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.
- package/CHANGELOG.md +12 -0
- package/build/webim-adapter.js +764 -540
- package/build/webim-embed.js +8 -8
- package/build/webim-ssr.js +689 -465
- package/package.json +9 -10
package/build/webim-ssr.js
CHANGED
|
@@ -1194,26 +1194,33 @@ function ct({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1194
1194
|
}
|
|
1195
1195
|
}) : null;
|
|
1196
1196
|
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1197
|
+
var lt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1198
|
+
function ut(e) {
|
|
1199
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(lt, "$1:scope")}\n}`;
|
|
1200
|
+
}
|
|
1201
|
+
function dt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
|
|
1202
|
+
let [o, s] = l(null);
|
|
1199
1203
|
return a(() => {
|
|
1200
|
-
|
|
1204
|
+
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1205
|
+
e.textContent = ut(e.textContent || "");
|
|
1206
|
+
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1201
1207
|
let t = document.createElement("script");
|
|
1202
1208
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
1203
1209
|
t.text = e.textContent, e.replaceWith(t);
|
|
1204
1210
|
}));
|
|
1205
1211
|
}, [
|
|
1206
|
-
|
|
1212
|
+
o,
|
|
1207
1213
|
e,
|
|
1208
|
-
t
|
|
1214
|
+
t,
|
|
1215
|
+
n
|
|
1209
1216
|
]), /* @__PURE__ */ d("div", {
|
|
1210
1217
|
ref: (e) => {
|
|
1211
|
-
|
|
1218
|
+
s(e), i && i(e);
|
|
1212
1219
|
},
|
|
1213
|
-
style: P(
|
|
1220
|
+
style: P(r)
|
|
1214
1221
|
});
|
|
1215
1222
|
}
|
|
1216
|
-
function
|
|
1223
|
+
function ft({ height: e, style: t, nodeRef: n }) {
|
|
1217
1224
|
return /* @__PURE__ */ d("div", {
|
|
1218
1225
|
ref: n,
|
|
1219
1226
|
style: {
|
|
@@ -1224,7 +1231,7 @@ function ut({ height: e, style: t, nodeRef: n }) {
|
|
|
1224
1231
|
}
|
|
1225
1232
|
});
|
|
1226
1233
|
}
|
|
1227
|
-
function
|
|
1234
|
+
function pt({ style: e, nodeRef: t }) {
|
|
1228
1235
|
return /* @__PURE__ */ d("div", {
|
|
1229
1236
|
ref: t,
|
|
1230
1237
|
style: {
|
|
@@ -1235,7 +1242,7 @@ function dt({ style: e, nodeRef: t }) {
|
|
|
1235
1242
|
}
|
|
1236
1243
|
});
|
|
1237
1244
|
}
|
|
1238
|
-
function
|
|
1245
|
+
function mt({ style: e, nodeRef: t }) {
|
|
1239
1246
|
return /* @__PURE__ */ d("div", {
|
|
1240
1247
|
ref: t,
|
|
1241
1248
|
style: {
|
|
@@ -1244,7 +1251,7 @@ function ft({ style: e, nodeRef: t }) {
|
|
|
1244
1251
|
}
|
|
1245
1252
|
});
|
|
1246
1253
|
}
|
|
1247
|
-
var
|
|
1254
|
+
var ht = {
|
|
1248
1255
|
position: "absolute",
|
|
1249
1256
|
top: "50%",
|
|
1250
1257
|
transform: "translateY(-50%)",
|
|
@@ -1261,7 +1268,7 @@ var pt = {
|
|
|
1261
1268
|
alignItems: "center",
|
|
1262
1269
|
justifyContent: "center",
|
|
1263
1270
|
padding: 0
|
|
1264
|
-
},
|
|
1271
|
+
}, gt = {
|
|
1265
1272
|
bottom: {
|
|
1266
1273
|
inset: "auto 0 0 0",
|
|
1267
1274
|
padding: "40px 24px 20px",
|
|
@@ -1280,8 +1287,8 @@ var pt = {
|
|
|
1280
1287
|
padding: 24,
|
|
1281
1288
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1282
1289
|
}
|
|
1283
|
-
},
|
|
1284
|
-
function
|
|
1290
|
+
}, _t = 48;
|
|
1291
|
+
function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1285
1292
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1286
1293
|
if (a(() => {
|
|
1287
1294
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1297,7 +1304,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1297
1304
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1298
1305
|
if (!_) return;
|
|
1299
1306
|
let { dx: e } = _;
|
|
1300
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1307
|
+
v(null), e < -48 ? b(y + 1) : e > _t && b(y - 1);
|
|
1301
1308
|
};
|
|
1302
1309
|
return /* @__PURE__ */ f("div", {
|
|
1303
1310
|
ref: c,
|
|
@@ -1346,7 +1353,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1346
1353
|
type: "button",
|
|
1347
1354
|
"aria-label": "Previous slide",
|
|
1348
1355
|
style: {
|
|
1349
|
-
...
|
|
1356
|
+
...ht,
|
|
1350
1357
|
left: 12
|
|
1351
1358
|
},
|
|
1352
1359
|
onClick: () => b(y - 1),
|
|
@@ -1356,7 +1363,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1356
1363
|
type: "button",
|
|
1357
1364
|
"aria-label": "Next slide",
|
|
1358
1365
|
style: {
|
|
1359
|
-
...
|
|
1366
|
+
...ht,
|
|
1360
1367
|
right: 12
|
|
1361
1368
|
},
|
|
1362
1369
|
onClick: () => b(y + 1),
|
|
@@ -1390,7 +1397,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1390
1397
|
] })]
|
|
1391
1398
|
});
|
|
1392
1399
|
}
|
|
1393
|
-
var
|
|
1400
|
+
var yt = (e, t) => ({
|
|
1394
1401
|
position: "absolute",
|
|
1395
1402
|
inset: 0,
|
|
1396
1403
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1398,18 +1405,18 @@ var _t = (e, t) => ({
|
|
|
1398
1405
|
backgroundSize: "cover",
|
|
1399
1406
|
backgroundPosition: "center"
|
|
1400
1407
|
});
|
|
1401
|
-
function
|
|
1402
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1408
|
+
function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1409
|
+
return e.length ? /* @__PURE__ */ d(vt, {
|
|
1403
1410
|
...r,
|
|
1404
1411
|
count: e.length,
|
|
1405
1412
|
renderSlide: (r) => {
|
|
1406
1413
|
let i = e[r];
|
|
1407
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1414
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1408
1415
|
style: {
|
|
1409
1416
|
position: "absolute",
|
|
1410
1417
|
color: "#fff",
|
|
1411
1418
|
textAlign: n,
|
|
1412
|
-
...
|
|
1419
|
+
...gt[t] ?? gt.bottom
|
|
1413
1420
|
},
|
|
1414
1421
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1415
1422
|
style: {
|
|
@@ -1429,13 +1436,13 @@ function vt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1429
1436
|
}
|
|
1430
1437
|
}) : null;
|
|
1431
1438
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1439
|
+
function xt({ slides: e = [], linked: t, ...n }) {
|
|
1440
|
+
return e.length ? /* @__PURE__ */ d(vt, {
|
|
1434
1441
|
...n,
|
|
1435
1442
|
count: e.length,
|
|
1436
1443
|
renderSlide: (n) => {
|
|
1437
1444
|
let r = e[n];
|
|
1438
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1445
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1439
1446
|
style: {
|
|
1440
1447
|
position: "absolute",
|
|
1441
1448
|
inset: 0,
|
|
@@ -1447,23 +1454,23 @@ function yt({ slides: e = [], linked: t, ...n }) {
|
|
|
1447
1454
|
}
|
|
1448
1455
|
}) : null;
|
|
1449
1456
|
}
|
|
1450
|
-
var
|
|
1451
|
-
let r =
|
|
1457
|
+
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) => {
|
|
1458
|
+
let r = St * 2 ** n;
|
|
1452
1459
|
return {
|
|
1453
1460
|
x: (Number(t) + 180) / 360 * r,
|
|
1454
|
-
y: (.5 -
|
|
1461
|
+
y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
|
|
1455
1462
|
};
|
|
1456
1463
|
}, $ = (e, t) => {
|
|
1457
1464
|
if (e === "" || e == null) return null;
|
|
1458
1465
|
let n = Number(e);
|
|
1459
1466
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1460
|
-
},
|
|
1461
|
-
function
|
|
1467
|
+
}, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1468
|
+
function Et(e, t, n = "directions", r = "") {
|
|
1462
1469
|
let i = `${e},${t}`;
|
|
1463
1470
|
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)}`;
|
|
1464
1471
|
}
|
|
1465
|
-
var
|
|
1466
|
-
function
|
|
1472
|
+
var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1473
|
+
function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1467
1474
|
let _ = c(null), [v, y] = l(1200);
|
|
1468
1475
|
a(() => {
|
|
1469
1476
|
let e = _.current;
|
|
@@ -1473,7 +1480,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1473
1480
|
let n = new ResizeObserver(t);
|
|
1474
1481
|
return n.observe(e), () => n.disconnect();
|
|
1475
1482
|
}, []);
|
|
1476
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1483
|
+
let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
|
|
1477
1484
|
lat: t,
|
|
1478
1485
|
lng: n
|
|
1479
1486
|
}) ? {
|
|
@@ -1485,7 +1492,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1485
1492
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1486
1493
|
if (b.length < 2) return 13;
|
|
1487
1494
|
for (let e = 19; e >= 1; e--) {
|
|
1488
|
-
let t = b.map((t) =>
|
|
1495
|
+
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));
|
|
1489
1496
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1490
1497
|
}
|
|
1491
1498
|
return 1;
|
|
@@ -1509,12 +1516,12 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1509
1516
|
},
|
|
1510
1517
|
children: "Set the coordinates in Settings"
|
|
1511
1518
|
});
|
|
1512
|
-
let T =
|
|
1519
|
+
let T = wt(x.lat, x.lng, C), E = {
|
|
1513
1520
|
x: T.x - v / 2,
|
|
1514
1521
|
y: T.y - S / 2
|
|
1515
1522
|
}, D = [], O = [];
|
|
1516
|
-
for (let e = Math.floor(E.x /
|
|
1517
|
-
for (let e = Math.floor(E.y /
|
|
1523
|
+
for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
|
|
1524
|
+
for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
|
|
1518
1525
|
let k = 2 ** C;
|
|
1519
1526
|
return /* @__PURE__ */ f("div", {
|
|
1520
1527
|
ref: (e) => {
|
|
@@ -1537,22 +1544,22 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1537
1544
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1538
1545
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1539
1546
|
alt: "",
|
|
1540
|
-
width:
|
|
1541
|
-
height:
|
|
1547
|
+
width: St,
|
|
1548
|
+
height: St,
|
|
1542
1549
|
loading: "lazy",
|
|
1543
1550
|
style: {
|
|
1544
1551
|
position: "absolute",
|
|
1545
|
-
left: Math.round(t *
|
|
1546
|
-
top: Math.round(e *
|
|
1547
|
-
width:
|
|
1548
|
-
height:
|
|
1552
|
+
left: Math.round(t * St - E.x),
|
|
1553
|
+
top: Math.round(e * St - E.y),
|
|
1554
|
+
width: St,
|
|
1555
|
+
height: St,
|
|
1549
1556
|
userSelect: "none",
|
|
1550
1557
|
pointerEvents: "none"
|
|
1551
1558
|
}
|
|
1552
1559
|
}, `${t}-${e}`);
|
|
1553
1560
|
})),
|
|
1554
1561
|
b.map((e, t) => {
|
|
1555
|
-
let n =
|
|
1562
|
+
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)", c = s === "none" || g ? null : Et($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1556
1563
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1557
1564
|
href: c || void 0,
|
|
1558
1565
|
target: c ? "_blank" : void 0,
|
|
@@ -1591,8 +1598,8 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1591
1598
|
viewBox: "0 0 24 24",
|
|
1592
1599
|
fill: a,
|
|
1593
1600
|
style: { display: "block" },
|
|
1594
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1595
|
-
d:
|
|
1601
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), kt[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1602
|
+
d: kt[e.icon],
|
|
1596
1603
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1597
1604
|
fill: "none",
|
|
1598
1605
|
stroke: "#fff",
|
|
@@ -1628,7 +1635,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1628
1635
|
})
|
|
1629
1636
|
]
|
|
1630
1637
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1631
|
-
href:
|
|
1638
|
+
href: Dt(x.lat, x.lng, C),
|
|
1632
1639
|
target: "_blank",
|
|
1633
1640
|
rel: "noopener noreferrer",
|
|
1634
1641
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1642,7 +1649,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1642
1649
|
}) : null]
|
|
1643
1650
|
});
|
|
1644
1651
|
}
|
|
1645
|
-
var
|
|
1652
|
+
var kt = {
|
|
1646
1653
|
check: "M4 12l5 5L20 6",
|
|
1647
1654
|
close: "M6 6l12 12M18 6L6 18",
|
|
1648
1655
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1739,8 +1746,8 @@ var Dt = {
|
|
|
1739
1746
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1740
1747
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1741
1748
|
};
|
|
1742
|
-
function
|
|
1743
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1749
|
+
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: u, inert: f }) {
|
|
1750
|
+
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__ */ d("svg", {
|
|
1744
1751
|
viewBox: "0 0 24 24",
|
|
1745
1752
|
width: g,
|
|
1746
1753
|
height: g,
|
|
@@ -1776,7 +1783,7 @@ function Ot({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1776
1783
|
children: v
|
|
1777
1784
|
});
|
|
1778
1785
|
}
|
|
1779
|
-
function
|
|
1786
|
+
function jt(e, t = {}, n = 0) {
|
|
1780
1787
|
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Ee(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1781
1788
|
for (let e of r) {
|
|
1782
1789
|
let n = e.data ?? e, r = we(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(we(n, t.nameField)) : i(n.name), l = t.hrefField ? i(we(n, t.hrefField)) : "";
|
|
@@ -1789,7 +1796,7 @@ function kt(e, t = {}, n = 0) {
|
|
|
1789
1796
|
}
|
|
1790
1797
|
return o;
|
|
1791
1798
|
}
|
|
1792
|
-
function
|
|
1799
|
+
function Mt({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1793
1800
|
let { tenant: x, apiUrl: S } = i(Y), C = i(xe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1794
1801
|
a(() => {
|
|
1795
1802
|
if (!t || C) return;
|
|
@@ -1807,7 +1814,7 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1807
1814
|
C
|
|
1808
1815
|
]);
|
|
1809
1816
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
|
|
1810
|
-
let e =
|
|
1817
|
+
let e = jt(k, {
|
|
1811
1818
|
imageField: r,
|
|
1812
1819
|
nameField: o,
|
|
1813
1820
|
hrefField: s
|
|
@@ -2012,19 +2019,19 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2012
2019
|
]
|
|
2013
2020
|
});
|
|
2014
2021
|
}
|
|
2015
|
-
var
|
|
2022
|
+
var Nt = {
|
|
2016
2023
|
color: "inherit",
|
|
2017
2024
|
textDecoration: "none",
|
|
2018
2025
|
fontSize: 14,
|
|
2019
2026
|
opacity: .85
|
|
2020
|
-
},
|
|
2027
|
+
}, Pt = {
|
|
2021
2028
|
background: "var(--page-surface, #f2f2f2)",
|
|
2022
2029
|
color: "var(--page-text, #111827)",
|
|
2023
2030
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2024
2031
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2025
2032
|
zIndex: 60
|
|
2026
2033
|
};
|
|
2027
|
-
function
|
|
2034
|
+
function Ft(e, t = {}, n = "dropdown") {
|
|
2028
2035
|
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 ? "" : Ee(e), o = r.map((e) => {
|
|
2029
2036
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2030
2037
|
return {
|
|
@@ -2066,7 +2073,7 @@ function Nt(e, t = {}, n = "dropdown") {
|
|
|
2066
2073
|
type: e.children.length ? n : "link"
|
|
2067
2074
|
}));
|
|
2068
2075
|
}
|
|
2069
|
-
function
|
|
2076
|
+
function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2070
2077
|
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Y), N = i(xe)?.[g], [F, I] = l(null);
|
|
2071
2078
|
a(() => {
|
|
2072
2079
|
if (!g || N) return;
|
|
@@ -2087,7 +2094,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2087
2094
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2088
2095
|
return e.observe(C), () => e.disconnect();
|
|
2089
2096
|
}, [C, h]);
|
|
2090
|
-
let L = g ?
|
|
2097
|
+
let L = g ? Ft(N ?? F ?? [], {
|
|
2091
2098
|
labelField: _,
|
|
2092
2099
|
hrefField: v,
|
|
2093
2100
|
imageField: y,
|
|
@@ -2116,7 +2123,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2116
2123
|
return /* @__PURE__ */ f("a", {
|
|
2117
2124
|
href: e.href || "#",
|
|
2118
2125
|
style: {
|
|
2119
|
-
...
|
|
2126
|
+
...Nt,
|
|
2120
2127
|
display: n ? "block" : "flex",
|
|
2121
2128
|
alignItems: n ? void 0 : "center",
|
|
2122
2129
|
gap: n ? void 0 : 10,
|
|
@@ -2213,7 +2220,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2213
2220
|
let t = e.children ?? [];
|
|
2214
2221
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2215
2222
|
href: e.href || "#",
|
|
2216
|
-
style:
|
|
2223
|
+
style: Nt,
|
|
2217
2224
|
children: e.label
|
|
2218
2225
|
}, e.key);
|
|
2219
2226
|
let n = e.type === "mega";
|
|
@@ -2227,7 +2234,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2227
2234
|
children: [/* @__PURE__ */ f("a", {
|
|
2228
2235
|
href: e.href || "#",
|
|
2229
2236
|
style: {
|
|
2230
|
-
...
|
|
2237
|
+
...Nt,
|
|
2231
2238
|
cursor: "pointer"
|
|
2232
2239
|
},
|
|
2233
2240
|
children: [
|
|
@@ -2243,7 +2250,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2243
2250
|
]
|
|
2244
2251
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2245
2252
|
style: {
|
|
2246
|
-
...
|
|
2253
|
+
...Pt,
|
|
2247
2254
|
position: "absolute",
|
|
2248
2255
|
left: 0,
|
|
2249
2256
|
right: 0,
|
|
@@ -2259,7 +2266,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2259
2266
|
}, !0))
|
|
2260
2267
|
}) : /* @__PURE__ */ d("div", {
|
|
2261
2268
|
style: {
|
|
2262
|
-
...
|
|
2269
|
+
...Pt,
|
|
2263
2270
|
position: "absolute",
|
|
2264
2271
|
top: "100%",
|
|
2265
2272
|
left: 0,
|
|
@@ -2288,7 +2295,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2288
2295
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2289
2296
|
href: e.href || "#",
|
|
2290
2297
|
style: {
|
|
2291
|
-
...
|
|
2298
|
+
...Nt,
|
|
2292
2299
|
padding: "10px 4px",
|
|
2293
2300
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2294
2301
|
opacity: 1
|
|
@@ -2299,7 +2306,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2299
2306
|
]
|
|
2300
2307
|
});
|
|
2301
2308
|
}
|
|
2302
|
-
function
|
|
2309
|
+
function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2303
2310
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2304
2311
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2305
2312
|
ref: r,
|
|
@@ -2339,13 +2346,13 @@ function Ft({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2339
2346
|
}, e.key))]
|
|
2340
2347
|
}) : null;
|
|
2341
2348
|
}
|
|
2342
|
-
function
|
|
2349
|
+
function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
|
|
2343
2350
|
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2344
2351
|
if (!e.length) return null;
|
|
2345
2352
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2346
2353
|
let n = Number(e);
|
|
2347
2354
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2348
|
-
}, b =
|
|
2355
|
+
}, b = kt[r], x = (e) => _((t) => {
|
|
2349
2356
|
let r = new Set(n ? t : []);
|
|
2350
2357
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2351
2358
|
});
|
|
@@ -2420,15 +2427,15 @@ function It({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2420
2427
|
})
|
|
2421
2428
|
});
|
|
2422
2429
|
}
|
|
2423
|
-
var
|
|
2430
|
+
var zt = {
|
|
2424
2431
|
display: "flex",
|
|
2425
2432
|
flexDirection: "column",
|
|
2426
2433
|
gap: "12px"
|
|
2427
|
-
},
|
|
2434
|
+
}, Bt = {
|
|
2428
2435
|
fontSize: "14px",
|
|
2429
2436
|
fontWeight: 500,
|
|
2430
2437
|
color: "var(--page-text, #111827)"
|
|
2431
|
-
},
|
|
2438
|
+
}, Vt = {
|
|
2432
2439
|
padding: "10px 12px",
|
|
2433
2440
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2434
2441
|
borderRadius: "6px",
|
|
@@ -2438,18 +2445,18 @@ var Lt = {
|
|
|
2438
2445
|
boxSizing: "border-box",
|
|
2439
2446
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2440
2447
|
color: "var(--page-text, #111827)"
|
|
2441
|
-
},
|
|
2448
|
+
}, Ht = {
|
|
2442
2449
|
display: "flex",
|
|
2443
2450
|
alignItems: "center",
|
|
2444
2451
|
gap: "8px",
|
|
2445
2452
|
fontSize: "14px",
|
|
2446
2453
|
color: "var(--page-text, #111827)"
|
|
2447
|
-
},
|
|
2454
|
+
}, Ut = (e) => e ? {
|
|
2448
2455
|
readOnly: !0,
|
|
2449
2456
|
tabIndex: -1,
|
|
2450
2457
|
onMouseDown: (e) => e.preventDefault()
|
|
2451
2458
|
} : {};
|
|
2452
|
-
function
|
|
2459
|
+
function Wt(e, t) {
|
|
2453
2460
|
if (!e) return !0;
|
|
2454
2461
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2455
2462
|
switch (e.op) {
|
|
@@ -2463,11 +2470,11 @@ function Ht(e, t) {
|
|
|
2463
2470
|
default: return !1;
|
|
2464
2471
|
}
|
|
2465
2472
|
}
|
|
2466
|
-
var
|
|
2473
|
+
var Gt = {
|
|
2467
2474
|
display: "flex",
|
|
2468
2475
|
flexDirection: "column",
|
|
2469
2476
|
gap: 6
|
|
2470
|
-
},
|
|
2477
|
+
}, Kt = {
|
|
2471
2478
|
font: "inherit",
|
|
2472
2479
|
fontSize: 15,
|
|
2473
2480
|
padding: "10px 12px",
|
|
@@ -2478,17 +2485,17 @@ var Ut = {
|
|
|
2478
2485
|
width: "100%",
|
|
2479
2486
|
boxSizing: "border-box"
|
|
2480
2487
|
};
|
|
2481
|
-
function
|
|
2488
|
+
function qt(e, t) {
|
|
2482
2489
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2483
2490
|
if (!e?.parentField) return n;
|
|
2484
2491
|
let r = t?.[e.parentField];
|
|
2485
2492
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2486
2493
|
}
|
|
2487
|
-
var
|
|
2488
|
-
function
|
|
2494
|
+
var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
|
|
2495
|
+
function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2489
2496
|
let a = /* @__PURE__ */ f("span", {
|
|
2490
2497
|
style: {
|
|
2491
|
-
...
|
|
2498
|
+
...Bt,
|
|
2492
2499
|
fontSize: 14
|
|
2493
2500
|
},
|
|
2494
2501
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2497,7 +2504,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2497
2504
|
required: e.required || void 0,
|
|
2498
2505
|
placeholder: e.placeholder || void 0,
|
|
2499
2506
|
disabled: r || void 0,
|
|
2500
|
-
style:
|
|
2507
|
+
style: Kt,
|
|
2501
2508
|
value: t ?? "",
|
|
2502
2509
|
onChange: (t) => n(e.name, t.target.value)
|
|
2503
2510
|
};
|
|
@@ -2526,11 +2533,11 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2526
2533
|
borderRadius: 8,
|
|
2527
2534
|
display: "block"
|
|
2528
2535
|
}
|
|
2529
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2536
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(tn, {
|
|
2530
2537
|
theme: e.captchaTheme,
|
|
2531
2538
|
size: e.captchaSize,
|
|
2532
2539
|
inert: r,
|
|
2533
|
-
onChange: (e) => n(
|
|
2540
|
+
onChange: (e) => n(Jt, e)
|
|
2534
2541
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(st, {
|
|
2535
2542
|
url: e.src,
|
|
2536
2543
|
style: { width: "100%" }
|
|
@@ -2543,14 +2550,14 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2543
2550
|
display: "block"
|
|
2544
2551
|
}
|
|
2545
2552
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2546
|
-
style:
|
|
2553
|
+
style: Gt,
|
|
2547
2554
|
children: [
|
|
2548
2555
|
a,
|
|
2549
2556
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2550
2557
|
...o,
|
|
2551
2558
|
rows: 4,
|
|
2552
2559
|
style: {
|
|
2553
|
-
...
|
|
2560
|
+
...Kt,
|
|
2554
2561
|
resize: "vertical"
|
|
2555
2562
|
}
|
|
2556
2563
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2559,7 +2566,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2559
2566
|
children: [/* @__PURE__ */ d("option", {
|
|
2560
2567
|
value: "",
|
|
2561
2568
|
children: e.placeholder || "—"
|
|
2562
|
-
}),
|
|
2569
|
+
}), qt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2563
2570
|
value: typeof e == "string" ? e : e.value,
|
|
2564
2571
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2565
2572
|
}, t))]
|
|
@@ -2606,7 +2613,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2606
2613
|
]
|
|
2607
2614
|
});
|
|
2608
2615
|
}
|
|
2609
|
-
function
|
|
2616
|
+
function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2610
2617
|
let { tenant: y, apiUrl: b } = i(Y), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2611
2618
|
a(() => {
|
|
2612
2619
|
if (!c || !s) return;
|
|
@@ -2628,11 +2635,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2628
2635
|
section: e,
|
|
2629
2636
|
fields: []
|
|
2630
2637
|
}) : A[A.length - 1].fields.push(e);
|
|
2631
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
2638
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
|
|
2632
2639
|
...e,
|
|
2633
|
-
fields: e.fields.filter((e) =>
|
|
2640
|
+
fields: e.fields.filter((e) => Wt(e.condition, T))
|
|
2634
2641
|
})), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2635
|
-
let t = T[
|
|
2642
|
+
let t = T[Yt(e)];
|
|
2636
2643
|
return e.required && (t == null || t === "" || t === !1);
|
|
2637
2644
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2638
2645
|
let r = {
|
|
@@ -2688,11 +2695,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2688
2695
|
}
|
|
2689
2696
|
},
|
|
2690
2697
|
style: {
|
|
2691
|
-
...
|
|
2698
|
+
...zt,
|
|
2692
2699
|
display: k === "success" ? "none" : "flex"
|
|
2693
2700
|
},
|
|
2694
2701
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2695
|
-
N && /* @__PURE__ */ d(
|
|
2702
|
+
N && /* @__PURE__ */ d(jn, {
|
|
2696
2703
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2697
2704
|
active: F + 1,
|
|
2698
2705
|
style: { marginBottom: 8 }
|
|
@@ -2705,9 +2712,9 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2705
2712
|
},
|
|
2706
2713
|
children: M[F].section.help
|
|
2707
2714
|
}),
|
|
2708
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
2715
|
+
I.map((e) => /* @__PURE__ */ d(Xt, {
|
|
2709
2716
|
field: e,
|
|
2710
|
-
value: T[
|
|
2717
|
+
value: T[Yt(e)],
|
|
2711
2718
|
values: T,
|
|
2712
2719
|
onChange: z,
|
|
2713
2720
|
inert: h
|
|
@@ -2778,10 +2785,10 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2778
2785
|
]
|
|
2779
2786
|
});
|
|
2780
2787
|
}
|
|
2781
|
-
var
|
|
2788
|
+
var Qt = null, $t = null, en = (e) => {
|
|
2782
2789
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2783
|
-
if (
|
|
2784
|
-
if (
|
|
2790
|
+
if (Qt && $t === t) return Qt;
|
|
2791
|
+
if (Qt && typeof window < "u") {
|
|
2785
2792
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2786
2793
|
delete window[e];
|
|
2787
2794
|
} catch {
|
|
@@ -2789,22 +2796,22 @@ var Xt = null, Zt = null, Qt = (e) => {
|
|
|
2789
2796
|
}
|
|
2790
2797
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2791
2798
|
}
|
|
2792
|
-
return
|
|
2799
|
+
return $t = t, Qt = new Promise((e) => {
|
|
2793
2800
|
if (typeof window > "u") return;
|
|
2794
2801
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2795
2802
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2796
2803
|
let n = document.createElement("script");
|
|
2797
2804
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2798
|
-
}),
|
|
2805
|
+
}), Qt;
|
|
2799
2806
|
};
|
|
2800
|
-
function
|
|
2807
|
+
function tn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2801
2808
|
let p = i(Y), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2802
2809
|
if (_.current = u, a(() => {
|
|
2803
2810
|
if (l || !h || !g.current) return;
|
|
2804
2811
|
let e = !0, i = (t) => {
|
|
2805
2812
|
e && typeof _.current == "function" && _.current(t);
|
|
2806
2813
|
};
|
|
2807
|
-
return
|
|
2814
|
+
return en(r).then((r) => {
|
|
2808
2815
|
if (!(!e || !g.current || !r?.render)) {
|
|
2809
2816
|
g.current.innerHTML = "", i("");
|
|
2810
2817
|
try {
|
|
@@ -2886,17 +2893,17 @@ function $t({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2886
2893
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2887
2894
|
}) : null;
|
|
2888
2895
|
}
|
|
2889
|
-
function
|
|
2896
|
+
function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2890
2897
|
return /* @__PURE__ */ d("label", {
|
|
2891
2898
|
ref: r,
|
|
2892
2899
|
style: {
|
|
2893
|
-
...
|
|
2900
|
+
...Bt,
|
|
2894
2901
|
...P(n)
|
|
2895
2902
|
},
|
|
2896
2903
|
children: Ue(t, e, i)
|
|
2897
2904
|
});
|
|
2898
2905
|
}
|
|
2899
|
-
function
|
|
2906
|
+
function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2900
2907
|
return /* @__PURE__ */ d("input", {
|
|
2901
2908
|
ref: a,
|
|
2902
2909
|
type: e,
|
|
@@ -2904,13 +2911,13 @@ function tn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2904
2911
|
placeholder: n,
|
|
2905
2912
|
required: !o && !!r,
|
|
2906
2913
|
style: {
|
|
2907
|
-
...
|
|
2914
|
+
...Vt,
|
|
2908
2915
|
...P(i)
|
|
2909
2916
|
},
|
|
2910
|
-
...
|
|
2917
|
+
...Ut(o)
|
|
2911
2918
|
});
|
|
2912
2919
|
}
|
|
2913
|
-
function
|
|
2920
|
+
function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2914
2921
|
return /* @__PURE__ */ d("textarea", {
|
|
2915
2922
|
ref: a,
|
|
2916
2923
|
name: e || void 0,
|
|
@@ -2918,18 +2925,18 @@ function nn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2918
2925
|
rows: n,
|
|
2919
2926
|
required: !o && !!r,
|
|
2920
2927
|
style: {
|
|
2921
|
-
...
|
|
2928
|
+
...Vt,
|
|
2922
2929
|
resize: "vertical",
|
|
2923
2930
|
...P(i)
|
|
2924
2931
|
},
|
|
2925
|
-
...
|
|
2932
|
+
...Ut(o)
|
|
2926
2933
|
});
|
|
2927
2934
|
}
|
|
2928
|
-
function
|
|
2935
|
+
function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2929
2936
|
return /* @__PURE__ */ f("label", {
|
|
2930
2937
|
ref: o,
|
|
2931
2938
|
style: {
|
|
2932
|
-
...
|
|
2939
|
+
...Ht,
|
|
2933
2940
|
...P(a)
|
|
2934
2941
|
},
|
|
2935
2942
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2946,7 +2953,7 @@ function rn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2946
2953
|
}), t]
|
|
2947
2954
|
});
|
|
2948
2955
|
}
|
|
2949
|
-
function
|
|
2956
|
+
function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2950
2957
|
return /* @__PURE__ */ f("select", {
|
|
2951
2958
|
ref: a,
|
|
2952
2959
|
name: e || void 0,
|
|
@@ -2955,7 +2962,7 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2955
2962
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2956
2963
|
tabIndex: o ? -1 : void 0,
|
|
2957
2964
|
style: {
|
|
2958
|
-
...
|
|
2965
|
+
...Vt,
|
|
2959
2966
|
appearance: "auto",
|
|
2960
2967
|
...P(i)
|
|
2961
2968
|
},
|
|
@@ -2969,12 +2976,12 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2969
2976
|
}, t))]
|
|
2970
2977
|
});
|
|
2971
2978
|
}
|
|
2972
|
-
function
|
|
2979
|
+
function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2973
2980
|
let [s, c] = l(null);
|
|
2974
2981
|
return /* @__PURE__ */ f("label", {
|
|
2975
2982
|
ref: a,
|
|
2976
2983
|
style: {
|
|
2977
|
-
...
|
|
2984
|
+
...Vt,
|
|
2978
2985
|
display: "flex",
|
|
2979
2986
|
alignItems: "center",
|
|
2980
2987
|
gap: "8px",
|
|
@@ -3001,7 +3008,7 @@ function on({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3001
3008
|
]
|
|
3002
3009
|
});
|
|
3003
3010
|
}
|
|
3004
|
-
function
|
|
3011
|
+
function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3005
3012
|
return /* @__PURE__ */ d("button", {
|
|
3006
3013
|
ref: n,
|
|
3007
3014
|
type: r ? "button" : "submit",
|
|
@@ -3021,7 +3028,7 @@ function sn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3021
3028
|
children: e
|
|
3022
3029
|
});
|
|
3023
3030
|
}
|
|
3024
|
-
function
|
|
3031
|
+
function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3025
3032
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3026
3033
|
return /* @__PURE__ */ d("div", {
|
|
3027
3034
|
ref: r,
|
|
@@ -3038,7 +3045,7 @@ function cn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3038
3045
|
}, t))
|
|
3039
3046
|
});
|
|
3040
3047
|
}
|
|
3041
|
-
function
|
|
3048
|
+
function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3042
3049
|
let { tenant: v, apiUrl: y, locale: b } = i(Y), x = i(Q), S = i(xe), [, C] = l(0);
|
|
3043
3050
|
a(() => {
|
|
3044
3051
|
if (typeof window > "u") return;
|
|
@@ -3157,7 +3164,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3157
3164
|
})
|
|
3158
3165
|
});
|
|
3159
3166
|
}
|
|
3160
|
-
function
|
|
3167
|
+
function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3161
3168
|
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : X(), s = {
|
|
3162
3169
|
height: 34,
|
|
3163
3170
|
padding: "0 12px",
|
|
@@ -3206,7 +3213,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3206
3213
|
name: `f_${e.name}`,
|
|
3207
3214
|
defaultValue: o[e.name] ?? "",
|
|
3208
3215
|
style: s,
|
|
3209
|
-
...
|
|
3216
|
+
...Ut(i),
|
|
3210
3217
|
children: [/* @__PURE__ */ d("option", {
|
|
3211
3218
|
value: "",
|
|
3212
3219
|
children: e.label || e.name
|
|
@@ -3221,7 +3228,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3221
3228
|
name: `f_${e.name}`,
|
|
3222
3229
|
defaultValue: o[e.name] ?? "",
|
|
3223
3230
|
style: s,
|
|
3224
|
-
...
|
|
3231
|
+
...Ut(i),
|
|
3225
3232
|
children: [
|
|
3226
3233
|
/* @__PURE__ */ d("option", {
|
|
3227
3234
|
value: "",
|
|
@@ -3242,7 +3249,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3242
3249
|
defaultValue: o[e.name] ?? "",
|
|
3243
3250
|
placeholder: e.label || e.name,
|
|
3244
3251
|
style: s,
|
|
3245
|
-
...
|
|
3252
|
+
...Ut(i)
|
|
3246
3253
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3247
3254
|
type: "submit",
|
|
3248
3255
|
style: {
|
|
@@ -3255,12 +3262,12 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3255
3262
|
fontWeight: 600,
|
|
3256
3263
|
cursor: i ? "default" : "pointer"
|
|
3257
3264
|
},
|
|
3258
|
-
...
|
|
3265
|
+
...Ut(i),
|
|
3259
3266
|
children: t
|
|
3260
3267
|
})]
|
|
3261
3268
|
});
|
|
3262
3269
|
}
|
|
3263
|
-
function
|
|
3270
|
+
function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3264
3271
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3265
3272
|
ref: r,
|
|
3266
3273
|
"aria-label": "Breadcrumb",
|
|
@@ -3310,7 +3317,7 @@ function dn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3310
3317
|
})
|
|
3311
3318
|
}) : null;
|
|
3312
3319
|
}
|
|
3313
|
-
function
|
|
3320
|
+
function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
3314
3321
|
let { tenant: g, apiUrl: _ } = i(Y), v = i(xe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3315
3322
|
a(() => {
|
|
3316
3323
|
if (!o || Number.isFinite(x)) return;
|
|
@@ -3395,15 +3402,15 @@ function fn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3395
3402
|
]
|
|
3396
3403
|
});
|
|
3397
3404
|
}
|
|
3398
|
-
var
|
|
3405
|
+
var hn = "webim.page_mode", gn = () => {
|
|
3399
3406
|
if (typeof window > "u") return "auto";
|
|
3400
3407
|
try {
|
|
3401
|
-
let e = window.localStorage.getItem(
|
|
3408
|
+
let e = window.localStorage.getItem(hn);
|
|
3402
3409
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3403
3410
|
} catch {
|
|
3404
3411
|
return "auto";
|
|
3405
3412
|
}
|
|
3406
|
-
},
|
|
3413
|
+
}, _n = (e) => {
|
|
3407
3414
|
let t = {
|
|
3408
3415
|
width: 16,
|
|
3409
3416
|
height: 16,
|
|
@@ -3435,13 +3442,13 @@ var pn = "webim.page_mode", mn = () => {
|
|
|
3435
3442
|
rx: "2"
|
|
3436
3443
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3437
3444
|
});
|
|
3438
|
-
},
|
|
3445
|
+
}, vn = {
|
|
3439
3446
|
light: "Light theme",
|
|
3440
3447
|
dark: "Dark theme",
|
|
3441
3448
|
auto: "Follow the device theme"
|
|
3442
3449
|
};
|
|
3443
|
-
function
|
|
3444
|
-
let [o, s] = l(i ? "auto" :
|
|
3450
|
+
function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3451
|
+
let [o, s] = l(i ? "auto" : gn), u = c(null), f = (e) => {
|
|
3445
3452
|
u.current = e, typeof r == "function" && r(e);
|
|
3446
3453
|
};
|
|
3447
3454
|
a(() => {
|
|
@@ -3449,7 +3456,7 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3449
3456
|
let e = u.current?.closest?.(".webim-page");
|
|
3450
3457
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3451
3458
|
try {
|
|
3452
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3459
|
+
o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
|
|
3453
3460
|
} catch {}
|
|
3454
3461
|
}, [o, i]);
|
|
3455
3462
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3484,8 +3491,8 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3484
3491
|
},
|
|
3485
3492
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3486
3493
|
type: "button",
|
|
3487
|
-
title:
|
|
3488
|
-
"aria-label":
|
|
3494
|
+
title: vn[e],
|
|
3495
|
+
"aria-label": vn[e],
|
|
3489
3496
|
"aria-pressed": e === m,
|
|
3490
3497
|
onClick: i ? void 0 : () => s(e),
|
|
3491
3498
|
style: {
|
|
@@ -3496,15 +3503,15 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3496
3503
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3497
3504
|
opacity: e === m ? 1 : .7
|
|
3498
3505
|
},
|
|
3499
|
-
children:
|
|
3506
|
+
children: _n(e)
|
|
3500
3507
|
}, e))
|
|
3501
3508
|
});
|
|
3502
3509
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3503
3510
|
return /* @__PURE__ */ d("button", {
|
|
3504
3511
|
ref: f,
|
|
3505
3512
|
type: "button",
|
|
3506
|
-
title:
|
|
3507
|
-
"aria-label": `Theme: ${
|
|
3513
|
+
title: vn[m],
|
|
3514
|
+
"aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
|
|
3508
3515
|
onClick: i ? void 0 : () => s(g),
|
|
3509
3516
|
style: {
|
|
3510
3517
|
...h,
|
|
@@ -3513,10 +3520,10 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3513
3520
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3514
3521
|
...P(n)
|
|
3515
3522
|
},
|
|
3516
|
-
children:
|
|
3523
|
+
children: _n(m)
|
|
3517
3524
|
});
|
|
3518
3525
|
}
|
|
3519
|
-
function
|
|
3526
|
+
function bn(e) {
|
|
3520
3527
|
let t = e?.parentElement;
|
|
3521
3528
|
for (; t && t !== document.body;) {
|
|
3522
3529
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3525,7 +3532,7 @@ function vn(e) {
|
|
|
3525
3532
|
}
|
|
3526
3533
|
return window;
|
|
3527
3534
|
}
|
|
3528
|
-
var
|
|
3535
|
+
var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
3529
3536
|
"bottom-right": (e) => ({
|
|
3530
3537
|
right: e,
|
|
3531
3538
|
bottom: e
|
|
@@ -3539,8 +3546,122 @@ var yn = (e) => e === window ? window.scrollY : e.scrollTop, bn = {
|
|
|
3539
3546
|
bottom: e,
|
|
3540
3547
|
transform: "translateX(-50%)"
|
|
3541
3548
|
})
|
|
3549
|
+
}, Cn = {
|
|
3550
|
+
linear: (e) => e,
|
|
3551
|
+
out: (e) => 1 - (1 - e) ** 3,
|
|
3552
|
+
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3553
|
+
}, wn = (e) => {
|
|
3554
|
+
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3555
|
+
for (; n && n !== document.body;) {
|
|
3556
|
+
let e = getComputedStyle(n);
|
|
3557
|
+
if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) break;
|
|
3558
|
+
n = n.parentElement;
|
|
3559
|
+
}
|
|
3560
|
+
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);
|
|
3561
|
+
}, Tn = (e, t) => {
|
|
3562
|
+
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3563
|
+
return Number.isFinite(n) ? n : t;
|
|
3542
3564
|
};
|
|
3543
|
-
function
|
|
3565
|
+
function En(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3566
|
+
let i = Math.min(Math.max(Math.round(Tn(n, 0)), 0), 6);
|
|
3567
|
+
try {
|
|
3568
|
+
return new Intl.NumberFormat(t || void 0, {
|
|
3569
|
+
minimumFractionDigits: i,
|
|
3570
|
+
maximumFractionDigits: i,
|
|
3571
|
+
useGrouping: r !== "none"
|
|
3572
|
+
}).format(e);
|
|
3573
|
+
} catch {
|
|
3574
|
+
return e.toFixed(i);
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suffix: u, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3578
|
+
let { locale: C } = i(Y), w = Math.max(Tn(g, 0), 0), T = Tn(e, 0), E = Tn(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
|
|
3579
|
+
return a(() => {
|
|
3580
|
+
let e = k.current;
|
|
3581
|
+
if (S || !A || !e) {
|
|
3582
|
+
O(E);
|
|
3583
|
+
return;
|
|
3584
|
+
}
|
|
3585
|
+
O(T);
|
|
3586
|
+
let t = Math.max(Tn(n, 2e3), 0), i = Math.max(Tn(r, 0), 0), a = Cn[m] || Cn.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3587
|
+
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3588
|
+
O(E);
|
|
3589
|
+
return;
|
|
3590
|
+
}
|
|
3591
|
+
c = setTimeout(() => {
|
|
3592
|
+
let e = performance.now(), n = (r) => {
|
|
3593
|
+
let i = Math.min((r - e) / t, 1);
|
|
3594
|
+
O(T + (E - T) * a(i)), i < 1 && (s = requestAnimationFrame(n));
|
|
3595
|
+
};
|
|
3596
|
+
s = requestAnimationFrame(n);
|
|
3597
|
+
}, i);
|
|
3598
|
+
};
|
|
3599
|
+
if (h === "load" || typeof IntersectionObserver > "u") return u(), () => {
|
|
3600
|
+
cancelAnimationFrame(s), clearTimeout(c);
|
|
3601
|
+
};
|
|
3602
|
+
let d = new IntersectionObserver((e) => {
|
|
3603
|
+
let t = e.some((e) => e.isIntersecting);
|
|
3604
|
+
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3605
|
+
}, {
|
|
3606
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(wn(e)))}px 0px`,
|
|
3607
|
+
threshold: w > 0 ? 0 : .3
|
|
3608
|
+
});
|
|
3609
|
+
return d.observe(e), () => {
|
|
3610
|
+
d.disconnect(), cancelAnimationFrame(s), clearTimeout(c);
|
|
3611
|
+
};
|
|
3612
|
+
}, [
|
|
3613
|
+
A,
|
|
3614
|
+
S,
|
|
3615
|
+
T,
|
|
3616
|
+
E,
|
|
3617
|
+
n,
|
|
3618
|
+
r,
|
|
3619
|
+
m,
|
|
3620
|
+
h,
|
|
3621
|
+
w,
|
|
3622
|
+
_
|
|
3623
|
+
]), /* @__PURE__ */ f("div", {
|
|
3624
|
+
ref: (e) => {
|
|
3625
|
+
k.current = e, e && j(!0), typeof x == "function" && x(e);
|
|
3626
|
+
},
|
|
3627
|
+
"data-wb-counter": "",
|
|
3628
|
+
style: {
|
|
3629
|
+
display: "flex",
|
|
3630
|
+
flexDirection: "column",
|
|
3631
|
+
alignItems: y === "left" ? "flex-start" : y === "right" ? "flex-end" : "center",
|
|
3632
|
+
gap: 4,
|
|
3633
|
+
fontSize: 48,
|
|
3634
|
+
fontWeight: 700,
|
|
3635
|
+
lineHeight: 1.1,
|
|
3636
|
+
textAlign: y === "left" ? "left" : y === "right" ? "right" : "center",
|
|
3637
|
+
...P(b)
|
|
3638
|
+
},
|
|
3639
|
+
children: [/* @__PURE__ */ f("span", {
|
|
3640
|
+
style: {
|
|
3641
|
+
fontVariantNumeric: "tabular-nums",
|
|
3642
|
+
whiteSpace: "nowrap"
|
|
3643
|
+
},
|
|
3644
|
+
children: [
|
|
3645
|
+
s || "",
|
|
3646
|
+
En(D, {
|
|
3647
|
+
locale: C,
|
|
3648
|
+
decimals: o,
|
|
3649
|
+
separator: p
|
|
3650
|
+
}),
|
|
3651
|
+
u || ""
|
|
3652
|
+
]
|
|
3653
|
+
}), v ? /* @__PURE__ */ d("span", {
|
|
3654
|
+
style: {
|
|
3655
|
+
fontSize: "0.3em",
|
|
3656
|
+
fontWeight: 400,
|
|
3657
|
+
lineHeight: 1.4,
|
|
3658
|
+
opacity: .72
|
|
3659
|
+
},
|
|
3660
|
+
children: v
|
|
3661
|
+
}) : null]
|
|
3662
|
+
});
|
|
3663
|
+
}
|
|
3664
|
+
function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3544
3665
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3545
3666
|
b(e), typeof p == "function" && p(e);
|
|
3546
3667
|
};
|
|
@@ -3551,8 +3672,8 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3551
3672
|
}
|
|
3552
3673
|
if (!y) return;
|
|
3553
3674
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3554
|
-
let t =
|
|
3555
|
-
v(n ||
|
|
3675
|
+
let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3676
|
+
v(n || xn(t) > e);
|
|
3556
3677
|
};
|
|
3557
3678
|
return t(), document.addEventListener("scroll", t, {
|
|
3558
3679
|
capture: !0,
|
|
@@ -3566,7 +3687,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3566
3687
|
]);
|
|
3567
3688
|
let S = () => {
|
|
3568
3689
|
if (m) return;
|
|
3569
|
-
let e =
|
|
3690
|
+
let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3570
3691
|
e === window ? window.scrollTo({
|
|
3571
3692
|
top: 0,
|
|
3572
3693
|
behavior: n
|
|
@@ -3574,7 +3695,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3574
3695
|
top: 0,
|
|
3575
3696
|
behavior: n
|
|
3576
3697
|
});
|
|
3577
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3698
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
|
|
3578
3699
|
position: "fixed",
|
|
3579
3700
|
zIndex: 5,
|
|
3580
3701
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3587,7 +3708,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3587
3708
|
} : {
|
|
3588
3709
|
position: "fixed",
|
|
3589
3710
|
zIndex: 2147482e3,
|
|
3590
|
-
...
|
|
3711
|
+
...Sn[E](C)
|
|
3591
3712
|
};
|
|
3592
3713
|
return /* @__PURE__ */ f("button", {
|
|
3593
3714
|
ref: x,
|
|
@@ -3638,7 +3759,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3638
3759
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3639
3760
|
});
|
|
3640
3761
|
}
|
|
3641
|
-
var
|
|
3762
|
+
var kn = {
|
|
3642
3763
|
facebook: {
|
|
3643
3764
|
label: "Facebook",
|
|
3644
3765
|
color: "#1877f2",
|
|
@@ -3705,8 +3826,8 @@ var Sn = {
|
|
|
3705
3826
|
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"
|
|
3706
3827
|
}
|
|
3707
3828
|
};
|
|
3708
|
-
function
|
|
3709
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3829
|
+
function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3830
|
+
let l = Array.isArray(e) ? e.filter((e) => e && kn[e.network]) : [];
|
|
3710
3831
|
if (!l.length) return null;
|
|
3711
3832
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3712
3833
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3719,7 +3840,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3719
3840
|
...P(o)
|
|
3720
3841
|
},
|
|
3721
3842
|
children: l.map((e, r) => {
|
|
3722
|
-
let i =
|
|
3843
|
+
let i = kn[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);
|
|
3723
3844
|
return /* @__PURE__ */ d("a", {
|
|
3724
3845
|
href: e.url || "#",
|
|
3725
3846
|
onClick: h,
|
|
@@ -3753,7 +3874,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3753
3874
|
})
|
|
3754
3875
|
});
|
|
3755
3876
|
}
|
|
3756
|
-
function
|
|
3877
|
+
function jn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3757
3878
|
if (!e.length) return null;
|
|
3758
3879
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3759
3880
|
width: 32,
|
|
@@ -3831,7 +3952,7 @@ function wn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3831
3952
|
})
|
|
3832
3953
|
});
|
|
3833
3954
|
}
|
|
3834
|
-
var
|
|
3955
|
+
var Mn = {
|
|
3835
3956
|
small: {
|
|
3836
3957
|
w: 132,
|
|
3837
3958
|
h: 46,
|
|
@@ -3853,21 +3974,21 @@ var Tn = {
|
|
|
3853
3974
|
title: 12.5,
|
|
3854
3975
|
avatar: 46
|
|
3855
3976
|
}
|
|
3856
|
-
},
|
|
3857
|
-
|
|
3858
|
-
var
|
|
3977
|
+
}, Nn = (e) => Mn[e] ?? Mn.medium;
|
|
3978
|
+
Mn.medium.w, Mn.medium.h;
|
|
3979
|
+
var Pn = (e) => String(e?.group ?? "").trim(), Fn = (e) => {
|
|
3859
3980
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3860
3981
|
return e.forEach((e, r) => {
|
|
3861
|
-
let i =
|
|
3982
|
+
let i = Pn(e) || `#${r}`;
|
|
3862
3983
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3863
3984
|
}), t.flatMap((e) => n.get(e));
|
|
3864
3985
|
};
|
|
3865
|
-
function
|
|
3866
|
-
let i =
|
|
3986
|
+
function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3987
|
+
let i = Nn(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 = [];
|
|
3867
3988
|
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);
|
|
3868
|
-
d =
|
|
3869
|
-
for (let [e, t] of u) u.set(e,
|
|
3870
|
-
let f = (e, t) => o + (
|
|
3989
|
+
d = Fn(d);
|
|
3990
|
+
for (let [e, t] of u) u.set(e, Fn(t));
|
|
3991
|
+
let f = (e, t) => o + (Pn(e) !== Pn(t) && (Pn(e) || Pn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3871
3992
|
if (t.has(e.id)) return 0;
|
|
3872
3993
|
t.add(e.id);
|
|
3873
3994
|
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);
|
|
@@ -3883,7 +4004,7 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3883
4004
|
x: m,
|
|
3884
4005
|
y: b
|
|
3885
4006
|
});
|
|
3886
|
-
let x =
|
|
4007
|
+
let x = Pn(e);
|
|
3887
4008
|
if (x) {
|
|
3888
4009
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3889
4010
|
_.has(t) || _.set(t, {
|
|
@@ -3957,18 +4078,18 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3957
4078
|
horizontal: n
|
|
3958
4079
|
};
|
|
3959
4080
|
}
|
|
3960
|
-
var
|
|
4081
|
+
var Ln = (e, t) => {
|
|
3961
4082
|
let n = String(e ?? "");
|
|
3962
4083
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3963
|
-
},
|
|
4084
|
+
}, Rn = (e) => {
|
|
3964
4085
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3965
4086
|
if (!t) return "#ffffff";
|
|
3966
4087
|
let n = t[1];
|
|
3967
4088
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3968
4089
|
let r = parseInt(n, 16);
|
|
3969
4090
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3970
|
-
},
|
|
3971
|
-
function
|
|
4091
|
+
}, zn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4092
|
+
function Bn(e, t = {}) {
|
|
3972
4093
|
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 ? "" : Ee(e);
|
|
3973
4094
|
return n.map((e) => {
|
|
3974
4095
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -3984,11 +4105,11 @@ function Nn(e, t = {}) {
|
|
|
3984
4105
|
};
|
|
3985
4106
|
});
|
|
3986
4107
|
}
|
|
3987
|
-
var
|
|
4108
|
+
var Vn = {
|
|
3988
4109
|
size: 36,
|
|
3989
4110
|
pad: 10
|
|
3990
4111
|
};
|
|
3991
|
-
function
|
|
4112
|
+
function Hn({ node: e, onClose: t }) {
|
|
3992
4113
|
return a(() => {
|
|
3993
4114
|
let e = (e) => e.key === "Escape" && t();
|
|
3994
4115
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4109,7 +4230,7 @@ function Fn({ node: e, onClose: t }) {
|
|
|
4109
4230
|
})
|
|
4110
4231
|
});
|
|
4111
4232
|
}
|
|
4112
|
-
function
|
|
4233
|
+
function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4113
4234
|
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Y), O = i(xe)?.[t], [k, A] = l(null);
|
|
4114
4235
|
a(() => {
|
|
4115
4236
|
if (!t || O) return;
|
|
@@ -4126,7 +4247,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4126
4247
|
D,
|
|
4127
4248
|
O
|
|
4128
4249
|
]);
|
|
4129
|
-
let j = t ?
|
|
4250
|
+
let j = t ? Bn(O ?? k ?? [], {
|
|
4130
4251
|
nameField: n,
|
|
4131
4252
|
titleField: r,
|
|
4132
4253
|
photoField: s,
|
|
@@ -4134,7 +4255,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4134
4255
|
cvField: p,
|
|
4135
4256
|
hrefField: m,
|
|
4136
4257
|
groupField: h
|
|
4137
|
-
}) : e, M =
|
|
4258
|
+
}) : e, M = Nn(v), { boxes: N, links: F, groups: I, width: L, height: R } = In(j, {
|
|
4138
4259
|
size: v,
|
|
4139
4260
|
horizontal: y,
|
|
4140
4261
|
groupTitles: g
|
|
@@ -4192,8 +4313,8 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4192
4313
|
fontSize: M.title + 1,
|
|
4193
4314
|
fontWeight: "600",
|
|
4194
4315
|
opacity: "0.55",
|
|
4195
|
-
fill: r ?
|
|
4196
|
-
children:
|
|
4316
|
+
fill: r ? Rn(e.color || _) : "var(--page-text, #111827)",
|
|
4317
|
+
children: Ln(e.title, Math.floor(e.width / 7))
|
|
4197
4318
|
})] }, `group-${t}`);
|
|
4198
4319
|
}),
|
|
4199
4320
|
F.map((e, t) => /* @__PURE__ */ d("path", {
|
|
@@ -4203,7 +4324,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4203
4324
|
strokeWidth: "1.5"
|
|
4204
4325
|
}, t)),
|
|
4205
4326
|
N.map(({ node: e, x: t, y: n }) => {
|
|
4206
|
-
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 ?
|
|
4327
|
+
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 ? Rn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Rn(e.color2) : s, l = S && (zn(e) || e.href), p = () => zn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Vn.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4207
4328
|
return /* @__PURE__ */ f("g", {
|
|
4208
4329
|
onClick: l ? p : void 0,
|
|
4209
4330
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -4267,13 +4388,13 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4267
4388
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4268
4389
|
id: `${C}-${e.id}`,
|
|
4269
4390
|
children: /* @__PURE__ */ d("circle", {
|
|
4270
|
-
cx: t +
|
|
4391
|
+
cx: t + Vn.pad + M.avatar / 2,
|
|
4271
4392
|
cy: n + M.h / 2,
|
|
4272
4393
|
r: M.avatar / 2
|
|
4273
4394
|
})
|
|
4274
4395
|
}), /* @__PURE__ */ d("image", {
|
|
4275
4396
|
href: e.photo,
|
|
4276
|
-
x: t +
|
|
4397
|
+
x: t + Vn.pad,
|
|
4277
4398
|
y: n + (M.h - M.avatar) / 2,
|
|
4278
4399
|
width: M.avatar,
|
|
4279
4400
|
height: M.avatar,
|
|
@@ -4287,7 +4408,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4287
4408
|
fontSize: M.title,
|
|
4288
4409
|
fontWeight: "600",
|
|
4289
4410
|
fill: s,
|
|
4290
|
-
children:
|
|
4411
|
+
children: Ln(e.title, g + 4)
|
|
4291
4412
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
4292
4413
|
x: m,
|
|
4293
4414
|
y: n + _ + _ / 2 + M.name * .35,
|
|
@@ -4295,7 +4416,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4295
4416
|
fontSize: M.name,
|
|
4296
4417
|
fontWeight: "600",
|
|
4297
4418
|
fill: c,
|
|
4298
|
-
children:
|
|
4419
|
+
children: Ln(e.name, g)
|
|
4299
4420
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
4300
4421
|
x: m,
|
|
4301
4422
|
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
@@ -4303,7 +4424,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4303
4424
|
fontSize: M.name,
|
|
4304
4425
|
fontWeight: "600",
|
|
4305
4426
|
fill: s,
|
|
4306
|
-
children:
|
|
4427
|
+
children: Ln(v[0], g)
|
|
4307
4428
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
4308
4429
|
x: m,
|
|
4309
4430
|
y: n + M.h * .73,
|
|
@@ -4311,19 +4432,19 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4311
4432
|
fontSize: M.title,
|
|
4312
4433
|
opacity: "0.7",
|
|
4313
4434
|
fill: s,
|
|
4314
|
-
children:
|
|
4435
|
+
children: Ln(v[1], g + 4)
|
|
4315
4436
|
})] })
|
|
4316
4437
|
]
|
|
4317
4438
|
}, e.id);
|
|
4318
4439
|
})
|
|
4319
4440
|
]
|
|
4320
|
-
}), w && /* @__PURE__ */ d(
|
|
4441
|
+
}), w && /* @__PURE__ */ d(Hn, {
|
|
4321
4442
|
node: w,
|
|
4322
4443
|
onClose: () => T(null)
|
|
4323
4444
|
})]
|
|
4324
4445
|
});
|
|
4325
4446
|
}
|
|
4326
|
-
function
|
|
4447
|
+
function Wn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4327
4448
|
let [i, o] = l(!1), s = c(null);
|
|
4328
4449
|
return a(() => {
|
|
4329
4450
|
if (!i || !s.current) return;
|
|
@@ -4353,7 +4474,7 @@ function Ln({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4353
4474
|
children: e ?? ""
|
|
4354
4475
|
});
|
|
4355
4476
|
}
|
|
4356
|
-
var
|
|
4477
|
+
var Gn = 360, Kn = "\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", qn = (e, t) => e && t ? `cell-${e}-${t}` : "", Jn = (e) => {
|
|
4357
4478
|
if (!e || typeof e != "object") return e ?? "";
|
|
4358
4479
|
let t = String(e.text ?? "");
|
|
4359
4480
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4364,7 +4485,7 @@ var Rn = 360, zn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4364
4485
|
children: t
|
|
4365
4486
|
}) : t;
|
|
4366
4487
|
};
|
|
4367
|
-
function
|
|
4488
|
+
function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
|
|
4368
4489
|
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
|
|
4369
4490
|
r: e,
|
|
4370
4491
|
c: t
|
|
@@ -4378,7 +4499,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4378
4499
|
}
|
|
4379
4500
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4380
4501
|
top: r.bottom - n.top + 4,
|
|
4381
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4502
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Gn))
|
|
4382
4503
|
};
|
|
4383
4504
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4384
4505
|
}), a(() => {
|
|
@@ -4434,7 +4555,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4434
4555
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4435
4556
|
}, ye = /* @__PURE__ */ new Set();
|
|
4436
4557
|
p && ae.forEach((t, n) => e.forEach((e, t) => {
|
|
4437
|
-
let i = p[
|
|
4558
|
+
let i = p[qn(r[n], o[t])];
|
|
4438
4559
|
if (!i) return;
|
|
4439
4560
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4440
4561
|
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4457,7 +4578,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4457
4578
|
},
|
|
4458
4579
|
onClick: n,
|
|
4459
4580
|
children: e
|
|
4460
|
-
}, t), Z = L && L.r < ae.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Ce = Z ? p?.[
|
|
4581
|
+
}, t), Z = L && L.r < ae.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Ce = Z ? p?.[qn(r[Z.r], o[Z.c])] : null, Te = Math.max(1, Number(Ce?.c) || 1), De = Math.max(1, Number(Ce?.r) || 1);
|
|
4461
4582
|
return /* @__PURE__ */ f("div", {
|
|
4462
4583
|
ref: (e) => {
|
|
4463
4584
|
I.current = e, typeof M == "function" && M(e);
|
|
@@ -4468,7 +4589,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4468
4589
|
...ge
|
|
4469
4590
|
},
|
|
4470
4591
|
children: [
|
|
4471
|
-
N && /* @__PURE__ */ d("style", { children:
|
|
4592
|
+
N && /* @__PURE__ */ d("style", { children: Kn }),
|
|
4472
4593
|
N && Z && z && /* @__PURE__ */ f("div", {
|
|
4473
4594
|
className: "wb-tedit-bar",
|
|
4474
4595
|
style: {
|
|
@@ -4534,7 +4655,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4534
4655
|
} : N ? { position: "relative" } : null,
|
|
4535
4656
|
...q
|
|
4536
4657
|
},
|
|
4537
|
-
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
4658
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Wn, {
|
|
4538
4659
|
value: t.label ?? t,
|
|
4539
4660
|
onCommit: (e) => N.header(n, e),
|
|
4540
4661
|
hint: Q("editCell", "Double-click to edit"),
|
|
@@ -4562,7 +4683,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4562
4683
|
},
|
|
4563
4684
|
children: e.map((e, i) => {
|
|
4564
4685
|
if (ye.has(`${n},${i}`)) return null;
|
|
4565
|
-
let a =
|
|
4686
|
+
let a = qn(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
|
|
4566
4687
|
return /* @__PURE__ */ f("td", {
|
|
4567
4688
|
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4568
4689
|
onMouseDownCapture: _e ? V(n, i) : void 0,
|
|
@@ -4575,7 +4696,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4575
4696
|
...N ? { position: "relative" } : null,
|
|
4576
4697
|
...q
|
|
4577
4698
|
},
|
|
4578
|
-
children: [s ??
|
|
4699
|
+
children: [s ?? Jn(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
|
|
4579
4700
|
className: "wb-tedit-rowgrip",
|
|
4580
4701
|
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4581
4702
|
onPointerDown: be(n),
|
|
@@ -4590,7 +4711,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4590
4711
|
]
|
|
4591
4712
|
});
|
|
4592
4713
|
}
|
|
4593
|
-
var
|
|
4714
|
+
var Xn = {
|
|
4594
4715
|
small: {
|
|
4595
4716
|
cell: 62,
|
|
4596
4717
|
font: 10.5,
|
|
@@ -4615,8 +4736,8 @@ var Un = {
|
|
|
4615
4736
|
pad: 8,
|
|
4616
4737
|
gap: 4
|
|
4617
4738
|
}
|
|
4618
|
-
},
|
|
4619
|
-
function
|
|
4739
|
+
}, Zn = (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()), $n = 366;
|
|
4740
|
+
function er(e, t = {}) {
|
|
4620
4741
|
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 ? "" : Ee(e), a = (e) => {
|
|
4621
4742
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4622
4743
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
@@ -4633,7 +4754,7 @@ function qn(e, t = {}) {
|
|
|
4633
4754
|
} : null;
|
|
4634
4755
|
}).filter(Boolean);
|
|
4635
4756
|
}
|
|
4636
|
-
function
|
|
4757
|
+
function tr(e) {
|
|
4637
4758
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4638
4759
|
let n = e?.start ? new Date(e.start) : null;
|
|
4639
4760
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4648,19 +4769,19 @@ function Jn(e) {
|
|
|
4648
4769
|
};
|
|
4649
4770
|
}).filter(Boolean);
|
|
4650
4771
|
}
|
|
4651
|
-
function
|
|
4772
|
+
function nr(e) {
|
|
4652
4773
|
let t = /* @__PURE__ */ new Map();
|
|
4653
4774
|
for (let n of e) {
|
|
4654
|
-
let e =
|
|
4775
|
+
let e = Qn(n.start), r = n.end ? Qn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), $n);
|
|
4655
4776
|
for (let r = 0; r <= i; r += 1) {
|
|
4656
|
-
let i =
|
|
4777
|
+
let i = Zn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4657
4778
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4658
4779
|
}
|
|
4659
4780
|
}
|
|
4660
4781
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4661
4782
|
return t;
|
|
4662
4783
|
}
|
|
4663
|
-
function
|
|
4784
|
+
function rr({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4664
4785
|
let { tenant: T, apiUrl: E, locale: D } = i(Y), O = i(xe)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4665
4786
|
let e = /* @__PURE__ */ new Date();
|
|
4666
4787
|
return {
|
|
@@ -4683,13 +4804,13 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4683
4804
|
E,
|
|
4684
4805
|
O
|
|
4685
4806
|
]);
|
|
4686
|
-
let N =
|
|
4807
|
+
let N = Xn[m] ?? Xn.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 ? er(O ?? k ?? [], {
|
|
4687
4808
|
titleField: n,
|
|
4688
4809
|
startField: r,
|
|
4689
4810
|
endField: o,
|
|
4690
4811
|
hrefField: s,
|
|
4691
4812
|
colorField: c
|
|
4692
|
-
}) :
|
|
4813
|
+
}) : tr(e), B = nr(z), V = D || void 0, H = (e, t) => {
|
|
4693
4814
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4694
4815
|
width: 6,
|
|
4695
4816
|
height: 6,
|
|
@@ -4821,9 +4942,9 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4821
4942
|
})]
|
|
4822
4943
|
});
|
|
4823
4944
|
}
|
|
4824
|
-
let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, ie = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((G + ie) / 7), oe =
|
|
4945
|
+
let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, ie = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((G + ie) / 7), oe = Zn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), K = [];
|
|
4825
4946
|
for (let e = 0; e < ae * 7; e += 1) {
|
|
4826
|
-
let t = e - G + 1, n = t >= 1 && t <= ie, r =
|
|
4947
|
+
let t = e - G + 1, n = t >= 1 && t <= ie, r = Zn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
|
|
4827
4948
|
K.push(/* @__PURE__ */ f("div", {
|
|
4828
4949
|
style: {
|
|
4829
4950
|
minHeight: N.cell,
|
|
@@ -4888,12 +5009,12 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4888
5009
|
]
|
|
4889
5010
|
});
|
|
4890
5011
|
}
|
|
4891
|
-
var
|
|
5012
|
+
var ir = {
|
|
4892
5013
|
small: 36,
|
|
4893
5014
|
medium: 56,
|
|
4894
5015
|
large: 88
|
|
4895
5016
|
};
|
|
4896
|
-
function
|
|
5017
|
+
function ar(e, t = {}) {
|
|
4897
5018
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Ee(e);
|
|
4898
5019
|
return n.map((e) => {
|
|
4899
5020
|
let n = e.data ?? e, i = we(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(we(n, t.nameField)) : r(n.name);
|
|
@@ -4904,7 +5025,7 @@ function Qn(e, t = {}) {
|
|
|
4904
5025
|
};
|
|
4905
5026
|
}).filter((e) => e.src);
|
|
4906
5027
|
}
|
|
4907
|
-
function
|
|
5028
|
+
function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "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 }) {
|
|
4908
5029
|
let { tenant: D, apiUrl: O } = i(Y), k = i(xe)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [W, te] = l(!1);
|
|
4909
5030
|
a(() => {
|
|
4910
5031
|
if (!t || k) return;
|
|
@@ -4944,11 +5065,11 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
4944
5065
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4945
5066
|
};
|
|
4946
5067
|
});
|
|
4947
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ?
|
|
5068
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? ar(k ?? A ?? [], {
|
|
4948
5069
|
imageField: n,
|
|
4949
5070
|
nameField: r,
|
|
4950
5071
|
hrefField: o
|
|
4951
|
-
}) : ne, G =
|
|
5072
|
+
}) : ne, G = ir[p] ?? ir.medium, ie = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = s === "marquee" ? "step" : s, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), se = Math.min(3e3, Math.max(100, Number(_) || 500)), K = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), q = (L || G * 3) + ie, J = F ? Math.max(1, Math.floor(F / q)) : K, le = Math.min(K, J), ue = F ? Math.min(q, F / le) : q;
|
|
4952
5073
|
if (!re.length) return /* @__PURE__ */ d("div", {
|
|
4953
5074
|
ref: T,
|
|
4954
5075
|
style: {
|
|
@@ -5133,7 +5254,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5133
5254
|
be,
|
|
5134
5255
|
Z ? Q(1) : null
|
|
5135
5256
|
] }),
|
|
5136
|
-
/* @__PURE__ */ d(
|
|
5257
|
+
/* @__PURE__ */ d(sr, {
|
|
5137
5258
|
running: me,
|
|
5138
5259
|
every: oe + se,
|
|
5139
5260
|
slide: se,
|
|
@@ -5147,7 +5268,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5147
5268
|
]
|
|
5148
5269
|
});
|
|
5149
5270
|
}
|
|
5150
|
-
function
|
|
5271
|
+
function sr({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5151
5272
|
a(() => {
|
|
5152
5273
|
if (!e) return;
|
|
5153
5274
|
let n = setInterval(() => {
|
|
@@ -5183,13 +5304,13 @@ function er({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
|
|
|
5183
5304
|
l
|
|
5184
5305
|
]), null;
|
|
5185
5306
|
}
|
|
5186
|
-
var
|
|
5307
|
+
var cr = {
|
|
5187
5308
|
small: 380,
|
|
5188
5309
|
medium: 560,
|
|
5189
5310
|
large: 820,
|
|
5190
5311
|
full: "100%"
|
|
5191
5312
|
};
|
|
5192
|
-
function
|
|
5313
|
+
function lr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
5193
5314
|
let [C, w] = l(!1), T = c(null);
|
|
5194
5315
|
a(() => {
|
|
5195
5316
|
if (S || !e) return;
|
|
@@ -5214,7 +5335,7 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5214
5335
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5215
5336
|
};
|
|
5216
5337
|
}, [S, C]);
|
|
5217
|
-
let E =
|
|
5338
|
+
let E = cr[o] ?? cr.medium, D = (e) => {
|
|
5218
5339
|
let t = {
|
|
5219
5340
|
padding: "9px 16px",
|
|
5220
5341
|
borderRadius: 6,
|
|
@@ -5383,39 +5504,142 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5383
5504
|
})]
|
|
5384
5505
|
});
|
|
5385
5506
|
}
|
|
5386
|
-
|
|
5507
|
+
function ur({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: o = "", offset: s = 8, editorOpen: u = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5508
|
+
let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
|
|
5509
|
+
b.current && clearTimeout(b.current), b.current = null;
|
|
5510
|
+
}, C = () => {
|
|
5511
|
+
S(), b.current = setTimeout(() => v(!1), 160);
|
|
5512
|
+
};
|
|
5513
|
+
a(() => {
|
|
5514
|
+
if (g || !e) return;
|
|
5515
|
+
let t = `[data-webim-toggle="${e}"]`, n = (e) => {
|
|
5516
|
+
e.target.closest?.(t) && (e.preventDefault(), S(), v((e) => !e));
|
|
5517
|
+
}, r = (e) => {
|
|
5518
|
+
e.target.closest?.(t) && (S(), v(!0));
|
|
5519
|
+
}, i = (e) => {
|
|
5520
|
+
let n = e.target.closest?.(t);
|
|
5521
|
+
!n || e.relatedTarget && n.contains(e.relatedTarget) || C();
|
|
5522
|
+
};
|
|
5523
|
+
return document.addEventListener("click", n), x && (document.addEventListener("mouseover", r), document.addEventListener("mouseout", i)), () => {
|
|
5524
|
+
document.removeEventListener("click", n), document.removeEventListener("mouseover", r), document.removeEventListener("mouseout", i);
|
|
5525
|
+
};
|
|
5526
|
+
}, [
|
|
5527
|
+
g,
|
|
5528
|
+
e,
|
|
5529
|
+
x
|
|
5530
|
+
]), a(() => {
|
|
5531
|
+
if (g || !_) return;
|
|
5532
|
+
let t = (t) => {
|
|
5533
|
+
y.current?.contains(t.target) || e && t.target.closest?.(`[data-webim-toggle="${e}"]`) || v(!1);
|
|
5534
|
+
}, n = (e) => e.key === "Escape" && v(!1);
|
|
5535
|
+
return document.addEventListener("mousedown", t), document.addEventListener("keydown", n), () => {
|
|
5536
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", n);
|
|
5537
|
+
};
|
|
5538
|
+
}, [
|
|
5539
|
+
g,
|
|
5540
|
+
_,
|
|
5541
|
+
e
|
|
5542
|
+
]), a(() => S, []);
|
|
5543
|
+
let w = Number(o) > 0 ? Number(o) : null, T = g ? u !== !1 : _, E = /* @__PURE__ */ d("div", {
|
|
5544
|
+
style: {
|
|
5545
|
+
position: "absolute",
|
|
5546
|
+
top: `calc(100% + ${Number(s) || 0}px)`,
|
|
5547
|
+
...i === "right" ? { right: 0 } : i === "center" ? {
|
|
5548
|
+
left: "50%",
|
|
5549
|
+
transform: "translateX(-50%)"
|
|
5550
|
+
} : { left: 0 },
|
|
5551
|
+
zIndex: 60,
|
|
5552
|
+
display: T ? "block" : "none",
|
|
5553
|
+
minWidth: w ?? 240,
|
|
5554
|
+
width: w ?? void 0,
|
|
5555
|
+
maxWidth: "92vw",
|
|
5556
|
+
padding: 14,
|
|
5557
|
+
borderRadius: 10,
|
|
5558
|
+
background: "var(--page-surface, #ffffff)",
|
|
5559
|
+
color: "var(--page-text, inherit)",
|
|
5560
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
5561
|
+
boxShadow: "0 16px 44px rgba(15, 23, 42, 0.22)",
|
|
5562
|
+
...P(m)
|
|
5563
|
+
},
|
|
5564
|
+
children: p?.content ?? null
|
|
5565
|
+
});
|
|
5566
|
+
return /* @__PURE__ */ f("div", {
|
|
5567
|
+
ref: (e) => {
|
|
5568
|
+
y.current = e, h && h(e);
|
|
5569
|
+
},
|
|
5570
|
+
id: e || void 0,
|
|
5571
|
+
onMouseEnter: !g && x ? () => {
|
|
5572
|
+
S(), v(!0);
|
|
5573
|
+
} : void 0,
|
|
5574
|
+
onMouseLeave: !g && x ? C : void 0,
|
|
5575
|
+
style: {
|
|
5576
|
+
position: "relative",
|
|
5577
|
+
display: "inline-block"
|
|
5578
|
+
},
|
|
5579
|
+
children: [t !== "none" && /* @__PURE__ */ f("button", {
|
|
5580
|
+
type: "button",
|
|
5581
|
+
"aria-haspopup": "true",
|
|
5582
|
+
"aria-expanded": g ? void 0 : _,
|
|
5583
|
+
onClick: () => !g && v((e) => !e),
|
|
5584
|
+
style: {
|
|
5585
|
+
padding: "9px 16px",
|
|
5586
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
5587
|
+
borderRadius: 6,
|
|
5588
|
+
cursor: "pointer",
|
|
5589
|
+
fontSize: 15,
|
|
5590
|
+
fontFamily: "inherit",
|
|
5591
|
+
background: "var(--page-surface, transparent)",
|
|
5592
|
+
color: "inherit",
|
|
5593
|
+
display: "inline-flex",
|
|
5594
|
+
alignItems: "center",
|
|
5595
|
+
gap: 6
|
|
5596
|
+
},
|
|
5597
|
+
children: [n, /* @__PURE__ */ d("span", {
|
|
5598
|
+
"aria-hidden": "true",
|
|
5599
|
+
style: {
|
|
5600
|
+
fontSize: 10,
|
|
5601
|
+
opacity: .7
|
|
5602
|
+
},
|
|
5603
|
+
children: "▾"
|
|
5604
|
+
})]
|
|
5605
|
+
}), E]
|
|
5606
|
+
});
|
|
5607
|
+
}
|
|
5608
|
+
var dr = {
|
|
5387
5609
|
PageRoot: Le,
|
|
5388
|
-
CalendarBlock:
|
|
5389
|
-
LogoCarousel:
|
|
5390
|
-
DialogBlock:
|
|
5610
|
+
CalendarBlock: rr,
|
|
5611
|
+
LogoCarousel: or,
|
|
5612
|
+
DialogBlock: lr,
|
|
5613
|
+
DropdownBlock: ur,
|
|
5391
5614
|
Section: Re,
|
|
5392
5615
|
Container: ze,
|
|
5393
5616
|
Heading: Be,
|
|
5394
5617
|
TextBlock: et,
|
|
5395
5618
|
ButtonBlock: rt,
|
|
5396
5619
|
ImageBlock: it,
|
|
5397
|
-
Spacer:
|
|
5398
|
-
Divider:
|
|
5399
|
-
BoxBlock:
|
|
5400
|
-
SliderBlock:
|
|
5401
|
-
CanvasSlider:
|
|
5402
|
-
TabsBlock:
|
|
5403
|
-
QuickStack:
|
|
5404
|
-
CollectionList:
|
|
5405
|
-
CollectionSearch:
|
|
5406
|
-
BreadcrumbsBlock:
|
|
5407
|
-
PaginationBlock:
|
|
5408
|
-
StepperBlock:
|
|
5409
|
-
SocialLinksBlock:
|
|
5410
|
-
ThemeModeBlock:
|
|
5411
|
-
ScrollTopBlock:
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5620
|
+
Spacer: ft,
|
|
5621
|
+
Divider: pt,
|
|
5622
|
+
BoxBlock: mt,
|
|
5623
|
+
SliderBlock: bt,
|
|
5624
|
+
CanvasSlider: xt,
|
|
5625
|
+
TabsBlock: Lt,
|
|
5626
|
+
QuickStack: un,
|
|
5627
|
+
CollectionList: dn,
|
|
5628
|
+
CollectionSearch: fn,
|
|
5629
|
+
BreadcrumbsBlock: pn,
|
|
5630
|
+
PaginationBlock: mn,
|
|
5631
|
+
StepperBlock: jn,
|
|
5632
|
+
SocialLinksBlock: An,
|
|
5633
|
+
ThemeModeBlock: yn,
|
|
5634
|
+
ScrollTopBlock: On,
|
|
5635
|
+
CounterBlock: Dn,
|
|
5636
|
+
OrgChartBlock: Un,
|
|
5637
|
+
TableBlock: Yn,
|
|
5638
|
+
IconBlock: At,
|
|
5639
|
+
MapBlock: Ot,
|
|
5640
|
+
MasonryBlock: Mt,
|
|
5641
|
+
AccordionBlock: Rt,
|
|
5642
|
+
NavbarBlock: It,
|
|
5419
5643
|
ListBlock: $e,
|
|
5420
5644
|
TextSpan: We,
|
|
5421
5645
|
QuoteBlock: Qe,
|
|
@@ -5425,56 +5649,56 @@ var rr = {
|
|
|
5425
5649
|
VideoBlock: at,
|
|
5426
5650
|
YouTubeBlock: st,
|
|
5427
5651
|
IframeBlock: ct,
|
|
5428
|
-
EmbedBlock:
|
|
5429
|
-
FormBlock:
|
|
5430
|
-
FormLabel:
|
|
5431
|
-
FormInput:
|
|
5432
|
-
FormTextarea:
|
|
5433
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
5652
|
+
EmbedBlock: dt,
|
|
5653
|
+
FormBlock: Zt,
|
|
5654
|
+
FormLabel: nn,
|
|
5655
|
+
FormInput: rn,
|
|
5656
|
+
FormTextarea: an,
|
|
5657
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(on, {
|
|
5434
5658
|
kind: "checkbox",
|
|
5435
5659
|
...e
|
|
5436
5660
|
}),
|
|
5437
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
5661
|
+
FormRadio: (e) => /* @__PURE__ */ d(on, {
|
|
5438
5662
|
kind: "radio",
|
|
5439
5663
|
...e
|
|
5440
5664
|
}),
|
|
5441
|
-
FormSelect:
|
|
5442
|
-
FormFile:
|
|
5443
|
-
FormRecaptcha:
|
|
5444
|
-
FormSubmit:
|
|
5445
|
-
},
|
|
5665
|
+
FormSelect: sn,
|
|
5666
|
+
FormFile: cn,
|
|
5667
|
+
FormRecaptcha: tn,
|
|
5668
|
+
FormSubmit: ln
|
|
5669
|
+
}, fr = {
|
|
5446
5670
|
id: "auth",
|
|
5447
5671
|
label: "Accounts",
|
|
5448
5672
|
category: "Apps",
|
|
5449
5673
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5450
5674
|
ssr: "shell",
|
|
5451
5675
|
settings: ["site.authRedirect"]
|
|
5452
|
-
},
|
|
5676
|
+
}, pr = n({
|
|
5453
5677
|
user: null,
|
|
5454
5678
|
status: "idle",
|
|
5455
5679
|
ensure: () => {},
|
|
5456
5680
|
refresh: () => {},
|
|
5457
5681
|
signOut: () => {}
|
|
5458
5682
|
});
|
|
5459
|
-
function
|
|
5683
|
+
function mr(e, t) {
|
|
5460
5684
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5461
5685
|
}
|
|
5462
|
-
function
|
|
5686
|
+
function hr(e) {
|
|
5463
5687
|
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);
|
|
5464
5688
|
return {
|
|
5465
5689
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5466
5690
|
url: i,
|
|
5467
5691
|
mePath: a,
|
|
5468
5692
|
logoutPath: o,
|
|
5469
|
-
meUrl:
|
|
5470
|
-
logoutUrl:
|
|
5693
|
+
meUrl: mr(i, a),
|
|
5694
|
+
logoutUrl: mr(i, o),
|
|
5471
5695
|
loginPage: r(n.loginPage),
|
|
5472
5696
|
userPath: r(n.userPath),
|
|
5473
5697
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5474
5698
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5475
5699
|
};
|
|
5476
5700
|
}
|
|
5477
|
-
function
|
|
5701
|
+
function gr(e, t) {
|
|
5478
5702
|
if (!t) return e ?? null;
|
|
5479
5703
|
let n = e;
|
|
5480
5704
|
for (let e of t.split(".")) {
|
|
@@ -5483,26 +5707,26 @@ function cr(e, t) {
|
|
|
5483
5707
|
}
|
|
5484
5708
|
return n ?? null;
|
|
5485
5709
|
}
|
|
5486
|
-
function
|
|
5710
|
+
function _r(e) {
|
|
5487
5711
|
try {
|
|
5488
5712
|
return window.localStorage.getItem(e) || "";
|
|
5489
5713
|
} catch {
|
|
5490
5714
|
return "";
|
|
5491
5715
|
}
|
|
5492
5716
|
}
|
|
5493
|
-
function
|
|
5717
|
+
function vr(e) {
|
|
5494
5718
|
try {
|
|
5495
5719
|
window.localStorage.removeItem(e);
|
|
5496
5720
|
} catch {}
|
|
5497
5721
|
}
|
|
5498
|
-
var
|
|
5499
|
-
let e = i(
|
|
5722
|
+
var yr = () => {
|
|
5723
|
+
let e = i(pr);
|
|
5500
5724
|
return a(() => {
|
|
5501
5725
|
e.ensure();
|
|
5502
5726
|
}, [e]), e;
|
|
5503
5727
|
};
|
|
5504
|
-
function
|
|
5505
|
-
let f = i(Y), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() =>
|
|
5728
|
+
function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
5729
|
+
let f = i(Y), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => hr(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
|
|
5506
5730
|
...t,
|
|
5507
5731
|
credentials: "include",
|
|
5508
5732
|
headers: {
|
|
@@ -5514,9 +5738,9 @@ function fr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5514
5738
|
if (n) return Promise.resolve(null);
|
|
5515
5739
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5516
5740
|
if (h.mode === "custom") {
|
|
5517
|
-
let e = h.auth === "bearer" ?
|
|
5741
|
+
let e = h.auth === "bearer" ? _r(h.tokenKey) : "";
|
|
5518
5742
|
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) => {
|
|
5519
|
-
let t =
|
|
5743
|
+
let t = gr(e, h.userPath);
|
|
5520
5744
|
return S(t && typeof t == "object" ? t : null);
|
|
5521
5745
|
}).catch(() => S(null));
|
|
5522
5746
|
}
|
|
@@ -5529,12 +5753,12 @@ function fr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5529
5753
|
]), w = r(() => {
|
|
5530
5754
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5531
5755
|
if (h.mode === "custom") {
|
|
5532
|
-
let e = h.auth === "bearer" ?
|
|
5756
|
+
let e = h.auth === "bearer" ? _r(h.tokenKey) : "";
|
|
5533
5757
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5534
5758
|
method: "post",
|
|
5535
5759
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5536
5760
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5537
|
-
h.auth === "bearer" &&
|
|
5761
|
+
h.auth === "bearer" && vr(h.tokenKey), S(null);
|
|
5538
5762
|
});
|
|
5539
5763
|
}
|
|
5540
5764
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5584,18 +5808,18 @@ function fr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5584
5808
|
h.loginPage,
|
|
5585
5809
|
C,
|
|
5586
5810
|
w
|
|
5587
|
-
]), /* @__PURE__ */ d(
|
|
5811
|
+
]), /* @__PURE__ */ d(pr.Provider, {
|
|
5588
5812
|
value: E,
|
|
5589
5813
|
children: e
|
|
5590
5814
|
});
|
|
5591
5815
|
}
|
|
5592
|
-
function
|
|
5593
|
-
let { status: n } =
|
|
5816
|
+
function xr({ when: e, children: t }) {
|
|
5817
|
+
let { status: n } = yr();
|
|
5594
5818
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5595
5819
|
}
|
|
5596
5820
|
//#endregion
|
|
5597
5821
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5598
|
-
function
|
|
5822
|
+
function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
5599
5823
|
let { tenant: h, apiUrl: g, settings: _ } = i(Y), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5600
5824
|
if (e.preventDefault(), u) return;
|
|
5601
5825
|
let n = new FormData(e.currentTarget);
|
|
@@ -5644,20 +5868,20 @@ function mr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5644
5868
|
children: [
|
|
5645
5869
|
w ? /* @__PURE__ */ f("label", {
|
|
5646
5870
|
style: {
|
|
5647
|
-
...
|
|
5871
|
+
...Bt,
|
|
5648
5872
|
display: "grid",
|
|
5649
5873
|
gap: 6
|
|
5650
5874
|
},
|
|
5651
5875
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5652
5876
|
name: "name",
|
|
5653
5877
|
type: "text",
|
|
5654
|
-
style:
|
|
5655
|
-
...
|
|
5878
|
+
style: Vt,
|
|
5879
|
+
...Ut(u)
|
|
5656
5880
|
})]
|
|
5657
5881
|
}) : null,
|
|
5658
5882
|
/* @__PURE__ */ f("label", {
|
|
5659
5883
|
style: {
|
|
5660
|
-
...
|
|
5884
|
+
...Bt,
|
|
5661
5885
|
display: "grid",
|
|
5662
5886
|
gap: 6
|
|
5663
5887
|
},
|
|
@@ -5665,13 +5889,13 @@ function mr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5665
5889
|
name: "email",
|
|
5666
5890
|
type: "email",
|
|
5667
5891
|
required: !u,
|
|
5668
|
-
style:
|
|
5669
|
-
...
|
|
5892
|
+
style: Vt,
|
|
5893
|
+
...Ut(u)
|
|
5670
5894
|
})]
|
|
5671
5895
|
}),
|
|
5672
5896
|
/* @__PURE__ */ f("label", {
|
|
5673
5897
|
style: {
|
|
5674
|
-
...
|
|
5898
|
+
...Bt,
|
|
5675
5899
|
display: "grid",
|
|
5676
5900
|
gap: 6
|
|
5677
5901
|
},
|
|
@@ -5679,8 +5903,8 @@ function mr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5679
5903
|
name: "password",
|
|
5680
5904
|
type: "password",
|
|
5681
5905
|
required: !u,
|
|
5682
|
-
style:
|
|
5683
|
-
...
|
|
5906
|
+
style: Vt,
|
|
5907
|
+
...Ut(u)
|
|
5684
5908
|
})]
|
|
5685
5909
|
}),
|
|
5686
5910
|
/* @__PURE__ */ d("button", {
|
|
@@ -5719,8 +5943,8 @@ function mr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5719
5943
|
]
|
|
5720
5944
|
});
|
|
5721
5945
|
}
|
|
5722
|
-
function
|
|
5723
|
-
let { user: c, status: l, signOut: u } =
|
|
5946
|
+
function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5947
|
+
let { user: c, status: l, signOut: u } = yr(), p = a ? s || "user" : l, m = a ? {
|
|
5724
5948
|
name: "Ada Lovelace",
|
|
5725
5949
|
email: "ada@example.com"
|
|
5726
5950
|
} : c;
|
|
@@ -5741,7 +5965,7 @@ function hr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5741
5965
|
children: [
|
|
5742
5966
|
/* @__PURE__ */ f("span", {
|
|
5743
5967
|
style: {
|
|
5744
|
-
...
|
|
5968
|
+
...Bt,
|
|
5745
5969
|
fontWeight: 600
|
|
5746
5970
|
},
|
|
5747
5971
|
children: [
|
|
@@ -5752,7 +5976,7 @@ function hr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5752
5976
|
}),
|
|
5753
5977
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5754
5978
|
style: {
|
|
5755
|
-
...
|
|
5979
|
+
...Bt,
|
|
5756
5980
|
opacity: .7
|
|
5757
5981
|
},
|
|
5758
5982
|
children: m.email
|
|
@@ -5768,7 +5992,7 @@ function hr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5768
5992
|
fontSize: 14,
|
|
5769
5993
|
cursor: a ? "default" : "pointer"
|
|
5770
5994
|
},
|
|
5771
|
-
...
|
|
5995
|
+
...Ut(a),
|
|
5772
5996
|
children: t
|
|
5773
5997
|
})
|
|
5774
5998
|
]
|
|
@@ -5785,40 +6009,40 @@ function hr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5785
6009
|
}
|
|
5786
6010
|
//#endregion
|
|
5787
6011
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5788
|
-
var
|
|
6012
|
+
var wr = {
|
|
5789
6013
|
id: "consent",
|
|
5790
6014
|
label: "Cookie consent",
|
|
5791
6015
|
category: "Apps",
|
|
5792
6016
|
keys: ["CookieConsent"],
|
|
5793
6017
|
ssr: "shell",
|
|
5794
6018
|
settings: []
|
|
5795
|
-
},
|
|
5796
|
-
function
|
|
6019
|
+
}, Tr = "webim.cookie_consent";
|
|
6020
|
+
function Er() {
|
|
5797
6021
|
try {
|
|
5798
|
-
let e = window.localStorage.getItem(
|
|
6022
|
+
let e = window.localStorage.getItem(Tr), t = e ? JSON.parse(e) : null;
|
|
5799
6023
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5800
6024
|
} catch {
|
|
5801
6025
|
return "";
|
|
5802
6026
|
}
|
|
5803
6027
|
}
|
|
5804
|
-
function
|
|
6028
|
+
function Dr(e) {
|
|
5805
6029
|
try {
|
|
5806
6030
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5807
6031
|
} catch {}
|
|
5808
6032
|
}
|
|
5809
|
-
function
|
|
6033
|
+
function Or(e) {
|
|
5810
6034
|
try {
|
|
5811
|
-
window.localStorage.setItem(
|
|
6035
|
+
window.localStorage.setItem(Tr, JSON.stringify({
|
|
5812
6036
|
choice: e,
|
|
5813
6037
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5814
6038
|
}));
|
|
5815
6039
|
} catch {}
|
|
5816
|
-
|
|
6040
|
+
Dr(e);
|
|
5817
6041
|
try {
|
|
5818
6042
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5819
6043
|
} catch {}
|
|
5820
6044
|
}
|
|
5821
|
-
var
|
|
6045
|
+
var kr = {
|
|
5822
6046
|
bottom: {
|
|
5823
6047
|
left: 0,
|
|
5824
6048
|
right: 0,
|
|
@@ -5840,18 +6064,18 @@ var xr = {
|
|
|
5840
6064
|
maxWidth: 400
|
|
5841
6065
|
}
|
|
5842
6066
|
};
|
|
5843
|
-
function
|
|
6067
|
+
function Ar({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
5844
6068
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
5845
6069
|
y(e), typeof m == "function" && m(e);
|
|
5846
6070
|
};
|
|
5847
6071
|
if (a(() => {
|
|
5848
6072
|
if (h) return;
|
|
5849
|
-
let e =
|
|
5850
|
-
e ?
|
|
6073
|
+
let e = Er();
|
|
6074
|
+
e ? Dr(e) : _(!0);
|
|
5851
6075
|
}, [h, v]), !g) return null;
|
|
5852
6076
|
let x = (e) => () => {
|
|
5853
|
-
h || (
|
|
5854
|
-
}, S =
|
|
6077
|
+
h || (Or(e), _(!1));
|
|
6078
|
+
}, S = kr[s] ?? kr.bottom, C = {
|
|
5855
6079
|
appearance: "none",
|
|
5856
6080
|
font: "inherit",
|
|
5857
6081
|
fontSize: 14,
|
|
@@ -5931,37 +6155,37 @@ function Sr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5931
6155
|
}
|
|
5932
6156
|
//#endregion
|
|
5933
6157
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5934
|
-
var
|
|
6158
|
+
var jr = {
|
|
5935
6159
|
id: "language",
|
|
5936
6160
|
label: "Language",
|
|
5937
6161
|
category: "Apps",
|
|
5938
6162
|
keys: ["SiteLanguagePicker"],
|
|
5939
6163
|
ssr: "prefetch",
|
|
5940
6164
|
settings: ["locales"]
|
|
5941
|
-
},
|
|
6165
|
+
}, Mr = {
|
|
5942
6166
|
id: "search",
|
|
5943
6167
|
label: "Search",
|
|
5944
6168
|
category: "Apps",
|
|
5945
6169
|
keys: ["SiteSearch"],
|
|
5946
6170
|
ssr: "prefetch",
|
|
5947
6171
|
settings: []
|
|
5948
|
-
},
|
|
5949
|
-
function
|
|
6172
|
+
}, Nr = 50, Pr = 2e3;
|
|
6173
|
+
function Fr() {
|
|
5950
6174
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5951
6175
|
}
|
|
5952
|
-
function
|
|
6176
|
+
function Ir(e, t) {
|
|
5953
6177
|
let n = e?.data ?? {}, r = [];
|
|
5954
6178
|
for (let e of Object.values(n)) {
|
|
5955
6179
|
let t = e == null ? "" : Ee(e);
|
|
5956
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6180
|
+
if (t && r.push(t), r.join(" ").length > Pr) break;
|
|
5957
6181
|
}
|
|
5958
|
-
return r.join(" ").slice(0,
|
|
6182
|
+
return r.join(" ").slice(0, Pr).toLocaleLowerCase(t || void 0);
|
|
5959
6183
|
}
|
|
5960
|
-
function
|
|
5961
|
-
let { tenant: b, apiUrl: x, locale: S } = i(Y), [C, w] = l(() =>
|
|
6184
|
+
function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6185
|
+
let { tenant: b, apiUrl: x, locale: S } = i(Y), [C, w] = l(() => Fr()), [T, E] = l(() => Fr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
5962
6186
|
a(() => {
|
|
5963
6187
|
let e = () => {
|
|
5964
|
-
let e =
|
|
6188
|
+
let e = Fr();
|
|
5965
6189
|
w(e), E(e);
|
|
5966
6190
|
};
|
|
5967
6191
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6012,7 +6236,7 @@ function kr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6012
6236
|
});
|
|
6013
6237
|
}
|
|
6014
6238
|
else for (let t of e.rows) {
|
|
6015
|
-
if (!
|
|
6239
|
+
if (!Ir(t, S).includes(N)) continue;
|
|
6016
6240
|
let n = t?.data ?? {}, r = Ee(n.name) || "Untitled", i = Ee(n.slug);
|
|
6017
6241
|
F.push({
|
|
6018
6242
|
key: `entry:${t.id}`,
|
|
@@ -6021,7 +6245,7 @@ function kr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6021
6245
|
kind: "entry"
|
|
6022
6246
|
});
|
|
6023
6247
|
}
|
|
6024
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6248
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Nr)), L = (e) => {
|
|
6025
6249
|
if (v) {
|
|
6026
6250
|
e.preventDefault(), w(T), A(!0);
|
|
6027
6251
|
return;
|
|
@@ -6103,7 +6327,7 @@ function kr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6103
6327
|
onChange: (e) => E(e.target.value),
|
|
6104
6328
|
onFocus: () => N && A(!0),
|
|
6105
6329
|
style: {
|
|
6106
|
-
...
|
|
6330
|
+
...Vt,
|
|
6107
6331
|
flexGrow: 1,
|
|
6108
6332
|
minWidth: 0
|
|
6109
6333
|
}
|
|
@@ -6161,21 +6385,21 @@ function kr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6161
6385
|
}
|
|
6162
6386
|
//#endregion
|
|
6163
6387
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6164
|
-
function
|
|
6388
|
+
function Rr(e) {
|
|
6165
6389
|
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());
|
|
6166
6390
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6167
6391
|
}
|
|
6168
|
-
var
|
|
6169
|
-
function
|
|
6392
|
+
var zr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6393
|
+
function Br(e, t) {
|
|
6170
6394
|
let n = String(e ?? "").toUpperCase();
|
|
6171
6395
|
if (t === "code") return n;
|
|
6172
6396
|
let r = "";
|
|
6173
6397
|
try {
|
|
6174
|
-
r =
|
|
6398
|
+
r = zr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6175
6399
|
} catch {}
|
|
6176
6400
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6177
6401
|
}
|
|
6178
|
-
function
|
|
6402
|
+
function Vr(e, t) {
|
|
6179
6403
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6180
6404
|
if (typeof window > "u") return n || "?";
|
|
6181
6405
|
try {
|
|
@@ -6185,8 +6409,8 @@ function Nr(e, t) {
|
|
|
6185
6409
|
return n || "/";
|
|
6186
6410
|
}
|
|
6187
6411
|
}
|
|
6188
|
-
function
|
|
6189
|
-
let c = i(Y), l =
|
|
6412
|
+
function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
6413
|
+
let c = i(Y), l = Rr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
6190
6414
|
display: "inline-flex",
|
|
6191
6415
|
alignItems: "center",
|
|
6192
6416
|
gap: 8,
|
|
@@ -6221,7 +6445,7 @@ function Pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6221
6445
|
style: { opacity: .4 },
|
|
6222
6446
|
children: n ?? "·"
|
|
6223
6447
|
}), /* @__PURE__ */ d("a", {
|
|
6224
|
-
href:
|
|
6448
|
+
href: Vr(e, e === u),
|
|
6225
6449
|
hrefLang: e,
|
|
6226
6450
|
"aria-current": e === p ? "true" : void 0,
|
|
6227
6451
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6231,7 +6455,7 @@ function Pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6231
6455
|
textDecoration: "none",
|
|
6232
6456
|
cursor: s ? "default" : "pointer"
|
|
6233
6457
|
},
|
|
6234
|
-
children:
|
|
6458
|
+
children: Br(e, t)
|
|
6235
6459
|
})]
|
|
6236
6460
|
}, e))]
|
|
6237
6461
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -6242,7 +6466,7 @@ function Pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6242
6466
|
value: p,
|
|
6243
6467
|
onChange: s ? void 0 : (e) => {
|
|
6244
6468
|
let t = e.target.value;
|
|
6245
|
-
window.location.assign(
|
|
6469
|
+
window.location.assign(Vr(t, t === u));
|
|
6246
6470
|
},
|
|
6247
6471
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6248
6472
|
style: {
|
|
@@ -6256,47 +6480,47 @@ function Pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6256
6480
|
},
|
|
6257
6481
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
6258
6482
|
value: e,
|
|
6259
|
-
children:
|
|
6483
|
+
children: Br(e, t)
|
|
6260
6484
|
}, e))
|
|
6261
6485
|
})]
|
|
6262
6486
|
});
|
|
6263
6487
|
}
|
|
6264
6488
|
//#endregion
|
|
6265
6489
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6266
|
-
var
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
],
|
|
6272
|
-
SiteLoginForm:
|
|
6273
|
-
SiteAccountMenu:
|
|
6274
|
-
SiteLanguagePicker:
|
|
6275
|
-
CookieConsent:
|
|
6276
|
-
SiteSearch:
|
|
6490
|
+
var Ur = [
|
|
6491
|
+
fr,
|
|
6492
|
+
jr,
|
|
6493
|
+
wr,
|
|
6494
|
+
Mr
|
|
6495
|
+
], Wr = {
|
|
6496
|
+
SiteLoginForm: Sr,
|
|
6497
|
+
SiteAccountMenu: Cr,
|
|
6498
|
+
SiteLanguagePicker: Hr,
|
|
6499
|
+
CookieConsent: Ar,
|
|
6500
|
+
SiteSearch: Lr
|
|
6277
6501
|
};
|
|
6278
|
-
new Set(
|
|
6502
|
+
new Set(Ur.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6279
6503
|
//#endregion
|
|
6280
6504
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6281
|
-
var
|
|
6505
|
+
var Gr = "0.185.1", Kr = "4.2.0", qr = "https://cdn.jsdelivr.net/npm", Jr = `${qr}/three@${Gr}/+esm`, Yr = `${qr}/@google/model-viewer@${Kr}/dist/model-viewer.min.js`, Xr = (e) => import(
|
|
6282
6506
|
/* @vite-ignore */
|
|
6283
6507
|
/* webpackIgnore: true */
|
|
6284
6508
|
e
|
|
6285
|
-
),
|
|
6286
|
-
function
|
|
6287
|
-
if (
|
|
6509
|
+
), Zr = /* @__PURE__ */ new Map();
|
|
6510
|
+
function Qr(e) {
|
|
6511
|
+
if (Zr.has(e)) return Zr.get(e);
|
|
6288
6512
|
if (typeof window > "u") return new Promise(() => {});
|
|
6289
|
-
let t =
|
|
6290
|
-
throw
|
|
6513
|
+
let t = Xr(e).catch((t) => {
|
|
6514
|
+
throw Zr.delete(e), t;
|
|
6291
6515
|
});
|
|
6292
|
-
return
|
|
6516
|
+
return Zr.set(e, t), t;
|
|
6293
6517
|
}
|
|
6294
|
-
var
|
|
6295
|
-
function
|
|
6296
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6518
|
+
var $r = () => Qr(Jr), ei = (e) => Qr(`${qr}/three@${Gr}/examples/jsm/${e}/+esm`);
|
|
6519
|
+
function ti() {
|
|
6520
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Qr(Yr);
|
|
6297
6521
|
}
|
|
6298
|
-
var
|
|
6299
|
-
function
|
|
6522
|
+
var ni = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ri = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6523
|
+
function ii(e, t) {
|
|
6300
6524
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6301
6525
|
n = requestAnimationFrame(o), i ||= e;
|
|
6302
6526
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6315,7 +6539,7 @@ function Xr(e, t) {
|
|
|
6315
6539
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6316
6540
|
};
|
|
6317
6541
|
}
|
|
6318
|
-
function
|
|
6542
|
+
function ai(e, t, n = {}) {
|
|
6319
6543
|
let r = {
|
|
6320
6544
|
radius: n.distance ?? 4,
|
|
6321
6545
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6364,13 +6588,13 @@ function Zr(e, t, n = {}) {
|
|
|
6364
6588
|
}
|
|
6365
6589
|
//#endregion
|
|
6366
6590
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6367
|
-
var
|
|
6368
|
-
function
|
|
6591
|
+
var oi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, si = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ci = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, li = (e) => typeof e == "string" && !!e.trim();
|
|
6592
|
+
function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6369
6593
|
return /* @__PURE__ */ f("div", {
|
|
6370
6594
|
ref: r,
|
|
6371
6595
|
style: {
|
|
6372
6596
|
...P(i),
|
|
6373
|
-
minHeight:
|
|
6597
|
+
minHeight: oi(n, 320),
|
|
6374
6598
|
display: "flex",
|
|
6375
6599
|
flexDirection: "column",
|
|
6376
6600
|
alignItems: "center",
|
|
@@ -6398,24 +6622,24 @@ function ni({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6398
6622
|
}) : null]
|
|
6399
6623
|
});
|
|
6400
6624
|
}
|
|
6401
|
-
function
|
|
6625
|
+
function di({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6402
6626
|
let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
|
|
6403
6627
|
a(() => {
|
|
6404
6628
|
if (y || !e) return;
|
|
6405
6629
|
let t = !0;
|
|
6406
|
-
return
|
|
6630
|
+
return ti().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6407
6631
|
t = !1;
|
|
6408
6632
|
};
|
|
6409
6633
|
}, [y, e]);
|
|
6410
6634
|
let C = {
|
|
6411
6635
|
display: "block",
|
|
6412
6636
|
width: "100%",
|
|
6413
|
-
minHeight:
|
|
6414
|
-
height:
|
|
6637
|
+
minHeight: oi(r, 360),
|
|
6638
|
+
height: oi(r, 360),
|
|
6415
6639
|
backgroundColor: i || "transparent",
|
|
6416
6640
|
...P(g)
|
|
6417
6641
|
};
|
|
6418
|
-
if (!e) return v ? /* @__PURE__ */ d(
|
|
6642
|
+
if (!e) return v ? /* @__PURE__ */ d(ui, {
|
|
6419
6643
|
nodeRef: _,
|
|
6420
6644
|
style: g,
|
|
6421
6645
|
height: r,
|
|
@@ -6450,13 +6674,13 @@ function ri({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6450
6674
|
poster: t || void 0,
|
|
6451
6675
|
style: C,
|
|
6452
6676
|
"camera-controls": w(!v && c !== !1),
|
|
6453
|
-
"auto-rotate": w(T && !
|
|
6454
|
-
"auto-rotate-delay": T ? String(
|
|
6677
|
+
"auto-rotate": w(T && !ni()),
|
|
6678
|
+
"auto-rotate-delay": T ? String(oi(s, 0)) : void 0,
|
|
6455
6679
|
"rotation-per-second": "18deg",
|
|
6456
6680
|
ar: w(!v && u === !0),
|
|
6457
6681
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6458
|
-
"shadow-intensity": String(
|
|
6459
|
-
exposure: String(
|
|
6682
|
+
"shadow-intensity": String(si(p, 100)),
|
|
6683
|
+
exposure: String(si(f, 100)),
|
|
6460
6684
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6461
6685
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6462
6686
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6474,7 +6698,7 @@ function ri({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6474
6698
|
}) : null
|
|
6475
6699
|
});
|
|
6476
6700
|
}
|
|
6477
|
-
var
|
|
6701
|
+
var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), pi = [
|
|
6478
6702
|
"precision highp float;",
|
|
6479
6703
|
"uniform vec2 u_res;",
|
|
6480
6704
|
"uniform float u_time;",
|
|
@@ -6497,7 +6721,7 @@ var ii = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6497
6721
|
" return v;",
|
|
6498
6722
|
"}",
|
|
6499
6723
|
""
|
|
6500
|
-
].join("\n"),
|
|
6724
|
+
].join("\n"), mi = {
|
|
6501
6725
|
gradient: [
|
|
6502
6726
|
"void main(){",
|
|
6503
6727
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6549,7 +6773,7 @@ var ii = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6549
6773
|
"}"
|
|
6550
6774
|
].join("\n")
|
|
6551
6775
|
};
|
|
6552
|
-
function
|
|
6776
|
+
function hi(e, t) {
|
|
6553
6777
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6554
6778
|
if (!n) return t;
|
|
6555
6779
|
let r = parseInt(n[1], 16);
|
|
@@ -6559,7 +6783,7 @@ function si(e, t) {
|
|
|
6559
6783
|
(r & 255) / 255
|
|
6560
6784
|
];
|
|
6561
6785
|
}
|
|
6562
|
-
function
|
|
6786
|
+
function gi(e, t, n) {
|
|
6563
6787
|
let r = e.createShader(t);
|
|
6564
6788
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6565
6789
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6567,13 +6791,13 @@ function ci(e, t, n) {
|
|
|
6567
6791
|
}
|
|
6568
6792
|
return r;
|
|
6569
6793
|
}
|
|
6570
|
-
function
|
|
6794
|
+
function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6571
6795
|
let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
|
|
6572
6796
|
a(() => () => {
|
|
6573
6797
|
let e = y.current;
|
|
6574
6798
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6575
6799
|
}, []);
|
|
6576
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
6800
|
+
let S = typeof t == "string" && t.trim() ? t : mi[e] ?? mi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = si(o, 100), D = Math.max(.05, si(s, 100));
|
|
6577
6801
|
return a(() => {
|
|
6578
6802
|
let e = _.current, t = v.current;
|
|
6579
6803
|
if (!e || !t) return;
|
|
@@ -6588,7 +6812,7 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6588
6812
|
}
|
|
6589
6813
|
let r = null;
|
|
6590
6814
|
try {
|
|
6591
|
-
let e =
|
|
6815
|
+
let e = gi(n, n.VERTEX_SHADER, fi), t = gi(n, n.FRAGMENT_SHADER, pi + S);
|
|
6592
6816
|
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");
|
|
6593
6817
|
x("");
|
|
6594
6818
|
} catch (e) {
|
|
@@ -6624,28 +6848,28 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6624
6848
|
};
|
|
6625
6849
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6626
6850
|
let u = () => {
|
|
6627
|
-
let r =
|
|
6851
|
+
let r = ri(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6628
6852
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6629
6853
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6630
6854
|
d?.observe(t), u();
|
|
6631
|
-
let f =
|
|
6632
|
-
a:
|
|
6855
|
+
let f = ni(), m = {
|
|
6856
|
+
a: hi(C, [
|
|
6633
6857
|
.35,
|
|
6634
6858
|
.4,
|
|
6635
6859
|
.95
|
|
6636
6860
|
]),
|
|
6637
|
-
b:
|
|
6861
|
+
b: hi(w, [
|
|
6638
6862
|
.05,
|
|
6639
6863
|
.06,
|
|
6640
6864
|
.16
|
|
6641
6865
|
]),
|
|
6642
|
-
c:
|
|
6866
|
+
c: hi(T, [
|
|
6643
6867
|
.95,
|
|
6644
6868
|
.35,
|
|
6645
6869
|
.6
|
|
6646
6870
|
])
|
|
6647
6871
|
}, h = {};
|
|
6648
|
-
return h.stop =
|
|
6872
|
+
return h.stop = ii(t, (t, r) => {
|
|
6649
6873
|
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?.();
|
|
6650
6874
|
}), () => {
|
|
6651
6875
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6664,7 +6888,7 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6664
6888
|
},
|
|
6665
6889
|
style: {
|
|
6666
6890
|
position: "relative",
|
|
6667
|
-
minHeight:
|
|
6891
|
+
minHeight: oi(u, 320),
|
|
6668
6892
|
overflow: "hidden",
|
|
6669
6893
|
...P(m)
|
|
6670
6894
|
},
|
|
@@ -6696,7 +6920,7 @@ function li({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6696
6920
|
}) : null]
|
|
6697
6921
|
});
|
|
6698
6922
|
}
|
|
6699
|
-
function
|
|
6923
|
+
function vi(e, t) {
|
|
6700
6924
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6701
6925
|
r.deleteAttribute("uv");
|
|
6702
6926
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6712,23 +6936,23 @@ function ui(e, t) {
|
|
|
6712
6936
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6713
6937
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6714
6938
|
}
|
|
6715
|
-
var
|
|
6716
|
-
function
|
|
6717
|
-
if (
|
|
6718
|
-
let t =
|
|
6939
|
+
var yi = /* @__PURE__ */ new Map();
|
|
6940
|
+
function bi(e) {
|
|
6941
|
+
if (yi.has(e)) return yi.get(e);
|
|
6942
|
+
let t = ei("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6719
6943
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6720
6944
|
})).catch((t) => {
|
|
6721
|
-
throw
|
|
6945
|
+
throw yi.delete(e), t;
|
|
6722
6946
|
});
|
|
6723
|
-
return
|
|
6947
|
+
return yi.set(e, t), t;
|
|
6724
6948
|
}
|
|
6725
|
-
function
|
|
6949
|
+
function xi(e, t) {
|
|
6726
6950
|
let n = new e.Box3().setFromObject(t);
|
|
6727
6951
|
if (n.isEmpty()) return t;
|
|
6728
6952
|
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();
|
|
6729
6953
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6730
6954
|
}
|
|
6731
|
-
var
|
|
6955
|
+
var Si = {
|
|
6732
6956
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6733
6957
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6734
6958
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6737,50 +6961,50 @@ var mi = {
|
|
|
6737
6961
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6738
6962
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6739
6963
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6740
|
-
},
|
|
6741
|
-
function
|
|
6742
|
-
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
6964
|
+
}, Ci = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
6965
|
+
function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
|
|
6966
|
+
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !ni(), S = s !== !1 && !h;
|
|
6743
6967
|
return a(() => {
|
|
6744
6968
|
let e = g.current;
|
|
6745
6969
|
if (!e) return;
|
|
6746
6970
|
let i = !0, a = null;
|
|
6747
|
-
return
|
|
6971
|
+
return $r().then((s) => {
|
|
6748
6972
|
if (!i || !e) return;
|
|
6749
6973
|
let c = new s.WebGLRenderer({
|
|
6750
6974
|
antialias: !0,
|
|
6751
6975
|
alpha: !t
|
|
6752
6976
|
});
|
|
6753
|
-
c.setPixelRatio(
|
|
6977
|
+
c.setPixelRatio(ri()), c.shadowMap.enabled = u !== !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);
|
|
6754
6978
|
let l = new s.Scene();
|
|
6755
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6756
|
-
let d = new s.PerspectiveCamera(
|
|
6757
|
-
distance:
|
|
6979
|
+
t && (l.background = new s.Color(t)), l.environment = vi(s, c);
|
|
6980
|
+
let d = new s.PerspectiveCamera(Ci(r, 45), 1, .1, 400), f = ai(d, c.domElement, {
|
|
6981
|
+
distance: Ci(n, 5),
|
|
6758
6982
|
enableZoom: S
|
|
6759
6983
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6760
6984
|
p.position.set(4, 7, 5), p.castShadow = u !== !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));
|
|
6761
6985
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6762
|
-
let n =
|
|
6763
|
-
e.position.set(
|
|
6986
|
+
let n = Ci(t.scale, 1);
|
|
6987
|
+
e.position.set(Ci(t.x, 0), Ci(t.y, 0), Ci(t.z, 0)), e.rotation.set(ci(t.rx), ci(t.ry), ci(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ci(t.spin);
|
|
6764
6988
|
};
|
|
6765
6989
|
for (let e of y) {
|
|
6766
6990
|
if (e.shape === "model") {
|
|
6767
|
-
if (!
|
|
6991
|
+
if (!li(e.src)) continue;
|
|
6768
6992
|
let t = new s.Group();
|
|
6769
|
-
g(t, e), h.add(t),
|
|
6993
|
+
g(t, e), h.add(t), bi(e.src).then((e) => {
|
|
6770
6994
|
if (!i) return;
|
|
6771
|
-
let n =
|
|
6995
|
+
let n = xi(s, e.clone(!0));
|
|
6772
6996
|
n.traverse((e) => {
|
|
6773
6997
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6774
6998
|
}), t.add(n);
|
|
6775
6999
|
}, () => {});
|
|
6776
7000
|
continue;
|
|
6777
7001
|
}
|
|
6778
|
-
let t = (
|
|
7002
|
+
let t = (Si[e.shape] ?? Si.box)(s), n = new s.MeshStandardMaterial({
|
|
6779
7003
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6780
|
-
metalness: Math.min(1, Math.max(0,
|
|
6781
|
-
roughness: Math.min(1, Math.max(0,
|
|
6782
|
-
transparent:
|
|
6783
|
-
opacity: Math.min(1, Math.max(0,
|
|
7004
|
+
metalness: Math.min(1, Math.max(0, si(e.metalness, 10))),
|
|
7005
|
+
roughness: Math.min(1, Math.max(0, si(e.roughness, 35))),
|
|
7006
|
+
transparent: si(e.opacity, 100) < 1,
|
|
7007
|
+
opacity: Math.min(1, Math.max(0, si(e.opacity, 100))),
|
|
6784
7008
|
flatShading: e.flat === !0,
|
|
6785
7009
|
wireframe: e.wireframe === !0,
|
|
6786
7010
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -6791,14 +7015,14 @@ function gi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6791
7015
|
let _ = null;
|
|
6792
7016
|
if (u !== !1) {
|
|
6793
7017
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6794
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7018
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Ci(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
6795
7019
|
}
|
|
6796
7020
|
let v = () => {
|
|
6797
7021
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6798
7022
|
c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
6799
7023
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6800
7024
|
b?.observe(e), v();
|
|
6801
|
-
let C =
|
|
7025
|
+
let C = ci(Number.isFinite(Number(o)) ? o : 20), w = ii(e, (e) => {
|
|
6802
7026
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
6803
7027
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6804
7028
|
c.render(l, d);
|
|
@@ -6822,7 +7046,7 @@ function gi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6822
7046
|
o,
|
|
6823
7047
|
S,
|
|
6824
7048
|
u
|
|
6825
|
-
]), _ && h ? /* @__PURE__ */ d(
|
|
7049
|
+
]), _ && h ? /* @__PURE__ */ d(ui, {
|
|
6826
7050
|
nodeRef: m,
|
|
6827
7051
|
style: p,
|
|
6828
7052
|
height: f,
|
|
@@ -6833,27 +7057,27 @@ function gi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6833
7057
|
g.current = e, typeof m == "function" && m(e);
|
|
6834
7058
|
},
|
|
6835
7059
|
style: {
|
|
6836
|
-
minHeight:
|
|
6837
|
-
height:
|
|
7060
|
+
minHeight: oi(f, 380),
|
|
7061
|
+
height: oi(f, 380),
|
|
6838
7062
|
overflow: "hidden",
|
|
6839
7063
|
touchAction: S ? "pan-y" : void 0,
|
|
6840
7064
|
...P(p)
|
|
6841
7065
|
}
|
|
6842
7066
|
});
|
|
6843
7067
|
}
|
|
6844
|
-
function
|
|
7068
|
+
function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
|
|
6845
7069
|
let s = c(null), [u, f] = l("");
|
|
6846
7070
|
return a(() => {
|
|
6847
7071
|
let t = s.current;
|
|
6848
7072
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
6849
7073
|
let r = !0, i = null;
|
|
6850
|
-
return
|
|
7074
|
+
return $r().then((a) => {
|
|
6851
7075
|
if (!r || !t) return;
|
|
6852
7076
|
let o = new a.WebGLRenderer({
|
|
6853
7077
|
antialias: !0,
|
|
6854
7078
|
alpha: !n
|
|
6855
7079
|
});
|
|
6856
|
-
o.setPixelRatio(
|
|
7080
|
+
o.setPixelRatio(ri()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
6857
7081
|
let s = new a.Scene();
|
|
6858
7082
|
n && (s.background = new a.Color(n));
|
|
6859
7083
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -6876,7 +7100,7 @@ function _i({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
6876
7100
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
6877
7101
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6878
7102
|
d?.observe(t), u();
|
|
6879
|
-
let p = !1, m =
|
|
7103
|
+
let p = !1, m = ii(t, (e, t) => {
|
|
6880
7104
|
if (!p && typeof l?.frame == "function") try {
|
|
6881
7105
|
l.frame(e, t);
|
|
6882
7106
|
} catch (e) {
|
|
@@ -6898,7 +7122,7 @@ function _i({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
6898
7122
|
e,
|
|
6899
7123
|
o,
|
|
6900
7124
|
n
|
|
6901
|
-
]), o ? /* @__PURE__ */ d(
|
|
7125
|
+
]), o ? /* @__PURE__ */ d(ui, {
|
|
6902
7126
|
nodeRef: i,
|
|
6903
7127
|
style: r,
|
|
6904
7128
|
height: t,
|
|
@@ -6909,8 +7133,8 @@ function _i({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
6909
7133
|
s.current = e, typeof i == "function" && i(e);
|
|
6910
7134
|
},
|
|
6911
7135
|
style: {
|
|
6912
|
-
minHeight:
|
|
6913
|
-
height:
|
|
7136
|
+
minHeight: oi(t, 380),
|
|
7137
|
+
height: oi(t, 380),
|
|
6914
7138
|
overflow: "hidden",
|
|
6915
7139
|
position: "relative",
|
|
6916
7140
|
touchAction: "pan-y",
|
|
@@ -6933,40 +7157,40 @@ function _i({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
6933
7157
|
}) : null
|
|
6934
7158
|
});
|
|
6935
7159
|
}
|
|
6936
|
-
var
|
|
6937
|
-
ModelViewerBlock:
|
|
6938
|
-
ShaderBlock:
|
|
6939
|
-
SceneBlock:
|
|
6940
|
-
ThreeCanvasBlock:
|
|
6941
|
-
},
|
|
6942
|
-
function
|
|
6943
|
-
if (
|
|
7160
|
+
var Ei = {
|
|
7161
|
+
ModelViewerBlock: di,
|
|
7162
|
+
ShaderBlock: _i,
|
|
7163
|
+
SceneBlock: wi,
|
|
7164
|
+
ThreeCanvasBlock: Ti
|
|
7165
|
+
}, Di = /* @__PURE__ */ new Map();
|
|
7166
|
+
function Oi(e) {
|
|
7167
|
+
if (Di.has(e)) return Di.get(e);
|
|
6944
7168
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
6945
7169
|
/* @vite-ignore */
|
|
6946
7170
|
/* webpackIgnore: true */
|
|
6947
7171
|
t
|
|
6948
7172
|
).finally(() => URL.revokeObjectURL(t));
|
|
6949
|
-
return
|
|
7173
|
+
return Di.set(e, n), n;
|
|
6950
7174
|
}
|
|
6951
|
-
function
|
|
7175
|
+
function ki(e) {
|
|
6952
7176
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
6953
7177
|
return n && typeof n == "object" ? n : {};
|
|
6954
7178
|
}
|
|
6955
7179
|
//#endregion
|
|
6956
7180
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
6957
|
-
async function
|
|
6958
|
-
let n = await
|
|
7181
|
+
async function Ai(e, t) {
|
|
7182
|
+
let n = await Oi(e);
|
|
6959
7183
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
6960
7184
|
}
|
|
6961
|
-
var
|
|
7185
|
+
var ji = {
|
|
6962
7186
|
padding: "10px 12px",
|
|
6963
7187
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
6964
7188
|
borderRadius: 8,
|
|
6965
7189
|
fontSize: 12,
|
|
6966
7190
|
opacity: .6
|
|
6967
7191
|
};
|
|
6968
|
-
function
|
|
6969
|
-
let s = i(Y), l =
|
|
7192
|
+
function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
7193
|
+
let s = i(Y), l = ki(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
6970
7194
|
tenant: s?.tenant ?? "",
|
|
6971
7195
|
apiUrl: s?.apiUrl ?? "/api",
|
|
6972
7196
|
locale: s?.locale ?? "",
|
|
@@ -6978,7 +7202,7 @@ function wi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
6978
7202
|
let e = u.current;
|
|
6979
7203
|
if (!l?.code || !e) return;
|
|
6980
7204
|
let n = !0;
|
|
6981
|
-
return
|
|
7205
|
+
return Ai(l.code, t).then((e) => {
|
|
6982
7206
|
if (!(!n || !e || !u.current)) {
|
|
6983
7207
|
p.current = e;
|
|
6984
7208
|
try {
|
|
@@ -7008,7 +7232,7 @@ function wi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7008
7232
|
}) : /* @__PURE__ */ f("div", {
|
|
7009
7233
|
ref: o,
|
|
7010
7234
|
style: {
|
|
7011
|
-
...
|
|
7235
|
+
...ji,
|
|
7012
7236
|
...P(r)
|
|
7013
7237
|
},
|
|
7014
7238
|
children: [
|
|
@@ -7020,13 +7244,13 @@ function wi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7020
7244
|
}
|
|
7021
7245
|
//#endregion
|
|
7022
7246
|
//#region ../ui/src/components/builder/render.jsx
|
|
7023
|
-
var
|
|
7024
|
-
...
|
|
7025
|
-
...
|
|
7026
|
-
...
|
|
7027
|
-
PluginBlock:
|
|
7247
|
+
var Ni = {
|
|
7248
|
+
...dr,
|
|
7249
|
+
...Wr,
|
|
7250
|
+
...Ei,
|
|
7251
|
+
PluginBlock: Mi
|
|
7028
7252
|
};
|
|
7029
|
-
function
|
|
7253
|
+
function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7030
7254
|
let o = n[e];
|
|
7031
7255
|
if (!o || o.hidden) return null;
|
|
7032
7256
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7034,11 +7258,11 @@ function Ei(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7034
7258
|
let n = o.props?.componentId, s = r?.[n];
|
|
7035
7259
|
if (!s?.template || i.has(n)) return null;
|
|
7036
7260
|
let c = new Set(i).add(n);
|
|
7037
|
-
return /* @__PURE__ */ d(t, { children:
|
|
7261
|
+
return /* @__PURE__ */ d(t, { children: Pi(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
7038
7262
|
}
|
|
7039
|
-
let l =
|
|
7263
|
+
let l = Ni[s];
|
|
7040
7264
|
if (!l) return null;
|
|
7041
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
7265
|
+
let u = (o.nodes ?? []).map((e) => Pi(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Pi(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
7042
7266
|
...c,
|
|
7043
7267
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7044
7268
|
linked: p,
|
|
@@ -7047,16 +7271,16 @@ function Ei(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7047
7271
|
},
|
|
7048
7272
|
children: u.length ? u : void 0
|
|
7049
7273
|
}, e);
|
|
7050
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
7274
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(xr, {
|
|
7051
7275
|
when: c.when,
|
|
7052
7276
|
children: m
|
|
7053
7277
|
}, e) : m;
|
|
7054
7278
|
}
|
|
7055
7279
|
//#endregion
|
|
7056
7280
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7057
|
-
var
|
|
7281
|
+
var Fi = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ii = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(me(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7058
7282
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(me(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7059
|
-
function
|
|
7283
|
+
function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
7060
7284
|
let y = o?.js?.trim();
|
|
7061
7285
|
if (a(() => {
|
|
7062
7286
|
if (!y) return;
|
|
@@ -7070,11 +7294,11 @@ function ki({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7070
7294
|
minHeight: "100%",
|
|
7071
7295
|
display: "flex",
|
|
7072
7296
|
flexDirection: "column"
|
|
7073
|
-
}, w =
|
|
7297
|
+
}, w = Pi("ROOT", e, n), T = s(() => ({ render: (t, r) => Pi(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = se(e, n), O = oe(e, n), k = o?.css?.trim(), j = S(c), M = pe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !ue[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
7074
7298
|
rel: "stylesheet",
|
|
7075
7299
|
precedence: "default",
|
|
7076
7300
|
href: D(e)
|
|
7077
|
-
}, e)), F =
|
|
7301
|
+
}, e)), F = Ii(M);
|
|
7078
7302
|
return r === "auto" ? /* @__PURE__ */ d(Y.Provider, {
|
|
7079
7303
|
value: {
|
|
7080
7304
|
tenant: l || "",
|
|
@@ -7082,7 +7306,7 @@ function ki({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7082
7306
|
locale: m || "",
|
|
7083
7307
|
settings: _ ?? null
|
|
7084
7308
|
},
|
|
7085
|
-
children: /* @__PURE__ */ d(
|
|
7309
|
+
children: /* @__PURE__ */ d(br, {
|
|
7086
7310
|
initialUser: v,
|
|
7087
7311
|
children: /* @__PURE__ */ d(xe.Provider, {
|
|
7088
7312
|
value: p ?? null,
|
|
@@ -7097,8 +7321,8 @@ function ki({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7097
7321
|
...i
|
|
7098
7322
|
},
|
|
7099
7323
|
children: [
|
|
7100
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
7101
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7324
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Fi(me(M.light))} }
|
|
7325
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Fi(me(M.dark))} } }` }),
|
|
7102
7326
|
/* @__PURE__ */ d("style", { children: F }),
|
|
7103
7327
|
P,
|
|
7104
7328
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -7118,7 +7342,7 @@ function ki({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7118
7342
|
locale: m || "",
|
|
7119
7343
|
settings: _ ?? null
|
|
7120
7344
|
},
|
|
7121
|
-
children: /* @__PURE__ */ d(
|
|
7345
|
+
children: /* @__PURE__ */ d(br, {
|
|
7122
7346
|
initialUser: v,
|
|
7123
7347
|
children: /* @__PURE__ */ d(xe.Provider, {
|
|
7124
7348
|
value: p ?? null,
|
|
@@ -7151,8 +7375,8 @@ function ki({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7151
7375
|
}
|
|
7152
7376
|
//#endregion
|
|
7153
7377
|
//#region src/WebimContent.jsx
|
|
7154
|
-
function
|
|
7155
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
7378
|
+
function Ri({ bundle: e, mode: t = "auto", style: n }) {
|
|
7379
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Li, {
|
|
7156
7380
|
blocks: e.blocks,
|
|
7157
7381
|
theme: e.theme,
|
|
7158
7382
|
components: e.components,
|
|
@@ -7170,7 +7394,7 @@ function Ai({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7170
7394
|
}
|
|
7171
7395
|
//#endregion
|
|
7172
7396
|
//#region src/bundle.js
|
|
7173
|
-
function
|
|
7397
|
+
function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
7174
7398
|
let a = {
|
|
7175
7399
|
...t?.global ?? {},
|
|
7176
7400
|
...t?.tenant ?? {}
|
|
@@ -7196,18 +7420,18 @@ function ji({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7196
7420
|
}
|
|
7197
7421
|
//#endregion
|
|
7198
7422
|
//#region src/fetchPage.js
|
|
7199
|
-
var
|
|
7423
|
+
var Bi = async (e) => {
|
|
7200
7424
|
let t = await e.json().catch(() => null);
|
|
7201
7425
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
7202
7426
|
return t?.payload ?? t;
|
|
7203
7427
|
};
|
|
7204
|
-
async function
|
|
7428
|
+
async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
7205
7429
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
7206
7430
|
if (!n) throw Error("fetchPage: slug is required");
|
|
7207
7431
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
7208
7432
|
...t ? { "x-tenant": t } : {},
|
|
7209
7433
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
7210
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
7434
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Bi), c(`${l}/settings/public`, { headers: u }).then(Bi)]), p = zi({
|
|
7211
7435
|
page: d,
|
|
7212
7436
|
settings: f,
|
|
7213
7437
|
tenant: t,
|
|
@@ -7222,7 +7446,7 @@ async function Ni({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7222
7446
|
"LogoCarousel"
|
|
7223
7447
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
7224
7448
|
if (m.length) {
|
|
7225
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
7449
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Bi).then((e) => {
|
|
7226
7450
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
7227
7451
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
7228
7452
|
}).catch(() => [[t, []]])));
|
|
@@ -7236,40 +7460,40 @@ async function Ni({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7236
7460
|
}
|
|
7237
7461
|
//#endregion
|
|
7238
7462
|
//#region src/ssr.jsx
|
|
7239
|
-
var
|
|
7463
|
+
var Hi = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
7240
7464
|
"&": "&",
|
|
7241
7465
|
"<": "<",
|
|
7242
7466
|
">": ">",
|
|
7243
7467
|
"\"": """
|
|
7244
7468
|
})[e]);
|
|
7245
|
-
function
|
|
7246
|
-
return e(/* @__PURE__ */ d(
|
|
7469
|
+
function Ui(t, { mode: n = "auto", style: r } = {}) {
|
|
7470
|
+
return e(/* @__PURE__ */ d(Ri, {
|
|
7247
7471
|
bundle: t,
|
|
7248
7472
|
mode: n,
|
|
7249
7473
|
style: r
|
|
7250
7474
|
}));
|
|
7251
7475
|
}
|
|
7252
|
-
function
|
|
7476
|
+
function Wi(e, { mode: t = "auto", lang: n } = {}) {
|
|
7253
7477
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
7254
7478
|
"<meta charset=\"utf-8\"/>",
|
|
7255
7479
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
7256
|
-
`<title>${
|
|
7257
|
-
r.description && `<meta name="description" content="${
|
|
7258
|
-
`<meta property="og:title" content="${
|
|
7259
|
-
r.image && `<meta property="og:image" content="${
|
|
7480
|
+
`<title>${Hi(o)}</title>`,
|
|
7481
|
+
r.description && `<meta name="description" content="${Hi(r.description)}"/>`,
|
|
7482
|
+
`<meta property="og:title" content="${Hi(o)}"/>`,
|
|
7483
|
+
r.image && `<meta property="og:image" content="${Hi(r.image)}"/>`,
|
|
7260
7484
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
7261
7485
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
7262
7486
|
].filter(Boolean).join("\n");
|
|
7263
7487
|
return `<!doctype html>
|
|
7264
|
-
<html lang="${
|
|
7488
|
+
<html lang="${Hi(i)}"${a ? ` dir="${a}"` : ""}>
|
|
7265
7489
|
<head>
|
|
7266
7490
|
${c}
|
|
7267
7491
|
</head>
|
|
7268
7492
|
<body>
|
|
7269
|
-
${
|
|
7493
|
+
${Ui(e, { mode: t })}
|
|
7270
7494
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
7271
7495
|
</body>
|
|
7272
7496
|
</html>`;
|
|
7273
7497
|
}
|
|
7274
7498
|
//#endregion
|
|
7275
|
-
export {
|
|
7499
|
+
export { zi as assembleBundle, Vi as fetchPage, Ui as renderBundleHtml, Wi as renderPageDocument };
|