@alfadocs/ui-kit-debug 1.6.0 → 1.6.1

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 (306) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js → actions-cell-renderer-ALEAGO3j.js} +6 -6
  2. package/dist/_chunks/{actions-cell-renderer-BD-jruqA.js.map → actions-cell-renderer-ALEAGO3j.js.map} +1 -1
  3. package/dist/_chunks/{agenda-tray-CYR-znfE.js → agenda-tray-BweO8pDo.js} +3 -3
  4. package/dist/_chunks/{agenda-tray-CYR-znfE.js.map → agenda-tray-BweO8pDo.js.map} +1 -1
  5. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js → ai-consent-banner-OggpS5hW.js} +2 -2
  6. package/dist/_chunks/{ai-consent-banner-DLF6FNXv.js.map → ai-consent-banner-OggpS5hW.js.map} +1 -1
  7. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js → ai-prompt-input-DnbfEJnr.js} +2 -2
  8. package/dist/_chunks/{ai-prompt-input-BgAubYKd.js.map → ai-prompt-input-DnbfEJnr.js.map} +1 -1
  9. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js → alia-sidebar-BWcWZivN.js} +7 -7
  10. package/dist/_chunks/{alia-sidebar-Bg53-ZOT.js.map → alia-sidebar-BWcWZivN.js.map} +1 -1
  11. package/dist/_chunks/{anamnesis-card-BylMLHYj.js → anamnesis-card-NTi4LLzI.js} +2 -2
  12. package/dist/_chunks/{anamnesis-card-BylMLHYj.js.map → anamnesis-card-NTi4LLzI.js.map} +1 -1
  13. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js → anamnesis-summary-rows-F-cCmFAn.js} +7 -7
  14. package/dist/_chunks/{anamnesis-summary-rows-BpYztFUv.js.map → anamnesis-summary-rows-F-cCmFAn.js.map} +1 -1
  15. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js → appointment-timeline-CMPvzlGZ.js} +4 -4
  16. package/dist/_chunks/{appointment-timeline-DT1uFp8z.js.map → appointment-timeline-CMPvzlGZ.js.map} +1 -1
  17. package/dist/_chunks/{appointment-tray-DvyVK7um.js → appointment-tray-3c_FLxXJ.js} +3 -3
  18. package/dist/_chunks/{appointment-tray-DvyVK7um.js.map → appointment-tray-3c_FLxXJ.js.map} +1 -1
  19. package/dist/_chunks/{audio-recorder-nVRN4PSK.js → audio-recorder-EWBCNIsd.js} +3 -3
  20. package/dist/_chunks/{audio-recorder-nVRN4PSK.js.map → audio-recorder-EWBCNIsd.js.map} +1 -1
  21. package/dist/_chunks/{bishop-score-BV1JAEMV.js → bishop-score-Cnu0xs-z.js} +2 -2
  22. package/dist/_chunks/{bishop-score-BV1JAEMV.js.map → bishop-score-Cnu0xs-z.js.map} +1 -1
  23. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js → bmi-calculator-CcH6upht.js} +2 -2
  24. package/dist/_chunks/{bmi-calculator-CdR-RLFj.js.map → bmi-calculator-CcH6upht.js.map} +1 -1
  25. package/dist/_chunks/{booking-D84O6H2X.js → booking-CQMJUFG-.js} +5 -5
  26. package/dist/_chunks/{booking-D84O6H2X.js.map → booking-CQMJUFG-.js.map} +1 -1
  27. package/dist/_chunks/{button-group-Be_In68J.js → button-group-CaxRJsNG.js} +2 -2
  28. package/dist/_chunks/{button-group-Be_In68J.js.map → button-group-CaxRJsNG.js.map} +1 -1
  29. package/dist/_chunks/{button-BvNtqHAS.js → button-nJaPh_HC.js} +68 -38
  30. package/dist/_chunks/button-nJaPh_HC.js.map +1 -0
  31. package/dist/_chunks/{care-plan-card-CehAU7F_.js → care-plan-card-DQjVRDxO.js} +2 -2
  32. package/dist/_chunks/{care-plan-card-CehAU7F_.js.map → care-plan-card-DQjVRDxO.js.map} +1 -1
  33. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js → care-plan-entry-card-CMpoeNkb.js} +2 -2
  34. package/dist/_chunks/{care-plan-entry-card-ChWRMfMw.js.map → care-plan-entry-card-CMpoeNkb.js.map} +1 -1
  35. package/dist/_chunks/{care-plan-header-_B0TTWT1.js → care-plan-header-CxYoq23f.js} +2 -2
  36. package/dist/_chunks/{care-plan-header-_B0TTWT1.js.map → care-plan-header-CxYoq23f.js.map} +1 -1
  37. package/dist/_chunks/{carousel.agent-pjORsMS8.js → carousel.agent-CLxdHEBP.js} +2 -2
  38. package/dist/_chunks/{carousel.agent-pjORsMS8.js.map → carousel.agent-CLxdHEBP.js.map} +1 -1
  39. package/dist/_chunks/{chart-Y-gso_Uz.js → chart-Bkr1Sh4o.js} +3 -3
  40. package/dist/_chunks/{chart-Y-gso_Uz.js.map → chart-Bkr1Sh4o.js.map} +1 -1
  41. package/dist/_chunks/{chat-input-BqI9GXQh.js → chat-input-BsB5Umpj.js} +2 -2
  42. package/dist/_chunks/{chat-input-BqI9GXQh.js.map → chat-input-BsB5Umpj.js.map} +1 -1
  43. package/dist/_chunks/{chat-message-DHNUbjXA.js → chat-message-DBQu10rs.js} +3 -3
  44. package/dist/_chunks/{chat-message-DHNUbjXA.js.map → chat-message-DBQu10rs.js.map} +1 -1
  45. package/dist/_chunks/{code-block-BONe9fJi.js → code-block-BIkpRLkl.js} +2 -2
  46. package/dist/_chunks/{code-block-BONe9fJi.js.map → code-block-BIkpRLkl.js.map} +1 -1
  47. package/dist/_chunks/{connection-status-NT8hUtYl.js → connection-status-DRZIcMqM.js} +3 -3
  48. package/dist/_chunks/{connection-status-NT8hUtYl.js.map → connection-status-DRZIcMqM.js.map} +1 -1
  49. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js → contact-profile-card-CE9OJKcl.js} +2 -2
  50. package/dist/_chunks/{contact-profile-card-BxHiG8e6.js.map → contact-profile-card-CE9OJKcl.js.map} +1 -1
  51. package/dist/_chunks/{control-room-rail-DDyPDBji.js → control-room-rail-IH1eBjrK.js} +3 -3
  52. package/dist/_chunks/{control-room-rail-DDyPDBji.js.map → control-room-rail-IH1eBjrK.js.map} +1 -1
  53. package/dist/_chunks/{copy-field-B-DoMBH_.js → copy-field-fYKpl6aN.js} +2 -2
  54. package/dist/_chunks/{copy-field-B-DoMBH_.js.map → copy-field-fYKpl6aN.js.map} +1 -1
  55. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js → cycle-calculator-DzgO1vzP.js} +2 -2
  56. package/dist/_chunks/{cycle-calculator-DJZYvNhw.js.map → cycle-calculator-DzgO1vzP.js.map} +1 -1
  57. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js → dashboard-grid-BFtdHqfn.js} +2 -2
  58. package/dist/_chunks/{dashboard-grid-bd0QW2a8.js.map → dashboard-grid-BFtdHqfn.js.map} +1 -1
  59. package/dist/_chunks/{data-table-tabs-C8uDThT3.js → data-table-tabs-C1kRUzat.js} +3 -3
  60. package/dist/_chunks/{data-table-tabs-C8uDThT3.js.map → data-table-tabs-C1kRUzat.js.map} +1 -1
  61. package/dist/_chunks/{description-list-Ck7fKdt5.js → description-list-CjJqR8WK.js} +2 -2
  62. package/dist/_chunks/{description-list-Ck7fKdt5.js.map → description-list-CjJqR8WK.js.map} +1 -1
  63. package/dist/_chunks/{document-preview-Aae2yKvY.js → document-preview-oyx9RhCo.js} +2 -2
  64. package/dist/_chunks/{document-preview-Aae2yKvY.js.map → document-preview-oyx9RhCo.js.map} +1 -1
  65. package/dist/_chunks/{document-scanner-qNZLhH_r.js → document-scanner-C5Vrbu21.js} +2 -2
  66. package/dist/_chunks/{document-scanner-qNZLhH_r.js.map → document-scanner-C5Vrbu21.js.map} +1 -1
  67. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js → due-date-calculator-wK8Tajzz.js} +2 -2
  68. package/dist/_chunks/{due-date-calculator-ajaQ4ya5.js.map → due-date-calculator-wK8Tajzz.js.map} +1 -1
  69. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js → editable-currency-cell-renderer-DYdzKpjL.js} +3 -3
  70. package/dist/_chunks/{editable-currency-cell-renderer-DyMbSyDK.js.map → editable-currency-cell-renderer-DYdzKpjL.js.map} +1 -1
  71. package/dist/_chunks/{editor-overlay-DE-gxj9L.js → editor-overlay-DEc5yYwo.js} +2 -2
  72. package/dist/_chunks/{editor-overlay-DE-gxj9L.js.map → editor-overlay-DEc5yYwo.js.map} +1 -1
  73. package/dist/_chunks/{empty-state-Df0tM6Kn.js → empty-state-X0sVPfVo.js} +2 -2
  74. package/dist/_chunks/{empty-state-Df0tM6Kn.js.map → empty-state-X0sVPfVo.js.map} +1 -1
  75. package/dist/_chunks/{entity-summary-DBOI5di6.js → entity-summary-B_vO5Ur4.js} +3 -3
  76. package/dist/_chunks/{entity-summary-DBOI5di6.js.map → entity-summary-B_vO5Ur4.js.map} +1 -1
  77. package/dist/_chunks/{face-scheme-D7Pub04e.js → face-scheme-BfDi4YkW.js} +5 -5
  78. package/dist/_chunks/{face-scheme-D7Pub04e.js.map → face-scheme-BfDi4YkW.js.map} +1 -1
  79. package/dist/_chunks/{fetal-weight-jon6GIfQ.js → fetal-weight-Dqy0T1fP.js} +2 -2
  80. package/dist/_chunks/{fetal-weight-jon6GIfQ.js.map → fetal-weight-Dqy0T1fP.js.map} +1 -1
  81. package/dist/_chunks/{field-array-BQFX5OYi.js → field-array-BjkXZzSr.js} +3 -3
  82. package/dist/_chunks/{field-array-BQFX5OYi.js.map → field-array-BjkXZzSr.js.map} +1 -1
  83. package/dist/_chunks/{field-value-BbiDRyNh.js → field-value-DG8zaZvo.js} +4 -4
  84. package/dist/_chunks/{field-value-BbiDRyNh.js.map → field-value-DG8zaZvo.js.map} +1 -1
  85. package/dist/_chunks/{file-manager-CML_C6_h.js → file-manager-Cc_upjZX.js} +6 -6
  86. package/dist/_chunks/{file-manager-CML_C6_h.js.map → file-manager-Cc_upjZX.js.map} +1 -1
  87. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js → finished-terminal-Br61Ip4e.js} +2 -2
  88. package/dist/_chunks/{finished-terminal-BWNVh7Y8.js.map → finished-terminal-Br61Ip4e.js.map} +1 -1
  89. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js → fiscal-code-input-B_nYMSEM.js} +2 -2
  90. package/dist/_chunks/{fiscal-code-input-Nx1N9r72.js.map → fiscal-code-input-B_nYMSEM.js.map} +1 -1
  91. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js → freemium-paywall-DrXzYfv-.js} +2 -2
  92. package/dist/_chunks/{freemium-paywall-HG3pFvMp.js.map → freemium-paywall-DrXzYfv-.js.map} +1 -1
  93. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js → gestational-age-calculator-C_uDAeP_.js} +2 -2
  94. package/dist/_chunks/{gestational-age-calculator-dEpQDWcb.js.map → gestational-age-calculator-C_uDAeP_.js.map} +1 -1
  95. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js → hcg-doubling-BaXkJhT-.js} +2 -2
  96. package/dist/_chunks/{hcg-doubling-CC6TLtHd.js.map → hcg-doubling-BaXkJhT-.js.map} +1 -1
  97. package/dist/_chunks/{header-CimZS-J9.js → header-DUXRIPyM.js} +2 -2
  98. package/dist/_chunks/{header-CimZS-J9.js.map → header-DUXRIPyM.js.map} +1 -1
  99. package/dist/_chunks/{header-settings-C0zHLXJE.js → header-settings-CVC_davE.js} +4 -4
  100. package/dist/_chunks/{header-settings-C0zHLXJE.js.map → header-settings-CVC_davE.js.map} +1 -1
  101. package/dist/_chunks/{icon-button-9c9Gp41m.js → icon-button-DA2CAGHZ.js} +2 -2
  102. package/dist/_chunks/{icon-button-9c9Gp41m.js.map → icon-button-DA2CAGHZ.js.map} +1 -1
  103. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js → icon-button-group-D6SVMteH.js} +2 -2
  104. package/dist/_chunks/{icon-button-group-DrvuWPGJ.js.map → icon-button-group-D6SVMteH.js.map} +1 -1
  105. package/dist/_chunks/{icon-picker-DXV3sDp1.js → icon-picker-ChzpCnZ-.js} +3 -3
  106. package/dist/_chunks/{icon-picker-DXV3sDp1.js.map → icon-picker-ChzpCnZ-.js.map} +1 -1
  107. package/dist/_chunks/{image-cropper-DWSnyLwW.js → image-cropper-C84NDTB7.js} +2 -2
  108. package/dist/_chunks/{image-cropper-DWSnyLwW.js.map → image-cropper-C84NDTB7.js.map} +1 -1
  109. package/dist/_chunks/{info-tip-C4mPSJbS.js → info-tip-C119cwQl.js} +2 -2
  110. package/dist/_chunks/{info-tip-C4mPSJbS.js.map → info-tip-C119cwQl.js.map} +1 -1
  111. package/dist/_chunks/{insert-result-98J1QEp7.js → insert-result-LCNTskNJ.js} +2 -2
  112. package/dist/_chunks/{insert-result-98J1QEp7.js.map → insert-result-LCNTskNJ.js.map} +1 -1
  113. package/dist/_chunks/{key-value-pair-DGkGlgCF.js → key-value-pair-BubG4fUa.js} +2 -2
  114. package/dist/_chunks/{key-value-pair-DGkGlgCF.js.map → key-value-pair-BubG4fUa.js.map} +1 -1
  115. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js → link-cell-renderer-DH4JYpKU.js} +2 -2
  116. package/dist/_chunks/{link-cell-renderer-D3IsW_2R.js.map → link-cell-renderer-DH4JYpKU.js.map} +1 -1
  117. package/dist/_chunks/{locale-picker-sI0HWgZy.js → locale-picker-BvbVjDQ-.js} +3 -3
  118. package/dist/_chunks/{locale-picker-sI0HWgZy.js.map → locale-picker-BvbVjDQ-.js.map} +1 -1
  119. package/dist/_chunks/{map-view-iwSDRW3t.js → map-view-CCAlC9IL.js} +2 -2
  120. package/dist/_chunks/{map-view-iwSDRW3t.js.map → map-view-CCAlC9IL.js.map} +1 -1
  121. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js → marketplace-app-shell-Chfdia7m.js} +4 -4
  122. package/dist/_chunks/{marketplace-app-shell-b5hN-Q0m.js.map → marketplace-app-shell-Chfdia7m.js.map} +1 -1
  123. package/dist/_chunks/{message-card-BCJ-Jgs6.js → message-card-D8GB4FdF.js} +3 -3
  124. package/dist/_chunks/{message-card-BCJ-Jgs6.js.map → message-card-D8GB4FdF.js.map} +1 -1
  125. package/dist/_chunks/{message-tray-DHtm_WaF.js → message-tray-CGIRQjx5.js} +4 -4
  126. package/dist/_chunks/{message-tray-DHtm_WaF.js.map → message-tray-CGIRQjx5.js.map} +1 -1
  127. package/dist/_chunks/{notes-panel-D6HKLLS-.js → notes-panel-DlnENphf.js} +3 -3
  128. package/dist/_chunks/{notes-panel-D6HKLLS-.js.map → notes-panel-DlnENphf.js.map} +1 -1
  129. package/dist/_chunks/{notification-card-CcMQn2RX.js → notification-card-CtrzoTUO.js} +3 -3
  130. package/dist/_chunks/{notification-card-CcMQn2RX.js.map → notification-card-CtrzoTUO.js.map} +1 -1
  131. package/dist/_chunks/{notification-tray-nr7dv-Q8.js → notification-tray-BiRzXHDf.js} +4 -4
  132. package/dist/_chunks/{notification-tray-nr7dv-Q8.js.map → notification-tray-BiRzXHDf.js.map} +1 -1
  133. package/dist/_chunks/{optical-prescription-DtzEqFQm.js → optical-prescription-Dj3Eh5Ok.js} +2 -2
  134. package/dist/_chunks/{optical-prescription-DtzEqFQm.js.map → optical-prescription-Dj3Eh5Ok.js.map} +1 -1
  135. package/dist/_chunks/{patient-details-rENrE_qY.js → patient-details-qnsqYBGQ.js} +5 -5
  136. package/dist/_chunks/{patient-details-rENrE_qY.js.map → patient-details-qnsqYBGQ.js.map} +1 -1
  137. package/dist/_chunks/{patient-search-NQemeJlL.js → patient-search-D5ufYoRc.js} +2 -2
  138. package/dist/_chunks/{patient-search-NQemeJlL.js.map → patient-search-D5ufYoRc.js.map} +1 -1
  139. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js → patient-summary-card-CBfuDvJ5.js} +3 -3
  140. package/dist/_chunks/{patient-summary-card-DQJgOOrA.js.map → patient-summary-card-CBfuDvJ5.js.map} +1 -1
  141. package/dist/_chunks/{patient-table-BubxfOWL.js → patient-table-DwshfVsQ.js} +3 -3
  142. package/dist/_chunks/{patient-table-BubxfOWL.js.map → patient-table-DwshfVsQ.js.map} +1 -1
  143. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js → payment-automation-upsell-BBIG7NFL.js} +2 -2
  144. package/dist/_chunks/{payment-automation-upsell-CnaBPt5e.js.map → payment-automation-upsell-BBIG7NFL.js.map} +1 -1
  145. package/dist/_chunks/{payment-request-card-CvhDzDNk.js → payment-request-card-BjjBMdsp.js} +3 -3
  146. package/dist/_chunks/{payment-request-card-CvhDzDNk.js.map → payment-request-card-BjjBMdsp.js.map} +1 -1
  147. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js → periodontal-chart-BatZEFar.js} +2 -2
  148. package/dist/_chunks/{periodontal-chart-C0nNQKKK.js.map → periodontal-chart-BatZEFar.js.map} +1 -1
  149. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js → periodontal-chart-card-BBpY_rBc.js} +2 -2
  150. package/dist/_chunks/{periodontal-chart-card-Bz-ebteE.js.map → periodontal-chart-card-BBpY_rBc.js.map} +1 -1
  151. package/dist/_chunks/{popover-Btj6N25H.js → popover-Cqcjx-Ny.js} +2 -2
  152. package/dist/_chunks/{popover-Btj6N25H.js.map → popover-Cqcjx-Ny.js.map} +1 -1
  153. package/dist/_chunks/{practice-results-CKoLD_x5.js → practice-results-F_Rf7c4H.js} +5 -5
  154. package/dist/_chunks/{practice-results-CKoLD_x5.js.map → practice-results-F_Rf7c4H.js.map} +1 -1
  155. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js → pregnancy-dating-BVS_9YU2.js} +2 -2
  156. package/dist/_chunks/{pregnancy-dating-DQVpFs_f.js.map → pregnancy-dating-BVS_9YU2.js.map} +1 -1
  157. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js → pregnancy-weight-gain-CJwbs9W-.js} +2 -2
  158. package/dist/_chunks/{pregnancy-weight-gain-hm3QJALe.js.map → pregnancy-weight-gain-CJwbs9W-.js.map} +1 -1
  159. package/dist/_chunks/{privacy-lock-SQYFRSuH.js → privacy-lock-CkAUo6Dz.js} +3 -3
  160. package/dist/_chunks/{privacy-lock-SQYFRSuH.js.map → privacy-lock-CkAUo6Dz.js.map} +1 -1
  161. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js → product-hub-panel-BScCotGD.js} +3 -3
  162. package/dist/_chunks/{product-hub-panel-BjnD9pdl.js.map → product-hub-panel-BScCotGD.js.map} +1 -1
  163. package/dist/_chunks/{public-header.agent-DseNK2NQ.js → public-header.agent-kth2SdXn.js} +3 -3
  164. package/dist/_chunks/{public-header.agent-DseNK2NQ.js.map → public-header.agent-kth2SdXn.js.map} +1 -1
  165. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js → radiograph-panel.agent-CiHwgISa.js} +4 -4
  166. package/dist/_chunks/{radiograph-panel.agent-CAXFgCyn.js.map → radiograph-panel.agent-CiHwgISa.js.map} +1 -1
  167. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js → reviews-panel-BKHEfqVQ.js} +4 -4
  168. package/dist/_chunks/{reviews-panel-Cd3SxJdW.js.map → reviews-panel-BKHEfqVQ.js.map} +1 -1
  169. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js → rich-text-editor-DARnq_6N.js} +5 -5
  170. package/dist/_chunks/{rich-text-editor-DGtn_4sb.js.map → rich-text-editor-DARnq_6N.js.map} +1 -1
  171. package/dist/_chunks/{session-countdown-q4r5TlCo.js → session-countdown-QMsnRa1x.js} +2 -2
  172. package/dist/_chunks/{session-countdown-q4r5TlCo.js.map → session-countdown-QMsnRa1x.js.map} +1 -1
  173. package/dist/_chunks/{sheet-CD99CdXr.js → sheet-BSznOyJs.js} +2 -2
  174. package/dist/_chunks/{sheet-CD99CdXr.js.map → sheet-BSznOyJs.js.map} +1 -1
  175. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js → sign-in-with-alfadocs-button-BLe_quy5.js} +2 -2
  176. package/dist/_chunks/{sign-in-with-alfadocs-button-_JxVRO5d.js.map → sign-in-with-alfadocs-button-BLe_quy5.js.map} +1 -1
  177. package/dist/_chunks/{signature-request-C4UBfVRZ.js → signature-request-DXhpphlp.js} +4 -4
  178. package/dist/_chunks/{signature-request-C4UBfVRZ.js.map → signature-request-DXhpphlp.js.map} +1 -1
  179. package/dist/_chunks/{slot-grid-P_e9p5t5.js → slot-grid-BuZOKfcd.js} +4 -4
  180. package/dist/_chunks/{slot-grid-P_e9p5t5.js.map → slot-grid-BuZOKfcd.js.map} +1 -1
  181. package/dist/_chunks/{streaming-text-BuW7I0Zu.js → streaming-text-CvsjIQ7S.js} +2 -2
  182. package/dist/_chunks/{streaming-text-BuW7I0Zu.js.map → streaming-text-CvsjIQ7S.js.map} +1 -1
  183. package/dist/_chunks/{task-tray-BT288xoM.js → task-tray-CYG6rj2s.js} +3 -3
  184. package/dist/_chunks/{task-tray-BT288xoM.js.map → task-tray-CYG6rj2s.js.map} +1 -1
  185. package/dist/_chunks/{tasks-panel-BBkZuejF.js → tasks-panel-Do5SFp-j.js} +5 -5
  186. package/dist/_chunks/{tasks-panel-BBkZuejF.js.map → tasks-panel-Do5SFp-j.js.map} +1 -1
  187. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js → theme-toggle-DuMhQNFS.js} +3 -3
  188. package/dist/_chunks/{theme-toggle-Bi-CmV6M.js.map → theme-toggle-DuMhQNFS.js.map} +1 -1
  189. package/dist/_chunks/{toast.agent-C44mtGrW.js → toast.agent-D1tdg6DS.js} +2 -2
  190. package/dist/_chunks/{toast.agent-C44mtGrW.js.map → toast.agent-D1tdg6DS.js.map} +1 -1
  191. package/dist/_chunks/{token-insert-menu-D8FgXl33.js → token-insert-menu-9Um0JinI.js} +2 -2
  192. package/dist/_chunks/{token-insert-menu-D8FgXl33.js.map → token-insert-menu-9Um0JinI.js.map} +1 -1
  193. package/dist/_chunks/{tool-rail-BF3F2Ihq.js → tool-rail-CHyUmulN.js} +2 -2
  194. package/dist/_chunks/{tool-rail-BF3F2Ihq.js.map → tool-rail-CHyUmulN.js.map} +1 -1
  195. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js → tooth-scheme-WdyVymQ1.js} +3 -3
  196. package/dist/_chunks/{tooth-scheme-BPXE1_3N.js.map → tooth-scheme-WdyVymQ1.js.map} +1 -1
  197. package/dist/_chunks/{unit-converter-iDxlxKmm.js → unit-converter-BPumXMA6.js} +2 -2
  198. package/dist/_chunks/{unit-converter-iDxlxKmm.js.map → unit-converter-BPumXMA6.js.map} +1 -1
  199. package/dist/_chunks/{warning-stack-nczJf52p.js → warning-stack-DQz0Jyir.js} +3 -3
  200. package/dist/_chunks/{warning-stack-nczJf52p.js.map → warning-stack-DQz0Jyir.js.map} +1 -1
  201. package/dist/_chunks/{workflow-map-BVofnDYh.js → workflow-map-DE_ribRM.js} +5 -5
  202. package/dist/_chunks/{workflow-map-BVofnDYh.js.map → workflow-map-DE_ribRM.js.map} +1 -1
  203. package/dist/agent-catalog.json +1 -1
  204. package/dist/components/agenda-tray/index.js +1 -1
  205. package/dist/components/ai-consent-banner/index.js +1 -1
  206. package/dist/components/ai-prompt-input/index.js +1 -1
  207. package/dist/components/anamnesis-card/index.js +1 -1
  208. package/dist/components/appointment-card/index.js +1 -1
  209. package/dist/components/appointment-timeline/index.js +1 -1
  210. package/dist/components/audio-recorder/index.js +1 -1
  211. package/dist/components/bishop-score/index.js +1 -1
  212. package/dist/components/bmi-calculator/index.js +1 -1
  213. package/dist/components/booking/index.js +1 -1
  214. package/dist/components/button/button.d.ts +10 -0
  215. package/dist/components/button/button.d.ts.map +1 -1
  216. package/dist/components/button/index.js +2 -2
  217. package/dist/components/button-group/index.js +1 -1
  218. package/dist/components/care-plan-card/index.js +1 -1
  219. package/dist/components/care-plan-entry-card/index.js +1 -1
  220. package/dist/components/care-plan-header/index.js +1 -1
  221. package/dist/components/carousel/index.js +1 -1
  222. package/dist/components/chart/index.js +1 -1
  223. package/dist/components/chat-input/index.js +1 -1
  224. package/dist/components/chat-message/index.js +1 -1
  225. package/dist/components/connection-status/index.js +1 -1
  226. package/dist/components/contact-profile-card/index.js +1 -1
  227. package/dist/components/control-room-rail/index.js +1 -1
  228. package/dist/components/copy-field/index.js +1 -1
  229. package/dist/components/cycle-calculator/index.js +1 -1
  230. package/dist/components/dashboard-grid/index.js +1 -1
  231. package/dist/components/data-table/index.js +3 -3
  232. package/dist/components/data-table-tabs/index.js +1 -1
  233. package/dist/components/description-list/index.js +1 -1
  234. package/dist/components/document-preview/index.js +1 -1
  235. package/dist/components/document-scanner/index.js +1 -1
  236. package/dist/components/due-date-calculator/index.js +1 -1
  237. package/dist/components/editor-overlay/index.js +1 -1
  238. package/dist/components/empty-state/index.js +1 -1
  239. package/dist/components/entity-summary/index.js +1 -1
  240. package/dist/components/face-scheme/index.js +1 -1
  241. package/dist/components/fetal-weight/index.js +1 -1
  242. package/dist/components/field-array/index.js +1 -1
  243. package/dist/components/file-manager/index.js +1 -1
  244. package/dist/components/finished-terminal/index.js +1 -1
  245. package/dist/components/fiscal-code-input/index.js +1 -1
  246. package/dist/components/freemium-paywall/index.js +1 -1
  247. package/dist/components/gestational-age-calculator/index.js +1 -1
  248. package/dist/components/hcg-doubling/index.js +1 -1
  249. package/dist/components/header/index.js +1 -1
  250. package/dist/components/header-settings/index.js +1 -1
  251. package/dist/components/icon-button/index.js +1 -1
  252. package/dist/components/icon-button-group/index.js +1 -1
  253. package/dist/components/icon-picker/index.js +1 -1
  254. package/dist/components/image-cropper/index.js +1 -1
  255. package/dist/components/info-tip/index.js +1 -1
  256. package/dist/components/key-value-pair/index.js +1 -1
  257. package/dist/components/locale-picker/index.js +1 -1
  258. package/dist/components/map-view/index.js +1 -1
  259. package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
  260. package/dist/components/message-card/index.js +1 -1
  261. package/dist/components/message-tray/index.js +1 -1
  262. package/dist/components/notes-panel/index.js +1 -1
  263. package/dist/components/notification-card/index.js +1 -1
  264. package/dist/components/notification-tray/index.js +1 -1
  265. package/dist/components/optical-prescription/index.js +1 -1
  266. package/dist/components/patient-details/index.js +1 -1
  267. package/dist/components/patient-search/index.js +1 -1
  268. package/dist/components/patient-summary-card/index.js +1 -1
  269. package/dist/components/patient-table/index.js +1 -1
  270. package/dist/components/payment-card/index.js +1 -1
  271. package/dist/components/periodontal-chart/index.js +1 -1
  272. package/dist/components/periodontal-chart-card/index.js +1 -1
  273. package/dist/components/popover/index.js +1 -1
  274. package/dist/components/practice-results/index.js +1 -1
  275. package/dist/components/pregnancy-dating/index.js +1 -1
  276. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  277. package/dist/components/privacy-lock/index.js +1 -1
  278. package/dist/components/product-hub-tray/index.js +1 -1
  279. package/dist/components/public-header/index.js +1 -1
  280. package/dist/components/public-header/public-header.d.ts +1 -1
  281. package/dist/components/radiograph-panel/index.js +1 -1
  282. package/dist/components/reviews-panel/index.js +1 -1
  283. package/dist/components/rich-text-editor/index.js +1 -1
  284. package/dist/components/session-countdown/index.js +1 -1
  285. package/dist/components/sheet/index.js +1 -1
  286. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  287. package/dist/components/slot-grid/index.js +1 -1
  288. package/dist/components/streaming-text/index.js +1 -1
  289. package/dist/components/task-tray/index.js +1 -1
  290. package/dist/components/tasks-panel/index.js +1 -1
  291. package/dist/components/theme-toggle/index.js +1 -1
  292. package/dist/components/toast/index.js +1 -1
  293. package/dist/components/token-insert-menu/index.js +1 -1
  294. package/dist/components/tool-rail/index.js +1 -1
  295. package/dist/components/tooth-scheme/index.js +1 -1
  296. package/dist/components/unit-converter/index.js +1 -1
  297. package/dist/components/warning-stack/index.js +1 -1
  298. package/dist/components/workflow/index.js +1 -1
  299. package/dist/index.js +96 -96
  300. package/dist/patterns/alia-assistant/index.js +1 -1
  301. package/dist/patterns/anamnesis/index.js +1 -1
  302. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  303. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  304. package/dist/patterns/signature-request/index.js +1 -1
  305. package/package.json +1 -1
  306. package/dist/_chunks/button-BvNtqHAS.js.map +0 -1
@@ -7,8 +7,8 @@ import ge from "apexcharts";
7
7
  import { u as Ge, g as ve, a as Ue, r as We } from "./apexcharts-theme-B_AxGC_h.js";
8
8
  import { u as je } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
9
  import { u as Ke } from "./registry-DvAUVLHh.js";
10
- import { I as Ve } from "./icon-button-9c9Gp41m.js";
11
- import { I as Ye } from "./icon-button-group-DrvuWPGJ.js";
10
+ import { I as Ve } from "./icon-button-DA2CAGHZ.js";
11
+ import { I as Ye } from "./icon-button-group-D6SVMteH.js";
12
12
  import { c as N } from "./createLucideIcon-DhHxpK9K.js";
13
13
  /**
14
14
  * @license lucide-react v1.22.0 - ISC
@@ -702,4 +702,4 @@ export {
702
702
  nt as a,
703
703
  it as c
704
704
  };
705
- //# sourceMappingURL=chart-Y-gso_Uz.js.map
705
+ //# sourceMappingURL=chart-Bkr1Sh4o.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-Y-gso_Uz.js","sources":["../../node_modules/lucide-react/dist/esm/icons/chart-area.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-column.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-line.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-pie.mjs","../../node_modules/lucide-react/dist/esm/icons/donut.mjs","../../src/components/chart/chart.agent.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\n \"path\",\n {\n d: \"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z\",\n key: \"q0gr47\"\n }\n ]\n];\nconst ChartArea = createLucideIcon(\"chart-area\", __iconNode);\n\nexport { __iconNode, ChartArea as default };\n//# sourceMappingURL=chart-area.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"M18 17V9\", key: \"2bz60n\" }],\n [\"path\", { d: \"M13 17V5\", key: \"1frdt8\" }],\n [\"path\", { d: \"M8 17v-3\", key: \"17ska0\" }]\n];\nconst ChartColumn = createLucideIcon(\"chart-column\", __iconNode);\n\nexport { __iconNode, ChartColumn as default };\n//# sourceMappingURL=chart-column.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"m19 9-5 5-4-4-3 3\", key: \"2osh9i\" }]\n];\nconst ChartLine = createLucideIcon(\"chart-line\", __iconNode);\n\nexport { __iconNode, ChartLine as default };\n//# sourceMappingURL=chart-line.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\",\n key: \"pzmjnu\"\n }\n ],\n [\"path\", { d: \"M21.21 15.89A10 10 0 1 1 8 2.83\", key: \"k2fpak\" }]\n];\nconst ChartPie = createLucideIcon(\"chart-pie\", __iconNode);\n\nexport { __iconNode, ChartPie as default };\n//# sourceMappingURL=chart-pie.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3\",\n key: \"19sr3x\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Donut = createLucideIcon(\"donut\", __iconNode);\n\nexport { __iconNode, Donut as default };\n//# sourceMappingURL=donut.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ChartHandle } from './chart';\n\nexport const chartAgent: AgentAdapter<ChartHandle> = {\n id: 'chart',\n // view_change backs the opt-in type switcher (`switchableTypes` prop):\n // the same chart re-presented as line / bar / area / pie / donut.\n capabilities: ['view_change'],\n state: {\n declaredType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.declaredType',\n description:\n 'The consumer-declared chart type — the shape `update_series` expects.',\n read: (handle) => handle.getTypeState().declaredType,\n },\n effectiveType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.effectiveType',\n description:\n 'The type currently rendered — differs from declaredType after a type-switcher pick.',\n read: (handle) => handle.getTypeState().effectiveType,\n },\n availableTypes: {\n type: 'ChartType[]',\n descriptionKey: 'ui.agent.chart.state.availableTypes',\n description:\n 'Types the switcher offers. Empty when the chart has no type switcher.',\n read: (handle) => handle.getTypeState().availableTypes,\n },\n },\n actions: {\n change_view: {\n // Switching the presentation is a write (it changes what the user\n // sees) but is trivially reversible by switching back.\n safety: 'write',\n argsType: 'type',\n argsSchema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['line', 'bar', 'area', 'pie', 'donut'],\n description: 'The chart type to render.',\n },\n },\n required: ['type'],\n },\n returns: 'boolean (accepted)',\n returnsSchema: {\n type: 'boolean',\n description:\n 'True when the switch was applied; false when the chart has no type switcher or the type is not offered (check availableTypes first).',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.changeView',\n description:\n 'Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.',\n invoke: (handle, args: { type: string }) =>\n handle.setType(args.type as Parameters<ChartHandle['setType']>[0]),\n },\n update_series: {\n // Replacing the rendered series mutates what the chart displays — it\n // is a write, reversible by pushing the prior series back.\n safety: 'write',\n argsType: 'series',\n // `series` is `ChartSeries[]` (line/bar/area) OR `number[]`\n // (pie/donut/radialBar). Both shapes are accepted; the handle routes\n // by chart type internally.\n argsSchema: {\n type: 'object',\n properties: {\n series: {\n oneOf: [\n {\n type: 'array',\n description: 'Categorical series for line / bar / area charts.',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n data: { type: 'array', items: { type: 'number' } },\n role: {\n type: 'string',\n enum: ['primary', 'compare'],\n description:\n \"Optional. 'compare' renders this series as a secondary, colour-blind-safe overlay (e.g. the previous period) — dashed grey for line/area, hatched grey for bar. Omit for a normal primary series.\",\n },\n },\n required: ['name', 'data'],\n },\n },\n {\n type: 'array',\n description: 'Flat values for pie / donut / radialBar charts.',\n items: { type: 'number' },\n },\n ],\n },\n },\n required: ['series'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.updateSeries',\n description:\n 'Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state) — when the user has switched the view cross-shape the values are converted to the rendered shape. The write targets the live instance only: a later type switch re-reads the original props and discards it.',\n invoke: (\n handle,\n args: { series: Parameters<ChartHandle['updateSeries']>[0] },\n ) => {\n handle.updateSeries(args.series);\n },\n },\n export_png: {\n safety: 'read',\n returns: 'string (PNG data URI)',\n returnsSchema: {\n type: 'string',\n description: 'A `data:image/png;base64,…` URI of the rendered chart.',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.exportPng',\n description:\n 'Return a PNG data URI of the chart for export or screenshotting.',\n invoke: (handle) => handle.dataURI(),\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'chart' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Chart — thin, typed wrapper over ApexCharts (react-apexcharts). */\n/* */\n/* - All chrome, colours, and fonts flow from */\n/* `src/tokens/apexcharts-theme.ts` — never hex literals in user */\n/* code. A MutationObserver on `<html class>` re-reads the bridge so */\n/* theme changes repaint without remount. */\n/* - A ResizeObserver on the wrapper keeps the chart responsive */\n/* without listening on `window.resize`. */\n/* - Accessibility: the wrapper carries `role=\"img\"` + `aria-label` */\n/* (required `title` prop) + `aria-describedby` pointing at a */\n/* visually-hidden `<table>` that mirrors series × categories. */\n/* - Colour-blind users: `patterns` prop flips `fill.type` to pattern */\n/* using ApexCharts' built-in pattern presets. */\n/* - Numbers format via `Intl.NumberFormat(locale)` — no hand-rolled */\n/* `toFixed()`. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport ReactApexChart from 'react-apexcharts';\nimport ApexCharts from 'apexcharts';\nimport {\n ChartArea,\n ChartColumn,\n ChartLine,\n ChartPie,\n Donut,\n} from 'lucide-react';\nimport {\n getApexChartsTheme,\n getCompareFillOpacity,\n resolveCompareTint,\n type ApexChartsTheme,\n} from '../../tokens/apexcharts-theme';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { useNeutraliseHiddenFocus } from '../_shared/use-neutralize-hidden-focus';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chartAgent } from './chart.agent';\nimport { IconButton } from '../button/icon-button';\nimport { IconButtonGroup } from '../icon-button-group';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst chartVariants = cva('ds:relative ds:block ds:w-full', {\n variants: {\n density: {\n compact: 'ds:min-h-[var(--chart-min-height-compact)]',\n comfortable: 'ds:min-h-[var(--chart-min-height-comfortable)]',\n // Applied when an explicit `height` prop is given and no density was\n // requested: the wrapper must not exceed the caller's height (a 96px\n // KPI chart inside a card must not reserve 320px).\n none: '',\n },\n },\n defaultVariants: { density: 'comfortable' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type ChartType = 'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar';\n\nexport interface ChartSeries {\n name: string;\n data: number[];\n /**\n * Marks this series as a secondary \"compare\" overlay — e.g. the previous\n * period in a current-vs-previous financial view. Rendered visually\n * subordinate and colour-blind-safe, distinguished from primary series by\n * BOTH a non-colour cue AND a lighter shade of the SAME hue (never colour\n * alone). The compare series inherits its PAIRED primary's colour (k-th\n * compare pairs with the k-th primary, by order), then:\n * - line / area: a round-DOTTED stroke in the paired-primary colour (the\n * dotted-vs-solid pattern is the non-colour cue); area also gets a tinted\n * fill at `--chart-compare-fill-opacity`.\n * - bar: a tinted fill (paired-primary hue at `--chart-compare-fill-opacity`)\n * under a full-strength DOTTED outline that is OPEN at the baseline — so a\n * compare bar reads as an outlined \"ghost\" of its solid primary.\n * The legend swatch shows the lighter tint (via `legend.markers.fillColors`),\n * and the series name (e.g. \"Revenue (previous period)\") remains the primary\n * signal in the legend and the screen-reader table.\n * Only meaningful on axis types (line / area / bar); it is structurally\n * impossible on pie / donut / radialBar (their `series` is `number[]`, which\n * cannot carry this field), so the axis-only invariant is enforced by the\n * type system with no runtime guard. On an axis→slice type switch the compare\n * series are dropped from the slice (a previous-period total is not a slice of\n * the current whole; DEV warn). Omit (or `'primary'`) to render normally — a\n * chart with NO compare series emits byte-identical ApexCharts options to\n * before this field existed.\n * @default 'primary'\n */\n role?: 'primary' | 'compare';\n}\n\n/** Bar orientation. `'horizontal'` renders a ranking sideways. Default `'vertical'`. */\nexport type ChartOrientation = 'vertical' | 'horizontal';\n\n/** Line / area stroke interpolation. Default `'smooth'`. */\nexport type ChartCurve = 'smooth' | 'straight' | 'stepline';\n\nexport interface ChartProps extends VariantProps<typeof chartVariants> {\n /** Required — drives aria-label and sr-only table caption. */\n title: string;\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** Chart visual type. */\n type: ChartType;\n /**\n * For `line` / `bar` / `area`: an array of `ChartSeries`.\n * For `pie` / `donut` / `radialBar`: an array of numbers matched to `labels`.\n */\n series: ChartSeries[] | number[];\n /** Category axis labels (line / bar / area). */\n categories?: string[];\n /** Slice labels (pie / donut / radialBar). */\n labels?: string[];\n /** Height override. Defaults to 320px. */\n height?: number | string;\n /** Width override. Defaults to 100% of container. */\n width?: number | string;\n /** Opt-in pattern fills for colour-blind users. */\n patterns?: boolean;\n /**\n * Stack multiple `bar` / `area` series into a composition-over-time view.\n * Maps to ApexCharts `chart.stacked`. Only applies to the axis types\n * (`line` / `bar` / `area`); slice types (`pie` / `donut` / `radialBar`)\n * have no axis to stack against and ignore it. Default `false` — an\n * unstacked chart emits no `chart.stacked` key and renders identically to\n * before this prop existed.\n */\n stacked?: boolean;\n /**\n * Orientation for the `bar` type. `'horizontal'` renders the bars sideways\n * (ApexCharts `plotOptions.bar.horizontal`) for ranking-style charts where\n * the category is a name and the value runs across the horizontal axis.\n * Still an axis chart — pass `series` as `ChartSeries[]` with `categories`.\n * Ignored for every non-`bar` type. Default `'vertical'`.\n */\n orientation?: ChartOrientation;\n /**\n * Stroke interpolation for `line` / `area` charts (ApexCharts\n * `stroke.curve`). `'straight'` avoids the overshoot a smoothed spline\n * introduces on spiky monthly financials — where a `'smooth'` curve can dip\n * visually below zero between two positive points. Inert on `bar` (stroke\n * width is 0) and ignored on slice types. Default `'smooth'` — existing\n * charts are unaffected.\n */\n curve?: ChartCurve;\n /**\n * Override the series colour ramp. Pass **already-resolved** colour strings\n * (e.g. the live value of `var(--success)` sampled by the consumer) — these\n * are handed straight to ApexCharts, which can't read CSS custom properties.\n * When omitted, the theme bridge's `colors` ramp from `apexcharts-theme.ts`\n * is used, so existing consumers are unaffected. Typical use: a single-arc\n * `radialBar` gauge (e.g. BMI) that must change hue with the value —\n * green in the healthy band, amber/red outside it.\n */\n colors?: string[];\n /** Show the ApexCharts toolbar. Defaults to false. */\n toolbar?: boolean;\n /** Locale override — defaults to the active i18next language. */\n locale?: string;\n /**\n * radialBar only. Formats the value printed in the ring centre. Use when the\n * gauge represents a non-percentage figure: pass the arc fill (0–100) as the\n * single `series` value and return the real figure here (e.g. `(_, ) => '22.4'`).\n * Ignored for every other chart type. Defaults to ApexCharts' `${value}%`.\n */\n radialValueFormatter?: (value: number) => string;\n /**\n * Formats the numeric value of each data point wherever it is surfaced as\n * text — the tooltip, the value (y) axis on categorical charts, and the\n * screen-reader summary table. Use it to append a unit or currency symbol,\n * e.g. `(v) => new Intl.NumberFormat(locale, { style: 'currency', currency:\n * 'EUR' }).format(v)`. Defaults to `Intl.NumberFormat(locale)` (grouped\n * number, no unit). Does not apply to a `radialBar` ring centre — use\n * `radialValueFormatter` for that.\n */\n valueFormatter?: (value: number) => string;\n /**\n * Opt-in type switcher. Pass two or more of `'line' | 'bar' | 'area' |\n * 'pie' | 'donut'` to render an icon radiogroup (an `IconButtonGroup`)\n * above the plot that lets the user flip the chart between those types.\n * `type` is the initial selection and is always offered; the user's pick\n * then sticks across re-renders (remount with a new `key` to reset it).\n * When the picked type reads the other data shape, the data adapts: axis\n * series collapse to one slice per series (that series' total) for `pie` /\n * `donut`, and slice values become a single-series axis chart with\n * `labels` as the categories. `radialBar` cannot participate — such\n * entries are ignored (DEV warning) and a `radialBar` chart never shows\n * the switcher.\n */\n switchableTypes?: ChartType[];\n /** Called when the user picks a different type via the switcher. */\n onTypeChange?: (type: ChartType) => void;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface ChartHandle {\n /** Returns a PNG data URI for the chart. */\n dataURI: () => Promise<string>;\n /**\n * Updates series without remounting. Always pass the DECLARED `type`'s\n * shape — while the user has switched the view across the axis/slice\n * boundary the values (and, for axis→slice, the slice labels) are\n * converted to the rendered shape; for slice→axis the categories stay\n * the `labels` prop, so keep the value count stable. The update writes\n * to the live ApexCharts instance only: a later type switch remounts\n * from the original props and discards it.\n */\n updateSeries: (next: ChartProps['series']) => void;\n /**\n * Switches the rendered type via the type switcher. Returns `false`\n * (no-op) when the switcher is not enabled or the type is not offered.\n */\n setType: (next: ChartType) => boolean;\n /** Declared vs rendered type plus the types the switcher offers ([] when disabled). */\n getTypeState: () => {\n declaredType: ChartType;\n effectiveType: ChartType;\n availableTypes: ChartType[];\n };\n}\n\n/* ------------------------------------------------------------------ */\n/* Constants */\n/* ------------------------------------------------------------------ */\n\nconst PATTERN_STYLES = [\n 'verticalLines',\n 'horizontalLines',\n 'slantedLines',\n 'squares',\n 'circles',\n] as const;\n\n/** Types where `categories` belong on an x-axis. */\nconst CATEGORICAL_TYPES: ReadonlyArray<ChartType> = ['line', 'bar', 'area'];\n\n/** Types where `series` is a flat `number[]` paired with `labels`. */\nconst SLICE_TYPES: ReadonlyArray<ChartType> = ['pie', 'donut', 'radialBar'];\n\n/** Types the switcher may offer. `radialBar` is excluded — its series are\n * synthetic arc percents that cannot be re-plotted on an axis or as slices. */\nconst SWITCHABLE_TYPES: ReadonlyArray<ChartType> = [\n 'line',\n 'bar',\n 'area',\n 'pie',\n 'donut',\n];\n\ntype SwitchableType = Exclude<ChartType, 'radialBar'>;\n\n/* Static key map (not template-built) so the i18n coverage tooling can see\n every key literally. */\nconst TYPE_SWITCHER_LABEL_KEYS: Record<SwitchableType, string> = {\n line: 'chart.typeSwitcher.line',\n bar: 'chart.typeSwitcher.bar',\n area: 'chart.typeSwitcher.area',\n pie: 'chart.typeSwitcher.pie',\n donut: 'chart.typeSwitcher.donut',\n};\n\nconst TYPE_SWITCHER_ICONS: Record<SwitchableType, React.ReactNode> = {\n line: <ChartLine />,\n bar: <ChartColumn />,\n area: <ChartArea />,\n pie: <ChartPie />,\n donut: <Donut />,\n};\n\n/* Compare-overlay geometry. Colours come only from tokens (via the bridge);\n these are pure numeric/dash literals, consistent with the pre-existing\n stroke width:2 / dashArray literals the component already used. */\nconst COMPARE_OUTLINE_WIDTH = 2; // dotted outline / stroke width (~1.5–2px)\nconst COMPARE_DOT_DASH = '0 6'; // 0-length dash + round cap ⇒ round dots, 6px pitch\n\n/**\n * Rewrite each COMPARE bar into a 3-sided OPEN path (drop the baseline edge and\n * the implicit close) and round-dot its outline. A bar is natively one closed\n * path, so \"open at the bottom\" is impossible via config — this post-render DOM\n * patch is the only way. Verified safe against ApexCharts 5.10.6: animation\n * continuity is read from a separate `pathTo`/`pathFrom` attribute, never the\n * live `d`, so overwriting `d` never corrupts entrance/update animation or\n * `previousPaths`; the same element is kept so tooltips/crosshair still bind.\n * Idempotent (re-running writes the same `d`).\n *\n * Only applied to VERTICAL, positive-valued bars: the open edge is assumed to be\n * the bbox bottom. A horizontal or negative compare bar keeps the native\n * 4-sided dotted outline (still a valid non-colour cue) — see the guard in the\n * component. jsdom lacks `getBBox`, so the per-path guard makes this a no-op in\n * unit tests (exercised in the real-browser story run instead).\n */\nfunction patchCompareBars(\n root: HTMLElement | null,\n compareRealIndexes: number[],\n): void {\n if (!root || compareRealIndexes.length === 0) return;\n root\n .querySelectorAll<SVGGElement>(\n '.apexcharts-bar-series > .apexcharts-series',\n )\n .forEach((g) => {\n const ri = Number(g.getAttribute('data:realIndex'));\n if (!compareRealIndexes.includes(ri)) return;\n g.querySelectorAll<SVGPathElement>('path.apexcharts-bar-area').forEach(\n (p) => {\n if (typeof p.getBBox !== 'function') return; // jsdom guard\n const b = p.getBBox(); // final rendered box, stroke-excluded\n // 3-sided OPEN path: bottom-left → up left → across top → down right.\n // SVG fills the implicit close (bottom-right → bottom-left), so the\n // tint fill stays full-height; the stroke omits the baseline edge.\n p.setAttribute(\n 'd',\n `M ${b.x} ${b.y + b.height} L ${b.x} ${b.y} ` +\n `L ${b.x + b.width} ${b.y} L ${b.x + b.width} ${b.y + b.height}`,\n );\n p.setAttribute('stroke-dasharray', COMPARE_DOT_DASH); // round-dot rhythm\n p.setAttribute('stroke-linecap', 'round');\n },\n );\n });\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction isSliceType(type: ChartType): boolean {\n return SLICE_TYPES.includes(type);\n}\n\nfunction isCategoricalType(type: ChartType): boolean {\n return CATEGORICAL_TYPES.includes(type);\n}\n\n/** Coerce `series` into `ChartSeries[]` for shared logic (table, aria). */\nfunction normaliseSeries(\n series: ChartSeries[] | number[],\n type: ChartType,\n): ChartSeries[] {\n if (isSliceType(type)) {\n const nums = series as number[];\n return [\n {\n name: '',\n data: nums,\n },\n ];\n }\n return series as ChartSeries[];\n}\n\n/* ------------------------------------------------------------------ */\n/* Chart component */\n/* ------------------------------------------------------------------ */\n\nexport const Chart = forwardRef<ChartHandle, ChartProps>(\n (\n {\n title,\n id,\n type,\n series,\n categories,\n labels,\n height,\n width,\n patterns = false,\n stacked = false,\n orientation = 'vertical',\n curve = 'smooth',\n colors,\n toolbar = false,\n locale: localeProp,\n radialValueFormatter,\n valueFormatter,\n switchableTypes,\n onTypeChange,\n density,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const rawId = useId();\n const chartId = useMemo(\n () => `chart-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const summaryId = `${chartId}-summary`;\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n /* ApexCharts injects focusable canvases inside the `aria-hidden` */\n /* chart wrapper. Neutralise their tabindex so axe's */\n /* `aria-hidden-focus` rule passes. Same hook used in Sparkline. */\n useNeutraliseHiddenFocus(wrapperRef);\n\n const locale = localeProp ?? i18n.language ?? 'en';\n\n /* ---- dev warning if title missing ------------------------------ */\n if (import.meta.env.DEV && !title) {\n console.warn(\n 'Chart: `title` prop is required. It drives aria-label and the screen-reader summary table.',\n );\n }\n\n /* ---- theme-reactive state -------------------------------------- */\n const [themeOptions, setThemeOptions] = useState<ApexChartsTheme>(() => {\n try {\n return getApexChartsTheme();\n } catch {\n return {};\n }\n });\n\n /* ---- MutationObserver: re-read theme on class change ------------ */\n useEffect(() => {\n if (typeof document === 'undefined') return undefined;\n let timer: ReturnType<typeof setTimeout>;\n const observer = new MutationObserver(() => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n try {\n setThemeOptions(getApexChartsTheme());\n } catch {\n /* no-op in non-browser environments */\n }\n }, 50);\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n return () => {\n clearTimeout(timer);\n observer.disconnect();\n };\n }, []);\n\n /* ---- ResizeObserver: track container width --------------------- */\n useEffect(() => {\n const el = wrapperRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return undefined;\n const ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) setContainerWidth(Math.floor(entry.contentRect.width));\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n /* ---- type switcher ---------------------------------------------- */\n const switcherTypes = useMemo<SwitchableType[]>(() => {\n if (!switchableTypes || switchableTypes.length === 0) return [];\n const valid = switchableTypes.filter((entry): entry is SwitchableType =>\n SWITCHABLE_TYPES.includes(entry),\n );\n if (import.meta.env.DEV && valid.length !== switchableTypes.length) {\n console.warn(\n \"Chart: `switchableTypes` accepts 'line' | 'bar' | 'area' | 'pie' | 'donut' — other entries are ignored.\",\n );\n }\n if (!SWITCHABLE_TYPES.includes(type)) {\n if (import.meta.env.DEV && valid.length > 0) {\n console.warn(\n 'Chart: the type switcher is unavailable when `type` is \"radialBar\".',\n );\n }\n return [];\n }\n const withCurrent = valid.includes(type as SwitchableType)\n ? valid\n : [type as SwitchableType, ...valid];\n return [...new Set(withCurrent)];\n }, [switchableTypes, type]);\n const switcherEnabled = switcherTypes.length >= 2;\n\n const [pickedType, setPickedType] = useState<SwitchableType | null>(null);\n const effectiveType: ChartType =\n switcherEnabled && pickedType && switcherTypes.includes(pickedType)\n ? pickedType\n : type;\n\n /* ---- data adaptation for the switcher --------------------------- */\n /* Axis and slice types read different `series` shapes. When the user */\n /* switches across that boundary the data adapts: each axis series */\n /* becomes one slice (its total across the categories), and slice */\n /* values become one axis series with `labels` as the categories. */\n /* Same-shape switches (line/bar/area, pie/donut) pass through as-is. */\n const declaredIsSlice = isSliceType(type);\n const effectiveIsSlice = isSliceType(effectiveType);\n const { effectiveSeries, effectiveCategories, effectiveLabels } =\n useMemo(() => {\n if (declaredIsSlice === effectiveIsSlice) {\n return {\n effectiveSeries: series,\n effectiveCategories: categories,\n effectiveLabels: labels,\n };\n }\n if (!declaredIsSlice) {\n const allRows = series as ChartSeries[];\n // A previous-period total is not a slice of the current whole, so\n // compare overlays are dropped from the axis→slice collapse (their\n // grey \"prev\" slice would misread as part of the current mix). This\n // also makes compareFlags naturally [] on the slice side.\n const rows = allRows.filter((row) => row.role !== 'compare');\n if (import.meta.env.DEV && rows.length !== allRows.length) {\n console.warn(\n 'Chart: compare series are dropped on an axis→slice switch — a previous-period total is not a slice of the current whole.',\n );\n }\n const totals = rows.map((row) =>\n row.data.reduce((sum, v) => sum + v, 0),\n );\n if (import.meta.env.DEV && totals.some((v) => v < 0)) {\n console.warn(\n 'Chart: the axis→slice adaptation produced a negative series total — pie/donut cannot represent negative values. Offer only axis types in `switchableTypes` for delta-style data.',\n );\n }\n return {\n effectiveSeries: totals,\n effectiveCategories: undefined,\n effectiveLabels: rows.map((row) => row.name),\n };\n }\n const values = series as number[];\n return {\n effectiveSeries: [\n { name: t('chart.table.value'), data: values },\n ] as ChartSeries[],\n effectiveCategories: labels ?? [],\n effectiveLabels: undefined,\n };\n }, [series, categories, labels, declaredIsSlice, effectiveIsSlice, t]);\n\n /* ---- imperative handle ----------------------------------------- */\n const agentHandle = useMemo<ChartHandle>(\n () => ({\n async dataURI(): Promise<string> {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return '';\n const result = await instance.dataURI();\n return (result as { imgURI: string }).imgURI;\n },\n updateSeries(next) {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return;\n // Callers always pass the DECLARED type's shape. When the user has\n // switched the view across the axis/slice boundary, convert to what\n // the live instance actually renders (mirrors the render-time\n // adaptation) so the update never hits a mismatched instance.\n const declaredSlice = isSliceType(type);\n const renderedSlice = isSliceType(effectiveType);\n if (declaredSlice === renderedSlice) {\n if (declaredSlice) instance.updateSeries(next as number[]);\n else instance.updateSeries(next as ChartSeries[]);\n return;\n }\n if (!declaredSlice) {\n // Drop compare overlays from the collapse (mirrors the render-time\n // adaptation) so no stray \"prev\" slice appears.\n const rows = (next as ChartSeries[]).filter(\n (row) => row.role !== 'compare',\n );\n // Keep slice labels in step with the incoming series — without\n // this, a series-count or name change desyncs slices from the\n // labels captured at the last React render.\n instance.updateOptions(\n { labels: rows.map((row) => row.name) },\n false,\n true,\n );\n instance.updateSeries(\n rows.map((row) => row.data.reduce((sum, v) => sum + v, 0)),\n );\n return;\n }\n instance.updateSeries([\n { name: t('chart.table.value'), data: next as number[] },\n ]);\n },\n setType(next: ChartType): boolean {\n if (!switcherEnabled) return false;\n if (!switcherTypes.includes(next as SwitchableType)) return false;\n setPickedType(next as SwitchableType);\n return true;\n },\n getTypeState() {\n return {\n declaredType: type,\n effectiveType,\n availableTypes: switcherEnabled\n ? ([...switcherTypes] as ChartType[])\n : [],\n };\n },\n }),\n [chartId, type, effectiveType, t, switcherEnabled, switcherTypes],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(chartAgent, agentHandle, id);\n\n /* ---- RTL detection --------------------------------------------- */\n const isRtl =\n typeof document !== 'undefined' && document.documentElement.dir === 'rtl';\n\n /* ---- normalised series for sr-only table ----------------------- */\n const tableSeries = useMemo(\n () => normaliseSeries(effectiveSeries, effectiveType),\n [effectiveSeries, effectiveType],\n );\n\n /* ---- Intl formatter -------------------------------------------- */\n const numberFormatter = useMemo(\n () => new Intl.NumberFormat(locale),\n [locale],\n );\n\n /* ---- resolved value formatter ---------------------------------- */\n /* The consumer's `valueFormatter` (e.g. a currency formatter) wins */\n /* everywhere a data-point value is surfaced as text; otherwise we */\n /* fall back to the locale-aware grouped number. */\n const formatValue = useMemo(\n () =>\n valueFormatter ?? ((value: number) => numberFormatter.format(value)),\n [valueFormatter, numberFormatter],\n );\n\n /* ---- toolbar localisation -------------------------------------- */\n const toolbarLocale = useMemo(\n () => ({\n name: locale,\n options: {\n toolbar: {\n download: t('chart.toolbar.download'),\n selection: t('chart.toolbar.selection'),\n selectionZoom: t('chart.toolbar.selectionZoom'),\n zoomIn: t('chart.toolbar.zoomIn'),\n zoomOut: t('chart.toolbar.zoomOut'),\n pan: t('chart.toolbar.pan'),\n reset: t('chart.toolbar.reset'),\n exportToSVG: t('chart.toolbar.exportToSVG'),\n exportToPNG: t('chart.toolbar.exportToPNG'),\n exportToCSV: t('chart.toolbar.exportToCSV'),\n },\n },\n }),\n [locale, t],\n );\n\n /* ---- build ApexOptions ----------------------------------------- */\n const reducedMotion = usePrefersReducedMotion();\n\n const chartOptions: ApexCharts.ApexOptions = useMemo(() => {\n // Split the resolved compare colours off the theme object BEFORE spread:\n // `base` is exactly today's theme shape (colours / chart / grid), so\n // `...base` emits the same keys as before. The theme no longer carries a\n // `compare` object — the redesign never uses grey; the compare fill is a\n // tint of the paired-primary hue, resolved below from a token.\n const base = themeOptions;\n\n // Per-series compare flags, derived at build time from the EFFECTIVE\n // series/type so the type switcher composes: only axis types carry the\n // `role` field (slice `series` is `number[]`), so a slice view yields [].\n const compareFlags =\n isCategoricalType(effectiveType) && Array.isArray(effectiveSeries)\n ? (effectiveSeries as ChartSeries[]).map((s) => s.role === 'compare')\n : [];\n const hasCompare = compareFlags.some(Boolean);\n const barCompare = hasCompare && effectiveType === 'bar';\n // The open-at-the-baseline bar rewrite (patchCompareBars) assumes the\n // baseline is the bbox BOTTOM — true only for vertical, non-negative bars.\n // A horizontal or negative compare bar keeps the native 4-sided dotted\n // outline (still a valid non-colour cue), so the hook is gated off for it.\n const compareHasNegative =\n barCompare &&\n (effectiveSeries as ChartSeries[]).some(\n (s) => s.role === 'compare' && s.data.some((v) => v < 0),\n );\n const openBottomBars =\n barCompare && orientation === 'vertical' && !compareHasNegative;\n // Compare fill opacity + per-series tints (legend swatch), resolved from\n // the token via the bridge so no hex literal lives in component code.\n const compareFillOpacity = hasCompare ? getCompareFillOpacity() : 0.3;\n\n if (\n import.meta.env.DEV &&\n hasCompare &&\n stacked &&\n isCategoricalType(effectiveType)\n ) {\n console.warn(\n 'Chart: `stacked` with a compare series — a compare overlay is normally a grouped, not stacked, series. It will be stacked with the primaries.',\n );\n }\n\n const options: ApexCharts.ApexOptions = {\n ...base,\n chart: {\n ...base.chart,\n id: chartId,\n toolbar: { show: toolbar },\n zoom: { enabled: toolbar },\n animations: {\n enabled: !reducedMotion,\n dynamicAnimation: { enabled: !reducedMotion },\n },\n locales: [toolbarLocale],\n defaultLocale: locale,\n parentHeightOffset: 0,\n // Stacking is an axis-only concept — gate on the categorical types\n // so a slice/radial chart never receives it, and omit the key\n // entirely when unstacked so the default output is byte-identical.\n ...(stacked && isCategoricalType(effectiveType)\n ? { stacked: true }\n : {}),\n },\n // Only set `labels` when the effective type actually has them (slice\n // charts). Emitting `labels: undefined` crashes ApexCharts' bar\n // renderer — `parseDataAxisCharts` reads `labels.length` and throws\n // \"Cannot read properties of undefined (reading 'length')\", which\n // aborts the render and leaves a blank chart. Absent is safe; area /\n // line tolerate the undefined but bar does not, so never pass it.\n ...(effectiveLabels ? { labels: effectiveLabels } : {}),\n legend: {\n ...base.legend,\n position: 'bottom',\n // ApexCharts legend.horizontalAlign is a physical prop mapped internally\n // to the chart's own text flow. For RTL we flip via `yaxis.opposite`\n // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored\n // to the inline-start by asking for 'left' on LTR and 'right' on RTL.\n horizontalAlign: isRtl ? 'right' : 'left',\n fontFamily: 'inherit',\n },\n tooltip: {\n ...base.tooltip,\n y: {\n formatter: (value: number) => formatValue(value),\n },\n },\n noData: {\n text: t('chart.noData'),\n },\n };\n\n // Consumer-supplied, already-resolved colour ramp wins over the theme\n // bridge's `colors`. Ignored when absent so existing charts keep the\n // tokenised ramp. ApexCharts can't read `var(--…)`, so the consumer is\n // responsible for sampling the live token value before passing it in.\n if (colors && colors.length > 0) {\n options.colors = colors;\n }\n\n // Step 1 (compare) — pair each compare series with a primary and inherit\n // its colour. The k-th `role:'compare'` pairs with the k-th `role:'primary'`\n // by order (clamped to the last primary; falls back to its own index when\n // there are zero primaries). Primaries keep ApexCharts' own %-cycled ramp\n // colour, so after this `options.colors[i]` is the full paired-primary\n // colour for EVERY series — used directly by the bar fill/outline and the\n // line stroke. The compare fill is tinted separately (fill.opacity); only\n // the LEGEND swatch shows the lighter tint (legend.markers.fillColors).\n if (hasCompare) {\n const ramp = (options.colors ?? base.colors ?? []) as string[];\n const rampAt = (i: number) => ramp[i % Math.max(ramp.length, 1)];\n const primaryIdx = (effectiveSeries as ChartSeries[])\n .map((s, i) => (s.role === 'compare' ? -1 : i))\n .filter((i) => i >= 0);\n let seen = 0;\n options.colors = (effectiveSeries as ChartSeries[]).map((s, i) => {\n if (s.role !== 'compare') return rampAt(i);\n const pair = primaryIdx.length\n ? primaryIdx[Math.min(seen++, primaryIdx.length - 1)]\n : i;\n return rampAt(pair); // inherit the paired primary's colour\n });\n // Legend swatch: compare shows the lighter tint (a shade of its paired\n // primary), primaries show their own colour. Decoupled from the mark\n // colour so the swatch reads as \"lighter = compare\".\n const compareTints = (options.colors as string[]).map((c, i) =>\n compareFlags[i] ? resolveCompareTint(c) : c,\n );\n options.legend = {\n ...options.legend,\n markers: {\n ...(options.legend?.markers ?? {}),\n fillColors: compareTints,\n },\n };\n }\n\n if (isCategoricalType(effectiveType)) {\n // A horizontal bar makes ApexCharts swap axes: the numeric axis\n // becomes the x-axis and the categories move to the y-axis. The value\n // formatter must follow the numbers, so on a horizontal bar it lives\n // on `xaxis.labels` and the category y-axis keeps its default (string)\n // labels; every other categorical chart keeps the formatter on `yaxis`.\n const horizontalBar =\n effectiveType === 'bar' && orientation === 'horizontal';\n options.xaxis = {\n ...base.xaxis,\n categories: effectiveCategories ?? [],\n ...(horizontalBar\n ? {\n labels: {\n formatter: (value: string | number) =>\n formatValue(Number(value)),\n },\n }\n : {}),\n };\n options.yaxis = {\n ...base.yaxis,\n opposite: isRtl,\n ...(horizontalBar\n ? {}\n : { labels: { formatter: (value: number) => formatValue(value) } }),\n };\n // Step 2 (compare) — the non-colour cue is a round-DOTTED stroke on the\n // compare indices (dotted-vs-solid, greyscale/print-safe). It works on\n // bars too: unlike a fill hatch, a per-series bar stroke width + dash\n // renders a dotted OUTLINE in the paired-primary colour. Line/area keep\n // width 2; a bar's outline width is COMPARE_OUTLINE_WIDTH on compare\n // indices and 0 on primaries (solid, fill-only). `lineCap:'round'` turns\n // the 0-length dash into round dots. When there is no compare series the\n // stroke is byte-identical to before (no lineCap / dashArray key).\n options.stroke = {\n curve,\n width:\n effectiveType === 'bar'\n ? hasCompare\n ? compareFlags.map((c) => (c ? COMPARE_OUTLINE_WIDTH : 0))\n : 0\n : 2,\n ...(hasCompare\n ? {\n lineCap: 'round' as const,\n // Runtime accepts a string dash; the published types say\n // `number` → one documented cast. `'0 6'` + round cap ⇒ dots.\n dashArray: compareFlags.map((c) =>\n c ? COMPARE_DOT_DASH : 0,\n ) as unknown as number[],\n }\n : {}),\n };\n options.dataLabels = { enabled: false };\n }\n\n if (effectiveType === 'radialBar' && radialValueFormatter) {\n // ApexCharts treats a radialBar series value as a 0–100 percent and\n // renders it verbatim in the ring centre. When the displayed value is\n // NOT a percentage (e.g. a BMI), the consumer scales the series to a\n // percent for the arc and supplies `radialValueFormatter` to print the\n // real value in the centre. Without this, the gauge would read \"56%\"\n // for a BMI of 22.4 — misleading. Default behaviour is untouched.\n const basePlot = (base.plotOptions ?? {}) as NonNullable<\n ApexCharts.ApexOptions['plotOptions']\n >;\n options.plotOptions = {\n ...basePlot,\n radialBar: {\n ...(basePlot.radialBar ?? {}),\n dataLabels: {\n ...(basePlot.radialBar?.dataLabels ?? {}),\n value: {\n ...(basePlot.radialBar?.dataLabels?.value ?? {}),\n formatter: (val: number) => radialValueFormatter(Number(val)),\n },\n },\n },\n };\n }\n\n // Horizontal bars for rankings. `bar` and `radialBar` are mutually\n // exclusive effective types, so this never collides with the radialBar\n // plotOptions above. Absent (vertical) = the ApexCharts default, so the\n // key is only emitted when the consumer opts in.\n if (effectiveType === 'bar' && orientation === 'horizontal') {\n const basePlot = (base.plotOptions ?? {}) as NonNullable<\n ApexCharts.ApexOptions['plotOptions']\n >;\n options.plotOptions = {\n ...basePlot,\n bar: { ...(basePlot.bar ?? {}), horizontal: true },\n };\n }\n\n // Step 3 (fill) — the compare branches sit between the global `patterns`\n // branch and the area-gradient branch. Each is gated on hasCompare /\n // barCompare, so a chart with no compare series follows today's exact\n // paths and emits byte-identical fill.\n if (patterns) {\n // Colour-blind pattern mode. With a compare overlay the compare indices\n // drop the hatch and use a plain tinted solid fill (their dotted outline\n // / stroke from Step 2 is already the non-colour cue), so they read as a\n // lighter ghost of the primary; the primaries keep the cycled hatch.\n options.fill = {\n type: hasCompare\n ? compareFlags.map((c) => (c ? 'solid' : 'pattern'))\n : 'pattern',\n opacity: hasCompare\n ? compareFlags.map((c) =>\n c ? compareFillOpacity : effectiveType === 'area' ? 0.3 : 1,\n )\n : effectiveType === 'area'\n ? 0.3\n : 1,\n pattern: {\n style: [...PATTERN_STYLES],\n strokeWidth: 2,\n },\n };\n } else if (barCompare) {\n // Tinted solid fill: compare bars are their paired-primary hue at\n // `--chart-compare-fill-opacity`; primaries stay solid at full opacity.\n // The dotted outline (Step 2 stroke width) + open-bottom rewrite\n // (patchCompareBars, wired via chart.events below) supply the shape.\n options.fill = {\n type: 'solid',\n opacity: compareFlags.map((c) => (c ? compareFillOpacity : 1)),\n };\n } else if (effectiveType === 'area') {\n // Area gradient. With a compare overlay the compare fill drops to the\n // tint opacity so it sits under the dotted paired-primary stroke without\n // fighting the primary; primaries keep the default gradient. No grey —\n // the tint is a shade of the same (paired-primary) hue from Step 1.\n options.fill = hasCompare\n ? {\n type: 'gradient',\n opacity: compareFlags.map((c) => (c ? compareFillOpacity : 0.3)),\n }\n : {\n type: 'gradient',\n opacity: 0.3,\n };\n }\n\n // Open-at-the-baseline bar outline (progressive enhancement over the\n // native dotted 4-sided border). Attached ONLY for vertical, non-negative\n // compare bars; horizontal / negative bars keep the closed dotted outline.\n // Added inside this branch so a chart without open-bottom bars never gets\n // an `events` key (byte-identical). Re-fires on mount / update / animation\n // end — jointly covering mount, resize, theme change, and series updates.\n if (openBottomBars) {\n const compareRealIndexes = compareFlags\n .map((c, i) => (c ? i : -1))\n .filter((i) => i >= 0);\n const run = () =>\n patchCompareBars(wrapperRef.current, compareRealIndexes);\n const raf = () =>\n typeof requestAnimationFrame === 'function'\n ? requestAnimationFrame(run)\n : run();\n options.chart = {\n ...options.chart,\n events: {\n ...(options.chart?.events ?? {}),\n mounted: () => raf(),\n updated: () => raf(),\n animationEnd: () => run(),\n },\n };\n }\n\n return options;\n }, [\n themeOptions,\n chartId,\n toolbar,\n reducedMotion,\n toolbarLocale,\n locale,\n effectiveLabels,\n formatValue,\n t,\n effectiveType,\n effectiveSeries,\n effectiveCategories,\n isRtl,\n patterns,\n stacked,\n orientation,\n curve,\n colors,\n radialValueFormatter,\n ]);\n\n /* ---- resolved dimensions --------------------------------------- */\n const resolvedWidth =\n width ?? (containerWidth > 0 ? containerWidth : '100%');\n const resolvedHeight = height ?? 320;\n\n /* ---- sr-only data table --------------------------------------- */\n const srTable = useMemo(() => {\n const columnLabels = isSliceType(effectiveType)\n ? (effectiveLabels ?? [])\n : (effectiveCategories ?? []);\n const rows = tableSeries;\n return (\n <table id={summaryId} className=\"ds:sr-only\">\n <caption>{title}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{t('chart.table.series')}</th>\n {columnLabels.map((col, i) => (\n <th key={`${col}-${i}`} scope=\"col\">\n {col}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row, rowIndex) => (\n <tr key={`${row.name}-${rowIndex}`}>\n <th scope=\"row\">{row.name || t('chart.table.value')}</th>\n {row.data.map((value, colIndex) => (\n <td key={`${rowIndex}-${colIndex}`}>\n {/* For a radialBar gauge the series is a synthetic arc\n percent — announce the consumer's display value (e.g.\n the real BMI) instead of the raw fill so AT users get\n the same figure sighted users see in the ring. */}\n {effectiveType === 'radialBar' && radialValueFormatter\n ? radialValueFormatter(value)\n : formatValue(value)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }, [\n effectiveType,\n tableSeries,\n effectiveLabels,\n effectiveCategories,\n summaryId,\n title,\n t,\n formatValue,\n radialValueFormatter,\n ]);\n\n /* ---- ApexCharts `series` prop shape ----------------------------- */\n const apexSeries = useMemo(() => {\n if (isSliceType(effectiveType)) {\n return effectiveSeries as number[];\n }\n return effectiveSeries as ChartSeries[];\n }, [effectiveSeries, effectiveType]);\n\n /* `key={effectiveType}` remounts ApexCharts on a switch: its in-place\n axis↔slice type transitions are unreliable (stale internal scales),\n and a clean mount is the documented-safe path. */\n const chartRegion = (\n <div\n ref={wrapperRef}\n role=\"img\"\n aria-label={title}\n aria-describedby={summaryId}\n className={chartVariants({\n // Explicit height wins over the density min-height unless the\n // caller also asked for a density explicitly.\n density: density ?? (height !== undefined ? 'none' : undefined),\n className: switcherEnabled ? undefined : className,\n })}\n {...(switcherEnabled\n ? {}\n : { 'data-component': 'chart', 'data-component-id': id })}\n >\n {srTable}\n <ReactApexChart\n key={effectiveType}\n type={effectiveType}\n series={apexSeries as ApexCharts.ApexOptions['series']}\n options={chartOptions}\n width={resolvedWidth}\n height={resolvedHeight}\n aria-hidden=\"true\"\n />\n </div>\n );\n\n if (!switcherEnabled) return chartRegion;\n\n /* The switcher cannot live inside the `role=\"img\"` region — that role\n makes the whole subtree presentational, which would strip the radios\n from the accessibility tree. It renders as a sibling above the plot,\n and the bounding `data-component` marker moves to this shared\n wrapper so the component boundary still encloses everything. */\n return (\n <div\n data-component=\"chart\"\n data-component-id={id}\n className={`ds:block ds:w-full ${className ?? ''}`.trim()}\n >\n <div className=\"ds:mb-[var(--spacing-xs)] ds:flex ds:justify-end\">\n <IconButtonGroup\n role=\"radiogroup\"\n mode=\"toggle-single\"\n size=\"sm\"\n aria-label={t('chart.typeSwitcher.label')}\n value={effectiveType}\n onValueChange={(next) => {\n // Guard: keyboard paths can re-commit the current value; the\n // contract is \"called when the user picks a DIFFERENT type\".\n if (next === effectiveType) return;\n setPickedType(next as SwitchableType);\n onTypeChange?.(next as ChartType);\n }}\n >\n {switcherTypes.map((entry) => (\n <IconButton\n key={entry}\n value={entry}\n // Explicit — the default (submit) would post a surrounding\n // consumer <form> on click/Space.\n type=\"button\"\n icon={TYPE_SWITCHER_ICONS[entry]}\n aria-label={t(TYPE_SWITCHER_LABEL_KEYS[entry])}\n />\n ))}\n </IconButtonGroup>\n </div>\n {chartRegion}\n </div>\n );\n },\n);\n\nChart.displayName = 'Chart';\n\n/* ------------------------------------------------------------------ */\n/* Re-export internal helper for downstream theming (kept narrow). */\n/* ------------------------------------------------------------------ */\n\nexport { chartVariants };\n"],"names":["__iconNode","ChartArea","createLucideIcon","ChartColumn","ChartLine","ChartPie","Donut","chartAgent","handle","args","chartVariants","cva","PATTERN_STYLES","CATEGORICAL_TYPES","SLICE_TYPES","SWITCHABLE_TYPES","TYPE_SWITCHER_LABEL_KEYS","TYPE_SWITCHER_ICONS","COMPARE_OUTLINE_WIDTH","COMPARE_DOT_DASH","patchCompareBars","root","compareRealIndexes","g","ri","p","b","isSliceType","type","isCategoricalType","normaliseSeries","series","Chart","forwardRef","title","id","categories","labels","height","width","patterns","stacked","orientation","curve","colors","toolbar","localeProp","radialValueFormatter","valueFormatter","switchableTypes","onTypeChange","density","className","ref","t","i18n","useTranslation","rawId","useId","chartId","useMemo","summaryId","wrapperRef","useRef","containerWidth","setContainerWidth","useState","useNeutraliseHiddenFocus","locale","themeOptions","setThemeOptions","getApexChartsTheme","useEffect","timer","observer","el","ro","entries","entry","switcherTypes","valid","withCurrent","switcherEnabled","pickedType","setPickedType","effectiveType","declaredIsSlice","effectiveIsSlice","effectiveSeries","effectiveCategories","effectiveLabels","rows","row","sum","v","values","agentHandle","instance","ApexCharts","next","declaredSlice","renderedSlice","useImperativeHandle","useAgentRegistration","isRtl","tableSeries","numberFormatter","formatValue","value","toolbarLocale","reducedMotion","usePrefersReducedMotion","chartOptions","base","compareFlags","s","hasCompare","barCompare","compareHasNegative","openBottomBars","compareFillOpacity","getCompareFillOpacity","options","ramp","rampAt","i","primaryIdx","seen","pair","compareTints","c","resolveCompareTint","_a","horizontalBar","basePlot","_b","_d","_c","val","run","raf","_e","resolvedWidth","resolvedHeight","srTable","columnLabels","jsx","jsxs","col","rowIndex","colIndex","apexSeries","chartRegion","ReactApexChart","IconButtonGroup","IconButton"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,KAAYC,EAAiB,cAAcF,EAAU;ACnB3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,YA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-area.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-column.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-line.mjs","../../node_modules/lucide-react/dist/esm/icons/chart-pie.mjs","../../node_modules/lucide-react/dist/esm/icons/donut.mjs","../../src/components/chart/chart.agent.ts","../../src/components/chart/chart.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\n \"path\",\n {\n d: \"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z\",\n key: \"q0gr47\"\n }\n ]\n];\nconst ChartArea = createLucideIcon(\"chart-area\", __iconNode);\n\nexport { __iconNode, ChartArea as default };\n//# sourceMappingURL=chart-area.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"M18 17V9\", key: \"2bz60n\" }],\n [\"path\", { d: \"M13 17V5\", key: \"1frdt8\" }],\n [\"path\", { d: \"M8 17v-3\", key: \"17ska0\" }]\n];\nconst ChartColumn = createLucideIcon(\"chart-column\", __iconNode);\n\nexport { __iconNode, ChartColumn as default };\n//# sourceMappingURL=chart-column.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M3 3v16a2 2 0 0 0 2 2h16\", key: \"c24i48\" }],\n [\"path\", { d: \"m19 9-5 5-4-4-3 3\", key: \"2osh9i\" }]\n];\nconst ChartLine = createLucideIcon(\"chart-line\", __iconNode);\n\nexport { __iconNode, ChartLine as default };\n//# sourceMappingURL=chart-line.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\",\n key: \"pzmjnu\"\n }\n ],\n [\"path\", { d: \"M21.21 15.89A10 10 0 1 1 8 2.83\", key: \"k2fpak\" }]\n];\nconst ChartPie = createLucideIcon(\"chart-pie\", __iconNode);\n\nexport { __iconNode, ChartPie as default };\n//# sourceMappingURL=chart-pie.mjs.map\n","/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3\",\n key: \"19sr3x\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Donut = createLucideIcon(\"donut\", __iconNode);\n\nexport { __iconNode, Donut as default };\n//# sourceMappingURL=donut.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ChartHandle } from './chart';\n\nexport const chartAgent: AgentAdapter<ChartHandle> = {\n id: 'chart',\n // view_change backs the opt-in type switcher (`switchableTypes` prop):\n // the same chart re-presented as line / bar / area / pie / donut.\n capabilities: ['view_change'],\n state: {\n declaredType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.declaredType',\n description:\n 'The consumer-declared chart type — the shape `update_series` expects.',\n read: (handle) => handle.getTypeState().declaredType,\n },\n effectiveType: {\n type: \"'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'\",\n descriptionKey: 'ui.agent.chart.state.effectiveType',\n description:\n 'The type currently rendered — differs from declaredType after a type-switcher pick.',\n read: (handle) => handle.getTypeState().effectiveType,\n },\n availableTypes: {\n type: 'ChartType[]',\n descriptionKey: 'ui.agent.chart.state.availableTypes',\n description:\n 'Types the switcher offers. Empty when the chart has no type switcher.',\n read: (handle) => handle.getTypeState().availableTypes,\n },\n },\n actions: {\n change_view: {\n // Switching the presentation is a write (it changes what the user\n // sees) but is trivially reversible by switching back.\n safety: 'write',\n argsType: 'type',\n argsSchema: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n enum: ['line', 'bar', 'area', 'pie', 'donut'],\n description: 'The chart type to render.',\n },\n },\n required: ['type'],\n },\n returns: 'boolean (accepted)',\n returnsSchema: {\n type: 'boolean',\n description:\n 'True when the switch was applied; false when the chart has no type switcher or the type is not offered (check availableTypes first).',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.changeView',\n description:\n 'Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.',\n invoke: (handle, args: { type: string }) =>\n handle.setType(args.type as Parameters<ChartHandle['setType']>[0]),\n },\n update_series: {\n // Replacing the rendered series mutates what the chart displays — it\n // is a write, reversible by pushing the prior series back.\n safety: 'write',\n argsType: 'series',\n // `series` is `ChartSeries[]` (line/bar/area) OR `number[]`\n // (pie/donut/radialBar). Both shapes are accepted; the handle routes\n // by chart type internally.\n argsSchema: {\n type: 'object',\n properties: {\n series: {\n oneOf: [\n {\n type: 'array',\n description: 'Categorical series for line / bar / area charts.',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n data: { type: 'array', items: { type: 'number' } },\n role: {\n type: 'string',\n enum: ['primary', 'compare'],\n description:\n \"Optional. 'compare' renders this series as a secondary, colour-blind-safe overlay (e.g. the previous period) — dashed grey for line/area, hatched grey for bar. Omit for a normal primary series.\",\n },\n },\n required: ['name', 'data'],\n },\n },\n {\n type: 'array',\n description: 'Flat values for pie / donut / radialBar charts.',\n items: { type: 'number' },\n },\n ],\n },\n },\n required: ['series'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.updateSeries',\n description:\n 'Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state) — when the user has switched the view cross-shape the values are converted to the rendered shape. The write targets the live instance only: a later type switch re-reads the original props and discards it.',\n invoke: (\n handle,\n args: { series: Parameters<ChartHandle['updateSeries']>[0] },\n ) => {\n handle.updateSeries(args.series);\n },\n },\n export_png: {\n safety: 'read',\n returns: 'string (PNG data URI)',\n returnsSchema: {\n type: 'string',\n description: 'A `data:image/png;base64,…` URI of the rendered chart.',\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chart.actions.exportPng',\n description:\n 'Return a PNG data URI of the chart for export or screenshotting.',\n invoke: (handle) => handle.dataURI(),\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'chart' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Chart — thin, typed wrapper over ApexCharts (react-apexcharts). */\n/* */\n/* - All chrome, colours, and fonts flow from */\n/* `src/tokens/apexcharts-theme.ts` — never hex literals in user */\n/* code. A MutationObserver on `<html class>` re-reads the bridge so */\n/* theme changes repaint without remount. */\n/* - A ResizeObserver on the wrapper keeps the chart responsive */\n/* without listening on `window.resize`. */\n/* - Accessibility: the wrapper carries `role=\"img\"` + `aria-label` */\n/* (required `title` prop) + `aria-describedby` pointing at a */\n/* visually-hidden `<table>` that mirrors series × categories. */\n/* - Colour-blind users: `patterns` prop flips `fill.type` to pattern */\n/* using ApexCharts' built-in pattern presets. */\n/* - Numbers format via `Intl.NumberFormat(locale)` — no hand-rolled */\n/* `toFixed()`. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport ReactApexChart from 'react-apexcharts';\nimport ApexCharts from 'apexcharts';\nimport {\n ChartArea,\n ChartColumn,\n ChartLine,\n ChartPie,\n Donut,\n} from 'lucide-react';\nimport {\n getApexChartsTheme,\n getCompareFillOpacity,\n resolveCompareTint,\n type ApexChartsTheme,\n} from '../../tokens/apexcharts-theme';\nimport { usePrefersReducedMotion } from '../../hooks';\nimport { useNeutraliseHiddenFocus } from '../_shared/use-neutralize-hidden-focus';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chartAgent } from './chart.agent';\nimport { IconButton } from '../button/icon-button';\nimport { IconButtonGroup } from '../icon-button-group';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst chartVariants = cva('ds:relative ds:block ds:w-full', {\n variants: {\n density: {\n compact: 'ds:min-h-[var(--chart-min-height-compact)]',\n comfortable: 'ds:min-h-[var(--chart-min-height-comfortable)]',\n // Applied when an explicit `height` prop is given and no density was\n // requested: the wrapper must not exceed the caller's height (a 96px\n // KPI chart inside a card must not reserve 320px).\n none: '',\n },\n },\n defaultVariants: { density: 'comfortable' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type ChartType = 'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar';\n\nexport interface ChartSeries {\n name: string;\n data: number[];\n /**\n * Marks this series as a secondary \"compare\" overlay — e.g. the previous\n * period in a current-vs-previous financial view. Rendered visually\n * subordinate and colour-blind-safe, distinguished from primary series by\n * BOTH a non-colour cue AND a lighter shade of the SAME hue (never colour\n * alone). The compare series inherits its PAIRED primary's colour (k-th\n * compare pairs with the k-th primary, by order), then:\n * - line / area: a round-DOTTED stroke in the paired-primary colour (the\n * dotted-vs-solid pattern is the non-colour cue); area also gets a tinted\n * fill at `--chart-compare-fill-opacity`.\n * - bar: a tinted fill (paired-primary hue at `--chart-compare-fill-opacity`)\n * under a full-strength DOTTED outline that is OPEN at the baseline — so a\n * compare bar reads as an outlined \"ghost\" of its solid primary.\n * The legend swatch shows the lighter tint (via `legend.markers.fillColors`),\n * and the series name (e.g. \"Revenue (previous period)\") remains the primary\n * signal in the legend and the screen-reader table.\n * Only meaningful on axis types (line / area / bar); it is structurally\n * impossible on pie / donut / radialBar (their `series` is `number[]`, which\n * cannot carry this field), so the axis-only invariant is enforced by the\n * type system with no runtime guard. On an axis→slice type switch the compare\n * series are dropped from the slice (a previous-period total is not a slice of\n * the current whole; DEV warn). Omit (or `'primary'`) to render normally — a\n * chart with NO compare series emits byte-identical ApexCharts options to\n * before this field existed.\n * @default 'primary'\n */\n role?: 'primary' | 'compare';\n}\n\n/** Bar orientation. `'horizontal'` renders a ranking sideways. Default `'vertical'`. */\nexport type ChartOrientation = 'vertical' | 'horizontal';\n\n/** Line / area stroke interpolation. Default `'smooth'`. */\nexport type ChartCurve = 'smooth' | 'straight' | 'stepline';\n\nexport interface ChartProps extends VariantProps<typeof chartVariants> {\n /** Required — drives aria-label and sr-only table caption. */\n title: string;\n /** Opaque instance id — emitted as `data-component-id` for the agent registry. */\n id?: string;\n /** Chart visual type. */\n type: ChartType;\n /**\n * For `line` / `bar` / `area`: an array of `ChartSeries`.\n * For `pie` / `donut` / `radialBar`: an array of numbers matched to `labels`.\n */\n series: ChartSeries[] | number[];\n /** Category axis labels (line / bar / area). */\n categories?: string[];\n /** Slice labels (pie / donut / radialBar). */\n labels?: string[];\n /** Height override. Defaults to 320px. */\n height?: number | string;\n /** Width override. Defaults to 100% of container. */\n width?: number | string;\n /** Opt-in pattern fills for colour-blind users. */\n patterns?: boolean;\n /**\n * Stack multiple `bar` / `area` series into a composition-over-time view.\n * Maps to ApexCharts `chart.stacked`. Only applies to the axis types\n * (`line` / `bar` / `area`); slice types (`pie` / `donut` / `radialBar`)\n * have no axis to stack against and ignore it. Default `false` — an\n * unstacked chart emits no `chart.stacked` key and renders identically to\n * before this prop existed.\n */\n stacked?: boolean;\n /**\n * Orientation for the `bar` type. `'horizontal'` renders the bars sideways\n * (ApexCharts `plotOptions.bar.horizontal`) for ranking-style charts where\n * the category is a name and the value runs across the horizontal axis.\n * Still an axis chart — pass `series` as `ChartSeries[]` with `categories`.\n * Ignored for every non-`bar` type. Default `'vertical'`.\n */\n orientation?: ChartOrientation;\n /**\n * Stroke interpolation for `line` / `area` charts (ApexCharts\n * `stroke.curve`). `'straight'` avoids the overshoot a smoothed spline\n * introduces on spiky monthly financials — where a `'smooth'` curve can dip\n * visually below zero between two positive points. Inert on `bar` (stroke\n * width is 0) and ignored on slice types. Default `'smooth'` — existing\n * charts are unaffected.\n */\n curve?: ChartCurve;\n /**\n * Override the series colour ramp. Pass **already-resolved** colour strings\n * (e.g. the live value of `var(--success)` sampled by the consumer) — these\n * are handed straight to ApexCharts, which can't read CSS custom properties.\n * When omitted, the theme bridge's `colors` ramp from `apexcharts-theme.ts`\n * is used, so existing consumers are unaffected. Typical use: a single-arc\n * `radialBar` gauge (e.g. BMI) that must change hue with the value —\n * green in the healthy band, amber/red outside it.\n */\n colors?: string[];\n /** Show the ApexCharts toolbar. Defaults to false. */\n toolbar?: boolean;\n /** Locale override — defaults to the active i18next language. */\n locale?: string;\n /**\n * radialBar only. Formats the value printed in the ring centre. Use when the\n * gauge represents a non-percentage figure: pass the arc fill (0–100) as the\n * single `series` value and return the real figure here (e.g. `(_, ) => '22.4'`).\n * Ignored for every other chart type. Defaults to ApexCharts' `${value}%`.\n */\n radialValueFormatter?: (value: number) => string;\n /**\n * Formats the numeric value of each data point wherever it is surfaced as\n * text — the tooltip, the value (y) axis on categorical charts, and the\n * screen-reader summary table. Use it to append a unit or currency symbol,\n * e.g. `(v) => new Intl.NumberFormat(locale, { style: 'currency', currency:\n * 'EUR' }).format(v)`. Defaults to `Intl.NumberFormat(locale)` (grouped\n * number, no unit). Does not apply to a `radialBar` ring centre — use\n * `radialValueFormatter` for that.\n */\n valueFormatter?: (value: number) => string;\n /**\n * Opt-in type switcher. Pass two or more of `'line' | 'bar' | 'area' |\n * 'pie' | 'donut'` to render an icon radiogroup (an `IconButtonGroup`)\n * above the plot that lets the user flip the chart between those types.\n * `type` is the initial selection and is always offered; the user's pick\n * then sticks across re-renders (remount with a new `key` to reset it).\n * When the picked type reads the other data shape, the data adapts: axis\n * series collapse to one slice per series (that series' total) for `pie` /\n * `donut`, and slice values become a single-series axis chart with\n * `labels` as the categories. `radialBar` cannot participate — such\n * entries are ignored (DEV warning) and a `radialBar` chart never shows\n * the switcher.\n */\n switchableTypes?: ChartType[];\n /** Called when the user picks a different type via the switcher. */\n onTypeChange?: (type: ChartType) => void;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\nexport interface ChartHandle {\n /** Returns a PNG data URI for the chart. */\n dataURI: () => Promise<string>;\n /**\n * Updates series without remounting. Always pass the DECLARED `type`'s\n * shape — while the user has switched the view across the axis/slice\n * boundary the values (and, for axis→slice, the slice labels) are\n * converted to the rendered shape; for slice→axis the categories stay\n * the `labels` prop, so keep the value count stable. The update writes\n * to the live ApexCharts instance only: a later type switch remounts\n * from the original props and discards it.\n */\n updateSeries: (next: ChartProps['series']) => void;\n /**\n * Switches the rendered type via the type switcher. Returns `false`\n * (no-op) when the switcher is not enabled or the type is not offered.\n */\n setType: (next: ChartType) => boolean;\n /** Declared vs rendered type plus the types the switcher offers ([] when disabled). */\n getTypeState: () => {\n declaredType: ChartType;\n effectiveType: ChartType;\n availableTypes: ChartType[];\n };\n}\n\n/* ------------------------------------------------------------------ */\n/* Constants */\n/* ------------------------------------------------------------------ */\n\nconst PATTERN_STYLES = [\n 'verticalLines',\n 'horizontalLines',\n 'slantedLines',\n 'squares',\n 'circles',\n] as const;\n\n/** Types where `categories` belong on an x-axis. */\nconst CATEGORICAL_TYPES: ReadonlyArray<ChartType> = ['line', 'bar', 'area'];\n\n/** Types where `series` is a flat `number[]` paired with `labels`. */\nconst SLICE_TYPES: ReadonlyArray<ChartType> = ['pie', 'donut', 'radialBar'];\n\n/** Types the switcher may offer. `radialBar` is excluded — its series are\n * synthetic arc percents that cannot be re-plotted on an axis or as slices. */\nconst SWITCHABLE_TYPES: ReadonlyArray<ChartType> = [\n 'line',\n 'bar',\n 'area',\n 'pie',\n 'donut',\n];\n\ntype SwitchableType = Exclude<ChartType, 'radialBar'>;\n\n/* Static key map (not template-built) so the i18n coverage tooling can see\n every key literally. */\nconst TYPE_SWITCHER_LABEL_KEYS: Record<SwitchableType, string> = {\n line: 'chart.typeSwitcher.line',\n bar: 'chart.typeSwitcher.bar',\n area: 'chart.typeSwitcher.area',\n pie: 'chart.typeSwitcher.pie',\n donut: 'chart.typeSwitcher.donut',\n};\n\nconst TYPE_SWITCHER_ICONS: Record<SwitchableType, React.ReactNode> = {\n line: <ChartLine />,\n bar: <ChartColumn />,\n area: <ChartArea />,\n pie: <ChartPie />,\n donut: <Donut />,\n};\n\n/* Compare-overlay geometry. Colours come only from tokens (via the bridge);\n these are pure numeric/dash literals, consistent with the pre-existing\n stroke width:2 / dashArray literals the component already used. */\nconst COMPARE_OUTLINE_WIDTH = 2; // dotted outline / stroke width (~1.5–2px)\nconst COMPARE_DOT_DASH = '0 6'; // 0-length dash + round cap ⇒ round dots, 6px pitch\n\n/**\n * Rewrite each COMPARE bar into a 3-sided OPEN path (drop the baseline edge and\n * the implicit close) and round-dot its outline. A bar is natively one closed\n * path, so \"open at the bottom\" is impossible via config — this post-render DOM\n * patch is the only way. Verified safe against ApexCharts 5.10.6: animation\n * continuity is read from a separate `pathTo`/`pathFrom` attribute, never the\n * live `d`, so overwriting `d` never corrupts entrance/update animation or\n * `previousPaths`; the same element is kept so tooltips/crosshair still bind.\n * Idempotent (re-running writes the same `d`).\n *\n * Only applied to VERTICAL, positive-valued bars: the open edge is assumed to be\n * the bbox bottom. A horizontal or negative compare bar keeps the native\n * 4-sided dotted outline (still a valid non-colour cue) — see the guard in the\n * component. jsdom lacks `getBBox`, so the per-path guard makes this a no-op in\n * unit tests (exercised in the real-browser story run instead).\n */\nfunction patchCompareBars(\n root: HTMLElement | null,\n compareRealIndexes: number[],\n): void {\n if (!root || compareRealIndexes.length === 0) return;\n root\n .querySelectorAll<SVGGElement>(\n '.apexcharts-bar-series > .apexcharts-series',\n )\n .forEach((g) => {\n const ri = Number(g.getAttribute('data:realIndex'));\n if (!compareRealIndexes.includes(ri)) return;\n g.querySelectorAll<SVGPathElement>('path.apexcharts-bar-area').forEach(\n (p) => {\n if (typeof p.getBBox !== 'function') return; // jsdom guard\n const b = p.getBBox(); // final rendered box, stroke-excluded\n // 3-sided OPEN path: bottom-left → up left → across top → down right.\n // SVG fills the implicit close (bottom-right → bottom-left), so the\n // tint fill stays full-height; the stroke omits the baseline edge.\n p.setAttribute(\n 'd',\n `M ${b.x} ${b.y + b.height} L ${b.x} ${b.y} ` +\n `L ${b.x + b.width} ${b.y} L ${b.x + b.width} ${b.y + b.height}`,\n );\n p.setAttribute('stroke-dasharray', COMPARE_DOT_DASH); // round-dot rhythm\n p.setAttribute('stroke-linecap', 'round');\n },\n );\n });\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction isSliceType(type: ChartType): boolean {\n return SLICE_TYPES.includes(type);\n}\n\nfunction isCategoricalType(type: ChartType): boolean {\n return CATEGORICAL_TYPES.includes(type);\n}\n\n/** Coerce `series` into `ChartSeries[]` for shared logic (table, aria). */\nfunction normaliseSeries(\n series: ChartSeries[] | number[],\n type: ChartType,\n): ChartSeries[] {\n if (isSliceType(type)) {\n const nums = series as number[];\n return [\n {\n name: '',\n data: nums,\n },\n ];\n }\n return series as ChartSeries[];\n}\n\n/* ------------------------------------------------------------------ */\n/* Chart component */\n/* ------------------------------------------------------------------ */\n\nexport const Chart = forwardRef<ChartHandle, ChartProps>(\n (\n {\n title,\n id,\n type,\n series,\n categories,\n labels,\n height,\n width,\n patterns = false,\n stacked = false,\n orientation = 'vertical',\n curve = 'smooth',\n colors,\n toolbar = false,\n locale: localeProp,\n radialValueFormatter,\n valueFormatter,\n switchableTypes,\n onTypeChange,\n density,\n className,\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const rawId = useId();\n const chartId = useMemo(\n () => `chart-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const summaryId = `${chartId}-summary`;\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n /* ApexCharts injects focusable canvases inside the `aria-hidden` */\n /* chart wrapper. Neutralise their tabindex so axe's */\n /* `aria-hidden-focus` rule passes. Same hook used in Sparkline. */\n useNeutraliseHiddenFocus(wrapperRef);\n\n const locale = localeProp ?? i18n.language ?? 'en';\n\n /* ---- dev warning if title missing ------------------------------ */\n if (import.meta.env.DEV && !title) {\n console.warn(\n 'Chart: `title` prop is required. It drives aria-label and the screen-reader summary table.',\n );\n }\n\n /* ---- theme-reactive state -------------------------------------- */\n const [themeOptions, setThemeOptions] = useState<ApexChartsTheme>(() => {\n try {\n return getApexChartsTheme();\n } catch {\n return {};\n }\n });\n\n /* ---- MutationObserver: re-read theme on class change ------------ */\n useEffect(() => {\n if (typeof document === 'undefined') return undefined;\n let timer: ReturnType<typeof setTimeout>;\n const observer = new MutationObserver(() => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n try {\n setThemeOptions(getApexChartsTheme());\n } catch {\n /* no-op in non-browser environments */\n }\n }, 50);\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n return () => {\n clearTimeout(timer);\n observer.disconnect();\n };\n }, []);\n\n /* ---- ResizeObserver: track container width --------------------- */\n useEffect(() => {\n const el = wrapperRef.current;\n if (!el || typeof ResizeObserver === 'undefined') return undefined;\n const ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) setContainerWidth(Math.floor(entry.contentRect.width));\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n /* ---- type switcher ---------------------------------------------- */\n const switcherTypes = useMemo<SwitchableType[]>(() => {\n if (!switchableTypes || switchableTypes.length === 0) return [];\n const valid = switchableTypes.filter((entry): entry is SwitchableType =>\n SWITCHABLE_TYPES.includes(entry),\n );\n if (import.meta.env.DEV && valid.length !== switchableTypes.length) {\n console.warn(\n \"Chart: `switchableTypes` accepts 'line' | 'bar' | 'area' | 'pie' | 'donut' — other entries are ignored.\",\n );\n }\n if (!SWITCHABLE_TYPES.includes(type)) {\n if (import.meta.env.DEV && valid.length > 0) {\n console.warn(\n 'Chart: the type switcher is unavailable when `type` is \"radialBar\".',\n );\n }\n return [];\n }\n const withCurrent = valid.includes(type as SwitchableType)\n ? valid\n : [type as SwitchableType, ...valid];\n return [...new Set(withCurrent)];\n }, [switchableTypes, type]);\n const switcherEnabled = switcherTypes.length >= 2;\n\n const [pickedType, setPickedType] = useState<SwitchableType | null>(null);\n const effectiveType: ChartType =\n switcherEnabled && pickedType && switcherTypes.includes(pickedType)\n ? pickedType\n : type;\n\n /* ---- data adaptation for the switcher --------------------------- */\n /* Axis and slice types read different `series` shapes. When the user */\n /* switches across that boundary the data adapts: each axis series */\n /* becomes one slice (its total across the categories), and slice */\n /* values become one axis series with `labels` as the categories. */\n /* Same-shape switches (line/bar/area, pie/donut) pass through as-is. */\n const declaredIsSlice = isSliceType(type);\n const effectiveIsSlice = isSliceType(effectiveType);\n const { effectiveSeries, effectiveCategories, effectiveLabels } =\n useMemo(() => {\n if (declaredIsSlice === effectiveIsSlice) {\n return {\n effectiveSeries: series,\n effectiveCategories: categories,\n effectiveLabels: labels,\n };\n }\n if (!declaredIsSlice) {\n const allRows = series as ChartSeries[];\n // A previous-period total is not a slice of the current whole, so\n // compare overlays are dropped from the axis→slice collapse (their\n // grey \"prev\" slice would misread as part of the current mix). This\n // also makes compareFlags naturally [] on the slice side.\n const rows = allRows.filter((row) => row.role !== 'compare');\n if (import.meta.env.DEV && rows.length !== allRows.length) {\n console.warn(\n 'Chart: compare series are dropped on an axis→slice switch — a previous-period total is not a slice of the current whole.',\n );\n }\n const totals = rows.map((row) =>\n row.data.reduce((sum, v) => sum + v, 0),\n );\n if (import.meta.env.DEV && totals.some((v) => v < 0)) {\n console.warn(\n 'Chart: the axis→slice adaptation produced a negative series total — pie/donut cannot represent negative values. Offer only axis types in `switchableTypes` for delta-style data.',\n );\n }\n return {\n effectiveSeries: totals,\n effectiveCategories: undefined,\n effectiveLabels: rows.map((row) => row.name),\n };\n }\n const values = series as number[];\n return {\n effectiveSeries: [\n { name: t('chart.table.value'), data: values },\n ] as ChartSeries[],\n effectiveCategories: labels ?? [],\n effectiveLabels: undefined,\n };\n }, [series, categories, labels, declaredIsSlice, effectiveIsSlice, t]);\n\n /* ---- imperative handle ----------------------------------------- */\n const agentHandle = useMemo<ChartHandle>(\n () => ({\n async dataURI(): Promise<string> {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return '';\n const result = await instance.dataURI();\n return (result as { imgURI: string }).imgURI;\n },\n updateSeries(next) {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return;\n // Callers always pass the DECLARED type's shape. When the user has\n // switched the view across the axis/slice boundary, convert to what\n // the live instance actually renders (mirrors the render-time\n // adaptation) so the update never hits a mismatched instance.\n const declaredSlice = isSliceType(type);\n const renderedSlice = isSliceType(effectiveType);\n if (declaredSlice === renderedSlice) {\n if (declaredSlice) instance.updateSeries(next as number[]);\n else instance.updateSeries(next as ChartSeries[]);\n return;\n }\n if (!declaredSlice) {\n // Drop compare overlays from the collapse (mirrors the render-time\n // adaptation) so no stray \"prev\" slice appears.\n const rows = (next as ChartSeries[]).filter(\n (row) => row.role !== 'compare',\n );\n // Keep slice labels in step with the incoming series — without\n // this, a series-count or name change desyncs slices from the\n // labels captured at the last React render.\n instance.updateOptions(\n { labels: rows.map((row) => row.name) },\n false,\n true,\n );\n instance.updateSeries(\n rows.map((row) => row.data.reduce((sum, v) => sum + v, 0)),\n );\n return;\n }\n instance.updateSeries([\n { name: t('chart.table.value'), data: next as number[] },\n ]);\n },\n setType(next: ChartType): boolean {\n if (!switcherEnabled) return false;\n if (!switcherTypes.includes(next as SwitchableType)) return false;\n setPickedType(next as SwitchableType);\n return true;\n },\n getTypeState() {\n return {\n declaredType: type,\n effectiveType,\n availableTypes: switcherEnabled\n ? ([...switcherTypes] as ChartType[])\n : [],\n };\n },\n }),\n [chartId, type, effectiveType, t, switcherEnabled, switcherTypes],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(chartAgent, agentHandle, id);\n\n /* ---- RTL detection --------------------------------------------- */\n const isRtl =\n typeof document !== 'undefined' && document.documentElement.dir === 'rtl';\n\n /* ---- normalised series for sr-only table ----------------------- */\n const tableSeries = useMemo(\n () => normaliseSeries(effectiveSeries, effectiveType),\n [effectiveSeries, effectiveType],\n );\n\n /* ---- Intl formatter -------------------------------------------- */\n const numberFormatter = useMemo(\n () => new Intl.NumberFormat(locale),\n [locale],\n );\n\n /* ---- resolved value formatter ---------------------------------- */\n /* The consumer's `valueFormatter` (e.g. a currency formatter) wins */\n /* everywhere a data-point value is surfaced as text; otherwise we */\n /* fall back to the locale-aware grouped number. */\n const formatValue = useMemo(\n () =>\n valueFormatter ?? ((value: number) => numberFormatter.format(value)),\n [valueFormatter, numberFormatter],\n );\n\n /* ---- toolbar localisation -------------------------------------- */\n const toolbarLocale = useMemo(\n () => ({\n name: locale,\n options: {\n toolbar: {\n download: t('chart.toolbar.download'),\n selection: t('chart.toolbar.selection'),\n selectionZoom: t('chart.toolbar.selectionZoom'),\n zoomIn: t('chart.toolbar.zoomIn'),\n zoomOut: t('chart.toolbar.zoomOut'),\n pan: t('chart.toolbar.pan'),\n reset: t('chart.toolbar.reset'),\n exportToSVG: t('chart.toolbar.exportToSVG'),\n exportToPNG: t('chart.toolbar.exportToPNG'),\n exportToCSV: t('chart.toolbar.exportToCSV'),\n },\n },\n }),\n [locale, t],\n );\n\n /* ---- build ApexOptions ----------------------------------------- */\n const reducedMotion = usePrefersReducedMotion();\n\n const chartOptions: ApexCharts.ApexOptions = useMemo(() => {\n // Split the resolved compare colours off the theme object BEFORE spread:\n // `base` is exactly today's theme shape (colours / chart / grid), so\n // `...base` emits the same keys as before. The theme no longer carries a\n // `compare` object — the redesign never uses grey; the compare fill is a\n // tint of the paired-primary hue, resolved below from a token.\n const base = themeOptions;\n\n // Per-series compare flags, derived at build time from the EFFECTIVE\n // series/type so the type switcher composes: only axis types carry the\n // `role` field (slice `series` is `number[]`), so a slice view yields [].\n const compareFlags =\n isCategoricalType(effectiveType) && Array.isArray(effectiveSeries)\n ? (effectiveSeries as ChartSeries[]).map((s) => s.role === 'compare')\n : [];\n const hasCompare = compareFlags.some(Boolean);\n const barCompare = hasCompare && effectiveType === 'bar';\n // The open-at-the-baseline bar rewrite (patchCompareBars) assumes the\n // baseline is the bbox BOTTOM — true only for vertical, non-negative bars.\n // A horizontal or negative compare bar keeps the native 4-sided dotted\n // outline (still a valid non-colour cue), so the hook is gated off for it.\n const compareHasNegative =\n barCompare &&\n (effectiveSeries as ChartSeries[]).some(\n (s) => s.role === 'compare' && s.data.some((v) => v < 0),\n );\n const openBottomBars =\n barCompare && orientation === 'vertical' && !compareHasNegative;\n // Compare fill opacity + per-series tints (legend swatch), resolved from\n // the token via the bridge so no hex literal lives in component code.\n const compareFillOpacity = hasCompare ? getCompareFillOpacity() : 0.3;\n\n if (\n import.meta.env.DEV &&\n hasCompare &&\n stacked &&\n isCategoricalType(effectiveType)\n ) {\n console.warn(\n 'Chart: `stacked` with a compare series — a compare overlay is normally a grouped, not stacked, series. It will be stacked with the primaries.',\n );\n }\n\n const options: ApexCharts.ApexOptions = {\n ...base,\n chart: {\n ...base.chart,\n id: chartId,\n toolbar: { show: toolbar },\n zoom: { enabled: toolbar },\n animations: {\n enabled: !reducedMotion,\n dynamicAnimation: { enabled: !reducedMotion },\n },\n locales: [toolbarLocale],\n defaultLocale: locale,\n parentHeightOffset: 0,\n // Stacking is an axis-only concept — gate on the categorical types\n // so a slice/radial chart never receives it, and omit the key\n // entirely when unstacked so the default output is byte-identical.\n ...(stacked && isCategoricalType(effectiveType)\n ? { stacked: true }\n : {}),\n },\n // Only set `labels` when the effective type actually has them (slice\n // charts). Emitting `labels: undefined` crashes ApexCharts' bar\n // renderer — `parseDataAxisCharts` reads `labels.length` and throws\n // \"Cannot read properties of undefined (reading 'length')\", which\n // aborts the render and leaves a blank chart. Absent is safe; area /\n // line tolerate the undefined but bar does not, so never pass it.\n ...(effectiveLabels ? { labels: effectiveLabels } : {}),\n legend: {\n ...base.legend,\n position: 'bottom',\n // ApexCharts legend.horizontalAlign is a physical prop mapped internally\n // to the chart's own text flow. For RTL we flip via `yaxis.opposite`\n // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored\n // to the inline-start by asking for 'left' on LTR and 'right' on RTL.\n horizontalAlign: isRtl ? 'right' : 'left',\n fontFamily: 'inherit',\n },\n tooltip: {\n ...base.tooltip,\n y: {\n formatter: (value: number) => formatValue(value),\n },\n },\n noData: {\n text: t('chart.noData'),\n },\n };\n\n // Consumer-supplied, already-resolved colour ramp wins over the theme\n // bridge's `colors`. Ignored when absent so existing charts keep the\n // tokenised ramp. ApexCharts can't read `var(--…)`, so the consumer is\n // responsible for sampling the live token value before passing it in.\n if (colors && colors.length > 0) {\n options.colors = colors;\n }\n\n // Step 1 (compare) — pair each compare series with a primary and inherit\n // its colour. The k-th `role:'compare'` pairs with the k-th `role:'primary'`\n // by order (clamped to the last primary; falls back to its own index when\n // there are zero primaries). Primaries keep ApexCharts' own %-cycled ramp\n // colour, so after this `options.colors[i]` is the full paired-primary\n // colour for EVERY series — used directly by the bar fill/outline and the\n // line stroke. The compare fill is tinted separately (fill.opacity); only\n // the LEGEND swatch shows the lighter tint (legend.markers.fillColors).\n if (hasCompare) {\n const ramp = (options.colors ?? base.colors ?? []) as string[];\n const rampAt = (i: number) => ramp[i % Math.max(ramp.length, 1)];\n const primaryIdx = (effectiveSeries as ChartSeries[])\n .map((s, i) => (s.role === 'compare' ? -1 : i))\n .filter((i) => i >= 0);\n let seen = 0;\n options.colors = (effectiveSeries as ChartSeries[]).map((s, i) => {\n if (s.role !== 'compare') return rampAt(i);\n const pair = primaryIdx.length\n ? primaryIdx[Math.min(seen++, primaryIdx.length - 1)]\n : i;\n return rampAt(pair); // inherit the paired primary's colour\n });\n // Legend swatch: compare shows the lighter tint (a shade of its paired\n // primary), primaries show their own colour. Decoupled from the mark\n // colour so the swatch reads as \"lighter = compare\".\n const compareTints = (options.colors as string[]).map((c, i) =>\n compareFlags[i] ? resolveCompareTint(c) : c,\n );\n options.legend = {\n ...options.legend,\n markers: {\n ...(options.legend?.markers ?? {}),\n fillColors: compareTints,\n },\n };\n }\n\n if (isCategoricalType(effectiveType)) {\n // A horizontal bar makes ApexCharts swap axes: the numeric axis\n // becomes the x-axis and the categories move to the y-axis. The value\n // formatter must follow the numbers, so on a horizontal bar it lives\n // on `xaxis.labels` and the category y-axis keeps its default (string)\n // labels; every other categorical chart keeps the formatter on `yaxis`.\n const horizontalBar =\n effectiveType === 'bar' && orientation === 'horizontal';\n options.xaxis = {\n ...base.xaxis,\n categories: effectiveCategories ?? [],\n ...(horizontalBar\n ? {\n labels: {\n formatter: (value: string | number) =>\n formatValue(Number(value)),\n },\n }\n : {}),\n };\n options.yaxis = {\n ...base.yaxis,\n opposite: isRtl,\n ...(horizontalBar\n ? {}\n : { labels: { formatter: (value: number) => formatValue(value) } }),\n };\n // Step 2 (compare) — the non-colour cue is a round-DOTTED stroke on the\n // compare indices (dotted-vs-solid, greyscale/print-safe). It works on\n // bars too: unlike a fill hatch, a per-series bar stroke width + dash\n // renders a dotted OUTLINE in the paired-primary colour. Line/area keep\n // width 2; a bar's outline width is COMPARE_OUTLINE_WIDTH on compare\n // indices and 0 on primaries (solid, fill-only). `lineCap:'round'` turns\n // the 0-length dash into round dots. When there is no compare series the\n // stroke is byte-identical to before (no lineCap / dashArray key).\n options.stroke = {\n curve,\n width:\n effectiveType === 'bar'\n ? hasCompare\n ? compareFlags.map((c) => (c ? COMPARE_OUTLINE_WIDTH : 0))\n : 0\n : 2,\n ...(hasCompare\n ? {\n lineCap: 'round' as const,\n // Runtime accepts a string dash; the published types say\n // `number` → one documented cast. `'0 6'` + round cap ⇒ dots.\n dashArray: compareFlags.map((c) =>\n c ? COMPARE_DOT_DASH : 0,\n ) as unknown as number[],\n }\n : {}),\n };\n options.dataLabels = { enabled: false };\n }\n\n if (effectiveType === 'radialBar' && radialValueFormatter) {\n // ApexCharts treats a radialBar series value as a 0–100 percent and\n // renders it verbatim in the ring centre. When the displayed value is\n // NOT a percentage (e.g. a BMI), the consumer scales the series to a\n // percent for the arc and supplies `radialValueFormatter` to print the\n // real value in the centre. Without this, the gauge would read \"56%\"\n // for a BMI of 22.4 — misleading. Default behaviour is untouched.\n const basePlot = (base.plotOptions ?? {}) as NonNullable<\n ApexCharts.ApexOptions['plotOptions']\n >;\n options.plotOptions = {\n ...basePlot,\n radialBar: {\n ...(basePlot.radialBar ?? {}),\n dataLabels: {\n ...(basePlot.radialBar?.dataLabels ?? {}),\n value: {\n ...(basePlot.radialBar?.dataLabels?.value ?? {}),\n formatter: (val: number) => radialValueFormatter(Number(val)),\n },\n },\n },\n };\n }\n\n // Horizontal bars for rankings. `bar` and `radialBar` are mutually\n // exclusive effective types, so this never collides with the radialBar\n // plotOptions above. Absent (vertical) = the ApexCharts default, so the\n // key is only emitted when the consumer opts in.\n if (effectiveType === 'bar' && orientation === 'horizontal') {\n const basePlot = (base.plotOptions ?? {}) as NonNullable<\n ApexCharts.ApexOptions['plotOptions']\n >;\n options.plotOptions = {\n ...basePlot,\n bar: { ...(basePlot.bar ?? {}), horizontal: true },\n };\n }\n\n // Step 3 (fill) — the compare branches sit between the global `patterns`\n // branch and the area-gradient branch. Each is gated on hasCompare /\n // barCompare, so a chart with no compare series follows today's exact\n // paths and emits byte-identical fill.\n if (patterns) {\n // Colour-blind pattern mode. With a compare overlay the compare indices\n // drop the hatch and use a plain tinted solid fill (their dotted outline\n // / stroke from Step 2 is already the non-colour cue), so they read as a\n // lighter ghost of the primary; the primaries keep the cycled hatch.\n options.fill = {\n type: hasCompare\n ? compareFlags.map((c) => (c ? 'solid' : 'pattern'))\n : 'pattern',\n opacity: hasCompare\n ? compareFlags.map((c) =>\n c ? compareFillOpacity : effectiveType === 'area' ? 0.3 : 1,\n )\n : effectiveType === 'area'\n ? 0.3\n : 1,\n pattern: {\n style: [...PATTERN_STYLES],\n strokeWidth: 2,\n },\n };\n } else if (barCompare) {\n // Tinted solid fill: compare bars are their paired-primary hue at\n // `--chart-compare-fill-opacity`; primaries stay solid at full opacity.\n // The dotted outline (Step 2 stroke width) + open-bottom rewrite\n // (patchCompareBars, wired via chart.events below) supply the shape.\n options.fill = {\n type: 'solid',\n opacity: compareFlags.map((c) => (c ? compareFillOpacity : 1)),\n };\n } else if (effectiveType === 'area') {\n // Area gradient. With a compare overlay the compare fill drops to the\n // tint opacity so it sits under the dotted paired-primary stroke without\n // fighting the primary; primaries keep the default gradient. No grey —\n // the tint is a shade of the same (paired-primary) hue from Step 1.\n options.fill = hasCompare\n ? {\n type: 'gradient',\n opacity: compareFlags.map((c) => (c ? compareFillOpacity : 0.3)),\n }\n : {\n type: 'gradient',\n opacity: 0.3,\n };\n }\n\n // Open-at-the-baseline bar outline (progressive enhancement over the\n // native dotted 4-sided border). Attached ONLY for vertical, non-negative\n // compare bars; horizontal / negative bars keep the closed dotted outline.\n // Added inside this branch so a chart without open-bottom bars never gets\n // an `events` key (byte-identical). Re-fires on mount / update / animation\n // end — jointly covering mount, resize, theme change, and series updates.\n if (openBottomBars) {\n const compareRealIndexes = compareFlags\n .map((c, i) => (c ? i : -1))\n .filter((i) => i >= 0);\n const run = () =>\n patchCompareBars(wrapperRef.current, compareRealIndexes);\n const raf = () =>\n typeof requestAnimationFrame === 'function'\n ? requestAnimationFrame(run)\n : run();\n options.chart = {\n ...options.chart,\n events: {\n ...(options.chart?.events ?? {}),\n mounted: () => raf(),\n updated: () => raf(),\n animationEnd: () => run(),\n },\n };\n }\n\n return options;\n }, [\n themeOptions,\n chartId,\n toolbar,\n reducedMotion,\n toolbarLocale,\n locale,\n effectiveLabels,\n formatValue,\n t,\n effectiveType,\n effectiveSeries,\n effectiveCategories,\n isRtl,\n patterns,\n stacked,\n orientation,\n curve,\n colors,\n radialValueFormatter,\n ]);\n\n /* ---- resolved dimensions --------------------------------------- */\n const resolvedWidth =\n width ?? (containerWidth > 0 ? containerWidth : '100%');\n const resolvedHeight = height ?? 320;\n\n /* ---- sr-only data table --------------------------------------- */\n const srTable = useMemo(() => {\n const columnLabels = isSliceType(effectiveType)\n ? (effectiveLabels ?? [])\n : (effectiveCategories ?? []);\n const rows = tableSeries;\n return (\n <table id={summaryId} className=\"ds:sr-only\">\n <caption>{title}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{t('chart.table.series')}</th>\n {columnLabels.map((col, i) => (\n <th key={`${col}-${i}`} scope=\"col\">\n {col}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row, rowIndex) => (\n <tr key={`${row.name}-${rowIndex}`}>\n <th scope=\"row\">{row.name || t('chart.table.value')}</th>\n {row.data.map((value, colIndex) => (\n <td key={`${rowIndex}-${colIndex}`}>\n {/* For a radialBar gauge the series is a synthetic arc\n percent — announce the consumer's display value (e.g.\n the real BMI) instead of the raw fill so AT users get\n the same figure sighted users see in the ring. */}\n {effectiveType === 'radialBar' && radialValueFormatter\n ? radialValueFormatter(value)\n : formatValue(value)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }, [\n effectiveType,\n tableSeries,\n effectiveLabels,\n effectiveCategories,\n summaryId,\n title,\n t,\n formatValue,\n radialValueFormatter,\n ]);\n\n /* ---- ApexCharts `series` prop shape ----------------------------- */\n const apexSeries = useMemo(() => {\n if (isSliceType(effectiveType)) {\n return effectiveSeries as number[];\n }\n return effectiveSeries as ChartSeries[];\n }, [effectiveSeries, effectiveType]);\n\n /* `key={effectiveType}` remounts ApexCharts on a switch: its in-place\n axis↔slice type transitions are unreliable (stale internal scales),\n and a clean mount is the documented-safe path. */\n const chartRegion = (\n <div\n ref={wrapperRef}\n role=\"img\"\n aria-label={title}\n aria-describedby={summaryId}\n className={chartVariants({\n // Explicit height wins over the density min-height unless the\n // caller also asked for a density explicitly.\n density: density ?? (height !== undefined ? 'none' : undefined),\n className: switcherEnabled ? undefined : className,\n })}\n {...(switcherEnabled\n ? {}\n : { 'data-component': 'chart', 'data-component-id': id })}\n >\n {srTable}\n <ReactApexChart\n key={effectiveType}\n type={effectiveType}\n series={apexSeries as ApexCharts.ApexOptions['series']}\n options={chartOptions}\n width={resolvedWidth}\n height={resolvedHeight}\n aria-hidden=\"true\"\n />\n </div>\n );\n\n if (!switcherEnabled) return chartRegion;\n\n /* The switcher cannot live inside the `role=\"img\"` region — that role\n makes the whole subtree presentational, which would strip the radios\n from the accessibility tree. It renders as a sibling above the plot,\n and the bounding `data-component` marker moves to this shared\n wrapper so the component boundary still encloses everything. */\n return (\n <div\n data-component=\"chart\"\n data-component-id={id}\n className={`ds:block ds:w-full ${className ?? ''}`.trim()}\n >\n <div className=\"ds:mb-[var(--spacing-xs)] ds:flex ds:justify-end\">\n <IconButtonGroup\n role=\"radiogroup\"\n mode=\"toggle-single\"\n size=\"sm\"\n aria-label={t('chart.typeSwitcher.label')}\n value={effectiveType}\n onValueChange={(next) => {\n // Guard: keyboard paths can re-commit the current value; the\n // contract is \"called when the user picks a DIFFERENT type\".\n if (next === effectiveType) return;\n setPickedType(next as SwitchableType);\n onTypeChange?.(next as ChartType);\n }}\n >\n {switcherTypes.map((entry) => (\n <IconButton\n key={entry}\n value={entry}\n // Explicit — the default (submit) would post a surrounding\n // consumer <form> on click/Space.\n type=\"button\"\n icon={TYPE_SWITCHER_ICONS[entry]}\n aria-label={t(TYPE_SWITCHER_LABEL_KEYS[entry])}\n />\n ))}\n </IconButtonGroup>\n </div>\n {chartRegion}\n </div>\n );\n },\n);\n\nChart.displayName = 'Chart';\n\n/* ------------------------------------------------------------------ */\n/* Re-export internal helper for downstream theming (kept narrow). */\n/* ------------------------------------------------------------------ */\n\nexport { chartVariants };\n"],"names":["__iconNode","ChartArea","createLucideIcon","ChartColumn","ChartLine","ChartPie","Donut","chartAgent","handle","args","chartVariants","cva","PATTERN_STYLES","CATEGORICAL_TYPES","SLICE_TYPES","SWITCHABLE_TYPES","TYPE_SWITCHER_LABEL_KEYS","TYPE_SWITCHER_ICONS","COMPARE_OUTLINE_WIDTH","COMPARE_DOT_DASH","patchCompareBars","root","compareRealIndexes","g","ri","p","b","isSliceType","type","isCategoricalType","normaliseSeries","series","Chart","forwardRef","title","id","categories","labels","height","width","patterns","stacked","orientation","curve","colors","toolbar","localeProp","radialValueFormatter","valueFormatter","switchableTypes","onTypeChange","density","className","ref","t","i18n","useTranslation","rawId","useId","chartId","useMemo","summaryId","wrapperRef","useRef","containerWidth","setContainerWidth","useState","useNeutraliseHiddenFocus","locale","themeOptions","setThemeOptions","getApexChartsTheme","useEffect","timer","observer","el","ro","entries","entry","switcherTypes","valid","withCurrent","switcherEnabled","pickedType","setPickedType","effectiveType","declaredIsSlice","effectiveIsSlice","effectiveSeries","effectiveCategories","effectiveLabels","rows","row","sum","v","values","agentHandle","instance","ApexCharts","next","declaredSlice","renderedSlice","useImperativeHandle","useAgentRegistration","isRtl","tableSeries","numberFormatter","formatValue","value","toolbarLocale","reducedMotion","usePrefersReducedMotion","chartOptions","base","compareFlags","s","hasCompare","barCompare","compareHasNegative","openBottomBars","compareFillOpacity","getCompareFillOpacity","options","ramp","rampAt","i","primaryIdx","seen","pair","compareTints","c","resolveCompareTint","_a","horizontalBar","basePlot","_b","_d","_c","val","run","raf","_e","resolvedWidth","resolvedHeight","srTable","columnLabels","jsx","jsxs","col","rowIndex","colIndex","apexSeries","chartRegion","ReactApexChart","IconButtonGroup","IconButton"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,KAAYC,EAAiB,cAAcF,EAAU;ACnB3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,GACMG,KAAcD,EAAiB,gBAAgBF,EAAU;ACf/D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,4BAA4B,KAAK,SAAQ,CAAE;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,qBAAqB,KAAK,SAAQ,CAAE;AACpD,GACMI,KAAYF,EAAiB,cAAcF,EAAU;ACb3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,mCAAmC,KAAK,SAAQ,CAAE;AAClE,GACMK,KAAWH,EAAiB,aAAaF,EAAU;ACnBzD;AAAA;AAAA;AAAA;AAAA;AA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ACL,MAAK;AAAA,cACL,cAAYpG,EAAE,0BAA0B;AAAA,cACxC,OAAO+B;AAAA,cACP,eAAe,CAACc,MAAS;AAGvB,gBAAIA,MAASd,MACbD,GAAce,CAAsB,GACpCjD,KAAA,QAAAA,EAAeiD;AAAA,cACjB;AAAA,cAEC,UAAApB,EAAc,IAAI,CAACD,MAClB,gBAAAoE;AAAA,gBAACS;AAAA,gBAAA;AAAA,kBAEC,OAAO7E;AAAA,kBAGP,MAAK;AAAA,kBACL,MAAM7D,GAAoB6D,CAAK;AAAA,kBAC/B,cAAYxB,EAAEtC,GAAyB8D,CAAK,CAAC;AAAA,gBAAA;AAAA,gBANxCA;AAAA,cAAA,CAQR;AAAA,YAAA;AAAA,UAAA,GAEL;AAAA,UACC0E;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,IAzCwBA;AAAA,EA4C/B;AACF;AAEAxH,GAAM,cAAc;","x_google_ignoreList":[0,1,2,3,4]}
@@ -2,7 +2,7 @@ import { jsxs as v, jsx as i, Fragment as ge } from "react/jsx-runtime";
2
2
  import { forwardRef as ve, useId as ye, useRef as w, useCallback as W, useImperativeHandle as be, useMemo as xe } from "react";
3
3
  import { c as Ie } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as ke } from "react-i18next";
5
- import { I as q } from "./icon-button-9c9Gp41m.js";
5
+ import { I as q } from "./icon-button-DA2CAGHZ.js";
6
6
  import { u as we } from "./use-controllable-state-BiY4xTzM.js";
7
7
  import { u as Ce } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
8
8
  import { u as Ne } from "./registry-DvAUVLHh.js";
@@ -366,4 +366,4 @@ export {
366
366
  Se as P,
367
367
  Te as c
368
368
  };
369
- //# sourceMappingURL=chat-input-BqI9GXQh.js.map
369
+ //# sourceMappingURL=chat-input-BsB5Umpj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-input-BqI9GXQh.js","sources":["../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs","../../src/components/chat-input/chat-input.agent.ts","../../src/components/chat-input/chat-input.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\",\n key: \"1miecu\"\n }\n ]\n];\nconst Paperclip = createLucideIcon(\"paperclip\", __iconNode);\n\nexport { __iconNode, Paperclip as default };\n//# sourceMappingURL=paperclip.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — ChatInput. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ChatInputHandle } from './chat-input';\n\nexport const chatInputAgent: AgentAdapter<ChatInputHandle> = {\n id: 'chat-input',\n capabilities: ['edit_inline', 'submit'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.chatInput.state.value',\n description: 'Current text in the composer.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.chatInput.state.isEmpty',\n description: 'True when the composer has no text.',\n read: (handle) => handle.isEmpty(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'New composer text, replacing the current value.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.setValue',\n description: 'Replace the composer text.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards whatever the user has typed — irreversible from this UI.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.clear',\n description: 'Clear the composer. Irreversible from the same UI.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n submit: {\n safety: 'write',\n // Hands the composer text to the host `onSubmit` callback, which sends\n // the message to a backend / model — an external side effect.\n openWorld: true,\n descriptionKey: 'ui.agent.chatInput.actions.submit',\n description: 'Submit the current composer state via onSubmit.',\n invoke: (handle) => {\n handle.submit();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.chatInput.actions.focus',\n description: 'Move keyboard focus into the textarea.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'chat-input',\n description: 'Marks the ChatInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ChangeEvent,\n type CompositionEvent,\n type KeyboardEvent,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert, Paperclip, Send } from 'lucide-react';\nimport { IconButton } from '../button';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chatInputAgent } from './chat-input.agent';\n\nconst rootVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full',\n // Uses the kit's shared input-chrome tokens — `--input` for fill,\n // `--shadow-input` for the halo. Border stays at 1px (`--border`,\n // softened to `grey-700` in light) so the focus-within override and\n // forced-colors fallback both still paint a visible edge.\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-input ds:shadow-[var(--shadow-input)]',\n 'ds:focus-within:border-[color:var(--primary)]',\n 'ds:transition-[border-color,box-shadow] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\ntype NativeTextareaProps = Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'size' | 'onSubmit' | 'children'\n>;\n\n/** Curated imperative handle for agent / external automation. */\nexport interface ChatInputHandle {\n getValue: () => string;\n isEmpty: () => boolean;\n setValue: (value: string) => void;\n clear: () => void;\n submit: () => void;\n focus: () => void;\n}\n\nexport interface ChatInputProps\n extends NativeTextareaProps, VariantProps<typeof rootVariants> {\n /** Invoked when the user submits (Cmd/Ctrl+Enter, or send button). */\n onSubmit?: (text: string) => void;\n /** Maximum allowed characters (grapheme clusters via Intl.Segmenter when available). */\n maxLength?: number;\n /** When true, plain Enter submits and Shift+Enter inserts a newline.\n * Default false (Enter inserts newline; Cmd/Ctrl+Enter submits). */\n submitOnEnter?: boolean;\n /** Minimum visible rows. Default 1. */\n minRows?: number;\n /** Maximum visible rows before the field scrolls. Default 8. */\n maxRows?: number;\n /** Optional attachment handler — when provided, renders the attachment button. */\n onAttach?: (files: FileList) => void;\n /** `accept` forwarded to the hidden file input. */\n accept?: string;\n /** Controls whether the textarea is disabled and submit is blocked. */\n disabled?: boolean;\n /** Optional slot placed between the textarea and the send button. */\n toolbar?: ReactNode;\n /** Visible label above the textarea. When omitted, a visually-hidden label is used. */\n label?: string;\n}\n\nfunction graphemeCount(value: string, locale: string): number {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n let n = 0;\n for (const _s of seg.segment(value)) n += 1;\n return n;\n } catch {\n /* fall through to Array.from */\n }\n }\n return Array.from(value).length;\n}\n\n/** Truncate `value` to at most `max` graphemes. Returns the original\n * string when it already fits so callers can compare references. */\nfunction truncateToGraphemes(\n value: string,\n max: number,\n locale: string,\n): string {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n const parts: string[] = [];\n for (const s of seg.segment(value)) {\n parts.push(s.segment);\n if (parts.length >= max) break;\n }\n const joined = parts.join('');\n return joined.length === value.length ? value : joined;\n } catch {\n /* fall through to code-point split */\n }\n }\n const cps = Array.from(value);\n return cps.length <= max ? value : cps.slice(0, max).join('');\n}\n\nexport const ChatInput = forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n size = 'md',\n value,\n defaultValue,\n maxLength,\n submitOnEnter = false,\n minRows = 1,\n maxRows = 8,\n onSubmit,\n onAttach,\n accept,\n disabled,\n toolbar,\n label,\n placeholder,\n className,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const textareaId = useId();\n const composingRef = useRef(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n const setRefs = useCallback((node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n }, []);\n\n const [currentValueRaw, setChatValue] = useControllableState<string>({\n value: value === undefined ? undefined : String(value),\n defaultValue: String(defaultValue ?? ''),\n });\n const currentValue = currentValueRaw ?? '';\n\n const count = graphemeCount(currentValue, i18n.language);\n const hasMaxLength = typeof maxLength === 'number' && maxLength > 0;\n const remaining = hasMaxLength ? Math.max(0, maxLength - count) : 0;\n const showCounter = hasMaxLength && count > (maxLength as number) * 0.9;\n const atLimit = hasMaxLength && count >= maxLength;\n\n /* Auto-grow — compute height from scrollHeight, clamped to [minRows, maxRows].\n Imperative `.style` write is permitted per 23-constraints\n §Runtime-computed dimensions (textarea scrollHeight measurement). */\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el) return;\n const styles = window.getComputedStyle(el);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const padTop = parseFloat(styles.paddingTop) || 0;\n const padBot = parseFloat(styles.paddingBottom) || 0;\n const borderTop = parseFloat(styles.borderTopWidth) || 0;\n const borderBot = parseFloat(styles.borderBottomWidth) || 0;\n const chrome = padTop + padBot + borderTop + borderBot;\n const minH = lineHeight * minRows + chrome;\n const maxH = lineHeight * maxRows + chrome;\n el.style.height = 'auto';\n const next = Math.max(minH, Math.min(el.scrollHeight, maxH));\n el.style.height = `${next}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [minRows, maxRows]);\n\n useIsomorphicLayoutEffect(() => {\n resize();\n }, [resize, currentValue]);\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {\n let next = e.target.value;\n // Enforce a grapheme cap so emoji like 👨‍👩‍👧 (1 grapheme, 11 UTF-16\n // units) stay aligned with the visible counter. Skip during IME\n // composition so the in-progress text is preserved verbatim.\n if (hasMaxLength && !composingRef.current) {\n next = truncateToGraphemes(next, maxLength as number, i18n.language);\n }\n setChatValue(next);\n if (composingRef.current) return;\n onChange?.(e);\n };\n\n const handleCompositionStart = (\n e: CompositionEvent<HTMLTextAreaElement>,\n ) => {\n composingRef.current = true;\n onCompositionStart?.(e);\n };\n const handleCompositionEnd = (e: CompositionEvent<HTMLTextAreaElement>) => {\n composingRef.current = false;\n onCompositionEnd?.(e);\n };\n\n const isIMEKey = (e: KeyboardEvent<HTMLTextAreaElement>) =>\n e.nativeEvent.isComposing || e.keyCode === 229 || composingRef.current;\n\n const submit = () => {\n const text = currentValue.trim();\n if (!text || disabled || atLimit) return;\n onSubmit?.(currentValue);\n setChatValue('');\n // Keep focus in the composer after a send. Activating the Send *button*\n // (click, or keyboard Enter/Space) otherwise strands focus: clearing the\n // value re-disables the button on the next render, so focus falls to\n // <body> and a keyboard user must re-traverse back to the textarea.\n // Refocusing leaves the composer ready for the next message — a no-op for\n // the Enter-to-send path, where focus is already in the textarea.\n innerRef.current?.focus();\n };\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<ChatInputHandle>(\n () => ({\n getValue: () => currentValue,\n isEmpty: () => !currentValue.trim(),\n setValue: (next: string) => {\n setChatValue(next);\n },\n clear: () => {\n setChatValue('');\n },\n submit: () => {\n submit();\n },\n focus: () => {\n innerRef.current?.focus();\n },\n }),\n // `submit` is a local closure that always sees the latest currentValue\n // via React's render cycle — depend on currentValue so the handle\n // picks up new values across renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentValue, setChatValue],\n );\n useAgentRegistration(chatInputAgent, agentHandle, id);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (isIMEKey(e)) return;\n\n if (e.key === 'Enter') {\n const explicitSubmit = e.metaKey || e.ctrlKey;\n const plainEnterSubmits = submitOnEnter && !e.shiftKey;\n if (explicitSubmit || plainEnterSubmits) {\n e.preventDefault();\n submit();\n }\n }\n };\n\n const handleAttach = () => {\n fileInputRef.current?.click();\n };\n\n const handleFilePick = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onAttach?.(e.target.files);\n }\n // Reset so picking the same file twice still fires change.\n e.target.value = '';\n };\n\n const effectiveId = id ?? textareaId;\n const labelId = `${effectiveId}-label`;\n const counterId = hasMaxLength ? `${effectiveId}-counter` : undefined;\n const hintId = `${effectiveId}-hint`;\n\n const resolvedPlaceholder = placeholder ?? t('chat.input.placeholder');\n const resolvedLabel = label ?? t('chat.prompt');\n\n return (\n <div\n ref={rootRef}\n data-component=\"chat-input\"\n data-component-id={id}\n className={rootVariants({ size, className })}\n >\n <label\n id={labelId}\n htmlFor={effectiveId}\n className={\n label\n ? 'type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]'\n : 'ds:sr-only'\n }\n >\n {resolvedLabel}\n </label>\n <textarea\n ref={setRefs}\n id={effectiveId}\n value={currentValue}\n disabled={disabled}\n rows={minRows}\n placeholder={resolvedPlaceholder}\n aria-labelledby={labelId}\n aria-describedby={\n [counterId, hintId].filter(Boolean).join(' ') || undefined\n }\n aria-invalid={atLimit || undefined}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={[\n 'ds:w-full ds:resize-none ds:bg-transparent',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]',\n 'ds:placeholder:text-[color:var(--muted-foreground)]',\n 'ds:leading-[var(--line-height-base)]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n // Tokenised focus ring on the textarea itself — the 1px border\n // shift on the wrapper alone fails the 3px accessible-theme\n // requirement. See a11y-critical-fixes.mdx.\n 'ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n {...rest}\n />\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]\">\n {onAttach ? (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"ds:sr-only\"\n multiple\n accept={accept}\n onChange={handleFilePick}\n aria-label={t('chat.input.attach')}\n tabIndex={-1}\n />\n <IconButton\n icon={<Paperclip />}\n aria-label={t('chat.input.attach')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={handleAttach}\n disabled={disabled}\n />\n </>\n ) : null}\n {toolbar}\n <div className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {showCounter ? (\n <span\n id={counterId}\n aria-live=\"polite\"\n className={[\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:tabular-nums',\n atLimit\n ? 'ds:text-[color:var(--destructive)]'\n : 'ds:text-[color:var(--muted-foreground)]',\n ].join(' ')}\n >\n {atLimit ? (\n // Icon pairs with --destructive colour so the at-limit\n // state is not conveyed by hue alone (WCAG 1.4.1).\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-3.5\" />\n ) : null}\n {t('chat.input.remaining', { count: remaining })}\n </span>\n ) : null}\n <span id={hintId} className=\"ds:sr-only\">\n {t('chat.input.sendHint')}\n </span>\n <IconButton\n icon={<Send />}\n aria-label={t('chat.send')}\n intent=\"primary\"\n size=\"sm\"\n disabled={disabled || !currentValue.trim() || atLimit}\n onClick={submit}\n aria-keyshortcuts=\"Meta+Enter Control+Enter\"\n />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatInput.displayName = 'ChatInput';\n"],"names":["__iconNode","Paperclip","createLucideIcon","chatInputAgent","handle","args","rootVariants","cva","graphemeCount","value","locale","seg","n","_s","truncateToGraphemes","max","parts","s","joined","cps","ChatInput","forwardRef","size","defaultValue","maxLength","submitOnEnter","minRows","maxRows","onSubmit","onAttach","accept","disabled","toolbar","label","placeholder","className","onChange","onKeyDown","onCompositionStart","onCompositionEnd","id","rest","ref","t","i18n","useTranslation","textareaId","useId","composingRef","useRef","fileInputRef","innerRef","setRefs","useCallback","node","currentValueRaw","setChatValue","useControllableState","currentValue","count","hasMaxLength","remaining","showCounter","atLimit","resize","el","styles","lineHeight","padTop","padBot","borderTop","borderBot","chrome","minH","maxH","next","useIsomorphicLayoutEffect","handleChange","handleCompositionStart","handleCompositionEnd","isIMEKey","submit","_a","rootRef","useImperativeHandle","agentHandle","useMemo","useAgentRegistration","handleKeyDown","explicitSubmit","plainEnterSubmits","handleAttach","handleFilePick","effectiveId","labelId","counterId","hintId","resolvedPlaceholder","resolvedLabel","jsxs","jsx","Fragment","IconButton","CircleAlert","Send"],"mappings":";;;;;;;;;;;AAAA;AAAA;AA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tD;AAAA,oBACH5D,EAAE,wBAAwB,EAAE,OAAOkB,GAAW;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA,IAE/C;AAAA,cACJ,gBAAAuC,EAAC,UAAK,IAAIJ,GAAQ,WAAU,cACzB,UAAArD,EAAE,qBAAqB,GAC1B;AAAA,cACA,gBAAAyD;AAAA,gBAACE;AAAA,gBAAA;AAAA,kBACC,wBAAOE,IAAA,EAAK;AAAA,kBACZ,cAAY7D,EAAE,WAAW;AAAA,kBACzB,QAAO;AAAA,kBACP,MAAK;AAAA,kBACL,UAAUZ,KAAY,CAAC2B,EAAa,UAAUK;AAAA,kBAC9C,SAASkB;AAAA,kBACT,qBAAkB;AAAA,gBAAA;AAAA,cAAA;AAAA,YACpB,EAAA,CACF;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA7D,GAAU,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"chat-input-BsB5Umpj.js","sources":["../../node_modules/lucide-react/dist/esm/icons/paperclip.mjs","../../src/components/chat-input/chat-input.agent.ts","../../src/components/chat-input/chat-input.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\",\n key: \"1miecu\"\n }\n ]\n];\nconst Paperclip = createLucideIcon(\"paperclip\", __iconNode);\n\nexport { __iconNode, Paperclip as default };\n//# sourceMappingURL=paperclip.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — ChatInput. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ChatInputHandle } from './chat-input';\n\nexport const chatInputAgent: AgentAdapter<ChatInputHandle> = {\n id: 'chat-input',\n capabilities: ['edit_inline', 'submit'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.chatInput.state.value',\n description: 'Current text in the composer.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.chatInput.state.isEmpty',\n description: 'True when the composer has no text.',\n read: (handle) => handle.isEmpty(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'New composer text, replacing the current value.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.setValue',\n description: 'Replace the composer text.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards whatever the user has typed — irreversible from this UI.\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.chatInput.actions.clear',\n description: 'Clear the composer. Irreversible from the same UI.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n submit: {\n safety: 'write',\n // Hands the composer text to the host `onSubmit` callback, which sends\n // the message to a backend / model — an external side effect.\n openWorld: true,\n descriptionKey: 'ui.agent.chatInput.actions.submit',\n description: 'Submit the current composer state via onSubmit.',\n invoke: (handle) => {\n handle.submit();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.chatInput.actions.focus',\n description: 'Move keyboard focus into the textarea.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'chat-input',\n description: 'Marks the ChatInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ChangeEvent,\n type CompositionEvent,\n type KeyboardEvent,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { CircleAlert, Paperclip, Send } from 'lucide-react';\nimport { IconButton } from '../button';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { chatInputAgent } from './chat-input.agent';\n\nconst rootVariants = cva(\n [\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full',\n // Uses the kit's shared input-chrome tokens — `--input` for fill,\n // `--shadow-input` for the halo. Border stays at 1px (`--border`,\n // softened to `grey-700` in light) so the focus-within override and\n // forced-colors fallback both still paint a visible edge.\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-input ds:shadow-[var(--shadow-input)]',\n 'ds:focus-within:border-[color:var(--primary)]',\n 'ds:transition-[border-color,box-shadow] ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\ntype NativeTextareaProps = Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'size' | 'onSubmit' | 'children'\n>;\n\n/** Curated imperative handle for agent / external automation. */\nexport interface ChatInputHandle {\n getValue: () => string;\n isEmpty: () => boolean;\n setValue: (value: string) => void;\n clear: () => void;\n submit: () => void;\n focus: () => void;\n}\n\nexport interface ChatInputProps\n extends NativeTextareaProps, VariantProps<typeof rootVariants> {\n /** Invoked when the user submits (Cmd/Ctrl+Enter, or send button). */\n onSubmit?: (text: string) => void;\n /** Maximum allowed characters (grapheme clusters via Intl.Segmenter when available). */\n maxLength?: number;\n /** When true, plain Enter submits and Shift+Enter inserts a newline.\n * Default false (Enter inserts newline; Cmd/Ctrl+Enter submits). */\n submitOnEnter?: boolean;\n /** Minimum visible rows. Default 1. */\n minRows?: number;\n /** Maximum visible rows before the field scrolls. Default 8. */\n maxRows?: number;\n /** Optional attachment handler — when provided, renders the attachment button. */\n onAttach?: (files: FileList) => void;\n /** `accept` forwarded to the hidden file input. */\n accept?: string;\n /** Controls whether the textarea is disabled and submit is blocked. */\n disabled?: boolean;\n /** Optional slot placed between the textarea and the send button. */\n toolbar?: ReactNode;\n /** Visible label above the textarea. When omitted, a visually-hidden label is used. */\n label?: string;\n}\n\nfunction graphemeCount(value: string, locale: string): number {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n let n = 0;\n for (const _s of seg.segment(value)) n += 1;\n return n;\n } catch {\n /* fall through to Array.from */\n }\n }\n return Array.from(value).length;\n}\n\n/** Truncate `value` to at most `max` graphemes. Returns the original\n * string when it already fits so callers can compare references. */\nfunction truncateToGraphemes(\n value: string,\n max: number,\n locale: string,\n): string {\n if (typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function') {\n try {\n const seg = new Intl.Segmenter(locale, { granularity: 'grapheme' });\n const parts: string[] = [];\n for (const s of seg.segment(value)) {\n parts.push(s.segment);\n if (parts.length >= max) break;\n }\n const joined = parts.join('');\n return joined.length === value.length ? value : joined;\n } catch {\n /* fall through to code-point split */\n }\n }\n const cps = Array.from(value);\n return cps.length <= max ? value : cps.slice(0, max).join('');\n}\n\nexport const ChatInput = forwardRef<HTMLDivElement, ChatInputProps>(\n (\n {\n size = 'md',\n value,\n defaultValue,\n maxLength,\n submitOnEnter = false,\n minRows = 1,\n maxRows = 8,\n onSubmit,\n onAttach,\n accept,\n disabled,\n toolbar,\n label,\n placeholder,\n className,\n onChange,\n onKeyDown,\n onCompositionStart,\n onCompositionEnd,\n id,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const textareaId = useId();\n const composingRef = useRef(false);\n const fileInputRef = useRef<HTMLInputElement>(null);\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n const setRefs = useCallback((node: HTMLTextAreaElement | null) => {\n innerRef.current = node;\n }, []);\n\n const [currentValueRaw, setChatValue] = useControllableState<string>({\n value: value === undefined ? undefined : String(value),\n defaultValue: String(defaultValue ?? ''),\n });\n const currentValue = currentValueRaw ?? '';\n\n const count = graphemeCount(currentValue, i18n.language);\n const hasMaxLength = typeof maxLength === 'number' && maxLength > 0;\n const remaining = hasMaxLength ? Math.max(0, maxLength - count) : 0;\n const showCounter = hasMaxLength && count > (maxLength as number) * 0.9;\n const atLimit = hasMaxLength && count >= maxLength;\n\n /* Auto-grow — compute height from scrollHeight, clamped to [minRows, maxRows].\n Imperative `.style` write is permitted per 23-constraints\n §Runtime-computed dimensions (textarea scrollHeight measurement). */\n const resize = useCallback(() => {\n const el = innerRef.current;\n if (!el) return;\n const styles = window.getComputedStyle(el);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const padTop = parseFloat(styles.paddingTop) || 0;\n const padBot = parseFloat(styles.paddingBottom) || 0;\n const borderTop = parseFloat(styles.borderTopWidth) || 0;\n const borderBot = parseFloat(styles.borderBottomWidth) || 0;\n const chrome = padTop + padBot + borderTop + borderBot;\n const minH = lineHeight * minRows + chrome;\n const maxH = lineHeight * maxRows + chrome;\n el.style.height = 'auto';\n const next = Math.max(minH, Math.min(el.scrollHeight, maxH));\n el.style.height = `${next}px`;\n el.style.overflowY = el.scrollHeight > maxH ? 'auto' : 'hidden';\n }, [minRows, maxRows]);\n\n useIsomorphicLayoutEffect(() => {\n resize();\n }, [resize, currentValue]);\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>) => {\n let next = e.target.value;\n // Enforce a grapheme cap so emoji like 👨‍👩‍👧 (1 grapheme, 11 UTF-16\n // units) stay aligned with the visible counter. Skip during IME\n // composition so the in-progress text is preserved verbatim.\n if (hasMaxLength && !composingRef.current) {\n next = truncateToGraphemes(next, maxLength as number, i18n.language);\n }\n setChatValue(next);\n if (composingRef.current) return;\n onChange?.(e);\n };\n\n const handleCompositionStart = (\n e: CompositionEvent<HTMLTextAreaElement>,\n ) => {\n composingRef.current = true;\n onCompositionStart?.(e);\n };\n const handleCompositionEnd = (e: CompositionEvent<HTMLTextAreaElement>) => {\n composingRef.current = false;\n onCompositionEnd?.(e);\n };\n\n const isIMEKey = (e: KeyboardEvent<HTMLTextAreaElement>) =>\n e.nativeEvent.isComposing || e.keyCode === 229 || composingRef.current;\n\n const submit = () => {\n const text = currentValue.trim();\n if (!text || disabled || atLimit) return;\n onSubmit?.(currentValue);\n setChatValue('');\n // Keep focus in the composer after a send. Activating the Send *button*\n // (click, or keyboard Enter/Space) otherwise strands focus: clearing the\n // value re-disables the button on the next render, so focus falls to\n // <body> and a keyboard user must re-traverse back to the textarea.\n // Refocusing leaves the composer ready for the next message — a no-op for\n // the Enter-to-send path, where focus is already in the textarea.\n innerRef.current?.focus();\n };\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n\n const agentHandle = useMemo<ChatInputHandle>(\n () => ({\n getValue: () => currentValue,\n isEmpty: () => !currentValue.trim(),\n setValue: (next: string) => {\n setChatValue(next);\n },\n clear: () => {\n setChatValue('');\n },\n submit: () => {\n submit();\n },\n focus: () => {\n innerRef.current?.focus();\n },\n }),\n // `submit` is a local closure that always sees the latest currentValue\n // via React's render cycle — depend on currentValue so the handle\n // picks up new values across renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentValue, setChatValue],\n );\n useAgentRegistration(chatInputAgent, agentHandle, id);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(e);\n if (e.defaultPrevented) return;\n if (isIMEKey(e)) return;\n\n if (e.key === 'Enter') {\n const explicitSubmit = e.metaKey || e.ctrlKey;\n const plainEnterSubmits = submitOnEnter && !e.shiftKey;\n if (explicitSubmit || plainEnterSubmits) {\n e.preventDefault();\n submit();\n }\n }\n };\n\n const handleAttach = () => {\n fileInputRef.current?.click();\n };\n\n const handleFilePick = (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files && e.target.files.length > 0) {\n onAttach?.(e.target.files);\n }\n // Reset so picking the same file twice still fires change.\n e.target.value = '';\n };\n\n const effectiveId = id ?? textareaId;\n const labelId = `${effectiveId}-label`;\n const counterId = hasMaxLength ? `${effectiveId}-counter` : undefined;\n const hintId = `${effectiveId}-hint`;\n\n const resolvedPlaceholder = placeholder ?? t('chat.input.placeholder');\n const resolvedLabel = label ?? t('chat.prompt');\n\n return (\n <div\n ref={rootRef}\n data-component=\"chat-input\"\n data-component-id={id}\n className={rootVariants({ size, className })}\n >\n <label\n id={labelId}\n htmlFor={effectiveId}\n className={\n label\n ? 'type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]'\n : 'ds:sr-only'\n }\n >\n {resolvedLabel}\n </label>\n <textarea\n ref={setRefs}\n id={effectiveId}\n value={currentValue}\n disabled={disabled}\n rows={minRows}\n placeholder={resolvedPlaceholder}\n aria-labelledby={labelId}\n aria-describedby={\n [counterId, hintId].filter(Boolean).join(' ') || undefined\n }\n aria-invalid={atLimit || undefined}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={[\n 'ds:w-full ds:resize-none ds:bg-transparent',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]',\n 'ds:placeholder:text-[color:var(--muted-foreground)]',\n 'ds:leading-[var(--line-height-base)]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n // Tokenised focus ring on the textarea itself — the 1px border\n // shift on the wrapper alone fails the 3px accessible-theme\n // requirement. See a11y-critical-fixes.mdx.\n 'ds:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n ].join(' ')}\n {...rest}\n />\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]\">\n {onAttach ? (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"ds:sr-only\"\n multiple\n accept={accept}\n onChange={handleFilePick}\n aria-label={t('chat.input.attach')}\n tabIndex={-1}\n />\n <IconButton\n icon={<Paperclip />}\n aria-label={t('chat.input.attach')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={handleAttach}\n disabled={disabled}\n />\n </>\n ) : null}\n {toolbar}\n <div className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {showCounter ? (\n <span\n id={counterId}\n aria-live=\"polite\"\n className={[\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:tabular-nums',\n atLimit\n ? 'ds:text-[color:var(--destructive)]'\n : 'ds:text-[color:var(--muted-foreground)]',\n ].join(' ')}\n >\n {atLimit ? (\n // Icon pairs with --destructive colour so the at-limit\n // state is not conveyed by hue alone (WCAG 1.4.1).\n <CircleAlert aria-hidden=\"true\" className=\"ds:size-3.5\" />\n ) : null}\n {t('chat.input.remaining', { count: remaining })}\n </span>\n ) : null}\n <span id={hintId} className=\"ds:sr-only\">\n {t('chat.input.sendHint')}\n </span>\n <IconButton\n icon={<Send />}\n aria-label={t('chat.send')}\n intent=\"primary\"\n size=\"sm\"\n disabled={disabled || !currentValue.trim() || atLimit}\n onClick={submit}\n aria-keyshortcuts=\"Meta+Enter Control+Enter\"\n />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatInput.displayName = 'ChatInput';\n"],"names":["__iconNode","Paperclip","createLucideIcon","chatInputAgent","handle","args","rootVariants","cva","graphemeCount","value","locale","seg","n","_s","truncateToGraphemes","max","parts","s","joined","cps","ChatInput","forwardRef","size","defaultValue","maxLength","submitOnEnter","minRows","maxRows","onSubmit","onAttach","accept","disabled","toolbar","label","placeholder","className","onChange","onKeyDown","onCompositionStart","onCompositionEnd","id","rest","ref","t","i18n","useTranslation","textareaId","useId","composingRef","useRef","fileInputRef","innerRef","setRefs","useCallback","node","currentValueRaw","setChatValue","useControllableState","currentValue","count","hasMaxLength","remaining","showCounter","atLimit","resize","el","styles","lineHeight","padTop","padBot","borderTop","borderBot","chrome","minH","maxH","next","useIsomorphicLayoutEffect","handleChange","handleCompositionStart","handleCompositionEnd","isIMEKey","submit","_a","rootRef","useImperativeHandle","agentHandle","useMemo","useAgentRegistration","handleKeyDown","explicitSubmit","plainEnterSubmits","handleAttach","handleFilePick","effectiveId","labelId","counterId","hintId","resolvedPlaceholder","resolvedLabel","jsxs","jsx","Fragment","IconButton","CircleAlert","Send"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,KAAYC,GAAiB,aAAaF,EAAU,GCX7CG,KAAgD;AAAA,EAC3D,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe,QAAQ;AAAA,EACtC,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,EACnC;AAAA,EAEF,SAAS;AA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AGN;AACF;AAEA7D,GAAU,cAAc;","x_google_ignoreList":[0]}
@@ -2,10 +2,10 @@ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as T, useMemo as z, Fragment as l } from "react";
3
3
  import { c as h } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as B } from "react-i18next";
5
- import { B as F } from "./button-BvNtqHAS.js";
5
+ import { B as F } from "./button-nJaPh_HC.js";
6
6
  import { A as I } from "./avatar-BNQNhoyL.js";
7
7
  import { T as A } from "./timestamp-BV2lC-wV.js";
8
- import { s as M, C as S } from "./code-block-BONe9fJi.js";
8
+ import { s as M, C as S } from "./code-block-BIkpRLkl.js";
9
9
  import { s as V } from "./safe-image-src-DstKgCo7.js";
10
10
  import { R as D } from "./rotate-ccw-BBQnIVTr.js";
11
11
  import { C as E } from "./clock-Drd4Wtis.js";
@@ -236,4 +236,4 @@ J.displayName = "ChatMessage";
236
236
  export {
237
237
  J as C
238
238
  };
239
- //# sourceMappingURL=chat-message-DHNUbjXA.js.map
239
+ //# sourceMappingURL=chat-message-DBQu10rs.js.map