@alfadocs/ui-kit 1.135.0 → 1.137.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 (216) hide show
  1. package/dist/_chunks/{ai-prompt-input-JIPbrTF3.js → ai-prompt-input-CVNeusoW.js} +2 -2
  2. package/dist/_chunks/ai-summary-panel-BhCo2vZF.js +1045 -0
  3. package/dist/_chunks/{alia-sidebar-CtwhdASP.js → alia-sidebar-CVBlKur9.js} +3 -3
  4. package/dist/_chunks/{anamnesis-summary-rows-CCNmkq55.js → anamnesis-summary-rows-Dr2V1Rtf.js} +3 -3
  5. package/dist/_chunks/appointment-details-panel.history-DrIMDQYf.js +314 -0
  6. package/dist/_chunks/appointment-details-panel.identity-C20Y9xNC.js +223 -0
  7. package/dist/_chunks/{audio-recorder-CsnM_WDy.js → audio-recorder-BOF5YYoC.js} +2 -2
  8. package/dist/_chunks/{balance-badge-cell-DTiMdnCZ.js → balance-badge-cell-BSB02Bwo.js} +4 -4
  9. package/dist/_chunks/{bill-line-table-DHKb_O7c.js → bill-line-table-By-YL2ms.js} +2 -2
  10. package/dist/_chunks/{bishop-score-CKztphVz.js → bishop-score-DWGESRP9.js} +2 -2
  11. package/dist/_chunks/calendar-appointment-editor-dialog-D0n_bVsT.js +5518 -0
  12. package/dist/_chunks/calendar-editor-discard-host-1UfmMOEb.js +1336 -0
  13. package/dist/_chunks/calendar-editor-guard-9fShhNIA.js +31 -0
  14. package/dist/_chunks/calendar-waiting-list-panel-Ckd6tSeu.js +981 -0
  15. package/dist/_chunks/calendar-workspace.model-DrOoxY1b.js +1557 -0
  16. package/dist/_chunks/calendar.sheets-Datc0-IT.js +4585 -0
  17. package/dist/_chunks/call-status-chip-pajxN5eZ.js +180 -0
  18. package/dist/_chunks/calls-panel-BIfatK90.js +1094 -0
  19. package/dist/_chunks/{chat-input-CX4dxBq7.js → chat-input-BmvnuZqj.js} +114 -109
  20. package/dist/_chunks/{chat-message-CfIyXrxA.js → chat-message-B4TMeZ2m.js} +35 -30
  21. package/dist/_chunks/circle-x-W8Enq3i4.js +16 -0
  22. package/dist/_chunks/color-picker-CC8ZfntU.js +582 -0
  23. package/dist/_chunks/communications-panel-SQ-55e3V.js +1079 -0
  24. package/dist/_chunks/{data-grid-B2oaI7Lt.js → data-grid-CxKz8flO.js} +2 -2
  25. package/dist/_chunks/{data-table-FTV3uRjX.js → data-table-_tgj0C_T.js} +2 -2
  26. package/dist/_chunks/{default-tabs-DbebYO04.js → default-tabs-oDWQzbN7.js} +3 -3
  27. package/dist/_chunks/{document-preview-DLVIrOYV.js → document-preview-CirR3C_m.js} +3 -3
  28. package/dist/_chunks/entity-summary-CPUHzyil.js +297 -0
  29. package/dist/_chunks/{file-manager-Bzr5NK1t.js → file-manager-CEi4z2i0.js} +2 -2
  30. package/dist/_chunks/{fiscal-code-input-BBvU7sAo.js → fiscal-code-input-DZlpaMGg.js} +2 -2
  31. package/dist/_chunks/{gestational-age-calculator-mB6brTlp.js → gestational-age-calculator-CHbpC4vL.js} +2 -2
  32. package/dist/_chunks/{heatmap-C5gJin_F.js → heatmap-_546qI2V.js} +2 -2
  33. package/dist/_chunks/{iban-input-DuTwKok5.js → iban-input-CdSLRzQN.js} +2 -2
  34. package/dist/_chunks/{invoice-upload-list-B5aMffTy.js → invoice-upload-list-CQI9MUl6.js} +3 -3
  35. package/dist/_chunks/{kit-extensions-DUaIYyMD.js → kit-extensions-BNBf4m8O.js} +3 -3
  36. package/dist/_chunks/{link-cell-renderer-D3JLPURZ.js → link-cell-renderer-Xx5T8u5Q.js} +3 -3
  37. package/dist/_chunks/list-todo-KWvUhmT_.js +33 -0
  38. package/dist/_chunks/{muscle-scheme-BGJD62op.js → muscle-scheme-D_rSyGDj.js} +2 -2
  39. package/dist/_chunks/{notes-panel-BvjAo4RQ.js → notes-panel-DsEKNtsw.js} +2 -2
  40. package/dist/_chunks/{optical-prescription-Da_r8pMr.js → optical-prescription-DaSbsh4p.js} +2 -2
  41. package/dist/_chunks/palettes-CKVXYTzo.js +172 -0
  42. package/dist/_chunks/{patient-account-settings-B2XbN_Fe.js → patient-account-settings-COybehKx.js} +3 -3
  43. package/dist/_chunks/{patient-card-DTh3QTyS.js → patient-card-Cpr8iD19.js} +4 -4
  44. package/dist/_chunks/{patient-check-in-resume-B7NY-6KI.js → patient-check-in-resume-DZnyYDKH.js} +40 -40
  45. package/dist/_chunks/{patient-details-DBtEITfE.js → patient-details-Dv7EiTCo.js} +2 -2
  46. package/dist/_chunks/{patient-field-row-a5d4QijH.js → patient-field-row-DuHWGlLz.js} +3 -3
  47. package/dist/_chunks/patient-picker-BZJuOgMw.js +173 -0
  48. package/dist/_chunks/{patient-sign-in-pin-CDBqV254.js → patient-sign-in-pin-DmMBwWet.js} +2 -2
  49. package/dist/_chunks/{patient-sign-in-steps-C2JSqlok.js → patient-sign-in-steps-BKcxNkdY.js} +37 -59
  50. package/dist/_chunks/{patient-summary-card-Bl2NknPe.js → patient-summary-card-D-cDzOim.js} +2 -2
  51. package/dist/_chunks/phone-off-DQSTLz4l.js +28 -0
  52. package/dist/_chunks/{portal-details-DCIiGkHA.js → portal-details-DdzvroYP.js} +2 -2
  53. package/dist/_chunks/{portal-documents-DJOH8pZx.js → portal-documents-CNmoYWFc.js} +3 -3
  54. package/dist/_chunks/{pregnancy-dating-BNI32qNw.js → pregnancy-dating-lJbzai73.js} +2 -2
  55. package/dist/_chunks/{privacy-mask-C19dJFMk.js → privacy-mask-C2ZLKrMh.js} +5 -5
  56. package/dist/_chunks/{registration-form-DS3RuKHu.js → registration-form-CuLiTA52.js} +2 -2
  57. package/dist/_chunks/{reserved.agent-DOzOBUW7.js → reserved.agent-CabZHFJC.js} +2 -2
  58. package/dist/_chunks/{rich-text-editor-DjHL1b3E.js → rich-text-editor-C48omVjq.js} +2 -2
  59. package/dist/_chunks/{select-uESzXTX6.js → select-CIXKyUMw.js} +172 -149
  60. package/dist/_chunks/{session-countdown-DOx1IBUB.js → session-countdown-StcyUU5O.js} +56 -66
  61. package/dist/_chunks/{signature-request-CHsM_iWi.js → signature-request-vJDSHZld.js} +2 -2
  62. package/dist/_chunks/{tabs-CRIDBLP7.js → tabs-Czkmw5ou.js} +2 -2
  63. package/dist/_chunks/task-editor-wKbFbGqW.js +1093 -0
  64. package/dist/_chunks/{tasks-panel-6EzdnwT8.js → tasks-panel-DbtJS4QI.js} +2 -2
  65. package/dist/_chunks/{toolbar-CfdoJzMV.js → toolbar-DjG-cpD_.js} +2 -2
  66. package/dist/_chunks/{unit-converter-YKlHyUC2.js → unit-converter-CUAUTu2B.js} +2 -2
  67. package/dist/_chunks/use-appointment-details-read-jGkJalX8.js +1966 -0
  68. package/dist/_chunks/{voice-control-panel-Be_c0CQ0.js → voice-control-panel-Cp4vs1iy.js} +2 -2
  69. package/dist/agent-catalog.json +282 -6
  70. package/dist/agent-i18n/en.json +26 -4
  71. package/dist/appointment-editor-panel/index.js +100 -0
  72. package/dist/booking-tools-data/index.js +82 -0
  73. package/dist/browser-support.js +1 -1
  74. package/dist/calendar-action-buttons/index.js +178 -0
  75. package/dist/components/ai-prompt-input/index.js +1 -1
  76. package/dist/components/ai-summary-panel/ai-summary-panel.d.ts +68 -5
  77. package/dist/components/ai-summary-panel/index.d.ts +1 -1
  78. package/dist/components/ai-summary-panel/index.js +1 -1
  79. package/dist/components/ai-summary-panel/summary-markdown.d.ts +15 -0
  80. package/dist/components/appointment-details-panel/index.js +6 -5
  81. package/dist/components/audio-recorder/index.js +1 -1
  82. package/dist/components/bill-line-table/index.js +1 -1
  83. package/dist/components/bill-table/index.js +1 -1
  84. package/dist/components/bishop-score/index.js +1 -1
  85. package/dist/components/booking/index.js +1 -1
  86. package/dist/components/call-status-chip/call-status-chip.d.ts +30 -0
  87. package/dist/components/call-status-chip/index.d.ts +3 -0
  88. package/dist/components/call-status-chip/index.js +5 -0
  89. package/dist/components/calls-panel/calls-panel.agent.d.ts +4 -0
  90. package/dist/components/calls-panel/calls-panel.d.ts +153 -0
  91. package/dist/components/calls-panel/index.d.ts +4 -0
  92. package/dist/components/calls-panel/index.js +6 -0
  93. package/dist/components/chat-input/chat-input.d.ts +17 -0
  94. package/dist/components/chat-input/index.js +1 -1
  95. package/dist/components/chat-message/index.js +1 -1
  96. package/dist/components/color-picker/index.js +5 -4
  97. package/dist/components/communications-panel/communications-panel.d.ts +15 -3
  98. package/dist/components/communications-panel/index.js +1 -1
  99. package/dist/components/data-grid/index.js +2 -2
  100. package/dist/components/data-table/index.js +2 -2
  101. package/dist/components/document-preview/index.js +1 -1
  102. package/dist/components/entity-summary/entity-summary.d.ts +29 -1
  103. package/dist/components/entity-summary/index.js +1 -1
  104. package/dist/components/file-manager/index.js +1 -1
  105. package/dist/components/fiscal-code-input/index.js +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/heatmap/index.js +1 -1
  108. package/dist/components/iban-input/index.js +1 -1
  109. package/dist/components/index.d.ts +2 -0
  110. package/dist/components/invoice-upload-list/index.js +1 -1
  111. package/dist/components/muscle-scheme/index.js +1 -1
  112. package/dist/components/notes-panel/index.js +1 -1
  113. package/dist/components/optical-prescription/index.js +1 -1
  114. package/dist/components/patient-details/index.js +1 -1
  115. package/dist/components/patient-summary-card/index.js +1 -1
  116. package/dist/components/patient-table/index.js +1 -1
  117. package/dist/components/pregnancy-dating/index.js +1 -1
  118. package/dist/components/rich-text-editor/index.js +2 -2
  119. package/dist/components/select/index.js +1 -1
  120. package/dist/components/select/select.d.ts +8 -0
  121. package/dist/components/session-countdown/index.js +1 -1
  122. package/dist/components/skeleton-scheme/index.js +1 -1
  123. package/dist/components/tabs/index.js +1 -1
  124. package/dist/components/task-editor/index.js +1 -1
  125. package/dist/components/tasks-panel/index.js +1 -1
  126. package/dist/components/unit-converter/index.js +1 -1
  127. package/dist/components/voice-control-panel/index.js +1 -1
  128. package/dist/core.css +1 -1
  129. package/dist/find-free-slots-panel/index.js +58 -0
  130. package/dist/host-compat.css +4 -1
  131. package/dist/i18n/locales/ar.d.ts +72 -3
  132. package/dist/i18n/locales/ar.js +74 -5
  133. package/dist/i18n/locales/de.d.ts +72 -3
  134. package/dist/i18n/locales/de.js +74 -5
  135. package/dist/i18n/locales/el.d.ts +72 -3
  136. package/dist/i18n/locales/el.js +74 -5
  137. package/dist/i18n/locales/en.d.ts +72 -3
  138. package/dist/i18n/locales/en.js +73 -4
  139. package/dist/i18n/locales/es.d.ts +72 -3
  140. package/dist/i18n/locales/es.js +74 -5
  141. package/dist/i18n/locales/fr.d.ts +72 -3
  142. package/dist/i18n/locales/fr.js +74 -5
  143. package/dist/i18n/locales/hi.d.ts +72 -3
  144. package/dist/i18n/locales/hi.js +74 -5
  145. package/dist/i18n/locales/it.d.ts +83 -14
  146. package/dist/i18n/locales/it.js +84 -15
  147. package/dist/i18n/locales/ja.d.ts +72 -3
  148. package/dist/i18n/locales/ja.js +74 -5
  149. package/dist/i18n/locales/nl.d.ts +72 -3
  150. package/dist/i18n/locales/nl.js +74 -5
  151. package/dist/i18n/locales/pl.d.ts +72 -3
  152. package/dist/i18n/locales/pl.js +74 -5
  153. package/dist/i18n/locales/pt.d.ts +72 -3
  154. package/dist/i18n/locales/pt.js +74 -5
  155. package/dist/i18n/locales/ro.d.ts +72 -3
  156. package/dist/i18n/locales/ro.js +74 -5
  157. package/dist/i18n/locales/ru.d.ts +72 -3
  158. package/dist/i18n/locales/ru.js +74 -5
  159. package/dist/i18n/locales/sq.d.ts +72 -3
  160. package/dist/i18n/locales/sq.js +74 -5
  161. package/dist/i18n/locales/sv.d.ts +72 -3
  162. package/dist/i18n/locales/sv.js +74 -5
  163. package/dist/i18n/locales/tr.d.ts +72 -3
  164. package/dist/i18n/locales/tr.js +74 -5
  165. package/dist/i18n/locales/zh.d.ts +72 -3
  166. package/dist/i18n/locales/zh.js +74 -5
  167. package/dist/index.js +1329 -1318
  168. package/dist/locales/ar.json +74 -5
  169. package/dist/locales/de.json +74 -5
  170. package/dist/locales/el.json +74 -5
  171. package/dist/locales/en.json +73 -4
  172. package/dist/locales/es.json +74 -5
  173. package/dist/locales/fr.json +74 -5
  174. package/dist/locales/hi.json +74 -5
  175. package/dist/locales/it.json +84 -15
  176. package/dist/locales/ja.json +74 -5
  177. package/dist/locales/nl.json +74 -5
  178. package/dist/locales/pl.json +74 -5
  179. package/dist/locales/pt.json +74 -5
  180. package/dist/locales/ro.json +74 -5
  181. package/dist/locales/ru.json +74 -5
  182. package/dist/locales/sq.json +74 -5
  183. package/dist/locales/sv.json +74 -5
  184. package/dist/locales/tr.json +74 -5
  185. package/dist/locales/zh.json +74 -5
  186. package/dist/online-bookings-panel/index.js +69 -0
  187. package/dist/patterns/alia-assistant/index.js +1 -1
  188. package/dist/patterns/anamnesis/index.js +1 -1
  189. package/dist/patterns/calendar/booking-tools/appointment-editor-panel.d.ts +46 -0
  190. package/dist/patterns/calendar/booking-tools/booking-tools-data.d.ts +48 -0
  191. package/dist/patterns/calendar/booking-tools/calendar-action-buttons.d.ts +55 -0
  192. package/dist/patterns/calendar/booking-tools/find-free-slots-panel.d.ts +35 -0
  193. package/dist/patterns/calendar/booking-tools/online-bookings-panel.d.ts +61 -0
  194. package/dist/patterns/calendar/booking-tools/waiting-list-panel.d.ts +58 -0
  195. package/dist/patterns/calendar/calendar-editor-discard-host.d.ts +20 -0
  196. package/dist/patterns/calendar/calendar-print-sheet.d.ts +16 -0
  197. package/dist/patterns/calendar/calendar-workspace.model.d.ts +7 -0
  198. package/dist/patterns/calendar/calendar.model.d.ts +9 -0
  199. package/dist/patterns/calendar/calendar.sheets.d.ts +59 -17
  200. package/dist/patterns/calendar/index.js +24 -20
  201. package/dist/patterns/patient-account-settings/index.js +1 -1
  202. package/dist/patterns/patient-check-in/index.js +1 -1
  203. package/dist/patterns/patient-portal/index.js +2 -2
  204. package/dist/patterns/patient-sign-in/index.js +2 -2
  205. package/dist/patterns/registration-form/index.js +1 -1
  206. package/dist/patterns/signature-request/index.js +1 -1
  207. package/dist/tokens.css +1 -1
  208. package/dist/waiting-list-panel/index.js +158 -0
  209. package/package.json +35 -2
  210. package/dist/_chunks/ai-summary-panel-B70S2lgC.js +0 -455
  211. package/dist/_chunks/calendar-appointment-editor-dialog-I5PfWudy.js +0 -13773
  212. package/dist/_chunks/color-picker-AcaWuKah.js +0 -745
  213. package/dist/_chunks/communications-panel-BKPHCiMB.js +0 -973
  214. package/dist/_chunks/entity-summary-CpNk6ybN.js +0 -266
  215. package/dist/_chunks/task-editor-DvwqPfFR.js +0 -1257
  216. package/dist/_chunks/use-appointment-details-read-6_OmOwUs.js +0 -2476
@@ -0,0 +1,1966 @@
1
+ import { jsxs as v, jsx as e, Fragment as ae } from "react/jsx-runtime";
2
+ import { c as ot } from "./index-D2ZczOXr.js";
3
+ import { useId as Ze, useRef as R, forwardRef as Xt, useEffect as we, useMemo as yt, useState as H, useCallback as Jt } from "react";
4
+ import { useTranslation as X } from "react-i18next";
5
+ import { u as Qt } from "./registry-DvAUVLHh.js";
6
+ import { u as ue } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
7
+ import { c as Zt } from "./compose-refs-C0k0tdqF.js";
8
+ import { g as et } from "./get-error-message-DbFUzuja.js";
9
+ import { h as Xe } from "./handled-rejection-C-6Dq0As.js";
10
+ import { c as en, a as bt } from "./privacy-mask-C2ZLKrMh.js";
11
+ import { A as G } from "./alert-C4WKViaS.js";
12
+ import { B as C } from "./button-DohK_Ak_.js";
13
+ import { I as _t } from "./icon-button-S8_weU3g.js";
14
+ import { B as tn } from "./button-group-DuQuuulC.js";
15
+ import { D as We } from "./dropdown-menu-DBWaW4pq.js";
16
+ import { E as Ht } from "./editable-description-KU56SP4P.js";
17
+ import { N as tt } from "./note-timeline-BbjHMhkL.js";
18
+ import { P as Mt } from "./panel-header-CbtlTe85.js";
19
+ import { P as Je } from "./panel-subview-DCyvn-49.js";
20
+ import { P as Ft } from "./patient-summary-card-D-cDzOim.js";
21
+ import { S as pe } from "./section-card-CYfeQ6EQ.js";
22
+ import { C as nn, S as ke } from "./skeleton-tTWJpvAq.js";
23
+ import { T as an } from "./text-area-COMVJ1yE.js";
24
+ import { T as sn } from "./tooltip-uEBdD1-5.js";
25
+ import { T as Bt } from "./treatment-receipt-BZzwvsnY.js";
26
+ import { a as Qe } from "./whatsapp-button-XbozeDl_.js";
27
+ import { W as on, a as rn } from "./workflow-status-CO0mxXs2.js";
28
+ import { a as kt, u as ln, i as dn } from "./appointment-workflow-status-S-lx81Yz.js";
29
+ import { M as cn, C as wt, A as un } from "./appointment-details-panel.history-DrIMDQYf.js";
30
+ import { R as pn, a as St, b as nt, e as mn, g as hn, c as fn, d as gn, h as vn, D as At, f as yn, i as bn, p as kn } from "./appointment-details-panel.identity-C20Y9xNC.js";
31
+ import { A as xt } from "./avatar-Dp5apm1d.js";
32
+ import { B as Wt } from "./badge-BUk4RjTS.js";
33
+ import { C as wn } from "./counter-WsvRuum1.js";
34
+ import { D as Ue } from "./description-list-BxzDN9o2.js";
35
+ import { T as Nt } from "./timestamp-DPLDWdxA.js";
36
+ import { T as Sn } from "./transaction-chip-CkYd-3ky.js";
37
+ import { H as Se } from "./hover-card-CuRIA4wN.js";
38
+ import { c as Ut } from "./createLucideIcon-DhHxpK9K.js";
39
+ import { S as Et } from "./smartphone-C0rFF2if.js";
40
+ import { P as An } from "./phone-FceYcIFQ.js";
41
+ import { M as xn } from "./mail-BqXVF2zH.js";
42
+ import { M as Nn } from "./map-pin-BaY37-Km.js";
43
+ import { F as En } from "./file-pen-line-k4uMBM3h.js";
44
+ import { C as Tn } from "./contact-round-DiSvB3LP.js";
45
+ import { P as Cn } from "./pen-line-D0De5zdl.js";
46
+ import { C as In } from "./credit-card-D9XZsHGA.js";
47
+ import { H as Dn } from "./heart-pulse-BCppJyN2.js";
48
+ import { R as Rn } from "./refresh-cw-DnI0cLFC.js";
49
+ import { C as Pn } from "./calendar-days-BGWklvE-.js";
50
+ import { C as Ln } from "./clock-Drd4Wtis.js";
51
+ import { H as On } from "./hourglass-BEAzW1wE.js";
52
+ import { V as $t } from "./video-BheNGvsu.js";
53
+ import { A as Tt } from "./armchair-BaLDW6Hz.js";
54
+ import { B as _n } from "./building-2-D33bLCWL.js";
55
+ import { R as Hn } from "./repeat-CvQa5rZt.js";
56
+ import { N as Mn } from "./notebook-pen-CO7HoM-W.js";
57
+ import { C as at } from "./clipboard-list-rSzfIYZB.js";
58
+ import { U as Fn } from "./user-plus-BtcOLgNU.js";
59
+ import { P as Ct } from "./pencil-B1sKKyuT.js";
60
+ import { C as Bn } from "./copy-vRpqqHtY.js";
61
+ import { P as Wn } from "./plus-DzMQ_c6b.js";
62
+ import { S as Un } from "./square-check-big-dj0o8yA3.js";
63
+ import { T as $n } from "./trash-2-uumy3fy1.js";
64
+ import { H as It } from "./history-CK2JaU2g.js";
65
+ import { C as qt } from "./calendar-clock-hbObjfGY.js";
66
+ import { C as qn } from "./chevron-down-DWE7GSq9.js";
67
+ import { C as zn } from "./camera-VSklPDCv.js";
68
+ import { F as Kn } from "./file-BuG1VMAy.js";
69
+ import { F as jn } from "./file-text-5yv6r2ls.js";
70
+ import { F as Yn } from "./folder-BghC8_S2.js";
71
+ import { R as Vn } from "./receipt-euro-B1cLM_TN.js";
72
+ /**
73
+ * @license lucide-react v1.22.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */
78
+ const Gn = [
79
+ ["path", { d: "M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8", key: "1w3rig" }],
80
+ ["path", { d: "M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1", key: "n2jgmb" }],
81
+ ["path", { d: "M2 21h20", key: "1nyx9w" }],
82
+ ["path", { d: "M7 8v3", key: "1qtyvj" }],
83
+ ["path", { d: "M12 8v3", key: "hwp4zt" }],
84
+ ["path", { d: "M17 8v3", key: "1i6e5u" }],
85
+ ["path", { d: "M7 4h.01", key: "1bh4kh" }],
86
+ ["path", { d: "M12 4h.01", key: "1ujb9j" }],
87
+ ["path", { d: "M17 4h.01", key: "1upcoc" }]
88
+ ], Xn = Ut("cake", Gn);
89
+ /**
90
+ * @license lucide-react v1.22.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */
95
+ const Jn = [
96
+ ["path", { d: "M16 10h2", key: "8sgtl7" }],
97
+ ["path", { d: "M16 14h2", key: "epxaof" }],
98
+ ["path", { d: "M6.17 15a3 3 0 0 1 5.66 0", key: "n6f512" }],
99
+ ["circle", { cx: "9", cy: "11", r: "2", key: "yxgjnd" }],
100
+ ["rect", { x: "2", y: "5", width: "20", height: "14", rx: "2", key: "qneu4z" }]
101
+ ], Qn = Ut("id-card", Jn), Zn = '[data-component="button-group"] [data-component="icon-button"][aria-haspopup="menu"]', ea = {
102
+ id: "appointment-details-panel",
103
+ // open and close back open_history and close_history; set_value backs
104
+ // set_status.
105
+ capabilities: ["open", "close", "set_value"],
106
+ state: {
107
+ eventId: {
108
+ type: "string | null",
109
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.eventId",
110
+ description: "The occurrence on screen or being read, as the host identifies it. After a failed or refused read, the occurrence it was for when the host says so. Null when there is none, or the host did not say.",
111
+ read: (t) => t.getEventId()
112
+ },
113
+ loadStatus: {
114
+ type: "'loading' | 'ready' | 'error' | 'refused'",
115
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.loadStatus",
116
+ description: "Where the read is: loading, ready, failed (with Retry) or refused. Actions need ready.",
117
+ read: (t) => t.getLoadStatus()
118
+ },
119
+ appointmentStatus: {
120
+ type: "'confirmed' | 'waiting' | 'in_care' | 'done' | 'cancelled' | 'absent' | null",
121
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.appointmentStatus",
122
+ description: "The appointment status as last saved here or read. Null when none is recorded or nothing is on screen.",
123
+ read: (t) => t.getAppointmentStatus()
124
+ },
125
+ allowedStatuses: {
126
+ type: "string[]",
127
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.allowedStatuses",
128
+ description: "The statuses set_status accepts now, in menu order. Empty when the status is read-only.",
129
+ read: (t) => t.getAllowedStatuses()
130
+ },
131
+ offeredActions: {
132
+ type: "string[]",
133
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.offeredActions",
134
+ description: "The footer actions on offer, as their data-action values (for example edit-appointment, delete-appointment), in footer order, including any folded into More.",
135
+ read: (t) => t.getOfferedActions()
136
+ },
137
+ historyOpen: {
138
+ type: "boolean",
139
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.historyOpen",
140
+ description: "Whether the History sub-view covers the details.",
141
+ read: (t) => t.isHistoryOpen()
142
+ },
143
+ privacy: {
144
+ type: "boolean",
145
+ descriptionKey: "ui.agent.appointmentDetailsPanel.state.privacy",
146
+ description: "Whether privacy mode is on. The patient identity and personal fields are then masked on screen.",
147
+ read: (t) => t.isPrivacy()
148
+ }
149
+ },
150
+ actions: {
151
+ open_history: {
152
+ safety: "read",
153
+ openWorld: !0,
154
+ idempotent: !0,
155
+ errors: ["No appointment is on screen, or History is not offered."],
156
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.openHistory",
157
+ description: "Slide the appointment's history over the details, as its header button does; the host reads it then if it did not send it with the details. It lists who changed what, and when.",
158
+ invoke: (t) => t.openHistory()
159
+ },
160
+ close_history: {
161
+ safety: "read",
162
+ idempotent: !0,
163
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.closeHistory",
164
+ description: "Return from History to the details.",
165
+ invoke: (t) => t.closeHistory()
166
+ },
167
+ set_status: {
168
+ safety: "phi",
169
+ openWorld: !0,
170
+ idempotent: !0,
171
+ argsType: "{ status: string }",
172
+ argsSchema: {
173
+ type: "object",
174
+ properties: {
175
+ status: {
176
+ type: "string",
177
+ enum: [
178
+ "confirmed",
179
+ "waiting",
180
+ "in_care",
181
+ "done",
182
+ "cancelled",
183
+ "absent"
184
+ ]
185
+ }
186
+ },
187
+ required: ["status"]
188
+ },
189
+ errors: [
190
+ "The status is read-only: no appointment on screen, no host save, readOnly, or no allowed statuses.",
191
+ "The status is not in allowedStatuses.",
192
+ "A status save is already in flight.",
193
+ "The host refused the change. The previous status stays and the panel shows the message."
194
+ ],
195
+ examples: [{ args: { status: "waiting" } }],
196
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.setStatus",
197
+ description: "Save a new appointment status through the host, as the footer control does. Resolves once the host has saved it.",
198
+ invoke: (t, n) => t.setAppointmentStatus(
199
+ n.status
200
+ )
201
+ },
202
+ retry: {
203
+ safety: "read",
204
+ openWorld: !0,
205
+ errors: [
206
+ "Retry is not offered: the read has not failed or been refused as retryable, or the host offers no Retry."
207
+ ],
208
+ descriptionKey: "ui.agent.appointmentDetailsPanel.actions.retry",
209
+ description: "Ask the host to read the appointment again, after a failed read or a refusal it marked retryable.",
210
+ invoke: (t) => t.retry()
211
+ }
212
+ },
213
+ domHooks: {
214
+ root: {
215
+ attr: "data-component",
216
+ value: "appointment-details-panel",
217
+ description: `Marks the panel. It also carries data-event-id and data-status. Inside, cards carry data-card (patient, appointment, notes, treatments), footer actions data-action, and the History and description sub-views data-details-subview. An action in offeredActions with no data-action in the footer strip is folded into More: click the panel's ${Zn}, and its menu item carries the same data-action.`
218
+ },
219
+ instanceId: {
220
+ attr: "data-component-id",
221
+ sourceProp: "id",
222
+ description: "Sourced from the id prop, or generated."
223
+ }
224
+ }
225
+ };
226
+ function it(t) {
227
+ const n = document.activeElement;
228
+ n && n !== document.body || t == null || t.focus({ preventScroll: !0 });
229
+ }
230
+ function Le(t) {
231
+ const n = document.getElementById(t);
232
+ n && !n.hasAttribute("tabindex") && (n.tabIndex = -1), it(n);
233
+ }
234
+ const ce = {
235
+ advancedSignature: "setup-advanced-signature",
236
+ requestSignature: "request-signature",
237
+ signOnDevice: "sign-on-device",
238
+ openPatient: "open-patient",
239
+ renewAnamnesis: "renew-anamnesis",
240
+ unlockPayments: "unlock-payments",
241
+ carePlan: "open-care-plan"
242
+ };
243
+ function $e(t) {
244
+ if (t)
245
+ try {
246
+ const { protocol: n } = new URL(t, "https://host.invalid");
247
+ return n === "http:" || n === "https:" ? t : void 0;
248
+ } catch {
249
+ return;
250
+ }
251
+ }
252
+ const ta = {
253
+ SU: 0,
254
+ MO: 1,
255
+ TU: 2,
256
+ WE: 3,
257
+ TH: 4,
258
+ FR: 5,
259
+ SA: 6
260
+ }, na = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"], aa = {
261
+ daily: "recurrenceEveryDay",
262
+ weekly: "recurrenceEveryWeek",
263
+ monthly: "recurrenceEveryMonth",
264
+ yearly: "recurrenceEveryYear"
265
+ }, ia = {
266
+ 1: "recurrenceOrdinal1",
267
+ 2: "recurrenceOrdinal2",
268
+ 3: "recurrenceOrdinal3",
269
+ 4: "recurrenceOrdinal4"
270
+ }, sa = /^(-1|[1-4])?(MO|TU|WE|TH|FR|SA|SU)$/;
271
+ function Dt(t, n) {
272
+ const i = new Date(2026, 0, 4 + ta[t]);
273
+ return new Intl.DateTimeFormat(n, { weekday: "long" }).format(i);
274
+ }
275
+ function oa(t, n, i) {
276
+ const d = St(n);
277
+ if (!Number.isFinite(d.getTime())) return;
278
+ const c = i ? St(i) : void 0, l = c && c.getFullYear() === d.getFullYear();
279
+ try {
280
+ return new Intl.DateTimeFormat(t, {
281
+ day: "numeric",
282
+ month: "long",
283
+ ...l ? {} : { year: "numeric" }
284
+ }).format(d);
285
+ } catch {
286
+ return;
287
+ }
288
+ }
289
+ function ra(t, n, i, d) {
290
+ const c = pn[i.frequency];
291
+ if (!c) return;
292
+ const l = (b) => `calendarWorkspace.editor.${b}`, u = (b) => `calendarWorkspace.details.${b}`, p = aa[i.frequency], r = p && (i.interval ?? 1) > 1 ? t(l(p), { count: i.interval }) : t(l(c)), a = (i.byDay ?? []).map((b) => sa.exec(b)).filter((b) => b !== null), o = i.frequency === "weekly" ? na.filter(
293
+ (b) => a.some(([, m, N]) => !m && N === b)
294
+ ) : [], f = i.frequency === "monthly" || i.frequency === "yearly" ? a.find(([, b]) => b) : void 0;
295
+ let y = r;
296
+ if (o.length > 0)
297
+ y = t(u("seriesOnDays"), {
298
+ every: r,
299
+ days: new Intl.ListFormat(n, { type: "conjunction" }).format(
300
+ o.map((b) => Dt(b, n))
301
+ )
302
+ });
303
+ else if (f) {
304
+ const [, b, m] = f, N = Dt(m, n);
305
+ y = b === "-1" ? t(u("seriesOnLast"), { every: r, weekday: N }) : t(u("seriesOnNth"), {
306
+ every: r,
307
+ weekday: N,
308
+ ordinal: t(l(ia[b]))
309
+ });
310
+ }
311
+ if (i.count !== void 0)
312
+ return t(u("seriesRule"), {
313
+ frequency: y,
314
+ count: i.count
315
+ });
316
+ const k = i.untilIso ? oa(n, i.untilIso, d) : void 0;
317
+ return k ? t(u("seriesUntil"), { rule: y, date: k }) : y;
318
+ }
319
+ function st({
320
+ eyebrow: t,
321
+ heading: n,
322
+ facts: i
323
+ }) {
324
+ return /* @__PURE__ */ v(ae, { children: [
325
+ /* @__PURE__ */ e(Se.Eyebrow, { children: t }),
326
+ /* @__PURE__ */ e(Se.Heading, { children: n }),
327
+ i && i.length > 0 ? /* @__PURE__ */ e(Se.Body, { children: /* @__PURE__ */ e("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-0 type-body-sm", children: i.map((d, c) => /* @__PURE__ */ e(
328
+ "li",
329
+ {
330
+ className: d.muted ? "ds:text-[color:var(--muted-foreground)]" : void 0,
331
+ children: d.text
332
+ },
333
+ c
334
+ )) }) }) : null
335
+ ] });
336
+ }
337
+ const la = "ds:inline-flex ds:cursor-pointer ds:rounded-[var(--radius-full)] ds:p-0 ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]";
338
+ function Rt({
339
+ id: t,
340
+ eyebrow: n,
341
+ heading: i,
342
+ facts: d,
343
+ children: c
344
+ }) {
345
+ return /* @__PURE__ */ v(Se, { children: [
346
+ /* @__PURE__ */ e(Se.Trigger, { asChild: !0, children: /* @__PURE__ */ e("button", { type: "button", "data-chip-hover": t, className: la, children: c }) }),
347
+ /* @__PURE__ */ e(Se.Content, { side: "bottom", align: "start", size: "sm", children: /* @__PURE__ */ e(st, { eyebrow: n, heading: i, facts: d }) })
348
+ ] });
349
+ }
350
+ const s = (t) => `calendarWorkspace.details.${t}`, da = {
351
+ missing: "consentMissing",
352
+ requested: "consentRequested",
353
+ signed: "consentSigned"
354
+ }, zt = (t) => /* @__PURE__ */ e("a", { href: `tel:${t.replace(/\s/g, "")}`, dir: "ltr", children: t }), Kt = (t) => /* @__PURE__ */ e("a", { href: `mailto:${t}`, dir: "ltr", children: t }), jt = (t, n, i) => new Intl.NumberFormat(t, { style: "currency", currency: i }).format(n);
355
+ function qe({
356
+ href: t,
357
+ action: n,
358
+ icon: i,
359
+ children: d
360
+ }) {
361
+ const c = $e(t);
362
+ return c ? /* @__PURE__ */ e(
363
+ C,
364
+ {
365
+ asChild: !0,
366
+ size: "sm",
367
+ intent: "outline",
368
+ "data-action": n,
369
+ startIcon: i,
370
+ children: /* @__PURE__ */ e("a", { href: c, children: d })
371
+ }
372
+ ) : null;
373
+ }
374
+ function Pt({ rows: t }) {
375
+ const n = t.filter((i) => !!i);
376
+ return n.length === 0 ? null : /* @__PURE__ */ e(Ue, { layout: "inline", density: "compact", children: n.map((i) => /* @__PURE__ */ v(
377
+ Ue.Row,
378
+ {
379
+ "data-row": i.id,
380
+ icon: i.icon,
381
+ children: [
382
+ /* @__PURE__ */ e(Ue.Term, { children: i.label }),
383
+ /* @__PURE__ */ e(Ue.Detail, { children: i.value })
384
+ ]
385
+ },
386
+ i.id
387
+ )) });
388
+ }
389
+ function ca({
390
+ details: t,
391
+ locale: n,
392
+ currency: i,
393
+ now: d,
394
+ mapsLink: c = !1,
395
+ shortcuts: l,
396
+ onRequestSignature: u,
397
+ onSignOnDevice: p,
398
+ onOpenPatient: r
399
+ }) {
400
+ const { t: a } = X("ui"), { patient: o, signing: f, money: y, booking: k } = t;
401
+ if (!o) return null;
402
+ const b = (f == null ? void 0 : f.consents) ?? [], m = f && (f.required > 0 || b.length > 0) ? f : void 0, N = ((m == null ? void 0 : m.toComplete) ?? 0) > 0, L = m ? [
403
+ {
404
+ text: N ? m.requestedVia === "sms" ? a(s("signingRequestedSms")) : m.requestedVia === "email" ? a(s("signingRequestedEmail")) : a(s("signingNotRequested")) : a(s("signingAllSigned"))
405
+ },
406
+ ...m.aesSetUp ? [] : [{ text: a(s("aesMissing")), muted: !0 }]
407
+ ] : [], P = ((f == null ? void 0 : f.required) ?? 0) > 0 && N, E = !!(l != null && l.advancedSignatureUrl) && ((f == null ? void 0 : f.required) ?? 0) > 0 && !(f != null && f.aesSetUp), M = !!u && P, T = !!p && P, I = o.highlightedAnamnesisCount ?? 0, F = o.expiredAnamnesisCount ?? 0, z = (o.highlightedAnamnesisAnswers ?? []).map((x) => ({
408
+ text: [
409
+ x.question,
410
+ a(s(x.yes ? "anamnesisYes" : "anamnesisNo")),
411
+ x.answer,
412
+ nt(n, x.interviewIso)
413
+ ].filter(Boolean).join(" · ")
414
+ })), ie = mn(o), se = hn(o) || ie, K = b.map((x) => ({
415
+ id: `consent-${x.id}`,
416
+ label: x.name,
417
+ value: a(s(da[x.state]))
418
+ })), B = [
419
+ ...o.dobIso ? [
420
+ {
421
+ id: "dob",
422
+ label: a(s("dob")),
423
+ icon: /* @__PURE__ */ e(Xn, {}),
424
+ value: `${nt(n, o.dobIso)} ${a(
425
+ s("patientAge"),
426
+ {
427
+ n: fn(o.dobIso, d)
428
+ }
429
+ )}`
430
+ }
431
+ ] : [],
432
+ ...gn(o).map((x, Z) => {
433
+ const ee = x.label === "mobile" || x.label === "home" || x.label === "work";
434
+ return {
435
+ id: `phone-${Z}`,
436
+ label: a(ee ? `calendarWorkspace.print.phoneLabels.${x.label}` : s("phone")),
437
+ icon: x.label === "mobile" ? /* @__PURE__ */ e(Et, {}) : /* @__PURE__ */ e(An, {}),
438
+ value: zt(x.number)
439
+ };
440
+ }),
441
+ ...o.email ? [
442
+ {
443
+ id: "email",
444
+ label: a(s("email")),
445
+ icon: /* @__PURE__ */ e(xn, {}),
446
+ value: Kt(o.email)
447
+ }
448
+ ] : [],
449
+ /* P27: hidden patient details leave the address out, and with it the
450
+ row: no map link and no empty "address" line. */
451
+ ...c && ie ? [
452
+ {
453
+ id: "address",
454
+ label: a(s("address")),
455
+ icon: /* @__PURE__ */ e(Nn, {}),
456
+ value: /* @__PURE__ */ e(
457
+ "a",
458
+ {
459
+ href: vn(o),
460
+ target: "_blank",
461
+ rel: "noopener noreferrer",
462
+ "aria-label": `${a(s("mapsLink"))}: ${se}`,
463
+ children: se
464
+ }
465
+ )
466
+ }
467
+ ] : []
468
+ ], j = (y == null ? void 0 : y.unpaidAmount) ?? 0, Y = (y == null ? void 0 : y.billableAmount) ?? 0, J = (k == null ? void 0 : k.paidOnlineAmount) ?? 0, Q = (x, Z, ee, Ae, me, te) => /* @__PURE__ */ e(
469
+ Rt,
470
+ {
471
+ id: ee,
472
+ eyebrow: a(s("hoverBilling")),
473
+ heading: a(s(Ae), {
474
+ amount: jt(n, Z, i)
475
+ }),
476
+ facts: [{ text: a(s(me)) }],
477
+ children: /* @__PURE__ */ e(
478
+ Sn,
479
+ {
480
+ "data-chip": ee,
481
+ state: x,
482
+ amount: Z,
483
+ currency: i,
484
+ locale: n,
485
+ size: "md",
486
+ showLabel: !0,
487
+ label: te,
488
+ showIcon: !1
489
+ }
490
+ )
491
+ }
492
+ );
493
+ return /* @__PURE__ */ e(
494
+ Ft,
495
+ {
496
+ "data-card": "patient",
497
+ name: o.name,
498
+ avatarUrl: o.avatarSrc,
499
+ locale: n,
500
+ surface: "elevated",
501
+ density: "compact",
502
+ flags: {
503
+ unsignedDocumentsCount: (m == null ? void 0 : m.toComplete) ?? 0,
504
+ highlightedAnamnesisCount: I
505
+ },
506
+ flagHover: {
507
+ ...m ? {
508
+ unsignedDocuments: /* @__PURE__ */ e(
509
+ st,
510
+ {
511
+ eyebrow: a(s("sectionSigning")),
512
+ heading: m.toComplete === 1 ? a(s("signingToSignOne")) : a(s("signingToSignMany"), {
513
+ n: m.toComplete
514
+ }),
515
+ facts: L
516
+ }
517
+ )
518
+ } : {},
519
+ highlightedAnamnesis: /* @__PURE__ */ e(
520
+ st,
521
+ {
522
+ eyebrow: a(s("anamnesisTitle")),
523
+ heading: a(s("anamnesisHighlighted"), { n: I }),
524
+ facts: z
525
+ }
526
+ )
527
+ },
528
+ extraChips: j > 0 || Y > 0 || J > 0 || F > 0 || E || M || T || r ? /* @__PURE__ */ v(ae, { children: [
529
+ /* @__PURE__ */ v("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
530
+ j > 0 ? Q(
531
+ "debt",
532
+ j,
533
+ "unpaid",
534
+ "hoverUnpaidHeading",
535
+ "hoverUnpaidFact"
536
+ ) : null,
537
+ Y > 0 ? Q(
538
+ "to-invoice",
539
+ Y,
540
+ "billable",
541
+ "hoverBillableHeading",
542
+ "hoverBillableFact"
543
+ ) : null,
544
+ J > 0 ? Q(
545
+ "settled",
546
+ J,
547
+ "paidOnline",
548
+ "hoverPaidOnlineHeading",
549
+ "hoverPaidOnlineFact",
550
+ /* A deposit is settled money, but "Settled" hides where
551
+ it came from: the chip says what its hover card says. */
552
+ a(s("paidOnline"))
553
+ ) : null
554
+ ] }),
555
+ M ? /* @__PURE__ */ e(
556
+ C,
557
+ {
558
+ size: "sm",
559
+ intent: "outline",
560
+ "data-action": ce.requestSignature,
561
+ startIcon: /* @__PURE__ */ e(En, { "aria-hidden": "true" }),
562
+ onClick: () => u(t.eventId),
563
+ children: a(s("signingRequest"))
564
+ }
565
+ ) : null,
566
+ T ? /* @__PURE__ */ e(
567
+ C,
568
+ {
569
+ size: "sm",
570
+ intent: "outline",
571
+ "data-action": ce.signOnDevice,
572
+ "aria-label": `${a(s("signingRequest"))}: ${a(s("signingOnDevice"))}`,
573
+ startIcon: /* @__PURE__ */ e(Et, { "aria-hidden": "true" }),
574
+ onClick: () => p(t.eventId),
575
+ children: a(s("signingOnDevice"))
576
+ }
577
+ ) : null,
578
+ r ? /* @__PURE__ */ e(
579
+ C,
580
+ {
581
+ size: "sm",
582
+ intent: "outline",
583
+ "data-action": ce.openPatient,
584
+ startIcon: /* @__PURE__ */ e(Tn, { "aria-hidden": "true" }),
585
+ onClick: () => r(t.eventId),
586
+ children: a(s("openPatient"))
587
+ }
588
+ ) : null,
589
+ E && (l != null && l.advancedSignatureUrl) ? /* @__PURE__ */ e(
590
+ qe,
591
+ {
592
+ href: l.advancedSignatureUrl,
593
+ action: ce.advancedSignature,
594
+ icon: /* @__PURE__ */ e(Cn, { "aria-hidden": "true" }),
595
+ children: a(s("aesSetUp"))
596
+ }
597
+ ) : null,
598
+ l != null && l.unlockPaymentsUrl && (j > 0 || Y > 0) ? /* @__PURE__ */ e(
599
+ qe,
600
+ {
601
+ href: l.unlockPaymentsUrl,
602
+ action: ce.unlockPayments,
603
+ icon: /* @__PURE__ */ e(In, { "aria-hidden": "true" }),
604
+ children: a(s("unlockPayments"))
605
+ }
606
+ ) : null,
607
+ F > 0 ? /* @__PURE__ */ e(
608
+ Rt,
609
+ {
610
+ id: "anamnesisExpired",
611
+ eyebrow: a(s("anamnesisTitle")),
612
+ heading: a(s("anamnesisExpired"), { n: F }),
613
+ facts: [{ text: a(s("hoverAnamnesisExpiredFact")) }],
614
+ children: /* @__PURE__ */ e(
615
+ Wt,
616
+ {
617
+ "data-chip": "anamnesisExpired",
618
+ variant: "warning",
619
+ size: "md",
620
+ leading: /* @__PURE__ */ e(Dn, {}),
621
+ children: a(s("anamnesisExpired"), { n: F })
622
+ }
623
+ )
624
+ }
625
+ ) : null,
626
+ F > 0 && (l != null && l.renewAnamnesisUrl) ? /* @__PURE__ */ e(
627
+ qe,
628
+ {
629
+ href: l.renewAnamnesisUrl,
630
+ action: ce.renewAnamnesis,
631
+ icon: /* @__PURE__ */ e(Rn, { "aria-hidden": "true" }),
632
+ children: a(s("anamnesisRenew"))
633
+ }
634
+ ) : null
635
+ ] }) : void 0,
636
+ visibleFieldOrder: [...B, ...K].map((x) => x.id),
637
+ sections: B.length > 0 || K.length > 0 ? [
638
+ ...B.length > 0 ? [{ id: "contact", heading: a(s("sectionPatient")), fields: B }] : [],
639
+ ...K.length > 0 ? [
640
+ {
641
+ id: "consents",
642
+ heading: a(s("sectionSigning")),
643
+ fields: K
644
+ }
645
+ ] : []
646
+ ] : void 0
647
+ }
648
+ );
649
+ }
650
+ function ua({
651
+ details: t,
652
+ locale: n,
653
+ currency: i,
654
+ operator: d,
655
+ chair: c,
656
+ description: l,
657
+ privacy: u = !1,
658
+ history: p
659
+ }) {
660
+ const { t: r } = X("ui"), { appointment: a, booking: o, patient: f } = t, y = (I) => r(`calendarWorkspace.editor.${I}`), k = new Date(a.startIso), b = new Date(k.getTime() + a.durationMin * 6e4), m = Number.isFinite(k.getTime()), { recurrence: N } = a, L = N && ra(r, n, N, a.startIso), P = o ? [
661
+ o.bookedAtIso && {
662
+ id: "bookedAt",
663
+ label: r(s("bookedAt")),
664
+ value: /* @__PURE__ */ e(
665
+ Nt,
666
+ {
667
+ value: o.bookedAtIso,
668
+ format: "absolute",
669
+ shape: "bare",
670
+ locale: n,
671
+ absoluteFormat: At
672
+ }
673
+ )
674
+ },
675
+ o.typedName && {
676
+ id: "bookingName",
677
+ label: r(s("bookingName")),
678
+ value: o.typedName
679
+ },
680
+ o.phone && {
681
+ id: "bookingPhone",
682
+ label: r(s("bookingPhone")),
683
+ value: zt(o.phone)
684
+ },
685
+ o.email && {
686
+ id: "bookingEmail",
687
+ label: r(s("bookingEmail")),
688
+ value: Kt(o.email)
689
+ },
690
+ o.note && {
691
+ id: "bookingNote",
692
+ label: r(s("bookingNote")),
693
+ value: o.note
694
+ },
695
+ /* With a patient the amount is a chip on the patient card. */
696
+ !f && o.paidOnlineAmount !== void 0 && {
697
+ id: "paidOnline",
698
+ label: r(s("paidOnline")),
699
+ value: jt(n, o.paidOnlineAmount, i)
700
+ }
701
+ ] : [], E = u ? P.filter((I) => I && I.id === "bookedAt") : P, M = E.some(Boolean), T = o || a.bookedOnline || p == null ? void 0 : p.filter(
702
+ (I) => I.kind === "created" && I.actor.trim() !== ""
703
+ ).sort((I, F) => Date.parse(I.atIso) - Date.parse(F.atIso))[0];
704
+ return /* @__PURE__ */ v(
705
+ pe,
706
+ {
707
+ "data-card": "appointment",
708
+ title: r(s("sectionAppointment")),
709
+ headingLevel: 3,
710
+ children: [
711
+ l,
712
+ /* @__PURE__ */ e(
713
+ Pt,
714
+ {
715
+ rows: [
716
+ m && {
717
+ id: "date",
718
+ label: y("date"),
719
+ icon: /* @__PURE__ */ e(Pn, {}),
720
+ value: nt(n, k)
721
+ },
722
+ m && {
723
+ id: "time",
724
+ label: r(s("time")),
725
+ icon: /* @__PURE__ */ e(Ln, {}),
726
+ value: a.allDay ? y("allDay") : yn(n, k, b)
727
+ },
728
+ !a.allDay && {
729
+ id: "duration",
730
+ label: y("duration"),
731
+ icon: /* @__PURE__ */ e(On, {}),
732
+ value: `${a.durationMin} ${y("durationUnit")}`
733
+ },
734
+ a.isTelehealth && {
735
+ id: "type",
736
+ label: y("type"),
737
+ icon: /* @__PURE__ */ e($t, {}),
738
+ value: y("typeTelehealth")
739
+ },
740
+ d && {
741
+ id: "operator",
742
+ label: r(s("operator")),
743
+ /* A person, as on the grid: the avatar fills the icon slot. */
744
+ icon: /* @__PURE__ */ e(xt, { name: d.name, src: d.avatarSrc, size: "xs" }),
745
+ value: d.name
746
+ },
747
+ c && {
748
+ id: "chair",
749
+ label: r(s("chair")),
750
+ icon: /* @__PURE__ */ e(Tt, {}),
751
+ value: /* @__PURE__ */ e(Wt, { variant: "neutral", size: "sm", leading: /* @__PURE__ */ e(Tt, {}), children: c.name })
752
+ },
753
+ a.branchLabel && {
754
+ id: "branch",
755
+ label: y("branch"),
756
+ icon: /* @__PURE__ */ e(_n, {}),
757
+ value: a.branchLabel
758
+ },
759
+ T && {
760
+ id: "createdBy",
761
+ label: r(s("createdBy")),
762
+ icon: /* @__PURE__ */ e(xt, { name: T.actor, size: "xs" }),
763
+ value: /* @__PURE__ */ v("span", { className: "ds:inline-flex ds:flex-wrap ds:items-baseline ds:gap-x-[var(--spacing-xs)]", children: [
764
+ /* @__PURE__ */ e("span", { children: T.actor }),
765
+ " ",
766
+ /* @__PURE__ */ e("span", { className: "ds:text-[color:var(--muted-foreground)]", children: /* @__PURE__ */ e(
767
+ Nt,
768
+ {
769
+ value: T.atIso,
770
+ format: "absolute",
771
+ shape: "bare",
772
+ locale: n,
773
+ absoluteFormat: At
774
+ }
775
+ ) })
776
+ ] })
777
+ },
778
+ L && {
779
+ id: "series",
780
+ label: r(s("seriesLabel")),
781
+ icon: /* @__PURE__ */ e(Hn, {}),
782
+ value: L
783
+ }
784
+ ]
785
+ }
786
+ ),
787
+ M ? /* @__PURE__ */ v(
788
+ "div",
789
+ {
790
+ "data-block": "booking",
791
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
792
+ children: [
793
+ /* @__PURE__ */ e("h4", { className: "ds:m-0 type-label ds:text-[color:var(--muted-foreground)]", children: r(s("sectionBooking")) }),
794
+ /* @__PURE__ */ e(Pt, { rows: E })
795
+ ]
796
+ }
797
+ ) : null
798
+ ]
799
+ }
800
+ );
801
+ }
802
+ function pa({
803
+ details: t,
804
+ locale: n,
805
+ currency: i,
806
+ privacy: d = !1,
807
+ carePlanUrl: c
808
+ }) {
809
+ const { t: l } = X("ui"), { care: u } = t, p = d || u == null ? void 0 : u.plan;
810
+ return !u || !p && u.lines.length === 0 ? null : /* @__PURE__ */ v(
811
+ pe,
812
+ {
813
+ "data-card": "treatments",
814
+ title: l(s("sectionTreatments")),
815
+ headingLevel: 3,
816
+ children: [
817
+ p ? /* @__PURE__ */ v("span", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)]", children: [
818
+ /* @__PURE__ */ v("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-item", children: [
819
+ /* @__PURE__ */ e(
820
+ at,
821
+ {
822
+ "aria-hidden": "true",
823
+ className: "ds:size-4 ds:shrink-0 ds:text-[color:var(--muted-foreground)]"
824
+ }
825
+ ),
826
+ p.number ? l(s("planLine"), { number: p.number, name: p.name }) : p.name
827
+ ] }),
828
+ c ? /* @__PURE__ */ e(
829
+ qe,
830
+ {
831
+ href: c,
832
+ action: ce.carePlan,
833
+ icon: /* @__PURE__ */ e(at, { "aria-hidden": "true" }),
834
+ children: l(s("openCarePlan"))
835
+ }
836
+ ) : null
837
+ ] }) : null,
838
+ u.lines.length > 0 ? /* @__PURE__ */ e(
839
+ Bt,
840
+ {
841
+ lines: u.lines.map(({ entryId: r, careId: a, ...o }) => ({
842
+ id: r,
843
+ ...o
844
+ })),
845
+ locale: n,
846
+ currency: i
847
+ }
848
+ ) : null
849
+ ]
850
+ }
851
+ );
852
+ }
853
+ const Lt = 3;
854
+ function ma({
855
+ preview: t,
856
+ onOpenNotes: n,
857
+ locale: i
858
+ }) {
859
+ const { t: d } = X("ui"), c = Ze(), l = t.status ?? "ready", u = R(!1);
860
+ ue(() => {
861
+ u.current && (l !== "loading" && (u.current = !1), Le(c));
862
+ }, [l, c]);
863
+ const p = t.total ?? (l === "ready" ? t.notes.length : null), r = Math.max(0, (p ?? 0) - Lt), a = r > 0 ? d(s("notesMore"), { n: r }) : d(s("notesPreviewOpen"));
864
+ return /* @__PURE__ */ v(
865
+ pe,
866
+ {
867
+ "data-card": "notes",
868
+ headingId: c,
869
+ headingLevel: 3,
870
+ title: p === null ? d("notesPanel.title") : d(s("notesPreviewTitle"), { count: p }),
871
+ headerAction: n && (p ?? 0) > 0 ? /* @__PURE__ */ v("span", { className: "ds:relative ds:inline-flex", children: [
872
+ /* @__PURE__ */ e(
873
+ _t,
874
+ {
875
+ icon: /* @__PURE__ */ e(Mn, { "aria-hidden": "true" }),
876
+ intent: "outline",
877
+ size: "sm",
878
+ "data-action": "open-patient-notes",
879
+ "aria-label": a,
880
+ tooltip: a,
881
+ onClick: () => n()
882
+ }
883
+ ),
884
+ r > 0 ? (
885
+ /* Decorative: the button's name already says the count. */
886
+ /* @__PURE__ */ e(
887
+ wn,
888
+ {
889
+ variant: "outline",
890
+ size: "sm",
891
+ background: "surface",
892
+ count: r,
893
+ "aria-hidden": "true",
894
+ className: "ds:pointer-events-none ds:absolute ds:-top-[var(--spacing-2xs)] ds:-end-[var(--spacing-2xs)]"
895
+ }
896
+ )
897
+ ) : null
898
+ ] }) : void 0,
899
+ children: [
900
+ l === "error" ? /* @__PURE__ */ v(G, { variant: "error", children: [
901
+ /* @__PURE__ */ e(G.Description, { children: d("notesPanel.loadError") }),
902
+ t.onRetry ? /* @__PURE__ */ e(G.Action, { children: /* @__PURE__ */ e(
903
+ C,
904
+ {
905
+ intent: "secondary",
906
+ size: "sm",
907
+ onClick: () => {
908
+ var o;
909
+ u.current = !0, (o = t.onRetry) == null || o.call(t);
910
+ },
911
+ children: d("notesPanel.retry")
912
+ }
913
+ ) }) : null
914
+ ] }) : null,
915
+ t.notes.length === 0 && l === "loading" ? /* @__PURE__ */ v(ae, { children: [
916
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: d("notesPanel.loading") }),
917
+ /* @__PURE__ */ e(tt, { notes: [], loading: !0, loadingRows: 2 })
918
+ ] }) : l !== "error" || t.notes.length > 0 ? (
919
+ /* A note click, or Enter or Space on it, goes straight to that note
920
+ in the Notes tool; the header button opens the tool at the top. */
921
+ /* @__PURE__ */ e(
922
+ tt,
923
+ {
924
+ notes: t.notes,
925
+ maxItems: Lt,
926
+ locale: i,
927
+ "aria-labelledby": c,
928
+ onNoteActivate: n,
929
+ emptyState: /* @__PURE__ */ e("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: d(s("notesPreviewEmpty")) })
930
+ }
931
+ )
932
+ ) : null
933
+ ]
934
+ }
935
+ );
936
+ }
937
+ const ha = ot("ds:flex ds:h-full ds:min-h-0 ds:flex-col"), fa = ot(
938
+ "ds:flex ds:shrink-0 ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:p-[var(--spacing-sm)]"
939
+ ), ga = ot(
940
+ "ds:shrink-0 ds:rounded-[var(--radius-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-offset)]"
941
+ ), $ = "ds:sm:[min-block-size:var(--accessible-target-floor,0px)]", va = "ds:sm:[&>button]:[min-block-size:var(--accessible-target-floor,0px)]", ya = [
942
+ "ds:sm:[&_button:has(svg.lucide-ellipsis)]:[min-block-size:var(--accessible-target-floor,0px)]",
943
+ "ds:[&_button:has(svg.lucide-ellipsis)]:[min-inline-size:var(--accessible-target-floor,auto)]"
944
+ ].join(" "), Yt = ["40%", "33%", "50%", "25%"], ba = [
945
+ "bill",
946
+ "folder",
947
+ "template",
948
+ "empty",
949
+ "identification",
950
+ "webcam"
951
+ ], ka = {
952
+ bill: /* @__PURE__ */ e(Vn, { "aria-hidden": "true" }),
953
+ folder: /* @__PURE__ */ e(Yn, { "aria-hidden": "true" }),
954
+ template: /* @__PURE__ */ e(jn, { "aria-hidden": "true" }),
955
+ empty: /* @__PURE__ */ e(Kn, { "aria-hidden": "true" }),
956
+ identification: /* @__PURE__ */ e(Qn, { "aria-hidden": "true" }),
957
+ webcam: /* @__PURE__ */ e(zn, { "aria-hidden": "true" })
958
+ }, S = (t) => `calendarWorkspace.details.${t}`;
959
+ function Ot({
960
+ children: t,
961
+ startIcon: n,
962
+ overflowItems: i,
963
+ "data-action": d,
964
+ intent: c,
965
+ background: l,
966
+ size: u,
967
+ hideLabel: p
968
+ }) {
969
+ return /* @__PURE__ */ v(We.Root, { children: [
970
+ /* @__PURE__ */ e(sn, { label: t, side: "top", children: /* @__PURE__ */ e(We.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
971
+ C,
972
+ {
973
+ intent: c,
974
+ background: l,
975
+ size: u,
976
+ "data-action": d,
977
+ className: $,
978
+ startIcon: n,
979
+ "aria-haspopup": "menu",
980
+ endIcon: /* @__PURE__ */ e(qn, { "aria-hidden": "true" }),
981
+ children: p ? /* @__PURE__ */ e("span", { className: "ds:sr-only", children: t }) : t
982
+ }
983
+ ) }) }),
984
+ /* @__PURE__ */ e(We.Content, { align: "end", children: i.map((r) => /* @__PURE__ */ e(
985
+ We.Item,
986
+ {
987
+ "data-action": r.action,
988
+ startIcon: r.icon,
989
+ onSelect: r.onSelect,
990
+ children: r.label
991
+ },
992
+ r.label
993
+ )) })
994
+ ] });
995
+ }
996
+ function wa() {
997
+ const { t } = X("ui");
998
+ return /* @__PURE__ */ v(ae, { children: [
999
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: t("common.loading") }),
1000
+ /* @__PURE__ */ v(
1001
+ "div",
1002
+ {
1003
+ "aria-hidden": "true",
1004
+ className: "ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)] ds:overflow-hidden ds:p-[var(--spacing-md)] ds:[&>*]:shrink-0",
1005
+ children: [
1006
+ /* @__PURE__ */ e(
1007
+ Ft,
1008
+ {
1009
+ name: "",
1010
+ loading: !0,
1011
+ surface: "elevated",
1012
+ density: "compact"
1013
+ }
1014
+ ),
1015
+ /* @__PURE__ */ v(pe, { title: t(S("sectionAppointment")), headingLevel: 3, children: [
1016
+ /* @__PURE__ */ e(Ht, { loading: !0, maxLines: 2 }),
1017
+ /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: Yt.map((n, i) => /* @__PURE__ */ v(
1018
+ "div",
1019
+ {
1020
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
1021
+ children: [
1022
+ /* @__PURE__ */ e(
1023
+ ke,
1024
+ {
1025
+ variant: "rounded",
1026
+ stagger: i + 2,
1027
+ width: "var(--spacing-md)",
1028
+ height: "var(--spacing-md)",
1029
+ className: "ds:shrink-0"
1030
+ }
1031
+ ),
1032
+ /* @__PURE__ */ e(
1033
+ ke,
1034
+ {
1035
+ variant: "text",
1036
+ size: "sm",
1037
+ stagger: i + 2,
1038
+ width: n
1039
+ }
1040
+ )
1041
+ ]
1042
+ },
1043
+ n
1044
+ )) })
1045
+ ] }),
1046
+ /* @__PURE__ */ e(pe, { title: t("notesPanel.title"), headingLevel: 3, children: /* @__PURE__ */ e(tt, { notes: [], loading: !0, loadingRows: 2 }) }),
1047
+ /* @__PURE__ */ e(pe, { title: t(S("sectionTreatments")), headingLevel: 3, children: /* @__PURE__ */ e(Bt, { lines: [], loading: !0 }) })
1048
+ ]
1049
+ }
1050
+ ),
1051
+ /* @__PURE__ */ v(
1052
+ "div",
1053
+ {
1054
+ "aria-hidden": "true",
1055
+ className: "ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-sm)] ds:border-t ds:border-[color:var(--border)] ds:p-[var(--spacing-md)]",
1056
+ children: [
1057
+ /* @__PURE__ */ e(ke, { variant: "rounded", width: "33%", height: "var(--spacing-xl)" }),
1058
+ /* @__PURE__ */ e(
1059
+ ke,
1060
+ {
1061
+ variant: "rounded",
1062
+ stagger: 1,
1063
+ height: "var(--spacing-xl)",
1064
+ className: "ds:flex-1"
1065
+ }
1066
+ )
1067
+ ]
1068
+ }
1069
+ )
1070
+ ] });
1071
+ }
1072
+ function Sa({
1073
+ history: t,
1074
+ locale: n,
1075
+ onRetry: i,
1076
+ noteUnrecordedEdits: d,
1077
+ privacy: c
1078
+ }) {
1079
+ var k;
1080
+ const { t: l } = X("ui"), u = t.status ?? (t.entries ? "ready" : "loading"), p = u === "error" ? void 0 : t.entries, r = u === "loading" || u !== "error" && !p, [a, o] = H(!1);
1081
+ we(() => o(!0), []);
1082
+ let f = "";
1083
+ r ? f = l("common.loading") : p && (f = p.length === 0 ? l(S("historyEmpty")) : l(S("historyLoaded"), { n: p.length }));
1084
+ let y;
1085
+ return u === "error" ? y = /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1086
+ /* @__PURE__ */ e(G, { variant: "error", children: /* @__PURE__ */ e(G.Description, { children: ((k = t.message) == null ? void 0 : k.trim()) || l("emptyState.error.description") }) }),
1087
+ i ? /* @__PURE__ */ e(
1088
+ C,
1089
+ {
1090
+ intent: "outline",
1091
+ "data-action": "retry-history",
1092
+ onClick: () => i(),
1093
+ children: l("emptyState.error.cta")
1094
+ }
1095
+ ) : null
1096
+ ] }) : r || !p ? y = /* @__PURE__ */ e(
1097
+ "div",
1098
+ {
1099
+ "aria-hidden": "true",
1100
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1101
+ children: Yt.slice(0, 3).map((b, m) => /* @__PURE__ */ v(
1102
+ "div",
1103
+ {
1104
+ className: "ds:flex ds:items-start ds:gap-[var(--spacing-sm)]",
1105
+ children: [
1106
+ /* @__PURE__ */ e(
1107
+ ke,
1108
+ {
1109
+ variant: "circular",
1110
+ stagger: m,
1111
+ width: "var(--spacing-xl)",
1112
+ height: "var(--spacing-xl)",
1113
+ className: "ds:shrink-0"
1114
+ }
1115
+ ),
1116
+ /* @__PURE__ */ e(
1117
+ ke,
1118
+ {
1119
+ variant: "rounded",
1120
+ stagger: m,
1121
+ width: b,
1122
+ height: "var(--spacing-2xl)"
1123
+ }
1124
+ )
1125
+ ]
1126
+ },
1127
+ b
1128
+ ))
1129
+ }
1130
+ ) : y = /* @__PURE__ */ e(
1131
+ un,
1132
+ {
1133
+ history: p,
1134
+ locale: n,
1135
+ noteUnrecordedEdits: d,
1136
+ privacy: c
1137
+ }
1138
+ ), /* @__PURE__ */ v(ae, { children: [
1139
+ /* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: a ? f : "" }),
1140
+ y
1141
+ ] });
1142
+ }
1143
+ function Aa({
1144
+ read: t,
1145
+ refreshing: n,
1146
+ currency: i,
1147
+ now: d,
1148
+ locale: c,
1149
+ shownTitle: l,
1150
+ headingId: u,
1151
+ enter: p,
1152
+ live: r,
1153
+ statusControl: a,
1154
+ patientId: o = ((Oe) => (Oe = t.patient) == null ? void 0 : Oe.id)(),
1155
+ operator: f,
1156
+ chair: y,
1157
+ privacy: k = !1,
1158
+ privacyTitle: b,
1159
+ mapsLink: m,
1160
+ notesPreview: N,
1161
+ onOpenNotes: L,
1162
+ history: P,
1163
+ onOpenHistory: E,
1164
+ noteUnrecordedEdits: M = !1,
1165
+ readOnly: T = !1,
1166
+ onStatusChange: I,
1167
+ allowedStatuses: F = kt,
1168
+ onDescriptionChange: z,
1169
+ onAssignPatient: ie,
1170
+ onEdit: se,
1171
+ onMove: K,
1172
+ onCopy: B,
1173
+ onDelete: j,
1174
+ onJoinTelehealth: Y,
1175
+ onWhatsApp: J,
1176
+ whatsappUrl: Q,
1177
+ onBuyWhatsApp: x,
1178
+ createTaskUrl: Z,
1179
+ onRequestSignature: ee,
1180
+ onSignOnDevice: Ae,
1181
+ onOpenPatient: me,
1182
+ shortcuts: te,
1183
+ documents: oe
1184
+ }) {
1185
+ var ft, gt;
1186
+ const { t: h } = X("ui"), { eventId: D } = t, [ze] = H(p), he = { details: t, locale: c, currency: i }, w = P ? P.eventId !== void 0 && P.eventId !== D ? { status: "loading" } : P : t.history ? { entries: t.history } : void 0, _e = (N == null ? void 0 : N.patientId) === void 0 || N.patientId === o, fe = N ? _e ? N : o ? { notes: [], status: "loading", total: null } : void 0 : void 0, re = !!z && !T && !k, [xe, ne] = H(!1), [Ne, V] = H(!1), le = xe && w !== void 0, He = Ne && re, Ee = () => {
1187
+ le || !w || (ne(!0), E == null || E(D));
1188
+ }, Me = R({ history: !1, editor: !1 });
1189
+ ue(() => {
1190
+ const g = Me.current;
1191
+ Me.current = { history: le, editor: He };
1192
+ const be = g.history && w === void 0, vt = g.editor && !re;
1193
+ be && ne(!1), vt && V(!1), (be || vt) && Le(u);
1194
+ });
1195
+ const ge = R(null), O = R(!1), Te = (w == null ? void 0 : w.status) ?? (w != null && w.entries ? "ready" : "loading");
1196
+ ue(() => {
1197
+ O.current && (Te !== "loading" && (O.current = !1), it(ge.current));
1198
+ }, [Te]);
1199
+ const [q, Ce] = H(t.appointment.name ?? "");
1200
+ we(() => {
1201
+ Ce(t.appointment.name ?? "");
1202
+ }, [t.appointment.name]);
1203
+ const [Ie, de] = H(""), [ve, De] = H(!1), [A, W] = H(), ye = R(null);
1204
+ we(() => {
1205
+ Ne && (de(q), W(void 0));
1206
+ }, [Ne]);
1207
+ const Fe = async () => {
1208
+ if (!z) return;
1209
+ const g = Ie.trim();
1210
+ De(!0), W(void 0);
1211
+ try {
1212
+ await z(g, D), Ce(g), V(!1);
1213
+ } catch (be) {
1214
+ W(
1215
+ et(be, h(S("descriptionSaveFailed")))
1216
+ );
1217
+ } finally {
1218
+ De(!1);
1219
+ }
1220
+ }, [U, Ke] = H(t.appointment.status);
1221
+ we(() => {
1222
+ Ke(t.appointment.status);
1223
+ }, [t.appointment.status]);
1224
+ const rt = R(n);
1225
+ ue(() => {
1226
+ const g = rt.current && !n;
1227
+ rt.current = n, g && (Ke(t.appointment.status), Ce(t.appointment.name ?? ""));
1228
+ }, [n]);
1229
+ const Be = kt.filter(
1230
+ (g) => F.includes(g)
1231
+ ), Re = ln(U, {
1232
+ statuses: Be,
1233
+ /* Shown so the control can say it, but not a choice. */
1234
+ disabledStatuses: U && !Be.includes(U) ? [U] : []
1235
+ }), Pe = !!I && !T && Be.some((g) => g !== U), Vt = async (g) => {
1236
+ if (!(!I || !dn(g))) {
1237
+ try {
1238
+ await I(g, D);
1239
+ } catch (be) {
1240
+ throw new Error(et(be, h(S("statusSaveFailed"))));
1241
+ }
1242
+ Ke(g);
1243
+ }
1244
+ }, lt = k ? void 0 : Q, dt = ba.filter(
1245
+ (g) => oe == null ? void 0 : oe.kinds.includes(g)
1246
+ ), Gt = (((ft = t.care) == null ? void 0 : ft.lines.length) ?? 0) > 0, je = o !== void 0 && o !== "", Ye = h(S("status")), ct = `${Ye}: ${Re.option.label}`, Ve = R(null), ut = R(Pe);
1247
+ ue(() => {
1248
+ const g = ut.current && !Pe;
1249
+ ut.current = Pe, g && (Ve.current ? it(Ve.current) : Le(u));
1250
+ });
1251
+ const pt = Pe ? /* @__PURE__ */ e(
1252
+ on,
1253
+ {
1254
+ ref: a,
1255
+ value: Re.value,
1256
+ options: Re.options,
1257
+ size: "sm",
1258
+ workflowLabel: Ye,
1259
+ className: `ds:[&>button]:bg-[color:var(--background)] ${va}`,
1260
+ "aria-label": ct,
1261
+ onValueChange: Vt
1262
+ }
1263
+ ) : U ? (
1264
+ /* Named as the control is, "Status: Confirmed": the small display
1265
+ prints the value alone. */
1266
+ /* @__PURE__ */ e(
1267
+ "div",
1268
+ {
1269
+ ref: Ve,
1270
+ role: "group",
1271
+ "aria-label": ct,
1272
+ tabIndex: -1,
1273
+ "data-status-display": "",
1274
+ className: ga(),
1275
+ children: /* @__PURE__ */ e(
1276
+ rn,
1277
+ {
1278
+ value: Re.value,
1279
+ size: "sm",
1280
+ workflowLabel: Ye,
1281
+ option: Re.option
1282
+ }
1283
+ )
1284
+ }
1285
+ )
1286
+ ) : null, _ = [];
1287
+ !T && ie && !je && _.push([
1288
+ "assign-patient",
1289
+ /* @__PURE__ */ e(
1290
+ C,
1291
+ {
1292
+ intent: "primary",
1293
+ "data-action": "assign-patient",
1294
+ className: $,
1295
+ startIcon: /* @__PURE__ */ e(Fn, { "aria-hidden": "true" }),
1296
+ onClick: () => ie(D),
1297
+ children: h("calendarWorkspace.inc1.bookings.assignPatient")
1298
+ },
1299
+ "assign"
1300
+ )
1301
+ ]), Y && _.push([
1302
+ "join-telehealth",
1303
+ /* @__PURE__ */ e(
1304
+ C,
1305
+ {
1306
+ intent: "primary",
1307
+ "data-action": "join-telehealth",
1308
+ className: $,
1309
+ startIcon: /* @__PURE__ */ e($t, { "aria-hidden": "true" }),
1310
+ onClick: () => Y(D),
1311
+ children: h(S("joinTelehealth"))
1312
+ },
1313
+ "join"
1314
+ )
1315
+ ]), !T && se && _.push([
1316
+ "edit-appointment",
1317
+ /* @__PURE__ */ e(
1318
+ C,
1319
+ {
1320
+ "data-action": "edit-appointment",
1321
+ className: $,
1322
+ startIcon: /* @__PURE__ */ e(Ct, { "aria-hidden": "true" }),
1323
+ onClick: () => se(D),
1324
+ children: h("calendarWorkspace.editor.editTitle")
1325
+ },
1326
+ "edit"
1327
+ )
1328
+ ]), !T && K && _.push([
1329
+ "move-appointment",
1330
+ /* @__PURE__ */ e(
1331
+ C,
1332
+ {
1333
+ "data-action": "move-appointment",
1334
+ className: $,
1335
+ startIcon: /* @__PURE__ */ e(cn, { "aria-hidden": "true" }),
1336
+ onClick: () => K(D),
1337
+ children: h(S("move"))
1338
+ },
1339
+ "move"
1340
+ )
1341
+ ]), !T && B && _.push([
1342
+ "copy-appointment",
1343
+ Gt ? /* @__PURE__ */ e(
1344
+ Ot,
1345
+ {
1346
+ "data-action": "copy-appointment",
1347
+ "data-overflow-tip": !1,
1348
+ startIcon: /* @__PURE__ */ e(wt, { "aria-hidden": "true" }),
1349
+ overflowItems: [
1350
+ {
1351
+ label: h("calendarWorkspace.editor.duplicateAppointmentOnly"),
1352
+ icon: /* @__PURE__ */ e(Bn, { "aria-hidden": "true" }),
1353
+ action: "copy-appointment-only",
1354
+ onSelect: () => B(!1, D)
1355
+ },
1356
+ {
1357
+ label: h("calendarWorkspace.editor.duplicateWithTreatments"),
1358
+ icon: /* @__PURE__ */ e(at, { "aria-hidden": "true" }),
1359
+ action: "copy-appointment-with-treatments",
1360
+ onSelect: () => B(!0, D)
1361
+ }
1362
+ ],
1363
+ children: h(S("copy"))
1364
+ },
1365
+ "copy"
1366
+ ) : /* @__PURE__ */ e(
1367
+ C,
1368
+ {
1369
+ "data-action": "copy-appointment",
1370
+ className: $,
1371
+ startIcon: /* @__PURE__ */ e(wt, { "aria-hidden": "true" }),
1372
+ onClick: () => B(!1, D),
1373
+ children: h(S("copy"))
1374
+ },
1375
+ "copy"
1376
+ )
1377
+ ]), oe && dt.length > 0 && _.push([
1378
+ "open-create-document",
1379
+ /* @__PURE__ */ e(
1380
+ Ot,
1381
+ {
1382
+ "data-action": "open-create-document",
1383
+ "data-overflow-tip": !1,
1384
+ startIcon: /* @__PURE__ */ e(Wn, { "aria-hidden": "true" }),
1385
+ overflowItems: dt.map((g) => ({
1386
+ label: h(S(`documents.${g}`)),
1387
+ icon: ka[g],
1388
+ action: `create-document-${g}`,
1389
+ onSelect: () => oe.onCreate(g, D)
1390
+ })),
1391
+ children: h(S("documents.label"))
1392
+ },
1393
+ "documents"
1394
+ )
1395
+ ]), J ? _.push([
1396
+ "open-whatsapp",
1397
+ /* @__PURE__ */ e(
1398
+ C,
1399
+ {
1400
+ "data-action": "open-whatsapp",
1401
+ className: $,
1402
+ startIcon: /* @__PURE__ */ e(Qe, { "aria-hidden": "true" }),
1403
+ onClick: () => J(D),
1404
+ children: h(S("remindWhatsApp"))
1405
+ },
1406
+ "whatsapp"
1407
+ )
1408
+ ]) : $e(lt) ? _.push([
1409
+ "open-whatsapp",
1410
+ /* @__PURE__ */ e(
1411
+ C,
1412
+ {
1413
+ asChild: !0,
1414
+ "data-action": "open-whatsapp",
1415
+ className: $,
1416
+ startIcon: /* @__PURE__ */ e(Qe, { "aria-hidden": "true" }),
1417
+ children: /* @__PURE__ */ e(
1418
+ "a",
1419
+ {
1420
+ href: $e(lt),
1421
+ target: "_blank",
1422
+ rel: "noopener noreferrer",
1423
+ children: h(S("remindWhatsApp"))
1424
+ }
1425
+ )
1426
+ },
1427
+ "whatsapp"
1428
+ )
1429
+ ]) : x && !Q && _.push([
1430
+ "buy-whatsapp",
1431
+ /* @__PURE__ */ e(
1432
+ C,
1433
+ {
1434
+ "data-action": "buy-whatsapp",
1435
+ className: $,
1436
+ startIcon: /* @__PURE__ */ e(Qe, { "aria-hidden": "true" }),
1437
+ onClick: () => x(D),
1438
+ children: h(S("buyWhatsApp"))
1439
+ },
1440
+ "buy-whatsapp"
1441
+ )
1442
+ ]);
1443
+ const mt = $e(Z);
1444
+ mt && _.push([
1445
+ "create-task",
1446
+ /* @__PURE__ */ e(
1447
+ C,
1448
+ {
1449
+ asChild: !0,
1450
+ "data-action": "create-task",
1451
+ className: $,
1452
+ startIcon: /* @__PURE__ */ e(Un, { "aria-hidden": "true" }),
1453
+ children: /* @__PURE__ */ e("a", { href: mt, children: h(S("createTask")) })
1454
+ },
1455
+ "task"
1456
+ )
1457
+ ]), !T && j && _.push([
1458
+ "delete-appointment",
1459
+ /* @__PURE__ */ e(
1460
+ C,
1461
+ {
1462
+ intent: "destructiveOutline",
1463
+ "data-action": "delete-appointment",
1464
+ className: $,
1465
+ startIcon: /* @__PURE__ */ e($n, { "aria-hidden": "true" }),
1466
+ onClick: () => j(D),
1467
+ children: h("calendarWorkspace.editor.delete")
1468
+ },
1469
+ "delete"
1470
+ )
1471
+ ]);
1472
+ const Ge = _.map(([, g]) => g);
1473
+ r.current = {
1474
+ status: U ?? null,
1475
+ allowed: Pe ? Be : [],
1476
+ offered: _.map(([g]) => g),
1477
+ historyAvailable: w !== void 0,
1478
+ historyOpen: le,
1479
+ openHistory: Ee,
1480
+ closeHistory: () => ne(!1)
1481
+ };
1482
+ const ht = h(S("historyBack"));
1483
+ return /* @__PURE__ */ e(
1484
+ "div",
1485
+ {
1486
+ className: `ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ${ze ? nn : ""}`,
1487
+ children: /* @__PURE__ */ v(Je.Host, { children: [
1488
+ /* @__PURE__ */ e(
1489
+ Mt,
1490
+ {
1491
+ title: l,
1492
+ headingId: u,
1493
+ icon: /* @__PURE__ */ e(qt, { "aria-hidden": "true" }),
1494
+ sticky: !0,
1495
+ divider: !0,
1496
+ actions: w ? /* @__PURE__ */ e(
1497
+ _t,
1498
+ {
1499
+ size: "sm",
1500
+ intent: "ghost",
1501
+ icon: /* @__PURE__ */ e(It, { "aria-hidden": "true" }),
1502
+ "aria-label": h(S("historyAction")),
1503
+ tooltip: h(S("historyAction")),
1504
+ "data-action": "open-history",
1505
+ onClick: Ee
1506
+ }
1507
+ ) : void 0
1508
+ }
1509
+ ),
1510
+ /* @__PURE__ */ e(
1511
+ "div",
1512
+ {
1513
+ tabIndex: 0,
1514
+ "aria-busy": n || void 0,
1515
+ className: "ds:[min-block-size:0] ds:flex-1 ds:overflow-y-auto",
1516
+ children: /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
1517
+ k ? /* @__PURE__ */ e(en, { mask: b }) : t.patient ? /* @__PURE__ */ e(
1518
+ ca,
1519
+ {
1520
+ ...he,
1521
+ now: d,
1522
+ mapsLink: m,
1523
+ shortcuts: te,
1524
+ onRequestSignature: ee,
1525
+ onSignOnDevice: Ae,
1526
+ onOpenPatient: me
1527
+ }
1528
+ ) : (
1529
+ /* No patient card to carry the identity: a patient-less, an
1530
+ unassigned or an unresolved booking keeps the strip. */
1531
+ /* @__PURE__ */ e(
1532
+ bn,
1533
+ {
1534
+ name: t.appointment.title.trim() ? t.appointment.title : h(S("patientNotLoaded")),
1535
+ unresolved: je,
1536
+ status: U,
1537
+ flags: {
1538
+ isTelehealth: t.appointment.isTelehealth,
1539
+ isBookedOnline: t.appointment.bookedOnline,
1540
+ isRecurring: t.appointment.recurrence !== void 0,
1541
+ hasUnassignedPatient: t.appointment.bookedOnline && !je,
1542
+ hasHighlightedAnamnesis: !1,
1543
+ hasBillableAmount: (((gt = t.money) == null ? void 0 : gt.billableAmount) ?? 0) > 0
1544
+ },
1545
+ locale: c
1546
+ }
1547
+ )
1548
+ ),
1549
+ /* @__PURE__ */ e(
1550
+ ua,
1551
+ {
1552
+ ...he,
1553
+ operator: f,
1554
+ chair: y,
1555
+ privacy: k,
1556
+ history: (w == null ? void 0 : w.status) === "error" || w == null ? void 0 : w.entries,
1557
+ description: (
1558
+ /* Not keyed on the text: the pencil must survive a save,
1559
+ so the sub-view can hand focus back to it. An empty
1560
+ read-only description prints nothing. Privacy hides the
1561
+ text and the pencil. */
1562
+ k ? q ? /* @__PURE__ */ e(bt, { block: "description" }) : void 0 : q || z && !T ? /* @__PURE__ */ e(
1563
+ Ht,
1564
+ {
1565
+ "data-block": "description",
1566
+ role: "group",
1567
+ "aria-label": h("calendarWorkspace.editor.description"),
1568
+ value: q,
1569
+ editLabel: h(S("editDescription")),
1570
+ onEdit: z && !T ? () => V(!0) : void 0
1571
+ }
1572
+ ) : void 0
1573
+ )
1574
+ }
1575
+ ),
1576
+ fe && k ? /* @__PURE__ */ e(
1577
+ pe,
1578
+ {
1579
+ "data-card": "notes",
1580
+ title: h("notesPanel.title"),
1581
+ headingLevel: 3,
1582
+ children: /* @__PURE__ */ e(bt, {})
1583
+ }
1584
+ ) : fe ? /* @__PURE__ */ e(
1585
+ ma,
1586
+ {
1587
+ preview: fe,
1588
+ onOpenNotes: _e ? L : void 0,
1589
+ locale: c
1590
+ }
1591
+ ) : null,
1592
+ /* @__PURE__ */ e(
1593
+ pa,
1594
+ {
1595
+ ...he,
1596
+ privacy: k,
1597
+ carePlanUrl: te == null ? void 0 : te.carePlanUrl
1598
+ }
1599
+ )
1600
+ ] })
1601
+ }
1602
+ ),
1603
+ pt || Ge.length > 0 ? (
1604
+ /* The body scrolls; the status and the actions stay put. The
1605
+ status keeps its own segment and never folds. The actions fold
1606
+ to icons, then into More, never onto a second line. */
1607
+ /* @__PURE__ */ v("div", { className: fa(), children: [
1608
+ pt,
1609
+ Ge.length > 0 ? /* @__PURE__ */ e(
1610
+ tn,
1611
+ {
1612
+ label: h(S("actionsLabel")),
1613
+ overflow: "menu",
1614
+ collapseToIcons: !0,
1615
+ background: "surface",
1616
+ size: "sm",
1617
+ className: `ds:min-w-0 ds:flex-1 ds:text-end ${ya}`,
1618
+ children: Ge
1619
+ }
1620
+ ) : null
1621
+ ] })
1622
+ ) : null,
1623
+ w ? /* @__PURE__ */ e(
1624
+ Je,
1625
+ {
1626
+ ref: ge,
1627
+ open: le,
1628
+ icon: /* @__PURE__ */ e(It, { "aria-hidden": "true" }),
1629
+ title: h(S("historyTitle")),
1630
+ backLabel: ht,
1631
+ headingLevel: 3,
1632
+ onBack: () => ne(!1),
1633
+ "data-details-subview": "history",
1634
+ children: /* @__PURE__ */ e("div", { className: "ds:-m-[var(--panel-subview-inset)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ e(
1635
+ Sa,
1636
+ {
1637
+ history: w,
1638
+ locale: c,
1639
+ noteUnrecordedEdits: M,
1640
+ privacy: k,
1641
+ onRetry: w.onRetry ? () => {
1642
+ var g;
1643
+ O.current = !0, (g = w.onRetry) == null || g.call(w);
1644
+ } : void 0
1645
+ }
1646
+ ) })
1647
+ }
1648
+ ) : null,
1649
+ re ? /* @__PURE__ */ e(
1650
+ Je,
1651
+ {
1652
+ open: He,
1653
+ icon: /* @__PURE__ */ e(Ct, { "aria-hidden": "true" }),
1654
+ title: h(S("editDescription")),
1655
+ backLabel: ht,
1656
+ headingLevel: 3,
1657
+ initialFocusRef: ye,
1658
+ onBack: () => {
1659
+ ve || V(!1);
1660
+ },
1661
+ "data-details-subview": "description",
1662
+ footer: /* @__PURE__ */ v(ae, { children: [
1663
+ /* @__PURE__ */ e(
1664
+ C,
1665
+ {
1666
+ intent: "secondary",
1667
+ disabled: ve,
1668
+ onClick: () => V(!1),
1669
+ children: h(S("noteCancel"))
1670
+ }
1671
+ ),
1672
+ /* @__PURE__ */ e(
1673
+ C,
1674
+ {
1675
+ intent: "primary",
1676
+ "data-action": "save-description",
1677
+ loading: ve,
1678
+ onClick: () => void Fe(),
1679
+ children: h(S("descriptionSave"))
1680
+ }
1681
+ )
1682
+ ] }),
1683
+ children: /* @__PURE__ */ v("div", { className: "ds:-m-[var(--panel-subview-inset)] ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
1684
+ A ? /* @__PURE__ */ e(G, { variant: "error", children: /* @__PURE__ */ e(G.Description, { children: A }) }) : null,
1685
+ /* @__PURE__ */ e(
1686
+ an,
1687
+ {
1688
+ ref: ye,
1689
+ value: Ie,
1690
+ minRows: 6,
1691
+ autoResize: !0,
1692
+ "aria-label": h("calendarWorkspace.editor.description"),
1693
+ onChange: (g) => de(g.target.value)
1694
+ }
1695
+ )
1696
+ ] })
1697
+ }
1698
+ ) : null
1699
+ ] })
1700
+ }
1701
+ );
1702
+ }
1703
+ const xa = Xt(function({
1704
+ state: n,
1705
+ onRetry: i,
1706
+ patientId: d,
1707
+ operator: c,
1708
+ chair: l,
1709
+ currency: u = "EUR",
1710
+ now: p,
1711
+ locale: r,
1712
+ title: a,
1713
+ privacy: o = !1,
1714
+ privacyTitle: f,
1715
+ mapsLink: y,
1716
+ notesPreview: k,
1717
+ onOpenNotes: b,
1718
+ history: m,
1719
+ onOpenHistory: N,
1720
+ noteUnrecordedEdits: L,
1721
+ readOnly: P = !1,
1722
+ onStatusChange: E,
1723
+ allowedStatuses: M,
1724
+ onDescriptionChange: T,
1725
+ onAssignPatient: I,
1726
+ onEdit: F,
1727
+ onMove: z,
1728
+ onCopy: ie,
1729
+ onDelete: se,
1730
+ onJoinTelehealth: K,
1731
+ onWhatsApp: B,
1732
+ whatsappUrl: j,
1733
+ onBuyWhatsApp: Y,
1734
+ createTaskUrl: J,
1735
+ onRequestSignature: Q,
1736
+ onSignOnDevice: x,
1737
+ onOpenPatient: Z,
1738
+ shortcuts: ee,
1739
+ documents: Ae,
1740
+ id: me,
1741
+ className: te,
1742
+ ...oe
1743
+ }, Oe) {
1744
+ var ve, De;
1745
+ const { t: h, i18n: D } = X("ui"), ze = Ze(), he = me ?? ze, w = Ze(), _e = r ?? D.language, fe = !o && (a != null && a.trim()) ? a : h(S("region")), re = n.status === "ready" ? n.read : void 0, xe = n.status === "ready" ? n.read.eventId : n.eventId, ne = R(
1746
+ void 0
1747
+ ), Ne = ne.current !== void 0 && ne.current !== "ready";
1748
+ we(() => {
1749
+ ne.current = n.status;
1750
+ }, [n.status]);
1751
+ const V = !!i && (n.status === "error" || n.status === "refused" && n.retryable === !0), le = R(null), He = yt(() => Zt(Oe, le), [Oe]), Ee = R(!1);
1752
+ typeof document < "u" && (Ee.current = ((ve = le.current) == null ? void 0 : ve.contains(document.activeElement)) ?? !1);
1753
+ const Me = re ? `ready:${re.eventId}` : n.status, ge = R(!1);
1754
+ ue(() => {
1755
+ ge.current ? (n.status !== "loading" && (ge.current = !1), Le(w)) : Ee.current && Le(w);
1756
+ }, [Me, w]);
1757
+ const O = R(null);
1758
+ re || (O.current = null);
1759
+ const Te = R(null), q = R({ state: n, eventId: xe, privacy: o, retryOffered: V, onRetry: i });
1760
+ q.current = { state: n, eventId: xe, privacy: o, retryOffered: V, onRetry: i };
1761
+ const Ce = yt(
1762
+ () => ({
1763
+ getEventId: () => q.current.eventId ?? null,
1764
+ getLoadStatus: () => q.current.state.status,
1765
+ getAppointmentStatus: () => {
1766
+ var A;
1767
+ return ((A = O.current) == null ? void 0 : A.status) ?? null;
1768
+ },
1769
+ getAllowedStatuses: () => {
1770
+ var A;
1771
+ return [...((A = O.current) == null ? void 0 : A.allowed) ?? []];
1772
+ },
1773
+ getOfferedActions: () => {
1774
+ var A;
1775
+ return [...((A = O.current) == null ? void 0 : A.offered) ?? []];
1776
+ },
1777
+ isHistoryOpen: () => {
1778
+ var A;
1779
+ return ((A = O.current) == null ? void 0 : A.historyOpen) ?? !1;
1780
+ },
1781
+ isPrivacy: () => q.current.privacy,
1782
+ openHistory: () => {
1783
+ var A;
1784
+ if (!((A = O.current) != null && A.historyAvailable))
1785
+ throw new Error("AppointmentDetailsPanel: History is not offered.");
1786
+ O.current.openHistory();
1787
+ },
1788
+ closeHistory: () => {
1789
+ var A;
1790
+ (A = O.current) == null || A.closeHistory();
1791
+ },
1792
+ setAppointmentStatus: (A) => {
1793
+ const W = O.current, ye = Te.current;
1794
+ if (!W || !ye || W.allowed.length === 0)
1795
+ return Xe(
1796
+ new Error("AppointmentDetailsPanel: the status is read-only.")
1797
+ );
1798
+ if (A === W.status) return Promise.resolve();
1799
+ if (!W.allowed.includes(A))
1800
+ return Xe(
1801
+ new Error(`AppointmentDetailsPanel: "${A}" is not allowed.`)
1802
+ );
1803
+ const Fe = () => Xe(
1804
+ new Error("AppointmentDetailsPanel: a status save is in flight.")
1805
+ );
1806
+ if (ye.getIsSaving()) return Fe();
1807
+ const U = ye.setValue(A);
1808
+ return U === void 0 ? Fe() : U;
1809
+ },
1810
+ retry: () => {
1811
+ const { retryOffered: A, onRetry: W } = q.current;
1812
+ if (!A || !W)
1813
+ throw new Error("AppointmentDetailsPanel: Retry is not offered.");
1814
+ W();
1815
+ }
1816
+ }),
1817
+ []
1818
+ );
1819
+ Qt(ea, Ce, he);
1820
+ const Ie = /* @__PURE__ */ e(
1821
+ Mt,
1822
+ {
1823
+ title: fe,
1824
+ headingId: w,
1825
+ icon: /* @__PURE__ */ e(qt, { "aria-hidden": "true" }),
1826
+ sticky: !0,
1827
+ divider: !0
1828
+ }
1829
+ );
1830
+ let de;
1831
+ return n.status === "ready" ? de = /* @__PURE__ */ e(
1832
+ Aa,
1833
+ {
1834
+ read: n.read,
1835
+ refreshing: n.refreshing === !0,
1836
+ currency: u,
1837
+ now: p ?? /* @__PURE__ */ new Date(),
1838
+ locale: _e,
1839
+ shownTitle: fe,
1840
+ headingId: w,
1841
+ enter: Ne,
1842
+ live: O,
1843
+ statusControl: Te,
1844
+ patientId: d,
1845
+ operator: c,
1846
+ chair: l,
1847
+ privacy: o,
1848
+ privacyTitle: f,
1849
+ mapsLink: y,
1850
+ notesPreview: k,
1851
+ onOpenNotes: b,
1852
+ history: m,
1853
+ onOpenHistory: N,
1854
+ noteUnrecordedEdits: L,
1855
+ readOnly: P,
1856
+ onStatusChange: E,
1857
+ allowedStatuses: M,
1858
+ onDescriptionChange: T,
1859
+ onAssignPatient: I,
1860
+ onEdit: F,
1861
+ onMove: z,
1862
+ onCopy: ie,
1863
+ onDelete: se,
1864
+ onJoinTelehealth: K,
1865
+ onWhatsApp: B,
1866
+ whatsappUrl: j,
1867
+ onBuyWhatsApp: Y,
1868
+ createTaskUrl: J,
1869
+ onRequestSignature: Q,
1870
+ onSignOnDevice: x,
1871
+ onOpenPatient: Z,
1872
+ shortcuts: ee,
1873
+ documents: Ae
1874
+ },
1875
+ n.read.eventId
1876
+ ) : n.status === "loading" ? de = /* @__PURE__ */ v(ae, { children: [
1877
+ Ie,
1878
+ /* @__PURE__ */ e(wa, {})
1879
+ ] }) : de = /* @__PURE__ */ v(ae, { children: [
1880
+ Ie,
1881
+ /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
1882
+ /* @__PURE__ */ e(G, { variant: n.status === "error" ? "error" : "warning", children: /* @__PURE__ */ e(G.Description, { children: n.status === "error" ? ((De = n.message) == null ? void 0 : De.trim()) || h("emptyState.error.description") : n.reason }) }),
1883
+ V ? /* @__PURE__ */ e(
1884
+ C,
1885
+ {
1886
+ intent: "outline",
1887
+ "data-action": "retry-load",
1888
+ onClick: () => {
1889
+ ge.current = !0, i == null || i();
1890
+ },
1891
+ children: h("emptyState.error.cta")
1892
+ }
1893
+ ) : null
1894
+ ] })
1895
+ ] }), /* @__PURE__ */ e(
1896
+ "div",
1897
+ {
1898
+ ref: He,
1899
+ id: me,
1900
+ "data-component": "appointment-details-panel",
1901
+ "data-component-id": he,
1902
+ "data-event-id": xe,
1903
+ "data-status": n.status,
1904
+ "aria-busy": n.status === "loading" || void 0,
1905
+ className: ha({ className: te }),
1906
+ ...oe,
1907
+ children: de
1908
+ }
1909
+ );
1910
+ });
1911
+ xa.displayName = "AppointmentDetailsPanel";
1912
+ function $i({
1913
+ eventId: t,
1914
+ load: n,
1915
+ reloadKey: i
1916
+ }) {
1917
+ const { t: d } = X("ui"), c = R("");
1918
+ c.current = d("emptyState.error.description");
1919
+ const l = R(n);
1920
+ ue(() => {
1921
+ l.current = n;
1922
+ });
1923
+ const [u, p] = H(0), [r, a] = H(), o = JSON.stringify([i ?? null, u]), [f, y] = H({ eventId: t, count: 0 }), k = f.eventId === t ? f.count : f.count + 1;
1924
+ f.eventId !== t && y({ eventId: t, count: k }), we(() => {
1925
+ if (t === null) {
1926
+ a(void 0);
1927
+ return;
1928
+ }
1929
+ const L = new AbortController(), P = (E) => {
1930
+ L.signal.aborted || a({ eventId: t, selection: k, request: o, value: E });
1931
+ };
1932
+ return Promise.resolve().then(() => l.current(t, { signal: L.signal })).then((E) => {
1933
+ var M, T;
1934
+ if (E.status !== "ready") {
1935
+ P({
1936
+ status: "refused",
1937
+ eventId: t,
1938
+ reason: E.reason,
1939
+ retryable: E.retryable
1940
+ });
1941
+ return;
1942
+ }
1943
+ if (((M = E.details) == null ? void 0 : M.eventId) !== t || !kn((T = E.details.appointment) == null ? void 0 : T.startIso))
1944
+ throw new Error(c.current);
1945
+ P({ status: "ready", read: E.details });
1946
+ }).catch((E) => {
1947
+ P({
1948
+ status: "error",
1949
+ eventId: t,
1950
+ message: et(E, c.current)
1951
+ });
1952
+ }), () => L.abort();
1953
+ }, [t, k, o]);
1954
+ const b = Jt(() => p((L) => L + 1), []);
1955
+ if (t === null) return { state: null, retry: b };
1956
+ const m = (r == null ? void 0 : r.eventId) === t && r.selection === k ? r : void 0;
1957
+ let N = { status: "loading", eventId: t };
1958
+ return (m == null ? void 0 : m.request) === o ? N = m.value : (m == null ? void 0 : m.value.status) === "ready" && (N = { status: "ready", read: m.value.read, refreshing: !0 }), { state: N, retry: b };
1959
+ }
1960
+ export {
1961
+ xa as A,
1962
+ ce as D,
1963
+ ea as a,
1964
+ $i as u
1965
+ };
1966
+ //# sourceMappingURL=use-appointment-details-read-jGkJalX8.js.map