@alfadocs/ui-kit 1.140.0 → 1.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/dist/_chunks/{actions-cell-renderer-C-l_ppP6.js → actions-cell-renderer-CPNyF6ye.js} +3 -3
  2. package/dist/_chunks/{ai-credits-notice-BNFcQoXo.js → ai-credits-notice-D_Zm_N2A.js} +2 -2
  3. package/dist/_chunks/{ai-prompt-input-B2QFwuJ1.js → ai-prompt-input-y4-dtQIT.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-CVBlKur9.js → alia-sidebar-uxTsUbIt.js} +2 -2
  5. package/dist/_chunks/{anamnesis-summary-rows-YJGs2uWD.js → anamnesis-summary-rows-C2Ca9_Qj.js} +8 -8
  6. package/dist/_chunks/{appointment-card-CaxFXtSn.js → appointment-card-C0UFYFLZ.js} +170 -168
  7. package/dist/_chunks/{appointment-details-panel.history-DrIMDQYf.js → appointment-details-panel.history-BUXwhill.js} +2 -2
  8. package/dist/_chunks/{appointment-peek-BP_ACFz5.js → appointment-peek-BCzekfWh.js} +3 -3
  9. package/dist/_chunks/appointment-timeline-BK68CCBl.js +689 -0
  10. package/dist/_chunks/{appointment-tray-DPpeR9JT.js → appointment-tray-dfgScPcC.js} +2 -2
  11. package/dist/_chunks/{audio-recorder-6dUq8I38.js → audio-recorder-DxhCiLqG.js} +2 -2
  12. package/dist/_chunks/{balance-badge-cell-CRStPNDd.js → balance-badge-cell-CXi6moSa.js} +5 -5
  13. package/dist/_chunks/{bill-line-table-DTqXdBED.js → bill-line-table-qAdmV19W.js} +2 -2
  14. package/dist/_chunks/{bishop-score-M7Fi-ykx.js → bishop-score-DbvfBlBM.js} +2 -2
  15. package/dist/_chunks/{button-group-DuQuuulC.js → button-group-DoKG16Fy.js} +2 -2
  16. package/dist/_chunks/{calculator-dialog-Cg3GjaRf.js → calculator-dialog-BWizCwN5.js} +2 -2
  17. package/dist/_chunks/{calendar-appointment-editor-dialog-BBrJlmyd.js → calendar-appointment-editor-dialog-BDc8Q4Ji.js} +17 -17
  18. package/dist/_chunks/{calendar-editor-discard-host-BcMEgVEq.js → calendar-editor-discard-host-BblBxMqT.js} +5 -5
  19. package/dist/_chunks/{calendar-waiting-list-panel-Cdg9YssA.js → calendar-waiting-list-panel-js-0KEh8.js} +6 -6
  20. package/dist/_chunks/{calendar.sheets-DbMOO7YV.js → calendar.sheets-sBWH7Jxn.js} +12 -12
  21. package/dist/_chunks/calls-panel-CnjAKFgA.js +1448 -0
  22. package/dist/_chunks/{care-plan-card-CjHq6PLo.js → care-plan-card-TZH6C60K.js} +2 -2
  23. package/dist/_chunks/{care-plan-entry-card-DY1toF6E.js → care-plan-entry-card-CufvXAWa.js} +2 -2
  24. package/dist/_chunks/{chart-D0EeFWst.js → chart-ChNsJf9_.js} +2 -2
  25. package/dist/_chunks/{color-picker-CC8ZfntU.js → color-picker-5FKOk_z1.js} +2 -2
  26. package/dist/_chunks/{communications-panel-DBWM9II9.js → communications-panel-EP27FN7e.js} +3 -3
  27. package/dist/_chunks/{control-room-rail-DcJpHbp4.js → control-room-rail-7SidoPJH.js} +2 -2
  28. package/dist/_chunks/{cycle-calculator-Cb66X2Pf.js → cycle-calculator-BUCGfEcy.js} +2 -2
  29. package/dist/_chunks/{dashboard-grid-2uVXEe9e.js → dashboard-grid-D2egA1Zu.js} +2 -2
  30. package/dist/_chunks/{data-grid-tabs-D9Y4DeeH.js → data-grid-tabs-Mbj6bSK2.js} +2 -2
  31. package/dist/_chunks/{data-grid-CRUSZcVT.js → data-grid-tyE2kGfx.js} +5 -5
  32. package/dist/_chunks/{data-table-CnLfOwxg.js → data-table-Bq1FRBGB.js} +4 -4
  33. package/dist/_chunks/{data-table-tabs-NYLhD8_Z.js → data-table-tabs-D5ujdK56.js} +2 -2
  34. package/dist/_chunks/{date-picker-BmVBVpVu.js → date-picker-CD-PBzXM.js} +2 -2
  35. package/dist/_chunks/{date-range-panel-CT9Pk-HF.js → date-range-panel-BOgfP_V3.js} +2 -2
  36. package/dist/_chunks/{date-range-picker-2Up_FRrM.js → date-range-picker-Z-hI5Vb7.js} +2 -2
  37. package/dist/_chunks/{date-time-picker-C6b_Vymc.js → date-time-picker-DHza1SEH.js} +2 -2
  38. package/dist/_chunks/{default-tabs-CRbVCDSU.js → default-tabs-ChkVzOL8.js} +7 -7
  39. package/dist/_chunks/dialog-239Geb7Z.js +431 -0
  40. package/dist/_chunks/dialog-container-DHR0byah.js +17 -0
  41. package/dist/_chunks/{document-preview-FTCHXYhk.js → document-preview-x_S8V7VC.js} +3 -3
  42. package/dist/_chunks/{dropdown-menu-DBWaW4pq.js → dropdown-menu-Bm1KALnk.js} +2 -2
  43. package/dist/_chunks/{due-date-calculator-Dlqegxx9.js → due-date-calculator-DpN0Z9p4.js} +2 -2
  44. package/dist/_chunks/{editable-currency-cell-renderer-CZMQ5xRT.js → editable-currency-cell-renderer-C6z6ABN_.js} +2 -2
  45. package/dist/_chunks/{face-scheme-Bxt7ZnJn.js → face-scheme-S88jbOzl.js} +3 -3
  46. package/dist/_chunks/{file-manager-Bsccb8Jj.js → file-manager-ChQSjfU8.js} +5 -5
  47. package/dist/_chunks/{gestational-age-calculator-DXSPWG8u.js → gestational-age-calculator-CCDIhSMV.js} +3 -3
  48. package/dist/_chunks/{hcg-doubling-Dqbj6PQj.js → hcg-doubling-BekuksBv.js} +2 -2
  49. package/dist/_chunks/{header-settings-Cu-MKOsO.js → header-settings-CvZ7Qii6.js} +3 -3
  50. package/dist/_chunks/{heatmap-CFPaEKD_.js → heatmap-D0OGx-70.js} +3 -3
  51. package/dist/_chunks/{help-me-write-templates-DO6vJeP4.js → help-me-write-templates-C84_4iwX.js} +2 -2
  52. package/dist/_chunks/{hover-card-CuRIA4wN.js → hover-card-CIiPOlyM.js} +2 -2
  53. package/dist/_chunks/{icon-button-group-SmkdVCNx.js → icon-button-group-CLhC7wjU.js} +2 -2
  54. package/dist/_chunks/{icon-picker-BmU6gpZT.js → icon-picker-Ct6n8GTa.js} +2 -2
  55. package/dist/_chunks/{info-tip-B3cn3fY2.js → info-tip-CkH2En-i.js} +2 -2
  56. package/dist/_chunks/{invoice-upload-list-BR6vycF7.js → invoice-upload-list-CZ1B9yWh.js} +4 -4
  57. package/dist/_chunks/{kit-extensions-QddOSnIq.js → kit-extensions-C_oZ7WOq.js} +4 -4
  58. package/dist/_chunks/{link-cell-renderer-hAJplRFF.js → link-cell-renderer-ByOAy2Sb.js} +4 -4
  59. package/dist/_chunks/{locale-picker-C86h8Yt1.js → locale-picker-OrojXX6E.js} +2 -2
  60. package/dist/_chunks/{marketplace-app-shell-dMmxI6MT.js → marketplace-app-shell-DnL187-U.js} +4 -4
  61. package/dist/_chunks/{message-tray-pLGgLmoG.js → message-tray-g6dp_AAt.js} +2 -2
  62. package/dist/_chunks/{muscle-scheme-BB2eBfww.js → muscle-scheme-vNd8wU7V.js} +2 -2
  63. package/dist/_chunks/{non-modal-tab-exit-j3CPOuE3.js → non-modal-tab-exit-DqJao_E-.js} +2 -1
  64. package/dist/_chunks/{notes-panel-CnmQqhwq.js → notes-panel-CtMLUJOe.js} +5 -4
  65. package/dist/_chunks/{notification-tray-mlCfxNRH.js → notification-tray-DqCYs9Bw.js} +2 -2
  66. package/dist/_chunks/{optical-prescription-GzeK_2cf.js → optical-prescription-CWwrW4YQ.js} +2 -2
  67. package/dist/_chunks/{pagination-C7N_NiRN.js → pagination-BpXG5jVk.js} +2 -2
  68. package/dist/_chunks/{parts-BOnDDU3E.js → parts-IFiXO68Y.js} +3 -3
  69. package/dist/_chunks/{patient-account-settings-DfEPHmCh.js → patient-account-settings-e8Wp2g-F.js} +3 -3
  70. package/dist/_chunks/{patient-check-in-resume-TWs8CPQr.js → patient-check-in-resume-_nwf9gpx.js} +5 -5
  71. package/dist/_chunks/{patient-details-D0PjzALT.js → patient-details-6uJZ27ZL.js} +2 -2
  72. package/dist/_chunks/{patient-field-row-DlpIModg.js → patient-field-row-D8Cu_MQp.js} +5 -5
  73. package/dist/_chunks/{patient-search-aTFd7p9s.js → patient-search-C6-INPjs.js} +2 -2
  74. package/dist/_chunks/{patient-summary-card-BP_K7g_q.js → patient-summary-card-NYjO0IfN.js} +3 -3
  75. package/dist/_chunks/{pdf-viewer-TRC5jEm5.js → pdf-viewer-C8no312t.js} +2 -2
  76. package/dist/_chunks/{phone-input-DRKcJUi4.js → phone-input-DHiYJZ9v.js} +2 -2
  77. package/dist/_chunks/{popover-CN5IsOeS.js → popover-CkvP3rHZ.js} +2 -2
  78. package/dist/_chunks/{popup-region-qz_5_A0V.js → popup-region-BgZ8oeUB.js} +2 -2
  79. package/dist/_chunks/{portal-details-VfeOI4PB.js → portal-details-D9oF6FUV.js} +2 -2
  80. package/dist/_chunks/{portal-documents-hGHlwmbv.js → portal-documents-DSiLSave.js} +5 -5
  81. package/dist/_chunks/{portal-parts-C99CreYO.js → portal-parts-8qrUM-uK.js} +3 -3
  82. package/dist/_chunks/{practice-results-DaxGw9_f.js → practice-results-BUEsl2Pj.js} +3 -3
  83. package/dist/_chunks/{pregnancy-dating-a6WIg4oy.js → pregnancy-dating-wc9iCN0f.js} +3 -3
  84. package/dist/_chunks/{prescription-history-Bp_JHhdF.js → prescription-history-DFcPXYdF.js} +8 -8
  85. package/dist/_chunks/{product-hub-panel-K4QbULG7.js → product-hub-panel-BPpmVDm5.js} +2 -2
  86. package/dist/_chunks/{public-header.agent-DaeDfLfy.js → public-header.agent-Dsl9zhA2.js} +2 -2
  87. package/dist/_chunks/{radiograph-panel.agent-88VjqlG7.js → radiograph-panel.agent-CSpr2paU.js} +4 -4
  88. package/dist/_chunks/{registration-form-Cs9o6e5q.js → registration-form-DRGMzq9V.js} +3 -3
  89. package/dist/_chunks/{reserved.agent-L2ElYPuj.js → reserved.agent-C_pr0bHy.js} +4 -4
  90. package/dist/_chunks/{rich-text-editor-DFsH5RAj.js → rich-text-editor-CQ54ybTB.js} +1325 -1310
  91. package/dist/_chunks/{row-actions-BF2-uizV.js → row-actions-C6d6vy5z.js} +3 -3
  92. package/dist/_chunks/{saved-view-tabs-DLWm88Eq.js → saved-view-tabs-CVUM3Nqz.js} +2 -2
  93. package/dist/_chunks/{select-Bm8s3q-X.js → select-Bw5FvGJ7.js} +2 -2
  94. package/dist/_chunks/{send-registration-link-form-C1vw6H1M.js → send-registration-link-form-D-NkS__p.js} +3 -3
  95. package/dist/_chunks/{sheet-BdhYeQQT.js → sheet-BIAhwdyS.js} +2 -2
  96. package/dist/_chunks/{sign-document-DDZbmYHu.js → sign-document-BUhWw-7S.js} +2 -2
  97. package/dist/_chunks/{signature-request-D3sLLOM6.js → signature-request-BfKo3vOz.js} +4 -4
  98. package/dist/_chunks/{signing-end-screen-BdhbkPKO.js → signing-end-screen-Pmda6tCH.js} +4 -4
  99. package/dist/_chunks/{step-up-dialog-C2JqJmCA.js → step-up-dialog-C1O8ctoh.js} +2 -2
  100. package/dist/_chunks/{sync-tray-BhnkgXKK.js → sync-tray-BTmveFGE.js} +2 -2
  101. package/dist/_chunks/{tab-bar-CeC2QOwB.js → tab-bar-C6tPDq9s.js} +2 -2
  102. package/dist/_chunks/{tabs-BXr5XeGq.js → tabs-BOf9OO--.js} +3 -3
  103. package/dist/_chunks/{task-editor-DDVDPKJf.js → task-editor-DNkrLbgK.js} +7 -6
  104. package/dist/_chunks/{tasks-panel-BHXaPNOZ.js → tasks-panel-Dmp49cBo.js} +3 -3
  105. package/dist/_chunks/{theme-toggle-BQDFxvVS.js → theme-toggle-C2LPw3xr.js} +3 -3
  106. package/dist/_chunks/{token-insert-menu-BLtfMTJd.js → token-insert-menu-sGtftx4Y.js} +2 -2
  107. package/dist/_chunks/{tool-rail-Kup1b7xI.js → tool-rail-CKOuVHUQ.js} +213 -209
  108. package/dist/_chunks/{toolbar-B7UHCMSr.js → toolbar-JTR20W-U.js} +3 -3
  109. package/dist/_chunks/{tooth-scheme-BtnFgugP.js → tooth-scheme-DpgciFU8.js} +2 -2
  110. package/dist/_chunks/{unit-converter-OBhSDXee.js → unit-converter-D1e1wZRE.js} +2 -2
  111. package/dist/_chunks/{use-appointment-details-read-DeQnmmZw.js → use-appointment-details-read-DIRHedaM.js} +7 -7
  112. package/dist/_chunks/{verify-identity-types-C6Bam8v6.js → verify-identity-types-CpeJIc9F.js} +2 -2
  113. package/dist/_chunks/{voice-control-panel-Dc_NFH2R.js → voice-control-panel-CfBUrzhJ.js} +3 -3
  114. package/dist/_chunks/{widget-picker-D3T7e8a4.js → widget-picker-Ddl0lDWV.js} +2 -2
  115. package/dist/_chunks/{workflow-map-DaZFP9SJ.js → workflow-map-CsfRHhlz.js} +2 -2
  116. package/dist/_chunks/{workflow-status-CO0mxXs2.js → workflow-status-Cg7yjnye.js} +2 -2
  117. package/dist/_chunks/{workflow-webhook-action-BsGSh3h9.js → workflow-webhook-action-BUWc2txJ.js} +2 -2
  118. package/dist/agent-catalog.json +134 -3
  119. package/dist/agent-i18n/en.json +8 -2
  120. package/dist/appointment-editor-panel/index.js +2 -2
  121. package/dist/browser-support.js +1 -1
  122. package/dist/calendar-action-buttons/index.js +1 -1
  123. package/dist/components/_shared/non-modal-tab-exit.d.ts +1 -0
  124. package/dist/components/ai-credits-notice/index.js +1 -1
  125. package/dist/components/ai-prompt-input/index.js +1 -1
  126. package/dist/components/appointment-card/appointment-card.d.ts +4 -0
  127. package/dist/components/appointment-card/index.js +2 -2
  128. package/dist/components/appointment-details-panel/index.js +1 -1
  129. package/dist/components/appointment-peek/index.js +1 -1
  130. package/dist/components/appointment-timeline/appointment-timeline.d.ts +51 -0
  131. package/dist/components/appointment-timeline/index.d.ts +1 -1
  132. package/dist/components/appointment-timeline/index.js +1 -1
  133. package/dist/components/audio-recorder/index.js +1 -1
  134. package/dist/components/bill-line-table/index.js +1 -1
  135. package/dist/components/bill-table/index.js +1 -1
  136. package/dist/components/bishop-score/index.js +1 -1
  137. package/dist/components/booking/index.js +1 -1
  138. package/dist/components/button-group/index.js +1 -1
  139. package/dist/components/calculator-dialog/index.js +1 -1
  140. package/dist/components/calls-panel/calls-panel.d.ts +91 -0
  141. package/dist/components/calls-panel/index.d.ts +1 -1
  142. package/dist/components/calls-panel/index.js +1 -1
  143. package/dist/components/care-plan-card/index.js +1 -1
  144. package/dist/components/care-plan-entry-card/index.js +1 -1
  145. package/dist/components/chart/index.js +1 -1
  146. package/dist/components/color-picker/index.js +1 -1
  147. package/dist/components/communications-panel/index.js +1 -1
  148. package/dist/components/control-room-rail/index.js +1 -1
  149. package/dist/components/cycle-calculator/index.js +1 -1
  150. package/dist/components/dashboard-grid/index.js +1 -1
  151. package/dist/components/data-grid/index.js +2 -2
  152. package/dist/components/data-grid-tabs/index.js +1 -1
  153. package/dist/components/data-table/index.js +4 -4
  154. package/dist/components/data-table-tabs/index.js +1 -1
  155. package/dist/components/date-picker/index.js +1 -1
  156. package/dist/components/date-range-picker/index.js +1 -1
  157. package/dist/components/date-time-picker/index.js +1 -1
  158. package/dist/components/dialog/dialog-container.d.ts +27 -0
  159. package/dist/components/dialog/dialog.d.ts +12 -2
  160. package/dist/components/dialog/index.d.ts +3 -1
  161. package/dist/components/dialog/index.js +5 -3
  162. package/dist/components/document-preview/index.js +1 -1
  163. package/dist/components/dropdown-menu/index.js +1 -1
  164. package/dist/components/due-date-calculator/index.js +1 -1
  165. package/dist/components/face-scheme/index.js +1 -1
  166. package/dist/components/file-manager/index.js +1 -1
  167. package/dist/components/gestational-age-calculator/index.js +1 -1
  168. package/dist/components/hcg-doubling/index.js +1 -1
  169. package/dist/components/header-settings/index.js +1 -1
  170. package/dist/components/heatmap/index.js +1 -1
  171. package/dist/components/hover-card/index.js +1 -1
  172. package/dist/components/icon-button-group/index.js +1 -1
  173. package/dist/components/icon-picker/index.js +1 -1
  174. package/dist/components/info-tip/index.js +1 -1
  175. package/dist/components/invoice-upload-list/index.js +1 -1
  176. package/dist/components/locale-picker/index.js +1 -1
  177. package/dist/components/message-tray/index.js +1 -1
  178. package/dist/components/muscle-scheme/index.js +1 -1
  179. package/dist/components/notes-panel/index.js +1 -1
  180. package/dist/components/notification-tray/index.js +1 -1
  181. package/dist/components/optical-prescription/index.js +1 -1
  182. package/dist/components/pagination/index.js +1 -1
  183. package/dist/components/patient-details/index.js +1 -1
  184. package/dist/components/patient-search/index.js +1 -1
  185. package/dist/components/patient-summary-card/index.js +1 -1
  186. package/dist/components/patient-table/index.js +1 -1
  187. package/dist/components/pdf-viewer/index.js +1 -1
  188. package/dist/components/phone-input/index.js +1 -1
  189. package/dist/components/popover/index.js +1 -1
  190. package/dist/components/practice-results/index.js +1 -1
  191. package/dist/components/pregnancy-dating/index.js +1 -1
  192. package/dist/components/product-hub-tray/index.js +1 -1
  193. package/dist/components/public-header/index.js +1 -1
  194. package/dist/components/radiograph-panel/index.js +1 -1
  195. package/dist/components/rich-text-editor/index.js +2 -2
  196. package/dist/components/row-actions/index.js +1 -1
  197. package/dist/components/select/index.js +1 -1
  198. package/dist/components/sheet/index.js +1 -1
  199. package/dist/components/sign-document/index.js +1 -1
  200. package/dist/components/skeleton-scheme/index.js +1 -1
  201. package/dist/components/step-up-dialog/index.js +1 -1
  202. package/dist/components/sync-tray/index.js +1 -1
  203. package/dist/components/tab-bar/index.js +1 -1
  204. package/dist/components/tabs/index.js +1 -1
  205. package/dist/components/task-editor/index.js +1 -1
  206. package/dist/components/tasks-panel/index.js +1 -1
  207. package/dist/components/theme-toggle/index.js +1 -1
  208. package/dist/components/token-insert-menu/index.js +1 -1
  209. package/dist/components/tool-rail/index.js +1 -1
  210. package/dist/components/tooth-scheme/index.js +1 -1
  211. package/dist/components/unit-converter/index.js +1 -1
  212. package/dist/components/voice-control-panel/index.js +1 -1
  213. package/dist/components/widget-picker/index.js +1 -1
  214. package/dist/components/workflow/index.js +1 -1
  215. package/dist/components/workflow-status/index.js +1 -1
  216. package/dist/core.css +1 -1
  217. package/dist/find-free-slots-panel/index.js +1 -1
  218. package/dist/host-compat.css +13 -1
  219. package/dist/i18n/locales/ar.d.ts +45 -0
  220. package/dist/i18n/locales/ar.js +44 -2
  221. package/dist/i18n/locales/de.d.ts +45 -0
  222. package/dist/i18n/locales/de.js +44 -2
  223. package/dist/i18n/locales/el.d.ts +45 -0
  224. package/dist/i18n/locales/el.js +47 -2
  225. package/dist/i18n/locales/en.d.ts +37 -0
  226. package/dist/i18n/locales/en.js +39 -2
  227. package/dist/i18n/locales/es.d.ts +45 -0
  228. package/dist/i18n/locales/es.js +44 -2
  229. package/dist/i18n/locales/fr.d.ts +45 -0
  230. package/dist/i18n/locales/fr.js +44 -2
  231. package/dist/i18n/locales/hi.d.ts +45 -0
  232. package/dist/i18n/locales/hi.js +47 -2
  233. package/dist/i18n/locales/it.d.ts +45 -0
  234. package/dist/i18n/locales/it.js +44 -2
  235. package/dist/i18n/locales/ja.d.ts +45 -0
  236. package/dist/i18n/locales/ja.js +47 -2
  237. package/dist/i18n/locales/nl.d.ts +45 -0
  238. package/dist/i18n/locales/nl.js +44 -2
  239. package/dist/i18n/locales/pl.d.ts +45 -0
  240. package/dist/i18n/locales/pl.js +47 -2
  241. package/dist/i18n/locales/pt.d.ts +45 -0
  242. package/dist/i18n/locales/pt.js +44 -2
  243. package/dist/i18n/locales/ro.d.ts +45 -0
  244. package/dist/i18n/locales/ro.js +44 -2
  245. package/dist/i18n/locales/ru.d.ts +45 -0
  246. package/dist/i18n/locales/ru.js +44 -2
  247. package/dist/i18n/locales/sq.d.ts +45 -0
  248. package/dist/i18n/locales/sq.js +47 -2
  249. package/dist/i18n/locales/sv.d.ts +45 -0
  250. package/dist/i18n/locales/sv.js +44 -2
  251. package/dist/i18n/locales/tr.d.ts +45 -0
  252. package/dist/i18n/locales/tr.js +44 -2
  253. package/dist/i18n/locales/zh.d.ts +45 -0
  254. package/dist/i18n/locales/zh.js +44 -2
  255. package/dist/index.js +945 -943
  256. package/dist/locales/ar.json +47 -2
  257. package/dist/locales/de.json +47 -2
  258. package/dist/locales/el.json +47 -2
  259. package/dist/locales/en.json +39 -2
  260. package/dist/locales/es.json +47 -2
  261. package/dist/locales/fr.json +47 -2
  262. package/dist/locales/hi.json +47 -2
  263. package/dist/locales/it.json +47 -2
  264. package/dist/locales/ja.json +47 -2
  265. package/dist/locales/nl.json +47 -2
  266. package/dist/locales/pl.json +47 -2
  267. package/dist/locales/pt.json +47 -2
  268. package/dist/locales/ro.json +47 -2
  269. package/dist/locales/ru.json +47 -2
  270. package/dist/locales/sq.json +47 -2
  271. package/dist/locales/sv.json +47 -2
  272. package/dist/locales/tr.json +47 -2
  273. package/dist/locales/zh.json +47 -2
  274. package/dist/online-bookings-panel/index.js +1 -1
  275. package/dist/patterns/alia-assistant/index.js +1 -1
  276. package/dist/patterns/anamnesis/index.js +1 -1
  277. package/dist/patterns/calendar/index.js +3 -3
  278. package/dist/patterns/help-me-write-templates/index.js +1 -1
  279. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  280. package/dist/patterns/patient-account-settings/index.js +1 -1
  281. package/dist/patterns/patient-check-in/index.js +1 -1
  282. package/dist/patterns/patient-portal/index.js +2 -2
  283. package/dist/patterns/prescription/index.js +1 -1
  284. package/dist/patterns/registration-form/index.js +1 -1
  285. package/dist/patterns/send-registration-link-form/index.js +1 -1
  286. package/dist/patterns/signature-request/index.js +1 -1
  287. package/dist/patterns/signing/index.js +1 -1
  288. package/dist/patterns/verify-identity/index.js +1 -1
  289. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  290. package/dist/tokens.css +1 -1
  291. package/dist/waiting-list-panel/index.js +2 -2
  292. package/package.json +1 -1
  293. package/dist/_chunks/appointment-timeline-BEwgbYyG.js +0 -455
  294. package/dist/_chunks/calls-panel-CtxJAzkJ.js +0 -1094
  295. package/dist/_chunks/dialog-CVTxyR0v.js +0 -349
@@ -0,0 +1,1448 @@
1
+ import { jsxs as m, jsx as r, Fragment as Qr } from "react/jsx-runtime";
2
+ import { forwardRef as Xr, useId as gt, useRef as d, useImperativeHandle as Wr, useEffect as Q, useMemo as ue, useCallback as pe, useState as g } from "react";
3
+ import { c as fr } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as hr } from "react-i18next";
5
+ import { u as en } from "./registry-DvAUVLHh.js";
6
+ import { u as tn } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
7
+ import { g as dt } from "./get-error-message-DbFUzuja.js";
8
+ import { formatPhoneForDisplay as rn } from "../format-phone/index.js";
9
+ import { f as vt, c as nn } from "./intl-locale-FWh-Y5_3.js";
10
+ import { A as X } from "./alert-C4WKViaS.js";
11
+ import { B as D } from "./button-DohK_Ak_.js";
12
+ import { I as nr } from "./icon-button-S8_weU3g.js";
13
+ import { C as ut } from "./call-status-chip-pajxN5eZ.js";
14
+ import { D as on } from "./date-range-picker-Z-hI5Vb7.js";
15
+ import { D as sn } from "./date-time-picker-DHza1SEH.js";
16
+ import { D as Y } from "./dialog-239Geb7Z.js";
17
+ import { E as Oe } from "./empty-state-DwJ5YNzz.js";
18
+ import { F as Le } from "./form-field-CyHfOVKF.js";
19
+ import { L as or } from "./link-CeV7FoI6.js";
20
+ import { P as sr } from "./panel-header-CbtlTe85.js";
21
+ import { P as lr } from "./panel-subview-DCyvn-49.js";
22
+ import { S as me } from "./select-Bw5FvGJ7.js";
23
+ import { S as pt } from "./skeleton-tTWJpvAq.js";
24
+ import { T as ar } from "./text-area-COMVJ1yE.js";
25
+ import { P as mt } from "./phone-FceYcIFQ.js";
26
+ import { P as ln } from "./pencil-B1sKKyuT.js";
27
+ import { T as ir } from "./trash-2-uumy3fy1.js";
28
+ import { P as an } from "./plus-DzMQ_c6b.js";
29
+ const cn = {
30
+ id: "calls-panel",
31
+ capabilities: ["open", "close", "submit", "edit_inline", "filter"],
32
+ state: {
33
+ callCount: {
34
+ type: "number",
35
+ descriptionKey: "ui.agent.callsPanel.state.callCount",
36
+ description: "How many logged calls the list holds. A count only, never a call. Zero under privacy.",
37
+ read: (n) => n.getState().callCount
38
+ },
39
+ automaticCount: {
40
+ type: "number",
41
+ descriptionKey: "ui.agent.callsPanel.state.automaticCount",
42
+ description: "How many calls were logged by other software, such as a phone system. A count only: never a number, a name or a link. Zero under privacy.",
43
+ read: (n) => n.getState().automaticCount
44
+ },
45
+ missedCount: {
46
+ type: "number",
47
+ descriptionKey: "ui.agent.callsPanel.state.missedCount",
48
+ description: "How many incoming calls nobody answered. A count only. Zero under privacy.",
49
+ read: (n) => n.getState().missedCount
50
+ },
51
+ status: {
52
+ type: "'ready' | 'loading' | 'error'",
53
+ descriptionKey: "ui.agent.callsPanel.state.status",
54
+ description: "The state of the host's read of the calls.",
55
+ read: (n) => n.getState().status
56
+ },
57
+ formOpen: {
58
+ type: "boolean",
59
+ descriptionKey: "ui.agent.callsPanel.state.formOpen",
60
+ description: 'Whether the "Log a call" form is showing.',
61
+ read: (n) => n.getState().formOpen
62
+ },
63
+ privacy: {
64
+ type: "{ masked: true } | null",
65
+ descriptionKey: "ui.agent.callsPanel.state.privacy",
66
+ description: "Reads { masked: true } when privacy mode withholds the calls, else null.",
67
+ read: (n) => n.getState().privacy ? { masked: !0 } : null
68
+ },
69
+ filters: {
70
+ type: "{ outcome: string | null; purpose: string | null; direction: 'all' | 'outgoing' | 'incoming' | 'missed'; from: string | null; to: string | null }",
71
+ descriptionKey: "ui.agent.callsPanel.state.filters",
72
+ description: "The filters now set: an outcome id, a purpose id, a direction, and a first and last day as YYYY-MM-DD (local, inclusive). Ids and days only, never a call.",
73
+ read: (n) => n.getState().filters
74
+ },
75
+ activeFilterCount: {
76
+ type: "number",
77
+ descriptionKey: "ui.agent.callsPanel.state.activeFilterCount",
78
+ description: "How many filters differ from the host's default query. The two days count as one.",
79
+ read: (n) => n.getState().activeFilterCount
80
+ }
81
+ },
82
+ actions: {
83
+ set_filter: {
84
+ // A view change, not a write: the same class as TasksPanel's set_filter.
85
+ safety: "read",
86
+ argsType: "{ outcome?: string | null; purpose?: string | null; direction?: 'all' | 'outgoing' | 'incoming' | 'missed'; from?: string | null; to?: string | null }",
87
+ argsSchema: {
88
+ type: "object",
89
+ properties: {
90
+ outcome: { type: ["string", "null"] },
91
+ purpose: { type: ["string", "null"] },
92
+ direction: {
93
+ type: "string",
94
+ enum: ["all", "outgoing", "incoming", "missed"]
95
+ },
96
+ from: {
97
+ type: ["string", "null"],
98
+ description: "First day, YYYY-MM-DD, local time, inclusive."
99
+ },
100
+ to: {
101
+ type: ["string", "null"],
102
+ description: "Last day, YYYY-MM-DD, local time, inclusive."
103
+ }
104
+ }
105
+ },
106
+ idempotent: !0,
107
+ errors: [
108
+ "Privacy mode is on.",
109
+ "The outcome or purpose is not one the host offered.",
110
+ "The direction is not one of the four.",
111
+ "A day is not a real date written as YYYY-MM-DD."
112
+ ],
113
+ descriptionKey: "ui.agent.callsPanel.actions.setFilter",
114
+ description: "Set the call filters (outcome, purpose, direction, first and last day). Omitted keys are left unchanged. A filter the panel cannot honour is ignored. Unchanged values are not re-sent.",
115
+ examples: [
116
+ {
117
+ args: { direction: "missed", from: "2026-06-01", to: "2026-06-30" },
118
+ note: "Missed calls in June."
119
+ }
120
+ ],
121
+ invoke: (n, s) => n.setFilter(s)
122
+ },
123
+ clear_filters: {
124
+ safety: "read",
125
+ idempotent: !0,
126
+ errors: ["Privacy mode is on."],
127
+ descriptionKey: "ui.agent.callsPanel.actions.clearFilters",
128
+ description: "Return every filter to the host's default query, as the Clear filters button does.",
129
+ invoke: (n) => n.clearFilters()
130
+ },
131
+ open_form: {
132
+ safety: "write",
133
+ idempotent: !0,
134
+ errors: [
135
+ "The panel is read-only, privacy mode is on, or the host gave no way to log a call."
136
+ ],
137
+ descriptionKey: "ui.agent.callsPanel.actions.openForm",
138
+ description: 'Open the "Log a call" form, as the button does.',
139
+ invoke: (n) => n.openForm()
140
+ },
141
+ close_form: {
142
+ // A dismiss, classed as select and dialog class their `close`.
143
+ safety: "read",
144
+ idempotent: !0,
145
+ errors: ["A call is being saved."],
146
+ descriptionKey: "ui.agent.callsPanel.actions.closeForm",
147
+ description: "Close the form and discard what was typed in it.",
148
+ invoke: (n) => n.closeForm()
149
+ },
150
+ submit_call: {
151
+ // A call note is patient-identifiable. PHI.
152
+ safety: "phi",
153
+ argsType: "{ dateIso: string; purposeId?: string | null; outcomeId?: string | null; description?: string }",
154
+ argsSchema: {
155
+ type: "object",
156
+ properties: {
157
+ dateIso: {
158
+ type: "string",
159
+ description: "ISO-8601 instant the call took place."
160
+ },
161
+ purposeId: { type: ["string", "null"] },
162
+ outcomeId: { type: ["string", "null"] },
163
+ description: { type: "string" }
164
+ },
165
+ required: ["dateIso"]
166
+ },
167
+ openWorld: !0,
168
+ errors: [
169
+ "The date is missing or not a date.",
170
+ "The purpose or outcome is not one the host offered.",
171
+ "The panel is read-only, privacy mode is on, or the host gave no way to log a call.",
172
+ "A write is already in progress.",
173
+ "The host refused the call. The panel keeps the form and shows the host's message."
174
+ ],
175
+ descriptionKey: "ui.agent.callsPanel.actions.logCall",
176
+ description: "Log a call made to the patient. Settles with the host's answer; a refusal rejects.",
177
+ examples: [
178
+ {
179
+ args: {
180
+ dateIso: "2026-06-24T09:30:00Z",
181
+ outcomeId: "connected",
182
+ description: "Confirmed the visit."
183
+ },
184
+ note: "Log a connected call."
185
+ }
186
+ ],
187
+ invoke: (n, s) => n.logCall(s)
188
+ },
189
+ edit_call: {
190
+ safety: "phi",
191
+ argsType: "{ id: string; description: string }",
192
+ argsSchema: {
193
+ type: "object",
194
+ properties: {
195
+ id: { type: "string" },
196
+ description: { type: "string", minLength: 1 }
197
+ },
198
+ required: ["id", "description"]
199
+ },
200
+ idempotent: !0,
201
+ openWorld: !0,
202
+ errors: [
203
+ "No call has that id.",
204
+ "The description is empty.",
205
+ "The panel is read-only, privacy mode is on, or the host gave no way to edit a call.",
206
+ "A write is already in progress.",
207
+ "The host refused the edit. The panel keeps the text and shows the host's message."
208
+ ],
209
+ descriptionKey: "ui.agent.callsPanel.actions.updateCall",
210
+ description: "Replace the description of a logged call. Only the description can change. Settles with the host's answer.",
211
+ invoke: (n, s) => n.updateCall(s.id, { description: s.description })
212
+ },
213
+ delete_call: {
214
+ safety: "destructive",
215
+ argsType: "{ id: string }",
216
+ argsSchema: {
217
+ type: "object",
218
+ properties: { id: { type: "string" } },
219
+ required: ["id"]
220
+ },
221
+ openWorld: !0,
222
+ errors: [
223
+ "No call has that id.",
224
+ "The panel is read-only, privacy mode is on, or the host gave no way to delete a call.",
225
+ "A write is already in progress.",
226
+ "The host refused the delete."
227
+ ],
228
+ descriptionKey: "ui.agent.callsPanel.actions.deleteCall",
229
+ description: "Delete a logged call. Settles with the host's answer; a refusal rejects.",
230
+ invoke: (n, s) => n.deleteCall(s.id)
231
+ }
232
+ },
233
+ domHooks: {
234
+ root: {
235
+ attr: "data-component",
236
+ value: "calls-panel",
237
+ description: "Marks the CallsPanel region."
238
+ },
239
+ instanceId: {
240
+ attr: "data-component-id",
241
+ sourceProp: "id",
242
+ description: "Sourced from the id prop. Required to address a specific panel from the agent."
243
+ },
244
+ item: {
245
+ attr: "data-call-id",
246
+ description: "Stable call id on each rendered call. Never a description, a purpose or a date."
247
+ }
248
+ }
249
+ }, cr = fr(
250
+ "ds:flex ds:h-full ds:min-h-0 ds:min-w-0 ds:flex-col ds:bg-[color:var(--card)]"
251
+ ), dr = fr(
252
+ [
253
+ "ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]",
254
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--card-border)]",
255
+ "ds:bg-[color:var(--card)] ds:p-[var(--spacing-sm)]"
256
+ ].join(" ")
257
+ ), gr = {
258
+ connected: "positive",
259
+ no_answer: "caution",
260
+ busy: "caution",
261
+ left_voicemail: "caution",
262
+ wrong_number: "negative"
263
+ }, dn = new Set(Object.keys(gr));
264
+ function ur(n) {
265
+ if (n)
266
+ try {
267
+ const s = new URL(n.trim());
268
+ return s.protocol === "http:" || s.protocol === "https:" ? s.href : void 0;
269
+ } catch {
270
+ return;
271
+ }
272
+ }
273
+ function un(n, s) {
274
+ const u = vt(nn(s)), w = Math.round(n), f = [
275
+ [Math.floor(w / 3600), "hour"],
276
+ [Math.floor(w % 3600 / 60), "minute"],
277
+ [w % 60, "second"]
278
+ ].filter(([A]) => A > 0);
279
+ f.length === 0 && f.push([0, "second"]);
280
+ const N = f.map(
281
+ ([A, k]) => new Intl.NumberFormat(u, {
282
+ style: "unit",
283
+ unit: k,
284
+ unitDisplay: "short"
285
+ }).format(A)
286
+ );
287
+ return new Intl.ListFormat(u, { type: "unit", style: "narrow" }).format(
288
+ N
289
+ );
290
+ }
291
+ function Ye(n) {
292
+ return !!n && !Number.isNaN(n.getTime());
293
+ }
294
+ const pn = {
295
+ outcome: null,
296
+ purpose: null,
297
+ direction: "all",
298
+ from: null,
299
+ to: null
300
+ }, ft = [
301
+ "all",
302
+ "outgoing",
303
+ "incoming",
304
+ "missed"
305
+ ], fe = "__any__", mn = /^\d{4}-\d{2}-\d{2}$/;
306
+ function ht(n) {
307
+ if (!n || !mn.test(n)) return;
308
+ const [s, u, w] = n.split("-").map(Number), b = new Date(s, u - 1, w);
309
+ return b.getFullYear() === s && b.getMonth() === u - 1 && b.getDate() === w ? b : void 0;
310
+ }
311
+ function yt(n) {
312
+ const s = (u) => String(u).padStart(2, "0");
313
+ return `${n.getFullYear()}-${s(n.getMonth() + 1)}-${s(n.getDate())}`;
314
+ }
315
+ function fn(n) {
316
+ const s = new Date(n);
317
+ return Number.isNaN(s.getTime()) ? null : yt(s);
318
+ }
319
+ function hn(n, s) {
320
+ return (n.outcome || null) === (s.outcome || null) && (n.purpose || null) === (s.purpose || null) && n.direction === s.direction && (n.from || null) === (s.from || null) && (n.to || null) === (s.to || null);
321
+ }
322
+ function gn(n, s) {
323
+ return [
324
+ (n.outcome || null) !== (s.outcome || null),
325
+ (n.purpose || null) !== (s.purpose || null),
326
+ n.direction !== s.direction,
327
+ (n.from || null) !== (s.from || null) || (n.to || null) !== (s.to || null)
328
+ ].filter(Boolean).length;
329
+ }
330
+ function pr(n) {
331
+ return n.missed === !0 && n.direction !== "outgoing";
332
+ }
333
+ function vn(n, s) {
334
+ if (s.outcome && n.outcomeId !== s.outcome || s.purpose && n.purposeId !== s.purpose || s.direction === "missed" && !pr(n) || s.direction === "outgoing" && n.direction !== "outgoing" || s.direction === "incoming" && (n.direction !== "incoming" || pr(n)))
335
+ return !1;
336
+ if (s.from || s.to) {
337
+ const u = fn(n.dateIso);
338
+ if (!u || s.from && u < s.from || s.to && u > s.to) return !1;
339
+ }
340
+ return !0;
341
+ }
342
+ function mr(n) {
343
+ const s = new Date(n).getTime();
344
+ return Number.isNaN(s) ? 0 : s;
345
+ }
346
+ function yn({ text: n }) {
347
+ const { t: s } = hr("ui"), u = gt(), w = d(null), [b, f] = g(!1), [N, A] = g(!1);
348
+ return tn(() => {
349
+ const k = w.current;
350
+ if (!k || b) return;
351
+ const he = () => A(k.scrollHeight > k.clientHeight + 1);
352
+ if (he(), typeof ResizeObserver > "u") return;
353
+ const p = new ResizeObserver(he);
354
+ return p.observe(k), () => p.disconnect();
355
+ }, [n, b]), /* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:flex-col ds:items-start ds:gap-[var(--spacing-2xs)]", children: [
356
+ /* @__PURE__ */ r(
357
+ "p",
358
+ {
359
+ ref: w,
360
+ id: u,
361
+ dir: "auto",
362
+ "data-calls-description": "",
363
+ className: [
364
+ "ds:m-0 ds:w-full type-body-sm ds:whitespace-pre-line ds:text-[color:var(--foreground)] ds:[overflow-wrap:anywhere]",
365
+ b ? "" : "ds:line-clamp-3"
366
+ ].join(" "),
367
+ children: n
368
+ }
369
+ ),
370
+ N || b ? /* @__PURE__ */ r(
371
+ D,
372
+ {
373
+ type: "button",
374
+ intent: "link",
375
+ size: "sm",
376
+ className: "ds:data-[component=button]:ps-0 ds:data-[component=button]:pe-0",
377
+ "aria-expanded": b,
378
+ "aria-controls": u,
379
+ onClick: () => f((k) => !k),
380
+ children: s(b ? "callsPanel.showLess" : "callsPanel.showMore")
381
+ }
382
+ ) : null
383
+ ] });
384
+ }
385
+ const wn = Xr(
386
+ ({
387
+ id: n,
388
+ title: s,
389
+ "aria-label": u,
390
+ nowIso: w,
391
+ locale: b,
392
+ calls: f,
393
+ status: N = "ready",
394
+ onRetry: A,
395
+ purposes: k,
396
+ outcomes: he,
397
+ privacy: p = !1,
398
+ readOnly: W = !1,
399
+ onCreate: Me,
400
+ onUpdate: Ke,
401
+ onDelete: _e,
402
+ onWriteError: wt,
403
+ filtering: vr = "client",
404
+ showFilters: yr = !0,
405
+ defaultFilters: wr,
406
+ onFiltersChange: R,
407
+ outcomeFilter: je,
408
+ onOutcomeFilterChange: ge,
409
+ purposeFilter: Fe,
410
+ onPurposeFilterChange: ve,
411
+ directionFilter: bt,
412
+ showDirectionFilter: br,
413
+ defaultDirectionFilter: Pr,
414
+ onDirectionFilterChange: ye,
415
+ fromDateFilter: He,
416
+ onFromDateFilterChange: we,
417
+ toDateFilter: ze,
418
+ onToDateFilterChange: be,
419
+ className: Pt,
420
+ ...It
421
+ }, Ir) => {
422
+ const { t: o, i18n: Nr } = hr("ui"), Pe = gt(), Sr = gt(), Nt = s ?? o("callsPanel.title"), Ie = b ?? Nr.language, M = d(null);
423
+ Wr(Ir, () => M.current, []);
424
+ const Be = d(null), St = d(null), Ne = d(!1), q = !W && !p && !!Me, $ = !W && !p && !!Ke, K = !W && !p && !!_e, _ = k ?? [], O = he ?? [], U = d(Me);
425
+ U.current = Me;
426
+ const ee = d(Ke);
427
+ ee.current = Ke;
428
+ const te = d(_e);
429
+ te.current = _e;
430
+ const E = d(wt);
431
+ E.current = wt;
432
+ const P = d(!0);
433
+ Q(() => (P.current = !0, () => {
434
+ P.current = !1;
435
+ }), []);
436
+ const xt = ue(
437
+ () => new Date(w ?? Date.now()).getFullYear(),
438
+ [w]
439
+ ), Ve = pe(
440
+ (e) => {
441
+ const t = new Date(e);
442
+ return Number.isNaN(t.getTime()) ? e : new Intl.DateTimeFormat(vt(Ie), {
443
+ calendar: "gregory",
444
+ hourCycle: "h23",
445
+ day: "numeric",
446
+ month: "short",
447
+ ...t.getFullYear() === xt ? {} : { year: "numeric" },
448
+ hour: "2-digit",
449
+ minute: "2-digit"
450
+ }).format(t);
451
+ },
452
+ [Ie, xt]
453
+ ), Se = ue(
454
+ () => [...f].sort((e, t) => mr(t.dateIso) - mr(e.dateIso)),
455
+ [f]
456
+ ), Tt = (e, t) => {
457
+ var a;
458
+ return t ? (a = e.find((l) => l.id === t)) == null ? void 0 : a.label : void 0;
459
+ }, L = vr === "server", j = {
460
+ outcome: !L || !!R || !!ge,
461
+ purpose: !L || !!R || !!ve,
462
+ direction: !L || !!R || !!ye,
463
+ from: !L || !!R || !!we,
464
+ to: !L || !!R || !!be
465
+ }, C = wr ?? pn, [xr, Tr] = g(
466
+ C.outcome
467
+ ), [kr, Er] = g(
468
+ C.purpose
469
+ ), [Cr, Dr] = g(
470
+ Pr ?? C.direction
471
+ ), [Ar, Rr] = g(C.from), [Or, Lr] = g(C.to), v = {
472
+ outcome: (je !== void 0 ? je : xr) || null,
473
+ purpose: (Fe !== void 0 ? Fe : kr) || null,
474
+ direction: bt ?? Cr,
475
+ from: (He !== void 0 ? He : Ar) || null,
476
+ to: (ze !== void 0 ? ze : Or) || null
477
+ }, F = gn(v, C), Yr = f.some(
478
+ (e) => e.direction !== void 0 || e.missed === !0
479
+ ), kt = O.length > 0 && j.outcome, Et = _.length > 0 && j.purpose, Ct = (br ?? (Yr || v.direction !== "all")) && j.direction, Dt = j.from && j.to, At = yr && (kt || Et || Ct || Dt) && (f.length > 0 || F > 0), [Mr, Kr] = g(!1), qe = d(v);
480
+ qe.current = v;
481
+ const H = (e) => {
482
+ const t = Object.fromEntries(
483
+ Object.entries(e).filter(
484
+ ([c]) => j[c]
485
+ )
486
+ );
487
+ if (Object.keys(t).length === 0) return;
488
+ const a = qe.current, l = { ...a, ...t };
489
+ qe.current = l, Kr(!0), S(null), je === void 0 && Tr(l.outcome), Fe === void 0 && Er(l.purpose), bt === void 0 && Dr(l.direction), He === void 0 && Rr(l.from), ze === void 0 && Lr(l.to), (a.outcome || null) !== (l.outcome || null) && (ge == null || ge(l.outcome)), (a.purpose || null) !== (l.purpose || null) && (ve == null || ve(l.purpose)), a.direction !== l.direction && (ye == null || ye(l.direction)), (a.from || null) !== (l.from || null) && (we == null || we(l.from)), (a.to || null) !== (l.to || null) && (be == null || be(l.to)), hn(a, l) || R == null || R(l);
490
+ }, Rt = () => H({ ...C }), $e = d(H);
491
+ $e.current = H;
492
+ const Ue = ue(
493
+ () => L ? Se : Se.filter((e) => vn(e, v)),
494
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- `filters` is rebuilt every render; its fields are the inputs
495
+ [
496
+ L,
497
+ Se,
498
+ v.outcome,
499
+ v.purpose,
500
+ v.direction,
501
+ v.from,
502
+ v.to
503
+ ]
504
+ ), [x, Z] = g(null), h = d(!1), z = d(null), re = d(null), [Ze, S] = g(null), [xe, B] = g(!1), [T, J] = g({
505
+ date: void 0,
506
+ purposeId: "",
507
+ outcomeId: "",
508
+ description: ""
509
+ }), [Ot, Te] = g(null), [_r, Je] = g(!1), Ge = pe(() => {
510
+ const e = new Date(w ?? Date.now());
511
+ J({
512
+ date: Ye(e) ? e : void 0,
513
+ purposeId: "",
514
+ outcomeId: "",
515
+ description: ""
516
+ }), Te(null), Je(!1), S(null), B(!0);
517
+ }, [w]), Lt = ue(
518
+ () => ({
519
+ get current() {
520
+ var e;
521
+ return ((e = St.current) == null ? void 0 : e.querySelector(
522
+ "[data-calls-date] button"
523
+ )) ?? null;
524
+ }
525
+ }),
526
+ []
527
+ ), [y, V] = g(
528
+ null
529
+ ), [ne, oe] = g(null), [ke, Ee] = g(!1), se = d(null), Qe = d(null), [le, ae] = g(null), [Yt, ie] = g(null), Xe = d(null), Ce = le ? f.find((e) => e.id === le) : void 0, G = d({
530
+ form: !1,
531
+ editingId: null,
532
+ deleteId: null
533
+ });
534
+ G.current = {
535
+ form: xe,
536
+ editingId: (y == null ? void 0 : y.id) ?? null,
537
+ deleteId: Ce ? le : null
538
+ }, Q(() => {
539
+ p && (B(!1), J({
540
+ date: void 0,
541
+ purposeId: "",
542
+ outcomeId: "",
543
+ description: ""
544
+ }), Te(null), V(null), oe(null), ae(null), ie(null), S(null));
545
+ }, [p]), Q(() => {
546
+ var a;
547
+ const e = G.current, t = !q && e.form || !$ && e.editingId !== null || !K && e.deleteId !== null;
548
+ if (q || B(!1), $ || V(null), K || ae(null), t && !p && Ne.current) {
549
+ const l = document.activeElement;
550
+ if (!l || l === document.body || !!l.closest(
551
+ '[data-calls-form],[data-calls-editor],[role="alertdialog"]'
552
+ )) {
553
+ const i = (a = M.current) == null ? void 0 : a.querySelector("h2");
554
+ i && (i.setAttribute("tabindex", "-1"), i.focus({
555
+ preventScroll: !0,
556
+ focusVisible: !1
557
+ }));
558
+ }
559
+ }
560
+ }, [q, $, K]);
561
+ const We = pe(
562
+ async (e, t = "ui") => {
563
+ var a, l;
564
+ if (!h.current) {
565
+ h.current = !0, z.current = "create", Z("create"), Te(null), S(null);
566
+ try {
567
+ await ((a = U.current) == null ? void 0 : a.call(U, e)), P.current && (t === "ui" && B(!1), S("saved"));
568
+ } catch (c) {
569
+ throw P.current && Te(dt(c, o("callsPanel.saveFailed"))), (l = E.current) == null || l.call(E, {
570
+ kind: "create",
571
+ error: c,
572
+ shown: P.current && (t === "ui" || G.current.form)
573
+ }), c;
574
+ } finally {
575
+ h.current = !1, z.current = null, P.current && Z(null);
576
+ }
577
+ }
578
+ },
579
+ [o]
580
+ ), et = pe(
581
+ async (e, t, a = "ui") => {
582
+ var l, c;
583
+ if (!h.current) {
584
+ h.current = !0, z.current = "update", Z("update"), oe(null), S(null);
585
+ try {
586
+ await ((l = ee.current) == null ? void 0 : l.call(ee, e, { description: t })), P.current && (a === "ui" && (se.current = e, V(null)), S("updated"));
587
+ } catch (i) {
588
+ throw P.current && oe(dt(i, o("callsPanel.updateFailed"))), (c = E.current) == null || c.call(E, {
589
+ kind: "update",
590
+ id: e,
591
+ error: i,
592
+ shown: P.current && (a === "ui" || G.current.editingId === e)
593
+ }), i;
594
+ } finally {
595
+ h.current = !1, z.current = null, P.current && Z(null);
596
+ }
597
+ }
598
+ },
599
+ [o]
600
+ ), tt = pe(
601
+ async (e, t = "ui") => {
602
+ var a, l;
603
+ if (!h.current) {
604
+ h.current = !0, z.current = "delete", Z("delete"), ie(null), S(null), re.current = null;
605
+ try {
606
+ if (await ((a = te.current) == null ? void 0 : a.call(te, e)), P.current) {
607
+ const c = G.current.deleteId === e;
608
+ ae((i) => i === e ? null : i), V((i) => (i == null ? void 0 : i.id) === e ? null : i), c ? re.current = "deleted" : S("deleted");
609
+ }
610
+ } catch (c) {
611
+ throw P.current && ie(
612
+ dt(c, o("callsPanel.deleteFailed"))
613
+ ), (l = E.current) == null || l.call(E, {
614
+ kind: "delete",
615
+ id: e,
616
+ error: c,
617
+ shown: P.current && (t === "ui" || G.current.deleteId === e)
618
+ }), c;
619
+ } finally {
620
+ h.current = !1, z.current = null, P.current && Z(null);
621
+ }
622
+ }
623
+ },
624
+ [o]
625
+ ), Mt = () => {
626
+ var e;
627
+ if (!h.current) {
628
+ if (!Ye(T.date)) {
629
+ Je(!0), (e = Lt.current) == null || e.focus();
630
+ return;
631
+ }
632
+ We({
633
+ dateIso: T.date.toISOString(),
634
+ purposeId: T.purposeId || null,
635
+ outcomeId: T.outcomeId || null,
636
+ description: T.description.trim()
637
+ }).catch(() => {
638
+ });
639
+ }
640
+ }, Kt = () => {
641
+ if (!y || h.current) return;
642
+ const e = y.text.trim();
643
+ if (!e) {
644
+ Ee(!0);
645
+ return;
646
+ }
647
+ et(y.id, e).catch(() => {
648
+ });
649
+ }, jr = (e) => {
650
+ h.current || (Qe.current = e.id, V({ id: e.id, text: e.description ?? "" }), oe(null), Ee(!1), S(null));
651
+ }, _t = () => {
652
+ h.current || (se.current = (y == null ? void 0 : y.id) ?? null, V(null), oe(null), Ee(!1));
653
+ };
654
+ Q(() => {
655
+ var t;
656
+ if (y || !se.current) return;
657
+ const e = (t = M.current) == null ? void 0 : t.querySelector(
658
+ `[data-call-id="${CSS.escape(se.current)}"] [data-calls-edit]`
659
+ );
660
+ se.current = null, e == null || e.focus();
661
+ }, [y, f]);
662
+ const jt = (e) => e.filter((t) => {
663
+ var a;
664
+ return ((a = t.source) == null ? void 0 : a.kind) === "integration";
665
+ }).length, Ft = (e) => e.filter((t) => t.missed === !0 && t.direction !== "outgoing").length, Ht = d({
666
+ callCount: f.length,
667
+ automaticCount: jt(f),
668
+ missedCount: Ft(f),
669
+ status: N,
670
+ formOpen: xe,
671
+ privacy: p,
672
+ filters: v,
673
+ activeFilterCount: F
674
+ });
675
+ Ht.current = {
676
+ callCount: p ? 0 : f.length,
677
+ automaticCount: p ? 0 : jt(f),
678
+ missedCount: p ? 0 : Ft(f),
679
+ status: N,
680
+ formOpen: xe && q,
681
+ privacy: p,
682
+ filters: { ...v },
683
+ activeFilterCount: F
684
+ };
685
+ const De = d({ readOnly: W, privacy: p });
686
+ De.current = { readOnly: W, privacy: p };
687
+ const rt = d(f);
688
+ rt.current = f;
689
+ const nt = d({
690
+ purposes: _,
691
+ outcomes: O
692
+ });
693
+ nt.current = { purposes: _, outcomes: O };
694
+ const zt = d(C);
695
+ zt.current = C;
696
+ const Bt = d(Ge);
697
+ Bt.current = Ge;
698
+ const Fr = ue(() => {
699
+ const e = async (t, a) => {
700
+ const l = De.current;
701
+ if (l.privacy) throw new Error("Calls are hidden by privacy mode.");
702
+ if (l.readOnly) throw new Error("The panel is read-only.");
703
+ if (!t) throw new Error(`The host gave the panel no way to ${a}.`);
704
+ };
705
+ return {
706
+ getState: () => ({ ...Ht.current }),
707
+ setFilter: async (t) => {
708
+ if (De.current.privacy)
709
+ throw new Error("Calls are hidden by privacy mode.");
710
+ const { purposes: a, outcomes: l } = nt.current;
711
+ if (t.outcome && !l.some((i) => i.id === t.outcome))
712
+ throw new Error("That outcome is not offered.");
713
+ if (t.purpose && !a.some((i) => i.id === t.purpose))
714
+ throw new Error("That purpose is not offered.");
715
+ if (t.direction !== void 0 && !ft.includes(t.direction))
716
+ throw new Error("That direction is not one of the four.");
717
+ for (const i of [t.from, t.to])
718
+ if (i && !ht(i))
719
+ throw new Error("A day must be a real date, as YYYY-MM-DD.");
720
+ const c = {};
721
+ t.outcome !== void 0 && (c.outcome = t.outcome || null), t.purpose !== void 0 && (c.purpose = t.purpose || null), t.direction !== void 0 && (c.direction = t.direction), t.from !== void 0 && (c.from = t.from || null), t.to !== void 0 && (c.to = t.to || null), $e.current(c);
722
+ },
723
+ clearFilters: async () => {
724
+ if (De.current.privacy)
725
+ throw new Error("Calls are hidden by privacy mode.");
726
+ $e.current({ ...zt.current });
727
+ },
728
+ openForm: async () => {
729
+ await e(!!U.current, "log a call"), Bt.current();
730
+ },
731
+ closeForm: async () => {
732
+ if (z.current === "create")
733
+ throw new Error("A call is being saved.");
734
+ B(!1);
735
+ },
736
+ logCall: async (t) => {
737
+ await e(!!U.current, "log a call");
738
+ const a = new Date(t.dateIso);
739
+ if (!Ye(a)) throw new Error("The date is not a date.");
740
+ const { purposes: l, outcomes: c } = nt.current;
741
+ if (t.purposeId && !l.some((i) => i.id === t.purposeId))
742
+ throw new Error("That purpose is not offered.");
743
+ if (t.outcomeId && !c.some((i) => i.id === t.outcomeId))
744
+ throw new Error("That outcome is not offered.");
745
+ if (h.current) throw new Error("A write is in progress.");
746
+ await We(
747
+ {
748
+ dateIso: a.toISOString(),
749
+ purposeId: t.purposeId ?? null,
750
+ outcomeId: t.outcomeId ?? null,
751
+ description: (t.description ?? "").trim()
752
+ },
753
+ "agent"
754
+ );
755
+ },
756
+ updateCall: async (t, a) => {
757
+ if (await e(!!ee.current, "edit a call"), !rt.current.some((l) => l.id === t))
758
+ throw new Error("No call has that id.");
759
+ if (!a.description.trim())
760
+ throw new Error("The description is empty.");
761
+ if (h.current) throw new Error("A write is in progress.");
762
+ await et(t, a.description.trim(), "agent");
763
+ },
764
+ deleteCall: async (t) => {
765
+ if (await e(!!te.current, "delete a call"), !rt.current.some((a) => a.id === t))
766
+ throw new Error("No call has that id.");
767
+ if (h.current) throw new Error("A write is in progress.");
768
+ await tt(t, "agent");
769
+ }
770
+ };
771
+ }, [We, et, tt]);
772
+ en(cn, Fr, n);
773
+ const Vt = d(!1);
774
+ Q(() => {
775
+ const e = M.current;
776
+ if (!e) return;
777
+ const t = Ne.current && (!document.activeElement || document.activeElement === document.body);
778
+ if (Vt.current && !t || !t && !p && N !== "ready") return;
779
+ Vt.current = !0;
780
+ const a = p || N !== "ready" ? null : Be.current;
781
+ if (a) {
782
+ a.focus({ preventScroll: !0 });
783
+ return;
784
+ }
785
+ const l = e.querySelector("h2");
786
+ l && (l.setAttribute("tabindex", "-1"), l.focus({ preventScroll: !0, focusVisible: !1 }));
787
+ }, [p, N]);
788
+ const qt = {
789
+ onFocusCapture: () => {
790
+ Ne.current = !0;
791
+ },
792
+ onBlurCapture: (e) => {
793
+ e.relatedTarget && (Ne.current = !1);
794
+ }
795
+ }, $t = N === "loading" ? o("callsPanel.loading") : x === "create" || x === "update" ? o("callsPanel.saving") : x === "delete" ? o("callsPanel.deleting") : Ze === "saved" ? o("callsPanel.saved") : Ze === "updated" ? o("callsPanel.updated") : Ze === "deleted" ? o("callsPanel.deleted") : (
796
+ // How many calls match, once the reader has changed a filter.
797
+ Mr && !p ? o("callsPanel.filteredCount", { count: Ue.length }) : ""
798
+ ), [Hr, zr] = g("");
799
+ if (Q(() => {
800
+ zr($t);
801
+ }, [$t]), p)
802
+ return /* @__PURE__ */ m(
803
+ "section",
804
+ {
805
+ ref: M,
806
+ "data-component": "calls-panel",
807
+ "data-component-id": n,
808
+ "data-privacy": "masked",
809
+ "aria-labelledby": u ? void 0 : Pe,
810
+ "aria-label": u,
811
+ className: [cr(), Pt].filter(Boolean).join(" "),
812
+ ...qt,
813
+ ...It,
814
+ children: [
815
+ /* @__PURE__ */ r(
816
+ sr,
817
+ {
818
+ title: Nt,
819
+ icon: /* @__PURE__ */ r(mt, { "aria-hidden": "true" }),
820
+ headingId: u ? void 0 : Pe,
821
+ divider: !0
822
+ }
823
+ ),
824
+ /* @__PURE__ */ r("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ r(
825
+ Oe,
826
+ {
827
+ variant: "first-use",
828
+ size: "sm",
829
+ title: o("callsPanel.privacyTitle"),
830
+ description: o("callsPanel.privacyDescription")
831
+ }
832
+ ) })
833
+ ]
834
+ }
835
+ );
836
+ let ce;
837
+ if (N === "loading")
838
+ ce = /* @__PURE__ */ r(
839
+ "div",
840
+ {
841
+ "data-calls-state": "loading",
842
+ className: "ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)] ds:overflow-y-auto ds:p-[var(--spacing-md)]",
843
+ "aria-hidden": "true",
844
+ children: ["a", "b", "c"].map((e, t) => /* @__PURE__ */ m("div", { className: dr(), children: [
845
+ /* @__PURE__ */ r(pt, { variant: "text", size: "md", width: "60%", stagger: t }),
846
+ /* @__PURE__ */ r(pt, { variant: "text", size: "sm", width: "90%", stagger: t }),
847
+ /* @__PURE__ */ r(pt, { variant: "text", size: "sm", width: "40%", stagger: t })
848
+ ] }, e))
849
+ }
850
+ );
851
+ else if (N === "error")
852
+ ce = /* @__PURE__ */ r(
853
+ "div",
854
+ {
855
+ "data-calls-state": "error",
856
+ className: "ds:min-h-0 ds:flex-1 ds:overflow-y-auto ds:p-[var(--spacing-md)]",
857
+ children: /* @__PURE__ */ r(
858
+ Oe,
859
+ {
860
+ variant: "error",
861
+ size: "sm",
862
+ title: o("callsPanel.errorTitle"),
863
+ primaryAction: A ? { label: o("callsPanel.retry"), onClick: A } : void 0
864
+ }
865
+ )
866
+ }
867
+ );
868
+ else if (Ue.length === 0) {
869
+ const e = L ? F > 0 : Se.length > 0, t = Object.values(j).some(Boolean);
870
+ ce = e ? /* @__PURE__ */ r(
871
+ "div",
872
+ {
873
+ "data-calls-state": "filtered-empty",
874
+ className: "ds:min-h-0 ds:flex-1 ds:overflow-y-auto ds:p-[var(--spacing-md)]",
875
+ children: /* @__PURE__ */ r(
876
+ Oe,
877
+ {
878
+ variant: "no-results",
879
+ size: "sm",
880
+ title: o("callsPanel.filteredEmptyTitle"),
881
+ description: o("callsPanel.filteredEmptyDescription"),
882
+ primaryAction: (
883
+ /* The "filters on" row in the header already offers Clear
884
+ filters while it shows: offer it once. */
885
+ t && !(At && F > 0) ? {
886
+ label: o("callsPanel.clearFilters"),
887
+ onClick: Rt
888
+ } : void 0
889
+ )
890
+ }
891
+ )
892
+ }
893
+ ) : /* @__PURE__ */ r(
894
+ "div",
895
+ {
896
+ "data-calls-state": "empty",
897
+ className: "ds:min-h-0 ds:flex-1 ds:overflow-y-auto ds:p-[var(--spacing-md)]",
898
+ children: /* @__PURE__ */ r(
899
+ Oe,
900
+ {
901
+ variant: "first-use",
902
+ size: "sm",
903
+ title: o("callsPanel.emptyTitle"),
904
+ description: o("callsPanel.emptyDescription")
905
+ }
906
+ )
907
+ }
908
+ );
909
+ } else
910
+ ce = /* @__PURE__ */ r(
911
+ "div",
912
+ {
913
+ tabIndex: $ || K ? void 0 : 0,
914
+ className: "ds:min-h-0 ds:flex-1 ds:overflow-y-auto ds:p-[var(--spacing-md)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:-outline-offset-[length:var(--focus-ring-width)]",
915
+ children: /* @__PURE__ */ r(
916
+ "ul",
917
+ {
918
+ "aria-label": o("callsPanel.listLabel"),
919
+ className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
920
+ children: Ue.map((e) => {
921
+ var Qt, Xt, Wt, er, tr, rr;
922
+ const t = Ve(e.dateIso), a = Tt(O, e.outcomeId), l = Tt(_, e.purposeId), c = ((Qt = O.find((I) => I.id === e.outcomeId)) == null ? void 0 : Qt.tone) ?? gr[e.outcomeId ?? ""] ?? "neutral", i = (y == null ? void 0 : y.id) === e.id, Zt = (e.description ?? "").trim(), Jr = e.missed === !0 && e.direction !== "outgoing", ot = typeof e.durationSeconds == "number" && Number.isFinite(e.durationSeconds) && e.durationSeconds >= 0 ? un(e.durationSeconds, Ie) : void 0, st = (Xt = e.phoneNumber) != null && Xt.trim() ? rn(e.phoneNumber.trim()) : void 0, lt = (Wt = e.handledBy) == null ? void 0 : Wt.trim(), Gr = ((er = e.source) == null ? void 0 : er.kind) === "integration", Jt = (rr = (tr = e.source) == null ? void 0 : tr.name) == null ? void 0 : rr.trim(), at = ur(e.recordingHref), it = ur(e.transcriptHref), Gt = `${Sr}-edit-${e.id}`, ct = `${Gt}-msg`;
923
+ return /* @__PURE__ */ m(
924
+ "li",
925
+ {
926
+ "data-call-id": e.id,
927
+ "data-outcome": e.outcomeId || void 0,
928
+ className: dr(),
929
+ children: [
930
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:items-start ds:gap-[var(--spacing-xs)]", children: [
931
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-2xs)] ds:py-[var(--spacing-xs)]", children: [
932
+ /* @__PURE__ */ r(
933
+ "time",
934
+ {
935
+ dateTime: e.dateIso,
936
+ className: "type-body-sm ds:font-semibold ds:text-[color:var(--foreground)]",
937
+ children: t
938
+ }
939
+ ),
940
+ Jr ? /* @__PURE__ */ r(
941
+ ut,
942
+ {
943
+ status: "missed",
944
+ label: o("callsPanel.missedCall"),
945
+ "data-calls-direction": "missed"
946
+ }
947
+ ) : e.direction ? /* @__PURE__ */ r(
948
+ ut,
949
+ {
950
+ status: e.direction,
951
+ label: e.direction === "incoming" ? o("callsPanel.incoming") : o("callsPanel.outgoing"),
952
+ "data-calls-direction": e.direction
953
+ }
954
+ ) : null,
955
+ a ? /* @__PURE__ */ r(
956
+ ut,
957
+ {
958
+ status: dn.has(e.outcomeId ?? "") ? e.outcomeId : "custom",
959
+ label: a,
960
+ tone: c,
961
+ "data-calls-outcome": ""
962
+ }
963
+ ) : null,
964
+ l ? /* @__PURE__ */ r(
965
+ "span",
966
+ {
967
+ "data-calls-purpose": "",
968
+ className: "type-meta ds:min-w-0 ds:text-[color:var(--muted-foreground)] ds:[overflow-wrap:anywhere]",
969
+ children: l
970
+ }
971
+ ) : null
972
+ ] }),
973
+ !i && ($ || K) ? /* @__PURE__ */ m("div", { className: "ds:-me-[var(--spacing-xs)] ds:flex ds:shrink-0 ds:items-center", children: [
974
+ $ ? /* @__PURE__ */ r(
975
+ nr,
976
+ {
977
+ "data-calls-edit": "",
978
+ icon: /* @__PURE__ */ r(ln, {}),
979
+ intent: "ghost",
980
+ "aria-label": o("callsPanel.editNamed", {
981
+ date: t
982
+ }),
983
+ tooltip: o("callsPanel.edit"),
984
+ "aria-disabled": x ? !0 : void 0,
985
+ onClick: () => jr(e)
986
+ }
987
+ ) : null,
988
+ K ? /* @__PURE__ */ r(
989
+ nr,
990
+ {
991
+ "data-calls-delete": "",
992
+ icon: /* @__PURE__ */ r(ir, {}),
993
+ intent: "ghost",
994
+ "aria-label": o("callsPanel.deleteNamed", {
995
+ date: t
996
+ }),
997
+ tooltip: o("callsPanel.delete"),
998
+ "aria-disabled": x ? !0 : void 0,
999
+ onClick: () => {
1000
+ h.current || (ie(null), S(null), Xe.current = e.id, ae(e.id));
1001
+ }
1002
+ }
1003
+ ) : null
1004
+ ] }) : null
1005
+ ] }),
1006
+ i && y ? /* @__PURE__ */ m(
1007
+ "div",
1008
+ {
1009
+ "data-calls-editor": "",
1010
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1011
+ children: [
1012
+ /* @__PURE__ */ r(
1013
+ ar,
1014
+ {
1015
+ id: Gt,
1016
+ "aria-label": o("callsPanel.editLabel", { date: t }),
1017
+ value: y.text,
1018
+ minRows: 3,
1019
+ autoResize: !0,
1020
+ ref: (I) => {
1021
+ I && Qe.current === e.id && (Qe.current = null, I.focus());
1022
+ },
1023
+ tone: ke || ne ? "error" : "default",
1024
+ "aria-invalid": ke || !!ne || void 0,
1025
+ "aria-describedby": ke || ne ? ct : void 0,
1026
+ onChange: (I) => {
1027
+ V({ id: e.id, text: I.target.value }), Ee(!1);
1028
+ },
1029
+ onKeyDown: (I) => {
1030
+ I.key === "Enter" && (I.ctrlKey || I.metaKey) && y.text.trim() ? (I.preventDefault(), Kt()) : I.key === "Escape" && (I.preventDefault(), I.stopPropagation(), _t());
1031
+ }
1032
+ }
1033
+ ),
1034
+ ke ? /* @__PURE__ */ r(
1035
+ "p",
1036
+ {
1037
+ id: ct,
1038
+ role: "alert",
1039
+ "data-calls-edit-error": "",
1040
+ className: "ds:m-0 type-meta ds:text-[color:var(--destructive)]",
1041
+ children: o("callsPanel.editRequired")
1042
+ }
1043
+ ) : null,
1044
+ ne ? /* @__PURE__ */ r(X, { variant: "error", "data-calls-edit-refused": "", children: /* @__PURE__ */ r(X.Description, { id: ct, children: ne }) }) : null,
1045
+ /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:justify-end ds:gap-[var(--spacing-sm)]", children: [
1046
+ /* @__PURE__ */ r(
1047
+ D,
1048
+ {
1049
+ type: "button",
1050
+ intent: "outline",
1051
+ size: "sm",
1052
+ "aria-disabled": x ? !0 : void 0,
1053
+ onClick: _t,
1054
+ children: o("callsPanel.editCancel")
1055
+ }
1056
+ ),
1057
+ /* @__PURE__ */ r(
1058
+ D,
1059
+ {
1060
+ type: "button",
1061
+ size: "sm",
1062
+ "aria-disabled": x ? !0 : void 0,
1063
+ "aria-busy": x === "update" || void 0,
1064
+ onClick: Kt,
1065
+ children: o(x === "update" ? "callsPanel.saving" : "callsPanel.editSave")
1066
+ }
1067
+ )
1068
+ ] })
1069
+ ]
1070
+ }
1071
+ ) : Zt ? /* @__PURE__ */ r(yn, { text: Zt }) : /* @__PURE__ */ r("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: o("callsPanel.noDescription") }),
1072
+ ot || st || lt ? /* @__PURE__ */ m(
1073
+ "div",
1074
+ {
1075
+ "data-calls-details": "",
1076
+ className: "ds:flex ds:min-w-0 ds:flex-wrap ds:items-baseline ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-2xs)] type-meta ds:text-[color:var(--muted-foreground)]",
1077
+ children: [
1078
+ ot ? /* @__PURE__ */ r("span", { "data-calls-duration": "", children: ot }) : null,
1079
+ st ? /* @__PURE__ */ r(
1080
+ "span",
1081
+ {
1082
+ "data-calls-phone": "",
1083
+ dir: "ltr",
1084
+ className: "ds:[overflow-wrap:anywhere]",
1085
+ children: st
1086
+ }
1087
+ ) : null,
1088
+ lt ? /* @__PURE__ */ r(
1089
+ "span",
1090
+ {
1091
+ "data-calls-handled-by": "",
1092
+ className: "ds:[overflow-wrap:anywhere]",
1093
+ children: o("callsPanel.takenBy", { name: lt })
1094
+ }
1095
+ ) : null
1096
+ ]
1097
+ }
1098
+ ) : null,
1099
+ Gr ? /* @__PURE__ */ r(
1100
+ "p",
1101
+ {
1102
+ "data-calls-source": "",
1103
+ className: "ds:m-0 type-meta ds:text-[color:var(--muted-foreground)] ds:[overflow-wrap:anywhere]",
1104
+ children: Jt ? o("callsPanel.loggedAutomaticallyBy", {
1105
+ app: Jt
1106
+ }) : o("callsPanel.loggedAutomatically")
1107
+ }
1108
+ ) : null,
1109
+ at || it ? /* @__PURE__ */ m(
1110
+ "div",
1111
+ {
1112
+ "data-calls-links": "",
1113
+ className: "ds:flex ds:min-w-0 ds:flex-wrap ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)] type-meta",
1114
+ children: [
1115
+ at ? /* @__PURE__ */ r(or, { href: at, external: !0, children: o("callsPanel.recording") }) : null,
1116
+ it ? /* @__PURE__ */ r(or, { href: it, external: !0, children: o("callsPanel.transcript") }) : null
1117
+ ]
1118
+ }
1119
+ ) : null,
1120
+ e.createdAtIso ? /* @__PURE__ */ r("p", { className: "ds:m-0 type-meta ds:text-[color:var(--muted-foreground)]", children: o("callsPanel.addedOn", {
1121
+ date: Ve(e.createdAtIso)
1122
+ }) }) : null
1123
+ ]
1124
+ },
1125
+ e.id
1126
+ );
1127
+ })
1128
+ }
1129
+ )
1130
+ }
1131
+ );
1132
+ const Br = {
1133
+ all: o("callsPanel.allDirections"),
1134
+ outgoing: o("callsPanel.outgoing"),
1135
+ incoming: o("callsPanel.incoming"),
1136
+ missed: o("callsPanel.directionMissed")
1137
+ }, Ae = {
1138
+ from: ht(v.from),
1139
+ to: ht(v.to)
1140
+ }, Vr = Ae.to && !Ae.from ? o("callsPanel.dateUntil", {
1141
+ date: new Intl.DateTimeFormat(vt(Ie), {
1142
+ calendar: "gregory",
1143
+ day: "numeric",
1144
+ month: "short",
1145
+ year: "numeric"
1146
+ }).format(Ae.to)
1147
+ }) : o("callsPanel.dateRangePlaceholder"), Ut = (e, t) => [
1148
+ { value: fe, label: t },
1149
+ ...e.map((a) => ({ value: a.id, label: a.label }))
1150
+ ], qr = At ? /* @__PURE__ */ m(
1151
+ "div",
1152
+ {
1153
+ role: "group",
1154
+ "aria-label": o("callsPanel.filtersLabel"),
1155
+ "data-calls-filters": "",
1156
+ className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)]",
1157
+ children: [
1158
+ /* @__PURE__ */ m("div", { className: "ds:grid ds:grid-cols-[repeat(auto-fit,minmax(min(100%,8rem),1fr))] ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1159
+ kt ? /* @__PURE__ */ r("div", { className: "ds:min-w-0", children: /* @__PURE__ */ r(
1160
+ me,
1161
+ {
1162
+ "aria-label": o("callsPanel.outcomeFilterLabel"),
1163
+ "data-calls-filter": "outcome",
1164
+ options: Ut(O, o("callsPanel.allOutcomes")),
1165
+ value: v.outcome ?? fe,
1166
+ onValueChange: (e) => H({
1167
+ outcome: !e || e === fe ? null : e
1168
+ })
1169
+ }
1170
+ ) }) : null,
1171
+ Et ? /* @__PURE__ */ r("div", { className: "ds:min-w-0", children: /* @__PURE__ */ r(
1172
+ me,
1173
+ {
1174
+ "aria-label": o("callsPanel.purposeFilterLabel"),
1175
+ "data-calls-filter": "purpose",
1176
+ options: Ut(_, o("callsPanel.allPurposes")),
1177
+ value: v.purpose ?? fe,
1178
+ onValueChange: (e) => H({
1179
+ purpose: !e || e === fe ? null : e
1180
+ })
1181
+ }
1182
+ ) }) : null,
1183
+ Ct ? /* @__PURE__ */ r("div", { className: "ds:min-w-0", children: /* @__PURE__ */ r(
1184
+ me,
1185
+ {
1186
+ "aria-label": o("callsPanel.directionFilterLabel"),
1187
+ "data-calls-filter": "direction",
1188
+ options: ft.map((e) => ({
1189
+ value: e,
1190
+ label: Br[e]
1191
+ })),
1192
+ value: v.direction,
1193
+ onValueChange: (e) => H({
1194
+ direction: ft.includes(
1195
+ e
1196
+ ) ? e : "all"
1197
+ })
1198
+ }
1199
+ ) }) : null,
1200
+ Dt ? /* @__PURE__ */ r(
1201
+ "div",
1202
+ {
1203
+ role: "group",
1204
+ "aria-label": o("callsPanel.dateRangeLabel"),
1205
+ "data-calls-filter": "date",
1206
+ className: "ds:min-w-0",
1207
+ children: /* @__PURE__ */ r(
1208
+ on,
1209
+ {
1210
+ compact: !0,
1211
+ value: Ae,
1212
+ placeholder: Vr,
1213
+ onChange: (e) => H({
1214
+ from: e.from ? yt(e.from) : null,
1215
+ to: e.to ? yt(e.to) : null
1216
+ })
1217
+ }
1218
+ )
1219
+ }
1220
+ ) : null
1221
+ ] }),
1222
+ F > 0 ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-x-[var(--spacing-sm)]", children: [
1223
+ /* @__PURE__ */ r(
1224
+ "span",
1225
+ {
1226
+ "data-calls-filter-count": "",
1227
+ className: "type-body-sm ds:text-[color:var(--muted-foreground)]",
1228
+ children: o("callsPanel.filtersActive", { count: F })
1229
+ }
1230
+ ),
1231
+ /* @__PURE__ */ r(
1232
+ D,
1233
+ {
1234
+ type: "button",
1235
+ intent: "ghost",
1236
+ size: "sm",
1237
+ "data-calls-clear-filters": "",
1238
+ onClick: Rt,
1239
+ children: o("callsPanel.clearFilters")
1240
+ }
1241
+ )
1242
+ ] }) : null
1243
+ ]
1244
+ }
1245
+ ) : void 0, Re = x === "create", $r = _r && !Ye(T.date) ? o("callsPanel.dateRequired") : void 0, Ur = /* @__PURE__ */ m(Qr, { children: [
1246
+ /* @__PURE__ */ r(
1247
+ D,
1248
+ {
1249
+ type: "button",
1250
+ intent: "outline",
1251
+ "aria-disabled": Re || void 0,
1252
+ onClick: () => {
1253
+ h.current || B(!1);
1254
+ },
1255
+ children: o("callsPanel.cancel")
1256
+ }
1257
+ ),
1258
+ /* @__PURE__ */ r(
1259
+ D,
1260
+ {
1261
+ type: "button",
1262
+ "aria-disabled": Re || void 0,
1263
+ "aria-busy": Re || void 0,
1264
+ onClick: Mt,
1265
+ children: o(Re ? "callsPanel.saving" : "callsPanel.save")
1266
+ }
1267
+ )
1268
+ ] }), Zr = Ce ? Ve(Ce.dateIso) : "", de = x === "delete";
1269
+ return /* @__PURE__ */ m(
1270
+ "section",
1271
+ {
1272
+ ref: M,
1273
+ "data-component": "calls-panel",
1274
+ "data-component-id": n,
1275
+ "aria-labelledby": u ? void 0 : Pe,
1276
+ "aria-label": u,
1277
+ className: [cr(), Pt].filter(Boolean).join(" "),
1278
+ ...qt,
1279
+ ...It,
1280
+ children: [
1281
+ /* @__PURE__ */ m(lr.Host, { className: "ds:flex-1", children: [
1282
+ /* @__PURE__ */ r(
1283
+ sr,
1284
+ {
1285
+ title: Nt,
1286
+ icon: /* @__PURE__ */ r(mt, { "aria-hidden": "true" }),
1287
+ headingId: u ? void 0 : Pe,
1288
+ filters: qr,
1289
+ divider: !0
1290
+ }
1291
+ ),
1292
+ /* @__PURE__ */ r("span", { role: "status", className: "ds:sr-only", children: Hr }),
1293
+ q && N === "ready" ? /* @__PURE__ */ r("div", { className: "ds:shrink-0 ds:px-[var(--spacing-md)] ds:pt-[var(--spacing-md)]", children: /* @__PURE__ */ r(
1294
+ D,
1295
+ {
1296
+ ref: Be,
1297
+ type: "button",
1298
+ className: "ds:w-full",
1299
+ startIcon: /* @__PURE__ */ r(an, { "aria-hidden": "true" }),
1300
+ onClick: Ge,
1301
+ children: o("callsPanel.logCall")
1302
+ }
1303
+ ) }) : null,
1304
+ ce,
1305
+ q ? /* @__PURE__ */ r(
1306
+ lr,
1307
+ {
1308
+ ref: St,
1309
+ open: xe,
1310
+ title: o("callsPanel.formTitle"),
1311
+ icon: /* @__PURE__ */ r(mt, { "aria-hidden": "true" }),
1312
+ backLabel: o("callsPanel.back"),
1313
+ headingLevel: 2,
1314
+ initialFocusRef: Lt,
1315
+ onBack: () => {
1316
+ h.current || B(!1);
1317
+ },
1318
+ footer: Ur,
1319
+ "data-calls-form": "",
1320
+ children: /* @__PURE__ */ m("div", { className: "ds:-m-[var(--panel-subview-inset)] ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
1321
+ Ot ? /* @__PURE__ */ r(X, { variant: "error", "data-calls-form-error": "", children: /* @__PURE__ */ r(X.Description, { children: Ot }) }) : null,
1322
+ /* @__PURE__ */ r("div", { "data-calls-date": "", children: /* @__PURE__ */ r(
1323
+ Le,
1324
+ {
1325
+ label: o("callsPanel.dateLabel"),
1326
+ required: !0,
1327
+ error: $r,
1328
+ children: /* @__PURE__ */ r(
1329
+ sn,
1330
+ {
1331
+ value: T.date,
1332
+ onChange: (e) => {
1333
+ J((t) => ({ ...t, date: e })), e && Je(!1);
1334
+ }
1335
+ }
1336
+ )
1337
+ }
1338
+ ) }),
1339
+ _.length > 0 ? /* @__PURE__ */ r(Le, { label: o("callsPanel.purposeLabel"), optional: !0, children: /* @__PURE__ */ r(
1340
+ me,
1341
+ {
1342
+ options: _.map((e) => ({
1343
+ value: e.id,
1344
+ label: e.label
1345
+ })),
1346
+ value: T.purposeId,
1347
+ placeholder: o("callsPanel.notSet"),
1348
+ clearable: !0,
1349
+ onValueChange: (e) => J((t) => ({ ...t, purposeId: e }))
1350
+ }
1351
+ ) }) : null,
1352
+ O.length > 0 ? /* @__PURE__ */ r(Le, { label: o("callsPanel.outcomeLabel"), optional: !0, children: /* @__PURE__ */ r(
1353
+ me,
1354
+ {
1355
+ options: O.map((e) => ({
1356
+ value: e.id,
1357
+ label: e.label
1358
+ })),
1359
+ value: T.outcomeId,
1360
+ placeholder: o("callsPanel.notSet"),
1361
+ clearable: !0,
1362
+ onValueChange: (e) => J((t) => ({ ...t, outcomeId: e }))
1363
+ }
1364
+ ) }) : null,
1365
+ /* @__PURE__ */ r(Le, { label: o("callsPanel.descriptionLabel"), optional: !0, children: /* @__PURE__ */ r(
1366
+ ar,
1367
+ {
1368
+ value: T.description,
1369
+ placeholder: o("callsPanel.descriptionPlaceholder"),
1370
+ minRows: 4,
1371
+ autoResize: !0,
1372
+ onChange: (e) => J((t) => ({ ...t, description: e.target.value })),
1373
+ onKeyDown: (e) => {
1374
+ e.key === "Enter" && (e.ctrlKey || e.metaKey) && T.description.trim() && (e.preventDefault(), Mt());
1375
+ }
1376
+ }
1377
+ ) })
1378
+ ] })
1379
+ }
1380
+ ) : null
1381
+ ] }),
1382
+ K ? /* @__PURE__ */ r(
1383
+ Y,
1384
+ {
1385
+ scope: "container",
1386
+ open: !!Ce,
1387
+ onOpenChange: (e) => {
1388
+ de || e || (ae(null), ie(null));
1389
+ },
1390
+ children: /* @__PURE__ */ m(
1391
+ Y.Content,
1392
+ {
1393
+ size: "sm",
1394
+ variant: "alert",
1395
+ onCloseAutoFocus: (e) => {
1396
+ const t = e.defaultPrevented;
1397
+ if (e.preventDefault(), re.current && (S(re.current), re.current = null), t) return;
1398
+ const a = M.current, l = (Xe.current ? a == null ? void 0 : a.querySelector(
1399
+ `[data-call-id="${CSS.escape(Xe.current)}"] [data-calls-delete]`
1400
+ ) : null) ?? Be.current ?? (a == null ? void 0 : a.querySelector("h2"));
1401
+ l && (l.tagName === "H2" && l.setAttribute("tabindex", "-1"), l.focus({ preventScroll: !0 }));
1402
+ },
1403
+ children: [
1404
+ /* @__PURE__ */ m(Y.Header, { children: [
1405
+ /* @__PURE__ */ r(Y.Title, { children: o("callsPanel.deleteTitle") }),
1406
+ /* @__PURE__ */ r(Y.Description, { children: o("callsPanel.deleteBody", { date: Zr }) })
1407
+ ] }),
1408
+ Yt ? /* @__PURE__ */ r(Y.Body, { children: /* @__PURE__ */ r(X, { variant: "error", "data-calls-delete-error": "", children: /* @__PURE__ */ r(X.Description, { children: Yt }) }) }) : null,
1409
+ /* @__PURE__ */ m(Y.Footer, { divider: !0, children: [
1410
+ /* @__PURE__ */ r(Y.Close, { asChild: !0, children: /* @__PURE__ */ r(
1411
+ D,
1412
+ {
1413
+ intent: "outline",
1414
+ "aria-disabled": de || void 0,
1415
+ children: o("callsPanel.deleteCancel")
1416
+ }
1417
+ ) }),
1418
+ /* @__PURE__ */ r(
1419
+ D,
1420
+ {
1421
+ intent: "destructive",
1422
+ startIcon: /* @__PURE__ */ r(ir, { "aria-hidden": "true" }),
1423
+ "aria-disabled": de || void 0,
1424
+ "aria-busy": de || void 0,
1425
+ onClick: () => {
1426
+ le && !h.current && tt(le).catch(() => {
1427
+ });
1428
+ },
1429
+ children: o(de ? "callsPanel.deleting" : "callsPanel.deleteConfirm")
1430
+ }
1431
+ )
1432
+ ] })
1433
+ ]
1434
+ }
1435
+ )
1436
+ }
1437
+ ) : null
1438
+ ]
1439
+ }
1440
+ );
1441
+ }
1442
+ );
1443
+ wn.displayName = "CallsPanel";
1444
+ export {
1445
+ wn as C,
1446
+ cn as c
1447
+ };
1448
+ //# sourceMappingURL=calls-panel-CnjAKFgA.js.map