@realtek/core-theme 0.0.214 → 0.0.216

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "./authApi-CVxnHdIU.js";
2
- import { $ as E, $t as D, A as O, An as k, At as A, B as j, Bn as M, Bt as ee, C as N, Cn as te, Ct as ne, D as re, Dn as ie, Dt as ae, E as oe, En as se, Et as P, F as ce, Fn as le, Ft as ue, G as de, Gn as fe, Gt as pe, H as me, Hn as he, Ht as ge, I as _e, In as ve, It as ye, J as be, Jn as xe, Jt as Se, K as Ce, Kn as we, Kt as Te, L as Ee, Ln as De, Lt as Oe, M as ke, Mn as Ae, Mt as je, N as Me, Nn as Ne, Nt as Pe, O as Fe, On as Ie, Ot as Le, P as Re, Pn as ze, Pt as Be, Q as Ve, Qn as He, Qt as Ue, R as We, Rn as Ge, Rt as Ke, S as qe, Sn as Je, St as Ye, T as Xe, Tn as Ze, Tt as Qe, U as $e, Un as et, Ut as tt, V as nt, Vn as rt, Vt as it, W as at, Wn as ot, Wt as st, X as ct, Xn as F, Xt as lt, Y as ut, Yn as dt, Yt as ft, Z as pt, Zn as mt, Zt as ht, _ as gt, _n as _t, _t as vt, a as yt, an as bt, at as xt, b as St, bn as Ct, bt as wt, c as Tt, cn as Et, ct as Dt, d as Ot, dn as kt, dt as At, en as jt, et as Mt, f as Nt, fn as Pt, ft as Ft, g as It, gn as Lt, gt as Rt, h as zt, hn as Bt, ht as Vt, i as Ht, in as Ut, it as Wt, j as Gt, jn as Kt, jt as qt, k as Jt, kn as Yt, kt as Xt, l as Zt, ln as Qt, lt as $t, m as en, mn as tn, mt as nn, n as rn, nn as an, nt as on, o as sn, on as cn, ot as ln, p as un, pn as dn, pt as fn, q as pn, qn as mn, qt as hn, r as gn, rn as _n, rt as vn, s as yn, sn as bn, st as xn, t as Sn, tn as Cn, tt as wn, u as Tn, un as En, ut as Dn, v as On, vn as kn, vt as An, w as jn, wn as Mn, wt as Nn, x as Pn, xn as Fn, xt as In, y as Ln, yn as Rn, yt as zn, z as Bn, zn as Vn, zt as Hn } from "./Breadcrumb-DD4Cy0gv.js";
2
+ import { $ as E, $t as D, A as O, An as k, At as A, B as j, Bn as M, Bt as ee, C as N, Cn as te, Ct as ne, D as re, Dn as ie, Dt as ae, E as oe, En as se, Et as P, F as ce, Fn as le, Ft as ue, G as de, Gn as fe, Gt as pe, H as me, Hn as he, Ht as ge, I as _e, In as ve, It as ye, J as be, Jn as xe, Jt as Se, K as Ce, Kn as we, Kt as Te, L as Ee, Ln as De, Lt as Oe, M as ke, Mn as Ae, Mt as je, N as Me, Nn as Ne, Nt as Pe, O as Fe, On as Ie, Ot as Le, P as Re, Pn as ze, Pt as Be, Q as Ve, Qn as He, Qt as Ue, R as We, Rn as Ge, Rt as Ke, S as qe, Sn as Je, St as Ye, T as Xe, Tn as Ze, Tt as Qe, U as $e, Un as et, Ut as tt, V as nt, Vn as rt, Vt as it, W as at, Wn as ot, Wt as st, X as ct, Xn as F, Xt as lt, Y as ut, Yn as dt, Yt as ft, Z as pt, Zn as mt, Zt as ht, _ as gt, _n as _t, _t as vt, a as yt, an as bt, at as xt, b as St, bn as Ct, bt as wt, c as Tt, cn as Et, ct as Dt, d as Ot, dn as kt, dt as At, en as jt, et as Mt, f as Nt, fn as Pt, ft as Ft, g as It, gn as Lt, gt as Rt, h as zt, hn as Bt, ht as Vt, i as Ht, in as Ut, it as Wt, j as Gt, jn as Kt, jt as qt, k as Jt, kn as Yt, kt as Xt, l as Zt, ln as Qt, lt as $t, m as en, mn as tn, mt as nn, n as rn, nn as an, nt as on, o as sn, on as cn, ot as ln, p as un, pn as dn, pt as fn, q as pn, qn as mn, qt as hn, r as gn, rn as _n, rt as vn, s as yn, sn as bn, st as xn, t as Sn, tn as Cn, tt as wn, u as Tn, un as En, ut as Dn, v as On, vn as kn, vt as An, w as jn, wn as Mn, wt as Nn, x as Pn, xn as Fn, xt as In, y as Ln, yn as Rn, yt as zn, z as Bn, zn as Vn, zt as Hn } from "./Breadcrumb-C8GAMPzl.js";
3
3
  import { i as Un } from "./diceCandidateMapper-BKRGwz7g.js";
4
4
  import Wn, { Fragment as Gn, createContext as Kn, useCallback as qn, useContext as Jn, useEffect as I, useMemo as L, useRef as Yn, useState as R } from "react";
5
5
  import { Alert as Xn, AutoComplete as Zn, Avatar as Qn, Badge as $n, Breadcrumb as er, Button as z, Card as tr, Checkbox as nr, Col as B, Collapse as rr, DatePicker as ir, Divider as ar, Drawer as or, Dropdown as sr, Empty as cr, Flex as lr, Form as V, Input as H, InputNumber as ur, Layout as dr, Mentions as fr, Menu as pr, Modal as mr, Pagination as hr, Popconfirm as gr, Popover as _r, Progress as vr, Radio as yr, Result as br, Row as xr, Select as U, Space as W, Spin as Sr, Statistic as Cr, Steps as wr, Switch as G, Table as Tr, Tabs as Er, Tag as K, TimePicker as Dr, Tooltip as q, Tree as Or, Typography as kr, Upload as Ar, message as J } from "antd";
@@ -6063,7 +6063,7 @@ function ip(e, t) {
6063
6063
  }
6064
6064
  }
6065
6065
  function ap(e) {
6066
- if (Array.isArray(e)) return e;
6066
+ if (Array.isArray(e)) return e.flatMap((e) => ap(e));
6067
6067
  if (!e || typeof e != "object") return [];
6068
6068
  let t = e.uploadedFileName ?? e.name ?? Object.entries(e).find(([e]) => e.endsWith("UploadName"))?.[1] ?? "", n = e.location ?? e.url ?? Object.entries(e).find(([e]) => e.endsWith("CopyLocation"))?.[1] ?? "";
6069
6069
  return !t && !n ? [] : [{
@@ -6071,7 +6071,8 @@ function ap(e) {
6071
6071
  name: t || "file",
6072
6072
  status: "done",
6073
6073
  url: n,
6074
- existing: !0
6074
+ existing: !0,
6075
+ stored: e
6075
6076
  }];
6076
6077
  }
6077
6078
  var op = (e) => e == null || e === "", sp = (e) => String(e).replace(/<[^>]*>/g, "").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").trim(), cp = ({ label: e, message: t, value: n, compare: r, text: i }) => ({ validator: (a, o) => op(o) || r(Number(o), Number(n)) ? Promise.resolve() : Promise.reject(Error(t ?? `${e} ${i} ${n}`)) });
@@ -9468,15 +9469,20 @@ function ah({ field: e }) {
9468
9469
  className: "v1-detail-value",
9469
9470
  style: d,
9470
9471
  children: h(e)
9471
- }), _ = (e) => /* @__PURE__ */ X("span", {
9472
+ }), _ = (e) => /* @__PURE__ */ X(Um, {
9473
+ strong: !0,
9474
+ className: "v1-detail-value v1-detail-token",
9475
+ style: d,
9476
+ children: h(e)
9477
+ }), v = (e) => /* @__PURE__ */ X("span", {
9472
9478
  className: "v1-detail-value v1-detail-tags",
9473
9479
  children: /* @__PURE__ */ X(K, {
9474
9480
  color: f,
9475
9481
  children: h(e)
9476
9482
  })
9477
- }), v = th(e);
9478
- if (v !== "document" && Wm(t) && !s.showEmpty) return g(l);
9479
- switch (v) {
9483
+ }), y = th(e);
9484
+ if (y !== "document" && Wm(t) && !s.showEmpty) return g(l);
9485
+ switch (y) {
9480
9486
  case "document": return /* @__PURE__ */ X(rh, {
9481
9487
  value: t,
9482
9488
  mode: s.documentMode || "preview",
@@ -9485,7 +9491,7 @@ function ah({ field: e }) {
9485
9491
  });
9486
9492
  case "text": return g(m(Qm(t, o, u)));
9487
9493
  case "tag":
9488
- case "chip": return _(m(Qm(t, o, u)));
9494
+ case "chip": return v(m(Qm(t, o, u)));
9489
9495
  case "badge": {
9490
9496
  let e = h(Qm(t, o, u));
9491
9497
  return /* @__PURE__ */ X("span", {
@@ -9533,7 +9539,7 @@ function ah({ field: e }) {
9533
9539
  case "phone": {
9534
9540
  let e = Qm(t, !1, u), n = nh(e);
9535
9541
  return /* @__PURE__ */ Z("a", {
9536
- className: "v1-detail-value",
9542
+ className: "v1-detail-value v1-detail-token",
9537
9543
  href: `tel:${e.replace(/[^0-9+]/g, "")}`,
9538
9544
  children: [
9539
9545
  /* @__PURE__ */ X(Ki, {}),
@@ -9544,12 +9550,12 @@ function ah({ field: e }) {
9544
9550
  }
9545
9551
  case "date": {
9546
9552
  let e = La(t), n = s.dateFormat || c.dateFormat;
9547
- return g(m(e.isValid() ? e.format(n) : Qm(t, o, u)));
9553
+ return _(m(e.isValid() ? e.format(n) : Qm(t, o, u)));
9548
9554
  }
9549
- case "currency": return g(m(ih(t, s)));
9555
+ case "currency": return _(m(ih(t, s)));
9550
9556
  case "budget": {
9551
9557
  let e = ih(t, s), n = s.unit ? String(s.unit) : "", r = n && s.budgetUnitMap ? s.budgetUnitMap[n] ?? n : n;
9552
- return g(`${e}${r ? `/${r}` : ""}`);
9558
+ return _(`${e}${r ? `/${r}` : ""}`);
9553
9559
  }
9554
9560
  case "html": return /* @__PURE__ */ X("span", {
9555
9561
  className: "v1-detail-value",
@@ -9559,8 +9565,8 @@ function ah({ field: e }) {
9559
9565
  default: break;
9560
9566
  }
9561
9567
  if (Wm(t)) return g(l);
9562
- let y = n === "date", b = typeof t == "string" && Gm.test(t.trim());
9563
- if (y || b) {
9568
+ let b = n === "date", x = typeof t == "string" && Gm.test(t.trim());
9569
+ if (b || x) {
9564
9570
  let e = La(t);
9565
9571
  if (e.isValid()) return g(m(e.format(c.dateFormat)));
9566
9572
  }
@@ -9738,25 +9744,66 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9738
9744
  if (t.isValid()) return t.format(e?.renderOptions?.dateFormat || Mt().dateFormat);
9739
9745
  }
9740
9746
  return (e?.formatter === "phone" || e?.type === "phone") && E(n) || n;
9741
- }, k = (e, t, n, r) => {
9742
- let i = e.map((e) => O(e, n(e).value)).filter((e) => e !== ""), a = typeof t.combineLabel == "string" && t.combineLabel.trim() ? t.combineLabel : t.label ?? t.field;
9743
- return /* @__PURE__ */ X(B, {
9744
- xs: 24,
9745
- sm: 12,
9746
- lg: t.detailCol ?? t.col ?? 8,
9747
+ }, k = (e, t) => {
9748
+ let n = String(e?.label ?? "").trim();
9749
+ if (!n) return "";
9750
+ let r = String(t ?? "").toLowerCase().split(/[\s/]+/).filter(Boolean), i = n.split(/\s+/), a = 0;
9751
+ for (; a < i.length;) {
9752
+ let e = i[a].toLowerCase();
9753
+ if (!r.some((t) => t === e || t.startsWith(e) || e.startsWith(t))) break;
9754
+ a += 1;
9755
+ }
9756
+ return i.slice(a).join(" ").trim();
9757
+ }, A = (e, t, n, r) => {
9758
+ let i = e.map((e) => ({
9759
+ field: e,
9760
+ cell: n(e)
9761
+ })), a = i.filter(({ cell: e }) => ee(e)).map(({ cell: e }) => ({
9762
+ ...e,
9763
+ renderType: "document"
9764
+ })).filter((e) => Me(e.value).length > 0), o = typeof t.combineLabel == "string" && t.combineLabel.trim() ? t.combineLabel : t.label ?? t.field, s = i.filter(({ cell: e }) => !ee(e)).map(({ field: e, cell: t }) => ({
9765
+ key: e.field,
9766
+ label: k(e, o),
9767
+ text: O(e, t.value)
9768
+ })).filter((e) => e.text !== ""), c = s.map((e) => `${e.label ? `${e.label} ` : ""}${e.text}`).join(" · "), l = C({
9769
+ detailCol: t.detailCol,
9770
+ value: c
9771
+ });
9772
+ return /* @__PURE__ */ X("div", {
9773
+ className: "v1-detail-cell v1-detail-cell--wrap",
9774
+ style: { "--v1-cell-span": a.length ? Math.max(l, 2) : l },
9747
9775
  children: /* @__PURE__ */ Z("div", {
9748
9776
  className: "v1-detail-field",
9749
- children: [/* @__PURE__ */ X(oh, {
9750
- type: "secondary",
9751
- className: "v1-detail-label",
9752
- children: a
9753
- }), /* @__PURE__ */ X("div", {
9754
- className: "v1-detail-value",
9755
- children: i.length ? i.join(" · ") : "—"
9756
- })]
9777
+ children: [
9778
+ /* @__PURE__ */ X(oh, {
9779
+ type: "secondary",
9780
+ className: "v1-detail-label",
9781
+ title: o,
9782
+ children: o
9783
+ }),
9784
+ (s.length > 0 || a.length === 0) && /* @__PURE__ */ X("div", {
9785
+ className: "v1-detail-value v1-detail-parts",
9786
+ children: s.length ? s.map((e, t) => /* @__PURE__ */ Z("span", {
9787
+ className: "v1-detail-part",
9788
+ children: [
9789
+ t > 0 && /* @__PURE__ */ X("span", {
9790
+ className: "v1-detail-part-sep",
9791
+ "aria-hidden": "true",
9792
+ children: "·"
9793
+ }),
9794
+ e.label && /* @__PURE__ */ X("span", {
9795
+ className: "v1-detail-part-label",
9796
+ children: e.label
9797
+ }),
9798
+ /* @__PURE__ */ X("span", { children: e.text })
9799
+ ]
9800
+ }, `${e.key}-part`)) : "—"
9801
+ }),
9802
+ a.map((e) => /* @__PURE__ */ X(ah, { field: e }, `${e.field}-doc`))
9803
+ ]
9757
9804
  })
9758
9805
  }, `${t.field}-merged${r}`);
9759
- }, A = (e, t, n = "") => {
9806
+ }, j = (e, t, n = "") => {
9760
9807
  let r = /* @__PURE__ */ new Set(), i = [];
9761
9808
  return e.forEach((a) => {
9762
9809
  let o = a.combineKey?.trim?.();
@@ -9766,13 +9813,13 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9766
9813
  let a = e.filter((e) => e.combineKey?.trim?.() === o);
9767
9814
  if (a.length > 1) {
9768
9815
  let e = a.find((e) => e.combineLabel) ?? a[0];
9769
- i.push(k(a, e, t, n));
9816
+ i.push(A(a, e, t, n));
9770
9817
  return;
9771
9818
  }
9772
9819
  }
9773
9820
  i.push(T(t(a), n));
9774
9821
  }), i;
9775
- }, j = L(() => {
9822
+ }, M = L(() => {
9776
9823
  let e = {};
9777
9824
  for (let t of g) {
9778
9825
  let n = t.fieldName || t.field || "file";
@@ -9783,7 +9830,25 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9783
9830
  });
9784
9831
  }
9785
9832
  return e;
9786
- }, [g]), M = (e) => e.type === "file" || e.type === "document" || e.renderType === "document", ee = (e) => j[e.field] || e.fileKey && j[e.fileKey] || null, N = (e, t) => {
9833
+ }, [g]), ee = (e) => e.type === "file" || e.type === "document" || e.renderType === "document", N = (e) => M[e.field] || e.fileKey && M[e.fileKey] || null, te = (e) => String(e?.name || e?.location || "").trim().toLowerCase(), ne = (e) => {
9834
+ let [t] = Me(e);
9835
+ return !t || !t.location && !t.url ? null : te(t);
9836
+ }, re = (e, t = []) => {
9837
+ let n = /* @__PURE__ */ new Set(), r = [], i = (e) => {
9838
+ if (e == null || e === "") return;
9839
+ let t = ne(e);
9840
+ t !== null && (t && n.has(t) || (t && n.add(t), r.push(e)));
9841
+ };
9842
+ return t.forEach(i), (Array.isArray(e) ? e : [e]).forEach(i), r;
9843
+ }, ie = (e) => Me(e).map(te).filter(Boolean), ae = (e) => {
9844
+ let t = (e.validations ?? []).find((e) => e?.type === "maxFiles");
9845
+ return t ? Math.max(1, Number(t.value ?? 1)) : ch(e.multiple) ? Math.max(1, Number(e.maxCount ?? 5)) : Math.max(1, Number(e.maxCount ?? 1));
9846
+ }, oe = (e, t, n) => {
9847
+ let r = ae(e);
9848
+ if (t.length <= r) return t;
9849
+ let [i] = ie(n);
9850
+ return (i ? [...t].sort((e, t) => Number(ne(t) === i) - Number(ne(e) === i)) : t).slice(0, r);
9851
+ }, se = (e, t) => {
9787
9852
  if (e.type === "file" || e.type === "document") return {
9788
9853
  ...e,
9789
9854
  renderType: "document",
@@ -9794,24 +9859,29 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9794
9859
  ...e,
9795
9860
  value: n
9796
9861
  };
9797
- }, te = (e) => {
9798
- if (!M(e)) return e;
9799
- let t = ee(e);
9800
- return t && t.length ? {
9862
+ }, P = (e) => {
9863
+ if (!ee(e)) return e;
9864
+ let t = oe(e, re(e.value, N(e) ?? []), e.value);
9865
+ return t.length ? {
9801
9866
  ...e,
9802
9867
  renderType: "document",
9803
9868
  value: t
9804
9869
  } : e;
9805
- }, ne = (e, t, n) => {
9806
- let r = e.name ?? e.id ?? String(t), i = Array.isArray(e.rows) ? e.rows : [];
9807
- return /* @__PURE__ */ X(tr, {
9870
+ }, ce = (e, t, n) => {
9871
+ let r = e.name ?? e.id ?? String(t), i = Array.isArray(e.rows) ? e.rows : [], a = new Set(i.flatMap((e) => ie(e))), o = [], s = /* @__PURE__ */ new Set();
9872
+ return n.filter(ee).forEach((e) => {
9873
+ (N(e) ?? []).forEach((e) => {
9874
+ let t = te(e);
9875
+ !t || a.has(t) || s.has(t) || (s.add(t), o.push(e));
9876
+ });
9877
+ }), /* @__PURE__ */ Z(tr, {
9808
9878
  size: "small",
9809
9879
  className: "v1-card v1-detail-card",
9810
9880
  title: /* @__PURE__ */ X(fh, {
9811
9881
  icon: sh[t % sh.length],
9812
9882
  title: e.label ?? e.name ?? "Details"
9813
9883
  }),
9814
- children: i.length === 0 ? /* @__PURE__ */ X(cr, {
9884
+ children: [i.length === 0 && o.length === 0 ? /* @__PURE__ */ X(cr, {
9815
9885
  image: cr.PRESENTED_IMAGE_SIMPLE,
9816
9886
  description: `No ${e.label ?? "records"} added`
9817
9887
  }) : i.map((t, r) => /* @__PURE__ */ Z("div", {
@@ -9826,9 +9896,21 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9826
9896
  ]
9827
9897
  }), /* @__PURE__ */ X("div", {
9828
9898
  className: "v1-detail-grid",
9829
- children: A(n, (e) => N(e, t), `-${r}`)
9899
+ children: j(n, (e) => se(e, t), `-${r}`)
9830
9900
  })]
9831
- }, r))
9901
+ }, r)), o.length > 0 && /* @__PURE__ */ X("div", {
9902
+ className: "v1-detail-addrow-item",
9903
+ children: /* @__PURE__ */ X("div", {
9904
+ className: "v1-detail-grid",
9905
+ children: T({
9906
+ field: `${r}-files`,
9907
+ label: "Uploaded Files",
9908
+ renderType: "document",
9909
+ detailCol: 24,
9910
+ value: o
9911
+ })
9912
+ })
9913
+ })]
9832
9914
  }, r);
9833
9915
  };
9834
9916
  return /* @__PURE__ */ X(Sr, {
@@ -9847,7 +9929,7 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9847
9929
  !o && !c && v.length === 0 && /* @__PURE__ */ X(cr, { description: "No detail fields are configured." }),
9848
9930
  v.map((e, t) => {
9849
9931
  let n = e.name ?? e.id ?? String(t), r = b ? e.fields.filter((e) => e.field !== b.key) : e.fields;
9850
- return r.length ? e.addRow ? ne(e, t, r) : /* @__PURE__ */ X(tr, {
9932
+ return r.length ? e.addRow ? ce(e, t, r) : /* @__PURE__ */ X(tr, {
9851
9933
  size: "small",
9852
9934
  className: "v1-card v1-detail-card",
9853
9935
  title: /* @__PURE__ */ X(fh, {
@@ -9856,7 +9938,7 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9856
9938
  }),
9857
9939
  children: /* @__PURE__ */ X("div", {
9858
9940
  className: "v1-detail-grid",
9859
- children: A(r, te)
9941
+ children: j(r, P)
9860
9942
  })
9861
9943
  }, n) : null;
9862
9944
  }),
@@ -11504,8 +11586,19 @@ function f_({ moduleName: e, id: t, customConfigName: n, authToken: r, onAction:
11504
11586
  let be = (n) => {
11505
11587
  let r = [...ve, ...ye].find((e) => e.key === n);
11506
11588
  if (r?.actionType === "document" && r.documentField) {
11507
- let e = d_(g, r.documentField);
11508
- e.length ? (T(e), C(!0)) : J.warning(`No ${(r.label || "document").toLowerCase()} available`);
11589
+ let n = d_(g, r.documentField);
11590
+ if (n.length) {
11591
+ T(n), C(!0);
11592
+ return;
11593
+ }
11594
+ At(r.documentModule || e, r.documentIdField ? o_(oe, r.documentIdField) : t, r.documentField).then((e) => {
11595
+ let t = (e?.data ?? []).map((e) => ({
11596
+ name: e.fileName || e.name || e.uploadedFileName || r.documentField,
11597
+ url: e.fileUrl || e.url || "",
11598
+ type: "file"
11599
+ })).filter((e) => e.url);
11600
+ t.length ? (T(t), C(!0)) : J.warning(`No ${(r.label || "document").toLowerCase()} available`);
11601
+ }).catch(() => J.warning(`No ${(r.label || "document").toLowerCase()} available`));
11509
11602
  return;
11510
11603
  }
11511
11604
  if (r?.actionType === "copy") {
@@ -16750,7 +16843,17 @@ function cb({ type: e, record: t, lookups: n, identity: r, referralOptions: i, o
16750
16843
  children: nb(r?.employerLocation, t?.submission?.city, t?.job?.jobLocation)
16751
16844
  })
16752
16845
  }),
16753
- /* @__PURE__ */ X(ob, {
16846
+ !P.isW2 && !P.employerVmsRequired ? /* @__PURE__ */ X(ob, {
16847
+ label: /* @__PURE__ */ X("span", {
16848
+ className: "fa-locked-label",
16849
+ children: "Employer VMS"
16850
+ }),
16851
+ sub: "VMS not required",
16852
+ value: /* @__PURE__ */ X("span", {
16853
+ className: "fa-vms-none",
16854
+ children: "Not required"
16855
+ })
16856
+ }) : /* @__PURE__ */ X(ob, {
16754
16857
  label: P.isW2 ? P.employerDeductionLabel : /* @__PURE__ */ Z("span", {
16755
16858
  className: "fa-locked-label",
16756
16859
  children: [P.employerDeductionLabel, /* @__PURE__ */ X("span", {
@@ -27011,7 +27114,7 @@ function HC() {
27011
27114
  }));
27012
27115
  t(n);
27013
27116
  let r = DC(n);
27014
- a(OC(r)), D("all", r);
27117
+ a(OC(r)), A("all", r);
27015
27118
  }).catch(() => t([])).finally(() => r(!1));
27016
27119
  }, []), I(() => {
27017
27120
  Pe({ limit: 200 }).then(_).catch(() => _([]));
@@ -27025,45 +27128,49 @@ function HC() {
27025
27128
  }
27026
27129
  }));
27027
27130
  }
27028
- function D(e, t) {
27029
- (t ?? w).find((t) => t.key === e) && (E(e, {
27131
+ let D = (e) => e !== "all" && !!(v.clientId || v.region), O = (e) => D(e) ? v : {}, k = (e) => D(e) ? `${v.clientId}|${v.region}` : "";
27132
+ function A(e, t) {
27133
+ if (!(t ?? w).find((t) => t.key === e)) return;
27134
+ let n = k(e);
27135
+ E(e, {
27030
27136
  loading: !0,
27031
27137
  error: ""
27032
- }), Be(e === "all" ? "" : e, e === "jobs" ? v : {}).then((t) => E(e, {
27138
+ }), Be(e === "all" ? "" : e, O(e)).then((t) => E(e, {
27033
27139
  groups: t,
27034
27140
  loading: !1,
27035
- loaded: !0
27141
+ loaded: !0,
27142
+ scopeKey: n
27036
27143
  })).catch((t) => E(e, {
27037
27144
  error: t.message || "Could not load groups",
27038
27145
  loading: !1
27039
- })));
27146
+ }));
27040
27147
  }
27041
- function O(e) {
27042
- D(e, null);
27148
+ function j(e) {
27149
+ A(e, null);
27043
27150
  }
27044
- function k(e) {
27045
- s(e), i[e]?.loaded || O(e);
27151
+ function M(e) {
27152
+ s(e), (!i[e]?.loaded || i[e]?.scopeKey !== k(e)) && j(e);
27046
27153
  }
27047
- function A() {
27154
+ function ee() {
27048
27155
  d(null), l(!0);
27049
27156
  }
27050
- function j(e) {
27157
+ function N(e) {
27051
27158
  d(e), l(!0);
27052
27159
  }
27053
- function M() {
27160
+ function te() {
27054
27161
  l(!1), d(null);
27055
27162
  }
27056
- async function ee() {
27057
- M(), O(o), o !== "all" && O("all");
27163
+ async function ne() {
27164
+ te(), j(o), o !== "all" && j("all");
27058
27165
  }
27059
- async function N(e) {
27166
+ async function re(e) {
27060
27167
  try {
27061
- await Ye(e), J.success("Group deleted"), O(o), o !== "all" && O("all");
27168
+ await Ye(e, se()), J.success("Group deleted"), j(o), o !== "all" && j("all");
27062
27169
  } catch (e) {
27063
27170
  J.error(e.message || "Could not delete group");
27064
27171
  }
27065
27172
  }
27066
- async function te(e) {
27173
+ async function ie(e) {
27067
27174
  let t = e.map((e, t) => ({
27068
27175
  g: e,
27069
27176
  index: t
@@ -27072,37 +27179,48 @@ function HC() {
27072
27179
  await Promise.all(t.map(({ g: e, index: t }) => Ie(e.id, {
27073
27180
  ...e,
27074
27181
  order: t
27075
- }, ie(e.module || o)))), J.success("Group order updated"), O(o), o !== "all" && O("all");
27182
+ }, se(e.module || o)))), J.success("Group order updated"), j(o), o !== "all" && j("all");
27076
27183
  } catch (e) {
27077
- J.error(e.message || "Could not reorder groups"), O(o);
27184
+ J.error(e.message || "Could not reorder groups"), j(o);
27078
27185
  }
27079
27186
  }
27080
- function ne(e) {
27187
+ function ae(e) {
27081
27188
  p(hC[e]);
27082
27189
  }
27083
- function re(e) {
27190
+ function oe(e) {
27084
27191
  let t = {
27085
27192
  ...v,
27086
27193
  ...e
27087
27194
  };
27088
- y(t), o === "jobs" && (E("jobs", {
27195
+ if (y(t), a((e) => {
27196
+ let t = {};
27197
+ for (let [n, r] of Object.entries(e)) t[n] = n === o ? r : {
27198
+ ...r,
27199
+ loaded: !1
27200
+ };
27201
+ return t;
27202
+ }), o === "all") return;
27203
+ let n = t.clientId || t.region ? t : {};
27204
+ E(o, {
27089
27205
  loading: !0,
27090
27206
  error: ""
27091
- }), Be("jobs", t).then((e) => E("jobs", {
27207
+ }), Be(o, n).then((e) => E(o, {
27092
27208
  groups: e,
27093
- loading: !1
27094
- })).catch((e) => E("jobs", {
27209
+ loading: !1,
27210
+ loaded: !0,
27211
+ scopeKey: t.clientId || t.region ? `${t.clientId}|${t.region}` : ""
27212
+ })).catch((e) => E(o, {
27095
27213
  error: e.message || "Could not load scoped groups",
27096
27214
  loading: !1
27097
- })));
27215
+ }));
27098
27216
  }
27099
- function ie(e = o) {
27100
- return e === "jobs" ? v : {};
27217
+ function se() {
27218
+ return O(o);
27101
27219
  }
27102
- function ae(e) {
27220
+ function P(e) {
27103
27221
  C(JSON.parse(JSON.stringify(e))), J.success(`Copied settings from ${e.label || e.name}`);
27104
27222
  }
27105
- async function oe(e) {
27223
+ async function ce(e) {
27106
27224
  if (S) try {
27107
27225
  let t = {
27108
27226
  ...e,
@@ -27110,15 +27228,15 @@ function HC() {
27110
27228
  payloadKey: S.payloadKey ?? e.payloadKey,
27111
27229
  fields: JSON.parse(JSON.stringify(S.fields ?? []))
27112
27230
  };
27113
- await Ie(e.id, t, ie(e.module || o)), J.success(`Pasted settings into ${e.label || e.name}`), O(o), o !== "all" && O("all");
27231
+ await Ie(e.id, t, se(e.module || o)), J.success(`Pasted settings into ${e.label || e.name}`), j(o), o !== "all" && j("all");
27114
27232
  } catch (e) {
27115
27233
  J.error(e.message || "Could not paste settings");
27116
27234
  }
27117
27235
  }
27118
- function se() {
27119
- p(null), a(OC(w)), O(o), o !== "all" && O("all");
27236
+ function le() {
27237
+ p(null), a(OC(w)), j(o), o !== "all" && j("all");
27120
27238
  }
27121
- let P = w.map(({ key: e, label: t, color: n }) => {
27239
+ let ue = w.map(({ key: e, label: t, color: n }) => {
27122
27240
  let r = i[e] ?? {
27123
27241
  groups: [],
27124
27242
  loading: !1,
@@ -27160,7 +27278,7 @@ function HC() {
27160
27278
  icon: /* @__PURE__ */ X(Ji, {}),
27161
27279
  disabled: e === "all",
27162
27280
  onClick: () => {
27163
- s(e), A();
27281
+ s(e), ee();
27164
27282
  },
27165
27283
  children: "Add Group"
27166
27284
  })
@@ -27169,29 +27287,39 @@ function HC() {
27169
27287
  spinning: r.loading,
27170
27288
  children: /* @__PURE__ */ X(zC, {
27171
27289
  groups: a,
27172
- onEdit: j,
27173
- onDelete: N,
27174
- onCopy: ae,
27175
- onPaste: oe,
27290
+ onEdit: N,
27291
+ onDelete: re,
27292
+ onCopy: P,
27293
+ onPaste: ce,
27176
27294
  canPaste: !!S,
27177
- onReorder: e === "all" ? void 0 : te
27295
+ onReorder: e === "all" ? void 0 : ie
27178
27296
  })
27179
27297
  })
27180
27298
  ]
27181
27299
  })
27182
27300
  };
27183
- }), ce = [
27301
+ }), de = o === "all" ? T[0]?.value ?? "jobs" : o, fe = w.find((e) => e.key === de)?.label ?? de, pe = [
27184
27302
  {
27185
27303
  key: "module",
27186
27304
  label: "Module Form",
27187
27305
  children: /* @__PURE__ */ Z(Y, { children: [
27188
27306
  /* @__PURE__ */ X(MS, { children: /* @__PURE__ */ Z("div", {
27189
27307
  className: "fg-scope-toolbar",
27190
- children: [/* @__PURE__ */ X("div", { children: /* @__PURE__ */ X("div", { children: /* @__PURE__ */ X(mC, {
27308
+ children: [/* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X("div", { children: /* @__PURE__ */ Z(mC, {
27191
27309
  type: "secondary",
27192
27310
  style: { fontSize: 12 },
27193
- children: "Select a client to edit a client-scoped field list for this module (Jobs, Submissions, …). Leave blank for the default module config. A Submission rendered against a job automatically uses that job's client here, falling back to the default when the client has no scoped config."
27194
- }) }) }), /* @__PURE__ */ Z(W, {
27311
+ children: [
27312
+ "Select a client to edit that client's field list for the module tab you are on — any module, not just Jobs. Leave blank for the default module config. Until the client has a config of its own you are shown the default; the first save copies it into a client-scoped config. A record rendered against a client — a Job, or a Submission through its job — uses that client's list here and falls back to the default when the client has none. The ",
27313
+ /* @__PURE__ */ X("b", { children: "All" }),
27314
+ " tab always shows the defaults."
27315
+ ]
27316
+ }) }), D(o) && /* @__PURE__ */ X("div", {
27317
+ style: { marginTop: 6 },
27318
+ children: /* @__PURE__ */ X(K, {
27319
+ color: "processing",
27320
+ children: `Editing ${g.find((e) => (e._id ?? e.id) === v.clientId)?.clientName ?? "client"} config for ${o}`
27321
+ })
27322
+ })] }), /* @__PURE__ */ Z(W, {
27195
27323
  wrap: !0,
27196
27324
  size: 8,
27197
27325
  children: [
@@ -27207,18 +27335,18 @@ function HC() {
27207
27335
  value: e._id ?? e.id,
27208
27336
  label: e.clientName ?? e.name ?? e.clientRefrenceId ?? e._id
27209
27337
  })).filter((e) => e.value),
27210
- onChange: (e) => re({ clientId: e ?? "" })
27338
+ onChange: (e) => oe({ clientId: e ?? "" })
27211
27339
  }),
27212
27340
  /* @__PURE__ */ X(z, {
27213
27341
  size: "small",
27214
27342
  icon: /* @__PURE__ */ X(Qi, {}),
27215
- onClick: () => O(o),
27343
+ onClick: () => j(o),
27216
27344
  children: "Reload"
27217
27345
  }),
27218
27346
  /* @__PURE__ */ X(z, {
27219
27347
  size: "small",
27220
27348
  icon: /* @__PURE__ */ X(gi, {}),
27221
- disabled: o !== "jobs",
27349
+ disabled: o === "all",
27222
27350
  onClick: () => x(!0),
27223
27351
  children: "Preview"
27224
27352
  })
@@ -27229,8 +27357,8 @@ function HC() {
27229
27357
  spinning: n,
27230
27358
  children: /* @__PURE__ */ X(Er, {
27231
27359
  activeKey: o,
27232
- onChange: k,
27233
- items: P,
27360
+ onChange: M,
27361
+ items: ue,
27234
27362
  size: "middle",
27235
27363
  className: "fg-tabs"
27236
27364
  })
@@ -27241,9 +27369,9 @@ function HC() {
27241
27369
  defaultModule: o === "all" ? T[0]?.value ?? "" : o,
27242
27370
  moduleOptions: T,
27243
27371
  allGroupsByModule: Object.fromEntries(Object.entries(i).filter(([e]) => e !== "all").map(([e, t]) => [e, t.groups ?? []])),
27244
- onClose: M,
27245
- onSaved: ee,
27246
- onSaveGroup: (e, t) => t ? Ie(t.id, e, ie(e.module)) : Vt(e, ie(e.module))
27372
+ onClose: te,
27373
+ onSaved: ne,
27374
+ onSaveGroup: (e, t) => t ? Ie(t.id, e, se(e.module)) : Vt(e, se(e.module))
27247
27375
  }),
27248
27376
  /* @__PURE__ */ X(or, {
27249
27377
  open: b,
@@ -27251,21 +27379,27 @@ function HC() {
27251
27379
  width: "92vw",
27252
27380
  title: /* @__PURE__ */ Z("span", {
27253
27381
  className: "fg-drawer-title",
27254
- children: [/* @__PURE__ */ X(gi, {}), " Jobs Add Form Preview"]
27382
+ children: [
27383
+ /* @__PURE__ */ X(gi, {}),
27384
+ " ",
27385
+ fe,
27386
+ " Add Form Preview"
27387
+ ]
27255
27388
  }),
27256
27389
  classNames: { body: "fg-preview-body" },
27390
+ destroyOnClose: !0,
27257
27391
  children: /* @__PURE__ */ X(Pp, {
27258
- moduleName: "jobs",
27392
+ moduleName: de,
27259
27393
  clientId: v.clientId,
27260
27394
  region: v.region,
27261
- cancelPath: "/jobs",
27395
+ cancelPath: `/${de}`,
27262
27396
  onSubmit: async () => J.info("Preview only. No record was created."),
27263
27397
  breadcrumbItems: [
27264
27398
  { label: "Admin" },
27265
27399
  { label: "Form Groups" },
27266
- { label: "Jobs Preview" }
27400
+ { label: `${fe} Preview` }
27267
27401
  ]
27268
- })
27402
+ }, `${de}-${v.clientId}-${v.region}`)
27269
27403
  })
27270
27404
  ] })
27271
27405
  },
@@ -27296,13 +27430,13 @@ function HC() {
27296
27430
  key: "save",
27297
27431
  label: "Save current as default",
27298
27432
  icon: /* @__PURE__ */ X(ia, {}),
27299
- onClick: () => ne("save")
27433
+ onClick: () => ae("save")
27300
27434
  },
27301
27435
  {
27302
27436
  key: "restore",
27303
27437
  label: "Restore saved default",
27304
27438
  icon: /* @__PURE__ */ X(ei, {}),
27305
- onClick: () => ne("restore")
27439
+ onClick: () => ae("restore")
27306
27440
  },
27307
27441
  { type: "divider" },
27308
27442
  {
@@ -27310,7 +27444,7 @@ function HC() {
27310
27444
  label: "Reset all form groups",
27311
27445
  icon: /* @__PURE__ */ X(Qi, {}),
27312
27446
  danger: !0,
27313
- onClick: () => ne("reset")
27447
+ onClick: () => ae("reset")
27314
27448
  }
27315
27449
  ] },
27316
27450
  children: /* @__PURE__ */ X(z, {
@@ -27322,7 +27456,7 @@ function HC() {
27322
27456
  type: "primary",
27323
27457
  size: "small",
27324
27458
  icon: /* @__PURE__ */ X(Pr, {}),
27325
- onClick: A,
27459
+ onClick: ee,
27326
27460
  children: "New Group"
27327
27461
  })]
27328
27462
  }) : null,
@@ -27343,7 +27477,7 @@ function HC() {
27343
27477
  children: /* @__PURE__ */ X(Er, {
27344
27478
  activeKey: m,
27345
27479
  onChange: h,
27346
- items: ce,
27480
+ items: pe,
27347
27481
  size: "middle",
27348
27482
  className: "fg-top-tabs",
27349
27483
  tabBarStyle: {
@@ -27362,7 +27496,7 @@ function HC() {
27362
27496
  confirmLabel: f?.confirmLabel,
27363
27497
  danger: f?.danger,
27364
27498
  onCancel: () => p(null),
27365
- onVerified: se
27499
+ onVerified: le
27366
27500
  })
27367
27501
  ]
27368
27502
  });