@realtek/core-theme 0.0.263 → 0.0.265
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/dist-lib/{Breadcrumb-DoifsTga.js → Breadcrumb-BgXaVW_N.js} +646 -598
- package/dist-lib/Breadcrumb-BgXaVW_N.js.map +1 -0
- package/dist-lib/Breadcrumb-DVoedtaa.cjs +3 -0
- package/dist-lib/Breadcrumb-DVoedtaa.cjs.map +1 -0
- package/dist-lib/index.cjs +5 -5
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +11679 -11606
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist-lib/Breadcrumb-CPjRRUg1.cjs +0 -3
- package/dist-lib/Breadcrumb-CPjRRUg1.cjs.map +0 -1
- package/dist-lib/Breadcrumb-DoifsTga.js.map +0 -1
|
@@ -1240,7 +1240,7 @@ async function It(e, { gateway: t, strategies: i }) {
|
|
|
1240
1240
|
async function Lt() {
|
|
1241
1241
|
let e = [];
|
|
1242
1242
|
try {
|
|
1243
|
-
e = await
|
|
1243
|
+
e = await Qn();
|
|
1244
1244
|
} catch {
|
|
1245
1245
|
e = [];
|
|
1246
1246
|
}
|
|
@@ -1273,20 +1273,20 @@ function Vt(e) {
|
|
|
1273
1273
|
let t = String(e ?? "").trim();
|
|
1274
1274
|
return t === "" || t === Bt;
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1276
|
+
function F(e = {}) {
|
|
1277
1277
|
let t = new URLSearchParams();
|
|
1278
1278
|
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
1279
1279
|
let n = t.toString();
|
|
1280
1280
|
return n ? `?${n}` : "";
|
|
1281
1281
|
}
|
|
1282
|
-
async function
|
|
1283
|
-
let i = await n(r, `${P}${
|
|
1282
|
+
async function Ht(e = "", t = {}) {
|
|
1283
|
+
let i = await n(r, `${P}${F({
|
|
1284
1284
|
...t,
|
|
1285
1285
|
module: e || t.module || ""
|
|
1286
1286
|
})}`), a = i?.data;
|
|
1287
1287
|
return Array.isArray(a) ? a : a && Array.isArray(a.groups) ? a.groups : Array.isArray(i) ? i : i && Array.isArray(i.groups) ? i.groups : [];
|
|
1288
1288
|
}
|
|
1289
|
-
async function
|
|
1289
|
+
async function Ut({ offset: e = 0, limit: t = 100, sortBy: i = "new", searchvalue: a = "" } = {}) {
|
|
1290
1290
|
let o = new URLSearchParams({
|
|
1291
1291
|
offset: String(e),
|
|
1292
1292
|
limit: String(t),
|
|
@@ -1297,28 +1297,28 @@ async function Wt({ offset: e = 0, limit: t = 100, sortBy: i = "new", searchvalu
|
|
|
1297
1297
|
let u = await n(r, `/client/view?${o.toString()}`), d = u?.data ?? u;
|
|
1298
1298
|
return d?.clients ?? d?.Clients ?? d?.items ?? [];
|
|
1299
1299
|
}
|
|
1300
|
-
async function
|
|
1300
|
+
async function Wt(e) {
|
|
1301
1301
|
let t = await n(r, `/filter-dropdown-fields?module=${encodeURIComponent(e)}`), i = t?.data ?? t;
|
|
1302
1302
|
return Array.isArray(i) ? i : [];
|
|
1303
1303
|
}
|
|
1304
|
-
async function
|
|
1305
|
-
return n(r, `${P}${
|
|
1304
|
+
async function Gt(e, t = {}) {
|
|
1305
|
+
return n(r, `${P}${F(t)}`, {
|
|
1306
1306
|
method: "POST",
|
|
1307
1307
|
headers: { "Content-Type": "application/json" },
|
|
1308
1308
|
body: JSON.stringify(e)
|
|
1309
1309
|
});
|
|
1310
1310
|
}
|
|
1311
|
-
async function
|
|
1312
|
-
return n(r, `${P}/${e}${
|
|
1311
|
+
async function Kt(e, t, i = {}) {
|
|
1312
|
+
return n(r, `${P}/${e}${F(i)}`, {
|
|
1313
1313
|
method: "PUT",
|
|
1314
1314
|
headers: { "Content-Type": "application/json" },
|
|
1315
1315
|
body: JSON.stringify(t)
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
|
-
async function
|
|
1319
|
-
return n(r, `${P}/${e}${
|
|
1318
|
+
async function qt(e, t = {}) {
|
|
1319
|
+
return n(r, `${P}/${e}${F(t)}`, { method: "DELETE" });
|
|
1320
1320
|
}
|
|
1321
|
-
async function
|
|
1321
|
+
async function Jt(e, t) {
|
|
1322
1322
|
return n(r, `${zt}/request-otp`, {
|
|
1323
1323
|
method: "POST",
|
|
1324
1324
|
body: JSON.stringify({
|
|
@@ -1327,7 +1327,7 @@ async function Yt(e, t) {
|
|
|
1327
1327
|
})
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
1330
|
-
async function
|
|
1330
|
+
async function Yt(e, t, i) {
|
|
1331
1331
|
return n(r, `${zt}/apply`, {
|
|
1332
1332
|
method: "POST",
|
|
1333
1333
|
body: JSON.stringify({
|
|
@@ -1337,9 +1337,9 @@ async function Xt(e, t, i) {
|
|
|
1337
1337
|
})
|
|
1338
1338
|
});
|
|
1339
1339
|
}
|
|
1340
|
-
var
|
|
1341
|
-
async function
|
|
1342
|
-
let i = await n(r, `${
|
|
1340
|
+
var Xt = "/admin/detail-config";
|
|
1341
|
+
async function Zt(e, t = {}) {
|
|
1342
|
+
let i = await n(r, `${Xt}${F({
|
|
1343
1343
|
module: e,
|
|
1344
1344
|
clientId: t.clientId
|
|
1345
1345
|
})}`), a = i?.data ?? i ?? {};
|
|
@@ -1350,8 +1350,8 @@ async function Qt(e, t = {}) {
|
|
|
1350
1350
|
merges: Array.isArray(a.merges) ? a.merges : []
|
|
1351
1351
|
};
|
|
1352
1352
|
}
|
|
1353
|
-
async function
|
|
1354
|
-
return n(r,
|
|
1353
|
+
async function Qt({ module: e, fields: t = [], merges: i = [], clientId: a = "" }) {
|
|
1354
|
+
return n(r, Xt, {
|
|
1355
1355
|
method: "POST",
|
|
1356
1356
|
headers: { "Content-Type": "application/json" },
|
|
1357
1357
|
body: JSON.stringify({
|
|
@@ -1362,88 +1362,88 @@ async function $t({ module: e, fields: t = [], merges: i = [], clientId: a = ""
|
|
|
1362
1362
|
})
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
1365
|
-
var
|
|
1366
|
-
async function
|
|
1367
|
-
let e = await n(r,
|
|
1365
|
+
var $t = "/admin/detail-defaults";
|
|
1366
|
+
async function en() {
|
|
1367
|
+
let e = await n(r, $t);
|
|
1368
1368
|
return e?.data ?? e ?? {};
|
|
1369
1369
|
}
|
|
1370
|
-
async function
|
|
1371
|
-
return n(r,
|
|
1370
|
+
async function tn(e) {
|
|
1371
|
+
return n(r, $t, {
|
|
1372
1372
|
method: "POST",
|
|
1373
1373
|
headers: { "Content-Type": "application/json" },
|
|
1374
1374
|
body: JSON.stringify(e)
|
|
1375
1375
|
});
|
|
1376
1376
|
}
|
|
1377
|
-
var
|
|
1378
|
-
async function
|
|
1379
|
-
let e = await n(r,
|
|
1377
|
+
var nn = "/admin/ai-service-config";
|
|
1378
|
+
async function rn() {
|
|
1379
|
+
let e = await n(r, nn);
|
|
1380
1380
|
return e?.data ?? e ?? [];
|
|
1381
1381
|
}
|
|
1382
|
-
async function
|
|
1383
|
-
return n(r,
|
|
1382
|
+
async function an(e) {
|
|
1383
|
+
return n(r, nn, {
|
|
1384
1384
|
method: "POST",
|
|
1385
1385
|
headers: { "Content-Type": "application/json" },
|
|
1386
1386
|
body: JSON.stringify(e)
|
|
1387
1387
|
});
|
|
1388
1388
|
}
|
|
1389
|
-
async function
|
|
1390
|
-
return n(r, `${
|
|
1389
|
+
async function on(e) {
|
|
1390
|
+
return n(r, `${nn}?serviceKey=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1391
1391
|
}
|
|
1392
|
-
var
|
|
1393
|
-
async function
|
|
1394
|
-
let e = await n(r,
|
|
1392
|
+
var sn = "/admin/bgc-integration-config";
|
|
1393
|
+
async function cn() {
|
|
1394
|
+
let e = await n(r, sn);
|
|
1395
1395
|
return e?.data ?? e ?? {
|
|
1396
1396
|
updateMethod: "MANUAL",
|
|
1397
1397
|
enabled: !0
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
|
-
async function
|
|
1401
|
-
return n(r,
|
|
1400
|
+
async function ln(e) {
|
|
1401
|
+
return n(r, sn, {
|
|
1402
1402
|
method: "PUT",
|
|
1403
1403
|
headers: { "Content-Type": "application/json" },
|
|
1404
1404
|
body: JSON.stringify(e)
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
|
-
async function
|
|
1407
|
+
async function un() {
|
|
1408
1408
|
let e = await n(r, "/integration-config/bgc/summary");
|
|
1409
1409
|
return e?.data ?? e ?? {
|
|
1410
1410
|
updateMethod: "MANUAL",
|
|
1411
1411
|
enabled: !0
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
|
-
var
|
|
1415
|
-
async function
|
|
1416
|
-
let e = await n(r,
|
|
1414
|
+
var I = "/admin/integration-config";
|
|
1415
|
+
async function dn() {
|
|
1416
|
+
let e = await n(r, I);
|
|
1417
1417
|
return e?.data ?? e ?? [];
|
|
1418
1418
|
}
|
|
1419
|
-
async function
|
|
1420
|
-
let t = await n(r, `${
|
|
1419
|
+
async function fn(e) {
|
|
1420
|
+
let t = await n(r, `${I}/${encodeURIComponent(e)}`);
|
|
1421
1421
|
return t?.data ?? t;
|
|
1422
1422
|
}
|
|
1423
|
-
async function
|
|
1423
|
+
async function pn(e) {
|
|
1424
1424
|
let t = e?.integrationKey;
|
|
1425
|
-
return n(r, t ? `${
|
|
1425
|
+
return n(r, t ? `${I}/${encodeURIComponent(t)}` : I, {
|
|
1426
1426
|
method: t ? "PUT" : "POST",
|
|
1427
1427
|
headers: { "Content-Type": "application/json" },
|
|
1428
1428
|
body: JSON.stringify(e)
|
|
1429
1429
|
});
|
|
1430
1430
|
}
|
|
1431
|
-
async function
|
|
1432
|
-
return n(r, `${
|
|
1431
|
+
async function mn(e) {
|
|
1432
|
+
return n(r, `${I}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1433
1433
|
}
|
|
1434
|
-
async function
|
|
1435
|
-
let t = await n(r, `${
|
|
1434
|
+
async function hn(e) {
|
|
1435
|
+
let t = await n(r, `${I}/test`, {
|
|
1436
1436
|
method: "POST",
|
|
1437
1437
|
headers: { "Content-Type": "application/json" },
|
|
1438
1438
|
body: JSON.stringify(e)
|
|
1439
1439
|
});
|
|
1440
1440
|
return t?.data ?? t;
|
|
1441
1441
|
}
|
|
1442
|
-
async function
|
|
1442
|
+
async function gn(e) {
|
|
1443
1443
|
let t = await n(r, `/integration-config/${encodeURIComponent(e)}/summary`);
|
|
1444
1444
|
return t?.data ?? t;
|
|
1445
1445
|
}
|
|
1446
|
-
async function
|
|
1446
|
+
async function _n(e, t, i) {
|
|
1447
1447
|
let a = await n(r, `/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(t)}`, {
|
|
1448
1448
|
method: "POST",
|
|
1449
1449
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1451,11 +1451,11 @@ async function vn(e, t, i) {
|
|
|
1451
1451
|
});
|
|
1452
1452
|
return a?.data ?? a;
|
|
1453
1453
|
}
|
|
1454
|
-
async function
|
|
1454
|
+
async function vn(e, t) {
|
|
1455
1455
|
let i = await n(r, `${P}?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}&view=detail`), a = i?.data ?? i;
|
|
1456
1456
|
return Array.isArray(a) ? a : [];
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function yn(e) {
|
|
1459
1459
|
return {
|
|
1460
1460
|
key: e.role_id ?? e.id,
|
|
1461
1461
|
roleId: e.role_id ?? e.id,
|
|
@@ -1466,17 +1466,17 @@ function bn(e) {
|
|
|
1466
1466
|
raw: e
|
|
1467
1467
|
};
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function L(e) {
|
|
1470
1470
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
1471
1471
|
}
|
|
1472
|
-
async function
|
|
1473
|
-
let e = await n(r, "/get-roles"), t = e.data ?? e, i = M(t?.zinnext_default).map(
|
|
1472
|
+
async function bn() {
|
|
1473
|
+
let e = await n(r, "/get-roles"), t = e.data ?? e, i = M(t?.zinnext_default).map(yn), a = M(t?.custom_roles).map(yn), o = [...i, ...a];
|
|
1474
1474
|
return {
|
|
1475
1475
|
roles: o,
|
|
1476
1476
|
total: o.length
|
|
1477
1477
|
};
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1479
|
+
function xn(e) {
|
|
1480
1480
|
return {
|
|
1481
1481
|
key: e.teamId,
|
|
1482
1482
|
teamId: e.teamId,
|
|
@@ -1489,10 +1489,10 @@ function Sn(e) {
|
|
|
1489
1489
|
raw: e
|
|
1490
1490
|
};
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function Sn(e) {
|
|
1493
1493
|
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
1494
1494
|
}
|
|
1495
|
-
async function
|
|
1495
|
+
async function Cn({ offset: e = 0, limit: t = 10, sortBy: i = "new", search: a = "" } = {}) {
|
|
1496
1496
|
let o = await n(r, `/get-teams?${new URLSearchParams({
|
|
1497
1497
|
searchquery: a,
|
|
1498
1498
|
sortBy: i,
|
|
@@ -1500,12 +1500,12 @@ async function wn({ offset: e = 0, limit: t = 10, sortBy: i = "new", search: a =
|
|
|
1500
1500
|
offset: String(e)
|
|
1501
1501
|
})}`), s = o.data ?? o, c = M(s?.teams, s, o?.teams), l = s?.totalCount ?? s?.total ?? c.length;
|
|
1502
1502
|
return {
|
|
1503
|
-
teams: c.map(
|
|
1503
|
+
teams: c.map(xn),
|
|
1504
1504
|
total: l
|
|
1505
1505
|
};
|
|
1506
1506
|
}
|
|
1507
|
-
async function
|
|
1508
|
-
return n(r, `/team/edit?teamId=${
|
|
1507
|
+
async function wn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
1508
|
+
return n(r, `/team/edit?teamId=${Sn(e)}`, {
|
|
1509
1509
|
method: "PUT",
|
|
1510
1510
|
body: JSON.stringify({
|
|
1511
1511
|
team_name: t,
|
|
@@ -1515,7 +1515,7 @@ async function Tn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
|
1515
1515
|
})
|
|
1516
1516
|
});
|
|
1517
1517
|
}
|
|
1518
|
-
async function
|
|
1518
|
+
async function Tn(e, t, i, a = "listView") {
|
|
1519
1519
|
let o = await n(r, `${A}?${new URLSearchParams({
|
|
1520
1520
|
module: e,
|
|
1521
1521
|
userId: "0",
|
|
@@ -1524,8 +1524,8 @@ async function En(e, t, i, a = "listView") {
|
|
|
1524
1524
|
})}`), s = o.data ?? o;
|
|
1525
1525
|
return M(s, s?.visibleFields, o?.visibleFields);
|
|
1526
1526
|
}
|
|
1527
|
-
async function
|
|
1528
|
-
let r =
|
|
1527
|
+
async function En(e, t = "listView", n = j) {
|
|
1528
|
+
let r = L(e), i = kt(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await Tn(n, "roleId", r, t)).map((t, i) => ({
|
|
1529
1529
|
...Dt(t, i),
|
|
1530
1530
|
module: e,
|
|
1531
1531
|
apiModule: n,
|
|
@@ -1533,8 +1533,8 @@ async function Dn(e, t = "listView", n = j) {
|
|
|
1533
1533
|
}))]));
|
|
1534
1534
|
return Object.fromEntries(a);
|
|
1535
1535
|
}
|
|
1536
|
-
async function
|
|
1537
|
-
let n =
|
|
1536
|
+
async function Dn(e, t = "listView") {
|
|
1537
|
+
let n = Sn(e), r = await Promise.all(j.map(async ({ key: e, apiModule: r }) => [e, (await Tn(r, "teamId", n, t)).map((t, i) => ({
|
|
1538
1538
|
...Dt(t, i),
|
|
1539
1539
|
module: e,
|
|
1540
1540
|
apiModule: r,
|
|
@@ -1542,7 +1542,7 @@ async function On(e, t = "listView") {
|
|
|
1542
1542
|
}))]));
|
|
1543
1543
|
return Object.fromEntries(r);
|
|
1544
1544
|
}
|
|
1545
|
-
function
|
|
1545
|
+
function On(e, t) {
|
|
1546
1546
|
let n = !t || t === "listView";
|
|
1547
1547
|
return e.map((e, r) => {
|
|
1548
1548
|
let i = {
|
|
@@ -1578,37 +1578,37 @@ function kn(e, t) {
|
|
|
1578
1578
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
1579
1579
|
});
|
|
1580
1580
|
}
|
|
1581
|
-
async function
|
|
1582
|
-
let s =
|
|
1581
|
+
async function kn(e, t, i, a = "listView", o = j) {
|
|
1582
|
+
let s = L(e), c = kt(o).find((e) => e.key === t)?.apiModule ?? t;
|
|
1583
1583
|
return n(r, `${A}/role`, {
|
|
1584
1584
|
method: "PUT",
|
|
1585
1585
|
body: JSON.stringify({
|
|
1586
1586
|
module: c,
|
|
1587
1587
|
roleId: s,
|
|
1588
1588
|
configType: a,
|
|
1589
|
-
visibleFields:
|
|
1589
|
+
visibleFields: On(i, a)
|
|
1590
1590
|
})
|
|
1591
1591
|
});
|
|
1592
1592
|
}
|
|
1593
|
-
var
|
|
1594
|
-
function
|
|
1593
|
+
var An = "/admin/role-form-permissions";
|
|
1594
|
+
function jn(e) {
|
|
1595
1595
|
return `__group__:${e}`;
|
|
1596
1596
|
}
|
|
1597
|
-
async function
|
|
1598
|
-
let a =
|
|
1597
|
+
async function Mn(e, t, i = {}) {
|
|
1598
|
+
let a = L(e), o = new URLSearchParams({
|
|
1599
1599
|
module: t,
|
|
1600
1600
|
roleId: String(a ?? "")
|
|
1601
1601
|
});
|
|
1602
1602
|
i.clientId && o.set("clientId", i.clientId), i.region && o.set("region", i.region);
|
|
1603
|
-
let s = await n(r, `${
|
|
1603
|
+
let s = await n(r, `${An}?${o}`), c = s?.data ?? s;
|
|
1604
1604
|
return Array.isArray(c) ? c : [];
|
|
1605
1605
|
}
|
|
1606
|
-
async function
|
|
1607
|
-
let a =
|
|
1606
|
+
async function Nn(e, t, i) {
|
|
1607
|
+
let a = L(e), o = [], s = 0;
|
|
1608
1608
|
for (let e of i) {
|
|
1609
1609
|
e.locked || o.push({
|
|
1610
1610
|
label: e.label,
|
|
1611
|
-
field:
|
|
1611
|
+
field: jn(e.name),
|
|
1612
1612
|
isVisible: e.enabled,
|
|
1613
1613
|
isEditable: e.editable !== !1,
|
|
1614
1614
|
order: s++
|
|
@@ -1631,19 +1631,19 @@ async function Pn(e, t, i) {
|
|
|
1631
1631
|
})
|
|
1632
1632
|
});
|
|
1633
1633
|
}
|
|
1634
|
-
async function
|
|
1635
|
-
let o =
|
|
1634
|
+
async function Pn(e, t, i, a = "listView") {
|
|
1635
|
+
let o = Sn(e), s = j.find((e) => e.key === t)?.apiModule ?? t;
|
|
1636
1636
|
return n(r, `${A}/team`, {
|
|
1637
1637
|
method: "PUT",
|
|
1638
1638
|
body: JSON.stringify({
|
|
1639
1639
|
module: s,
|
|
1640
1640
|
teamId: o,
|
|
1641
1641
|
configType: a,
|
|
1642
|
-
visibleFields:
|
|
1642
|
+
visibleFields: On(i, a)
|
|
1643
1643
|
})
|
|
1644
1644
|
});
|
|
1645
1645
|
}
|
|
1646
|
-
async function
|
|
1646
|
+
async function Fn({ offset: e = 0, limit: t = 10, sortBy: i = "new", searchQuery: a = "" } = {}) {
|
|
1647
1647
|
let o = new URLSearchParams({
|
|
1648
1648
|
offset: String(e),
|
|
1649
1649
|
limit: String(t),
|
|
@@ -1659,21 +1659,21 @@ async function In({ offset: e = 0, limit: t = 10, sortBy: i = "new", searchQuery
|
|
|
1659
1659
|
}, l)
|
|
1660
1660
|
};
|
|
1661
1661
|
}
|
|
1662
|
-
async function
|
|
1662
|
+
async function In(e = []) {
|
|
1663
1663
|
return n(r, `${A}/seed`, {
|
|
1664
1664
|
method: "POST",
|
|
1665
1665
|
headers: { "Content-Type": "application/json" },
|
|
1666
1666
|
body: JSON.stringify({ collections: e })
|
|
1667
1667
|
});
|
|
1668
1668
|
}
|
|
1669
|
-
async function
|
|
1669
|
+
async function Ln() {
|
|
1670
1670
|
let e = await n(r, `${A}/seed-status`), t = e?.data ?? e ?? {};
|
|
1671
1671
|
return {
|
|
1672
1672
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
1673
1673
|
seededModules: t.seededModules ?? {}
|
|
1674
1674
|
};
|
|
1675
1675
|
}
|
|
1676
|
-
async function
|
|
1676
|
+
async function Rn(e) {
|
|
1677
1677
|
let t = localStorage.getItem("authToken"), n = new FormData();
|
|
1678
1678
|
n.append("icon", e);
|
|
1679
1679
|
let i = await fetch(`${r}/admin/field-config/action-icon`, {
|
|
@@ -1688,11 +1688,11 @@ async function zn(e) {
|
|
|
1688
1688
|
let a = await i.json();
|
|
1689
1689
|
return a.data ?? a;
|
|
1690
1690
|
}
|
|
1691
|
-
async function
|
|
1691
|
+
async function zn() {
|
|
1692
1692
|
let [e, t, n] = await Promise.all([
|
|
1693
1693
|
Lt().catch(() => []),
|
|
1694
|
-
|
|
1695
|
-
|
|
1694
|
+
Yn().catch(() => []),
|
|
1695
|
+
mr().catch(() => [])
|
|
1696
1696
|
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
1697
1697
|
return [
|
|
1698
1698
|
...r,
|
|
@@ -1700,7 +1700,7 @@ async function Bn() {
|
|
|
1700
1700
|
...i
|
|
1701
1701
|
];
|
|
1702
1702
|
}
|
|
1703
|
-
async function
|
|
1703
|
+
async function Bn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
1704
1704
|
let a = await n(r, `/module/list?${new URLSearchParams({
|
|
1705
1705
|
module: e,
|
|
1706
1706
|
page: String(t),
|
|
@@ -1711,24 +1711,24 @@ async function Vn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
|
1711
1711
|
total: o.pagination?.total ?? 0
|
|
1712
1712
|
};
|
|
1713
1713
|
}
|
|
1714
|
-
async function
|
|
1714
|
+
async function Vn(e, t) {
|
|
1715
1715
|
return n(r, `/module/create?module=${encodeURIComponent(e)}`, {
|
|
1716
1716
|
method: "POST",
|
|
1717
1717
|
headers: { "Content-Type": "application/json" },
|
|
1718
1718
|
body: JSON.stringify(t)
|
|
1719
1719
|
});
|
|
1720
1720
|
}
|
|
1721
|
-
async function
|
|
1721
|
+
async function Hn(e, t, i) {
|
|
1722
1722
|
return n(r, `/module/update/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, {
|
|
1723
1723
|
method: "PUT",
|
|
1724
1724
|
headers: { "Content-Type": "application/json" },
|
|
1725
1725
|
body: JSON.stringify(i)
|
|
1726
1726
|
});
|
|
1727
1727
|
}
|
|
1728
|
-
async function
|
|
1728
|
+
async function Un(e, t) {
|
|
1729
1729
|
return n(r, `/module/delete/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1730
1730
|
}
|
|
1731
|
-
async function
|
|
1731
|
+
async function Wn(e = "", t = 50) {
|
|
1732
1732
|
let i = await n(r, `/admin/location-dropdown-values?${new URLSearchParams({
|
|
1733
1733
|
search: e,
|
|
1734
1734
|
limit: String(t),
|
|
@@ -1742,7 +1742,7 @@ async function Gn(e = "", t = 50) {
|
|
|
1742
1742
|
};
|
|
1743
1743
|
}).filter((e) => e.label);
|
|
1744
1744
|
}
|
|
1745
|
-
async function
|
|
1745
|
+
async function Gn(e, t, i = "_id") {
|
|
1746
1746
|
let a = await n(r, `/admin/lookup-dropdown-values?${new URLSearchParams({
|
|
1747
1747
|
collection: String(e),
|
|
1748
1748
|
displayField: String(t),
|
|
@@ -1753,11 +1753,11 @@ async function Kn(e, t, i = "_id") {
|
|
|
1753
1753
|
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
1754
1754
|
})).filter((e) => e.value && e.label);
|
|
1755
1755
|
}
|
|
1756
|
-
async function
|
|
1756
|
+
async function Kn(e) {
|
|
1757
1757
|
let t = await n(r, `/admin/default-fields?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
1758
1758
|
return Array.isArray(i.fields) ? i.fields : [];
|
|
1759
1759
|
}
|
|
1760
|
-
async function
|
|
1760
|
+
async function qn(e, t, i) {
|
|
1761
1761
|
return n(r, "/admin/default-fields", {
|
|
1762
1762
|
method: "PUT",
|
|
1763
1763
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1768,7 +1768,7 @@ async function Jn(e, t, i) {
|
|
|
1768
1768
|
})
|
|
1769
1769
|
});
|
|
1770
1770
|
}
|
|
1771
|
-
async function
|
|
1771
|
+
async function Jn(e) {
|
|
1772
1772
|
let t = await n(r, "/email-verify", {
|
|
1773
1773
|
method: "POST",
|
|
1774
1774
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1786,23 +1786,23 @@ async function Yn(e) {
|
|
|
1786
1786
|
checks: Array.isArray(i.checks) ? i.checks : []
|
|
1787
1787
|
};
|
|
1788
1788
|
}
|
|
1789
|
-
async function
|
|
1789
|
+
async function Yn() {
|
|
1790
1790
|
let e = await n(r, "/admin/lookup/collections"), t = e.data ?? e;
|
|
1791
1791
|
return Array.isArray(t) ? t : [];
|
|
1792
1792
|
}
|
|
1793
|
-
async function
|
|
1793
|
+
async function Xn(e) {
|
|
1794
1794
|
let t = await n(r, `/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`), i = t.data ?? t;
|
|
1795
1795
|
return Array.isArray(i) ? i : [];
|
|
1796
1796
|
}
|
|
1797
|
-
async function
|
|
1797
|
+
async function Zn(e, t) {
|
|
1798
1798
|
let i = await n(r, `/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(t)}`), a = i.data ?? i;
|
|
1799
1799
|
return Array.isArray(a?.fields) ? a.fields : [];
|
|
1800
1800
|
}
|
|
1801
|
-
async function
|
|
1801
|
+
async function Qn() {
|
|
1802
1802
|
let e = await n(r, "/admin/menu-modules");
|
|
1803
1803
|
return M(e.data, e);
|
|
1804
1804
|
}
|
|
1805
|
-
async function
|
|
1805
|
+
async function $n({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMenuId: a = 0, displayOrder: o = 0 }) {
|
|
1806
1806
|
let s = await n(r, "/admin/menu-modules", {
|
|
1807
1807
|
method: "POST",
|
|
1808
1808
|
body: JSON.stringify({
|
|
@@ -1815,22 +1815,22 @@ async function er({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMen
|
|
|
1815
1815
|
});
|
|
1816
1816
|
return s.data ?? s;
|
|
1817
1817
|
}
|
|
1818
|
-
async function
|
|
1818
|
+
async function er(e, { menuName: t }) {
|
|
1819
1819
|
let i = await n(r, `/admin/menu-modules/${e}`, {
|
|
1820
1820
|
method: "PUT",
|
|
1821
1821
|
body: JSON.stringify({ menuName: t })
|
|
1822
1822
|
});
|
|
1823
1823
|
return i.data ?? i;
|
|
1824
1824
|
}
|
|
1825
|
-
async function
|
|
1825
|
+
async function tr(e) {
|
|
1826
1826
|
let t = await n(r, `/admin/menu-modules/${e}`, { method: "DELETE" });
|
|
1827
1827
|
return t.data ?? t;
|
|
1828
1828
|
}
|
|
1829
|
-
async function
|
|
1829
|
+
async function nr() {
|
|
1830
1830
|
let e = await n(r, "/admin/menu-actions");
|
|
1831
1831
|
return M(e.data, e);
|
|
1832
1832
|
}
|
|
1833
|
-
async function
|
|
1833
|
+
async function rr({ permissionName: e, permissionKey: t }) {
|
|
1834
1834
|
let i = await n(r, "/admin/menu-actions", {
|
|
1835
1835
|
method: "POST",
|
|
1836
1836
|
body: JSON.stringify({
|
|
@@ -1840,22 +1840,22 @@ async function ir({ permissionName: e, permissionKey: t }) {
|
|
|
1840
1840
|
});
|
|
1841
1841
|
return i.data ?? i;
|
|
1842
1842
|
}
|
|
1843
|
-
async function
|
|
1843
|
+
async function ir(e, { permissionName: t }) {
|
|
1844
1844
|
let i = await n(r, `/admin/menu-actions/${e}`, {
|
|
1845
1845
|
method: "PUT",
|
|
1846
1846
|
body: JSON.stringify({ permissionName: t })
|
|
1847
1847
|
});
|
|
1848
1848
|
return i.data ?? i;
|
|
1849
1849
|
}
|
|
1850
|
-
async function
|
|
1850
|
+
async function ar(e) {
|
|
1851
1851
|
let t = await n(r, `/admin/menu-actions/${e}`, { method: "DELETE" });
|
|
1852
1852
|
return t.data ?? t;
|
|
1853
1853
|
}
|
|
1854
|
-
async function
|
|
1854
|
+
async function or(e) {
|
|
1855
1855
|
let t = await n(r, `/get-role-details?roleid=${e}`);
|
|
1856
1856
|
return t?.data ?? t ?? {};
|
|
1857
1857
|
}
|
|
1858
|
-
async function
|
|
1858
|
+
async function sr(e, t) {
|
|
1859
1859
|
return n(r, "/edit-role-details", {
|
|
1860
1860
|
method: "PUT",
|
|
1861
1861
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1865,41 +1865,41 @@ async function cr(e, t) {
|
|
|
1865
1865
|
})
|
|
1866
1866
|
});
|
|
1867
1867
|
}
|
|
1868
|
-
var
|
|
1869
|
-
async function
|
|
1868
|
+
var cr = "/admin/custom-forms";
|
|
1869
|
+
async function lr(e = "", t = "", i = "") {
|
|
1870
1870
|
let a = new URLSearchParams();
|
|
1871
1871
|
e && a.append("module", e), t && a.append("formType", t), i && a.append("action", i);
|
|
1872
|
-
let o = await n(r, `${
|
|
1872
|
+
let o = await n(r, `${cr}?${a.toString()}`), s = o?.data;
|
|
1873
1873
|
return Array.isArray(s) ? s : Array.isArray(o) ? o : [];
|
|
1874
1874
|
}
|
|
1875
|
-
async function
|
|
1876
|
-
return n(r,
|
|
1875
|
+
async function ur(e) {
|
|
1876
|
+
return n(r, cr, {
|
|
1877
1877
|
method: "POST",
|
|
1878
1878
|
headers: { "Content-Type": "application/json" },
|
|
1879
1879
|
body: JSON.stringify(e)
|
|
1880
1880
|
});
|
|
1881
1881
|
}
|
|
1882
|
-
async function
|
|
1883
|
-
return n(r, `${
|
|
1882
|
+
async function dr(e, t) {
|
|
1883
|
+
return n(r, `${cr}/${e}`, {
|
|
1884
1884
|
method: "PUT",
|
|
1885
1885
|
headers: { "Content-Type": "application/json" },
|
|
1886
1886
|
body: JSON.stringify(t)
|
|
1887
1887
|
});
|
|
1888
1888
|
}
|
|
1889
|
-
async function
|
|
1890
|
-
return n(r, `${
|
|
1889
|
+
async function fr(e) {
|
|
1890
|
+
return n(r, `${cr}/${e}`, { method: "DELETE" });
|
|
1891
1891
|
}
|
|
1892
|
-
var
|
|
1893
|
-
function
|
|
1892
|
+
var R = "/admin/row-action-config";
|
|
1893
|
+
function pr(e) {
|
|
1894
1894
|
return String(e ?? "").trim().toLowerCase();
|
|
1895
1895
|
}
|
|
1896
|
-
async function
|
|
1897
|
-
let t =
|
|
1896
|
+
async function mr(e = "") {
|
|
1897
|
+
let t = pr(e), i = await n(r, t ? `${R}?module=${encodeURIComponent(t)}` : R), a = i?.data;
|
|
1898
1898
|
return Array.isArray(a) ? a : Array.isArray(i) ? i : [];
|
|
1899
1899
|
}
|
|
1900
|
-
async function
|
|
1901
|
-
let a =
|
|
1902
|
-
return n(r,
|
|
1900
|
+
async function hr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
1901
|
+
let a = pr(e);
|
|
1902
|
+
return n(r, R, {
|
|
1903
1903
|
method: "POST",
|
|
1904
1904
|
headers: { "Content-Type": "application/json" },
|
|
1905
1905
|
body: JSON.stringify({
|
|
@@ -1909,23 +1909,23 @@ async function gr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
|
1909
1909
|
})
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
async function
|
|
1913
|
-
return n(r, `${
|
|
1912
|
+
async function gr(e, t = []) {
|
|
1913
|
+
return n(r, `${R}/${e}`, {
|
|
1914
1914
|
method: "PUT",
|
|
1915
1915
|
headers: { "Content-Type": "application/json" },
|
|
1916
1916
|
body: JSON.stringify({ rowActions: t })
|
|
1917
1917
|
});
|
|
1918
1918
|
}
|
|
1919
|
-
async function
|
|
1920
|
-
return n(r, `${
|
|
1919
|
+
async function _r(e) {
|
|
1920
|
+
return n(r, `${R}/${e}`, { method: "DELETE" });
|
|
1921
1921
|
}
|
|
1922
|
-
var
|
|
1923
|
-
async function
|
|
1924
|
-
let t = await n(r, `${
|
|
1922
|
+
var vr = "/admin/module-action-rules";
|
|
1923
|
+
async function yr(e) {
|
|
1924
|
+
let t = await n(r, `${vr}?module=${encodeURIComponent(e)}`), i = t?.data;
|
|
1925
1925
|
return Array.isArray(i) ? i : Array.isArray(t) ? t : [];
|
|
1926
1926
|
}
|
|
1927
|
-
async function
|
|
1928
|
-
return n(r,
|
|
1927
|
+
async function br({ module: e, name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1928
|
+
return n(r, vr, {
|
|
1929
1929
|
method: "POST",
|
|
1930
1930
|
headers: { "Content-Type": "application/json" },
|
|
1931
1931
|
body: JSON.stringify({
|
|
@@ -1939,8 +1939,8 @@ async function xr({ module: e, name: t, description: i = "", conditions: a = [],
|
|
|
1939
1939
|
})
|
|
1940
1940
|
});
|
|
1941
1941
|
}
|
|
1942
|
-
async function
|
|
1943
|
-
return n(r, `${
|
|
1942
|
+
async function xr(e, { name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1943
|
+
return n(r, `${vr}/${e}`, {
|
|
1944
1944
|
method: "PUT",
|
|
1945
1945
|
headers: { "Content-Type": "application/json" },
|
|
1946
1946
|
body: JSON.stringify({
|
|
@@ -1953,15 +1953,15 @@ async function Sr(e, { name: t, description: i = "", conditions: a = [], blocked
|
|
|
1953
1953
|
})
|
|
1954
1954
|
});
|
|
1955
1955
|
}
|
|
1956
|
-
async function
|
|
1957
|
-
return n(r, `${
|
|
1956
|
+
async function Sr(e) {
|
|
1957
|
+
return n(r, `${vr}/${e}`, { method: "DELETE" });
|
|
1958
1958
|
}
|
|
1959
1959
|
//#endregion
|
|
1960
1960
|
//#region src/services/documentApi.js
|
|
1961
|
-
function
|
|
1961
|
+
function Cr(e) {
|
|
1962
1962
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1963
1963
|
}
|
|
1964
|
-
async function
|
|
1964
|
+
async function wr(e, t, n = [], a = {}) {
|
|
1965
1965
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
1966
1966
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
1967
1967
|
if (!n.length) return {
|
|
@@ -1971,7 +1971,7 @@ async function Tr(e, t, n = [], a = {}) {
|
|
|
1971
1971
|
let o = await i(), s = new FormData();
|
|
1972
1972
|
n.forEach(({ formKey: e, file: t }) => {
|
|
1973
1973
|
let n = t?.name ?? void 0;
|
|
1974
|
-
s.append(
|
|
1974
|
+
s.append(Cr(e), t, n);
|
|
1975
1975
|
}), a && Object.keys(a).length > 0 && s.append("metadata", JSON.stringify(a));
|
|
1976
1976
|
let c = new URLSearchParams({
|
|
1977
1977
|
module: e,
|
|
@@ -1987,7 +1987,7 @@ async function Tr(e, t, n = [], a = {}) {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
return u?.data ?? u;
|
|
1989
1989
|
}
|
|
1990
|
-
async function
|
|
1990
|
+
async function Tr(e, t, i = "") {
|
|
1991
1991
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
1992
1992
|
if (!t) throw Error("refId is required to fetch documents");
|
|
1993
1993
|
let a = new URLSearchParams({
|
|
@@ -2003,12 +2003,12 @@ async function Er(e, t, i = "") {
|
|
|
2003
2003
|
}
|
|
2004
2004
|
//#endregion
|
|
2005
2005
|
//#region src/services/detailedViewApi.js
|
|
2006
|
-
var
|
|
2006
|
+
var Er = {
|
|
2007
2007
|
job: { fetchUrl: (e) => `${t}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
2008
2008
|
candidates: { fetchUrl: (e) => `${s}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
2009
2009
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
2010
2010
|
};
|
|
2011
|
-
async function
|
|
2011
|
+
async function Dr(e, t) {
|
|
2012
2012
|
let i = String(e ?? "").trim().toLowerCase();
|
|
2013
2013
|
if (i === "job" || i === "jobs") {
|
|
2014
2014
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
@@ -2019,17 +2019,17 @@ async function Or(e, t) {
|
|
|
2019
2019
|
id: String(t)
|
|
2020
2020
|
}).toString()}`);
|
|
2021
2021
|
}
|
|
2022
|
-
async function
|
|
2022
|
+
async function Or(e) {
|
|
2023
2023
|
let t = await n(r, `/module-actions?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
2024
2024
|
return {
|
|
2025
2025
|
actions: Array.isArray(i.actions) ? i.actions : [],
|
|
2026
2026
|
actionRules: Array.isArray(i.actionRules) ? i.actionRules : []
|
|
2027
2027
|
};
|
|
2028
2028
|
}
|
|
2029
|
-
async function
|
|
2029
|
+
async function kr(e, t) {
|
|
2030
2030
|
if (!e) throw Error("module is required");
|
|
2031
2031
|
if (!t) throw Error("id is required");
|
|
2032
|
-
let n =
|
|
2032
|
+
let n = Er[e];
|
|
2033
2033
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2034
2034
|
let r = await i(), a = await fetch(n.fetchUrl(t), {
|
|
2035
2035
|
method: "GET",
|
|
@@ -2042,7 +2042,7 @@ async function Ar(e, t) {
|
|
|
2042
2042
|
let o = await a.json();
|
|
2043
2043
|
return o.data ?? o;
|
|
2044
2044
|
}
|
|
2045
|
-
async function
|
|
2045
|
+
async function Ar(e, t, n, a = []) {
|
|
2046
2046
|
if (!e) throw Error("module is required");
|
|
2047
2047
|
if (!t) throw Error("id is required");
|
|
2048
2048
|
let o = await i(), s = new FormData();
|
|
@@ -2054,12 +2054,12 @@ async function jr(e, t, n, a = []) {
|
|
|
2054
2054
|
});
|
|
2055
2055
|
if (!c.ok) {
|
|
2056
2056
|
let e = await c.text();
|
|
2057
|
-
throw console.error("[updateRecord] Error response:", e), Error(
|
|
2057
|
+
throw console.error("[updateRecord] Error response:", e), Error(jr(e) || `API ${c.status}: ${c.statusText}`);
|
|
2058
2058
|
}
|
|
2059
2059
|
let l = await c.json();
|
|
2060
2060
|
return l.data ?? l;
|
|
2061
2061
|
}
|
|
2062
|
-
function
|
|
2062
|
+
function jr(e) {
|
|
2063
2063
|
let t = String(e ?? "").trim();
|
|
2064
2064
|
if (!t.startsWith("{")) return t;
|
|
2065
2065
|
try {
|
|
@@ -2069,22 +2069,22 @@ function Mr(e) {
|
|
|
2069
2069
|
return t;
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
|
-
var
|
|
2073
|
-
async function
|
|
2072
|
+
var Mr = (e) => e?.data ?? e;
|
|
2073
|
+
async function Nr(e, t) {
|
|
2074
2074
|
if (!e || !t) return [];
|
|
2075
|
-
let i =
|
|
2075
|
+
let i = Mr(await n(r, `/module-activity?${new URLSearchParams({
|
|
2076
2076
|
module: e,
|
|
2077
2077
|
id: String(t)
|
|
2078
2078
|
}).toString()}`));
|
|
2079
2079
|
return Array.isArray(i) ? i : [];
|
|
2080
2080
|
}
|
|
2081
|
-
async function
|
|
2081
|
+
async function Pr(e) {
|
|
2082
2082
|
if (!e) return [];
|
|
2083
|
-
let t =
|
|
2083
|
+
let t = Mr(await n(r, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2084
2084
|
return Array.isArray(t) ? t : [];
|
|
2085
2085
|
}
|
|
2086
|
-
async function
|
|
2087
|
-
return
|
|
2086
|
+
async function Fr({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
2087
|
+
return Mr(await n(r, "/notes", {
|
|
2088
2088
|
method: "POST",
|
|
2089
2089
|
body: JSON.stringify({
|
|
2090
2090
|
relatedId: e,
|
|
@@ -2096,7 +2096,7 @@ async function Ir({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
//#endregion
|
|
2098
2098
|
//#region src/services/detailDefaults.js
|
|
2099
|
-
var
|
|
2099
|
+
var Ir = Object.freeze({
|
|
2100
2100
|
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
2101
2101
|
dateFormat: "DD MMM YYYY",
|
|
2102
2102
|
booleanTrueLabel: "Yes",
|
|
@@ -2112,16 +2112,16 @@ var Lr = Object.freeze({
|
|
|
2112
2112
|
],
|
|
2113
2113
|
phoneFormat: "3-3-4",
|
|
2114
2114
|
phoneCountryCode: ""
|
|
2115
|
-
}),
|
|
2116
|
-
function
|
|
2117
|
-
return
|
|
2115
|
+
}), z = { ...Ir }, Lr = null;
|
|
2116
|
+
function Rr() {
|
|
2117
|
+
return z;
|
|
2118
2118
|
}
|
|
2119
|
-
function
|
|
2119
|
+
function zr(e) {
|
|
2120
2120
|
if (!e || typeof e != "object") return {};
|
|
2121
2121
|
let t = {};
|
|
2122
2122
|
return e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), typeof e.separator == "string" && e.separator !== "" && (t.separator = e.separator), typeof e.phoneFormat == "string" && e.phoneFormat.trim() !== "" && (t.phoneFormat = e.phoneFormat.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), t;
|
|
2123
2123
|
}
|
|
2124
|
-
function
|
|
2124
|
+
function Br(e = Vr()) {
|
|
2125
2125
|
let t = (String(e).match(/\d+/g) ?? [
|
|
2126
2126
|
"3",
|
|
2127
2127
|
"3",
|
|
@@ -2137,18 +2137,18 @@ function Vr(e = Hr()) {
|
|
|
2137
2137
|
total: r.reduce((e, t) => e + t, 0)
|
|
2138
2138
|
};
|
|
2139
2139
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return
|
|
2140
|
+
function Vr() {
|
|
2141
|
+
return z.phoneFormat || Ir.phoneFormat;
|
|
2142
2142
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return
|
|
2143
|
+
function Hr() {
|
|
2144
|
+
return z.phoneCountryCode ?? Ir.phoneCountryCode;
|
|
2145
2145
|
}
|
|
2146
|
-
function
|
|
2147
|
-
let { total: n } =
|
|
2146
|
+
function Ur(e, t = Vr()) {
|
|
2147
|
+
let { total: n } = Br(t);
|
|
2148
2148
|
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
2149
2149
|
}
|
|
2150
|
-
function
|
|
2151
|
-
let { groups: n, sep: r } =
|
|
2150
|
+
function Wr(e, t = Vr()) {
|
|
2151
|
+
let { groups: n, sep: r } = Br(t), i = Ur(e, t);
|
|
2152
2152
|
if (!i) return "";
|
|
2153
2153
|
let a = [], o = 0;
|
|
2154
2154
|
for (let e of n) {
|
|
@@ -2157,30 +2157,30 @@ function Gr(e, t = Hr()) {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
return a.join(r);
|
|
2159
2159
|
}
|
|
2160
|
-
function
|
|
2161
|
-
return
|
|
2162
|
-
...
|
|
2163
|
-
...
|
|
2164
|
-
},
|
|
2160
|
+
function Gr(e) {
|
|
2161
|
+
return z = {
|
|
2162
|
+
...z,
|
|
2163
|
+
...zr(e)
|
|
2164
|
+
}, z;
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2167
|
-
return
|
|
2166
|
+
function Kr(e = !1) {
|
|
2167
|
+
return Lr && !e || (Lr = en().then((e) => Gr(e)).catch(() => z)), Lr;
|
|
2168
2168
|
}
|
|
2169
2169
|
//#endregion
|
|
2170
2170
|
//#region src/utils/roleFormPermissionGate.js
|
|
2171
|
-
function
|
|
2171
|
+
function qr(e, t) {
|
|
2172
2172
|
if (!e) return !0;
|
|
2173
2173
|
let n = e.find((e) => e.name === t);
|
|
2174
2174
|
return n ? n.enabled !== !1 : !0;
|
|
2175
2175
|
}
|
|
2176
|
-
function
|
|
2176
|
+
function Jr(e, t, n) {
|
|
2177
2177
|
if (!e) return !0;
|
|
2178
2178
|
let r = e.find((e) => e.name === t);
|
|
2179
2179
|
if (!r) return !0;
|
|
2180
2180
|
let i = r.fields?.find((e) => e.field === n);
|
|
2181
2181
|
return i ? i.enabled !== !1 : !0;
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2183
|
+
function Yr(e, t, n) {
|
|
2184
2184
|
if (!e) return !0;
|
|
2185
2185
|
let r = e.find((e) => e.name === t);
|
|
2186
2186
|
if (!r) return !0;
|
|
@@ -2190,7 +2190,7 @@ function Xr(e, t, n) {
|
|
|
2190
2190
|
}
|
|
2191
2191
|
//#endregion
|
|
2192
2192
|
//#region src/components/form/inputSecurity.js
|
|
2193
|
-
var
|
|
2193
|
+
var Xr = [
|
|
2194
2194
|
"p",
|
|
2195
2195
|
"br",
|
|
2196
2196
|
"strong",
|
|
@@ -2212,12 +2212,12 @@ var Zr = [
|
|
|
2212
2212
|
"a",
|
|
2213
2213
|
"code",
|
|
2214
2214
|
"pre"
|
|
2215
|
-
],
|
|
2215
|
+
], Zr = [
|
|
2216
2216
|
"href",
|
|
2217
2217
|
"title",
|
|
2218
2218
|
"target",
|
|
2219
2219
|
"rel"
|
|
2220
|
-
],
|
|
2220
|
+
], Qr = /[\u200B-\u200D\u2060\uFEFF]/g, $r = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, ei = /^[\p{L}\p{M}\p{N} .'-]+$/u, ti = /^\+?[0-9 ()-]+$/, ni = /^-?(?:\d+|\d*\.\d+)$/, ri = [
|
|
2221
2221
|
{
|
|
2222
2222
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta)\b/i,
|
|
2223
2223
|
message: "HTML/script content is not allowed"
|
|
@@ -2251,12 +2251,12 @@ var Zr = [
|
|
|
2251
2251
|
message: "Command execution patterns are not allowed"
|
|
2252
2252
|
}
|
|
2253
2253
|
];
|
|
2254
|
-
function
|
|
2254
|
+
function ii(e) {
|
|
2255
2255
|
if (typeof document > "u") return e;
|
|
2256
2256
|
let t = document.createElement("textarea");
|
|
2257
2257
|
return t.innerHTML = e, t.value;
|
|
2258
2258
|
}
|
|
2259
|
-
function
|
|
2259
|
+
function ai(e) {
|
|
2260
2260
|
let t = String(e ?? "");
|
|
2261
2261
|
for (let e = 0; e < 2; e += 1) try {
|
|
2262
2262
|
let e = decodeURIComponent(t);
|
|
@@ -2265,12 +2265,12 @@ function oi(e) {
|
|
|
2265
2265
|
} catch {
|
|
2266
2266
|
break;
|
|
2267
2267
|
}
|
|
2268
|
-
return t =
|
|
2268
|
+
return t = ii(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
2269
2269
|
}
|
|
2270
|
-
function
|
|
2270
|
+
function oi(e) {
|
|
2271
2271
|
return Ee.sanitize(String(e ?? ""), {
|
|
2272
|
-
ALLOWED_TAGS:
|
|
2273
|
-
ALLOWED_ATTR:
|
|
2272
|
+
ALLOWED_TAGS: Xr,
|
|
2273
|
+
ALLOWED_ATTR: Zr,
|
|
2274
2274
|
ALLOW_DATA_ATTR: !1,
|
|
2275
2275
|
FORBID_TAGS: [
|
|
2276
2276
|
"script",
|
|
@@ -2290,40 +2290,40 @@ function si(e) {
|
|
|
2290
2290
|
]
|
|
2291
2291
|
});
|
|
2292
2292
|
}
|
|
2293
|
-
function
|
|
2293
|
+
function si(e) {
|
|
2294
2294
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2295
2295
|
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
2296
2296
|
}
|
|
2297
|
-
function
|
|
2297
|
+
function ci(e) {
|
|
2298
2298
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function li(e, t = {}) {
|
|
2301
2301
|
if (typeof e != "string") return e;
|
|
2302
|
-
if (t.type === "text-editor") return
|
|
2303
|
-
let n = e.normalize("NFC").replace(
|
|
2304
|
-
return n =
|
|
2302
|
+
if (t.type === "text-editor") return oi(e.normalize("NFC"));
|
|
2303
|
+
let n = e.normalize("NFC").replace(Qr, "").replace(/\u00A0/g, " ").replace($r, "");
|
|
2304
|
+
return n = ci(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2306
|
+
function ui(e, t = {}) {
|
|
2307
2307
|
if (typeof e != "string" || e === "") return null;
|
|
2308
|
-
let n = t.label || t.field || "Field", r =
|
|
2308
|
+
let n = t.label || t.field || "Field", r = ai(e);
|
|
2309
2309
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2310
2310
|
if (t.type !== "text-editor") {
|
|
2311
|
-
let e =
|
|
2311
|
+
let e = ri.find(({ re: e }) => e.test(r));
|
|
2312
2312
|
if (e) return `${n}: ${e.message}`;
|
|
2313
2313
|
} else {
|
|
2314
|
-
let e =
|
|
2314
|
+
let e = ri.slice(0, 3).find(({ re: e }) => e.test(r));
|
|
2315
2315
|
if (e) return `${n}: ${e.message}`;
|
|
2316
2316
|
}
|
|
2317
|
-
let i =
|
|
2318
|
-
return [...i].length >
|
|
2317
|
+
let i = li(e, t);
|
|
2318
|
+
return [...i].length > si(t) ? `${n} is too long` : t.formatter === "name" && i && !ei.test(i) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && i && !ti.test(i) ? `${n} contains invalid phone characters` : t.type === "number" && i && !ni.test(i) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && i && !/^https?:\/\//i.test(i) ? `${n} must use http:// or https://` : null;
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function di(e) {
|
|
2321
2321
|
return { validator: (t, n) => {
|
|
2322
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2322
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => ui(t, e)).find(Boolean);
|
|
2323
2323
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2324
2324
|
} };
|
|
2325
2325
|
}
|
|
2326
|
-
function
|
|
2326
|
+
function fi(e = []) {
|
|
2327
2327
|
let t = /* @__PURE__ */ new Map();
|
|
2328
2328
|
return e.forEach((e) => {
|
|
2329
2329
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2335,12 +2335,12 @@ function pi(e = []) {
|
|
|
2335
2335
|
});
|
|
2336
2336
|
}), t;
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2339
|
-
let n =
|
|
2338
|
+
function pi(e, t = []) {
|
|
2339
|
+
let n = fi(t), r = (e, t = "") => {
|
|
2340
2340
|
if (typeof e == "string") {
|
|
2341
|
-
let r = n.get(t) ?? {}, i =
|
|
2341
|
+
let r = n.get(t) ?? {}, i = ui(e, r);
|
|
2342
2342
|
if (i) throw Error(i);
|
|
2343
|
-
return
|
|
2343
|
+
return li(e, r);
|
|
2344
2344
|
}
|
|
2345
2345
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2346
2346
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2351,12 +2351,12 @@ function mi(e, t = []) {
|
|
|
2351
2351
|
}
|
|
2352
2352
|
//#endregion
|
|
2353
2353
|
//#region src/components/form/optionMatching.js
|
|
2354
|
-
function
|
|
2354
|
+
function mi(e) {
|
|
2355
2355
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function hi(e) {
|
|
2358
2358
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2359
|
-
let r =
|
|
2359
|
+
let r = mi(e);
|
|
2360
2360
|
r && !t.has(r) && t.set(r, n);
|
|
2361
2361
|
};
|
|
2362
2362
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2364,34 +2364,34 @@ function gi(e) {
|
|
|
2364
2364
|
let t = typeof e == "object" ? e.value : e;
|
|
2365
2365
|
t == null || t === "" || (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2366
2366
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2367
|
-
let i = t.get(
|
|
2367
|
+
let i = t.get(mi(r));
|
|
2368
2368
|
i !== void 0 && n(e, i);
|
|
2369
2369
|
}), t;
|
|
2370
2370
|
}
|
|
2371
|
-
var
|
|
2372
|
-
function
|
|
2371
|
+
var gi = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2372
|
+
function _i(e, t) {
|
|
2373
2373
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2374
|
-
let n = e.get(
|
|
2374
|
+
let n = e.get(mi(t));
|
|
2375
2375
|
return n === void 0 ? t : n;
|
|
2376
2376
|
}
|
|
2377
|
-
function
|
|
2378
|
-
if (!
|
|
2379
|
-
let n =
|
|
2380
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2377
|
+
function vi(e, t) {
|
|
2378
|
+
if (!gi(e)) return t;
|
|
2379
|
+
let n = hi(e);
|
|
2380
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => _i(n, e)) : _i(n, t);
|
|
2381
2381
|
}
|
|
2382
2382
|
//#endregion
|
|
2383
2383
|
//#region src/components/form/payloadTransformer.js
|
|
2384
|
-
var
|
|
2385
|
-
function
|
|
2384
|
+
var B = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, yi = (e) => e === !0 || e === 1 || e === "1", V = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !bi(e);
|
|
2385
|
+
function bi(e) {
|
|
2386
2386
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2387
2387
|
}
|
|
2388
|
-
function
|
|
2389
|
-
return
|
|
2388
|
+
function xi(e) {
|
|
2389
|
+
return bi(e) || e instanceof Date;
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return e instanceof Date ? e.toISOString() :
|
|
2391
|
+
function Si(e) {
|
|
2392
|
+
return e instanceof Date ? e.toISOString() : bi(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2394
|
+
function H(e, t) {
|
|
2395
2395
|
if (!t) return;
|
|
2396
2396
|
let n = String(t).split("."), r = e;
|
|
2397
2397
|
for (let e of n) {
|
|
@@ -2400,51 +2400,51 @@ function V(e, t) {
|
|
|
2400
2400
|
}
|
|
2401
2401
|
return r;
|
|
2402
2402
|
}
|
|
2403
|
-
function H(e, t) {
|
|
2404
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : V(e, t);
|
|
2405
|
-
}
|
|
2406
2403
|
function U(e, t) {
|
|
2407
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ?
|
|
2404
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : H(e, t);
|
|
2405
|
+
}
|
|
2406
|
+
function W(e, t) {
|
|
2407
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 : H(e, t) !== void 0;
|
|
2408
2408
|
}
|
|
2409
|
-
function
|
|
2409
|
+
function G(e, t, n) {
|
|
2410
2410
|
let r = String(t).split("."), i = e;
|
|
2411
2411
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2412
2412
|
let t = r[e];
|
|
2413
|
-
|
|
2413
|
+
V(i[t]) || (i[t] = {}), i = i[t];
|
|
2414
2414
|
}
|
|
2415
2415
|
return i[r[r.length - 1]] = n, e;
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function Ci(e, t, n) {
|
|
2418
2418
|
let r = String(t).split("."), i = e;
|
|
2419
2419
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2420
2420
|
let t = r[e];
|
|
2421
|
-
|
|
2421
|
+
V(i[t]) || (i[t] = {}), i = i[t];
|
|
2422
2422
|
}
|
|
2423
2423
|
let a = r[r.length - 1];
|
|
2424
|
-
return i[a] =
|
|
2424
|
+
return i[a] = V(i[a]) && V(n) ? {
|
|
2425
2425
|
...n,
|
|
2426
2426
|
...i[a]
|
|
2427
2427
|
} : n, e;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function wi(e) {
|
|
2430
2430
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2431
2431
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2432
2432
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2433
2433
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2434
2434
|
}
|
|
2435
|
-
function
|
|
2435
|
+
function Ti(e, t) {
|
|
2436
2436
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2437
|
-
|
|
2437
|
+
V(n) && V(e[t]) ? Ti(e[t], n) : e[t] = n;
|
|
2438
2438
|
}), e;
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function Ei(e, t) {
|
|
2441
2441
|
let n = e.options ?? e.values ?? [];
|
|
2442
2442
|
for (let e of n) if (typeof e == "string") {
|
|
2443
2443
|
if (e === t) return e;
|
|
2444
2444
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2447
|
-
if (
|
|
2446
|
+
function Di(e, t) {
|
|
2447
|
+
if (V(e)) {
|
|
2448
2448
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2449
2449
|
return {
|
|
2450
2450
|
value: n,
|
|
@@ -2453,10 +2453,10 @@ function Oi(e, t) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
return {
|
|
2455
2455
|
value: e,
|
|
2456
|
-
label:
|
|
2456
|
+
label: Ei(t, e) ?? e
|
|
2457
2457
|
};
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function Oi(e = {}) {
|
|
2460
2460
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2461
2461
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2462
2462
|
switch (e.type) {
|
|
@@ -2466,36 +2466,36 @@ function ki(e = {}) {
|
|
|
2466
2466
|
default: return "auto";
|
|
2467
2467
|
}
|
|
2468
2468
|
}
|
|
2469
|
-
function
|
|
2470
|
-
if (
|
|
2471
|
-
if (t === "string") return
|
|
2469
|
+
function K(e, t, n = {}) {
|
|
2470
|
+
if (xi(e)) {
|
|
2471
|
+
if (t === "string") return Si(e);
|
|
2472
2472
|
if (t === "number") {
|
|
2473
|
-
let t =
|
|
2473
|
+
let t = bi(e) ? e.valueOf() : e.getTime();
|
|
2474
2474
|
return Number.isNaN(t) ? null : t;
|
|
2475
2475
|
}
|
|
2476
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2476
|
+
if (t === "date" || t === "auto" || !t) return Si(e);
|
|
2477
2477
|
}
|
|
2478
2478
|
switch (t) {
|
|
2479
2479
|
case "string": return e == null ? "" : String(e);
|
|
2480
2480
|
case "number": {
|
|
2481
|
-
if (
|
|
2481
|
+
if (B(e)) return null;
|
|
2482
2482
|
let t = Number(e);
|
|
2483
2483
|
return Number.isNaN(t) ? null : t;
|
|
2484
2484
|
}
|
|
2485
2485
|
case "boolean": return e === !0 || e === 1 || e === "1" || e === "true";
|
|
2486
2486
|
case "array": {
|
|
2487
2487
|
let t;
|
|
2488
|
-
return t = Array.isArray(e) ? e :
|
|
2488
|
+
return t = Array.isArray(e) ? e : B(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => K(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2489
2489
|
}
|
|
2490
|
-
case "object": return
|
|
2491
|
-
case "date": return
|
|
2490
|
+
case "object": return V(e), e;
|
|
2491
|
+
case "date": return Si(e);
|
|
2492
2492
|
case "custom":
|
|
2493
2493
|
case "auto":
|
|
2494
2494
|
case void 0:
|
|
2495
2495
|
default: return e;
|
|
2496
2496
|
}
|
|
2497
2497
|
}
|
|
2498
|
-
var
|
|
2498
|
+
var ki = {
|
|
2499
2499
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2500
2500
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2501
2501
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2503,11 +2503,11 @@ var Ai = {
|
|
|
2503
2503
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2504
2504
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2505
2505
|
};
|
|
2506
|
-
function
|
|
2506
|
+
function Ai(e, t) {
|
|
2507
2507
|
if (!t) return e;
|
|
2508
2508
|
let n = t;
|
|
2509
2509
|
if (typeof n == "string") {
|
|
2510
|
-
if (
|
|
2510
|
+
if (ki[n]) return ki[n](e);
|
|
2511
2511
|
try {
|
|
2512
2512
|
n = JSON.parse(n);
|
|
2513
2513
|
} catch {
|
|
@@ -2515,39 +2515,39 @@ function ji(e, t) {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
}
|
|
2517
2517
|
let r = e;
|
|
2518
|
-
if (n.name &&
|
|
2518
|
+
if (n.name && ki[n.name] && (r = ki[n.name](r)), n.map && typeof n.map == "object") {
|
|
2519
2519
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2520
2520
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2521
2521
|
}
|
|
2522
2522
|
return r;
|
|
2523
2523
|
}
|
|
2524
|
-
var
|
|
2525
|
-
function
|
|
2524
|
+
var ji = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2525
|
+
function Mi(e, t) {
|
|
2526
2526
|
let [n, ...r] = e.split("."), i;
|
|
2527
2527
|
if (n === "value") i = t.value;
|
|
2528
2528
|
else if (n === "label") i = t.label;
|
|
2529
2529
|
else if (n === "raw") i = t.raw;
|
|
2530
2530
|
else return;
|
|
2531
|
-
return r.length ?
|
|
2531
|
+
return r.length ? H(i, r.join(".")) : i;
|
|
2532
2532
|
}
|
|
2533
|
-
function
|
|
2533
|
+
function Ni(e, t) {
|
|
2534
2534
|
if (typeof e == "string") {
|
|
2535
2535
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2536
|
-
return n ?
|
|
2537
|
-
let r =
|
|
2536
|
+
return n ? Mi(n[1], t) : e.replace(ji, (e, n) => {
|
|
2537
|
+
let r = Mi(n, t);
|
|
2538
2538
|
return r == null ? "" : String(r);
|
|
2539
2539
|
});
|
|
2540
2540
|
}
|
|
2541
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2542
|
-
if (
|
|
2541
|
+
if (Array.isArray(e)) return e.map((e) => Ni(e, t));
|
|
2542
|
+
if (V(e)) {
|
|
2543
2543
|
let n = {};
|
|
2544
2544
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2545
|
-
n[e] =
|
|
2545
|
+
n[e] = Ni(r, t);
|
|
2546
2546
|
}), n;
|
|
2547
2547
|
}
|
|
2548
2548
|
return e;
|
|
2549
2549
|
}
|
|
2550
|
-
function
|
|
2550
|
+
function Pi(e) {
|
|
2551
2551
|
if (!e) return null;
|
|
2552
2552
|
if (typeof e == "string") try {
|
|
2553
2553
|
return JSON.parse(e);
|
|
@@ -2556,36 +2556,36 @@ function Fi(e) {
|
|
|
2556
2556
|
}
|
|
2557
2557
|
return e;
|
|
2558
2558
|
}
|
|
2559
|
-
function
|
|
2560
|
-
let n = e.payloadMode || "auto", r =
|
|
2559
|
+
function Fi(e, t) {
|
|
2560
|
+
let n = e.payloadMode || "auto", r = Oi(e), { value: i, label: a } = Di(t, e);
|
|
2561
2561
|
switch (n) {
|
|
2562
2562
|
case "value": return {
|
|
2563
2563
|
kind: "scalar",
|
|
2564
|
-
out:
|
|
2564
|
+
out: K(i, r, e)
|
|
2565
2565
|
};
|
|
2566
2566
|
case "label": return {
|
|
2567
2567
|
kind: "scalar",
|
|
2568
|
-
out:
|
|
2568
|
+
out: K(a, e.dataType || "string", e)
|
|
2569
2569
|
};
|
|
2570
2570
|
case "object": {
|
|
2571
2571
|
let t = e.valueKey || "id", n = e.displayKey || "name";
|
|
2572
2572
|
return {
|
|
2573
2573
|
kind: "scalar",
|
|
2574
2574
|
out: {
|
|
2575
|
-
[t]:
|
|
2575
|
+
[t]: K(i, e.elementType || "auto", {}),
|
|
2576
2576
|
[n]: a
|
|
2577
2577
|
}
|
|
2578
2578
|
};
|
|
2579
2579
|
}
|
|
2580
2580
|
case "custom":
|
|
2581
2581
|
case "template": {
|
|
2582
|
-
let n =
|
|
2582
|
+
let n = Pi(e.payloadTemplate);
|
|
2583
2583
|
if (!n) return {
|
|
2584
2584
|
kind: "scalar",
|
|
2585
|
-
out:
|
|
2585
|
+
out: K(i, r, e)
|
|
2586
2586
|
};
|
|
2587
|
-
let o =
|
|
2588
|
-
value:
|
|
2587
|
+
let o = Ni(n, {
|
|
2588
|
+
value: K(i, e.elementType || "auto", {}),
|
|
2589
2589
|
label: a,
|
|
2590
2590
|
raw: t
|
|
2591
2591
|
});
|
|
@@ -2596,19 +2596,19 @@ function Ii(e, t) {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
default: return {
|
|
2598
2598
|
kind: "scalar",
|
|
2599
|
-
out:
|
|
2599
|
+
out: K(i, r, e)
|
|
2600
2600
|
};
|
|
2601
2601
|
}
|
|
2602
2602
|
}
|
|
2603
|
-
function
|
|
2603
|
+
function Ii(e, t) {
|
|
2604
2604
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2605
2605
|
let n = t;
|
|
2606
|
-
return
|
|
2606
|
+
return B(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = Ai(n, e.transformRule), B(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Oi(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2607
2607
|
kind: "scalar",
|
|
2608
|
-
out: n.map((t) =>
|
|
2609
|
-
} :
|
|
2608
|
+
out: n.map((t) => Fi(e, t).out)
|
|
2609
|
+
} : Fi(e, n);
|
|
2610
2610
|
}
|
|
2611
|
-
function
|
|
2611
|
+
function Li(e = {}) {
|
|
2612
2612
|
return !!e.richValue || [
|
|
2613
2613
|
"label",
|
|
2614
2614
|
"object",
|
|
@@ -2616,10 +2616,10 @@ function Ri(e = {}) {
|
|
|
2616
2616
|
"template"
|
|
2617
2617
|
].includes(e.payloadMode);
|
|
2618
2618
|
}
|
|
2619
|
-
function
|
|
2620
|
-
if (!
|
|
2619
|
+
function Ri(e, t, n = []) {
|
|
2620
|
+
if (!Li(e) || t == null) return t;
|
|
2621
2621
|
let r = (e) => {
|
|
2622
|
-
if (
|
|
2622
|
+
if (V(e) && e.value !== void 0) return e;
|
|
2623
2623
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
2624
2624
|
return {
|
|
2625
2625
|
value: t?.value ?? e,
|
|
@@ -2628,9 +2628,9 @@ function zi(e, t, n = []) {
|
|
|
2628
2628
|
};
|
|
2629
2629
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2630
2630
|
}
|
|
2631
|
-
function
|
|
2631
|
+
function zi(e, t, n) {
|
|
2632
2632
|
if (!e?.field) return !0;
|
|
2633
|
-
let r =
|
|
2633
|
+
let r = W(t, e.field) ? U(t, e.field) : U(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2634
2634
|
switch (e.operator) {
|
|
2635
2635
|
case "eq": return String(r ?? "") === String(e.value ?? "");
|
|
2636
2636
|
case "neq": return String(r ?? "") !== String(e.value ?? "");
|
|
@@ -2642,45 +2642,45 @@ function Bi(e, t, n) {
|
|
|
2642
2642
|
default: return !0;
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
function
|
|
2645
|
+
function Bi(e) {
|
|
2646
2646
|
let t = [];
|
|
2647
2647
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2648
2648
|
e?.field && t.push(e.field);
|
|
2649
2649
|
}), t;
|
|
2650
2650
|
}
|
|
2651
|
-
function
|
|
2651
|
+
function Vi(e, t, n) {
|
|
2652
2652
|
if (!e) return !0;
|
|
2653
2653
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2654
2654
|
if (r.length) {
|
|
2655
|
-
let i = r.map((e) =>
|
|
2655
|
+
let i = r.map((e) => zi(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2656
2656
|
if (e.field) {
|
|
2657
|
-
let r =
|
|
2657
|
+
let r = zi(e, t, n);
|
|
2658
2658
|
o = a ? o || r : o && r;
|
|
2659
2659
|
}
|
|
2660
2660
|
return o;
|
|
2661
2661
|
}
|
|
2662
|
-
return
|
|
2662
|
+
return zi(e, t, n);
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2665
|
-
let a =
|
|
2666
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2664
|
+
function Hi(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2665
|
+
let a = Bi(e?.showIf);
|
|
2666
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Vi(e.showIf, t, n) ? a.every((e) => {
|
|
2667
2667
|
let a = r?.get?.(e);
|
|
2668
|
-
return a ?
|
|
2668
|
+
return a ? Hi(a, t, n, r, i) : !0;
|
|
2669
2669
|
}) : !1);
|
|
2670
2670
|
}
|
|
2671
|
-
function
|
|
2671
|
+
function Ui(e = []) {
|
|
2672
2672
|
let t = /* @__PURE__ */ new Map();
|
|
2673
2673
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2674
2674
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2675
2675
|
})), t;
|
|
2676
2676
|
}
|
|
2677
|
-
function
|
|
2677
|
+
function Wi(e = {}, { editing: t = !1 } = {}) {
|
|
2678
2678
|
let n = {};
|
|
2679
2679
|
return (e.fields ?? []).forEach((e) => {
|
|
2680
|
-
!e.field ||
|
|
2680
|
+
!e.field || q(e) || t && !e.defaultOnEdit || e.defaultValue === void 0 || e.defaultValue === "" || (n[e.field] = e.defaultValue);
|
|
2681
2681
|
}), n;
|
|
2682
2682
|
}
|
|
2683
|
-
function
|
|
2683
|
+
function Gi(e = []) {
|
|
2684
2684
|
let t = [];
|
|
2685
2685
|
return e.forEach((e) => {
|
|
2686
2686
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2691,27 +2691,27 @@ function Ki(e = []) {
|
|
|
2691
2691
|
});
|
|
2692
2692
|
}), t;
|
|
2693
2693
|
}
|
|
2694
|
-
var
|
|
2694
|
+
var Ki = [
|
|
2695
2695
|
"file",
|
|
2696
2696
|
"document",
|
|
2697
2697
|
"image",
|
|
2698
2698
|
"upload",
|
|
2699
2699
|
"attachment"
|
|
2700
2700
|
];
|
|
2701
|
-
function
|
|
2702
|
-
return
|
|
2701
|
+
function q(e) {
|
|
2702
|
+
return Ki.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2703
2703
|
}
|
|
2704
|
-
function
|
|
2705
|
-
return
|
|
2704
|
+
function qi(e = []) {
|
|
2705
|
+
return Gi(e).map(({ field: e }) => e).filter(q);
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2707
|
+
function Ji(e) {
|
|
2708
2708
|
return String(e ?? "").trim().toLowerCase();
|
|
2709
2709
|
}
|
|
2710
|
-
function
|
|
2711
|
-
return !!t &&
|
|
2710
|
+
function Yi(e, t) {
|
|
2711
|
+
return !!t && Ji(e.moduleName) === t;
|
|
2712
2712
|
}
|
|
2713
|
-
function
|
|
2714
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2713
|
+
function Xi(e, t = [], n = {}) {
|
|
2714
|
+
let r = [], i = n.scope ?? "all", a = Ji(n.module), o = (e, t) => {
|
|
2715
2715
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2716
2716
|
let n = t?.originFileObj || t;
|
|
2717
2717
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2721,9 +2721,9 @@ function Zi(e, t = [], n = {}) {
|
|
|
2721
2721
|
});
|
|
2722
2722
|
};
|
|
2723
2723
|
return (t ?? []).forEach((t) => {
|
|
2724
|
-
let r = (t.fields ?? []).filter(
|
|
2724
|
+
let r = (t.fields ?? []).filter(q);
|
|
2725
2725
|
if (!r.length) return;
|
|
2726
|
-
let s = t.moduleName && !
|
|
2726
|
+
let s = t.moduleName && !Yi(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2727
2727
|
if (t.addRow) {
|
|
2728
2728
|
if (i === "flat") return;
|
|
2729
2729
|
let a = e[t.name];
|
|
@@ -2731,89 +2731,89 @@ function Zi(e, t = [], n = {}) {
|
|
|
2731
2731
|
r.forEach((e) => {
|
|
2732
2732
|
let t = e.fileKey ?? String(e.field).split(".")[0];
|
|
2733
2733
|
a.forEach((r, i) => {
|
|
2734
|
-
o(c(n.indexed ? `${t}[${i}]` : t),
|
|
2734
|
+
o(c(n.indexed ? `${t}[${i}]` : t), U(r, e.field));
|
|
2735
2735
|
});
|
|
2736
2736
|
});
|
|
2737
2737
|
return;
|
|
2738
2738
|
}
|
|
2739
2739
|
i !== "addRow" && r.forEach((t) => {
|
|
2740
|
-
o(c(t.fileKey ?? String(t.field).split(".")[0]),
|
|
2740
|
+
o(c(t.fileKey ?? String(t.field).split(".")[0]), U(e, t.field));
|
|
2741
2741
|
});
|
|
2742
2742
|
}), r;
|
|
2743
2743
|
}
|
|
2744
|
-
function
|
|
2745
|
-
let r =
|
|
2746
|
-
|
|
2747
|
-
(e.payloadKey || e.field) && (
|
|
2744
|
+
function Zi(e, t, n = {}) {
|
|
2745
|
+
let r = V(n.base) ? structuredClone(n.base) : {};
|
|
2746
|
+
qi(t).forEach((e) => {
|
|
2747
|
+
(e.payloadKey || e.field) && (ea(r, e.payloadKey || e.field), ea(r, e.field));
|
|
2748
2748
|
});
|
|
2749
|
-
let i =
|
|
2749
|
+
let i = Ji(n.module), a = Ui(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || Yi(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2750
2750
|
return (t ?? []).forEach((t) => {
|
|
2751
|
-
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField &&
|
|
2752
|
-
if (t.toggleEnabled && t.toggleField &&
|
|
2753
|
-
|
|
2751
|
+
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && W(e, t.toggleField) ? !!U(e, t.toggleField) : !1;
|
|
2752
|
+
if (t.toggleEnabled && t.toggleField && W(e, t.toggleField) && (G(n, t.toggleField, i), i && t.addRow)) {
|
|
2753
|
+
G(n, t.payloadKey || t.name, []);
|
|
2754
2754
|
return;
|
|
2755
2755
|
}
|
|
2756
2756
|
if (t.addRow) {
|
|
2757
2757
|
let i = e[t.name];
|
|
2758
2758
|
if (!Array.isArray(i)) return;
|
|
2759
|
-
|
|
2759
|
+
G(n, t.payloadKey || t.name, i.map((t) => $i(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2760
2760
|
return;
|
|
2761
2761
|
}
|
|
2762
|
-
r.forEach((t) =>
|
|
2762
|
+
r.forEach((t) => Qi(t, e, n, e, a));
|
|
2763
2763
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2764
2764
|
moduleName: e,
|
|
2765
2765
|
data: t
|
|
2766
|
-
}))),
|
|
2766
|
+
}))), pi(r, t);
|
|
2767
2767
|
}
|
|
2768
|
-
function
|
|
2769
|
-
if (
|
|
2770
|
-
let i =
|
|
2768
|
+
function Qi(e, t, n, r, i) {
|
|
2769
|
+
if (q(e)) {
|
|
2770
|
+
let i = wi(U(t, e.field));
|
|
2771
2771
|
if (i !== void 0) {
|
|
2772
2772
|
let a = r !== void 0 && r !== t;
|
|
2773
|
-
|
|
2773
|
+
Ci(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2774
2774
|
}
|
|
2775
2775
|
return;
|
|
2776
2776
|
}
|
|
2777
|
-
if (
|
|
2778
|
-
(r === void 0 || r === t) &&
|
|
2777
|
+
if (Bi(e.showIf).length && !Hi(e, t, r, i)) {
|
|
2778
|
+
(r === void 0 || r === t) && W(t, e.field) && G(n, e.payloadKey || e.field, null);
|
|
2779
2779
|
return;
|
|
2780
2780
|
}
|
|
2781
2781
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2782
|
-
if (!
|
|
2783
|
-
let a =
|
|
2782
|
+
if (!W(t, e.field)) return;
|
|
2783
|
+
let a = U(t, e.field);
|
|
2784
2784
|
if (!Array.isArray(a)) return;
|
|
2785
|
-
let o = a.map((t) =>
|
|
2786
|
-
|
|
2785
|
+
let o = a.map((t) => $i(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2786
|
+
G(n, e.payloadKey || e.field, o);
|
|
2787
2787
|
return;
|
|
2788
2788
|
}
|
|
2789
|
-
if (!
|
|
2790
|
-
if (
|
|
2791
|
-
let r =
|
|
2792
|
-
|
|
2789
|
+
if (!W(t, e.field)) return;
|
|
2790
|
+
if (yi(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2791
|
+
let r = U(t, e.field), i = Array.isArray(r) ? r : B(r) ? [] : [r], a = na(e), o = i.map((e) => Ii(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2792
|
+
G(n, e.payloadKey || e.field, o);
|
|
2793
2793
|
return;
|
|
2794
2794
|
}
|
|
2795
|
-
let a =
|
|
2795
|
+
let a = Ii(e, U(t, e.field));
|
|
2796
2796
|
if (a.kind !== "skip") {
|
|
2797
|
-
if (a.kind === "spread" &&
|
|
2798
|
-
|
|
2797
|
+
if (a.kind === "spread" && V(a.out)) {
|
|
2798
|
+
Ti(n, a.out);
|
|
2799
2799
|
return;
|
|
2800
2800
|
}
|
|
2801
|
-
|
|
2801
|
+
G(n, e.payloadKey || e.field, a.out);
|
|
2802
2802
|
}
|
|
2803
2803
|
}
|
|
2804
|
-
function
|
|
2804
|
+
function $i(e, t, n, r) {
|
|
2805
2805
|
let i = {};
|
|
2806
|
-
return e.forEach((e) =>
|
|
2806
|
+
return e.forEach((e) => Qi(e, t, i, n ?? t, r)), i;
|
|
2807
2807
|
}
|
|
2808
|
-
function
|
|
2808
|
+
function ea(e, t) {
|
|
2809
2809
|
let n = String(t).split("."), r = e;
|
|
2810
2810
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2811
|
-
if (!
|
|
2811
|
+
if (!V(r[n[e]])) return;
|
|
2812
2812
|
r = r[n[e]];
|
|
2813
2813
|
}
|
|
2814
2814
|
delete r[n[n.length - 1]];
|
|
2815
2815
|
}
|
|
2816
|
-
var
|
|
2816
|
+
var ta = new Set([
|
|
2817
2817
|
"text",
|
|
2818
2818
|
"textarea",
|
|
2819
2819
|
"email",
|
|
@@ -2825,14 +2825,14 @@ var na = new Set([
|
|
|
2825
2825
|
"datetime",
|
|
2826
2826
|
"password"
|
|
2827
2827
|
]);
|
|
2828
|
-
function
|
|
2828
|
+
function J(e, t) {
|
|
2829
2829
|
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" ? e.defaultValue : void 0;
|
|
2830
2830
|
if (t == null) return r() ?? t;
|
|
2831
2831
|
if (n(t)) return r();
|
|
2832
|
-
if (
|
|
2833
|
-
if (
|
|
2832
|
+
if (B(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
2833
|
+
if (ta.has(e.type) && V(t)) {
|
|
2834
2834
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2835
|
-
if (r === void 0 ||
|
|
2835
|
+
if (r === void 0 || V(r)) return;
|
|
2836
2836
|
t = r;
|
|
2837
2837
|
}
|
|
2838
2838
|
if (e.type === "date" || e.type === "time") {
|
|
@@ -2840,8 +2840,8 @@ function q(e, t) {
|
|
|
2840
2840
|
let e = ge(t);
|
|
2841
2841
|
return e.isValid() ? e : null;
|
|
2842
2842
|
}
|
|
2843
|
-
t =
|
|
2844
|
-
let i = (t) =>
|
|
2843
|
+
t = vi(e, t);
|
|
2844
|
+
let i = (t) => V(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type === "radio" ? !1 : Oi(e) === "array", o = (t) => {
|
|
2845
2845
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2846
2846
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2847
2847
|
return n ? n.value : t;
|
|
@@ -2853,7 +2853,7 @@ function q(e, t) {
|
|
|
2853
2853
|
}
|
|
2854
2854
|
return t;
|
|
2855
2855
|
}
|
|
2856
|
-
function
|
|
2856
|
+
function na(e = {}) {
|
|
2857
2857
|
return {
|
|
2858
2858
|
...e,
|
|
2859
2859
|
addRow: !1,
|
|
@@ -2862,26 +2862,26 @@ function ra(e = {}) {
|
|
|
2862
2862
|
dataType: void 0
|
|
2863
2863
|
};
|
|
2864
2864
|
}
|
|
2865
|
-
function
|
|
2865
|
+
function ra(e, t) {
|
|
2866
2866
|
let n = Math.max(0, Number(e.minRows ?? 0) || 0), r = e.initialRows !== void 0 && e.initialRows !== "" ? Math.max(n, Math.max(0, Number(e.initialRows) || 0)) : n;
|
|
2867
2867
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2868
2868
|
let i = [];
|
|
2869
2869
|
Array.isArray(t) && (i = t.map((t) => {
|
|
2870
2870
|
let n = {};
|
|
2871
2871
|
return e.subFields.forEach((e) => {
|
|
2872
|
-
if (!e.field ||
|
|
2873
|
-
let r =
|
|
2874
|
-
r != null && (n[e.field] =
|
|
2872
|
+
if (!e.field || q(e)) return;
|
|
2873
|
+
let r = H(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
2874
|
+
r != null && (n[e.field] = J(e, r));
|
|
2875
2875
|
}), n;
|
|
2876
2876
|
}));
|
|
2877
2877
|
let a = i.length > 0 ? n : Math.max(n, r);
|
|
2878
2878
|
for (; i.length < a;) i.push({});
|
|
2879
2879
|
return i;
|
|
2880
2880
|
}
|
|
2881
|
-
let i =
|
|
2882
|
-
if (Array.isArray(t)) a = t.map((e) =>
|
|
2881
|
+
let i = na(e), a = [];
|
|
2882
|
+
if (Array.isArray(t)) a = t.map((e) => J(i, e)).filter((e) => e != null && e !== "");
|
|
2883
2883
|
else if (t != null && t !== "") {
|
|
2884
|
-
let e =
|
|
2884
|
+
let e = J(i, t);
|
|
2885
2885
|
e != null && e !== "" && (a = [e]);
|
|
2886
2886
|
}
|
|
2887
2887
|
let o = a.length > 0 ? n : Math.max(n, r);
|
|
@@ -2890,12 +2890,12 @@ function ia(e, t) {
|
|
|
2890
2890
|
}
|
|
2891
2891
|
//#endregion
|
|
2892
2892
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2893
|
-
var
|
|
2894
|
-
function
|
|
2893
|
+
var ia = (e) => e === !0 || e === 1 || e === "1";
|
|
2894
|
+
function aa(e = []) {
|
|
2895
2895
|
let t = /* @__PURE__ */ new Map();
|
|
2896
2896
|
e.forEach((e) => {
|
|
2897
2897
|
let n = e?.linkGroup;
|
|
2898
|
-
!
|
|
2898
|
+
!ia(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2899
2899
|
});
|
|
2900
2900
|
let n = /* @__PURE__ */ new Map();
|
|
2901
2901
|
return t.forEach((e, t) => {
|
|
@@ -2905,11 +2905,11 @@ function oa(e = []) {
|
|
|
2905
2905
|
});
|
|
2906
2906
|
}), n;
|
|
2907
2907
|
}
|
|
2908
|
-
function
|
|
2908
|
+
function oa(e, t) {
|
|
2909
2909
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
2910
2910
|
return null;
|
|
2911
2911
|
}
|
|
2912
|
-
function
|
|
2912
|
+
function sa(e, t = {}) {
|
|
2913
2913
|
let n = { ...t };
|
|
2914
2914
|
return e.forEach(({ memberNames: e }) => {
|
|
2915
2915
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -2921,7 +2921,7 @@ function ca(e, t = {}) {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
//#endregion
|
|
2923
2923
|
//#region src/services/aiActionApi.js
|
|
2924
|
-
async function
|
|
2924
|
+
async function ca({ module: e, group: t, field: n, actionKey: a, inputs: o = {}, files: s = {} }) {
|
|
2925
2925
|
if (!e || !t || !n || !a) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
2926
2926
|
let c = await i(), l = new FormData();
|
|
2927
2927
|
l.append("json", JSON.stringify({ inputs: o })), Object.entries(s).forEach(([e, t]) => {
|
|
@@ -2947,7 +2947,7 @@ async function la({ module: e, group: t, field: n, actionKey: a, inputs: o = {},
|
|
|
2947
2947
|
}
|
|
2948
2948
|
//#endregion
|
|
2949
2949
|
//#region src/components/detail/renderConfig.js
|
|
2950
|
-
var
|
|
2950
|
+
var la = [
|
|
2951
2951
|
{
|
|
2952
2952
|
value: "auto",
|
|
2953
2953
|
label: "Default (auto)"
|
|
@@ -3004,7 +3004,7 @@ var ua = [
|
|
|
3004
3004
|
value: "html",
|
|
3005
3005
|
label: "HTML"
|
|
3006
3006
|
}
|
|
3007
|
-
],
|
|
3007
|
+
], ua = [
|
|
3008
3008
|
{
|
|
3009
3009
|
value: "preview",
|
|
3010
3010
|
label: "Preview (viewer)"
|
|
@@ -3025,7 +3025,7 @@ var ua = [
|
|
|
3025
3025
|
value: "text",
|
|
3026
3026
|
label: "Text (filename)"
|
|
3027
3027
|
}
|
|
3028
|
-
],
|
|
3028
|
+
], da = [
|
|
3029
3029
|
{
|
|
3030
3030
|
value: "none",
|
|
3031
3031
|
label: "None"
|
|
@@ -3042,71 +3042,71 @@ var ua = [
|
|
|
3042
3042
|
value: "title",
|
|
3043
3043
|
label: "Title Case"
|
|
3044
3044
|
}
|
|
3045
|
-
],
|
|
3045
|
+
], fa = [
|
|
3046
3046
|
"location",
|
|
3047
3047
|
"path",
|
|
3048
3048
|
"url",
|
|
3049
3049
|
"key"
|
|
3050
|
-
],
|
|
3050
|
+
], pa = [
|
|
3051
3051
|
"location",
|
|
3052
3052
|
"filepath",
|
|
3053
3053
|
"path",
|
|
3054
3054
|
"url",
|
|
3055
3055
|
"key"
|
|
3056
|
-
],
|
|
3056
|
+
], ma = [
|
|
3057
3057
|
"uploadedfilename",
|
|
3058
3058
|
"uploadname",
|
|
3059
3059
|
"originalname",
|
|
3060
3060
|
"displayname",
|
|
3061
3061
|
"documentname",
|
|
3062
3062
|
"filename"
|
|
3063
|
-
],
|
|
3064
|
-
function
|
|
3063
|
+
], ha = ["name"], ga = (e) => String(e).toLowerCase(), _a = (e) => e == null || e === "";
|
|
3064
|
+
function va(e, t) {
|
|
3065
3065
|
for (let n of t) {
|
|
3066
3066
|
let t = e[n];
|
|
3067
3067
|
if (typeof t == "string" && t) return t;
|
|
3068
3068
|
}
|
|
3069
3069
|
return "";
|
|
3070
3070
|
}
|
|
3071
|
-
function
|
|
3072
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3071
|
+
function ya(e, t) {
|
|
3072
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && ga(t).endsWith(n)) return r;
|
|
3073
3073
|
return "";
|
|
3074
3074
|
}
|
|
3075
|
-
function
|
|
3075
|
+
function ba(e) {
|
|
3076
3076
|
if (!e) return "";
|
|
3077
3077
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3078
3078
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3079
3079
|
}
|
|
3080
|
-
function
|
|
3080
|
+
function xa(e) {
|
|
3081
3081
|
if (!e) return "";
|
|
3082
3082
|
let t = String(e);
|
|
3083
3083
|
if (/^https?:\/\//i.test(t)) return t;
|
|
3084
|
-
let n =
|
|
3084
|
+
let n = Rr().s3BaseUrl || "";
|
|
3085
3085
|
return n ? `${n}/${t.replace(/^\/+/, "")}` : "";
|
|
3086
3086
|
}
|
|
3087
3087
|
function Sa(e) {
|
|
3088
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3088
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : va(e, fa) || ya(e, pa);
|
|
3089
3089
|
}
|
|
3090
3090
|
function Ca(e) {
|
|
3091
|
-
return e ? typeof e == "string" ?
|
|
3091
|
+
return e ? typeof e == "string" ? ba(e) || e : typeof e == "object" && (va(e, Rr().documentNameOrder ?? []) || ya(e, ma) || ba(Sa(e)) || ya(e, ha)) || "Document" : "Document";
|
|
3092
3092
|
}
|
|
3093
3093
|
function wa(e) {
|
|
3094
|
-
if (
|
|
3094
|
+
if (_a(e)) return [];
|
|
3095
3095
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3096
|
-
for (let e of t) if (!
|
|
3096
|
+
for (let e of t) if (!_a(e)) {
|
|
3097
3097
|
if (typeof e == "string") {
|
|
3098
3098
|
let t = e.includes("/") ? e : "";
|
|
3099
3099
|
n.push({
|
|
3100
3100
|
location: t,
|
|
3101
|
-
name:
|
|
3102
|
-
url:
|
|
3101
|
+
name: ba(e) || e,
|
|
3102
|
+
url: xa(t)
|
|
3103
3103
|
});
|
|
3104
3104
|
} else if (typeof e == "object") {
|
|
3105
3105
|
let t = Sa(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3106
3106
|
n.push({
|
|
3107
3107
|
location: t,
|
|
3108
3108
|
name: Ca(e),
|
|
3109
|
-
url: r ||
|
|
3109
|
+
url: r || xa(t)
|
|
3110
3110
|
});
|
|
3111
3111
|
}
|
|
3112
3112
|
}
|
|
@@ -3131,20 +3131,20 @@ function Y(e, t, n) {
|
|
|
3131
3131
|
function Oa(e, t = []) {
|
|
3132
3132
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3133
3133
|
if (!n) continue;
|
|
3134
|
-
let t =
|
|
3134
|
+
let t = H(e, n);
|
|
3135
3135
|
if (!Ea(t)) return t;
|
|
3136
3136
|
}
|
|
3137
3137
|
}
|
|
3138
|
-
function
|
|
3138
|
+
function ka(e, t) {
|
|
3139
3139
|
if (!e || typeof e != "object") return;
|
|
3140
3140
|
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Ea(n));
|
|
3141
3141
|
if (r) return r[1];
|
|
3142
3142
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3143
|
-
let n =
|
|
3143
|
+
let n = ka(e, t);
|
|
3144
3144
|
if (!Ea(n)) return n;
|
|
3145
3145
|
}
|
|
3146
3146
|
}
|
|
3147
|
-
function
|
|
3147
|
+
function Aa(e, t) {
|
|
3148
3148
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3149
3149
|
if (!n.length) return;
|
|
3150
3150
|
let r = n.map((e, n) => {
|
|
@@ -3154,9 +3154,9 @@ function ka(e, t) {
|
|
|
3154
3154
|
status: "done"
|
|
3155
3155
|
};
|
|
3156
3156
|
if (!e || typeof e != "object") return null;
|
|
3157
|
-
let r = Oa(e, [t.fileUrlKey, t.locationKey]) ??
|
|
3157
|
+
let r = Oa(e, [t.fileUrlKey, t.locationKey]) ?? ka(e, /(location|url|path)$/i) ?? "", i = Oa(e, [t.fileNameKey]) ?? ka(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3158
3158
|
if (!r && !i) return null;
|
|
3159
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3159
|
+
let a = r && !String(r).startsWith("http") ? xa(r) : r;
|
|
3160
3160
|
return {
|
|
3161
3161
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3162
3162
|
name: i || "file",
|
|
@@ -3168,11 +3168,11 @@ function ka(e, t) {
|
|
|
3168
3168
|
}).filter(Boolean);
|
|
3169
3169
|
return r.length ? r : void 0;
|
|
3170
3170
|
}
|
|
3171
|
-
function
|
|
3171
|
+
function ja(e, t) {
|
|
3172
3172
|
if (!e || typeof e != "object") return;
|
|
3173
|
-
let n = Oa(e, [t.fileNameKey, t.field]) ??
|
|
3173
|
+
let n = Oa(e, [t.fileNameKey, t.field]) ?? ka(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Oa(e, [t.fileUrlKey, t.locationKey]) ?? ka(e, /(location|url|path)$/i) ?? "";
|
|
3174
3174
|
if (!n && !r) return;
|
|
3175
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3175
|
+
let i = r && !String(r).startsWith("http") ? xa(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3176
3176
|
return [{
|
|
3177
3177
|
uid: String(a),
|
|
3178
3178
|
name: n ?? "file",
|
|
@@ -3181,20 +3181,20 @@ function Aa(e, t) {
|
|
|
3181
3181
|
url: i || void 0
|
|
3182
3182
|
}];
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3184
|
+
function Ma(e, t, n, r) {
|
|
3185
3185
|
(e.fields ?? []).forEach((e) => {
|
|
3186
3186
|
e?.verifyAction && [
|
|
3187
3187
|
e.verifyResultField,
|
|
3188
3188
|
e.verifyTimestampField,
|
|
3189
3189
|
...String(e.verifyLockedWhenFields ?? "").split(/[,\s]+/)
|
|
3190
3190
|
].map((e) => String(e ?? "").trim()).filter(Boolean).forEach((e) => {
|
|
3191
|
-
if (
|
|
3191
|
+
if (H(n, e) !== void 0) return;
|
|
3192
3192
|
let i = r(t, { field: e });
|
|
3193
3193
|
i != null && Y(n, e, i);
|
|
3194
3194
|
});
|
|
3195
3195
|
});
|
|
3196
3196
|
}
|
|
3197
|
-
function
|
|
3197
|
+
function Na(e) {
|
|
3198
3198
|
let t = Array.isArray(e.rows) ? e.rows : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3199
3199
|
let i = {};
|
|
3200
3200
|
return (e.fields ?? []).forEach((e) => {
|
|
@@ -3209,26 +3209,26 @@ function Ma(e) {
|
|
|
3209
3209
|
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Y(i, e.field, e.defaultValue);
|
|
3210
3210
|
return;
|
|
3211
3211
|
}
|
|
3212
|
-
Y(i, e.field, Ta(e.addRow) ?
|
|
3213
|
-
}),
|
|
3214
|
-
}, i =
|
|
3212
|
+
Y(i, e.field, Ta(e.addRow) ? ra(e, a) : J(e, a));
|
|
3213
|
+
}), Ma(e, t, i, r), i;
|
|
3214
|
+
}, i = Wi(e, { editing: !0 });
|
|
3215
3215
|
if (t && t.length > 0) {
|
|
3216
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3216
|
+
let e = t.map((e) => r(e, (e, t) => ja(e, t), (e, t) => H(e, t.field)));
|
|
3217
3217
|
for (; e.length < n;) e.push({ ...i });
|
|
3218
3218
|
return e;
|
|
3219
3219
|
}
|
|
3220
|
-
let a = r(e, (e, t) =>
|
|
3220
|
+
let a = r(e, (e, t) => Aa(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3221
3221
|
for (; o.length < n;) o.push({ ...i });
|
|
3222
3222
|
return o;
|
|
3223
3223
|
}
|
|
3224
|
-
function
|
|
3224
|
+
function Pa(e, t = []) {
|
|
3225
3225
|
let n = {};
|
|
3226
3226
|
return t.forEach((e) => {
|
|
3227
3227
|
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3228
3228
|
if (!e.field || e.addRow) return;
|
|
3229
3229
|
let t = e.value, r = e.field;
|
|
3230
3230
|
if (e.type === "file") {
|
|
3231
|
-
let i =
|
|
3231
|
+
let i = Aa(t, e);
|
|
3232
3232
|
i && Y(n, r, i);
|
|
3233
3233
|
return;
|
|
3234
3234
|
}
|
|
@@ -3238,37 +3238,37 @@ function Na(e, t = []) {
|
|
|
3238
3238
|
if (i) {
|
|
3239
3239
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3240
3240
|
Y(n, r, e ? [e[0]] : []);
|
|
3241
|
-
} else Y(n, r,
|
|
3241
|
+
} else Y(n, r, vi(e, Array.isArray(t) ? t : [t]));
|
|
3242
3242
|
return;
|
|
3243
3243
|
}
|
|
3244
|
-
Y(n, r,
|
|
3244
|
+
Y(n, r, J(e, t));
|
|
3245
3245
|
}
|
|
3246
3246
|
});
|
|
3247
3247
|
}), Object.keys(n).length > 0 && e.setFieldsValue(n), n;
|
|
3248
3248
|
}
|
|
3249
3249
|
//#endregion
|
|
3250
3250
|
//#region src/components/form/useAiActions.js
|
|
3251
|
-
function
|
|
3251
|
+
function Fa(e) {
|
|
3252
3252
|
let t = document.createElement("div");
|
|
3253
3253
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3254
3254
|
}
|
|
3255
|
-
function
|
|
3256
|
-
return t && t === "stripHtml" ?
|
|
3255
|
+
function Ia(e, t) {
|
|
3256
|
+
return t && t === "stripHtml" ? Fa(e) : e;
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function La(e) {
|
|
3259
3259
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3260
3260
|
}
|
|
3261
|
-
function
|
|
3261
|
+
function Ra(e) {
|
|
3262
3262
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3263
3263
|
}
|
|
3264
|
-
function
|
|
3264
|
+
function za(e, t) {
|
|
3265
3265
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3266
|
-
let n =
|
|
3266
|
+
let n = Ia(t, e.transform), r = String(n ?? "").trim();
|
|
3267
3267
|
if (!r) return !1;
|
|
3268
3268
|
let i = Number(e.minWords) || 0;
|
|
3269
|
-
return i > 0 ?
|
|
3269
|
+
return i > 0 ? La(r) >= i : !0;
|
|
3270
3270
|
}
|
|
3271
|
-
function
|
|
3271
|
+
function Ba(e, t) {
|
|
3272
3272
|
let n = e.inputs || [];
|
|
3273
3273
|
if (n.length === 0) return !0;
|
|
3274
3274
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3276,35 +3276,35 @@ function za(e, t) {
|
|
|
3276
3276
|
let n = e.group || `__solo_${t}`;
|
|
3277
3277
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3278
3278
|
});
|
|
3279
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3279
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => za(e, t(e.sourceField)))) return !1;
|
|
3280
3280
|
return !0;
|
|
3281
3281
|
}
|
|
3282
|
-
var
|
|
3282
|
+
var Va = [
|
|
3283
3283
|
"top-left",
|
|
3284
3284
|
"top-center",
|
|
3285
3285
|
"top-right",
|
|
3286
3286
|
"bottom-left",
|
|
3287
3287
|
"bottom-center",
|
|
3288
3288
|
"bottom-right"
|
|
3289
|
-
],
|
|
3290
|
-
function
|
|
3289
|
+
], Ha = "bottom-left";
|
|
3290
|
+
function Ua(e = []) {
|
|
3291
3291
|
let t = {};
|
|
3292
3292
|
return e.forEach((e) => {
|
|
3293
|
-
let n =
|
|
3293
|
+
let n = Va.includes(e.position) ? e.position : Ha;
|
|
3294
3294
|
(t[n] ??= []).push(e);
|
|
3295
3295
|
}), t;
|
|
3296
3296
|
}
|
|
3297
|
-
function
|
|
3298
|
-
let [r, i] = g(null), a = y.useWatch((e) => e, e), o = f((e) =>
|
|
3297
|
+
function Wa({ form: e, groups: t, module: n }) {
|
|
3298
|
+
let [r, i] = g(null), a = y.useWatch((e) => e, e), o = f((e) => Ba(e, (e) => (a || {})[e]), [a]), s = f((t) => {
|
|
3299
3299
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3300
|
-
let n =
|
|
3300
|
+
let n = Pa(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3301
3301
|
return t.forEach((t) => {
|
|
3302
3302
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3303
|
-
let n =
|
|
3303
|
+
let n = Na(t);
|
|
3304
3304
|
if (n.length === 0) return;
|
|
3305
3305
|
r = !0;
|
|
3306
3306
|
let i = () => e.setFieldsValue({ [t.name]: n }), a = e.getFieldValue(t.name) || [];
|
|
3307
|
-
a.some(
|
|
3307
|
+
a.some(Ra) ? b.confirm({
|
|
3308
3308
|
title: "Replace existing rows?",
|
|
3309
3309
|
content: `This will replace ${a.length} existing row(s) in "${t.label || t.name}".`,
|
|
3310
3310
|
okText: "Replace",
|
|
@@ -3324,12 +3324,12 @@ function Ua({ form: e, groups: t, module: n }) {
|
|
|
3324
3324
|
r && (c[t.param] = r);
|
|
3325
3325
|
} else {
|
|
3326
3326
|
let n = e.getFieldValue(t.sourceField);
|
|
3327
|
-
n != null && n !== "" && (i[t.param] =
|
|
3327
|
+
n != null && n !== "" && (i[t.param] = Ia(n, t.transform));
|
|
3328
3328
|
}
|
|
3329
3329
|
}), (a.inputs || []).forEach((e) => {
|
|
3330
3330
|
!e.group || e.kind !== "text" || (a.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete i[e.param];
|
|
3331
3331
|
});
|
|
3332
|
-
let l = await
|
|
3332
|
+
let l = await ca({
|
|
3333
3333
|
module: n,
|
|
3334
3334
|
group: t,
|
|
3335
3335
|
field: r.field,
|
|
@@ -3356,7 +3356,7 @@ function Ua({ form: e, groups: t, module: n }) {
|
|
|
3356
3356
|
}
|
|
3357
3357
|
//#endregion
|
|
3358
3358
|
//#region src/components/form/AiActionButtons.jsx
|
|
3359
|
-
function
|
|
3359
|
+
function Ga({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3360
3360
|
return !t || t.length === 0 ? null : /* @__PURE__ */ C(ee, {
|
|
3361
3361
|
size: 8,
|
|
3362
3362
|
className: "v1-ai-action-buttons",
|
|
@@ -3375,18 +3375,18 @@ function Wa({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3375
3375
|
}
|
|
3376
3376
|
//#endregion
|
|
3377
3377
|
//#region src/components/form/emailValidator.js
|
|
3378
|
-
function
|
|
3378
|
+
function Ka(e) {
|
|
3379
3379
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3380
3380
|
if (!n) return !1;
|
|
3381
3381
|
let [, r, i] = n;
|
|
3382
3382
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3383
3383
|
}
|
|
3384
|
-
function
|
|
3385
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3384
|
+
function qa(e = "Email", t) {
|
|
3385
|
+
return { validator: (n, r) => r == null || r === "" || Ka(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3386
3386
|
}
|
|
3387
3387
|
//#endregion
|
|
3388
3388
|
//#region src/components/form/inputValidator.js
|
|
3389
|
-
var
|
|
3389
|
+
var Ja = [
|
|
3390
3390
|
{
|
|
3391
3391
|
label: "Only Numbers",
|
|
3392
3392
|
value: "onlyNumber"
|
|
@@ -3455,7 +3455,7 @@ var qa = [
|
|
|
3455
3455
|
label: "Website URL",
|
|
3456
3456
|
value: "websiteUrl"
|
|
3457
3457
|
}
|
|
3458
|
-
],
|
|
3458
|
+
], Ya = {
|
|
3459
3459
|
onlyNumber: /^[0-9]$/,
|
|
3460
3460
|
experience: /^[0-9]$/,
|
|
3461
3461
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3470,10 +3470,10 @@ var qa = [
|
|
|
3470
3470
|
decimalRange: /^[0-9.]$/,
|
|
3471
3471
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3472
3472
|
};
|
|
3473
|
-
function
|
|
3474
|
-
return
|
|
3473
|
+
function Xa(e) {
|
|
3474
|
+
return Ya[e] ?? null;
|
|
3475
3475
|
}
|
|
3476
|
-
function
|
|
3476
|
+
function Za(e, t = {}, n = "change") {
|
|
3477
3477
|
if (!t?.type || e == null) return {
|
|
3478
3478
|
cleaned: e ?? "",
|
|
3479
3479
|
error: null
|
|
@@ -3551,7 +3551,7 @@ function Xa(e, t = {}, n = "change") {
|
|
|
3551
3551
|
break;
|
|
3552
3552
|
}
|
|
3553
3553
|
case "email":
|
|
3554
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
3554
|
+
c = n === "blur" ? r.trim() : r, c && !Ka(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3555
3555
|
break;
|
|
3556
3556
|
case "websiteUrl":
|
|
3557
3557
|
c = n === "blur" ? r.trim() : r, c && !/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c) && (l = `${s} must be a valid URL.`);
|
|
@@ -3563,21 +3563,21 @@ function Xa(e, t = {}, n = "change") {
|
|
|
3563
3563
|
error: l
|
|
3564
3564
|
};
|
|
3565
3565
|
}
|
|
3566
|
-
var
|
|
3567
|
-
function
|
|
3566
|
+
var Qa = "This value is already present";
|
|
3567
|
+
function $a(e) {
|
|
3568
3568
|
return typeof e == "string" ? e : e?.type ?? e?.rule ?? e?.name;
|
|
3569
3569
|
}
|
|
3570
|
-
function
|
|
3571
|
-
if (
|
|
3570
|
+
function eo(e) {
|
|
3571
|
+
if ($a(e) !== "unique") return null;
|
|
3572
3572
|
if (typeof e == "string") return {
|
|
3573
|
-
message:
|
|
3573
|
+
message: Qa,
|
|
3574
3574
|
normalizer: "trim",
|
|
3575
3575
|
skipBlank: !0,
|
|
3576
3576
|
validateOn: "blur"
|
|
3577
3577
|
};
|
|
3578
3578
|
let t = e.value && typeof e.value == "object" ? e.value : e, n = String(t.validateOn ?? "blur").toLowerCase();
|
|
3579
3579
|
return {
|
|
3580
|
-
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() :
|
|
3580
|
+
message: typeof e.message == "string" && e.message.trim() ? e.message.trim() : Qa,
|
|
3581
3581
|
collectionField: t.collectionField ?? "",
|
|
3582
3582
|
normalizer: String(t.normalizer ?? "trim"),
|
|
3583
3583
|
skipBlank: t.skipBlank !== !1,
|
|
@@ -3588,20 +3588,20 @@ function $a(e) {
|
|
|
3588
3588
|
].includes(n) ? n : "blur"
|
|
3589
3589
|
};
|
|
3590
3590
|
}
|
|
3591
|
-
function
|
|
3591
|
+
function to(e) {
|
|
3592
3592
|
let t = e?.validations ?? e?.validation ?? e?.rules ?? [];
|
|
3593
3593
|
if (!Array.isArray(t)) return null;
|
|
3594
3594
|
for (let e of t) {
|
|
3595
|
-
let t =
|
|
3595
|
+
let t = eo(e);
|
|
3596
3596
|
if (t) return t;
|
|
3597
3597
|
}
|
|
3598
3598
|
return null;
|
|
3599
3599
|
}
|
|
3600
|
-
function
|
|
3600
|
+
function no(e = []) {
|
|
3601
3601
|
let t = [];
|
|
3602
3602
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3603
3603
|
(e?.fields ?? []).forEach((e) => {
|
|
3604
|
-
let n =
|
|
3604
|
+
let n = to(e);
|
|
3605
3605
|
!n || !e?.field || t.push({
|
|
3606
3606
|
field: e.field,
|
|
3607
3607
|
label: e.label ?? e.field,
|
|
@@ -3610,10 +3610,10 @@ function to(e = []) {
|
|
|
3610
3610
|
});
|
|
3611
3611
|
}), t;
|
|
3612
3612
|
}
|
|
3613
|
-
function
|
|
3613
|
+
function ro(e) {
|
|
3614
3614
|
return e == null ? !0 : typeof e == "number" ? Number.isNaN(e) : typeof e == "boolean" ? !1 : Array.isArray(e) ? e.length === 0 : String(e).trim() === "";
|
|
3615
3615
|
}
|
|
3616
|
-
function
|
|
3616
|
+
function io(e, t = "trim") {
|
|
3617
3617
|
if (e == null) return "";
|
|
3618
3618
|
let n = String(e);
|
|
3619
3619
|
switch (String(t)) {
|
|
@@ -3625,34 +3625,34 @@ function ro(e, t = "trim") {
|
|
|
3625
3625
|
default: return n.trim();
|
|
3626
3626
|
}
|
|
3627
3627
|
}
|
|
3628
|
-
function
|
|
3629
|
-
return !(!e || e.skipBlank !== !1 &&
|
|
3628
|
+
function ao(e, t) {
|
|
3629
|
+
return !(!e || e.skipBlank !== !1 && ro(t));
|
|
3630
3630
|
}
|
|
3631
|
-
function
|
|
3631
|
+
function oo(e) {
|
|
3632
3632
|
return !e || e.validateOn === "submit" ? [] : e.validateOn === "change" ? ["onChange", "onBlur"] : ["onBlur"];
|
|
3633
3633
|
}
|
|
3634
|
-
var
|
|
3634
|
+
var X = {
|
|
3635
3635
|
SKIPPED: "skipped",
|
|
3636
3636
|
AVAILABLE: "available",
|
|
3637
3637
|
DUPLICATE: "duplicate",
|
|
3638
3638
|
STALE: "stale",
|
|
3639
3639
|
ERROR: "error"
|
|
3640
3640
|
};
|
|
3641
|
-
function
|
|
3641
|
+
function so({ module: e, field: t, recordId: n, normalized: r }) {
|
|
3642
3642
|
return `${e}${t}${n ?? ""}${r}`;
|
|
3643
3643
|
}
|
|
3644
|
-
function
|
|
3644
|
+
function co({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
3645
3645
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
3646
3646
|
function o(e) {
|
|
3647
3647
|
a = e, typeof t == "function" && t(a);
|
|
3648
3648
|
}
|
|
3649
3649
|
async function s({ module: t, field: s, rule: c, value: l, recordId: u, clientId: d, region: f } = {}) {
|
|
3650
|
-
if (!c || !t || !s || typeof e != "function" || !
|
|
3651
|
-
let p =
|
|
3650
|
+
if (!c || !t || !s || typeof e != "function" || !ao(c, l)) return { status: X.SKIPPED };
|
|
3651
|
+
let p = so({
|
|
3652
3652
|
module: t,
|
|
3653
3653
|
field: s,
|
|
3654
3654
|
recordId: u,
|
|
3655
|
-
normalized:
|
|
3655
|
+
normalized: io(l, c.normalizer)
|
|
3656
3656
|
});
|
|
3657
3657
|
if (n.has(p)) return n.get(p);
|
|
3658
3658
|
i += 1;
|
|
@@ -3667,17 +3667,17 @@ function so({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
3667
3667
|
clientId: d,
|
|
3668
3668
|
region: f
|
|
3669
3669
|
});
|
|
3670
|
-
if (r.get(s) !== m) return { status:
|
|
3670
|
+
if (r.get(s) !== m) return { status: X.STALE };
|
|
3671
3671
|
let a = i?.available === !1 ? {
|
|
3672
|
-
status:
|
|
3673
|
-
message:
|
|
3674
|
-
} : { status:
|
|
3672
|
+
status: X.DUPLICATE,
|
|
3673
|
+
message: lo(i) || c.message || Qa
|
|
3674
|
+
} : { status: X.AVAILABLE };
|
|
3675
3675
|
return n.set(p, a), a;
|
|
3676
3676
|
} catch (e) {
|
|
3677
3677
|
return r.get(s) === m ? {
|
|
3678
|
-
status:
|
|
3678
|
+
status: X.ERROR,
|
|
3679
3679
|
error: e
|
|
3680
|
-
} : { status:
|
|
3680
|
+
} : { status: X.STALE };
|
|
3681
3681
|
} finally {
|
|
3682
3682
|
o(Math.max(0, a - 1));
|
|
3683
3683
|
}
|
|
@@ -3691,17 +3691,17 @@ function so({ checkFieldUnique: e, onPendingChange: t } = {}) {
|
|
|
3691
3691
|
}
|
|
3692
3692
|
};
|
|
3693
3693
|
}
|
|
3694
|
-
function
|
|
3694
|
+
function lo(e) {
|
|
3695
3695
|
return (e?.errors ?? []).find((e) => e?.message)?.message || e?.message || "";
|
|
3696
3696
|
}
|
|
3697
|
-
var
|
|
3698
|
-
function
|
|
3699
|
-
let r =
|
|
3697
|
+
var uo = "__uniqueRule";
|
|
3698
|
+
function fo({ field: e, validation: t, context: n }) {
|
|
3699
|
+
let r = eo(t);
|
|
3700
3700
|
if (!r) return { validator: () => Promise.resolve() };
|
|
3701
3701
|
let i = e?.field ?? "";
|
|
3702
3702
|
return !n?.checker || !n?.module || !i ? { validator: () => Promise.resolve() } : {
|
|
3703
|
-
[
|
|
3704
|
-
validateTrigger:
|
|
3703
|
+
[uo]: r,
|
|
3704
|
+
validateTrigger: oo(r),
|
|
3705
3705
|
validator: async (e, t) => {
|
|
3706
3706
|
let a = await n.checker.check({
|
|
3707
3707
|
module: n.module,
|
|
@@ -3712,26 +3712,26 @@ function uo({ field: e, validation: t, context: n }) {
|
|
|
3712
3712
|
clientId: n.clientId,
|
|
3713
3713
|
region: n.region
|
|
3714
3714
|
});
|
|
3715
|
-
return a.status ===
|
|
3715
|
+
return a.status === X.DUPLICATE ? Promise.reject(Error(a.message || r.message)) : Promise.resolve();
|
|
3716
3716
|
}
|
|
3717
3717
|
};
|
|
3718
3718
|
}
|
|
3719
|
-
function
|
|
3719
|
+
function po(e = []) {
|
|
3720
3720
|
let t = Array.isArray(e) ? e : [];
|
|
3721
|
-
if (!t.some((e) => e && e[
|
|
3722
|
-
let n = t.filter((e) => e && !e[
|
|
3721
|
+
if (!t.some((e) => e && e[uo])) return t;
|
|
3722
|
+
let n = t.filter((e) => e && !e[uo]);
|
|
3723
3723
|
return t.map((e) => {
|
|
3724
|
-
if (!e || !e[
|
|
3724
|
+
if (!e || !e[uo]) return e;
|
|
3725
3725
|
let t = e.validator;
|
|
3726
3726
|
return {
|
|
3727
3727
|
...e,
|
|
3728
|
-
validator: async (e, r) => await
|
|
3728
|
+
validator: async (e, r) => await mo(n, r, e) ? Promise.resolve() : t(e, r)
|
|
3729
3729
|
};
|
|
3730
3730
|
});
|
|
3731
3731
|
}
|
|
3732
|
-
async function
|
|
3732
|
+
async function mo(e = [], t, n = {}) {
|
|
3733
3733
|
for (let r of e) if (!(!r || typeof r == "string")) {
|
|
3734
|
-
if (r.required &&
|
|
3734
|
+
if (r.required && ro(t) || !ro(t) && (r.pattern instanceof RegExp && !new RegExp(r.pattern.source, r.pattern.flags).test(String(t)) || r.len != null && String(t).length !== Number(r.len))) return !0;
|
|
3735
3735
|
if (typeof r.validator == "function") try {
|
|
3736
3736
|
await r.validator(n, t);
|
|
3737
3737
|
} catch {
|
|
@@ -3740,7 +3740,7 @@ async function po(e = [], t, n = {}) {
|
|
|
3740
3740
|
}
|
|
3741
3741
|
return !1;
|
|
3742
3742
|
}
|
|
3743
|
-
function
|
|
3743
|
+
function ho(e) {
|
|
3744
3744
|
let t = String(e ?? "").trim();
|
|
3745
3745
|
if (!t.startsWith("{")) return null;
|
|
3746
3746
|
try {
|
|
@@ -3749,24 +3749,24 @@ function mo(e) {
|
|
|
3749
3749
|
return null;
|
|
3750
3750
|
}
|
|
3751
3751
|
}
|
|
3752
|
-
function
|
|
3752
|
+
function go(e) {
|
|
3753
3753
|
if (!e) return null;
|
|
3754
|
-
if (typeof e == "string") return
|
|
3754
|
+
if (typeof e == "string") return ho(e);
|
|
3755
3755
|
let t = [
|
|
3756
3756
|
e.data,
|
|
3757
3757
|
e.response,
|
|
3758
3758
|
e,
|
|
3759
|
-
|
|
3759
|
+
ho(e.message)
|
|
3760
3760
|
];
|
|
3761
3761
|
for (let e of t) if (!(!e || typeof e != "object") && (Array.isArray(e.errors) || e.code === "DUPLICATE_VALUE")) return e;
|
|
3762
3762
|
return null;
|
|
3763
3763
|
}
|
|
3764
|
-
function
|
|
3765
|
-
let n =
|
|
3764
|
+
function _o(e, { uniqueRules: t = [] } = {}) {
|
|
3765
|
+
let n = go(e);
|
|
3766
3766
|
if (n) {
|
|
3767
3767
|
let e = (Array.isArray(n.errors) ? n.errors : []).filter((e) => e?.field).map((e) => ({
|
|
3768
3768
|
field: e.field,
|
|
3769
|
-
message: e.message || n.message ||
|
|
3769
|
+
message: e.message || n.message || Qa
|
|
3770
3770
|
}));
|
|
3771
3771
|
if (e.length) return e;
|
|
3772
3772
|
}
|
|
@@ -3780,7 +3780,7 @@ function go(e, { uniqueRules: t = [] } = {}) {
|
|
|
3780
3780
|
}
|
|
3781
3781
|
//#endregion
|
|
3782
3782
|
//#region src/services/uniqueValidationApi.js
|
|
3783
|
-
async function
|
|
3783
|
+
async function vo({ module: e, field: t, value: i, recordId: a, clientId: o, region: s } = {}) {
|
|
3784
3784
|
if (!e || !t) throw Error("module and field are required to check uniqueness");
|
|
3785
3785
|
let c = {
|
|
3786
3786
|
field: t,
|
|
@@ -3816,7 +3816,7 @@ async function _o({ module: e, field: t, value: i, recordId: a, clientId: o, reg
|
|
|
3816
3816
|
}
|
|
3817
3817
|
//#endregion
|
|
3818
3818
|
//#region src/components/form/uploadAccept.js
|
|
3819
|
-
var
|
|
3819
|
+
var yo = [
|
|
3820
3820
|
"jpg",
|
|
3821
3821
|
"jpeg",
|
|
3822
3822
|
"png",
|
|
@@ -3825,18 +3825,18 @@ var vo = [
|
|
|
3825
3825
|
"bmp",
|
|
3826
3826
|
"svg",
|
|
3827
3827
|
"avif"
|
|
3828
|
-
],
|
|
3828
|
+
], bo = [
|
|
3829
3829
|
"mp4",
|
|
3830
3830
|
"webm",
|
|
3831
3831
|
"ogg",
|
|
3832
3832
|
"ogv",
|
|
3833
3833
|
"mov",
|
|
3834
3834
|
"m4v"
|
|
3835
|
-
],
|
|
3835
|
+
], xo = [
|
|
3836
3836
|
"pdf",
|
|
3837
3837
|
"doc",
|
|
3838
3838
|
"docx"
|
|
3839
|
-
],
|
|
3839
|
+
], So = [
|
|
3840
3840
|
{
|
|
3841
3841
|
label: "Any file",
|
|
3842
3842
|
value: "any"
|
|
@@ -3857,34 +3857,34 @@ var vo = [
|
|
|
3857
3857
|
label: "Images & Videos",
|
|
3858
3858
|
value: "imagesAndVideos"
|
|
3859
3859
|
}
|
|
3860
|
-
],
|
|
3860
|
+
], Co = {
|
|
3861
3861
|
documents: {
|
|
3862
|
-
exts: [...
|
|
3862
|
+
exts: [...xo, ...yo],
|
|
3863
3863
|
hint: "PDF, DOC or image files",
|
|
3864
3864
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
3865
3865
|
},
|
|
3866
3866
|
images: {
|
|
3867
|
-
exts:
|
|
3867
|
+
exts: yo,
|
|
3868
3868
|
hint: "Image files",
|
|
3869
3869
|
error: "Only image files are allowed"
|
|
3870
3870
|
},
|
|
3871
3871
|
videos: {
|
|
3872
|
-
exts:
|
|
3872
|
+
exts: bo,
|
|
3873
3873
|
hint: "Video files",
|
|
3874
3874
|
error: "Only video files are allowed"
|
|
3875
3875
|
},
|
|
3876
3876
|
imagesAndVideos: {
|
|
3877
|
-
exts: [...
|
|
3877
|
+
exts: [...yo, ...bo],
|
|
3878
3878
|
hint: "Image or video files",
|
|
3879
3879
|
error: "Only image or video files are allowed"
|
|
3880
3880
|
}
|
|
3881
3881
|
};
|
|
3882
|
-
function
|
|
3883
|
-
return
|
|
3882
|
+
function wo(e) {
|
|
3883
|
+
return Co[String(e?.accept ?? "").trim()] ?? null;
|
|
3884
3884
|
}
|
|
3885
3885
|
//#endregion
|
|
3886
3886
|
//#region src/components/AppButton.jsx
|
|
3887
|
-
function
|
|
3887
|
+
function To({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
3888
3888
|
let o = /* @__PURE__ */ C(v, {
|
|
3889
3889
|
className: `app-button app-button--${i} ${t}`.trim(),
|
|
3890
3890
|
icon: n,
|
|
@@ -3899,13 +3899,13 @@ function wo({ children: e, className: t = "", icon: n, to: r, variant: i = "defa
|
|
|
3899
3899
|
}
|
|
3900
3900
|
//#endregion
|
|
3901
3901
|
//#region src/components/detail/userNames.js
|
|
3902
|
-
function
|
|
3902
|
+
function Eo(e) {
|
|
3903
3903
|
return !e || typeof e != "object" ? "" : [e.first_name ?? e.firstName ?? e.FIRST_NAME, e.last_name ?? e.lastName ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.user_name || e.userName || e.username || e.email || "";
|
|
3904
3904
|
}
|
|
3905
|
-
function
|
|
3905
|
+
function Do(e) {
|
|
3906
3906
|
let t = {};
|
|
3907
3907
|
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3908
|
-
let n =
|
|
3908
|
+
let n = Eo(e);
|
|
3909
3909
|
n && [
|
|
3910
3910
|
e.legacyUserId,
|
|
3911
3911
|
e.userId,
|
|
@@ -3919,29 +3919,29 @@ function Eo(e) {
|
|
|
3919
3919
|
});
|
|
3920
3920
|
}), t;
|
|
3921
3921
|
}
|
|
3922
|
-
var
|
|
3923
|
-
function
|
|
3922
|
+
var Oo = /* @__PURE__ */ new Map();
|
|
3923
|
+
function ko(e) {
|
|
3924
3924
|
let t = String(e ?? "").trim();
|
|
3925
3925
|
if (!t) return Promise.resolve("");
|
|
3926
|
-
if (
|
|
3927
|
-
let i = n(r, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) =>
|
|
3928
|
-
return
|
|
3926
|
+
if (Oo.has(t)) return Oo.get(t);
|
|
3927
|
+
let i = n(r, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => Eo(e?.data ?? e ?? null)).catch(() => "");
|
|
3928
|
+
return Oo.set(t, i), i;
|
|
3929
3929
|
}
|
|
3930
|
-
var
|
|
3931
|
-
function
|
|
3930
|
+
var Z = (e) => e == null ? "" : String(e).trim();
|
|
3931
|
+
function Ao(e) {
|
|
3932
3932
|
let t = e?.quickCreateNotice;
|
|
3933
3933
|
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
3934
3934
|
enabled: !0,
|
|
3935
|
-
title:
|
|
3936
|
-
message:
|
|
3935
|
+
title: Z(t.title) || "New record created",
|
|
3936
|
+
message: Z(t.message) || "A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.",
|
|
3937
3937
|
showCreator: t.showCreator !== !1,
|
|
3938
3938
|
showRecordName: t.showRecordName !== !1,
|
|
3939
|
-
recordNameField:
|
|
3940
|
-
recordLabel:
|
|
3941
|
-
creatorLabel:
|
|
3939
|
+
recordNameField: Z(t.recordNameField),
|
|
3940
|
+
recordLabel: Z(t.recordLabel) || "Record name",
|
|
3941
|
+
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
3942
3942
|
};
|
|
3943
3943
|
}
|
|
3944
|
-
var
|
|
3944
|
+
var jo = [
|
|
3945
3945
|
"clientName",
|
|
3946
3946
|
"companyName",
|
|
3947
3947
|
"name",
|
|
@@ -3951,24 +3951,24 @@ var Ao = [
|
|
|
3951
3951
|
"label",
|
|
3952
3952
|
"employerName",
|
|
3953
3953
|
"vendorName"
|
|
3954
|
-
],
|
|
3954
|
+
], Mo = (e, t) => {
|
|
3955
3955
|
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
3956
|
-
},
|
|
3957
|
-
function
|
|
3956
|
+
}, No = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
3957
|
+
function Po(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
3958
3958
|
if (!e || typeof e != "object") return "";
|
|
3959
3959
|
for (let r of [
|
|
3960
3960
|
t,
|
|
3961
3961
|
n,
|
|
3962
|
-
...
|
|
3962
|
+
...jo
|
|
3963
3963
|
]) {
|
|
3964
3964
|
if (!r) continue;
|
|
3965
|
-
let t = Mo(
|
|
3965
|
+
let t = No(Mo(e, r));
|
|
3966
3966
|
if (t) return t;
|
|
3967
3967
|
}
|
|
3968
3968
|
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
3969
|
-
return r ?
|
|
3969
|
+
return r ? Z(e[r]) : "";
|
|
3970
3970
|
}
|
|
3971
|
-
function
|
|
3971
|
+
function Fo(e) {
|
|
3972
3972
|
if (!e || typeof e != "object") return "";
|
|
3973
3973
|
let t = [
|
|
3974
3974
|
e.createdBy,
|
|
@@ -3981,45 +3981,45 @@ function Po(e) {
|
|
|
3981
3981
|
for (let e of t) {
|
|
3982
3982
|
if (e == null || e === "") continue;
|
|
3983
3983
|
if (typeof e == "object") {
|
|
3984
|
-
let t =
|
|
3984
|
+
let t = Z(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
3985
3985
|
if (t) return t;
|
|
3986
3986
|
continue;
|
|
3987
3987
|
}
|
|
3988
|
-
let t =
|
|
3988
|
+
let t = Z(e);
|
|
3989
3989
|
if (t) return t;
|
|
3990
3990
|
}
|
|
3991
3991
|
return "";
|
|
3992
3992
|
}
|
|
3993
|
-
function
|
|
3993
|
+
function Io(e = o) {
|
|
3994
3994
|
try {
|
|
3995
|
-
return
|
|
3995
|
+
return Eo(e()) || "";
|
|
3996
3996
|
} catch {
|
|
3997
3997
|
return "";
|
|
3998
3998
|
}
|
|
3999
3999
|
}
|
|
4000
|
-
var
|
|
4000
|
+
var Lo = (e, t) => n(r, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
4001
4001
|
let t = e?.data?.data ?? e?.data ?? [];
|
|
4002
4002
|
return Array.isArray(t) ? t[0] : t;
|
|
4003
4003
|
});
|
|
4004
|
-
async function
|
|
4005
|
-
let { fetchRecord: a =
|
|
4004
|
+
async function Ro({ module: e, recordId: t, notice: n, displayField: r = "", deps: i = {} } = {}) {
|
|
4005
|
+
let { fetchRecord: a = Lo, fetchUserNameFn: s = ko, getUser: c = o } = i, l = null;
|
|
4006
4006
|
if (e && t) try {
|
|
4007
4007
|
l = await a(e, t);
|
|
4008
4008
|
} catch {
|
|
4009
4009
|
l = null;
|
|
4010
4010
|
}
|
|
4011
|
-
let u = n?.showRecordName === !1 ? "" :
|
|
4011
|
+
let u = n?.showRecordName === !1 ? "" : Po(l, {
|
|
4012
4012
|
recordNameField: n?.recordNameField,
|
|
4013
4013
|
displayField: r
|
|
4014
4014
|
}), d = "";
|
|
4015
4015
|
if (n?.showCreator !== !1) {
|
|
4016
|
-
let e =
|
|
4016
|
+
let e = Fo(l);
|
|
4017
4017
|
if (e) try {
|
|
4018
|
-
d =
|
|
4018
|
+
d = Z(await s(e));
|
|
4019
4019
|
} catch {
|
|
4020
4020
|
d = "";
|
|
4021
4021
|
}
|
|
4022
|
-
d ||=
|
|
4022
|
+
d ||= Io(c);
|
|
4023
4023
|
}
|
|
4024
4024
|
return {
|
|
4025
4025
|
recordName: u,
|
|
@@ -4028,17 +4028,17 @@ async function Lo({ module: e, recordId: t, notice: n, displayField: r = "", dep
|
|
|
4028
4028
|
}
|
|
4029
4029
|
//#endregion
|
|
4030
4030
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
4031
|
-
var
|
|
4032
|
-
function
|
|
4031
|
+
var zo = d(() => import("./index.js").then((e) => e.i)), Bo = d(() => import("./index.js").then((e) => e.n)), Vo = (e) => e == null || e === "", Ho = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
4032
|
+
function Uo(e, t, n, r, i) {
|
|
4033
4033
|
let a = e.quickEditIdFrom;
|
|
4034
4034
|
if (a) {
|
|
4035
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
4036
|
-
return
|
|
4035
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...Ho(a)] : Ho(a), i = t?.getFieldValue?.(e);
|
|
4036
|
+
return Vo(i) && (i = r?.[a]), Vo(i) ? null : i;
|
|
4037
4037
|
}
|
|
4038
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
4038
|
+
return i && typeof i == "object" ? i.value ?? null : Vo(i) ? null : i;
|
|
4039
4039
|
}
|
|
4040
|
-
function
|
|
4041
|
-
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ?
|
|
4040
|
+
function Wo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
4041
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ? Uo(e, t, n, i, a) : null, [
|
|
4042
4042
|
p,
|
|
4043
4043
|
e,
|
|
4044
4044
|
t,
|
|
@@ -4068,12 +4068,12 @@ function Uo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4068
4068
|
module: _,
|
|
4069
4069
|
recordId: String(y)
|
|
4070
4070
|
}), re = (t) => {
|
|
4071
|
-
let n =
|
|
4071
|
+
let n = Ao(e);
|
|
4072
4072
|
n && (d({
|
|
4073
4073
|
...n,
|
|
4074
4074
|
recordName: "",
|
|
4075
4075
|
creatorName: ""
|
|
4076
|
-
}),
|
|
4076
|
+
}), Ro({
|
|
4077
4077
|
module: h,
|
|
4078
4078
|
recordId: t,
|
|
4079
4079
|
notice: n,
|
|
@@ -4134,7 +4134,7 @@ function Uo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4134
4134
|
},
|
|
4135
4135
|
children: /* @__PURE__ */ C(te, {})
|
|
4136
4136
|
}),
|
|
4137
|
-
children: s.mode === "create" ? /* @__PURE__ */ C(
|
|
4137
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(zo, {
|
|
4138
4138
|
moduleName: s.module,
|
|
4139
4139
|
embedded: !0,
|
|
4140
4140
|
breadcrumbItems: [],
|
|
@@ -4142,7 +4142,7 @@ function Uo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4142
4142
|
onSuccess: (e) => {
|
|
4143
4143
|
x(), re(e), o?.("create", e);
|
|
4144
4144
|
}
|
|
4145
|
-
}) : /* @__PURE__ */ C(
|
|
4145
|
+
}) : /* @__PURE__ */ C(Bo, {
|
|
4146
4146
|
moduleName: s.module,
|
|
4147
4147
|
recordId: s.recordId,
|
|
4148
4148
|
embedded: !0,
|
|
@@ -4166,7 +4166,7 @@ function Uo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4166
4166
|
width: "min(520px, 94vw)",
|
|
4167
4167
|
maskClosable: !1,
|
|
4168
4168
|
onCancel: () => d(null),
|
|
4169
|
-
footer: /* @__PURE__ */ C(
|
|
4169
|
+
footer: /* @__PURE__ */ C(To, {
|
|
4170
4170
|
variant: "primary",
|
|
4171
4171
|
type: "primary",
|
|
4172
4172
|
onClick: () => d(null),
|
|
@@ -4203,8 +4203,8 @@ function Uo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValu
|
|
|
4203
4203
|
}
|
|
4204
4204
|
//#endregion
|
|
4205
4205
|
//#region src/components/form/crossFieldRules.js
|
|
4206
|
-
var
|
|
4207
|
-
function
|
|
4206
|
+
var Go = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4207
|
+
function Ko(e, t, n) {
|
|
4208
4208
|
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
4209
4209
|
if (typeof n == "function") {
|
|
4210
4210
|
let e = n(t);
|
|
@@ -4212,24 +4212,50 @@ function Go(e, t, n) {
|
|
|
4212
4212
|
}
|
|
4213
4213
|
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
4214
4214
|
}
|
|
4215
|
-
function
|
|
4215
|
+
function qo({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
4216
4216
|
let s = n.field ?? n.compareField ?? r;
|
|
4217
4217
|
return { validator: async (n, r) => {
|
|
4218
|
-
if (!s ||
|
|
4219
|
-
let c = i?.getFieldValue?.(
|
|
4220
|
-
if (
|
|
4218
|
+
if (!s || Go(r)) return Promise.resolve();
|
|
4219
|
+
let c = i?.getFieldValue?.(Ko(a, s, o));
|
|
4220
|
+
if (Go(c)) return Promise.resolve();
|
|
4221
4221
|
let l = Number(c), u = Number(r);
|
|
4222
4222
|
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
4223
4223
|
} };
|
|
4224
4224
|
}
|
|
4225
|
-
function
|
|
4225
|
+
function Jo(e = {}, t, n) {
|
|
4226
4226
|
let r = e.field ?? e.compareField ?? e.value;
|
|
4227
|
-
return r ?
|
|
4227
|
+
return r ? Ko(t, r, n) : null;
|
|
4228
|
+
}
|
|
4229
|
+
//#endregion
|
|
4230
|
+
//#region src/components/form/prefillWhenRules.js
|
|
4231
|
+
var Yo = (e) => String(e ?? "");
|
|
4232
|
+
function Xo(e) {
|
|
4233
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
4234
|
+
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
4235
|
+
let r = e?.field;
|
|
4236
|
+
!r || t.has(r) || (t.add(r), n.push(r));
|
|
4237
|
+
}), n;
|
|
4238
|
+
}
|
|
4239
|
+
function Zo(e, t, n, r) {
|
|
4240
|
+
return Xo(e).map((e) => ({
|
|
4241
|
+
field: e,
|
|
4242
|
+
path: n(t, e, r)
|
|
4243
|
+
}));
|
|
4244
|
+
}
|
|
4245
|
+
function Qo(e, t = {}) {
|
|
4246
|
+
return !e || !e.field ? !1 : Yo(t[e.field]) === Yo(e.value);
|
|
4247
|
+
}
|
|
4248
|
+
function $o({ rules: e, watched: t = {}, current: n, lastApplied: r, clearOnMismatch: i = !0, initial: a = !1 } = {}) {
|
|
4249
|
+
let o = (Array.isArray(e) ? e : []).find((e) => Qo(e, t));
|
|
4250
|
+
return o ? o.clearValue ? a ? { action: "none" } : { action: "clear" } : {
|
|
4251
|
+
action: "set",
|
|
4252
|
+
value: o.setValue
|
|
4253
|
+
} : i && r !== void 0 && Yo(n) === Yo(r) ? { action: "clear" } : { action: "none" };
|
|
4228
4254
|
}
|
|
4229
4255
|
//#endregion
|
|
4230
4256
|
//#region src/components/form/optionConstraints.js
|
|
4231
|
-
var
|
|
4232
|
-
function
|
|
4257
|
+
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
4258
|
+
function es(e) {
|
|
4233
4259
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
4234
4260
|
return t.forEach((e) => {
|
|
4235
4261
|
if (!(e == null || e === "")) {
|
|
@@ -4241,46 +4267,68 @@ function Yo(e) {
|
|
|
4241
4267
|
e.label,
|
|
4242
4268
|
e.name
|
|
4243
4269
|
].forEach((e) => {
|
|
4244
|
-
e != null && e !== "" && n.push(
|
|
4270
|
+
e != null && e !== "" && n.push(Q(e));
|
|
4245
4271
|
});
|
|
4246
4272
|
return;
|
|
4247
4273
|
}
|
|
4248
|
-
n.push(
|
|
4274
|
+
n.push(Q(e));
|
|
4249
4275
|
}
|
|
4250
4276
|
}), n;
|
|
4251
4277
|
}
|
|
4252
|
-
function
|
|
4253
|
-
let n =
|
|
4278
|
+
function ts(e = [], t) {
|
|
4279
|
+
let n = es(t);
|
|
4254
4280
|
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4255
|
-
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(
|
|
4281
|
+
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(Q(e.value)) || r.has(Q(e.label)) : r.has(Q(e)));
|
|
4256
4282
|
return i.length > 0 ? i : e;
|
|
4257
4283
|
}
|
|
4284
|
+
function ns(e) {
|
|
4285
|
+
let t = [];
|
|
4286
|
+
return [e?.setValue, e?.setValueLabel].forEach((e) => {
|
|
4287
|
+
e == null || e === "" || t.push(Q(e));
|
|
4288
|
+
}), t;
|
|
4289
|
+
}
|
|
4290
|
+
function rs(e, t = {}) {
|
|
4291
|
+
let n = Array.isArray(e) ? e : [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
4292
|
+
return n.forEach((e) => {
|
|
4293
|
+
if (!e || e.clearValue) return;
|
|
4294
|
+
let n = ns(e);
|
|
4295
|
+
if (!n.length) return;
|
|
4296
|
+
let a = Qo(e, t) ? i : r;
|
|
4297
|
+
n.forEach((e) => a.add(e));
|
|
4298
|
+
}), i.forEach((e) => r.delete(e)), [...r];
|
|
4299
|
+
}
|
|
4300
|
+
function is(e = [], t, n) {
|
|
4301
|
+
let r = rs(t, n);
|
|
4302
|
+
if (!r.length || !Array.isArray(e) || e.length === 0) return e;
|
|
4303
|
+
let i = new Set(r);
|
|
4304
|
+
return e.filter((e) => e == null ? !0 : typeof e == "object" ? !(i.has(Q(e.value)) || i.has(Q(e.label))) : !i.has(Q(e)));
|
|
4305
|
+
}
|
|
4258
4306
|
//#endregion
|
|
4259
4307
|
//#region src/components/form/fieldTooltip.js
|
|
4260
|
-
var
|
|
4261
|
-
function
|
|
4262
|
-
return
|
|
4308
|
+
var as = (e) => e == null || String(e).trim() === "", os = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
4309
|
+
function ss(e) {
|
|
4310
|
+
return as(e?.tooltip) ? os(e?.infoEnabled) && !as(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
4263
4311
|
}
|
|
4264
4312
|
//#endregion
|
|
4265
4313
|
//#region src/utils/roleAllowsAction.js
|
|
4266
|
-
function
|
|
4267
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
4314
|
+
function cs(e) {
|
|
4315
|
+
return e == null ? !0 : typeof e == "object" ? cs(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
4268
4316
|
}
|
|
4269
|
-
function
|
|
4317
|
+
function ls(e, t) {
|
|
4270
4318
|
if (!e) return !0;
|
|
4271
4319
|
try {
|
|
4272
4320
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
4273
|
-
return
|
|
4321
|
+
return cs((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
4274
4322
|
} catch {
|
|
4275
4323
|
return !0;
|
|
4276
4324
|
}
|
|
4277
4325
|
}
|
|
4278
4326
|
//#endregion
|
|
4279
4327
|
//#region src/utils/afterSubmitNav.js
|
|
4280
|
-
function
|
|
4328
|
+
function us(e) {
|
|
4281
4329
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
4282
4330
|
}
|
|
4283
|
-
function
|
|
4331
|
+
function ds(e, t, n) {
|
|
4284
4332
|
let r = String(e ?? "").trim();
|
|
4285
4333
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
4286
4334
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -4289,29 +4337,29 @@ function rs(e, t, n) {
|
|
|
4289
4337
|
}
|
|
4290
4338
|
//#endregion
|
|
4291
4339
|
//#region src/utils/submitMessages.js
|
|
4292
|
-
function
|
|
4340
|
+
function fs(e) {
|
|
4293
4341
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
4294
4342
|
}
|
|
4295
4343
|
function $(e) {
|
|
4296
4344
|
let t = String(e ?? "").trim();
|
|
4297
4345
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
4298
4346
|
}
|
|
4299
|
-
function
|
|
4347
|
+
function ps(e, t) {
|
|
4300
4348
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
4301
4349
|
}
|
|
4302
|
-
function
|
|
4303
|
-
let r =
|
|
4350
|
+
function ms(e, t, n) {
|
|
4351
|
+
let r = fs(e);
|
|
4304
4352
|
if (r?.suppress) return null;
|
|
4305
4353
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
4306
|
-
return i && String(i).trim() ?
|
|
4354
|
+
return i && String(i).trim() ? ps(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
4307
4355
|
}
|
|
4308
|
-
function
|
|
4309
|
-
let i =
|
|
4310
|
-
return a && String(a).trim() ?
|
|
4356
|
+
function hs(e, t, n, r) {
|
|
4357
|
+
let i = fs(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
4358
|
+
return a && String(a).trim() ? ps(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
4311
4359
|
}
|
|
4312
4360
|
//#endregion
|
|
4313
4361
|
//#region src/utils/scrollToFirstFormError.js
|
|
4314
|
-
function
|
|
4362
|
+
function gs({ errorFields: e } = {}, t) {
|
|
4315
4363
|
if (!e?.length) return;
|
|
4316
4364
|
let n = e[0]?.name;
|
|
4317
4365
|
setTimeout(() => {
|
|
@@ -4336,10 +4384,10 @@ function cs({ errorFields: e } = {}, t) {
|
|
|
4336
4384
|
}
|
|
4337
4385
|
//#endregion
|
|
4338
4386
|
//#region src/components/form/conditionalFieldLabel.js
|
|
4339
|
-
function
|
|
4387
|
+
function _s(e) {
|
|
4340
4388
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
4341
4389
|
}
|
|
4342
|
-
function
|
|
4390
|
+
function vs(e, t) {
|
|
4343
4391
|
if (!e?.field) return !1;
|
|
4344
4392
|
switch (e.operator ?? "eq") {
|
|
4345
4393
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -4347,38 +4395,38 @@ function us(e, t) {
|
|
|
4347
4395
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
4348
4396
|
case "falsy": return t == null || t === "" || t === !1;
|
|
4349
4397
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
4350
|
-
case "in": return
|
|
4351
|
-
case "notIn": return !
|
|
4398
|
+
case "in": return _s(e.value).includes(String(t ?? ""));
|
|
4399
|
+
case "notIn": return !_s(e.value).includes(String(t ?? ""));
|
|
4352
4400
|
default: return !1;
|
|
4353
4401
|
}
|
|
4354
4402
|
}
|
|
4355
|
-
function
|
|
4403
|
+
function ys(e, t, n = !1) {
|
|
4356
4404
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
4357
|
-
return
|
|
4405
|
+
return vs(i, t) && i?.label ? i.label : r;
|
|
4358
4406
|
}
|
|
4359
|
-
function
|
|
4407
|
+
function bs(e) {
|
|
4360
4408
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
4361
4409
|
}
|
|
4362
|
-
function
|
|
4363
|
-
let n =
|
|
4410
|
+
function xs(e, t) {
|
|
4411
|
+
let n = bs(e);
|
|
4364
4412
|
if (!n.length) return !0;
|
|
4365
|
-
let r = n.map((e) =>
|
|
4413
|
+
let r = n.map((e) => vs(e, t(e.field)));
|
|
4366
4414
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
4367
4415
|
}
|
|
4368
|
-
function
|
|
4416
|
+
function Ss(e) {
|
|
4369
4417
|
let t = e?.colWhen;
|
|
4370
4418
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
4371
4419
|
}
|
|
4372
|
-
function
|
|
4373
|
-
for (let t of
|
|
4420
|
+
function Cs(e, t, n) {
|
|
4421
|
+
for (let t of Ss(e)) if (vs(t, n(t))) return Number(t.col);
|
|
4374
4422
|
return t;
|
|
4375
4423
|
}
|
|
4376
|
-
function
|
|
4424
|
+
function ws(e, t) {
|
|
4377
4425
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
4378
4426
|
}
|
|
4379
4427
|
//#endregion
|
|
4380
4428
|
//#region src/components/Breadcrumb.jsx
|
|
4381
|
-
function
|
|
4429
|
+
function Ts({ items: e = [] }) {
|
|
4382
4430
|
return /* @__PURE__ */ C(_, { items: e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Be, {
|
|
4383
4431
|
variant: "body",
|
|
4384
4432
|
weight: "medium",
|
|
@@ -4394,6 +4442,6 @@ function _s({ items: e = [] }) {
|
|
|
4394
4442
|
}) })) });
|
|
4395
4443
|
}
|
|
4396
4444
|
//#endregion
|
|
4397
|
-
export {
|
|
4445
|
+
export { oa as $, xr as $n, Ut as $t, wo as A, L as An, Ar as At, qa as B, Qt as Bn, Vn as Bt, qo as C, Mt as Cn, Ur as Ct, Do as D, Wt as Dn, Dr as Dt, ko as E, vn as En, Or as Et, co as F, Bn as Fn, Gt as Ft, Na as G, Pt as Gn, mn as Gt, Ua as H, pn as Hn, qt as Ht, _o as I, Nt as In, ur as It, la as J, hn as Jn, Sr as Jt, Da as K, Nn as Kn, ar as Kt, Ja as L, Jt as Ln, rr as Lt, po as M, or as Mn, wr as Mt, fo as N, mr as Nn, Yt as Nt, To as O, jt as On, Pr as Ot, no as P, Dn as Pn, _n as Pt, aa as Q, er as Qn, zn as Qt, Za as R, an as Rn, $n as Rt, Jo as S, yr as Sn, Br as St, Wo as T, Kn as Tn, Nr as Tt, Wa as U, It as Un, on as Ut, Ga as V, tn as Vn, hr as Vt, Pa as W, qn as Wn, fr as Wt, xa as X, dr as Xn, Ft as Xt, da as Y, Kt as Yn, Un as Yt, wa as Z, ir as Zn, _r as Zt, ts as _, gn as _n, Be as _r, Gr as _t, ys as a, Zn as an, Pn as ar, Oi as at, Zo as b, nr as bn, Hr as bt, bs as c, cn, Tt as cr, Wi as ct, ms as d, lr as dn, vt as dr, Li as dt, Ht as en, Hn as er, sa as et, us as f, Zt as fn, yt as fr, di as ft, ss as g, dn as gn, He as gr, Ir as gt, ls as h, fn as hn, ct as hr, qr as ht, vs as i, Fn as in, wn as ir, Xi as it, vo as j, En as jn, Tr as jt, So as k, Mn as kn, kr as kt, gs as l, un as ln, wt as lr, na as lt, cs as m, Ln as mn, lt as mr, Yr as mt, Ss as n, bn as nn, sr as nr, Zi as nt, xs as o, Yn as on, Rn as or, H as ot, ds as p, en as pn, ut as pr, Jr as pt, ua as q, In as qn, tr as qt, ws as r, Cn as rn, gr as rr, ra as rt, Cs as s, Lt as sn, Jn as sr, q as st, Ts as t, rn as tn, kn as tr, J as tt, hs as u, Xn as un, _t as ur, Ri as ut, is as v, Wn as vn, D as vr, Wr as vt, Ko as w, Rt as wn, Fr as wt, $o as x, Qn as xn, Kr as xt, Xo as y, Gn as yn, E as yr, Rr as yt, Xa as z, ln as zn, br as zt };
|
|
4398
4446
|
|
|
4399
|
-
//# sourceMappingURL=Breadcrumb-
|
|
4447
|
+
//# sourceMappingURL=Breadcrumb-BgXaVW_N.js.map
|