@alfadocs/ui-kit-debug 1.127.2 → 1.129.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 (289) hide show
  1. package/dist/_chunks/{appointment-card-0PebvrOS.js → appointment-card-vbUsDh70.js} +49 -72
  2. package/dist/_chunks/appointment-card-vbUsDh70.js.map +1 -0
  3. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js → appointment-timeline-B5pfBl-b.js} +2 -2
  4. package/dist/_chunks/{appointment-timeline-Czd4PBkF.js.map → appointment-timeline-B5pfBl-b.js.map} +1 -1
  5. package/dist/_chunks/{appointment-tray-B04zKY7g.js → appointment-tray-BhiXetjs.js} +2 -2
  6. package/dist/_chunks/{appointment-tray-B04zKY7g.js.map → appointment-tray-BhiXetjs.js.map} +1 -1
  7. package/dist/_chunks/{calendar-_sgjuH3L.js → calendar-DzR-vdJ5.js} +614 -563
  8. package/dist/_chunks/calendar-DzR-vdJ5.js.map +1 -0
  9. package/dist/_chunks/calendar-appointment-editor-dialog-DnPADcj9.js +13438 -0
  10. package/dist/_chunks/calendar-appointment-editor-dialog-DnPADcj9.js.map +1 -0
  11. package/dist/_chunks/{calendar-event-card-DXAYWH6k.js → calendar-event-card-BNEzkjm-.js} +142 -132
  12. package/dist/_chunks/calendar-event-card-BNEzkjm-.js.map +1 -0
  13. package/dist/_chunks/{care-plan-card-bGTIliXc.js → care-plan-card-CwgkImOD.js} +2 -2
  14. package/dist/_chunks/{care-plan-card-bGTIliXc.js.map → care-plan-card-CwgkImOD.js.map} +1 -1
  15. package/dist/_chunks/{care-plan-header-k8FslxsU.js → care-plan-header-Dx5OMkc9.js} +2 -2
  16. package/dist/_chunks/{care-plan-header-k8FslxsU.js.map → care-plan-header-Dx5OMkc9.js.map} +1 -1
  17. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js → clinical-note-card-pPaeWWnu.js} +2 -2
  18. package/dist/_chunks/{clinical-note-card-DHn5W_bv.js.map → clinical-note-card-pPaeWWnu.js.map} +1 -1
  19. package/dist/_chunks/{contact-card-CGpbYuxl.js → contact-card-BSY2YpLZ.js} +2 -2
  20. package/dist/_chunks/{contact-card-CGpbYuxl.js.map → contact-card-BSY2YpLZ.js.map} +1 -1
  21. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js → contact-profile-card-CsZNMlws.js} +2 -2
  22. package/dist/_chunks/{contact-profile-card-CCgf0Ntt.js.map → contact-profile-card-CsZNMlws.js.map} +1 -1
  23. package/dist/_chunks/{default-tabs-DOuHEKI5.js → default-tabs-BnB6FUEW.js} +2 -2
  24. package/dist/_chunks/{default-tabs-DOuHEKI5.js.map → default-tabs-BnB6FUEW.js.map} +1 -1
  25. package/dist/_chunks/{entity-summary-BanguTa6.js → entity-summary-Dzk54yom.js} +2 -2
  26. package/dist/_chunks/{entity-summary-BanguTa6.js.map → entity-summary-Dzk54yom.js.map} +1 -1
  27. package/dist/_chunks/file-pen-line-k4uMBM3h.js +29 -0
  28. package/dist/_chunks/file-pen-line-k4uMBM3h.js.map +1 -0
  29. package/dist/_chunks/{info-tip-C-MPkShR.js → info-tip-B3cn3fY2.js} +2 -2
  30. package/dist/_chunks/{info-tip-C-MPkShR.js.map → info-tip-B3cn3fY2.js.map} +1 -1
  31. package/dist/_chunks/{link-DtCfnLnF.js → link-CeV7FoI6.js} +2 -2
  32. package/dist/_chunks/{link-DtCfnLnF.js.map → link-CeV7FoI6.js.map} +1 -1
  33. package/dist/_chunks/{nav-grid-D2xVcHTO.js → nav-grid-dEgDAri3.js} +2 -2
  34. package/dist/_chunks/{nav-grid-D2xVcHTO.js.map → nav-grid-dEgDAri3.js.map} +1 -1
  35. package/dist/_chunks/{note-attachment-cnj2JRrg.js → note-attachment-MNTIqdSz.js} +2 -2
  36. package/dist/_chunks/{note-attachment-cnj2JRrg.js.map → note-attachment-MNTIqdSz.js.map} +1 -1
  37. package/dist/_chunks/{note-timeline-BrjHBQfx.js → note-timeline-BQeW0VZY.js} +2 -2
  38. package/dist/_chunks/{note-timeline-BrjHBQfx.js.map → note-timeline-BQeW0VZY.js.map} +1 -1
  39. package/dist/_chunks/{notes-panel-BOwlTz2-.js → notes-panel-DIY7eNsq.js} +3 -3
  40. package/dist/_chunks/{notes-panel-BOwlTz2-.js.map → notes-panel-DIY7eNsq.js.map} +1 -1
  41. package/dist/_chunks/{patient-details-Cba9HQj_.js → patient-details-DBtEITfE.js} +2 -2
  42. package/dist/_chunks/{patient-details-Cba9HQj_.js.map → patient-details-DBtEITfE.js.map} +1 -1
  43. package/dist/_chunks/{patient-field-row-CtDihADs.js → patient-field-row-a5d4QijH.js} +2 -2
  44. package/dist/_chunks/{patient-field-row-CtDihADs.js.map → patient-field-row-a5d4QijH.js.map} +1 -1
  45. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js → patient-summary-card-BUcZ-gaL.js} +3 -3
  46. package/dist/_chunks/{patient-summary-card-DnLdbtsw.js.map → patient-summary-card-BUcZ-gaL.js.map} +1 -1
  47. package/dist/_chunks/{payment-request-card-CEIalOtr.js → payment-request-card-Dv4WbRBe.js} +2 -2
  48. package/dist/_chunks/{payment-request-card-CEIalOtr.js.map → payment-request-card-Dv4WbRBe.js.map} +1 -1
  49. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js → product-hub-panel-a8wdVOUt.js} +2 -2
  50. package/dist/_chunks/{product-hub-panel-CqRJlmb7.js.map → product-hub-panel-a8wdVOUt.js.map} +1 -1
  51. package/dist/_chunks/{public-footer-C8UIzqLJ.js → public-footer-D0cqScpz.js} +2 -2
  52. package/dist/_chunks/{public-footer-C8UIzqLJ.js.map → public-footer-D0cqScpz.js.map} +1 -1
  53. package/dist/_chunks/{rich-text-editor-BLEdXJ0l.js → rich-text-editor-TnX0SYdq.js} +1866 -1766
  54. package/dist/_chunks/rich-text-editor-TnX0SYdq.js.map +1 -0
  55. package/dist/_chunks/{signature-request-Dzs0jZsd.js → signature-request-DW2PSp66.js} +3 -3
  56. package/dist/_chunks/{signature-request-Dzs0jZsd.js.map → signature-request-DW2PSp66.js.map} +1 -1
  57. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js → signed-out-frame-Oa2e1yps.js} +2 -2
  58. package/dist/_chunks/{signed-out-frame-fUf7tqs3.js.map → signed-out-frame-Oa2e1yps.js.map} +1 -1
  59. package/dist/_chunks/task-editor-CVRrDqpe.js +1256 -0
  60. package/dist/_chunks/task-editor-CVRrDqpe.js.map +1 -0
  61. package/dist/_chunks/{treatment-receipt-1VnuinhY.js → treatment-receipt-BZzwvsnY.js} +73 -56
  62. package/dist/_chunks/treatment-receipt-BZzwvsnY.js.map +1 -0
  63. package/dist/_chunks/use-appointment-details-read-n7kycxrm.js +2439 -0
  64. package/dist/_chunks/use-appointment-details-read-n7kycxrm.js.map +1 -0
  65. package/dist/_chunks/{whatsapp-button-DV9JFmtq.js → whatsapp-button-XbozeDl_.js} +32 -25
  66. package/dist/_chunks/whatsapp-button-XbozeDl_.js.map +1 -0
  67. package/dist/agent-catalog.json +49 -16
  68. package/dist/agent-i18n/en.json +5 -5
  69. package/dist/browser-support.js +1 -1
  70. package/dist/components/_shared/patient-picker.d.ts +10 -0
  71. package/dist/components/_shared/patient-picker.d.ts.map +1 -1
  72. package/dist/components/appointment-card/index.js +2 -2
  73. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +23 -1
  74. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts.map +1 -1
  75. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts +13 -0
  76. package/dist/components/appointment-details-panel/appointment-details-panel.links.d.ts.map +1 -0
  77. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts +9 -0
  78. package/dist/components/appointment-details-panel/appointment-details-panel.recurrence.d.ts.map +1 -0
  79. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +8 -3
  80. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts.map +1 -1
  81. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +63 -1
  82. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts.map +1 -1
  83. package/dist/components/appointment-details-panel/index.d.ts +2 -1
  84. package/dist/components/appointment-details-panel/index.d.ts.map +1 -1
  85. package/dist/components/appointment-details-panel/index.js +5 -4
  86. package/dist/components/appointment-timeline/index.js +1 -1
  87. package/dist/components/bill-table/index.js +1 -1
  88. package/dist/components/calendar/calendar.d.ts +22 -0
  89. package/dist/components/calendar/calendar.d.ts.map +1 -1
  90. package/dist/components/calendar/index.js +1 -1
  91. package/dist/components/calendar-event-card/calendar-event-card.d.ts +8 -0
  92. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  93. package/dist/components/calendar-event-card/index.js +1 -1
  94. package/dist/components/care-plan-card/index.js +1 -1
  95. package/dist/components/care-plan-header/index.js +1 -1
  96. package/dist/components/clinical-note-card/index.js +1 -1
  97. package/dist/components/contact-card/index.js +1 -1
  98. package/dist/components/contact-profile-card/index.js +1 -1
  99. package/dist/components/entity-summary/index.js +1 -1
  100. package/dist/components/info-tip/index.js +1 -1
  101. package/dist/components/link/index.js +1 -1
  102. package/dist/components/nav-grid/index.js +1 -1
  103. package/dist/components/note-timeline/index.js +1 -1
  104. package/dist/components/notes-panel/index.js +1 -1
  105. package/dist/components/patient-details/index.js +1 -1
  106. package/dist/components/patient-summary-card/index.js +1 -1
  107. package/dist/components/payment-card/index.js +1 -1
  108. package/dist/components/product-hub-tray/index.js +1 -1
  109. package/dist/components/public-footer/index.js +1 -1
  110. package/dist/components/rich-text-editor/editor-toolbar.d.ts +1 -0
  111. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  112. package/dist/components/rich-text-editor/index.js +1 -1
  113. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  114. package/dist/components/task-editor/index.js +1 -1
  115. package/dist/components/treatment-receipt/index.d.ts +2 -2
  116. package/dist/components/treatment-receipt/index.d.ts.map +1 -1
  117. package/dist/components/treatment-receipt/index.js +2 -1
  118. package/dist/components/treatment-receipt/treatment-receipt.d.ts +11 -1
  119. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -1
  120. package/dist/components/whatsapp-button/index.js +1 -1
  121. package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
  122. package/dist/core.css +1 -1
  123. package/dist/fullcalendar.css +5 -1
  124. package/dist/host-compat.css +4 -1
  125. package/dist/host-legacy.css +22 -0
  126. package/dist/i18n/locales/ar.d.ts +118 -4
  127. package/dist/i18n/locales/ar.d.ts.map +1 -1
  128. package/dist/i18n/locales/ar.js +129 -15
  129. package/dist/i18n/locales/ar.js.map +1 -1
  130. package/dist/i18n/locales/de.d.ts +118 -4
  131. package/dist/i18n/locales/de.d.ts.map +1 -1
  132. package/dist/i18n/locales/de.js +129 -15
  133. package/dist/i18n/locales/de.js.map +1 -1
  134. package/dist/i18n/locales/el.d.ts +118 -4
  135. package/dist/i18n/locales/el.d.ts.map +1 -1
  136. package/dist/i18n/locales/el.js +129 -15
  137. package/dist/i18n/locales/el.js.map +1 -1
  138. package/dist/i18n/locales/en.d.ts +118 -4
  139. package/dist/i18n/locales/en.d.ts.map +1 -1
  140. package/dist/i18n/locales/en.js +121 -10
  141. package/dist/i18n/locales/en.js.map +1 -1
  142. package/dist/i18n/locales/es.d.ts +118 -4
  143. package/dist/i18n/locales/es.d.ts.map +1 -1
  144. package/dist/i18n/locales/es.js +129 -15
  145. package/dist/i18n/locales/es.js.map +1 -1
  146. package/dist/i18n/locales/fr.d.ts +118 -4
  147. package/dist/i18n/locales/fr.d.ts.map +1 -1
  148. package/dist/i18n/locales/fr.js +129 -15
  149. package/dist/i18n/locales/fr.js.map +1 -1
  150. package/dist/i18n/locales/hi.d.ts +118 -4
  151. package/dist/i18n/locales/hi.d.ts.map +1 -1
  152. package/dist/i18n/locales/hi.js +129 -15
  153. package/dist/i18n/locales/hi.js.map +1 -1
  154. package/dist/i18n/locales/it.d.ts +118 -4
  155. package/dist/i18n/locales/it.d.ts.map +1 -1
  156. package/dist/i18n/locales/it.js +129 -15
  157. package/dist/i18n/locales/it.js.map +1 -1
  158. package/dist/i18n/locales/ja.d.ts +118 -4
  159. package/dist/i18n/locales/ja.d.ts.map +1 -1
  160. package/dist/i18n/locales/ja.js +129 -15
  161. package/dist/i18n/locales/ja.js.map +1 -1
  162. package/dist/i18n/locales/nl.d.ts +118 -4
  163. package/dist/i18n/locales/nl.d.ts.map +1 -1
  164. package/dist/i18n/locales/nl.js +129 -15
  165. package/dist/i18n/locales/nl.js.map +1 -1
  166. package/dist/i18n/locales/pl.d.ts +118 -4
  167. package/dist/i18n/locales/pl.d.ts.map +1 -1
  168. package/dist/i18n/locales/pl.js +129 -15
  169. package/dist/i18n/locales/pl.js.map +1 -1
  170. package/dist/i18n/locales/pt.d.ts +118 -4
  171. package/dist/i18n/locales/pt.d.ts.map +1 -1
  172. package/dist/i18n/locales/pt.js +129 -15
  173. package/dist/i18n/locales/pt.js.map +1 -1
  174. package/dist/i18n/locales/ro.d.ts +118 -4
  175. package/dist/i18n/locales/ro.d.ts.map +1 -1
  176. package/dist/i18n/locales/ro.js +129 -15
  177. package/dist/i18n/locales/ro.js.map +1 -1
  178. package/dist/i18n/locales/ru.d.ts +118 -4
  179. package/dist/i18n/locales/ru.d.ts.map +1 -1
  180. package/dist/i18n/locales/ru.js +129 -15
  181. package/dist/i18n/locales/ru.js.map +1 -1
  182. package/dist/i18n/locales/sq.d.ts +118 -4
  183. package/dist/i18n/locales/sq.d.ts.map +1 -1
  184. package/dist/i18n/locales/sq.js +129 -15
  185. package/dist/i18n/locales/sq.js.map +1 -1
  186. package/dist/i18n/locales/sv.d.ts +118 -4
  187. package/dist/i18n/locales/sv.d.ts.map +1 -1
  188. package/dist/i18n/locales/sv.js +129 -15
  189. package/dist/i18n/locales/sv.js.map +1 -1
  190. package/dist/i18n/locales/tr.d.ts +118 -4
  191. package/dist/i18n/locales/tr.d.ts.map +1 -1
  192. package/dist/i18n/locales/tr.js +129 -15
  193. package/dist/i18n/locales/tr.js.map +1 -1
  194. package/dist/i18n/locales/zh.d.ts +118 -4
  195. package/dist/i18n/locales/zh.d.ts.map +1 -1
  196. package/dist/i18n/locales/zh.js +129 -15
  197. package/dist/i18n/locales/zh.js.map +1 -1
  198. package/dist/index.js +1112 -1107
  199. package/dist/locales/ar.json +129 -15
  200. package/dist/locales/de.json +129 -15
  201. package/dist/locales/el.json +129 -15
  202. package/dist/locales/en.json +121 -7
  203. package/dist/locales/es.json +129 -15
  204. package/dist/locales/fr.json +129 -15
  205. package/dist/locales/hi.json +129 -15
  206. package/dist/locales/it.json +129 -15
  207. package/dist/locales/ja.json +129 -15
  208. package/dist/locales/nl.json +129 -15
  209. package/dist/locales/pl.json +129 -15
  210. package/dist/locales/pt.json +129 -15
  211. package/dist/locales/ro.json +129 -15
  212. package/dist/locales/ru.json +129 -15
  213. package/dist/locales/sq.json +129 -15
  214. package/dist/locales/sv.json +129 -15
  215. package/dist/locales/tr.json +129 -15
  216. package/dist/locales/zh.json +129 -15
  217. package/dist/patterns/calendar/calendar-appointment-details.d.ts +74 -2
  218. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  219. package/dist/patterns/calendar/calendar-archive.d.ts +12 -0
  220. package/dist/patterns/calendar/calendar-archive.d.ts.map +1 -0
  221. package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
  222. package/dist/patterns/calendar/calendar-care-rules.d.ts +19 -23
  223. package/dist/patterns/calendar/calendar-care-rules.d.ts.map +1 -1
  224. package/dist/patterns/calendar/calendar-delete-confirm.d.ts +18 -0
  225. package/dist/patterns/calendar/calendar-delete-confirm.d.ts.map +1 -0
  226. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts +12 -0
  227. package/dist/patterns/calendar/calendar-document-scope-confirm.d.ts.map +1 -0
  228. package/dist/patterns/calendar/calendar-editor-guard.d.ts +12 -0
  229. package/dist/patterns/calendar/calendar-editor-guard.d.ts.map +1 -0
  230. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +13 -2
  231. package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -1
  232. package/dist/patterns/calendar/calendar-load-error.d.ts +11 -0
  233. package/dist/patterns/calendar/calendar-load-error.d.ts.map +1 -0
  234. package/dist/patterns/calendar/calendar-patient-locked.d.ts +13 -0
  235. package/dist/patterns/calendar/calendar-patient-locked.d.ts.map +1 -0
  236. package/dist/patterns/calendar/calendar-patient-picker.d.ts +6 -1
  237. package/dist/patterns/calendar/calendar-patient-picker.d.ts.map +1 -1
  238. package/dist/patterns/calendar/calendar-prompts.d.ts +11 -0
  239. package/dist/patterns/calendar/calendar-prompts.d.ts.map +1 -0
  240. package/dist/patterns/calendar/calendar-settings-ical.d.ts +11 -0
  241. package/dist/patterns/calendar/calendar-settings-ical.d.ts.map +1 -0
  242. package/dist/patterns/calendar/calendar-settings-overlay.d.ts +73 -0
  243. package/dist/patterns/calendar/calendar-settings-overlay.d.ts.map +1 -0
  244. package/dist/patterns/calendar/calendar-settings-panel.d.ts +62 -0
  245. package/dist/patterns/calendar/calendar-settings-panel.d.ts.map +1 -0
  246. package/dist/patterns/calendar/calendar-settings-practice.d.ts +20 -0
  247. package/dist/patterns/calendar/calendar-settings-practice.d.ts.map +1 -0
  248. package/dist/patterns/calendar/calendar-status-colours.d.ts +18 -0
  249. package/dist/patterns/calendar/calendar-status-colours.d.ts.map +1 -0
  250. package/dist/patterns/calendar/calendar-upcoming-panel.d.ts.map +1 -1
  251. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts +17 -2
  252. package/dist/patterns/calendar/calendar-waiting-list-panel.d.ts.map +1 -1
  253. package/dist/patterns/calendar/calendar-workspace.d.ts +258 -6
  254. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  255. package/dist/patterns/calendar/calendar-workspace.model.d.ts +98 -11
  256. package/dist/patterns/calendar/calendar-workspace.model.d.ts.map +1 -1
  257. package/dist/patterns/calendar/calendar.data.d.ts +9 -3
  258. package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
  259. package/dist/patterns/calendar/calendar.journey.d.ts +69 -5
  260. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  261. package/dist/patterns/calendar/calendar.model.d.ts +72 -14
  262. package/dist/patterns/calendar/calendar.model.d.ts.map +1 -1
  263. package/dist/patterns/calendar/calendar.preferences.d.ts +4 -0
  264. package/dist/patterns/calendar/calendar.preferences.d.ts.map +1 -1
  265. package/dist/patterns/calendar/calendar.sheets.d.ts +85 -17
  266. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  267. package/dist/patterns/calendar/calendar.surface.d.ts +64 -6
  268. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  269. package/dist/patterns/calendar/calendar.types.d.ts +223 -6
  270. package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
  271. package/dist/patterns/calendar/index.d.ts +9 -6
  272. package/dist/patterns/calendar/index.d.ts.map +1 -1
  273. package/dist/patterns/calendar/index.js +18 -15
  274. package/dist/patterns/signature-request/index.js +1 -1
  275. package/dist/patterns/signed-out-frame/index.js +1 -1
  276. package/dist/tokens.css +5 -1
  277. package/package.json +1 -1
  278. package/dist/_chunks/appointment-card-0PebvrOS.js.map +0 -1
  279. package/dist/_chunks/calendar-_sgjuH3L.js.map +0 -1
  280. package/dist/_chunks/calendar-appointment-editor-dialog-B-zYgCgH.js +0 -10974
  281. package/dist/_chunks/calendar-appointment-editor-dialog-B-zYgCgH.js.map +0 -1
  282. package/dist/_chunks/calendar-event-card-DXAYWH6k.js.map +0 -1
  283. package/dist/_chunks/rich-text-editor-BLEdXJ0l.js.map +0 -1
  284. package/dist/_chunks/task-editor-C05yx7JJ.js +0 -1218
  285. package/dist/_chunks/task-editor-C05yx7JJ.js.map +0 -1
  286. package/dist/_chunks/treatment-receipt-1VnuinhY.js.map +0 -1
  287. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js +0 -2198
  288. package/dist/_chunks/use-appointment-details-read-Bm408XzX.js.map +0 -1
  289. package/dist/_chunks/whatsapp-button-DV9JFmtq.js.map +0 -1
@@ -1,1218 +0,0 @@
1
- import { jsx as n, jsxs as k, Fragment as Te } from "react/jsx-runtime";
2
- import { useState as q, useRef as C, useEffect as qe, forwardRef as At, useId as Bt, useMemo as Pe } from "react";
3
- import { c as ht } from "./index-D2ZczOXr.js";
4
- import { useTranslation as gt } from "react-i18next";
5
- import { A as $ } from "./alert-C4WKViaS.js";
6
- import { B as $e } from "./button-DohK_Ak_.js";
7
- import { I as We } from "./icon-button-S8_weU3g.js";
8
- import { C as Qe } from "./combobox-BBCVQS-S.js";
9
- import { D as le } from "./dialog-CIUn5oLb.js";
10
- import { D as Ft } from "./date-picker-BmVBVpVu.js";
11
- import { F as H } from "./form-field-CyHfOVKF.js";
12
- import { I as xt } from "./icon-button-group-BKtkVZ1W.js";
13
- import { P as Pt } from "./panel-header-CbtlTe85.js";
14
- import { P as Ot } from "./panel-subview-DCyvn-49.js";
15
- import { R as Oe } from "./radio-BZQs6_36.js";
16
- import { R as jt } from "./radio-group-ChIKyeSJ.js";
17
- import { S as Mt } from "./scroll-area-CY5SLYNw.js";
18
- import { S as Ke } from "./select-uESzXTX6.js";
19
- import { S as He } from "./skeleton-tTWJpvAq.js";
20
- import { S as $t } from "./switch-DO6uC4HJ.js";
21
- import { T as qt } from "./text-area-COMVJ1yE.js";
22
- import { T as je } from "./text-input-B6iAgCr3.js";
23
- import { T as Vt } from "./time-picker-DDr5vhwQ.js";
24
- import { u as _t } from "./registry-DvAUVLHh.js";
25
- import { u as zt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
26
- import { c as Lt } from "./compose-refs-C0k0tdqF.js";
27
- import { E as Ut, a as Wt } from "./compact-editor-fields-cP6yh7xv.js";
28
- import { n as Kt } from "./normalize-diacritics-BNGbFNlJ.js";
29
- import { P as Ht } from "./privacy-mask-DJ1gee4c.js";
30
- import { g as Me, h as Gt } from "./handled-rejection-6gqCf5vt.js";
31
- import { L as Qt } from "./lock-ClAFG1gy.js";
32
- import { X as Yt } from "./x-B5YnXwCz.js";
33
- import { C as Xt } from "./circle-off-DuT9pVy2.js";
34
- import { U as Jt } from "./user-B12p7bVF.js";
35
- import { B as Zt } from "./building-2-D33bLCWL.js";
36
- import { S as en } from "./stethoscope-sZXGC43m.js";
37
- import { T as dt } from "./trash-2-uumy3fy1.js";
38
- import { S as lt } from "./square-check-big-dj0o8yA3.js";
39
- import { p as tn } from "./privacy-mask-text-B8YfzB7L.js";
40
- import { L as nn } from "./loader-circle-BECIU_8N.js";
41
- import { c as on } from "./createLucideIcon-DhHxpK9K.js";
42
- /**
43
- * @license lucide-react v1.22.0 - ISC
44
- *
45
- * This source code is licensed under the ISC license.
46
- * See the LICENSE file in the root directory of this source tree.
47
- */
48
- const rn = [
49
- [
50
- "path",
51
- {
52
- d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
53
- key: "1c8476"
54
- }
55
- ],
56
- ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
57
- ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
58
- ], an = on("save", rn);
59
- function sn({
60
- patients: o = [],
61
- searchPatients: l,
62
- ...I
63
- }) {
64
- if (l)
65
- return /* @__PURE__ */ n(dn, { ...I, searchPatients: l });
66
- const { value: y, onValueChange: x, selectedLabel: B, placeholder: Y, size: D, disabled: X } = I;
67
- return /* @__PURE__ */ n(
68
- Qe,
69
- {
70
- value: y,
71
- onValueChange: x,
72
- options: [
73
- ...y && !o.some((T) => T.id === y) ? [{ value: y, label: B ?? "" }] : [],
74
- ...o.map((T) => ({ value: T.id, label: T.name }))
75
- ],
76
- placeholder: Y,
77
- size: D,
78
- disabled: X,
79
- clearable: !0
80
- }
81
- );
82
- }
83
- function dn({
84
- value: o,
85
- onValueChange: l,
86
- selectedLabel: I,
87
- placeholder: y,
88
- size: x,
89
- disabled: B,
90
- searchPatients: Y
91
- }) {
92
- const { t: D } = gt("ui"), [X, T] = q(""), [J, Z] = q(0), [P, se] = q(), [N, ee] = q(), _ = C(null), O = X.trim();
93
- qe(() => {
94
- if (!O) return;
95
- const m = new AbortController(), S = { query: O, source: Y };
96
- ee({ ...S, status: "loading", patients: [] });
97
- const ce = setTimeout(() => {
98
- Promise.resolve().then(() => Y(O, { signal: m.signal })).then(
99
- (oe) => {
100
- m.signal.aborted || ee({ ...S, status: "ready", patients: oe });
101
- },
102
- () => {
103
- m.signal.aborted || ee({ ...S, status: "error", patients: [] });
104
- }
105
- );
106
- }, 250);
107
- return () => {
108
- clearTimeout(ce), m.abort();
109
- };
110
- }, [O, Y, J]);
111
- const z = (N == null ? void 0 : N.query) === O && N.source === Y, L = O ? z ? N.status : "loading" : "idle", te = z && L === "ready" ? N.patients : [], ne = L === "loading" ? D("inputs.search.loading") : L === "error" ? D("emptyState.error.description") : L === "idle" ? y : te.length === 0 ? D("inputs.combobox.empty") : "", j = te.map((m) => ({
112
- value: m.id,
113
- label: m.name
114
- }));
115
- return o && !te.some((m) => m.id === o) && j.push({
116
- value: o,
117
- label: (P == null ? void 0 : P.id) === o ? P.name : I ?? ""
118
- }), /* @__PURE__ */ k(
119
- "div",
120
- {
121
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
122
- "data-component": "patient-picker",
123
- "data-status": L,
124
- children: [
125
- /* @__PURE__ */ n(
126
- Qe,
127
- {
128
- ref: _,
129
- options: j,
130
- value: o,
131
- onValueChange: (m) => {
132
- se(
133
- (S) => te.find((ce) => ce.id === m) ?? ((S == null ? void 0 : S.id) === m ? S : void 0)
134
- ), l(m);
135
- },
136
- onQueryChange: T,
137
- onOpenChange: (m) => {
138
- !m && L !== "error" && T("");
139
- },
140
- filter: (m) => !O || te.some((S) => Kt(S.id) === m) ? 1 : 0,
141
- size: x,
142
- disabled: B,
143
- placeholder: y,
144
- emptyMessage: ne || void 0,
145
- clearable: !0
146
- }
147
- ),
148
- /* @__PURE__ */ n("p", { role: "status", className: "type-body-sm ds:text-muted-foreground", children: ne }),
149
- L === "error" ? /* @__PURE__ */ n(
150
- $e,
151
- {
152
- size: "sm",
153
- intent: "ghost",
154
- onClick: () => {
155
- var m;
156
- Z((S) => S + 1), (m = _.current) == null || m.focus();
157
- },
158
- children: D("emptyState.error.cta")
159
- }
160
- ) : null
161
- ]
162
- }
163
- );
164
- }
165
- const ln = {
166
- id: "task-editor",
167
- // set_value backs set_fields and set_done; submit backs save; dismiss
168
- // backs cancel.
169
- capabilities: ["set_value", "submit", "dismiss"],
170
- state: {
171
- status: {
172
- type: "'loading' | 'ready' | 'error' | 'locked' | 'withheld'",
173
- descriptionKey: "ui.agent.taskEditor.state.status",
174
- description: "Where the form is: loading the task, ready, failed to load, locked (edit mode with nothing to load) or withheld behind the privacy notice. Writes need 'ready'.",
175
- read: (o) => o.getStatus()
176
- },
177
- draft: {
178
- type: "{ mode: string; dateIso: string | null; about: string; patientId: string | null; companyId: string | null; operatorId: string | null; typeId: string | null; assigneeId: string | null; done: boolean; hasNote: boolean; noteLength: number }",
179
- descriptionKey: "ui.agent.taskEditor.state.draft",
180
- description: "The draft as Save would send it: ids and structure only, never the note body. done is the last value the host confirmed.",
181
- read: (o) => o.getDraft()
182
- },
183
- canSave: {
184
- type: "boolean",
185
- descriptionKey: "ui.agent.taskEditor.state.canSave",
186
- description: "Whether save would reach the host now: the form is ready, the note is filled, a chosen counterpart has an id and no write is pending.",
187
- read: (o) => o.canSave()
188
- }
189
- },
190
- actions: {
191
- set_fields: {
192
- safety: "phi",
193
- argsType: "{ dateIso?: string; note?: string; typeId?: string; assigneeId?: string | null; about?: 'nobody' | 'patient' | 'company' | 'operator'; patientId?: string; companyId?: string; operatorId?: string }",
194
- argsSchema: {
195
- type: "object",
196
- properties: {
197
- dateIso: { type: "string", format: "date-time" },
198
- note: { type: "string" },
199
- typeId: { type: "string" },
200
- assigneeId: { type: ["string", "null"] },
201
- about: {
202
- type: "string",
203
- enum: ["nobody", "patient", "company", "operator"]
204
- },
205
- patientId: { type: "string" },
206
- companyId: { type: "string" },
207
- operatorId: { type: "string" }
208
- }
209
- },
210
- idempotent: !0,
211
- errors: [
212
- "An id the host lists, its patient search or the stored task do not resolve.",
213
- "More than one of patientId, companyId and operatorId.",
214
- "The form is not ready, is read-only or is withheld."
215
- ],
216
- descriptionKey: "ui.agent.taskEditor.actions.setFields",
217
- description: "Set draft fields. Ids must come from the host lists, a patient the host search returned, or equal the stored one. At most one counterpart per call, and it selects its branch; assigneeId null is nobody. Nothing is saved.",
218
- invoke: (o, l) => {
219
- o.setFields(l);
220
- }
221
- },
222
- save: {
223
- safety: "phi",
224
- // Reaches the host's data source; the result is the host's promise.
225
- openWorld: !0,
226
- descriptionKey: "ui.agent.taskEditor.actions.save",
227
- description: "Save the task through the host. Resolves once the write lands and rejects with the host error, which the form also shows.",
228
- invoke: (o) => o.save()
229
- },
230
- set_done: {
231
- safety: "write",
232
- argsType: "{ done: boolean }",
233
- argsSchema: {
234
- type: "object",
235
- properties: { done: { type: "boolean" } },
236
- required: ["done"]
237
- },
238
- openWorld: !0,
239
- errors: [
240
- "The form is not ready, is read-only or has no Done seam.",
241
- "A save, a delete or another Done change is in flight.",
242
- "The task was already saved or deleted in this session."
243
- ],
244
- descriptionKey: "ui.agent.taskEditor.actions.setDone",
245
- description: "Mark an existing task done or not done through the host. A rejection rolls the switch back.",
246
- invoke: (o, l) => o.setDone(l.done)
247
- },
248
- delete: {
249
- safety: "destructive",
250
- idempotent: !0,
251
- openWorld: !0,
252
- descriptionKey: "ui.agent.taskEditor.actions.delete",
253
- description: "Delete the task through the host, without the confirmation dialog. Resolves once the delete lands.",
254
- invoke: (o) => o.deleteTask()
255
- },
256
- cancel: {
257
- safety: "destructive",
258
- errors: ["A save or delete is in flight: wait for it to settle."],
259
- descriptionKey: "ui.agent.taskEditor.actions.cancel",
260
- description: "Close the editor without saving. Anything typed since the last save is lost. Refused while a save or delete is in flight.",
261
- invoke: (o) => {
262
- o.cancel();
263
- }
264
- }
265
- },
266
- domHooks: {
267
- root: {
268
- attr: "data-component",
269
- value: "task-editor",
270
- description: "Marks the TaskEditor body. It also carries data-variant and data-status. In the subview variant it sits inside the panel-subview section, which repeats data-component-id, data-variant and data-status and holds the heading and footer."
271
- },
272
- instanceId: {
273
- attr: "data-component-id",
274
- sourceProp: "id",
275
- description: "Sourced from the id prop, or generated. Addresses one editor from the agent. [data-component-id] reaches the footer actions in both variants."
276
- }
277
- }
278
- }, V = "none", ct = {
279
- showError: !1,
280
- saving: !1,
281
- saveError: void 0,
282
- done: !1,
283
- confirmedDone: !1,
284
- donePending: !1,
285
- doneError: void 0,
286
- deleting: !1,
287
- deleteError: void 0,
288
- confirmDeleteOpen: !1,
289
- accepted: !1
290
- };
291
- function cn(o) {
292
- return o.patientId ? "patient" : o.companyId ? "company" : o.operatorId ? "operator" : "nobody";
293
- }
294
- function Ye(o) {
295
- return { hours: o.getHours(), minutes: o.getMinutes() };
296
- }
297
- function ut(o) {
298
- const l = o ?? /* @__PURE__ */ new Date();
299
- return {
300
- date: l,
301
- time: Ye(l),
302
- note: "",
303
- operatorId: V,
304
- typeId: "",
305
- assigneeId: V,
306
- about: "nobody",
307
- patientId: "",
308
- companyId: ""
309
- };
310
- }
311
- function un(o) {
312
- const l = new Date(o.dateIso);
313
- return {
314
- date: l,
315
- time: Ye(l),
316
- note: o.note,
317
- /* `||`, not `??`: a host's '' is unset, like patient and company. */
318
- operatorId: o.operatorId || V,
319
- /* A stored type wins. With none, '' falls through to the first entry. */
320
- typeId: o.typeId ?? "",
321
- /* `||` too: '' would become a Select option with an empty value. */
322
- assigneeId: o.assigneeId || V,
323
- about: cn(o),
324
- patientId: o.patientId ?? "",
325
- companyId: o.companyId ?? ""
326
- };
327
- }
328
- const pn = [
329
- ["patientId", "patient"],
330
- ["companyId", "company"],
331
- ["operatorId", "operator"]
332
- ];
333
- function mn({
334
- mode: o,
335
- taskId: l,
336
- initialDate: I,
337
- active: y,
338
- taskTypes: x,
339
- assignees: B,
340
- companies: Y,
341
- operators: D,
342
- patients: X,
343
- searchedPatients: T,
344
- resolvePatientLabel: J,
345
- loadTask: Z,
346
- onCreateTask: P,
347
- onUpdateTask: se,
348
- onDeleteTask: N,
349
- onSetTaskDone: ee,
350
- onSaved: _,
351
- onDeleted: O,
352
- readOnly: z,
353
- withheld: L,
354
- maskPatient: te,
355
- fallbackError: ne
356
- }) {
357
- var Ce;
358
- const j = o === "edit", [m, S] = q(0), [ce, oe] = q(y);
359
- ce !== y && (oe(y), y && S((e) => e + 1));
360
- const U = `${o}|${l ?? ""}|${m}`, [p, fe] = q(
361
- () => ut(I)
362
- ), [G, Ee] = q(ct), [b, r] = q(), w = (e) => Ee((i) => ({ ...i, ...e })), he = (e) => fe((i) => ({ ...i, ...e })), [ge, re] = q(U);
363
- ge !== U && (re(U), fe(ut(I)), Ee(ct), r(void 0));
364
- const F = C({
365
- subject: U,
366
- saving: !1,
367
- deleting: !1,
368
- donePending: !1,
369
- accepted: !1
370
- });
371
- F.current.subject !== U && (F.current = {
372
- subject: U,
373
- saving: !1,
374
- deleting: !1,
375
- donePending: !1,
376
- accepted: !1
377
- });
378
- const ve = C(!0);
379
- qe(() => (ve.current = !0, () => {
380
- ve.current = !1;
381
- }), []);
382
- const R = (e) => ve.current && F.current === e, ue = C(Z);
383
- ue.current = Z;
384
- const d = !!Z, [A, c] = q(0), [s, f] = q(null), ke = C(s);
385
- ke.current = s;
386
- const ye = y && j && !!l && d && !L;
387
- qe(() => {
388
- const e = ue.current;
389
- if (!ye || !l || !e) return;
390
- const i = F.current, h = ke.current;
391
- if ((h == null ? void 0 : h.subject) === i.subject && h.status === "ready")
392
- return;
393
- const u = new AbortController();
394
- return Promise.resolve().then(
395
- () => (
396
- /* Cleaned up before this ran (StrictMode's replay, a quick re-run):
397
- never call the host with a signal already aborted. */
398
- u.signal.aborted ? Promise.reject(u.signal.reason) : e(l, { signal: u.signal })
399
- )
400
- ).then(
401
- (g) => {
402
- u.signal.aborted || !R(i) || (fe(un(g)), w({ done: g.done, confirmedDone: g.done }), r(g), f({ subject: i.subject, status: "ready" }));
403
- },
404
- (g) => {
405
- u.signal.aborted || !R(i) || f({
406
- subject: i.subject,
407
- status: "error",
408
- message: Me(g, ne)
409
- });
410
- }
411
- ), () => u.abort();
412
- }, [ye, U, A]);
413
- const M = j ? !l || !d ? "locked" : L ? "withheld" : (s == null ? void 0 : s.subject) === U ? s.status : "loading" : "ready", Q = () => {
414
- M === "error" && (f(null), c((e) => e + 1));
415
- }, pe = p.typeId || (((Ce = x[0]) == null ? void 0 : Ce.id) ?? ""), Ve = p.about === "nobody" || p.about === "patient" && p.patientId !== "" || p.about === "company" && p.companyId !== "" || p.about === "operator" && p.operatorId !== V, me = !z && p.note.trim() !== "" && p.date !== void 0 && Ve && /* Required whenever the host offers a list. */
416
- (x.length === 0 || pe !== "") && !G.saving && !G.donePending, be = j ? se : P, Se = () => {
417
- const { date: e, time: i } = p;
418
- return e ? {
419
- dateIso: new Date(
420
- e.getFullYear(),
421
- e.getMonth(),
422
- e.getDate(),
423
- i.hours,
424
- i.minutes,
425
- 0,
426
- 0
427
- ).toISOString(),
428
- note: p.note.trim(),
429
- /* Sent whatever the host's list says, including a value the list no
430
- longer resolves: a real link must survive a Save that never
431
- offered to change it. */
432
- typeId: pe === "" ? void 0 : pe,
433
- assigneeId: p.assigneeId === V ? void 0 : p.assigneeId,
434
- /* ONE counterpart, decided by `about` alone: the platform refuses a
435
- task carrying two. Never gated on a list being loaded, or a list
436
- that empties mid-edit would unlink the task on Save. */
437
- patientId: p.about === "patient" && p.patientId ? p.patientId : void 0,
438
- companyId: p.about === "company" && p.companyId ? p.companyId : void 0,
439
- operatorId: p.about === "operator" && p.operatorId !== V ? p.operatorId : void 0,
440
- /* The last CONFIRMED value only, never an optimistic or rolled-back
441
- toggle. */
442
- done: G.confirmedDone
443
- } : void 0;
444
- }, E = (e) => Gt(new Error(`TaskEditor: ${e}`)), Re = () => {
445
- const e = F.current;
446
- if (M !== "ready") return E(`cannot save while ${M}.`);
447
- if (!be) return E("the host gave no save seam.");
448
- if (e.accepted) return E("this task was already saved.");
449
- if (e.deleting) return E("a delete is in flight.");
450
- if (e.saving || !me) return E("the task cannot be saved.");
451
- const i = Se();
452
- if (!i)
453
- return w({ showError: !0 }), E("the task has no date.");
454
- const h = l;
455
- e.saving = !0, w({ saving: !0, saveError: void 0 });
456
- const u = (async () => {
457
- try {
458
- if (j)
459
- await (se == null ? void 0 : se(h, i)), e.accepted = !0, R(e) && (w({ accepted: !0 }), _ == null || _({
460
- ...i,
461
- id: h,
462
- done: i.done ?? !1
463
- }));
464
- else {
465
- const g = await (P == null ? void 0 : P(i));
466
- e.accepted = !0, R(e) && (w({ accepted: !0 }), g && (_ == null || _(g)));
467
- }
468
- } catch (g) {
469
- throw R(e) && w({ saveError: Me(g, ne) }), g;
470
- } finally {
471
- e.saving = !1, R(e) && w({ saving: !1 });
472
- }
473
- })();
474
- return u.catch(() => {
475
- }), u;
476
- }, Ae = (e) => {
477
- const i = F.current;
478
- if (M !== "ready")
479
- return E(`cannot change Done while ${M}.`);
480
- if (!j || !l || !ee || z)
481
- return E("the host gave no Done seam.");
482
- if (i.donePending) return E("a Done change is already pending.");
483
- if (i.saving || i.deleting)
484
- return E("a save or delete is in flight.");
485
- if (i.accepted)
486
- return E("this task was already saved or deleted.");
487
- if (e === G.done) return Promise.resolve();
488
- const h = G.confirmedDone, u = l;
489
- i.donePending = !0, w({ done: e, donePending: !0, doneError: void 0 });
490
- const g = (async () => {
491
- try {
492
- await ee(u, e), R(i) && w({ confirmedDone: e });
493
- } catch (W) {
494
- throw R(i) && w({
495
- done: h,
496
- doneError: Me(W, ne)
497
- }), W;
498
- } finally {
499
- i.donePending = !1, R(i) && w({ donePending: !1 });
500
- }
501
- })();
502
- return g.catch(() => {
503
- }), g;
504
- }, Be = () => {
505
- const e = F.current;
506
- if (M !== "ready") return E(`cannot delete while ${M}.`);
507
- if (!j || !l || !N || z)
508
- return E("the host gave no delete seam.");
509
- if (e.saving || e.accepted || e.deleting)
510
- return E("the task cannot be deleted now.");
511
- const i = l;
512
- e.deleting = !0, w({ deleting: !0, deleteError: void 0 });
513
- const h = (async () => {
514
- try {
515
- await N(i), e.accepted = !0, R(e) && (w({ accepted: !0, confirmDeleteOpen: !1 }), O == null || O(i));
516
- } catch (u) {
517
- throw R(e) && w({ deleteError: Me(u, ne) }), u;
518
- } finally {
519
- e.deleting = !1, R(e) && w({ deleting: !1 });
520
- }
521
- })();
522
- return h.catch(() => {
523
- }), h;
524
- }, de = (e, i, h) => (
525
- /* '' is never an id, even when the stored record holds one. */
526
- i !== "" && (i === h || e.some((u) => u.id === i))
527
- ), Ie = (e) => {
528
- var g;
529
- if (M !== "ready")
530
- throw new Error(`TaskEditor: cannot set fields while ${M}.`);
531
- if (z) throw new Error("TaskEditor: the task is read-only.");
532
- const i = pn.filter(([W]) => e[W] !== void 0);
533
- if (i.length > 1)
534
- throw new Error(
535
- "TaskEditor: set at most one of patientId, companyId and operatorId."
536
- );
537
- const h = (g = i[0]) == null ? void 0 : g[1];
538
- if (e.about !== void 0 && h && e.about !== h)
539
- throw new Error(
540
- `TaskEditor: about "${e.about}" does not match the ${h} id.`
541
- );
542
- if (e.typeId !== void 0 && !de(x, e.typeId, b == null ? void 0 : b.typeId))
543
- throw new Error(`TaskEditor: unknown typeId "${e.typeId}".`);
544
- if (e.assigneeId !== void 0 && e.assigneeId !== null && !de(B, e.assigneeId, b == null ? void 0 : b.assigneeId))
545
- throw new Error(`TaskEditor: unknown assigneeId "${e.assigneeId}".`);
546
- if (e.companyId !== void 0 && !de(Y, e.companyId, b == null ? void 0 : b.companyId))
547
- throw new Error(`TaskEditor: unknown companyId "${e.companyId}".`);
548
- if (e.operatorId !== void 0 && !de(D, e.operatorId, b == null ? void 0 : b.operatorId))
549
- throw new Error(`TaskEditor: unknown operatorId "${e.operatorId}".`);
550
- if (e.patientId !== void 0) {
551
- if (te)
552
- throw new Error("TaskEditor: no patient can be set in privacy mode.");
553
- if (!(de(X, e.patientId, b == null ? void 0 : b.patientId) || T.has(e.patientId) || (J == null ? void 0 : J(e.patientId)) !== void 0))
554
- throw new Error(`TaskEditor: unknown patientId "${e.patientId}".`);
555
- }
556
- const u = {};
557
- if (e.dateIso !== void 0) {
558
- const W = new Date(e.dateIso);
559
- if (Number.isNaN(W.getTime()))
560
- throw new Error(`TaskEditor: "${e.dateIso}" is not a date.`);
561
- u.date = W, u.time = Ye(W);
562
- }
563
- e.note !== void 0 && (u.note = e.note), e.typeId !== void 0 && (u.typeId = e.typeId), e.assigneeId !== void 0 && (u.assigneeId = e.assigneeId ?? V), e.about !== void 0 && (u.about = e.about), e.patientId !== void 0 && (u.patientId = e.patientId, u.about = "patient"), e.companyId !== void 0 && (u.companyId = e.companyId, u.about = "company"), e.operatorId !== void 0 && (u.operatorId = e.operatorId, u.about = "operator"), he(u);
564
- }, Fe = () => {
565
- const e = Se();
566
- return {
567
- mode: o,
568
- dateIso: (e == null ? void 0 : e.dateIso) ?? null,
569
- about: p.about,
570
- patientId: (e == null ? void 0 : e.patientId) ?? null,
571
- companyId: (e == null ? void 0 : e.companyId) ?? null,
572
- operatorId: (e == null ? void 0 : e.operatorId) ?? null,
573
- typeId: (e == null ? void 0 : e.typeId) ?? null,
574
- assigneeId: (e == null ? void 0 : e.assigneeId) ?? null,
575
- done: G.confirmedDone,
576
- hasNote: p.note.trim() !== "",
577
- noteLength: p.note.trim().length
578
- };
579
- };
580
- return {
581
- status: M,
582
- loadError: (s == null ? void 0 : s.subject) === U ? s.message : void 0,
583
- retry: Q,
584
- fields: p,
585
- patchFields: he,
586
- stored: b,
587
- chosenTypeId: pe,
588
- canSave: me,
589
- /** What the agent's `canSave` reports: the button's rule plus the
590
- * status, the seam and a save that has not landed yet. */
591
- agentCanSave: M === "ready" && !!be && me && !G.accepted,
592
- showSave: !z && !!be,
593
- showDelete: j && !z && !!N && !!l,
594
- showDone: j && !z && !!ee,
595
- ui: G,
596
- patchUi: w,
597
- /** True once a save or delete landed in this session. */
598
- isAccepted: () => F.current.accepted,
599
- /** A save or delete is in flight: closing now would lose its outcome. */
600
- isBusy: () => F.current.saving || F.current.deleting,
601
- submit: Re,
602
- setDone: Ae,
603
- remove: Be,
604
- applyPatch: Ie,
605
- draftState: Fe
606
- };
607
- }
608
- const pt = ht("ds:flex ds:min-h-0 ds:flex-col", {
609
- variants: {
610
- /** The panel fills its box; the subview body sits in its scroll area. */
611
- variant: {
612
- /* Focusable from script only, as the subview section is: where focus
613
- waits when a control takes itself away. */
614
- panel: "ds:h-full ds:focus-visible:outline-none",
615
- /* The states pad themselves, so the subview's ring inset is cancelled. */
616
- subview: "ds:-m-[var(--panel-subview-inset)]"
617
- }
618
- },
619
- defaultVariants: { variant: "panel" }
620
- }), mt = ht(
621
- `ds:m-0 ds:min-w-0 ds:border-0 ds:p-[var(--spacing-md)] ${Wt}`,
622
- {
623
- variants: {
624
- /** 'form': the fields in a column. 'notice': the locked notice. */
625
- layout: {
626
- form: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
627
- notice: "ds:flex-1"
628
- }
629
- },
630
- defaultVariants: { layout: "form" }
631
- }
632
- ), a = (o) => `calendarWorkspace.taskEditor.${o}`, fn = (o, l, I) => I.includes(l) ? 1 : 0, Ne = [], Ge = (o, l) => Array.from(o.querySelectorAll("[data-task-id]")).filter(
633
- (I) => !l.contains(I)
634
- ), hn = 'button:not([disabled]), a[href], input:not([disabled]), [tabindex]:not([tabindex="-1"])', ft = (o, l) => {
635
- if (!o) return [];
636
- const I = Array.from(
637
- o.querySelectorAll("[data-action]")
638
- );
639
- return [
640
- ...I.filter((y) => l && y.dataset.action === l),
641
- ...I.filter((y) => y.dataset.action === "open-task"),
642
- ...Array.from(o.querySelectorAll(hn))
643
- ];
644
- }, gn = At(
645
- ({
646
- id: o,
647
- mode: l,
648
- taskId: I,
649
- initialDate: y,
650
- variant: x = "panel",
651
- open: B = !0,
652
- onExited: Y,
653
- taskTypes: D = Ne,
654
- assignees: X = Ne,
655
- companies: T = Ne,
656
- operators: J = Ne,
657
- patients: Z = Ne,
658
- searchPatients: P,
659
- patientLabel: se,
660
- resolvePatientLabel: N,
661
- companyLabel: ee,
662
- operatorLabel: _,
663
- backLabel: O,
664
- loadTask: z,
665
- onCreateTask: L,
666
- onUpdateTask: te,
667
- onDeleteTask: ne,
668
- onSetTaskDone: j,
669
- onCancel: m,
670
- onSaved: S,
671
- onDeleted: ce,
672
- readOnly: oe = !1,
673
- privacy: U = !1,
674
- privacyMode: p = "notice",
675
- onPrivacyOff: fe,
676
- className: G,
677
- ...Ee
678
- }, b) => {
679
- const { t: r } = gt("ui"), w = Bt(), he = o ?? w, ge = l === "edit", re = x === "subview", F = !re || B, ve = U && ge && p === "notice", R = U && !ve, [ue] = q(() => /* @__PURE__ */ new Map()), d = mn({
680
- mode: l,
681
- taskId: I,
682
- initialDate: y,
683
- active: F,
684
- taskTypes: D,
685
- assignees: X,
686
- companies: T,
687
- operators: J,
688
- patients: Z,
689
- searchedPatients: ue,
690
- resolvePatientLabel: N,
691
- loadTask: z,
692
- onCreateTask: L,
693
- onUpdateTask: te,
694
- onDeleteTask: ne,
695
- onSetTaskDone: j,
696
- onSaved: S,
697
- onDeleted: ce,
698
- readOnly: oe,
699
- withheld: ve,
700
- maskPatient: R,
701
- fallbackError: r("emptyState.error.title")
702
- }), { status: A, fields: c, ui: s, stored: f } = d, ke = C(P);
703
- ke.current = P;
704
- const ye = !!P, M = Pe(
705
- () => ye ? async (t, v) => {
706
- const K = await ke.current(t, v);
707
- for (const ie of K)
708
- ue.set(ie.id, ie.name);
709
- return K;
710
- } : void 0,
711
- [ye, ue]
712
- ), Q = C(d);
713
- Q.current = d;
714
- const pe = C(m);
715
- pe.current = m;
716
- const Ve = Pe(
717
- () => ({
718
- getStatus: () => Q.current.status,
719
- getDraft: () => Q.current.draftState(),
720
- canSave: () => Q.current.agentCanSave,
721
- setFields: (t) => Q.current.applyPatch(t),
722
- save: () => Q.current.submit(),
723
- setDone: (t) => Q.current.setDone(t),
724
- deleteTask: () => Q.current.remove(),
725
- cancel: () => {
726
- if (Q.current.isBusy())
727
- throw new Error("TaskEditor: a save or delete is in flight.");
728
- pe.current();
729
- }
730
- }),
731
- []
732
- );
733
- _t(ln, F ? Ve : null, he);
734
- const me = C(null), be = Pe(
735
- () => Lt(b, me),
736
- [b]
737
- ), Se = C(null), E = C(null), Re = C(!1);
738
- re && B && !Re.current && (E.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null), Re.current = re && B;
739
- const Ae = C(B);
740
- Ae.current = B;
741
- const Be = C(I);
742
- Be.current = ge ? I : void 0, qe(() => {
743
- var st;
744
- const t = me.current, v = t == null ? void 0 : t.parentElement;
745
- if (!re || !B || !t || !v) return;
746
- const K = E.current, ie = K && v.contains(K) && !t.contains(K) ? K : null, Nt = Be.current, De = (ie == null ? void 0 : ie.closest("[data-task-id]")) ?? Ge(v, t).find((xe) => xe.dataset.taskId === Nt), rt = De == null ? void 0 : De.dataset.taskId, at = (st = ie == null ? void 0 : ie.closest("[data-action]")) == null ? void 0 : st.dataset.action, it = De ? Ge(v, t).indexOf(De) : -1;
747
- return () => {
748
- if (Ae.current && t.isConnected) return;
749
- const xe = document.activeElement;
750
- if (!v.isConnected || xe && xe !== document.body) return;
751
- const Ue = Ge(v, t), Rt = [
752
- ...ft(
753
- Ue.find((we) => rt !== void 0 && we.dataset.taskId === rt),
754
- at
755
- ),
756
- /* The row that took its place, or the last row when it was last. */
757
- ...it >= 0 ? ft(Ue[Math.min(it, Ue.length - 1)], at) : [],
758
- v.querySelector('[data-action="add-task"]'),
759
- v.querySelector("[data-tasks-panel-region]")
760
- ];
761
- for (const we of Rt)
762
- if (!(!we || t.contains(we)) && (we.focus(), document.activeElement === we))
763
- return;
764
- };
765
- }, [B, re]);
766
- const de = C(null), Ie = C(!1), Fe = (t) => () => {
767
- Ie.current = !0, t();
768
- };
769
- zt(() => {
770
- var K;
771
- if (!Ie.current) return;
772
- const t = me.current, v = document.activeElement;
773
- if (v && v !== document.body && v !== t) {
774
- Ie.current = !1;
775
- return;
776
- }
777
- A !== "loading" && (Ie.current = !1), (K = A === "error" ? de.current : t) == null || K.focus({
778
- preventScroll: !0
779
- });
780
- }, [A]);
781
- const Ce = r(a(ge ? "editTitle" : "title")), e = T.length > 0, i = J.length > 0, h = ye || Z.length > 0, u = Pe(
782
- () => T.map((t) => ({ value: t.id, label: t.label })),
783
- [T]
784
- ), g = (t) => {
785
- var v;
786
- return (N == null ? void 0 : N(t)) ?? ((v = Z.find((K) => K.id === t)) == null ? void 0 : v.name) ?? ue.get(t) ?? (t === (f == null ? void 0 : f.patientId) ? se : void 0) ?? r("calendarWorkspace.details.patientNotLoaded");
787
- }, W = (t) => t === (f == null ? void 0 : f.operatorId) && _ ? _ : r(a("operatorUnresolved"), { id: t }), vt = [
788
- { value: V, label: r(a("operatorNone")) },
789
- ...J.map((t) => ({ value: t.id, label: t.label })),
790
- /* An operator the roster no longer lists is still a real link, so it
791
- stays pickable and survives a Save. */
792
- ...c.operatorId !== V && !J.some((t) => t.id === c.operatorId) ? [
793
- {
794
- value: c.operatorId,
795
- label: W(c.operatorId)
796
- }
797
- ] : []
798
- ], yt = D.some((t) => t.custom) && D.some((t) => !t.custom), bt = [
799
- ...D.map((t) => ({
800
- value: t.id,
801
- label: t.label,
802
- group: yt ? r(a(t.custom ? "typeGroupCustom" : "typeGroupStandard")) : void 0
803
- })),
804
- /* An id the list no longer resolves is still a real link: offered as
805
- its own option so Save re-sends it. */
806
- ...d.chosenTypeId && !D.some((t) => t.id === d.chosenTypeId) ? [
807
- {
808
- value: d.chosenTypeId,
809
- label: r(a("typeUnresolved"), { id: d.chosenTypeId })
810
- }
811
- ] : []
812
- ], It = [
813
- { value: V, label: r(a("assigneeNone")) },
814
- ...X.map((t) => ({ value: t.id, label: t.label })),
815
- ...c.assigneeId !== V && !X.some((t) => t.id === c.assigneeId) ? [
816
- {
817
- value: c.assigneeId,
818
- label: r(a("assigneeUnresolved"), { id: c.assigneeId })
819
- }
820
- ] : []
821
- ], ae = c.about === "company" && c.companyId && !T.some((t) => t.id === c.companyId) ? c.companyId : void 0, wt = ae && ae === (f == null ? void 0 : f.companyId) && ee ? ee : r(a("companyUnresolved"), { id: ae }), Xe = /* @__PURE__ */ k($, { variant: "info", announce: "off", icon: /* @__PURE__ */ n(Qt, { "aria-hidden": "true" }), children: [
822
- /* @__PURE__ */ n($.Title, { as: "p", children: r("calendarWorkspace.details.readOnlyTitle") }),
823
- /* @__PURE__ */ n($.Description, { children: r(a("readOnlyBody")) })
824
- ] }), _e = s.saving || s.deleting, Je = () => {
825
- d.isBusy() || m();
826
- }, Et = /* @__PURE__ */ n(
827
- We,
828
- {
829
- size: "sm",
830
- intent: "outline",
831
- icon: /* @__PURE__ */ n(Yt, { "aria-hidden": "true" }),
832
- "aria-label": r(a("cancel")),
833
- tooltip: r(a("cancel")),
834
- "data-action": "cancel-task",
835
- disabled: _e,
836
- onClick: Je
837
- }
838
- ), ze = s.saving || s.accepted, Ze = (t) => /* @__PURE__ */ k(Te, { children: [
839
- t && d.showDelete ? /* @__PURE__ */ n(
840
- We,
841
- {
842
- ref: Se,
843
- size: "sm",
844
- intent: "destructiveOutline",
845
- icon: /* @__PURE__ */ n(dt, { "aria-hidden": "true" }),
846
- "aria-label": r(a("delete")),
847
- tooltip: r(a("delete")),
848
- "data-action": "delete-task",
849
- disabled: _e || s.accepted,
850
- onClick: () => d.patchUi({ confirmDeleteOpen: !0, deleteError: void 0 })
851
- }
852
- ) : null,
853
- /* @__PURE__ */ k(
854
- xt,
855
- {
856
- role: "toolbar",
857
- "aria-label": r(a("actionsLabel")),
858
- className: "ds:ms-auto",
859
- children: [
860
- Et,
861
- t && d.showSave ? /* @__PURE__ */ n(
862
- We,
863
- {
864
- size: "sm",
865
- intent: "primary",
866
- icon: s.saving ? /* @__PURE__ */ n(
867
- nn,
868
- {
869
- "aria-hidden": "true",
870
- className: "ds:animate-spin ds:motion-reduce:animate-none"
871
- }
872
- ) : /* @__PURE__ */ n(an, { "aria-hidden": "true" }),
873
- "aria-label": r(a("save")),
874
- tooltip: r(a("save")),
875
- disabled: !ze && !d.canSave,
876
- "aria-disabled": ze || void 0,
877
- "aria-busy": s.saving || void 0,
878
- "data-action": "save-task",
879
- onClick: () => {
880
- ze || d.submit();
881
- }
882
- }
883
- ) : null
884
- ]
885
- }
886
- ),
887
- t && d.showSave ? (
888
- /* Out of flow, so it never moves the footer's two ends. */
889
- /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: s.saving ? r(a("saving")) : "" })
890
- ) : null
891
- ] }), kt = /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
892
- /* @__PURE__ */ n("span", { role: "status", className: "ds:sr-only", children: r("common.loading") }),
893
- /* @__PURE__ */ k(
894
- "div",
895
- {
896
- "aria-hidden": "true",
897
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
898
- children: [
899
- /* @__PURE__ */ n(
900
- He,
901
- {
902
- variant: "rounded",
903
- height: "calc(var(--spacing-xl) + var(--spacing-sm))"
904
- }
905
- ),
906
- /* @__PURE__ */ n(
907
- He,
908
- {
909
- variant: "rounded",
910
- height: "calc(var(--spacing-xl) * 3)",
911
- stagger: 1
912
- }
913
- ),
914
- /* @__PURE__ */ n(
915
- He,
916
- {
917
- variant: "rounded",
918
- height: "calc(var(--spacing-xl) + var(--spacing-sm))",
919
- stagger: 2
920
- }
921
- )
922
- ]
923
- }
924
- )
925
- ] }), St = /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
926
- /* @__PURE__ */ n($, { variant: "error", children: /* @__PURE__ */ n($.Description, { children: d.loadError }) }),
927
- /* @__PURE__ */ n(
928
- $e,
929
- {
930
- ref: de,
931
- intent: "outline",
932
- "data-action": "retry-load",
933
- onClick: Fe(d.retry),
934
- children: r("emptyState.error.cta")
935
- }
936
- )
937
- ] }), Ct = /* @__PURE__ */ n("fieldset", { disabled: !0, className: mt({ layout: "notice" }), children: Xe }), Dt = () => c.about !== "patient" ? null : R ? /* @__PURE__ */ n(H, { label: r(a("aboutPatient")), children: /* @__PURE__ */ n(je, { value: tn(), disabled: !0, readOnly: !0 }) }) : h ? /* @__PURE__ */ n(H, { label: r(a("aboutPatient")), children: /* @__PURE__ */ n(
938
- sn,
939
- {
940
- value: c.patientId,
941
- onValueChange: (t) => d.patchFields({ patientId: t }),
942
- patients: Z,
943
- searchPatients: M,
944
- selectedLabel: c.patientId ? g(c.patientId) : void 0,
945
- placeholder: r("calendarWorkspace.editor.patientSearch"),
946
- disabled: oe
947
- }
948
- ) }) : c.patientId ? /* @__PURE__ */ n(H, { label: r(a("aboutPatient")), children: /* @__PURE__ */ n(je, { value: g(c.patientId), disabled: !0, readOnly: !0 }) }) : null, et = /* @__PURE__ */ k("fieldset", { disabled: oe, className: mt(), children: [
949
- oe ? Xe : null,
950
- /* @__PURE__ */ n(H, { label: r(a("date")), children: /* @__PURE__ */ n(
951
- Ft,
952
- {
953
- value: c.date,
954
- onChange: (t) => d.patchFields({ date: t })
955
- }
956
- ) }),
957
- /* @__PURE__ */ n(H, { label: r(a("time")), children: /* @__PURE__ */ n(
958
- Vt,
959
- {
960
- value: c.time,
961
- onChange: (t) => d.patchFields({ time: t })
962
- }
963
- ) }),
964
- /* @__PURE__ */ n(
965
- H,
966
- {
967
- label: r(a("note")),
968
- required: !0,
969
- error: s.showError && c.note.trim() === "" ? r(a("noteRequired")) : void 0,
970
- children: /* @__PURE__ */ n(
971
- qt,
972
- {
973
- value: c.note,
974
- onChange: (t) => {
975
- d.patchFields({ note: t.target.value }), d.patchUi({ showError: !1 });
976
- },
977
- minRows: 3,
978
- autoResize: !0
979
- }
980
- )
981
- }
982
- ),
983
- D.length > 0 ? /* @__PURE__ */ n(H, { label: r(a("type")), required: !0, children: /* @__PURE__ */ n(
984
- Ke,
985
- {
986
- options: bt,
987
- value: d.chosenTypeId,
988
- onValueChange: (t) => t && d.patchFields({ typeId: t })
989
- }
990
- ) }) : null,
991
- X.length > 0 ? /* @__PURE__ */ n(H, { label: r(a("assignee")), children: /* @__PURE__ */ n(
992
- Ke,
993
- {
994
- options: It,
995
- value: c.assigneeId,
996
- onValueChange: (t) => t && d.patchFields({ assigneeId: t })
997
- }
998
- ) }) : null,
999
- /* @__PURE__ */ k(
1000
- jt,
1001
- {
1002
- label: r(a("about")),
1003
- variant: "segmented",
1004
- className: Ut,
1005
- value: c.about,
1006
- onValueChange: (t) => d.patchFields({ about: t }),
1007
- children: [
1008
- /* @__PURE__ */ n(
1009
- Oe,
1010
- {
1011
- value: "nobody",
1012
- label: r(a("aboutNobody")),
1013
- icon: /* @__PURE__ */ n(Xt, { "aria-hidden": "true" })
1014
- }
1015
- ),
1016
- h || c.about === "patient" || f != null && f.patientId ? /* @__PURE__ */ n(
1017
- Oe,
1018
- {
1019
- value: "patient",
1020
- label: r(a("aboutPatient")),
1021
- icon: /* @__PURE__ */ n(Jt, { "aria-hidden": "true" })
1022
- }
1023
- ) : null,
1024
- e || c.about === "company" || f != null && f.companyId ? /* @__PURE__ */ n(
1025
- Oe,
1026
- {
1027
- value: "company",
1028
- label: r(a("aboutCompany")),
1029
- icon: /* @__PURE__ */ n(Zt, { "aria-hidden": "true" })
1030
- }
1031
- ) : null,
1032
- i || c.about === "operator" || f != null && f.operatorId ? /* @__PURE__ */ n(
1033
- Oe,
1034
- {
1035
- value: "operator",
1036
- label: r(a("aboutOperator")),
1037
- icon: /* @__PURE__ */ n(en, { "aria-hidden": "true" })
1038
- }
1039
- ) : null
1040
- ]
1041
- }
1042
- ),
1043
- Dt(),
1044
- c.about === "company" ? /* @__PURE__ */ k(Te, { children: [
1045
- ae ? /* @__PURE__ */ n(H, { label: r(a("companyName")), children: /* @__PURE__ */ n(je, { value: wt, disabled: !0, readOnly: !0 }) }) : null,
1046
- e ? /* @__PURE__ */ n(
1047
- H,
1048
- {
1049
- label: r(
1050
- a(ae ? "companyReplace" : "companyName")
1051
- ),
1052
- children: /* @__PURE__ */ n(
1053
- Qe,
1054
- {
1055
- options: u,
1056
- value: ae ? "" : c.companyId,
1057
- onValueChange: (t) => ae ? t && d.patchFields({ companyId: t }) : d.patchFields({ companyId: t }),
1058
- clearable: !ae && !oe,
1059
- filter: fn,
1060
- placeholder: r(a("companySearch")),
1061
- "aria-label": r(
1062
- a(ae ? "companyReplace" : "companyName")
1063
- )
1064
- }
1065
- )
1066
- }
1067
- ) : null
1068
- ] }) : null,
1069
- c.about === "operator" ? i ? /* @__PURE__ */ n(H, { label: r(a("operator")), children: /* @__PURE__ */ n(
1070
- Ke,
1071
- {
1072
- options: vt,
1073
- value: c.operatorId,
1074
- onValueChange: (t) => t && d.patchFields({ operatorId: t })
1075
- }
1076
- ) }) : c.operatorId !== V ? (
1077
- /* No roster to pick from: name the link read-only. */
1078
- /* @__PURE__ */ n(H, { label: r(a("operator")), children: /* @__PURE__ */ n(
1079
- je,
1080
- {
1081
- value: W(c.operatorId),
1082
- disabled: !0,
1083
- readOnly: !0
1084
- }
1085
- ) })
1086
- ) : null : null,
1087
- d.showDone ? /* @__PURE__ */ k(Te, { children: [
1088
- /* @__PURE__ */ n(
1089
- $t,
1090
- {
1091
- label: r(a("done")),
1092
- checked: s.done,
1093
- disabled: _e || s.accepted,
1094
- "aria-disabled": s.donePending || void 0,
1095
- "aria-busy": s.donePending || void 0,
1096
- className: "ds:aria-disabled:cursor-progress",
1097
- onCheckedChange: (t) => {
1098
- s.donePending || d.setDone(t);
1099
- }
1100
- }
1101
- ),
1102
- s.doneError ? /* @__PURE__ */ n($, { variant: "error", children: /* @__PURE__ */ n($.Description, { children: s.doneError }) }) : null
1103
- ] }) : null,
1104
- s.saveError ? /* @__PURE__ */ n($, { variant: "error", children: /* @__PURE__ */ n($.Description, { children: s.saveError }) }) : null,
1105
- s.deleteError && !s.confirmDeleteOpen ? /* @__PURE__ */ n($, { variant: "error", children: /* @__PURE__ */ n($.Description, { children: s.deleteError }) }) : null
1106
- ] }), tt = A === "loading" ? kt : A === "error" ? St : A === "locked" ? Ct : A === "withheld" ? /* @__PURE__ */ n(
1107
- Ht,
1108
- {
1109
- onTurnOff: fe ? Fe(fe) : void 0
1110
- }
1111
- ) : re ? et : /* @__PURE__ */ n(Mt, { orientation: "vertical", className: "ds:min-h-0 ds:flex-1", children: et }), Le = A === "ready" ? Ze(!0) : A === "locked" || A === "withheld" ? Ze(!1) : null, Tt = A === "ready" && d.showDelete, nt = ge ? /* @__PURE__ */ n(
1112
- le,
1113
- {
1114
- open: s.confirmDeleteOpen && F,
1115
- onOpenChange: (t) => {
1116
- s.deleting || d.patchUi(
1117
- t ? { confirmDeleteOpen: !0 } : { confirmDeleteOpen: !1, deleteError: void 0 }
1118
- );
1119
- },
1120
- children: /* @__PURE__ */ k(
1121
- le.Content,
1122
- {
1123
- size: "sm",
1124
- variant: "alert",
1125
- onCloseAutoFocus: (t) => {
1126
- var v;
1127
- t.preventDefault(), d.isAccepted() || (v = Se.current) == null || v.focus();
1128
- },
1129
- children: [
1130
- /* @__PURE__ */ k(le.Header, { children: [
1131
- /* @__PURE__ */ n(le.Title, { children: r(a("deleteConfirmTitle")) }),
1132
- /* @__PURE__ */ n(le.Description, { children: r(a("deleteConfirmBody")) })
1133
- ] }),
1134
- s.deleteError ? /* @__PURE__ */ n(le.Body, { children: /* @__PURE__ */ n($, { variant: "error", children: /* @__PURE__ */ n($.Description, { children: s.deleteError }) }) }) : null,
1135
- /* @__PURE__ */ k(le.Footer, { divider: !0, children: [
1136
- /* @__PURE__ */ n(le.Close, { asChild: !0, children: /* @__PURE__ */ n($e, { intent: "outline", "aria-disabled": s.deleting || void 0, children: r(a("deleteCancel")) }) }),
1137
- /* @__PURE__ */ n(
1138
- $e,
1139
- {
1140
- intent: "destructive",
1141
- startIcon: /* @__PURE__ */ n(dt, { "aria-hidden": "true" }),
1142
- "aria-disabled": s.deleting || void 0,
1143
- "aria-busy": s.deleting || void 0,
1144
- onClick: () => {
1145
- s.deleting || d.remove();
1146
- },
1147
- children: r(a("deleteConfirm"))
1148
- }
1149
- )
1150
- ] })
1151
- ]
1152
- }
1153
- )
1154
- }
1155
- ) : null, ot = {
1156
- "data-component": "task-editor",
1157
- "data-component-id": he,
1158
- "data-variant": x,
1159
- "data-status": A
1160
- };
1161
- return re ? /* @__PURE__ */ k(Te, { children: [
1162
- /* @__PURE__ */ n(
1163
- Ot,
1164
- {
1165
- ...Ee,
1166
- "data-component-id": he,
1167
- "data-variant": x,
1168
- "data-status": A,
1169
- ref: be,
1170
- open: B,
1171
- onBack: Je,
1172
- onExited: Y,
1173
- title: Ce,
1174
- icon: /* @__PURE__ */ n(lt, { "aria-hidden": "true" }),
1175
- backLabel: O ?? r(a("back")),
1176
- footer: Le,
1177
- footerAlign: Tt ? "between" : "end",
1178
- className: G,
1179
- children: /* @__PURE__ */ n("div", { ...ot, className: pt({ variant: x }), children: tt })
1180
- }
1181
- ),
1182
- nt
1183
- ] }) : /* @__PURE__ */ k(Te, { children: [
1184
- /* @__PURE__ */ k(
1185
- "div",
1186
- {
1187
- tabIndex: -1,
1188
- ...Ee,
1189
- ...ot,
1190
- ref: be,
1191
- className: pt({ variant: x, className: G }),
1192
- children: [
1193
- /* @__PURE__ */ n(
1194
- Pt,
1195
- {
1196
- title: Ce,
1197
- icon: /* @__PURE__ */ n(lt, { "aria-hidden": "true" }),
1198
- sticky: !0,
1199
- divider: !0
1200
- }
1201
- ),
1202
- tt,
1203
- Le ? /* @__PURE__ */ n("div", { className: "ds:relative ds:z-[var(--z-sticky)] ds:shrink-0 ds:border-t ds:border-[color:var(--border)] ds:bg-[var(--background)]", children: /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: Le }) }) : null
1204
- ]
1205
- }
1206
- ),
1207
- nt
1208
- ] });
1209
- }
1210
- );
1211
- gn.displayName = "TaskEditor";
1212
- export {
1213
- sn as P,
1214
- an as S,
1215
- gn as T,
1216
- ln as t
1217
- };
1218
- //# sourceMappingURL=task-editor-C05yx7JJ.js.map