@alfadocs/ui-kit 1.47.1 → 1.48.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.
- package/dist/_chunks/{actions-cell-renderer-B5m9lwgC.js → actions-cell-renderer-DMittsR3.js} +4 -4
- package/dist/_chunks/{address-autocomplete-Bq-1n1UX.js → address-autocomplete-Dp5uMvKP.js} +61 -60
- package/dist/_chunks/{address-fields-jFfjxOQR.js → address-fields-QfC-N3pw.js} +5 -5
- package/dist/_chunks/{agenda-card-DyQtHb9z.js → agenda-card-C4h0xMGi.js} +2 -2
- package/dist/_chunks/{agenda-tray-CBaJASb5.js → agenda-tray-DNZYW2xt.js} +4 -4
- package/dist/_chunks/{ai-credits-notice-xszqOZTC.js → ai-credits-notice-C-kz_RrY.js} +3 -3
- package/dist/_chunks/{ai-permission-notice-D7I2U-cz.js → ai-permission-notice-BRZeS3mT.js} +3 -3
- package/dist/_chunks/{ai-prompt-input-DXknpQCB.js → ai-prompt-input-CxvnXsAs.js} +82 -82
- package/dist/_chunks/{alia-sidebar-CUqaJNPQ.js → alia-sidebar-Crn8OGPF.js} +7 -7
- package/dist/_chunks/{anamnesis-card-xtEhyojD.js → anamnesis-card-D8Si-2GV.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-card-CclBbiXg.js → anamnesis-summary-card-DPyScUMM.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-DI-UX5r6.js → anamnesis-summary-rows-CZirLRuv.js} +12 -12
- package/dist/_chunks/{antenatal-schedule-timeline-CXk_tzWG.js → antenatal-schedule-timeline-8fm3vPSV.js} +2 -2
- package/dist/_chunks/{appointment-card-DluZy8Iv.js → appointment-card-CvGU0QP6.js} +5 -5
- package/dist/_chunks/{appointment-peek-BsfCpiJs.js → appointment-peek--dmWznLZ.js} +5 -5
- package/dist/_chunks/{appointment-timeline-Cs5f9viN.js → appointment-timeline-y9uYZMUd.js} +6 -6
- package/dist/_chunks/{appointment-tray-CLrGGnKR.js → appointment-tray-BTecNeSb.js} +4 -4
- package/dist/_chunks/appointment-workflow-status-CS8ufF1f.js +66 -0
- package/dist/_chunks/{audio-recorder-B7dT-Y3v.js → audio-recorder-DZBtAvLH.js} +4 -4
- package/dist/_chunks/{autocomplete-MpBhz-fG.js → autocomplete-DSasZUf6.js} +65 -64
- package/dist/_chunks/{badge-BudgzTe_.js → badge-BAkd6_Pj.js} +24 -17
- package/dist/_chunks/{balance-badge-cell-YGrYdrvR.js → balance-badge-cell-CA0YNJMR.js} +6 -6
- package/dist/_chunks/{bishop-score-Cu70iv9C.js → bishop-score-BMLRvXYF.js} +4 -4
- package/dist/_chunks/{bmi-calculator-C9N19aLX.js → bmi-calculator-DUhRyyrA.js} +3 -3
- package/dist/_chunks/{booking-C4MwImkS.js → booking-BQYFDcrz.js} +10 -10
- package/dist/_chunks/{breadcrumb-agut0PwN.js → breadcrumb-D3boYzD4.js} +50 -49
- package/dist/_chunks/{button-CaUe1uyd.js → button-18oBsI3n.js} +54 -50
- package/dist/_chunks/button-group-BSDqso_C.js +408 -0
- package/dist/_chunks/{calendar-OzSeTb4V.js → calendar-DjoJ9ovF.js} +11 -17
- package/dist/_chunks/{calendar-event-card-B6N5h1dO.js → calendar-event-card-BUbKBPv_.js} +55 -73
- package/dist/_chunks/calendar-workspace-D8zX9JWm.js +10423 -0
- package/dist/_chunks/{care-plan-card-BOv0NRle.js → care-plan-card-ciBaaguw.js} +4 -4
- package/dist/_chunks/{care-plan-entry-card-d-rZD4li.js → care-plan-entry-card-D7A0whiZ.js} +5 -5
- package/dist/_chunks/{care-plan-header-CEmBXn6-.js → care-plan-header-DKV1gLqv.js} +4 -4
- package/dist/_chunks/{carousel.agent-z1yLBpyC.js → carousel.agent-DqDGR2yH.js} +2 -2
- package/dist/_chunks/{chart-D8ucl8hH.js → chart-VjuXDXOZ.js} +3 -3
- package/dist/_chunks/{chat-input-Cj7ZYQr5.js → chat-input-BVho_SqP.js} +2 -2
- package/dist/_chunks/{chat-message-BMVxiUIX.js → chat-message-Co_NRGM4.js} +3 -3
- package/dist/_chunks/{smartphone-DaPcFw-X.js → circle-dashed-CUj6o2cA.js} +3 -14
- package/dist/_chunks/{city-input-DaQc-Hbj.js → city-input-BGYc4lRV.js} +2 -2
- package/dist/_chunks/{clinical-note-card-DdsGYMmI.js → clinical-note-card-DYDQ3q2x.js} +89 -74
- package/dist/_chunks/{code-block-BB-viuTn.js → code-block-C_eNHWaa.js} +2 -2
- package/dist/_chunks/combobox-B_rLwmSv.js +578 -0
- package/dist/_chunks/{command-palette-DQl_SNEv.js → command-palette-DhgGo7GJ.js} +82 -80
- package/dist/_chunks/{connection-status-BmA9T0UO.js → connection-status-Cfux3TvH.js} +4 -4
- package/dist/_chunks/{contact-profile-card-C0WpwpVV.js → contact-profile-card-Dj4NgBL-.js} +3 -3
- package/dist/_chunks/control-room-rail-DAO0qfOI.js +379 -0
- package/dist/_chunks/{copy-field-B8XRVmQv.js → copy-field-Cm4y5Bff.js} +2 -2
- package/dist/_chunks/{country-select-CfDNFG5c.js → country-select-C5jZjO8O.js} +2 -2
- package/dist/_chunks/{cycle-calculator-BH2StWoT.js → cycle-calculator-B9lBRNiZ.js} +3 -3
- package/dist/_chunks/{dashboard-grid-BcXWL5S9.js → dashboard-grid-uX7x1ePj.js} +2 -2
- package/dist/_chunks/{data-table-DnKOmEVw.js → data-table-DWOSxlsy.js} +9 -9
- package/dist/_chunks/{data-table-tabs-B9SXA5VP.js → data-table-tabs-CzYYKp2_.js} +3 -3
- package/dist/_chunks/{dependent-selector-BHDP0nBB.js → dependent-selector-BR_8D2Qu.js} +2 -2
- package/dist/_chunks/{description-list-BsJ_6CQE.js → description-list-1A2DEbE6.js} +2 -2
- package/dist/_chunks/{document-preview-COV0BC6n.js → document-preview-Od2Hz4z5.js} +13 -12
- package/dist/_chunks/{document-scanner-B1abl-A4.js → document-scanner-p0aGlzCy.js} +3 -3
- package/dist/_chunks/{dropdown-menu-DU-Hrf33.js → dropdown-menu-C8PaW3lR.js} +110 -96
- package/dist/_chunks/{due-date-calculator-Buh_mVHq.js → due-date-calculator-BVqJaxzd.js} +4 -4
- package/dist/_chunks/{editable-currency-cell-renderer-OUkUv7U4.js → editable-currency-cell-renderer-D_G2Ap61.js} +4 -4
- package/dist/_chunks/{editable-description-ADMVFPUz.js → editable-description-B4NVdjvd.js} +3 -3
- package/dist/_chunks/{editor-overlay-DwNKaI22.js → editor-overlay-BDiBvQmL.js} +2 -2
- package/dist/_chunks/{empty-state-BUN_UAWf.js → empty-state-DTBZ1ENT.js} +2 -2
- package/dist/_chunks/{entity-card-I-Gio5wo.js → entity-card-D1Yrh9wf.js} +2 -1
- package/dist/_chunks/{entity-summary-DXejuQ8i.js → entity-summary-Ckz_U00H.js} +3 -3
- package/dist/_chunks/{error-boundary-BNT2iQ1w.js → error-boundary-BxTqEXqj.js} +2 -2
- package/dist/_chunks/euro-Dsuz4ixO.js +22 -0
- package/dist/_chunks/{face-scheme-mIhwrQXt.js → face-scheme-fku-RShg.js} +71 -71
- package/dist/_chunks/{fetal-weight-wx4ycKc6.js → fetal-weight-B69yOS9W.js} +3 -3
- package/dist/_chunks/{field-array-BW9KeeXG.js → field-array-lIXrFWS0.js} +3 -3
- package/dist/_chunks/file-BuG1VMAy.js +21 -0
- package/dist/_chunks/{file-Cwe9VC1A.js → file-image-cDgE-BTy.js} +2 -19
- package/dist/_chunks/{file-manager-DOcJGIx2.js → file-manager-CqgxLqoA.js} +15 -14
- package/dist/_chunks/{file-upload-BDpb08GM.js → file-upload-B242a_Y1.js} +53 -52
- package/dist/_chunks/{finished-terminal-DJd7Z_po.js → finished-terminal-B2oqXO0Y.js} +2 -2
- package/dist/_chunks/fiscal-code-input-BEF8eKIG.js +572 -0
- package/dist/_chunks/{freemium-paywall-BaW5ODc9.js → freemium-paywall-B6JITu4l.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CwbecTul.js → gestational-age-calculator-DsGN6_HS.js} +5 -5
- package/dist/_chunks/handled-rejection-6gqCf5vt.js +13 -0
- package/dist/_chunks/{hcg-doubling-BcXriXJe.js → hcg-doubling-D2SH-e7t.js} +3 -3
- package/dist/_chunks/{header-3o9o9v_T.js → header-CCjp5GvE.js} +2 -2
- package/dist/_chunks/{header-settings-BEfx_-TF.js → header-settings-ZXa6hXuu.js} +5 -5
- package/dist/_chunks/{help-me-write-templates-DHIwa4xR.js → help-me-write-templates-DQtT1qs_.js} +5 -5
- package/dist/_chunks/history-CK2JaU2g.js +16 -0
- package/dist/_chunks/{hover-card-nUae8NPJ.js → hover-card-BplP5SzQ.js} +2 -2
- package/dist/_chunks/{icon-button-CehAeZoP.js → icon-button-CY7GU_Se.js} +2 -2
- package/dist/_chunks/icon-button-group-B_426QN_.js +431 -0
- package/dist/_chunks/{icon-picker-DMEelg9v.js → icon-picker-ZLebyB0U.js} +3 -3
- package/dist/_chunks/{image-cropper-BjPjT7wU.js → image-cropper-_HiNN79d.js} +2 -2
- package/dist/_chunks/{info-tip-iP2Pm9dh.js → info-tip-laBxZhKu.js} +2 -2
- package/dist/_chunks/{insert-result-DPnOBD85.js → insert-result-CSuPQyKL.js} +2 -2
- package/dist/_chunks/{key-value-pair-DaQI_LZB.js → key-value-pair-Dcdl3Gni.js} +2 -2
- package/dist/_chunks/{kit-extensions-DuoFF1R3.js → kit-extensions-BTJSnM_H.js} +6 -6
- package/dist/_chunks/{link-cell-renderer-s3oHzOwi.js → link-cell-renderer-Tswqf6BT.js} +7 -7
- package/dist/_chunks/{locale-picker-CH3kfrIG.js → locale-picker-DGkQmhV9.js} +170 -180
- package/dist/_chunks/{map-view-CHw4RL6w.js → map-view-Bb7ClKSF.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-PB89Dkk_.js → marketplace-app-shell-Dehuxbi-.js} +6 -6
- package/dist/_chunks/menu-row-BAr8bx1I.js +95 -0
- package/dist/_chunks/{message-card-V3sFPiQI.js → message-card-DKOtnBHy.js} +3 -3
- package/dist/_chunks/{message-tray-CrRIHfiQ.js → message-tray-COMEtmyr.js} +4 -4
- package/dist/_chunks/{multi-select-CtPd7g4x.js → multi-select-N4Smh-gj.js} +114 -113
- package/dist/_chunks/{muscle-scheme-UVz_x4iE.js → muscle-scheme-Co0NIgbU.js} +3 -3
- package/dist/_chunks/{note-attachment-CwDir3kK.js → note-attachment-CGjNTrAC.js} +2 -2
- package/dist/_chunks/{note-timeline-Dn_XTo1s.js → note-timeline-CVnKL0p6.js} +2 -2
- package/dist/_chunks/notes-panel-BiOxZL_0.js +1111 -0
- package/dist/_chunks/{notification-card-B2gLO6dK.js → notification-card-DDzBCi8l.js} +3 -3
- package/dist/_chunks/{notification-tray-BOEKegVV.js → notification-tray-PnH2PBlZ.js} +4 -4
- package/dist/_chunks/{operator-hero-XIdwDmN2.js → operator-hero-5061fkY5.js} +3 -3
- package/dist/_chunks/{optical-prescription-LGgmtcST.js → optical-prescription-DUufWXfZ.js} +3 -3
- package/dist/_chunks/{pagination-EkD5SiCK.js → pagination-B0N2qGy_.js} +83 -82
- package/dist/_chunks/panel-subview-CzHutkA8.js +217 -0
- package/dist/_chunks/{patient-details-yrgkSeEY.js → patient-details-C23Hdm8v.js} +3 -3
- package/dist/_chunks/{patient-field-row-DCMkFGqI.js → patient-field-row-DElFbpKc.js} +12 -12
- package/dist/_chunks/{patient-search-5QcmQKJD.js → patient-search-DgXdGkhK.js} +4 -4
- package/dist/_chunks/{patient-summary-card-CmEFflGS.js → patient-summary-card-C36L3h7h.js} +7 -7
- package/dist/_chunks/{payment-automation-upsell-BKmBXU4i.js → payment-automation-upsell-ugi4np1l.js} +3 -3
- package/dist/_chunks/{payment-request-card-Cer6XXCn.js → payment-request-card-DMJB57Tv.js} +5 -5
- package/dist/_chunks/{periodontal-chart-DJoZS_o7.js → periodontal-chart-DbGzKDj7.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-Nd1ZoYWb.js → periodontal-chart-card-DvHyP47v.js} +3 -3
- package/dist/_chunks/{periodontal-diagnosis-C7pfPOct.js → periodontal-diagnosis-B8WqI0eU.js} +2 -2
- package/dist/_chunks/{periodontal-risk-chart-B2tNFa15.js → periodontal-risk-chart-DsFRFFSz.js} +2 -2
- package/dist/_chunks/{phone-input-IWrGOCwm.js → phone-input-sQj-zi59.js} +85 -86
- package/dist/_chunks/{popover-DO-pssF3.js → popover-Dvb40vPH.js} +2 -2
- package/dist/_chunks/{practice-profile-hero-DxoLlQr5.js → practice-profile-hero-CPy5h2yI.js} +2 -2
- package/dist/_chunks/{practice-results-D11Zpt27.js → practice-results-t2BHht91.js} +7 -7
- package/dist/_chunks/{pregnancy-dating-DcyV9ZRD.js → pregnancy-dating-lfjjZVZH.js} +5 -5
- package/dist/_chunks/{pregnancy-weight-gain-Bfq4Kwt5.js → pregnancy-weight-gain-WpNt-S0q.js} +3 -3
- package/dist/_chunks/{privacy-lock-CbFCAMM3.js → privacy-lock-D6gq0GDg.js} +3 -3
- package/dist/_chunks/privacy-mask-BC5lw2zB.js +81 -0
- package/dist/_chunks/{product-hub-panel-w40-_-1s.js → product-hub-panel-CKeSCSeE.js} +3 -3
- package/dist/_chunks/{province-select-BaUnkg4S.js → province-select-BiszMRRY.js} +2 -2
- package/dist/_chunks/{public-header.agent-D-EBVskf.js → public-header.agent-B9wDmUeB.js} +3 -3
- package/dist/_chunks/{radiograph-panel.agent-LrILY2lN.js → radiograph-panel.agent-TmyIvTOa.js} +6 -6
- package/dist/_chunks/{reviews-panel-2GVuxGeT.js → reviews-panel-BdwFp_0c.js} +4 -4
- package/dist/_chunks/{rich-text-editor-BwDV2XkZ.js → rich-text-editor-y6ML0KeV.js} +12 -11
- package/dist/_chunks/{search-bar-CCmViqaa.js → search-bar-6bHatpYJ.js} +69 -67
- package/dist/_chunks/{select-CLSUnKjF.js → select-upNAltly.js} +89 -88
- package/dist/_chunks/{session-countdown-BqppPrw6.js → session-countdown-ACJyTXH2.js} +2 -2
- package/dist/_chunks/{sheet-C8WIDFS8.js → sheet-D0Lh0KR2.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-DWwBJtyE.js → sign-in-with-alfadocs-button-CDyJAIzW.js} +2 -2
- package/dist/_chunks/{signature-request-D_j2aQu1.js → signature-request-15D363w5.js} +6 -6
- package/dist/_chunks/{signature-status-chip-D4NsrdeI.js → signature-status-chip-Dz6sS2oA.js} +2 -2
- package/dist/_chunks/{slot-grid-B3eOPkKD.js → slot-grid-4fWH3Euk.js} +4 -4
- package/dist/_chunks/smartphone-C0rFF2if.js +15 -0
- package/dist/_chunks/{streaming-text-CE1u_oGa.js → streaming-text-eRiizArc.js} +2 -2
- package/dist/_chunks/{tab-bar-Cw9UK18Z.js → tab-bar-BHFf6knq.js} +9 -9
- package/dist/_chunks/{tabs-BnRaLT0y.js → tabs-CFsuMQ5H.js} +82 -81
- package/dist/_chunks/{tag-Ci3xJPcH.js → tag-B65tLWvD.js} +24 -21
- package/dist/_chunks/{task-card-qTKD1fIT.js → task-card-CTTQfPS6.js} +72 -55
- package/dist/_chunks/task-editor-DlvTwAfv.js +1243 -0
- package/dist/_chunks/{task-tray-DIwjAIes.js → task-tray-JA-qp_pB.js} +4 -4
- package/dist/_chunks/tasks-panel-C_dVDQKJ.js +1243 -0
- package/dist/_chunks/{theme-toggle-BP0XRGMM.js → theme-toggle-LUBxlNDm.js} +4 -4
- package/dist/_chunks/{toast-ZZfhA5u0.js → toast-CT8hjr9r.js} +2 -2
- package/dist/_chunks/{token-insert-menu-A9B5AJw6.js → token-insert-menu-klwbxVKh.js} +3 -3
- package/dist/_chunks/{tool-rail-CCFqDfAn.js → tool-rail-DEeX4PdN.js} +144 -137
- package/dist/_chunks/{tooth-scheme-DPAq0vQK.js → tooth-scheme-BkjhkI8g.js} +4 -4
- package/dist/_chunks/{treatment-receipt-DU0OewqH.js → treatment-receipt-C-gWZ6uv.js} +3 -3
- package/dist/_chunks/{unit-converter-C-LpGzrN.js → unit-converter-Dp_KDxE6.js} +3 -3
- package/dist/_chunks/use-appointment-details-read-D2FH-cHF.js +2045 -0
- package/dist/_chunks/use-list-reflow-C7O4Uqnl.js +133 -0
- package/dist/_chunks/use-priority-overflow-Cdmb5EiR.js +108 -0
- package/dist/_chunks/{variables-menu-vXUaSBj4.js → variables-menu-aJLKJ_cu.js} +127 -136
- package/dist/_chunks/{warning-stack-C0glSB7p.js → warning-stack-CEgYkI1z.js} +3 -3
- package/dist/_chunks/{widget-picker-B1sj6uyf.js → widget-picker-CilQvcNL.js} +2 -2
- package/dist/_chunks/{workflow-map-DhR_h5yw.js → workflow-map-qGkQTNvS.js} +30 -29
- package/dist/_chunks/{workflow-status-CuJAOuKL.js → workflow-status-ClHfz4Kr.js} +209 -167
- package/dist/agent-catalog.json +371 -26
- package/dist/agent-i18n/en.json +41 -9
- package/dist/components/_shared/appointment-format.d.ts +52 -0
- package/dist/{patterns/calendar/calendar-editor-fields.d.ts → components/_shared/compact-editor-fields.d.ts} +6 -5
- package/dist/components/_shared/handled-rejection.d.ts +2 -0
- package/dist/components/_shared/menu-row.d.ts +17 -0
- package/dist/components/_shared/patient-identity.d.ts +7 -0
- package/dist/components/_shared/patient-picker.d.ts +24 -0
- package/dist/components/_shared/privacy-mask.d.ts +29 -0
- package/dist/components/address-autocomplete/index.js +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-credits-notice/index.js +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/anamnesis-summary-card/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-details-panel/appointment-details-panel.agent.d.ts +4 -0
- package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +134 -0
- package/dist/components/appointment-details-panel/appointment-details-panel.focus.d.ts +7 -0
- package/dist/components/appointment-details-panel/appointment-details-panel.history.d.ts +12 -0
- package/dist/components/appointment-details-panel/appointment-details-panel.identity.d.ts +41 -0
- package/dist/{patterns/calendar/calendar-info-hover.d.ts → components/appointment-details-panel/appointment-details-panel.info-hover.d.ts} +1 -1
- package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +51 -0
- package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +326 -0
- package/dist/components/appointment-details-panel/index.d.ts +8 -0
- package/dist/components/appointment-details-panel/index.js +8 -0
- package/dist/components/appointment-details-panel/use-appointment-details-read.d.ts +32 -0
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button-group/button-group.d.ts +19 -2
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/calendar.d.ts +5 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +13 -5
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts +9 -4
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/connection-status/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/control-room-rail.d.ts +14 -3
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/dashboard-grid/index.js +1 -1
- package/dist/components/data-table/index.js +4 -4
- package/dist/components/data-table-tabs/index.js +1 -1
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/editable-description/index.js +1 -1
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/error-boundary/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/field-array/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/fiscal-code-input/fiscal-code-input.d.ts +7 -0
- package/dist/components/fiscal-code-input/index.d.ts +1 -1
- package/dist/components/fiscal-code-input/index.js +8 -7
- package/dist/components/fiscal-code-input/is-valid-codice-fiscale.d.ts +19 -4
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/info-tip/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/notes-panel/index.d.ts +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +102 -26
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/panel-subview/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/periodontal-diagnosis/index.js +1 -1
- package/dist/components/periodontal-risk-chart/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +2 -2
- package/dist/components/search-bar/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-field/signature-field.d.ts +1 -1
- package/dist/components/signature-status-chip/index.js +1 -1
- package/dist/components/skeleton-scheme/index.js +17 -17
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-card/task-card.d.ts +6 -0
- package/dist/components/task-editor/index.d.ts +4 -0
- package/dist/components/task-editor/index.js +6 -0
- package/dist/components/task-editor/task-editor.agent.d.ts +4 -0
- package/dist/components/task-editor/task-editor.d.ts +240 -0
- package/dist/components/task-editor/use-task-editor-form.d.ts +101 -0
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.d.ts +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/tasks-panel/tasks-panel.d.ts +84 -12
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/token-insert-menu/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/treatment-receipt/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/variables-menu/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/widget-picker/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/components/workflow-status/appointment-workflow-status.d.ts +55 -0
- package/dist/components/workflow-status/index.d.ts +2 -0
- package/dist/components/workflow-status/index.js +7 -2
- package/dist/components/workflow-status/workflow-status.d.ts +35 -0
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/use-exit-transition.d.ts +5 -0
- package/dist/hooks/use-priority-overflow.d.ts +11 -2
- package/dist/host-compat.css +7 -1
- package/dist/i18n/locales/ar.d.ts +29 -10
- package/dist/i18n/locales/ar.js +33 -14
- package/dist/i18n/locales/de.d.ts +29 -10
- package/dist/i18n/locales/de.js +33 -14
- package/dist/i18n/locales/el.d.ts +29 -10
- package/dist/i18n/locales/el.js +33 -14
- package/dist/i18n/locales/en.d.ts +29 -10
- package/dist/i18n/locales/en.js +33 -14
- package/dist/i18n/locales/es.d.ts +29 -10
- package/dist/i18n/locales/es.js +33 -14
- package/dist/i18n/locales/fr.d.ts +29 -10
- package/dist/i18n/locales/fr.js +33 -14
- package/dist/i18n/locales/hi.d.ts +29 -10
- package/dist/i18n/locales/hi.js +33 -14
- package/dist/i18n/locales/it.d.ts +29 -10
- package/dist/i18n/locales/it.js +33 -14
- package/dist/i18n/locales/ja.d.ts +29 -10
- package/dist/i18n/locales/ja.js +33 -14
- package/dist/i18n/locales/nl.d.ts +29 -10
- package/dist/i18n/locales/nl.js +33 -14
- package/dist/i18n/locales/pl.d.ts +29 -10
- package/dist/i18n/locales/pl.js +33 -14
- package/dist/i18n/locales/pt.d.ts +29 -10
- package/dist/i18n/locales/pt.js +33 -14
- package/dist/i18n/locales/ro.d.ts +29 -10
- package/dist/i18n/locales/ro.js +33 -14
- package/dist/i18n/locales/ru.d.ts +29 -10
- package/dist/i18n/locales/ru.js +33 -14
- package/dist/i18n/locales/sq.d.ts +29 -10
- package/dist/i18n/locales/sq.js +33 -14
- package/dist/i18n/locales/sv.d.ts +29 -10
- package/dist/i18n/locales/sv.js +33 -14
- package/dist/i18n/locales/tr.d.ts +29 -10
- package/dist/i18n/locales/tr.js +33 -14
- package/dist/i18n/locales/zh.d.ts +29 -10
- package/dist/i18n/locales/zh.js +33 -14
- package/dist/i18n/registerUiBundle.d.ts +5 -9
- package/dist/index.js +742 -728
- package/dist/locales/ar.json +33 -14
- package/dist/locales/de.json +33 -14
- package/dist/locales/el.json +33 -14
- package/dist/locales/en.json +33 -14
- package/dist/locales/es.json +33 -14
- package/dist/locales/fr.json +33 -14
- package/dist/locales/hi.json +33 -14
- package/dist/locales/it.json +33 -14
- package/dist/locales/ja.json +33 -14
- package/dist/locales/nl.json +33 -14
- package/dist/locales/pl.json +33 -14
- package/dist/locales/pt.json +33 -14
- package/dist/locales/ro.json +33 -14
- package/dist/locales/ru.json +33 -14
- package/dist/locales/sq.json +33 -14
- package/dist/locales/sv.json +33 -14
- package/dist/locales/tr.json +33 -14
- package/dist/locales/zh.json +33 -14
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.d.ts +25 -95
- package/dist/patterns/calendar/calendar-patient-picker.d.ts +4 -3
- package/dist/patterns/calendar/calendar-privacy.d.ts +1 -22
- package/dist/patterns/calendar/calendar-sticky-offset.d.ts +20 -13
- package/dist/patterns/calendar/calendar-task-editor.d.ts +9 -13
- package/dist/patterns/calendar/calendar-workspace.d.ts +79 -8
- package/dist/patterns/calendar/calendar-workspace.model.d.ts +17 -12
- package/dist/patterns/calendar/calendar.journey.d.ts +40 -6
- package/dist/patterns/calendar/calendar.model.d.ts +10 -17
- package/dist/patterns/calendar/calendar.sheets.d.ts +18 -16
- package/dist/patterns/calendar/calendar.types.d.ts +24 -100
- package/dist/patterns/calendar/index.d.ts +4 -3
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +22 -5
- package/dist/_chunks/button-group-CA1tmu39.js +0 -325
- package/dist/_chunks/calendar-workspace-BmscntRR.js +0 -12528
- package/dist/_chunks/combobox-DnSdYssy.js +0 -522
- package/dist/_chunks/control-room-rail-CdBOXIqX.js +0 -366
- package/dist/_chunks/fiscal-code-input-ODQRd_Sw.js +0 -553
- package/dist/_chunks/icon-button-group-DZKC6KGf.js +0 -428
- package/dist/_chunks/notes-panel-CHbDDMx8.js +0 -683
- package/dist/_chunks/panel-subview-CYnuX-KR.js +0 -171
- package/dist/_chunks/tasks-panel-DncuBPIZ.js +0 -844
- package/dist/_chunks/use-list-reflow-Cw43nxw5.js +0 -100
- package/dist/_chunks/use-priority-overflow-c9SjxZkZ.js +0 -101
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +0 -37
|
@@ -0,0 +1,1243 @@
|
|
|
1
|
+
import { jsx as o, jsxs as k, Fragment as De } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useRef as C, useEffect as $e, forwardRef as Rt, useId as At, useMemo as Fe } from "react";
|
|
3
|
+
import { c as ft } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as gt } from "react-i18next";
|
|
5
|
+
import { A as M } from "./alert-CiQ5Pa3Q.js";
|
|
6
|
+
import { B as Me } from "./button-18oBsI3n.js";
|
|
7
|
+
import { I as We } from "./icon-button-CY7GU_Se.js";
|
|
8
|
+
import { C as Qe } from "./combobox-B_rLwmSv.js";
|
|
9
|
+
import { D as ce } from "./dialog-BJiLqhx6.js";
|
|
10
|
+
import { D as Bt } from "./date-picker-6tFnKFty.js";
|
|
11
|
+
import { F as H } from "./form-field-CahJzTxp.js";
|
|
12
|
+
import { I as Ft } from "./icon-button-group-B_426QN_.js";
|
|
13
|
+
import { P as Pt } from "./panel-header-D_mTdhUp.js";
|
|
14
|
+
import { P as Ot } from "./panel-subview-CzHutkA8.js";
|
|
15
|
+
import { R as Pe } from "./radio-6fml-pWk.js";
|
|
16
|
+
import { R as jt } from "./radio-group-CIjmyioi.js";
|
|
17
|
+
import { S as Mt } from "./scroll-area-BZOvUhwQ.js";
|
|
18
|
+
import { S as Ke } from "./select-upNAltly.js";
|
|
19
|
+
import { S as He } from "./skeleton-B1KTdJ4N.js";
|
|
20
|
+
import { S as $t } from "./switch-OILsBLWo.js";
|
|
21
|
+
import { T as zt } from "./text-area-Bt3p7Pt0.js";
|
|
22
|
+
import { T as Oe } from "./text-input-CUvCb6ST.js";
|
|
23
|
+
import { T as qt } from "./time-picker-D0RS391l.js";
|
|
24
|
+
import { u as Vt } from "./registry-DvAUVLHh.js";
|
|
25
|
+
import { u as Lt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
26
|
+
import { c as Ut } from "./compose-refs-C0k0tdqF.js";
|
|
27
|
+
import { n as Wt } from "./normalize-diacritics-BNGbFNlJ.js";
|
|
28
|
+
import { p as Kt, P as Ht } from "./privacy-mask-BC5lw2zB.js";
|
|
29
|
+
import { g as je, h as Gt } from "./handled-rejection-6gqCf5vt.js";
|
|
30
|
+
import { L as Qt } from "./lock-ClAFG1gy.js";
|
|
31
|
+
import { X as Yt } from "./x-B5YnXwCz.js";
|
|
32
|
+
import { c as vt } from "./createLucideIcon-DhHxpK9K.js";
|
|
33
|
+
import { U as Xt } from "./user-B12p7bVF.js";
|
|
34
|
+
import { B as Jt } from "./building-2-D33bLCWL.js";
|
|
35
|
+
import { S as Zt } from "./stethoscope-sZXGC43m.js";
|
|
36
|
+
import { T as dt } from "./trash-2-uumy3fy1.js";
|
|
37
|
+
import { S as ct } from "./square-check-big-dj0o8yA3.js";
|
|
38
|
+
import { L as eo } from "./loader-circle-BECIU_8N.js";
|
|
39
|
+
/**
|
|
40
|
+
* @license lucide-react v1.22.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/
|
|
45
|
+
const to = [
|
|
46
|
+
["path", { d: "m2 2 20 20", key: "1ooewy" }],
|
|
47
|
+
["path", { d: "M8.35 2.69A10 10 0 0 1 21.3 15.65", key: "1pfsoa" }],
|
|
48
|
+
["path", { d: "M19.08 19.08A10 10 0 1 1 4.92 4.92", key: "1ablyi" }]
|
|
49
|
+
], oo = vt("circle-off", to);
|
|
50
|
+
/**
|
|
51
|
+
* @license lucide-react v1.22.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/
|
|
56
|
+
const no = [
|
|
57
|
+
[
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
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",
|
|
61
|
+
key: "1c8476"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
65
|
+
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
66
|
+
], ao = vt("save", no), ro = [
|
|
67
|
+
"ds:[&_:is([data-component=select][role=combobox],[data-component=text-input],[data-component=text-input]_input,[data-component=date-picker]_input,[data-component=combobox],[data-component=time-picker])]:h-8",
|
|
68
|
+
"ds:[&_:is([data-component=select][role=combobox],[data-component=text-input],[data-component=text-input]_input,[data-component=date-picker]_input,[data-component=combobox],[data-component=time-picker])]:rounded-[var(--radius-md)]",
|
|
69
|
+
"ds:[.theme-accessible_&_:is([data-component=select][role=combobox],[data-component=text-input],[data-component=text-input]_input,[data-component=date-picker]_input,[data-component=combobox],[data-component=time-picker])]:[min-block-size:var(--min-target-size)]",
|
|
70
|
+
"ds:max-sm:[&_:is([data-component=select][role=combobox],[data-component=text-input],[data-component=text-input]_input,[data-component=date-picker]_input,[data-component=combobox],[data-component=time-picker])]:[min-block-size:var(--min-target-size)]",
|
|
71
|
+
/* Multi-line notes keep their height but share the corners. */
|
|
72
|
+
"ds:[&_[data-component=text-area]_textarea]:rounded-[var(--radius-md)]",
|
|
73
|
+
/* The time field's hour and minute segments are 32px at the kit default;
|
|
74
|
+
inside a 32px box they take the kit's `sm` segment height instead,
|
|
75
|
+
and get the default back wherever the field is raised. */
|
|
76
|
+
"ds:[&_[data-component=time-picker]_[role=spinbutton]]:h-6",
|
|
77
|
+
"ds:[.theme-accessible_&_[data-component=time-picker]_[role=spinbutton]]:h-8",
|
|
78
|
+
"ds:max-sm:[&_[data-component=time-picker]_[role=spinbutton]]:h-8"
|
|
79
|
+
].join(" "), io = [
|
|
80
|
+
"ds:h-8 ds:[&_[role=radio]]:min-h-0",
|
|
81
|
+
"ds:[.theme-accessible_&]:h-auto ds:[.theme-accessible_&_[role=radio]]:min-h-[var(--min-target-size)]",
|
|
82
|
+
"ds:max-sm:h-auto ds:max-sm:[&_[role=radio]]:min-h-[var(--min-target-size)]"
|
|
83
|
+
].join(" ");
|
|
84
|
+
function so({
|
|
85
|
+
patients: n = [],
|
|
86
|
+
searchPatients: c,
|
|
87
|
+
...I
|
|
88
|
+
}) {
|
|
89
|
+
if (c)
|
|
90
|
+
return /* @__PURE__ */ o(co, { ...I, searchPatients: c });
|
|
91
|
+
const { value: y, onValueChange: B, selectedLabel: R, placeholder: Y, size: x, disabled: X } = I;
|
|
92
|
+
return /* @__PURE__ */ o(
|
|
93
|
+
Qe,
|
|
94
|
+
{
|
|
95
|
+
value: y,
|
|
96
|
+
onValueChange: B,
|
|
97
|
+
options: [
|
|
98
|
+
...y && !n.some((D) => D.id === y) ? [{ value: y, label: R ?? "" }] : [],
|
|
99
|
+
...n.map((D) => ({ value: D.id, label: D.name }))
|
|
100
|
+
],
|
|
101
|
+
placeholder: Y,
|
|
102
|
+
size: x,
|
|
103
|
+
disabled: X,
|
|
104
|
+
clearable: !0
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function co({
|
|
109
|
+
value: n,
|
|
110
|
+
onValueChange: c,
|
|
111
|
+
selectedLabel: I,
|
|
112
|
+
placeholder: y,
|
|
113
|
+
size: B,
|
|
114
|
+
disabled: R,
|
|
115
|
+
searchPatients: Y
|
|
116
|
+
}) {
|
|
117
|
+
const { t: x } = gt(), [X, D] = $(""), [J, Z] = $(0), [F, se] = $(), [_, ee] = $(), q = C(null), P = X.trim();
|
|
118
|
+
$e(() => {
|
|
119
|
+
if (!P) return;
|
|
120
|
+
const m = new AbortController(), S = { query: P, source: Y };
|
|
121
|
+
ee({ ...S, status: "loading", patients: [] });
|
|
122
|
+
const le = setTimeout(() => {
|
|
123
|
+
Promise.resolve().then(() => Y(P, { signal: m.signal })).then(
|
|
124
|
+
(ne) => {
|
|
125
|
+
m.signal.aborted || ee({ ...S, status: "ready", patients: ne });
|
|
126
|
+
},
|
|
127
|
+
() => {
|
|
128
|
+
m.signal.aborted || ee({ ...S, status: "error", patients: [] });
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}, 250);
|
|
132
|
+
return () => {
|
|
133
|
+
clearTimeout(le), m.abort();
|
|
134
|
+
};
|
|
135
|
+
}, [P, Y, J]);
|
|
136
|
+
const V = (_ == null ? void 0 : _.query) === P && _.source === Y, L = P ? V ? _.status : "loading" : "idle", te = V && L === "ready" ? _.patients : [], oe = L === "loading" ? x("inputs.search.loading") : L === "error" ? x("emptyState.error.description") : L === "idle" ? y : te.length === 0 ? x("inputs.combobox.empty") : "", O = te.map((m) => ({
|
|
137
|
+
value: m.id,
|
|
138
|
+
label: m.name
|
|
139
|
+
}));
|
|
140
|
+
return n && !te.some((m) => m.id === n) && O.push({
|
|
141
|
+
value: n,
|
|
142
|
+
label: (F == null ? void 0 : F.id) === n ? F.name : I ?? ""
|
|
143
|
+
}), /* @__PURE__ */ k(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
147
|
+
"data-component": "patient-picker",
|
|
148
|
+
"data-status": L,
|
|
149
|
+
children: [
|
|
150
|
+
/* @__PURE__ */ o(
|
|
151
|
+
Qe,
|
|
152
|
+
{
|
|
153
|
+
ref: q,
|
|
154
|
+
options: O,
|
|
155
|
+
value: n,
|
|
156
|
+
onValueChange: (m) => {
|
|
157
|
+
se(
|
|
158
|
+
(S) => te.find((le) => le.id === m) ?? ((S == null ? void 0 : S.id) === m ? S : void 0)
|
|
159
|
+
), c(m);
|
|
160
|
+
},
|
|
161
|
+
onQueryChange: D,
|
|
162
|
+
onOpenChange: (m) => {
|
|
163
|
+
!m && L !== "error" && D("");
|
|
164
|
+
},
|
|
165
|
+
filter: (m) => !P || te.some((S) => Wt(S.id) === m) ? 1 : 0,
|
|
166
|
+
size: B,
|
|
167
|
+
disabled: R,
|
|
168
|
+
placeholder: y,
|
|
169
|
+
emptyMessage: oe || void 0,
|
|
170
|
+
clearable: !0
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ o("p", { role: "status", className: "type-body-sm ds:text-muted-foreground", children: oe }),
|
|
174
|
+
L === "error" ? /* @__PURE__ */ o(
|
|
175
|
+
Me,
|
|
176
|
+
{
|
|
177
|
+
size: "sm",
|
|
178
|
+
intent: "ghost",
|
|
179
|
+
onClick: () => {
|
|
180
|
+
var m;
|
|
181
|
+
Z((S) => S + 1), (m = q.current) == null || m.focus();
|
|
182
|
+
},
|
|
183
|
+
children: x("emptyState.error.cta")
|
|
184
|
+
}
|
|
185
|
+
) : null
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
const lo = {
|
|
191
|
+
id: "task-editor",
|
|
192
|
+
// set_value backs set_fields and set_done; submit backs save; dismiss
|
|
193
|
+
// backs cancel.
|
|
194
|
+
capabilities: ["set_value", "submit", "dismiss"],
|
|
195
|
+
state: {
|
|
196
|
+
status: {
|
|
197
|
+
type: "'loading' | 'ready' | 'error' | 'locked' | 'withheld'",
|
|
198
|
+
descriptionKey: "ui.agent.taskEditor.state.status",
|
|
199
|
+
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'.",
|
|
200
|
+
read: (n) => n.getStatus()
|
|
201
|
+
},
|
|
202
|
+
draft: {
|
|
203
|
+
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 }",
|
|
204
|
+
descriptionKey: "ui.agent.taskEditor.state.draft",
|
|
205
|
+
description: "The draft as Save would send it: ids and structure only, never the note body. done is the last value the host confirmed.",
|
|
206
|
+
read: (n) => n.getDraft()
|
|
207
|
+
},
|
|
208
|
+
canSave: {
|
|
209
|
+
type: "boolean",
|
|
210
|
+
descriptionKey: "ui.agent.taskEditor.state.canSave",
|
|
211
|
+
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.",
|
|
212
|
+
read: (n) => n.canSave()
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
actions: {
|
|
216
|
+
set_fields: {
|
|
217
|
+
safety: "phi",
|
|
218
|
+
argsType: "{ dateIso?: string; note?: string; typeId?: string; assigneeId?: string | null; about?: 'nobody' | 'patient' | 'company' | 'operator'; patientId?: string; companyId?: string; operatorId?: string }",
|
|
219
|
+
argsSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
dateIso: { type: "string", format: "date-time" },
|
|
223
|
+
note: { type: "string" },
|
|
224
|
+
typeId: { type: "string" },
|
|
225
|
+
assigneeId: { type: ["string", "null"] },
|
|
226
|
+
about: {
|
|
227
|
+
type: "string",
|
|
228
|
+
enum: ["nobody", "patient", "company", "operator"]
|
|
229
|
+
},
|
|
230
|
+
patientId: { type: "string" },
|
|
231
|
+
companyId: { type: "string" },
|
|
232
|
+
operatorId: { type: "string" }
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
idempotent: !0,
|
|
236
|
+
errors: [
|
|
237
|
+
"An id the host lists, its patient search or the stored task do not resolve.",
|
|
238
|
+
"More than one of patientId, companyId and operatorId.",
|
|
239
|
+
"The form is not ready, is read-only or is withheld."
|
|
240
|
+
],
|
|
241
|
+
descriptionKey: "ui.agent.taskEditor.actions.setFields",
|
|
242
|
+
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.",
|
|
243
|
+
invoke: (n, c) => {
|
|
244
|
+
n.setFields(c);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
save: {
|
|
248
|
+
safety: "phi",
|
|
249
|
+
// Reaches the host's data source; the result is the host's promise.
|
|
250
|
+
openWorld: !0,
|
|
251
|
+
descriptionKey: "ui.agent.taskEditor.actions.save",
|
|
252
|
+
description: "Save the task through the host. Resolves once the write lands and rejects with the host error, which the form also shows.",
|
|
253
|
+
invoke: (n) => n.save()
|
|
254
|
+
},
|
|
255
|
+
set_done: {
|
|
256
|
+
safety: "write",
|
|
257
|
+
argsType: "{ done: boolean }",
|
|
258
|
+
argsSchema: {
|
|
259
|
+
type: "object",
|
|
260
|
+
properties: { done: { type: "boolean" } },
|
|
261
|
+
required: ["done"]
|
|
262
|
+
},
|
|
263
|
+
openWorld: !0,
|
|
264
|
+
errors: [
|
|
265
|
+
"The form is not ready, is read-only or has no Done seam.",
|
|
266
|
+
"A save, a delete or another Done change is in flight.",
|
|
267
|
+
"The task was already saved or deleted in this session."
|
|
268
|
+
],
|
|
269
|
+
descriptionKey: "ui.agent.taskEditor.actions.setDone",
|
|
270
|
+
description: "Mark an existing task done or not done through the host. A rejection rolls the switch back.",
|
|
271
|
+
invoke: (n, c) => n.setDone(c.done)
|
|
272
|
+
},
|
|
273
|
+
delete: {
|
|
274
|
+
safety: "destructive",
|
|
275
|
+
idempotent: !0,
|
|
276
|
+
openWorld: !0,
|
|
277
|
+
descriptionKey: "ui.agent.taskEditor.actions.delete",
|
|
278
|
+
description: "Delete the task through the host, without the confirmation dialog. Resolves once the delete lands.",
|
|
279
|
+
invoke: (n) => n.deleteTask()
|
|
280
|
+
},
|
|
281
|
+
cancel: {
|
|
282
|
+
safety: "destructive",
|
|
283
|
+
errors: ["A save or delete is in flight: wait for it to settle."],
|
|
284
|
+
descriptionKey: "ui.agent.taskEditor.actions.cancel",
|
|
285
|
+
description: "Close the editor without saving. Anything typed since the last save is lost. Refused while a save or delete is in flight.",
|
|
286
|
+
invoke: (n) => {
|
|
287
|
+
n.cancel();
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
domHooks: {
|
|
292
|
+
root: {
|
|
293
|
+
attr: "data-component",
|
|
294
|
+
value: "task-editor",
|
|
295
|
+
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."
|
|
296
|
+
},
|
|
297
|
+
instanceId: {
|
|
298
|
+
attr: "data-component-id",
|
|
299
|
+
sourceProp: "id",
|
|
300
|
+
description: "Sourced from the id prop, or generated. Addresses one editor from the agent. [data-component-id] reaches the footer actions in both variants."
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}, z = "none", lt = {
|
|
304
|
+
showError: !1,
|
|
305
|
+
saving: !1,
|
|
306
|
+
saveError: void 0,
|
|
307
|
+
done: !1,
|
|
308
|
+
confirmedDone: !1,
|
|
309
|
+
donePending: !1,
|
|
310
|
+
doneError: void 0,
|
|
311
|
+
deleting: !1,
|
|
312
|
+
deleteError: void 0,
|
|
313
|
+
confirmDeleteOpen: !1,
|
|
314
|
+
accepted: !1
|
|
315
|
+
};
|
|
316
|
+
function uo(n) {
|
|
317
|
+
return n.patientId ? "patient" : n.companyId ? "company" : n.operatorId ? "operator" : "nobody";
|
|
318
|
+
}
|
|
319
|
+
function Ye(n) {
|
|
320
|
+
return { hours: n.getHours(), minutes: n.getMinutes() };
|
|
321
|
+
}
|
|
322
|
+
function ut(n) {
|
|
323
|
+
const c = n ?? /* @__PURE__ */ new Date();
|
|
324
|
+
return {
|
|
325
|
+
date: c,
|
|
326
|
+
time: Ye(c),
|
|
327
|
+
note: "",
|
|
328
|
+
operatorId: z,
|
|
329
|
+
typeId: "",
|
|
330
|
+
assigneeId: z,
|
|
331
|
+
about: "nobody",
|
|
332
|
+
patientId: "",
|
|
333
|
+
companyId: ""
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function po(n) {
|
|
337
|
+
const c = new Date(n.dateIso);
|
|
338
|
+
return {
|
|
339
|
+
date: c,
|
|
340
|
+
time: Ye(c),
|
|
341
|
+
note: n.note,
|
|
342
|
+
/* `||`, not `??`: a host's '' is unset, like patient and company. */
|
|
343
|
+
operatorId: n.operatorId || z,
|
|
344
|
+
/* A stored type wins. With none, '' falls through to the first entry. */
|
|
345
|
+
typeId: n.typeId ?? "",
|
|
346
|
+
/* `||` too: '' would become a Select option with an empty value. */
|
|
347
|
+
assigneeId: n.assigneeId || z,
|
|
348
|
+
about: uo(n),
|
|
349
|
+
patientId: n.patientId ?? "",
|
|
350
|
+
companyId: n.companyId ?? ""
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
const mo = [
|
|
354
|
+
["patientId", "patient"],
|
|
355
|
+
["companyId", "company"],
|
|
356
|
+
["operatorId", "operator"]
|
|
357
|
+
];
|
|
358
|
+
function ho({
|
|
359
|
+
mode: n,
|
|
360
|
+
taskId: c,
|
|
361
|
+
initialDate: I,
|
|
362
|
+
active: y,
|
|
363
|
+
taskTypes: B,
|
|
364
|
+
assignees: R,
|
|
365
|
+
companies: Y,
|
|
366
|
+
operators: x,
|
|
367
|
+
patients: X,
|
|
368
|
+
searchedPatients: D,
|
|
369
|
+
resolvePatientLabel: J,
|
|
370
|
+
loadTask: Z,
|
|
371
|
+
onCreateTask: F,
|
|
372
|
+
onUpdateTask: se,
|
|
373
|
+
onDeleteTask: _,
|
|
374
|
+
onSetTaskDone: ee,
|
|
375
|
+
onSaved: q,
|
|
376
|
+
onDeleted: P,
|
|
377
|
+
readOnly: V,
|
|
378
|
+
withheld: L,
|
|
379
|
+
maskPatient: te,
|
|
380
|
+
fallbackError: oe
|
|
381
|
+
}) {
|
|
382
|
+
var Ce;
|
|
383
|
+
const O = n === "edit", [m, S] = $(0), [le, ne] = $(y);
|
|
384
|
+
le !== y && (ne(y), y && S((e) => e + 1));
|
|
385
|
+
const U = `${n}|${c ?? ""}|${m}`, [p, he] = $(
|
|
386
|
+
() => ut(I)
|
|
387
|
+
), [G, Ee] = $(lt), [b, a] = $(), w = (e) => Ee((i) => ({ ...i, ...e })), fe = (e) => he((i) => ({ ...i, ...e })), [ge, ae] = $(U);
|
|
388
|
+
ge !== U && (ae(U), he(ut(I)), Ee(lt), a(void 0));
|
|
389
|
+
const A = C({
|
|
390
|
+
subject: U,
|
|
391
|
+
saving: !1,
|
|
392
|
+
deleting: !1,
|
|
393
|
+
donePending: !1,
|
|
394
|
+
accepted: !1
|
|
395
|
+
});
|
|
396
|
+
A.current.subject !== U && (A.current = {
|
|
397
|
+
subject: U,
|
|
398
|
+
saving: !1,
|
|
399
|
+
deleting: !1,
|
|
400
|
+
donePending: !1,
|
|
401
|
+
accepted: !1
|
|
402
|
+
});
|
|
403
|
+
const ve = C(!0);
|
|
404
|
+
$e(() => (ve.current = !0, () => {
|
|
405
|
+
ve.current = !1;
|
|
406
|
+
}), []);
|
|
407
|
+
const N = (e) => ve.current && A.current === e, ue = C(Z);
|
|
408
|
+
ue.current = Z;
|
|
409
|
+
const d = !!Z, [T, l] = $(0), [s, h] = $(null), ke = C(s);
|
|
410
|
+
ke.current = s;
|
|
411
|
+
const ye = y && O && !!c && d && !L;
|
|
412
|
+
$e(() => {
|
|
413
|
+
const e = ue.current;
|
|
414
|
+
if (!ye || !c || !e) return;
|
|
415
|
+
const i = A.current, f = ke.current;
|
|
416
|
+
if ((f == null ? void 0 : f.subject) === i.subject && f.status === "ready")
|
|
417
|
+
return;
|
|
418
|
+
const u = new AbortController();
|
|
419
|
+
return Promise.resolve().then(
|
|
420
|
+
() => (
|
|
421
|
+
/* Cleaned up before this ran (StrictMode's replay, a quick re-run):
|
|
422
|
+
never call the host with a signal already aborted. */
|
|
423
|
+
u.signal.aborted ? Promise.reject(u.signal.reason) : e(c, { signal: u.signal })
|
|
424
|
+
)
|
|
425
|
+
).then(
|
|
426
|
+
(g) => {
|
|
427
|
+
u.signal.aborted || !N(i) || (he(po(g)), w({ done: g.done, confirmedDone: g.done }), a(g), h({ subject: i.subject, status: "ready" }));
|
|
428
|
+
},
|
|
429
|
+
(g) => {
|
|
430
|
+
u.signal.aborted || !N(i) || h({
|
|
431
|
+
subject: i.subject,
|
|
432
|
+
status: "error",
|
|
433
|
+
message: je(g, oe)
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
), () => u.abort();
|
|
437
|
+
}, [ye, U, T]);
|
|
438
|
+
const j = O ? !c || !d ? "locked" : L ? "withheld" : (s == null ? void 0 : s.subject) === U ? s.status : "loading" : "ready", Q = () => {
|
|
439
|
+
j === "error" && (h(null), l((e) => e + 1));
|
|
440
|
+
}, pe = p.typeId || (((Ce = B[0]) == null ? void 0 : Ce.id) ?? ""), ze = p.about === "nobody" || p.about === "patient" && p.patientId !== "" || p.about === "company" && p.companyId !== "" || p.about === "operator" && p.operatorId !== z, me = !V && p.note.trim() !== "" && p.date !== void 0 && ze && /* Required whenever the host offers a list. */
|
|
441
|
+
(B.length === 0 || pe !== "") && !G.saving && !G.donePending, be = O ? se : F, Se = () => {
|
|
442
|
+
const { date: e, time: i } = p;
|
|
443
|
+
return e ? {
|
|
444
|
+
dateIso: new Date(
|
|
445
|
+
e.getFullYear(),
|
|
446
|
+
e.getMonth(),
|
|
447
|
+
e.getDate(),
|
|
448
|
+
i.hours,
|
|
449
|
+
i.minutes,
|
|
450
|
+
0,
|
|
451
|
+
0
|
|
452
|
+
).toISOString(),
|
|
453
|
+
note: p.note.trim(),
|
|
454
|
+
/* Sent whatever the host's list says, including a value the list no
|
|
455
|
+
longer resolves: a real link must survive a Save that never
|
|
456
|
+
offered to change it. */
|
|
457
|
+
typeId: pe === "" ? void 0 : pe,
|
|
458
|
+
assigneeId: p.assigneeId === z ? void 0 : p.assigneeId,
|
|
459
|
+
/* ONE counterpart, decided by `about` alone: the platform refuses a
|
|
460
|
+
task carrying two. Never gated on a list being loaded, or a list
|
|
461
|
+
that empties mid-edit would unlink the task on Save. */
|
|
462
|
+
patientId: p.about === "patient" && p.patientId ? p.patientId : void 0,
|
|
463
|
+
companyId: p.about === "company" && p.companyId ? p.companyId : void 0,
|
|
464
|
+
operatorId: p.about === "operator" && p.operatorId !== z ? p.operatorId : void 0,
|
|
465
|
+
/* The last CONFIRMED value only, never an optimistic or rolled-back
|
|
466
|
+
toggle. */
|
|
467
|
+
done: G.confirmedDone
|
|
468
|
+
} : void 0;
|
|
469
|
+
}, E = (e) => Gt(new Error(`TaskEditor: ${e}`)), Ne = () => {
|
|
470
|
+
const e = A.current;
|
|
471
|
+
if (j !== "ready") return E(`cannot save while ${j}.`);
|
|
472
|
+
if (!be) return E("the host gave no save seam.");
|
|
473
|
+
if (e.accepted) return E("this task was already saved.");
|
|
474
|
+
if (e.deleting) return E("a delete is in flight.");
|
|
475
|
+
if (e.saving || !me) return E("the task cannot be saved.");
|
|
476
|
+
const i = Se();
|
|
477
|
+
if (!i)
|
|
478
|
+
return w({ showError: !0 }), E("the task has no date.");
|
|
479
|
+
const f = c;
|
|
480
|
+
e.saving = !0, w({ saving: !0, saveError: void 0 });
|
|
481
|
+
const u = (async () => {
|
|
482
|
+
try {
|
|
483
|
+
if (O)
|
|
484
|
+
await (se == null ? void 0 : se(f, i)), e.accepted = !0, N(e) && (w({ accepted: !0 }), q == null || q({
|
|
485
|
+
...i,
|
|
486
|
+
id: f,
|
|
487
|
+
done: i.done ?? !1
|
|
488
|
+
}));
|
|
489
|
+
else {
|
|
490
|
+
const g = await (F == null ? void 0 : F(i));
|
|
491
|
+
e.accepted = !0, N(e) && (w({ accepted: !0 }), g && (q == null || q(g)));
|
|
492
|
+
}
|
|
493
|
+
} catch (g) {
|
|
494
|
+
throw N(e) && w({ saveError: je(g, oe) }), g;
|
|
495
|
+
} finally {
|
|
496
|
+
e.saving = !1, N(e) && w({ saving: !1 });
|
|
497
|
+
}
|
|
498
|
+
})();
|
|
499
|
+
return u.catch(() => {
|
|
500
|
+
}), u;
|
|
501
|
+
}, Te = (e) => {
|
|
502
|
+
const i = A.current;
|
|
503
|
+
if (j !== "ready")
|
|
504
|
+
return E(`cannot change Done while ${j}.`);
|
|
505
|
+
if (!O || !c || !ee || V)
|
|
506
|
+
return E("the host gave no Done seam.");
|
|
507
|
+
if (i.donePending) return E("a Done change is already pending.");
|
|
508
|
+
if (i.saving || i.deleting)
|
|
509
|
+
return E("a save or delete is in flight.");
|
|
510
|
+
if (i.accepted)
|
|
511
|
+
return E("this task was already saved or deleted.");
|
|
512
|
+
if (e === G.done) return Promise.resolve();
|
|
513
|
+
const f = G.confirmedDone, u = c;
|
|
514
|
+
i.donePending = !0, w({ done: e, donePending: !0, doneError: void 0 });
|
|
515
|
+
const g = (async () => {
|
|
516
|
+
try {
|
|
517
|
+
await ee(u, e), N(i) && w({ confirmedDone: e });
|
|
518
|
+
} catch (W) {
|
|
519
|
+
throw N(i) && w({
|
|
520
|
+
done: f,
|
|
521
|
+
doneError: je(W, oe)
|
|
522
|
+
}), W;
|
|
523
|
+
} finally {
|
|
524
|
+
i.donePending = !1, N(i) && w({ donePending: !1 });
|
|
525
|
+
}
|
|
526
|
+
})();
|
|
527
|
+
return g.catch(() => {
|
|
528
|
+
}), g;
|
|
529
|
+
}, Re = () => {
|
|
530
|
+
const e = A.current;
|
|
531
|
+
if (j !== "ready") return E(`cannot delete while ${j}.`);
|
|
532
|
+
if (!O || !c || !_ || V)
|
|
533
|
+
return E("the host gave no delete seam.");
|
|
534
|
+
if (e.saving || e.accepted || e.deleting)
|
|
535
|
+
return E("the task cannot be deleted now.");
|
|
536
|
+
const i = c;
|
|
537
|
+
e.deleting = !0, w({ deleting: !0, deleteError: void 0 });
|
|
538
|
+
const f = (async () => {
|
|
539
|
+
try {
|
|
540
|
+
await _(i), e.accepted = !0, N(e) && (w({ accepted: !0, confirmDeleteOpen: !1 }), P == null || P(i));
|
|
541
|
+
} catch (u) {
|
|
542
|
+
throw N(e) && w({ deleteError: je(u, oe) }), u;
|
|
543
|
+
} finally {
|
|
544
|
+
e.deleting = !1, N(e) && w({ deleting: !1 });
|
|
545
|
+
}
|
|
546
|
+
})();
|
|
547
|
+
return f.catch(() => {
|
|
548
|
+
}), f;
|
|
549
|
+
}, de = (e, i, f) => (
|
|
550
|
+
/* '' is never an id, even when the stored record holds one. */
|
|
551
|
+
i !== "" && (i === f || e.some((u) => u.id === i))
|
|
552
|
+
), Ie = (e) => {
|
|
553
|
+
var g;
|
|
554
|
+
if (j !== "ready")
|
|
555
|
+
throw new Error(`TaskEditor: cannot set fields while ${j}.`);
|
|
556
|
+
if (V) throw new Error("TaskEditor: the task is read-only.");
|
|
557
|
+
const i = mo.filter(([W]) => e[W] !== void 0);
|
|
558
|
+
if (i.length > 1)
|
|
559
|
+
throw new Error(
|
|
560
|
+
"TaskEditor: set at most one of patientId, companyId and operatorId."
|
|
561
|
+
);
|
|
562
|
+
const f = (g = i[0]) == null ? void 0 : g[1];
|
|
563
|
+
if (e.about !== void 0 && f && e.about !== f)
|
|
564
|
+
throw new Error(
|
|
565
|
+
`TaskEditor: about "${e.about}" does not match the ${f} id.`
|
|
566
|
+
);
|
|
567
|
+
if (e.typeId !== void 0 && !de(B, e.typeId, b == null ? void 0 : b.typeId))
|
|
568
|
+
throw new Error(`TaskEditor: unknown typeId "${e.typeId}".`);
|
|
569
|
+
if (e.assigneeId !== void 0 && e.assigneeId !== null && !de(R, e.assigneeId, b == null ? void 0 : b.assigneeId))
|
|
570
|
+
throw new Error(`TaskEditor: unknown assigneeId "${e.assigneeId}".`);
|
|
571
|
+
if (e.companyId !== void 0 && !de(Y, e.companyId, b == null ? void 0 : b.companyId))
|
|
572
|
+
throw new Error(`TaskEditor: unknown companyId "${e.companyId}".`);
|
|
573
|
+
if (e.operatorId !== void 0 && !de(x, e.operatorId, b == null ? void 0 : b.operatorId))
|
|
574
|
+
throw new Error(`TaskEditor: unknown operatorId "${e.operatorId}".`);
|
|
575
|
+
if (e.patientId !== void 0) {
|
|
576
|
+
if (te)
|
|
577
|
+
throw new Error("TaskEditor: no patient can be set in privacy mode.");
|
|
578
|
+
if (!(de(X, e.patientId, b == null ? void 0 : b.patientId) || D.has(e.patientId) || (J == null ? void 0 : J(e.patientId)) !== void 0))
|
|
579
|
+
throw new Error(`TaskEditor: unknown patientId "${e.patientId}".`);
|
|
580
|
+
}
|
|
581
|
+
const u = {};
|
|
582
|
+
if (e.dateIso !== void 0) {
|
|
583
|
+
const W = new Date(e.dateIso);
|
|
584
|
+
if (Number.isNaN(W.getTime()))
|
|
585
|
+
throw new Error(`TaskEditor: "${e.dateIso}" is not a date.`);
|
|
586
|
+
u.date = W, u.time = Ye(W);
|
|
587
|
+
}
|
|
588
|
+
e.note !== void 0 && (u.note = e.note), e.typeId !== void 0 && (u.typeId = e.typeId), e.assigneeId !== void 0 && (u.assigneeId = e.assigneeId ?? z), 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"), fe(u);
|
|
589
|
+
}, Ae = () => {
|
|
590
|
+
const e = Se();
|
|
591
|
+
return {
|
|
592
|
+
mode: n,
|
|
593
|
+
dateIso: (e == null ? void 0 : e.dateIso) ?? null,
|
|
594
|
+
about: p.about,
|
|
595
|
+
patientId: (e == null ? void 0 : e.patientId) ?? null,
|
|
596
|
+
companyId: (e == null ? void 0 : e.companyId) ?? null,
|
|
597
|
+
operatorId: (e == null ? void 0 : e.operatorId) ?? null,
|
|
598
|
+
typeId: (e == null ? void 0 : e.typeId) ?? null,
|
|
599
|
+
assigneeId: (e == null ? void 0 : e.assigneeId) ?? null,
|
|
600
|
+
done: G.confirmedDone,
|
|
601
|
+
hasNote: p.note.trim() !== "",
|
|
602
|
+
noteLength: p.note.trim().length
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
return {
|
|
606
|
+
status: j,
|
|
607
|
+
loadError: (s == null ? void 0 : s.subject) === U ? s.message : void 0,
|
|
608
|
+
retry: Q,
|
|
609
|
+
fields: p,
|
|
610
|
+
patchFields: fe,
|
|
611
|
+
stored: b,
|
|
612
|
+
chosenTypeId: pe,
|
|
613
|
+
canSave: me,
|
|
614
|
+
/** What the agent's `canSave` reports: the button's rule plus the
|
|
615
|
+
* status, the seam and a save that has not landed yet. */
|
|
616
|
+
agentCanSave: j === "ready" && !!be && me && !G.accepted,
|
|
617
|
+
showSave: !V && !!be,
|
|
618
|
+
showDelete: O && !V && !!_ && !!c,
|
|
619
|
+
showDone: O && !V && !!ee,
|
|
620
|
+
ui: G,
|
|
621
|
+
patchUi: w,
|
|
622
|
+
/** True once a save or delete landed in this session. */
|
|
623
|
+
isAccepted: () => A.current.accepted,
|
|
624
|
+
/** A save or delete is in flight: closing now would lose its outcome. */
|
|
625
|
+
isBusy: () => A.current.saving || A.current.deleting,
|
|
626
|
+
submit: Ne,
|
|
627
|
+
setDone: Te,
|
|
628
|
+
remove: Re,
|
|
629
|
+
applyPatch: Ie,
|
|
630
|
+
draftState: Ae
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
const pt = ft("ds:flex ds:min-h-0 ds:flex-col", {
|
|
634
|
+
variants: {
|
|
635
|
+
/** The panel fills its box; the subview body sits in its scroll area. */
|
|
636
|
+
variant: {
|
|
637
|
+
/* Focusable from script only, as the subview section is: where focus
|
|
638
|
+
waits when a control takes itself away. */
|
|
639
|
+
panel: "ds:h-full ds:focus-visible:outline-none",
|
|
640
|
+
subview: ""
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
defaultVariants: { variant: "panel" }
|
|
644
|
+
}), mt = ft(
|
|
645
|
+
`ds:m-0 ds:min-w-0 ds:border-0 ds:p-[var(--spacing-md)] ${ro}`,
|
|
646
|
+
{
|
|
647
|
+
variants: {
|
|
648
|
+
/** 'form': the fields in a column. 'notice': the locked notice. */
|
|
649
|
+
layout: {
|
|
650
|
+
form: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
651
|
+
notice: "ds:flex-1"
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
defaultVariants: { layout: "form" }
|
|
655
|
+
}
|
|
656
|
+
), r = (n) => `calendarWorkspace.taskEditor.${n}`, fo = (n, c, I) => I.includes(c) ? 1 : 0, _e = [], Ge = (n, c) => Array.from(n.querySelectorAll("[data-task-id]")).filter(
|
|
657
|
+
(I) => !c.contains(I)
|
|
658
|
+
), go = 'button:not([disabled]), a[href], input:not([disabled]), [tabindex]:not([tabindex="-1"])', ht = (n, c) => {
|
|
659
|
+
if (!n) return [];
|
|
660
|
+
const I = Array.from(
|
|
661
|
+
n.querySelectorAll("[data-action]")
|
|
662
|
+
);
|
|
663
|
+
return [
|
|
664
|
+
...I.filter((y) => c && y.dataset.action === c),
|
|
665
|
+
...I.filter((y) => y.dataset.action === "open-task"),
|
|
666
|
+
...Array.from(n.querySelectorAll(go))
|
|
667
|
+
];
|
|
668
|
+
}, vo = Rt(
|
|
669
|
+
({
|
|
670
|
+
id: n,
|
|
671
|
+
mode: c,
|
|
672
|
+
taskId: I,
|
|
673
|
+
initialDate: y,
|
|
674
|
+
variant: B = "panel",
|
|
675
|
+
open: R = !0,
|
|
676
|
+
onExited: Y,
|
|
677
|
+
taskTypes: x = _e,
|
|
678
|
+
assignees: X = _e,
|
|
679
|
+
companies: D = _e,
|
|
680
|
+
operators: J = _e,
|
|
681
|
+
patients: Z = _e,
|
|
682
|
+
searchPatients: F,
|
|
683
|
+
patientLabel: se,
|
|
684
|
+
resolvePatientLabel: _,
|
|
685
|
+
companyLabel: ee,
|
|
686
|
+
operatorLabel: q,
|
|
687
|
+
backLabel: P,
|
|
688
|
+
loadTask: V,
|
|
689
|
+
onCreateTask: L,
|
|
690
|
+
onUpdateTask: te,
|
|
691
|
+
onDeleteTask: oe,
|
|
692
|
+
onSetTaskDone: O,
|
|
693
|
+
onCancel: m,
|
|
694
|
+
onSaved: S,
|
|
695
|
+
onDeleted: le,
|
|
696
|
+
readOnly: ne = !1,
|
|
697
|
+
privacy: U = !1,
|
|
698
|
+
privacyMode: p = "notice",
|
|
699
|
+
onPrivacyOff: he,
|
|
700
|
+
className: G,
|
|
701
|
+
...Ee
|
|
702
|
+
}, b) => {
|
|
703
|
+
const { t: a } = gt(), w = At(), fe = n ?? w, ge = c === "edit", ae = B === "subview", A = !ae || R, ve = U && ge && p === "notice", N = U && !ve, [ue] = $(() => /* @__PURE__ */ new Map()), d = ho({
|
|
704
|
+
mode: c,
|
|
705
|
+
taskId: I,
|
|
706
|
+
initialDate: y,
|
|
707
|
+
active: A,
|
|
708
|
+
taskTypes: x,
|
|
709
|
+
assignees: X,
|
|
710
|
+
companies: D,
|
|
711
|
+
operators: J,
|
|
712
|
+
patients: Z,
|
|
713
|
+
searchedPatients: ue,
|
|
714
|
+
resolvePatientLabel: _,
|
|
715
|
+
loadTask: V,
|
|
716
|
+
onCreateTask: L,
|
|
717
|
+
onUpdateTask: te,
|
|
718
|
+
onDeleteTask: oe,
|
|
719
|
+
onSetTaskDone: O,
|
|
720
|
+
onSaved: S,
|
|
721
|
+
onDeleted: le,
|
|
722
|
+
readOnly: ne,
|
|
723
|
+
withheld: ve,
|
|
724
|
+
maskPatient: N,
|
|
725
|
+
fallbackError: a("emptyState.error.title")
|
|
726
|
+
}), { status: T, fields: l, ui: s, stored: h } = d, ke = C(F);
|
|
727
|
+
ke.current = F;
|
|
728
|
+
const ye = !!F, j = Fe(
|
|
729
|
+
() => ye ? async (t, v) => {
|
|
730
|
+
const K = await ke.current(t, v);
|
|
731
|
+
for (const ie of K)
|
|
732
|
+
ue.set(ie.id, ie.name);
|
|
733
|
+
return K;
|
|
734
|
+
} : void 0,
|
|
735
|
+
[ye, ue]
|
|
736
|
+
), Q = C(d);
|
|
737
|
+
Q.current = d;
|
|
738
|
+
const pe = C(m);
|
|
739
|
+
pe.current = m;
|
|
740
|
+
const ze = Fe(
|
|
741
|
+
() => ({
|
|
742
|
+
getStatus: () => Q.current.status,
|
|
743
|
+
getDraft: () => Q.current.draftState(),
|
|
744
|
+
canSave: () => Q.current.agentCanSave,
|
|
745
|
+
setFields: (t) => Q.current.applyPatch(t),
|
|
746
|
+
save: () => Q.current.submit(),
|
|
747
|
+
setDone: (t) => Q.current.setDone(t),
|
|
748
|
+
deleteTask: () => Q.current.remove(),
|
|
749
|
+
cancel: () => {
|
|
750
|
+
if (Q.current.isBusy())
|
|
751
|
+
throw new Error("TaskEditor: a save or delete is in flight.");
|
|
752
|
+
pe.current();
|
|
753
|
+
}
|
|
754
|
+
}),
|
|
755
|
+
[]
|
|
756
|
+
);
|
|
757
|
+
Vt(lo, A ? ze : null, fe);
|
|
758
|
+
const me = C(null), be = Fe(
|
|
759
|
+
() => Ut(b, me),
|
|
760
|
+
[b]
|
|
761
|
+
), Se = C(null), E = C(null), Ne = C(!1);
|
|
762
|
+
ae && R && !Ne.current && (E.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null), Ne.current = ae && R;
|
|
763
|
+
const Te = C(R);
|
|
764
|
+
Te.current = R;
|
|
765
|
+
const Re = C(I);
|
|
766
|
+
Re.current = ge ? I : void 0, $e(() => {
|
|
767
|
+
var st;
|
|
768
|
+
const t = me.current, v = t == null ? void 0 : t.parentElement;
|
|
769
|
+
if (!ae || !R || !t || !v) return;
|
|
770
|
+
const K = E.current, ie = K && v.contains(K) && !t.contains(K) ? K : null, Nt = Re.current, xe = (ie == null ? void 0 : ie.closest("[data-task-id]")) ?? Ge(v, t).find((Be) => Be.dataset.taskId === Nt), at = xe == null ? void 0 : xe.dataset.taskId, rt = (st = ie == null ? void 0 : ie.closest("[data-action]")) == null ? void 0 : st.dataset.action, it = xe ? Ge(v, t).indexOf(xe) : -1;
|
|
771
|
+
return () => {
|
|
772
|
+
if (Te.current && t.isConnected) return;
|
|
773
|
+
const Be = document.activeElement;
|
|
774
|
+
if (!v.isConnected || Be && Be !== document.body) return;
|
|
775
|
+
const Ue = Ge(v, t), Tt = [
|
|
776
|
+
...ht(
|
|
777
|
+
Ue.find((we) => at !== void 0 && we.dataset.taskId === at),
|
|
778
|
+
rt
|
|
779
|
+
),
|
|
780
|
+
/* The row that took its place, or the last row when it was last. */
|
|
781
|
+
...it >= 0 ? ht(Ue[Math.min(it, Ue.length - 1)], rt) : [],
|
|
782
|
+
v.querySelector('[data-action="add-task"]'),
|
|
783
|
+
v.querySelector("[data-tasks-panel-region]")
|
|
784
|
+
];
|
|
785
|
+
for (const we of Tt)
|
|
786
|
+
if (!(!we || t.contains(we)) && (we.focus(), document.activeElement === we))
|
|
787
|
+
return;
|
|
788
|
+
};
|
|
789
|
+
}, [R, ae]);
|
|
790
|
+
const de = C(null), Ie = C(!1), Ae = (t) => () => {
|
|
791
|
+
Ie.current = !0, t();
|
|
792
|
+
};
|
|
793
|
+
Lt(() => {
|
|
794
|
+
var K;
|
|
795
|
+
if (!Ie.current) return;
|
|
796
|
+
const t = me.current, v = document.activeElement;
|
|
797
|
+
if (v && v !== document.body && v !== t) {
|
|
798
|
+
Ie.current = !1;
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
T !== "loading" && (Ie.current = !1), (K = T === "error" ? de.current : t) == null || K.focus({
|
|
802
|
+
preventScroll: !0
|
|
803
|
+
});
|
|
804
|
+
}, [T]);
|
|
805
|
+
const Ce = a(r(ge ? "editTitle" : "title")), e = D.length > 0, i = J.length > 0, f = ye || Z.length > 0, u = Fe(
|
|
806
|
+
() => D.map((t) => ({ value: t.id, label: t.label })),
|
|
807
|
+
[D]
|
|
808
|
+
), g = (t) => {
|
|
809
|
+
var v;
|
|
810
|
+
return (_ == null ? void 0 : _(t)) ?? ((v = Z.find((K) => K.id === t)) == null ? void 0 : v.name) ?? ue.get(t) ?? (t === (h == null ? void 0 : h.patientId) ? se : void 0) ?? a("calendarWorkspace.details.patientNotLoaded");
|
|
811
|
+
}, W = (t) => t === (h == null ? void 0 : h.operatorId) && q ? q : a(r("operatorUnresolved"), { id: t }), yt = [
|
|
812
|
+
{ value: z, label: a(r("operatorNone")) },
|
|
813
|
+
...J.map((t) => ({ value: t.id, label: t.label })),
|
|
814
|
+
/* An operator the roster no longer lists is still a real link, so it
|
|
815
|
+
stays pickable and survives a Save. */
|
|
816
|
+
...l.operatorId !== z && !J.some((t) => t.id === l.operatorId) ? [
|
|
817
|
+
{
|
|
818
|
+
value: l.operatorId,
|
|
819
|
+
label: W(l.operatorId)
|
|
820
|
+
}
|
|
821
|
+
] : []
|
|
822
|
+
], bt = x.some((t) => t.custom) && x.some((t) => !t.custom), It = [
|
|
823
|
+
...x.map((t) => ({
|
|
824
|
+
value: t.id,
|
|
825
|
+
label: t.label,
|
|
826
|
+
group: bt ? a(r(t.custom ? "typeGroupCustom" : "typeGroupStandard")) : void 0
|
|
827
|
+
})),
|
|
828
|
+
/* An id the list no longer resolves is still a real link: offered as
|
|
829
|
+
its own option so Save re-sends it. */
|
|
830
|
+
...d.chosenTypeId && !x.some((t) => t.id === d.chosenTypeId) ? [
|
|
831
|
+
{
|
|
832
|
+
value: d.chosenTypeId,
|
|
833
|
+
label: a(r("typeUnresolved"), { id: d.chosenTypeId })
|
|
834
|
+
}
|
|
835
|
+
] : []
|
|
836
|
+
], wt = [
|
|
837
|
+
{ value: z, label: a(r("assigneeNone")) },
|
|
838
|
+
...X.map((t) => ({ value: t.id, label: t.label })),
|
|
839
|
+
...l.assigneeId !== z && !X.some((t) => t.id === l.assigneeId) ? [
|
|
840
|
+
{
|
|
841
|
+
value: l.assigneeId,
|
|
842
|
+
label: a(r("assigneeUnresolved"), { id: l.assigneeId })
|
|
843
|
+
}
|
|
844
|
+
] : []
|
|
845
|
+
], re = l.about === "company" && l.companyId && !D.some((t) => t.id === l.companyId) ? l.companyId : void 0, Et = re && re === (h == null ? void 0 : h.companyId) && ee ? ee : a(r("companyUnresolved"), { id: re }), Xe = /* @__PURE__ */ k(M, { variant: "info", announce: "off", icon: /* @__PURE__ */ o(Qt, { "aria-hidden": "true" }), children: [
|
|
846
|
+
/* @__PURE__ */ o(M.Title, { as: "p", children: a("calendarWorkspace.details.readOnlyTitle") }),
|
|
847
|
+
/* @__PURE__ */ o(M.Description, { children: a(r("readOnlyBody")) })
|
|
848
|
+
] }), qe = s.saving || s.deleting, Je = () => {
|
|
849
|
+
d.isBusy() || m();
|
|
850
|
+
}, kt = /* @__PURE__ */ o(
|
|
851
|
+
We,
|
|
852
|
+
{
|
|
853
|
+
size: "sm",
|
|
854
|
+
intent: "outline",
|
|
855
|
+
icon: /* @__PURE__ */ o(Yt, { "aria-hidden": "true" }),
|
|
856
|
+
"aria-label": a(r("cancel")),
|
|
857
|
+
tooltip: a(r("cancel")),
|
|
858
|
+
"data-action": "cancel-task",
|
|
859
|
+
disabled: qe,
|
|
860
|
+
onClick: Je
|
|
861
|
+
}
|
|
862
|
+
), Ve = s.saving || s.accepted, Ze = (t) => /* @__PURE__ */ k(De, { children: [
|
|
863
|
+
t && d.showDelete ? /* @__PURE__ */ o(
|
|
864
|
+
We,
|
|
865
|
+
{
|
|
866
|
+
ref: Se,
|
|
867
|
+
size: "sm",
|
|
868
|
+
intent: "destructiveOutline",
|
|
869
|
+
icon: /* @__PURE__ */ o(dt, { "aria-hidden": "true" }),
|
|
870
|
+
"aria-label": a(r("delete")),
|
|
871
|
+
tooltip: a(r("delete")),
|
|
872
|
+
"data-action": "delete-task",
|
|
873
|
+
disabled: qe || s.accepted,
|
|
874
|
+
onClick: () => d.patchUi({ confirmDeleteOpen: !0, deleteError: void 0 })
|
|
875
|
+
}
|
|
876
|
+
) : null,
|
|
877
|
+
/* @__PURE__ */ k(
|
|
878
|
+
Ft,
|
|
879
|
+
{
|
|
880
|
+
role: "toolbar",
|
|
881
|
+
"aria-label": a(r("actionsLabel")),
|
|
882
|
+
className: "ds:ms-auto",
|
|
883
|
+
children: [
|
|
884
|
+
kt,
|
|
885
|
+
t && d.showSave ? /* @__PURE__ */ o(
|
|
886
|
+
We,
|
|
887
|
+
{
|
|
888
|
+
size: "sm",
|
|
889
|
+
intent: "primary",
|
|
890
|
+
icon: s.saving ? /* @__PURE__ */ o(
|
|
891
|
+
eo,
|
|
892
|
+
{
|
|
893
|
+
"aria-hidden": "true",
|
|
894
|
+
className: "ds:animate-spin ds:motion-reduce:animate-none"
|
|
895
|
+
}
|
|
896
|
+
) : /* @__PURE__ */ o(ao, { "aria-hidden": "true" }),
|
|
897
|
+
"aria-label": a(r("save")),
|
|
898
|
+
tooltip: a(r("save")),
|
|
899
|
+
disabled: !Ve && !d.canSave,
|
|
900
|
+
"aria-disabled": Ve || void 0,
|
|
901
|
+
"aria-busy": s.saving || void 0,
|
|
902
|
+
"data-action": "save-task",
|
|
903
|
+
onClick: () => {
|
|
904
|
+
Ve || d.submit();
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
) : null
|
|
908
|
+
]
|
|
909
|
+
}
|
|
910
|
+
),
|
|
911
|
+
t && d.showSave ? (
|
|
912
|
+
/* Out of flow, so it never moves the footer's two ends. */
|
|
913
|
+
/* @__PURE__ */ o("span", { role: "status", className: "ds:sr-only", children: s.saving ? a(r("saving")) : "" })
|
|
914
|
+
) : null
|
|
915
|
+
] }), St = /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
916
|
+
/* @__PURE__ */ o("span", { role: "status", className: "ds:sr-only", children: a("common.loading") }),
|
|
917
|
+
/* @__PURE__ */ k(
|
|
918
|
+
"div",
|
|
919
|
+
{
|
|
920
|
+
"aria-hidden": "true",
|
|
921
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
922
|
+
children: [
|
|
923
|
+
/* @__PURE__ */ o(
|
|
924
|
+
He,
|
|
925
|
+
{
|
|
926
|
+
variant: "rounded",
|
|
927
|
+
height: "calc(var(--spacing-xl) + var(--spacing-sm))"
|
|
928
|
+
}
|
|
929
|
+
),
|
|
930
|
+
/* @__PURE__ */ o(
|
|
931
|
+
He,
|
|
932
|
+
{
|
|
933
|
+
variant: "rounded",
|
|
934
|
+
height: "calc(var(--spacing-xl) * 3)",
|
|
935
|
+
stagger: 1
|
|
936
|
+
}
|
|
937
|
+
),
|
|
938
|
+
/* @__PURE__ */ o(
|
|
939
|
+
He,
|
|
940
|
+
{
|
|
941
|
+
variant: "rounded",
|
|
942
|
+
height: "calc(var(--spacing-xl) + var(--spacing-sm))",
|
|
943
|
+
stagger: 2
|
|
944
|
+
}
|
|
945
|
+
)
|
|
946
|
+
]
|
|
947
|
+
}
|
|
948
|
+
)
|
|
949
|
+
] }), Ct = /* @__PURE__ */ k("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
|
|
950
|
+
/* @__PURE__ */ o(M, { variant: "error", children: /* @__PURE__ */ o(M.Description, { children: d.loadError }) }),
|
|
951
|
+
/* @__PURE__ */ o(
|
|
952
|
+
Me,
|
|
953
|
+
{
|
|
954
|
+
ref: de,
|
|
955
|
+
intent: "outline",
|
|
956
|
+
"data-action": "retry-load",
|
|
957
|
+
onClick: Ae(d.retry),
|
|
958
|
+
children: a("emptyState.error.cta")
|
|
959
|
+
}
|
|
960
|
+
)
|
|
961
|
+
] }), xt = /* @__PURE__ */ o("fieldset", { disabled: !0, className: mt({ layout: "notice" }), children: Xe }), Dt = () => l.about !== "patient" ? null : N ? /* @__PURE__ */ o(H, { label: a(r("aboutPatient")), children: /* @__PURE__ */ o(Oe, { value: Kt(), disabled: !0, readOnly: !0 }) }) : f ? /* @__PURE__ */ o(H, { label: a(r("aboutPatient")), children: /* @__PURE__ */ o(
|
|
962
|
+
so,
|
|
963
|
+
{
|
|
964
|
+
value: l.patientId,
|
|
965
|
+
onValueChange: (t) => d.patchFields({ patientId: t }),
|
|
966
|
+
patients: Z,
|
|
967
|
+
searchPatients: j,
|
|
968
|
+
selectedLabel: l.patientId ? g(l.patientId) : void 0,
|
|
969
|
+
placeholder: a("calendarWorkspace.editor.patientSearch"),
|
|
970
|
+
disabled: ne
|
|
971
|
+
}
|
|
972
|
+
) }) : l.patientId ? /* @__PURE__ */ o(H, { label: a(r("aboutPatient")), children: /* @__PURE__ */ o(Oe, { value: g(l.patientId), disabled: !0, readOnly: !0 }) }) : null, et = /* @__PURE__ */ k("fieldset", { disabled: ne, className: mt(), children: [
|
|
973
|
+
ne ? Xe : null,
|
|
974
|
+
/* @__PURE__ */ o(H, { label: a(r("date")), children: /* @__PURE__ */ o(
|
|
975
|
+
Bt,
|
|
976
|
+
{
|
|
977
|
+
value: l.date,
|
|
978
|
+
onChange: (t) => d.patchFields({ date: t })
|
|
979
|
+
}
|
|
980
|
+
) }),
|
|
981
|
+
/* @__PURE__ */ o(H, { label: a(r("time")), children: /* @__PURE__ */ o(
|
|
982
|
+
qt,
|
|
983
|
+
{
|
|
984
|
+
value: l.time,
|
|
985
|
+
onChange: (t) => d.patchFields({ time: t })
|
|
986
|
+
}
|
|
987
|
+
) }),
|
|
988
|
+
/* @__PURE__ */ o(
|
|
989
|
+
H,
|
|
990
|
+
{
|
|
991
|
+
label: a(r("note")),
|
|
992
|
+
required: !0,
|
|
993
|
+
error: s.showError && l.note.trim() === "" ? a(r("noteRequired")) : void 0,
|
|
994
|
+
children: /* @__PURE__ */ o(
|
|
995
|
+
zt,
|
|
996
|
+
{
|
|
997
|
+
value: l.note,
|
|
998
|
+
onChange: (t) => {
|
|
999
|
+
d.patchFields({ note: t.target.value }), d.patchUi({ showError: !1 });
|
|
1000
|
+
},
|
|
1001
|
+
minRows: 3,
|
|
1002
|
+
autoResize: !0
|
|
1003
|
+
}
|
|
1004
|
+
)
|
|
1005
|
+
}
|
|
1006
|
+
),
|
|
1007
|
+
x.length > 0 ? /* @__PURE__ */ o(H, { label: a(r("type")), required: !0, children: /* @__PURE__ */ o(
|
|
1008
|
+
Ke,
|
|
1009
|
+
{
|
|
1010
|
+
options: It,
|
|
1011
|
+
value: d.chosenTypeId,
|
|
1012
|
+
onValueChange: (t) => t && d.patchFields({ typeId: t })
|
|
1013
|
+
}
|
|
1014
|
+
) }) : null,
|
|
1015
|
+
X.length > 0 ? /* @__PURE__ */ o(H, { label: a(r("assignee")), children: /* @__PURE__ */ o(
|
|
1016
|
+
Ke,
|
|
1017
|
+
{
|
|
1018
|
+
options: wt,
|
|
1019
|
+
value: l.assigneeId,
|
|
1020
|
+
onValueChange: (t) => t && d.patchFields({ assigneeId: t })
|
|
1021
|
+
}
|
|
1022
|
+
) }) : null,
|
|
1023
|
+
/* @__PURE__ */ k(
|
|
1024
|
+
jt,
|
|
1025
|
+
{
|
|
1026
|
+
label: a(r("about")),
|
|
1027
|
+
variant: "segmented",
|
|
1028
|
+
className: io,
|
|
1029
|
+
value: l.about,
|
|
1030
|
+
onValueChange: (t) => d.patchFields({ about: t }),
|
|
1031
|
+
children: [
|
|
1032
|
+
/* @__PURE__ */ o(
|
|
1033
|
+
Pe,
|
|
1034
|
+
{
|
|
1035
|
+
value: "nobody",
|
|
1036
|
+
label: a(r("aboutNobody")),
|
|
1037
|
+
icon: /* @__PURE__ */ o(oo, { "aria-hidden": "true" })
|
|
1038
|
+
}
|
|
1039
|
+
),
|
|
1040
|
+
f || l.about === "patient" || h != null && h.patientId ? /* @__PURE__ */ o(
|
|
1041
|
+
Pe,
|
|
1042
|
+
{
|
|
1043
|
+
value: "patient",
|
|
1044
|
+
label: a(r("aboutPatient")),
|
|
1045
|
+
icon: /* @__PURE__ */ o(Xt, { "aria-hidden": "true" })
|
|
1046
|
+
}
|
|
1047
|
+
) : null,
|
|
1048
|
+
e || l.about === "company" || h != null && h.companyId ? /* @__PURE__ */ o(
|
|
1049
|
+
Pe,
|
|
1050
|
+
{
|
|
1051
|
+
value: "company",
|
|
1052
|
+
label: a(r("aboutCompany")),
|
|
1053
|
+
icon: /* @__PURE__ */ o(Jt, { "aria-hidden": "true" })
|
|
1054
|
+
}
|
|
1055
|
+
) : null,
|
|
1056
|
+
i || l.about === "operator" || h != null && h.operatorId ? /* @__PURE__ */ o(
|
|
1057
|
+
Pe,
|
|
1058
|
+
{
|
|
1059
|
+
value: "operator",
|
|
1060
|
+
label: a(r("aboutOperator")),
|
|
1061
|
+
icon: /* @__PURE__ */ o(Zt, { "aria-hidden": "true" })
|
|
1062
|
+
}
|
|
1063
|
+
) : null
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
),
|
|
1067
|
+
Dt(),
|
|
1068
|
+
l.about === "company" ? /* @__PURE__ */ k(De, { children: [
|
|
1069
|
+
re ? /* @__PURE__ */ o(H, { label: a(r("companyName")), children: /* @__PURE__ */ o(Oe, { value: Et, disabled: !0, readOnly: !0 }) }) : null,
|
|
1070
|
+
e ? /* @__PURE__ */ o(
|
|
1071
|
+
H,
|
|
1072
|
+
{
|
|
1073
|
+
label: a(
|
|
1074
|
+
r(re ? "companyReplace" : "companyName")
|
|
1075
|
+
),
|
|
1076
|
+
children: /* @__PURE__ */ o(
|
|
1077
|
+
Qe,
|
|
1078
|
+
{
|
|
1079
|
+
options: u,
|
|
1080
|
+
value: re ? "" : l.companyId,
|
|
1081
|
+
onValueChange: (t) => re ? t && d.patchFields({ companyId: t }) : d.patchFields({ companyId: t }),
|
|
1082
|
+
clearable: !re && !ne,
|
|
1083
|
+
filter: fo,
|
|
1084
|
+
placeholder: a(r("companySearch")),
|
|
1085
|
+
"aria-label": a(
|
|
1086
|
+
r(re ? "companyReplace" : "companyName")
|
|
1087
|
+
)
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
}
|
|
1091
|
+
) : null
|
|
1092
|
+
] }) : null,
|
|
1093
|
+
l.about === "operator" ? i ? /* @__PURE__ */ o(H, { label: a(r("operator")), children: /* @__PURE__ */ o(
|
|
1094
|
+
Ke,
|
|
1095
|
+
{
|
|
1096
|
+
options: yt,
|
|
1097
|
+
value: l.operatorId,
|
|
1098
|
+
onValueChange: (t) => t && d.patchFields({ operatorId: t })
|
|
1099
|
+
}
|
|
1100
|
+
) }) : l.operatorId !== z ? (
|
|
1101
|
+
/* No roster to pick from: name the link read-only. */
|
|
1102
|
+
/* @__PURE__ */ o(H, { label: a(r("operator")), children: /* @__PURE__ */ o(
|
|
1103
|
+
Oe,
|
|
1104
|
+
{
|
|
1105
|
+
value: W(l.operatorId),
|
|
1106
|
+
disabled: !0,
|
|
1107
|
+
readOnly: !0
|
|
1108
|
+
}
|
|
1109
|
+
) })
|
|
1110
|
+
) : null : null,
|
|
1111
|
+
d.showDone ? /* @__PURE__ */ k(De, { children: [
|
|
1112
|
+
/* @__PURE__ */ o(
|
|
1113
|
+
$t,
|
|
1114
|
+
{
|
|
1115
|
+
label: a(r("done")),
|
|
1116
|
+
checked: s.done,
|
|
1117
|
+
disabled: qe || s.accepted,
|
|
1118
|
+
"aria-disabled": s.donePending || void 0,
|
|
1119
|
+
"aria-busy": s.donePending || void 0,
|
|
1120
|
+
className: "ds:aria-disabled:cursor-progress",
|
|
1121
|
+
onCheckedChange: (t) => {
|
|
1122
|
+
s.donePending || d.setDone(t);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
),
|
|
1126
|
+
s.doneError ? /* @__PURE__ */ o(M, { variant: "error", children: /* @__PURE__ */ o(M.Description, { children: s.doneError }) }) : null
|
|
1127
|
+
] }) : null,
|
|
1128
|
+
s.saveError ? /* @__PURE__ */ o(M, { variant: "error", children: /* @__PURE__ */ o(M.Description, { children: s.saveError }) }) : null,
|
|
1129
|
+
s.deleteError && !s.confirmDeleteOpen ? /* @__PURE__ */ o(M, { variant: "error", children: /* @__PURE__ */ o(M.Description, { children: s.deleteError }) }) : null
|
|
1130
|
+
] }), tt = T === "loading" ? St : T === "error" ? Ct : T === "locked" ? xt : T === "withheld" ? /* @__PURE__ */ o(
|
|
1131
|
+
Ht,
|
|
1132
|
+
{
|
|
1133
|
+
onTurnOff: he ? Ae(he) : void 0
|
|
1134
|
+
}
|
|
1135
|
+
) : ae ? et : /* @__PURE__ */ o(Mt, { orientation: "vertical", className: "ds:min-h-0 ds:flex-1", children: et }), Le = T === "ready" ? Ze(!0) : T === "locked" || T === "withheld" ? Ze(!1) : null, _t = T === "ready" && d.showDelete, ot = ge ? /* @__PURE__ */ o(
|
|
1136
|
+
ce,
|
|
1137
|
+
{
|
|
1138
|
+
open: s.confirmDeleteOpen && A,
|
|
1139
|
+
onOpenChange: (t) => {
|
|
1140
|
+
s.deleting || d.patchUi(
|
|
1141
|
+
t ? { confirmDeleteOpen: !0 } : { confirmDeleteOpen: !1, deleteError: void 0 }
|
|
1142
|
+
);
|
|
1143
|
+
},
|
|
1144
|
+
children: /* @__PURE__ */ k(
|
|
1145
|
+
ce.Content,
|
|
1146
|
+
{
|
|
1147
|
+
size: "sm",
|
|
1148
|
+
variant: "alert",
|
|
1149
|
+
onCloseAutoFocus: (t) => {
|
|
1150
|
+
var v;
|
|
1151
|
+
t.preventDefault(), d.isAccepted() || (v = Se.current) == null || v.focus();
|
|
1152
|
+
},
|
|
1153
|
+
children: [
|
|
1154
|
+
/* @__PURE__ */ k(ce.Header, { children: [
|
|
1155
|
+
/* @__PURE__ */ o(ce.Title, { children: a(r("deleteConfirmTitle")) }),
|
|
1156
|
+
/* @__PURE__ */ o(ce.Description, { children: a(r("deleteConfirmBody")) })
|
|
1157
|
+
] }),
|
|
1158
|
+
s.deleteError ? /* @__PURE__ */ o(ce.Body, { children: /* @__PURE__ */ o(M, { variant: "error", children: /* @__PURE__ */ o(M.Description, { children: s.deleteError }) }) }) : null,
|
|
1159
|
+
/* @__PURE__ */ k(ce.Footer, { divider: !0, children: [
|
|
1160
|
+
/* @__PURE__ */ o(ce.Close, { asChild: !0, children: /* @__PURE__ */ o(Me, { intent: "outline", "aria-disabled": s.deleting || void 0, children: a(r("deleteCancel")) }) }),
|
|
1161
|
+
/* @__PURE__ */ o(
|
|
1162
|
+
Me,
|
|
1163
|
+
{
|
|
1164
|
+
intent: "destructive",
|
|
1165
|
+
startIcon: /* @__PURE__ */ o(dt, { "aria-hidden": "true" }),
|
|
1166
|
+
"aria-disabled": s.deleting || void 0,
|
|
1167
|
+
"aria-busy": s.deleting || void 0,
|
|
1168
|
+
onClick: () => {
|
|
1169
|
+
s.deleting || d.remove();
|
|
1170
|
+
},
|
|
1171
|
+
children: a(r("deleteConfirm"))
|
|
1172
|
+
}
|
|
1173
|
+
)
|
|
1174
|
+
] })
|
|
1175
|
+
]
|
|
1176
|
+
}
|
|
1177
|
+
)
|
|
1178
|
+
}
|
|
1179
|
+
) : null, nt = {
|
|
1180
|
+
"data-component": "task-editor",
|
|
1181
|
+
"data-component-id": fe,
|
|
1182
|
+
"data-variant": B,
|
|
1183
|
+
"data-status": T
|
|
1184
|
+
};
|
|
1185
|
+
return ae ? /* @__PURE__ */ k(De, { children: [
|
|
1186
|
+
/* @__PURE__ */ o(
|
|
1187
|
+
Ot,
|
|
1188
|
+
{
|
|
1189
|
+
...Ee,
|
|
1190
|
+
"data-component-id": fe,
|
|
1191
|
+
"data-variant": B,
|
|
1192
|
+
"data-status": T,
|
|
1193
|
+
ref: be,
|
|
1194
|
+
open: R,
|
|
1195
|
+
onBack: Je,
|
|
1196
|
+
onExited: Y,
|
|
1197
|
+
title: Ce,
|
|
1198
|
+
icon: /* @__PURE__ */ o(ct, { "aria-hidden": "true" }),
|
|
1199
|
+
backLabel: P ?? a(r("back")),
|
|
1200
|
+
footer: Le,
|
|
1201
|
+
footerAlign: _t ? "between" : "end",
|
|
1202
|
+
className: G,
|
|
1203
|
+
children: /* @__PURE__ */ o("div", { ...nt, className: pt({ variant: B }), children: tt })
|
|
1204
|
+
}
|
|
1205
|
+
),
|
|
1206
|
+
ot
|
|
1207
|
+
] }) : /* @__PURE__ */ k(De, { children: [
|
|
1208
|
+
/* @__PURE__ */ k(
|
|
1209
|
+
"div",
|
|
1210
|
+
{
|
|
1211
|
+
tabIndex: -1,
|
|
1212
|
+
...Ee,
|
|
1213
|
+
...nt,
|
|
1214
|
+
ref: be,
|
|
1215
|
+
className: pt({ variant: B, className: G }),
|
|
1216
|
+
children: [
|
|
1217
|
+
/* @__PURE__ */ o(
|
|
1218
|
+
Pt,
|
|
1219
|
+
{
|
|
1220
|
+
title: Ce,
|
|
1221
|
+
icon: /* @__PURE__ */ o(ct, { "aria-hidden": "true" }),
|
|
1222
|
+
sticky: !0,
|
|
1223
|
+
divider: !0
|
|
1224
|
+
}
|
|
1225
|
+
),
|
|
1226
|
+
tt,
|
|
1227
|
+
Le ? /* @__PURE__ */ o("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__ */ o("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: Le }) }) : null
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
),
|
|
1231
|
+
ot
|
|
1232
|
+
] });
|
|
1233
|
+
}
|
|
1234
|
+
);
|
|
1235
|
+
vo.displayName = "TaskEditor";
|
|
1236
|
+
export {
|
|
1237
|
+
ro as E,
|
|
1238
|
+
so as P,
|
|
1239
|
+
ao as S,
|
|
1240
|
+
vo as T,
|
|
1241
|
+
lo as t
|
|
1242
|
+
};
|
|
1243
|
+
//# sourceMappingURL=task-editor-DlvTwAfv.js.map
|