@alfadocs/ui-kit-debug 1.6.0 → 1.7.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 (400) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js → actions-cell-renderer-ALEAGO3j.js} +6 -6
  2. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js.map → actions-cell-renderer-ALEAGO3j.js.map} +1 -1
  3. package/dist/_chunks/{agenda-tray-CYR-znfE.js → agenda-tray-BweO8pDo.js} +3 -3
  4. package/dist/_chunks/{agenda-tray-CYR-znfE.js.map → agenda-tray-BweO8pDo.js.map} +1 -1
  5. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js → ai-consent-banner-OggpS5hW.js} +2 -2
  6. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js.map → ai-consent-banner-OggpS5hW.js.map} +1 -1
  7. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js → ai-prompt-input-DnbfEJnr.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js.map → ai-prompt-input-DnbfEJnr.js.map} +1 -1
  9. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js → alia-sidebar-BWcWZivN.js} +7 -7
  10. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js.map → alia-sidebar-BWcWZivN.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-card-BylMLHYj.js → anamnesis-card-NTi4LLzI.js} +2 -2
  12. package/dist/_chunks/{anamnesis-card-BylMLHYj.js.map → anamnesis-card-NTi4LLzI.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js → anamnesis-summary-rows-F-cCmFAn.js} +7 -7
  14. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js.map → anamnesis-summary-rows-F-cCmFAn.js.map} +1 -1
  15. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js → appointment-timeline-CMPvzlGZ.js} +4 -4
  16. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js.map → appointment-timeline-CMPvzlGZ.js.map} +1 -1
  17. package/dist/_chunks/{appointment-tray-DvyVK7um.js → appointment-tray-3c_FLxXJ.js} +3 -3
  18. package/dist/_chunks/{appointment-tray-DvyVK7um.js.map → appointment-tray-3c_FLxXJ.js.map} +1 -1
  19. package/dist/_chunks/{audio-recorder-nVRN4PSK.js → audio-recorder-EWBCNIsd.js} +3 -3
  20. package/dist/_chunks/{audio-recorder-nVRN4PSK.js.map → audio-recorder-EWBCNIsd.js.map} +1 -1
  21. package/dist/_chunks/{bishop-score-BV1JAEMV.js → bishop-score-Cnu0xs-z.js} +2 -2
  22. package/dist/_chunks/{bishop-score-BV1JAEMV.js.map → bishop-score-Cnu0xs-z.js.map} +1 -1
  23. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js → bmi-calculator-CcH6upht.js} +2 -2
  24. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js.map → bmi-calculator-CcH6upht.js.map} +1 -1
  25. package/dist/_chunks/{booking-D84O6H2X.js → booking-CQMJUFG-.js} +5 -5
  26. package/dist/_chunks/{booking-D84O6H2X.js.map → booking-CQMJUFG-.js.map} +1 -1
  27. package/dist/_chunks/{button-group-Be_In68J.js → button-group-CaxRJsNG.js} +2 -2
  28. package/dist/_chunks/{button-group-Be_In68J.js.map → button-group-CaxRJsNG.js.map} +1 -1
  29. package/dist/_chunks/{button-BvNtqHAS.js → button-nJaPh_HC.js} +68 -38
  30. package/dist/_chunks/button-nJaPh_HC.js.map +1 -0
  31. package/dist/_chunks/{care-plan-card-CehAU7F_.js → care-plan-card-DQjVRDxO.js} +2 -2
  32. package/dist/_chunks/{care-plan-card-CehAU7F_.js.map → care-plan-card-DQjVRDxO.js.map} +1 -1
  33. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js → care-plan-entry-card-CMpoeNkb.js} +2 -2
  34. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js.map → care-plan-entry-card-CMpoeNkb.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-header-_B0TTWT1.js → care-plan-header-CxYoq23f.js} +2 -2
  36. package/dist/_chunks/{care-plan-header-_B0TTWT1.js.map → care-plan-header-CxYoq23f.js.map} +1 -1
  37. package/dist/_chunks/{carousel.agent-pjORsMS8.js → carousel.agent-CLxdHEBP.js} +2 -2
  38. package/dist/_chunks/{carousel.agent-pjORsMS8.js.map → carousel.agent-CLxdHEBP.js.map} +1 -1
  39. package/dist/_chunks/{chart-Y-gso_Uz.js → chart-Bkr1Sh4o.js} +3 -3
  40. package/dist/_chunks/{chart-Y-gso_Uz.js.map → chart-Bkr1Sh4o.js.map} +1 -1
  41. package/dist/_chunks/{chat-input-BqI9GXQh.js → chat-input-BsB5Umpj.js} +2 -2
  42. package/dist/_chunks/{chat-input-BqI9GXQh.js.map → chat-input-BsB5Umpj.js.map} +1 -1
  43. package/dist/_chunks/{chat-message-DHNUbjXA.js → chat-message-DBQu10rs.js} +3 -3
  44. package/dist/_chunks/{chat-message-DHNUbjXA.js.map → chat-message-DBQu10rs.js.map} +1 -1
  45. package/dist/_chunks/{code-block-BONe9fJi.js → code-block-BIkpRLkl.js} +2 -2
  46. package/dist/_chunks/{code-block-BONe9fJi.js.map → code-block-BIkpRLkl.js.map} +1 -1
  47. package/dist/_chunks/{connection-status-NT8hUtYl.js → connection-status-DRZIcMqM.js} +3 -3
  48. package/dist/_chunks/{connection-status-NT8hUtYl.js.map → connection-status-DRZIcMqM.js.map} +1 -1
  49. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js → contact-profile-card-CE9OJKcl.js} +2 -2
  50. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js.map → contact-profile-card-CE9OJKcl.js.map} +1 -1
  51. package/dist/_chunks/{control-room-rail-DDyPDBji.js → control-room-rail-IH1eBjrK.js} +3 -3
  52. package/dist/_chunks/{control-room-rail-DDyPDBji.js.map → control-room-rail-IH1eBjrK.js.map} +1 -1
  53. package/dist/_chunks/{copy-field-B-DoMBH_.js → copy-field-fYKpl6aN.js} +2 -2
  54. package/dist/_chunks/{copy-field-B-DoMBH_.js.map → copy-field-fYKpl6aN.js.map} +1 -1
  55. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js → cycle-calculator-DzgO1vzP.js} +2 -2
  56. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js.map → cycle-calculator-DzgO1vzP.js.map} +1 -1
  57. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js → dashboard-grid-BFtdHqfn.js} +2 -2
  58. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js.map → dashboard-grid-BFtdHqfn.js.map} +1 -1
  59. package/dist/_chunks/{data-table-tabs-C8uDThT3.js → data-table-tabs-C1kRUzat.js} +3 -3
  60. package/dist/_chunks/{data-table-tabs-C8uDThT3.js.map → data-table-tabs-C1kRUzat.js.map} +1 -1
  61. package/dist/_chunks/{description-list-Ck7fKdt5.js → description-list-CjJqR8WK.js} +2 -2
  62. package/dist/_chunks/{description-list-Ck7fKdt5.js.map → description-list-CjJqR8WK.js.map} +1 -1
  63. package/dist/_chunks/{document-preview-Aae2yKvY.js → document-preview-oyx9RhCo.js} +2 -2
  64. package/dist/_chunks/{document-preview-Aae2yKvY.js.map → document-preview-oyx9RhCo.js.map} +1 -1
  65. package/dist/_chunks/{document-scanner-qNZLhH_r.js → document-scanner-C5Vrbu21.js} +2 -2
  66. package/dist/_chunks/{document-scanner-qNZLhH_r.js.map → document-scanner-C5Vrbu21.js.map} +1 -1
  67. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js → due-date-calculator-wK8Tajzz.js} +2 -2
  68. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js.map → due-date-calculator-wK8Tajzz.js.map} +1 -1
  69. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js → editable-currency-cell-renderer-DYdzKpjL.js} +3 -3
  70. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js.map → editable-currency-cell-renderer-DYdzKpjL.js.map} +1 -1
  71. package/dist/_chunks/{editor-overlay-DE-gxj9L.js → editor-overlay-DEc5yYwo.js} +2 -2
  72. package/dist/_chunks/{editor-overlay-DE-gxj9L.js.map → editor-overlay-DEc5yYwo.js.map} +1 -1
  73. package/dist/_chunks/{empty-state-Df0tM6Kn.js → empty-state-X0sVPfVo.js} +2 -2
  74. package/dist/_chunks/{empty-state-Df0tM6Kn.js.map → empty-state-X0sVPfVo.js.map} +1 -1
  75. package/dist/_chunks/{entity-summary-DBOI5di6.js → entity-summary-B_vO5Ur4.js} +3 -3
  76. package/dist/_chunks/{entity-summary-DBOI5di6.js.map → entity-summary-B_vO5Ur4.js.map} +1 -1
  77. package/dist/_chunks/{face-scheme-D7Pub04e.js → face-scheme-BfDi4YkW.js} +5 -5
  78. package/dist/_chunks/{face-scheme-D7Pub04e.js.map → face-scheme-BfDi4YkW.js.map} +1 -1
  79. package/dist/_chunks/{fetal-weight-jon6GIfQ.js → fetal-weight-Dqy0T1fP.js} +2 -2
  80. package/dist/_chunks/{fetal-weight-jon6GIfQ.js.map → fetal-weight-Dqy0T1fP.js.map} +1 -1
  81. package/dist/_chunks/{field-array-BQFX5OYi.js → field-array-BjkXZzSr.js} +3 -3
  82. package/dist/_chunks/{field-array-BQFX5OYi.js.map → field-array-BjkXZzSr.js.map} +1 -1
  83. package/dist/_chunks/{field-value-BbiDRyNh.js → field-value-DG8zaZvo.js} +4 -4
  84. package/dist/_chunks/{field-value-BbiDRyNh.js.map → field-value-DG8zaZvo.js.map} +1 -1
  85. package/dist/_chunks/{file-manager-CML_C6_h.js → file-manager-Cc_upjZX.js} +6 -6
  86. package/dist/_chunks/{file-manager-CML_C6_h.js.map → file-manager-Cc_upjZX.js.map} +1 -1
  87. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js → finished-terminal-Br61Ip4e.js} +2 -2
  88. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js.map → finished-terminal-Br61Ip4e.js.map} +1 -1
  89. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js → fiscal-code-input-B_nYMSEM.js} +2 -2
  90. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js.map → fiscal-code-input-B_nYMSEM.js.map} +1 -1
  91. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js → freemium-paywall-DrXzYfv-.js} +2 -2
  92. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js.map → freemium-paywall-DrXzYfv-.js.map} +1 -1
  93. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js → gestational-age-calculator-C_uDAeP_.js} +2 -2
  94. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js.map → gestational-age-calculator-C_uDAeP_.js.map} +1 -1
  95. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js → hcg-doubling-BaXkJhT-.js} +2 -2
  96. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js.map → hcg-doubling-BaXkJhT-.js.map} +1 -1
  97. package/dist/_chunks/{header-CimZS-J9.js → header-DUXRIPyM.js} +2 -2
  98. package/dist/_chunks/{header-CimZS-J9.js.map → header-DUXRIPyM.js.map} +1 -1
  99. package/dist/_chunks/{header-settings-C0zHLXJE.js → header-settings-CVC_davE.js} +4 -4
  100. package/dist/_chunks/{header-settings-C0zHLXJE.js.map → header-settings-CVC_davE.js.map} +1 -1
  101. package/dist/_chunks/{icon-button-9c9Gp41m.js → icon-button-DA2CAGHZ.js} +2 -2
  102. package/dist/_chunks/{icon-button-9c9Gp41m.js.map → icon-button-DA2CAGHZ.js.map} +1 -1
  103. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js → icon-button-group-D6SVMteH.js} +2 -2
  104. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js.map → icon-button-group-D6SVMteH.js.map} +1 -1
  105. package/dist/_chunks/{icon-picker-DXV3sDp1.js → icon-picker-ChzpCnZ-.js} +3 -3
  106. package/dist/_chunks/{icon-picker-DXV3sDp1.js.map → icon-picker-ChzpCnZ-.js.map} +1 -1
  107. package/dist/_chunks/{image-cropper-DWSnyLwW.js → image-cropper-C84NDTB7.js} +2 -2
  108. package/dist/_chunks/{image-cropper-DWSnyLwW.js.map → image-cropper-C84NDTB7.js.map} +1 -1
  109. package/dist/_chunks/{info-tip-C4mPSJbS.js → info-tip-C119cwQl.js} +2 -2
  110. package/dist/_chunks/{info-tip-C4mPSJbS.js.map → info-tip-C119cwQl.js.map} +1 -1
  111. package/dist/_chunks/{insert-result-98J1QEp7.js → insert-result-LCNTskNJ.js} +2 -2
  112. package/dist/_chunks/{insert-result-98J1QEp7.js.map → insert-result-LCNTskNJ.js.map} +1 -1
  113. package/dist/_chunks/{key-value-pair-DGkGlgCF.js → key-value-pair-BubG4fUa.js} +2 -2
  114. package/dist/_chunks/{key-value-pair-DGkGlgCF.js.map → key-value-pair-BubG4fUa.js.map} +1 -1
  115. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js → link-cell-renderer-DH4JYpKU.js} +2 -2
  116. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js.map → link-cell-renderer-DH4JYpKU.js.map} +1 -1
  117. package/dist/_chunks/{locale-picker-sI0HWgZy.js → locale-picker-BvbVjDQ-.js} +3 -3
  118. package/dist/_chunks/{locale-picker-sI0HWgZy.js.map → locale-picker-BvbVjDQ-.js.map} +1 -1
  119. package/dist/_chunks/{map-view-iwSDRW3t.js → map-view-CCAlC9IL.js} +2 -2
  120. package/dist/_chunks/{map-view-iwSDRW3t.js.map → map-view-CCAlC9IL.js.map} +1 -1
  121. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js → marketplace-app-shell-Chfdia7m.js} +4 -4
  122. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js.map → marketplace-app-shell-Chfdia7m.js.map} +1 -1
  123. package/dist/_chunks/{message-card-BCJ-Jgs6.js → message-card-D8GB4FdF.js} +3 -3
  124. package/dist/_chunks/{message-card-BCJ-Jgs6.js.map → message-card-D8GB4FdF.js.map} +1 -1
  125. package/dist/_chunks/{message-tray-DHtm_WaF.js → message-tray-CGIRQjx5.js} +4 -4
  126. package/dist/_chunks/{message-tray-DHtm_WaF.js.map → message-tray-CGIRQjx5.js.map} +1 -1
  127. package/dist/_chunks/{notes-panel-D6HKLLS-.js → notes-panel-DlnENphf.js} +3 -3
  128. package/dist/_chunks/{notes-panel-D6HKLLS-.js.map → notes-panel-DlnENphf.js.map} +1 -1
  129. package/dist/_chunks/{notification-card-CcMQn2RX.js → notification-card-CtrzoTUO.js} +3 -3
  130. package/dist/_chunks/{notification-card-CcMQn2RX.js.map → notification-card-CtrzoTUO.js.map} +1 -1
  131. package/dist/_chunks/{notification-tray-nr7dv-Q8.js → notification-tray-BiRzXHDf.js} +4 -4
  132. package/dist/_chunks/{notification-tray-nr7dv-Q8.js.map → notification-tray-BiRzXHDf.js.map} +1 -1
  133. package/dist/_chunks/{optical-prescription-DtzEqFQm.js → optical-prescription-Dj3Eh5Ok.js} +2 -2
  134. package/dist/_chunks/{optical-prescription-DtzEqFQm.js.map → optical-prescription-Dj3Eh5Ok.js.map} +1 -1
  135. package/dist/_chunks/{patient-details-rENrE_qY.js → patient-details-qnsqYBGQ.js} +5 -5
  136. package/dist/_chunks/{patient-details-rENrE_qY.js.map → patient-details-qnsqYBGQ.js.map} +1 -1
  137. package/dist/_chunks/{patient-search-NQemeJlL.js → patient-search-D5ufYoRc.js} +2 -2
  138. package/dist/_chunks/{patient-search-NQemeJlL.js.map → patient-search-D5ufYoRc.js.map} +1 -1
  139. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js → patient-summary-card-CBfuDvJ5.js} +3 -3
  140. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js.map → patient-summary-card-CBfuDvJ5.js.map} +1 -1
  141. package/dist/_chunks/{patient-table-BubxfOWL.js → patient-table-DwshfVsQ.js} +3 -3
  142. package/dist/_chunks/{patient-table-BubxfOWL.js.map → patient-table-DwshfVsQ.js.map} +1 -1
  143. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js → payment-automation-upsell-BBIG7NFL.js} +2 -2
  144. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js.map → payment-automation-upsell-BBIG7NFL.js.map} +1 -1
  145. package/dist/_chunks/{payment-request-card-CvhDzDNk.js → payment-request-card-BjjBMdsp.js} +3 -3
  146. package/dist/_chunks/{payment-request-card-CvhDzDNk.js.map → payment-request-card-BjjBMdsp.js.map} +1 -1
  147. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js → periodontal-chart-BatZEFar.js} +2 -2
  148. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js.map → periodontal-chart-BatZEFar.js.map} +1 -1
  149. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js → periodontal-chart-card-BBpY_rBc.js} +2 -2
  150. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js.map → periodontal-chart-card-BBpY_rBc.js.map} +1 -1
  151. package/dist/_chunks/{popover-Btj6N25H.js → popover-Cqcjx-Ny.js} +2 -2
  152. package/dist/_chunks/{popover-Btj6N25H.js.map → popover-Cqcjx-Ny.js.map} +1 -1
  153. package/dist/_chunks/{practice-results-CKoLD_x5.js → practice-results-BEsAdW-B.js} +719 -633
  154. package/dist/_chunks/practice-results-BEsAdW-B.js.map +1 -0
  155. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js → pregnancy-dating-BVS_9YU2.js} +2 -2
  156. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js.map → pregnancy-dating-BVS_9YU2.js.map} +1 -1
  157. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js → pregnancy-weight-gain-CJwbs9W-.js} +2 -2
  158. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js.map → pregnancy-weight-gain-CJwbs9W-.js.map} +1 -1
  159. package/dist/_chunks/{privacy-lock-SQYFRSuH.js → privacy-lock-CkAUo6Dz.js} +3 -3
  160. package/dist/_chunks/{privacy-lock-SQYFRSuH.js.map → privacy-lock-CkAUo6Dz.js.map} +1 -1
  161. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js → product-hub-panel-BScCotGD.js} +3 -3
  162. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js.map → product-hub-panel-BScCotGD.js.map} +1 -1
  163. package/dist/_chunks/{public-header.agent-DseNK2NQ.js → public-header.agent-kth2SdXn.js} +3 -3
  164. package/dist/_chunks/{public-header.agent-DseNK2NQ.js.map → public-header.agent-kth2SdXn.js.map} +1 -1
  165. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js → radiograph-panel.agent-CiHwgISa.js} +4 -4
  166. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js.map → radiograph-panel.agent-CiHwgISa.js.map} +1 -1
  167. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js → reviews-panel-BKHEfqVQ.js} +4 -4
  168. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js.map → reviews-panel-BKHEfqVQ.js.map} +1 -1
  169. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js → rich-text-editor-DARnq_6N.js} +5 -5
  170. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js.map → rich-text-editor-DARnq_6N.js.map} +1 -1
  171. package/dist/_chunks/{session-countdown-q4r5TlCo.js → session-countdown-QMsnRa1x.js} +2 -2
  172. package/dist/_chunks/{session-countdown-q4r5TlCo.js.map → session-countdown-QMsnRa1x.js.map} +1 -1
  173. package/dist/_chunks/{sheet-CD99CdXr.js → sheet-BSznOyJs.js} +2 -2
  174. package/dist/_chunks/{sheet-CD99CdXr.js.map → sheet-BSznOyJs.js.map} +1 -1
  175. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js → sign-in-with-alfadocs-button-BLe_quy5.js} +2 -2
  176. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js.map → sign-in-with-alfadocs-button-BLe_quy5.js.map} +1 -1
  177. package/dist/_chunks/{signature-request-C4UBfVRZ.js → signature-request-DXhpphlp.js} +4 -4
  178. package/dist/_chunks/{signature-request-C4UBfVRZ.js.map → signature-request-DXhpphlp.js.map} +1 -1
  179. package/dist/_chunks/{slot-grid-P_e9p5t5.js → slot-grid-BuZOKfcd.js} +4 -4
  180. package/dist/_chunks/{slot-grid-P_e9p5t5.js.map → slot-grid-BuZOKfcd.js.map} +1 -1
  181. package/dist/_chunks/{streaming-text-BuW7I0Zu.js → streaming-text-CvsjIQ7S.js} +2 -2
  182. package/dist/_chunks/{streaming-text-BuW7I0Zu.js.map → streaming-text-CvsjIQ7S.js.map} +1 -1
  183. package/dist/_chunks/{task-tray-BT288xoM.js → task-tray-CYG6rj2s.js} +3 -3
  184. package/dist/_chunks/{task-tray-BT288xoM.js.map → task-tray-CYG6rj2s.js.map} +1 -1
  185. package/dist/_chunks/{tasks-panel-BBkZuejF.js → tasks-panel-Do5SFp-j.js} +5 -5
  186. package/dist/_chunks/{tasks-panel-BBkZuejF.js.map → tasks-panel-Do5SFp-j.js.map} +1 -1
  187. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js → theme-toggle-DuMhQNFS.js} +3 -3
  188. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js.map → theme-toggle-DuMhQNFS.js.map} +1 -1
  189. package/dist/_chunks/{toast.agent-C44mtGrW.js → toast.agent-D1tdg6DS.js} +2 -2
  190. package/dist/_chunks/{toast.agent-C44mtGrW.js.map → toast.agent-D1tdg6DS.js.map} +1 -1
  191. package/dist/_chunks/{token-insert-menu-D8FgXl33.js → token-insert-menu-9Um0JinI.js} +2 -2
  192. package/dist/_chunks/{token-insert-menu-D8FgXl33.js.map → token-insert-menu-9Um0JinI.js.map} +1 -1
  193. package/dist/_chunks/{tool-rail-BF3F2Ihq.js → tool-rail-CHyUmulN.js} +2 -2
  194. package/dist/_chunks/{tool-rail-BF3F2Ihq.js.map → tool-rail-CHyUmulN.js.map} +1 -1
  195. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js → tooth-scheme-WdyVymQ1.js} +3 -3
  196. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js.map → tooth-scheme-WdyVymQ1.js.map} +1 -1
  197. package/dist/_chunks/{unit-converter-iDxlxKmm.js → unit-converter-BPumXMA6.js} +2 -2
  198. package/dist/_chunks/{unit-converter-iDxlxKmm.js.map → unit-converter-BPumXMA6.js.map} +1 -1
  199. package/dist/_chunks/{warning-stack-nczJf52p.js → warning-stack-DQz0Jyir.js} +3 -3
  200. package/dist/_chunks/{warning-stack-nczJf52p.js.map → warning-stack-DQz0Jyir.js.map} +1 -1
  201. package/dist/_chunks/{workflow-map-BVofnDYh.js → workflow-map-DE_ribRM.js} +5 -5
  202. package/dist/_chunks/{workflow-map-BVofnDYh.js.map → workflow-map-DE_ribRM.js.map} +1 -1
  203. package/dist/agent-catalog.json +2 -2
  204. package/dist/components/agenda-tray/index.js +1 -1
  205. package/dist/components/ai-consent-banner/index.js +1 -1
  206. package/dist/components/ai-prompt-input/index.js +1 -1
  207. package/dist/components/anamnesis-card/index.js +1 -1
  208. package/dist/components/appointment-card/index.js +1 -1
  209. package/dist/components/appointment-timeline/index.js +1 -1
  210. package/dist/components/audio-recorder/index.js +1 -1
  211. package/dist/components/bishop-score/index.js +1 -1
  212. package/dist/components/bmi-calculator/index.js +1 -1
  213. package/dist/components/booking/index.js +1 -1
  214. package/dist/components/button/button.d.ts +10 -0
  215. package/dist/components/button/button.d.ts.map +1 -1
  216. package/dist/components/button/index.js +2 -2
  217. package/dist/components/button-group/index.js +1 -1
  218. package/dist/components/care-plan-card/index.js +1 -1
  219. package/dist/components/care-plan-entry-card/index.js +1 -1
  220. package/dist/components/care-plan-header/index.js +1 -1
  221. package/dist/components/carousel/index.js +1 -1
  222. package/dist/components/chart/index.js +1 -1
  223. package/dist/components/chat-input/index.js +1 -1
  224. package/dist/components/chat-message/index.js +1 -1
  225. package/dist/components/connection-status/index.js +1 -1
  226. package/dist/components/contact-profile-card/index.js +1 -1
  227. package/dist/components/control-room-rail/index.js +1 -1
  228. package/dist/components/copy-field/index.js +1 -1
  229. package/dist/components/cycle-calculator/index.js +1 -1
  230. package/dist/components/dashboard-grid/index.js +1 -1
  231. package/dist/components/data-table/index.js +3 -3
  232. package/dist/components/data-table-tabs/index.js +1 -1
  233. package/dist/components/description-list/index.js +1 -1
  234. package/dist/components/document-preview/index.js +1 -1
  235. package/dist/components/document-scanner/index.js +1 -1
  236. package/dist/components/due-date-calculator/index.js +1 -1
  237. package/dist/components/editor-overlay/index.js +1 -1
  238. package/dist/components/empty-state/index.js +1 -1
  239. package/dist/components/entity-summary/index.js +1 -1
  240. package/dist/components/face-scheme/index.js +1 -1
  241. package/dist/components/fetal-weight/index.js +1 -1
  242. package/dist/components/field-array/index.js +1 -1
  243. package/dist/components/file-manager/index.js +1 -1
  244. package/dist/components/finished-terminal/index.js +1 -1
  245. package/dist/components/fiscal-code-input/index.js +1 -1
  246. package/dist/components/freemium-paywall/index.js +1 -1
  247. package/dist/components/gestational-age-calculator/index.js +1 -1
  248. package/dist/components/hcg-doubling/index.js +1 -1
  249. package/dist/components/header/index.js +1 -1
  250. package/dist/components/header-settings/index.js +1 -1
  251. package/dist/components/icon-button/index.js +1 -1
  252. package/dist/components/icon-button-group/index.js +1 -1
  253. package/dist/components/icon-picker/index.js +1 -1
  254. package/dist/components/image-cropper/index.js +1 -1
  255. package/dist/components/info-tip/index.js +1 -1
  256. package/dist/components/key-value-pair/index.js +1 -1
  257. package/dist/components/locale-picker/index.js +1 -1
  258. package/dist/components/map-view/index.js +1 -1
  259. package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
  260. package/dist/components/message-card/index.js +1 -1
  261. package/dist/components/message-tray/index.js +1 -1
  262. package/dist/components/notes-panel/index.js +1 -1
  263. package/dist/components/notification-card/index.js +1 -1
  264. package/dist/components/notification-tray/index.js +1 -1
  265. package/dist/components/optical-prescription/index.js +1 -1
  266. package/dist/components/patient-details/index.js +1 -1
  267. package/dist/components/patient-search/index.js +1 -1
  268. package/dist/components/patient-summary-card/index.js +1 -1
  269. package/dist/components/patient-table/index.js +1 -1
  270. package/dist/components/payment-card/index.js +1 -1
  271. package/dist/components/periodontal-chart/index.js +1 -1
  272. package/dist/components/periodontal-chart-card/index.js +1 -1
  273. package/dist/components/popover/index.js +1 -1
  274. package/dist/components/practice-results/index.js +1 -1
  275. package/dist/components/practice-results/practice-results.d.ts +47 -7
  276. package/dist/components/practice-results/practice-results.d.ts.map +1 -1
  277. package/dist/components/pregnancy-dating/index.js +1 -1
  278. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  279. package/dist/components/privacy-lock/index.js +1 -1
  280. package/dist/components/product-hub-tray/index.js +1 -1
  281. package/dist/components/public-header/index.js +1 -1
  282. package/dist/components/public-header/public-header.d.ts +1 -1
  283. package/dist/components/radiograph-panel/index.js +1 -1
  284. package/dist/components/reviews-panel/index.js +1 -1
  285. package/dist/components/rich-text-editor/index.js +1 -1
  286. package/dist/components/session-countdown/index.js +1 -1
  287. package/dist/components/sheet/index.js +1 -1
  288. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  289. package/dist/components/slot-grid/index.js +1 -1
  290. package/dist/components/streaming-text/index.js +1 -1
  291. package/dist/components/task-tray/index.js +1 -1
  292. package/dist/components/tasks-panel/index.js +1 -1
  293. package/dist/components/theme-toggle/index.js +1 -1
  294. package/dist/components/toast/index.js +1 -1
  295. package/dist/components/token-insert-menu/index.js +1 -1
  296. package/dist/components/tool-rail/index.js +1 -1
  297. package/dist/components/tooth-scheme/index.js +1 -1
  298. package/dist/components/unit-converter/index.js +1 -1
  299. package/dist/components/warning-stack/index.js +1 -1
  300. package/dist/components/workflow/index.js +1 -1
  301. package/dist/i18n/locales/ar.d.ts +1 -0
  302. package/dist/i18n/locales/ar.d.ts.map +1 -1
  303. package/dist/i18n/locales/ar.js +2 -1
  304. package/dist/i18n/locales/ar.js.map +1 -1
  305. package/dist/i18n/locales/de.d.ts +1 -0
  306. package/dist/i18n/locales/de.d.ts.map +1 -1
  307. package/dist/i18n/locales/de.js +2 -1
  308. package/dist/i18n/locales/de.js.map +1 -1
  309. package/dist/i18n/locales/el.d.ts +1 -0
  310. package/dist/i18n/locales/el.d.ts.map +1 -1
  311. package/dist/i18n/locales/el.js +2 -1
  312. package/dist/i18n/locales/el.js.map +1 -1
  313. package/dist/i18n/locales/en.d.ts +1 -0
  314. package/dist/i18n/locales/en.d.ts.map +1 -1
  315. package/dist/i18n/locales/en.js +2 -1
  316. package/dist/i18n/locales/en.js.map +1 -1
  317. package/dist/i18n/locales/es.d.ts +1 -0
  318. package/dist/i18n/locales/es.d.ts.map +1 -1
  319. package/dist/i18n/locales/es.js +2 -1
  320. package/dist/i18n/locales/es.js.map +1 -1
  321. package/dist/i18n/locales/fr.d.ts +1 -0
  322. package/dist/i18n/locales/fr.d.ts.map +1 -1
  323. package/dist/i18n/locales/fr.js +2 -1
  324. package/dist/i18n/locales/fr.js.map +1 -1
  325. package/dist/i18n/locales/hi.d.ts +1 -0
  326. package/dist/i18n/locales/hi.d.ts.map +1 -1
  327. package/dist/i18n/locales/hi.js +2 -1
  328. package/dist/i18n/locales/hi.js.map +1 -1
  329. package/dist/i18n/locales/it.d.ts +1 -0
  330. package/dist/i18n/locales/it.d.ts.map +1 -1
  331. package/dist/i18n/locales/it.js +2 -1
  332. package/dist/i18n/locales/it.js.map +1 -1
  333. package/dist/i18n/locales/ja.d.ts +1 -0
  334. package/dist/i18n/locales/ja.d.ts.map +1 -1
  335. package/dist/i18n/locales/ja.js +2 -1
  336. package/dist/i18n/locales/ja.js.map +1 -1
  337. package/dist/i18n/locales/nl.d.ts +1 -0
  338. package/dist/i18n/locales/nl.d.ts.map +1 -1
  339. package/dist/i18n/locales/nl.js +2 -1
  340. package/dist/i18n/locales/nl.js.map +1 -1
  341. package/dist/i18n/locales/pl.d.ts +1 -0
  342. package/dist/i18n/locales/pl.d.ts.map +1 -1
  343. package/dist/i18n/locales/pl.js +2 -1
  344. package/dist/i18n/locales/pl.js.map +1 -1
  345. package/dist/i18n/locales/pt.d.ts +1 -0
  346. package/dist/i18n/locales/pt.d.ts.map +1 -1
  347. package/dist/i18n/locales/pt.js +2 -1
  348. package/dist/i18n/locales/pt.js.map +1 -1
  349. package/dist/i18n/locales/ro.d.ts +1 -0
  350. package/dist/i18n/locales/ro.d.ts.map +1 -1
  351. package/dist/i18n/locales/ro.js +2 -1
  352. package/dist/i18n/locales/ro.js.map +1 -1
  353. package/dist/i18n/locales/ru.d.ts +1 -0
  354. package/dist/i18n/locales/ru.d.ts.map +1 -1
  355. package/dist/i18n/locales/ru.js +2 -1
  356. package/dist/i18n/locales/ru.js.map +1 -1
  357. package/dist/i18n/locales/sq.d.ts +1 -0
  358. package/dist/i18n/locales/sq.d.ts.map +1 -1
  359. package/dist/i18n/locales/sq.js +2 -1
  360. package/dist/i18n/locales/sq.js.map +1 -1
  361. package/dist/i18n/locales/sv.d.ts +1 -0
  362. package/dist/i18n/locales/sv.d.ts.map +1 -1
  363. package/dist/i18n/locales/sv.js +2 -1
  364. package/dist/i18n/locales/sv.js.map +1 -1
  365. package/dist/i18n/locales/tr.d.ts +1 -0
  366. package/dist/i18n/locales/tr.d.ts.map +1 -1
  367. package/dist/i18n/locales/tr.js +2 -1
  368. package/dist/i18n/locales/tr.js.map +1 -1
  369. package/dist/i18n/locales/zh.d.ts +1 -0
  370. package/dist/i18n/locales/zh.d.ts.map +1 -1
  371. package/dist/i18n/locales/zh.js +2 -1
  372. package/dist/i18n/locales/zh.js.map +1 -1
  373. package/dist/index.js +96 -96
  374. package/dist/locales/ar.json +2 -1
  375. package/dist/locales/de.json +2 -1
  376. package/dist/locales/el.json +2 -1
  377. package/dist/locales/en.json +2 -1
  378. package/dist/locales/es.json +2 -1
  379. package/dist/locales/fr.json +2 -1
  380. package/dist/locales/hi.json +2 -1
  381. package/dist/locales/it.json +2 -1
  382. package/dist/locales/ja.json +2 -1
  383. package/dist/locales/nl.json +2 -1
  384. package/dist/locales/pl.json +2 -1
  385. package/dist/locales/pt.json +2 -1
  386. package/dist/locales/ro.json +2 -1
  387. package/dist/locales/ru.json +2 -1
  388. package/dist/locales/sq.json +2 -1
  389. package/dist/locales/sv.json +2 -1
  390. package/dist/locales/tr.json +2 -1
  391. package/dist/locales/zh.json +2 -1
  392. package/dist/patterns/alia-assistant/index.js +1 -1
  393. package/dist/patterns/anamnesis/index.js +1 -1
  394. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  395. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  396. package/dist/patterns/signature-request/index.js +1 -1
  397. package/dist/tokens.css +1 -1
  398. package/package.json +1 -1
  399. package/dist/_chunks/button-BvNtqHAS.js.map +0 -1
  400. package/dist/_chunks/practice-results-CKoLD_x5.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"gestational-age-calculator-dEpQDWcb.js","sources":["../../src/components/gestational-age-calculator/gestational-age-calculator.agent.ts","../../src/components/gestational-age-calculator/gestational-age-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — GestationalAgeCalculator. */\n/* */\n/* Clinical calculator: a known LMP or due date → current gestational */\n/* age, trimester and milestone dates (with an optional antenatal exam */\n/* schedule). The agent surface is the dating inputs plus the computed */\n/* gestational age / trimester / due date; the handle is the curated */\n/* `GestationalAgeCalculatorHandle` (the public `ref` stays the root */\n/* <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { GestationalAgeCalculatorHandle } from './gestational-age-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const gestationalAgeCalculatorAgent: AgentAdapter<GestationalAgeCalculatorHandle> =\n {\n id: 'gestational-age-calculator',\n // set_value → the three `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: \"{ method: 'lmp' | 'edd', referenceDate: string | null, asOfDate: string }\",\n descriptionKey: 'ui.agent.gestationalAgeCalculator.state.inputs',\n description:\n 'The dating inputs as entered — whether the reference date is a last period or a known due date, that date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string, dueDate: string } | null',\n descriptionKey: 'ui.agent.gestationalAgeCalculator.state.result',\n description:\n 'Computed gestational age in completed weeks + days as of the evaluation date, the trimester band (preconception / first / second / third / postterm), and the estimated delivery date. Null until a reference date is set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'edd' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'edd'],\n description:\n 'Whether the reference date is the last menstrual period or a known estimated delivery date.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: ['Returns false for a method other than `lmp` or `edd`.'],\n descriptionKey: 'ui.agent.gestationalAgeCalculator.actions.setMethod',\n description:\n 'Choose how the reference date is read. The date is kept and re-interpreted under the new method, so set the method first — an EDD may be in the future, an LMP may not.',\n invoke: (handle, args: { method: 'lmp' | 'edd' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n {\n ...isoDate,\n description: 'Local calendar date, `yyyy-MM-dd`.',\n },\n { type: 'null' },\n ],\n description:\n 'The last period (not in the future) or the known due date, depending on the active method — or null to clear it.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date, or for a future date under the `lmp` method — the on-screen DatePicker caps an LMP at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey:\n 'ui.agent.gestationalAgeCalculator.actions.setReferenceDate',\n description:\n 'Set the dating anchor. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.gestationalAgeCalculator.actions.setAsOfDate',\n description:\n 'Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.',\n invoke: (handle, args: { date: string }) =>\n handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'gestational-age-calculator',\n description:\n 'Marks the GestationalAgeCalculator (current gestational age, trimester and milestones from LMP or due date).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable.',\n },\n },\n };\n","/* ------------------------------------------------------------------ */\n/* GestationalAgeCalculator — current gestational age, trimester and */\n/* milestone dates, from either a known LMP or a known due date. */\n/* */\n/* Reuses the shared `gestation` maths from due-date-calculator: GA day */\n/* 0 is the LMP; from an EDD we back out LMP = EDD − 280 days. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, parseISO, subDays, isAfter } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { gestationalAgeCalculatorAgent } from './gestational-age-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type Trimester,\n type GestationalAge,\n type Plurality,\n type Chorionicity,\n computeDueDate,\n gestationalMilestones,\n GESTATION_DAYS,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n type GdmRisk,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Whether the entered date is the last period (`lmp`) or the due date (`edd`). */\nexport type GestationalAgeMethod = 'lmp' | 'edd';\n\nexport interface GestationalAgeResult {\n gestationalAge: GestationalAge | null;\n trimester: Trimester;\n dueDate: Date;\n}\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** The dating inputs as entered. */\nexport interface GestationalAgeInputsSnapshot {\n /** Whether the reference date is a last period or a due date. */\n method: GestationalAgeMethod;\n /** The reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `GestationalAgeResult` projected onto the agent boundary — ISO dates. */\nexport interface GestationalAgeSnapshot {\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: Trimester;\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed gestational age, and drives the inputs the way a\n * user would. Never exposes patient identity — only structural dates and\n * numbers. Consumed by `gestational-age-calculator.agent.ts`; the public `ref`\n * stays the root DOM element.\n */\nexport interface GestationalAgeCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => GestationalAgeInputsSnapshot;\n /** Computed gestational age, trimester and due date, or null until a reference date is set. */\n getResult: () => GestationalAgeSnapshot | null;\n /** Switch between dating from a last period and dating from a known due date. */\n setMethod: (method: GestationalAgeMethod) => boolean;\n /** Set the reference date (`yyyy-MM-dd`); a last period may not be in the future. */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface GestationalAgeCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Whether the input date is the last period (`lmp`) or the due date (`edd`). */\n defaultMethod?: GestationalAgeMethod;\n /** Pre-fill the reference date (e.g. a known LMP from the patient record). */\n defaultReferenceDate?: Date;\n /** Fires whenever a result can be computed (and `null` when it can't). */\n onResultChange?: (result: GestationalAgeResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start, and reveal the\n * plurality / chorionicity inputs that drive it.\n */\n showSchedule?: boolean;\n /** `showSchedule` only — initial number of babies. Defaults to `'singleton'`. */\n defaultPlurality?: Plurality;\n /** `showSchedule` only — initial chorionicity for multiples. Defaults to `'unknown'`. */\n defaultChorionicity?: Chorionicity;\n /** `showSchedule` only — initial Rh-negative state (surfaces anti-D). */\n defaultRhNegative?: boolean;\n /** `showSchedule` only — initial gestational-diabetes risk tier (surfaces OGTT). */\n defaultGdmRisk?: GdmRisk;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `includeOnIndication`, `birthGuideline`). `today`, `plurality`,\n * `chorionicity`, `rhNegative` and `gdmRisk` come from the component's own\n * inputs. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<\n AntenatalScheduleOptions,\n 'today' | 'plurality' | 'chorionicity' | 'rhNegative' | 'gdmRisk'\n >;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"edd\"` for the\n * date-back-from-EDD flow).\n */\nexport const GestationalAgeCalculator = forwardRef<\n HTMLDivElement,\n GestationalAgeCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n defaultReferenceDate,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n defaultPlurality = 'singleton',\n defaultChorionicity = 'unknown',\n defaultRhNegative = false,\n defaultGdmRisk,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [method, setMethod] = useState<GestationalAgeMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(\n defaultReferenceDate,\n );\n // The date the result is evaluated against (\"as of\"); defaults to today but\n // can be a future appointment date to project the GA/schedule forward.\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n // Real today — caps the dating-anchor input (an LMP can't be in the future).\n const today = useMemo(() => new Date(), []);\n const [plurality, setPlurality] = useState<Plurality>(defaultPlurality);\n const [chorionicity, setChorionicity] =\n useState<Chorionicity>(defaultChorionicity);\n const [rhNegative, setRhNegative] = useState<boolean>(defaultRhNegative);\n const [gdmRisk, setGdmRisk] = useState<GdmRisk | 'none'>(\n defaultGdmRisk ?? 'none',\n );\n\n const data = useMemo(() => {\n if (!refDate) return null;\n // Normalise to an LMP, then reuse the shared gestation maths.\n const lmp = method === 'lmp' ? refDate : subDays(refDate, GESTATION_DAYS);\n const r = computeDueDate({ method: 'lmp', date: lmp }, asOfDate);\n return {\n result: {\n gestationalAge: r.gestationalAge,\n trimester: r.trimester,\n dueDate: r.dueDate,\n } satisfies GestationalAgeResult,\n milestones: gestationalMilestones(r.gestationalStart),\n gestationalStart: r.gestationalStart,\n };\n }, [method, refDate, asOfDate]);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !data) return null;\n return computeAntenatalSchedule(data.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n plurality,\n chorionicity,\n rhNegative,\n gdmRisk: gdmRisk === 'none' ? undefined : gdmRisk,\n });\n }, [\n showSchedule,\n data,\n asOfDate,\n scheduleOptions,\n plurality,\n chorionicity,\n rhNegative,\n gdmRisk,\n ]);\n\n const chorionicityOptions = useMemo(\n () =>\n (\n [\n 'unknown',\n 'dichorionic-diamniotic',\n 'monochorionic-diamniotic',\n 'monochorionic-monoamniotic',\n ] as const\n ).map((c) => ({\n value: c,\n label: t(`antenatalSchedule.chorionicity.${c}`),\n })),\n [t],\n );\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'medium' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(data?.result ?? null);\n }, [data, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ method, refDate, asOfDate, data });\n liveRef.current = { method, refDate, asOfDate, data };\n\n const agentHandle = useMemo<GestationalAgeCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.data?.result;\n if (!r) return null;\n return {\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n dueDate: toIsoDate(r.dueDate),\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'edd') return false;\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n // The DatePicker caps an LMP at today; a known EDD is in the future.\n if (liveRef.current.method === 'lmp' && isAfter(parsed, new Date())) {\n return false;\n }\n setRefDate(parsed);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(gestationalAgeCalculatorAgent, agentHandle, id);\n\n const gaText = (ga: GestationalAge | null): string =>\n ga\n ? t('gestationalAgeCalculator.gestation', {\n weeks: ga.weeks,\n days: ga.days,\n })\n : '—';\n\n return (\n <div\n ref={ref}\n data-component=\"gestational-age-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('gestationalAgeCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as GestationalAgeMethod)}\n >\n <Radio label={t('gestationalAgeCalculator.method.lmp')} value=\"lmp\" />\n <Radio label={t('gestationalAgeCalculator.method.edd')} value=\"edd\" />\n </RadioGroup>\n\n <FormField\n label={t(\n method === 'lmp'\n ? 'gestationalAgeCalculator.lmpDate'\n : 'gestationalAgeCalculator.eddDate',\n )}\n >\n <DatePicker\n value={refDate}\n onChange={setRefDate}\n maxDate={method === 'lmp' ? today : undefined}\n />\n </FormField>\n\n <FormField\n label={t('gestationalAgeCalculator.asOfDate')}\n description={t('gestationalAgeCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {showSchedule ? (\n <>\n <RadioGroup\n label={t('antenatalSchedule.plurality.label')}\n variant=\"horizontal\"\n value={plurality}\n onValueChange={(next) => setPlurality(next as Plurality)}\n >\n <Radio\n label={t('antenatalSchedule.plurality.singleton')}\n value=\"singleton\"\n />\n <Radio\n label={t('antenatalSchedule.plurality.twin')}\n value=\"twin\"\n />\n <Radio\n label={t('antenatalSchedule.plurality.triplet')}\n value=\"triplet\"\n />\n </RadioGroup>\n\n {plurality !== 'singleton' ? (\n <FormField label={t('antenatalSchedule.chorionicity.label')}>\n <Select\n options={chorionicityOptions}\n value={chorionicity}\n onValueChange={(next) =>\n setChorionicity(next as Chorionicity)\n }\n />\n </FormField>\n ) : null}\n\n <Switch\n label={t('antenatalSchedule.rhNegative')}\n checked={rhNegative}\n onCheckedChange={setRhNegative}\n />\n\n <RadioGroup\n label={t('antenatalSchedule.gdmRisk.label')}\n variant=\"horizontal\"\n value={gdmRisk}\n onValueChange={(next) => setGdmRisk(next as GdmRisk | 'none')}\n >\n <Radio label={t('antenatalSchedule.gdmRisk.none')} value=\"none\" />\n <Radio\n label={t('antenatalSchedule.gdmRisk.medium')}\n value=\"medium\"\n />\n <Radio label={t('antenatalSchedule.gdmRisk.high')} value=\"high\" />\n </RadioGroup>\n </>\n ) : null}\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {data\n ? `${t('gestationalAgeCalculator.gestationLabel')}: ${gaText(\n data.result.gestationalAge,\n )}. ${t('gestationalAgeCalculator.trimesterLabel')}: ${t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {data ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[data.result.trimester]}\n size=\"lg\"\n >\n {t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n )}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.gestationLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {gaText(data.result.gestationalAge)}\n </dd>\n </div>\n </dl>\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.milestonesLabel')}\n </span>\n <ul className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {data.milestones.map((m) => {\n const reached = isAfter(asOfDate, m.date);\n return (\n <li\n key={m.key}\n className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]\"\n >\n <span className=\"type-body ds:text-foreground\">\n {t(`gestationalAgeCalculator.milestone.${m.key}`)}\n </span>\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"type-body ds:text-muted-foreground\">\n {dateFormatter.format(m.date)}\n </span>\n {reached ? (\n <Badge variant=\"success\">\n {t('gestationalAgeCalculator.reached')}\n </Badge>\n ) : null}\n </span>\n </li>\n );\n })}\n </ul>\n </div>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n gestational-age card and the schedule, and its payload carries the\n schedule rows when shown (no per-card buttons). */}\n {data && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.gestationalAge'),\n icon: 'baby',\n highlight: t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n ),\n // Chip shares the trimester's semantic token so the inserted PNG\n // chip matches the on-screen trimester badge — with the\n // contrast-safe orange override for the `--warning` third trimester.\n highlightToken: trimesterHighlightToken(data.result.trimester),\n brand: insertBrand,\n fields: [\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('gestationalAgeCalculator.gestationLabel'),\n value: gaText(data.result.gestationalAge),\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('gestationalAgeCalculator.trimesterLabel'),\n value: t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n ),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nGestationalAgeCalculator.displayName = 'GestationalAgeCalculator';\n"],"names":["DEPRECATED","isoDate","gestationalAgeCalculatorAgent","handle","args","rootVariants","cva","toIsoDate","d","format","fromIsoDate","iso","parseISO","GestationalAgeCalculator","forwardRef","defaultMethod","defaultReferenceDate","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","defaultPlurality","defaultChorionicity","defaultRhNegative","defaultGdmRisk","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","asOfDate","setAsOfDate","today","useMemo","plurality","setPlurality","chorionicity","setChorionicity","rhNegative","setRhNegative","gdmRisk","setGdmRisk","data","lmp","subDays","GESTATION_DAYS","r","computeDueDate","gestationalMilestones","schedule","computeAntenatalSchedule","chorionicityOptions","c","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","_a","next","parsed","isAfter","useAgentRegistration","gaText","ga","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","Fragment","Select","Switch","Card","Badge","TRIMESTER_BADGE_VARIANT","m","reached","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAa,iDAGbC,IAAU;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX,GAEaC,KACX;AAAA,EACE,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,QA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cACA,SAASC;AAAA,cACT,QAAAC;AAAA,cACA,SAAAC;AAAA,cACA,MAAM;AAAA,gBACJ,OAAO,EAAE,6BAA6B;AAAA,gBACtC,MAAM;AAAA,gBACN,WAAW;AAAA,kBACT,sCAAsC+B,EAAK,OAAO,SAAS;AAAA,gBAAA;AAAA;AAAA;AAAA;AAAA,gBAK7D,gBAAgBwC,GAAwBxC,EAAK,OAAO,SAAS;AAAA,gBAC7D,OAAO9B;AAAA,gBACP,QAAQ;AAAA,kBACN;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAOoD,EAAOtB,EAAK,OAAO,cAAc;AAAA,kBAAA;AAAA,kBAE1C;AAAA;AAAA,oBAEE,MAAM;AAAA,oBACN,OAAO,EAAE,yCAAyC;AAAA,oBAClD,OAAO;AAAA,sBACL,sCAAsCA,EAAK,OAAO,SAAS;AAAA,oBAAA;AAAA,kBAC7D;AAAA;AAAA;AAAA,kBAIF,GAAIO,IACAkC;AAAA,oBAA0BlC;AAAA,oBAAU;AAAA,oBAAG,CAACnD,MACtCuD,EAAc,OAAOvD,CAAC;AAAA,kBAAA,IAExB,CAAA;AAAA,gBAAC;AAAA,cACP;AAAA,YACF;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAK,GAAyB,cAAc;"}
1
+ {"version":3,"file":"gestational-age-calculator-C_uDAeP_.js","sources":["../../src/components/gestational-age-calculator/gestational-age-calculator.agent.ts","../../src/components/gestational-age-calculator/gestational-age-calculator.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — GestationalAgeCalculator. */\n/* */\n/* Clinical calculator: a known LMP or due date → current gestational */\n/* age, trimester and milestone dates (with an optional antenatal exam */\n/* schedule). The agent surface is the dating inputs plus the computed */\n/* gestational age / trimester / due date; the handle is the curated */\n/* `GestationalAgeCalculatorHandle` (the public `ref` stays the root */\n/* <div>, exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Dates cross the boundary as local-time `yyyy-MM-dd` strings, never */\n/* `Date` objects, so nothing shifts a day under JSON/UTC serialisation. */\n/* */\n/* DEPRECATED surface: this component is superseded by PregnancyDating, */\n/* which unifies dating + gestational age. Prefer the `pregnancy-dating` */\n/* adapter for new work — every action here is marked deprecated. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural dating inputs and the dates derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { GestationalAgeCalculatorHandle } from './gestational-age-calculator';\n\nconst DEPRECATED = 'Superseded by the `pregnancy-dating` adapter.';\n\n/** Shared JSON Schema fragment for a local calendar date. */\nconst isoDate = {\n type: 'string',\n pattern: '^\\\\d{4}-\\\\d{2}-\\\\d{2}$',\n} as const;\n\nexport const gestationalAgeCalculatorAgent: AgentAdapter<GestationalAgeCalculatorHandle> =\n {\n id: 'gestational-age-calculator',\n // set_value → the three `set_*` actions + the `inputs` state slot.\n capabilities: ['set_value'],\n state: {\n inputs: {\n type: \"{ method: 'lmp' | 'edd', referenceDate: string | null, asOfDate: string }\",\n descriptionKey: 'ui.agent.gestationalAgeCalculator.state.inputs',\n description:\n 'The dating inputs as entered — whether the reference date is a last period or a known due date, that date, and the evaluation date. Dates are `yyyy-MM-dd`. Read this to see which method a reference date will be interpreted under.',\n read: (handle) => handle.getInputs(),\n },\n result: {\n type: '{ gestationalAge: { weeks: number, days: number, totalDays: number } | null, trimester: string, dueDate: string } | null',\n descriptionKey: 'ui.agent.gestationalAgeCalculator.state.result',\n description:\n 'Computed gestational age in completed weeks + days as of the evaluation date, the trimester band (preconception / first / second / third / postterm), and the estimated delivery date. Null until a reference date is set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_method: {\n // Drives the same local input state a user picks; nothing is persisted\n // to a record, and the choice is reversible in the same UI.\n safety: 'write',\n argsType: \"{ method: 'lmp' | 'edd' }\",\n argsSchema: {\n type: 'object',\n properties: {\n method: {\n enum: ['lmp', 'edd'],\n description:\n 'Whether the reference date is the last menstrual period or a known estimated delivery date.',\n },\n },\n required: ['method'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the method was applied.',\n },\n errors: ['Returns false for a method other than `lmp` or `edd`.'],\n descriptionKey: 'ui.agent.gestationalAgeCalculator.actions.setMethod',\n description:\n 'Choose how the reference date is read. The date is kept and re-interpreted under the new method, so set the method first — an EDD may be in the future, an LMP may not.',\n invoke: (handle, args: { method: 'lmp' | 'edd' }) =>\n handle.setMethod(args.method),\n },\n set_reference_date: {\n safety: 'write',\n argsType: '{ date: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n oneOf: [\n {\n ...isoDate,\n description: 'Local calendar date, `yyyy-MM-dd`.',\n },\n { type: 'null' },\n ],\n description:\n 'The last period (not in the future) or the known due date, depending on the active method — or null to clear it.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: [\n 'Returns false for an unparseable date, or for a future date under the `lmp` method — the on-screen DatePicker caps an LMP at today.',\n ],\n examples: [\n {\n args: { date: '2026-01-12' },\n note: 'Under the default LMP method, a last period starting 12 January.',\n },\n ],\n descriptionKey:\n 'ui.agent.gestationalAgeCalculator.actions.setReferenceDate',\n description:\n 'Set the dating anchor. This is the only required input — the result stays null without it.',\n invoke: (handle, args: { date: string | null }) =>\n handle.setReferenceDate(args.date),\n },\n set_as_of_date: {\n safety: 'write',\n argsType: '{ date: string }',\n argsSchema: {\n type: 'object',\n properties: {\n date: {\n ...isoDate,\n description:\n 'Date to evaluate gestational age and trimester against, `yyyy-MM-dd`. May be in the future to project forward.',\n },\n },\n required: ['date'],\n additionalProperties: false,\n },\n idempotent: true,\n deprecated: DEPRECATED,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the date was applied.',\n },\n errors: ['Returns false for an unparseable date.'],\n examples: [\n {\n args: { date: '2026-09-15' },\n note: 'Project gestational age forward to an upcoming appointment.',\n },\n ],\n descriptionKey: 'ui.agent.gestationalAgeCalculator.actions.setAsOfDate',\n description:\n 'Set the date gestational age, trimester and the antenatal schedule are evaluated against. Defaults to today; the estimated delivery date itself does not depend on it.',\n invoke: (handle, args: { date: string }) =>\n handle.setAsOfDate(args.date),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'gestational-age-calculator',\n description:\n 'Marks the GestationalAgeCalculator (current gestational age, trimester and milestones from LMP or due date).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Also the registry key — without an `id` the instance does not register and the handle-driven actions/state are unreachable.',\n },\n },\n };\n","/* ------------------------------------------------------------------ */\n/* GestationalAgeCalculator — current gestational age, trimester and */\n/* milestone dates, from either a known LMP or a known due date. */\n/* */\n/* Reuses the shared `gestation` maths from due-date-calculator: GA day */\n/* 0 is the LMP; from an EDD we back out LMP = EDD − 280 days. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { format, parseISO, subDays, isAfter } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { gestationalAgeCalculatorAgent } from './gestational-age-calculator.agent';\nimport { RadioGroup, Radio } from '../radio-group';\nimport { FormField } from '../form-field';\nimport { DatePicker } from '../date-picker';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type Trimester,\n type GestationalAge,\n type Plurality,\n type Chorionicity,\n computeDueDate,\n gestationalMilestones,\n GESTATION_DAYS,\n TRIMESTER_BADGE_VARIANT,\n trimesterHighlightToken,\n} from '../_shared/obstetrics';\nimport {\n computeAntenatalSchedule,\n type AntenatalScheduleOptions,\n type GdmRisk,\n} from '../_shared/antenatal-schedule';\nimport {\n AntenatalScheduleTimeline,\n buildScheduleInsertFields,\n} from '../_shared/antenatal-schedule-timeline';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Whether the entered date is the last period (`lmp`) or the due date (`edd`). */\nexport type GestationalAgeMethod = 'lmp' | 'edd';\n\nexport interface GestationalAgeResult {\n gestationalAge: GestationalAge | null;\n trimester: Trimester;\n dueDate: Date;\n}\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Dates cross the agent boundary as local-time `yyyy-MM-dd` strings, */\n/* never `Date` objects — a Date JSON-serialises to UTC and silently */\n/* shifts the day for anyone east or west of Greenwich. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDate = (d: Date): string => format(d, 'yyyy-MM-dd');\n\nconst fromIsoDate = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** The dating inputs as entered. */\nexport interface GestationalAgeInputsSnapshot {\n /** Whether the reference date is a last period or a due date. */\n method: GestationalAgeMethod;\n /** The reference date (`yyyy-MM-dd`), or null when unset. */\n referenceDate: string | null;\n /** The date gestational age and trimester are evaluated against. */\n asOfDate: string;\n}\n\n/** `GestationalAgeResult` projected onto the agent boundary — ISO dates. */\nexport interface GestationalAgeSnapshot {\n /** Gestational age as of the evaluation date; null before conception. */\n gestationalAge: { weeks: number; days: number; totalDays: number } | null;\n /** Trimester band as of the evaluation date. */\n trimester: Trimester;\n /** Estimated date of delivery, `yyyy-MM-dd`. */\n dueDate: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the dating\n * inputs and the computed gestational age, and drives the inputs the way a\n * user would. Never exposes patient identity — only structural dates and\n * numbers. Consumed by `gestational-age-calculator.agent.ts`; the public `ref`\n * stays the root DOM element.\n */\nexport interface GestationalAgeCalculatorHandle {\n /** The dating inputs as entered. */\n getInputs: () => GestationalAgeInputsSnapshot;\n /** Computed gestational age, trimester and due date, or null until a reference date is set. */\n getResult: () => GestationalAgeSnapshot | null;\n /** Switch between dating from a last period and dating from a known due date. */\n setMethod: (method: GestationalAgeMethod) => boolean;\n /** Set the reference date (`yyyy-MM-dd`); a last period may not be in the future. */\n setReferenceDate: (isoDate: string | null) => boolean;\n /** Set the date gestational age and trimester are evaluated against. */\n setAsOfDate: (isoDate: string) => boolean;\n}\n\nexport interface GestationalAgeCalculatorProps extends VariantProps<\n typeof rootVariants\n> {\n /** Whether the input date is the last period (`lmp`) or the due date (`edd`). */\n defaultMethod?: GestationalAgeMethod;\n /** Pre-fill the reference date (e.g. a known LMP from the patient record). */\n defaultReferenceDate?: Date;\n /** Fires whenever a result can be computed (and `null` when it can't). */\n onResultChange?: (result: GestationalAgeResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /**\n * Which verb the result button performs. Defaults to `'insert'`.\n * Use `'copy'` in an app-shell surface (no editor to insert into) — the\n * button writes the result to the clipboard as a multi-format `ClipboardItem`.\n */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /**\n * Brand wordmark printed in the inserted/copied result-card footer.\n * Omitted → no brand line (and no footer hairline); a string → that custom\n * brand; `false` → no brand line. Brand is opt-in.\n */\n insertBrand?: string | false;\n /**\n * Append the antenatal exam schedule (the time-sensitive screening windows)\n * below the result, dated from the computed gestational start, and reveal the\n * plurality / chorionicity inputs that drive it.\n */\n showSchedule?: boolean;\n /** `showSchedule` only — initial number of babies. Defaults to `'singleton'`. */\n defaultPlurality?: Plurality;\n /** `showSchedule` only — initial chorionicity for multiples. Defaults to `'unknown'`. */\n defaultChorionicity?: Chorionicity;\n /** `showSchedule` only — initial Rh-negative state (surfaces anti-D). */\n defaultRhNegative?: boolean;\n /** `showSchedule` only — initial gestational-diabetes risk tier (surfaces OGTT). */\n defaultGdmRisk?: GdmRisk;\n /**\n * Passthrough options for the appended schedule (national `schedule`,\n * `includeOnIndication`, `birthGuideline`). `today`, `plurality`,\n * `chorionicity`, `rhNegative` and `gdmRisk` come from the component's own\n * inputs. Ignored unless `showSchedule` is set.\n */\n scheduleOptions?: Omit<\n AntenatalScheduleOptions,\n 'today' | 'plurality' | 'chorionicity' | 'rhNegative' | 'gdmRisk'\n >;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * @deprecated Superseded by `PregnancyDating`, which unifies the due-date and\n * gestational-age calculators (any anchor → both EDD and current GA) and adds a\n * manual ±days dating adjustment. This component will be removed in a future\n * release; migrate to `PregnancyDating` (`defaultMethod=\"edd\"` for the\n * date-back-from-EDD flow).\n */\nexport const GestationalAgeCalculator = forwardRef<\n HTMLDivElement,\n GestationalAgeCalculatorProps\n>(\n (\n {\n defaultMethod = 'lmp',\n defaultReferenceDate,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n showSchedule = false,\n defaultPlurality = 'singleton',\n defaultChorionicity = 'unknown',\n defaultRhNegative = false,\n defaultGdmRisk,\n scheduleOptions,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [method, setMethod] = useState<GestationalAgeMethod>(defaultMethod);\n const [refDate, setRefDate] = useState<Date | undefined>(\n defaultReferenceDate,\n );\n // The date the result is evaluated against (\"as of\"); defaults to today but\n // can be a future appointment date to project the GA/schedule forward.\n const [asOfDate, setAsOfDate] = useState<Date>(() => new Date());\n // Real today — caps the dating-anchor input (an LMP can't be in the future).\n const today = useMemo(() => new Date(), []);\n const [plurality, setPlurality] = useState<Plurality>(defaultPlurality);\n const [chorionicity, setChorionicity] =\n useState<Chorionicity>(defaultChorionicity);\n const [rhNegative, setRhNegative] = useState<boolean>(defaultRhNegative);\n const [gdmRisk, setGdmRisk] = useState<GdmRisk | 'none'>(\n defaultGdmRisk ?? 'none',\n );\n\n const data = useMemo(() => {\n if (!refDate) return null;\n // Normalise to an LMP, then reuse the shared gestation maths.\n const lmp = method === 'lmp' ? refDate : subDays(refDate, GESTATION_DAYS);\n const r = computeDueDate({ method: 'lmp', date: lmp }, asOfDate);\n return {\n result: {\n gestationalAge: r.gestationalAge,\n trimester: r.trimester,\n dueDate: r.dueDate,\n } satisfies GestationalAgeResult,\n milestones: gestationalMilestones(r.gestationalStart),\n gestationalStart: r.gestationalStart,\n };\n }, [method, refDate, asOfDate]);\n\n const schedule = useMemo(() => {\n if (!showSchedule || !data) return null;\n return computeAntenatalSchedule(data.gestationalStart, {\n ...scheduleOptions,\n today: asOfDate,\n plurality,\n chorionicity,\n rhNegative,\n gdmRisk: gdmRisk === 'none' ? undefined : gdmRisk,\n });\n }, [\n showSchedule,\n data,\n asOfDate,\n scheduleOptions,\n plurality,\n chorionicity,\n rhNegative,\n gdmRisk,\n ]);\n\n const chorionicityOptions = useMemo(\n () =>\n (\n [\n 'unknown',\n 'dichorionic-diamniotic',\n 'monochorionic-diamniotic',\n 'monochorionic-monoamniotic',\n ] as const\n ).map((c) => ({\n value: c,\n label: t(`antenatalSchedule.chorionicity.${c}`),\n })),\n [t],\n );\n\n const dateFormatter = useMemo(\n () => new Intl.DateTimeFormat(i18n.language, { dateStyle: 'medium' }),\n [i18n.language],\n );\n\n useEffect(() => {\n onResultChange?.(data?.result ?? null);\n }, [data, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ method, refDate, asOfDate, data });\n liveRef.current = { method, refDate, asOfDate, data };\n\n const agentHandle = useMemo<GestationalAgeCalculatorHandle>(\n () => ({\n getInputs: () => {\n const live = liveRef.current;\n return {\n method: live.method,\n referenceDate: live.refDate ? toIsoDate(live.refDate) : null,\n asOfDate: toIsoDate(live.asOfDate),\n };\n },\n getResult: () => {\n const r = liveRef.current.data?.result;\n if (!r) return null;\n return {\n gestationalAge: r.gestationalAge ? { ...r.gestationalAge } : null,\n trimester: r.trimester,\n dueDate: toIsoDate(r.dueDate),\n };\n },\n setMethod: (next) => {\n if (next !== 'lmp' && next !== 'edd') return false;\n setMethod(next);\n return true;\n },\n setReferenceDate: (isoDate) => {\n if (isoDate === null) {\n setRefDate(undefined);\n return true;\n }\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n // The DatePicker caps an LMP at today; a known EDD is in the future.\n if (liveRef.current.method === 'lmp' && isAfter(parsed, new Date())) {\n return false;\n }\n setRefDate(parsed);\n return true;\n },\n setAsOfDate: (isoDate) => {\n const parsed = fromIsoDate(isoDate);\n if (!parsed) return false;\n setAsOfDate(parsed);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(gestationalAgeCalculatorAgent, agentHandle, id);\n\n const gaText = (ga: GestationalAge | null): string =>\n ga\n ? t('gestationalAgeCalculator.gestation', {\n weeks: ga.weeks,\n days: ga.days,\n })\n : '—';\n\n return (\n <div\n ref={ref}\n data-component=\"gestational-age-calculator\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <RadioGroup\n label={t('gestationalAgeCalculator.method.label')}\n variant=\"horizontal\"\n value={method}\n onValueChange={(next) => setMethod(next as GestationalAgeMethod)}\n >\n <Radio label={t('gestationalAgeCalculator.method.lmp')} value=\"lmp\" />\n <Radio label={t('gestationalAgeCalculator.method.edd')} value=\"edd\" />\n </RadioGroup>\n\n <FormField\n label={t(\n method === 'lmp'\n ? 'gestationalAgeCalculator.lmpDate'\n : 'gestationalAgeCalculator.eddDate',\n )}\n >\n <DatePicker\n value={refDate}\n onChange={setRefDate}\n maxDate={method === 'lmp' ? today : undefined}\n />\n </FormField>\n\n <FormField\n label={t('gestationalAgeCalculator.asOfDate')}\n description={t('gestationalAgeCalculator.asOfDateHint')}\n >\n <DatePicker value={asOfDate} onChange={(d) => d && setAsOfDate(d)} />\n </FormField>\n\n {showSchedule ? (\n <>\n <RadioGroup\n label={t('antenatalSchedule.plurality.label')}\n variant=\"horizontal\"\n value={plurality}\n onValueChange={(next) => setPlurality(next as Plurality)}\n >\n <Radio\n label={t('antenatalSchedule.plurality.singleton')}\n value=\"singleton\"\n />\n <Radio\n label={t('antenatalSchedule.plurality.twin')}\n value=\"twin\"\n />\n <Radio\n label={t('antenatalSchedule.plurality.triplet')}\n value=\"triplet\"\n />\n </RadioGroup>\n\n {plurality !== 'singleton' ? (\n <FormField label={t('antenatalSchedule.chorionicity.label')}>\n <Select\n options={chorionicityOptions}\n value={chorionicity}\n onValueChange={(next) =>\n setChorionicity(next as Chorionicity)\n }\n />\n </FormField>\n ) : null}\n\n <Switch\n label={t('antenatalSchedule.rhNegative')}\n checked={rhNegative}\n onCheckedChange={setRhNegative}\n />\n\n <RadioGroup\n label={t('antenatalSchedule.gdmRisk.label')}\n variant=\"horizontal\"\n value={gdmRisk}\n onValueChange={(next) => setGdmRisk(next as GdmRisk | 'none')}\n >\n <Radio label={t('antenatalSchedule.gdmRisk.none')} value=\"none\" />\n <Radio\n label={t('antenatalSchedule.gdmRisk.medium')}\n value=\"medium\"\n />\n <Radio label={t('antenatalSchedule.gdmRisk.high')} value=\"high\" />\n </RadioGroup>\n </>\n ) : null}\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {data\n ? `${t('gestationalAgeCalculator.gestationLabel')}: ${gaText(\n data.result.gestationalAge,\n )}. ${t('gestationalAgeCalculator.trimesterLabel')}: ${t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n )}.`\n : ''}\n </p>\n\n {data ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.trimesterLabel')}\n </dt>\n <dd>\n <Badge\n variant={TRIMESTER_BADGE_VARIANT[data.result.trimester]}\n size=\"lg\"\n >\n {t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n )}\n </Badge>\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.gestationLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {gaText(data.result.gestationalAge)}\n </dd>\n </div>\n </dl>\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.milestonesLabel')}\n </span>\n <ul className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {data.milestones.map((m) => {\n const reached = isAfter(asOfDate, m.date);\n return (\n <li\n key={m.key}\n className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-md)]\"\n >\n <span className=\"type-body ds:text-foreground\">\n {t(`gestationalAgeCalculator.milestone.${m.key}`)}\n </span>\n <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span className=\"type-body ds:text-muted-foreground\">\n {dateFormatter.format(m.date)}\n </span>\n {reached ? (\n <Badge variant=\"success\">\n {t('gestationalAgeCalculator.reached')}\n </Badge>\n ) : null}\n </span>\n </li>\n );\n })}\n </ul>\n </div>\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('gestationalAgeCalculator.empty')}\n </p>\n )}\n\n {schedule ? <AntenatalScheduleTimeline events={schedule} /> : null}\n\n {/* One result-action group for the whole result — sits after both the\n gestational-age card and the schedule, and its payload carries the\n schedule rows when shown (no per-card buttons). */}\n {data && (insertVariant === 'copy' || onInsert) ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.gestationalAge'),\n icon: 'baby',\n highlight: t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n ),\n // Chip shares the trimester's semantic token so the inserted PNG\n // chip matches the on-screen trimester badge — with the\n // contrast-safe orange override for the `--warning` third trimester.\n highlightToken: trimesterHighlightToken(data.result.trimester),\n brand: insertBrand,\n fields: [\n {\n // Gestational age is an elapsed duration → clock glyph.\n icon: 'clock',\n label: t('gestationalAgeCalculator.gestationLabel'),\n value: gaText(data.result.gestationalAge),\n },\n {\n // Trimester is a clinical-stage classification → tag.\n icon: 'tag',\n label: t('gestationalAgeCalculator.trimesterLabel'),\n value: t(\n `gestationalAgeCalculator.trimester.${data.result.trimester}`,\n ),\n },\n // When the schedule is shown, the single Insert button carries\n // the exam windows too (no second button).\n ...(schedule\n ? buildScheduleInsertFields(schedule, t, (d) =>\n dateFormatter.format(d),\n )\n : []),\n ],\n }}\n />\n ) : null}\n </div>\n );\n },\n);\n\nGestationalAgeCalculator.displayName = 'GestationalAgeCalculator';\n"],"names":["DEPRECATED","isoDate","gestationalAgeCalculatorAgent","handle","args","rootVariants","cva","toIsoDate","d","format","fromIsoDate","iso","parseISO","GestationalAgeCalculator","forwardRef","defaultMethod","defaultReferenceDate","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","showSchedule","defaultPlurality","defaultChorionicity","defaultRhNegative","defaultGdmRisk","scheduleOptions","id","width","className","ref","i18n","useTranslation","method","setMethod","useState","refDate","setRefDate","asOfDate","setAsOfDate","today","useMemo","plurality","setPlurality","chorionicity","setChorionicity","rhNegative","setRhNegative","gdmRisk","setGdmRisk","data","lmp","subDays","GESTATION_DAYS","r","computeDueDate","gestationalMilestones","schedule","computeAntenatalSchedule","chorionicityOptions","c","dateFormatter","useEffect","liveRef","useRef","agentHandle","live","_a","next","parsed","isAfter","useAgentRegistration","gaText","ga","jsxs","RadioGroup","jsx","Radio","FormField","DatePicker","Fragment","Select","Switch","Card","Badge","TRIMESTER_BADGE_VARIANT","m","reached","AntenatalScheduleTimeline","InsertButton","trimesterHighlightToken","buildScheduleInsertFields"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAAa,iDAGbC,IAAU;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX,GAEaC,KACX;AAAA,EACE,IAAI;AAAA;AAAA,EAEJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA;AAAA;AAAA,MAGV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM,CAAC,OAAO,KAAK;AAAA,YACnB,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,QAAQ;AAAA,QACnB,sBAAsB;AAAA,MAAA;AAAA,MAExB,YAAY;AAAA,MACZ,YAAYH;AAAA,MACZ,SAAS;AAAA,MACT,eAAe;AAAA,QACb,MAAM;AAAA,QACN,aAAa;AAAA,MAAA;AAAA,MAEf,QAAQ,CAAC,uDAAuD;AAAA,MAChE,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ,CAACG,GAAQC,MACfD,EAAO,UAA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UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEAK,GAAyB,cAAc;"}
@@ -8,7 +8,7 @@ import { N as P } from "./number-input-Cgu2TtA8.js";
8
8
  import { D as G } from "./date-time-picker-DVETwpzc.js";
9
9
  import { C as B } from "./card-DPmk26CL.js";
10
10
  import { B as X } from "./badge-sTusUqZD.js";
11
- import { I as ee } from "./insert-result-98J1QEp7.js";
11
+ import { I as ee } from "./insert-result-LCNTskNJ.js";
12
12
  import { c as te } from "./date-picker-variants-pKAJfnWr.js";
13
13
  import { p as ne } from "./parseISO-fOGpHKXm.js";
14
14
  import { t as se, e as h } from "./format-4HNwNGrN.js";
@@ -309,4 +309,4 @@ export {
309
309
  re as M,
310
310
  oe as a
311
311
  };
312
- //# sourceMappingURL=hcg-doubling-CC6TLtHd.js.map
312
+ //# sourceMappingURL=hcg-doubling-BaXkJhT-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hcg-doubling-CC6TLtHd.js","sources":["../../node_modules/date-fns/formatISO.js","../../src/components/hcg-doubling/hcg-doubling.agent.ts","../../src/components/hcg-doubling/hcg.ts","../../src/components/hcg-doubling/hcg-doubling.tsx"],"sourcesContent":["import { addLeadingZeros } from \"./_lib/addLeadingZeros.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link formatISO} function options.\n */\n\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param date - The original date\n * @param options - An object with options.\n *\n * @returns The formatted date string (in local time zone)\n *\n * @throws `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport function formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const format = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n\n let result = \"\";\n let tzOffset = \"\";\n\n const dateDelimiter = format === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format === \"extended\" ? \":\" : \"\";\n\n // Representation is either 'date' or 'complete'\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== \"date\") {\n // Add the timezone.\n const offset = date_.getTimezoneOffset();\n\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = offset < 0 ? \"+\" : \"-\";\n\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n const separator = result === \"\" ? \"\" : \"T\";\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n const time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = `${result}${separator}${time}${tzOffset}`;\n }\n\n return result;\n}\n\n// Fallback for modularized imports:\nexport default formatISO;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — HcgDoubling. */\n/* */\n/* Clinical calculator: two timed serum β-hCG values → doubling time, */\n/* 48-hour-normalised rise and a viability trend band. The agent surface */\n/* is the two timed samples plus the computed trend; the handle is the */\n/* curated `HcgDoublingHandle` (the public `ref` stays the root <div>, */\n/* exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset, so */\n/* the interval between the two draws survives serialisation. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural lab figures and the numbers derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HcgDoublingHandle } from './hcg-doubling';\n\n/** JSON Schema fragment for one optional β-hCG value, mIU/mL. */\nconst hcgValue = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in mIU/mL, or null to clear it.`,\n});\n\n/** JSON Schema fragment for one optional sample time. */\nconst sampleTime = (label: string) => ({\n oneOf: [{ type: 'string', format: 'date-time' }, { type: 'null' }],\n description: `${label} as an ISO-8601 timestamp with offset (e.g. 2026-08-01T09:30:00+02:00), not in the future, or null to clear it.`,\n});\n\nexport const hcgDoublingAgent: AgentAdapter<HcgDoublingHandle> = {\n id: 'hcg-doubling',\n // set_value → the `set_samples` action + the `samples` state slot.\n capabilities: ['set_value'],\n state: {\n samples: {\n type: '{ hcg1: number | null, date1: string | null, hcg2: number | null, date2: string | null }',\n descriptionKey: 'ui.agent.hcgDoubling.state.samples',\n description:\n 'The two timed β-hCG samples as entered — value in mIU/mL plus the draw time as an ISO-8601 timestamp. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getSamples(),\n },\n result: {\n type: \"{ intervalHours: number, ratio: number, percentRise: number, twoDayRisePercent: number, doublingTimeHours: number | null, trend: 'rising-normal' | 'rising-slow' | 'plateau-falling' } | null\",\n descriptionKey: 'ui.agent.hcgDoubling.state.result',\n description:\n 'Computed doubling time in hours (null when not rising), the rise normalised to 48 hours, and the trend band against the minimal-rise benchmark. Null until both samples are set and the second is after the first.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_samples: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ hcg1?: number | null, date1?: string | null, hcg2?: number | null, date2?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n hcg1: hcgValue('First β-hCG value'),\n date1: sampleTime('When the first sample was drawn'),\n hcg2: hcgValue('Second β-hCG value'),\n date2: sampleTime('When the second sample was drawn'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the samples were applied.',\n },\n errors: [\n 'Returns false and writes nothing when a value is not positive, a timestamp is unparseable, or a timestamp is in the future — the payload applies all-or-nothing.',\n 'Applies cleanly but leaves `result` null when the second sample is not strictly after the first — the analysis needs a forward interval.',\n ],\n examples: [\n {\n args: {\n hcg1: 1200,\n date1: '2026-08-01T09:00:00+02:00',\n hcg2: 2500,\n date2: '2026-08-03T09:00:00+02:00',\n },\n note: 'A doubling over 48 hours → the rising-normal band.',\n },\n ],\n descriptionKey: 'ui.agent.hcgDoubling.actions.setSamples',\n description:\n 'Set any subset of the two timed β-hCG samples. Omitted keys are left unchanged; an explicit null clears one. All four are needed before a trend is computed.',\n invoke: (\n handle,\n args: {\n hcg1?: number | null;\n date1?: string | null;\n hcg2?: number | null;\n date2?: string | null;\n },\n ) => handle.setSamples(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'hcg-doubling',\n description:\n 'Marks the HcgDoubling calculator (serum β-hCG doubling time from two timed values).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n '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.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Serum β-hCG doubling time — early-pregnancy viability. */\n/* */\n/* Pure, framework-free, unit-testable. From two timed β-hCG values it */\n/* derives the doubling time, the rise over the actual interval, and the */\n/* rise normalised to 48 hours (the standard comparison window). A */\n/* normal early intrauterine pregnancy rises at least ~35% over 48h */\n/* (Barnhart 2004); a plateau or fall is abnormal. */\n/* */\n/* Barnhart KT et al. \"Symptomatic patients with an early viable */\n/* intrauterine pregnancy.\" Obstet Gynecol 2004;104:50-5. */\n/* ------------------------------------------------------------------ */\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n/** Conservative minimal 48-hour rise for a potentially viable IUP, %. */\nexport const MINIMAL_48H_RISE_PERCENT = 35;\n\nexport interface HcgInput {\n /** First β-hCG value, mIU/mL. */\n hcg1: number;\n /** When the first sample was drawn. */\n date1: Date;\n /** Second β-hCG value, mIU/mL. */\n hcg2: number;\n /** When the second sample was drawn (must be after `date1`). */\n date2: Date;\n}\n\nexport type HcgTrend = 'rising-normal' | 'rising-slow' | 'plateau-falling';\n\nexport interface HcgResult {\n /** Hours between the two samples. */\n intervalHours: number;\n /** hcg2 / hcg1. */\n ratio: number;\n /** Rise over the actual interval, %. */\n percentRise: number;\n /** Rise normalised to a 48-hour window, % (comparable to the benchmark). */\n twoDayRisePercent: number;\n /** Doubling time in hours, or `null` when not rising. */\n doublingTimeHours: number | null;\n /** Trend band against the Barnhart minimal-rise benchmark. */\n trend: HcgTrend;\n}\n\n/**\n * Analyse a two-point β-hCG series. Returns `null` unless both values are\n * positive and the second sample is strictly after the first.\n */\nexport function analyseHcg(input: HcgInput): HcgResult | null {\n const { hcg1, hcg2, date1, date2 } = input;\n if (!(hcg1 > 0) || !(hcg2 > 0)) return null;\n\n const intervalHours = (date2.getTime() - date1.getTime()) / MS_PER_HOUR;\n if (!(intervalHours > 0)) return null;\n\n const ratio = hcg2 / hcg1;\n const percentRise = (ratio - 1) * 100;\n const twoDayRisePercent = (ratio ** (48 / intervalHours) - 1) * 100;\n const doublingTimeHours =\n ratio > 1 ? (intervalHours * Math.LN2) / Math.log(ratio) : null;\n\n const trend: HcgTrend =\n ratio <= 1\n ? 'plateau-falling'\n : twoDayRisePercent >= MINIMAL_48H_RISE_PERCENT\n ? 'rising-normal'\n : 'rising-slow';\n\n return {\n intervalHours,\n ratio,\n percentRise,\n twoDayRisePercent,\n doublingTimeHours,\n trend,\n };\n}\n","/* ------------------------------------------------------------------ */\n/* HcgDoubling — serum β-hCG doubling time from two timed values. */\n/* */\n/* Maths in `./hcg` (pure, tested). Two timepoints (value + datetime) */\n/* → doubling time, 48-hour-normalised rise and a viability trend band. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { formatISO, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { hcgDoublingAgent } from './hcg-doubling.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { DateTimePicker } from '../date-time-picker';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport { type HcgResult, type HcgTrend, analyseHcg } from './hcg';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\nconst TREND_BADGE: Record<HcgTrend, 'success' | 'warning' | 'error'> = {\n 'rising-normal': 'success',\n 'rising-slow': 'warning',\n 'plateau-falling': 'error',\n};\nconst TREND_TOKEN: Record<HcgTrend, string> = {\n 'rising-normal': '--success',\n 'rising-slow': '--warning-readable',\n 'plateau-falling': '--destructive',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset */\n/* (`2026-08-01T09:30:00+02:00`), never `Date` objects — the doubling */\n/* maths is a difference between two instants, so the offset has to */\n/* survive the trip. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDateTime = (d: Date): string => formatISO(d);\n\nconst fromIsoDateTime = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** A β-hCG figure is usable when it is a positive finite number, or cleared. */\nconst isHcgValue = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** The two timed samples as entered. */\nexport interface HcgSamplesSnapshot {\n /** First β-hCG value, mIU/mL, or null. */\n hcg1: number | null;\n /** When the first sample was drawn, ISO-8601 with offset, or null. */\n date1: string | null;\n /** Second β-hCG value, mIU/mL, or null. */\n hcg2: number | null;\n /** When the second sample was drawn, ISO-8601 with offset, or null. */\n date2: string | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the two\n * timed samples and the computed trend, and writes the samples the way a user\n * would enter them. Never exposes patient identity — only structural lab\n * figures, sample times and the derived doubling numbers. Consumed by\n * `hcg-doubling.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface HcgDoublingHandle {\n /** The two timed samples as entered, or null where unset. */\n getSamples: () => HcgSamplesSnapshot;\n /** Computed doubling time, 48-hour rise and trend band, or null. */\n getResult: () => HcgResult | null;\n /**\n * Set any subset of the two timed samples. Omitted keys are left unchanged;\n * an explicit `null` clears one. Applies all-or-nothing — returns false and\n * writes nothing if any value is unusable.\n */\n setSamples: (next: Partial<HcgSamplesSnapshot>) => boolean;\n}\n\nexport interface HcgDoublingProps extends VariantProps<typeof rootVariants> {\n /** Pre-fill the first sample's date/time (e.g. from the lab record). */\n defaultDate1?: Date;\n /** Pre-fill the second sample's date/time. */\n defaultDate2?: Date;\n /** Fires whenever both timed values resolve (and `null` when not). */\n onResultChange?: (result: HcgResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const HcgDoubling = forwardRef<HTMLDivElement, HcgDoublingProps>(\n (\n {\n defaultDate1,\n defaultDate2,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [hcg1, setHcg1] = useState<number | null>(null);\n const [date1, setDate1] = useState<Date | undefined>(defaultDate1);\n const [hcg2, setHcg2] = useState<number | null>(null);\n const [date2, setDate2] = useState<Date | undefined>(defaultDate2);\n\n const today = useMemo(() => new Date(), []);\n\n const result = useMemo(() => {\n if (hcg1 === null || hcg2 === null || !date1 || !date2) return null;\n return analyseHcg({ hcg1, date1, hcg2, date2 });\n }, [hcg1, date1, hcg2, date2]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ hcg1, date1, hcg2, date2, result });\n liveRef.current = { hcg1, date1, hcg2, date2, result };\n\n const agentHandle = useMemo<HcgDoublingHandle>(\n () => ({\n getSamples: () => {\n const live = liveRef.current;\n return {\n hcg1: live.hcg1,\n date1: live.date1 ? toIsoDateTime(live.date1) : null,\n hcg2: live.hcg2,\n date2: live.date2 ? toIsoDateTime(live.date2) : null,\n };\n },\n getResult: () => liveRef.current.result,\n setSamples: (next) => {\n const now = new Date();\n const parsed: { date1?: Date | undefined; date2?: Date | undefined } =\n {};\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const key of ['hcg1', 'hcg2'] as const) {\n if (key in next && !isHcgValue(next[key])) return false;\n }\n for (const key of ['date1', 'date2'] as const) {\n if (!(key in next)) continue;\n const iso = next[key];\n if (iso === null || iso === undefined) {\n parsed[key] = undefined;\n continue;\n }\n const d = fromIsoDateTime(iso);\n // The DateTimePickers cap at now; the handle honours the same bound.\n if (!d || isAfter(d, now)) return false;\n parsed[key] = d;\n }\n if ('hcg1' in next) setHcg1(next.hcg1 ?? null);\n if ('hcg2' in next) setHcg2(next.hcg2 ?? null);\n if ('date1' in next) setDate1(parsed.date1);\n if ('date2' in next) setDate2(parsed.date2);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(hcgDoublingAgent, agentHandle, id);\n\n const num = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const doublingText = (r: HcgResult): string =>\n r.doublingTimeHours === null\n ? '—'\n : t('hcgDoubling.hoursValue', {\n hours: num.format(r.doublingTimeHours),\n });\n const riseText = (r: HcgResult): string =>\n t('hcgDoubling.percentValue', { value: num.format(r.twoDayRisePercent) });\n\n return (\n <div\n ref={ref}\n data-component=\"hcg-doubling\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={`${t('hcgDoubling.hcg1')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg1}\n onChange={setHcg1}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date1')}>\n <DateTimePicker value={date1} onChange={setDate1} maxDate={today} />\n </FormField>\n <FormField\n label={`${t('hcgDoubling.hcg2')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg2}\n onChange={setHcg2}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date2')}>\n <DateTimePicker value={date2} onChange={setDate2} maxDate={today} />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('hcgDoubling.doublingLabel')}: ${doublingText(result)}. ${t(\n `hcgDoubling.trend.${result.trend}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.doublingLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {doublingText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.riseLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {riseText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.trendLabel')}\n </dt>\n <dd>\n <Badge variant={TREND_BADGE[result.trend]} size=\"lg\">\n {t(`hcgDoubling.trend.${result.trend}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('hcgDoubling.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.hcg'),\n icon: 'activity',\n highlight: t(`hcgDoubling.trend.${result.trend}`),\n highlightToken: TREND_TOKEN[result.trend],\n brand: insertBrand,\n fields: [\n {\n icon: 'clock',\n label: t('hcgDoubling.doublingLabel'),\n value: doublingText(result),\n },\n {\n icon: 'trending-up',\n label: t('hcgDoubling.riseLabel'),\n value: riseText(result),\n },\n {\n icon: 'tag',\n label: t('hcgDoubling.trendLabel'),\n value: t(`hcgDoubling.trend.${result.trend}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('hcgDoubling.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nHcgDoubling.displayName = 'HcgDoubling';\n"],"names":["formatISO","date","options","date_","toDate","result","tzOffset","dateDelimiter","timeDelimiter","day","addLeadingZeros","month","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","hcgValue","label","sampleTime","hcgDoublingAgent","handle","args","MS_PER_HOUR","MINIMAL_48H_RISE_PERCENT","analyseHcg","input","hcg1","hcg2","date1","date2","intervalHours","ratio","percentRise","twoDayRisePercent","doublingTimeHours","trend","rootVariants","cva","TREND_BADGE","TREND_TOKEN","toIsoDateTime","d","fromIsoDateTime","iso","parseISO","isHcgValue","n","HcgDoubling","forwardRef","defaultDate1","defaultDate2","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","setHcg1","useState","setDate1","setHcg2","setDate2","today","useMemo","useEffect","liveRef","useRef","agentHandle","live","next","now","parsed","key","isAfter","useAgentRegistration","num","doublingText","r","riseText","jsxs","jsx","FormField","NumberInput","DateTimePicker","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;;;;;AA0CO,SAASA,GAAUC,GAAMC,GAAS;AACvC,QAAMC,IAAQC,GAAOH,GAAMC,KAAA,gBAAAA,EAAS,EAAE;AAEtC,MAAI,MAAM,CAACC,CAAK;AACd,UAAM,I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,EAAE,qBAAqBA,EAAO,KAAK,EAAE,GACxC,EAAA,CACF;AAAA,cAAA,EAAA,CACF;AAAA,YAAA,GACF;AAAA,8BACC,KAAA,EAAE,WAAU,yCACV,UAAA,EAAE,wBAAwB,GAC7B;AAAA,YACCqD,MAAkB,UAAUD,IAC3B,gBAAAkC;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,UAAAxC;AAAA,gBACA,SAASC;AAAA,gBACT,QAAAC;AAAA,gBACA,SAAAC;AAAA,gBACA,MAAM;AAAA,kBACJ,OAAO,EAAE,kBAAkB;AAAA,kBAC3B,MAAM;AAAA,kBACN,WAAW,EAAE,qBAAqBvD,EAAO,KAAK,EAAE;AAAA,kBAChD,gBAAgBuC,GAAYvC,EAAO,KAAK;AAAA,kBACxC,OAAOwD;AAAA,kBACP,QAAQ;AAAA,oBACN;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,2BAA2B;AAAA,sBACpC,OAAO0B,EAAalF,CAAM;AAAA,oBAAA;AAAA,oBAE5B;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,uBAAuB;AAAA,sBAChC,OAAOoF,EAASpF,CAAM;AAAA,oBAAA;AAAA,oBAExB;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,wBAAwB;AAAA,sBACjC,OAAO,EAAE,qBAAqBA,EAAO,KAAK,EAAE;AAAA,oBAAA;AAAA,kBAC9C;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAsF,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAvC,GAAY,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"hcg-doubling-BaXkJhT-.js","sources":["../../node_modules/date-fns/formatISO.js","../../src/components/hcg-doubling/hcg-doubling.agent.ts","../../src/components/hcg-doubling/hcg.ts","../../src/components/hcg-doubling/hcg-doubling.tsx"],"sourcesContent":["import { addLeadingZeros } from \"./_lib/addLeadingZeros.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link formatISO} function options.\n */\n\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param date - The original date\n * @param options - An object with options.\n *\n * @returns The formatted date string (in local time zone)\n *\n * @throws `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\nexport function formatISO(date, options) {\n const date_ = toDate(date, options?.in);\n\n if (isNaN(+date_)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const format = options?.format ?? \"extended\";\n const representation = options?.representation ?? \"complete\";\n\n let result = \"\";\n let tzOffset = \"\";\n\n const dateDelimiter = format === \"extended\" ? \"-\" : \"\";\n const timeDelimiter = format === \"extended\" ? \":\" : \"\";\n\n // Representation is either 'date' or 'complete'\n if (representation !== \"time\") {\n const day = addLeadingZeros(date_.getDate(), 2);\n const month = addLeadingZeros(date_.getMonth() + 1, 2);\n const year = addLeadingZeros(date_.getFullYear(), 4);\n\n // yyyyMMdd or yyyy-MM-dd.\n result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`;\n }\n\n // Representation is either 'time' or 'complete'\n if (representation !== \"date\") {\n // Add the timezone.\n const offset = date_.getTimezoneOffset();\n\n if (offset !== 0) {\n const absoluteOffset = Math.abs(offset);\n const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = offset < 0 ? \"+\" : \"-\";\n\n tzOffset = `${sign}${hourOffset}:${minuteOffset}`;\n } else {\n tzOffset = \"Z\";\n }\n\n const hour = addLeadingZeros(date_.getHours(), 2);\n const minute = addLeadingZeros(date_.getMinutes(), 2);\n const second = addLeadingZeros(date_.getSeconds(), 2);\n\n // If there's also date, separate it with time with 'T'\n const separator = result === \"\" ? \"\" : \"T\";\n\n // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n const time = [hour, minute, second].join(timeDelimiter);\n\n // HHmmss or HH:mm:ss.\n result = `${result}${separator}${time}${tzOffset}`;\n }\n\n return result;\n}\n\n// Fallback for modularized imports:\nexport default formatISO;\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — HcgDoubling. */\n/* */\n/* Clinical calculator: two timed serum β-hCG values → doubling time, */\n/* 48-hour-normalised rise and a viability trend band. The agent surface */\n/* is the two timed samples plus the computed trend; the handle is the */\n/* curated `HcgDoublingHandle` (the public `ref` stays the root <div>, */\n/* exactly as `slider.tsx` and `bmi-calculator.tsx` keep theirs). */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset, so */\n/* the interval between the two draws survives serialisation. */\n/* */\n/* PHI (§7): never exposes patient identity — the slots return the */\n/* operator's own structural lab figures and the numbers derived from */\n/* them. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HcgDoublingHandle } from './hcg-doubling';\n\n/** JSON Schema fragment for one optional β-hCG value, mIU/mL. */\nconst hcgValue = (label: string) => ({\n oneOf: [{ type: 'number', exclusiveMinimum: 0 }, { type: 'null' }],\n description: `${label} in mIU/mL, or null to clear it.`,\n});\n\n/** JSON Schema fragment for one optional sample time. */\nconst sampleTime = (label: string) => ({\n oneOf: [{ type: 'string', format: 'date-time' }, { type: 'null' }],\n description: `${label} as an ISO-8601 timestamp with offset (e.g. 2026-08-01T09:30:00+02:00), not in the future, or null to clear it.`,\n});\n\nexport const hcgDoublingAgent: AgentAdapter<HcgDoublingHandle> = {\n id: 'hcg-doubling',\n // set_value → the `set_samples` action + the `samples` state slot.\n capabilities: ['set_value'],\n state: {\n samples: {\n type: '{ hcg1: number | null, date1: string | null, hcg2: number | null, date2: string | null }',\n descriptionKey: 'ui.agent.hcgDoubling.state.samples',\n description:\n 'The two timed β-hCG samples as entered — value in mIU/mL plus the draw time as an ISO-8601 timestamp. Null where unset. Read this to see why a result is still null.',\n read: (handle) => handle.getSamples(),\n },\n result: {\n type: \"{ intervalHours: number, ratio: number, percentRise: number, twoDayRisePercent: number, doublingTimeHours: number | null, trend: 'rising-normal' | 'rising-slow' | 'plateau-falling' } | null\",\n descriptionKey: 'ui.agent.hcgDoubling.state.result',\n description:\n 'Computed doubling time in hours (null when not rising), the rise normalised to 48 hours, and the trend band against the minimal-rise benchmark. Null until both samples are set and the second is after the first.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_samples: {\n // Drives the same local input state a user types into; nothing is\n // persisted to a record, and every value is reversible in the same UI.\n safety: 'write',\n argsType:\n '{ hcg1?: number | null, date1?: string | null, hcg2?: number | null, date2?: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n hcg1: hcgValue('First β-hCG value'),\n date1: sampleTime('When the first sample was drawn'),\n hcg2: hcgValue('Second β-hCG value'),\n date2: sampleTime('When the second sample was drawn'),\n },\n additionalProperties: false,\n },\n idempotent: true,\n returns: 'boolean',\n returnsSchema: {\n type: 'boolean',\n description: 'True when the samples were applied.',\n },\n errors: [\n 'Returns false and writes nothing when a value is not positive, a timestamp is unparseable, or a timestamp is in the future — the payload applies all-or-nothing.',\n 'Applies cleanly but leaves `result` null when the second sample is not strictly after the first — the analysis needs a forward interval.',\n ],\n examples: [\n {\n args: {\n hcg1: 1200,\n date1: '2026-08-01T09:00:00+02:00',\n hcg2: 2500,\n date2: '2026-08-03T09:00:00+02:00',\n },\n note: 'A doubling over 48 hours → the rising-normal band.',\n },\n ],\n descriptionKey: 'ui.agent.hcgDoubling.actions.setSamples',\n description:\n 'Set any subset of the two timed β-hCG samples. Omitted keys are left unchanged; an explicit null clears one. All four are needed before a trend is computed.',\n invoke: (\n handle,\n args: {\n hcg1?: number | null;\n date1?: string | null;\n hcg2?: number | null;\n date2?: string | null;\n },\n ) => handle.setSamples(args),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'hcg-doubling',\n description:\n 'Marks the HcgDoubling calculator (serum β-hCG doubling time from two timed values).',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n '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.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Serum β-hCG doubling time — early-pregnancy viability. */\n/* */\n/* Pure, framework-free, unit-testable. From two timed β-hCG values it */\n/* derives the doubling time, the rise over the actual interval, and the */\n/* rise normalised to 48 hours (the standard comparison window). A */\n/* normal early intrauterine pregnancy rises at least ~35% over 48h */\n/* (Barnhart 2004); a plateau or fall is abnormal. */\n/* */\n/* Barnhart KT et al. \"Symptomatic patients with an early viable */\n/* intrauterine pregnancy.\" Obstet Gynecol 2004;104:50-5. */\n/* ------------------------------------------------------------------ */\n\nconst MS_PER_HOUR = 1000 * 60 * 60;\n/** Conservative minimal 48-hour rise for a potentially viable IUP, %. */\nexport const MINIMAL_48H_RISE_PERCENT = 35;\n\nexport interface HcgInput {\n /** First β-hCG value, mIU/mL. */\n hcg1: number;\n /** When the first sample was drawn. */\n date1: Date;\n /** Second β-hCG value, mIU/mL. */\n hcg2: number;\n /** When the second sample was drawn (must be after `date1`). */\n date2: Date;\n}\n\nexport type HcgTrend = 'rising-normal' | 'rising-slow' | 'plateau-falling';\n\nexport interface HcgResult {\n /** Hours between the two samples. */\n intervalHours: number;\n /** hcg2 / hcg1. */\n ratio: number;\n /** Rise over the actual interval, %. */\n percentRise: number;\n /** Rise normalised to a 48-hour window, % (comparable to the benchmark). */\n twoDayRisePercent: number;\n /** Doubling time in hours, or `null` when not rising. */\n doublingTimeHours: number | null;\n /** Trend band against the Barnhart minimal-rise benchmark. */\n trend: HcgTrend;\n}\n\n/**\n * Analyse a two-point β-hCG series. Returns `null` unless both values are\n * positive and the second sample is strictly after the first.\n */\nexport function analyseHcg(input: HcgInput): HcgResult | null {\n const { hcg1, hcg2, date1, date2 } = input;\n if (!(hcg1 > 0) || !(hcg2 > 0)) return null;\n\n const intervalHours = (date2.getTime() - date1.getTime()) / MS_PER_HOUR;\n if (!(intervalHours > 0)) return null;\n\n const ratio = hcg2 / hcg1;\n const percentRise = (ratio - 1) * 100;\n const twoDayRisePercent = (ratio ** (48 / intervalHours) - 1) * 100;\n const doublingTimeHours =\n ratio > 1 ? (intervalHours * Math.LN2) / Math.log(ratio) : null;\n\n const trend: HcgTrend =\n ratio <= 1\n ? 'plateau-falling'\n : twoDayRisePercent >= MINIMAL_48H_RISE_PERCENT\n ? 'rising-normal'\n : 'rising-slow';\n\n return {\n intervalHours,\n ratio,\n percentRise,\n twoDayRisePercent,\n doublingTimeHours,\n trend,\n };\n}\n","/* ------------------------------------------------------------------ */\n/* HcgDoubling — serum β-hCG doubling time from two timed values. */\n/* */\n/* Maths in `./hcg` (pure, tested). Two timepoints (value + datetime) */\n/* → doubling time, 48-hour-normalised rise and a viability trend band. */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { formatISO, isAfter, parseISO } from 'date-fns';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { hcgDoublingAgent } from './hcg-doubling.agent';\nimport { FormField } from '../form-field';\nimport { NumberInput } from '../number-input';\nimport { DateTimePicker } from '../date-time-picker';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport { type HcgResult, type HcgTrend, analyseHcg } from './hcg';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\nconst TREND_BADGE: Record<HcgTrend, 'success' | 'warning' | 'error'> = {\n 'rising-normal': 'success',\n 'rising-slow': 'warning',\n 'plateau-falling': 'error',\n};\nconst TREND_TOKEN: Record<HcgTrend, string> = {\n 'rising-normal': '--success',\n 'rising-slow': '--warning-readable',\n 'plateau-falling': '--destructive',\n};\n\n/* ------------------------------------------------------------------ */\n/* Agent boundary */\n/* */\n/* Sample times cross the boundary as ISO-8601 strings WITH an offset */\n/* (`2026-08-01T09:30:00+02:00`), never `Date` objects — the doubling */\n/* maths is a difference between two instants, so the offset has to */\n/* survive the trip. */\n/* ------------------------------------------------------------------ */\n\nconst toIsoDateTime = (d: Date): string => formatISO(d);\n\nconst fromIsoDateTime = (iso: string): Date | null => {\n const d = parseISO(iso);\n return Number.isNaN(d.getTime()) ? null : d;\n};\n\n/** A β-hCG figure is usable when it is a positive finite number, or cleared. */\nconst isHcgValue = (n: number | null | undefined): boolean =>\n n === null || n === undefined || (Number.isFinite(n) && n > 0);\n\n/** The two timed samples as entered. */\nexport interface HcgSamplesSnapshot {\n /** First β-hCG value, mIU/mL, or null. */\n hcg1: number | null;\n /** When the first sample was drawn, ISO-8601 with offset, or null. */\n date1: string | null;\n /** Second β-hCG value, mIU/mL, or null. */\n hcg2: number | null;\n /** When the second sample was drawn, ISO-8601 with offset, or null. */\n date2: string | null;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Reads the two\n * timed samples and the computed trend, and writes the samples the way a user\n * would enter them. Never exposes patient identity — only structural lab\n * figures, sample times and the derived doubling numbers. Consumed by\n * `hcg-doubling.agent.ts`; the public `ref` stays the root DOM element.\n */\nexport interface HcgDoublingHandle {\n /** The two timed samples as entered, or null where unset. */\n getSamples: () => HcgSamplesSnapshot;\n /** Computed doubling time, 48-hour rise and trend band, or null. */\n getResult: () => HcgResult | null;\n /**\n * Set any subset of the two timed samples. Omitted keys are left unchanged;\n * an explicit `null` clears one. Applies all-or-nothing — returns false and\n * writes nothing if any value is unusable.\n */\n setSamples: (next: Partial<HcgSamplesSnapshot>) => boolean;\n}\n\nexport interface HcgDoublingProps extends VariantProps<typeof rootVariants> {\n /** Pre-fill the first sample's date/time (e.g. from the lab record). */\n defaultDate1?: Date;\n /** Pre-fill the second sample's date/time. */\n defaultDate2?: Date;\n /** Fires whenever both timed values resolve (and `null` when not). */\n onResultChange?: (result: HcgResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport const HcgDoubling = forwardRef<HTMLDivElement, HcgDoublingProps>(\n (\n {\n defaultDate1,\n defaultDate2,\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n\n const [hcg1, setHcg1] = useState<number | null>(null);\n const [date1, setDate1] = useState<Date | undefined>(defaultDate1);\n const [hcg2, setHcg2] = useState<number | null>(null);\n const [date2, setDate2] = useState<Date | undefined>(defaultDate2);\n\n const today = useMemo(() => new Date(), []);\n\n const result = useMemo(() => {\n if (hcg1 === null || hcg2 === null || !date1 || !date2) return null;\n return analyseHcg({ hcg1, date1, hcg2, date2 });\n }, [hcg1, date1, hcg2, date2]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n /* ── Agent handle ────────────────────────────────────────────────── */\n const liveRef = useRef({ hcg1, date1, hcg2, date2, result });\n liveRef.current = { hcg1, date1, hcg2, date2, result };\n\n const agentHandle = useMemo<HcgDoublingHandle>(\n () => ({\n getSamples: () => {\n const live = liveRef.current;\n return {\n hcg1: live.hcg1,\n date1: live.date1 ? toIsoDateTime(live.date1) : null,\n hcg2: live.hcg2,\n date2: live.date2 ? toIsoDateTime(live.date2) : null,\n };\n },\n getResult: () => liveRef.current.result,\n setSamples: (next) => {\n const now = new Date();\n const parsed: { date1?: Date | undefined; date2?: Date | undefined } =\n {};\n // Validate the whole payload before writing any of it, so a bad\n // value can't leave the form half-updated.\n for (const key of ['hcg1', 'hcg2'] as const) {\n if (key in next && !isHcgValue(next[key])) return false;\n }\n for (const key of ['date1', 'date2'] as const) {\n if (!(key in next)) continue;\n const iso = next[key];\n if (iso === null || iso === undefined) {\n parsed[key] = undefined;\n continue;\n }\n const d = fromIsoDateTime(iso);\n // The DateTimePickers cap at now; the handle honours the same bound.\n if (!d || isAfter(d, now)) return false;\n parsed[key] = d;\n }\n if ('hcg1' in next) setHcg1(next.hcg1 ?? null);\n if ('hcg2' in next) setHcg2(next.hcg2 ?? null);\n if ('date1' in next) setDate1(parsed.date1);\n if ('date2' in next) setDate2(parsed.date2);\n return true;\n },\n }),\n [],\n );\n useAgentRegistration(hcgDoublingAgent, agentHandle, id);\n\n const num = useMemo(\n () => new Intl.NumberFormat(i18n.language, { maximumFractionDigits: 0 }),\n [i18n.language],\n );\n\n const doublingText = (r: HcgResult): string =>\n r.doublingTimeHours === null\n ? '—'\n : t('hcgDoubling.hoursValue', {\n hours: num.format(r.doublingTimeHours),\n });\n const riseText = (r: HcgResult): string =>\n t('hcgDoubling.percentValue', { value: num.format(r.twoDayRisePercent) });\n\n return (\n <div\n ref={ref}\n data-component=\"hcg-doubling\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <FormField\n label={`${t('hcgDoubling.hcg1')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg1}\n onChange={setHcg1}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date1')}>\n <DateTimePicker value={date1} onChange={setDate1} maxDate={today} />\n </FormField>\n <FormField\n label={`${t('hcgDoubling.hcg2')} (${t('hcgDoubling.units')})`}\n >\n <NumberInput\n mode=\"decimal\"\n min={0}\n value={hcg2}\n onChange={setHcg2}\n />\n </FormField>\n <FormField label={t('hcgDoubling.date2')}>\n <DateTimePicker value={date2} onChange={setDate2} maxDate={today} />\n </FormField>\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('hcgDoubling.doublingLabel')}: ${doublingText(result)}. ${t(\n `hcgDoubling.trend.${result.trend}`,\n )}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-3\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.doublingLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {doublingText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.riseLabel')}\n </dt>\n <dd className=\"type-body ds:text-foreground\">\n {riseText(result)}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('hcgDoubling.trendLabel')}\n </dt>\n <dd>\n <Badge variant={TREND_BADGE[result.trend]} size=\"lg\">\n {t(`hcgDoubling.trend.${result.trend}`)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t('hcgDoubling.disclaimer')}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.hcg'),\n icon: 'activity',\n highlight: t(`hcgDoubling.trend.${result.trend}`),\n highlightToken: TREND_TOKEN[result.trend],\n brand: insertBrand,\n fields: [\n {\n icon: 'clock',\n label: t('hcgDoubling.doublingLabel'),\n value: doublingText(result),\n },\n {\n icon: 'trending-up',\n label: t('hcgDoubling.riseLabel'),\n value: riseText(result),\n },\n {\n icon: 'tag',\n label: t('hcgDoubling.trendLabel'),\n value: t(`hcgDoubling.trend.${result.trend}`),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('hcgDoubling.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nHcgDoubling.displayName = 'HcgDoubling';\n"],"names":["formatISO","date","options","date_","toDate","result","tzOffset","dateDelimiter","timeDelimiter","day","addLeadingZeros","month","offset","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","time","hcgValue","label","sampleTime","hcgDoublingAgent","handle","args","MS_PER_HOUR","MINIMAL_48H_RISE_PERCENT","analyseHcg","input","hcg1","hcg2","date1","date2","intervalHours","ratio","percentRise","twoDayRisePercent","doublingTimeHours","trend","rootVariants","cva","TREND_BADGE","TREND_TOKEN","toIsoDateTime","d","fromIsoDateTime","iso","parseISO","isHcgValue","n","HcgDoubling","forwardRef","defaultDate1","defaultDate2","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","i18n","useTranslation","setHcg1","useState","setDate1","setHcg2","setDate2","today","useMemo","useEffect","liveRef","useRef","agentHandle","live","next","now","parsed","key","isAfter","useAgentRegistration","num","doublingText","r","riseText","jsxs","jsx","FormField","NumberInput","DateTimePicker","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;;;;;AA0CO,SAASA,GAAUC,GAAMC,GAAS;AACvC,QAAMC,IAAQC,GAAOH,GAAMC,KAAA,gBAAAA,EAAS,EAAE;AAEtC,MAAI,MAAM,CAACC,CAAK;AACd,UAAM,IAAI,WAAW,oBAAoB;AAM3C,MAAIE,IAAS,IACTC,IAAW;AAEf,QAAMC,IAAwC,KACxCC,IAAwC;AAGf;AAC7B,UAAMC,IAAMC,EAAgBP,EAAM,QAAO,GAAI,CAAC,GACxCQ,IAAQD,EAAgBP,EAAM,SAAQ,IAAK,GAAG,CAAC;AAIrD,IAAAE,IAAS,GAHIK,EAAgBP,EAAM,YAAW,GAAI,CAAC,CAGnC,GAAGI,CAAa,GAAGI,CAAK,GAAGJ,CAAa,GAAGE,CAAG;AAAA,EAChE;AAG+B;AAE7B,UAAMG,IAAST,EAAM,kBAAiB;AAEtC,QAAIS,MAAW,GAAG;AAChB,YAAMC,IAAiB,KAAK,IAAID,CAAM,GAChCE,IAAaJ,EAAgB,KAAK,MAAMG,IAAiB,EAAE,GAAG,CAAC,GAC/DE,IAAeL,EAAgBG,IAAiB,IAAI,CAAC;AAI3D,MAAAP,IAAW,GAFEM,IAAS,IAAI,MAAM,GAEd,GAAGE,CAAU,IAAIC,CAAY;AAAA,IACjD;AACE,MAAAT,IAAW;AAGb,UAAMU,IAAON,EAAgBP,EAAM,SAAQ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AChC,OAAOoF,EAASpF,CAAM;AAAA,oBAAA;AAAA,oBAExB;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO,EAAE,wBAAwB;AAAA,sBACjC,OAAO,EAAE,qBAAqBA,EAAO,KAAK,EAAE;AAAA,oBAAA;AAAA,kBAC9C;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAsF,EAAC,KAAA,EAAE,WAAU,sCACV,UAAA,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAvC,GAAY,cAAc;","x_google_ignoreList":[0]}
@@ -3,7 +3,7 @@ import { forwardRef as t, useMemo as j, useRef as H, useState as w, useEffect as
3
3
  import { c as o } from "./index-D2ZczOXr.js";
4
4
  import { Slot as V } from "@radix-ui/react-slot";
5
5
  import { useTranslation as u } from "react-i18next";
6
- import { I as C } from "./icon-button-9c9Gp41m.js";
6
+ import { I as C } from "./icon-button-DA2CAGHZ.js";
7
7
  import { c as S } from "./compose-refs-C0k0tdqF.js";
8
8
  import { u as z } from "./use-visual-viewport-pin-ChurOsHM.js";
9
9
  import { M as R } from "./menu-Op71AWIC.js";
@@ -303,4 +303,4 @@ export {
303
303
  Q as f,
304
304
  q as g
305
305
  };
306
- //# sourceMappingURL=header-CimZS-J9.js.map
306
+ //# sourceMappingURL=header-DUXRIPyM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"header-CimZS-J9.js","sources":["../../src/components/header/header.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useTranslation } from 'react-i18next';\nimport { Menu } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useVisualViewportPin } from '../../hooks/use-visual-viewport-pin';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:w-full',\n // Fixed height — a Header is always the `lg` token (64px). Using `h-*`\n // (not `min-h-*`) pins the row regardless of how Storybook's Canvas /\n // docs wrapper stretches the story's layout.\n 'ds:h-[var(--header-height-lg)]',\n // `flex items-stretch` lets the inner div fill the full cross-axis so\n // the flex-centered content sits on the true vertical midline.\n 'ds:flex ds:items-stretch',\n // Pin to the top of the page — `sticky` keeps the Header in normal\n // document flow (so content below isn't occluded and the docs Canvas\n // doesn't leak the Header over adjacent preview blocks) but stays\n // anchored to the viewport while the nearest scroll ancestor scrolls.\n // `top-0` (block axis is direction-independent): `inset-block-start-0`\n // is not a Tailwind utility and compiled to nothing — sticky never\n // engaged without an offset.\n 'ds:sticky ds:top-0 ds:z-[var(--z-sticky)]',\n 'ds:bg-[var(--background)]',\n 'ds:text-[color:var(--foreground)]',\n // Shadow recipe follows `Brand/Shadows` — one tier between states, never\n // two. Resting: flat, no shadow. Scrolled: --shadow-md (tooltip/menu tier)\n // paired with a 1-px --border so elevation still reads without the shadow\n // in forced-colors / print, where UAs strip box-shadow. Transition is\n // gated on `motion-reduce` so users opting out of motion still get the\n // static elevation without animated lift.\n 'ds:transition-[border-color,box-shadow] ds:motion-reduce:transition-none',\n 'ds:border-block-end ds:border-transparent',\n 'ds:data-[scrolled=true]:border-[color:var(--border)]',\n 'ds:data-[scrolled=true]:shadow-[var(--shadow-md)]',\n // Windows HCM: always show the border — forced-colors strips box-shadow\n // entirely, so the border is the only separation cue the user gets.\n 'ds:forced-colors:border-[color:CanvasText]',\n // Print: strip shadow, keep border so the header still reads as a\n // bounded surface on paper.\n 'ds:print:shadow-none ds:print:border-[color:var(--border)]',\n ].join(' '),\n {\n variants: {\n variant: {\n // Brand surface — primary-tinted background with primary-foreground\n // ink. Token rescopes are narrowed to `start` + `end` slots so chrome\n // (IconButton outline border, Logo monochrome, focus rings) re-tints\n // automatically. The `center` slot is excluded because SearchBar paints\n // its own `var(--background)` surface and must keep the document's\n // --foreground / --muted-foreground for its icon, placeholder, border,\n // kbd chip, and hover state.\n //\n // Contrast: --primary-foreground (#fff) over --primary (violet-500) is\n // 4.6:1 — passes WCAG AA for normal text. Muted-foreground is also set\n // to pure primary-foreground so any muted text in the header clears AA.\n //\n // Dark-mode override: in dark mode --primary is magenta-500 — using it\n // as the full-width header surface puts a hot-pink bar at the top of\n // every page, which the Apr 2026 brand guide's own dark mockups never\n // do (fuchsia is reserved for CTAs). We shift the header bg to\n // --background (blue-500) in dark so the header blends with the Dark\n // Blue brand surface at the same level as the Sidebar; separation\n // from the main canvas (which we offset to blue-700) is carried by\n // the existing scroll-shadow + border. White --primary-foreground ink\n // on blue-500 clears AAA (~12.8:1).\n brand: [\n 'ds:bg-[var(--primary)] ds:text-[color:var(--header-foreground)]',\n 'ds:[.theme-dark_&]:bg-[var(--background)]',\n 'ds:[&_[data-header-slot=start]]:[--foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--muted-foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--border:color-mix(in_srgb,var(--header-foreground)_40%,transparent)]',\n 'ds:[&_[data-header-slot=start]]:[--muted:color-mix(in_srgb,var(--header-foreground)_16%,transparent)]',\n 'ds:[&_[data-header-slot=start]]:[--ring:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--muted-foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--border:color-mix(in_srgb,var(--header-foreground)_40%,transparent)]',\n 'ds:[&_[data-header-slot=end]]:[--muted:color-mix(in_srgb,var(--header-foreground)_16%,transparent)]',\n 'ds:[&_[data-header-slot=end]]:[--ring:var(--header-foreground)]',\n ].join(' '),\n // Light surface — plain page background with primary-coloured chrome.\n // Start + end slots rescope --foreground, --border, --ring to --primary\n // so IconButton borders/icons render in the brand hue while the\n // HeaderBrand wordmark keeps its bicolor artwork and the SearchBar\n // (center slot) is untouched.\n light: [\n 'ds:bg-[var(--background)] ds:text-[color:var(--foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--foreground:var(--primary)]',\n 'ds:[&_[data-header-slot=start]]:[--border:var(--primary)]',\n 'ds:[&_[data-header-slot=start]]:[--ring:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--foreground:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--border:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--ring:var(--primary)]',\n ].join(' '),\n },\n },\n defaultVariants: {\n variant: 'brand',\n },\n },\n);\n\nconst innerVariants = cva(\n [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:w-full ds:h-full',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n ].join(' '),\n);\n\nconst slotStartVariants = cva(\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n);\nconst slotCenterVariants = cva(\n 'ds:hidden ds:md:flex ds:flex-1 ds:min-w-0 ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)]',\n);\nconst slotEndVariants = cva(\n 'ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n);\n\nconst brandVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:text-[length:var(--font-size-base)] ds:font-[var(--font-weight-semibold)]',\n // `leading-none` zeros the anchor's line-height so the Logo SVG sits at\n // the geometric centre of the flex cross-axis — otherwise the residual\n // line-box above ascenders / below descenders nudges the SVG upward.\n 'ds:leading-none',\n // Inherit foreground from the Header root so the `brand` variant's\n // --primary-foreground ink cascades here without an override prop.\n 'ds:text-[color:currentColor]',\n 'ds:no-underline',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:min-h-[var(--min-target-size)]',\n ].join(' '),\n);\n\nconst brandDividerVariants = cva(\n [\n 'ds:hidden ds:md:inline-block',\n 'ds:border-inline-start ds:border-[color:var(--border)]',\n 'ds:self-stretch ds:my-[var(--spacing-xs)]',\n ].join(' '),\n);\n\nconst skipLinkVariants = cva(\n [\n 'ds:sr-only ds:focus:not-sr-only',\n 'ds:focus:absolute ds:focus:inset-inline-start-[var(--spacing-sm)] ds:focus:inset-block-start-[var(--spacing-sm)]',\n 'ds:focus:z-[calc(var(--z-sticky)+1)]',\n 'ds:focus:ps-[var(--spacing-sm)] ds:focus:pe-[var(--spacing-sm)] ds:focus:pbs-[var(--spacing-xs)] ds:focus:pbe-[var(--spacing-xs)]',\n 'ds:focus:bg-[var(--background)] ds:focus:text-[color:var(--foreground)]',\n 'ds:focus:border ds:focus:border-[color:var(--border)]',\n 'ds:focus:rounded-[var(--radius-sm)]',\n 'ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)]',\n 'ds:forced-colors:focus:outline-[CanvasText]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'role' | 'children'>,\n VariantProps<typeof rootVariants> {\n children: ReactNode;\n /** Override the default landmark name. */\n 'aria-label'?: string;\n /** Enable the scroll-linked border + shadow (default `true`). */\n scrollLinkedElevation?: boolean;\n}\n\nexport const Header = forwardRef<HTMLElement, HeaderProps>(\n (\n {\n variant = 'brand',\n className,\n children,\n scrollLinkedElevation = true,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const label = ariaLabel ?? t('navigation.header.label', 'Page header');\n\n // The bar is sticky against the LAYOUT viewport — pinch-zooming pans it\n // off the visible screen. Keep it glued to the visual viewport instead\n // (identity when unzoomed; no-op without the visualViewport API).\n const pinRef = useVisualViewportPin<HTMLElement>();\n // Memoised so React doesn't detach/reattach the refs on every render.\n const composedRef = useMemo(() => composeRefs(pinRef, ref), [pinRef, ref]);\n\n /* ---- Scroll-linked border / shadow ---------------------------- */\n const sentinelRef = useRef<HTMLDivElement | null>(null);\n const [scrolled, setScrolled] = useState(false);\n useEffect(() => {\n if (!scrollLinkedElevation) return undefined;\n const sentinel = sentinelRef.current;\n if (!sentinel) return undefined;\n if (typeof IntersectionObserver === 'undefined') return undefined;\n const io = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n // When the sentinel scrolls out of view (isIntersecting=false),\n // the user has scrolled past the top — flip the elevation on.\n setScrolled(!entry.isIntersecting);\n },\n { threshold: 0 },\n );\n io.observe(sentinel);\n return () => io.disconnect();\n }, [scrollLinkedElevation]);\n\n return (\n <>\n {/* 1px sentinel above the sticky header so the IntersectionObserver\n fires when the user scrolls past the top. Kept outside the\n <header> so it doesn't affect landmark semantics. */}\n {scrollLinkedElevation ? (\n // -mb-px swallows the sentinel's 1px flow height so the header sits\n // flush at the top; the IntersectionObserver still sees the pixel.\n <div\n ref={sentinelRef}\n aria-hidden=\"true\"\n className=\"ds:block ds:h-px ds:w-full ds:-mb-px\"\n />\n ) : null}\n <header\n ref={composedRef}\n role=\"banner\"\n aria-label={label}\n data-component=\"header\"\n data-scrolled={scrolled ? 'true' : undefined}\n className={rootVariants({ variant, className })}\n {...rest}\n >\n <div className={innerVariants()}>{children}</div>\n </header>\n </>\n );\n },\n);\nHeader.displayName = 'Header';\n\n/* ------------------------------------------------------------------ */\n/* Slot wrappers */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderStart = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"start\"\n className={[slotStartVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderStart.displayName = 'HeaderStart';\n\nexport const HeaderCenter = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"center\"\n className={[slotCenterVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderCenter.displayName = 'HeaderCenter';\n\nexport const HeaderEnd = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"end\"\n className={[slotEndVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderEnd.displayName = 'HeaderEnd';\n\n/* ------------------------------------------------------------------ */\n/* Brand */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderBrandProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n /** Logo slot — an <svg> / <img>. Must carry its own accessible name via aria-label on the wrapping component OR a visible wordmark child. */\n logo?: ReactNode;\n /** Visible wordmark / product name. Sits after the logo. */\n children?: ReactNode;\n /** Destination href. Defaults to \"/\". */\n href?: string;\n /**\n * Render through Radix `Slot` so a consumer's router link (`<Link>`) takes\n * over the brand anchor while keeping the kit's `brandVariants` styling and\n * any forwarded `aria-label`. Pass a single link element as `children` (the\n * logo + wordmark go inside it). With `asChild` off the output is the plain\n * `<a href>` exactly as before.\n */\n asChild?: boolean;\n}\n\nexport const HeaderBrand = forwardRef<HTMLAnchorElement, HeaderBrandProps>(\n (\n { logo, children, href = '/', className, asChild = false, ...props },\n ref,\n ) => {\n if (import.meta.env.DEV && !props['aria-label'] && !children) {\n console.warn(\n 'HeaderBrand: pass `aria-label` or visible children — a logo-only brand link without a name has no accessible name.',\n );\n }\n const brandClassName = [brandVariants(), className]\n .filter(Boolean)\n .join(' ');\n\n // Consumer-router mode: the consumer supplies their own link element as\n // `children`; Slot merges the kit's brand class + forwarded props onto it\n // so the lockup styling and any aria-label survive. The logo + wordmark\n // live inside the consumer's element (it owns the click → client route).\n if (asChild) {\n return (\n <Slot ref={ref} className={brandClassName} {...props}>\n {children}\n </Slot>\n );\n }\n\n return (\n <a ref={ref} href={href} className={brandClassName} {...props}>\n {logo ? (\n <span\n aria-hidden={children ? 'true' : undefined}\n className=\"ds:inline-flex ds:items-center\"\n >\n {logo}\n </span>\n ) : null}\n {children ? <span className=\"ds:truncate\">{children}</span> : null}\n </a>\n );\n },\n);\nHeaderBrand.displayName = 'HeaderBrand';\n\n/* ------------------------------------------------------------------ */\n/* Brand divider */\n/* ------------------------------------------------------------------ */\n\nexport function HeaderBrandDivider({\n className,\n ...props\n}: HTMLAttributes<HTMLSpanElement>): ReactNode {\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={[brandDividerVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Menu button (mobile drawer trigger) */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderMenuButtonProps {\n onMenuOpen: () => void;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport const HeaderMenuButton = forwardRef<\n HTMLButtonElement,\n HeaderMenuButtonProps\n>(({ onMenuOpen, 'aria-label': ariaLabel, className }, ref) => {\n const { t } = useTranslation();\n return (\n <IconButton\n ref={ref}\n // Show on mobile; hide above md breakpoint.\n className={['ds:md:hidden', className].filter(Boolean).join(' ')}\n icon={<Menu aria-hidden />}\n aria-label={ariaLabel ?? t('navigation.sidebar.open', 'Open menu')}\n onClick={onMenuOpen}\n />\n );\n});\nHeaderMenuButton.displayName = 'HeaderMenuButton';\n\n/* ------------------------------------------------------------------ */\n/* SkipLink */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSkipLinkProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n href: string;\n children?: ReactNode;\n}\n\nexport const HeaderSkipLink = forwardRef<\n HTMLAnchorElement,\n HeaderSkipLinkProps\n>(({ href, children, className, ...props }, ref) => {\n const { t } = useTranslation();\n return (\n <a\n ref={ref}\n href={href}\n className={[skipLinkVariants(), className].filter(Boolean).join(' ')}\n {...props}\n >\n {children ?? t('navigation.nav.skipToContent', 'Skip to content')}\n </a>\n );\n});\nHeaderSkipLink.displayName = 'HeaderSkipLink';\n"],"names":["rootVariants","cva","innerVariants","slotStartVariants","slotCenterVariants","slotEndVariants","brandVariants","brandDividerVariants","skipLinkVariants","Header","forwardRef","variant","className","children","scrollLinkedElevation","ariaLabel","rest","ref","t","useTranslation","label","pinRef","useVisualViewportPin","composedRef","useMemo","composeRefs","sentinelRef","useRef","scrolled","setScrolled","useState","useEffect","sentinel","io","entries","entry","jsxs","Fragment","jsx","HeaderStart","props","HeaderCenter","HeaderEnd","HeaderBrand","logo","href","asChild","brandClassName","Slot","HeaderBrandDivider","HeaderMenuButton","onMenuOpen","IconButton","Menu","HeaderSkipLink"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAAeC;AAAA,EACnB;AAAA,IACE;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA,IAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,IAGA;AAAA;AAAA;AAAA,IAGA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAsBP,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;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KAAArB;AAAA,MACA,MAAA4B;AAAA,MACA,WAAW,CAACrC,EAAA,GAAoBI,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAClE,GAAG4B;AAAA,MAEH,UAAA3B,KAAYK,EAAE,gCAAgC,iBAAiB;AAAA,IAAA;AAAA,EAAA;AAGtE,CAAC;AACDoC,EAAe,cAAc;"}
1
+ {"version":3,"file":"header-DUXRIPyM.js","sources":["../../src/components/header/header.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useTranslation } from 'react-i18next';\nimport { Menu } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useVisualViewportPin } from '../../hooks/use-visual-viewport-pin';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n 'ds:w-full',\n // Fixed height — a Header is always the `lg` token (64px). Using `h-*`\n // (not `min-h-*`) pins the row regardless of how Storybook's Canvas /\n // docs wrapper stretches the story's layout.\n 'ds:h-[var(--header-height-lg)]',\n // `flex items-stretch` lets the inner div fill the full cross-axis so\n // the flex-centered content sits on the true vertical midline.\n 'ds:flex ds:items-stretch',\n // Pin to the top of the page — `sticky` keeps the Header in normal\n // document flow (so content below isn't occluded and the docs Canvas\n // doesn't leak the Header over adjacent preview blocks) but stays\n // anchored to the viewport while the nearest scroll ancestor scrolls.\n // `top-0` (block axis is direction-independent): `inset-block-start-0`\n // is not a Tailwind utility and compiled to nothing — sticky never\n // engaged without an offset.\n 'ds:sticky ds:top-0 ds:z-[var(--z-sticky)]',\n 'ds:bg-[var(--background)]',\n 'ds:text-[color:var(--foreground)]',\n // Shadow recipe follows `Brand/Shadows` — one tier between states, never\n // two. Resting: flat, no shadow. Scrolled: --shadow-md (tooltip/menu tier)\n // paired with a 1-px --border so elevation still reads without the shadow\n // in forced-colors / print, where UAs strip box-shadow. Transition is\n // gated on `motion-reduce` so users opting out of motion still get the\n // static elevation without animated lift.\n 'ds:transition-[border-color,box-shadow] ds:motion-reduce:transition-none',\n 'ds:border-block-end ds:border-transparent',\n 'ds:data-[scrolled=true]:border-[color:var(--border)]',\n 'ds:data-[scrolled=true]:shadow-[var(--shadow-md)]',\n // Windows HCM: always show the border — forced-colors strips box-shadow\n // entirely, so the border is the only separation cue the user gets.\n 'ds:forced-colors:border-[color:CanvasText]',\n // Print: strip shadow, keep border so the header still reads as a\n // bounded surface on paper.\n 'ds:print:shadow-none ds:print:border-[color:var(--border)]',\n ].join(' '),\n {\n variants: {\n variant: {\n // Brand surface — primary-tinted background with primary-foreground\n // ink. Token rescopes are narrowed to `start` + `end` slots so chrome\n // (IconButton outline border, Logo monochrome, focus rings) re-tints\n // automatically. The `center` slot is excluded because SearchBar paints\n // its own `var(--background)` surface and must keep the document's\n // --foreground / --muted-foreground for its icon, placeholder, border,\n // kbd chip, and hover state.\n //\n // Contrast: --primary-foreground (#fff) over --primary (violet-500) is\n // 4.6:1 — passes WCAG AA for normal text. Muted-foreground is also set\n // to pure primary-foreground so any muted text in the header clears AA.\n //\n // Dark-mode override: in dark mode --primary is magenta-500 — using it\n // as the full-width header surface puts a hot-pink bar at the top of\n // every page, which the Apr 2026 brand guide's own dark mockups never\n // do (fuchsia is reserved for CTAs). We shift the header bg to\n // --background (blue-500) in dark so the header blends with the Dark\n // Blue brand surface at the same level as the Sidebar; separation\n // from the main canvas (which we offset to blue-700) is carried by\n // the existing scroll-shadow + border. White --primary-foreground ink\n // on blue-500 clears AAA (~12.8:1).\n brand: [\n 'ds:bg-[var(--primary)] ds:text-[color:var(--header-foreground)]',\n 'ds:[.theme-dark_&]:bg-[var(--background)]',\n 'ds:[&_[data-header-slot=start]]:[--foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--muted-foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--border:color-mix(in_srgb,var(--header-foreground)_40%,transparent)]',\n 'ds:[&_[data-header-slot=start]]:[--muted:color-mix(in_srgb,var(--header-foreground)_16%,transparent)]',\n 'ds:[&_[data-header-slot=start]]:[--ring:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--muted-foreground:var(--header-foreground)]',\n 'ds:[&_[data-header-slot=end]]:[--border:color-mix(in_srgb,var(--header-foreground)_40%,transparent)]',\n 'ds:[&_[data-header-slot=end]]:[--muted:color-mix(in_srgb,var(--header-foreground)_16%,transparent)]',\n 'ds:[&_[data-header-slot=end]]:[--ring:var(--header-foreground)]',\n ].join(' '),\n // Light surface — plain page background with primary-coloured chrome.\n // Start + end slots rescope --foreground, --border, --ring to --primary\n // so IconButton borders/icons render in the brand hue while the\n // HeaderBrand wordmark keeps its bicolor artwork and the SearchBar\n // (center slot) is untouched.\n light: [\n 'ds:bg-[var(--background)] ds:text-[color:var(--foreground)]',\n 'ds:[&_[data-header-slot=start]]:[--foreground:var(--primary)]',\n 'ds:[&_[data-header-slot=start]]:[--border:var(--primary)]',\n 'ds:[&_[data-header-slot=start]]:[--ring:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--foreground:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--border:var(--primary)]',\n 'ds:[&_[data-header-slot=end]]:[--ring:var(--primary)]',\n ].join(' '),\n },\n },\n defaultVariants: {\n variant: 'brand',\n },\n },\n);\n\nconst innerVariants = cva(\n [\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:w-full ds:h-full',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n ].join(' '),\n);\n\nconst slotStartVariants = cva(\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n);\nconst slotCenterVariants = cva(\n 'ds:hidden ds:md:flex ds:flex-1 ds:min-w-0 ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)]',\n);\nconst slotEndVariants = cva(\n 'ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n);\n\nconst brandVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:text-[length:var(--font-size-base)] ds:font-[var(--font-weight-semibold)]',\n // `leading-none` zeros the anchor's line-height so the Logo SVG sits at\n // the geometric centre of the flex cross-axis — otherwise the residual\n // line-box above ascenders / below descenders nudges the SVG upward.\n 'ds:leading-none',\n // Inherit foreground from the Header root so the `brand` variant's\n // --primary-foreground ink cascades here without an override prop.\n 'ds:text-[color:currentColor]',\n 'ds:no-underline',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:min-h-[var(--min-target-size)]',\n ].join(' '),\n);\n\nconst brandDividerVariants = cva(\n [\n 'ds:hidden ds:md:inline-block',\n 'ds:border-inline-start ds:border-[color:var(--border)]',\n 'ds:self-stretch ds:my-[var(--spacing-xs)]',\n ].join(' '),\n);\n\nconst skipLinkVariants = cva(\n [\n 'ds:sr-only ds:focus:not-sr-only',\n 'ds:focus:absolute ds:focus:inset-inline-start-[var(--spacing-sm)] ds:focus:inset-block-start-[var(--spacing-sm)]',\n 'ds:focus:z-[calc(var(--z-sticky)+1)]',\n 'ds:focus:ps-[var(--spacing-sm)] ds:focus:pe-[var(--spacing-sm)] ds:focus:pbs-[var(--spacing-xs)] ds:focus:pbe-[var(--spacing-xs)]',\n 'ds:focus:bg-[var(--background)] ds:focus:text-[color:var(--foreground)]',\n 'ds:focus:border ds:focus:border-[color:var(--border)]',\n 'ds:focus:rounded-[var(--radius-sm)]',\n 'ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)]',\n 'ds:forced-colors:focus:outline-[CanvasText]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'role' | 'children'>,\n VariantProps<typeof rootVariants> {\n children: ReactNode;\n /** Override the default landmark name. */\n 'aria-label'?: string;\n /** Enable the scroll-linked border + shadow (default `true`). */\n scrollLinkedElevation?: boolean;\n}\n\nexport const Header = forwardRef<HTMLElement, HeaderProps>(\n (\n {\n variant = 'brand',\n className,\n children,\n scrollLinkedElevation = true,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const label = ariaLabel ?? t('navigation.header.label', 'Page header');\n\n // The bar is sticky against the LAYOUT viewport — pinch-zooming pans it\n // off the visible screen. Keep it glued to the visual viewport instead\n // (identity when unzoomed; no-op without the visualViewport API).\n const pinRef = useVisualViewportPin<HTMLElement>();\n // Memoised so React doesn't detach/reattach the refs on every render.\n const composedRef = useMemo(() => composeRefs(pinRef, ref), [pinRef, ref]);\n\n /* ---- Scroll-linked border / shadow ---------------------------- */\n const sentinelRef = useRef<HTMLDivElement | null>(null);\n const [scrolled, setScrolled] = useState(false);\n useEffect(() => {\n if (!scrollLinkedElevation) return undefined;\n const sentinel = sentinelRef.current;\n if (!sentinel) return undefined;\n if (typeof IntersectionObserver === 'undefined') return undefined;\n const io = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n // When the sentinel scrolls out of view (isIntersecting=false),\n // the user has scrolled past the top — flip the elevation on.\n setScrolled(!entry.isIntersecting);\n },\n { threshold: 0 },\n );\n io.observe(sentinel);\n return () => io.disconnect();\n }, [scrollLinkedElevation]);\n\n return (\n <>\n {/* 1px sentinel above the sticky header so the IntersectionObserver\n fires when the user scrolls past the top. Kept outside the\n <header> so it doesn't affect landmark semantics. */}\n {scrollLinkedElevation ? (\n // -mb-px swallows the sentinel's 1px flow height so the header sits\n // flush at the top; the IntersectionObserver still sees the pixel.\n <div\n ref={sentinelRef}\n aria-hidden=\"true\"\n className=\"ds:block ds:h-px ds:w-full ds:-mb-px\"\n />\n ) : null}\n <header\n ref={composedRef}\n role=\"banner\"\n aria-label={label}\n data-component=\"header\"\n data-scrolled={scrolled ? 'true' : undefined}\n className={rootVariants({ variant, className })}\n {...rest}\n >\n <div className={innerVariants()}>{children}</div>\n </header>\n </>\n );\n },\n);\nHeader.displayName = 'Header';\n\n/* ------------------------------------------------------------------ */\n/* Slot wrappers */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderStart = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"start\"\n className={[slotStartVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderStart.displayName = 'HeaderStart';\n\nexport const HeaderCenter = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"center\"\n className={[slotCenterVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderCenter.displayName = 'HeaderCenter';\n\nexport const HeaderEnd = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n data-header-slot=\"end\"\n className={[slotEndVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nHeaderEnd.displayName = 'HeaderEnd';\n\n/* ------------------------------------------------------------------ */\n/* Brand */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderBrandProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n /** Logo slot — an <svg> / <img>. Must carry its own accessible name via aria-label on the wrapping component OR a visible wordmark child. */\n logo?: ReactNode;\n /** Visible wordmark / product name. Sits after the logo. */\n children?: ReactNode;\n /** Destination href. Defaults to \"/\". */\n href?: string;\n /**\n * Render through Radix `Slot` so a consumer's router link (`<Link>`) takes\n * over the brand anchor while keeping the kit's `brandVariants` styling and\n * any forwarded `aria-label`. Pass a single link element as `children` (the\n * logo + wordmark go inside it). With `asChild` off the output is the plain\n * `<a href>` exactly as before.\n */\n asChild?: boolean;\n}\n\nexport const HeaderBrand = forwardRef<HTMLAnchorElement, HeaderBrandProps>(\n (\n { logo, children, href = '/', className, asChild = false, ...props },\n ref,\n ) => {\n if (import.meta.env.DEV && !props['aria-label'] && !children) {\n console.warn(\n 'HeaderBrand: pass `aria-label` or visible children — a logo-only brand link without a name has no accessible name.',\n );\n }\n const brandClassName = [brandVariants(), className]\n .filter(Boolean)\n .join(' ');\n\n // Consumer-router mode: the consumer supplies their own link element as\n // `children`; Slot merges the kit's brand class + forwarded props onto it\n // so the lockup styling and any aria-label survive. The logo + wordmark\n // live inside the consumer's element (it owns the click → client route).\n if (asChild) {\n return (\n <Slot ref={ref} className={brandClassName} {...props}>\n {children}\n </Slot>\n );\n }\n\n return (\n <a ref={ref} href={href} className={brandClassName} {...props}>\n {logo ? (\n <span\n aria-hidden={children ? 'true' : undefined}\n className=\"ds:inline-flex ds:items-center\"\n >\n {logo}\n </span>\n ) : null}\n {children ? <span className=\"ds:truncate\">{children}</span> : null}\n </a>\n );\n },\n);\nHeaderBrand.displayName = 'HeaderBrand';\n\n/* ------------------------------------------------------------------ */\n/* Brand divider */\n/* ------------------------------------------------------------------ */\n\nexport function HeaderBrandDivider({\n className,\n ...props\n}: HTMLAttributes<HTMLSpanElement>): ReactNode {\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={[brandDividerVariants(), className].filter(Boolean).join(' ')}\n {...props}\n />\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Menu button (mobile drawer trigger) */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderMenuButtonProps {\n onMenuOpen: () => void;\n 'aria-label'?: string;\n className?: string;\n}\n\nexport const HeaderMenuButton = forwardRef<\n HTMLButtonElement,\n HeaderMenuButtonProps\n>(({ onMenuOpen, 'aria-label': ariaLabel, className }, ref) => {\n const { t } = useTranslation();\n return (\n <IconButton\n ref={ref}\n // Show on mobile; hide above md breakpoint.\n className={['ds:md:hidden', className].filter(Boolean).join(' ')}\n icon={<Menu aria-hidden />}\n aria-label={ariaLabel ?? t('navigation.sidebar.open', 'Open menu')}\n onClick={onMenuOpen}\n />\n );\n});\nHeaderMenuButton.displayName = 'HeaderMenuButton';\n\n/* ------------------------------------------------------------------ */\n/* SkipLink */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSkipLinkProps extends Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n 'children'\n> {\n href: string;\n children?: ReactNode;\n}\n\nexport const HeaderSkipLink = forwardRef<\n HTMLAnchorElement,\n HeaderSkipLinkProps\n>(({ href, children, className, ...props }, ref) => {\n const { t } = useTranslation();\n return (\n <a\n ref={ref}\n href={href}\n className={[skipLinkVariants(), className].filter(Boolean).join(' ')}\n {...props}\n >\n {children ?? t('navigation.nav.skipToContent', 'Skip to content')}\n </a>\n );\n});\nHeaderSkipLink.displayName = 'HeaderSkipLink';\n"],"names":["rootVariants","cva","innerVariants","slotStartVariants","slotCenterVariants","slotEndVariants","brandVariants","brandDividerVariants","skipLinkVariants","Header","forwardRef","variant","className","children","scrollLinkedElevation","ariaLabel","rest","ref","t","useTranslation","label","pinRef","useVisualViewportPin","composedRef","useMemo","composeRefs","sentinelRef","useRef","scrolled","setScrolled","useState","useEffect","sentinel","io","entries","entry","jsxs","Fragment","jsx","HeaderStart","props","HeaderCenter","HeaderEnd","HeaderBrand","logo","href","asChild","brandClassName","Slot","HeaderBrandDivider","HeaderMenuButton","onMenuOpen","IconButton","Menu","HeaderSkipLink"],"mappings":";;;;;;;;;AAsBA,MAAMA,IAAeC;AAAA,EACnB;AAAA,IACE;AAAA;AAAA;AAAA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AAAC,EAAA,IAAMC,EAAA;AACd,SACE,gBAAAmB;AAAA,IAACc;AAAA,IAAA;AAAA,MACC,KAAAnC;AAAA,MAEA,WAAW,CAAC,gBAAgBL,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAC/D,MAAM,gBAAA0B,EAACe,GAAA,EAAK,eAAW,IAAC;AAAA,MACxB,cAAYtC,KAAaG,EAAE,2BAA2B,WAAW;AAAA,MACjE,SAASiC;AAAA,IAAA;AAAA,EAAA;AAGf,CAAC;AACDD,EAAiB,cAAc;AAcxB,MAAMI,IAAiB5C,EAG5B,CAAC,EAAE,MAAAmC,GAAM,UAAAhC,GAAU,WAAAD,GAAW,GAAG4B,EAAA,GAASvB,MAAQ;AAClD,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA;AACd,SACE,gBAAAmB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAArB;AAAA,MACA,MAAA4B;AAAA,MACA,WAAW,CAACrC,EAAA,GAAoBI,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,MAClE,GAAG4B;AAAA,MAEH,UAAA3B,KAAYK,EAAE,gCAAgC,iBAAiB;AAAA,IAAA;AAAA,EAAA;AAGtE,CAAC;AACDoC,EAAe,cAAc;"}
@@ -2,11 +2,11 @@ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
2
  import { forwardRef as I, useRef as c, useImperativeHandle as C, useCallback as R, useMemo as E } from "react";
3
3
  import { c as _ } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as K } from "react-i18next";
5
- import { I as l } from "./icon-button-9c9Gp41m.js";
6
- import { I as M } from "./icon-button-group-DrvuWPGJ.js";
5
+ import { I as l } from "./icon-button-DA2CAGHZ.js";
6
+ import { I as M } from "./icon-button-group-D6SVMteH.js";
7
7
  import { D as r } from "./dropdown-menu-DU-Hrf33.js";
8
8
  import { S as N } from "./switch-OILsBLWo.js";
9
- import { c as S, a as j, L as H } from "./locale-picker-sI0HWgZy.js";
9
+ import { c as S, a as j, L as H } from "./locale-picker-BvbVjDQ-.js";
10
10
  import { u as O } from "./use-locale-BkCIHujH.js";
11
11
  import { u as P } from "./use-theme-CAuo6EYT.js";
12
12
  import { u as V } from "./registry-DvAUVLHh.js";
@@ -332,4 +332,4 @@ J.displayName = "HeaderSettings";
332
332
  export {
333
333
  J as H
334
334
  };
335
- //# sourceMappingURL=header-settings-C0zHLXJE.js.map
335
+ //# sourceMappingURL=header-settings-CVC_davE.js.map