@alfadocs/ui-kit 1.10.1 → 1.12.4

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.
Files changed (118) hide show
  1. package/dist/_chunks/{actions-cell-renderer-xfSYiTXQ.js → actions-cell-renderer-BCEjn3-f.js} +2 -2
  2. package/dist/_chunks/{anamnesis-summary-rows-d44s_whc.js → anamnesis-summary-rows-BfhxWPO3.js} +1421 -1418
  3. package/dist/_chunks/appointment-timeline-DCn0Jx55.js +403 -0
  4. package/dist/_chunks/{balance-badge-cell-C_Qz76x7.js → balance-badge-cell-BrlikHfT.js} +317 -290
  5. package/dist/_chunks/booking-CBHKdsZl.js +2906 -0
  6. package/dist/_chunks/{chart-Bkr1Sh4o.js → chart-C6eHTxkO.js} +2 -2
  7. package/dist/_chunks/{contact-profile-card-CE9OJKcl.js → contact-profile-card-BMIBr5s9.js} +104 -125
  8. package/dist/_chunks/{control-room-rail-Cj2iX9h_.js → control-room-rail-iO_BCaq1.js} +2 -2
  9. package/dist/_chunks/{editable-currency-cell-renderer-zLf_bXvL.js → editable-currency-cell-renderer-B7TVZ5ZJ.js} +2 -2
  10. package/dist/_chunks/{face-scheme-BfDi4YkW.js → face-scheme-CZaKm6fG.js} +2 -2
  11. package/dist/_chunks/{file-manager-Df6hyUYg.js → file-manager-Moc7sUFj.js} +3 -3
  12. package/dist/_chunks/format-price-DNqXPa_q.js +61 -0
  13. package/dist/_chunks/{header-settings-CVC_davE.js → header-settings-J-ZCAfir.js} +2 -2
  14. package/dist/_chunks/{icon-button-group-D6SVMteH.js → icon-button-group-VCCod3Hz.js} +154 -145
  15. package/dist/_chunks/{link-cell-renderer-Cp2MSlJl.js → link-cell-renderer-CenJx-_7.js} +197 -181
  16. package/dist/_chunks/{marketplace-app-shell-Chfdia7m.js → marketplace-app-shell-DDQXQ8hX.js} +2 -2
  17. package/dist/_chunks/{notes-panel-e9cJWVRg.js → notes-panel-CymneXtl.js} +93 -91
  18. package/dist/_chunks/{practice-results-BEsAdW-B.js → practice-results-D7ygCj_W.js} +333 -291
  19. package/dist/_chunks/{signature-request-CW30B77U.js → signature-request-DVDTKLjM.js} +2 -2
  20. package/dist/_chunks/{stepper-accordion-BeVMZPuG.js → stepper-accordion-DmVykr5F.js} +91 -88
  21. package/dist/_chunks/{theme-toggle-DuMhQNFS.js → theme-toggle-uEwoKjl3.js} +2 -2
  22. package/dist/_chunks/{tool-rail-CHyUmulN.js → tool-rail-8Scslq3X.js} +2 -2
  23. package/dist/_chunks/{whatsapp-button-Ca9towA4.js → whatsapp-button-CuFIHJzG.js} +27 -19
  24. package/dist/agent-catalog.json +12 -5
  25. package/dist/agent-i18n/en.json +4 -3
  26. package/dist/components/_shared/format-price.d.ts +21 -0
  27. package/dist/components/_shared/index.d.ts +1 -0
  28. package/dist/components/_shared/stepper.d.ts +28 -2
  29. package/dist/components/appointment-card/appointment-card.d.ts +1 -1
  30. package/dist/components/appointment-timeline/appointment-timeline.d.ts +8 -0
  31. package/dist/components/appointment-timeline/index.js +1 -1
  32. package/dist/components/booking/booking-types.d.ts +15 -2
  33. package/dist/components/booking/index.js +1 -1
  34. package/dist/components/chart/index.js +1 -1
  35. package/dist/components/contact-profile-card/index.js +1 -1
  36. package/dist/components/control-room-rail/index.js +1 -1
  37. package/dist/components/data-table/filters/date-range-filter.d.ts +22 -0
  38. package/dist/components/data-table/index.js +3 -3
  39. package/dist/components/face-scheme/index.js +1 -1
  40. package/dist/components/file-manager/index.js +1 -1
  41. package/dist/components/header-settings/index.js +1 -1
  42. package/dist/components/icon-button-group/index.js +1 -1
  43. package/dist/components/notes-panel/index.js +1 -1
  44. package/dist/components/notes-panel/notes-panel.d.ts +6 -0
  45. package/dist/components/patient-table/index.js +1 -1
  46. package/dist/components/practice-results/index.js +1 -1
  47. package/dist/components/practice-results/practice-results.d.ts +18 -0
  48. package/dist/components/stepper-accordion/index.js +1 -1
  49. package/dist/components/theme-toggle/index.js +1 -1
  50. package/dist/components/tool-rail/index.js +1 -1
  51. package/dist/components/tool-rail/tool-rail.d.ts +1 -1
  52. package/dist/components/whatsapp-button/index.js +1 -1
  53. package/dist/host-compat.css +7 -1
  54. package/dist/i18n/locales/ar.d.ts +4 -0
  55. package/dist/i18n/locales/ar.js +5 -1
  56. package/dist/i18n/locales/de.d.ts +5 -1
  57. package/dist/i18n/locales/de.js +6 -2
  58. package/dist/i18n/locales/el.d.ts +4 -0
  59. package/dist/i18n/locales/el.js +5 -1
  60. package/dist/i18n/locales/en.d.ts +4 -0
  61. package/dist/i18n/locales/en.js +5 -1
  62. package/dist/i18n/locales/es.d.ts +5 -1
  63. package/dist/i18n/locales/es.js +6 -2
  64. package/dist/i18n/locales/fr.d.ts +5 -1
  65. package/dist/i18n/locales/fr.js +6 -2
  66. package/dist/i18n/locales/hi.d.ts +4 -0
  67. package/dist/i18n/locales/hi.js +5 -1
  68. package/dist/i18n/locales/it.d.ts +4 -0
  69. package/dist/i18n/locales/it.js +5 -1
  70. package/dist/i18n/locales/ja.d.ts +4 -0
  71. package/dist/i18n/locales/ja.js +5 -1
  72. package/dist/i18n/locales/nl.d.ts +5 -1
  73. package/dist/i18n/locales/nl.js +6 -2
  74. package/dist/i18n/locales/pl.d.ts +4 -0
  75. package/dist/i18n/locales/pl.js +5 -1
  76. package/dist/i18n/locales/pt.d.ts +5 -1
  77. package/dist/i18n/locales/pt.js +6 -2
  78. package/dist/i18n/locales/ro.d.ts +4 -0
  79. package/dist/i18n/locales/ro.js +5 -1
  80. package/dist/i18n/locales/ru.d.ts +4 -0
  81. package/dist/i18n/locales/ru.js +5 -1
  82. package/dist/i18n/locales/sq.d.ts +4 -0
  83. package/dist/i18n/locales/sq.js +5 -1
  84. package/dist/i18n/locales/sv.d.ts +4 -0
  85. package/dist/i18n/locales/sv.js +5 -1
  86. package/dist/i18n/locales/tr.d.ts +4 -0
  87. package/dist/i18n/locales/tr.js +5 -1
  88. package/dist/i18n/locales/zh.d.ts +4 -0
  89. package/dist/i18n/locales/zh.js +5 -1
  90. package/dist/index.js +20 -20
  91. package/dist/locales/ar.json +5 -1
  92. package/dist/locales/de.json +6 -2
  93. package/dist/locales/el.json +5 -1
  94. package/dist/locales/en.json +5 -1
  95. package/dist/locales/es.json +6 -2
  96. package/dist/locales/fr.json +6 -2
  97. package/dist/locales/hi.json +5 -1
  98. package/dist/locales/it.json +5 -1
  99. package/dist/locales/ja.json +5 -1
  100. package/dist/locales/nl.json +6 -2
  101. package/dist/locales/pl.json +5 -1
  102. package/dist/locales/pt.json +6 -2
  103. package/dist/locales/ro.json +5 -1
  104. package/dist/locales/ru.json +5 -1
  105. package/dist/locales/sq.json +5 -1
  106. package/dist/locales/sv.json +5 -1
  107. package/dist/locales/tr.json +5 -1
  108. package/dist/locales/zh.json +5 -1
  109. package/dist/patterns/anamnesis/anamnesis-config.d.ts +18 -7
  110. package/dist/patterns/anamnesis/anamnesis-types.d.ts +8 -0
  111. package/dist/patterns/anamnesis/index.js +1 -1
  112. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  113. package/dist/patterns/signature-request/index.js +1 -1
  114. package/dist/tokens.css +1 -1
  115. package/package.json +1 -1
  116. package/dist/_chunks/appointment-timeline-0mwtpErq.js +0 -388
  117. package/dist/_chunks/booking-DHkKcUIl.js +0 -2713
  118. package/dist/_chunks/languages-CGLX6Qpe.js +0 -19
@@ -1,28 +1,28 @@
1
- import { jsx as v, jsxs as k } from "react/jsx-runtime";
2
- import { createElement as E, useRef as G, useEffect as te, useCallback as j, forwardRef as he, useState as ne, useImperativeHandle as pe, useMemo as Q } from "react";
1
+ import { jsx as v, jsxs as M } from "react/jsx-runtime";
2
+ import { createElement as O, useRef as k, useEffect as ne, useCallback as j, forwardRef as pe, useState as ae, useImperativeHandle as be, useMemo as Q } from "react";
3
3
  import { useTranslation as K } from "react-i18next";
4
- import { a as g, T as C, A as be, d as ie, D as S, e as ge } from "./actions-cell-renderer-xfSYiTXQ.js";
5
- import { S as Ce } from "./select-BW5ecXlX.js";
6
- import { u as ve } from "./registry-DvAUVLHh.js";
7
- import { I as Te, L as we, b as _, a as z, c as H, N as $, d as R, S as I, T as ae, D as q, g as Ne, f as Fe, U as Re, e as Ie } from "./link-cell-renderer-Cp2MSlJl.js";
4
+ import { a as g, T as C, A as ge, d as ie, D as S, e as Ce } from "./actions-cell-renderer-BCEjn3-f.js";
5
+ import { S as ve } from "./select-BW5ecXlX.js";
6
+ import { u as Te } from "./registry-DvAUVLHh.js";
7
+ import { I as we, L as Ne, b as _, a as z, c as H, N as $, d as R, S as I, T as re, D as q, g as Fe, f as Re, U as Ie, e as ye } from "./link-cell-renderer-CenJx-_7.js";
8
8
  import { T as Pe } from "./transaction-chip-DJCstquX.js";
9
- import { B as re } from "./badge-sTusUqZD.js";
10
- import { c as ye } from "./index-D2ZczOXr.js";
11
- import { T as Se } from "./timestamp-BV2lC-wV.js";
12
- import { C as We } from "./calendar-clock-hbObjfGY.js";
13
- import { E as Ae } from "./eye-BjhN2nYf.js";
14
- import { P as De } from "./pencil-B1sKKyuT.js";
15
- import { M as Be } from "./mail-BqXVF2zH.js";
9
+ import { B as le } from "./badge-sTusUqZD.js";
10
+ import { c as Se } from "./index-D2ZczOXr.js";
11
+ import { T as We } from "./timestamp-BV2lC-wV.js";
12
+ import { C as Ae } from "./calendar-clock-hbObjfGY.js";
13
+ import { E as De } from "./eye-BjhN2nYf.js";
14
+ import { P as Be } from "./pencil-B1sKKyuT.js";
15
+ import { M as Ve } from "./mail-BqXVF2zH.js";
16
16
  import { M as xe } from "./message-square-Bye4ATvx.js";
17
- import { U as Ve } from "./users-BjS_Gg1E.js";
17
+ import { U as Ee } from "./users-BjS_Gg1E.js";
18
18
  import { T as Oe } from "./trash-2-uumy3fy1.js";
19
19
  function Z(e) {
20
- const { value: n, positiveState: s, showLabel: o = !0 } = e, l = typeof n == "number" && Number.isFinite(n) ? n : null;
20
+ const { value: a, positiveState: o, showLabel: s = !0 } = e, l = typeof a == "number" && Number.isFinite(a) ? a : null;
21
21
  if (l === null) return null;
22
- const r = l > 0 ? s : "settled";
23
- return /* @__PURE__ */ v(Pe, { state: r, amount: l / 100, showLabel: o });
22
+ const r = l > 0 ? o : "settled";
23
+ return /* @__PURE__ */ v(Pe, { state: r, amount: l / 100, showLabel: s });
24
24
  }
25
- const Ee = {
25
+ const Ge = {
26
26
  accepted: "success",
27
27
  estimate: "info",
28
28
  none: "neutral"
@@ -31,12 +31,12 @@ function Me(e) {
31
31
  return e === "accepted" || e === "estimate" || e === "none";
32
32
  }
33
33
  function ke(e) {
34
- const { t: n } = K("ui"), { data: s, value: o, size: l = "sm" } = e, r = (s == null ? void 0 : s.carePlanStatus) ?? o;
34
+ const { t: a } = K("ui"), { data: o, value: s, size: l = "sm" } = e, r = (o == null ? void 0 : o.carePlanStatus) ?? s;
35
35
  if (!Me(r)) return null;
36
- const c = Ee[r];
37
- return /* @__PURE__ */ v(re, { variant: c, withDot: !0, size: l, children: n(`patientTable.carePlanStatus.${r}`) });
36
+ const c = Ge[r];
37
+ return /* @__PURE__ */ v(le, { variant: c, withDot: !0, size: l, children: a(`patientTable.carePlanStatus.${r}`) });
38
38
  }
39
- const ee = ye(
39
+ const ee = Se(
40
40
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:whitespace-nowrap",
41
41
  {
42
42
  variants: {
@@ -51,91 +51,91 @@ const ee = ye(
51
51
  },
52
52
  defaultVariants: { tone: "default" }
53
53
  }
54
- ), Ge = 1440 * 60 * 1e3, Le = 7;
55
- function Ue(e) {
54
+ ), Ue = 1440 * 60 * 1e3, Le = 7;
55
+ function _e(e) {
56
56
  if (e == null || e === "") return null;
57
- const n = e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(String(e)).getTime();
58
- return Number.isNaN(n) ? null : n;
57
+ const a = e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(String(e)).getTime();
58
+ return Number.isNaN(a) ? null : a;
59
59
  }
60
- function _e(e, n) {
61
- if (n <= 0) return "default";
62
- const s = e - Date.now();
63
- return s < 0 ? "default" : s <= n * Ge ? "soon" : "default";
60
+ function ze(e, a) {
61
+ if (a <= 0) return "default";
62
+ const o = e - Date.now();
63
+ return o < 0 ? "default" : o <= a * Ue ? "soon" : "default";
64
64
  }
65
- function ze(e) {
66
- const { t: n } = K("ui"), { data: s, value: o, soonWithinDays: l = Le } = e, r = Ue((s == null ? void 0 : s.nextAppointment) ?? o);
65
+ function He(e) {
66
+ const { t: a } = K("ui"), { data: o, value: s, soonWithinDays: l = Le } = e, r = _e((o == null ? void 0 : o.nextAppointment) ?? s);
67
67
  if (r === null)
68
- return /* @__PURE__ */ v("span", { className: ee({ tone: "empty" }), children: n("patientTable.nextAppointment.none") });
69
- const c = _e(r, l);
70
- return /* @__PURE__ */ k("span", { className: ee({ tone: c }), children: [
71
- c === "soon" ? /* @__PURE__ */ v(We, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }) : null,
72
- /* @__PURE__ */ v(Se, { value: r, format: "relative", shape: "bare" })
68
+ return /* @__PURE__ */ v("span", { className: ee({ tone: "empty" }), children: a("patientTable.nextAppointment.none") });
69
+ const c = ze(r, l);
70
+ return /* @__PURE__ */ M("span", { className: ee({ tone: c }), children: [
71
+ c === "soon" ? /* @__PURE__ */ v(Ae, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }) : null,
72
+ /* @__PURE__ */ v(We, { value: r, format: "relative", shape: "bare" })
73
73
  ] });
74
74
  }
75
- function le(e) {
75
+ function oe(e) {
76
76
  return e.responsiveTier;
77
77
  }
78
- const He = 6;
79
- function $e(e, n) {
80
- const s = (l) => (r) => {
81
- n == null || n(l, r);
82
- }, o = (l, r) => ({
78
+ const $e = 6;
79
+ function je(e, a) {
80
+ const o = (l) => (r) => {
81
+ a == null || a(l, r);
82
+ }, s = (l, r) => ({
83
83
  icon: l.icon,
84
84
  label: l.label,
85
85
  variant: l.variant,
86
- onClick: s(l),
86
+ onClick: o(l),
87
87
  ...r
88
88
  });
89
89
  return [
90
- o(
90
+ s(
91
91
  {
92
92
  id: "show",
93
93
  label: e("patientTable.actions.show"),
94
- icon: E(Ae, { "aria-hidden": "true" })
94
+ icon: O(De, { "aria-hidden": "true" })
95
95
  },
96
96
  {}
97
97
  ),
98
- o(
98
+ s(
99
99
  {
100
100
  id: "edit",
101
101
  label: e("patientTable.actions.edit"),
102
- icon: E(De, { "aria-hidden": "true" })
102
+ icon: O(Be, { "aria-hidden": "true" })
103
103
  },
104
104
  {}
105
105
  ),
106
- o(
106
+ s(
107
107
  {
108
108
  id: "sendEmailReminder",
109
109
  label: e("patientTable.actions.sendEmailReminder"),
110
- icon: E(Be, { "aria-hidden": "true" })
110
+ icon: O(Ve, { "aria-hidden": "true" })
111
111
  },
112
112
  // Hidden when the patient has email contact disabled (spec).
113
113
  { hidden: (l) => !l.emailEnabled }
114
114
  ),
115
- o(
115
+ s(
116
116
  {
117
117
  id: "sendSmsReminder",
118
118
  label: e("patientTable.actions.sendSmsReminder"),
119
- icon: E(xe, { "aria-hidden": "true" })
119
+ icon: O(xe, { "aria-hidden": "true" })
120
120
  },
121
121
  // Hidden when no phone number is SMS-enabled (spec).
122
122
  {
123
123
  hidden: (l) => !(l.phoneNumbers ?? []).some((r) => r.smsEnabled)
124
124
  }
125
125
  ),
126
- o(
126
+ s(
127
127
  {
128
128
  id: "reassign",
129
129
  label: e("patientTable.actions.reassign"),
130
- icon: E(Ve, { "aria-hidden": "true" })
130
+ icon: O(Ee, { "aria-hidden": "true" })
131
131
  },
132
132
  {}
133
133
  ),
134
- o(
134
+ s(
135
135
  {
136
136
  id: "delete",
137
137
  label: e("patientTable.actions.delete"),
138
- icon: E(Oe, { "aria-hidden": "true" }),
138
+ icon: O(Oe, { "aria-hidden": "true" }),
139
139
  variant: "destructive"
140
140
  },
141
141
  // Disabled (with a reason) for archived patients — the row model's
@@ -147,30 +147,40 @@ function $e(e, n) {
147
147
  )
148
148
  ];
149
149
  }
150
- const je = () => !1, A = "✓", W = "—";
151
- function Ke(e) {
152
- if (!e) return null;
153
- const n = new Date(e), s = n.getTime();
154
- if (Number.isNaN(s)) return null;
155
- const o = /* @__PURE__ */ new Date();
156
- let l = o.getFullYear() - n.getFullYear();
157
- const r = o.getMonth() - n.getMonth();
158
- return (r < 0 || r === 0 && o.getDate() < n.getDate()) && (l -= 1), l >= 0 ? l : null;
150
+ const Ke = () => !1, A = "✓", W = "—";
151
+ function te(e) {
152
+ if (!e) return "";
153
+ const a = e.toUpperCase();
154
+ try {
155
+ const o = typeof document < "u" && document.documentElement.lang || "en";
156
+ return new Intl.DisplayNames([o], { type: "region" }).of(a) ?? a;
157
+ } catch {
158
+ return a;
159
+ }
159
160
  }
160
161
  function Ye(e) {
161
- return e.map((n) => {
162
+ if (!e) return null;
163
+ const a = new Date(e), o = a.getTime();
164
+ if (Number.isNaN(o)) return null;
165
+ const s = /* @__PURE__ */ new Date();
166
+ let l = s.getFullYear() - a.getFullYear();
167
+ const r = s.getMonth() - a.getMonth();
168
+ return (r < 0 || r === 0 && s.getDate() < a.getDate()) && (l -= 1), l >= 0 ? l : null;
169
+ }
170
+ function qe(e) {
171
+ return e.map((a) => {
162
172
  var l;
163
- const o = {
164
- colId: `custom:${n.fieldName}`,
165
- headerName: n.label,
173
+ const s = {
174
+ colId: `custom:${a.fieldName}`,
175
+ headerName: a.label,
166
176
  hide: !0
167
177
  // No tier — custom fields are opt-in via ColumnToggle only.
168
178
  };
169
- return n.type === "checkbox" ? {
170
- ...o,
179
+ return a.type === "checkbox" ? {
180
+ ...s,
171
181
  valueGetter: (r) => {
172
182
  var c, h;
173
- return ((h = (c = r.data) == null ? void 0 : c.customFields) == null ? void 0 : h[n.fieldName]) === !0;
183
+ return ((h = (c = r.data) == null ? void 0 : c.customFields) == null ? void 0 : h[a.fieldName]) === !0;
174
184
  },
175
185
  valueFormatter: (r) => r.value === !0 ? A : W,
176
186
  filter: I,
@@ -183,18 +193,18 @@ function Ye(e) {
183
193
  },
184
194
  minWidth: 110,
185
195
  width: 130
186
- } : n.type === "dropdown" ? {
187
- ...o,
196
+ } : a.type === "dropdown" ? {
197
+ ...s,
188
198
  // TagListCellRenderer expects an array; wrap the single value.
189
199
  valueGetter: (r) => {
190
200
  var h, d;
191
- const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
201
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[a.fieldName];
192
202
  return typeof c == "string" && c ? [c] : [];
193
203
  },
194
- cellRenderer: ae,
204
+ cellRenderer: re,
195
205
  filterValueGetter: (r) => {
196
206
  var h, d;
197
- const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
207
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[a.fieldName];
198
208
  return typeof c == "string" ? c : "";
199
209
  },
200
210
  filter: I,
@@ -203,7 +213,7 @@ function Ye(e) {
203
213
  // Undefined (not []) when the field declares no options, so the
204
214
  // filter derives its choices from the rows. An empty array would
205
215
  // mean "this column has no facets" and leave the filter unusable.
206
- options: (l = n.options) == null ? void 0 : l.map((r) => ({
216
+ options: (l = a.options) == null ? void 0 : l.map((r) => ({
207
217
  value: r,
208
218
  label: r
209
219
  }))
@@ -212,10 +222,10 @@ function Ye(e) {
212
222
  minWidth: 130,
213
223
  width: 160
214
224
  } : {
215
- ...o,
225
+ ...s,
216
226
  valueGetter: (r) => {
217
227
  var h, d;
218
- const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[n.fieldName];
228
+ const c = (d = (h = r.data) == null ? void 0 : h.customFields) == null ? void 0 : d[a.fieldName];
219
229
  return typeof c == "string" ? c : "";
220
230
  },
221
231
  filter: C,
@@ -225,14 +235,14 @@ function Ye(e) {
225
235
  };
226
236
  });
227
237
  }
228
- function qe(e, n = {}) {
238
+ function Qe(e, a = {}) {
229
239
  const {
230
- hideDetails: s = !1,
231
- getActionsCompact: o = je,
240
+ hideDetails: o = !1,
241
+ getActionsCompact: s = Ke,
232
242
  onRowAction: l,
233
243
  identityHref: r,
234
244
  customFields: c = []
235
- } = n, h = $e(e, l), d = {
245
+ } = a, h = je(e, l), d = {
236
246
  m: e("patientTable.gender.m"),
237
247
  f: e("patientTable.gender.f"),
238
248
  x: e("patientTable.gender.x")
@@ -244,7 +254,7 @@ function qe(e, n = {}) {
244
254
  [u.yes]: "success",
245
255
  [u.no]: "error",
246
256
  [u.notSpecified]: "neutral"
247
- }, a = (t) => e(`patientTable.column.${t}`);
257
+ }, i = (t) => e(`patientTable.column.${t}`);
248
258
  return [
249
259
  /* ── Avatar (P0, pinned-start) ─────────────────────────────────── */
250
260
  {
@@ -254,10 +264,10 @@ function qe(e, n = {}) {
254
264
  // TEXT is clipped via the kit's `sr-only-th` convention (clips only
255
265
  // `.ag-header-cell-text`, keeping the header-cell box in the grid chrome
256
266
  // and the name in the a11y tree — see ag-grid-theme.css).
257
- headerName: a("avatar"),
267
+ headerName: i("avatar"),
258
268
  headerClass: "sr-only-th",
259
269
  pinned: "left",
260
- cellRenderer: Te,
270
+ cellRenderer: we,
261
271
  cellRendererParams: {
262
272
  srcField: "avatarUrl",
263
273
  fallbackField: "lastName",
@@ -283,7 +293,7 @@ function qe(e, n = {}) {
283
293
  /* ── First name (P0, pinned-start) — plain text ────────────────── */
284
294
  {
285
295
  colId: "firstName",
286
- headerName: a("firstName"),
296
+ headerName: i("firstName"),
287
297
  pinned: "left",
288
298
  field: "firstName",
289
299
  filter: C,
@@ -297,10 +307,10 @@ function qe(e, n = {}) {
297
307
  /* ── Last name (P0, pinned-start) — the patient-detail link ────── */
298
308
  {
299
309
  colId: "lastName",
300
- headerName: a("lastName"),
310
+ headerName: i("lastName"),
301
311
  pinned: "left",
302
312
  field: "lastName",
303
- cellRenderer: we,
313
+ cellRenderer: Ne,
304
314
  cellRendererParams: {
305
315
  href: r,
306
316
  // When no detail href is supplied the cell renders a button; route its
@@ -321,12 +331,12 @@ function qe(e, n = {}) {
321
331
  /* ── Phone (P1) ────────────────────────────────────────────────── */
322
332
  {
323
333
  colId: "phone",
324
- headerName: a("phone"),
334
+ headerName: i("phone"),
325
335
  responsiveTier: "P1",
326
336
  // The primary phone number string (prefix + number).
327
337
  valueGetter: (t) => {
328
- var i, f, b;
329
- return ((b = (f = (i = t.data) == null ? void 0 : i.phoneNumbers) == null ? void 0 : f[0]) == null ? void 0 : b.number) ?? "";
338
+ var n, f, b;
339
+ return ((b = (f = (n = t.data) == null ? void 0 : n.phoneNumbers) == null ? void 0 : f[0]) == null ? void 0 : b.number) ?? "";
330
340
  },
331
341
  filter: C,
332
342
  floatingFilterComponent: g,
@@ -336,10 +346,10 @@ function qe(e, n = {}) {
336
346
  /* ── Next appointment (P1) ─────────────────────────────────────── */
337
347
  {
338
348
  colId: "nextAppointment",
339
- headerName: a("nextAppointment"),
349
+ headerName: i("nextAppointment"),
340
350
  responsiveTier: "P1",
341
351
  field: "nextAppointment",
342
- cellRenderer: ze,
352
+ cellRenderer: He,
343
353
  filter: z,
344
354
  floatingFilterComponent: _,
345
355
  minWidth: 160,
@@ -348,13 +358,18 @@ function qe(e, n = {}) {
348
358
  /* ── Unpaid balance (P1) ───────────────────────────────────────── */
349
359
  {
350
360
  colId: "unpaidBalance",
351
- headerName: a("unpaidBalance"),
361
+ headerName: i("unpaidBalance"),
352
362
  responsiveTier: "P1",
353
363
  field: "unpaidAmount",
354
364
  type: "numericColumn",
355
365
  // The kit's financial-state pill: `debt` while anything is owed, `settled` at zero.
356
366
  cellRenderer: Z,
357
367
  cellRendererParams: { positiveState: "debt" },
368
+ // The row carries integer cents; the filter reads euros, as typed.
369
+ filterValueGetter: (t) => {
370
+ var n;
371
+ return (((n = t.data) == null ? void 0 : n.unpaidAmount) ?? 0) / 100;
372
+ },
358
373
  filter: $,
359
374
  floatingFilterComponent: H,
360
375
  // Money is integer cents; the inRange filter compares cents directly.
@@ -365,13 +380,13 @@ function qe(e, n = {}) {
365
380
  /* ── Email (P2) — hidden when masking ──────────────────────────── */
366
381
  {
367
382
  colId: "email",
368
- headerName: a("email"),
383
+ headerName: i("email"),
369
384
  responsiveTier: "P2",
370
385
  field: "email",
371
386
  // Emit `hide` ONLY when masking (never a literal `hide: false`). A static
372
387
  // `hide: false` is re-applied by AG Grid on every `columnDefs` reconcile,
373
388
  // clobbering a runtime hide from the ViewSwitcher / responsive hook.
374
- hide: s || void 0,
389
+ hide: o || void 0,
375
390
  filter: C,
376
391
  floatingFilterComponent: g,
377
392
  minWidth: 200,
@@ -380,7 +395,7 @@ function qe(e, n = {}) {
380
395
  /* ── Care-plan status (P2) ─────────────────────────────────────── */
381
396
  {
382
397
  colId: "carePlanStatus",
383
- headerName: a("carePlanStatus"),
398
+ headerName: i("carePlanStatus"),
384
399
  responsiveTier: "P2",
385
400
  field: "carePlanStatus",
386
401
  cellRenderer: ke,
@@ -406,7 +421,7 @@ function qe(e, n = {}) {
406
421
  /* ── Fiscal code (P3, text) ────────────────────────────────────── */
407
422
  {
408
423
  colId: "fiscalCode",
409
- headerName: a("fiscalCode"),
424
+ headerName: i("fiscalCode"),
410
425
  responsiveTier: "P3",
411
426
  field: "italianFiscalCode",
412
427
  filter: C,
@@ -417,14 +432,14 @@ function qe(e, n = {}) {
417
432
  /* ── Age (P3, derived numeric) ─────────────────────────────────── */
418
433
  {
419
434
  colId: "age",
420
- headerName: a("age"),
435
+ headerName: i("age"),
421
436
  responsiveTier: "P3",
422
437
  // Left-aligned like the text columns — `numericColumn` (which right-aligns
423
438
  // header + cell) is for ledger figures, not a 2-digit age. Sort stays
424
439
  // numeric because the valueGetter returns a number.
425
440
  valueGetter: (t) => {
426
- var i;
427
- return Ke((i = t.data) == null ? void 0 : i.dateOfBirth) ?? void 0;
441
+ var n;
442
+ return Ye((n = t.data) == null ? void 0 : n.dateOfBirth) ?? void 0;
428
443
  },
429
444
  filter: $,
430
445
  floatingFilterComponent: H,
@@ -434,12 +449,12 @@ function qe(e, n = {}) {
434
449
  /* ── Gender (P3) ───────────────────────────────────────────────── */
435
450
  {
436
451
  colId: "gender",
437
- headerName: a("gender"),
452
+ headerName: i("gender"),
438
453
  responsiveTier: "P3",
439
454
  // Map the raw code to a localised label for both cell + set filter.
440
455
  valueGetter: (t) => {
441
- var i;
442
- return (i = t.data) != null && i.gender ? d[t.data.gender] : W;
456
+ var n;
457
+ return (n = t.data) != null && n.gender ? d[t.data.gender] : W;
443
458
  },
444
459
  filter: I,
445
460
  floatingFilterComponent: R,
@@ -456,18 +471,18 @@ function qe(e, n = {}) {
456
471
  /* ── Source (P3) ───────────────────────────────────────────────── */
457
472
  {
458
473
  colId: "source",
459
- headerName: a("source"),
474
+ headerName: i("source"),
460
475
  responsiveTier: "P3",
461
476
  // TagListCellRenderer expects an array; wrap the resolved source string.
462
477
  valueGetter: (t) => {
463
478
  var f, b;
464
- const i = ((f = t.data) == null ? void 0 : f.source) ?? ((b = t.data) == null ? void 0 : b.customSource);
465
- return i ? [i] : [];
479
+ const n = ((f = t.data) == null ? void 0 : f.source) ?? ((b = t.data) == null ? void 0 : b.customSource);
480
+ return n ? [n] : [];
466
481
  },
467
- cellRenderer: ae,
482
+ cellRenderer: re,
468
483
  filterValueGetter: (t) => {
469
- var i, f;
470
- return ((i = t.data) == null ? void 0 : i.source) ?? ((f = t.data) == null ? void 0 : f.customSource) ?? "";
484
+ var n, f;
485
+ return ((n = t.data) == null ? void 0 : n.source) ?? ((f = t.data) == null ? void 0 : f.customSource) ?? "";
471
486
  },
472
487
  filter: I,
473
488
  floatingFilterComponent: R,
@@ -478,7 +493,7 @@ function qe(e, n = {}) {
478
493
  /* ── Grouped: Identity — hidden by default ─────────────────────── */
479
494
  {
480
495
  colId: "dateOfBirth",
481
- headerName: a("dateOfBirth"),
496
+ headerName: i("dateOfBirth"),
482
497
  hide: !0,
483
498
  field: "dateOfBirth",
484
499
  cellRenderer: q,
@@ -490,7 +505,7 @@ function qe(e, n = {}) {
490
505
  },
491
506
  {
492
507
  colId: "placeOfBirth",
493
- headerName: a("placeOfBirth"),
508
+ headerName: i("placeOfBirth"),
494
509
  hide: !0,
495
510
  field: "placeOfBirth",
496
511
  filter: C,
@@ -500,9 +515,13 @@ function qe(e, n = {}) {
500
515
  },
501
516
  {
502
517
  colId: "countryOfBirth",
503
- headerName: a("countryOfBirth"),
518
+ headerName: i("countryOfBirth"),
504
519
  hide: !0,
505
- field: "countryOfBirth",
520
+ // ISO code in the row, the name in the cell — and in the text filter.
521
+ valueGetter: (t) => {
522
+ var n;
523
+ return te((n = t.data) == null ? void 0 : n.countryOfBirth);
524
+ },
506
525
  filter: C,
507
526
  floatingFilterComponent: g,
508
527
  minWidth: 130,
@@ -511,11 +530,11 @@ function qe(e, n = {}) {
511
530
  /* ── Grouped: Contact — hidden by default ──────────────────────── */
512
531
  {
513
532
  colId: "smsReminders",
514
- headerName: a("smsReminders"),
533
+ headerName: i("smsReminders"),
515
534
  hide: !0,
516
535
  valueGetter: (t) => {
517
- var i;
518
- return !!((i = t.data) != null && i.smsReminderEligible);
536
+ var n;
537
+ return !!((n = t.data) != null && n.smsReminderEligible);
519
538
  },
520
539
  valueFormatter: (t) => t.value === !0 ? A : W,
521
540
  filter: I,
@@ -531,11 +550,11 @@ function qe(e, n = {}) {
531
550
  },
532
551
  {
533
552
  colId: "emailReminders",
534
- headerName: a("emailReminders"),
553
+ headerName: i("emailReminders"),
535
554
  hide: !0,
536
555
  valueGetter: (t) => {
537
- var i;
538
- return !!((i = t.data) != null && i.emailReminderEligible);
556
+ var n;
557
+ return !!((n = t.data) != null && n.emailReminderEligible);
539
558
  },
540
559
  valueFormatter: (t) => t.value === !0 ? A : W,
541
560
  filter: I,
@@ -551,7 +570,7 @@ function qe(e, n = {}) {
551
570
  },
552
571
  {
553
572
  colId: "pec",
554
- headerName: a("pec"),
573
+ headerName: i("pec"),
555
574
  hide: !0,
556
575
  field: "pecAddress",
557
576
  filter: C,
@@ -562,7 +581,7 @@ function qe(e, n = {}) {
562
581
  /* ── Grouped: Appointments — hidden by default ─────────────────── */
563
582
  {
564
583
  colId: "lastVisit",
565
- headerName: a("lastVisit"),
584
+ headerName: i("lastVisit"),
566
585
  hide: !0,
567
586
  field: "lastAppointment",
568
587
  cellRenderer: q,
@@ -575,7 +594,7 @@ function qe(e, n = {}) {
575
594
  /* ── Grouped: Financial — hidden by default ────────────────────── */
576
595
  {
577
596
  colId: "billableAmount",
578
- headerName: a("billableAmount"),
597
+ headerName: i("billableAmount"),
579
598
  hide: !0,
580
599
  type: "numericColumn",
581
600
  field: "billableAmount",
@@ -584,6 +603,11 @@ function qe(e, n = {}) {
584
603
  // renderer converts, so the inRange filter compares cents directly.
585
604
  cellRenderer: Z,
586
605
  cellRendererParams: { positiveState: "to-invoice" },
606
+ // The row carries integer cents; the filter reads euros, as typed.
607
+ filterValueGetter: (t) => {
608
+ var n;
609
+ return (((n = t.data) == null ? void 0 : n.billableAmount) ?? 0) / 100;
610
+ },
587
611
  filter: $,
588
612
  floatingFilterComponent: H,
589
613
  filterParams: { defaultOperator: "inRange", min: 0 },
@@ -592,7 +616,7 @@ function qe(e, n = {}) {
592
616
  },
593
617
  {
594
618
  colId: "discount",
595
- headerName: a("discount"),
619
+ headerName: i("discount"),
596
620
  hide: !0,
597
621
  field: "defaultDiscount",
598
622
  type: "numericColumn",
@@ -605,7 +629,7 @@ function qe(e, n = {}) {
605
629
  /* ── Grouped: Clinical — hidden by default ─────────────────────── */
606
630
  {
607
631
  colId: "diagnosis",
608
- headerName: a("diagnosis"),
632
+ headerName: i("diagnosis"),
609
633
  hide: !0,
610
634
  field: "diagnosis",
611
635
  filter: C,
@@ -615,7 +639,7 @@ function qe(e, n = {}) {
615
639
  },
616
640
  {
617
641
  colId: "insurance",
618
- headerName: a("insurance"),
642
+ headerName: i("insurance"),
619
643
  hide: !0,
620
644
  field: "defaultInsurance",
621
645
  filter: I,
@@ -625,26 +649,26 @@ function qe(e, n = {}) {
625
649
  },
626
650
  {
627
651
  colId: "assignedTo",
628
- headerName: a("assignedTo"),
652
+ headerName: i("assignedTo"),
629
653
  hide: !0,
630
- cellRenderer: Re,
654
+ cellRenderer: Ie,
631
655
  valueGetter: (t) => {
632
- var i;
633
- return (i = t.data) != null && i.personalAssistant ? { name: t.data.personalAssistant } : null;
656
+ var n;
657
+ return (n = t.data) != null && n.personalAssistant ? { name: t.data.personalAssistant } : null;
634
658
  },
635
- comparator: (t, i) => ((t == null ? void 0 : t.name) ?? "").localeCompare((i == null ? void 0 : i.name) ?? ""),
659
+ comparator: (t, n) => ((t == null ? void 0 : t.name) ?? "").localeCompare((n == null ? void 0 : n.name) ?? ""),
636
660
  filterValueGetter: (t) => {
637
- var i;
638
- return ((i = t.data) == null ? void 0 : i.personalAssistant) ?? "";
661
+ var n;
662
+ return ((n = t.data) == null ? void 0 : n.personalAssistant) ?? "";
639
663
  },
640
- filter: Fe,
641
- floatingFilterComponent: Ne,
664
+ filter: Re,
665
+ floatingFilterComponent: Fe,
642
666
  minWidth: 160,
643
667
  width: 180
644
668
  },
645
669
  {
646
670
  colId: "job",
647
- headerName: a("job"),
671
+ headerName: i("job"),
648
672
  hide: !0,
649
673
  field: "job",
650
674
  filter: C,
@@ -655,15 +679,15 @@ function qe(e, n = {}) {
655
679
  /* ── Grouped: Admin — hidden by default ────────────────────────── */
656
680
  {
657
681
  colId: "marketingConsent",
658
- headerName: a("marketingConsent"),
682
+ headerName: i("marketingConsent"),
659
683
  hide: !0,
660
- cellRenderer: Ie,
684
+ cellRenderer: ye,
661
685
  cellRendererParams: {
662
686
  variantMap: p
663
687
  },
664
688
  valueGetter: (t) => {
665
- var i;
666
- switch ((i = t.data) == null ? void 0 : i.marketingConsent) {
689
+ var n;
690
+ switch ((n = t.data) == null ? void 0 : n.marketingConsent) {
667
691
  case 1:
668
692
  return u.yes;
669
693
  case 0:
@@ -690,13 +714,13 @@ function qe(e, n = {}) {
690
714
  },
691
715
  {
692
716
  colId: "patientNumber",
693
- headerName: a("patientNumber"),
717
+ headerName: i("patientNumber"),
694
718
  hide: !0,
695
719
  // `YYYY/N` yearly numbering.
696
720
  valueGetter: (t) => {
697
721
  var b, m;
698
- const i = (b = t.data) == null ? void 0 : b.yearlyNumberingYear, f = (m = t.data) == null ? void 0 : m.yearlyNumberingNumber;
699
- return i != null && f != null ? `${i}/${f}` : "";
722
+ const n = (b = t.data) == null ? void 0 : b.yearlyNumberingYear, f = (m = t.data) == null ? void 0 : m.yearlyNumberingNumber;
723
+ return n != null && f != null ? `${n}/${f}` : "";
700
724
  },
701
725
  filter: C,
702
726
  floatingFilterComponent: g,
@@ -705,11 +729,11 @@ function qe(e, n = {}) {
705
729
  },
706
730
  {
707
731
  colId: "portal",
708
- headerName: a("portal"),
732
+ headerName: i("portal"),
709
733
  hide: !0,
710
734
  valueGetter: (t) => {
711
- var i;
712
- return !!((i = t.data) != null && i.mydentista);
735
+ var n;
736
+ return !!((n = t.data) != null && n.mydentista);
713
737
  },
714
738
  valueFormatter: (t) => t.value === !0 ? A : W,
715
739
  filter: I,
@@ -725,7 +749,7 @@ function qe(e, n = {}) {
725
749
  },
726
750
  {
727
751
  colId: "createdAt",
728
- headerName: a("createdAt"),
752
+ headerName: i("createdAt"),
729
753
  hide: !0,
730
754
  field: "createdAt",
731
755
  cellRenderer: q,
@@ -738,7 +762,7 @@ function qe(e, n = {}) {
738
762
  /* ── Grouped: Address — hidden by default ──────────────────────── */
739
763
  {
740
764
  colId: "city",
741
- headerName: a("city"),
765
+ headerName: i("city"),
742
766
  hide: !0,
743
767
  field: "city",
744
768
  filter: C,
@@ -748,7 +772,7 @@ function qe(e, n = {}) {
748
772
  },
749
773
  {
750
774
  colId: "province",
751
- headerName: a("province"),
775
+ headerName: i("province"),
752
776
  hide: !0,
753
777
  field: "province",
754
778
  filter: C,
@@ -758,7 +782,7 @@ function qe(e, n = {}) {
758
782
  },
759
783
  {
760
784
  colId: "postcode",
761
- headerName: a("postcode"),
785
+ headerName: i("postcode"),
762
786
  hide: !0,
763
787
  field: "postcode",
764
788
  filter: C,
@@ -768,9 +792,12 @@ function qe(e, n = {}) {
768
792
  },
769
793
  {
770
794
  colId: "country",
771
- headerName: a("country"),
795
+ headerName: i("country"),
772
796
  hide: !0,
773
- field: "countryCode",
797
+ valueGetter: (t) => {
798
+ var n;
799
+ return te((n = t.data) == null ? void 0 : n.countryCode);
800
+ },
774
801
  filter: C,
775
802
  floatingFilterComponent: g,
776
803
  minWidth: 110,
@@ -778,7 +805,7 @@ function qe(e, n = {}) {
778
805
  },
779
806
  {
780
807
  colId: "street",
781
- headerName: a("street"),
808
+ headerName: i("street"),
782
809
  hide: !0,
783
810
  field: "street",
784
811
  filter: C,
@@ -787,11 +814,11 @@ function qe(e, n = {}) {
787
814
  width: 220
788
815
  },
789
816
  /* ── Custom fields (per-practice, dynamic) — appended, hidden ──── */
790
- ...Ye(c),
817
+ ...qe(c),
791
818
  /* ── Actions (P0, pinned-end) ──────────────────────────────────── */
792
819
  {
793
820
  colId: "actions",
794
- headerName: a("actions"),
821
+ headerName: i("actions"),
795
822
  // Pinned to the inline-end edge so actions stay reachable while the field
796
823
  // columns scroll. AG Grid `pinned` is physical — the grid's `enableRtl`
797
824
  // flips this to the start edge under RTL. Locked: neither a header drag
@@ -803,13 +830,13 @@ function qe(e, n = {}) {
803
830
  // other column — no right-aligned header (the actions still sit at the
804
831
  // pinned inline-end edge, the group just starts at the cell's leading edge).
805
832
  cellClass: "ds:justify-start ag-cell-graphic",
806
- cellRenderer: be,
833
+ cellRenderer: ge,
807
834
  cellRendererParams: {
808
835
  actions: h,
809
836
  intent: "ghost",
810
837
  group: !0,
811
838
  label: e("patientTable.actions.group"),
812
- collapsed: o
839
+ collapsed: s
813
840
  },
814
841
  sortable: !1,
815
842
  filter: !1,
@@ -823,7 +850,7 @@ function qe(e, n = {}) {
823
850
  }
824
851
  ];
825
852
  }
826
- const Qe = /* @__PURE__ */ new Set([
853
+ const Xe = /* @__PURE__ */ new Set([
827
854
  "api",
828
855
  "flex",
829
856
  "gridInitializing",
@@ -832,73 +859,73 @@ const Qe = /* @__PURE__ */ new Set([
832
859
  "sizeColumnsToFit",
833
860
  "rowDataUpdated",
834
861
  "rowModelUpdated"
835
- ]), Xe = [
862
+ ]), Je = [
836
863
  { minWidth: 0, tier: "P0" },
837
864
  { minWidth: 640, tier: "P1" },
838
865
  { minWidth: 900, tier: "P2" },
839
866
  { minWidth: 1200, tier: "P3" }
840
867
  ];
841
- function Je(e, n) {
842
- const s = /* @__PURE__ */ new Set();
843
- for (const o of n)
844
- e >= o.minWidth && s.add(o.tier);
845
- return s.add("P0"), s;
868
+ function Ze(e, a) {
869
+ const o = /* @__PURE__ */ new Set();
870
+ for (const s of a)
871
+ e >= s.minWidth && o.add(s.tier);
872
+ return o.add("P0"), o;
846
873
  }
847
- function Ze(e, n) {
874
+ function et(e, a) {
848
875
  const {
849
- containerRef: s,
850
- enabled: o = !0,
851
- breakpoints: l = Xe
852
- } = n, r = G(/* @__PURE__ */ new Set()), c = G(!1);
853
- return te(() => {
854
- const d = s.current;
855
- if (!o || !d) return;
876
+ containerRef: o,
877
+ enabled: s = !0,
878
+ breakpoints: l = Je
879
+ } = a, r = k(/* @__PURE__ */ new Set()), c = k(!1);
880
+ return ne(() => {
881
+ const d = o.current;
882
+ if (!s || !d) return;
856
883
  const u = () => {
857
884
  var m;
858
885
  return (m = e.current) == null ? void 0 : m.getRawApi();
859
886
  };
860
887
  let p;
861
- const a = () => {
888
+ const i = () => {
862
889
  p === void 0 && (p = window.setTimeout(() => {
863
890
  p = void 0, f();
864
891
  }, 0));
865
892
  }, T = (m) => {
866
- var O;
893
+ var E;
867
894
  if (c.current) return;
868
- if (Qe.has(m.source)) {
869
- a();
895
+ if (Xe.has(m.source)) {
896
+ i();
870
897
  return;
871
898
  }
872
- const V = (m.columns ?? (m.column ? [m.column] : [])).map((D) => D.getColId());
873
- for (const D of V) r.current.add(D);
874
- (O = e.current) == null || O.markColumnsUserTouched(V);
899
+ const x = (m.columns ?? (m.column ? [m.column] : [])).map((D) => D.getColId());
900
+ for (const D of x) r.current.add(D);
901
+ (E = e.current) == null || E.markColumnsUserTouched(x);
875
902
  };
876
903
  let t = !1;
877
- const i = (m) => {
904
+ const n = (m) => {
878
905
  t || (t = !0, m.addEventListener("columnVisible", T));
879
906
  }, f = () => {
880
- var M;
907
+ var G;
881
908
  const m = u();
882
909
  if (!m) return;
883
- i(m);
884
- const x = m.getColumns();
885
- if (!x) return;
886
- const V = d.getBoundingClientRect().width, O = Je(V, l), D = new Set(
887
- ((M = e.current) == null ? void 0 : M.getUserTouchedColumns()) ?? []
888
- ), P = [], F = [];
889
- for (const N of x) {
890
- const L = N.getColId();
891
- if (r.current.has(L) || D.has(L))
910
+ n(m);
911
+ const V = m.getColumns();
912
+ if (!V) return;
913
+ const x = d.getBoundingClientRect().width, E = Ze(x, l), D = new Set(
914
+ ((G = e.current) == null ? void 0 : G.getUserTouchedColumns()) ?? []
915
+ ), y = [], F = [];
916
+ for (const N of V) {
917
+ const U = N.getColId();
918
+ if (r.current.has(U) || D.has(U))
892
919
  continue;
893
- const U = le(N.getColDef());
894
- if (!U) continue;
895
- const B = O.has(U);
896
- B && !N.isVisible() ? P.push(N) : !B && N.isVisible() && F.push(N);
920
+ const L = oe(N.getColDef());
921
+ if (!L) continue;
922
+ const B = E.has(L);
923
+ B && !N.isVisible() ? y.push(N) : !B && N.isVisible() && F.push(N);
897
924
  }
898
- if (!(P.length === 0 && F.length === 0)) {
925
+ if (!(y.length === 0 && F.length === 0)) {
899
926
  c.current = !0;
900
927
  try {
901
- P.length > 0 && m.setColumnsVisible(P, !0), F.length > 0 && m.setColumnsVisible(F, !1);
928
+ y.length > 0 && m.setColumnsVisible(y, !0), F.length > 0 && m.setColumnsVisible(F, !1);
902
929
  } finally {
903
930
  c.current = !1;
904
931
  }
@@ -908,7 +935,7 @@ function Ze(e, n) {
908
935
  var m;
909
936
  b.disconnect(), p !== void 0 && window.clearTimeout(p), (m = u()) == null || m.removeEventListener("columnVisible", T);
910
937
  };
911
- }, [s, o, l, e]), { lockColumns: j(
938
+ }, [o, s, l, e]), { lockColumns: j(
912
939
  (d) => {
913
940
  var u;
914
941
  for (const p of d) r.current.add(p);
@@ -917,39 +944,39 @@ function Ze(e, n) {
917
944
  [e]
918
945
  ) };
919
946
  }
920
- function et(e) {
921
- var n;
922
- return (n = e.data) != null && n.isArchived ? "data-table-row-archived" : void 0;
923
- }
924
947
  function tt(e) {
948
+ var a;
949
+ return (a = e.data) != null && a.isArchived ? "data-table-row-archived" : void 0;
950
+ }
951
+ function nt(e) {
925
952
  return e.data.id;
926
953
  }
927
- function nt({
954
+ function at({
928
955
  views: e,
929
- handleRef: n,
930
- lockColumns: s,
931
- label: o
956
+ handleRef: a,
957
+ lockColumns: o,
958
+ label: s
932
959
  }) {
933
- const [l, r] = ne(""), c = Q(
960
+ const [l, r] = ae(""), c = Q(
934
961
  () => e.map((u) => ({ value: u.id, label: u.label })),
935
962
  [e]
936
963
  ), h = j(
937
964
  (u) => {
938
- const p = e.find((t) => t.id === u), a = n.current;
939
- if (!p || !a) return;
940
- const T = a.getRawApi();
965
+ const p = e.find((t) => t.id === u), i = a.current;
966
+ if (!p || !i) return;
967
+ const T = i.getRawApi();
941
968
  if (T) {
942
- const t = new Set(p.columns), i = [], f = [];
969
+ const t = new Set(p.columns), n = [], f = [];
943
970
  for (const b of T.getColumns() ?? []) {
944
- if (le(b.getColDef()) === void 0) continue;
971
+ if (oe(b.getColDef()) === void 0) continue;
945
972
  const m = b.getColId();
946
- t.has(m) ? i.push(m) : f.push(m);
973
+ t.has(m) ? n.push(m) : f.push(m);
947
974
  }
948
- s([...i, ...f]), i.length > 0 && T.setColumnsVisible(i, !0), f.length > 0 && T.setColumnsVisible(f, !1);
975
+ o([...n, ...f]), n.length > 0 && T.setColumnsVisible(n, !0), f.length > 0 && T.setColumnsVisible(f, !1);
949
976
  }
950
- a.setFilter(p.filterModel), a.setSort(p.sortModel), T == null || T.onFilterChanged();
977
+ i.setFilter(p.filterModel), i.setSort(p.sortModel), T == null || T.onFilterChanged();
951
978
  },
952
- [e, n, s]
979
+ [e, a, o]
953
980
  ), d = j(
954
981
  (u) => {
955
982
  r(u), u && h(u);
@@ -961,22 +988,22 @@ function nt({
961
988
  // the Select's intrinsic `w-full` trigger sizes to a compact, legible width
962
989
  // instead of absorbing the whole FilterBar row.
963
990
  /* @__PURE__ */ v("div", { className: "ds:w-[12rem] ds:max-w-full ds:min-w-0 ds:shrink-0", children: /* @__PURE__ */ v(
964
- Ce,
991
+ ve,
965
992
  {
966
993
  options: c,
967
994
  value: l,
968
995
  onValueChange: d,
969
996
  size: "sm",
970
- "aria-label": o
997
+ "aria-label": s
971
998
  }
972
999
  ) })
973
1000
  );
974
1001
  }
975
- const it = he(
1002
+ const it = pe(
976
1003
  function({
977
- rowData: n,
978
- columns: s,
979
- gridId: o,
1004
+ rowData: a,
1005
+ columns: o,
1006
+ gridId: s,
980
1007
  density: l,
981
1008
  actionsCompact: r,
982
1009
  heightClass: c,
@@ -984,79 +1011,79 @@ const it = he(
984
1011
  views: d,
985
1012
  onRowAction: u,
986
1013
  bulkActions: p,
987
- loading: a = !1,
1014
+ loading: i = !1,
988
1015
  toolbar: T,
989
1016
  hideQuickSearch: t = !1,
990
- pagination: i = !1,
1017
+ pagination: n = !1,
991
1018
  paginationPageSizeSelector: f,
992
1019
  hideDetails: b = !1,
993
1020
  identityHref: m,
994
- customFields: x,
995
- "aria-label": V,
996
- className: O
1021
+ customFields: V,
1022
+ "aria-label": x,
1023
+ className: E
997
1024
  }, D) {
998
- const { t: P } = K("ui"), F = G(null), M = G(null), [N, L] = ne(null);
999
- pe(
1025
+ const { t: y } = K("ui"), F = k(null), G = k(null), [N, U] = ae(null);
1026
+ be(
1000
1027
  D,
1001
1028
  () => N ?? F.current,
1002
1029
  [N]
1003
1030
  );
1004
- const { lockColumns: U } = Ze(F, {
1005
- containerRef: M,
1031
+ const { lockColumns: L } = et(F, {
1032
+ containerRef: G,
1006
1033
  enabled: h
1007
- }), B = r ?? l === "compact", X = G(B), J = j(() => X.current, []);
1008
- te(() => {
1009
- var y;
1034
+ }), B = r ?? l === "compact", X = k(B), J = j(() => X.current, []);
1035
+ ne(() => {
1036
+ var P;
1010
1037
  X.current = B;
1011
- const w = (y = F.current) == null ? void 0 : y.getRawApi();
1038
+ const w = (P = F.current) == null ? void 0 : P.getRawApi();
1012
1039
  w && (w.setColumnWidths([
1013
1040
  {
1014
1041
  key: "actions",
1015
- newWidth: B ? 88 : ie(He)
1042
+ newWidth: B ? 88 : ie($e)
1016
1043
  }
1017
1044
  ]), w.refreshCells({ force: !0 }));
1018
1045
  }, [B, N]);
1019
- const oe = Q(
1020
- () => s ?? qe(P, {
1046
+ const se = Q(
1047
+ () => o ?? Qe(y, {
1021
1048
  hideDetails: b,
1022
1049
  onRowAction: u,
1023
1050
  identityHref: m,
1024
- customFields: x,
1051
+ customFields: V,
1025
1052
  getActionsCompact: J
1026
1053
  }),
1027
1054
  [
1028
- s,
1029
- P,
1055
+ o,
1056
+ y,
1030
1057
  b,
1031
1058
  u,
1032
1059
  m,
1033
- x,
1060
+ V,
1034
1061
  J
1035
1062
  ]
1036
- ), se = ((d == null ? void 0 : d.length) ?? 0) > 0, de = /* @__PURE__ */ k(S.Toolbar, { children: [
1037
- /* @__PURE__ */ k(S.Toolbar.FilterBar, { children: [
1038
- se && d ? /* @__PURE__ */ v(
1039
- nt,
1063
+ ), de = ((d == null ? void 0 : d.length) ?? 0) > 0, ce = /* @__PURE__ */ M(S.Toolbar, { children: [
1064
+ /* @__PURE__ */ M(S.Toolbar.FilterBar, { children: [
1065
+ de && d ? /* @__PURE__ */ v(
1066
+ at,
1040
1067
  {
1041
1068
  views: d,
1042
1069
  handleRef: F,
1043
- lockColumns: U,
1044
- label: P("patientTable.views.label")
1070
+ lockColumns: L,
1071
+ label: y("patientTable.views.label")
1045
1072
  }
1046
1073
  ) : null,
1047
1074
  t ? null : /* @__PURE__ */ v(S.Toolbar.QuickSearch, {}),
1048
1075
  /* @__PURE__ */ v(S.Toolbar.FilterChips, {})
1049
1076
  ] }),
1050
- /* @__PURE__ */ k(S.Toolbar.Actions, { children: [
1077
+ /* @__PURE__ */ M(S.Toolbar.Actions, { children: [
1051
1078
  p == null ? void 0 : p.map((w) => /* @__PURE__ */ v(
1052
1079
  S.Toolbar.BulkAction,
1053
1080
  {
1054
1081
  label: w.label,
1055
1082
  icon: w.icon,
1056
1083
  variant: w.variant,
1057
- onClick: (y) => {
1058
- const fe = (y == null ? void 0 : y.getSelectedNodes().map((Y) => Y.id).filter((Y) => Y != null)) ?? [];
1059
- w.onSelect(fe);
1084
+ onClick: (P) => {
1085
+ const he = (P == null ? void 0 : P.getSelectedNodes().map((Y) => Y.id).filter((Y) => Y != null)) ?? [];
1086
+ w.onSelect(he);
1060
1087
  }
1061
1088
  },
1062
1089
  w.id
@@ -1064,40 +1091,40 @@ const it = he(
1064
1091
  /* @__PURE__ */ v(S.Toolbar.ColumnToggle, {}),
1065
1092
  /* @__PURE__ */ v(S.Toolbar.ExportMenu, {})
1066
1093
  ] })
1067
- ] }), ce = T ?? de, ue = a ? void 0 : n, me = Q(() => ({ getRowId: tt }), []);
1068
- return ve(
1069
- ge,
1094
+ ] }), ue = T ?? ce, me = i ? void 0 : a, fe = Q(() => ({ getRowId: nt }), []);
1095
+ return Te(
1096
+ Ce,
1070
1097
  N,
1071
- o
1098
+ s
1072
1099
  ), /* @__PURE__ */ v(
1073
1100
  "div",
1074
1101
  {
1075
- ref: M,
1102
+ ref: G,
1076
1103
  role: "region",
1077
- "aria-label": V ?? P("patientTable.regionLabel"),
1104
+ "aria-label": x ?? y("patientTable.regionLabel"),
1078
1105
  "data-component": "patient-table",
1079
- "data-component-id": o,
1106
+ "data-component-id": s,
1080
1107
  className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col",
1081
1108
  children: /* @__PURE__ */ v(
1082
1109
  S,
1083
1110
  {
1084
1111
  ref: (w) => {
1085
- F.current = w, L(
1086
- (y) => y === w ? y : w
1112
+ F.current = w, U(
1113
+ (P) => P === w ? P : w
1087
1114
  );
1088
1115
  },
1089
- gridId: o,
1090
- columnDefs: oe,
1091
- rowData: ue,
1116
+ gridId: s,
1117
+ columnDefs: se,
1118
+ rowData: me,
1092
1119
  rowSelection: "multiple",
1093
- pagination: i,
1120
+ pagination: n,
1094
1121
  ...c !== void 0 ? { heightClass: c } : {},
1095
1122
  ...f !== void 0 ? { paginationPageSizeSelector: f } : {},
1096
1123
  density: l,
1097
- getRowClass: et,
1098
- gridOptions: me,
1099
- className: O,
1100
- children: ce
1124
+ getRowClass: tt,
1125
+ gridOptions: fe,
1126
+ className: E,
1127
+ children: ue
1101
1128
  }
1102
1129
  )
1103
1130
  }
@@ -1105,37 +1132,37 @@ const it = he(
1105
1132
  }
1106
1133
  );
1107
1134
  it.displayName = "PatientTable";
1108
- const at = 5e4;
1109
- function rt(e) {
1110
- return e === 0 ? { variant: "success", statusKey: "settled" } : e <= at ? { variant: "warning", statusKey: "pending" } : { variant: "error", statusKey: "overdue" };
1111
- }
1135
+ const rt = 5e4;
1112
1136
  function lt(e) {
1137
+ return e === 0 ? { variant: "success", statusKey: "settled" } : e <= rt ? { variant: "warning", statusKey: "pending" } : { variant: "error", statusKey: "overdue" };
1138
+ }
1139
+ function ot(e) {
1113
1140
  if (e == null || e === "") return null;
1114
- const n = typeof e == "number" ? e : Number(e);
1115
- return Number.isFinite(n) ? n : null;
1141
+ const a = typeof e == "number" ? e : Number(e);
1142
+ return Number.isFinite(a) ? a : null;
1116
1143
  }
1117
- function It(e) {
1118
- const { value: n, currency: s = "EUR", options: o } = e, { t: l, i18n: r } = K("ui"), c = lt(n);
1144
+ function yt(e) {
1145
+ const { value: a, currency: o = "EUR", options: s } = e, { t: l, i18n: r } = K("ui"), c = ot(a);
1119
1146
  if (c === null) return null;
1120
1147
  const h = r.language || "en", d = new Intl.NumberFormat(h, {
1121
1148
  style: "currency",
1122
- currency: s,
1123
- ...o
1124
- }).format(c / 100), { variant: u, statusKey: p } = rt(c), a = l(`patientTable.balance.status.${p}`);
1125
- return /* @__PURE__ */ k(re, { variant: u, withDot: !0, size: "sm", className: "ds:tabular-nums", children: [
1149
+ currency: o,
1150
+ ...s
1151
+ }).format(c / 100), { variant: u, statusKey: p } = lt(c), i = l(`patientTable.balance.status.${p}`);
1152
+ return /* @__PURE__ */ M(le, { variant: u, withDot: !0, size: "sm", className: "ds:tabular-nums", children: [
1126
1153
  /* @__PURE__ */ v("span", { children: d }),
1127
- /* @__PURE__ */ v("span", { className: "ds:sr-only", children: a })
1154
+ /* @__PURE__ */ v("span", { className: "ds:sr-only", children: i })
1128
1155
  ] });
1129
1156
  }
1130
1157
  export {
1131
- It as B,
1158
+ yt as B,
1132
1159
  ke as C,
1133
- ze as N,
1134
- He as P,
1160
+ He as N,
1161
+ $e as P,
1135
1162
  Z as T,
1136
1163
  it as a,
1137
- qe as b,
1138
- le as g,
1139
- Ze as u
1164
+ Qe as b,
1165
+ oe as g,
1166
+ et as u
1140
1167
  };
1141
- //# sourceMappingURL=balance-badge-cell-C_Qz76x7.js.map
1168
+ //# sourceMappingURL=balance-badge-cell-BrlikHfT.js.map