@alfadocs/ui-kit-debug 1.55.0 → 1.57.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 (448) hide show
  1. package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js → ai-credits-notice-ktklr8fy.js} +2 -2
  2. package/dist/_chunks/{ai-credits-notice-BoNJtOuE.js.map → ai-credits-notice-ktklr8fy.js.map} +1 -1
  3. package/dist/_chunks/ai-permission-notice-DyuEGwAt.js +206 -0
  4. package/dist/_chunks/ai-permission-notice-DyuEGwAt.js.map +1 -0
  5. package/dist/_chunks/alia-sidebar-BBKBJCv6.js +1284 -0
  6. package/dist/_chunks/alia-sidebar-BBKBJCv6.js.map +1 -0
  7. package/dist/_chunks/{anamnesis-summary-rows-Dtw5Hpg4.js → anamnesis-summary-rows-CCQ62mMN.js} +5 -5
  8. package/dist/_chunks/{anamnesis-summary-rows-Dtw5Hpg4.js.map → anamnesis-summary-rows-CCQ62mMN.js.map} +1 -1
  9. package/dist/_chunks/{appointment-peek-BIZaDeCi.js → appointment-peek-WvNbE4JG.js} +2 -2
  10. package/dist/_chunks/{appointment-peek-BIZaDeCi.js.map → appointment-peek-WvNbE4JG.js.map} +1 -1
  11. package/dist/_chunks/{appointment-timeline-DmqYEIT9.js → appointment-timeline-Z0494xO-.js} +2 -2
  12. package/dist/_chunks/{appointment-timeline-DmqYEIT9.js.map → appointment-timeline-Z0494xO-.js.map} +1 -1
  13. package/dist/_chunks/{balance-badge-cell-zP-iN-Pd.js → balance-badge-cell-CII3SDmR.js} +3 -3
  14. package/dist/_chunks/{balance-badge-cell-zP-iN-Pd.js.map → balance-badge-cell-CII3SDmR.js.map} +1 -1
  15. package/dist/_chunks/{bmi-calculator-DTZhRhXe.js → bmi-calculator-C0UTxB7R.js} +2 -2
  16. package/dist/_chunks/{bmi-calculator-DTZhRhXe.js.map → bmi-calculator-C0UTxB7R.js.map} +1 -1
  17. package/dist/_chunks/{booking-uZO10TLK.js → booking-81WnKDsH.js} +4 -4
  18. package/dist/_chunks/{booking-uZO10TLK.js.map → booking-81WnKDsH.js.map} +1 -1
  19. package/dist/_chunks/{breadcrumb-xgVpPH2H.js → breadcrumb-Boan-5n8.js} +39 -39
  20. package/dist/_chunks/breadcrumb-Boan-5n8.js.map +1 -0
  21. package/dist/_chunks/{calculator-dialog-BRjZMWuE.js → calculator-dialog-CzQv03p0.js} +2 -2
  22. package/dist/_chunks/{calculator-dialog-BRjZMWuE.js.map → calculator-dialog-CzQv03p0.js.map} +1 -1
  23. package/dist/_chunks/{calendar-workspace-DVajSkKA.js → calendar-workspace-D5-k_9zE.js} +15 -15
  24. package/dist/_chunks/{calendar-workspace-DVajSkKA.js.map → calendar-workspace-D5-k_9zE.js.map} +1 -1
  25. package/dist/_chunks/{care-plan-card-Ddjh5Doc.js → care-plan-card-DxrRLRdW.js} +2 -2
  26. package/dist/_chunks/{care-plan-card-Ddjh5Doc.js.map → care-plan-card-DxrRLRdW.js.map} +1 -1
  27. package/dist/_chunks/{care-plan-header-BeMYMiI7.js → care-plan-header-BMwZIgHJ.js} +3 -3
  28. package/dist/_chunks/{care-plan-header-BeMYMiI7.js.map → care-plan-header-BMwZIgHJ.js.map} +1 -1
  29. package/dist/_chunks/chart-DQ5GxqgT.js +906 -0
  30. package/dist/_chunks/chart-DQ5GxqgT.js.map +1 -0
  31. package/dist/_chunks/{clinical-note-card-14JIoUR0.js → clinical-note-card-hx939bvw.js} +2 -2
  32. package/dist/_chunks/{clinical-note-card-14JIoUR0.js.map → clinical-note-card-hx939bvw.js.map} +1 -1
  33. package/dist/_chunks/{color-picker-BRQ4Y9SO.js → color-picker-BsggJovx.js} +128 -123
  34. package/dist/_chunks/color-picker-BsggJovx.js.map +1 -0
  35. package/dist/_chunks/{contact-card-CmK05vNb.js → contact-card-fHBMwEsx.js} +2 -2
  36. package/dist/_chunks/{contact-card-CmK05vNb.js.map → contact-card-fHBMwEsx.js.map} +1 -1
  37. package/dist/_chunks/{contact-profile-card-C5DbP_X3.js → contact-profile-card-CMyBYgRR.js} +3 -3
  38. package/dist/_chunks/{contact-profile-card-C5DbP_X3.js.map → contact-profile-card-CMyBYgRR.js.map} +1 -1
  39. package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js → cycle-calculator-Cww9DzIa.js} +2 -2
  40. package/dist/_chunks/{cycle-calculator-Dgfqr4Q4.js.map → cycle-calculator-Cww9DzIa.js.map} +1 -1
  41. package/dist/_chunks/dashboard-grid-DfEY2qci.js +844 -0
  42. package/dist/_chunks/dashboard-grid-DfEY2qci.js.map +1 -0
  43. package/dist/_chunks/{data-table-C6T31E33.js → data-table-fAMTeAjM.js} +2 -2
  44. package/dist/_chunks/{data-table-C6T31E33.js.map → data-table-fAMTeAjM.js.map} +1 -1
  45. package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js → data-table-tabs-CHYAAeHy.js} +2 -2
  46. package/dist/_chunks/{data-table-tabs-Xhg5G0gU.js.map → data-table-tabs-CHYAAeHy.js.map} +1 -1
  47. package/dist/_chunks/{date-picker-wRAcq2lt.js → date-picker-BSZuKo13.js} +69 -62
  48. package/dist/_chunks/date-picker-BSZuKo13.js.map +1 -0
  49. package/dist/_chunks/{date-range-picker-BOvHwWO5.js → date-range-picker-CFk-5O3R.js} +188 -177
  50. package/dist/_chunks/date-range-picker-CFk-5O3R.js.map +1 -0
  51. package/dist/_chunks/{date-time-picker-CLeLKuv9.js → date-time-picker-CjxTkblD.js} +92 -85
  52. package/dist/_chunks/date-time-picker-CjxTkblD.js.map +1 -0
  53. package/dist/_chunks/{dependent-selector-Bet3XAFj.js → dependent-selector-DgaAQc-c.js} +91 -86
  54. package/dist/_chunks/dependent-selector-DgaAQc-c.js.map +1 -0
  55. package/dist/_chunks/{dialog-D52AI4nF.js → dialog-Dn-iQ0Jp.js} +86 -69
  56. package/dist/_chunks/dialog-Dn-iQ0Jp.js.map +1 -0
  57. package/dist/_chunks/{document-preview-uoTekVR7.js → document-preview-CHGGG0l_.js} +2 -2
  58. package/dist/_chunks/{document-preview-uoTekVR7.js.map → document-preview-CHGGG0l_.js.map} +1 -1
  59. package/dist/_chunks/{due-date-calculator-DXDJbUzo.js → due-date-calculator-D_qFUiHp.js} +3 -3
  60. package/dist/_chunks/{due-date-calculator-DXDJbUzo.js.map → due-date-calculator-D_qFUiHp.js.map} +1 -1
  61. package/dist/_chunks/{entity-summary-DcB0fIiv.js → entity-summary-CWcCSThK.js} +2 -2
  62. package/dist/_chunks/{entity-summary-DcB0fIiv.js.map → entity-summary-CWcCSThK.js.map} +1 -1
  63. package/dist/_chunks/{file-manager-dIJQUZvq.js → file-manager-CFsL1KVt.js} +4 -4
  64. package/dist/_chunks/{file-manager-dIJQUZvq.js.map → file-manager-CFsL1KVt.js.map} +1 -1
  65. package/dist/_chunks/{freemium-paywall-B6ojVXq7.js → freemium-paywall-DIKuhX8b.js} +90 -86
  66. package/dist/_chunks/freemium-paywall-DIKuhX8b.js.map +1 -0
  67. package/dist/_chunks/{gestational-age-calculator-BfGpt3du.js → gestational-age-calculator-CZi43xKG.js} +3 -3
  68. package/dist/_chunks/{gestational-age-calculator-BfGpt3du.js.map → gestational-age-calculator-CZi43xKG.js.map} +1 -1
  69. package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js → hcg-doubling-Ccvh7OaU.js} +2 -2
  70. package/dist/_chunks/{hcg-doubling-BIYyI2Yo.js.map → hcg-doubling-Ccvh7OaU.js.map} +1 -1
  71. package/dist/_chunks/{header-settings-ge_3gYEq.js → header-settings-BMcCx2LC.js} +2 -2
  72. package/dist/_chunks/{header-settings-ge_3gYEq.js.map → header-settings-BMcCx2LC.js.map} +1 -1
  73. package/dist/_chunks/{heatmap-BARGZZt2.js → heatmap-BEeOThkW.js} +2 -2
  74. package/dist/_chunks/{heatmap-BARGZZt2.js.map → heatmap-BEeOThkW.js.map} +1 -1
  75. package/dist/_chunks/{help-me-write-templates-B7L3zGsE.js → help-me-write-templates-BUoYGo6f.js} +2 -2
  76. package/dist/_chunks/help-me-write-templates-BUoYGo6f.js.map +1 -0
  77. package/dist/_chunks/{hover-card-BnTueNS2.js → hover-card-U_ZYoh1n.js} +201 -187
  78. package/dist/_chunks/hover-card-U_ZYoh1n.js.map +1 -0
  79. package/dist/_chunks/{icon-picker-DWrqmI1c.js → icon-picker-C86lQTIA.js} +2 -2
  80. package/dist/_chunks/{icon-picker-DWrqmI1c.js.map → icon-picker-C86lQTIA.js.map} +1 -1
  81. package/dist/_chunks/{info-tip-B0jmIt6M.js → info-tip-CJpNpzZe.js} +2 -2
  82. package/dist/_chunks/{info-tip-B0jmIt6M.js.map → info-tip-CJpNpzZe.js.map} +1 -1
  83. package/dist/_chunks/{key-value-pair-Ax8IJr1M.js → key-value-pair-BNNITp6S.js} +25 -19
  84. package/dist/_chunks/key-value-pair-BNNITp6S.js.map +1 -0
  85. package/dist/_chunks/{kit-extensions-C9-v8Dih.js → kit-extensions-DYVxWcqv.js} +5 -5
  86. package/dist/_chunks/{kit-extensions-C9-v8Dih.js.map → kit-extensions-DYVxWcqv.js.map} +1 -1
  87. package/dist/_chunks/{link-cell-renderer-DlBVPMTi.js → link-cell-renderer-CxW_oLa5.js} +2 -2
  88. package/dist/_chunks/{link-cell-renderer-DlBVPMTi.js.map → link-cell-renderer-CxW_oLa5.js.map} +1 -1
  89. package/dist/_chunks/link-gRw3NtOt.js +137 -0
  90. package/dist/_chunks/link-gRw3NtOt.js.map +1 -0
  91. package/dist/_chunks/{locale-picker-DfNSdOpy.js → locale-picker-BGfrZyTw.js} +2 -2
  92. package/dist/_chunks/{locale-picker-DfNSdOpy.js.map → locale-picker-BGfrZyTw.js.map} +1 -1
  93. package/dist/_chunks/{marketplace-app-shell-Dcx-JEjg.js → marketplace-app-shell-BZcA9Z06.js} +143 -129
  94. package/dist/_chunks/marketplace-app-shell-BZcA9Z06.js.map +1 -0
  95. package/dist/_chunks/{message-tray-BB95DA82.js → message-tray-QKQutwxj.js} +76 -69
  96. package/dist/_chunks/message-tray-QKQutwxj.js.map +1 -0
  97. package/dist/_chunks/{nav-grid-BqCPH8sm.js → nav-grid-Byx8PxuB.js} +2 -2
  98. package/dist/_chunks/{nav-grid-BqCPH8sm.js.map → nav-grid-Byx8PxuB.js.map} +1 -1
  99. package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js +89 -0
  100. package/dist/_chunks/non-modal-tab-exit-j3CPOuE3.js.map +1 -0
  101. package/dist/_chunks/{note-attachment-I1NLoeRZ.js → note-attachment-Bt2cddsZ.js} +2 -2
  102. package/dist/_chunks/{note-attachment-I1NLoeRZ.js.map → note-attachment-Bt2cddsZ.js.map} +1 -1
  103. package/dist/_chunks/{note-timeline-CsY8YOE7.js → note-timeline-CX9nAgAR.js} +2 -2
  104. package/dist/_chunks/{note-timeline-CsY8YOE7.js.map → note-timeline-CX9nAgAR.js.map} +1 -1
  105. package/dist/_chunks/{notes-panel-I8ntrrUW.js → notes-panel-Cm4pttpl.js} +4 -4
  106. package/dist/_chunks/{notes-panel-I8ntrrUW.js.map → notes-panel-Cm4pttpl.js.map} +1 -1
  107. package/dist/_chunks/{notification-tray-__sJXnsz.js → notification-tray-C5VtbGjd.js} +83 -76
  108. package/dist/_chunks/notification-tray-C5VtbGjd.js.map +1 -0
  109. package/dist/_chunks/{patient-details-DsTtjpuX.js → patient-details-99kEdtc5.js} +2 -2
  110. package/dist/_chunks/{patient-details-DsTtjpuX.js.map → patient-details-99kEdtc5.js.map} +1 -1
  111. package/dist/_chunks/{patient-field-row-BvZ9luz-.js → patient-field-row-DkxY13T6.js} +5 -5
  112. package/dist/_chunks/{patient-field-row-BvZ9luz-.js.map → patient-field-row-DkxY13T6.js.map} +1 -1
  113. package/dist/_chunks/{patient-summary-card-3dspc2tR.js → patient-summary-card-opdyfeW2.js} +10 -6
  114. package/dist/_chunks/{patient-summary-card-3dspc2tR.js.map → patient-summary-card-opdyfeW2.js.map} +1 -1
  115. package/dist/_chunks/{payment-automation-upsell-DEUfM7EU.js → payment-automation-upsell-DiHovmUL.js} +2 -2
  116. package/dist/_chunks/{payment-automation-upsell-DEUfM7EU.js.map → payment-automation-upsell-DiHovmUL.js.map} +1 -1
  117. package/dist/_chunks/{payment-request-card-DAGqh9Yx.js → payment-request-card-DAniJNLX.js} +3 -3
  118. package/dist/_chunks/{payment-request-card-DAGqh9Yx.js.map → payment-request-card-DAniJNLX.js.map} +1 -1
  119. package/dist/_chunks/{pdf-viewer-C3minW5b.js → pdf-viewer-CNQxa4tv.js} +396 -391
  120. package/dist/_chunks/pdf-viewer-CNQxa4tv.js.map +1 -0
  121. package/dist/_chunks/{periodontal-chart-BqwLxy2m.js → periodontal-chart-DD5C0M3l.js} +2 -2
  122. package/dist/_chunks/{periodontal-chart-BqwLxy2m.js.map → periodontal-chart-DD5C0M3l.js.map} +1 -1
  123. package/dist/_chunks/{periodontal-chart-card-CWZ1YM1h.js → periodontal-chart-card-CxdXvsPU.js} +2 -2
  124. package/dist/_chunks/{periodontal-chart-card-CWZ1YM1h.js.map → periodontal-chart-card-CxdXvsPU.js.map} +1 -1
  125. package/dist/_chunks/{periodontal-diagnosis-C9IuvLId.js → periodontal-diagnosis-D-PJv7KS.js} +2 -2
  126. package/dist/_chunks/{periodontal-diagnosis-C9IuvLId.js.map → periodontal-diagnosis-D-PJv7KS.js.map} +1 -1
  127. package/dist/_chunks/{phone-input-DxkHMYmu.js → phone-input-O9camxkq.js} +156 -151
  128. package/dist/_chunks/phone-input-O9camxkq.js.map +1 -0
  129. package/dist/_chunks/popover-BG75rYjN.js +367 -0
  130. package/dist/_chunks/popover-BG75rYjN.js.map +1 -0
  131. package/dist/_chunks/{position-grid-D2D5_Tze.js → position-grid-CBB88EaH.js} +38 -36
  132. package/dist/_chunks/position-grid-CBB88EaH.js.map +1 -0
  133. package/dist/_chunks/{practice-results-DxOgbPDy.js → practice-results-CfRkjzsI.js} +2 -2
  134. package/dist/_chunks/{practice-results-DxOgbPDy.js.map → practice-results-CfRkjzsI.js.map} +1 -1
  135. package/dist/_chunks/{pregnancy-dating-R3q5n1Wh.js → pregnancy-dating-BFzv9g1N.js} +3 -3
  136. package/dist/_chunks/{pregnancy-dating-R3q5n1Wh.js.map → pregnancy-dating-BFzv9g1N.js.map} +1 -1
  137. package/dist/_chunks/{pregnancy-weight-gain-DwmNklDU.js → pregnancy-weight-gain-CUUrBTBo.js} +2 -2
  138. package/dist/_chunks/{pregnancy-weight-gain-DwmNklDU.js.map → pregnancy-weight-gain-CUUrBTBo.js.map} +1 -1
  139. package/dist/_chunks/{product-hub-panel-BSSiGGG4.js → product-hub-panel-DlVRK7Ue.js} +103 -96
  140. package/dist/_chunks/product-hub-panel-DlVRK7Ue.js.map +1 -0
  141. package/dist/_chunks/{public-footer-CxpG6J1M.js → public-footer-ZWTEG1Rq.js} +2 -2
  142. package/dist/_chunks/{public-footer-CxpG6J1M.js.map → public-footer-ZWTEG1Rq.js.map} +1 -1
  143. package/dist/_chunks/{public-header.agent-BWusjxY8.js → public-header.agent-BctevbuY.js} +2 -2
  144. package/dist/_chunks/{public-header.agent-BWusjxY8.js.map → public-header.agent-BctevbuY.js.map} +1 -1
  145. package/dist/_chunks/{radio-group-BT97ty7o.js → radio-group-DicxWJXP.js} +111 -106
  146. package/dist/_chunks/radio-group-DicxWJXP.js.map +1 -0
  147. package/dist/_chunks/{radiograph-panel.agent-BA90I3Mu.js → radiograph-panel.agent-DyqbTECc.js} +4 -4
  148. package/dist/_chunks/{radiograph-panel.agent-BA90I3Mu.js.map → radiograph-panel.agent-DyqbTECc.js.map} +1 -1
  149. package/dist/_chunks/{registration-form-D7iNqMBF.js → registration-form-BlTzYywa.js} +2 -2
  150. package/dist/_chunks/{registration-form-D7iNqMBF.js.map → registration-form-BlTzYywa.js.map} +1 -1
  151. package/dist/_chunks/{rich-text-editor-Blp4smUr.js → rich-text-editor-DTnNZ4Ff.js} +489 -484
  152. package/dist/_chunks/rich-text-editor-DTnNZ4Ff.js.map +1 -0
  153. package/dist/_chunks/{sheet-CNFW8mYZ.js → sheet-8qsiMoUI.js} +95 -79
  154. package/dist/_chunks/sheet-8qsiMoUI.js.map +1 -0
  155. package/dist/_chunks/{sign-document-B6HlyCGV.js → sign-document-D4iHS_Ug.js} +2 -2
  156. package/dist/_chunks/{sign-document-B6HlyCGV.js.map → sign-document-D4iHS_Ug.js.map} +1 -1
  157. package/dist/_chunks/{signature-request-rgMsgo-C.js → signature-request-DRuYAG5I.js} +2 -2
  158. package/dist/_chunks/{signature-request-rgMsgo-C.js.map → signature-request-DRuYAG5I.js.map} +1 -1
  159. package/dist/_chunks/{signed-out-frame-B2GTIeqA.js → signed-out-frame-AhMsNW1r.js} +2 -2
  160. package/dist/_chunks/{signed-out-frame-B2GTIeqA.js.map → signed-out-frame-AhMsNW1r.js.map} +1 -1
  161. package/dist/_chunks/{stat-51CDL4au.js → stat-DmjGfXND.js} +117 -108
  162. package/dist/_chunks/stat-DmjGfXND.js.map +1 -0
  163. package/dist/_chunks/{stepper-accordion-D7lnBGh2.js → stepper-accordion-DDTSOUHc.js} +17 -6
  164. package/dist/_chunks/stepper-accordion-DDTSOUHc.js.map +1 -0
  165. package/dist/_chunks/{task-editor-Ctxsa1BY.js → task-editor-NkcopDna.js} +4 -4
  166. package/dist/_chunks/{task-editor-Ctxsa1BY.js.map → task-editor-NkcopDna.js.map} +1 -1
  167. package/dist/_chunks/{use-appointment-details-read-DinTrRIW.js → use-appointment-details-read-CfFQNOF_.js} +5 -5
  168. package/dist/_chunks/{use-appointment-details-read-DinTrRIW.js.map → use-appointment-details-read-CfFQNOF_.js.map} +1 -1
  169. package/dist/_chunks/use-select-on-arrow-Cr4iBuW5.js +26 -0
  170. package/dist/_chunks/use-select-on-arrow-Cr4iBuW5.js.map +1 -0
  171. package/dist/_chunks/{voice-control-panel-Bg1eklL0.js → voice-control-panel-BKbgb7FM.js} +2 -2
  172. package/dist/_chunks/{voice-control-panel-Bg1eklL0.js.map → voice-control-panel-BKbgb7FM.js.map} +1 -1
  173. package/dist/_chunks/{widget-picker-D8RiWrJd.js → widget-picker-rBA7MR5P.js} +2 -2
  174. package/dist/_chunks/{widget-picker-D8RiWrJd.js.map → widget-picker-rBA7MR5P.js.map} +1 -1
  175. package/dist/_chunks/{workflow-map-D3mezmGB.js → workflow-map-Demlpy39.js} +2 -2
  176. package/dist/_chunks/{workflow-map-D3mezmGB.js.map → workflow-map-Demlpy39.js.map} +1 -1
  177. package/dist/agent-catalog.json +28 -11
  178. package/dist/agent-i18n/en.json +8 -7
  179. package/dist/components/_shared/non-modal-tab-exit.d.ts +19 -0
  180. package/dist/components/_shared/non-modal-tab-exit.d.ts.map +1 -0
  181. package/dist/components/_shared/use-apex-chart-semantics.d.ts +6 -0
  182. package/dist/components/_shared/use-apex-chart-semantics.d.ts.map +1 -0
  183. package/dist/components/_shared/use-select-on-arrow.d.ts +20 -0
  184. package/dist/components/_shared/use-select-on-arrow.d.ts.map +1 -0
  185. package/dist/components/ai-credits-notice/index.js +1 -1
  186. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts +32 -0
  187. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -1
  188. package/dist/components/ai-permission-notice/index.d.ts +1 -1
  189. package/dist/components/ai-permission-notice/index.d.ts.map +1 -1
  190. package/dist/components/ai-permission-notice/index.js +1 -1
  191. package/dist/components/appointment-details-panel/index.js +1 -1
  192. package/dist/components/appointment-peek/index.js +1 -1
  193. package/dist/components/appointment-timeline/index.js +1 -1
  194. package/dist/components/bmi-calculator/index.js +1 -1
  195. package/dist/components/booking/index.js +1 -1
  196. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  197. package/dist/components/breadcrumb/index.js +1 -1
  198. package/dist/components/calculator-dialog/index.js +1 -1
  199. package/dist/components/care-plan-card/index.js +1 -1
  200. package/dist/components/care-plan-header/index.js +1 -1
  201. package/dist/components/chart/chart.d.ts +15 -10
  202. package/dist/components/chart/chart.d.ts.map +1 -1
  203. package/dist/components/chart/index.js +1 -1
  204. package/dist/components/clinical-note-card/index.js +1 -1
  205. package/dist/components/color-picker/color-picker.d.ts.map +1 -1
  206. package/dist/components/color-picker/index.js +1 -1
  207. package/dist/components/contact-card/index.js +1 -1
  208. package/dist/components/contact-profile-card/index.js +1 -1
  209. package/dist/components/cycle-calculator/index.js +1 -1
  210. package/dist/components/dashboard-grid/dashboard-grid-engine.d.ts +22 -0
  211. package/dist/components/dashboard-grid/dashboard-grid-engine.d.ts.map +1 -1
  212. package/dist/components/dashboard-grid/dashboard-grid.agent.d.ts.map +1 -1
  213. package/dist/components/dashboard-grid/dashboard-grid.d.ts +48 -4
  214. package/dist/components/dashboard-grid/dashboard-grid.d.ts.map +1 -1
  215. package/dist/components/dashboard-grid/index.js +1 -1
  216. package/dist/components/data-table/index.js +2 -2
  217. package/dist/components/data-table-tabs/index.js +1 -1
  218. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  219. package/dist/components/date-picker/index.js +1 -1
  220. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
  221. package/dist/components/date-range-picker/index.js +1 -1
  222. package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
  223. package/dist/components/date-time-picker/index.js +1 -1
  224. package/dist/components/dependent-selector/dependent-selector.d.ts.map +1 -1
  225. package/dist/components/dependent-selector/index.js +1 -1
  226. package/dist/components/dialog/dialog.d.ts +2 -2
  227. package/dist/components/dialog/dialog.d.ts.map +1 -1
  228. package/dist/components/dialog/index.js +1 -1
  229. package/dist/components/document-preview/index.js +1 -1
  230. package/dist/components/due-date-calculator/index.js +1 -1
  231. package/dist/components/entity-summary/index.js +1 -1
  232. package/dist/components/file-manager/index.js +1 -1
  233. package/dist/components/freemium-paywall/freemium-paywall.d.ts.map +1 -1
  234. package/dist/components/freemium-paywall/index.js +1 -1
  235. package/dist/components/gestational-age-calculator/index.js +1 -1
  236. package/dist/components/hcg-doubling/index.js +1 -1
  237. package/dist/components/header-settings/index.js +1 -1
  238. package/dist/components/heatmap/index.js +1 -1
  239. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  240. package/dist/components/hover-card/index.js +1 -1
  241. package/dist/components/icon-picker/index.js +1 -1
  242. package/dist/components/info-tip/index.js +1 -1
  243. package/dist/components/key-value-pair/index.js +1 -1
  244. package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
  245. package/dist/components/link/index.js +1 -1
  246. package/dist/components/link/link.d.ts +5 -3
  247. package/dist/components/link/link.d.ts.map +1 -1
  248. package/dist/components/locale-picker/index.js +1 -1
  249. package/dist/components/message-tray/index.js +1 -1
  250. package/dist/components/message-tray/message-tray.d.ts.map +1 -1
  251. package/dist/components/nav-grid/index.js +1 -1
  252. package/dist/components/note-timeline/index.js +1 -1
  253. package/dist/components/notes-panel/index.js +1 -1
  254. package/dist/components/notification-tray/index.js +1 -1
  255. package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
  256. package/dist/components/patient-details/index.js +1 -1
  257. package/dist/components/patient-summary-card/index.js +1 -1
  258. package/dist/components/patient-summary-card/patient-summary-card.d.ts.map +1 -1
  259. package/dist/components/patient-table/index.js +1 -1
  260. package/dist/components/payment-card/index.js +1 -1
  261. package/dist/components/pdf-viewer/index.js +1 -1
  262. package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
  263. package/dist/components/periodontal-chart/index.js +1 -1
  264. package/dist/components/periodontal-chart-card/index.js +1 -1
  265. package/dist/components/periodontal-diagnosis/index.js +1 -1
  266. package/dist/components/phone-input/index.js +1 -1
  267. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  268. package/dist/components/popover/index.js +1 -1
  269. package/dist/components/popover/popover.d.ts +1 -1
  270. package/dist/components/popover/popover.d.ts.map +1 -1
  271. package/dist/components/position-grid/index.js +1 -1
  272. package/dist/components/position-grid/position-grid.d.ts.map +1 -1
  273. package/dist/components/practice-results/index.js +1 -1
  274. package/dist/components/pregnancy-dating/index.js +1 -1
  275. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  276. package/dist/components/product-hub-tray/index.js +1 -1
  277. package/dist/components/product-hub-tray/product-hub-tray.d.ts.map +1 -1
  278. package/dist/components/public-footer/index.js +1 -1
  279. package/dist/components/public-header/index.js +1 -1
  280. package/dist/components/radio-group/index.js +1 -1
  281. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  282. package/dist/components/radiograph-panel/index.js +1 -1
  283. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  284. package/dist/components/rich-text-editor/index.js +2 -2
  285. package/dist/components/sheet/index.js +1 -1
  286. package/dist/components/sheet/sheet.d.ts +2 -2
  287. package/dist/components/sheet/sheet.d.ts.map +1 -1
  288. package/dist/components/sign-document/index.js +1 -1
  289. package/dist/components/stat/index.d.ts +1 -1
  290. package/dist/components/stat/index.d.ts.map +1 -1
  291. package/dist/components/stat/index.js +1 -1
  292. package/dist/components/stat/stat.d.ts +9 -0
  293. package/dist/components/stat/stat.d.ts.map +1 -1
  294. package/dist/components/stepper-accordion/index.js +1 -1
  295. package/dist/components/stepper-accordion/stepper-accordion.d.ts.map +1 -1
  296. package/dist/components/task-editor/index.js +1 -1
  297. package/dist/components/voice-control-panel/index.js +1 -1
  298. package/dist/components/widget-picker/index.js +1 -1
  299. package/dist/components/workflow/index.js +1 -1
  300. package/dist/host-legacy.css +13 -2
  301. package/dist/i18n/locales/ar.d.ts +17 -2
  302. package/dist/i18n/locales/ar.d.ts.map +1 -1
  303. package/dist/i18n/locales/ar.js +20 -5
  304. package/dist/i18n/locales/ar.js.map +1 -1
  305. package/dist/i18n/locales/de.d.ts +17 -2
  306. package/dist/i18n/locales/de.d.ts.map +1 -1
  307. package/dist/i18n/locales/de.js +20 -5
  308. package/dist/i18n/locales/de.js.map +1 -1
  309. package/dist/i18n/locales/el.d.ts +17 -2
  310. package/dist/i18n/locales/el.d.ts.map +1 -1
  311. package/dist/i18n/locales/el.js +20 -5
  312. package/dist/i18n/locales/el.js.map +1 -1
  313. package/dist/i18n/locales/en.d.ts +17 -2
  314. package/dist/i18n/locales/en.d.ts.map +1 -1
  315. package/dist/i18n/locales/en.js +20 -5
  316. package/dist/i18n/locales/en.js.map +1 -1
  317. package/dist/i18n/locales/es.d.ts +17 -2
  318. package/dist/i18n/locales/es.d.ts.map +1 -1
  319. package/dist/i18n/locales/es.js +20 -5
  320. package/dist/i18n/locales/es.js.map +1 -1
  321. package/dist/i18n/locales/fr.d.ts +17 -2
  322. package/dist/i18n/locales/fr.d.ts.map +1 -1
  323. package/dist/i18n/locales/fr.js +20 -5
  324. package/dist/i18n/locales/fr.js.map +1 -1
  325. package/dist/i18n/locales/hi.d.ts +17 -2
  326. package/dist/i18n/locales/hi.d.ts.map +1 -1
  327. package/dist/i18n/locales/hi.js +20 -5
  328. package/dist/i18n/locales/hi.js.map +1 -1
  329. package/dist/i18n/locales/it.d.ts +17 -2
  330. package/dist/i18n/locales/it.d.ts.map +1 -1
  331. package/dist/i18n/locales/it.js +20 -5
  332. package/dist/i18n/locales/it.js.map +1 -1
  333. package/dist/i18n/locales/ja.d.ts +17 -2
  334. package/dist/i18n/locales/ja.d.ts.map +1 -1
  335. package/dist/i18n/locales/ja.js +20 -5
  336. package/dist/i18n/locales/ja.js.map +1 -1
  337. package/dist/i18n/locales/nl.d.ts +17 -2
  338. package/dist/i18n/locales/nl.d.ts.map +1 -1
  339. package/dist/i18n/locales/nl.js +20 -5
  340. package/dist/i18n/locales/nl.js.map +1 -1
  341. package/dist/i18n/locales/pl.d.ts +17 -2
  342. package/dist/i18n/locales/pl.d.ts.map +1 -1
  343. package/dist/i18n/locales/pl.js +20 -5
  344. package/dist/i18n/locales/pl.js.map +1 -1
  345. package/dist/i18n/locales/pt.d.ts +17 -2
  346. package/dist/i18n/locales/pt.d.ts.map +1 -1
  347. package/dist/i18n/locales/pt.js +20 -5
  348. package/dist/i18n/locales/pt.js.map +1 -1
  349. package/dist/i18n/locales/ro.d.ts +17 -2
  350. package/dist/i18n/locales/ro.d.ts.map +1 -1
  351. package/dist/i18n/locales/ro.js +20 -5
  352. package/dist/i18n/locales/ro.js.map +1 -1
  353. package/dist/i18n/locales/ru.d.ts +17 -2
  354. package/dist/i18n/locales/ru.d.ts.map +1 -1
  355. package/dist/i18n/locales/ru.js +20 -5
  356. package/dist/i18n/locales/ru.js.map +1 -1
  357. package/dist/i18n/locales/sq.d.ts +17 -2
  358. package/dist/i18n/locales/sq.d.ts.map +1 -1
  359. package/dist/i18n/locales/sq.js +20 -5
  360. package/dist/i18n/locales/sq.js.map +1 -1
  361. package/dist/i18n/locales/sv.d.ts +17 -2
  362. package/dist/i18n/locales/sv.d.ts.map +1 -1
  363. package/dist/i18n/locales/sv.js +20 -5
  364. package/dist/i18n/locales/sv.js.map +1 -1
  365. package/dist/i18n/locales/tr.d.ts +17 -2
  366. package/dist/i18n/locales/tr.d.ts.map +1 -1
  367. package/dist/i18n/locales/tr.js +20 -5
  368. package/dist/i18n/locales/tr.js.map +1 -1
  369. package/dist/i18n/locales/zh.d.ts +17 -2
  370. package/dist/i18n/locales/zh.d.ts.map +1 -1
  371. package/dist/i18n/locales/zh.js +20 -5
  372. package/dist/i18n/locales/zh.js.map +1 -1
  373. package/dist/index.js +207 -206
  374. package/dist/locales/ar.json +20 -5
  375. package/dist/locales/de.json +20 -5
  376. package/dist/locales/el.json +20 -5
  377. package/dist/locales/en.json +20 -5
  378. package/dist/locales/es.json +20 -5
  379. package/dist/locales/fr.json +20 -5
  380. package/dist/locales/hi.json +20 -5
  381. package/dist/locales/it.json +20 -5
  382. package/dist/locales/ja.json +20 -5
  383. package/dist/locales/nl.json +20 -5
  384. package/dist/locales/pl.json +20 -5
  385. package/dist/locales/pt.json +20 -5
  386. package/dist/locales/ro.json +20 -5
  387. package/dist/locales/ru.json +20 -5
  388. package/dist/locales/sq.json +20 -5
  389. package/dist/locales/sv.json +20 -5
  390. package/dist/locales/tr.json +20 -5
  391. package/dist/locales/zh.json +20 -5
  392. package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts +10 -13
  393. package/dist/patterns/alia-assistant/alia-asteroid-icon.d.ts.map +1 -1
  394. package/dist/patterns/alia-assistant/alia-chat-surface.d.ts.map +1 -1
  395. package/dist/patterns/alia-assistant/alia-popout.d.ts +5 -3
  396. package/dist/patterns/alia-assistant/alia-popout.d.ts.map +1 -1
  397. package/dist/patterns/alia-assistant/index.d.ts +2 -0
  398. package/dist/patterns/alia-assistant/index.d.ts.map +1 -1
  399. package/dist/patterns/alia-assistant/index.js +6 -5
  400. package/dist/patterns/anamnesis/index.js +1 -1
  401. package/dist/patterns/calendar/index.js +1 -1
  402. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +2 -2
  403. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
  404. package/dist/patterns/help-me-write-templates/index.js +1 -1
  405. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  406. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +7 -2
  407. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts.map +1 -1
  408. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  409. package/dist/patterns/registration-form/index.js +1 -1
  410. package/dist/patterns/signature-request/index.js +1 -1
  411. package/dist/patterns/signed-out-frame/index.js +1 -1
  412. package/dist/tokens.css +13 -2
  413. package/package.json +1 -1
  414. package/dist/_chunks/ai-permission-notice-5vpblPCx.js +0 -171
  415. package/dist/_chunks/ai-permission-notice-5vpblPCx.js.map +0 -1
  416. package/dist/_chunks/alia-sidebar-DS0b54Mv.js +0 -1183
  417. package/dist/_chunks/alia-sidebar-DS0b54Mv.js.map +0 -1
  418. package/dist/_chunks/breadcrumb-xgVpPH2H.js.map +0 -1
  419. package/dist/_chunks/chart-C2RBJERE.js +0 -705
  420. package/dist/_chunks/chart-C2RBJERE.js.map +0 -1
  421. package/dist/_chunks/color-picker-BRQ4Y9SO.js.map +0 -1
  422. package/dist/_chunks/dashboard-grid-SAGoyCtL.js +0 -691
  423. package/dist/_chunks/dashboard-grid-SAGoyCtL.js.map +0 -1
  424. package/dist/_chunks/date-picker-wRAcq2lt.js.map +0 -1
  425. package/dist/_chunks/date-range-picker-BOvHwWO5.js.map +0 -1
  426. package/dist/_chunks/date-time-picker-CLeLKuv9.js.map +0 -1
  427. package/dist/_chunks/dependent-selector-Bet3XAFj.js.map +0 -1
  428. package/dist/_chunks/dialog-D52AI4nF.js.map +0 -1
  429. package/dist/_chunks/freemium-paywall-B6ojVXq7.js.map +0 -1
  430. package/dist/_chunks/help-me-write-templates-B7L3zGsE.js.map +0 -1
  431. package/dist/_chunks/hover-card-BnTueNS2.js.map +0 -1
  432. package/dist/_chunks/key-value-pair-Ax8IJr1M.js.map +0 -1
  433. package/dist/_chunks/link-2HokYuIi.js +0 -130
  434. package/dist/_chunks/link-2HokYuIi.js.map +0 -1
  435. package/dist/_chunks/marketplace-app-shell-Dcx-JEjg.js.map +0 -1
  436. package/dist/_chunks/message-tray-BB95DA82.js.map +0 -1
  437. package/dist/_chunks/notification-tray-__sJXnsz.js.map +0 -1
  438. package/dist/_chunks/pdf-viewer-C3minW5b.js.map +0 -1
  439. package/dist/_chunks/phone-input-DxkHMYmu.js.map +0 -1
  440. package/dist/_chunks/popover-BI3oV3eY.js +0 -305
  441. package/dist/_chunks/popover-BI3oV3eY.js.map +0 -1
  442. package/dist/_chunks/position-grid-D2D5_Tze.js.map +0 -1
  443. package/dist/_chunks/product-hub-panel-BSSiGGG4.js.map +0 -1
  444. package/dist/_chunks/radio-group-BT97ty7o.js.map +0 -1
  445. package/dist/_chunks/rich-text-editor-Blp4smUr.js.map +0 -1
  446. package/dist/_chunks/sheet-CNFW8mYZ.js.map +0 -1
  447. package/dist/_chunks/stat-51CDL4au.js.map +0 -1
  448. package/dist/_chunks/stepper-accordion-D7lnBGh2.js.map +0 -1
@@ -5,7 +5,7 @@ import { useTranslation as J } from "react-i18next";
5
5
  import { u as Q } from "./registry-DvAUVLHh.js";
6
6
  import { F as S } from "./form-field-Ani72sVY.js";
7
7
  import { N as P } from "./number-input-CVwI1ltI.js";
8
- import { D as G } from "./date-time-picker-CLeLKuv9.js";
8
+ import { D as G } from "./date-time-picker-CjxTkblD.js";
9
9
  import { C as B } from "./card-DMO2nkt4.js";
10
10
  import { B as X } from "./badge-hnBt8o7n.js";
11
11
  import { I as ee } from "./insert-result-C1C2OCc3.js";
@@ -309,4 +309,4 @@ export {
309
309
  re as M,
310
310
  oe as a
311
311
  };
312
- //# sourceMappingURL=hcg-doubling-BIYyI2Yo.js.map
312
+ //# sourceMappingURL=hcg-doubling-Ccvh7OaU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hcg-doubling-BIYyI2Yo.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). */\n/* A 35% rise is a conservative threshold when assessing a potentially */\n/* viable early pregnancy, interpreted alongside ultrasound and the */\n/* clinical picture. Seeber et al. Fertil Steril 2006;86:454-9. */\n/* https://pubmed.ncbi.nlm.nih.gov/16753158/ */\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 conservative Seeber 48-hour rise threshold. */\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('ui');\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,G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ACT,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-Ccvh7OaU.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). */\n/* A 35% rise is a conservative threshold when assessing a potentially */\n/* viable early pregnancy, interpreted alongside ultrasound and the */\n/* clinical picture. Seeber et al. Fertil Steril 2006;86:454-9. */\n/* https://pubmed.ncbi.nlm.nih.gov/16753158/ */\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 conservative Seeber 48-hour rise threshold. */\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('ui');\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,GAAI,CAAC,GAC1Cc,IAASP,EAAgBP,EAAM,WAAU,GAAI,CAAC,GAC9Ce,IAASR,EAAgBP,EAAM,WAAU,GAAI,CAAC,GAG9CgB,IAAYd,MAAW,KAAK,KAAK,KAGjCe,IAAO,CAACJ,GAAMC,GAAQC,CAAM,EAAE,KAAKV,CAAa;AAGtD,IAAAH,IAAS,GAAGA,CAAM,GAAGc,CAAS,GAAGC,CAAI,GAAGd,C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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]}
@@ -4,7 +4,7 @@ import { c as K } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as T } from "react-i18next";
5
5
  import { I as _ } from "./icon-button-COX76Jdj.js";
6
6
  import { D as n } from "./dropdown-menu-BQSNVp4x.js";
7
- import { u as H, c as g, L as O, a as j } from "./locale-picker-DfNSdOpy.js";
7
+ import { u as H, c as g, L as O, a as j } from "./locale-picker-BGfrZyTw.js";
8
8
  import { u as N } from "./use-locale-BExNy9Dl.js";
9
9
  import { u as x } from "./use-theme-CAuo6EYT.js";
10
10
  import { u as D } from "./registry-DvAUVLHh.js";
@@ -302,4 +302,4 @@ B.displayName = "HeaderSettings";
302
302
  export {
303
303
  B as H
304
304
  };
305
- //# sourceMappingURL=header-settings-ge_3gYEq.js.map
305
+ //# sourceMappingURL=header-settings-BMcCx2LC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"header-settings-ge_3gYEq.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n 'Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.',\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n type FocusEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Settings } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport {\n LocalePicker,\n LOCALE_STORAGE_KEY,\n useInitialLocale,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\n\nfunction safeWriteStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* Storage can throw in private mode — silent-fail per use-theme.ts. */\n }\n}\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\n// The language flyout hosts the searchable locale list, so it takes a\n// popover width rather than the menu's minimum.\nconst languageFlyoutClasses = 'ds:w-[var(--popover-size-md)]';\n\nfunction isLocale(tag: string): tag is Locale {\n return Object.prototype.hasOwnProperty.call(LOCALE_META, tag);\n}\n\n/* ------------------------------------------------------------------ */\n/* LanguageSub */\n/* */\n/* One menu row naming the setting and showing the current language */\n/* (\"Language · English ›\"), laid out like DropdownMenu.ChoiceSub. It */\n/* opens a flyout beside the menu holding LocalePicker.SearchList, so */\n/* the 18 locales stay searchable. The flyout is a dialog, not a menu: */\n/* it holds a search combobox and a listbox, which a menu may not own. */\n/* ------------------------------------------------------------------ */\n\nfunction LanguageSub({ locale }: { locale: string }) {\n const { t } = useTranslation('ui');\n const current = LOCALE_META[isLocale(locale) ? locale : 'en'];\n\n // Radix focuses the flyout itself when a keyboard user opens it. Hand\n // that focus on to the search field so typing filters at once.\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n event.currentTarget\n .querySelector<HTMLInputElement>('input')\n ?.focus({ preventScroll: true });\n };\n\n // The flyout closes on the \"back\" arrow (ArrowLeft, or ArrowRight in\n // RTL). Inside the search field that key moves the caret instead,\n // unless the caret is already at the start of the field. Capture\n // phase, so Radix's own handler on the flyout never sees the key.\n const handleKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) return;\n // Keys pressed while an IME is composing (Japanese, Chinese) belong to\n // the composition, never to the menu.\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n if (target.selectionStart !== 0 || target.selectionEnd !== 0) {\n event.stopPropagation();\n }\n };\n\n return (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger aria-haspopup=\"dialog\" data-value={current.code}>\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:truncate\">\n {t('navigation.headerSettings.language.label')}\n </span>\n <span\n lang={current.code}\n className=\"ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:[[data-highlighted]_&]:text-current\"\n >\n {current.nativeName}\n </span>\n </span>\n </DropdownMenu.SubTrigger>\n {/* Radix renders a `menu`; override to `dialog` and drop the\n menu-only `aria-orientation`, which a dialog may not carry. */}\n <DropdownMenu.SubContent\n role=\"dialog\"\n aria-orientation={undefined}\n className={languageFlyoutClasses}\n onFocus={handleFocus}\n onKeyDownCapture={handleKeyDownCapture}\n // Escape that cancels an IME conversion must not close the menu.\n onEscapeKeyDown={(escapeEvent) => {\n if (escapeEvent.isComposing) escapeEvent.preventDefault();\n }}\n >\n <LocalePicker.SearchList />\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. Defaults to `md` to preserve the existing visual.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row — keeps the visual rhythm consistent.\n *\n * The menu itself (language, appearance and accessible-mode rows)\n * stays at kit defaults regardless — this prop only sizes the\n * trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface, laid out as a View */\n/* menu: a Language row whose flyout holds the searchable locale list, */\n/* an Appearance ChoiceSub (light / dark / system) and an Accessible */\n/* mode SwitchItem. Every row reads and writes the same hooks */\n/* (`useLocale`, `useTheme`) as the standalone components, so there is */\n/* no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation('ui');\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n // The language search only mounts with its flyout, so apply the saved\n // (or browser) language here, on mount.\n useInitialLocale();\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Inlined here (rather than exported from locale-picker) because\n // it's three small calls; the LocalePicker.SearchList component\n // continues to own its own copy for inline use, and both apply\n // the same persistence key (`alfadocs-ui.locale`) so a write from\n // either path is visible to the other on next mount.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n safeWriteStorage(LOCALE_STORAGE_KEY, next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n setLocaleRef.current(next as Locale);\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align={align}>\n <LanguageSub locale={locale} />\n <DropdownMenu.Separator />\n <DropdownMenu.ChoiceSub\n label={t('navigation.headerSettings.appearance.label')}\n value={theme.theme}\n onValueChange={theme.setTheme}\n options={[\n {\n value: 'light',\n label: t('navigation.headerSettings.appearance.light'),\n },\n {\n value: 'dark',\n label: t('navigation.headerSettings.appearance.dark'),\n },\n {\n value: 'system',\n label: t('navigation.headerSettings.appearance.system'),\n },\n ]}\n />\n {/* Writes through useTheme, so the document gets the\n `theme-accessible` class at once (including the Lexend\n swap for Latin scripts, see src/tokens/index.css). */}\n <DropdownMenu.SwitchItem\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n >\n {t('navigation.headerSettings.appearance.accessible')}\n </DropdownMenu.SwitchItem>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","safeWriteStorage","key","value","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","languageFlyoutClasses","isLocale","tag","LanguageSub","t","useTranslation","current","handleFocus","event","_a","handleKeyDownCapture","target","jsxs","DropdownMenu","jsx","escapeEvent","LocalePicker","HeaderSettings","forwardRef","props","ref","align","size","disabled","className","id","rest","theme","useTheme","setLocaleI18n","useLocale","useInitialLocale","forwardedRef","useRef","useImperativeHandle","setLocaleWithPersistence","useCallback","next","LOCALE_STORAGE_KEY","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","useAgentRegistration","accessibleChecked","IconButton","Settings"],"mappings":";;;;;;;;;;;AAOO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,IAE5C,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,EAC5C;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,QAAQ;AAAA,MAAA;AAAA,MAErB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ;AAAA,QACN;AAAA,MAAA;AAAA,MAEF,UAAU,CAAC,EA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,SAAO,IAC3B,UAAA,gBAAAC;AAAA,YAACgC;AAAA,YAAA;AAAA,cACC,MAAAxB;AAAA,cACA,UAAAC;AAAA,cACA,MAAM,gBAAAT,EAACiC,GAAA,EAAS,eAAW,GAAA,CAAC;AAAA,cAC5B,cAAY3C,EAAE,mCAAmC;AAAA,YAAA;AAAA,UAAA,GAErD;AAAA,UACA,gBAAAQ,EAACC,EAAa,SAAb,EAAqB,OAAAQ,GACpB,UAAA;AAAA,YAAA,gBAAAP,EAACX,KAAY,QAAAR,GAAgB;AAAA,YAC7B,gBAAAmB,EAACD,EAAa,WAAb,EAAuB;AAAA,YACxB,gBAAAC;AAAA,cAACD,EAAa;AAAA,cAAb;AAAA,gBACC,OAAOT,EAAE,4CAA4C;AAAA,gBACrD,OAAOuB,EAAM;AAAA,gBACb,eAAeA,EAAM;AAAA,gBACrB,SAAS;AAAA,kBACP;AAAA,oBACE,OAAO;AAAA,oBACP,OAAOvB,EAAE,4CAA4C;AAAA,kBAAA;AAAA,kBAEvD;AAAA,oBACE,OAAO;AAAA,oBACP,OAAOA,EAAE,2CAA2C;AAAA,kBAAA;AAAA,kBAEtD;AAAA,oBACE,OAAO;AAAA,oBACP,OAAOA,EAAE,6CAA6C;AAAA,kBAAA;AAAA,gBACxD;AAAA,cACF;AAAA,YAAA;AAAA,YAKF,gBAAAU;AAAA,cAACD,EAAa;AAAA,cAAb;AAAA,gBACC,SAASgC;AAAA,gBACT,iBAAiB,CAACR,MAChBV,EAAM,iBAAiBU,IAAO,eAAe,SAAS;AAAA,gBAGvD,YAAE,iDAAiD;AAAA,cAAA;AAAA,YAAA;AAAA,UACtD,EAAA,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEApB,EAAe,cAAc;"}
1
+ {"version":3,"file":"header-settings-BMcCx2LC.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Read after `set_locale` to confirm the switch landed — an unknown tag is silently dropped and leaves this unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n 'Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.',\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n type FocusEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Settings } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport {\n LocalePicker,\n LOCALE_STORAGE_KEY,\n useInitialLocale,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\n\nfunction safeWriteStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* Storage can throw in private mode — silent-fail per use-theme.ts. */\n }\n}\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\n// The language flyout hosts the searchable locale list, so it takes a\n// popover width rather than the menu's minimum.\nconst languageFlyoutClasses = 'ds:w-[var(--popover-size-md)]';\n\nfunction isLocale(tag: string): tag is Locale {\n return Object.prototype.hasOwnProperty.call(LOCALE_META, tag);\n}\n\n/* ------------------------------------------------------------------ */\n/* LanguageSub */\n/* */\n/* One menu row naming the setting and showing the current language */\n/* (\"Language · English ›\"), laid out like DropdownMenu.ChoiceSub. It */\n/* opens a flyout beside the menu holding LocalePicker.SearchList, so */\n/* the 18 locales stay searchable. The flyout is a dialog, not a menu: */\n/* it holds a search combobox and a listbox, which a menu may not own. */\n/* ------------------------------------------------------------------ */\n\nfunction LanguageSub({ locale }: { locale: string }) {\n const { t } = useTranslation('ui');\n const current = LOCALE_META[isLocale(locale) ? locale : 'en'];\n\n // Radix focuses the flyout itself when a keyboard user opens it. Hand\n // that focus on to the search field so typing filters at once.\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n event.currentTarget\n .querySelector<HTMLInputElement>('input')\n ?.focus({ preventScroll: true });\n };\n\n // The flyout closes on the \"back\" arrow (ArrowLeft, or ArrowRight in\n // RTL). Inside the search field that key moves the caret instead,\n // unless the caret is already at the start of the field. Capture\n // phase, so Radix's own handler on the flyout never sees the key.\n const handleKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) return;\n // Keys pressed while an IME is composing (Japanese, Chinese) belong to\n // the composition, never to the menu.\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n if (target.selectionStart !== 0 || target.selectionEnd !== 0) {\n event.stopPropagation();\n }\n };\n\n return (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger aria-haspopup=\"dialog\" data-value={current.code}>\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:truncate\">\n {t('navigation.headerSettings.language.label')}\n </span>\n <span\n lang={current.code}\n className=\"ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:[[data-highlighted]_&]:text-current\"\n >\n {current.nativeName}\n </span>\n </span>\n </DropdownMenu.SubTrigger>\n {/* Radix renders a `menu`; override to `dialog` and drop the\n menu-only `aria-orientation`, which a dialog may not carry. */}\n <DropdownMenu.SubContent\n role=\"dialog\"\n aria-orientation={undefined}\n className={languageFlyoutClasses}\n onFocus={handleFocus}\n onKeyDownCapture={handleKeyDownCapture}\n // Escape that cancels an IME conversion must not close the menu.\n onEscapeKeyDown={(escapeEvent) => {\n if (escapeEvent.isComposing) escapeEvent.preventDefault();\n }}\n >\n <LocalePicker.SearchList />\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. Defaults to `md` to preserve the existing visual.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row — keeps the visual rhythm consistent.\n *\n * The menu itself (language, appearance and accessible-mode rows)\n * stays at kit defaults regardless — this prop only sizes the\n * trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface, laid out as a View */\n/* menu: a Language row whose flyout holds the searchable locale list, */\n/* an Appearance ChoiceSub (light / dark / system) and an Accessible */\n/* mode SwitchItem. Every row reads and writes the same hooks */\n/* (`useLocale`, `useTheme`) as the standalone components, so there is */\n/* no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation('ui');\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n // The language search only mounts with its flyout, so apply the saved\n // (or browser) language here, on mount.\n useInitialLocale();\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Inlined here (rather than exported from locale-picker) because\n // it's three small calls; the LocalePicker.SearchList component\n // continues to own its own copy for inline use, and both apply\n // the same persistence key (`alfadocs-ui.locale`) so a write from\n // either path is visible to the other on next mount.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n safeWriteStorage(LOCALE_STORAGE_KEY, next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n setLocaleRef.current(next as Locale);\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align={align}>\n <LanguageSub locale={locale} />\n <DropdownMenu.Separator />\n <DropdownMenu.ChoiceSub\n label={t('navigation.headerSettings.appearance.label')}\n value={theme.theme}\n onValueChange={theme.setTheme}\n options={[\n {\n value: 'light',\n label: t('navigation.headerSettings.appearance.light'),\n },\n {\n value: 'dark',\n label: t('navigation.headerSettings.appearance.dark'),\n },\n {\n value: 'system',\n label: t('navigation.headerSettings.appearance.system'),\n },\n ]}\n />\n {/* Writes through useTheme, so the document gets the\n `theme-accessible` class at once (including the Lexend\n swap for Latin scripts, see src/tokens/index.css). */}\n <DropdownMenu.SwitchItem\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n >\n {t('navigation.headerSettings.appearance.accessible')}\n </DropdownMenu.SwitchItem>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","safeWriteStorage","key","value","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","languageFlyoutClasses","isLocale","tag","LanguageSub","t","useTranslation","current","handleFocus","event","_a","handleKeyDownCapture","target","jsxs","DropdownMenu","jsx","escapeEvent","LocalePicker","HeaderSettings","forwardRef","props","ref","align","size","disabled","className","id","rest","theme","useTheme","setLocaleI18n","useLocale","useInitialLocale","forwardedRef","useRef","useImperativeHandle","setLocaleWithPersistence","useCallback","next","LOCALE_STORAGE_KEY","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","useAgentRegistration","accessibleChecked","IconButton","Settings"],"mappings":";;;;;;;;;;;AAOO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,IAE5C,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;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AA,YAAA;AAAA,YAKF,gBAAAU;AAAA,cAACD,EAAa;AAAA,cAAb;AAAA,gBACC,SAASgC;AAAA,gBACT,iBAAiB,CAACR,MAChBV,EAAM,iBAAiBU,IAAO,eAAe,SAAS;AAAA,gBAGvD,YAAE,iDAAiD;AAAA,cAAA;AAAA,YAAA;AAAA,UACtD,EAAA,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEApB,EAAe,cAAc;"}
@@ -2036,7 +2036,7 @@ const ea = fa(
2036
2036
  }
2037
2037
  );
2038
2038
  ea.displayName = "HeatmapLegend";
2039
- const ta = () => import("./data-table-C6T31E33.js").then((e) => e.h).then((e) => ({
2039
+ const ta = () => import("./data-table-fAMTeAjM.js").then((e) => e.h).then((e) => ({
2040
2040
  default: e.DataTable
2041
2041
  })), Mr = va(ta);
2042
2042
  function ha() {
@@ -2862,4 +2862,4 @@ export {
2862
2862
  Na as b,
2863
2863
  Ya as h
2864
2864
  };
2865
- //# sourceMappingURL=heatmap-BARGZZt2.js.map
2865
+ //# sourceMappingURL=heatmap-BEeOThkW.js.map