@alfadocs/ui-kit 1.3.13 → 1.4.0

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 (185) hide show
  1. package/dist/_chunks/agenda-card.agent-Cb5tuEh3.js +28 -0
  2. package/dist/_chunks/{alia-sidebar-DzNz1gDf.js → alia-sidebar-DSBZMick.js} +3 -3
  3. package/dist/_chunks/{anamnesis-i18n-CfC0qYzy.js → anamnesis-i18n-BA631X4t.js} +2209 -2144
  4. package/dist/_chunks/{antenatal-schedule-timeline-BMMpi2lb.js → antenatal-schedule-timeline-u8TsS2QJ.js} +27 -26
  5. package/dist/_chunks/{appointment-timeline-B630OT_J.js → appointment-timeline-Bqf1sTU5.js} +2 -2
  6. package/dist/_chunks/{ar-THMLfSoN.js → ar-BR1FGFP2.js} +14 -14
  7. package/dist/_chunks/{bmi-calculator-CM0-G2mg.js → bmi-calculator-CpyY13MV.js} +2 -2
  8. package/dist/_chunks/{booking-DjNbd7C1.js → booking-BjsA7j1-.js} +699 -688
  9. package/dist/_chunks/calculator-dialog-12d3Sxaz.js +48 -0
  10. package/dist/_chunks/{care-plan-card-1G_f4I5s.js → care-plan-card-BvQy366X.js} +3 -3
  11. package/dist/_chunks/{care-plan-entry-card-DmBsffHS.js → care-plan-entry-card-apk_5B3O.js} +2 -2
  12. package/dist/_chunks/{chat-container-HlFnoEIl.js → chat-container-CYYego1W.js} +105 -81
  13. package/dist/_chunks/cycle-calculator-B7fyH-h4.js +425 -0
  14. package/dist/_chunks/{date-picker-ZHejTVAJ.js → date-picker-Bp64zk2p.js} +19 -19
  15. package/dist/_chunks/date-picker-variants-pKAJfnWr.js +2089 -0
  16. package/dist/_chunks/{date-range-picker-pEG3Ln3i.js → date-range-picker-CDrZ8Zh0.js} +27 -27
  17. package/dist/_chunks/{date-time-picker-695QvBGj.js → date-time-picker-DafkGDGO.js} +10 -10
  18. package/dist/_chunks/{de-DmZ-8rTN.js → de-3iM4rGqo.js} +7 -7
  19. package/dist/_chunks/{document-preview-D3gg4MXB.js → document-preview-DOrsqiN1.js} +2 -2
  20. package/dist/_chunks/due-date-calculator-CnkbbAej.js +571 -0
  21. package/dist/_chunks/{editor-overlay-DE3esyio.js → editor-overlay-B1tr2i7B.js} +22 -21
  22. package/dist/_chunks/{el-Bela9mxs.js → el-C96rGJvU.js} +2 -2
  23. package/dist/_chunks/{es-BNncHKex.js → es-Cxiqjx8r.js} +12 -12
  24. package/dist/_chunks/fetal-weight-avlj-l-S.js +223 -0
  25. package/dist/_chunks/format-4HNwNGrN.js +1315 -0
  26. package/dist/_chunks/{fr-CH8ADfhN.js → fr-Bhr6SYKj.js} +21 -21
  27. package/dist/_chunks/{freemium-paywall-C_Ue6wxU.js → freemium-paywall-DRDdWuOg.js} +3 -3
  28. package/dist/_chunks/gestational-age-calculator-BljY_DVJ.js +488 -0
  29. package/dist/_chunks/hcg-doubling-Cv_vH61p.js +312 -0
  30. package/dist/_chunks/header-settings-Cn5fPXCE.js +335 -0
  31. package/dist/_chunks/{hi-Bppfxp8l.js → hi-BxXX26d_.js} +12 -12
  32. package/dist/_chunks/isSameWeek-B73MagWB.js +13 -0
  33. package/dist/_chunks/{it-B4ySaRyK.js → it-Xmjomvyj.js} +24 -24
  34. package/dist/_chunks/{ja-CGF6Io9P.js → ja-mfZvt1ZV.js} +16 -16
  35. package/dist/_chunks/{link-cell-renderer-C5XLwVXQ.js → link-cell-renderer-CJ_gk7gl.js} +3 -3
  36. package/dist/_chunks/{locale-picker-BfBUdT1m.js → locale-picker-D9Kv2zrK.js} +153 -132
  37. package/dist/_chunks/map-view-2yZCQW2l.js +445 -0
  38. package/dist/_chunks/{marketplace-app-shell-DwcFMxzp.js → marketplace-app-shell-BLRvg-M0.js} +49 -40
  39. package/dist/_chunks/{nl-DuShqwuV.js → nl-DDs-KEnD.js} +15 -15
  40. package/dist/_chunks/{notes-panel-DPsgB4Mv.js → notes-panel-CiFN3sLW.js} +2 -2
  41. package/dist/_chunks/{number-input-DrozbZAU.js → number-input-DOe5VYei.js} +64 -64
  42. package/dist/_chunks/{optical-prescription-BDHJr8Zz.js → optical-prescription-CRemE8fL.js} +2 -2
  43. package/dist/_chunks/{parse-DvA97ro9.js → parse-JqixfsU0.js} +43 -43
  44. package/dist/_chunks/parseISO-fOGpHKXm.js +120 -0
  45. package/dist/_chunks/{patient-details-DqjjwPmt.js → patient-details-CpunD0qx.js} +3 -3
  46. package/dist/_chunks/{patient-table-BmIDrLIS.js → patient-table-2eWx-Rrk.js} +2 -2
  47. package/dist/_chunks/{payment-form-h-BZ8onk.js → payment-form-Ds1I9KqB.js} +308 -231
  48. package/dist/_chunks/{pdf-viewer-Ddx-T053.js → pdf-viewer-DUIsV9s5.js} +429 -369
  49. package/dist/_chunks/{pl-CKQwX9Fk.js → pl-BYYMnEWP.js} +18 -18
  50. package/dist/_chunks/{practice-results-B-HPc13W.js → practice-results-SjCniMd2.js} +2 -2
  51. package/dist/_chunks/pregnancy-dating-BmpHScZ0.js +770 -0
  52. package/dist/_chunks/pregnancy-weight-gain-B5KSJzdc.js +553 -0
  53. package/dist/_chunks/progress-CK8otcQ-.js +343 -0
  54. package/dist/_chunks/{pt-_njpXyOZ.js → pt-BSPnVrQ7.js} +20 -20
  55. package/dist/_chunks/{radiograph-panel.agent-BQZ64Riy.js → radiograph-panel.agent-CtFtNMzk.js} +3 -3
  56. package/dist/_chunks/{rich-text-editor-CfeXPPWs.js → rich-text-editor-BedTpWzL.js} +2 -2
  57. package/dist/_chunks/{ro-3X6_4FcN.js → ro-BbiylGmG.js} +14 -14
  58. package/dist/_chunks/{ru-bAcgmnS-.js → ru-BX_qsV67.js} +14 -14
  59. package/dist/_chunks/{session-countdown-Bc70VXN1.js → session-countdown-BL-Psg8u.js} +2 -2
  60. package/dist/_chunks/{sign-document-CW_ByDUh.js → sign-document-jF4fZDJ5.js} +2 -2
  61. package/dist/_chunks/slot-grid-DNiUcXy2.js +640 -0
  62. package/dist/_chunks/{sparkline-BTY4B5tv.js → sparkline-BmGcEyZO.js} +209 -164
  63. package/dist/_chunks/{sq-jYFqr4Ga.js → sq-i9UOk4P7.js} +10 -10
  64. package/dist/_chunks/subDays-CAUv47M1.js +8 -0
  65. package/dist/_chunks/{sv-BSGEJ-8B.js → sv-CpTdtmDQ.js} +8 -8
  66. package/dist/_chunks/{tab-bar-Axhk6xzx.js → tab-bar-BYESZINM.js} +83 -77
  67. package/dist/_chunks/task-card.agent-CF2N_uu4.js +29 -0
  68. package/dist/_chunks/{tr-CTpgUtw6.js → tr-DXG2QN1K.js} +17 -17
  69. package/dist/_chunks/{unit-converter-COgkN7YP.js → unit-converter-CHPDuV7W.js} +2 -2
  70. package/dist/_chunks/{warning-stack-BtjmJChC.js → warning-stack-B7t_8jRE.js} +42 -37
  71. package/dist/_chunks/{zh-CN-BgM0Io2O.js → zh-CN-vPkPEK6H.js} +18 -18
  72. package/dist/agent-catalog.json +6426 -3382
  73. package/dist/agent-i18n/en.json +234 -15
  74. package/dist/components/agenda-card/index.js +1 -1
  75. package/dist/components/appointment-timeline/index.js +1 -1
  76. package/dist/components/bmi-calculator/index.js +1 -1
  77. package/dist/components/booking/index.js +1 -1
  78. package/dist/components/calculator-dialog/index.js +1 -1
  79. package/dist/components/care-plan-card/index.js +1 -1
  80. package/dist/components/care-plan-entry-card/index.js +1 -1
  81. package/dist/components/chat-container/chat-container.d.ts +14 -0
  82. package/dist/components/chat-container/index.js +1 -1
  83. package/dist/components/cycle-calculator/cycle-calculator.agent.d.ts +4 -0
  84. package/dist/components/cycle-calculator/cycle-calculator.d.ts +42 -0
  85. package/dist/components/cycle-calculator/index.d.ts +1 -1
  86. package/dist/components/cycle-calculator/index.js +1 -1
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/date-picker/index.js +1 -1
  89. package/dist/components/date-range-picker/index.js +1 -1
  90. package/dist/components/date-time-picker/index.js +1 -1
  91. package/dist/components/document-preview/index.js +1 -1
  92. package/dist/components/due-date-calculator/due-date-calculator.agent.d.ts +4 -0
  93. package/dist/components/due-date-calculator/due-date-calculator.d.ts +61 -1
  94. package/dist/components/due-date-calculator/index.d.ts +1 -1
  95. package/dist/components/due-date-calculator/index.js +2 -2
  96. package/dist/components/editor-overlay/editor-overlay.d.ts +7 -1
  97. package/dist/components/editor-overlay/index.js +1 -1
  98. package/dist/components/fetal-weight/fetal-weight.agent.d.ts +4 -0
  99. package/dist/components/fetal-weight/fetal-weight.d.ts +26 -0
  100. package/dist/components/fetal-weight/index.d.ts +1 -1
  101. package/dist/components/fetal-weight/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/gestational-age-calculator/gestational-age-calculator.agent.d.ts +4 -0
  104. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +44 -2
  105. package/dist/components/gestational-age-calculator/index.d.ts +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/hcg-doubling/hcg-doubling.agent.d.ts +4 -0
  108. package/dist/components/hcg-doubling/hcg-doubling.d.ts +30 -0
  109. package/dist/components/hcg-doubling/index.d.ts +1 -1
  110. package/dist/components/hcg-doubling/index.js +1 -1
  111. package/dist/components/header-settings/header-settings.d.ts +13 -1
  112. package/dist/components/header-settings/index.js +1 -1
  113. package/dist/components/locale-picker/index.js +1 -1
  114. package/dist/components/locale-picker/locale-picker.d.ts +9 -0
  115. package/dist/components/map-view/index.js +1 -1
  116. package/dist/components/map-view/map-view.d.ts +22 -0
  117. package/dist/components/notes-panel/index.js +1 -1
  118. package/dist/components/number-input/index.js +1 -1
  119. package/dist/components/number-input/number-input.d.ts +2 -1
  120. package/dist/components/optical-prescription/index.js +1 -1
  121. package/dist/components/patient-details/index.js +1 -1
  122. package/dist/components/patient-table/index.js +1 -1
  123. package/dist/components/payment-form/index.d.ts +1 -1
  124. package/dist/components/payment-form/index.js +1 -1
  125. package/dist/components/payment-form/payment-form.d.ts +32 -1
  126. package/dist/components/pdf-viewer/index.js +1 -1
  127. package/dist/components/pdf-viewer/pdf-viewer.d.ts +13 -0
  128. package/dist/components/practice-results/index.js +1 -1
  129. package/dist/components/pregnancy-dating/index.d.ts +1 -1
  130. package/dist/components/pregnancy-dating/index.js +1 -1
  131. package/dist/components/pregnancy-dating/pregnancy-dating.agent.d.ts +4 -0
  132. package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +65 -1
  133. package/dist/components/pregnancy-weight-gain/index.d.ts +2 -1
  134. package/dist/components/pregnancy-weight-gain/index.js +6 -5
  135. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.agent.d.ts +4 -0
  136. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +35 -0
  137. package/dist/components/progress/index.js +1 -1
  138. package/dist/components/progress/progress.d.ts +13 -0
  139. package/dist/components/radiograph-panel/index.js +1 -1
  140. package/dist/components/rich-text-editor/index.js +1 -1
  141. package/dist/components/session-countdown/index.js +1 -1
  142. package/dist/components/sign-document/index.js +1 -1
  143. package/dist/components/slot-grid/index.d.ts +2 -1
  144. package/dist/components/slot-grid/index.js +5 -4
  145. package/dist/components/slot-grid/slot-grid.agent.d.ts +4 -0
  146. package/dist/components/slot-grid/slot-grid.d.ts +34 -0
  147. package/dist/components/sparkline/index.js +1 -1
  148. package/dist/components/sparkline/sparkline.d.ts +10 -0
  149. package/dist/components/tab-bar/index.js +1 -1
  150. package/dist/components/tab-bar/tab-bar.d.ts +13 -0
  151. package/dist/components/task-card/index.js +1 -1
  152. package/dist/components/unit-converter/index.js +1 -1
  153. package/dist/components/warning-stack/index.js +1 -1
  154. package/dist/index.js +630 -627
  155. package/dist/patterns/alia-assistant/index.js +1 -1
  156. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +27 -8
  157. package/dist/patterns/anamnesis/anamnesis-format.d.ts +11 -3
  158. package/dist/patterns/anamnesis/anamnesis-highlight.d.ts +6 -0
  159. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts +23 -9
  160. package/dist/patterns/anamnesis/anamnesis-types.d.ts +7 -0
  161. package/dist/patterns/anamnesis/anamnesis.d.ts +16 -7
  162. package/dist/patterns/anamnesis/index.d.ts +3 -2
  163. package/dist/patterns/anamnesis/index.js +7 -6
  164. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  165. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +6 -0
  166. package/dist/tokens.css +1 -1
  167. package/package.json +1 -1
  168. package/dist/_chunks/agenda-card.agent-mTCrkKSZ.js +0 -27
  169. package/dist/_chunks/calculator-dialog-DuXMQSdm.js +0 -40
  170. package/dist/_chunks/cycle-calculator-BwqYVPB4.js +0 -252
  171. package/dist/_chunks/date-picker-variants-eL6HjWvw.js +0 -3363
  172. package/dist/_chunks/due-date-calculator-CwfsFd3T.js +0 -256
  173. package/dist/_chunks/fetal-weight-ePlLjJPc.js +0 -122
  174. package/dist/_chunks/gestational-age-calculator-DdgbH69Z.js +0 -311
  175. package/dist/_chunks/hcg-doubling-BBqD2wI2.js +0 -170
  176. package/dist/_chunks/header-settings--pjYOe6g.js +0 -284
  177. package/dist/_chunks/isSameDay-DUEiAT0G.js +0 -39
  178. package/dist/_chunks/isSameWeek-CK4HS9lH.js +0 -14
  179. package/dist/_chunks/map-view-CsaHfoo6.js +0 -378
  180. package/dist/_chunks/pregnancy-dating-DzYTlBkT.js +0 -421
  181. package/dist/_chunks/pregnancy-weight-gain-O6J0sUIi.js +0 -322
  182. package/dist/_chunks/progress-DA413-zn.js +0 -299
  183. package/dist/_chunks/slot-grid-CQSULZjd.js +0 -502
  184. package/dist/_chunks/subDays-BcNi04uf.js +0 -8
  185. package/dist/_chunks/task-card.agent-Bt14CzUd.js +0 -25
@@ -1,4 +1,4 @@
1
- import { A as d, B as o, E as r, F as s } from "./date-picker-variants-eL6HjWvw.js";
1
+ import { g as d, h as o, j as r, k as s } from "./format-4HNwNGrN.js";
2
2
  const m = {
3
3
  lessThanXSeconds: {
4
4
  one: "menos de un segundo",
@@ -189,7 +189,7 @@ const m = {
189
189
  evening: "tarde",
190
190
  night: "noche"
191
191
  }
192
- }, W = {
192
+ }, j = {
193
193
  narrow: {
194
194
  am: "a",
195
195
  pm: "p",
@@ -220,8 +220,8 @@ const m = {
220
220
  evening: "de la tarde",
221
221
  night: "de la noche"
222
222
  }
223
- }, j = (e, n) => Number(e) + "º", D = {
224
- ordinalNumber: j,
223
+ }, W = (e, n) => Number(e) + "º", D = {
224
+ ordinalNumber: W,
225
225
  era: o({
226
226
  values: v,
227
227
  defaultWidth: "wide"
@@ -242,7 +242,7 @@ const m = {
242
242
  dayPeriod: o({
243
243
  values: M,
244
244
  defaultWidth: "wide",
245
- formattingValues: W,
245
+ formattingValues: j,
246
246
  defaultFormattingWidth: "wide"
247
247
  })
248
248
  }, k = /^(\d+)(º)?/i, x = /\d+/i, H = {
@@ -299,13 +299,13 @@ const m = {
299
299
  short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
300
300
  abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
301
301
  wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
302
- }, E = {
302
+ }, L = {
303
303
  narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
304
304
  any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
305
- }, L = {
305
+ }, N = {
306
306
  narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
307
307
  any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
308
- }, N = {
308
+ }, E = {
309
309
  any: {
310
310
  am: /^a/i,
311
311
  pm: /^p/i,
@@ -346,13 +346,13 @@ const m = {
346
346
  day: r({
347
347
  matchPatterns: X,
348
348
  defaultMatchWidth: "wide",
349
- parsePatterns: E,
349
+ parsePatterns: L,
350
350
  defaultParseWidth: "any"
351
351
  }),
352
352
  dayPeriod: r({
353
- matchPatterns: L,
353
+ matchPatterns: N,
354
354
  defaultMatchWidth: "any",
355
- parsePatterns: N,
355
+ parsePatterns: E,
356
356
  defaultParseWidth: "any"
357
357
  })
358
358
  }, R = {
@@ -370,4 +370,4 @@ const m = {
370
370
  export {
371
371
  R as es
372
372
  };
373
- //# sourceMappingURL=es-BNncHKex.js.map
373
+ //# sourceMappingURL=es-Cxiqjx8r.js.map
@@ -0,0 +1,223 @@
1
+ import { jsxs as p, jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as R, useState as y, useMemo as N, useEffect as E, useRef as O } from "react";
3
+ import { c as P } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as V } from "react-i18next";
5
+ import { u as _ } from "./registry-DvAUVLHh.js";
6
+ import { F as D } from "./form-field-M5UpX65Z.js";
7
+ import { N as q } from "./number-input-DOe5VYei.js";
8
+ import { C } from "./card-DPmk26CL.js";
9
+ import { B as z } from "./badge-DCOqV9mI.js";
10
+ import { I as G } from "./insert-result-D074GtHX.js";
11
+ const v = (e) => ({
12
+ oneOf: [{ type: "number", exclusiveMinimum: 0 }, { type: "null" }],
13
+ description: `${e} in millimetres, or null to clear it.`
14
+ }), J = {
15
+ id: "fetal-weight",
16
+ // set_value → the `set_biometry` action + the `biometry` state slot.
17
+ capabilities: ["set_value"],
18
+ state: {
19
+ biometry: {
20
+ type: "{ bpdMm: number | null, hcMm: number | null, acMm: number | null, flMm: number | null }",
21
+ descriptionKey: "ui.agent.fetalWeight.state.biometry",
22
+ description: "The four ultrasound measurements as entered, in millimetres — biparietal diameter, head circumference, abdominal circumference and femur length. Null where unset. Read this to see why a result is still null.",
23
+ read: (e) => e.getBiometry()
24
+ },
25
+ result: {
26
+ type: "{ grams: number, method: 'hadlock4' | 'hadlock1' } | null",
27
+ descriptionKey: "ui.agent.fetalWeight.state.result",
28
+ description: "Estimated fetal weight in grams and which Hadlock regression produced it — `hadlock4` when all four measurements are present, `hadlock1` from AC + FL alone. Null until AC and FL are both set.",
29
+ read: (e) => e.getResult()
30
+ }
31
+ },
32
+ actions: {
33
+ set_biometry: {
34
+ // Drives the same local input state a user types into; nothing is
35
+ // persisted to a record, and every value is reversible in the same UI.
36
+ safety: "write",
37
+ argsType: "{ bpdMm?: number | null, hcMm?: number | null, acMm?: number | null, flMm?: number | null }",
38
+ argsSchema: {
39
+ type: "object",
40
+ properties: {
41
+ bpdMm: v("Biparietal diameter"),
42
+ hcMm: v("Head circumference"),
43
+ acMm: v("Abdominal circumference"),
44
+ flMm: v("Femur length")
45
+ },
46
+ additionalProperties: !1
47
+ },
48
+ idempotent: !0,
49
+ returns: "boolean",
50
+ returnsSchema: {
51
+ type: "boolean",
52
+ description: "True when the measurements were applied."
53
+ },
54
+ errors: [
55
+ "Returns false and writes nothing when any supplied measurement is not a positive number — the payload applies all-or-nothing."
56
+ ],
57
+ examples: [
58
+ {
59
+ args: { bpdMm: 85, hcMm: 310, acMm: 300, flMm: 62 },
60
+ note: "Full biometry around 32 weeks → the Hadlock 4-parameter estimate."
61
+ },
62
+ {
63
+ args: { acMm: 300, flMm: 62 },
64
+ note: "AC + FL only — the minimum for an estimate, via Hadlock 1."
65
+ }
66
+ ],
67
+ descriptionKey: "ui.agent.fetalWeight.actions.setBiometry",
68
+ description: "Set any subset of the ultrasound biometry in millimetres. Omitted measurements are left unchanged; an explicit null clears one. AC and FL are the minimum for an estimate.",
69
+ invoke: (e, s) => e.setBiometry(s)
70
+ }
71
+ },
72
+ domHooks: {
73
+ root: {
74
+ attr: "data-component",
75
+ value: "fetal-weight",
76
+ description: "Marks the FetalWeight calculator (estimated fetal weight from ultrasound biometry)."
77
+ },
78
+ instanceId: {
79
+ attr: "data-component-id",
80
+ sourceProp: "id",
81
+ description: "Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven action/state are unreachable."
82
+ }
83
+ }
84
+ };
85
+ function w(e) {
86
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? e / 10 : null;
87
+ }
88
+ function Q(e) {
89
+ const s = w(e.bpdMm), d = w(e.hcMm), r = w(e.acMm), n = w(e.flMm);
90
+ if (r === null || n === null) return null;
91
+ let c, m;
92
+ return s !== null && d !== null ? (c = 1.3596 - 386e-5 * r * n + 64e-4 * d + 61e-5 * s * r + 0.0424 * r + 0.174 * n, m = "hadlock4") : (c = 1.304 + 0.05281 * r + 0.1938 * n - 4e-3 * r * n, m = "hadlock1"), { grams: Math.round(10 ** c), method: m };
93
+ }
94
+ const U = P("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
95
+ variants: {
96
+ width: { full: "ds:w-full", auto: "ds:inline-flex" }
97
+ },
98
+ defaultVariants: { width: "full" }
99
+ }), X = (e) => e == null || Number.isFinite(e) && e > 0, Y = R(
100
+ ({
101
+ onResultChange: e,
102
+ onInsert: s,
103
+ insertVariant: d = "insert",
104
+ onCopy: r,
105
+ onError: n,
106
+ insertBrand: c,
107
+ id: m,
108
+ width: H,
109
+ className: $
110
+ }, T) => {
111
+ const { t, i18n: F } = V(), [u, k] = y(null), [h, B] = y(null), [f, A] = y(null), [g, L] = y(null), i = N(
112
+ () => Q({ bpdMm: u, hcMm: h, acMm: f, flMm: g }),
113
+ [u, h, f, g]
114
+ );
115
+ E(() => {
116
+ e == null || e(i);
117
+ }, [i, e]);
118
+ const W = O({ bpdMm: u, hcMm: h, acMm: f, flMm: g, result: i });
119
+ W.current = { bpdMm: u, hcMm: h, acMm: f, flMm: g, result: i };
120
+ const S = N(
121
+ () => ({
122
+ getBiometry: () => {
123
+ const { bpdMm: a, hcMm: M, acMm: o, flMm: x } = W.current;
124
+ return { bpdMm: a, hcMm: M, acMm: o, flMm: x };
125
+ },
126
+ getResult: () => W.current.result,
127
+ setBiometry: (a) => {
128
+ const M = [
129
+ ["bpdMm", k],
130
+ ["hcMm", B],
131
+ ["acMm", A],
132
+ ["flMm", L]
133
+ ];
134
+ for (const [o] of M)
135
+ if (o in a && !X(a[o])) return !1;
136
+ for (const [o, x] of M)
137
+ o in a && x(a[o] ?? null);
138
+ return !0;
139
+ }
140
+ }),
141
+ []
142
+ );
143
+ _(J, S, m);
144
+ const I = N(
145
+ () => new Intl.NumberFormat(F.language, { maximumFractionDigits: 0 }),
146
+ [F.language]
147
+ ), j = t("fetalWeight.units.mm"), b = (a) => t("fetalWeight.efwValue", { grams: I.format(a.grams) }), K = [
148
+ { label: t("fetalWeight.bpd"), value: u, onChange: k },
149
+ { label: t("fetalWeight.hc"), value: h, onChange: B },
150
+ { label: t("fetalWeight.ac"), value: f, onChange: A },
151
+ { label: t("fetalWeight.fl"), value: g, onChange: L }
152
+ ];
153
+ return /* @__PURE__ */ p(
154
+ "div",
155
+ {
156
+ ref: T,
157
+ "data-component": "fetal-weight",
158
+ "data-component-id": m,
159
+ className: U({ width: H, className: $ }),
160
+ children: [
161
+ /* @__PURE__ */ l("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: K.map((a) => /* @__PURE__ */ l(D, { label: `${a.label} (${j})`, children: /* @__PURE__ */ l(
162
+ q,
163
+ {
164
+ mode: "decimal",
165
+ min: 0,
166
+ step: 0.1,
167
+ value: a.value,
168
+ onChange: a.onChange
169
+ }
170
+ ) }, a.label)) }),
171
+ /* @__PURE__ */ l("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: i ? `${t("fetalWeight.efwLabel")}: ${b(i)}.` : "" }),
172
+ i ? /* @__PURE__ */ l(C, { variant: "elevated", children: /* @__PURE__ */ p(C.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
173
+ /* @__PURE__ */ p("dl", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
174
+ /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]", children: [
175
+ /* @__PURE__ */ l("dt", { className: "type-label ds:text-muted-foreground", children: t("fetalWeight.efwLabel") }),
176
+ /* @__PURE__ */ l("dd", { className: "type-metric ds:text-foreground", children: b(i) })
177
+ ] }),
178
+ /* @__PURE__ */ p("div", { className: "ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end", children: [
179
+ /* @__PURE__ */ l("dt", { className: "type-label ds:text-muted-foreground", children: t("fetalWeight.methodLabel") }),
180
+ /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l(z, { variant: "info", children: t(`fetalWeight.method.${i.method}`) }) })
181
+ ] })
182
+ ] }),
183
+ /* @__PURE__ */ l("p", { className: "type-body-sm ds:text-muted-foreground", children: t("fetalWeight.disclaimer") }),
184
+ d === "copy" || s ? /* @__PURE__ */ l(
185
+ G,
186
+ {
187
+ onInsert: s,
188
+ variant: d,
189
+ onCopy: r,
190
+ onError: n,
191
+ card: {
192
+ title: t("insert.title.fetalWeight"),
193
+ icon: "scale",
194
+ highlight: b(i),
195
+ highlightToken: "--info",
196
+ brand: c,
197
+ fields: [
198
+ {
199
+ icon: "scale",
200
+ label: t("fetalWeight.efwLabel"),
201
+ value: b(i)
202
+ },
203
+ {
204
+ icon: "activity",
205
+ label: t("fetalWeight.methodLabel"),
206
+ value: t(`fetalWeight.method.${i.method}`)
207
+ }
208
+ ]
209
+ }
210
+ }
211
+ ) : null
212
+ ] }) }) : /* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: t("fetalWeight.empty") })
213
+ ]
214
+ }
215
+ );
216
+ }
217
+ );
218
+ Y.displayName = "FetalWeight";
219
+ export {
220
+ Y as F,
221
+ Q as e
222
+ };
223
+ //# sourceMappingURL=fetal-weight-avlj-l-S.js.map