@realtek/core-theme 0.0.368 → 0.0.370

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.
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { O as t, b as n, u as r, y as i } from "./authApi-B0Y5f--u.js";
3
3
  import { useCallback as a, useEffect as o, useLayoutEffect as s, useMemo as c, useRef as l, useState as u } from "react";
4
- import { Alert as d, Button as f, Checkbox as p, Col as m, Collapse as h, DatePicker as g, Drawer as _, Dropdown as v, Empty as ee, Form as y, Input as te, InputNumber as ne, Modal as re, Popconfirm as b, Progress as x, Radio as S, Row as C, Segmented as w, Select as ie, Skeleton as T, Space as E, Statistic as D, Switch as ae, Table as O, Tabs as k, Tag as A, TimePicker as j, Tooltip as M, Typography as N, message as P } from "antd";
5
- import { ArrowDownOutlined as oe, ArrowUpOutlined as se, CheckCircleOutlined as ce, DeleteOutlined as le, DragOutlined as ue, EditOutlined as de, MoreOutlined as F, PlusOutlined as I, ReloadOutlined as fe, SearchOutlined as pe, SwapOutlined as L, TeamOutlined as me } from "@ant-design/icons";
4
+ import { Alert as d, Button as f, Checkbox as p, Col as m, Collapse as h, DatePicker as g, Drawer as _, Dropdown as v, Empty as ee, Form as y, Input as te, InputNumber as ne, Modal as re, Popconfirm as b, Progress as x, Radio as S, Row as C, Segmented as w, Select as T, Skeleton as ie, Space as E, Statistic as D, Switch as O, Table as k, Tabs as A, Tag as j, TimePicker as M, Tooltip as N, Typography as P, message as F } from "antd";
5
+ import { ArrowDownOutlined as ae, ArrowUpOutlined as oe, CheckCircleOutlined as se, DeleteOutlined as ce, DragOutlined as le, EditOutlined as ue, MoreOutlined as I, PlusOutlined as de, ReloadOutlined as fe, SearchOutlined as pe, SwapOutlined as L, TeamOutlined as me } from "@ant-design/icons";
6
6
  import { Fragment as he, jsx as R, jsxs as z } from "react/jsx-runtime";
7
7
  import B from "dayjs";
8
8
  //#region src/components/AppAlert.jsx
@@ -31,7 +31,7 @@ function ve({ items: e = [], loading: t = !1, className: n = "", ariaLabel: r =
31
31
  3
32
32
  ].map((e) => /* @__PURE__ */ R("div", {
33
33
  className: "cc-stat",
34
- children: /* @__PURE__ */ R(T.Button, {
34
+ children: /* @__PURE__ */ R(ie.Button, {
35
35
  active: !0,
36
36
  size: "small",
37
37
  style: { width: 56 }
@@ -210,7 +210,7 @@ var Re = (e) => {
210
210
  }), Ue = (e) => Q(`/distribution/leaves${Re({ from: e })}`), We = (e) => Q("/distribution/leaves", {
211
211
  method: "POST",
212
212
  body: JSON.stringify(e)
213
- }), Ge = (e) => Q(`/distribution/leaves/${encodeURIComponent(e)}`, { method: "DELETE" }), Ke = (e) => Q(`/distribution/queue${Re(e)}`), qe = (e) => Q(`/distribution/assignments${Re(e)}`), { Text: Je } = N, Ye = (e) => e ? new Date(e).toLocaleString() : "—", Xe = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ze = [
213
+ }), Ge = (e) => Q(`/distribution/leaves/${encodeURIComponent(e)}`, { method: "DELETE" }), Ke = (e) => Q(`/distribution/queue${Re(e)}`), qe = (e) => Q(`/distribution/assignments${Re(e)}`), { Text: Je } = P, Ye = (e) => e ? new Date(e).toLocaleString() : "—", Xe = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ze = [
214
214
  {
215
215
  value: "on_leave",
216
216
  label: "On leave"
@@ -247,7 +247,7 @@ function tt({ id: e, rows: t = [], value: n, onChange: r, minWidth: i = 260 }) {
247
247
  value: e.formId,
248
248
  label: e.formName
249
249
  })), [t]);
250
- return /* @__PURE__ */ R(ie, {
250
+ return /* @__PURE__ */ R(T, {
251
251
  id: e,
252
252
  showSearch: !0,
253
253
  optionFilterProp: "label",
@@ -324,15 +324,15 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
324
324
  let [p, m] = u([]), [g, _] = u(!1), [v, ee] = u(""), [y, ne] = u(""), [b, x] = u({
325
325
  leads: [],
326
326
  total: 0
327
- }), [C, w] = u(!1), [T, E] = u(1), [D, ae] = u([]), [k, j] = u(!1), [M, N] = u(""), [oe, se] = u("on_leave"), [ce, le] = u(""), [ue, de] = u(!1), [F, I] = u(""), [fe, pe] = u({
327
+ }), [C, w] = u(!1), [ie, E] = u(1), [D, O] = u([]), [A, M] = u(!1), [N, P] = u(""), [ae, oe] = u("on_leave"), [se, ce] = u(""), [le, ue] = u(!1), [I, de] = u(""), [fe, pe] = u({
328
328
  reassignments: [],
329
329
  total: 0
330
- }), [me, B] = u(1), [ge, _e] = u(!1), V = Number(r?.minReason) || 5, ve = Number(r?.maxReason) || 500, H = Number(r?.maxPerRun) || 500, U = i?.length ? i : Ze, W = Object.fromEntries(U.map((e) => [e.value, e.label])), ye = W[oe] ? oe : U[0]?.value, be = a(async () => {
330
+ }), [me, B] = u(1), [ge, _e] = u(!1), V = Number(r?.minReason) || 5, ve = Number(r?.maxReason) || 500, H = Number(r?.maxPerRun) || 500, U = i?.length ? i : Ze, W = Object.fromEntries(U.map((e) => [e.value, e.label])), ye = W[ae] ? ae : U[0]?.value, be = a(async () => {
331
331
  _(!0);
332
332
  try {
333
- m(await Ae()), I("");
333
+ m(await Ae()), de("");
334
334
  } catch (e) {
335
- I(e.message);
335
+ de(e.message);
336
336
  } finally {
337
337
  _(!1);
338
338
  }
@@ -349,11 +349,11 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
349
349
  x(await je({
350
350
  fromUserId: v,
351
351
  formId: y,
352
- page: T,
352
+ page: ie,
353
353
  limit: 20
354
- })), I("");
354
+ })), de("");
355
355
  } catch (e) {
356
- I(e.message), x({
356
+ de(e.message), x({
357
357
  leads: [],
358
358
  total: 0
359
359
  });
@@ -363,7 +363,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
363
363
  }, [
364
364
  v,
365
365
  y,
366
- T
366
+ ie
367
367
  ]), Se = a(async () => {
368
368
  _e(!0);
369
369
  try {
@@ -372,7 +372,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
372
372
  limit: 10
373
373
  }));
374
374
  } catch (e) {
375
- I(e.message);
375
+ de(e.message);
376
376
  } finally {
377
377
  _e(!1);
378
378
  }
@@ -384,32 +384,32 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
384
384
  }, [xe, l]), o(() => {
385
385
  Se();
386
386
  }, [Se, l]);
387
- let G = p.find((e) => e.userId === v), K = Number(b.total || 0), q = k ? Math.min(K, H) : D.length, J = c(() => t.filter((e) => e.userId !== v && e.isActive !== !1).map((e) => ({
387
+ let G = p.find((e) => e.userId === v), K = Number(b.total || 0), q = A ? Math.min(K, H) : D.length, J = c(() => t.filter((e) => e.userId !== v && e.isActive !== !1).map((e) => ({
388
388
  value: e.userId,
389
389
  label: e.name || e.email || e.userId
390
- })), [t, v]), Y = J.find((e) => e.value === M)?.label || "", X = ce.trim().length >= V, Z = et({
390
+ })), [t, v]), Y = J.find((e) => e.value === N)?.label || "", X = se.trim().length >= V, Z = et({
391
391
  canEdit: s,
392
392
  fromId: v,
393
- toId: M,
393
+ toId: N,
394
394
  movingCount: q,
395
395
  reasonOk: X,
396
396
  minReason: V
397
- }), Q = !Z && !ue, Ce = (e) => {
398
- ee(e), E(1), ae([]), j(!1), N("");
397
+ }), Q = !Z && !le, Ce = (e) => {
398
+ ee(e), E(1), O([]), M(!1), P("");
399
399
  }, we = (e) => {
400
- ne(e), E(1), ae([]), j(!1);
400
+ ne(e), E(1), O([]), M(!1);
401
401
  }, Te = async () => {
402
- de(!0);
402
+ ue(!0);
403
403
  try {
404
404
  let e = await Me({
405
405
  fromUserId: v,
406
- toUserId: M,
406
+ toUserId: N,
407
407
  reasonType: ye,
408
- reason: ce.trim(),
408
+ reason: se.trim(),
409
409
  ...y ? { formId: y } : {},
410
- ...k ? { allOpen: !0 } : { leadIds: D }
410
+ ...A ? { allOpen: !0 } : { leadIds: D }
411
411
  }), t = e.skipped || [];
412
- if (P.success(`${e.moved} lead${e.moved === 1 ? "" : "s"} moved to ${e.to?.name || Y}`), t.length) {
412
+ if (F.success(`${e.moved} lead${e.moved === 1 ? "" : "s"} moved to ${e.to?.name || Y}`), t.length) {
413
413
  let e = t.reduce((e, t) => ({
414
414
  ...e,
415
415
  [t.reason]: (e[t.reason] || 0) + 1
@@ -426,15 +426,15 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
426
426
  })
427
427
  });
428
428
  }
429
- e.auditSaved === !1 && P.warning("Leads were moved, but the history row could not be saved. Each lead still has its own activity entry."), e.remaining > 0 && P.info(`${e.remaining} open lead${e.remaining === 1 ? "" : "s"} still with ${e.from?.name || "this counsellor"}. Run again to move them.`), ae([]), j(!1), le(""), await Promise.all([
429
+ e.auditSaved === !1 && F.warning("Leads were moved, but the history row could not be saved. Each lead still has its own activity entry."), e.remaining > 0 && F.info(`${e.remaining} open lead${e.remaining === 1 ? "" : "s"} still with ${e.from?.name || "this counsellor"}. Run again to move them.`), O([]), M(!1), ce(""), await Promise.all([
430
430
  be(),
431
431
  xe(),
432
432
  Se()
433
433
  ]), n && n();
434
434
  } catch (e) {
435
- P.error(e.message || "Could not reassign leads");
435
+ F.error(e.message || "Could not reassign leads");
436
436
  } finally {
437
- de(!1);
437
+ ue(!1);
438
438
  }
439
439
  }, Ee = () => re.confirm({
440
440
  title: `Move ${q} lead${q === 1 ? "" : "s"} to ${Y}?`,
@@ -457,7 +457,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
457
457
  "Reason: ",
458
458
  /* @__PURE__ */ R("strong", { children: W[ye] }),
459
459
  " — ",
460
- ce.trim()
460
+ se.trim()
461
461
  ]
462
462
  }),
463
463
  /* @__PURE__ */ R(Je, {
@@ -487,7 +487,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
487
487
  {
488
488
  title: "Status",
489
489
  dataIndex: "status",
490
- render: (e) => /* @__PURE__ */ R(A, { children: e || "New Lead" })
490
+ render: (e) => /* @__PURE__ */ R(j, { children: e || "New Lead" })
491
491
  },
492
492
  {
493
493
  title: "Received",
@@ -517,7 +517,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
517
517
  },
518
518
  {
519
519
  title: "Reason",
520
- render: (e, t) => /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R(A, { children: W[t.reasonType] || "Other" }), /* @__PURE__ */ R("div", {
520
+ render: (e, t) => /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R(j, { children: W[t.reasonType] || "Other" }), /* @__PURE__ */ R("div", {
521
521
  style: { fontSize: 12 },
522
522
  children: t.reason
523
523
  })] })
@@ -535,11 +535,11 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
535
535
  className: "fb-tab-intro",
536
536
  children: "Automatic turns keep sending leads to a counsellor who is on leave. Move their open leads to someone else here."
537
537
  }),
538
- F && /* @__PURE__ */ R(d, {
538
+ I && /* @__PURE__ */ R(d, {
539
539
  type: "error",
540
540
  showIcon: !0,
541
541
  title: "Could not load everything for this tab",
542
- description: F,
542
+ description: I,
543
543
  className: "fb-block"
544
544
  }),
545
545
  /* @__PURE__ */ z("div", {
@@ -550,7 +550,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
550
550
  className: "fb-field-label",
551
551
  htmlFor: "fb-reassign-from",
552
552
  children: "From"
553
- }), /* @__PURE__ */ R(ie, {
553
+ }), /* @__PURE__ */ R(T, {
554
554
  id: "fb-reassign-from",
555
555
  showSearch: !0,
556
556
  optionFilterProp: "label",
@@ -583,9 +583,9 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
583
583
  /* @__PURE__ */ z("div", {
584
584
  className: "fb-block",
585
585
  children: [/* @__PURE__ */ z(S.Group, {
586
- value: k ? "all" : "pick",
586
+ value: A ? "all" : "pick",
587
587
  onChange: (e) => {
588
- j(e.target.value === "all"), e.target.value === "all" && ae([]);
588
+ M(e.target.value === "all"), e.target.value === "all" && O([]);
589
589
  },
590
590
  children: [/* @__PURE__ */ R(S.Button, {
591
591
  value: "pick",
@@ -599,7 +599,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
599
599
  K === 1 ? "" : "s"
600
600
  ]
601
601
  })]
602
- }), k && K > H && /* @__PURE__ */ z(Je, {
602
+ }), A && K > H && /* @__PURE__ */ z(Je, {
603
603
  type: "secondary",
604
604
  className: "fb-hint-inline",
605
605
  children: [
@@ -609,19 +609,19 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
609
609
  ]
610
610
  })]
611
611
  }),
612
- /* @__PURE__ */ R(O, {
612
+ /* @__PURE__ */ R(k, {
613
613
  size: "small",
614
614
  rowKey: "id",
615
615
  loading: C,
616
616
  columns: De,
617
617
  dataSource: b.leads,
618
- rowSelection: k ? void 0 : {
618
+ rowSelection: A ? void 0 : {
619
619
  selectedRowKeys: D,
620
620
  preserveSelectedRowKeys: !0,
621
- onChange: (e) => ae(e)
621
+ onChange: (e) => O(e)
622
622
  },
623
623
  pagination: {
624
- current: T,
624
+ current: ie,
625
625
  pageSize: 20,
626
626
  total: K,
627
627
  showSizeChanger: !1,
@@ -639,13 +639,13 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
639
639
  className: "fb-field-label",
640
640
  htmlFor: "fb-reassign-to",
641
641
  children: "To"
642
- }), /* @__PURE__ */ R(ie, {
642
+ }), /* @__PURE__ */ R(T, {
643
643
  id: "fb-reassign-to",
644
644
  showSearch: !0,
645
645
  optionFilterProp: "label",
646
646
  placeholder: "Choose an active counsellor",
647
- value: M || void 0,
648
- onChange: N,
647
+ value: N || void 0,
648
+ onChange: P,
649
649
  options: J,
650
650
  notFoundContent: "No other active counsellor available"
651
651
  })]
@@ -656,10 +656,10 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
656
656
  className: "fb-field-label",
657
657
  htmlFor: "fb-reassign-type",
658
658
  children: "Reason type"
659
- }), /* @__PURE__ */ R(ie, {
659
+ }), /* @__PURE__ */ R(T, {
660
660
  id: "fb-reassign-type",
661
661
  value: ye,
662
- onChange: se,
662
+ onChange: oe,
663
663
  options: U
664
664
  })]
665
665
  }),
@@ -676,11 +676,11 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
676
676
  rows: 2,
677
677
  maxLength: ve,
678
678
  showCount: !0,
679
- value: ce,
680
- onChange: (e) => le(e.target.value),
679
+ value: se,
680
+ onChange: (e) => ce(e.target.value),
681
681
  placeholder: "For example, on leave 3–7 Nov",
682
682
  "aria-describedby": "fb-reassign-reason-hint",
683
- status: ce && !X ? "error" : void 0
683
+ status: se && !X ? "error" : void 0
684
684
  }),
685
685
  !X && /* @__PURE__ */ z("div", {
686
686
  id: "fb-reassign-reason-hint",
@@ -697,7 +697,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
697
697
  type: "primary",
698
698
  icon: /* @__PURE__ */ R(L, {}),
699
699
  disabled: !Q,
700
- loading: ue,
700
+ loading: le,
701
701
  onClick: Ee,
702
702
  children: q ? `Reassign ${q} lead${q === 1 ? "" : "s"}` : "Reassign"
703
703
  }), Z && /* @__PURE__ */ R("div", {
@@ -714,7 +714,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
714
714
  items: [{
715
715
  key: "history",
716
716
  label: "Reassignment history",
717
- children: /* @__PURE__ */ R(O, {
717
+ children: /* @__PURE__ */ R(k, {
718
718
  size: "small",
719
719
  rowKey: "id",
720
720
  loading: ge,
@@ -737,7 +737,7 @@ function at({ rows: e = [], eligibleCounsellors: t = [], onChanged: n, limits: r
737
737
  }
738
738
  //#endregion
739
739
  //#region src/pages/Modules/Admin/FacebookDistributionUI.jsx
740
- var { Text: ot } = N, $ = (e) => String(e?.userId || ""), st = 50, ct = (e) => {
740
+ var { Text: ot } = P, $ = (e) => String(e?.userId || ""), st = 50, ct = (e) => {
741
741
  let t = e ? new Date(e) : null;
742
742
  return t && !Number.isNaN(t.getTime()) ? t.toLocaleString() : "—";
743
743
  }, lt = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), ut = {
@@ -868,7 +868,7 @@ function wt(e) {
868
868
  }
869
869
  function Tt({ status: e }) {
870
870
  let t = ut[e];
871
- return t ? /* @__PURE__ */ z(A, {
871
+ return t ? /* @__PURE__ */ z(j, {
872
872
  className: `fb-status fb-status--${t.tone}`,
873
873
  children: [/* @__PURE__ */ R("span", {
874
874
  className: "fb-status-dot",
@@ -903,7 +903,7 @@ var Dt = (e, t) => ({
903
903
  enabled: t?.isActive !== !1
904
904
  });
905
905
  function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsellors: o = [], limits: m, permissions: h = {}, section: g = "course", onClose: v, onSaved: y, onReload: ne, onAfterClose: b }) {
906
- let [x] = u(() => Dt(n, r)), [S, C] = u(x.base), [w, T] = u(x.courseId), [E, D] = u(x.mappingActive), [O, k] = u(x.orderedIds), [j, N] = u(x.enabled), [le, de] = u(""), [F, I] = u(!1), [fe, L] = u(""), [me, he] = u(""), [B, ge] = u(null), [_e, V] = u(null), ve = l(null), H = l(null), U = l(null), W = l(!1), { canAdd: ye = !0, canEdit: be = !0 } = h, Se = S.mapping ? be : ye, G = S.current ? be : ye, K = !Se && !G, q = Number(m?.maxCounsellors) || st, J = S.current?.counsellors, Y = S.mapping, Z = c(() => {
906
+ let [x] = u(() => Dt(n, r)), [S, C] = u(x.base), [w, ie] = u(x.courseId), [E, D] = u(x.mappingActive), [k, A] = u(x.orderedIds), [M, P] = u(x.enabled), [ce, ue] = u(""), [I, de] = u(!1), [fe, L] = u(""), [me, he] = u(""), [B, ge] = u(null), [_e, V] = u(null), ve = l(null), H = l(null), U = l(null), W = l(!1), { canAdd: ye = !0, canEdit: be = !0 } = h, Se = S.mapping ? be : ye, G = S.current ? be : ye, K = !Se && !G, q = Number(m?.maxCounsellors) || st, J = S.current?.counsellors, Y = S.mapping, Z = c(() => {
907
907
  let e = new Map(o.map((e) => [$(e), {
908
908
  ...e,
909
909
  isActive: !0
@@ -915,7 +915,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
915
915
  isActive: !1
916
916
  });
917
917
  }), e;
918
- }, [o, J]), Q = a((e) => Z.get(e)?.name || "Unnamed counsellor", [Z]), Ce = c(() => new Set(O), [O]), we = O.map((e) => Z.get(e)).filter(Boolean), Ee = [...o].filter((e) => !Ce.has($(e))).sort((e, t) => String(e.name).localeCompare(String(t.name))), De = [...we, ...Ee].filter((e) => `${e.name || ""} ${e.email || ""}`.toLowerCase().includes(le.trim().toLowerCase())), Oe = we.filter((e) => !e.isActive), ke = we.length - Oe.length, Ae = (S.current?.counsellors || []).map($).filter(Boolean), je = Ae.length !== O.length || Ae.some((e, t) => e !== O[t]), Me = S.current ? je || j !== (S.current.isActive !== !1) : O.length > 0, Ne = S.mapping ? String(w) !== String(S.mapping.courseId) || E !== S.mapping.isActive : !!w, Pe = Ne || Me, Fe = xt(S.current, O), Ie = O.indexOf(Fe), Le = (Ie < 0 ? O : [...O.slice(Ie), ...O.slice(0, Ie)]).find((e) => Z.get(e)?.isActive) || "", Re = Z.get(Le)?.name || "No one yet", ze = c(() => {
918
+ }, [o, J]), Q = a((e) => Z.get(e)?.name || "Unnamed counsellor", [Z]), Ce = c(() => new Set(k), [k]), we = k.map((e) => Z.get(e)).filter(Boolean), Ee = [...o].filter((e) => !Ce.has($(e))).sort((e, t) => String(e.name).localeCompare(String(t.name))), De = [...we, ...Ee].filter((e) => `${e.name || ""} ${e.email || ""}`.toLowerCase().includes(ce.trim().toLowerCase())), Oe = we.filter((e) => !e.isActive), ke = we.length - Oe.length, Ae = (S.current?.counsellors || []).map($).filter(Boolean), je = Ae.length !== k.length || Ae.some((e, t) => e !== k[t]), Me = S.current ? je || M !== (S.current.isActive !== !1) : k.length > 0, Ne = S.mapping ? String(w) !== String(S.mapping.courseId) || E !== S.mapping.isActive : !!w, Pe = Ne || Me, Fe = xt(S.current, k), Ie = k.indexOf(Fe), Le = (Ie < 0 ? k : [...k.slice(Ie), ...k.slice(0, Ie)]).find((e) => Z.get(e)?.isActive) || "", Re = Z.get(Le)?.name || "No one yet", ze = c(() => {
919
919
  let e = i.map((e) => ({
920
920
  value: e.courseId,
921
921
  label: e.courseName
@@ -926,15 +926,15 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
926
926
  }), e;
927
927
  }, [i, Y]), Be = (e, t) => {
928
928
  let n = Dt(e, t);
929
- C(n.base), T(n.courseId), D(n.mappingActive), k(n.orderedIds), N(n.enabled);
929
+ C(n.base), ie(n.courseId), D(n.mappingActive), A(n.orderedIds), P(n.enabled);
930
930
  }, Ve = (e, t) => {
931
- k((n) => t ? [...n.filter((t) => t !== e), e] : n.filter((t) => t !== e)), he(t ? `${Q(e)} added to the list` : `${Q(e)} removed from the list`);
931
+ A((n) => t ? [...n.filter((t) => t !== e), e] : n.filter((t) => t !== e)), he(t ? `${Q(e)} added to the list` : `${Q(e)} removed from the list`);
932
932
  }, He = (e, t) => {
933
- let n = O.indexOf(e), r = n + (t === "up" ? -1 : 1);
934
- n < 0 || r < 0 || r >= O.length || (U.current = {
933
+ let n = k.indexOf(e), r = n + (t === "up" ? -1 : 1);
934
+ n < 0 || r < 0 || r >= k.length || (U.current = {
935
935
  id: e,
936
936
  direction: t
937
- }, k((e) => bt(e, n, r)), he(`${Q(e)} moved to place ${r + 1} of ${O.length}`));
937
+ }, A((e) => bt(e, n, r)), he(`${Q(e)} moved to place ${r + 1} of ${k.length}`));
938
938
  };
939
939
  s(() => {
940
940
  let e = U.current;
@@ -942,7 +942,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
942
942
  U.current = null;
943
943
  let t = [...ve.current?.querySelectorAll("[data-move-id]") || []].filter((t) => t.dataset.moveId === e.id && !t.disabled);
944
944
  (t.find((t) => t.dataset.moveDirection === e.direction) || t[0])?.focus();
945
- }, [O]);
945
+ }, [k]);
946
946
  let Ue = (e, t) => {
947
947
  V(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t);
948
948
  }, We = (e, t, n) => {
@@ -951,9 +951,9 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
951
951
  V(null), ge(null);
952
952
  }, Ke = (e) => {
953
953
  let t = _e;
954
- Ge(), !(!Ce.has(t) || !Ce.has(e) || t === e) && (k((n) => bt(n, n.indexOf(t), n.indexOf(e))), he(`${Q(t)} moved`));
954
+ Ge(), !(!Ce.has(t) || !Ce.has(e) || t === e) && (A((n) => bt(n, n.indexOf(t), n.indexOf(e))), he(`${Q(t)} moved`));
955
955
  }, qe = () => {
956
- if (!F) {
956
+ if (!I) {
957
957
  if (!Pe) {
958
958
  v();
959
959
  return;
@@ -984,22 +984,22 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
984
984
  className: "fb-setup-footer-actions",
985
985
  children: [/* @__PURE__ */ R(f, {
986
986
  onClick: qe,
987
- disabled: F,
987
+ disabled: I,
988
988
  children: K ? "Close" : "Cancel"
989
989
  }), !K && /* @__PURE__ */ R(f, {
990
990
  type: "primary",
991
- loading: F,
991
+ loading: I,
992
992
  disabled: !Pe,
993
993
  onClick: async () => {
994
- if (L(""), Me && !O.length) {
994
+ if (L(""), Me && !k.length) {
995
995
  L("Choose at least one counsellor. To stop using counsellors on this form, use Remove distribution in the form menu.");
996
996
  return;
997
997
  }
998
- if (Me && O.length > q) {
999
- L(`You can choose up to ${q} counsellors. You have chosen ${O.length}.`);
998
+ if (Me && k.length > q) {
999
+ L(`You can choose up to ${q} counsellors. You have chosen ${k.length}.`);
1000
1000
  return;
1001
1001
  }
1002
- I(!0);
1002
+ de(!0);
1003
1003
  let e = await St({
1004
1004
  mapping: Ne ? {
1005
1005
  input: {
@@ -1012,8 +1012,8 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1012
1012
  distribution: Me ? {
1013
1013
  input: {
1014
1014
  formId: t.formId,
1015
- counsellorIds: O,
1016
- isActive: j,
1015
+ counsellorIds: k,
1016
+ isActive: M,
1017
1017
  version: S.current?.version ?? 0
1018
1018
  },
1019
1019
  isEdit: !!S.current
@@ -1022,7 +1022,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1022
1022
  saveDistribution: Te
1023
1023
  });
1024
1024
  if (!e.error) {
1025
- I(!1), P.success("Form setup saved"), y?.(), v();
1025
+ de(!1), F.success("Form setup saved"), y?.(), v();
1026
1026
  return;
1027
1027
  }
1028
1028
  let n = e.mappingSaved ? "The course was saved. " : "";
@@ -1043,7 +1043,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1043
1043
  courseName: ze.find((e) => e.value === w)?.label || e.mapping?.courseName || ""
1044
1044
  }
1045
1045
  })), L(`${n}The counsellors were not saved: ${X(e.error)}`);
1046
- e.mappingSaved && y?.(), I(!1);
1046
+ e.mappingSaved && y?.(), de(!1);
1047
1047
  },
1048
1048
  children: "Save"
1049
1049
  })]
@@ -1094,16 +1094,16 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1094
1094
  number: "1",
1095
1095
  title: "Course"
1096
1096
  }),
1097
- /* @__PURE__ */ R(ie, {
1097
+ /* @__PURE__ */ R(T, {
1098
1098
  className: "fb-setup-select",
1099
1099
  showSearch: !0,
1100
1100
  optionFilterProp: "label",
1101
1101
  "aria-label": "Course",
1102
1102
  placeholder: "Choose a course",
1103
1103
  value: w,
1104
- onChange: T,
1104
+ onChange: ie,
1105
1105
  options: ze,
1106
- disabled: !Se || F,
1106
+ disabled: !Se || I,
1107
1107
  notFoundContent: "No matching courses"
1108
1108
  }),
1109
1109
  w ? /* @__PURE__ */ z("label", {
@@ -1114,11 +1114,11 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1114
1114
  }), /* @__PURE__ */ R("span", {
1115
1115
  className: "fb-hint",
1116
1116
  children: "When off, new leads still come in, but without a course."
1117
- })] }), /* @__PURE__ */ R(ae, {
1117
+ })] }), /* @__PURE__ */ R(O, {
1118
1118
  "aria-label": "Use this course for new leads",
1119
1119
  checked: E,
1120
1120
  onChange: D,
1121
- disabled: !Se || F
1121
+ disabled: !Se || I
1122
1122
  })]
1123
1123
  }) : /* @__PURE__ */ R("div", {
1124
1124
  className: "fb-hint",
@@ -1145,7 +1145,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1145
1145
  className: "fb-inactive-actions",
1146
1146
  children: Oe.map((e) => /* @__PURE__ */ z(f, {
1147
1147
  size: "small",
1148
- disabled: F,
1148
+ disabled: I,
1149
1149
  onClick: () => Ve($(e), !1),
1150
1150
  children: ["Remove ", e.name || "Unnamed counsellor"]
1151
1151
  }, $(e)))
@@ -1153,22 +1153,22 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1153
1153
  }),
1154
1154
  /* @__PURE__ */ R(te, {
1155
1155
  allowClear: !0,
1156
- value: le,
1156
+ value: ce,
1157
1157
  prefix: /* @__PURE__ */ R(pe, { "aria-hidden": "true" }),
1158
1158
  className: "fb-block",
1159
1159
  placeholder: "Search counsellors",
1160
1160
  "aria-label": "Search counsellors",
1161
- onChange: (e) => de(e.target.value)
1161
+ onChange: (e) => ue(e.target.value)
1162
1162
  }),
1163
1163
  /* @__PURE__ */ R("div", {
1164
1164
  className: "fb-dist-draggable-list",
1165
1165
  ref: ve,
1166
- children: De.length === 0 ? /* @__PURE__ */ R(ee, { description: o.length || O.length ? "No matching counsellors" : "No active counsellors to choose from" }) : De.map((e) => {
1167
- let t = $(e), n = e.name || "Unnamed counsellor", r = Ce.has(t), i = O.indexOf(t);
1166
+ children: De.length === 0 ? /* @__PURE__ */ R(ee, { description: o.length || k.length ? "No matching counsellors" : "No active counsellors to choose from" }) : De.map((e) => {
1167
+ let t = $(e), n = e.name || "Unnamed counsellor", r = Ce.has(t), i = k.indexOf(t);
1168
1168
  return /* @__PURE__ */ z("div", {
1169
1169
  "data-person-row": t,
1170
1170
  className: `fb-dist-unified-row ${r ? "selected" : ""} ${B === t ? "drag-over" : ""}`,
1171
- draggable: r && !F && G,
1171
+ draggable: r && !I && G,
1172
1172
  onDragStart: (e) => Ue(e, t),
1173
1173
  onDragOver: (e) => We(e, t, r),
1174
1174
  onDrop: (e) => {
@@ -1181,14 +1181,14 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1181
1181
  children: /* @__PURE__ */ R(p, {
1182
1182
  "aria-label": `Include ${n}`,
1183
1183
  checked: r,
1184
- disabled: F || !G,
1184
+ disabled: I || !G,
1185
1185
  onChange: (e) => Ve(t, e.target.checked)
1186
1186
  })
1187
1187
  }),
1188
1188
  /* @__PURE__ */ R("span", {
1189
1189
  className: `fb-dist-grip ${r ? "" : "placeholder"}`,
1190
1190
  "aria-hidden": "true",
1191
- children: /* @__PURE__ */ R(ue, {})
1191
+ children: /* @__PURE__ */ R(le, {})
1192
1192
  }),
1193
1193
  /* @__PURE__ */ R("span", {
1194
1194
  className: "fb-dist-rank",
@@ -1207,7 +1207,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1207
1207
  children: e.email
1208
1208
  })]
1209
1209
  }),
1210
- !e.isActive && /* @__PURE__ */ z(A, {
1210
+ !e.isActive && /* @__PURE__ */ z(j, {
1211
1211
  className: "fb-status fb-status--bad",
1212
1212
  children: [/* @__PURE__ */ R("span", {
1213
1213
  className: "fb-status-dot",
@@ -1216,26 +1216,26 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1216
1216
  }),
1217
1217
  r && /* @__PURE__ */ z("span", {
1218
1218
  className: "fb-dist-order-buttons",
1219
- children: [/* @__PURE__ */ R(M, {
1219
+ children: [/* @__PURE__ */ R(N, {
1220
1220
  title: `Move ${n} up`,
1221
1221
  children: /* @__PURE__ */ R(f, {
1222
1222
  type: "text",
1223
- icon: /* @__PURE__ */ R(se, { "aria-hidden": "true" }),
1223
+ icon: /* @__PURE__ */ R(oe, { "aria-hidden": "true" }),
1224
1224
  "aria-label": `Move ${n} up`,
1225
1225
  "data-move-id": t,
1226
1226
  "data-move-direction": "up",
1227
- disabled: i <= 0 || F || !G,
1227
+ disabled: i <= 0 || I || !G,
1228
1228
  onClick: () => He(t, "up")
1229
1229
  })
1230
- }), /* @__PURE__ */ R(M, {
1230
+ }), /* @__PURE__ */ R(N, {
1231
1231
  title: `Move ${n} down`,
1232
1232
  children: /* @__PURE__ */ R(f, {
1233
1233
  type: "text",
1234
- icon: /* @__PURE__ */ R(oe, { "aria-hidden": "true" }),
1234
+ icon: /* @__PURE__ */ R(ae, { "aria-hidden": "true" }),
1235
1235
  "aria-label": `Move ${n} down`,
1236
1236
  "data-move-id": t,
1237
1237
  "data-move-direction": "down",
1238
- disabled: i >= O.length - 1 || F || !G,
1238
+ disabled: i >= k.length - 1 || I || !G,
1239
1239
  onClick: () => He(t, "down")
1240
1240
  })
1241
1241
  })]
@@ -1251,7 +1251,7 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1251
1251
  }),
1252
1252
  /* @__PURE__ */ z("div", {
1253
1253
  className: "fb-dist-next-line",
1254
- children: [/* @__PURE__ */ R(ce, { "aria-hidden": "true" }), /* @__PURE__ */ z("span", { children: [
1254
+ children: [/* @__PURE__ */ R(se, { "aria-hidden": "true" }), /* @__PURE__ */ z("span", { children: [
1255
1255
  je ? "Next after save" : "Next in saved order",
1256
1256
  ": ",
1257
1257
  /* @__PURE__ */ R("strong", { children: Re })
@@ -1277,13 +1277,13 @@ function Ot({ open: e, row: t, mapping: n, current: r, courses: i = [], counsell
1277
1277
  }), /* @__PURE__ */ R("span", {
1278
1278
  className: "fb-hint",
1279
1279
  children: "When paused, new leads wait until you turn this back on."
1280
- })] }), /* @__PURE__ */ R(ae, {
1280
+ })] }), /* @__PURE__ */ R(O, {
1281
1281
  "aria-label": "Send leads to this form automatically",
1282
- checked: j,
1283
- onChange: N,
1282
+ checked: M,
1283
+ onChange: P,
1284
1284
  checkedChildren: "On",
1285
1285
  unCheckedChildren: "Paused",
1286
- disabled: !G || F
1286
+ disabled: !G || I
1287
1287
  })]
1288
1288
  })]
1289
1289
  })
@@ -1376,9 +1376,9 @@ function Mt({ rows: e = [], canEdit: t = !0, refreshKey: n = 0, onChanged: r })
1376
1376
  autoFocusButton: "cancel",
1377
1377
  onOk: async () => {
1378
1378
  try {
1379
- await Ie(t.facebookLeadId), P.success("This lead will be tried again");
1379
+ await Ie(t.facebookLeadId), F.success("This lead will be tried again");
1380
1380
  } catch (e) {
1381
- P.error(e?.status === 409 ? "This lead is no longer failed. The list has been updated." : X(e));
1381
+ F.error(e?.status === 409 ? "This lead is no longer failed. The list has been updated." : X(e));
1382
1382
  }
1383
1383
  ee(), r?.();
1384
1384
  }
@@ -1443,7 +1443,7 @@ function Mt({ rows: e = [], canEdit: t = !0, refreshKey: n = 0, onChanged: r })
1443
1443
  title: "",
1444
1444
  key: "retry",
1445
1445
  width: 96,
1446
- render: (e, n) => /* @__PURE__ */ R(M, {
1446
+ render: (e, n) => /* @__PURE__ */ R(N, {
1447
1447
  title: t ? "" : "You don't have permission to retry leads",
1448
1448
  children: /* @__PURE__ */ R("span", { children: /* @__PURE__ */ R(f, {
1449
1449
  size: "small",
@@ -1477,7 +1477,7 @@ function Mt({ rows: e = [], canEdit: t = !0, refreshKey: n = 0, onChanged: r })
1477
1477
  }),
1478
1478
  /* @__PURE__ */ z("div", {
1479
1479
  className: "fb-subhead",
1480
- children: [/* @__PURE__ */ z("h4", { children: ["Waiting leads", x === void 0 ? "" : ` (${x})`] }), /* @__PURE__ */ R(ie, {
1480
+ children: [/* @__PURE__ */ z("h4", { children: ["Waiting leads", x === void 0 ? "" : ` (${x})`] }), /* @__PURE__ */ R(T, {
1481
1481
  "aria-label": "Show waiting leads",
1482
1482
  value: s,
1483
1483
  className: "fb-subhead-select",
@@ -1504,7 +1504,7 @@ function Mt({ rows: e = [], canEdit: t = !0, refreshKey: n = 0, onChanged: r })
1504
1504
  title: "Could not load waiting leads",
1505
1505
  resource: _
1506
1506
  }),
1507
- /* @__PURE__ */ R(O, {
1507
+ /* @__PURE__ */ R(k, {
1508
1508
  size: "small",
1509
1509
  rowKey: (e) => String(e.id || `${e.facebookLeadId}-${e.formId}`),
1510
1510
  loading: _.loading,
@@ -1529,7 +1529,7 @@ function Mt({ rows: e = [], canEdit: t = !0, refreshKey: n = 0, onChanged: r })
1529
1529
  title: "Could not load failed leads",
1530
1530
  resource: v
1531
1531
  }),
1532
- /* @__PURE__ */ R(O, {
1532
+ /* @__PURE__ */ R(k, {
1533
1533
  size: "small",
1534
1534
  rowKey: (e) => String(e.facebookLeadId),
1535
1535
  loading: v.loading,
@@ -1610,7 +1610,7 @@ function Nt({ rows: e = [], refreshKey: t = 0 }) {
1610
1610
  title: "Could not load skipped counsellors",
1611
1611
  resource: s
1612
1612
  }),
1613
- /* @__PURE__ */ R(O, {
1613
+ /* @__PURE__ */ R(k, {
1614
1614
  size: "small",
1615
1615
  rowKey: (e) => String(e.id || `${e.facebookLeadId}-${e.skippedCounsellorLegacyId}`),
1616
1616
  loading: s.loading,
@@ -1683,7 +1683,7 @@ function Pt({ rows: e = [], refreshKey: t = 0 }) {
1683
1683
  title: "Could not load history",
1684
1684
  resource: s
1685
1685
  }),
1686
- /* @__PURE__ */ R(O, {
1686
+ /* @__PURE__ */ R(k, {
1687
1687
  size: "small",
1688
1688
  rowKey: (e) => String(e.id || `${e.formId}-${e.at}`),
1689
1689
  loading: s.loading,
@@ -1705,7 +1705,7 @@ function Pt({ rows: e = [], refreshKey: t = 0 }) {
1705
1705
  }
1706
1706
  //#endregion
1707
1707
  //#region src/pages/Modules/Admin/LeadDistributionPanels.jsx
1708
- var { Text: Ft, Paragraph: It } = N, Lt = {
1708
+ var { Text: Ft, Paragraph: It } = P, Lt = {
1709
1709
  eligible: {
1710
1710
  label: "Active – Eligible",
1711
1711
  color: "green"
@@ -1726,6 +1726,10 @@ var { Text: Ft, Paragraph: It } = N, Lt = {
1726
1726
  label: "Admin Disabled – Skipped",
1727
1727
  color: "red"
1728
1728
  },
1729
+ at_cap: {
1730
+ label: "At open-lead limit – Skipped",
1731
+ color: "gold"
1732
+ },
1729
1733
  inactive: {
1730
1734
  label: "Inactive user – Skipped",
1731
1735
  color: "red"
@@ -1736,7 +1740,7 @@ var { Text: Ft, Paragraph: It } = N, Lt = {
1736
1740
  }
1737
1741
  }, Rt = {
1738
1742
  awaiting_cutoff: "Waiting for cut-off",
1739
- no_active_counsellor: "Waiting for a counsellor to log in",
1743
+ no_active_counsellor: "Waiting for a counsellor who is online and under the open-lead limit",
1740
1744
  distribution_not_configured: "Form has no counsellor list",
1741
1745
  distribution_disabled: "Form distribution is switched off"
1742
1746
  }, zt = (e) => e ? B(e).format("h:mm A") : "–", Bt = (e) => e ? B(e).format("D MMM, h:mm A") : "–", Vt = (e) => {
@@ -1778,9 +1782,9 @@ function Wt({ canEdit: e = !1 }) {
1778
1782
  let [t, n] = u(null), [r, i] = Ht(() => ze(t ? t.format("YYYY-MM-DD") : ""), [t]), [a, o] = u(null), [s, c] = u(""), l = r.data ?? {}, p = l.summary ?? {}, h = !t || l.day === l.today, _ = async (e, t) => {
1779
1783
  c(`t${e.legacyUserId}`);
1780
1784
  try {
1781
- await He(e.legacyUserId, t, t ? "" : "Disabled by admin"), P.success(`${e.name} ${t ? "will receive new leads again" : "will not receive new leads"}`), i();
1785
+ await He(e.legacyUserId, t, t ? "" : "Disabled by admin"), F.success(`${e.name} ${t ? "will receive new leads again" : "will not receive new leads"}`), i();
1782
1786
  } catch (e) {
1783
- P.error(X(e));
1787
+ F.error(X(e));
1784
1788
  } finally {
1785
1789
  c("");
1786
1790
  }
@@ -1815,7 +1819,7 @@ function Wt({ canEdit: e = !1 }) {
1815
1819
  {
1816
1820
  title: "Status",
1817
1821
  dataIndex: "status",
1818
- render: (e) => /* @__PURE__ */ R(A, {
1822
+ render: (e) => /* @__PURE__ */ R(j, {
1819
1823
  color: Lt[e]?.color,
1820
1824
  children: Lt[e]?.label ?? e
1821
1825
  }),
@@ -1831,6 +1835,20 @@ function Wt({ canEdit: e = !1 }) {
1831
1835
  align: "right",
1832
1836
  sorter: (e, t) => e.assigned - t.assigned
1833
1837
  },
1838
+ {
1839
+ title: "Untouched now",
1840
+ dataIndex: "untouched",
1841
+ align: "right",
1842
+ sorter: (e, t) => (e.untouched ?? 0) - (t.untouched ?? 0),
1843
+ render: (e, t) => {
1844
+ let n = l.settings?.openLeadCap ?? 0, r = n > 0 ? `${e ?? 0} / ${n}` : String(e ?? 0);
1845
+ return t.atCap ? /* @__PURE__ */ R(Ft, {
1846
+ type: "warning",
1847
+ strong: !0,
1848
+ children: r
1849
+ }) : r;
1850
+ }
1851
+ },
1834
1852
  {
1835
1853
  title: "Target",
1836
1854
  dataIndex: "target",
@@ -1901,7 +1919,7 @@ function Wt({ canEdit: e = !1 }) {
1901
1919
  allowClear: !0,
1902
1920
  placeholder: "Today",
1903
1921
  disabledDate: (e) => e && e.isAfter(B(), "day")
1904
- }), l.settings ? /* @__PURE__ */ R(A, {
1922
+ }), l.settings ? /* @__PURE__ */ R(j, {
1905
1923
  color: l.settings.mode === "equal_daily" ? "magenta" : "default",
1906
1924
  children: l.settings.mode === "equal_daily" ? "Equal daily distribution" : "Round-robin (earlier behaviour)"
1907
1925
  }) : null]
@@ -1911,7 +1929,7 @@ function Wt({ canEdit: e = !1 }) {
1911
1929
  children: "Refresh"
1912
1930
  })]
1913
1931
  }),
1914
- r.loading && !r.data ? /* @__PURE__ */ R(T, { active: !0 }) : r.error ? /* @__PURE__ */ R(Ut, {
1932
+ r.loading && !r.data ? /* @__PURE__ */ R(ie, { active: !0 }) : r.error ? /* @__PURE__ */ R(Ut, {
1915
1933
  text: r.error,
1916
1934
  onRetry: i
1917
1935
  }) : /* @__PURE__ */ z(he, { children: [
@@ -1961,6 +1979,15 @@ function Wt({ canEdit: e = !1 }) {
1961
1979
  value: p.eligible ?? 0
1962
1980
  })
1963
1981
  }),
1982
+ /* @__PURE__ */ R(m, {
1983
+ xs: 12,
1984
+ md: 6,
1985
+ xl: 3,
1986
+ children: /* @__PURE__ */ R(D, {
1987
+ title: "At open-lead limit",
1988
+ value: p.atCap ?? 0
1989
+ })
1990
+ }),
1964
1991
  /* @__PURE__ */ R(m, {
1965
1992
  xs: 12,
1966
1993
  md: 6,
@@ -1985,7 +2012,7 @@ function Wt({ canEdit: e = !1 }) {
1985
2012
  xl: 6,
1986
2013
  children: /* @__PURE__ */ R(D, {
1987
2014
  title: "Balance",
1988
- valueRender: () => /* @__PURE__ */ R(A, {
2015
+ valueRender: () => /* @__PURE__ */ R(j, {
1989
2016
  color: p.balance === "balanced" ? "green" : "gold",
1990
2017
  style: {
1991
2018
  fontSize: 14,
@@ -2002,7 +2029,7 @@ function Wt({ canEdit: e = !1 }) {
2002
2029
  style: { fontSize: 12 },
2003
2030
  children: "Counsellors who joined later get new leads first until they catch up. Leads already assigned are never moved, so an exact match is not always possible."
2004
2031
  }) : null,
2005
- /* @__PURE__ */ R(O, {
2032
+ /* @__PURE__ */ R(k, {
2006
2033
  rowKey: "legacyUserId",
2007
2034
  size: "small",
2008
2035
  columns: v,
@@ -2032,17 +2059,17 @@ function Gt({ counsellor: e, onClose: t }) {
2032
2059
  from: t.range[0].format("YYYY-MM-DD"),
2033
2060
  to: t.range[1].format("YYYY-MM-DD"),
2034
2061
  reason: t.reason ?? ""
2035
- }), P.success("Leave saved: no new leads on those days"), n.resetFields(), c(!0), i();
2062
+ }), F.success("Leave saved: no new leads on those days"), n.resetFields(), c(!0), i();
2036
2063
  } catch (e) {
2037
- P.error(X(e));
2064
+ F.error(X(e));
2038
2065
  } finally {
2039
2066
  o(!1);
2040
2067
  }
2041
2068
  }, p = async (e) => {
2042
2069
  try {
2043
- await Ge(e), P.success("Leave removed"), c(!0), i();
2070
+ await Ge(e), F.success("Leave removed"), c(!0), i();
2044
2071
  } catch (e) {
2045
- P.error(X(e));
2072
+ F.error(X(e));
2046
2073
  }
2047
2074
  };
2048
2075
  return /* @__PURE__ */ z(re, {
@@ -2088,7 +2115,7 @@ function Gt({ counsellor: e, onClose: t }) {
2088
2115
  style: { margin: "12px 0 4px" },
2089
2116
  children: "Upcoming leave"
2090
2117
  }),
2091
- r.loading ? /* @__PURE__ */ R(T, {
2118
+ r.loading ? /* @__PURE__ */ R(ie, {
2092
2119
  active: !0,
2093
2120
  paragraph: { rows: 1 }
2094
2121
  }) : r.error ? /* @__PURE__ */ R(Ut, {
@@ -2160,13 +2187,13 @@ function Kt({ rows: e = [] }) {
2160
2187
  {
2161
2188
  title: "Status",
2162
2189
  dataIndex: "status",
2163
- render: (e, t) => e === "dead" ? /* @__PURE__ */ R(A, {
2190
+ render: (e, t) => e === "dead" ? /* @__PURE__ */ R(j, {
2164
2191
  color: "red",
2165
2192
  children: "Assignment Failed"
2166
- }) : e === "processing" ? /* @__PURE__ */ R(A, {
2193
+ }) : e === "processing" ? /* @__PURE__ */ R(j, {
2167
2194
  color: "blue",
2168
2195
  children: "Assigning…"
2169
- }) : /* @__PURE__ */ R(A, {
2196
+ }) : /* @__PURE__ */ R(j, {
2170
2197
  color: t.lastResult === "awaiting_cutoff" ? "purple" : "gold",
2171
2198
  children: Rt[t.lastResult] ?? "Pending Assignment"
2172
2199
  })
@@ -2209,7 +2236,7 @@ function Kt({ rows: e = [] }) {
2209
2236
  }
2210
2237
  ]
2211
2238
  }),
2212
- /* @__PURE__ */ R(ie, {
2239
+ /* @__PURE__ */ R(T, {
2213
2240
  style: { minWidth: 220 },
2214
2241
  value: r,
2215
2242
  onChange: (e) => {
@@ -2238,7 +2265,7 @@ function Kt({ rows: e = [] }) {
2238
2265
  s.error ? /* @__PURE__ */ R(Ut, {
2239
2266
  text: s.error,
2240
2267
  onRetry: c
2241
- }) : /* @__PURE__ */ R(O, {
2268
+ }) : /* @__PURE__ */ R(k, {
2242
2269
  rowKey: (e) => String(e._id ?? e.facebookLeadId),
2243
2270
  size: "small",
2244
2271
  loading: s.loading,
@@ -2293,9 +2320,9 @@ function qt() {
2293
2320
  {
2294
2321
  title: "Skipped",
2295
2322
  dataIndex: "skipped",
2296
- render: (e) => Array.isArray(e) && e.length ? /* @__PURE__ */ R(M, {
2323
+ render: (e) => Array.isArray(e) && e.length ? /* @__PURE__ */ R(N, {
2297
2324
  title: e.map((e) => `${e.name || `#${e.legacyUserId}`}: ${Lt[e.reason]?.label ?? e.reason}`).join("\n"),
2298
- children: /* @__PURE__ */ z(A, { children: [e.length, " skipped"] })
2325
+ children: /* @__PURE__ */ z(j, { children: [e.length, " skipped"] })
2299
2326
  }) : "–"
2300
2327
  }
2301
2328
  ];
@@ -2326,7 +2353,7 @@ function qt() {
2326
2353
  i.error ? /* @__PURE__ */ R(Ut, {
2327
2354
  text: i.error,
2328
2355
  onRetry: a
2329
- }) : /* @__PURE__ */ R(O, {
2356
+ }) : /* @__PURE__ */ R(k, {
2330
2357
  rowKey: (e) => String(e._id),
2331
2358
  size: "small",
2332
2359
  loading: i.loading,
@@ -2357,6 +2384,8 @@ function Yt({ canEdit: e = !1 }) {
2357
2384
  let [t] = y.useForm(), [n, r] = Ht(() => Be(), []), [i, a] = u(!1), s = n.data?.settings;
2358
2385
  o(() => {
2359
2386
  s && t.setFieldsValue({
2387
+ openLeadCap: 15,
2388
+ capWindowDays: 0,
2360
2389
  ...s,
2361
2390
  startTime: B(s.startTime, "HH:mm"),
2362
2391
  cutoffTime: B(s.cutoffTime, "HH:mm"),
@@ -2364,7 +2393,7 @@ function Yt({ canEdit: e = !1 }) {
2364
2393
  });
2365
2394
  }, [s, t]);
2366
2395
  let c = y.useWatch("mode", t);
2367
- return n.loading && !n.data ? /* @__PURE__ */ R(T, { active: !0 }) : n.error ? /* @__PURE__ */ R(Ut, {
2396
+ return n.loading && !n.data ? /* @__PURE__ */ R(ie, { active: !0 }) : n.error ? /* @__PURE__ */ R(Ut, {
2368
2397
  text: n.error,
2369
2398
  onRetry: r
2370
2399
  }) : /* @__PURE__ */ z(y, {
@@ -2375,109 +2404,171 @@ function Yt({ canEdit: e = !1 }) {
2375
2404
  children: [
2376
2405
  /* @__PURE__ */ R(y.Item, {
2377
2406
  name: "mode",
2378
- label: "How leads are shared",
2379
- children: /* @__PURE__ */ R(w, {
2380
- block: !0,
2381
- options: [{
2382
- value: "equal_daily",
2383
- label: "Equal daily distribution"
2384
- }, {
2385
- value: "round_robin",
2386
- label: "Round-robin (earlier behaviour)"
2387
- }]
2407
+ label: "Only give leads to counsellors who are logged in",
2408
+ valuePropName: "checked",
2409
+ getValueProps: (e) => ({ checked: e === "equal_daily" }),
2410
+ normalize: (e) => e ? "equal_daily" : "round_robin",
2411
+ children: /* @__PURE__ */ R(O, {
2412
+ checkedChildren: "On",
2413
+ unCheckedChildren: "Off"
2388
2414
  })
2389
2415
  }),
2390
2416
  /* @__PURE__ */ R(It, {
2391
2417
  type: "secondary",
2392
- children: c === "equal_daily" ? "Only counsellors who are logged in, enabled and not on leave get leads. Each lead goes to the one with the fewest leads today; equal counts take turns." : "Leads take turns through each form's counsellor list, skipping inactive users. Login and leave are not checked."
2418
+ children: c === "equal_daily" ? "Only counsellors who are logged in right now, enabled, not on leave and under the open-lead limit get leads. Each lead goes to the one with the fewest leads today; equal counts take turns (round robin). A lead nobody can take waits and is offered again every 2 minutes." : "Off: round robin as before. Leads take turns through each form's counsellor list, skipping only inactive users. Login, leave and the open-lead limit are not checked, and nothing waits for a login."
2393
2419
  }),
2394
- /* @__PURE__ */ z(C, {
2395
- gutter: 12,
2420
+ /* @__PURE__ */ z("div", {
2421
+ className: "ld-settings-group",
2422
+ hidden: c !== "equal_daily",
2396
2423
  children: [
2397
- /* @__PURE__ */ R(m, {
2398
- xs: 12,
2399
- md: 6,
2400
- children: /* @__PURE__ */ R(y.Item, {
2401
- name: "startTime",
2402
- label: "Day starts",
2403
- rules: [{ required: !0 }],
2404
- children: /* @__PURE__ */ R(j, {
2405
- format: "HH:mm",
2406
- minuteStep: 5,
2407
- style: { width: "100%" }
2408
- })
2409
- })
2424
+ /* @__PURE__ */ R(Ft, {
2425
+ strong: !0,
2426
+ children: "Open-lead limit"
2410
2427
  }),
2411
- /* @__PURE__ */ R(m, {
2412
- xs: 12,
2413
- md: 6,
2414
- children: /* @__PURE__ */ R(y.Item, {
2415
- name: "cutoffTime",
2416
- label: "Initial cut-off",
2417
- rules: [{ required: !0 }],
2418
- extra: "Morning leads wait until this time.",
2419
- children: /* @__PURE__ */ R(j, {
2420
- format: "HH:mm",
2421
- minuteStep: 5,
2422
- style: { width: "100%" }
2423
- })
2424
- })
2428
+ /* @__PURE__ */ R(It, {
2429
+ type: "secondary",
2430
+ style: {
2431
+ margin: "4px 0 8px",
2432
+ fontSize: 13
2433
+ },
2434
+ children: "A counsellor who has this many untouched leads gets no new lead until they work some (a call, a follow-up, a status change or a save). Their leads are never moved. 0 = no limit."
2425
2435
  }),
2426
- /* @__PURE__ */ R(m, {
2427
- xs: 12,
2428
- md: 6,
2429
- children: /* @__PURE__ */ R(y.Item, {
2430
- name: "resetTime",
2431
- label: "Daily reset",
2432
- rules: [{ required: !0 }],
2433
- children: /* @__PURE__ */ R(j, {
2434
- format: "HH:mm",
2435
- minuteStep: 5,
2436
- style: { width: "100%" }
2436
+ /* @__PURE__ */ z(C, {
2437
+ gutter: 12,
2438
+ children: [/* @__PURE__ */ R(m, {
2439
+ xs: 24,
2440
+ md: 12,
2441
+ children: /* @__PURE__ */ R(y.Item, {
2442
+ name: "openLeadCap",
2443
+ label: "Untouched leads per counsellor",
2444
+ rules: [{ required: !0 }],
2445
+ children: /* @__PURE__ */ R(ne, {
2446
+ min: 0,
2447
+ max: 500,
2448
+ addonAfter: "leads",
2449
+ style: { width: "100%" }
2450
+ })
2437
2451
  })
2438
- })
2439
- }),
2440
- /* @__PURE__ */ R(m, {
2441
- xs: 12,
2442
- md: 6,
2443
- children: /* @__PURE__ */ R(y.Item, {
2444
- name: "timezone",
2445
- label: "Time zone",
2446
- rules: [{ required: !0 }],
2447
- children: /* @__PURE__ */ R(ie, { options: Jt.map((e) => ({
2448
- value: e,
2449
- label: e
2450
- })) })
2451
- })
2452
- }),
2453
- /* @__PURE__ */ R(m, {
2454
- xs: 24,
2455
- md: 12,
2456
- children: /* @__PURE__ */ R(y.Item, {
2457
- name: "holdUntilCutoff",
2458
- label: "Hold morning leads until the cut-off",
2459
- valuePropName: "checked",
2460
- extra: "Off: leads are shared as soon as they arrive.",
2461
- children: /* @__PURE__ */ R(ae, {})
2462
- })
2463
- }),
2464
- /* @__PURE__ */ R(m, {
2465
- xs: 24,
2466
- md: 12,
2467
- children: /* @__PURE__ */ R(y.Item, {
2468
- name: "onlineWindowMinutes",
2469
- label: "Offline after no activity for",
2470
- rules: [{ required: !0 }],
2471
- children: /* @__PURE__ */ R(ne, {
2472
- min: 2,
2473
- max: 120,
2474
- addonAfter: "minutes",
2475
- style: { width: "100%" }
2452
+ }), /* @__PURE__ */ R(m, {
2453
+ xs: 24,
2454
+ md: 12,
2455
+ children: /* @__PURE__ */ R(y.Item, {
2456
+ name: "capWindowDays",
2457
+ label: "Count untouched leads from",
2458
+ rules: [{ required: !0 }],
2459
+ children: /* @__PURE__ */ R(T, { options: [
2460
+ {
2461
+ value: 0,
2462
+ label: "Today"
2463
+ },
2464
+ {
2465
+ value: 1,
2466
+ label: "Today and yesterday"
2467
+ },
2468
+ {
2469
+ value: 2,
2470
+ label: "The last 3 days"
2471
+ },
2472
+ {
2473
+ value: 6,
2474
+ label: "The last 7 days"
2475
+ }
2476
+ ] })
2476
2477
  })
2477
- })
2478
+ })]
2478
2479
  })
2479
2480
  ]
2480
2481
  }),
2482
+ /* @__PURE__ */ R("div", {
2483
+ hidden: c !== "equal_daily",
2484
+ children: /* @__PURE__ */ z(C, {
2485
+ gutter: 12,
2486
+ children: [
2487
+ /* @__PURE__ */ R(m, {
2488
+ xs: 12,
2489
+ md: 6,
2490
+ children: /* @__PURE__ */ R(y.Item, {
2491
+ name: "startTime",
2492
+ label: "Day starts",
2493
+ rules: [{ required: !0 }],
2494
+ children: /* @__PURE__ */ R(M, {
2495
+ format: "HH:mm",
2496
+ minuteStep: 5,
2497
+ style: { width: "100%" }
2498
+ })
2499
+ })
2500
+ }),
2501
+ /* @__PURE__ */ R(m, {
2502
+ xs: 12,
2503
+ md: 6,
2504
+ children: /* @__PURE__ */ R(y.Item, {
2505
+ name: "cutoffTime",
2506
+ label: "Initial cut-off",
2507
+ rules: [{ required: !0 }],
2508
+ extra: "Morning leads wait until this time.",
2509
+ children: /* @__PURE__ */ R(M, {
2510
+ format: "HH:mm",
2511
+ minuteStep: 5,
2512
+ style: { width: "100%" }
2513
+ })
2514
+ })
2515
+ }),
2516
+ /* @__PURE__ */ R(m, {
2517
+ xs: 12,
2518
+ md: 6,
2519
+ children: /* @__PURE__ */ R(y.Item, {
2520
+ name: "resetTime",
2521
+ label: "Daily reset",
2522
+ rules: [{ required: !0 }],
2523
+ children: /* @__PURE__ */ R(M, {
2524
+ format: "HH:mm",
2525
+ minuteStep: 5,
2526
+ style: { width: "100%" }
2527
+ })
2528
+ })
2529
+ }),
2530
+ /* @__PURE__ */ R(m, {
2531
+ xs: 12,
2532
+ md: 6,
2533
+ children: /* @__PURE__ */ R(y.Item, {
2534
+ name: "timezone",
2535
+ label: "Time zone",
2536
+ rules: [{ required: !0 }],
2537
+ children: /* @__PURE__ */ R(T, { options: Jt.map((e) => ({
2538
+ value: e,
2539
+ label: e
2540
+ })) })
2541
+ })
2542
+ }),
2543
+ /* @__PURE__ */ R(m, {
2544
+ xs: 24,
2545
+ md: 12,
2546
+ children: /* @__PURE__ */ R(y.Item, {
2547
+ name: "holdUntilCutoff",
2548
+ label: "Hold morning leads until the cut-off",
2549
+ valuePropName: "checked",
2550
+ extra: "Off (recommended): leads go to whoever is online as they arrive; the open-lead limit spreads the morning backlog.",
2551
+ children: /* @__PURE__ */ R(O, {})
2552
+ })
2553
+ }),
2554
+ /* @__PURE__ */ R(m, {
2555
+ xs: 24,
2556
+ md: 12,
2557
+ children: /* @__PURE__ */ R(y.Item, {
2558
+ name: "onlineWindowMinutes",
2559
+ label: "Offline after no activity for",
2560
+ rules: [{ required: !0 }],
2561
+ children: /* @__PURE__ */ R(ne, {
2562
+ min: 2,
2563
+ max: 120,
2564
+ addonAfter: "minutes",
2565
+ style: { width: "100%" }
2566
+ })
2567
+ })
2568
+ })
2569
+ ]
2570
+ })
2571
+ }),
2481
2572
  e ? /* @__PURE__ */ R(f, {
2482
2573
  type: "primary",
2483
2574
  loading: i,
@@ -2495,9 +2586,9 @@ function Yt({ canEdit: e = !1 }) {
2495
2586
  onOk: async () => {
2496
2587
  a(!0);
2497
2588
  try {
2498
- await Ve(n), P.success("Distribution settings saved"), r();
2589
+ await Ve(n), F.success("Distribution settings saved"), r();
2499
2590
  } catch (e) {
2500
- P.error(X(e));
2591
+ F.error(X(e));
2501
2592
  } finally {
2502
2593
  a(!1);
2503
2594
  }
@@ -2514,7 +2605,7 @@ function Yt({ canEdit: e = !1 }) {
2514
2605
  }
2515
2606
  //#endregion
2516
2607
  //#region src/pages/Modules/Admin/FacebookCourseMappingsSection.jsx
2517
- var Xt = /* @__PURE__ */ e({ default: () => un }), { Text: Zt, Title: Qt } = N, $t = 10, en = "—", tn = "You don't have permission to do this.", nn = "This could not be loaded. Press Try again first.";
2608
+ var Xt = /* @__PURE__ */ e({ default: () => un }), { Text: Zt, Title: Qt } = P, $t = 10, en = "—", tn = "You don't have permission to do this.", nn = "This could not be loaded. Press Try again first.";
2518
2609
  function rn(e, t) {
2519
2610
  return Array.isArray(e) ? e : Array.isArray(e?.[t]) ? e[t] : [];
2520
2611
  }
@@ -2558,7 +2649,7 @@ function ln({ distribution: e }) {
2558
2649
  let n = t.map((e) => e.name || "Unnamed counsellor"), r = yt(e);
2559
2650
  return /* @__PURE__ */ z("div", {
2560
2651
  className: "fb-who",
2561
- children: [/* @__PURE__ */ R(M, {
2652
+ children: [/* @__PURE__ */ R(N, {
2562
2653
  title: n.join(", "),
2563
2654
  trigger: ["hover", "focus"],
2564
2655
  children: /* @__PURE__ */ z("span", {
@@ -2583,14 +2674,14 @@ function ln({ distribution: e }) {
2583
2674
  });
2584
2675
  }
2585
2676
  function un() {
2586
- let [e, t] = u(sn), [n, r] = u(cn), [i, s] = u(!0), [d, p] = u(null), [m, h] = u("forms"), [g, _] = u(""), [y, ne] = u("all"), [b, x] = u(null), [S, C] = u(1), [w, E] = u(""), [D, ae] = u(null), [A, j] = u(!1), [M, N] = u(0), oe = l(0), se = l(0), ce = l({
2677
+ let [e, t] = u(sn), [n, r] = u(cn), [i, s] = u(!0), [d, p] = u(null), [m, h] = u("forms"), [g, _] = u(""), [y, ne] = u("all"), [b, x] = u(null), [S, C] = u(1), [w, E] = u(""), [D, O] = u(null), [j, M] = u(!1), [N, P] = u(0), ae = l(0), oe = l(0), se = l({
2587
2678
  element: null,
2588
2679
  formId: ""
2589
- }), ue = l(null), L = a(async () => {
2590
- let e = ++oe.current;
2680
+ }), le = l(null), L = a(async () => {
2681
+ let e = ++ae.current;
2591
2682
  s(!0);
2592
2683
  let n = await Promise.allSettled(on.map((e) => an[e].load()));
2593
- e === oe.current && (t((e) => {
2684
+ e === ae.current && (t((e) => {
2594
2685
  let t = { ...e };
2595
2686
  return n.forEach((e, n) => {
2596
2687
  e.status === "fulfilled" && (t[on[n]] = an[on[n]].read(e.value));
@@ -2610,7 +2701,7 @@ function un() {
2610
2701
  };
2611
2702
  }), t;
2612
2703
  }), s(!1));
2613
- }, []), he = a(() => (N((e) => e + 1), L()), [L]);
2704
+ }, []), he = a(() => (P((e) => e + 1), L()), [L]);
2614
2705
  o(() => {
2615
2706
  L();
2616
2707
  }, [L]), o(() => {
@@ -2621,7 +2712,7 @@ function un() {
2621
2712
  e = !1;
2622
2713
  };
2623
2714
  }, []);
2624
- let { alerts: B, alertsOk: _e, failedCount: V } = nt({ refreshKey: M }), H = {
2715
+ let { alerts: B, alertsOk: _e, failedCount: V } = nt({ refreshKey: N }), H = {
2625
2716
  add: d?.permissions?.canAdd !== !1,
2626
2717
  edit: d?.permissions?.canEdit !== !1,
2627
2718
  remove: d?.permissions?.canDelete !== !1
@@ -2740,31 +2831,31 @@ function un() {
2740
2831
  return He(i), i;
2741
2832
  }, We = async (e, t, n = null) => {
2742
2833
  if (!Z) {
2743
- ce.current = {
2834
+ se.current = {
2744
2835
  element: n,
2745
2836
  formId: e.formId
2746
2837
  }, E(e.formId);
2747
2838
  try {
2748
- await Ue(), se.current += 1, ae({
2749
- token: se.current,
2839
+ await Ue(), oe.current += 1, O({
2840
+ token: oe.current,
2750
2841
  row: e,
2751
2842
  section: t
2752
- }), j(!0);
2843
+ }), M(!0);
2753
2844
  } catch (e) {
2754
- P.error(X(e, "Could not open this form. Please try again."));
2845
+ F.error(X(e, "Could not open this form. Please try again."));
2755
2846
  } finally {
2756
2847
  E("");
2757
2848
  }
2758
2849
  }
2759
2850
  }, Ge = () => {
2760
- let { element: e, formId: t } = ce.current;
2851
+ let { element: e, formId: t } = se.current;
2761
2852
  if (e?.isConnected) {
2762
2853
  e.focus();
2763
2854
  return;
2764
2855
  }
2765
- [...ue.current?.querySelectorAll("[data-form-menu]") || []].find((e) => e.dataset.formMenu === t)?.focus();
2856
+ [...le.current?.querySelectorAll("[data-form-menu]") || []].find((e) => e.dataset.formMenu === t)?.focus();
2766
2857
  }, Ke = () => {
2767
- N((e) => e + 1), L();
2858
+ P((e) => e + 1), L();
2768
2859
  }, qe = (e) => {
2769
2860
  re.confirm({
2770
2861
  title: "Remove course mapping?",
@@ -2781,9 +2872,9 @@ function un() {
2781
2872
  onOk: async () => {
2782
2873
  E(e.formId);
2783
2874
  try {
2784
- await Se(e.formId), P.success("Course mapping removed"), Ke();
2875
+ await Se(e.formId), F.success("Course mapping removed"), Ke();
2785
2876
  } catch (e) {
2786
- throw P.error(X(e, "Could not remove the mapping. Please try again.")), e;
2877
+ throw F.error(X(e, "Could not remove the mapping. Please try again.")), e;
2787
2878
  } finally {
2788
2879
  E("");
2789
2880
  }
@@ -2805,9 +2896,9 @@ function un() {
2805
2896
  E(e.formId);
2806
2897
  try {
2807
2898
  if ((await Oe(e.formId))?.deleted === !1) throw Error("This has already been removed. Refresh and try again.");
2808
- P.success("Counsellor distribution removed"), Ke();
2899
+ F.success("Counsellor distribution removed"), Ke();
2809
2900
  } catch (e) {
2810
- throw P.error(X(e, "Could not remove the distribution. Please try again.")), e;
2901
+ throw F.error(X(e, "Could not remove the distribution. Please try again.")), e;
2811
2902
  } finally {
2812
2903
  E("");
2813
2904
  }
@@ -2819,14 +2910,14 @@ function un() {
2819
2910
  items: [
2820
2911
  {
2821
2912
  key: "mapping",
2822
- icon: e.mapping ? /* @__PURE__ */ R(de, {}) : /* @__PURE__ */ R(I, {}),
2913
+ icon: e.mapping ? /* @__PURE__ */ R(ue, {}) : /* @__PURE__ */ R(de, {}),
2823
2914
  label: e.mapping ? "Edit mapping" : "Set up mapping",
2824
2915
  disabled: !!n,
2825
2916
  title: n
2826
2917
  },
2827
2918
  ...e.mapping && H.remove ? [{
2828
2919
  key: "removeMapping",
2829
- icon: /* @__PURE__ */ R(le, {}),
2920
+ icon: /* @__PURE__ */ R(ce, {}),
2830
2921
  label: "Remove mapping",
2831
2922
  danger: !0,
2832
2923
  disabled: Z
@@ -2841,7 +2932,7 @@ function un() {
2841
2932
  },
2842
2933
  ...e.distribution && H.remove ? [{
2843
2934
  key: "removeDistribution",
2844
- icon: /* @__PURE__ */ R(le, {}),
2935
+ icon: /* @__PURE__ */ R(ce, {}),
2845
2936
  label: "Remove distribution",
2846
2937
  danger: !0,
2847
2938
  disabled: Z
@@ -2932,7 +3023,7 @@ function un() {
2932
3023
  "aria-label": `Actions for ${t.formName}`,
2933
3024
  "data-form-menu": t.formId,
2934
3025
  loading: w === t.formId,
2935
- icon: /* @__PURE__ */ R(F, {})
3026
+ icon: /* @__PURE__ */ R(I, {})
2936
3027
  })
2937
3028
  })
2938
3029
  })
@@ -2976,7 +3067,7 @@ function un() {
2976
3067
  className: "fb-field-label",
2977
3068
  htmlFor: "fb-forms-show",
2978
3069
  children: "Show"
2979
- }), /* @__PURE__ */ R(ie, {
3070
+ }), /* @__PURE__ */ R(T, {
2980
3071
  id: "fb-forms-show",
2981
3072
  className: "fb-show-select",
2982
3073
  value: y,
@@ -3006,11 +3097,11 @@ function un() {
3006
3097
  children: "Show all forms"
3007
3098
  })]
3008
3099
  }),
3009
- Q ? /* @__PURE__ */ R(T, {
3100
+ Q ? /* @__PURE__ */ R(ie, {
3010
3101
  active: !0,
3011
3102
  title: !1,
3012
3103
  paragraph: { rows: 6 }
3013
- }) : /* @__PURE__ */ R(O, {
3104
+ }) : /* @__PURE__ */ R(k, {
3014
3105
  rowKey: "formId",
3015
3106
  className: `fb-forms-table${Z ? "" : " fb-forms-table--open"}`,
3016
3107
  columns: Ze,
@@ -3036,7 +3127,7 @@ function un() {
3036
3127
  ]
3037
3128
  }), ot = {
3038
3129
  rows: ke,
3039
- refreshKey: M
3130
+ refreshKey: N
3040
3131
  }, $ = [
3041
3132
  {
3042
3133
  key: "forms",
@@ -3049,7 +3140,7 @@ function un() {
3049
3140
  children: /* @__PURE__ */ R(Mt, {
3050
3141
  ...ot,
3051
3142
  canEdit: H.edit,
3052
- onChanged: () => N((e) => e + 1)
3143
+ onChanged: () => P((e) => e + 1)
3053
3144
  })
3054
3145
  },
3055
3146
  {
@@ -3066,7 +3157,7 @@ function un() {
3066
3157
  limits: d?.limits,
3067
3158
  reasonTypes: d?.reasonTypes,
3068
3159
  canEdit: H.edit,
3069
- onChanged: () => N((e) => e + 1)
3160
+ onChanged: () => P((e) => e + 1)
3070
3161
  })
3071
3162
  },
3072
3163
  {
@@ -3097,7 +3188,7 @@ function un() {
3097
3188
  ], st = D ? ke.find((e) => e.formId === D.row.formId) || D.row : null;
3098
3189
  return /* @__PURE__ */ z("div", {
3099
3190
  className: "facebook-course-mapping",
3100
- ref: ue,
3191
+ ref: le,
3101
3192
  children: [
3102
3193
  /* @__PURE__ */ z("div", {
3103
3194
  className: "admin-section-head fb-head",
@@ -3141,7 +3232,7 @@ function un() {
3141
3232
  onViewLeads: () => h("attention"),
3142
3233
  onShowForms: Fe
3143
3234
  }),
3144
- /* @__PURE__ */ R(k, {
3235
+ /* @__PURE__ */ R(A, {
3145
3236
  size: "small",
3146
3237
  activeKey: m,
3147
3238
  onChange: h,
@@ -3149,7 +3240,7 @@ function un() {
3149
3240
  className: "fb-tabs"
3150
3241
  }),
3151
3242
  D && /* @__PURE__ */ R(Ot, {
3152
- open: A,
3243
+ open: j,
3153
3244
  row: st,
3154
3245
  section: D.section,
3155
3246
  mapping: Ee.get(D.row.formId),
@@ -3161,7 +3252,7 @@ function un() {
3161
3252
  canAdd: H.add,
3162
3253
  canEdit: H.edit
3163
3254
  },
3164
- onClose: () => j(!1),
3255
+ onClose: () => M(!1),
3165
3256
  onSaved: Ke,
3166
3257
  onAfterClose: Ge,
3167
3258
  onReload: async () => {
@@ -3178,4 +3269,4 @@ function un() {
3178
3269
  //#endregion
3179
3270
  export { ge as a, ve as i, Xt as n, Be as r, un as t };
3180
3271
 
3181
- //# sourceMappingURL=FacebookCourseMappingsSection-C49voxq7.js.map
3272
+ //# sourceMappingURL=FacebookCourseMappingsSection-kmMbflwV.js.map