@alfadocs/ui-kit-debug 1.3.11 → 1.3.12

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 (54) hide show
  1. package/dist/_chunks/{anamnesis-i18n-DFXSM72N.js → anamnesis-i18n-9OrXTNS3.js} +882 -874
  2. package/dist/_chunks/anamnesis-i18n-9OrXTNS3.js.map +1 -0
  3. package/dist/_chunks/{bmi-calculator-Bk2GAju7.js → bmi-calculator-CM0-G2mg.js} +2 -2
  4. package/dist/_chunks/{bmi-calculator-Bk2GAju7.js.map → bmi-calculator-CM0-G2mg.js.map} +1 -1
  5. package/dist/_chunks/{cycle-calculator-DNvvr0bP.js → cycle-calculator-DrdC2hPj.js} +2 -2
  6. package/dist/_chunks/{cycle-calculator-DNvvr0bP.js.map → cycle-calculator-DrdC2hPj.js.map} +1 -1
  7. package/dist/_chunks/{due-date-calculator-BEcdoy_E.js → due-date-calculator-DzNMFyOU.js} +2 -2
  8. package/dist/_chunks/{due-date-calculator-BEcdoy_E.js.map → due-date-calculator-DzNMFyOU.js.map} +1 -1
  9. package/dist/_chunks/{fetal-weight-1F9N4IMx.js → fetal-weight-ePlLjJPc.js} +2 -2
  10. package/dist/_chunks/{fetal-weight-1F9N4IMx.js.map → fetal-weight-ePlLjJPc.js.map} +1 -1
  11. package/dist/_chunks/{hcg-doubling-fZ6qQN08.js → hcg-doubling-BBqD2wI2.js} +2 -2
  12. package/dist/_chunks/{hcg-doubling-fZ6qQN08.js.map → hcg-doubling-BBqD2wI2.js.map} +1 -1
  13. package/dist/_chunks/{link-cell-renderer-_DlEZHLI.js → link-cell-renderer-C5XLwVXQ.js} +2 -2
  14. package/dist/_chunks/{link-cell-renderer-_DlEZHLI.js.map → link-cell-renderer-C5XLwVXQ.js.map} +1 -1
  15. package/dist/_chunks/number-input-DrozbZAU.js +370 -0
  16. package/dist/_chunks/number-input-DrozbZAU.js.map +1 -0
  17. package/dist/_chunks/{optical-prescription-BEjYQjiO.js → optical-prescription-BDHJr8Zz.js} +2 -2
  18. package/dist/_chunks/{optical-prescription-BEjYQjiO.js.map → optical-prescription-BDHJr8Zz.js.map} +1 -1
  19. package/dist/_chunks/{patient-details-BAUg0FWs.js → patient-details-D7D3f9dy.js} +2 -2
  20. package/dist/_chunks/{patient-details-BAUg0FWs.js.map → patient-details-D7D3f9dy.js.map} +1 -1
  21. package/dist/_chunks/{patient-table-C7QHFC63.js → patient-table-BmIDrLIS.js} +2 -2
  22. package/dist/_chunks/{patient-table-C7QHFC63.js.map → patient-table-BmIDrLIS.js.map} +1 -1
  23. package/dist/_chunks/{pregnancy-dating-BdFl-rB1.js → pregnancy-dating-C3WvXHee.js} +2 -2
  24. package/dist/_chunks/{pregnancy-dating-BdFl-rB1.js.map → pregnancy-dating-C3WvXHee.js.map} +1 -1
  25. package/dist/_chunks/{pregnancy-weight-gain-B-CkVYnU.js → pregnancy-weight-gain-O6J0sUIi.js} +2 -2
  26. package/dist/_chunks/{pregnancy-weight-gain-B-CkVYnU.js.map → pregnancy-weight-gain-O6J0sUIi.js.map} +1 -1
  27. package/dist/_chunks/{unit-converter-CSLWFDQh.js → unit-converter-COgkN7YP.js} +2 -2
  28. package/dist/_chunks/{unit-converter-CSLWFDQh.js.map → unit-converter-COgkN7YP.js.map} +1 -1
  29. package/dist/agent-catalog.json +1 -1
  30. package/dist/components/bmi-calculator/index.js +1 -1
  31. package/dist/components/cycle-calculator/index.js +1 -1
  32. package/dist/components/data-table/index.js +1 -1
  33. package/dist/components/due-date-calculator/index.js +1 -1
  34. package/dist/components/fetal-weight/index.js +1 -1
  35. package/dist/components/hcg-doubling/index.js +1 -1
  36. package/dist/components/number-input/index.js +1 -1
  37. package/dist/components/number-input/number-input.d.ts.map +1 -1
  38. package/dist/components/optical-prescription/index.js +1 -1
  39. package/dist/components/patient-details/index.js +1 -1
  40. package/dist/components/patient-table/index.js +1 -1
  41. package/dist/components/pregnancy-dating/index.js +1 -1
  42. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  43. package/dist/components/unit-converter/index.js +1 -1
  44. package/dist/index.js +14 -14
  45. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +16 -0
  46. package/dist/patterns/anamnesis/anamnesis-derive.d.ts.map +1 -1
  47. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts.map +1 -1
  48. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +4 -3
  49. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts.map +1 -1
  50. package/dist/patterns/anamnesis/index.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/_chunks/anamnesis-i18n-DFXSM72N.js.map +0 -1
  53. package/dist/_chunks/number-input-DjWzmlEY.js +0 -350
  54. package/dist/_chunks/number-input-DjWzmlEY.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { jsxs as d, jsx as t, Fragment as Le } from "react/jsx-runtime";
2
- import { useRef as we, useState as z, useEffect as ia, useCallback as na, useId as We, useMemo as M, Fragment as Gt, useContext as Wt, createContext as Qt } from "react";
2
+ import { useRef as we, useState as $, useEffect as ia, useCallback as na, useId as We, useMemo as M, Fragment as Gt, useContext as Wt, createContext as Qt } from "react";
3
3
  import { B as Q } from "./badge-DCOqV9mI.js";
4
4
  import { B as X } from "./button-CPGiR_bH.js";
5
5
  import { I as re } from "./icon-button-C_kbcd7I.js";
@@ -8,7 +8,7 @@ import { C as sn, b as Gn, a as on } from "./collapsible-CTjxzGuF.js";
8
8
  import { E as Be } from "./empty-state-CrLsi0XI.js";
9
9
  import { F as q } from "./form-field-M5UpX65Z.js";
10
10
  import { M as rn } from "./multi-select-CC52Qws6.js";
11
- import { N as pa } from "./number-input-DjWzmlEY.js";
11
+ import { N as pa } from "./number-input-DrozbZAU.js";
12
12
  import { R as ke } from "./radio-TWf9Q-mp.js";
13
13
  import { R as ua } from "./radio-group-CI-6SmSw.js";
14
14
  import { S as Me } from "./select-BW5ecXlX.js";
@@ -573,6 +573,13 @@ function Fe(e, a) {
573
573
  }
574
574
  }
575
575
  }
576
+ function qi(e, a) {
577
+ for (let n = e.length - 1; n >= 0; n -= 1) {
578
+ const i = e[n], s = Fe(i, a);
579
+ if (s != null) return { value: s, visit: i };
580
+ }
581
+ return null;
582
+ }
576
583
  function Dn(e, a, n) {
577
584
  return e.some((i) => i.parameterKey === a) ? e.map(
578
585
  (i) => i.parameterKey === a ? { ...i, value: n } : i
@@ -658,7 +665,7 @@ function un(e, a) {
658
665
  };
659
666
  });
660
667
  }
661
- const qi = [
668
+ const Vi = [
662
669
  "nutritionalProposal",
663
670
  "clinicalNotes"
664
671
  ];
@@ -666,21 +673,21 @@ function it(e, a) {
666
673
  const n = 10 ** a;
667
674
  return Math.round(e * n) / n;
668
675
  }
669
- function Vi(e, a) {
676
+ function Bi(e, a) {
670
677
  return e == null ? null : it(e, a);
671
678
  }
672
679
  function Sa(e, a = (n, i) => n === i) {
673
680
  return e.every((n) => a(n, e[0]));
674
681
  }
675
- function Bi(e, a) {
682
+ function Ui(e, a) {
676
683
  return e == null || a == null ? e == null && a == null : e.name === a.name && e.dose === a.dose;
677
684
  }
678
- function Ui(e, a) {
685
+ function Ki(e, a) {
679
686
  if (e.length < 2) return null;
680
687
  const n = [];
681
688
  for (const r of a) {
682
689
  const l = r.precision ?? 1, c = e.map(
683
- (m) => Vi(Fe(m, r), l)
690
+ (m) => Bi(Fe(m, r), l)
684
691
  );
685
692
  Sa(c) || n.push({
686
693
  def: r,
@@ -701,10 +708,10 @@ function Ui(e, a) {
701
708
  const l = e.map(
702
709
  (c) => c.therapy.find((m) => m.id === r)
703
710
  );
704
- Sa(l, Bi) || s.push({ id: r, entries: l });
711
+ Sa(l, Ui) || s.push({ id: r, entries: l });
705
712
  }
706
713
  const o = [];
707
- for (const r of qi) {
714
+ for (const r of Vi) {
708
715
  const l = e.map((c) => {
709
716
  var m;
710
717
  return ((m = c[r]) == null ? void 0 : m.trim()) ?? "";
@@ -726,12 +733,12 @@ const _e = "—";
726
733
  function Ve(e, a = 1) {
727
734
  return e == null || !Number.isFinite(e) ? _e : e.toFixed(a);
728
735
  }
729
- function Ki(e, a) {
736
+ function Hi(e, a) {
730
737
  return ha(e) ? new Intl.DateTimeFormat(a, Ye).format(
731
738
  new Date(e)
732
739
  ) : _e;
733
740
  }
734
- function Hi(e, a = 1) {
741
+ function ji(e, a = 1) {
735
742
  if (!Number.isFinite(e)) return _e;
736
743
  const n = it(e, a);
737
744
  return n === 0 ? "0" : `${n > 0 ? "+" : "−"}${Math.abs(n).toFixed(a)}`;
@@ -745,14 +752,14 @@ function pn(e) {
745
752
  return typeof a == "string" ? a : void 0;
746
753
  }
747
754
  function se(e, a) {
748
- return Ki(e, pn(a));
755
+ return Hi(e, pn(a));
749
756
  }
750
- function ji(e) {
757
+ function Gi(e) {
751
758
  const [a, n, i] = e.split("-").map(Number);
752
759
  if (!(!a || !n || !i))
753
760
  return new Date(a, n - 1, i);
754
761
  }
755
- function Gi(e) {
762
+ function Wi(e) {
756
763
  const a = (n) => String(n).padStart(2, "0");
757
764
  return `${e.getFullYear()}-${a(e.getMonth() + 1)}-${a(e.getDate())}`;
758
765
  }
@@ -764,13 +771,13 @@ function st(e, a, n, i = !1) {
764
771
  });
765
772
  return i ? n("anamnesis.window.optionHasNote", { label: s }) : s;
766
773
  }
767
- function Wi(e, a, n) {
774
+ function Qi(e, a, n) {
768
775
  const i = Oi(e, a);
769
776
  return i == null ? _e : n("anamnesis.header.years", { age: i });
770
777
  }
771
778
  function $a(e, a) {
772
779
  const n = _a(e);
773
- return n ? Wi(e.patient.dateOfBirthIso, n.dateIso, a) : _e;
780
+ return n ? Qi(e.patient.dateOfBirthIso, n.dateIso, a) : _e;
774
781
  }
775
782
  function ba(e) {
776
783
  const a = e == null ? void 0 : e.trim();
@@ -786,7 +793,7 @@ function Te(e, a) {
786
793
  function he(e, a) {
787
794
  return ba(e.label) ?? a(`anamnesis.field.${e.key}.label`, { defaultValue: e.key });
788
795
  }
789
- function Qi(e, a) {
796
+ function Yi(e, a) {
790
797
  const n = he(e, a);
791
798
  return e.unit ? `${n} (${e.unit})` : n;
792
799
  }
@@ -855,7 +862,7 @@ function gn(e, a, n) {
855
862
  return [e.time, e.description].filter(Boolean).join(" · ") || "—";
856
863
  }
857
864
  }
858
- const Yi = [
865
+ const Xi = [
859
866
  { id: "reason", kind: "prose", fieldKeys: ["reasonForVisit"] },
860
867
  {
861
868
  id: "history",
@@ -879,12 +886,12 @@ const Yi = [
879
886
  ]
880
887
  }
881
888
  ];
882
- function Xi(e, a) {
889
+ function Ji(e, a) {
883
890
  return e.flatMap(
884
891
  (n) => n.fields.filter((i) => ra(i, a))
885
892
  );
886
893
  }
887
- function Ji(e, a, n) {
894
+ function Zi(e, a, n) {
888
895
  const i = a(e.key);
889
896
  return !i || !ga(i) ? null : {
890
897
  key: e.key,
@@ -892,7 +899,7 @@ function Ji(e, a, n) {
892
899
  value: gn(i, e, n)
893
900
  };
894
901
  }
895
- function Zi(e, a, n) {
902
+ function es(e, a, n) {
896
903
  var s;
897
904
  const i = [];
898
905
  for (const o of e) {
@@ -905,12 +912,12 @@ function Zi(e, a, n) {
905
912
  }
906
913
  return i;
907
914
  }
908
- function es(e, a, n, i) {
909
- const s = Xi(e, n), o = new Map(s.map((c) => [c.key, c])), r = [];
910
- for (const c of Yi) {
911
- const m = c.kind === "flags" ? Zi(s, a, i) : c.fieldKeys.map((g) => {
915
+ function as(e, a, n, i) {
916
+ const s = Ji(e, n), o = new Map(s.map((c) => [c.key, c])), r = [];
917
+ for (const c of Xi) {
918
+ const m = c.kind === "flags" ? es(s, a, i) : c.fieldKeys.map((g) => {
912
919
  const h = o.get(g);
913
- return h ? Ji(h, a, i) : null;
920
+ return h ? Zi(h, a, i) : null;
914
921
  }).filter((g) => g != null);
915
922
  m.length > 0 && r.push({ id: c.id, kind: c.kind, items: m });
916
923
  }
@@ -935,25 +942,25 @@ function rt(e, a, n, i) {
935
942
  }
936
943
  return s;
937
944
  }
938
- const as = 'input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), button:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])';
939
- function ns(e, a) {
945
+ const ns = 'input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), button:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])';
946
+ function ts(e, a) {
940
947
  const n = e == null ? void 0 : e.querySelector(
941
948
  `[data-testid="anamnesis-field-${a}"]`
942
- ), i = n == null ? void 0 : n.querySelector(as);
949
+ ), i = n == null ? void 0 : n.querySelector(ns);
943
950
  return i ? (i.focus(), !0) : !1;
944
951
  }
945
- const ts = 4;
952
+ const is = 4;
946
953
  function lt() {
947
- const e = we(null), [a, n] = z(null);
954
+ const e = we(null), [a, n] = $(null);
948
955
  ia(() => {
949
956
  if (a == null) return;
950
957
  let s = 0, o = 0;
951
958
  const r = () => {
952
- if (ns(e.current, a)) {
959
+ if (ts(e.current, a)) {
953
960
  n(null);
954
961
  return;
955
962
  }
956
- if (s += 1, s >= ts) {
963
+ if (s += 1, s >= is) {
957
964
  n(null);
958
965
  return;
959
966
  }
@@ -997,7 +1004,7 @@ function ct({
997
1004
  }
998
1005
  );
999
1006
  }
1000
- function is({ group: e, t: a }) {
1007
+ function ss({ group: e, t: a }) {
1001
1008
  return /* @__PURE__ */ d(
1002
1009
  "div",
1003
1010
  {
@@ -1022,7 +1029,7 @@ function is({ group: e, t: a }) {
1022
1029
  }
1023
1030
  );
1024
1031
  }
1025
- function ss({ digest: e, t: a }) {
1032
+ function os({ digest: e, t: a }) {
1026
1033
  return e.groups.length === 0 ? /* @__PURE__ */ t(
1027
1034
  Be,
1028
1035
  {
@@ -1036,11 +1043,11 @@ function ss({ digest: e, t: a }) {
1036
1043
  {
1037
1044
  "data-testid": "anamnesis-digest-panel",
1038
1045
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1039
- children: e.groups.map((n) => /* @__PURE__ */ t(is, { group: n, t: a }, n.id))
1046
+ children: e.groups.map((n) => /* @__PURE__ */ t(ss, { group: n, t: a }, n.id))
1040
1047
  }
1041
1048
  );
1042
1049
  }
1043
- const os = Wn(
1050
+ const rs = Wn(
1044
1051
  "type-meta ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:tabular-nums",
1045
1052
  {
1046
1053
  variants: {
@@ -1057,12 +1064,12 @@ const os = Wn(
1057
1064
  );
1058
1065
  function za({ delta: e, def: a, t: n }) {
1059
1066
  if (!e) return null;
1060
- const i = e.direction === "up" ? Qn : e.direction === "down" ? Yn : Zt, s = `${Hi(e.abs, a.precision ?? 1)}${a.unit ? ` ${a.unit}` : ""}`, o = e.valence === "good" ? n("anamnesis.delta.improved") : e.valence === "bad" ? n("anamnesis.delta.worsened") : n("anamnesis.delta.unchanged");
1067
+ const i = e.direction === "up" ? Qn : e.direction === "down" ? Yn : Zt, s = `${ji(e.abs, a.precision ?? 1)}${a.unit ? ` ${a.unit}` : ""}`, o = e.valence === "good" ? n("anamnesis.delta.improved") : e.valence === "bad" ? n("anamnesis.delta.worsened") : n("anamnesis.delta.unchanged");
1061
1068
  return /* @__PURE__ */ d(
1062
1069
  "span",
1063
1070
  {
1064
1071
  role: "img",
1065
- className: os({ valence: e.valence }),
1072
+ className: rs({ valence: e.valence }),
1066
1073
  "aria-label": n("anamnesis.delta.aria", {
1067
1074
  valence: o,
1068
1075
  change: s
@@ -1096,7 +1103,7 @@ function fn({
1096
1103
  }
1097
1104
  );
1098
1105
  }
1099
- const rs = {
1106
+ const ls = {
1100
1107
  good: "var(--success)",
1101
1108
  bad: "var(--error)",
1102
1109
  neutral: "var(--muted-foreground)"
@@ -1117,7 +1124,7 @@ function mt({
1117
1124
  data: e,
1118
1125
  variant: "line",
1119
1126
  size: "sm",
1120
- color: rs[l],
1127
+ color: ls[l],
1121
1128
  annotations: i,
1122
1129
  onAnnotationSelect: s,
1123
1130
  label: n("anamnesis.grid.trendLabel", {
@@ -1158,7 +1165,7 @@ function pt({
1158
1165
  o.key
1159
1166
  )) });
1160
1167
  }
1161
- function ls({
1168
+ function cs({
1162
1169
  intake: e,
1163
1170
  sections: a,
1164
1171
  sex: n,
@@ -1184,7 +1191,7 @@ function ls({
1184
1191
  jumpKey: "anamnesis.summary.jump"
1185
1192
  }
1186
1193
  ) : null,
1187
- /* @__PURE__ */ t(ss, { digest: i, t: r }),
1194
+ /* @__PURE__ */ t(os, { digest: i, t: r }),
1188
1195
  /* @__PURE__ */ d(sn, { variant: "default", children: [
1189
1196
  /* @__PURE__ */ t("h2", { className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]", children: /* @__PURE__ */ d(
1190
1197
  Gn,
@@ -1230,7 +1237,7 @@ function ls({
1230
1237
  }
1231
1238
  );
1232
1239
  }
1233
- const cs = [
1240
+ const ds = [
1234
1241
  "visitMeta",
1235
1242
  "intakeGaps",
1236
1243
  "anthropometrics",
@@ -1246,13 +1253,13 @@ const cs = [
1246
1253
  function Ba(e) {
1247
1254
  return (e ?? "").trim() !== "";
1248
1255
  }
1249
- function ds(e) {
1256
+ function ms(e) {
1250
1257
  const a = e.oncological;
1251
1258
  if (!a) return 0;
1252
1259
  let n = 0;
1253
1260
  return Ba(a.tumourType) && (n += 1), Ba(a.stage) && (n += 1), a.metastases && a.metastases.present !== "unknown" && (n += 1), Ba(a.treatmentStatus) && (n += 1), n;
1254
1261
  }
1255
- function ms(e, a) {
1262
+ function us(e, a) {
1256
1263
  const n = new Map(e.labs.map((s) => [s.parameterKey, s.value])), i = [];
1257
1264
  for (const s of a) {
1258
1265
  const o = n.get(s.key);
@@ -1260,34 +1267,34 @@ function ms(e, a) {
1260
1267
  }
1261
1268
  return i;
1262
1269
  }
1263
- function us(e) {
1270
+ function ps(e) {
1264
1271
  const a = e.annualProgramme;
1265
1272
  return a && (a.proposed || a.accepted) ? 1 : 0;
1266
1273
  }
1267
1274
  function Fn(e, a = []) {
1268
- const n = e ? ms(e, a) : [], i = (e == null ? void 0 : e.visitType) === "first", s = {
1269
- oncological: e ? ds(e) : 0,
1275
+ const n = e ? us(e, a) : [], i = (e == null ? void 0 : e.visitType) === "first", s = {
1276
+ oncological: e ? ms(e) : 0,
1270
1277
  labs: n.length,
1271
1278
  fmd: e ? e.fmdCycles.length : 0,
1272
- annual: e ? us(e) : 0
1279
+ annual: e ? ps(e) : 0
1273
1280
  }, o = {
1274
1281
  oncological: 0,
1275
1282
  labs: n.filter(({ def: l, value: c }) => ya(c, l.referenceRange)).length,
1276
1283
  fmd: 0,
1277
1284
  annual: 0
1278
1285
  }, r = {};
1279
- for (const l of cs)
1286
+ for (const l of ds)
1280
1287
  r[l] = { open: !0, fill: null, flagged: 0 };
1281
1288
  for (const l of ht)
1282
1289
  r[l] = { open: i, fill: s[l], flagged: o[l] };
1283
1290
  return r;
1284
1291
  }
1285
- const ps = [
1292
+ const hs = [
1286
1293
  "clinicalNotes",
1287
1294
  "nutritionalProposal"
1288
1295
  ];
1289
1296
  function Oa(e) {
1290
- return ps.flatMap((a) => {
1297
+ return hs.flatMap((a) => {
1291
1298
  var i;
1292
1299
  const n = (i = e[a]) == null ? void 0 : i.trim();
1293
1300
  return n ? [{ field: a, text: n }] : [];
@@ -1296,7 +1303,7 @@ function Oa(e) {
1296
1303
  function gt(e) {
1297
1304
  return Oa(e).length > 0;
1298
1305
  }
1299
- function hs({
1306
+ function gs({
1300
1307
  visit: e,
1301
1308
  t: a
1302
1309
  }) {
@@ -1305,8 +1312,8 @@ function hs({
1305
1312
  /* @__PURE__ */ t(_.Detail, { children: /* @__PURE__ */ t("span", { className: "ds:block ds:break-words ds:whitespace-pre-line", children: n.text }) })
1306
1313
  ] }, n.field)) });
1307
1314
  }
1308
- const gs = "ds:mt-[var(--spacing-md)] ds:max-h-[min(20rem,var(--radix-popover-content-available-height))] ds:overflow-y-auto ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
1309
- function fs({
1315
+ const fs = "ds:mt-[var(--spacing-md)] ds:max-h-[min(20rem,var(--radix-popover-content-available-height))] ds:overflow-y-auto ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
1316
+ function ys({
1310
1317
  visit: e,
1311
1318
  t: a,
1312
1319
  defaultOpen: n = !1,
@@ -1371,8 +1378,8 @@ function fs({
1371
1378
  tabIndex: 0,
1372
1379
  role: "group",
1373
1380
  "aria-label": a("anamnesis.visitNote.title"),
1374
- className: gs,
1375
- children: /* @__PURE__ */ t(hs, { visit: e, t: a })
1381
+ className: fs,
1382
+ children: /* @__PURE__ */ t(gs, { visit: e, t: a })
1376
1383
  }
1377
1384
  )
1378
1385
  ]
@@ -1380,7 +1387,7 @@ function fs({
1380
1387
  )
1381
1388
  ] });
1382
1389
  }
1383
- const yn = "ds:min-w-[11rem]", fa = "ds:min-w-[8rem]", vn = "ds:w-[40%] ds:min-w-[14rem]", ys = "type-label ds:sticky ds:start-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-end)]", ft = "ds:sticky ds:top-0 ds:z-[2] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-down)]", vs = "type-label ds:sticky ds:end-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-start)]", bs = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]", je = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
1390
+ const yn = "ds:min-w-[11rem]", fa = "ds:min-w-[8rem]", vn = "ds:w-[40%] ds:min-w-[14rem]", vs = "type-label ds:sticky ds:start-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-end)]", ft = "ds:sticky ds:top-0 ds:z-[2] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-down)]", bs = "type-label ds:sticky ds:end-0 ds:top-0 ds:z-[3] ds:bg-[color:var(--card)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)] ds:text-start ds:shadow-[var(--shadow-chrome-start)]", xs = "ds:sticky ds:end-0 ds:z-[1] ds:bg-[color:var(--card)] ds:shadow-[var(--shadow-chrome-start)]", je = "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)] ds:align-top";
1384
1391
  function yt({
1385
1392
  column: e,
1386
1393
  t: a,
@@ -1412,7 +1419,7 @@ function yt({
1412
1419
  }
1413
1420
  ) }),
1414
1421
  o ? /* @__PURE__ */ t(
1415
- fs,
1422
+ ys,
1416
1423
  {
1417
1424
  visit: l,
1418
1425
  t: a,
@@ -1468,7 +1475,7 @@ function vt({
1468
1475
  "th",
1469
1476
  {
1470
1477
  scope: "col",
1471
- className: `${yn} ${ys}`,
1478
+ className: `${yn} ${vs}`,
1472
1479
  children: n
1473
1480
  }
1474
1481
  ),
@@ -1492,14 +1499,14 @@ function vt({
1492
1499
  {
1493
1500
  scope: "col",
1494
1501
  "data-testid": l,
1495
- className: `${fa} ${vs}`,
1502
+ className: `${fa} ${bs}`,
1496
1503
  children: r
1497
1504
  }
1498
1505
  ) : null
1499
1506
  ] }) }),
1500
1507
  /* @__PURE__ */ t("tbody", { children: c.map(
1501
1508
  (p) => {
1502
- var v, N;
1509
+ var b, N;
1503
1510
  return p.banner != null ? /* @__PURE__ */ t("tr", { className: "ds:bg-[color:var(--muted)]", children: /* @__PURE__ */ t(
1504
1511
  "th",
1505
1512
  {
@@ -1509,7 +1516,7 @@ function vt({
1509
1516
  }
1510
1517
  ) }, p.key) : /* @__PURE__ */ d("tr", { children: [
1511
1518
  p.header,
1512
- (v = p.cells) == null ? void 0 : v[0],
1519
+ (b = p.cells) == null ? void 0 : b[0],
1513
1520
  p.trend,
1514
1521
  (N = p.cells) == null ? void 0 : N.slice(1),
1515
1522
  p.trailing
@@ -1520,7 +1527,7 @@ function vt({
1520
1527
  }
1521
1528
  );
1522
1529
  }
1523
- const Pn = 160, xs = {
1530
+ const Pn = 160, ks = {
1524
1531
  added: "success",
1525
1532
  removed: "error",
1526
1533
  changed: "info"
@@ -1529,16 +1536,16 @@ function Ma(e) {
1529
1536
  const a = e[0], n = e[e.length - 1];
1530
1537
  return !a && n ? "added" : a && !n ? "removed" : "changed";
1531
1538
  }
1532
- function ks(e) {
1539
+ function ws(e) {
1533
1540
  const a = e.trim();
1534
1541
  return a ? a.length > Pn ? `${a.slice(0, Pn).trimEnd()}…` : a : _e;
1535
1542
  }
1536
- function ws(e, a, n) {
1543
+ function Ns(e, a, n) {
1537
1544
  var s;
1538
1545
  const i = (s = e.dose) == null ? void 0 : s.trim();
1539
1546
  return a ? i ? `${e.name} · ${i}` : e.name : i || n;
1540
1547
  }
1541
- function Ns(e, { t: a, seriesByKey: n }) {
1548
+ function Cs(e, { t: a, seriesByKey: n }) {
1542
1549
  return e.numeric.map((i) => {
1543
1550
  const s = i.values.map((r) => r != null), o = Ma(s);
1544
1551
  return {
@@ -1559,7 +1566,7 @@ function Ns(e, { t: a, seriesByKey: n }) {
1559
1566
  };
1560
1567
  });
1561
1568
  }
1562
- function Cs(e, { t: a, pathologies: n }) {
1569
+ function Ts(e, { t: a, pathologies: n }) {
1563
1570
  const i = a("anamnesis.compare.present");
1564
1571
  return e.pathologies.map((s) => {
1565
1572
  const o = Ma(s.present);
@@ -1573,7 +1580,7 @@ function Cs(e, { t: a, pathologies: n }) {
1573
1580
  };
1574
1581
  });
1575
1582
  }
1576
- function Ts(e, { t: a }) {
1583
+ function Ss(e, { t: a }) {
1577
1584
  const n = a("anamnesis.compare.present");
1578
1585
  return e.medications.map((i) => {
1579
1586
  var l;
@@ -1589,14 +1596,14 @@ function Ts(e, { t: a }) {
1589
1596
  change: r,
1590
1597
  changeLabel: a(`anamnesis.compare.${r}`),
1591
1598
  values: i.entries.map(
1592
- (c) => c ? ws(c, o, n) : _e
1599
+ (c) => c ? Ns(c, o, n) : _e
1593
1600
  )
1594
1601
  };
1595
1602
  });
1596
1603
  }
1597
- function Ss(e, { t: a }) {
1604
+ function As(e, { t: a }) {
1598
1605
  return e.texts.flatMap((n) => {
1599
- const i = n.values.map(ks);
1606
+ const i = n.values.map(ws);
1600
1607
  if (i.every((o) => o === i[0])) return [];
1601
1608
  const s = Ma(i.map((o) => o !== _e));
1602
1609
  return [
@@ -1613,19 +1620,19 @@ function Ss(e, { t: a }) {
1613
1620
  ];
1614
1621
  });
1615
1622
  }
1616
- const As = [
1617
- { id: "measurement", rows: Ns },
1618
- { id: "pathology", rows: Cs },
1619
- { id: "therapy", rows: Ts },
1620
- { id: "note", rows: Ss }
1623
+ const Es = [
1624
+ { id: "measurement", rows: Cs },
1625
+ { id: "pathology", rows: Ts },
1626
+ { id: "therapy", rows: Ss },
1627
+ { id: "note", rows: As }
1621
1628
  ];
1622
- function Es(e, a) {
1623
- return As.flatMap((n) => n.rows(e, a));
1629
+ function Ds(e, a) {
1630
+ return Es.flatMap((n) => n.rows(e, a));
1624
1631
  }
1625
- function Ds({ row: e, t: a }) {
1626
- return e.def && e.delta ? /* @__PURE__ */ t(za, { delta: e.delta, def: e.def, t: a }) : /* @__PURE__ */ t(Q, { variant: xs[e.change], size: "sm", children: e.changeLabel });
1632
+ function Is({ row: e, t: a }) {
1633
+ return e.def && e.delta ? /* @__PURE__ */ t(za, { delta: e.delta, def: e.def, t: a }) : /* @__PURE__ */ t(Q, { variant: ks[e.change], size: "sm", children: e.changeLabel });
1627
1634
  }
1628
- function Is({
1635
+ function Rs({
1629
1636
  visits: e,
1630
1637
  columns: a,
1631
1638
  selectedIds: n,
@@ -1638,23 +1645,23 @@ function Is({
1638
1645
  t: m,
1639
1646
  onClose: g
1640
1647
  }) {
1641
- const h = We(), [p, v] = z(""), N = M(
1648
+ const h = We(), [p, b] = $(""), N = M(
1642
1649
  () => e.map((S, D) => ({
1643
1650
  value: S.id,
1644
1651
  label: st(S, D, m)
1645
1652
  })),
1646
1653
  [e, m]
1647
1654
  ), f = M(
1648
- () => s ? Es(s, { t: m, pathologies: r, seriesByKey: o }) : [],
1655
+ () => s ? Ds(s, { t: m, pathologies: r, seriesByKey: o }) : [],
1649
1656
  [s, m, r, o]
1650
1657
  ), C = M(() => {
1651
- var x, u;
1652
- const S = (x = a[0]) == null ? void 0 : x.visit.dateIso, D = (u = a[a.length - 1]) == null ? void 0 : u.visit.dateIso, E = m("anamnesis.compare.selected", {
1658
+ var w, u;
1659
+ const S = (w = a[0]) == null ? void 0 : w.visit.dateIso, D = (u = a[a.length - 1]) == null ? void 0 : u.visit.dateIso, A = m("anamnesis.compare.selected", {
1653
1660
  total: a.length,
1654
1661
  from: S ? se(S, m) : "",
1655
1662
  to: D ? se(D, m) : ""
1656
1663
  });
1657
- return a.length === 2 ? `${E} · ${m("anamnesis.compare.minimum")}` : E;
1664
+ return a.length === 2 ? `${A} · ${m("anamnesis.compare.minimum")}` : A;
1658
1665
  }, [a, m]), k = M(
1659
1666
  () => a.map((S) => /* @__PURE__ */ t(
1660
1667
  yt,
@@ -1667,42 +1674,42 @@ function Is({
1667
1674
  S.key
1668
1675
  )),
1669
1676
  [a, m]
1670
- ), A = M(() => {
1677
+ ), E = M(() => {
1671
1678
  const S = [];
1672
1679
  let D = null;
1673
- for (const E of f)
1674
- E.categoryId !== D && (D = E.categoryId, S.push({
1675
- key: `group-${E.categoryId}`,
1676
- banner: m(`anamnesis.compare.category.${E.categoryId}`)
1680
+ for (const A of f)
1681
+ A.categoryId !== D && (D = A.categoryId, S.push({
1682
+ key: `group-${A.categoryId}`,
1683
+ banner: m(`anamnesis.compare.category.${A.categoryId}`)
1677
1684
  })), S.push({
1678
- key: E.id,
1685
+ key: A.id,
1679
1686
  header: /* @__PURE__ */ t(
1680
1687
  "th",
1681
1688
  {
1682
1689
  scope: "row",
1683
1690
  className: `${yn} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
1684
1691
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1685
- /* @__PURE__ */ t("span", { className: "type-label ds:break-words ds:text-[color:var(--foreground)]", children: E.item }),
1686
- E.meta ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: E.meta }) : null
1692
+ /* @__PURE__ */ t("span", { className: "type-label ds:break-words ds:text-[color:var(--foreground)]", children: A.item }),
1693
+ A.meta ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: A.meta }) : null
1687
1694
  ] })
1688
1695
  }
1689
1696
  ),
1690
- cells: E.values.map((x, u) => {
1697
+ cells: A.values.map((w, u) => {
1691
1698
  var T;
1692
1699
  return /* @__PURE__ */ t(
1693
1700
  "td",
1694
1701
  {
1695
1702
  className: `${fa} ${je} ds:tabular-nums`,
1696
- children: /* @__PURE__ */ t("span", { className: "type-body-sm ds:block ds:break-words ds:whitespace-normal ds:text-[color:var(--foreground)]", children: x })
1703
+ children: /* @__PURE__ */ t("span", { className: "type-body-sm ds:block ds:break-words ds:whitespace-normal ds:text-[color:var(--foreground)]", children: w })
1697
1704
  },
1698
1705
  ((T = a[u]) == null ? void 0 : T.key) ?? u
1699
1706
  );
1700
1707
  }),
1701
- trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children: E.series && E.def ? /* @__PURE__ */ t(
1708
+ trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children: A.series && A.def ? /* @__PURE__ */ t(
1702
1709
  mt,
1703
1710
  {
1704
- series: E.series,
1705
- def: E.def,
1711
+ series: A.series,
1712
+ def: A.def,
1706
1713
  t: m,
1707
1714
  annotations: l,
1708
1715
  onSelectAnnotation: c
@@ -1711,9 +1718,9 @@ function Is({
1711
1718
  trailing: /* @__PURE__ */ t(
1712
1719
  "td",
1713
1720
  {
1714
- className: `${fa} ${je} ${bs}`,
1715
- "data-change": E.change,
1716
- children: /* @__PURE__ */ t(Ds, { row: E, t: m })
1721
+ className: `${fa} ${je} ${xs}`,
1722
+ "data-change": A.change,
1723
+ children: /* @__PURE__ */ t(Is, { row: A, t: m })
1717
1724
  }
1718
1725
  )
1719
1726
  });
@@ -1752,10 +1759,10 @@ function Is({
1752
1759
  allowSelectAll: !0,
1753
1760
  onChange: (S) => {
1754
1761
  if (S.length >= 2) {
1755
- v(""), i(S);
1762
+ b(""), i(S);
1756
1763
  return;
1757
1764
  }
1758
- v(m("anamnesis.compare.minimum"));
1765
+ b(m("anamnesis.compare.minimum"));
1759
1766
  }
1760
1767
  }
1761
1768
  )
@@ -1805,7 +1812,7 @@ function Is({
1805
1812
  trailingLabel: m("anamnesis.compare.column.change"),
1806
1813
  trailingTestId: "anamnesis-compare-change-column",
1807
1814
  visitHeaders: k,
1808
- rows: A,
1815
+ rows: E,
1809
1816
  testId: "anamnesis-compare-table"
1810
1817
  }
1811
1818
  )
@@ -1821,7 +1828,7 @@ const bt = {
1821
1828
  surgery: "triangle",
1822
1829
  lifestyle: "square"
1823
1830
  }, xt = "neutral";
1824
- function Rs(e, a) {
1831
+ function Ls(e, a) {
1825
1832
  const n = a.length - 1;
1826
1833
  if (n < 1 || !ha(e.dateIso)) return null;
1827
1834
  const i = a.map((o) => new Date(o.dateIso).getTime()), s = new Date(e.dateIso).getTime();
@@ -1833,9 +1840,9 @@ function Rs(e, a) {
1833
1840
  }
1834
1841
  return null;
1835
1842
  }
1836
- function Ls(e, a) {
1843
+ function Fs(e, a) {
1837
1844
  return (e ?? []).flatMap((n) => {
1838
- const i = Rs(n, a);
1845
+ const i = Ls(n, a);
1839
1846
  return i == null ? [] : [{ event: n, position: i }];
1840
1847
  }).sort((n, i) => n.position - i.position);
1841
1848
  }
@@ -1852,7 +1859,7 @@ function kt(e, a) {
1852
1859
  source: a(`anamnesis.event.source.${e.sourceKey}`)
1853
1860
  }) : n;
1854
1861
  }
1855
- function Fs(e, a, n) {
1862
+ function Ps(e, a, n) {
1856
1863
  return e.filter((i) => a.has(i.event.id)).map(({ event: i, position: s }) => ({
1857
1864
  id: i.id,
1858
1865
  position: s,
@@ -1861,7 +1868,7 @@ function Fs(e, a, n) {
1861
1868
  tone: xt
1862
1869
  }));
1863
1870
  }
1864
- function Ps({
1871
+ function _s({
1865
1872
  marks: e,
1866
1873
  activeIds: a,
1867
1874
  onToggle: n,
@@ -1946,22 +1953,22 @@ function wt(e) {
1946
1953
  e.map((a) => a.id)
1947
1954
  ).columns;
1948
1955
  }
1949
- function _s(e) {
1956
+ function $s(e) {
1950
1957
  return e.length >= 2;
1951
1958
  }
1952
- const $s = {
1959
+ const zs = {
1953
1960
  value: null,
1954
1961
  outOfRange: null,
1955
1962
  delta: null
1956
1963
  };
1957
- function zs(e, a) {
1964
+ function Os(e, a) {
1958
1965
  const n = e[a], i = e[a - 1];
1959
1966
  return i ? i.index === n.index - 1 : n.index === 0;
1960
1967
  }
1961
- function Os(e, a) {
1968
+ function Ms(e, a) {
1962
1969
  return e ? e.min != null && e.max != null ? `${e.min}–${e.max}` : e.max != null ? a("anamnesis.range.atMost", { value: e.max }) : e.min != null ? a("anamnesis.range.atLeast", { value: e.min }) : null : null;
1963
1970
  }
1964
- function Ms({
1971
+ function qs({
1965
1972
  record: e,
1966
1973
  defs: a,
1967
1974
  t: n,
@@ -1976,16 +1983,16 @@ function Ms({
1976
1983
  annotations: h,
1977
1984
  onSelectAnnotation: p
1978
1985
  }) {
1979
- const v = We(), N = un(e, a), f = e.visits, C = f.length - 1, k = m ?? wt(f), A = [];
1986
+ const b = We(), N = un(e, a), f = e.visits, C = f.length - 1, k = m ?? wt(f), E = [];
1980
1987
  let S = null;
1981
- const D = (x) => (o == null ? void 0 : o.visitIds.has(x)) ?? !1;
1982
- if (N.forEach((x) => {
1983
- x.def.group !== S && (S = x.def.group, A.push({
1984
- key: `group-${x.def.group}`,
1985
- banner: n(`anamnesis.group.${x.def.group}`)
1988
+ const D = (w) => (o == null ? void 0 : o.visitIds.has(w)) ?? !1;
1989
+ if (N.forEach((w) => {
1990
+ w.def.group !== S && (S = w.def.group, E.push({
1991
+ key: `group-${w.def.group}`,
1992
+ banner: n(`anamnesis.group.${w.def.group}`)
1986
1993
  }));
1987
- const u = Os(x.def.referenceRange, n), T = k.map((w, I) => {
1988
- const { visit: $, index: V } = w, R = x.cells[V] ?? $s, P = V === C, B = g == null || g.has(x.def.key), G = i && P && B && !x.def.computed, ne = !zs(k, I), ue = o != null && o.changedCells.has(`${$.id}:${x.def.key}`), pe = D($.id);
1994
+ const u = Ms(w.def.referenceRange, n), T = k.map((y, F) => {
1995
+ const { visit: z, index: U } = y, I = w.cells[U] ?? zs, P = U === C, V = g == null || g.has(w.def.key), G = i && P && V && !w.def.computed, ne = !Os(k, F), ue = o != null && o.changedCells.has(`${z.id}:${w.def.key}`), pe = D(z.id);
1989
1996
  return /* @__PURE__ */ t(
1990
1997
  "td",
1991
1998
  {
@@ -2004,26 +2011,26 @@ function Ms({
2004
2011
  pa,
2005
2012
  {
2006
2013
  size: "sm",
2007
- value: R.value,
2008
- mode: (x.def.precision ?? 0) > 0 ? "decimal" : "integer",
2014
+ value: I.value,
2015
+ mode: (w.def.precision ?? 0) > 0 ? "decimal" : "integer",
2009
2016
  "aria-label": n("anamnesis.grid.editCell", {
2010
- parameter: Pe(x.def, n)
2017
+ parameter: Pe(w.def, n)
2011
2018
  }),
2012
- onChange: (ce) => s == null ? void 0 : s($, x.def, ce)
2019
+ onChange: (ce) => s == null ? void 0 : s(z, w.def, ce)
2013
2020
  }
2014
- ) : /* @__PURE__ */ t("span", { className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]", children: Ve(R.value, x.def.precision) }),
2021
+ ) : /* @__PURE__ */ t("span", { className: "type-body-sm ds:font-[var(--font-weight-medium)] ds:text-[color:var(--foreground)]", children: Ve(I.value, w.def.precision) }),
2015
2022
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
2016
- R.outOfRange ? /* @__PURE__ */ t(fn, { flag: R.outOfRange, t: n, compact: !0 }) : null,
2017
- ne ? null : /* @__PURE__ */ t(za, { delta: R.delta, def: x.def, t: n }),
2023
+ I.outOfRange ? /* @__PURE__ */ t(fn, { flag: I.outOfRange, t: n, compact: !0 }) : null,
2024
+ ne ? null : /* @__PURE__ */ t(za, { delta: I.delta, def: w.def, t: n }),
2018
2025
  ue ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: n("anamnesis.compare.changedCell") }) : null
2019
2026
  ] })
2020
2027
  ] })
2021
2028
  },
2022
- w.key
2029
+ y.key
2023
2030
  );
2024
2031
  });
2025
- A.push({
2026
- key: x.def.key,
2032
+ E.push({
2033
+ key: w.def.key,
2027
2034
  // Sticky parameter column (inline-start). The shell splices the trend
2028
2035
  // in after the first value cell — the order is not decided here.
2029
2036
  header: /* @__PURE__ */ t(
@@ -2032,17 +2039,17 @@ function Ms({
2032
2039
  scope: "row",
2033
2040
  className: `${yn} ds:sticky ds:start-0 ds:z-[1] ds:bg-[color:var(--card)] ds:text-start ds:shadow-[var(--shadow-chrome-end)] ${je}`,
2034
2041
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
2035
- /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: Pe(x.def, n) }),
2042
+ /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: Pe(w.def, n) }),
2036
2043
  /* @__PURE__ */ d("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: [
2037
- x.def.unit,
2044
+ w.def.unit,
2038
2045
  u ? /* @__PURE__ */ d(Le, { children: [
2039
2046
  " · ",
2040
2047
  u
2041
2048
  ] }) : null
2042
2049
  ] }),
2043
- x.target != null ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.grid.target", {
2044
- value: Ve(x.target, x.def.precision),
2045
- unit: x.def.unit ?? ""
2050
+ w.target != null ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.grid.target", {
2051
+ value: Ve(w.target, w.def.precision),
2052
+ unit: w.def.unit ?? ""
2046
2053
  }) }) : null
2047
2054
  ] })
2048
2055
  }
@@ -2051,8 +2058,8 @@ function Ms({
2051
2058
  trend: /* @__PURE__ */ t("td", { className: `${vn} ${je}`, children: /* @__PURE__ */ t(
2052
2059
  mt,
2053
2060
  {
2054
- series: x.series,
2055
- def: x.def,
2061
+ series: w.series,
2062
+ def: w.def,
2056
2063
  t: n,
2057
2064
  annotations: h,
2058
2065
  onSelectAnnotation: p
@@ -2076,28 +2083,28 @@ function Ms({
2076
2083
  )
2077
2084
  }
2078
2085
  );
2079
- const E = k.map((x) => /* @__PURE__ */ t(
2086
+ const A = k.map((w) => /* @__PURE__ */ t(
2080
2087
  yt,
2081
2088
  {
2082
- column: x,
2089
+ column: w,
2083
2090
  t: n,
2084
- emphasised: D(x.visit.id),
2085
- editable: i && x.index === C,
2091
+ emphasised: D(w.visit.id),
2092
+ editable: i && w.index === C,
2086
2093
  defaultOpenNoteVisitId: l,
2087
2094
  onOpenNote: c
2088
2095
  },
2089
- x.key
2096
+ w.key
2090
2097
  ));
2091
2098
  return /* @__PURE__ */ t(
2092
2099
  vt,
2093
2100
  {
2094
- captionId: v,
2101
+ captionId: b,
2095
2102
  caption: n("anamnesis.grid.caption"),
2096
2103
  identityLabel: n("anamnesis.grid.parameter"),
2097
2104
  trendLabel: n("anamnesis.grid.trend"),
2098
2105
  trendTestId: "anamnesis-grid-trend",
2099
- visitHeaders: E,
2100
- rows: A,
2106
+ visitHeaders: A,
2107
+ rows: E,
2101
2108
  framed: r
2102
2109
  }
2103
2110
  );
@@ -2116,28 +2123,28 @@ function bn({
2116
2123
  onVisitSelectionChange: g,
2117
2124
  onOpenNote: h
2118
2125
  }) {
2119
- const { visits: p } = e, v = p.length >= 2, N = We(), f = We(), C = M(() => Re(o), [o]), k = M(
2126
+ const { visits: p } = e, b = p.length >= 2, N = We(), f = We(), C = M(() => Re(o), [o]), k = M(
2120
2127
  () => new Set(Ne(o).map((O) => O.key)),
2121
2128
  [o]
2122
- ), A = M(() => Pa(o), [o]), [S, D] = z(r), [E, x] = z(""), u = we(null), T = we(null), w = we(!1);
2129
+ ), E = M(() => Pa(o), [o]), [S, D] = $(r), [A, w] = $(""), u = we(null), T = we(null), y = we(!1);
2123
2130
  ia(() => {
2124
2131
  var O;
2125
- w.current && S && ((O = u.current) == null || O.scrollIntoView({ block: "start" })), w.current = !0;
2132
+ y.current && S && ((O = u.current) == null || O.scrollIntoView({ block: "start" })), y.current = !0;
2126
2133
  }, [S]);
2127
- const I = () => {
2134
+ const F = () => {
2128
2135
  var O;
2129
2136
  D(!1), (O = T.current) == null || O.focus();
2130
- }, [$, V] = z(
2137
+ }, [z, U] = $(
2131
2138
  () => c ? [...c] : ma(p)
2132
- ), R = M(() => {
2133
- const O = $.filter(
2139
+ ), I = M(() => {
2140
+ const O = z.filter(
2134
2141
  (H) => p.some((j) => j.id === H)
2135
2142
  );
2136
2143
  return O.length >= 2 ? O : ma(p);
2137
- }, [$, p]), P = M(
2138
- () => Da(p, R).columns,
2139
- [p, R]
2140
- ), B = M(() => S ? Ui(
2144
+ }, [z, p]), P = M(
2145
+ () => Da(p, I).columns,
2146
+ [p, I]
2147
+ ), V = M(() => S ? Ki(
2141
2148
  P.map((O) => O.visit),
2142
2149
  C
2143
2150
  ) : null, [S, P, C]), G = M(() => {
@@ -2145,9 +2152,9 @@ function bn({
2145
2152
  for (const H of un(e, C))
2146
2153
  O.set(H.def.key, H.series);
2147
2154
  return O;
2148
- }, [e, C]), [ne, ue] = z(
2155
+ }, [e, C]), [ne, ue] = $(
2149
2156
  () => l ? [...l] : ma(p)
2150
- ), pe = _s(p), ce = M(() => {
2157
+ ), pe = $s(p), ce = M(() => {
2151
2158
  const O = ne.filter((H) => p.some((j) => j.id === H));
2152
2159
  return O.length > 0 ? O : ma(p);
2153
2160
  }, [ne, p]), J = M(
@@ -2155,9 +2162,9 @@ function bn({
2155
2162
  // A compared visit is always a column, so compare always marks its
2156
2163
  // columns in the grid — comparing a visit the picker left out brings
2157
2164
  // it back on screen rather than marking nothing.
2158
- alsoShowIds: S ? R : []
2165
+ alsoShowIds: S ? I : []
2159
2166
  }),
2160
- [p, ce, S, R]
2167
+ [p, ce, S, I]
2161
2168
  ), Ae = M(
2162
2169
  () => J.columns.map((O) => O.visit.id),
2163
2170
  [J]
@@ -2165,13 +2172,13 @@ function bn({
2165
2172
  ia(() => {
2166
2173
  g == null || g(Ae);
2167
2174
  }, [Ae, g]);
2168
- const L = M(
2175
+ const R = M(
2169
2176
  () => p.map((O, H) => ({
2170
2177
  value: O.id,
2171
2178
  label: st(O, H, a, gt(O))
2172
2179
  })),
2173
2180
  [p, a]
2174
- ), U = M(() => {
2181
+ ), B = M(() => {
2175
2182
  const O = J.firstIso ? se(J.firstIso, a) : "", H = J.lastIso ? se(J.lastIso, a) : "", be = [J.hiddenCount > 0 ? a("anamnesis.window.showing", {
2176
2183
  shown: J.shownCount,
2177
2184
  total: J.totalCount,
@@ -2184,15 +2191,15 @@ function bn({
2184
2191
  })], Xe = J.shownCount - ce.length;
2185
2192
  return Xe > 0 && be.push(a("anamnesis.window.addedByCompare", { added: Xe })), ce.length === 1 && be.push(a("anamnesis.window.minimum")), be.join(" · ");
2186
2193
  }, [J, ce, a]), Z = M(
2187
- () => Ls(e.events, p),
2194
+ () => Fs(e.events, p),
2188
2195
  [e.events, p]
2189
- ), [de, le] = z(
2196
+ ), [de, le] = $(
2190
2197
  () => m ? [...m] : []
2191
2198
  ), Ee = M(() => {
2192
2199
  const O = new Set(Z.map((H) => H.event.id));
2193
2200
  return new Set(de.filter((H) => O.has(H)));
2194
2201
  }, [de, Z]), De = M(
2195
- () => Fs(Z, Ee, a),
2202
+ () => Ps(Z, Ee, a),
2196
2203
  [Z, Ee, a]
2197
2204
  ), Ie = (O) => le(
2198
2205
  (H) => H.includes(O) ? H.filter((j) => j !== O) : [...H, O]
@@ -2200,18 +2207,18 @@ function bn({
2200
2207
  () => h ? (O) => h({ kind: "event", eventId: O }) : void 0,
2201
2208
  [h]
2202
2209
  ), la = M(() => {
2203
- if (!B) return null;
2210
+ if (!V) return null;
2204
2211
  const O = /* @__PURE__ */ new Set();
2205
- for (const H of B.numeric)
2212
+ for (const H of V.numeric)
2206
2213
  H.values.forEach((j, be) => {
2207
2214
  const Xe = be === 0 ? H.values[1] : H.values[be - 1];
2208
- j !== Xe && O.add(`${B.visits[be].id}:${H.def.key}`);
2215
+ j !== Xe && O.add(`${V.visits[be].id}:${H.def.key}`);
2209
2216
  });
2210
2217
  return {
2211
- visitIds: new Set(B.visits.map((H) => H.id)),
2218
+ visitIds: new Set(V.visits.map((H) => H.id)),
2212
2219
  changedCells: O
2213
2220
  };
2214
- }, [B]);
2221
+ }, [V]);
2215
2222
  return p.length === 0 ? /* @__PURE__ */ t("div", { className: "ds:w-full", "data-testid": "anamnesis-evolution-empty", children: /* @__PURE__ */ t(
2216
2223
  Be,
2217
2224
  {
@@ -2221,7 +2228,7 @@ function bn({
2221
2228
  description: a("anamnesis.empty.noVisits.description")
2222
2229
  }
2223
2230
  ) }) : /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2224
- pe || v ? /* @__PURE__ */ d(
2231
+ pe || b ? /* @__PURE__ */ d(
2225
2232
  "div",
2226
2233
  {
2227
2234
  "data-testid": "anamnesis-evolution-toolbar",
@@ -2237,19 +2244,19 @@ function bn({
2237
2244
  q,
2238
2245
  {
2239
2246
  label: a("anamnesis.window.label"),
2240
- description: U,
2247
+ description: B,
2241
2248
  children: /* @__PURE__ */ t(
2242
2249
  rn,
2243
2250
  {
2244
- options: L,
2251
+ options: R,
2245
2252
  value: ce,
2246
2253
  allowSelectAll: !0,
2247
2254
  onChange: (O) => {
2248
2255
  if (O.length > 0) {
2249
- x(""), ue(O);
2256
+ w(""), ue(O);
2250
2257
  return;
2251
2258
  }
2252
- x(a("anamnesis.window.minimum"));
2259
+ w(a("anamnesis.window.minimum"));
2253
2260
  }
2254
2261
  }
2255
2262
  )
@@ -2261,13 +2268,13 @@ function bn({
2261
2268
  role: "status",
2262
2269
  "data-testid": "anamnesis-window-floor",
2263
2270
  className: "ds:sr-only",
2264
- children: E
2271
+ children: A
2265
2272
  }
2266
2273
  )
2267
2274
  ]
2268
2275
  }
2269
2276
  ) : null,
2270
- v ? (
2277
+ b ? (
2271
2278
  // The picker beside it is a FormField — label, control, then
2272
2279
  // description. A bare button in an `items-start` row top-aligns
2273
2280
  // with that LABEL and reads as floating above the control it acts
@@ -2296,7 +2303,7 @@ function bn({
2296
2303
  }
2297
2304
  ) : null,
2298
2305
  /* @__PURE__ */ t(
2299
- Ps,
2306
+ _s,
2300
2307
  {
2301
2308
  marks: Z,
2302
2309
  activeIds: Ee,
@@ -2305,7 +2312,7 @@ function bn({
2305
2312
  }
2306
2313
  ),
2307
2314
  /* @__PURE__ */ t(
2308
- Ms,
2315
+ qs,
2309
2316
  {
2310
2317
  record: e,
2311
2318
  defs: C,
@@ -2321,7 +2328,7 @@ function bn({
2321
2328
  onOpenNote: h
2322
2329
  }
2323
2330
  ),
2324
- v ? /* @__PURE__ */ t(sn, { open: S, onOpenChange: D, children: /* @__PURE__ */ t(
2331
+ b ? /* @__PURE__ */ t(sn, { open: S, onOpenChange: D, children: /* @__PURE__ */ t(
2325
2332
  on,
2326
2333
  {
2327
2334
  ref: u,
@@ -2330,19 +2337,19 @@ function bn({
2330
2337
  "data-testid": "anamnesis-compare-panel",
2331
2338
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
2332
2339
  children: /* @__PURE__ */ t(
2333
- Is,
2340
+ Rs,
2334
2341
  {
2335
2342
  visits: p,
2336
2343
  columns: P,
2337
- selectedIds: R,
2338
- onSelectionChange: V,
2339
- diff: B,
2344
+ selectedIds: I,
2345
+ onSelectionChange: U,
2346
+ diff: V,
2340
2347
  seriesByKey: G,
2341
- pathologies: A,
2348
+ pathologies: E,
2342
2349
  annotations: De,
2343
2350
  onSelectAnnotation: xa,
2344
2351
  t: a,
2345
- onClose: I
2352
+ onClose: F
2346
2353
  }
2347
2354
  )
2348
2355
  }
@@ -2352,7 +2359,7 @@ function bn({
2352
2359
  const Ce = ["clinician"], me = [
2353
2360
  "clinician",
2354
2361
  "patient"
2355
- ], qs = [
2362
+ ], Vs = [
2356
2363
  {
2357
2364
  id: "patient.identity",
2358
2365
  surface: "intake",
@@ -2528,16 +2535,16 @@ const Ce = ["clinician"], me = [
2528
2535
  rationale: "The per-tab export ENVELOPE — a title, a meta block and a list of tables. It carries no clinical content of its own: every table inside is gated on the concept it renders, so this row decides only whether a file may be produced at all. The whole-record workbook stays reserved by export.workbook.",
2529
2536
  status: "provisional"
2530
2537
  }
2531
- ], Vs = new Map(
2532
- qs.map((e) => [e.id, e])
2538
+ ], Bs = new Map(
2539
+ Vs.map((e) => [e.id, e])
2533
2540
  );
2534
- function Bs(e, a) {
2535
- const n = Vs.get(e);
2541
+ function Us(e, a) {
2542
+ const n = Bs.get(e);
2536
2543
  return n ? n.audiences.includes(a) : !1;
2537
2544
  }
2538
2545
  const qa = "export.tabDocument";
2539
2546
  function ee(e, a) {
2540
- return Bs(a, e.audience) ? !0 : (e.withheld.add(a), !1);
2547
+ return Us(a, e.audience) ? !0 : (e.withheld.add(a), !1);
2541
2548
  }
2542
2549
  function Nt(e) {
2543
2550
  if (e.key === "bmi") return "derived.bmi";
@@ -2564,7 +2571,7 @@ function Tt(e, a) {
2564
2571
  function St(e, a) {
2565
2572
  return e === "high" ? a("anamnesis.range.aboveRange") : e === "low" ? a("anamnesis.range.belowRange") : null;
2566
2573
  }
2567
- function Us(e) {
2574
+ function Ks(e) {
2568
2575
  return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
2569
2576
  }
2570
2577
  function qe(e) {
@@ -2573,7 +2580,7 @@ function qe(e) {
2573
2580
  return ha(a) ? a : null;
2574
2581
  }
2575
2582
  function Ia(e, a, n, i, s) {
2576
- const o = i ? Us(`${a.patient.lastName} ${a.patient.firstName}`) : "";
2583
+ const o = i ? Ks(`${a.patient.lastName} ${a.patient.firstName}`) : "";
2577
2584
  return [
2578
2585
  "anamnesis",
2579
2586
  e,
@@ -2585,12 +2592,12 @@ function Ia(e, a, n, i, s) {
2585
2592
  function xn(e, a) {
2586
2593
  return a(`anamnesis.export.audience.${e}`);
2587
2594
  }
2588
- function Ks(e, a) {
2595
+ function Hs(e, a) {
2589
2596
  return a(`anamnesis.export.tab.${e}`);
2590
2597
  }
2591
2598
  function At(e, a) {
2592
2599
  return a(`anamnesis.export.docTab.${e}`, {
2593
- defaultValue: Ks(e, a)
2600
+ defaultValue: Hs(e, a)
2594
2601
  });
2595
2602
  }
2596
2603
  function kn(e, a, n, i) {
@@ -2638,8 +2645,8 @@ function La(e, a, n, i = []) {
2638
2645
  locale: pn(n)
2639
2646
  };
2640
2647
  }
2641
- function Hs(e) {
2642
- var v;
2648
+ function js(e) {
2649
+ var b;
2643
2650
  const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: n, withheld: /* @__PURE__ */ new Set() };
2644
2651
  if (!ee(r, qa))
2645
2652
  return wn("summary", n, i);
@@ -2651,12 +2658,12 @@ function Hs(e) {
2651
2658
  if (C.length !== 0) {
2652
2659
  N.push(Ct(ye(f, i)));
2653
2660
  for (const k of C) {
2654
- const A = h.answers[k.key];
2655
- A && N.push({
2661
+ const E = h.answers[k.key];
2662
+ E && N.push({
2656
2663
  cells: [
2657
2664
  he(k, i),
2658
- ie(gn(A.value, k, i)),
2659
- i(`anamnesis.export.source.${A.origin}`)
2665
+ ie(gn(E.value, k, i)),
2666
+ i(`anamnesis.export.source.${E.origin}`)
2660
2667
  ]
2661
2668
  });
2662
2669
  }
@@ -2674,7 +2681,7 @@ function Hs(e) {
2674
2681
  emptyText: i("anamnesis.summary.noAnswers")
2675
2682
  });
2676
2683
  } else h || g.push(i("anamnesis.compile.noIntake"));
2677
- const p = qe(h == null ? void 0 : h.submittedAtIso) ?? qe((v = _a(a)) == null ? void 0 : v.dateIso) ?? qe(o);
2684
+ const p = qe(h == null ? void 0 : h.submittedAtIso) ?? qe((b = _a(a)) == null ? void 0 : b.dateIso) ?? qe(o);
2678
2685
  return La(
2679
2686
  {
2680
2687
  tab: "summary",
@@ -2732,7 +2739,7 @@ function Ka(e, a, n, i) {
2732
2739
  emptyText: i("anamnesis.export.none")
2733
2740
  };
2734
2741
  }
2735
- function js(e) {
2742
+ function Gs(e) {
2736
2743
  const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = { audience: n, withheld: /* @__PURE__ */ new Set() };
2737
2744
  if (!ee(r, qa))
2738
2745
  return wn("compile", n, i);
@@ -2781,7 +2788,7 @@ function js(e) {
2781
2788
  }), p.length > 0 && g.push(
2782
2789
  Ka("visit", i("anamnesis.section.visitMeta"), p, i)
2783
2790
  );
2784
- const v = Ua(
2791
+ const b = Ua(
2785
2792
  "anthropometrics",
2786
2793
  i("anamnesis.section.anthropometrics"),
2787
2794
  Ne(s, "anthropometric"),
@@ -2790,7 +2797,7 @@ function js(e) {
2790
2797
  i,
2791
2798
  !1
2792
2799
  );
2793
- v && g.push(v);
2800
+ b && g.push(b);
2794
2801
  const N = Ua(
2795
2802
  "dietary",
2796
2803
  i("anamnesis.section.dietary"),
@@ -2812,32 +2819,32 @@ function js(e) {
2812
2819
  header: i("anamnesis.export.column.description")
2813
2820
  }
2814
2821
  ],
2815
- rows: m.pathologyCodes.map((A) => ({
2816
- cells: [A, hn(A, i, k[A])]
2822
+ rows: m.pathologyCodes.map((E) => ({
2823
+ cells: [E, hn(E, i, k[E])]
2817
2824
  })),
2818
2825
  emptyText: i("anamnesis.export.none")
2819
2826
  });
2820
2827
  }
2821
2828
  if (ee(r, "oncological.history")) {
2822
- const k = m.oncological, A = [];
2829
+ const k = m.oncological, E = [];
2823
2830
  if (k) {
2824
- if (ie(k.tumourType) && A.push({
2831
+ if (ie(k.tumourType) && E.push({
2825
2832
  cells: [
2826
2833
  i("anamnesis.field.tumourType.label"),
2827
2834
  ie(k.tumourType)
2828
2835
  ]
2829
- }), ie(k.stage) && A.push({
2836
+ }), ie(k.stage) && E.push({
2830
2837
  cells: [i("anamnesis.field.stage.label"), ie(k.stage)]
2831
2838
  }), k.metastases) {
2832
2839
  const S = i(`anamnesis.common.${k.metastases.present}`), D = ie(k.metastases.site);
2833
- A.push({
2840
+ E.push({
2834
2841
  cells: [
2835
2842
  i("anamnesis.field.metastases.label"),
2836
2843
  D ? `${S} — ${D}` : S
2837
2844
  ]
2838
2845
  });
2839
2846
  }
2840
- ie(k.treatmentStatus) && A.push({
2847
+ ie(k.treatmentStatus) && E.push({
2841
2848
  cells: [
2842
2849
  i("anamnesis.field.treatmentStatus.label"),
2843
2850
  ie(k.treatmentStatus)
@@ -2848,7 +2855,7 @@ function js(e) {
2848
2855
  Ka(
2849
2856
  "oncological",
2850
2857
  i("anamnesis.section.oncological"),
2851
- A,
2858
+ E,
2852
2859
  i
2853
2860
  )
2854
2861
  );
@@ -2898,20 +2905,20 @@ function js(e) {
2898
2905
  })),
2899
2906
  emptyText: i("anamnesis.compile.noFmd")
2900
2907
  }), ee(r, "annual.programme")) {
2901
- const k = m.annualProgramme, A = [];
2908
+ const k = m.annualProgramme, E = [];
2902
2909
  if (k) {
2903
2910
  const S = (D) => i(D ? "anamnesis.common.yes" : "anamnesis.common.no");
2904
- A.push({
2911
+ E.push({
2905
2912
  cells: [
2906
2913
  i("anamnesis.field.annualProposed.label"),
2907
2914
  S(k.proposed)
2908
2915
  ]
2909
- }), A.push({
2916
+ }), E.push({
2910
2917
  cells: [
2911
2918
  i("anamnesis.field.annualAccepted.label"),
2912
2919
  S(k.accepted)
2913
2920
  ]
2914
- }), ie(k.declineReason) && A.push({
2921
+ }), ie(k.declineReason) && E.push({
2915
2922
  cells: [
2916
2923
  i("anamnesis.field.annualDeclineReason.label"),
2917
2924
  ie(k.declineReason)
@@ -2919,7 +2926,7 @@ function js(e) {
2919
2926
  });
2920
2927
  }
2921
2928
  g.push(
2922
- Ka("annual", i("anamnesis.section.annual"), A, i)
2929
+ Ka("annual", i("anamnesis.section.annual"), E, i)
2923
2930
  );
2924
2931
  }
2925
2932
  const C = [];
@@ -2963,7 +2970,7 @@ function js(e) {
2963
2970
  h
2964
2971
  );
2965
2972
  }
2966
- function Gs(e, a, n) {
2973
+ function Ws(e, a, n) {
2967
2974
  const i = a.map((s) => {
2968
2975
  var r;
2969
2976
  const o = ((r = e.cells[s.index]) == null ? void 0 : r.outOfRange) ?? null;
@@ -2974,18 +2981,18 @@ function Gs(e, a, n) {
2974
2981
  }).filter((s) => s != null);
2975
2982
  return i.length === 0 ? null : i.join(n("anamnesis.export.listSeparator"));
2976
2983
  }
2977
- function Ws(e, a) {
2984
+ function Qs(e, a) {
2978
2985
  var s, o;
2979
2986
  if (a.length < 2) return null;
2980
2987
  const n = ((s = e.cells[a[0].index]) == null ? void 0 : s.value) ?? null, i = ((o = e.cells[a[a.length - 1].index]) == null ? void 0 : o.value) ?? null;
2981
2988
  return n == null || i == null ? null : i - n;
2982
2989
  }
2983
- function Qs(e) {
2990
+ function Ys(e) {
2984
2991
  var C;
2985
2992
  const { record: a, audience: n, t: i, config: s } = e, o = e.generatedAtIso ?? (/* @__PURE__ */ new Date()).toISOString(), r = e.scope ?? "selected", l = { audience: n, withheld: /* @__PURE__ */ new Set() };
2986
2993
  if (!ee(l, qa))
2987
2994
  return wn("evolution", n, i);
2988
- const { meta: c, patientName: m } = kn(a, l, i, o), g = [], h = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null, v = p && p.length > 0 ? p : ma(a.visits), N = r === "all" ? wt(a.visits) : Da(a.visits, v).columns;
2995
+ const { meta: c, patientName: m } = kn(a, l, i, o), g = [], h = [], p = e.selectedVisitIds ? [...e.selectedVisitIds] : null, b = p && p.length > 0 ? p : ma(a.visits), N = r === "all" ? wt(a.visits) : Da(a.visits, b).columns;
2989
2996
  if (c.push({
2990
2997
  label: i("anamnesis.export.visitsLabel"),
2991
2998
  value: r === "all" ? i("anamnesis.export.visitsAll", { total: a.visits.length }) : i("anamnesis.export.visitsSelected", {
@@ -2993,7 +3000,7 @@ function Qs(e) {
2993
3000
  total: a.visits.length
2994
3001
  })
2995
3002
  }), ee(l, "visit.date") && N.length > 0) {
2996
- const k = Re(s), A = un(a, k), S = se(N[0].visit.dateIso, i), D = se(N[N.length - 1].visit.dateIso, i), E = [
3003
+ const k = Re(s), E = un(a, k), S = se(N[0].visit.dateIso, i), D = se(N[N.length - 1].visit.dateIso, i), A = [
2997
3004
  { key: "parameter", header: i("anamnesis.grid.parameter") },
2998
3005
  { key: "unit", header: i("anamnesis.export.column.unit") },
2999
3006
  {
@@ -3019,29 +3026,29 @@ function Qs(e) {
3019
3026
  numeric: !0
3020
3027
  },
3021
3028
  { key: "outOfRange", header: i("anamnesis.export.column.outOfRange") }
3022
- ], x = [];
3029
+ ], w = [];
3023
3030
  let u = null;
3024
- for (const T of A)
3025
- ee(l, Nt(T.def)) && (T.def.group !== u && (u = T.def.group, x.push(Ct(i(`anamnesis.group.${T.def.group}`)))), x.push({
3031
+ for (const T of E)
3032
+ ee(l, Nt(T.def)) && (T.def.group !== u && (u = T.def.group, w.push(Ct(i(`anamnesis.group.${T.def.group}`)))), w.push({
3026
3033
  precision: T.def.precision,
3027
3034
  cells: [
3028
3035
  Pe(T.def, i),
3029
3036
  T.def.unit ?? null,
3030
3037
  Tt(T.def, i),
3031
- ...N.map((w) => {
3032
- var I;
3033
- return ((I = T.cells[w.index]) == null ? void 0 : I.value) ?? null;
3038
+ ...N.map((y) => {
3039
+ var F;
3040
+ return ((F = T.cells[y.index]) == null ? void 0 : F.value) ?? null;
3034
3041
  }),
3035
3042
  T.target,
3036
- Ws(T, N),
3037
- Gs(T, N, i)
3043
+ Qs(T, N),
3044
+ Ws(T, N, i)
3038
3045
  ]
3039
3046
  }));
3040
3047
  g.push({
3041
3048
  id: "matrix",
3042
3049
  title: i("anamnesis.section.evolution"),
3043
- columns: E,
3044
- rows: x,
3050
+ columns: A,
3051
+ rows: w,
3045
3052
  emptyText: i("anamnesis.export.none")
3046
3053
  });
3047
3054
  } else N.length === 0 && h.push(i("anamnesis.export.none"));
@@ -3067,17 +3074,17 @@ function Qs(e) {
3067
3074
  h
3068
3075
  );
3069
3076
  }
3070
- function Ys(e, a) {
3077
+ function Xs(e, a) {
3071
3078
  switch (e) {
3072
3079
  case "summary":
3073
- return Hs(a);
3074
- case "compile":
3075
3080
  return js(a);
3081
+ case "compile":
3082
+ return Gs(a);
3076
3083
  case "evolution":
3077
- return Qs(a);
3084
+ return Ys(a);
3078
3085
  }
3079
3086
  }
3080
- function Xs(e, a) {
3087
+ function Js(e, a) {
3081
3088
  return a(`anamnesis.export.concept.${e.replace(/\./g, "_")}`, {
3082
3089
  defaultValue: e
3083
3090
  });
@@ -3085,12 +3092,12 @@ function Xs(e, a) {
3085
3092
  function _n(e, a) {
3086
3093
  return {
3087
3094
  included: e.tables.map((n) => n.title),
3088
- excluded: e.withheld.map((n) => Xs(n, a)).sort((n, i) => n.localeCompare(i, e.locale))
3095
+ excluded: e.withheld.map((n) => Js(n, a)).sort((n, i) => n.localeCompare(i, e.locale))
3089
3096
  };
3090
3097
  }
3091
- const Js = "text/csv;charset=utf-8", Zs = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $n = `\r
3092
- `, eo = /^[=+\-@\t\r]/;
3093
- function ao(e) {
3098
+ const Zs = "text/csv;charset=utf-8", eo = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $n = `\r
3099
+ `, ao = /^[=+\-@\t\r]/;
3100
+ function no(e) {
3094
3101
  var a;
3095
3102
  if (!e) return ".";
3096
3103
  try {
@@ -3102,25 +3109,25 @@ function ao(e) {
3102
3109
  }
3103
3110
  }
3104
3111
  function Nn(e) {
3105
- return ao(e) === "," ? { delimiter: ";", decimal: ",", eol: $n, bom: !0 } : { delimiter: ",", decimal: ".", eol: $n, bom: !0 };
3112
+ return no(e) === "," ? { delimiter: ";", decimal: ",", eol: $n, bom: !0 } : { delimiter: ",", decimal: ".", eol: $n, bom: !0 };
3106
3113
  }
3107
- function no(e, a, n) {
3114
+ function to(e, a, n) {
3108
3115
  if (!Number.isFinite(e)) return "";
3109
3116
  const i = a == null ? String(e) : e.toFixed(a);
3110
3117
  return n.decimal === "," ? i.replace(".", ",") : i;
3111
3118
  }
3112
3119
  function ze(e, a) {
3113
- const n = eo.test(e) ? `'${e}` : e;
3120
+ const n = ao.test(e) ? `'${e}` : e;
3114
3121
  return n.includes(a.delimiter) || n.includes('"') || n.includes(`
3115
3122
  `) || n.includes("\r") || n !== n.trim() ? `"${n.replace(/"/g, '""')}"` : n;
3116
3123
  }
3117
3124
  function zn(e, a, n) {
3118
- return e == null ? "" : typeof e == "number" ? no(e, n, a) : ze(e, a);
3125
+ return e == null ? "" : typeof e == "number" ? to(e, n, a) : ze(e, a);
3119
3126
  }
3120
3127
  function Et(e, a) {
3121
3128
  return e.precision ?? (a == null ? void 0 : a.precision);
3122
3129
  }
3123
- function to(e, a = Nn(e.locale)) {
3130
+ function io(e, a = Nn(e.locale)) {
3124
3131
  const n = [], i = (s) => n.push(s.join(a.delimiter));
3125
3132
  i([ze(e.title, a)]);
3126
3133
  for (const s of e.meta)
@@ -3155,11 +3162,11 @@ function to(e, a = Nn(e.locale)) {
3155
3162
  }
3156
3163
  return n.join(a.eol) + a.eol;
3157
3164
  }
3158
- function io(e, a = Nn(e.locale)) {
3159
- const n = to(e, a);
3160
- return new Blob([a.bom ? `\uFEFF${n}` : n], { type: Js });
3165
+ function so(e, a = Nn(e.locale)) {
3166
+ const n = io(e, a);
3167
+ return new Blob([a.bom ? `\uFEFF${n}` : n], { type: Zs });
3161
3168
  }
3162
- async function so() {
3169
+ async function oo() {
3163
3170
  const e = await import("./exceljs.min-D2MHbJsF.js").then((n) => n.e), a = e;
3164
3171
  return typeof a.Workbook == "function" ? e : a.default ?? e;
3165
3172
  }
@@ -3172,20 +3179,20 @@ function On(e, a) {
3172
3179
  }
3173
3180
  return a.add(i.toLowerCase()), i;
3174
3181
  }
3175
- function oo(e) {
3182
+ function ro(e) {
3176
3183
  if (e != null)
3177
3184
  return e > 0 ? `0.${"0".repeat(e)}` : "0";
3178
3185
  }
3179
- const ro = 12, lo = 60;
3180
- function co(e, a) {
3186
+ const lo = 12, co = 60;
3187
+ function mo(e, a) {
3181
3188
  const n = a.reduce(
3182
3189
  (i, s) => Math.max(i, s == null ? 0 : String(s).length),
3183
3190
  e.length
3184
3191
  );
3185
- return Math.min(lo, Math.max(ro, n + 2));
3192
+ return Math.min(co, Math.max(lo, n + 2));
3186
3193
  }
3187
- async function mo(e) {
3188
- const a = await so(), n = new a.Workbook();
3194
+ async function uo(e) {
3195
+ const a = await oo(), n = new a.Workbook();
3189
3196
  n.created = /* @__PURE__ */ new Date();
3190
3197
  const i = /* @__PURE__ */ new Set(), s = n.addWorksheet(On(e.title, i)), o = s.addRow([e.title]);
3191
3198
  o.font = { bold: !0 };
@@ -3202,27 +3209,27 @@ async function mo(e) {
3202
3209
  m.font = { bold: !0 }, c.views = [{ state: "frozen", ySplit: 1 }], l.rows.length === 0 && l.emptyText && c.addRow([l.emptyText]);
3203
3210
  for (const g of l.rows) {
3204
3211
  if (g.kind === "section") {
3205
- const v = c.addRow([g.cells[0] ?? null]);
3206
- v.font = { bold: !0 };
3212
+ const b = c.addRow([g.cells[0] ?? null]);
3213
+ b.font = { bold: !0 };
3207
3214
  continue;
3208
3215
  }
3209
- const h = l.columns.map((v, N) => g.cells[N] ?? null), p = c.addRow(h);
3210
- l.columns.forEach((v, N) => {
3216
+ const h = l.columns.map((b, N) => g.cells[N] ?? null), p = c.addRow(h);
3217
+ l.columns.forEach((b, N) => {
3211
3218
  const f = p.getCell(N + 1);
3212
3219
  if (typeof h[N] != "number") return;
3213
- const C = oo(Et(g, v));
3220
+ const C = ro(Et(g, b));
3214
3221
  C && (f.numFmt = C), f.alignment = { horizontal: "right" };
3215
3222
  });
3216
3223
  }
3217
3224
  l.columns.forEach((g, h) => {
3218
- c.getColumn(h + 1).width = co(
3225
+ c.getColumn(h + 1).width = mo(
3219
3226
  g.header,
3220
3227
  l.rows.map((p) => p.cells[h] ?? null)
3221
3228
  );
3222
3229
  });
3223
3230
  }
3224
3231
  const r = await n.xlsx.writeBuffer();
3225
- return new Blob([r], { type: Zs });
3232
+ return new Blob([r], { type: eo });
3226
3233
  }
3227
3234
  function Cn(e, a) {
3228
3235
  return `${e.fileStem}.${a}`;
@@ -3233,11 +3240,11 @@ function Tn(e, a) {
3233
3240
  const n = URL.createObjectURL(e), i = document.createElement("a");
3234
3241
  return i.href = n, i.download = a, document.body.appendChild(i), i.click(), i.remove(), window.setTimeout(() => URL.revokeObjectURL(n), 0), !0;
3235
3242
  }
3236
- function uo(e, a = Nn(e.locale)) {
3237
- return Tn(io(e, a), Cn(e, "csv"));
3243
+ function po(e, a = Nn(e.locale)) {
3244
+ return Tn(so(e, a), Cn(e, "csv"));
3238
3245
  }
3239
- async function po(e) {
3240
- return Tn(await mo(e), Cn(e, "xlsx"));
3246
+ async function ho(e) {
3247
+ return Tn(await uo(e), Cn(e, "xlsx"));
3241
3248
  }
3242
3249
  const Ue = {
3243
3250
  headerFill: [237, 237, 240],
@@ -3262,7 +3269,7 @@ function ea(e, a, n) {
3262
3269
  const l = r.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
3263
3270
  return l ? [Number(l[1]), Number(l[2]), Number(l[3])] : a;
3264
3271
  }
3265
- function ho(e) {
3272
+ function go(e) {
3266
3273
  return {
3267
3274
  headerFill: ea("--muted", Ue.headerFill, e),
3268
3275
  headerText: ea("--foreground", Ue.headerText, e),
@@ -3280,7 +3287,7 @@ function ho(e) {
3280
3287
  sectionFill: ea("--muted", Ue.sectionFill, e)
3281
3288
  };
3282
3289
  }
3283
- const go = [
3290
+ const fo = [
3284
3291
  ["→", "->"],
3285
3292
  // → the Evolution change header
3286
3293
  ["←", "<-"],
@@ -3349,17 +3356,17 @@ new Set(
3349
3356
  );
3350
3357
  function Oe(e) {
3351
3358
  let a = e;
3352
- for (const [n, i] of go)
3359
+ for (const [n, i] of fo)
3353
3360
  a.includes(n) && (a = a.split(n).join(i));
3354
3361
  return a;
3355
3362
  }
3356
- const te = 14, fo = 6, yo = 15, vo = 9, bo = 11, Mn = 8.5, qn = 8, $e = 5;
3357
- function xo(e) {
3363
+ const te = 14, yo = 6, vo = 15, bo = 9, xo = 11, Mn = 8.5, qn = 8, $e = 5;
3364
+ function ko(e) {
3358
3365
  return e.tables.some(
3359
- (a) => a.columns.length > fo
3366
+ (a) => a.columns.length > yo
3360
3367
  );
3361
3368
  }
3362
- function ko(e, a, n) {
3369
+ function wo(e, a, n) {
3363
3370
  if (!Number.isFinite(e)) return "";
3364
3371
  try {
3365
3372
  return new Intl.NumberFormat(n, {
@@ -3372,10 +3379,10 @@ function ko(e, a, n) {
3372
3379
  }
3373
3380
  function Dt(e, a, n) {
3374
3381
  return e == null ? "" : Oe(
3375
- typeof e == "number" ? ko(e, a, n) : e
3382
+ typeof e == "number" ? wo(e, a, n) : e
3376
3383
  );
3377
3384
  }
3378
- function wo(e, a, n) {
3385
+ function No(e, a, n) {
3379
3386
  return a.columns.map(
3380
3387
  (i, s) => Dt(
3381
3388
  e.cells[s] ?? null,
@@ -3390,31 +3397,31 @@ async function It(e, a = {}) {
3390
3397
  import("./jspdf.es.min-DaapWjR1.js").then((f) => f.j),
3391
3398
  import("./jspdf.plugin.autotable-CSiDNyPn.js")
3392
3399
  ]), s = a.palette ?? Ue, o = e.locale, r = new n({
3393
- orientation: xo(e) ? "landscape" : "portrait",
3400
+ orientation: ko(e) ? "landscape" : "portrait",
3394
3401
  unit: "mm",
3395
3402
  format: "a4"
3396
3403
  }), l = r.internal.pageSize.getWidth(), c = r.internal.pageSize.getHeight(), m = l - te * 2, g = (f, C, k) => {
3397
3404
  r.setFont("helvetica", f), r.setFontSize(C), r.setTextColor(k[0], k[1], k[2]);
3398
3405
  };
3399
3406
  let h = te;
3400
- g("bold", yo, s.headerText);
3407
+ g("bold", vo, s.headerText);
3401
3408
  for (const f of r.splitTextToSize(
3402
3409
  Oe(e.title),
3403
3410
  m
3404
3411
  ))
3405
3412
  r.text(f, te, h), h += $e + 1;
3406
- h += 1, g("normal", vo, s.mutedText);
3413
+ h += 1, g("normal", bo, s.mutedText);
3407
3414
  for (const f of e.meta)
3408
3415
  r.text(Oe(`${f.label}: ${f.value}`), te, h), h += $e - 0.6;
3409
3416
  for (const f of e.tables) {
3410
- if (h += $e, h > c - te * 2 && (r.addPage(), h = te), g("bold", bo, s.headerText), r.text(Oe(f.title), te, h), h += 2, f.rows.length === 0 && f.emptyText) {
3417
+ if (h += $e, h > c - te * 2 && (r.addPage(), h = te), g("bold", xo, s.headerText), r.text(Oe(f.title), te, h), h += 2, f.rows.length === 0 && f.emptyText) {
3411
3418
  h += $e, g("normal", Mn, s.mutedText), r.text(Oe(f.emptyText), te, h), h += 1;
3412
3419
  continue;
3413
3420
  }
3414
- const C = /* @__PURE__ */ new Set(), k = f.rows.map((D, E) => D.kind === "section" ? (C.add(E), [
3421
+ const C = /* @__PURE__ */ new Set(), k = f.rows.map((D, A) => D.kind === "section" ? (C.add(A), [
3415
3422
  Dt(D.cells[0] ?? null, void 0, o),
3416
3423
  ...f.columns.slice(1).map(() => "")
3417
- ]) : wo(D, f, o)), A = {}, S = {
3424
+ ]) : No(D, f, o)), E = {}, S = {
3418
3425
  head: [f.columns.map((D) => Oe(D.header))],
3419
3426
  body: k,
3420
3427
  startY: h + 2,
@@ -3436,8 +3443,8 @@ async function It(e, a = {}) {
3436
3443
  },
3437
3444
  alternateRowStyles: { fillColor: s.zebraFill },
3438
3445
  columnStyles: Object.fromEntries(
3439
- f.columns.map((D, E) => [
3440
- E,
3446
+ f.columns.map((D, A) => [
3447
+ A,
3441
3448
  D.numeric ? { halign: "right" } : {}
3442
3449
  ])
3443
3450
  ),
@@ -3445,10 +3452,10 @@ async function It(e, a = {}) {
3445
3452
  D.section === "body" && C.has(D.row.index) && (D.cell.styles.fillColor = s.sectionFill, D.cell.styles.textColor = s.headerText, D.cell.styles.fontStyle = "bold");
3446
3453
  },
3447
3454
  didDrawPage: (D) => {
3448
- A.table = D.table;
3455
+ E.table = D.table;
3449
3456
  }
3450
3457
  };
3451
- i(r, S), h = ((N = A.table) == null ? void 0 : N.finalY) ?? h + $e;
3458
+ i(r, S), h = ((N = E.table) == null ? void 0 : N.finalY) ?? h + $e;
3452
3459
  }
3453
3460
  if (e.footnotes.length > 0) {
3454
3461
  h += $e + 1, h > c - te * 2 && (r.addPage(), h = te), g("normal", qn, s.mutedText);
@@ -3458,30 +3465,30 @@ async function It(e, a = {}) {
3458
3465
  }
3459
3466
  const p = Oe(
3460
3467
  [e.patientName, e.audienceLabel].filter(Boolean).join(" · ")
3461
- ), v = r.getNumberOfPages();
3462
- for (let f = 1; f <= v; f += 1)
3468
+ ), b = r.getNumberOfPages();
3469
+ for (let f = 1; f <= b; f += 1)
3463
3470
  r.setPage(f), g("normal", qn, s.mutedText), p && r.text(p, te, c - te + 4), r.text(
3464
- `${f} / ${v}`,
3471
+ `${f} / ${b}`,
3465
3472
  l - te,
3466
3473
  c - te + 4,
3467
3474
  { align: "right" }
3468
3475
  );
3469
3476
  return a.autoPrint && r.autoPrint(), r.output("blob");
3470
3477
  }
3471
- async function No(e, a = {}) {
3478
+ async function Co(e, a = {}) {
3472
3479
  return Tn(
3473
3480
  await It(e, a),
3474
3481
  Cn(e, "pdf")
3475
3482
  );
3476
3483
  }
3477
- async function Co(e, a, n = {}) {
3484
+ async function To(e, a, n = {}) {
3478
3485
  if (!a || typeof URL > "u" || typeof URL.createObjectURL != "function")
3479
3486
  return null;
3480
3487
  const i = await It(e, { ...n, autoPrint: !0 }), s = URL.createObjectURL(i);
3481
3488
  return a.setAttribute("src", s), s;
3482
3489
  }
3483
3490
  const nn = ["clinician", "patient"];
3484
- function To({
3491
+ function So({
3485
3492
  tab: e,
3486
3493
  record: a,
3487
3494
  t: n,
@@ -3491,63 +3498,63 @@ function To({
3491
3498
  defaultShareOpen: r = !1,
3492
3499
  defaultAudience: l = "clinician"
3493
3500
  }) {
3494
- const [c, m] = z(l), [g, h] = z(!1), [p, v] = z(o), [N, f] = z(r), [C, k] = z(l), [A, S] = z({ text: "", seq: 0 }), D = we(null), E = we(null), x = we(null), u = we(!1), T = We();
3501
+ const [c, m] = $(l), [g, h] = $(!1), [p, b] = $(o), [N, f] = $(r), [C, k] = $(l), [E, S] = $({ text: "", seq: 0 }), D = we(null), A = we(null), w = we(null), u = we(!1), T = We();
3495
3502
  ia(
3496
3503
  () => () => {
3497
- x.current && URL.revokeObjectURL(x.current);
3504
+ w.current && URL.revokeObjectURL(w.current);
3498
3505
  },
3499
3506
  []
3500
3507
  );
3501
- const w = na(
3502
- (U) => Ys(e, {
3508
+ const y = na(
3509
+ (B) => Xs(e, {
3503
3510
  record: a,
3504
- audience: U,
3511
+ audience: B,
3505
3512
  t: n,
3506
3513
  config: i,
3507
3514
  selectedVisitIds: s,
3508
3515
  scope: g ? "all" : "selected"
3509
3516
  }),
3510
3517
  [e, a, n, i, s, g]
3511
- ), I = n(`anamnesis.export.tab.${e}`), $ = n("anamnesis.export.control.audienceBadge"), V = M(
3512
- () => p ? _n(w("patient"), n).excluded : [],
3513
- [p, w, n]
3514
- ), R = {
3515
- clinician: V.length > 0 ? n("anamnesis.export.control.holds", {
3516
- list: V.join(n("anamnesis.export.listSeparator"))
3518
+ ), F = n(`anamnesis.export.tab.${e}`), z = n("anamnesis.export.control.audienceBadge"), U = M(
3519
+ () => p ? _n(y("patient"), n).excluded : [],
3520
+ [p, y, n]
3521
+ ), I = {
3522
+ clinician: U.length > 0 ? n("anamnesis.export.control.holds", {
3523
+ list: U.join(n("anamnesis.export.listSeparator"))
3517
3524
  }) : n("anamnesis.export.control.holdsNone"),
3518
- patient: V.length > 0 ? n("anamnesis.export.control.excludes", {
3519
- list: V.join(n("anamnesis.export.listSeparator"))
3525
+ patient: U.length > 0 ? n("anamnesis.export.control.excludes", {
3526
+ list: U.join(n("anamnesis.export.listSeparator"))
3520
3527
  }) : n("anamnesis.export.control.excludesNone")
3521
3528
  }, P = M(
3522
- () => N ? _n(w(C), n) : { included: [], excluded: [] },
3523
- [N, w, C, n]
3524
- ), B = (U) => S((Z) => ({ text: U, seq: Z.seq + 1 })), G = (U, Z) => {
3529
+ () => N ? _n(y(C), n) : { included: [], excluded: [] },
3530
+ [N, y, C, n]
3531
+ ), V = (B) => S((Z) => ({ text: B, seq: Z.seq + 1 })), G = (B, Z) => {
3525
3532
  if (u.current) return;
3526
3533
  u.current = !0;
3527
- const de = w(c);
3534
+ const de = y(c);
3528
3535
  Promise.resolve(Z(de)).then(
3529
- (le) => B(
3536
+ (le) => V(
3530
3537
  le ? n("anamnesis.export.control.ready", {
3531
- file: `${de.fileStem}.${U}`
3538
+ file: `${de.fileStem}.${B}`
3532
3539
  }) : n("anamnesis.export.control.failed")
3533
3540
  )
3534
- ).catch(() => B(n("anamnesis.export.control.failed"))).finally(() => {
3541
+ ).catch(() => V(n("anamnesis.export.control.failed"))).finally(() => {
3535
3542
  u.current = !1;
3536
3543
  });
3537
- }, ne = () => ho(D.current), ue = () => G("pdf", (U) => No(U, { palette: ne() })), pe = () => G("xlsx", po), ce = () => G("csv", uo), J = () => {
3538
- u.current || (u.current = !0, Co(w(c), E.current, { palette: ne() }).then((U) => {
3539
- if (!U) {
3540
- B(n("anamnesis.export.control.failed"));
3544
+ }, ne = () => go(D.current), ue = () => G("pdf", (B) => Co(B, { palette: ne() })), pe = () => G("xlsx", ho), ce = () => G("csv", po), J = () => {
3545
+ u.current || (u.current = !0, To(y(c), A.current, { palette: ne() }).then((B) => {
3546
+ if (!B) {
3547
+ V(n("anamnesis.export.control.failed"));
3541
3548
  return;
3542
3549
  }
3543
- x.current && URL.revokeObjectURL(x.current), x.current = U, B(n("anamnesis.export.control.printing"));
3544
- }).catch(() => B(n("anamnesis.export.control.failed"))).finally(() => {
3550
+ w.current && URL.revokeObjectURL(w.current), w.current = B, V(n("anamnesis.export.control.printing"));
3551
+ }).catch(() => V(n("anamnesis.export.control.failed"))).finally(() => {
3545
3552
  u.current = !1;
3546
3553
  }));
3547
3554
  }, Ae = () => {
3548
3555
  k(c), f(!0);
3549
- }, L = () => {
3550
- m(C), f(!1), B(
3556
+ }, R = () => {
3557
+ m(C), f(!1), V(
3551
3558
  n("anamnesis.export.share.confirmed", {
3552
3559
  audience: n(`anamnesis.export.audience.${C}`)
3553
3560
  })
@@ -3568,14 +3575,14 @@ function To({
3568
3575
  variant: "warning",
3569
3576
  size: "sm",
3570
3577
  "data-testid": "anamnesis-export-audience",
3571
- children: $
3578
+ children: z
3572
3579
  }
3573
3580
  ) : null,
3574
3581
  /* @__PURE__ */ d(
3575
3582
  oe.Root,
3576
3583
  {
3577
3584
  open: p,
3578
- onOpenChange: v,
3585
+ onOpenChange: b,
3579
3586
  modal: !o,
3580
3587
  children: [
3581
3588
  /* @__PURE__ */ t(oe.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
@@ -3585,44 +3592,44 @@ function To({
3585
3592
  intent: "outline",
3586
3593
  size: "sm",
3587
3594
  endIcon: /* @__PURE__ */ t(ln, { "aria-hidden": "true" }),
3588
- "aria-label": c === "clinician" ? n("anamnesis.export.control.triggerLabel", { tab: I }) : n("anamnesis.export.control.triggerLabelAudience", {
3589
- tab: I,
3590
- audience: $
3595
+ "aria-label": c === "clinician" ? n("anamnesis.export.control.triggerLabel", { tab: F }) : n("anamnesis.export.control.triggerLabelAudience", {
3596
+ tab: F,
3597
+ audience: z
3591
3598
  }),
3592
3599
  "data-testid": "anamnesis-export-trigger",
3593
3600
  children: n("anamnesis.export.control.trigger")
3594
3601
  }
3595
3602
  ) }),
3596
3603
  /* @__PURE__ */ d(oe.Content, { align: "end", children: [
3597
- /* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.control.menuLabel", { tab: I }) }),
3604
+ /* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.control.menuLabel", { tab: F }) }),
3598
3605
  /* @__PURE__ */ t(oe.Separator, {}),
3599
3606
  /* @__PURE__ */ t(oe.Label, { children: n("anamnesis.export.audienceLabel") }),
3600
3607
  /* @__PURE__ */ t(
3601
3608
  oe.RadioGroup,
3602
3609
  {
3603
3610
  value: c,
3604
- onValueChange: (U) => m(U),
3605
- children: nn.map((U) => /* @__PURE__ */ t(
3611
+ onValueChange: (B) => m(B),
3612
+ children: nn.map((B) => /* @__PURE__ */ t(
3606
3613
  oe.RadioItem,
3607
3614
  {
3608
- value: U,
3609
- "aria-describedby": `${T}-${U}`,
3615
+ value: B,
3616
+ "aria-describedby": `${T}-${B}`,
3610
3617
  onSelect: (Z) => Z.preventDefault(),
3611
- children: n(`anamnesis.export.audience.${U}`)
3618
+ children: n(`anamnesis.export.audience.${B}`)
3612
3619
  },
3613
- U
3620
+ B
3614
3621
  ))
3615
3622
  }
3616
3623
  ),
3617
- /* @__PURE__ */ t(oe.Label, { "data-testid": "anamnesis-export-disclosure", children: R[c === "patient" ? "patient" : "clinician"] }),
3618
- nn.map((U) => /* @__PURE__ */ t(
3624
+ /* @__PURE__ */ t(oe.Label, { "data-testid": "anamnesis-export-disclosure", children: I[c === "patient" ? "patient" : "clinician"] }),
3625
+ nn.map((B) => /* @__PURE__ */ t(
3619
3626
  "span",
3620
3627
  {
3621
- id: `${T}-${U}`,
3628
+ id: `${T}-${B}`,
3622
3629
  className: "ds:sr-only",
3623
- children: R[U]
3630
+ children: I[B]
3624
3631
  },
3625
- U
3632
+ B
3626
3633
  )),
3627
3634
  e === "evolution" ? (
3628
3635
  /* SwitchItem, not CheckboxItem: a setting the menu keeps open,
@@ -3684,22 +3691,22 @@ function To({
3684
3691
  }
3685
3692
  ),
3686
3693
  /* @__PURE__ */ t(
3687
- So,
3694
+ Ao,
3688
3695
  {
3689
3696
  open: N,
3690
3697
  onOpenChange: f,
3691
3698
  audience: C,
3692
3699
  onAudienceChange: k,
3693
3700
  preview: P,
3694
- onConfirm: L,
3695
- tabName: I,
3701
+ onConfirm: R,
3702
+ tabName: F,
3696
3703
  t: n
3697
3704
  }
3698
3705
  ),
3699
3706
  /* @__PURE__ */ t(
3700
3707
  "iframe",
3701
3708
  {
3702
- ref: E,
3709
+ ref: A,
3703
3710
  title: n("anamnesis.export.control.printFrame"),
3704
3711
  "aria-hidden": "true",
3705
3712
  tabIndex: -1,
@@ -3713,14 +3720,14 @@ function To({
3713
3720
  "aria-live": "polite",
3714
3721
  "data-testid": "anamnesis-export-status",
3715
3722
  className: "type-body-sm ds:text-[color:var(--muted-foreground)]",
3716
- children: A.text ? `${A.text}${A.seq % 2 ? "​" : ""}` : ""
3723
+ children: E.text ? `${E.text}${E.seq % 2 ? "​" : ""}` : ""
3717
3724
  }
3718
3725
  )
3719
3726
  ]
3720
3727
  }
3721
3728
  );
3722
3729
  }
3723
- function So({
3730
+ function Ao({
3724
3731
  open: e,
3725
3732
  onOpenChange: a,
3726
3733
  audience: n,
@@ -3812,17 +3819,17 @@ function Vn({
3812
3819
  }
3813
3820
  );
3814
3821
  }
3815
- function Ao(e) {
3822
+ function Eo(e) {
3816
3823
  if (!e) return;
3817
3824
  const [a, n] = e.split(":").map((i) => Number.parseInt(i, 10));
3818
3825
  if (!(Number.isNaN(a) || Number.isNaN(n)))
3819
3826
  return { hours: a, minutes: n };
3820
3827
  }
3821
- function Eo(e) {
3828
+ function Do(e) {
3822
3829
  const a = (n) => String(n).padStart(2, "0");
3823
3830
  return `${a(e.hours)}:${a(e.minutes)}`;
3824
3831
  }
3825
- const Do = /* @__PURE__ */ new Set(["weightSelf", "waterPerDay"]);
3832
+ const Io = /* @__PURE__ */ new Set(["weightSelf", "waterPerDay"]);
3826
3833
  function Rt({
3827
3834
  def: e,
3828
3835
  answer: a,
@@ -3832,7 +3839,7 @@ function Rt({
3832
3839
  readOnly: o = !1,
3833
3840
  t: r
3834
3841
  }) {
3835
- const l = Qi(e, r), c = ot(e, r), m = i && s === "patient";
3842
+ const l = Yi(e, r), c = ot(e, r), m = i && s === "patient";
3836
3843
  let g = null;
3837
3844
  switch (e.type) {
3838
3845
  case "text": {
@@ -3869,7 +3876,7 @@ function Rt({
3869
3876
  disabled: o,
3870
3877
  value: h,
3871
3878
  min: 0,
3872
- mode: e.decimal || Do.has(e.key) ? "decimal" : "integer",
3879
+ mode: e.decimal || Io.has(e.key) ? "decimal" : "integer",
3873
3880
  onChange: (p) => n({ kind: "number", value: p })
3874
3881
  }
3875
3882
  ) });
@@ -3886,9 +3893,9 @@ function Rt({
3886
3893
  min: 0,
3887
3894
  max: 21,
3888
3895
  mode: "integer",
3889
- onChange: (v) => n({
3896
+ onChange: (b) => n({
3890
3897
  kind: "frequency",
3891
- perWeek: v,
3898
+ perWeek: b,
3892
3899
  detail: p || void 0
3893
3900
  })
3894
3901
  }
@@ -3898,10 +3905,10 @@ function Rt({
3898
3905
  {
3899
3906
  disabled: o,
3900
3907
  value: p,
3901
- onChange: (v) => n({
3908
+ onChange: (b) => n({
3902
3909
  kind: "frequency",
3903
3910
  perWeek: h,
3904
- detail: v.target.value || void 0
3911
+ detail: b.target.value || void 0
3905
3912
  })
3906
3913
  }
3907
3914
  ) }) : null
@@ -3919,9 +3926,9 @@ function Rt({
3919
3926
  description: c,
3920
3927
  variant: "horizontal",
3921
3928
  value: h,
3922
- onValueChange: (v) => n({
3929
+ onValueChange: (b) => n({
3923
3930
  kind: "yesNo",
3924
- present: v,
3931
+ present: b,
3925
3932
  detail: p || void 0
3926
3933
  }),
3927
3934
  children: [
@@ -3957,10 +3964,10 @@ function Rt({
3957
3964
  {
3958
3965
  disabled: o,
3959
3966
  value: p,
3960
- onChange: (v) => n({
3967
+ onChange: (b) => n({
3961
3968
  kind: "yesNo",
3962
3969
  present: h,
3963
- detail: v.target.value || void 0
3970
+ detail: b.target.value || void 0
3964
3971
  })
3965
3972
  }
3966
3973
  ) }) : null
@@ -3968,7 +3975,7 @@ function Rt({
3968
3975
  break;
3969
3976
  }
3970
3977
  case "choice": {
3971
- const h = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", p = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "", v = (e.options ?? []).map((N) => ({
3978
+ const h = (a == null ? void 0 : a.kind) === "choice" ? a.selected ?? "" : "", p = (a == null ? void 0 : a.kind) === "choice" ? a.detail ?? "" : "", b = (e.options ?? []).map((N) => ({
3972
3979
  value: N,
3973
3980
  // A practice-added option has no kit translation; show it verbatim
3974
3981
  // rather than the unresolved key.
@@ -3981,7 +3988,7 @@ function Rt({
3981
3988
  Me,
3982
3989
  {
3983
3990
  disabled: o,
3984
- options: v,
3991
+ options: b,
3985
3992
  value: h,
3986
3993
  placeholder: r("anamnesis.common.choose"),
3987
3994
  onValueChange: (N) => n({
@@ -4007,24 +4014,24 @@ function Rt({
4007
4014
  break;
4008
4015
  }
4009
4016
  case "multiChoice": {
4010
- const h = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], p = (v) => n({
4017
+ const h = (a == null ? void 0 : a.kind) === "multiChoice" ? a.selected : [], p = (b) => n({
4011
4018
  kind: "multiChoice",
4012
- selected: h.includes(v) ? h.filter((N) => N !== v) : [...h, v]
4019
+ selected: h.includes(b) ? h.filter((N) => N !== b) : [...h, b]
4013
4020
  });
4014
4021
  g = /* @__PURE__ */ d("fieldset", { className: "ds:m-0 ds:border-0 ds:p-0", children: [
4015
4022
  /* @__PURE__ */ t("legend", { className: "type-label ds:mb-[var(--spacing-2xs)] ds:text-[color:var(--foreground)]", children: l }),
4016
4023
  c ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:mb-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: c }) : null,
4017
- /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: (e.options ?? []).map((v) => /* @__PURE__ */ t(
4024
+ /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: (e.options ?? []).map((b) => /* @__PURE__ */ t(
4018
4025
  li,
4019
4026
  {
4020
4027
  disabled: o,
4021
- label: r(`anamnesis.field.${e.key}.option.${v}`, {
4022
- defaultValue: v
4028
+ label: r(`anamnesis.field.${e.key}.option.${b}`, {
4029
+ defaultValue: b
4023
4030
  }),
4024
- checked: h.includes(v),
4025
- onCheckedChange: () => p(v)
4031
+ checked: h.includes(b),
4032
+ onCheckedChange: () => p(b)
4026
4033
  },
4027
- v
4034
+ b
4028
4035
  )) })
4029
4036
  ] });
4030
4037
  break;
@@ -4038,10 +4045,10 @@ function Rt({
4038
4045
  ci,
4039
4046
  {
4040
4047
  disabled: o,
4041
- value: Ao(h),
4042
- onChange: (v) => n({
4048
+ value: Eo(h),
4049
+ onChange: (b) => n({
4043
4050
  kind: "meal",
4044
- time: Eo(v),
4051
+ time: Do(b),
4045
4052
  description: p
4046
4053
  })
4047
4054
  }
@@ -4051,10 +4058,10 @@ function Rt({
4051
4058
  {
4052
4059
  disabled: o,
4053
4060
  value: p,
4054
- onChange: (v) => n({
4061
+ onChange: (b) => n({
4055
4062
  kind: "meal",
4056
4063
  time: h,
4057
- description: v.target.value
4064
+ description: b.target.value
4058
4065
  })
4059
4066
  }
4060
4067
  ) }) })
@@ -4078,7 +4085,7 @@ function Rt({
4078
4085
  function Lt(e) {
4079
4086
  return Ne(e).filter((a) => a.goal === !0);
4080
4087
  }
4081
- const Io = {
4088
+ const Ro = {
4082
4089
  // ±2% of goal weight (≈1.2 kg at 62 kg) is the day-to-day hydration and
4083
4090
  // gut-content swing — indistinguishable from being at target. 10% is the
4084
4091
  // clinically meaningful unit of weight change (the 5–10% loss guidelines are
@@ -4111,43 +4118,43 @@ const Io = {
4111
4118
  approaching: 0.1,
4112
4119
  sided: "atLeast"
4113
4120
  }
4114
- }, Ro = {
4121
+ }, Lo = {
4115
4122
  kind: "relative",
4116
4123
  onTarget: 0.05,
4117
4124
  approaching: 0.15,
4118
4125
  sided: "both"
4119
4126
  };
4120
- function Lo(e) {
4121
- return Io[e] ?? Ro;
4127
+ function Fo(e) {
4128
+ return Ro[e] ?? Lo;
4122
4129
  }
4123
4130
  function Bn(e, a, n) {
4124
4131
  return e.kind === "absolute" ? a : Math.abs(n) * a;
4125
4132
  }
4126
- function Fo(e, a, n) {
4133
+ function Po(e, a, n) {
4127
4134
  if (e == null || !Number.isFinite(e) || a == null || !Number.isFinite(a)) return null;
4128
- const i = Lo(n), s = e - a;
4135
+ const i = Fo(n), s = e - a;
4129
4136
  if (i.sided === "atLeast" && s >= 0 || i.sided === "atMost" && s <= 0) return "onTarget";
4130
4137
  const o = Math.abs(s);
4131
4138
  return o <= Bn(i, i.onTarget, a) ? "onTarget" : o <= Bn(i, i.approaching, a) ? "approaching" : "offTarget";
4132
4139
  }
4133
- const Po = {
4140
+ const _o = {
4134
4141
  weight: { min: 20, max: 400, step: 0.1 },
4135
4142
  bmi: { min: 10, max: 60, step: 0.1 },
4136
4143
  waist: { min: 30, max: 250, step: 1 },
4137
4144
  energy: { min: 500, max: 6e3, step: 50 },
4138
4145
  protein: { min: 10, max: 400, step: 5 }
4139
4146
  };
4140
- function _o(e) {
4141
- const a = Po[e.key];
4147
+ function $o(e) {
4148
+ const a = _o[e.key];
4142
4149
  return a || { min: 0, max: 1e4, step: 10 ** -(e.precision ?? 0) };
4143
4150
  }
4144
- function $o(e, a) {
4151
+ function zo(e, a) {
4145
4152
  return e == null ? !0 : Number.isFinite(e) ? e >= a.min && e <= a.max : !1;
4146
4153
  }
4147
- function zo(e, a) {
4154
+ function Oo(e, a) {
4148
4155
  return e == null || a == null, e === a;
4149
4156
  }
4150
- function Oo(e, a) {
4157
+ function Mo(e, a) {
4151
4158
  return a.unit ? `${e.min}–${e.max} ${a.unit}` : `${e.min}–${e.max}`;
4152
4159
  }
4153
4160
  function Ft({
@@ -4158,7 +4165,7 @@ function Ft({
4158
4165
  t: s,
4159
4166
  onCommit: o
4160
4167
  }) {
4161
- const [r, l] = z(!1), [c, m] = z(n), g = _o(e), h = $o(c, g), p = !zo(c, n), v = Te(e, s), N = Oo(g, e), f = (k) => {
4168
+ const [r, l] = $(!1), [c, m] = $(n), g = $o(e), h = zo(c, g), p = !Oo(c, n), b = Te(e, s), N = Mo(g, e), f = (k) => {
4162
4169
  k && m(n), l(k);
4163
4170
  }, C = (k) => {
4164
4171
  o(k), l(!1);
@@ -4182,7 +4189,7 @@ function Ft({
4182
4189
  "data-testid": `anamnesis-target-form-${e.key}`,
4183
4190
  children: [
4184
4191
  /* @__PURE__ */ t(fe.Close, {}),
4185
- /* @__PURE__ */ t(fe.Heading, { children: s("anamnesis.targets.editTitle", { parameter: v }) }),
4192
+ /* @__PURE__ */ t(fe.Heading, { children: s("anamnesis.targets.editTitle", { parameter: b }) }),
4186
4193
  /* @__PURE__ */ t(fe.Description, { children: i }),
4187
4194
  /* @__PURE__ */ d("div", { className: "ds:mt-[var(--spacing-md)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
4188
4195
  /* @__PURE__ */ t(
@@ -4236,12 +4243,12 @@ function Ft({
4236
4243
  )
4237
4244
  ] });
4238
4245
  }
4239
- const Mo = {
4246
+ const qo = {
4240
4247
  onTarget: "success",
4241
4248
  approaching: "warning",
4242
4249
  offTarget: "error"
4243
4250
  };
4244
- function qo({
4251
+ function Vo({
4245
4252
  variant: e = "outlined",
4246
4253
  label: a,
4247
4254
  target: n,
@@ -4270,7 +4277,7 @@ function qo({
4270
4277
  // `mt-auto` pins it to the tile's foot, so a row of tiles stretched to
4271
4278
  // the tallest one lines its chips up instead of leaving a hole.
4272
4279
  /* @__PURE__ */ d("div", { className: "ds:mt-auto ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4273
- s ? /* @__PURE__ */ t(Q, { variant: Mo[s], size: "sm", withDot: !0, children: o }) : null,
4280
+ s ? /* @__PURE__ */ t(Q, { variant: qo[s], size: "sm", withDot: !0, children: o }) : null,
4274
4281
  r
4275
4282
  ] })
4276
4283
  ) : null
@@ -4282,15 +4289,16 @@ function Ha(e, a) {
4282
4289
  const n = Ve(e, a.precision);
4283
4290
  return a.unit ? `${n} ${a.unit}` : n;
4284
4291
  }
4285
- function Vo({ def: e, visit: a, target: n, t: i, onTargetChange: s }) {
4286
- const { t: o } = di(), r = Fe(a, e), l = Fo(r, n, e.key), c = i("anamnesis.targets.tileLabel", {
4292
+ function Bo({ def: e, visits: a, target: n, t: i, onTargetChange: s }) {
4293
+ var h;
4294
+ const { t: o } = di(), r = ((h = qi(a, e)) == null ? void 0 : h.value) ?? null, l = Po(r, n, e.key), c = i("anamnesis.targets.tileLabel", {
4287
4295
  name: Pe(e, i)
4288
4296
  }), m = e.computed && r != null, g = r == null ? i("anamnesis.targets.nowUnset") : m ? i("anamnesis.targets.nowBanded", {
4289
4297
  value: Ha(r, e),
4290
4298
  band: o(`bmiCalculator.category.${ui(r)}`)
4291
4299
  }) : i("anamnesis.targets.now", { value: Ha(r, e) });
4292
4300
  return /* @__PURE__ */ t(
4293
- qo,
4301
+ Vo,
4294
4302
  {
4295
4303
  variant: "elevated",
4296
4304
  label: c,
@@ -4306,17 +4314,17 @@ function Vo({ def: e, visit: a, target: n, t: i, onTargetChange: s }) {
4306
4314
  committed: n,
4307
4315
  nowLabel: g,
4308
4316
  t: i,
4309
- onCommit: (h) => s(e, h)
4317
+ onCommit: (p) => s(e, p)
4310
4318
  }
4311
4319
  )
4312
4320
  }
4313
4321
  );
4314
4322
  }
4315
- function Bo(e) {
4323
+ function Uo(e) {
4316
4324
  return e <= 1 ? "ds:grid-cols-1" : e === 2 ? "ds:grid-cols-2" : e === 3 ? "ds:grid-cols-2 ds:sm:grid-cols-3" : "ds:grid-cols-2 ds:sm:grid-cols-4";
4317
4325
  }
4318
4326
  function Pt({
4319
- visit: e,
4327
+ visits: e,
4320
4328
  defs: a,
4321
4329
  targets: n,
4322
4330
  t: i,
@@ -4338,12 +4346,12 @@ function Pt({
4338
4346
  /* @__PURE__ */ t(
4339
4347
  "div",
4340
4348
  {
4341
- className: `ds:grid ds:gap-[var(--spacing-md)] ${Bo(a.length)}`,
4349
+ className: `ds:grid ds:gap-[var(--spacing-md)] ${Uo(a.length)}`,
4342
4350
  children: a.map((o) => /* @__PURE__ */ t(
4343
- Vo,
4351
+ Bo,
4344
4352
  {
4345
4353
  def: o,
4346
- visit: e,
4354
+ visits: e,
4347
4355
  target: n.get(o.key) ?? null,
4348
4356
  t: i,
4349
4357
  onTargetChange: s
@@ -4368,7 +4376,7 @@ function ja({
4368
4376
  onTargetChange: l
4369
4377
  }) {
4370
4378
  return /* @__PURE__ */ t("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: a.filter((c) => !c.computed).map((c) => {
4371
- const m = Fe(n, c), g = i ? Fe(i, c) : null, h = i ? va(m, g, c) : null, p = ya(m, c.referenceRange), v = s.get(c.key) ?? null, N = Te(c, o), f = l != null && Pi(c.key) && !e.has(c.key);
4379
+ const m = Fe(n, c), g = i ? Fe(i, c) : null, h = i ? va(m, g, c) : null, p = ya(m, c.referenceRange), b = s.get(c.key) ?? null, N = Te(c, o), f = l != null && Pi(c.key) && !e.has(c.key);
4372
4380
  return /* @__PURE__ */ d(
4373
4381
  "div",
4374
4382
  {
@@ -4385,9 +4393,9 @@ function ja({
4385
4393
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
4386
4394
  p ? /* @__PURE__ */ t(fn, { flag: p, t: o }) : null,
4387
4395
  /* @__PURE__ */ t(za, { delta: h, def: c, t: o }),
4388
- f || v != null ? /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
4389
- /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: v == null ? o("anamnesis.targets.unset") : o("anamnesis.grid.target", {
4390
- value: Ve(v, c.precision),
4396
+ f || b != null ? /* @__PURE__ */ d("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
4397
+ /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: b == null ? o("anamnesis.targets.unset") : o("anamnesis.grid.target", {
4398
+ value: Ve(b, c.precision),
4391
4399
  unit: c.unit ?? ""
4392
4400
  }) }),
4393
4401
  f ? /* @__PURE__ */ t(
@@ -4395,7 +4403,7 @@ function ja({
4395
4403
  {
4396
4404
  def: c,
4397
4405
  label: N,
4398
- committed: v,
4406
+ committed: b,
4399
4407
  nowLabel: o("anamnesis.targets.now", {
4400
4408
  value: `${Ve(m, c.precision)} ${c.unit ?? ""}`.trim()
4401
4409
  }),
@@ -4470,7 +4478,7 @@ function ge({
4470
4478
  }
4471
4479
  );
4472
4480
  }
4473
- function Uo({
4481
+ function Ko({
4474
4482
  record: e,
4475
4483
  t: a,
4476
4484
  embedded: n = !1,
@@ -4484,70 +4492,70 @@ function Uo({
4484
4492
  practitioners: g,
4485
4493
  newVisitDateIso: h,
4486
4494
  defaultView: p = "summary",
4487
- defaultExportMenuOpen: v = !1,
4495
+ defaultExportMenuOpen: b = !1,
4488
4496
  defaultShareOpen: N = !1,
4489
4497
  defaultExportAudience: f = "clinician"
4490
4498
  }) {
4491
4499
  var An;
4492
- const [C, k] = z(
4500
+ const [C, k] = $(
4493
4501
  () => structuredClone(e)
4494
- ), A = we(!1);
4502
+ ), E = we(!1);
4495
4503
  ia(() => {
4496
- if (!A.current) {
4497
- A.current = !0;
4504
+ if (!E.current) {
4505
+ E.current = !0;
4498
4506
  return;
4499
4507
  }
4500
4508
  m == null || m(C);
4501
4509
  }, [C]);
4502
- const S = we(0), { patient: D, visits: E } = C, x = E[E.length - 1], u = E.length > 1 ? E[E.length - 2] : void 0, T = M(
4503
- () => new Map(C.targets.map((y) => [y.parameterKey, y.target])),
4510
+ const S = we(0), { patient: D, visits: A } = C, w = A[A.length - 1], u = A.length > 1 ? A[A.length - 2] : void 0, T = M(
4511
+ () => new Map(C.targets.map((v) => [v.parameterKey, v.target])),
4504
4512
  [C.targets]
4505
- ), w = M(
4513
+ ), y = M(
4506
4514
  () => Ne(i, "anthropometric"),
4507
4515
  [i]
4508
- ), I = M(
4516
+ ), F = M(
4509
4517
  () => Ne(i, "dietary"),
4510
4518
  [i]
4511
- ), $ = M(() => Ne(i, "lab"), [i]), V = M(() => Lt(i), [i]), R = M(
4512
- () => new Set(V.map((y) => y.key)),
4513
- [V]
4519
+ ), z = M(() => Ne(i, "lab"), [i]), U = M(() => Lt(i), [i]), I = M(
4520
+ () => new Set(U.map((v) => v.key)),
4521
+ [U]
4514
4522
  ), P = M(
4515
- () => Fn(x, $),
4516
- [x, $]
4517
- ), [B, G] = z(() => {
4518
- const y = Fn(x, $), b = {};
4519
- for (const F of ht) b[F] = y[F].open;
4520
- return b;
4523
+ () => Fn(w, z),
4524
+ [w, z]
4525
+ ), [V, G] = $(() => {
4526
+ const v = Fn(w, z), x = {};
4527
+ for (const L of ht) x[L] = v[L].open;
4528
+ return x;
4521
4529
  }), ne = na(
4522
- (y) => (b) => G((F) => ({ ...F, [y]: b })),
4530
+ (v) => (x) => G((L) => ({ ...L, [v]: x })),
4523
4531
  []
4524
4532
  ), ue = M(
4525
4533
  () => He(i),
4526
4534
  [i]
4527
- ), pe = M(() => dn(i), [i]), ce = M(() => Pa(i), [i]), [J, Ae] = z(p), [L, U] = z(!0), [Z, de] = z([]), le = na((y) => {
4535
+ ), pe = M(() => dn(i), [i]), ce = M(() => Pa(i), [i]), [J, Ae] = $(p), [R, B] = $(!0), [Z, de] = $([]), le = na((v) => {
4528
4536
  de(
4529
- (b) => b.length === y.length && b.every((F, K) => F === y[K]) ? b : [...y]
4537
+ (x) => x.length === v.length && x.every((L, K) => L === v[K]) ? x : [...v]
4530
4538
  );
4531
4539
  }, []), { containerRef: Ee, requestJump: De } = lt(), Ie = na(
4532
- (y) => {
4533
- var b, F;
4534
- return (F = (b = C.intake) == null ? void 0 : b.answers[y]) == null ? void 0 : F.value;
4540
+ (v) => {
4541
+ var x, L;
4542
+ return (L = (x = C.intake) == null ? void 0 : x.answers[v]) == null ? void 0 : L.value;
4535
4543
  },
4536
4544
  [C.intake]
4537
4545
  ), xa = M(
4538
- () => es(ue, Ie, D.sex, a),
4546
+ () => as(ue, Ie, D.sex, a),
4539
4547
  [ue, Ie, D.sex, a]
4540
4548
  ), la = M(
4541
4549
  () => rt(pe, Ie, D.sex, a),
4542
4550
  [pe, Ie, D.sex, a]
4543
- ), [O] = z(() => new Set(la.map((y) => y.key))), H = (y) => {
4551
+ ), [O] = $(() => new Set(la.map((v) => v.key))), H = (v) => {
4544
4552
  if (c) {
4545
- c(y);
4553
+ c(v);
4546
4554
  return;
4547
4555
  }
4548
- Ae("compile"), U(!0), De(y.key);
4556
+ Ae("compile"), B(!0), De(v.key);
4549
4557
  };
4550
- if (!x)
4558
+ if (!w)
4551
4559
  return /* @__PURE__ */ t(Un, { embedded: n, children: /* @__PURE__ */ t(ve, { variant: "elevated", children: /* @__PURE__ */ t(ve.Body, { children: /* @__PURE__ */ t(
4552
4560
  Be,
4553
4561
  {
@@ -4557,42 +4565,42 @@ function Uo({
4557
4565
  description: a("anamnesis.empty.noRecord.description")
4558
4566
  }
4559
4567
  ) }) }) });
4560
- const j = (y) => {
4561
- k((b) => {
4562
- if (b.visits.length === 0) return b;
4563
- const F = b.visits.slice();
4564
- return F[F.length - 1] = y(F[F.length - 1]), { ...b, visits: F };
4568
+ const j = (v) => {
4569
+ k((x) => {
4570
+ if (x.visits.length === 0) return x;
4571
+ const L = x.visits.slice();
4572
+ return L[L.length - 1] = v(L[L.length - 1]), { ...x, visits: L };
4565
4573
  });
4566
- }, be = (y, b) => j((F) => In(F, y, b)), Xe = (y, b, F) => k((K) => ({
4574
+ }, be = (v, x) => j((L) => In(L, v, x)), Xe = (v, x, L) => k((K) => ({
4567
4575
  ...K,
4568
4576
  visits: K.visits.map(
4569
- (Je) => Je.id === y.id ? In(Je, b, F) : Je
4577
+ (Je) => Je.id === v.id ? In(Je, x, L) : Je
4570
4578
  )
4571
- })), Va = (y, b) => {
4572
- k((F) => tt(F, y.key, b)), s == null || s(y.key, b);
4573
- }, Mt = (y) => j((b) => ({ ...b, pathologyCodes: y })), Sn = (y, b) => j((F) => ({
4574
- ...F,
4575
- therapy: F.therapy.map((K) => K.id === y ? { ...K, ...b } : K)
4576
- })), qt = (y) => j((b) => ({
4577
- ...b,
4578
- therapy: b.therapy.filter((F) => F.id !== y)
4579
+ })), Va = (v, x) => {
4580
+ k((L) => tt(L, v.key, x)), s == null || s(v.key, x);
4581
+ }, Mt = (v) => j((x) => ({ ...x, pathologyCodes: v })), Sn = (v, x) => j((L) => ({
4582
+ ...L,
4583
+ therapy: L.therapy.map((K) => K.id === v ? { ...K, ...x } : K)
4584
+ })), qt = (v) => j((x) => ({
4585
+ ...x,
4586
+ therapy: x.therapy.filter((L) => L.id !== v)
4579
4587
  })), Vt = () => {
4580
4588
  S.current += 1;
4581
- const y = `new-${S.current}`;
4582
- j((b) => ({
4583
- ...b,
4584
- therapy: [...b.therapy, { id: y, name: "", dose: "", kind: "medication" }]
4589
+ const v = `new-${S.current}`;
4590
+ j((x) => ({
4591
+ ...x,
4592
+ therapy: [...x.therapy, { id: v, name: "", dose: "", kind: "medication" }]
4585
4593
  }));
4586
4594
  }, Bt = () => {
4587
4595
  S.current += 1;
4588
- const y = `new-visit-${S.current}`;
4589
- k((b) => {
4590
- const F = b.visits[b.visits.length - 1];
4591
- if (!F) return b;
4596
+ const v = `new-visit-${S.current}`;
4597
+ k((x) => {
4598
+ const L = x.visits[x.visits.length - 1];
4599
+ if (!L) return x;
4592
4600
  const K = {
4593
- id: y,
4601
+ id: v,
4594
4602
  visitType: "followUp",
4595
- dateIso: h ?? F.dateIso,
4603
+ dateIso: h ?? L.dateIso,
4596
4604
  anthropometrics: {
4597
4605
  weightKg: null,
4598
4606
  heightCm: null,
@@ -4606,32 +4614,32 @@ function Uo({
4606
4614
  therapy: [],
4607
4615
  fmdCycles: []
4608
4616
  };
4609
- return { ...b, visits: [...b.visits, K] };
4617
+ return { ...x, visits: [...x.visits, K] };
4610
4618
  });
4611
- }, Ut = (y, b) => {
4612
- k((F) => {
4619
+ }, Ut = (v, x) => {
4620
+ k((L) => {
4613
4621
  var K;
4614
4622
  return {
4615
- ...F,
4623
+ ...L,
4616
4624
  intake: {
4617
- ...F.intake,
4625
+ ...L.intake,
4618
4626
  answers: {
4619
- ...(K = F.intake) == null ? void 0 : K.answers,
4620
- [y]: { value: b, origin: "clinician" }
4627
+ ...(K = L.intake) == null ? void 0 : K.answers,
4628
+ [v]: { value: x, origin: "clinician" }
4621
4629
  }
4622
4630
  }
4623
4631
  };
4624
4632
  });
4625
4633
  }, Kt = $i(i).map(
4626
- (y) => {
4627
- const b = ce[y], F = b == null ? void 0 : b.parentCode;
4634
+ (v) => {
4635
+ const x = ce[v], L = x == null ? void 0 : x.parentCode;
4628
4636
  return {
4629
- value: y,
4630
- label: Se(y, a, b),
4631
- group: F ? hn(F, a, ce[F]) : a("anamnesis.pathology.groupGeneral")
4637
+ value: v,
4638
+ label: Se(v, a, x),
4639
+ group: L ? hn(L, a, ce[L]) : a("anamnesis.pathology.groupGeneral")
4632
4640
  };
4633
4641
  }
4634
- ), ka = x.oncological ?? {}, wa = x.annualProgramme ?? {
4642
+ ), ka = w.oncological ?? {}, wa = w.annualProgramme ?? {
4635
4643
  proposed: !1,
4636
4644
  accepted: !1
4637
4645
  }, Ht = /* @__PURE__ */ d(Le, { children: [
@@ -4645,7 +4653,7 @@ function Uo({
4645
4653
  /* @__PURE__ */ d("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: [
4646
4654
  $a(C, a),
4647
4655
  " · ",
4648
- a("anamnesis.compile.visitCount", { visits: E.length })
4656
+ a("anamnesis.compile.visitCount", { visits: A.length })
4649
4657
  ] })
4650
4658
  ] }),
4651
4659
  r ? /* @__PURE__ */ t(
@@ -4660,8 +4668,8 @@ function Uo({
4660
4668
  o ? null : /* @__PURE__ */ t(
4661
4669
  Pt,
4662
4670
  {
4663
- visit: x,
4664
- defs: V,
4671
+ visits: A,
4672
+ defs: U,
4665
4673
  targets: T,
4666
4674
  t: a,
4667
4675
  onTargetChange: Va
@@ -4671,7 +4679,7 @@ function Uo({
4671
4679
  W,
4672
4680
  {
4673
4681
  value: J,
4674
- onValueChange: (y) => Ae(y),
4682
+ onValueChange: (v) => Ae(v),
4675
4683
  children: [
4676
4684
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
4677
4685
  /* @__PURE__ */ d(W.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
@@ -4680,21 +4688,21 @@ function Uo({
4680
4688
  /* @__PURE__ */ t(W.Trigger, { value: "evolution", children: a("anamnesis.compile.tabEvolution") })
4681
4689
  ] }),
4682
4690
  /* @__PURE__ */ t(
4683
- To,
4691
+ So,
4684
4692
  {
4685
4693
  tab: J,
4686
4694
  record: C,
4687
4695
  t: a,
4688
4696
  config: i,
4689
4697
  shownVisitIds: Z,
4690
- defaultOpen: v,
4698
+ defaultOpen: b,
4691
4699
  defaultShareOpen: N,
4692
4700
  defaultAudience: f
4693
4701
  }
4694
4702
  )
4695
4703
  ] }),
4696
4704
  /* @__PURE__ */ t(W.Content, { value: "summary", children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ t(
4697
- ls,
4705
+ cs,
4698
4706
  {
4699
4707
  intake: C.intake,
4700
4708
  sections: ue,
@@ -4721,10 +4729,10 @@ function Uo({
4721
4729
  label: a("anamnesis.visitType.followUp")
4722
4730
  }
4723
4731
  ],
4724
- value: x.visitType,
4725
- onValueChange: (y) => j((b) => ({
4726
- ...b,
4727
- visitType: y || "followUp"
4732
+ value: w.visitType,
4733
+ onValueChange: (v) => j((x) => ({
4734
+ ...x,
4735
+ visitType: v || "followUp"
4728
4736
  }))
4729
4737
  }
4730
4738
  ) }),
@@ -4732,29 +4740,29 @@ function Uo({
4732
4740
  Me,
4733
4741
  {
4734
4742
  options: g,
4735
- value: x.practitioner ?? "",
4736
- onValueChange: (y) => j((b) => ({
4737
- ...b,
4738
- practitioner: y || void 0
4743
+ value: w.practitioner ?? "",
4744
+ onValueChange: (v) => j((x) => ({
4745
+ ...x,
4746
+ practitioner: v || void 0
4739
4747
  }))
4740
4748
  }
4741
4749
  ) : /* @__PURE__ */ t(
4742
4750
  ae,
4743
4751
  {
4744
- value: x.practitioner ?? "",
4745
- onChange: (y) => j((b) => ({
4746
- ...b,
4747
- practitioner: y.target.value
4752
+ value: w.practitioner ?? "",
4753
+ onChange: (v) => j((x) => ({
4754
+ ...x,
4755
+ practitioner: v.target.value
4748
4756
  }))
4749
4757
  }
4750
4758
  ) }),
4751
4759
  /* @__PURE__ */ t(q, { label: a("anamnesis.header.visitDate"), children: /* @__PURE__ */ t(
4752
4760
  Yt,
4753
4761
  {
4754
- value: ji(x.dateIso),
4755
- onChange: (y) => y && j((b) => ({
4756
- ...b,
4757
- dateIso: Gi(y)
4762
+ value: Gi(w.dateIso),
4763
+ onChange: (v) => v && j((x) => ({
4764
+ ...x,
4765
+ dateIso: Wi(v)
4758
4766
  }))
4759
4767
  }
4760
4768
  ) })
@@ -4776,8 +4784,8 @@ function Uo({
4776
4784
  {
4777
4785
  titleKey: "anamnesis.section.intakeGaps",
4778
4786
  t: a,
4779
- open: L,
4780
- onOpenChange: U,
4787
+ open: R,
4788
+ onOpenChange: B,
4781
4789
  fill: la.length,
4782
4790
  fillKind: "outstanding",
4783
4791
  children: [
@@ -4787,33 +4795,33 @@ function Uo({
4787
4795
  {
4788
4796
  ref: Ee,
4789
4797
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]",
4790
- children: pe.map((y) => {
4791
- const b = y.fields.filter((F) => ra(F, D.sex)).filter((F) => O.has(F.key));
4792
- return b.length === 0 ? null : /* @__PURE__ */ d(
4798
+ children: pe.map((v) => {
4799
+ const x = v.fields.filter((L) => ra(L, D.sex)).filter((L) => O.has(L.key));
4800
+ return x.length === 0 ? null : /* @__PURE__ */ d(
4793
4801
  "div",
4794
4802
  {
4795
4803
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
4796
4804
  children: [
4797
- /* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(y, a) }),
4798
- b.map((F) => {
4805
+ /* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: ye(v, a) }),
4806
+ x.map((L) => {
4799
4807
  var Je;
4800
- const K = (Je = C.intake) == null ? void 0 : Je.answers[F.key];
4808
+ const K = (Je = C.intake) == null ? void 0 : Je.answers[L.key];
4801
4809
  return /* @__PURE__ */ t(
4802
4810
  Rt,
4803
4811
  {
4804
- def: F,
4812
+ def: L,
4805
4813
  answer: K == null ? void 0 : K.value,
4806
4814
  origin: K == null ? void 0 : K.origin,
4807
4815
  showOrigin: !0,
4808
- onChange: (jt) => Ut(F.key, jt),
4816
+ onChange: (jt) => Ut(L.key, jt),
4809
4817
  t: a
4810
4818
  },
4811
- F.key
4819
+ L.key
4812
4820
  );
4813
4821
  })
4814
4822
  ]
4815
4823
  },
4816
- y.key
4824
+ v.key
4817
4825
  );
4818
4826
  })
4819
4827
  }
@@ -4826,9 +4834,9 @@ function Uo({
4826
4834
  /* @__PURE__ */ t(
4827
4835
  ja,
4828
4836
  {
4829
- stripKeys: R,
4830
- defs: w,
4831
- visit: x,
4837
+ stripKeys: I,
4838
+ defs: y,
4839
+ visit: w,
4832
4840
  previous: u,
4833
4841
  targets: T,
4834
4842
  t: a,
@@ -4837,12 +4845,12 @@ function Uo({
4837
4845
  }
4838
4846
  )
4839
4847
  ] }),
4840
- I.length > 0 ? /* @__PURE__ */ t(ge, { titleKey: "anamnesis.section.dietary", t: a, children: /* @__PURE__ */ t(
4848
+ F.length > 0 ? /* @__PURE__ */ t(ge, { titleKey: "anamnesis.section.dietary", t: a, children: /* @__PURE__ */ t(
4841
4849
  ja,
4842
4850
  {
4843
- stripKeys: R,
4844
- defs: I,
4845
- visit: x,
4851
+ stripKeys: I,
4852
+ defs: F,
4853
+ visit: w,
4846
4854
  previous: u,
4847
4855
  targets: T,
4848
4856
  t: a,
@@ -4859,7 +4867,7 @@ function Uo({
4859
4867
  rn,
4860
4868
  {
4861
4869
  options: Kt,
4862
- value: x.pathologyCodes,
4870
+ value: w.pathologyCodes,
4863
4871
  allowClear: !0,
4864
4872
  placeholder: a(
4865
4873
  "anamnesis.compile.pathologiesPlaceholder"
@@ -4874,7 +4882,7 @@ function Uo({
4874
4882
  {
4875
4883
  titleKey: "anamnesis.section.oncological",
4876
4884
  t: a,
4877
- open: B.oncological,
4885
+ open: V.oncological,
4878
4886
  onOpenChange: ne("oncological"),
4879
4887
  fill: P.oncological.fill,
4880
4888
  children: /* @__PURE__ */ d("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
@@ -4882,11 +4890,11 @@ function Uo({
4882
4890
  ae,
4883
4891
  {
4884
4892
  value: ka.tumourType ?? "",
4885
- onChange: (y) => j((b) => ({
4886
- ...b,
4893
+ onChange: (v) => j((x) => ({
4894
+ ...x,
4887
4895
  oncological: {
4888
- ...b.oncological,
4889
- tumourType: y.target.value
4896
+ ...x.oncological,
4897
+ tumourType: v.target.value
4890
4898
  }
4891
4899
  }))
4892
4900
  }
@@ -4895,11 +4903,11 @@ function Uo({
4895
4903
  ae,
4896
4904
  {
4897
4905
  value: ka.stage ?? "",
4898
- onChange: (y) => j((b) => ({
4899
- ...b,
4906
+ onChange: (v) => j((x) => ({
4907
+ ...x,
4900
4908
  oncological: {
4901
- ...b.oncological,
4902
- stage: y.target.value
4909
+ ...x.oncological,
4910
+ stage: v.target.value
4903
4911
  }
4904
4912
  }))
4905
4913
  }
@@ -4910,15 +4918,15 @@ function Uo({
4910
4918
  label: a("anamnesis.field.metastases.label"),
4911
4919
  variant: "horizontal",
4912
4920
  value: ((An = ka.metastases) == null ? void 0 : An.present) ?? "unknown",
4913
- onValueChange: (y) => j((b) => {
4914
- var F, K;
4921
+ onValueChange: (v) => j((x) => {
4922
+ var L, K;
4915
4923
  return {
4916
- ...b,
4924
+ ...x,
4917
4925
  oncological: {
4918
- ...b.oncological,
4926
+ ...x.oncological,
4919
4927
  metastases: {
4920
- present: y,
4921
- site: (K = (F = b.oncological) == null ? void 0 : F.metastases) == null ? void 0 : K.site
4928
+ present: v,
4929
+ site: (K = (L = x.oncological) == null ? void 0 : L.metastases) == null ? void 0 : K.site
4922
4930
  }
4923
4931
  }
4924
4932
  };
@@ -4944,11 +4952,11 @@ function Uo({
4944
4952
  ae,
4945
4953
  {
4946
4954
  value: ka.treatmentStatus ?? "",
4947
- onChange: (y) => j((b) => ({
4948
- ...b,
4955
+ onChange: (v) => j((x) => ({
4956
+ ...x,
4949
4957
  oncological: {
4950
- ...b.oncological,
4951
- treatmentStatus: y.target.value
4958
+ ...x.oncological,
4959
+ treatmentStatus: v.target.value
4952
4960
  }
4953
4961
  }))
4954
4962
  }
@@ -4959,7 +4967,7 @@ function Uo({
4959
4967
  }
4960
4968
  ),
4961
4969
  /* @__PURE__ */ t(ge, { titleKey: "anamnesis.section.therapy", t: a, children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
4962
- x.therapy.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noTherapy") }) : x.therapy.map((y) => /* @__PURE__ */ d(
4970
+ w.therapy.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noTherapy") }) : w.therapy.map((v) => /* @__PURE__ */ d(
4963
4971
  "div",
4964
4972
  {
4965
4973
  className: "ds:flex ds:flex-wrap ds:items-end ds:gap-[var(--spacing-sm)]",
@@ -4971,9 +4979,9 @@ function Uo({
4971
4979
  children: /* @__PURE__ */ t(
4972
4980
  ae,
4973
4981
  {
4974
- value: y.name,
4975
- onChange: (b) => Sn(y.id, {
4976
- name: b.target.value
4982
+ value: v.name,
4983
+ onChange: (x) => Sn(v.id, {
4984
+ name: x.target.value
4977
4985
  })
4978
4986
  }
4979
4987
  )
@@ -4982,18 +4990,18 @@ function Uo({
4982
4990
  /* @__PURE__ */ t(q, { label: a("anamnesis.field.medDose.label"), children: /* @__PURE__ */ t(
4983
4991
  ae,
4984
4992
  {
4985
- value: y.dose ?? "",
4986
- onChange: (b) => Sn(y.id, {
4987
- dose: b.target.value
4993
+ value: v.dose ?? "",
4994
+ onChange: (x) => Sn(v.id, {
4995
+ dose: x.target.value
4988
4996
  })
4989
4997
  }
4990
4998
  ) }),
4991
4999
  /* @__PURE__ */ t(
4992
5000
  Q,
4993
5001
  {
4994
- variant: y.kind === "medication" ? "info" : "neutral",
5002
+ variant: v.kind === "medication" ? "info" : "neutral",
4995
5003
  size: "md",
4996
- children: a(`anamnesis.medKind.${y.kind}`)
5004
+ children: a(`anamnesis.medKind.${v.kind}`)
4997
5005
  }
4998
5006
  ),
4999
5007
  /* @__PURE__ */ t(
@@ -5002,14 +5010,14 @@ function Uo({
5002
5010
  icon: /* @__PURE__ */ t(pi, { "aria-hidden": "true" }),
5003
5011
  intent: "ghost",
5004
5012
  "aria-label": a("anamnesis.compile.removeTherapy", {
5005
- name: y.name
5013
+ name: v.name
5006
5014
  }),
5007
- onClick: () => qt(y.id)
5015
+ onClick: () => qt(v.id)
5008
5016
  }
5009
5017
  )
5010
5018
  ]
5011
5019
  },
5012
- y.id
5020
+ v.id
5013
5021
  )),
5014
5022
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
5015
5023
  X,
@@ -5027,16 +5035,16 @@ function Uo({
5027
5035
  {
5028
5036
  titleKey: "anamnesis.section.labs",
5029
5037
  t: a,
5030
- open: B.labs,
5038
+ open: V.labs,
5031
5039
  onOpenChange: ne("labs"),
5032
5040
  fill: P.labs.fill,
5033
5041
  flagged: P.labs.flagged,
5034
5042
  children: /* @__PURE__ */ t(
5035
5043
  ja,
5036
5044
  {
5037
- stripKeys: R,
5038
- defs: $,
5039
- visit: x,
5045
+ stripKeys: I,
5046
+ defs: z,
5047
+ visit: w,
5040
5048
  previous: u,
5041
5049
  targets: T,
5042
5050
  t: a,
@@ -5050,21 +5058,21 @@ function Uo({
5050
5058
  {
5051
5059
  titleKey: "anamnesis.section.fmd",
5052
5060
  t: a,
5053
- open: B.fmd,
5061
+ open: V.fmd,
5054
5062
  onOpenChange: ne("fmd"),
5055
5063
  fill: P.fmd.fill,
5056
- children: x.fmdCycles.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noFmd") }) : /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: x.fmdCycles.map((y) => /* @__PURE__ */ d(
5064
+ children: w.fmdCycles.length === 0 ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.compile.noFmd") }) : /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: w.fmdCycles.map((v) => /* @__PURE__ */ d(
5057
5065
  "li",
5058
5066
  {
5059
5067
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
5060
5068
  children: [
5061
5069
  /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: a("anamnesis.compile.cycleNumber", {
5062
- number: y.cycleNumber
5070
+ number: v.cycleNumber
5063
5071
  }) }),
5064
5072
  /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: /* @__PURE__ */ t(
5065
5073
  sa,
5066
5074
  {
5067
- value: y.startDateIso,
5075
+ value: v.startDateIso,
5068
5076
  format: "absolute",
5069
5077
  shape: "bare",
5070
5078
  absoluteFormat: Ye
@@ -5073,15 +5081,15 @@ function Uo({
5073
5081
  /* @__PURE__ */ t(
5074
5082
  Q,
5075
5083
  {
5076
- variant: y.completed ? "success" : "warning",
5084
+ variant: v.completed ? "success" : "warning",
5077
5085
  size: "sm",
5078
5086
  withDot: !0,
5079
- children: y.completed ? a("anamnesis.compile.cycleCompleted") : a("anamnesis.compile.cycleInProgress")
5087
+ children: v.completed ? a("anamnesis.compile.cycleCompleted") : a("anamnesis.compile.cycleInProgress")
5080
5088
  }
5081
5089
  )
5082
5090
  ]
5083
5091
  },
5084
- y.cycleNumber
5092
+ v.cycleNumber
5085
5093
  )) })
5086
5094
  }
5087
5095
  ),
@@ -5093,12 +5101,12 @@ function Uo({
5093
5101
  children: /* @__PURE__ */ t(
5094
5102
  ta,
5095
5103
  {
5096
- value: x.nutritionalProposal ?? "",
5104
+ value: w.nutritionalProposal ?? "",
5097
5105
  autoResize: !0,
5098
5106
  minRows: 2,
5099
- onChange: (y) => j((b) => ({
5100
- ...b,
5101
- nutritionalProposal: y.target.value
5107
+ onChange: (v) => j((x) => ({
5108
+ ...x,
5109
+ nutritionalProposal: v.target.value
5102
5110
  }))
5103
5111
  }
5104
5112
  )
@@ -5107,12 +5115,12 @@ function Uo({
5107
5115
  /* @__PURE__ */ t(q, { label: a("anamnesis.field.clinicalNotes.label"), children: /* @__PURE__ */ t(
5108
5116
  ta,
5109
5117
  {
5110
- value: x.clinicalNotes ?? "",
5118
+ value: w.clinicalNotes ?? "",
5111
5119
  autoResize: !0,
5112
5120
  minRows: 2,
5113
- onChange: (y) => j((b) => ({
5114
- ...b,
5115
- clinicalNotes: y.target.value
5121
+ onChange: (v) => j((x) => ({
5122
+ ...x,
5123
+ clinicalNotes: v.target.value
5116
5124
  }))
5117
5125
  }
5118
5126
  ) })
@@ -5122,7 +5130,7 @@ function Uo({
5122
5130
  {
5123
5131
  titleKey: "anamnesis.section.annual",
5124
5132
  t: a,
5125
- open: B.annual,
5133
+ open: V.annual,
5126
5134
  onOpenChange: ne("annual"),
5127
5135
  fill: P.annual.fill,
5128
5136
  children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
@@ -5132,14 +5140,14 @@ function Uo({
5132
5140
  label: a("anamnesis.field.annualProposed.label"),
5133
5141
  variant: "horizontal",
5134
5142
  value: wa.proposed ? "yes" : "no",
5135
- onValueChange: (y) => j((b) => {
5136
- var F, K;
5143
+ onValueChange: (v) => j((x) => {
5144
+ var L, K;
5137
5145
  return {
5138
- ...b,
5146
+ ...x,
5139
5147
  annualProgramme: {
5140
- proposed: y === "yes",
5141
- accepted: ((F = b.annualProgramme) == null ? void 0 : F.accepted) ?? !1,
5142
- declineReason: (K = b.annualProgramme) == null ? void 0 : K.declineReason
5148
+ proposed: v === "yes",
5149
+ accepted: ((L = x.annualProgramme) == null ? void 0 : L.accepted) ?? !1,
5150
+ declineReason: (K = x.annualProgramme) == null ? void 0 : K.declineReason
5143
5151
  }
5144
5152
  };
5145
5153
  }),
@@ -5155,14 +5163,14 @@ function Uo({
5155
5163
  label: a("anamnesis.field.annualAccepted.label"),
5156
5164
  variant: "horizontal",
5157
5165
  value: wa.accepted ? "yes" : "no",
5158
- onValueChange: (y) => j((b) => {
5159
- var F, K;
5166
+ onValueChange: (v) => j((x) => {
5167
+ var L, K;
5160
5168
  return {
5161
- ...b,
5169
+ ...x,
5162
5170
  annualProgramme: {
5163
- proposed: ((F = b.annualProgramme) == null ? void 0 : F.proposed) ?? !1,
5164
- accepted: y === "yes",
5165
- declineReason: (K = b.annualProgramme) == null ? void 0 : K.declineReason
5171
+ proposed: ((L = x.annualProgramme) == null ? void 0 : L.proposed) ?? !1,
5172
+ accepted: v === "yes",
5173
+ declineReason: (K = x.annualProgramme) == null ? void 0 : K.declineReason
5166
5174
  }
5167
5175
  };
5168
5176
  }),
@@ -5182,14 +5190,14 @@ function Uo({
5182
5190
  value: wa.declineReason ?? "",
5183
5191
  autoResize: !0,
5184
5192
  minRows: 2,
5185
- onChange: (y) => j((b) => {
5186
- var F, K;
5193
+ onChange: (v) => j((x) => {
5194
+ var L, K;
5187
5195
  return {
5188
- ...b,
5196
+ ...x,
5189
5197
  annualProgramme: {
5190
- proposed: ((F = b.annualProgramme) == null ? void 0 : F.proposed) ?? !1,
5191
- accepted: ((K = b.annualProgramme) == null ? void 0 : K.accepted) ?? !1,
5192
- declineReason: y.target.value
5198
+ proposed: ((L = x.annualProgramme) == null ? void 0 : L.proposed) ?? !1,
5199
+ accepted: ((K = x.annualProgramme) == null ? void 0 : K.accepted) ?? !1,
5200
+ declineReason: v.target.value
5193
5201
  }
5194
5202
  };
5195
5203
  })
@@ -5243,27 +5251,27 @@ function _t({
5243
5251
  jumpToField: r,
5244
5252
  readOnly: l = !1
5245
5253
  }) {
5246
- const { patient: c } = e, m = _a(e), [g, h] = z(() => Kn(e)), [p, v] = z(e);
5247
- e !== p && (v(e), h(Kn(e)));
5248
- const [N, f] = z(
5254
+ const { patient: c } = e, m = _a(e), [g, h] = $(() => Kn(e)), [p, b] = $(e);
5255
+ e !== p && (b(e), h(Kn(e)));
5256
+ const [N, f] = $(
5249
5257
  () => {
5250
5258
  var P;
5251
5259
  return ((P = e.intake) == null ? void 0 : P.submittedAtIso) != null;
5252
5260
  }
5253
- ), C = (P, B) => {
5254
- h((G) => ({ ...G, [P]: B }));
5261
+ ), C = (P, V) => {
5262
+ h((G) => ({ ...G, [P]: V }));
5255
5263
  }, k = M(
5256
5264
  () => dn(i).map((P) => ({
5257
5265
  ...P,
5258
- fields: P.fields.filter((B) => ra(B, c.sex))
5266
+ fields: P.fields.filter((V) => ra(V, c.sex))
5259
5267
  })).filter((P) => P.fields.length > 0),
5260
5268
  [i, c.sex]
5261
- ), [A, S] = z(
5269
+ ), [E, S] = $(
5262
5270
  () => {
5263
5271
  var P;
5264
5272
  return s ?? ((P = k[0]) == null ? void 0 : P.key) ?? "";
5265
5273
  }
5266
- ), { containerRef: D, requestJump: E } = lt(), x = M(
5274
+ ), { containerRef: D, requestJump: A } = lt(), w = M(
5267
5275
  () => rt(
5268
5276
  k,
5269
5277
  (P) => g[P],
@@ -5272,25 +5280,25 @@ function _t({
5272
5280
  ),
5273
5281
  [k, g, c.sex, a]
5274
5282
  ), u = (P) => {
5275
- S(P.sectionKey), E(P.key);
5283
+ S(P.sectionKey), A(P.key);
5276
5284
  };
5277
5285
  ia(() => {
5278
5286
  if (!r) return;
5279
5287
  const P = k.find(
5280
- (B) => B.fields.some((G) => G.key === r)
5288
+ (V) => V.fields.some((G) => G.key === r)
5281
5289
  );
5282
- P && (S(P.key), E(r));
5290
+ P && (S(P.key), A(r));
5283
5291
  }, [r]);
5284
- const { answeredCount: T, totalCount: w } = M(() => {
5285
- let P = 0, B = 0;
5292
+ const { answeredCount: T, totalCount: y } = M(() => {
5293
+ let P = 0, V = 0;
5286
5294
  for (const G of k)
5287
5295
  for (const ne of G.fields)
5288
- B += 1, ga(g[ne.key]) && (P += 1);
5289
- return { answeredCount: P, totalCount: B };
5290
- }, [k, g]), I = w === 0 ? 0 : Math.round(T / w * 100), $ = a("anamnesis.intake.answered", {
5296
+ V += 1, ga(g[ne.key]) && (P += 1);
5297
+ return { answeredCount: P, totalCount: V };
5298
+ }, [k, g]), F = y === 0 ? 0 : Math.round(T / y * 100), z = a("anamnesis.intake.answered", {
5291
5299
  answered: T,
5292
- total: w
5293
- }), V = x.length > 0 && (T > 0 || N), R = /* @__PURE__ */ d(Le, { children: [
5300
+ total: y
5301
+ }), U = w.length > 0 && (T > 0 || N), I = /* @__PURE__ */ d(Le, { children: [
5294
5302
  n ? null : /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
5295
5303
  /* @__PURE__ */ t("h1", { className: "type-title-page ds:m-0 ds:text-[color:var(--foreground)]", children: a("anamnesis.intake.title") }),
5296
5304
  /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.intake.subtitle") })
@@ -5334,20 +5342,20 @@ function _t({
5334
5342
  ] }) : null
5335
5343
  ] }),
5336
5344
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
5337
- /* @__PURE__ */ t(vi, { value: I, ariaLabel: $ }),
5345
+ /* @__PURE__ */ t(vi, { value: F, ariaLabel: z }),
5338
5346
  /* @__PURE__ */ t(
5339
5347
  "p",
5340
5348
  {
5341
5349
  className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]",
5342
5350
  "aria-live": "polite",
5343
- children: $
5351
+ children: z
5344
5352
  }
5345
5353
  )
5346
5354
  ] }),
5347
- V ? /* @__PURE__ */ t(
5355
+ U ? /* @__PURE__ */ t(
5348
5356
  ct,
5349
5357
  {
5350
- missing: x,
5358
+ missing: w,
5351
5359
  t: a,
5352
5360
  onJump: u,
5353
5361
  announce: "off"
@@ -5374,17 +5382,17 @@ function _t({
5374
5382
  type: "single",
5375
5383
  collapsible: !0,
5376
5384
  variant: "default",
5377
- value: A,
5385
+ value: E,
5378
5386
  onValueChange: S,
5379
5387
  children: k.map((P) => {
5380
- const B = P.fields.filter(
5388
+ const V = P.fields.filter(
5381
5389
  (G) => ga(g[G.key])
5382
5390
  ).length;
5383
5391
  return /* @__PURE__ */ d(gi, { value: P.key, children: [
5384
5392
  /* @__PURE__ */ t(fi, { children: /* @__PURE__ */ d("span", { className: "ds:flex ds:w-full ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
5385
5393
  /* @__PURE__ */ t("span", { children: ye(P, a) }),
5386
5394
  /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.intake.sectionProgress", {
5387
- answered: B,
5395
+ answered: V,
5388
5396
  total: P.fields.length
5389
5397
  }) })
5390
5398
  ] }) }),
@@ -5429,7 +5437,7 @@ function _t({
5429
5437
  ) })
5430
5438
  ] })
5431
5439
  ] });
5432
- return n ? /* @__PURE__ */ t("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: R }) : /* @__PURE__ */ t("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-xl)]", children: /* @__PURE__ */ t("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[48rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: R }) });
5440
+ return n ? /* @__PURE__ */ t("div", { className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-lg)]", children: I }) : /* @__PURE__ */ t("div", { className: "ds:min-h-[100dvh] ds:w-full ds:bg-[color:var(--app-shell-background)] ds:py-[var(--spacing-xl)]", children: /* @__PURE__ */ t("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[48rem] ds:flex-col ds:gap-[var(--spacing-lg)] ds:px-[var(--spacing-md)]", children: I }) });
5433
5441
  }
5434
5442
  function xe({
5435
5443
  titleKey: e,
@@ -5467,7 +5475,7 @@ function Ga({
5467
5475
  ] }, o.key);
5468
5476
  }) });
5469
5477
  }
5470
- function Ko({
5478
+ function Ho({
5471
5479
  record: e,
5472
5480
  t: a,
5473
5481
  embedded: n = !1,
@@ -5475,8 +5483,8 @@ function Ko({
5475
5483
  onOpenNote: s
5476
5484
  }) {
5477
5485
  const { patient: o, visits: r } = e, l = r[r.length - 1], c = r.length > 1 ? r[r.length - 2] : void 0, m = new Map(
5478
- e.targets.map((A) => [A.parameterKey, A.target])
5479
- ), g = Re(i, "anthropometric"), h = Re(i, "dietary"), p = Re(i, "lab"), v = He(i), N = Pa(i);
5486
+ e.targets.map((E) => [E.parameterKey, E.target])
5487
+ ), g = Re(i, "anthropometric"), h = Re(i, "dietary"), p = Re(i, "lab"), b = He(i), N = Pa(i);
5480
5488
  if (!l)
5481
5489
  return /* @__PURE__ */ t(Hn, { embedded: n, children: /* @__PURE__ */ t(ve, { variant: "elevated", children: /* @__PURE__ */ t(ve.Body, { children: /* @__PURE__ */ t(
5482
5490
  Be,
@@ -5555,7 +5563,7 @@ function Ko({
5555
5563
  t: a
5556
5564
  }
5557
5565
  ) }) : null,
5558
- /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: a, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((A) => /* @__PURE__ */ t(Q, { variant: "neutral", size: "md", children: Se(A, a, N[A]) }, A)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5566
+ /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.pathologies", t: a, children: l.pathologyCodes.length > 0 ? /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: l.pathologyCodes.map((E) => /* @__PURE__ */ t(Q, { variant: "neutral", size: "md", children: Se(E, a, N[E]) }, E)) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5559
5567
  f ? /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.oncological", t: a, children: /* @__PURE__ */ d(
5560
5568
  _,
5561
5569
  {
@@ -5578,24 +5586,24 @@ function Ko({
5578
5586
  ]
5579
5587
  }
5580
5588
  ) }) : null,
5581
- /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.therapy", t: a, children: l.therapy.length > 0 ? /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: l.therapy.map((A) => /* @__PURE__ */ d(
5589
+ /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.therapy", t: a, children: l.therapy.length > 0 ? /* @__PURE__ */ t("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: l.therapy.map((E) => /* @__PURE__ */ d(
5582
5590
  "li",
5583
5591
  {
5584
5592
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
5585
5593
  children: [
5586
- /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: A.name }),
5587
- A.dose ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: A.dose }) : null,
5594
+ /* @__PURE__ */ t("span", { className: "type-label ds:text-[color:var(--foreground)]", children: E.name }),
5595
+ E.dose ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: E.dose }) : null,
5588
5596
  /* @__PURE__ */ t(
5589
5597
  Q,
5590
5598
  {
5591
- variant: A.kind === "medication" ? "info" : "neutral",
5599
+ variant: E.kind === "medication" ? "info" : "neutral",
5592
5600
  size: "sm",
5593
- children: a(`anamnesis.medKind.${A.kind}`)
5601
+ children: a(`anamnesis.medKind.${E.kind}`)
5594
5602
  }
5595
5603
  )
5596
5604
  ]
5597
5605
  },
5598
- A.id
5606
+ E.id
5599
5607
  )) }) : /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesis.readOnly.none") }) }),
5600
5608
  /* @__PURE__ */ t(xe, { titleKey: "anamnesis.section.labs", t: a, children: /* @__PURE__ */ t(
5601
5609
  Ga,
@@ -5651,7 +5659,7 @@ function Ko({
5651
5659
  pt,
5652
5660
  {
5653
5661
  intake: e.intake,
5654
- sections: v,
5662
+ sections: b,
5655
5663
  sex: o.sex,
5656
5664
  t: a
5657
5665
  }
@@ -5688,38 +5696,38 @@ function $t({
5688
5696
  canEdit: c = !0,
5689
5697
  defaultTab: m = "questionnaire"
5690
5698
  }) {
5691
- var T, w;
5692
- const [g, h] = z(m), p = ((T = e.intake) == null ? void 0 : T.submittedAtIso) != null, [v, N] = z(!p), [f, C] = z(e), [k, A] = z(e);
5693
- e !== k && (A(e), C(e), N(((w = e.intake) == null ? void 0 : w.submittedAtIso) == null));
5699
+ var u, T;
5700
+ const [g, h] = $(m), p = ((u = e.intake) == null ? void 0 : u.submittedAtIso) != null, [b, N] = $(!p), [f, C] = $(e), [k, E] = $(e);
5701
+ e !== k && (E(e), C(e), N(((T = e.intake) == null ? void 0 : T.submittedAtIso) == null));
5694
5702
  const S = M(
5695
- () => new Map(f.targets.map((I) => [I.parameterKey, I.target])),
5703
+ () => new Map(f.targets.map((y) => [y.parameterKey, y.target])),
5696
5704
  [f.targets]
5697
- ), D = M(() => Lt(n), [n]), E = M(
5705
+ ), D = M(() => Lt(n), [n]), A = M(
5698
5706
  () => Re(n),
5699
5707
  [n]
5700
- ), x = f.visits[f.visits.length - 1];
5708
+ ), w = (y, F) => {
5709
+ C((z) => tt(z, y.key, F)), r == null || r(y.key, F);
5710
+ };
5701
5711
  return (
5702
5712
  // The goals strip and the tabs are two objects, not one run-on block: an
5703
5713
  // explicit column gap keeps the strip from sitting flush on the card
5704
5714
  // below it, which read as a rendering fault rather than as a heading.
5705
5715
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
5706
- l || x === void 0 ? null : /* @__PURE__ */ t(
5716
+ l || f.visits.length === 0 ? null : /* @__PURE__ */ t(
5707
5717
  Pt,
5708
5718
  {
5709
- visit: x,
5719
+ visits: f.visits,
5710
5720
  defs: D,
5711
5721
  targets: S,
5712
5722
  t: a,
5713
- onTargetChange: (I, $) => {
5714
- C((V) => tt(V, I.key, $)), r == null || r(I.key, $);
5715
- }
5723
+ onTargetChange: w
5716
5724
  }
5717
5725
  ),
5718
5726
  /* @__PURE__ */ d(
5719
5727
  W,
5720
5728
  {
5721
5729
  value: g,
5722
- onValueChange: (I) => h(I),
5730
+ onValueChange: (y) => h(y),
5723
5731
  children: [
5724
5732
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
5725
5733
  /* @__PURE__ */ d(W.List, { "aria-label": a("anamnesis.compile.viewsLabel"), children: [
@@ -5728,8 +5736,8 @@ function $t({
5728
5736
  ] }),
5729
5737
  /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
5730
5738
  o,
5731
- p && !v ? /* @__PURE__ */ t(Q, { variant: "neutral", children: a("anamnesis.questionnaire.compiled") }) : null,
5732
- c && !v ? /* @__PURE__ */ t(
5739
+ p && !b ? /* @__PURE__ */ t(Q, { variant: "neutral", children: a("anamnesis.questionnaire.compiled") }) : null,
5740
+ c && !b ? /* @__PURE__ */ t(
5733
5741
  X,
5734
5742
  {
5735
5743
  intent: "outline",
@@ -5751,14 +5759,14 @@ function $t({
5751
5759
  t: a,
5752
5760
  embedded: !0,
5753
5761
  config: n,
5754
- readOnly: !v,
5755
- onSubmit: (I) => {
5756
- N(!1), i == null || i(I);
5762
+ readOnly: !b,
5763
+ onSubmit: (y) => {
5764
+ N(!1), i == null || i(y);
5757
5765
  },
5758
5766
  jumpToField: s
5759
5767
  }
5760
5768
  ) }),
5761
- /* @__PURE__ */ t(W.Content, { value: "trend", children: E.length === 0 ? /* @__PURE__ */ t(
5769
+ /* @__PURE__ */ t(W.Content, { value: "trend", children: A.length === 0 ? /* @__PURE__ */ t(
5762
5770
  Be,
5763
5771
  {
5764
5772
  variant: "no-results",
@@ -5785,7 +5793,7 @@ function $t({
5785
5793
  );
5786
5794
  }
5787
5795
  $t.displayName = "AnamnesisQuestionnaire";
5788
- function ll({
5796
+ function cl({
5789
5797
  mode: e,
5790
5798
  record: a,
5791
5799
  t: n,
@@ -5799,17 +5807,17 @@ function ll({
5799
5807
  onIntakeSubmit: g,
5800
5808
  intakeJumpToField: h,
5801
5809
  onMissingAnswerJump: p,
5802
- onRecordChange: v,
5810
+ onRecordChange: b,
5803
5811
  canEdit: N,
5804
5812
  defaultQuestionnaireTab: f,
5805
5813
  practitioners: C,
5806
5814
  newVisitDateIso: k,
5807
- defaultView: A,
5815
+ defaultView: E,
5808
5816
  defaultExportMenuOpen: S,
5809
5817
  defaultShareOpen: D,
5810
- defaultExportAudience: E
5818
+ defaultExportAudience: A
5811
5819
  }) {
5812
- const x = e === "intake" ? /* @__PURE__ */ t(
5820
+ const w = e === "intake" ? /* @__PURE__ */ t(
5813
5821
  _t,
5814
5822
  {
5815
5823
  record: a,
@@ -5834,7 +5842,7 @@ function ll({
5834
5842
  defaultTab: f
5835
5843
  }
5836
5844
  ) : e === "compile" ? /* @__PURE__ */ t(
5837
- Uo,
5845
+ Ko,
5838
5846
  {
5839
5847
  record: a,
5840
5848
  t: n,
@@ -5845,16 +5853,16 @@ function ll({
5845
5853
  statusSlot: c,
5846
5854
  onOpenNote: m,
5847
5855
  onMissingAnswerJump: p,
5848
- onRecordChange: v,
5856
+ onRecordChange: b,
5849
5857
  practitioners: C,
5850
5858
  newVisitDateIso: k,
5851
- defaultView: A,
5859
+ defaultView: E,
5852
5860
  defaultExportMenuOpen: S,
5853
5861
  defaultShareOpen: D,
5854
- defaultExportAudience: E
5862
+ defaultExportAudience: A
5855
5863
  }
5856
5864
  ) : /* @__PURE__ */ t(
5857
- Ko,
5865
+ Ho,
5858
5866
  {
5859
5867
  record: a,
5860
5868
  t: n,
@@ -5869,7 +5877,7 @@ function ll({
5869
5877
  "data-component": i,
5870
5878
  "data-mode": e,
5871
5879
  className: "ds:w-full",
5872
- children: x
5880
+ children: w
5873
5881
  }
5874
5882
  ) : /* @__PURE__ */ t(
5875
5883
  "main",
@@ -5880,11 +5888,11 @@ function ll({
5880
5888
  mode: n(`anamnesis.mode.${e}`)
5881
5889
  }),
5882
5890
  className: "ds:w-full",
5883
- children: x
5891
+ children: w
5884
5892
  }
5885
5893
  );
5886
5894
  }
5887
- const Ho = Wn("", {
5895
+ const jo = Wn("", {
5888
5896
  variants: {
5889
5897
  dragging: {
5890
5898
  true: "ds:opacity-60",
@@ -5903,7 +5911,7 @@ function Wa({
5903
5911
  t: n,
5904
5912
  children: i
5905
5913
  }) {
5906
- const [s, o] = z(null), [r, l] = z(""), c = we(!1), m = na((h) => {
5914
+ const [s, o] = $(null), [r, l] = $(""), c = we(!1), m = na((h) => {
5907
5915
  c.current = !c.current, l(c.current ? h : `${h}​`);
5908
5916
  }, []), g = M(
5909
5917
  () => ({ onReorder: a, count: e, dragSource: s, setDragSource: o, announce: m, t: n }),
@@ -5919,13 +5927,13 @@ function Qa({
5919
5927
  label: a,
5920
5928
  children: n
5921
5929
  }) {
5922
- const i = Wt(zt), [s, o] = z(!1);
5930
+ const i = Wt(zt), [s, o] = $(!1);
5923
5931
  if (!i)
5924
5932
  throw new Error(
5925
5933
  "AnamnesisReorderRow must render inside an AnamnesisReorderGroup"
5926
5934
  );
5927
- const { t: r } = i, l = (p, v) => {
5928
- const N = Math.max(0, Math.min(i.count - 1, v));
5935
+ const { t: r } = i, l = (p, b) => {
5936
+ const N = Math.max(0, Math.min(i.count - 1, b));
5929
5937
  N !== p && (i.onReorder(p, N), i.announce(
5930
5938
  r("anamnesis.configEditor.reorderAnnounce", {
5931
5939
  name: a,
@@ -5949,10 +5957,10 @@ function Qa({
5949
5957
  onDragLeave: () => o(!1),
5950
5958
  onDrop: (p) => {
5951
5959
  p.preventDefault();
5952
- const v = i.dragSource;
5953
- o(!1), i.setDragSource(null), !(v === null || v === e) && l(v, e);
5960
+ const b = i.dragSource;
5961
+ o(!1), i.setDragSource(null), !(b === null || b === e) && l(b, e);
5954
5962
  },
5955
- className: Ho({
5963
+ className: jo({
5956
5964
  dragging: m,
5957
5965
  dropTarget: s && !m
5958
5966
  })
@@ -5969,7 +5977,7 @@ function Qa({
5969
5977
  );
5970
5978
  return n({ rowProps: g, handle: h });
5971
5979
  }
5972
- function cl() {
5980
+ function dl() {
5973
5981
  return {
5974
5982
  parameters: Ge.parameters.map((e) => ({
5975
5983
  ...e,
@@ -5998,7 +6006,7 @@ function Xa(e, a, n) {
5998
6006
  const i = [...e], [s] = i.splice(a, 1);
5999
6007
  return i.splice(n, 0, s), i;
6000
6008
  }
6001
- const jo = [
6009
+ const Go = [
6002
6010
  "text",
6003
6011
  "textarea",
6004
6012
  "numberInteger",
@@ -6009,7 +6017,7 @@ const jo = [
6009
6017
  "multiChoice",
6010
6018
  "frequency",
6011
6019
  "meal"
6012
- ], Go = new Set(
6020
+ ], Wo = new Set(
6013
6021
  Ge.intakeSections.flatMap(
6014
6022
  (e) => e.fields.map((a) => a.key)
6015
6023
  )
@@ -6018,71 +6026,71 @@ function Ot(e, a) {
6018
6026
  const n = e.type === "number" ? e.decimal ? "numberDecimal" : "numberInteger" : e.type === "choice" && e.detail ? "choiceWithText" : e.type;
6019
6027
  return a(`anamnesis.configEditor.type.${n}`);
6020
6028
  }
6021
- const Wo = ["down", "up", "toRange"], tn = ["anthropometric", "dietary", "lab"];
6022
- function dl({
6029
+ const Qo = ["down", "up", "toRange"], tn = ["anthropometric", "dietary", "lab"];
6030
+ function ml({
6023
6031
  config: e,
6024
6032
  onConfigChange: a,
6025
6033
  t: n,
6026
6034
  dataComponent: i = "anamnesis-config-editor"
6027
6035
  }) {
6028
- const [s, o] = z(null), [r, l] = z(null), c = (u) => a({ ...e, parameters: e.parameters.map(u) }), m = (u) => a({
6036
+ const [s, o] = $(null), [r, l] = $(null), c = (u) => a({ ...e, parameters: e.parameters.map(u) }), m = (u) => a({
6029
6037
  ...e,
6030
6038
  intakeSections: e.intakeSections.map(u)
6031
- }), g = (u, T, w) => m(
6032
- (I) => I.key === u ? {
6033
- ...I,
6034
- fields: I.fields.map(
6035
- ($) => $.key === T ? w($) : $
6039
+ }), g = (u, T, y) => m(
6040
+ (F) => F.key === u ? {
6041
+ ...F,
6042
+ fields: F.fields.map(
6043
+ (z) => z.key === T ? y(z) : z
6036
6044
  )
6037
- } : I
6038
- ), h = (u) => a({ ...e, pathologies: e.pathologies.map(u) }), p = (u, T, w) => {
6039
- const I = Re(e, u), $ = Xa(I, T, w);
6040
- if (!$) return;
6041
- const V = new Map($.map((R, P) => [R.key, P]));
6045
+ } : F
6046
+ ), h = (u) => a({ ...e, pathologies: e.pathologies.map(u) }), p = (u, T, y) => {
6047
+ const F = Re(e, u), z = Xa(F, T, y);
6048
+ if (!z) return;
6049
+ const U = new Map(z.map((I, P) => [I.key, P]));
6042
6050
  c(
6043
- (R) => V.has(R.key) ? { ...R, order: V.get(R.key) } : R
6051
+ (I) => U.has(I.key) ? { ...I, order: U.get(I.key) } : I
6044
6052
  );
6045
- }, v = (u, T) => {
6046
- const w = Xa(He(e), u, T);
6047
- if (!w) return;
6048
- const I = new Map(
6049
- w.map(($, V) => [$.key, V])
6053
+ }, b = (u, T) => {
6054
+ const y = Xa(He(e), u, T);
6055
+ if (!y) return;
6056
+ const F = new Map(
6057
+ y.map((z, U) => [z.key, U])
6050
6058
  );
6051
6059
  m(
6052
- ($) => I.has($.key) ? { ...$, order: I.get($.key) } : $
6060
+ (z) => F.has(z.key) ? { ...z, order: F.get(z.key) } : z
6053
6061
  );
6054
- }, N = (u, T, w) => {
6055
- const I = Xa(u.fields, T, w);
6056
- if (!I) return;
6057
- const $ = new Map(
6058
- I.map((V, R) => [V.key, R])
6062
+ }, N = (u, T, y) => {
6063
+ const F = Xa(u.fields, T, y);
6064
+ if (!F) return;
6065
+ const z = new Map(
6066
+ F.map((U, I) => [U.key, I])
6059
6067
  );
6060
6068
  m(
6061
- (V) => V.key === u.key ? {
6062
- ...V,
6063
- fields: V.fields.map(
6064
- (R) => $.has(R.key) ? { ...R, order: $.get(R.key) } : R
6069
+ (U) => U.key === u.key ? {
6070
+ ...U,
6071
+ fields: U.fields.map(
6072
+ (I) => z.has(I.key) ? { ...I, order: z.get(I.key) } : I
6065
6073
  )
6066
- } : V
6074
+ } : U
6067
6075
  );
6068
6076
  }, f = (u, T) => {
6069
6077
  u.kind === "parameter" ? c(
6070
- (w) => w.key === u.entry.key ? { ...w, enabled: T } : w
6078
+ (y) => y.key === u.entry.key ? { ...y, enabled: T } : y
6071
6079
  ) : u.kind === "section" ? m(
6072
- (w) => w.key === u.entry.key ? { ...w, enabled: T } : w
6073
- ) : u.kind === "field" ? g(u.sectionKey, u.entry.key, (w) => ({
6074
- ...w,
6080
+ (y) => y.key === u.entry.key ? { ...y, enabled: T } : y
6081
+ ) : u.kind === "field" ? g(u.sectionKey, u.entry.key, (y) => ({
6082
+ ...y,
6075
6083
  enabled: T
6076
6084
  })) : h(
6077
- (w) => w.code === u.entry.code ? { ...w, enabled: T } : w
6085
+ (y) => y.code === u.entry.code ? { ...y, enabled: T } : y
6078
6086
  );
6079
- }, C = Ne(e).length, k = Re(e).length, A = dn(e).reduce(
6087
+ }, C = Ne(e).length, k = Re(e).length, E = dn(e).reduce(
6080
6088
  (u, T) => u + T.fields.length,
6081
6089
  0
6082
6090
  ), S = He(e).reduce(
6083
6091
  (u, T) => u + T.fields.length,
6084
6092
  0
6085
- ), D = at(e).length, E = en(e).length, x = Ne(e).filter(
6093
+ ), D = at(e).length, A = en(e).length, w = Ne(e).filter(
6086
6094
  (u) => u.goal === !0
6087
6095
  ).length;
6088
6096
  return /* @__PURE__ */ d(
@@ -6105,22 +6113,22 @@ function dl({
6105
6113
  ] }),
6106
6114
  /* @__PURE__ */ t(W.Content, { value: "questionnaire", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6107
6115
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${n("anamnesis.configEditor.panelLive", {
6108
- count: A
6116
+ count: E
6109
6117
  })} · ${n("anamnesis.configEditor.panelNotCaptured", {
6110
6118
  // Not "archived": this also counts live questions inside
6111
6119
  // an archived section, which capture drops as a whole.
6112
- count: S - A
6120
+ count: S - E
6113
6121
  })}` }),
6114
6122
  /* @__PURE__ */ t(
6115
6123
  Wa,
6116
6124
  {
6117
6125
  count: He(e).length,
6118
- onReorder: v,
6126
+ onReorder: b,
6119
6127
  t: n,
6120
6128
  children: He(e).map(
6121
6129
  (u, T) => {
6122
- const w = u.enabled === !1, I = u.fields.filter(
6123
- ($) => $.enabled !== !1
6130
+ const y = u.enabled === !1, F = u.fields.filter(
6131
+ (z) => z.enabled !== !1
6124
6132
  ).length;
6125
6133
  return /* @__PURE__ */ t(
6126
6134
  Qa,
@@ -6128,21 +6136,21 @@ function dl({
6128
6136
  index: T,
6129
6137
  label: ye(u, n),
6130
6138
  children: ({
6131
- rowProps: $,
6132
- handle: V
6139
+ rowProps: z,
6140
+ handle: U
6133
6141
  }) => /* @__PURE__ */ d("section", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
6134
6142
  /* @__PURE__ */ d(
6135
6143
  "div",
6136
6144
  {
6137
- ...$,
6145
+ ...z,
6138
6146
  className: [
6139
6147
  "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]",
6140
- $.className
6148
+ z.className
6141
6149
  ].filter(Boolean).join(" "),
6142
6150
  children: [
6143
6151
  /* @__PURE__ */ d("h3", { className: "type-title-item ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--foreground)]", children: [
6144
6152
  ye(u, n),
6145
- w ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n("anamnesis.configEditor.archived") }) : null
6153
+ y ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n("anamnesis.configEditor.archived") }) : null
6146
6154
  ] }),
6147
6155
  /* @__PURE__ */ d(
6148
6156
  Na,
@@ -6154,7 +6162,7 @@ function dl({
6154
6162
  }
6155
6163
  ),
6156
6164
  children: [
6157
- V,
6165
+ U,
6158
6166
  /* @__PURE__ */ t(
6159
6167
  re,
6160
6168
  {
@@ -6173,7 +6181,7 @@ function dl({
6173
6181
  })
6174
6182
  }
6175
6183
  ),
6176
- w ? /* @__PURE__ */ t(
6184
+ y ? /* @__PURE__ */ t(
6177
6185
  re,
6178
6186
  {
6179
6187
  size: "sm",
@@ -6210,27 +6218,27 @@ function dl({
6210
6218
  ]
6211
6219
  }
6212
6220
  ),
6213
- I === 0 && !w ? /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n(
6221
+ F === 0 && !y ? /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n(
6214
6222
  "anamnesis.configEditor.sectionEmptyCapture"
6215
6223
  ) }) : null,
6216
6224
  u.fields.length > 0 ? /* @__PURE__ */ t(
6217
6225
  Wa,
6218
6226
  {
6219
6227
  count: u.fields.length,
6220
- onReorder: (R, P) => N(u, R, P),
6228
+ onReorder: (I, P) => N(u, I, P),
6221
6229
  t: n,
6222
- children: /* @__PURE__ */ t(Ze, { divider: "divided", children: u.fields.map((R, P) => /* @__PURE__ */ t(
6230
+ children: /* @__PURE__ */ t(Ze, { divider: "divided", children: u.fields.map((I, P) => /* @__PURE__ */ t(
6223
6231
  Qa,
6224
6232
  {
6225
6233
  index: P,
6226
- label: he(R, n),
6227
- children: ({ rowProps: B, handle: G }) => /* @__PURE__ */ t(
6234
+ label: he(I, n),
6235
+ children: ({ rowProps: V, handle: G }) => /* @__PURE__ */ t(
6228
6236
  Ze.Item,
6229
6237
  {
6230
- ...B,
6238
+ ...V,
6231
6239
  title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6232
- he(R, n),
6233
- R.required === !0 ? /* @__PURE__ */ t(
6240
+ he(I, n),
6241
+ I.required === !0 ? /* @__PURE__ */ t(
6234
6242
  Q,
6235
6243
  {
6236
6244
  size: "sm",
@@ -6240,7 +6248,7 @@ function dl({
6240
6248
  )
6241
6249
  }
6242
6250
  ) : null,
6243
- R.enabled === !1 ? /* @__PURE__ */ t(
6251
+ I.enabled === !1 ? /* @__PURE__ */ t(
6244
6252
  Q,
6245
6253
  {
6246
6254
  size: "sm",
@@ -6252,8 +6260,8 @@ function dl({
6252
6260
  ) : null
6253
6261
  ] }),
6254
6262
  description: [
6255
- Ot(R, n),
6256
- ot(R, n)
6263
+ Ot(I, n),
6264
+ ot(I, n)
6257
6265
  ].filter(Boolean).join(" · "),
6258
6266
  trailing: /* @__PURE__ */ d(
6259
6267
  Na,
@@ -6262,7 +6270,7 @@ function dl({
6262
6270
  "anamnesis.configEditor.rowActions",
6263
6271
  {
6264
6272
  name: he(
6265
- R,
6273
+ I,
6266
6274
  n
6267
6275
  )
6268
6276
  }
@@ -6279,7 +6287,7 @@ function dl({
6279
6287
  "anamnesis.configEditor.edit",
6280
6288
  {
6281
6289
  name: he(
6282
- R,
6290
+ I,
6283
6291
  n
6284
6292
  )
6285
6293
  }
@@ -6287,11 +6295,11 @@ function dl({
6287
6295
  onClick: () => o({
6288
6296
  kind: "field",
6289
6297
  sectionKey: u.key,
6290
- entry: R
6298
+ entry: I
6291
6299
  })
6292
6300
  }
6293
6301
  ),
6294
- R.enabled === !1 ? /* @__PURE__ */ t(
6302
+ I.enabled === !1 ? /* @__PURE__ */ t(
6295
6303
  re,
6296
6304
  {
6297
6305
  size: "sm",
@@ -6301,7 +6309,7 @@ function dl({
6301
6309
  "anamnesis.configEditor.restore",
6302
6310
  {
6303
6311
  name: he(
6304
- R,
6312
+ I,
6305
6313
  n
6306
6314
  )
6307
6315
  }
@@ -6310,7 +6318,7 @@ function dl({
6310
6318
  {
6311
6319
  kind: "field",
6312
6320
  sectionKey: u.key,
6313
- entry: R
6321
+ entry: I
6314
6322
  },
6315
6323
  void 0
6316
6324
  )
@@ -6325,7 +6333,7 @@ function dl({
6325
6333
  "anamnesis.configEditor.archive",
6326
6334
  {
6327
6335
  name: he(
6328
- R,
6336
+ I,
6329
6337
  n
6330
6338
  )
6331
6339
  }
@@ -6334,7 +6342,7 @@ function dl({
6334
6342
  {
6335
6343
  kind: "field",
6336
6344
  sectionKey: u.key,
6337
- entry: R
6345
+ entry: I
6338
6346
  },
6339
6347
  !1
6340
6348
  )
@@ -6346,7 +6354,7 @@ function dl({
6346
6354
  }
6347
6355
  )
6348
6356
  },
6349
- R.key
6357
+ I.key
6350
6358
  )) })
6351
6359
  }
6352
6360
  ) : null,
@@ -6403,28 +6411,28 @@ function dl({
6403
6411
  Wa,
6404
6412
  {
6405
6413
  count: T.length,
6406
- onReorder: (w, I) => p(u, w, I),
6414
+ onReorder: (y, F) => p(u, y, F),
6407
6415
  t: n,
6408
- children: /* @__PURE__ */ t(Ze, { divider: "divided", children: T.map((w, I) => {
6409
- const $ = [
6410
- Qo(w, n),
6416
+ children: /* @__PURE__ */ t(Ze, { divider: "divided", children: T.map((y, F) => {
6417
+ const z = [
6418
+ Yo(y, n),
6411
6419
  n(
6412
- `anamnesis.configEditor.direction.${w.betterDirection}`
6420
+ `anamnesis.configEditor.direction.${y.betterDirection}`
6413
6421
  ),
6414
- w.locked ? n("anamnesis.configEditor.lockedHint") : null
6422
+ y.locked ? n("anamnesis.configEditor.lockedHint") : null
6415
6423
  ].filter(Boolean).join(" · ");
6416
6424
  return /* @__PURE__ */ t(
6417
6425
  Qa,
6418
6426
  {
6419
- index: I,
6420
- label: Te(w, n),
6421
- children: ({ rowProps: V, handle: R }) => /* @__PURE__ */ t(
6427
+ index: F,
6428
+ label: Te(y, n),
6429
+ children: ({ rowProps: U, handle: I }) => /* @__PURE__ */ t(
6422
6430
  Ze.Item,
6423
6431
  {
6424
- ...V,
6432
+ ...U,
6425
6433
  title: /* @__PURE__ */ d("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
6426
- Te(w, n),
6427
- w.locked ? /* @__PURE__ */ t(
6434
+ Te(y, n),
6435
+ y.locked ? /* @__PURE__ */ t(
6428
6436
  Q,
6429
6437
  {
6430
6438
  size: "sm",
@@ -6433,11 +6441,11 @@ function dl({
6433
6441
  children: n("anamnesis.configEditor.locked")
6434
6442
  }
6435
6443
  ) : null,
6436
- w.enabled === !1 ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n(
6444
+ y.enabled === !1 ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n(
6437
6445
  "anamnesis.configEditor.archived"
6438
6446
  ) }) : null
6439
6447
  ] }),
6440
- description: $,
6448
+ description: z,
6441
6449
  trailing: /* @__PURE__ */ d(
6442
6450
  Na,
6443
6451
  {
@@ -6445,13 +6453,13 @@ function dl({
6445
6453
  "anamnesis.configEditor.rowActions",
6446
6454
  {
6447
6455
  name: Te(
6448
- w,
6456
+ y,
6449
6457
  n
6450
6458
  )
6451
6459
  }
6452
6460
  ),
6453
6461
  children: [
6454
- R,
6462
+ I,
6455
6463
  /* @__PURE__ */ t(
6456
6464
  re,
6457
6465
  {
@@ -6462,18 +6470,18 @@ function dl({
6462
6470
  "anamnesis.configEditor.edit",
6463
6471
  {
6464
6472
  name: Te(
6465
- w,
6473
+ y,
6466
6474
  n
6467
6475
  )
6468
6476
  }
6469
6477
  ),
6470
6478
  onClick: () => o({
6471
6479
  kind: "parameter",
6472
- entry: w
6480
+ entry: y
6473
6481
  })
6474
6482
  }
6475
6483
  ),
6476
- w.locked ? null : w.enabled === !1 ? /* @__PURE__ */ t(
6484
+ y.locked ? null : y.enabled === !1 ? /* @__PURE__ */ t(
6477
6485
  re,
6478
6486
  {
6479
6487
  size: "sm",
@@ -6483,7 +6491,7 @@ function dl({
6483
6491
  "anamnesis.configEditor.restore",
6484
6492
  {
6485
6493
  name: Te(
6486
- w,
6494
+ y,
6487
6495
  n
6488
6496
  )
6489
6497
  }
@@ -6491,7 +6499,7 @@ function dl({
6491
6499
  onClick: () => f(
6492
6500
  {
6493
6501
  kind: "parameter",
6494
- entry: w
6502
+ entry: y
6495
6503
  },
6496
6504
  void 0
6497
6505
  )
@@ -6506,7 +6514,7 @@ function dl({
6506
6514
  "anamnesis.configEditor.archive",
6507
6515
  {
6508
6516
  name: Te(
6509
- w,
6517
+ y,
6510
6518
  n
6511
6519
  )
6512
6520
  }
@@ -6514,7 +6522,7 @@ function dl({
6514
6522
  onClick: () => f(
6515
6523
  {
6516
6524
  kind: "parameter",
6517
- entry: w
6525
+ entry: y
6518
6526
  },
6519
6527
  !1
6520
6528
  )
@@ -6526,7 +6534,7 @@ function dl({
6526
6534
  }
6527
6535
  )
6528
6536
  },
6529
- w.key
6537
+ y.key
6530
6538
  );
6531
6539
  }) })
6532
6540
  }
@@ -6551,12 +6559,12 @@ function dl({
6551
6559
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: `${n("anamnesis.configEditor.panelLive", {
6552
6560
  count: D
6553
6561
  })} · ${n("anamnesis.configEditor.panelArchived", {
6554
- count: E - D
6562
+ count: A - D
6555
6563
  })}` }),
6556
6564
  /* @__PURE__ */ t(Ze, { divider: "divided", children: en(e).map((u) => {
6557
6565
  const T = e.pathologies.some(
6558
- (I) => I.parentCode === u.code && I.enabled !== !1
6559
- ), w = [
6566
+ (F) => F.parentCode === u.code && F.enabled !== !1
6567
+ ), y = [
6560
6568
  u.parentCode ? n("anamnesis.configEditor.subCodeOf", {
6561
6569
  code: u.parentCode
6562
6570
  }) : null,
@@ -6569,7 +6577,7 @@ function dl({
6569
6577
  Se(u.code, n, u),
6570
6578
  u.enabled === !1 ? /* @__PURE__ */ t(Q, { size: "sm", variant: "neutral", children: n("anamnesis.configEditor.archived") }) : null
6571
6579
  ] }),
6572
- description: w || void 0,
6580
+ description: y || void 0,
6573
6581
  trailing: /* @__PURE__ */ d(
6574
6582
  Na,
6575
6583
  {
@@ -6656,7 +6664,7 @@ function dl({
6656
6664
  ] }) }),
6657
6665
  /* @__PURE__ */ t(W.Content, { value: "targets", children: /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)] ds:pt-[var(--spacing-md)]", children: [
6658
6666
  /* @__PURE__ */ t("p", { className: "type-meta ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.configEditor.panelTracked", {
6659
- count: x
6667
+ count: w
6660
6668
  }) }),
6661
6669
  /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: n("anamnesis.configEditor.targetsIntro") }),
6662
6670
  tn.map((u) => {
@@ -6667,16 +6675,16 @@ function dl({
6667
6675
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
6668
6676
  children: [
6669
6677
  /* @__PURE__ */ t("h3", { className: "type-title-item ds:m-0 ds:text-[color:var(--foreground)]", children: n(`anamnesis.group.${u}`) }),
6670
- /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: T.map((w) => /* @__PURE__ */ t(
6678
+ /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: T.map((y) => /* @__PURE__ */ t(
6671
6679
  cn,
6672
6680
  {
6673
- label: Te(w, n),
6674
- checked: w.goal === !0,
6675
- onCheckedChange: (I) => c(
6676
- ($) => $.key === w.key ? { ...$, goal: I === !0 } : $
6681
+ label: Te(y, n),
6682
+ checked: y.goal === !0,
6683
+ onCheckedChange: (F) => c(
6684
+ (z) => z.key === y.key ? { ...z, goal: F === !0 } : z
6677
6685
  )
6678
6686
  },
6679
- w.key
6687
+ y.key
6680
6688
  )) })
6681
6689
  ]
6682
6690
  },
@@ -6686,7 +6694,7 @@ function dl({
6686
6694
  ] }) })
6687
6695
  ] }) }) }),
6688
6696
  /* @__PURE__ */ t(
6689
- Yo,
6697
+ Xo,
6690
6698
  {
6691
6699
  editing: s,
6692
6700
  onClose: () => o(null),
@@ -6696,7 +6704,7 @@ function dl({
6696
6704
  }
6697
6705
  ),
6698
6706
  /* @__PURE__ */ t(
6699
- er,
6707
+ ar,
6700
6708
  {
6701
6709
  adding: r,
6702
6710
  onClose: () => l(null),
@@ -6709,11 +6717,11 @@ function dl({
6709
6717
  }
6710
6718
  );
6711
6719
  }
6712
- function Qo(e, a) {
6720
+ function Yo(e, a) {
6713
6721
  const n = e.referenceRange;
6714
6722
  return n ? n.min != null && n.max != null ? `${n.min}–${n.max}` : n.max != null ? a("anamnesis.range.atMost", { value: n.max }) : n.min != null ? a("anamnesis.range.atLeast", { value: n.min }) : null : null;
6715
6723
  }
6716
- function Yo({
6724
+ function Xo({
6717
6725
  editing: e,
6718
6726
  onClose: a,
6719
6727
  config: n,
@@ -6728,7 +6736,7 @@ function Yo({
6728
6736
  o || a();
6729
6737
  },
6730
6738
  children: e ? /* @__PURE__ */ t(
6731
- Jo,
6739
+ Zo,
6732
6740
  {
6733
6741
  editing: e,
6734
6742
  onClose: a,
@@ -6736,44 +6744,44 @@ function Yo({
6736
6744
  onConfigChange: i,
6737
6745
  t: s
6738
6746
  },
6739
- Xo(e)
6747
+ Jo(e)
6740
6748
  ) : null
6741
6749
  }
6742
6750
  );
6743
6751
  }
6744
- function Xo(e) {
6752
+ function Jo(e) {
6745
6753
  return e.kind === "pathology" ? `pathology:${e.entry.code}` : e.kind === "field" ? `field:${e.sectionKey}:${e.entry.key}` : `${e.kind}:${e.entry.key}`;
6746
6754
  }
6747
- function Jo({
6755
+ function Zo({
6748
6756
  editing: e,
6749
6757
  onClose: a,
6750
6758
  config: n,
6751
6759
  onConfigChange: i,
6752
6760
  t: s
6753
6761
  }) {
6754
- const o = e.entry, r = Zo(e, s), [l, c] = z(o.label ?? ""), [m, g] = z(
6762
+ const o = e.entry, r = er(e, s), [l, c] = $(o.label ?? ""), [m, g] = $(
6755
6763
  e.kind === "field" ? o.helpText ?? "" : ""
6756
- ), [h, p] = z(
6764
+ ), [h, p] = $(
6757
6765
  e.kind === "field" && e.entry.required === !0
6758
- ), v = e.kind === "field" ? e.entry : null, N = v !== null && (v.type === "choice" || v.type === "multiChoice"), f = N && !Go.has(v.key), [C, k] = z(
6759
- f ? (v.options ?? []).join(", ") : ""
6760
- ), A = C.split(",").map((E) => E.trim()).filter(Boolean), S = !f || A.length > 0, D = () => {
6761
- const E = l.trim(), x = (u) => {
6766
+ ), b = e.kind === "field" ? e.entry : null, N = b !== null && (b.type === "choice" || b.type === "multiChoice"), f = N && !Wo.has(b.key), [C, k] = $(
6767
+ f ? (b.options ?? []).join(", ") : ""
6768
+ ), E = C.split(",").map((A) => A.trim()).filter(Boolean), S = !f || E.length > 0, D = () => {
6769
+ const A = l.trim(), w = (u) => {
6762
6770
  const T = { ...u };
6763
- return E ? T.label = E : delete T.label, T;
6771
+ return A ? T.label = A : delete T.label, T;
6764
6772
  };
6765
6773
  if (e.kind === "parameter")
6766
6774
  i({
6767
6775
  ...n,
6768
6776
  parameters: n.parameters.map(
6769
- (u) => u.key === e.entry.key ? x(u) : u
6777
+ (u) => u.key === e.entry.key ? w(u) : u
6770
6778
  )
6771
6779
  });
6772
6780
  else if (e.kind === "section")
6773
6781
  i({
6774
6782
  ...n,
6775
6783
  intakeSections: n.intakeSections.map(
6776
- (u) => u.key === e.entry.key ? x(u) : u
6784
+ (u) => u.key === e.entry.key ? w(u) : u
6777
6785
  )
6778
6786
  });
6779
6787
  else if (e.kind === "field") {
@@ -6783,10 +6791,10 @@ function Jo({
6783
6791
  intakeSections: n.intakeSections.map(
6784
6792
  (T) => T.key === e.sectionKey ? {
6785
6793
  ...T,
6786
- fields: T.fields.map((w) => {
6787
- if (w.key !== e.entry.key) return w;
6788
- const I = x(w);
6789
- return u ? I.helpText = u : delete I.helpText, f && (I.options = A), h ? I.required = !0 : delete I.required, I;
6794
+ fields: T.fields.map((y) => {
6795
+ if (y.key !== e.entry.key) return y;
6796
+ const F = w(y);
6797
+ return u ? F.helpText = u : delete F.helpText, f && (F.options = E), h ? F.required = !0 : delete F.required, F;
6790
6798
  })
6791
6799
  } : T
6792
6800
  )
@@ -6795,7 +6803,7 @@ function Jo({
6795
6803
  i({
6796
6804
  ...n,
6797
6805
  pathologies: n.pathologies.map(
6798
- (u) => u.code === o.code ? x(u) : u
6806
+ (u) => u.code === o.code ? w(u) : u
6799
6807
  )
6800
6808
  });
6801
6809
  a();
@@ -6823,7 +6831,7 @@ function Jo({
6823
6831
  ae,
6824
6832
  {
6825
6833
  value: l,
6826
- onChange: (E) => c(E.target.value),
6834
+ onChange: (A) => c(A.target.value),
6827
6835
  placeholder: r
6828
6836
  }
6829
6837
  )
@@ -6833,7 +6841,7 @@ function Jo({
6833
6841
  ta,
6834
6842
  {
6835
6843
  value: m,
6836
- onChange: (E) => g(E.target.value),
6844
+ onChange: (A) => g(A.target.value),
6837
6845
  minRows: 2
6838
6846
  }
6839
6847
  ) }) : null,
@@ -6842,7 +6850,7 @@ function Jo({
6842
6850
  {
6843
6851
  label: s("anamnesis.configEditor.requiredField"),
6844
6852
  checked: h,
6845
- onCheckedChange: (E) => p(E === !0)
6853
+ onCheckedChange: (A) => p(A === !0)
6846
6854
  }
6847
6855
  ) : null,
6848
6856
  f ? /* @__PURE__ */ t(
@@ -6855,14 +6863,14 @@ function Jo({
6855
6863
  ae,
6856
6864
  {
6857
6865
  value: C,
6858
- onChange: (E) => k(E.target.value)
6866
+ onChange: (A) => k(A.target.value)
6859
6867
  }
6860
6868
  )
6861
6869
  }
6862
6870
  ) : N ? /* @__PURE__ */ t("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: s("anamnesis.configEditor.optionsCurrent", {
6863
- list: (v.options ?? []).map(
6864
- (E) => s(`anamnesis.field.${v.key}.option.${E}`, {
6865
- defaultValue: E
6871
+ list: (b.options ?? []).map(
6872
+ (A) => s(`anamnesis.field.${b.key}.option.${A}`, {
6873
+ defaultValue: A
6866
6874
  })
6867
6875
  ).join(", ")
6868
6876
  }) }) : null
@@ -6873,7 +6881,7 @@ function Jo({
6873
6881
  ] })
6874
6882
  ] });
6875
6883
  }
6876
- function Zo(e, a) {
6884
+ function er(e, a) {
6877
6885
  return e.kind === "parameter" ? Te({ ...e.entry, label: void 0 }, a) : e.kind === "section" ? ye({ ...e.entry, label: void 0 }, a) : e.kind === "field" ? he({ ...e.entry, label: void 0 }, a) : Se(e.entry.code, a, {
6878
6886
  ...e.entry,
6879
6887
  label: void 0
@@ -6882,7 +6890,7 @@ function Zo(e, a) {
6882
6890
  function Ja(e) {
6883
6891
  return e === "choice" || e === "choiceWithText" || e === "multiChoice";
6884
6892
  }
6885
- function er({
6893
+ function ar({
6886
6894
  adding: e,
6887
6895
  onClose: a,
6888
6896
  config: n,
@@ -6897,7 +6905,7 @@ function er({
6897
6905
  o || a();
6898
6906
  },
6899
6907
  children: e ? /* @__PURE__ */ t(
6900
- ar,
6908
+ nr,
6901
6909
  {
6902
6910
  adding: e,
6903
6911
  onClose: a,
@@ -6910,41 +6918,41 @@ function er({
6910
6918
  }
6911
6919
  );
6912
6920
  }
6913
- function ar({
6921
+ function nr({
6914
6922
  adding: e,
6915
6923
  onClose: a,
6916
6924
  config: n,
6917
6925
  onConfigChange: i,
6918
6926
  t: s
6919
6927
  }) {
6920
- const [o, r] = z(""), [l, c] = z(""), [m, g] = z(""), [h, p] = z(""), [v, N] = z(""), [f, C] = z(""), [k, A] = z("0"), [S, D] = z(""), [E, x] = z(""), [u, T] = z(""), [w, I] = z(""), [$, V] = z(!1), [R, P] = z(""), B = tn.map((L) => ({
6921
- value: L,
6922
- label: s(`anamnesis.group.${L}`)
6923
- })), G = Wo.map((L) => ({
6924
- value: L,
6925
- label: s(`anamnesis.configEditor.direction.${L}`)
6926
- })), ne = jo.map((L) => ({
6927
- value: L,
6928
- label: s(`anamnesis.configEditor.type.${L}`)
6929
- })), ue = n.pathologies.filter((L) => !L.parentCode && L.enabled !== !1).map((L) => ({
6930
- value: L.code,
6931
- label: Se(L.code, s, L)
6932
- })), pe = E.split(",").map((L) => L.trim()).filter(Boolean), ce = e.kind === "parameter" ? o.trim() !== "" && l !== "" && m !== "" : e.kind === "field" ? o.trim() !== "" && S !== "" && (!Ja(S) || pe.length > 0) : e.kind === "section" ? o.trim() !== "" : o.trim() !== "" && w.trim() !== "" && // A duplicate code would collide with the existing entry
6928
+ const [o, r] = $(""), [l, c] = $(""), [m, g] = $(""), [h, p] = $(""), [b, N] = $(""), [f, C] = $(""), [k, E] = $("0"), [S, D] = $(""), [A, w] = $(""), [u, T] = $(""), [y, F] = $(""), [z, U] = $(!1), [I, P] = $(""), V = tn.map((R) => ({
6929
+ value: R,
6930
+ label: s(`anamnesis.group.${R}`)
6931
+ })), G = Qo.map((R) => ({
6932
+ value: R,
6933
+ label: s(`anamnesis.configEditor.direction.${R}`)
6934
+ })), ne = Go.map((R) => ({
6935
+ value: R,
6936
+ label: s(`anamnesis.configEditor.type.${R}`)
6937
+ })), ue = n.pathologies.filter((R) => !R.parentCode && R.enabled !== !1).map((R) => ({
6938
+ value: R.code,
6939
+ label: Se(R.code, s, R)
6940
+ })), pe = A.split(",").map((R) => R.trim()).filter(Boolean), ce = e.kind === "parameter" ? o.trim() !== "" && l !== "" && m !== "" : e.kind === "field" ? o.trim() !== "" && S !== "" && (!Ja(S) || pe.length > 0) : e.kind === "section" ? o.trim() !== "" : o.trim() !== "" && y.trim() !== "" && // A duplicate code would collide with the existing entry
6933
6941
  // everywhere codes are matched (lookup, archive, edit) —
6934
6942
  // uniqueness is the add gate, matching keyFromLabel's guarantee
6935
6943
  // on the other vocabularies.
6936
6944
  !n.pathologies.some(
6937
- (L) => L.code.toLowerCase() === w.trim().toLowerCase()
6945
+ (R) => R.code.toLowerCase() === y.trim().toLowerCase()
6938
6946
  ), J = () => {
6939
- const L = o.trim();
6947
+ const R = o.trim();
6940
6948
  if (e.kind === "parameter") {
6941
- const U = new Set(n.parameters.map((De) => De.key)), Z = (De) => {
6949
+ const B = new Set(n.parameters.map((De) => De.key)), Z = (De) => {
6942
6950
  if (De.trim() === "") return;
6943
6951
  const Ie = Number(De);
6944
6952
  return Number.isFinite(Ie) ? Ie : void 0;
6945
- }, de = Z(v), le = Z(f), Ee = {
6946
- key: Ya(L, U),
6947
- label: L,
6953
+ }, de = Z(b), le = Z(f), Ee = {
6954
+ key: Ya(R, B),
6955
+ label: R,
6948
6956
  group: l,
6949
6957
  betterDirection: m,
6950
6958
  precision: Number(k),
@@ -6958,19 +6966,19 @@ function ar({
6958
6966
  };
6959
6967
  i({ ...n, parameters: [...n.parameters, Ee] });
6960
6968
  } else if (e.kind === "field") {
6961
- const U = new Set(
6969
+ const B = new Set(
6962
6970
  n.intakeSections.flatMap(
6963
6971
  (le) => le.fields.map((Ee) => Ee.key)
6964
6972
  )
6965
6973
  ), Z = S === "numberInteger" || S === "numberDecimal" ? "number" : S === "choiceWithText" ? "choice" : S, de = {
6966
- key: Ya(L, U),
6967
- label: L,
6974
+ key: Ya(R, B),
6975
+ label: R,
6968
6976
  type: Z,
6969
6977
  ...S === "numberDecimal" ? { decimal: !0 } : {},
6970
6978
  ...S === "choiceWithText" ? { detail: !0 } : {},
6971
6979
  ...Ja(S) ? { options: pe } : {},
6972
6980
  ...u.trim() ? { helpText: u.trim() } : {},
6973
- ...$ ? { required: !0 } : {}
6981
+ ...z ? { required: !0 } : {}
6974
6982
  };
6975
6983
  i({
6976
6984
  ...n,
@@ -6979,11 +6987,11 @@ function ar({
6979
6987
  )
6980
6988
  });
6981
6989
  } else if (e.kind === "section") {
6982
- const U = new Set(
6990
+ const B = new Set(
6983
6991
  n.intakeSections.map((de) => de.key)
6984
6992
  ), Z = {
6985
- key: Ya(L, U),
6986
- label: L,
6993
+ key: Ya(R, B),
6994
+ label: R,
6987
6995
  fields: []
6988
6996
  };
6989
6997
  i({
@@ -6991,19 +6999,19 @@ function ar({
6991
6999
  intakeSections: [...n.intakeSections, Z]
6992
7000
  });
6993
7001
  } else {
6994
- const U = {
6995
- code: w.trim(),
6996
- label: L,
6997
- ...R ? { parentCode: R } : {}
7002
+ const B = {
7003
+ code: y.trim(),
7004
+ label: R,
7005
+ ...I ? { parentCode: I } : {}
6998
7006
  };
6999
7007
  i({
7000
7008
  ...n,
7001
- pathologies: [...n.pathologies, U]
7009
+ pathologies: [...n.pathologies, B]
7002
7010
  });
7003
7011
  }
7004
7012
  a();
7005
7013
  }, Ae = e.kind === "parameter" ? s("anamnesis.configEditor.addParameterTitle") : e.kind === "field" ? s("anamnesis.configEditor.addQuestionTitle", {
7006
- section: nr(n, e.sectionKey, s)
7014
+ section: tr(n, e.sectionKey, s)
7007
7015
  }) : e.kind === "section" ? s("anamnesis.configEditor.addSectionTitle") : s("anamnesis.configEditor.addCodeTitle");
7008
7016
  return /* @__PURE__ */ d(Y.Content, { size: "sm", children: [
7009
7017
  /* @__PURE__ */ d(Y.Header, { children: [
@@ -7014,24 +7022,24 @@ function ar({
7014
7022
  e.kind === "pathology" ? /* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.codeField"), required: !0, children: /* @__PURE__ */ t(
7015
7023
  ae,
7016
7024
  {
7017
- value: w,
7018
- onChange: (L) => I(L.target.value)
7025
+ value: y,
7026
+ onChange: (R) => F(R.target.value)
7019
7027
  }
7020
7028
  ) }) : null,
7021
7029
  /* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.labelField"), required: !0, children: /* @__PURE__ */ t(
7022
7030
  ae,
7023
7031
  {
7024
7032
  value: o,
7025
- onChange: (L) => r(L.target.value)
7033
+ onChange: (R) => r(R.target.value)
7026
7034
  }
7027
7035
  ) }),
7028
7036
  e.kind === "parameter" ? /* @__PURE__ */ d(Le, { children: [
7029
7037
  /* @__PURE__ */ t(q, { label: s("anamnesis.configEditor.groupField"), required: !0, children: /* @__PURE__ */ t(
7030
7038
  Me,
7031
7039
  {
7032
- options: B,
7040
+ options: V,
7033
7041
  value: l,
7034
- onValueChange: (L) => c(L),
7042
+ onValueChange: (R) => c(R),
7035
7043
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
7036
7044
  "aria-label": s("anamnesis.configEditor.groupField")
7037
7045
  }
@@ -7046,7 +7054,7 @@ function ar({
7046
7054
  {
7047
7055
  options: G,
7048
7056
  value: m,
7049
- onValueChange: (L) => g(L),
7057
+ onValueChange: (R) => g(R),
7050
7058
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
7051
7059
  "aria-label": s("anamnesis.configEditor.directionField")
7052
7060
  }
@@ -7058,7 +7066,7 @@ function ar({
7058
7066
  ae,
7059
7067
  {
7060
7068
  value: h,
7061
- onChange: (L) => p(L.target.value)
7069
+ onChange: (R) => p(R.target.value)
7062
7070
  }
7063
7071
  ) }),
7064
7072
  /* @__PURE__ */ t(
@@ -7075,7 +7083,7 @@ function ar({
7075
7083
  { value: "2", label: "2" }
7076
7084
  ],
7077
7085
  value: k,
7078
- onValueChange: (L) => A(L || "0"),
7086
+ onValueChange: (R) => E(R || "0"),
7079
7087
  "aria-label": s("anamnesis.configEditor.precisionField")
7080
7088
  }
7081
7089
  )
@@ -7092,8 +7100,8 @@ function ar({
7092
7100
  ae,
7093
7101
  {
7094
7102
  inputMode: "decimal",
7095
- value: v,
7096
- onChange: (L) => N(L.target.value)
7103
+ value: b,
7104
+ onChange: (R) => N(R.target.value)
7097
7105
  }
7098
7106
  )
7099
7107
  }
@@ -7108,7 +7116,7 @@ function ar({
7108
7116
  {
7109
7117
  inputMode: "decimal",
7110
7118
  value: f,
7111
- onChange: (L) => C(L.target.value)
7119
+ onChange: (R) => C(R.target.value)
7112
7120
  }
7113
7121
  )
7114
7122
  }
@@ -7121,7 +7129,7 @@ function ar({
7121
7129
  {
7122
7130
  options: ne,
7123
7131
  value: S,
7124
- onValueChange: (L) => D(L),
7132
+ onValueChange: (R) => D(R),
7125
7133
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
7126
7134
  "aria-label": s("anamnesis.configEditor.typeField")
7127
7135
  }
@@ -7135,8 +7143,8 @@ function ar({
7135
7143
  children: /* @__PURE__ */ t(
7136
7144
  ae,
7137
7145
  {
7138
- value: E,
7139
- onChange: (L) => x(L.target.value)
7146
+ value: A,
7147
+ onChange: (R) => w(R.target.value)
7140
7148
  }
7141
7149
  )
7142
7150
  }
@@ -7145,7 +7153,7 @@ function ar({
7145
7153
  ta,
7146
7154
  {
7147
7155
  value: u,
7148
- onChange: (L) => T(L.target.value),
7156
+ onChange: (R) => T(R.target.value),
7149
7157
  minRows: 2
7150
7158
  }
7151
7159
  ) }),
@@ -7153,8 +7161,8 @@ function ar({
7153
7161
  cn,
7154
7162
  {
7155
7163
  label: s("anamnesis.configEditor.requiredField"),
7156
- checked: $,
7157
- onCheckedChange: (L) => V(L === !0)
7164
+ checked: z,
7165
+ onCheckedChange: (R) => U(R === !0)
7158
7166
  }
7159
7167
  )
7160
7168
  ] }) : null,
@@ -7168,8 +7176,8 @@ function ar({
7168
7176
  Me,
7169
7177
  {
7170
7178
  options: ue,
7171
- value: R,
7172
- onValueChange: (L) => P(L),
7179
+ value: I,
7180
+ onValueChange: (R) => P(R),
7173
7181
  placeholder: s("anamnesis.configEditor.selectPlaceholder"),
7174
7182
  clearable: !0,
7175
7183
  "aria-label": s("anamnesis.configEditor.parentField")
@@ -7185,7 +7193,7 @@ function ar({
7185
7193
  ] })
7186
7194
  ] });
7187
7195
  }
7188
- function nr(e, a, n) {
7196
+ function tr(e, a, n) {
7189
7197
  const i = e.intakeSections.find(
7190
7198
  (s) => s.key === a
7191
7199
  );
@@ -7194,7 +7202,7 @@ function nr(e, a, n) {
7194
7202
  function jn(e) {
7195
7203
  return e.kind === "visit" ? `anamnesis-visit-${e.visitId}` : `anamnesis-event-${e.eventId}`;
7196
7204
  }
7197
- function ml(e, a) {
7205
+ function ul(e, a) {
7198
7206
  const n = e.visits.filter(gt).map((s) => ({
7199
7207
  id: jn({ kind: "visit", visitId: s.id }),
7200
7208
  dateIso: s.dateIso,
@@ -7234,7 +7242,7 @@ function ml(e, a) {
7234
7242
  (s, o) => o.dateIso.localeCompare(s.dateIso)
7235
7243
  );
7236
7244
  }
7237
- const Za = "patterns", tr = {
7245
+ const Za = "patterns", ir = {
7238
7246
  anamnesis: {
7239
7247
  mainLabel: "Anamnesis record — {{mode}}",
7240
7248
  mode: { intake: "Intake", compile: "Compile", readOnly: "Read-only" },
@@ -7871,7 +7879,7 @@ const Za = "patterns", tr = {
7871
7879
  }
7872
7880
  }
7873
7881
  }
7874
- }, ir = {
7882
+ }, sr = {
7875
7883
  anamnesis: {
7876
7884
  mainLabel: "Cartella anamnestica — {{mode}}",
7877
7885
  mode: {
@@ -8499,7 +8507,7 @@ const Za = "patterns", tr = {
8499
8507
  }
8500
8508
  }
8501
8509
  }
8502
- }, sr = {
8510
+ }, or = {
8503
8511
  anamnesis: {
8504
8512
  mainLabel: "السجل الطبي — {{mode}}",
8505
8513
  mode: { intake: "الاستجواب", compile: "التجميع", readOnly: "للقراءة فقط" },
@@ -8774,7 +8782,7 @@ const Za = "patterns", tr = {
8774
8782
  groupGeneral: "عام"
8775
8783
  }
8776
8784
  }
8777
- }, or = {
8785
+ }, rr = {
8778
8786
  anamnesis: {
8779
8787
  mainLabel: "問診記録 — {{mode}}",
8780
8788
  mode: { intake: "問診", compile: "記入", readOnly: "閲覧のみ" },
@@ -9044,28 +9052,28 @@ const Za = "patterns", tr = {
9044
9052
  groupGeneral: "一般"
9045
9053
  }
9046
9054
  }
9047
- }, rr = {
9048
- en: tr,
9049
- it: ir,
9050
- ar: sr,
9051
- ja: or
9055
+ }, lr = {
9056
+ en: ir,
9057
+ it: sr,
9058
+ ar: or,
9059
+ ja: rr
9052
9060
  };
9053
- function ul(e) {
9054
- for (const [a, n] of Object.entries(rr))
9061
+ function pl(e) {
9062
+ for (const [a, n] of Object.entries(lr))
9055
9063
  e.hasResourceBundle(a, Za) ? e.addResourceBundle(a, Za, n, !0, !1) : e.addResourceBundle(a, Za, n);
9056
9064
  }
9057
9065
  export {
9058
- ll as A,
9066
+ cl as A,
9059
9067
  Ri as L,
9060
9068
  Za as P,
9061
9069
  Ge as S,
9062
9070
  Fi as T,
9063
- dl as a,
9071
+ ml as a,
9064
9072
  Re as b,
9065
9073
  en as c,
9066
9074
  He as d,
9067
9075
  jn as e,
9068
- ml as f,
9076
+ ul as f,
9069
9077
  $i as g,
9070
9078
  Ne as h,
9071
9079
  at as i,
@@ -9075,7 +9083,7 @@ export {
9075
9083
  Ya as m,
9076
9084
  oa as n,
9077
9085
  Lt as o,
9078
- ul as r,
9079
- cl as s
9086
+ pl as r,
9087
+ dl as s
9080
9088
  };
9081
- //# sourceMappingURL=anamnesis-i18n-DFXSM72N.js.map
9089
+ //# sourceMappingURL=anamnesis-i18n-9OrXTNS3.js.map