@alfadocs/ui-kit-debug 1.133.0 → 1.134.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/{agenda-card-B8hV3dZV.js → agenda-card-B9wgX_Ed.js} +2 -2
- package/dist/_chunks/{agenda-card-B8hV3dZV.js.map → agenda-card-B9wgX_Ed.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-Bu46s3dI.js → agenda-tray-CGcS_qoM.js} +2 -2
- package/dist/_chunks/{agenda-tray-Bu46s3dI.js.map → agenda-tray-CGcS_qoM.js.map} +1 -1
- package/dist/_chunks/appointment-card-DG3m9yN-.js +504 -0
- package/dist/_chunks/appointment-card-DG3m9yN-.js.map +1 -0
- package/dist/_chunks/{appointment-peek-DZa6xyUb.js → appointment-peek-BK0tDs4C.js} +2 -2
- package/dist/_chunks/{appointment-peek-DZa6xyUb.js.map → appointment-peek-BK0tDs4C.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-DQePqpyH.js → appointment-timeline-BiI2riRZ.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DQePqpyH.js.map → appointment-timeline-BiI2riRZ.js.map} +1 -1
- package/dist/_chunks/appointment-tray-ClJCtYQj.js +200 -0
- package/dist/_chunks/appointment-tray-ClJCtYQj.js.map +1 -0
- package/dist/_chunks/{appointment-workflow-status-DMjuIK90.js → appointment-workflow-status-S-lx81Yz.js} +2 -2
- package/dist/_chunks/{appointment-workflow-status-DMjuIK90.js.map → appointment-workflow-status-S-lx81Yz.js.map} +1 -1
- package/dist/_chunks/ban-CiSCCcOE.js +15 -0
- package/dist/_chunks/ban-CiSCCcOE.js.map +1 -0
- package/dist/_chunks/{calendar-BIoOeBTT.js → calendar-CyLtLBNP.js} +2 -2
- package/dist/_chunks/{calendar-BIoOeBTT.js.map → calendar-CyLtLBNP.js.map} +1 -1
- package/dist/_chunks/{calendar-appointment-editor-dialog-BHx6kUhX.js → calendar-appointment-editor-dialog-BSkIYGlW.js} +13 -13
- package/dist/_chunks/{calendar-appointment-editor-dialog-BHx6kUhX.js.map → calendar-appointment-editor-dialog-BSkIYGlW.js.map} +1 -1
- package/dist/_chunks/{calendar-event-card-BNEzkjm-.js → calendar-event-card-BJifpYZQ.js} +7 -6
- package/dist/_chunks/{calendar-event-card-BNEzkjm-.js.map → calendar-event-card-BJifpYZQ.js.map} +1 -1
- package/dist/_chunks/{care-plan-card-DKScH9Ss.js → care-plan-card-CjHq6PLo.js} +6 -6
- package/dist/_chunks/{care-plan-card-DKScH9Ss.js.map → care-plan-card-CjHq6PLo.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-AG1y3nyW.js → care-plan-entry-card-DY1toF6E.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-AG1y3nyW.js.map → care-plan-entry-card-DY1toF6E.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-Dx5OMkc9.js → care-plan-header-CeFXUDnL.js} +6 -6
- package/dist/_chunks/{care-plan-header-Dx5OMkc9.js.map → care-plan-header-CeFXUDnL.js.map} +1 -1
- package/dist/_chunks/check-in-documents-CEVcgcYZ.js +136 -0
- package/dist/_chunks/check-in-documents-CEVcgcYZ.js.map +1 -0
- package/dist/_chunks/{clinical-note-card-pPaeWWnu.js → clinical-note-card-D--IwbZa.js} +2 -2
- package/dist/_chunks/{clinical-note-card-pPaeWWnu.js.map → clinical-note-card-D--IwbZa.js.map} +1 -1
- package/dist/_chunks/document-preview-DLVIrOYV.js +385 -0
- package/dist/_chunks/document-preview-DLVIrOYV.js.map +1 -0
- package/dist/_chunks/{entity-card-fpm-KUKc.js → entity-card-p-LANpYt.js} +18 -17
- package/dist/_chunks/{entity-card-fpm-KUKc.js.map → entity-card-p-LANpYt.js.map} +1 -1
- package/dist/_chunks/{error-page-B0fGNTRB.js → error-page-WLhmWUTq.js} +100 -115
- package/dist/_chunks/error-page-WLhmWUTq.js.map +1 -0
- package/dist/_chunks/finished-terminal-unDnXT4j.js +191 -0
- package/dist/_chunks/finished-terminal-unDnXT4j.js.map +1 -0
- package/dist/_chunks/house-DGCypGTo.js +21 -0
- package/dist/_chunks/house-DGCypGTo.js.map +1 -0
- package/dist/_chunks/is-safe-url-CEy9CEml.js +8 -0
- package/dist/_chunks/is-safe-url-CEy9CEml.js.map +1 -0
- package/dist/_chunks/keypad-DBH_keVs.js +152 -0
- package/dist/_chunks/keypad-DBH_keVs.js.map +1 -0
- package/dist/_chunks/keypad-button-mOaPQRrH.js +114 -0
- package/dist/_chunks/keypad-button-mOaPQRrH.js.map +1 -0
- package/dist/_chunks/{message-card-BG3_3nN1.js → message-card-Bw_q1qKx.js} +2 -2
- package/dist/_chunks/{message-card-BG3_3nN1.js.map → message-card-Bw_q1qKx.js.map} +1 -1
- package/dist/_chunks/{message-tray-BjZv0Fsk.js → message-tray-pLGgLmoG.js} +2 -2
- package/dist/_chunks/{message-tray-BjZv0Fsk.js.map → message-tray-pLGgLmoG.js.map} +1 -1
- package/dist/_chunks/{note-attachment-MNTIqdSz.js → note-attachment-JTIy9iXN.js} +2 -2
- package/dist/_chunks/{note-attachment-MNTIqdSz.js.map → note-attachment-JTIy9iXN.js.map} +1 -1
- package/dist/_chunks/{note-timeline-BQeW0VZY.js → note-timeline-BbjHMhkL.js} +2 -2
- package/dist/_chunks/{note-timeline-BQeW0VZY.js.map → note-timeline-BbjHMhkL.js.map} +1 -1
- package/dist/_chunks/{notes-panel-Cm-_pCRJ.js → notes-panel-BAyPOr8N.js} +2 -2
- package/dist/_chunks/{notes-panel-Cm-_pCRJ.js.map → notes-panel-BAyPOr8N.js.map} +1 -1
- package/dist/_chunks/{operator-hero-CnfWckNQ.js → operator-hero-D4wfVu2l.js} +2 -2
- package/dist/_chunks/{operator-hero-CnfWckNQ.js.map → operator-hero-D4wfVu2l.js.map} +1 -1
- package/dist/_chunks/otp-input-BNOTlxq3.js +342 -0
- package/dist/_chunks/otp-input-BNOTlxq3.js.map +1 -0
- package/dist/_chunks/patient-account-settings-BkAtIxJW.js +546 -0
- package/dist/_chunks/patient-account-settings-BkAtIxJW.js.map +1 -0
- package/dist/_chunks/patient-card-DTh3QTyS.js +125 -0
- package/dist/_chunks/patient-card-DTh3QTyS.js.map +1 -0
- package/dist/_chunks/patient-check-in-resume-xhqjC6gf.js +742 -0
- package/dist/_chunks/patient-check-in-resume-xhqjC6gf.js.map +1 -0
- package/dist/_chunks/patient-sign-in-pin-CDBqV254.js +432 -0
- package/dist/_chunks/patient-sign-in-pin-CDBqV254.js.map +1 -0
- package/dist/_chunks/patient-sign-in-steps-C2JSqlok.js +199 -0
- package/dist/_chunks/patient-sign-in-steps-C2JSqlok.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-BUcZ-gaL.js → patient-summary-card-Bl2NknPe.js} +2 -2
- package/dist/_chunks/{patient-summary-card-BUcZ-gaL.js.map → patient-summary-card-Bl2NknPe.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-Dv4WbRBe.js → payment-request-card-CNW00DCx.js} +6 -6
- package/dist/_chunks/{payment-request-card-Dv4WbRBe.js.map → payment-request-card-CNW00DCx.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-BnBKdx0y.js → pdf-viewer-TRC5jEm5.js} +472 -425
- package/dist/_chunks/pdf-viewer-TRC5jEm5.js.map +1 -0
- package/dist/_chunks/pin-entry-BugWQMOS.js +219 -0
- package/dist/_chunks/pin-entry-BugWQMOS.js.map +1 -0
- package/dist/_chunks/pin-indicator-Cb-n40UI.js +124 -0
- package/dist/_chunks/pin-indicator-Cb-n40UI.js.map +1 -0
- package/dist/_chunks/portal-details-CTEsm705.js +478 -0
- package/dist/_chunks/portal-details-CTEsm705.js.map +1 -0
- package/dist/_chunks/portal-documents-D8skew0h.js +902 -0
- package/dist/_chunks/portal-documents-D8skew0h.js.map +1 -0
- package/dist/_chunks/portal-parts-BdR29P7z.js +285 -0
- package/dist/_chunks/portal-parts-BdR29P7z.js.map +1 -0
- package/dist/_chunks/{privacy-mask-DJ1gee4c.js → privacy-mask-C19dJFMk.js} +5 -5
- package/dist/_chunks/{privacy-mask-DJ1gee4c.js.map → privacy-mask-C19dJFMk.js.map} +1 -1
- package/dist/_chunks/{product-hub-panel-a8wdVOUt.js → product-hub-panel-K4QbULG7.js} +2 -2
- package/dist/_chunks/{product-hub-panel-a8wdVOUt.js.map → product-hub-panel-K4QbULG7.js.map} +1 -1
- package/dist/_chunks/{registration-form-CwbhtKcy.js → registration-form-DS3RuKHu.js} +2 -2
- package/dist/_chunks/{registration-form-CwbhtKcy.js.map → registration-form-DS3RuKHu.js.map} +1 -1
- package/dist/_chunks/{reserved.agent-W8mR179D.js → reserved.agent-DOzOBUW7.js} +2 -2
- package/dist/_chunks/{reserved.agent-W8mR179D.js.map → reserved.agent-DOzOBUW7.js.map} +1 -1
- package/dist/_chunks/session-countdown-DOx1IBUB.js +232 -0
- package/dist/_chunks/session-countdown-DOx1IBUB.js.map +1 -0
- package/dist/_chunks/{sign-document-CQZVzfpk.js → sign-document-DDZbmYHu.js} +2 -2
- package/dist/_chunks/{sign-document-CQZVzfpk.js.map → sign-document-DDZbmYHu.js.map} +1 -1
- package/dist/_chunks/{signature-field-DjabvRZm.js → signature-field-BjlY_yXH.js} +39 -34
- package/dist/_chunks/signature-field-BjlY_yXH.js.map +1 -0
- package/dist/_chunks/{signature-request-4pGq3YBe.js → signature-request-CHsM_iWi.js} +2 -2
- package/dist/_chunks/{signature-request-4pGq3YBe.js.map → signature-request-CHsM_iWi.js.map} +1 -1
- package/dist/_chunks/{signature-status-chip-pIoQjvH8.js → signature-status-chip-DS9hHwIt.js} +66 -69
- package/dist/_chunks/signature-status-chip-DS9hHwIt.js.map +1 -0
- package/dist/_chunks/signing-end-screen-an9P8DOT.js +1041 -0
- package/dist/_chunks/signing-end-screen-an9P8DOT.js.map +1 -0
- package/dist/_chunks/sms-code-entry-Dgp4GwlM.js +316 -0
- package/dist/_chunks/sms-code-entry-Dgp4GwlM.js.map +1 -0
- package/dist/_chunks/step-up-dialog-C2JqJmCA.js +132 -0
- package/dist/_chunks/step-up-dialog-C2JqJmCA.js.map +1 -0
- package/dist/_chunks/{task-editor-BL2hHxNz.js → task-editor-g1AGfxhr.js} +38 -38
- package/dist/_chunks/{task-editor-BL2hHxNz.js.map → task-editor-g1AGfxhr.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-_b7FRB1x.js → use-appointment-details-read-Dzc6fEzG.js} +6 -6
- package/dist/_chunks/{use-appointment-details-read-_b7FRB1x.js.map → use-appointment-details-read-Dzc6fEzG.js.map} +1 -1
- package/dist/_chunks/use-zoom-drilldown-Cr1baU5X.js +221 -0
- package/dist/_chunks/use-zoom-drilldown-Cr1baU5X.js.map +1 -0
- package/dist/_chunks/{user-x-DYszNtIg.js → user-x-BJZg4kaP.js} +8 -19
- package/dist/_chunks/user-x-BJZg4kaP.js.map +1 -0
- package/dist/_chunks/{verify-identity-types-CxtrBXsZ.js → verify-identity-types-C6Bam8v6.js} +2 -2
- package/dist/_chunks/{verify-identity-types-CxtrBXsZ.js.map → verify-identity-types-C6Bam8v6.js.map} +1 -1
- package/dist/agent-catalog.json +723 -364
- package/dist/agent-i18n/en.json +75 -18
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/is-safe-url.d.ts +3 -1
- package/dist/components/_shared/is-safe-url.d.ts.map +1 -1
- package/dist/components/agenda-card/index.js +2 -2
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +45 -0
- package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
- package/dist/components/appointment-card/appointment-tray.agent.d.ts.map +1 -1
- package/dist/components/appointment-card/appointment-tray.d.ts +11 -0
- package/dist/components/appointment-card/appointment-tray.d.ts.map +1 -1
- package/dist/components/appointment-card/index.js +3 -3
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -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/clinical-note-card/index.js +1 -1
- package/dist/components/document-preview/document-preview.agent.d.ts.map +1 -1
- package/dist/components/document-preview/document-preview.d.ts +61 -7
- package/dist/components/document-preview/document-preview.d.ts.map +1 -1
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/finished-terminal/finished-terminal.d.ts +63 -6
- package/dist/components/finished-terminal/finished-terminal.d.ts.map +1 -1
- package/dist/components/finished-terminal/index.d.ts +1 -1
- package/dist/components/finished-terminal/index.d.ts.map +1 -1
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/keypad/index.d.ts +3 -0
- package/dist/components/keypad/index.d.ts.map +1 -0
- package/dist/components/keypad/index.js +6 -0
- package/dist/components/keypad/index.js.map +1 -0
- package/dist/components/keypad/keypad.d.ts +54 -0
- package/dist/components/keypad/keypad.d.ts.map +1 -0
- package/dist/components/keypad-button/index.d.ts +3 -0
- package/dist/components/keypad-button/index.d.ts.map +1 -0
- package/dist/components/keypad-button/index.js +6 -0
- package/dist/components/keypad-button/index.js.map +1 -0
- package/dist/components/keypad-button/keypad-button.d.ts +33 -0
- package/dist/components/keypad-button/keypad-button.d.ts.map +1 -0
- package/dist/components/message-card/index.js +2 -2
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +11 -0
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.agent.d.ts.map +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
- package/dist/components/pdf-viewer/pdf-viewer.d.ts.map +1 -1
- package/dist/components/pin-entry/index.d.ts +3 -0
- package/dist/components/pin-entry/index.d.ts.map +1 -0
- package/dist/components/pin-entry/index.js +5 -0
- package/dist/components/pin-entry/index.js.map +1 -0
- package/dist/components/pin-entry/pin-entry.agent.d.ts +4 -0
- package/dist/components/pin-entry/pin-entry.agent.d.ts.map +1 -0
- package/dist/components/pin-entry/pin-entry.d.ts +64 -0
- package/dist/components/pin-entry/pin-entry.d.ts.map +1 -0
- package/dist/components/pin-indicator/index.d.ts +3 -0
- package/dist/components/pin-indicator/index.d.ts.map +1 -0
- package/dist/components/pin-indicator/index.js +9 -0
- package/dist/components/pin-indicator/index.js.map +1 -0
- package/dist/components/pin-indicator/pin-indicator.d.ts +34 -0
- package/dist/components/pin-indicator/pin-indicator.d.ts.map +1 -0
- package/dist/components/product-hub-tray/index.js +2 -2
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/session-countdown/session-countdown.d.ts +19 -0
- package/dist/components/session-countdown/session-countdown.d.ts.map +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/signature-field/signature-field.d.ts +17 -6
- package/dist/components/signature-field/signature-field.d.ts.map +1 -1
- package/dist/components/signature-status-chip/index.js +1 -1
- package/dist/components/signature-status-chip/signature-status-chip.d.ts +3 -2
- package/dist/components/signature-status-chip/signature-status-chip.d.ts.map +1 -1
- package/dist/components/sms-code-entry/index.d.ts +3 -0
- package/dist/components/sms-code-entry/index.d.ts.map +1 -0
- package/dist/components/sms-code-entry/index.js +5 -0
- package/dist/components/sms-code-entry/index.js.map +1 -0
- package/dist/components/sms-code-entry/sms-code-entry.agent.d.ts +4 -0
- package/dist/components/sms-code-entry/sms-code-entry.agent.d.ts.map +1 -0
- package/dist/components/sms-code-entry/sms-code-entry.d.ts +156 -0
- package/dist/components/sms-code-entry/sms-code-entry.d.ts.map +1 -0
- package/dist/components/step-up-dialog/index.d.ts +3 -0
- package/dist/components/step-up-dialog/index.d.ts.map +1 -0
- package/dist/components/step-up-dialog/index.js +5 -0
- package/dist/components/step-up-dialog/index.js.map +1 -0
- package/dist/components/step-up-dialog/step-up-dialog.d.ts +108 -0
- package/dist/components/step-up-dialog/step-up-dialog.d.ts.map +1 -0
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-signing-session.d.ts +7 -2
- package/dist/hooks/use-signing-session.d.ts.map +1 -1
- package/dist/host-compat.css +10 -1
- package/dist/i18n/locales/ar.d.ts +512 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +509 -3
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +512 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +517 -4
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +512 -1
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +512 -4
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +514 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +520 -4
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +512 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +510 -4
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +512 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +510 -4
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +512 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +510 -4
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +512 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +517 -4
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +512 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +510 -4
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +512 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +517 -4
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +512 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +517 -4
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +512 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +517 -4
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +512 -1
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +517 -4
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +512 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +509 -3
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +512 -1
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +510 -4
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +512 -1
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +510 -4
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +512 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +512 -4
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +512 -1
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +510 -4
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1271 -1204
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +513 -2
- package/dist/locales/de.json +514 -3
- package/dist/locales/el.json +514 -3
- package/dist/locales/en.json +514 -3
- package/dist/locales/es.json +514 -3
- package/dist/locales/fr.json +514 -3
- package/dist/locales/hi.json +514 -3
- package/dist/locales/it.json +514 -3
- package/dist/locales/ja.json +514 -3
- package/dist/locales/nl.json +514 -3
- package/dist/locales/pl.json +514 -3
- package/dist/locales/pt.json +514 -3
- package/dist/locales/ro.json +514 -3
- package/dist/locales/ru.json +513 -2
- package/dist/locales/sq.json +514 -3
- package/dist/locales/sv.json +514 -3
- package/dist/locales/tr.json +514 -3
- package/dist/locales/zh.json +514 -3
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/check-in-documents/check-in-documents.d.ts +61 -0
- package/dist/patterns/check-in-documents/check-in-documents.d.ts.map +1 -0
- package/dist/patterns/check-in-documents/check-in-signable-document.d.ts +32 -0
- package/dist/patterns/check-in-documents/check-in-signable-document.d.ts.map +1 -0
- package/dist/patterns/check-in-documents/index.d.ts +4 -0
- package/dist/patterns/check-in-documents/index.d.ts.map +1 -0
- package/dist/patterns/check-in-documents/index.js +5 -0
- package/dist/patterns/check-in-documents/index.js.map +1 -0
- package/dist/patterns/error-page/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.d.ts +4 -0
- package/dist/patterns/patient-account-settings/index.d.ts.map +1 -0
- package/dist/patterns/patient-account-settings/index.js +5 -0
- package/dist/patterns/patient-account-settings/index.js.map +1 -0
- package/dist/patterns/patient-account-settings/patient-account-settings-panels.d.ts +36 -0
- package/dist/patterns/patient-account-settings/patient-account-settings-panels.d.ts.map +1 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.d.ts +94 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.d.ts.map +1 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.types.d.ts +91 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.types.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/index.d.ts +20 -0
- package/dist/patterns/patient-check-in/index.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/index.js +13 -0
- package/dist/patterns/patient-check-in/index.js.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-changed.d.ts +33 -0
- package/dist/patterns/patient-check-in/patient-check-in-changed.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-connection-notice.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-connection-notice.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-done.d.ts +25 -0
- package/dist/patterns/patient-check-in/patient-check-in-done.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-entry.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-entry.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub-empty.d.ts +23 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub-empty.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub.d.ts +61 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-personal-data.d.ts +73 -0
- package/dist/patterns/patient-check-in/patient-check-in-personal-data.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-privacy.d.ts +9 -0
- package/dist/patterns/patient-check-in/patient-check-in-privacy.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-resume.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-resume.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-shell.d.ts +60 -0
- package/dist/patterns/patient-check-in/patient-check-in-shell.d.ts.map +1 -0
- package/dist/patterns/patient-check-in/patient-check-in-types.d.ts +92 -0
- package/dist/patterns/patient-check-in/patient-check-in-types.d.ts.map +1 -0
- package/dist/patterns/patient-portal/index.d.ts +12 -0
- package/dist/patterns/patient-portal/index.d.ts.map +1 -0
- package/dist/patterns/patient-portal/index.js +13 -0
- package/dist/patterns/patient-portal/index.js.map +1 -0
- package/dist/patterns/patient-portal/portal-appointments.d.ts +70 -0
- package/dist/patterns/patient-portal/portal-appointments.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-details.d.ts +148 -0
- package/dist/patterns/patient-portal/portal-details.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-documents.d.ts +74 -0
- package/dist/patterns/patient-portal/portal-documents.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-format.d.ts +14 -0
- package/dist/patterns/patient-portal/portal-format.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-home.d.ts +71 -0
- package/dist/patterns/patient-portal/portal-home.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-parts.d.ts +107 -0
- package/dist/patterns/patient-portal/portal-parts.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-shell.d.ts +84 -0
- package/dist/patterns/patient-portal/portal-shell.d.ts.map +1 -0
- package/dist/patterns/patient-portal/portal-types.d.ts +157 -0
- package/dist/patterns/patient-portal/portal-types.d.ts.map +1 -0
- package/dist/patterns/patient-sign-in/index.d.ts +7 -0
- package/dist/patterns/patient-sign-in/index.d.ts.map +1 -0
- package/dist/patterns/patient-sign-in/index.js +15 -0
- package/dist/patterns/patient-sign-in/index.js.map +1 -0
- package/dist/patterns/patient-sign-in/patient-card.d.ts +74 -0
- package/dist/patterns/patient-sign-in/patient-card.d.ts.map +1 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-email.d.ts +109 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-email.d.ts.map +1 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-pin.d.ts +157 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-pin.d.ts.map +1 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-steps.d.ts +143 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-steps.d.ts.map +1 -0
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signing/index.d.ts +25 -0
- package/dist/patterns/signing/index.d.ts.map +1 -0
- package/dist/patterns/signing/index.js +16 -0
- package/dist/patterns/signing/index.js.map +1 -0
- package/dist/patterns/signing/multi-field-signer.d.ts +117 -0
- package/dist/patterns/signing/multi-field-signer.d.ts.map +1 -0
- package/dist/patterns/signing/signing-awaiting-screen.d.ts +25 -0
- package/dist/patterns/signing/signing-awaiting-screen.d.ts.map +1 -0
- package/dist/patterns/signing/signing-chrome.d.ts +30 -0
- package/dist/patterns/signing/signing-chrome.d.ts.map +1 -0
- package/dist/patterns/signing/signing-document-screen.d.ts +87 -0
- package/dist/patterns/signing/signing-document-screen.d.ts.map +1 -0
- package/dist/patterns/signing/signing-end-screen.d.ts +27 -0
- package/dist/patterns/signing/signing-end-screen.d.ts.map +1 -0
- package/dist/patterns/signing/signing-finished-screen.d.ts +34 -0
- package/dist/patterns/signing/signing-finished-screen.d.ts.map +1 -0
- package/dist/patterns/signing/signing-footer.d.ts +56 -0
- package/dist/patterns/signing/signing-footer.d.ts.map +1 -0
- package/dist/patterns/signing/signing-handoff-screen.d.ts +37 -0
- package/dist/patterns/signing/signing-handoff-screen.d.ts.map +1 -0
- package/dist/patterns/signing/signing-message-dialog.d.ts +29 -0
- package/dist/patterns/signing/signing-message-dialog.d.ts.map +1 -0
- package/dist/patterns/signing/signing-progress-chip.d.ts +27 -0
- package/dist/patterns/signing/signing-progress-chip.d.ts.map +1 -0
- package/dist/patterns/signing/signing-roster.d.ts +44 -0
- package/dist/patterns/signing/signing-roster.d.ts.map +1 -0
- package/dist/patterns/signing/signing-staff-id-confirmation.d.ts +49 -0
- package/dist/patterns/signing/signing-staff-id-confirmation.d.ts.map +1 -0
- package/dist/patterns/verify-identity/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +49 -1
- package/dist/_chunks/appointment-card-OAOur8lH.js +0 -434
- package/dist/_chunks/appointment-card-OAOur8lH.js.map +0 -1
- package/dist/_chunks/appointment-tray-DSFqO5Rm.js +0 -193
- package/dist/_chunks/appointment-tray-DSFqO5Rm.js.map +0 -1
- package/dist/_chunks/document-preview-_kQ9QvZV.js +0 -291
- package/dist/_chunks/document-preview-_kQ9QvZV.js.map +0 -1
- package/dist/_chunks/error-page-B0fGNTRB.js.map +0 -1
- package/dist/_chunks/finished-terminal-FR8uc_Ws.js +0 -122
- package/dist/_chunks/finished-terminal-FR8uc_Ws.js.map +0 -1
- package/dist/_chunks/is-safe-url-DkETxeHz.js +0 -7
- package/dist/_chunks/is-safe-url-DkETxeHz.js.map +0 -1
- package/dist/_chunks/otp-input-gV1446Dw.js +0 -301
- package/dist/_chunks/otp-input-gV1446Dw.js.map +0 -1
- package/dist/_chunks/pdf-viewer-BnBKdx0y.js.map +0 -1
- package/dist/_chunks/session-countdown-C4tzbJVc.js +0 -223
- package/dist/_chunks/session-countdown-C4tzbJVc.js.map +0 -1
- package/dist/_chunks/signature-field-DjabvRZm.js.map +0 -1
- package/dist/_chunks/signature-status-chip-pIoQjvH8.js.map +0 -1
- package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +0 -210
- package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js.map +0 -1
- package/dist/_chunks/user-x-DYszNtIg.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-page-WLhmWUTq.js","sources":["../../node_modules/lucide-react/dist/esm/icons/circle-question-mark.mjs","../../src/patterns/error-page/error-page-statuses.ts","../../src/patterns/error-page/error-page-english.ts","../../src/patterns/error-page/error-page-locale.ts","../../src/patterns/error-page/error-page.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\", key: \"1u773s\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst CircleQuestionMark = createLucideIcon(\"circle-question-mark\", __iconNode);\n\nexport { __iconNode, CircleQuestionMark as default };\n//# sourceMappingURL=circle-question-mark.mjs.map\n","import type { ErrorPageMood } from './error-page-illustration';\n\n/** The statuses with their own copy. Anything else shows `generic`. */\nexport const ERROR_PAGE_STATUSES = [\n 400,\n 401,\n 403,\n 404,\n 405,\n 410,\n 419,\n 429,\n 500,\n 502,\n 503,\n 504,\n 'offline',\n 'maintenance',\n] as const;\n\nexport type ErrorPageKnownStatus = (typeof ERROR_PAGE_STATUSES)[number];\n\n/** What the status's main button does. */\nexport type ErrorPagePrimaryAction = 'home' | 'retry' | 'login';\n\nexport interface ErrorPageStatusSpec {\n /** Key under `ui.errorPage.status.*`. */\n key: string;\n /** How the Alfadocs mark shows the trouble. */\n mood: ErrorPageMood;\n primary: ErrorPagePrimaryAction;\n}\n\nconst SPECS: Record<ErrorPageKnownStatus | 'generic', ErrorPageStatusSpec> = {\n 400: { key: 'badRequest', mood: 'jumbled', primary: 'home' },\n 401: { key: 'unauthorised', mood: 'locked', primary: 'login' },\n 403: { key: 'forbidden', mood: 'roped', primary: 'home' },\n 404: { key: 'notFound', mood: 'lost', primary: 'home' },\n 405: { key: 'methodNotAllowed', mood: 'wrong-way', primary: 'home' },\n 410: { key: 'gone', mood: 'vanished', primary: 'home' },\n 419: { key: 'expired', mood: 'asleep', primary: 'login' },\n 429: { key: 'tooManyRequests', mood: 'melt', primary: 'retry' },\n 500: { key: 'serverError', mood: 'patched', primary: 'retry' },\n 502: { key: 'badGateway', mood: 'unplugged', primary: 'retry' },\n 503: { key: 'maintenance', mood: 'rebuild', primary: 'retry' },\n 504: { key: 'timeout', mood: 'snail', primary: 'retry' },\n offline: { key: 'offline', mood: 'adrift', primary: 'retry' },\n maintenance: { key: 'maintenance', mood: 'rebuild', primary: 'retry' },\n generic: { key: 'generic', mood: 'puzzled', primary: 'home' },\n};\n\n/** The spec for any status; unknown ones fall back to `generic`. */\nexport function errorPageStatusSpec(\n status: number | 'offline' | 'maintenance',\n): ErrorPageStatusSpec {\n return (ERROR_PAGE_STATUSES as readonly (number | string)[]).includes(status)\n ? SPECS[status as ErrorPageKnownStatus]\n : SPECS.generic;\n}\n","/* -------------------------------------------------------------------- */\n/* ErrorPage's English copy, kept static on purpose (HTP-7057). */\n/* */\n/* The kit's English bundle is a lazy chunk. An error page often appears */\n/* because the network is failing, and then that chunk cannot load, so */\n/* the page would show raw keys. This small copy ships with the page */\n/* itself (not with the i18n entry) and is the last thing it falls back */\n/* to. A test keeps it identical to `errorPage` in locales/en.ts. */\n/* -------------------------------------------------------------------- */\n\nexport const errorPageEnglish = {\n statusLabel: 'Error {{status}}',\n reference: 'Reference: {{id}}',\n referenceHint: 'If you contact support, quote this reference.',\n backAt: 'We expect to be back by {{time}}.',\n actions: {\n home: 'Go to the home page',\n retry: 'Try again',\n login: 'Log in',\n support: 'Contact support',\n },\n status: {\n badRequest: {\n title: \"We couldn't handle that request\",\n message: 'Something in the request was not right. Please try again.',\n },\n unauthorised: {\n title: 'Please log in',\n message: 'You need to log in to see this page.',\n },\n forbidden: {\n title: \"You don't have access to this page\",\n message: 'If you think you should, contact support.',\n },\n notFound: {\n title: \"We can't find this page\",\n message: 'The link may be wrong, or the page may have moved.',\n },\n methodNotAllowed: {\n title: \"This page can't be opened this way\",\n message: 'Go to the home page and try again from there.',\n },\n gone: {\n title: 'This page is no longer available',\n message: 'It has been removed.',\n },\n expired: {\n title: 'This page has expired',\n message: 'For your security, please start again.',\n },\n tooManyRequests: {\n title: 'Too many attempts',\n message: 'Please wait a minute, then try again.',\n },\n serverError: {\n title: 'Something went wrong on our side',\n message: \"It's not your fault. Please try again in a few minutes.\",\n },\n badGateway: {\n title: \"We can't reach the service right now\",\n message: 'Please try again in a few minutes.',\n },\n maintenance: {\n title: \"We're doing some maintenance\",\n message: \"We'll be back soon. Thanks for your patience.\",\n },\n timeout: {\n title: 'This is taking too long',\n message: \"The service didn't answer in time. Please try again.\",\n },\n offline: {\n title: \"You're offline\",\n message: 'Check your internet connection, then try again.',\n },\n generic: {\n title: 'Something went wrong',\n message: 'Please try again, or go to the home page.',\n },\n },\n};\n","import type { i18n as I18n } from 'i18next';\nimport { loadLocale } from '../../i18n/config';\nimport { LOCALES_WITH_BUNDLES } from '../../i18n/supported-locales';\n\n/** Where LocalePicker and HeaderSettings save a language the visitor\n * picked: `LOCALE_STORAGE_KEY` in locale-picker.tsx, copied so the error\n * page does not bundle the picker. */\nexport const SAVED_LOCALE_KEY = 'alfadocs-ui.locale';\n\n/** Used when nothing else names a language the kit ships. */\nexport const ERROR_PAGE_FALLBACK_LOCALE = 'it';\n\nexport interface ErrorPageLocaleSources {\n /** Host-supplied locale. Always wins when the kit ships it. */\n locale?: string;\n /** True when `<html lang>` is only the site default, not the visitor's\n * language: for example an error raised before routing read it. */\n hostLocaleIsDefault?: boolean;\n /** Test seams; the browser values are read when omitted. */\n saved?: string | null;\n browser?: readonly string[];\n document?: string;\n}\n\nconst shipped = (tag: string | null | undefined): string | undefined => {\n if (!tag) return undefined;\n const base = tag.toLowerCase().replaceAll('_', '-').split('-')[0];\n // The legacy `cn` code is Chinese.\n const code = base === 'cn' ? 'zh' : base;\n return (LOCALES_WITH_BUNDLES as readonly string[]).includes(code)\n ? code\n : undefined;\n};\n\nconst readSaved = (): string | null => {\n try {\n return window.localStorage.getItem(SAVED_LOCALE_KEY);\n } catch {\n return null;\n }\n};\n\n/**\n * The language to show an error in. First match wins:\n * 1. the `locale` prop;\n * 2. the language the visitor picked before in the kit;\n * 3. the browser's languages, in order;\n * 4. `<html lang>`, unless the host says it is only its default;\n * 5. Italian.\n * Only languages the kit ships count at each step.\n */\nexport function resolveErrorPageLocale(\n sources: ErrorPageLocaleSources = {},\n): string {\n const inBrowser = typeof window !== 'undefined';\n const saved =\n sources.saved !== undefined\n ? sources.saved\n : inBrowser\n ? readSaved()\n : null;\n const browser =\n sources.browser ??\n (inBrowser && typeof navigator !== 'undefined'\n ? navigator.languages?.length\n ? navigator.languages\n : [navigator.language]\n : []);\n const documentLang =\n sources.document ??\n (typeof document !== 'undefined' ? document.documentElement.lang : '');\n\n const candidates = [\n sources.locale,\n saved,\n ...browser,\n sources.hostLocaleIsDefault ? undefined : documentLang,\n ];\n for (const candidate of candidates) {\n const code = shipped(candidate);\n if (code) return code;\n }\n return ERROR_PAGE_FALLBACK_LOCALE;\n}\n\n/** Fetches the kit's bundle for a language without changing the host's\n * active language. Rejects when the bundle cannot load. */\nexport const loadErrorPageLocale = (\n language: string,\n instance: I18n,\n): Promise<void> => loadLocale(language, instance);\n","/* -------------------------------------------------------------------- */\n/* ErrorPage — one branded, translated page for every HTTP error. */\n/* */\n/* A status picks the illustration, the copy and the main action (home, */\n/* retry or log in); a host may override each, e.g. to show an outcome */\n/* of its own. The language is chosen in the browser, so a host */\n/* whose server rendered the error before it knew the visitor's */\n/* language still shows the right one: see `resolveErrorPageLocale`. */\n/* -------------------------------------------------------------------- */\n\nimport {\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport type { i18n as I18n } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CircleQuestionMark, House, LogIn, RotateCcw } from 'lucide-react';\nimport { Button } from '../../components/button';\nimport { Logo } from '../../components/logo';\nimport { isDevelopment } from '../../components/_shared/is-development';\nimport { isSafeHref } from '../../components/_shared/safe-href';\nimport { errorPageStatusSpec } from './error-page-statuses';\nimport {\n ErrorPageIllustration,\n type ErrorPageMood,\n} from './error-page-illustration';\nimport { errorPageEnglish } from './error-page-english';\nimport {\n loadErrorPageLocale,\n resolveErrorPageLocale,\n} from './error-page-locale';\n\nconst errorPageVariants = cva(\n 'ds:flex ds:flex-col ds:items-center ds:justify-center ds:bg-[var(--background)] ds:text-[var(--foreground)] ds:px-[var(--spacing-md)] ds:py-[var(--spacing-2xl)]',\n {\n variants: {\n layout: {\n /** Fills the viewport: the whole page is the error. */\n page: 'ds:min-h-screen',\n /** Fills its container, under the host's own header. */\n embedded: 'ds:[min-block-size:100%]',\n },\n surface: {\n /** The page background. */\n background: '',\n /** A card's surface, for a page set inside a `Card`. The mark\n * cuts its holes with `--background`, so that is re-pointed too. */\n card: 'ds:[--background:var(--card)] ds:[--foreground:var(--card-foreground)]',\n },\n },\n defaultVariants: { layout: 'page', surface: 'background' },\n },\n);\n\nconst RTL = new Set(['ar']);\n\n/** How long to wait for the chosen language before showing English. An\n * error page often appears because the network is failing. */\nconst LANGUAGE_PATIENCE = 1500;\n\n/** \"22:00\" today, \"30 set, 22:00\" on another day, and with the year when\n * it is not this year. Undefined for a date that does not parse, so a\n * bad value shows nothing. */\nfunction formatBackAt(\n value: Date | string,\n locale: string,\n): string | undefined {\n const at = value instanceof Date ? value : new Date(value);\n if (Number.isNaN(at.getTime())) return undefined;\n const now = new Date();\n const day =\n now.toDateString() === at.toDateString()\n ? {}\n : ({\n day: 'numeric',\n month: 'short',\n ...(now.getFullYear() === at.getFullYear()\n ? {}\n : { year: 'numeric' }),\n } as const);\n // Plain `en` formats the US way; the kit writes British English.\n return new Intl.DateTimeFormat(locale === 'en' ? 'en-GB' : locale, {\n ...day,\n hour: '2-digit',\n minute: '2-digit',\n }).format(at);\n}\n\n/** True when the instance holds error page copy for a language. A host\n * may register its own `ui` bundle, even a partial one for this page:\n * the kit's full bundle is still merged in, and English backs every\n * key, so a gap never shows as a raw key. */\nconst hasCopy = (instance: I18n, language: string): boolean =>\n Boolean(instance.getResource(language, 'ui', 'errorPage'));\n\n/** Links the page may render: paths on the same site, and web, mail and\n * phone addresses written out in full. Anything else becomes `#`. */\nconst safeHref = (href: string): string => (isSafeHref(href) ? href : '#');\n\n/** A host's own main action: a link (`href`) or a button (`onClick`).\n * The label is shown as given, so pass it already translated. A link may\n * also take `onClick`, e.g. to record the click: it runs, and the link\n * still opens. */\nexport type ErrorPageCustomAction =\n | { label: string; href: string; onClick?: () => void; icon?: ReactNode }\n | { label: string; onClick: () => void; href?: never; icon?: ReactNode };\n\nexport interface ErrorPageProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'title'>,\n VariantProps<typeof errorPageVariants> {\n /** `'page'` fills the viewport; `'embedded'` fills its container, under\n * the host's own header. Default `'page'`, or `'embedded'` with\n * `surface=\"card\"`. */\n layout?: VariantProps<typeof errorPageVariants>['layout'];\n /** `'card'` takes a card's colour, for a page set inside a `Card`, and\n * then defaults to `layout=\"embedded\"` and `as=\"div\"`. Default\n * `'background'`. */\n surface?: VariantProps<typeof errorPageVariants>['surface'];\n /** HTTP status, `'offline'` for a network error in the browser, or\n * `'maintenance'` for planned downtime with no HTTP error behind it.\n * Statuses without their own copy show the generic page. */\n status: number | 'offline' | 'maintenance';\n /** Where \"Go to the home page\" leads. Default `/`. Like every link\n * here it may be a path on the same site or an `http(s)`, `mailto:`\n * or `tel:` address; anything else is replaced with `#`. */\n homeHref?: string;\n /** Where \"Log in\" leads for 401 and 419. Without it, those statuses\n * offer \"Try again\" instead. */\n loginHref?: string;\n /** Adds \"Contact support\". A path, a web address, `mailto:` or `tel:`. */\n supportHref?: string;\n /** \"Try again\". Default: reload the page. */\n onRetry?: () => void;\n /** Shown for support to quote, e.g. the host's X-Request-Id. */\n requestId?: string;\n /** When planned maintenance should end, for 503 and `'maintenance'`.\n * Shown in the visitor's own time zone and language. Pass a `Date`, or\n * an ISO string with its offset (`2026-10-01T22:00:00+02:00`): without\n * one the browser reads it as the visitor's local time. */\n backAt?: Date | string;\n /** The host's language. Always wins when the kit ships it. */\n locale?: string;\n /** True when `<html lang>` is only the site default, as on an error\n * raised before routing: the page then skips it when choosing. */\n hostLocaleIsDefault?: boolean;\n /** Replaces the status title. Pass it already translated. */\n title?: string;\n /** Replaces the status message. Pass it already translated. */\n message?: string;\n /** Replaces the status's main button with the host's own, e.g. \"Book\n * an appointment\". Where the main button was Home (400, 403, 404,\n * 405, 410 and any status without its own copy), the home link goes\n * with it; where it was \"Try again\" or \"Log in\", the home link\n * stays as the second button. */\n primaryAction?: ErrorPageCustomAction;\n /** Shows \"Go to the home page\". Default true. False hides it on every\n * status, leaving the status's own main button (\"Try again\" or \"Log\n * in\"), or `primaryAction` in its place, and \"Contact support\" when\n * `supportHref` is set. On a status whose main button was Home, that\n * can leave no button at all. */\n showHomeLink?: boolean;\n /** Picks the mark's mood whatever the status, e.g. for a status\n * without its own copy. */\n mood?: ErrorPageMood;\n /** Shows \"Error 404\" above the title. Default true. Turn it off when\n * the page reports an outcome inside an app rather than an HTTP\n * error. */\n showStatusLabel?: boolean;\n /** Signs the page with the Alfadocs wordmark. Default true. */\n showLogo?: boolean;\n /** Renders as `<main>` or as `<div>` when the host already has a main\n * landmark. Default `'main'`, or `'div'` with `surface=\"card\"`. */\n as?: 'main' | 'div';\n /** Moves focus to the heading once shown, and again when the status\n * or `focusKey` changes. Default true. */\n focusHeading?: boolean;\n /** Moves focus to the heading again when it changes, even under the\n * same status: a retry count, say, so a retry that fails the same way\n * is announced again. Copy that changes on its own never moves focus. */\n focusKey?: string | number;\n /** Scrolls the heading into view, if it is not, when it takes focus.\n * Default false, so focus never moves the host's page. Turn it on when\n * the page can appear below the fold, as in a long form. */\n scrollOnFocus?: boolean;\n /** The heading's level. Default 1; pass 2 inside an app page that\n * already has its own `h1`. */\n headingLevel?: 1 | 2 | 3;\n}\n\nexport const ErrorPage = forwardRef<HTMLElement, ErrorPageProps>(\n (\n {\n status,\n homeHref = '/',\n loginHref,\n supportHref,\n onRetry,\n requestId,\n backAt,\n locale,\n hostLocaleIsDefault = false,\n title,\n message,\n primaryAction,\n showHomeLink = true,\n mood,\n showStatusLabel = true,\n showLogo = true,\n as,\n focusHeading = true,\n focusKey,\n scrollOnFocus = false,\n headingLevel = 1,\n layout,\n surface,\n className,\n ...rest\n },\n ref,\n ) => {\n // This page handles a missing bundle itself (below), so it stays out of\n // the gate that holds other kit components back until their bundle lands.\n const { i18n } = useTranslation('ui', { useSuspense: false });\n const language = useMemo(\n () => resolveErrorPageLocale({ locale, hostLocaleIsDefault }),\n [locale, hostLocaleIsDefault],\n );\n // The chosen language may not be loaded yet. Until it is, the page\n // stays hidden rather than flashing English. If it cannot load, or\n // takes too long (offline, a failing gateway), the page shows in\n // English and switches over if the language arrives after all.\n // `for` is the language each answer was given for: when the language\n // changes, the old answer is still on screen until the new one comes.\n const [answer, setAnswer] = useState<{\n for: string;\n shown: string | null;\n }>(() => ({\n for: language,\n shown: hasCopy(i18n, language) ? language : null,\n }));\n const shown = answer.shown;\n // Bumped when a bundle lands, so copy that arrives then is drawn.\n const [, setLoaded] = useState(0);\n useEffect(() => {\n let current = true;\n const ready = hasCopy(i18n, language);\n const show = (next: string | null) =>\n setAnswer((now) =>\n now.for === language && now.shown === next\n ? now\n : { for: language, shown: next },\n );\n // English if nothing for this language is shown yet.\n const english = () =>\n setAnswer((now) =>\n now.for === language && now.shown\n ? now\n : { for: language, shown: 'en' },\n );\n show(ready ? language : null);\n // The kit's English is a lazy chunk, which cannot load when the network\n // is down. Put the page's own English copy in the store first, so the\n // fallback below is real text, never raw keys. It holds only the\n // `errorPage` group, so the kit does not count it as a whole bundle and\n // the full English still loads over it, keeping what is already there.\n if (!hasCopy(i18n, 'en'))\n i18n.addResourceBundle(\n 'en',\n 'ui',\n { errorPage: errorPageEnglish },\n true,\n false,\n );\n const landed = () => current && setLoaded((count) => count + 1);\n // The kit's full bundles: English backs every key, and a host's own\n // instance may hold neither yet. A loaded bundle resolves at once.\n void loadErrorPageLocale('en', i18n)\n .then(landed)\n .catch(() => undefined);\n const patience = ready\n ? undefined\n : setTimeout(() => current && english(), LANGUAGE_PATIENCE);\n loadErrorPageLocale(language, i18n)\n .then(() => {\n if (!current) return;\n show(language);\n landed();\n })\n .catch(() => current && english());\n return () => {\n current = false;\n clearTimeout(patience);\n };\n }, [i18n, language]);\n\n // The chosen language first, English for any key it lacks.\n const t = i18n.getFixedT(\n shown && shown !== 'en' ? [shown, 'en'] : 'en',\n 'ui',\n );\n const spec = errorPageStatusSpec(status);\n const backTime =\n spec.key === 'maintenance' && backAt\n ? formatBackAt(backAt, shown ?? 'en')\n : undefined;\n\n const headingRef = useRef<HTMLHeadingElement | null>(null);\n const copyId = useId();\n // Once per status and focusKey: copy that arrives late (the kit's\n // language or the host's) must not pull focus back, but a different\n // status or key shown in place must be announced. And only once the\n // language asked for has answered: while the old one is still on\n // screen, focus would land before the page appears in the new one.\n const focusFor = `${String(status)}:${focusKey ?? ''}`;\n const focusedFor = useRef<string | null>(null);\n useEffect(() => {\n if (!focusHeading || !answer.shown || answer.for !== language) return;\n if (focusedFor.current === focusFor) return;\n focusedFor.current = focusFor;\n const heading = headingRef.current;\n heading?.focus({ preventScroll: true });\n if (scrollOnFocus) heading?.scrollIntoView({ block: 'nearest' });\n }, [answer, language, focusHeading, focusFor, scrollOnFocus]);\n const Heading = (['h1', 'h2', 'h3'] as const)[headingLevel - 1];\n\n // A blank label leaves the host's button with no accessible name.\n const blankLabel =\n primaryAction !== undefined &&\n (typeof primaryAction.label !== 'string' ||\n primaryAction.label.trim() === '');\n // isDevelopment, not import.meta.env.DEV: the library build strips the\n // latter, and this warning is for the host's developer.\n useEffect(() => {\n if (blankLabel && isDevelopment()) {\n console.warn(\n 'ErrorPage: `primaryAction.label` is empty, so its button has no accessible name. Pass the label, already translated.',\n );\n }\n }, [blankLabel]);\n\n // A page inside a card is part of the host's page.\n const inCard = surface === 'card';\n const Root = as ?? (inCard ? 'div' : 'main');\n\n const retry = onRetry ?? (() => window.location.reload());\n const primary =\n spec.primary === 'login' && !loginHref ? 'retry' : spec.primary;\n\n const link = (\n action: 'home' | 'login' | 'support',\n href: string,\n icon: ReactNode,\n intent: 'primary' | 'secondary' | 'ghost',\n ) => (\n <Button\n key={action}\n intent={intent}\n size=\"lg\"\n flipIconInRtl={action === 'login'}\n asChild\n startIcon={icon}\n data-action={action}\n >\n <a href={safeHref(href)}>{t(`errorPage.actions.${action}`)}</a>\n </Button>\n );\n\n const actions: ReactNode[] = [];\n if (primaryAction) {\n actions.push(\n typeof primaryAction.href === 'string' ? (\n <Button\n key=\"custom\"\n intent=\"primary\"\n size=\"lg\"\n asChild\n startIcon={primaryAction.icon}\n data-action=\"custom\"\n >\n <a\n href={safeHref(primaryAction.href)}\n onClick={primaryAction.onClick}\n >\n {primaryAction.label}\n </a>\n </Button>\n ) : (\n <Button\n key=\"custom\"\n intent=\"primary\"\n size=\"lg\"\n startIcon={primaryAction.icon}\n onClick={primaryAction.onClick}\n data-action=\"custom\"\n >\n {primaryAction.label}\n </Button>\n ),\n );\n } else if (primary === 'retry') {\n actions.push(\n <Button\n key=\"retry\"\n intent=\"primary\"\n size=\"lg\"\n startIcon={<RotateCcw aria-hidden=\"true\" />}\n onClick={retry}\n data-action=\"retry\"\n >\n {t('errorPage.actions.retry')}\n </Button>,\n );\n } else if (primary === 'login' && loginHref) {\n actions.push(\n link('login', loginHref, <LogIn aria-hidden=\"true\" />, 'primary'),\n );\n }\n // Always a way back, except offline or during maintenance, where\n // there is nowhere to go, where the host's own action replaced it, and\n // where the host turned it off.\n if (\n showHomeLink &&\n status !== 'offline' &&\n spec.key !== 'maintenance' &&\n !(primaryAction && primary === 'home')\n ) {\n actions.push(\n link(\n 'home',\n homeHref,\n <House aria-hidden=\"true\" />,\n primary === 'home' ? 'primary' : 'secondary',\n ),\n );\n }\n if (supportHref) {\n actions.push(\n link(\n 'support',\n supportHref,\n <CircleQuestionMark aria-hidden=\"true\" />,\n 'ghost',\n ),\n );\n }\n\n return (\n <Root\n ref={ref as Ref<HTMLDivElement>}\n data-component=\"error-page\"\n data-status={String(status)}\n lang={shown ?? undefined}\n aria-busy={shown ? undefined : true}\n dir={shown && RTL.has(shown) ? 'rtl' : 'ltr'}\n className={errorPageVariants({\n layout: layout ?? (inCard ? 'embedded' : undefined),\n surface,\n className,\n })}\n {...rest}\n >\n <div\n className={\n shown\n ? 'ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:text-center ds:[max-inline-size:32rem]'\n : 'ds:invisible'\n }\n >\n <ErrorPageIllustration mood={mood ?? spec.mood} />\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {/* Focus lands here, so the status label sits inside the\n heading: a screen reader would never read a label before\n it. No outline: the heading is focused by script only and\n is not in the tab order. */}\n <Heading\n ref={headingRef}\n tabIndex={-1}\n aria-describedby={\n backTime\n ? `${copyId}-message ${copyId}-back`\n : `${copyId}-message`\n }\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:outline-none\"\n >\n {showStatusLabel && typeof status === 'number' && (\n <span className=\"type-label ds:text-[var(--muted-foreground)]\">\n {t('errorPage.statusLabel', { status })}\n </span>\n )}\n <span className=\"type-title-page\">\n {title ?? t(`errorPage.status.${spec.key}.title`)}\n </span>\n </Heading>\n <p\n id={`${copyId}-message`}\n className=\"type-body ds:text-[var(--muted-foreground)]\"\n >\n {message ?? t(`errorPage.status.${spec.key}.message`)}\n </p>\n {backTime && (\n <p id={`${copyId}-back`} className=\"type-body ds:font-semibold\">\n {t('errorPage.backAt', { time: backTime })}\n </p>\n )}\n </div>\n {actions.length > 0 && (\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:justify-center ds:gap-[var(--spacing-sm)]\">\n {actions}\n </div>\n )}\n {requestId && (\n <p className=\"type-body-sm ds:text-[var(--muted-foreground)]\">\n {t('errorPage.reference', { id: requestId })}\n <br />\n {t('errorPage.referenceHint')}\n </p>\n )}\n {showLogo && <Logo decorative size=\"sm\" className=\"ds:opacity-70\" />}\n </div>\n </Root>\n );\n },\n);\nErrorPage.displayName = 'ErrorPage';\n"],"names":["__iconNode","CircleQuestionMark","createLucideIcon","ERROR_PAGE_STATUSES","SPECS","errorPageStatusSpec","status","errorPageEnglish","SAVED_LOCALE_KEY","ERROR_PAGE_FALLBACK_LOCALE","shipped","tag","base","code","LOCALES_WITH_BUNDLES","readSaved","resolveErrorPageLocale","sources","inBrowser","saved","browser","_a","documentLang","candidates","candidate","loadErrorPageLocale","language","instance","loadLocale","errorPageVariants","cva","RTL","LANGUAGE_PATIENCE","formatBackAt","value","locale","at","now","day","hasCopy","safeHref","href","isSafeHref","ErrorPage","forwardRef","homeHref","loginHref","supportHref","onRetry","requestId","backAt","hostLocaleIsDefault","title","message","primaryAction","showHomeLink","mood","showStatusLabel","showLogo","as","focusHeading","focusKey","scrollOnFocus","headingLevel","layout","surface","className","rest","ref","i18n","useTranslation","useMemo","answer","setAnswer","useState","shown","setLoaded","useEffect","current","ready","show","next","english","landed","count","patience","t","spec","backTime","headingRef","useRef","copyId","useId","focusFor","focusedFor","heading","Heading","blankLabel","isDevelopment","inCard","Root","retry","primary","link","action","icon","intent","jsx","Button","actions","RotateCcw","LogIn","House","jsxs","ErrorPageIllustration","Logo"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,MAAM,KAAK,UAAU;AAAA,EACzD,CAAC,QAAQ,EAAE,GAAG,wCAAwC,KAAK,SAAQ,CAAE;AAAA,EACrE,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,KAAqBC,GAAiB,wBAAwBF,EAAU,GCXjEG,KAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAeM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AAAA,sBAAAlC,KAAmB,OAAOnD,KAAW,YACpC,gBAAAqG,EAAC,QAAA,EAAK,WAAU,gDACb,UAAArB,EAAE,yBAAyB,EAAE,QAAAhF,EAAA,CAAQ,EAAA,CACxC;AAAA,sBAEF,gBAAAqG,EAAC,QAAA,EAAK,WAAU,mBACb,UAAAvD,KAASkC,EAAE,oBAAoBC,EAAK,GAAG,QAAQ,EAAA,CAClD;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAEF,gBAAAoB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,IAAI,GAAGhB,CAAM;AAAA,oBACb,WAAU;AAAA,oBAET,UAAAtC,KAAWiC,EAAE,oBAAoBC,EAAK,GAAG,UAAU;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAErDC,KACC,gBAAAmB,EAAC,KAAA,EAAE,IAAI,GAAGhB,CAAM,SAAS,WAAU,8BAChC,YAAE,oBAAoB,EAAE,MAAMH,EAAA,CAAU,EAAA,CAC3C;AAAA,cAAA,GAEJ;AAAA,cACCqB,EAAQ,SAAS,uBACf,OAAA,EAAI,WAAU,qFACZ,UAAAA,GACH;AAAA,cAED5D,KACC,gBAAAgE,EAAC,KAAA,EAAE,WAAU,kDACV,UAAA;AAAA,gBAAA3B,EAAE,uBAAuB,EAAE,IAAIrC,EAAA,CAAW;AAAA,kCAC1C,MAAA,EAAG;AAAA,gBACHqC,EAAE,yBAAyB;AAAA,cAAA,GAC9B;AAAA,cAED5B,uBAAayD,IAAA,EAAK,YAAU,IAAC,MAAK,MAAK,WAAU,gBAAA,CAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACpE;AAAA,IAAA;AAAA,EAGN;AACF;AACAxE,GAAU,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsx as s, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as K, useState as P, useRef as m, useId as Q, useEffect as h, useCallback as E } from "react";
|
|
3
|
+
import { useTranslation as X } from "react-i18next";
|
|
4
|
+
import { c as L } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { C as D } from "./card-n6W6LW-N.js";
|
|
6
|
+
import { B as p } from "./button-DohK_Ak_.js";
|
|
7
|
+
import { u as Y } from "./use-countdown-Yd6ts0_a.js";
|
|
8
|
+
import { i as Z } from "./is-development-CLUAnsU7.js";
|
|
9
|
+
import { i as $ } from "./safe-href-5dbsfbQn.js";
|
|
10
|
+
import { C as ee } from "./circle-check-BN6rz4NV.js";
|
|
11
|
+
function I(t) {
|
|
12
|
+
const n = globalThis.window !== void 0 && globalThis;
|
|
13
|
+
return !!(n && (/Chromatic/.test(n.navigator.userAgent) || /chromatic=true/.test(n.location.href)));
|
|
14
|
+
}
|
|
15
|
+
const se = "https://www.alfadocs.com", te = 10, ne = L(
|
|
16
|
+
"ds:flex ds:flex-1 ds:flex-col ds:items-center ds:overflow-y-auto ds:p-[var(--spacing-lg)]"
|
|
17
|
+
), _ = L("ds:size-12", {
|
|
18
|
+
variants: {
|
|
19
|
+
tone: {
|
|
20
|
+
success: "ds:text-[var(--success)]",
|
|
21
|
+
neutral: "ds:inline-flex ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-full"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { tone: "success" }
|
|
25
|
+
});
|
|
26
|
+
function B(t) {
|
|
27
|
+
if (typeof t != "string" || t.length === 0 || t.startsWith("//")) return !1;
|
|
28
|
+
if (t.startsWith("/")) return !0;
|
|
29
|
+
try {
|
|
30
|
+
const { protocol: n } = new URL(t, window.location.origin);
|
|
31
|
+
return n === "https:" || n === "http:";
|
|
32
|
+
} catch {
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const oe = K(
|
|
37
|
+
({
|
|
38
|
+
title: t,
|
|
39
|
+
body: n,
|
|
40
|
+
icon: a,
|
|
41
|
+
action: e,
|
|
42
|
+
autoCloseSeconds: g,
|
|
43
|
+
redirectUrl: r,
|
|
44
|
+
brandUrl: l = se,
|
|
45
|
+
onClose: c,
|
|
46
|
+
countdownLabel: w,
|
|
47
|
+
closeNowLabel: j,
|
|
48
|
+
redirectingLabel: V,
|
|
49
|
+
focusOnMount: H = !0,
|
|
50
|
+
className: O,
|
|
51
|
+
...W
|
|
52
|
+
}, M) => {
|
|
53
|
+
const { t: u } = X("ui"), [v, U] = P(!1), x = m(!1), y = m(null), C = Q(), f = e ? 0 : g ?? te, o = f > 0;
|
|
54
|
+
h(() => {
|
|
55
|
+
var A;
|
|
56
|
+
H && ((A = y.current) == null || A.focus({ preventScroll: !0 }));
|
|
57
|
+
}, []);
|
|
58
|
+
const T = E(() => {
|
|
59
|
+
if (!x.current) {
|
|
60
|
+
if (x.current = !0, U(!0), c) {
|
|
61
|
+
c();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
r ? B(r) && window.location.assign(r) : (window.close(), B(l) && window.location.assign(l));
|
|
65
|
+
}
|
|
66
|
+
}, [c, r, l]), { remaining: b, start: q, reset: G } = Y(f, {
|
|
67
|
+
autoStart: o && !I(),
|
|
68
|
+
onElapsed: o ? T : void 0
|
|
69
|
+
}), N = m(!1);
|
|
70
|
+
h(() => {
|
|
71
|
+
if (!N.current) {
|
|
72
|
+
N.current = !0;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
o ? I() || q() : G();
|
|
76
|
+
}, [f]);
|
|
77
|
+
const J = w ? w(b) : u("finishedTerminal.autoClose", { seconds: b }), i = e == null ? void 0 : e.onClick, k = E(() => {
|
|
78
|
+
i == null || i();
|
|
79
|
+
}, [i]), d = (e == null ? void 0 : e.href) !== void 0 && $(e.href) ? e.href : void 0, F = (e == null ? void 0 : e.href) !== void 0 && d === void 0, R = e !== void 0 && i === void 0 && d === void 0, S = e !== void 0 && g !== void 0;
|
|
80
|
+
return h(() => {
|
|
81
|
+
Z() && (F && console.warn(
|
|
82
|
+
"FinishedTerminal: `action.href` is not an http(s), mailto: or tel: address or a path on this site, so the button is not a link."
|
|
83
|
+
), S && console.warn(
|
|
84
|
+
"FinishedTerminal: `autoCloseSeconds` is ignored when `action` is given; the button stands alone with no countdown."
|
|
85
|
+
), R && console.warn(
|
|
86
|
+
"FinishedTerminal: `action` has no `onClick` and no usable `href`, so its button does nothing."
|
|
87
|
+
));
|
|
88
|
+
}, [F, R, S]), /* @__PURE__ */ s(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
ref: M,
|
|
92
|
+
"data-component": "finished-terminal",
|
|
93
|
+
className: ne({ className: O }),
|
|
94
|
+
...W,
|
|
95
|
+
children: /* @__PURE__ */ s(
|
|
96
|
+
D,
|
|
97
|
+
{
|
|
98
|
+
variant: "elevated",
|
|
99
|
+
className: "ds:my-auto ds:min-w-0 ds:[inline-size:100%] ds:max-w-[28rem] ds:text-center",
|
|
100
|
+
children: /* @__PURE__ */ s(D.Body, { children: /* @__PURE__ */ z("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]", children: [
|
|
101
|
+
a === void 0 ? /* @__PURE__ */ s(
|
|
102
|
+
ee,
|
|
103
|
+
{
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
className: _({ tone: "success" })
|
|
106
|
+
}
|
|
107
|
+
) : a ? /* @__PURE__ */ s(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
className: _({ tone: "neutral" }),
|
|
112
|
+
children: a
|
|
113
|
+
}
|
|
114
|
+
) : null,
|
|
115
|
+
/* @__PURE__ */ s(
|
|
116
|
+
"h1",
|
|
117
|
+
{
|
|
118
|
+
ref: y,
|
|
119
|
+
tabIndex: -1,
|
|
120
|
+
"aria-describedby": o && !v ? C : void 0,
|
|
121
|
+
className: "type-title-card ds:m-0 ds:outline-none",
|
|
122
|
+
children: t
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ s("p", { className: "type-body ds:m-0 ds:text-[var(--muted-foreground)]", children: n }),
|
|
126
|
+
e && d !== void 0 ? /* @__PURE__ */ s(
|
|
127
|
+
p,
|
|
128
|
+
{
|
|
129
|
+
asChild: !0,
|
|
130
|
+
intent: "primary",
|
|
131
|
+
size: "lg",
|
|
132
|
+
loading: e.loading,
|
|
133
|
+
"data-action": "next-step",
|
|
134
|
+
children: /* @__PURE__ */ s("a", { href: d, onClick: k, children: e.label })
|
|
135
|
+
}
|
|
136
|
+
) : e ? /* @__PURE__ */ s(
|
|
137
|
+
p,
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
intent: "primary",
|
|
141
|
+
size: "lg",
|
|
142
|
+
loading: e.loading,
|
|
143
|
+
"data-action": "next-step",
|
|
144
|
+
onClick: k,
|
|
145
|
+
children: e.label
|
|
146
|
+
}
|
|
147
|
+
) : null,
|
|
148
|
+
o && v ? (
|
|
149
|
+
// Mounts once when closing begins → role="status" announces the
|
|
150
|
+
// hand-off exactly once (no churn).
|
|
151
|
+
/* @__PURE__ */ s(
|
|
152
|
+
"p",
|
|
153
|
+
{
|
|
154
|
+
role: "status",
|
|
155
|
+
className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
|
|
156
|
+
children: V ?? u("finishedTerminal.redirecting")
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
) : o ? /* @__PURE__ */ z("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
160
|
+
/* @__PURE__ */ s(
|
|
161
|
+
"p",
|
|
162
|
+
{
|
|
163
|
+
id: C,
|
|
164
|
+
className: "type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]",
|
|
165
|
+
children: J
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ s(
|
|
169
|
+
p,
|
|
170
|
+
{
|
|
171
|
+
intent: "secondary",
|
|
172
|
+
size: "lg",
|
|
173
|
+
type: "button",
|
|
174
|
+
"data-action": "close-now",
|
|
175
|
+
onClick: T,
|
|
176
|
+
children: j ?? u("finishedTerminal.closeNow")
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
] }) : null
|
|
180
|
+
] }) })
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
oe.displayName = "FinishedTerminal";
|
|
188
|
+
export {
|
|
189
|
+
oe as F
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=finished-terminal-unDnXT4j.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finished-terminal-unDnXT4j.js","sources":["../../node_modules/chromatic/isChromatic.mjs","../../src/components/finished-terminal/finished-terminal.tsx"],"sourcesContent":["export default function isChromatic(windowArgument) {\n const windowToCheck = windowArgument || (globalThis.window !== undefined && globalThis);\n return !!(\n windowToCheck &&\n (/Chromatic/.test(windowToCheck.navigator.userAgent) ||\n /chromatic=true/.test(windowToCheck.location.href))\n );\n}\n","/*\n * FinishedTerminal: the end screen a public flow (for example\n * sign.alfadocs.com) lands on once the user is done. A mark (the success\n * tick, or the host's `icon`), the host's title and body, then the next\n * step:\n *\n * - Countdown (the default): an i18n'd auto-close countdown and \"Close\n * now\". On elapse or press it calls `onClose`; without one it navigates\n * to `redirectUrl`, or tries `window.close()` (blocked for tabs the\n * signer opened themselves) and falls back to `brandUrl`, the public\n * site.\n * - Button only (HTP-6900, SIGN-DS-01): with `action`, one button and no\n * countdown. It calls the host's `onClick` or follows its `href`; the\n * component runs no timer, so the user is never moved on against their\n * will (WCAG 2.2.1).\n * - Static: `autoCloseSeconds={0}` and no `action`, so no next step.\n *\n * The countdown's browser navigation is its DEFAULT; pass `onClose` to\n * take it over (analytics, SPA routing, a no-op in stories). The countdown\n * freezes under Chromatic for deterministic snapshots.\n */\n\nimport isChromatic from 'chromatic/isChromatic';\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { cva } from 'class-variance-authority';\nimport { CircleCheck } from 'lucide-react';\nimport { Card } from '../card';\nimport { Button } from '../button';\nimport { useCountdown } from '../../hooks/use-countdown';\nimport { isDevelopment } from '../_shared/is-development';\nimport { isSafeHref } from '../_shared/safe-href';\n\n/** The public brand site the terminal falls back to when there's no\n * `redirectUrl` and `window.close()` is blocked. */\nconst DEFAULT_BRAND_URL = 'https://www.alfadocs.com';\n\n/** The countdown, in seconds, when the host gives neither\n * `autoCloseSeconds` nor `action`. */\nconst DEFAULT_AUTO_CLOSE_SECONDS = 10;\n\nconst rootVariants = cva(\n 'ds:flex ds:flex-1 ds:flex-col ds:items-center ds:overflow-y-auto ds:p-[var(--spacing-lg)]',\n);\n\n/* The mark above the title. `success` is the default tick, unchanged.\n `neutral` sizes the host's icon to match and paints it in the muted\n text colour: a host icon marks an end screen that is not a success. */\nconst markVariants = cva('ds:size-12', {\n variants: {\n tone: {\n success: 'ds:text-[var(--success)]',\n neutral:\n 'ds:inline-flex ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-full',\n },\n },\n defaultVariants: { tone: 'success' },\n});\n\n/**\n * Gate for the URLs the terminal will navigate to. Allows only same-origin\n * relative paths (`/…`) and explicit `http(s)` absolute URLs; rejects\n * `javascript:` / `data:` / `vbscript:` and any other scheme.\n *\n * This terminal lives on public signing pages where `redirectUrl` may flow\n * from a URL parameter, so a hostile `javascript:…` value must never reach\n * `window.location.assign` (it would execute in the page). Exported for unit\n * testing — it is NOT part of the public component API (`index.ts` does not\n * re-export it).\n */\nexport function isNavigableUrl(url: string): boolean {\n if (typeof url !== 'string' || url.length === 0) return false;\n // Protocol-relative `//host` is a classic open-redirect bypass (it resolves\n // to a cross-origin http(s) URL) — reject it; a caller wanting a cross-origin\n // target must pass an explicit `https://` URL.\n if (url.startsWith('//')) return false;\n // Same-origin relative path.\n if (url.startsWith('/')) return true;\n try {\n const { protocol } = new URL(url, window.location.origin);\n return protocol === 'https:' || protocol === 'http:';\n } catch {\n return false;\n }\n}\n\n/** The one button of the button-only end screen (`action`). */\nexport interface FinishedTerminalAction {\n /**\n * The button's label, already translated (for example \"Sign in again\").\n * Keep it short: it stays on one line and is cut with \"…\" when the card is\n * narrower than it, and the full label stays the accessible name.\n */\n label: string;\n /**\n * Called when the button is pressed. With `href` as well, it runs first\n * and the link is then followed (for example to record the press).\n */\n onClick?: () => void;\n /**\n * Makes the button a link to this address.\n *\n * @security Only `http(s)`, `mailto:` and `tel:` addresses and paths on\n * this site become a link. Anything else (`javascript:`, `data:`, or a\n * relative address that leaves the site, such as `//host`) is dropped,\n * and the button only calls `onClick`.\n */\n href?: string;\n /**\n * The host is acting on the press (for example starting again): the\n * button shows a spinner and ignores presses, and keeps keyboard focus.\n * Default `false`.\n */\n loading?: boolean;\n}\n\nexport interface FinishedTerminalProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title'\n> {\n /** Completion headline — consumer-provided, already translated. */\n title: string;\n /** Completion sub-message — consumer-provided, already translated. */\n body: ReactNode;\n /**\n * Replaces the success tick above the title, for an end screen that is\n * not a success: signed out, timed out, link expired, cancelled by the\n * practice. Decorative: hidden from assistive technology, so the title\n * must say what happened. Drawn at the tick's size in the muted text\n * colour; a colour class on the icon itself overrides the colour. `null`\n * shows no icon. Default: the success tick.\n */\n icon?: ReactNode;\n /**\n * The one button of the button-only end screen (HTP-6900: \"The finished\n * screen has a button and no countdown\"). With `action` the screen shows\n * this button and no countdown, and the component runs no timer;\n * `autoCloseSeconds` is ignored, because a timed move away would take the\n * choice from the user. The button carries `data-action=\"next-step\"`.\n */\n action?: FinishedTerminalAction;\n /**\n * Auto-close countdown, in seconds. Default `10`. `0` turns the countdown\n * off: a static success screen with no next step. Ignored when `action`\n * is given: the button stands alone, with no countdown.\n */\n autoCloseSeconds?: number;\n /**\n * Where to send the signer when the countdown elapses / \"Close now\" is\n * pressed. When omitted, the terminal does a best-effort `window.close()`\n * and falls back to `brandUrl`.\n *\n * @security Navigated to via `window.location.assign`. Only same-origin\n * relative paths and `http(s)` absolute URLs are honoured — `javascript:` /\n * `data:` values are dropped. Pass a value from trusted backend config.\n */\n redirectUrl?: string;\n /**\n * Brand-site fallback used when there is no `redirectUrl` and the\n * best-effort `window.close()` is blocked. Default `https://www.alfadocs.com`.\n *\n * @security Same navigation gate as `redirectUrl`.\n */\n brandUrl?: string;\n /**\n * Override the default close/redirect behaviour (e.g. SPA routing, analytics,\n * or a no-op in stories). When provided, the terminal does NO browser\n * navigation of its own: it just calls this. Close now and the countdown\n * running out call it; the `action` button never does.\n */\n onClose?: () => void;\n /** Override the countdown line (default `ui.finishedTerminal.autoClose`). */\n countdownLabel?: (seconds: number) => string;\n /**\n * Override the \"Close now\" label (default `ui.finishedTerminal.closeNow`).\n * The button carries `data-action=\"close-now\"`.\n */\n closeNowLabel?: string;\n /** Override the post-close line (default `ui.finishedTerminal.redirecting`). */\n redirectingLabel?: string;\n /**\n * Move focus to the heading on mount. Default `true`. Set `false` when the\n * host decides where focus goes, for example a screen shown on a docs page\n * or one that is not the result of a user action.\n */\n focusOnMount?: boolean;\n}\n\nexport const FinishedTerminal = forwardRef<\n HTMLDivElement,\n FinishedTerminalProps\n>(\n (\n {\n title,\n body,\n icon,\n action,\n autoCloseSeconds,\n redirectUrl,\n brandUrl = DEFAULT_BRAND_URL,\n onClose,\n countdownLabel,\n closeNowLabel,\n redirectingLabel,\n focusOnMount = true,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const [closing, setClosing] = useState(false);\n const closedRef = useRef(false);\n const headingRef = useRef<HTMLHeadingElement>(null);\n\n const countdownId = useId();\n\n // Button-only mode (HTP-6900): an `action` means no countdown, whatever\n // `autoCloseSeconds` says (WCAG 2.2.1: no timed move away). Without an\n // `action` the default stays 10 seconds.\n const countdownSeconds = action\n ? 0\n : (autoCloseSeconds ?? DEFAULT_AUTO_CLOSE_SECONDS);\n const showCountdown = countdownSeconds > 0;\n\n // Move focus to the completion heading on mount so assistive tech announces\n // the terminal on arrival. This surface is reached by a flow/page\n // transition, which otherwise leaves focus on <body> with no spoken\n // context. The heading is a non-interactive focus receiver (tabIndex={-1},\n // no visible ring) — the SPA \"route changed\" announcement pattern.\n useEffect(() => {\n if (!focusOnMount) return;\n // preventScroll: focus is for the AT announcement, not for bringing the\n // terminal into view — the flow transition already did that. Without it\n // a docs page embedding this story scroll-jumps to the canvas on load.\n headingRef.current?.focus({ preventScroll: true });\n // Mount only: a later change of the prop never pulls focus.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleClose = useCallback(() => {\n if (closedRef.current) return;\n closedRef.current = true;\n setClosing(true);\n if (onClose) {\n onClose();\n return;\n }\n // Default: navigate to the configured return URL, or best-effort close\n // the tab and fall back to the brand site (window.close() is blocked for\n // tabs the user opened themselves, so the redirect is the real fallback).\n // Both URLs are gated against javascript:/data: schemes before navigating.\n if (redirectUrl) {\n if (isNavigableUrl(redirectUrl)) window.location.assign(redirectUrl);\n } else {\n window.close();\n if (isNavigableUrl(brandUrl)) window.location.assign(brandUrl);\n }\n }, [onClose, redirectUrl, brandUrl]);\n\n // Freeze the countdown under Chromatic so the snapshot is deterministic.\n // A countdown turned off after mount (an `action` arriving late, say)\n // must not close the page from its hidden timer, so it gets no\n // `onElapsed` while hidden.\n const { remaining, start, reset } = useCountdown(countdownSeconds, {\n autoStart: showCountdown && !isChromatic(),\n onElapsed: showCountdown ? handleClose : undefined,\n });\n\n // `useCountdown` reads its duration once, so a change after mount (an\n // `action` arriving or leaving, `autoCloseSeconds` going 0 to 5) is\n // applied here: stop and reset when the countdown is off, restart from\n // the new duration when it is on. The first run matches the initial\n // state, so it is skipped.\n const countdownMounted = useRef(false);\n useEffect(() => {\n if (!countdownMounted.current) {\n countdownMounted.current = true;\n return;\n }\n if (!showCountdown) reset();\n else if (!isChromatic()) start();\n // start and reset change with the duration; this runs once per change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [countdownSeconds]);\n\n const countdownText = countdownLabel\n ? countdownLabel(remaining)\n : t('finishedTerminal.autoClose', { seconds: remaining });\n\n // The `action` button is a link only when `href` passes the shared link\n // gate; a refused address falls back to a plain button. The host's\n // `onClick` is called without the click event.\n const actionOnClick = action?.onClick;\n const handleActionClick = useCallback(() => {\n actionOnClick?.();\n }, [actionOnClick]);\n const actionHref =\n action?.href !== undefined && isSafeHref(action.href)\n ? action.href\n : undefined;\n const hrefRefused = action?.href !== undefined && actionHref === undefined;\n const actionInert =\n action !== undefined &&\n actionOnClick === undefined &&\n actionHref === undefined;\n const secondsIgnored =\n action !== undefined && autoCloseSeconds !== undefined;\n\n // Development only: say why the button will not do what the host meant.\n useEffect(() => {\n if (!isDevelopment()) return;\n if (hrefRefused) {\n console.warn(\n 'FinishedTerminal: `action.href` is not an http(s), mailto: or tel: address or a path on this site, so the button is not a link.',\n );\n }\n if (secondsIgnored) {\n console.warn(\n 'FinishedTerminal: `autoCloseSeconds` is ignored when `action` is given; the button stands alone with no countdown.',\n );\n }\n if (actionInert) {\n console.warn(\n 'FinishedTerminal: `action` has no `onClick` and no usable `href`, so its button does nothing.',\n );\n }\n }, [hrefRefused, actionInert, secondsIgnored]);\n\n return (\n <div\n ref={ref}\n data-component=\"finished-terminal\"\n className={rootVariants({ className })}\n {...rest}\n >\n <Card\n variant=\"elevated\"\n className=\"ds:my-auto ds:min-w-0 ds:[inline-size:100%] ds:max-w-[28rem] ds:text-center\"\n >\n <Card.Body>\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]\">\n {icon === undefined ? (\n <CircleCheck\n aria-hidden=\"true\"\n className={markVariants({ tone: 'success' })}\n />\n ) : icon ? (\n <span\n aria-hidden=\"true\"\n className={markVariants({ tone: 'neutral' })}\n >\n {icon}\n </span>\n ) : null}\n <h1\n ref={headingRef}\n tabIndex={-1}\n aria-describedby={\n showCountdown && !closing ? countdownId : undefined\n }\n className=\"type-title-card ds:m-0 ds:outline-none\"\n >\n {title}\n </h1>\n <p className=\"type-body ds:m-0 ds:text-[var(--muted-foreground)]\">\n {body}\n </p>\n {action && actionHref !== undefined ? (\n <Button\n asChild\n intent=\"primary\"\n size=\"lg\"\n loading={action.loading}\n data-action=\"next-step\"\n >\n <a href={actionHref} onClick={handleActionClick}>\n {action.label}\n </a>\n </Button>\n ) : action ? (\n <Button\n type=\"button\"\n intent=\"primary\"\n size=\"lg\"\n loading={action.loading}\n data-action=\"next-step\"\n onClick={handleActionClick}\n >\n {action.label}\n </Button>\n ) : null}\n {showCountdown && closing ? (\n // Mounts once when closing begins → role=\"status\" announces the\n // hand-off exactly once (no churn).\n <p\n role=\"status\"\n className=\"type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]\"\n >\n {redirectingLabel ?? t('finishedTerminal.redirecting')}\n </p>\n ) : showCountdown ? (\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* The ticking count is visible-only — NO live region. A\n polite region re-rewritten every second would announce\n \"…10 sec…9 sec…8 sec…\", which is hostile to SR users. The\n completion itself is announced via the focused heading,\n which points here with aria-describedby, so the count is\n read once when the heading takes focus. */}\n <p\n id={countdownId}\n className=\"type-body-sm ds:m-0 ds:text-[var(--muted-foreground)]\"\n >\n {countdownText}\n </p>\n <Button\n intent=\"secondary\"\n size=\"lg\"\n type=\"button\"\n data-action=\"close-now\"\n onClick={handleClose}\n >\n {closeNowLabel ?? t('finishedTerminal.closeNow')}\n </Button>\n </div>\n ) : null}\n </div>\n </Card.Body>\n </Card>\n </div>\n );\n },\n);\n\nFinishedTerminal.displayName = 'FinishedTerminal';\n"],"names":["isChromatic","windowArgument","windowToCheck","DEFAULT_BRAND_URL","DEFAULT_AUTO_CLOSE_SECONDS","rootVariants","cva","markVariants","isNavigableUrl","url","protocol","FinishedTerminal","forwardRef","title","body","icon","action","autoCloseSeconds","redirectUrl","brandUrl","onClose","countdownLabel","closeNowLabel","redirectingLabel","focusOnMount","className","rest","ref","t","useTranslation","closing","setClosing","useState","closedRef","useRef","headingRef","countdownId","useId","countdownSeconds","showCountdown","useEffect","_a","handleClose","useCallback","remaining","start","reset","useCountdown","countdownMounted","countdownText","actionOnClick","handleActionClick","actionHref","isSafeHref","hrefRefused","actionInert","secondsIgnored","isDevelopment","jsx","Card","jsxs","CircleCheck","Button"],"mappings":";;;;;;;;;;AAAe,SAASA,EAAYC,GAAgB;AAClD,QAAMC,IAAmC,WAAW,WAAW,UAAa;AAC5E,SAAO,CAAC,EACNA,MACC,YAAY,KAAKA,EAAc,UAAU,SAAS,KACjD,iBAAiB,KAAKA,EAAc,SAAS,IAAI;AAEvD;ACqCA,MAAMC,KAAoB,4BAIpBC,KAA6B,IAE7BC,KAAeC;AAAA,EACnB;AACF,GAKMC,IAAeD,EAAI,cAAc;AAAA,EACrC,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SACE;AAAA,IAAA;AAAA,EACJ;AAAA,EAEF,iBAAiB,EAAE,MAAM,UAAA;AAC3B,CAAC;AAaM,SAASE,EAAeC,GAAsB;AAKnD,MAJI,OAAOA,KAAQ,YAAYA,EAAI,WAAW,KAI1CA,EAAI,WAAW,IAAI,EAAG,QAAO;AAEjC,MAAIA,EAAI,WAAW,GAAG,EAAG,QAAO;AAChC,MAAI;AACF,UAAM,EAAE,UAAAC,MAAa,IAAI,IAAID,GAAK,OAAO,SAAS,MAAM;AACxD,WAAOC,MAAa,YAAYA,MAAa;AAAA,EAC/C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAwGO,MAAMC,KAAmBC;AAAA,EAI9B,CACE;AAAA,IACE,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC,IAAWhB;AAAA,IACX,SAAAiB;AAAA,IAC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,kBAACI;AAAA,kBAAA;AAAA,oBACC,QAAO;AAAA,oBACP,MAAK;AAAA,oBACL,MAAK;AAAA,oBACL,eAAY;AAAA,oBACZ,SAASpB;AAAA,oBAER,UAAApB,KAAiBM,EAAE,2BAA2B;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACjD,EAAA,CACF,IACE;AAAA,YAAA,EAAA,CACN,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AAEAjB,GAAiB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { c as a } from "./createLucideIcon-DhHxpK9K.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v1.22.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const o = [
|
|
9
|
+
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
10
|
+
[
|
|
11
|
+
"path",
|
|
12
|
+
{
|
|
13
|
+
d: "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
|
|
14
|
+
key: "r6nss1"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
], s = a("house", o);
|
|
18
|
+
export {
|
|
19
|
+
s as H
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=house-DGCypGTo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"house-DGCypGTo.js","sources":["../../node_modules/lucide-react/dist/esm/icons/house.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\", key: \"5wwlr5\" }],\n [\n \"path\",\n {\n d: \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\",\n key: \"r6nss1\"\n }\n ]\n];\nconst House = createLucideIcon(\"house\", __iconNode);\n\nexport { __iconNode, House as default };\n//# sourceMappingURL=house.mjs.map\n"],"names":["__iconNode","House","createLucideIcon"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,8CAA8C,KAAK,SAAQ,CAAE;AAAA,EAC3E;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAQC,EAAiB,SAASF,CAAU;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-safe-url-CEy9CEml.js","sources":["../../src/components/_shared/is-safe-url.ts"],"sourcesContent":["/**\n * Shared URL allow-list for the card family (AgendaCard, MessageCard,\n * NotificationCard, TaskCard, …). Lifted from the per-card `isSafe*Url`\n * duplicates so every entity card guards deep links the same way.\n *\n * Only http(s) absolute URLs, single-leading-slash same-origin paths, and\n * in-page hash anchors pass. Protocol-relative (`//host` and `/\\host`: a\n * backslash counts as a slash in http(s) URLs, and a tab or line feed is\n * stripped by the browser, so `/<tab>/host` is `//host`), `javascript:`,\n * `data:`, and `mailto:` URLs are rejected — an unsafe URL makes the card\n * fall back to a `<button>` so it stays interactive without becoming a\n * phishing vector.\n */\nexport function isSafeEntityUrl(url: string): boolean {\n // Browsers drop ASCII tab and newline anywhere in a URL: test what they see.\n const seen = url.replace(/[\\t\\n\\r]/g, '');\n return /^(https?:\\/\\/(?!\\/)|\\/(?![/\\\\])|#)/.test(seen);\n}\n"],"names":["isSafeEntityUrl","url","seen"],"mappings":"AAaO,SAASA,EAAgBC,GAAsB;AAEpD,QAAMC,IAAOD,EAAI,QAAQ,aAAa,EAAE;AACxC,SAAO,qCAAqC,KAAKC,CAAI;AACvD;"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsxs as H, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useRef as E, useState as I, useEffect as S, useCallback as L } from "react";
|
|
3
|
+
import { c as B } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as F } from "react-i18next";
|
|
5
|
+
import { K as p } from "./keypad-button-mOaPQRrH.js";
|
|
6
|
+
import { c as P } from "./createLucideIcon-DhHxpK9K.js";
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide-react v1.22.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
const V = [
|
|
14
|
+
[
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
d: "M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",
|
|
18
|
+
key: "1yo7s0"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
["path", { d: "m12 9 6 6", key: "anjzzh" }],
|
|
22
|
+
["path", { d: "m18 9-6 6", key: "1fp51s" }]
|
|
23
|
+
], z = P("delete", V), W = B(
|
|
24
|
+
"ds:grid ds:w-max ds:grid-cols-3 ds:justify-items-center",
|
|
25
|
+
{
|
|
26
|
+
variants: {
|
|
27
|
+
size: {
|
|
28
|
+
md: "ds:gap-[var(--spacing-sm)]",
|
|
29
|
+
lg: "ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-md)]"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: { size: "lg" }
|
|
33
|
+
}
|
|
34
|
+
), G = ["1", "2", "3", "4", "5", "6", "7", "8", "9"], O = "ph-no-capture", U = 140;
|
|
35
|
+
function Y(t) {
|
|
36
|
+
if (/^[0-9]$/.test(t)) return t;
|
|
37
|
+
const r = t.charCodeAt(0);
|
|
38
|
+
return t.length === 1 && r >= 1632 && r <= 1641 ? String(r - 1632) : t.length === 1 && r >= 1776 && r <= 1785 ? String(r - 1776) : null;
|
|
39
|
+
}
|
|
40
|
+
function $(t) {
|
|
41
|
+
return t instanceof HTMLElement ? t.isContentEditable ? !0 : t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement : !1;
|
|
42
|
+
}
|
|
43
|
+
const b = N(
|
|
44
|
+
({
|
|
45
|
+
onDigit: t,
|
|
46
|
+
onDelete: r,
|
|
47
|
+
bottomLeft: A,
|
|
48
|
+
disabled: n = !1,
|
|
49
|
+
deleteDisabled: s = !1,
|
|
50
|
+
captureKeyboard: m = !1,
|
|
51
|
+
size: o = "lg",
|
|
52
|
+
shape: l = "round",
|
|
53
|
+
label: _,
|
|
54
|
+
deleteLabel: g,
|
|
55
|
+
maskClassName: v = O,
|
|
56
|
+
id: M,
|
|
57
|
+
className: x,
|
|
58
|
+
...C
|
|
59
|
+
}, c) => {
|
|
60
|
+
const { t: y } = F("ui"), w = E(null), [K, h] = I(null), f = E(void 0);
|
|
61
|
+
S(() => () => window.clearTimeout(f.current), []);
|
|
62
|
+
const u = L((e) => {
|
|
63
|
+
h(e), window.clearTimeout(f.current), f.current = window.setTimeout(
|
|
64
|
+
() => h(null),
|
|
65
|
+
U
|
|
66
|
+
);
|
|
67
|
+
}, []), d = L(
|
|
68
|
+
(e) => {
|
|
69
|
+
if (n || e.ctrlKey || e.metaKey || e.altKey) return !1;
|
|
70
|
+
const a = Y(e.key);
|
|
71
|
+
return a !== null ? (t == null || t(a), u(a), !0) : e.key === "Backspace" || e.key === "Delete" ? s ? !1 : (r == null || r(), u("delete"), !0) : !1;
|
|
72
|
+
},
|
|
73
|
+
[s, n, u, r, t]
|
|
74
|
+
), R = (e) => {
|
|
75
|
+
d(e) && e.preventDefault();
|
|
76
|
+
};
|
|
77
|
+
S(() => {
|
|
78
|
+
if (!m) return;
|
|
79
|
+
const e = (a) => {
|
|
80
|
+
var T;
|
|
81
|
+
a.defaultPrevented || a.target instanceof Node && ((T = w.current) != null && T.contains(a.target)) || $(a.target) || d(a) && a.preventDefault();
|
|
82
|
+
};
|
|
83
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
84
|
+
}, [m, d]);
|
|
85
|
+
const j = (e) => {
|
|
86
|
+
w.current = e, typeof c == "function" ? c(e) : c && (c.current = e);
|
|
87
|
+
}, k = (e) => /* @__PURE__ */ i(
|
|
88
|
+
p,
|
|
89
|
+
{
|
|
90
|
+
digit: e,
|
|
91
|
+
size: o,
|
|
92
|
+
shape: l,
|
|
93
|
+
disabled: n,
|
|
94
|
+
pressed: K === e,
|
|
95
|
+
onClick: () => t == null ? void 0 : t(e)
|
|
96
|
+
},
|
|
97
|
+
e
|
|
98
|
+
);
|
|
99
|
+
return (
|
|
100
|
+
// A group, not a toolbar: every key stays in the tab order, which is
|
|
101
|
+
// what people expect of a number pad.
|
|
102
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- the keydown only adds physical digits; every key is a real button
|
|
103
|
+
/* @__PURE__ */ H(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
ref: j,
|
|
107
|
+
role: "group",
|
|
108
|
+
"aria-label": _ ?? y("inputs.keypad.label", "Keypad"),
|
|
109
|
+
"aria-disabled": n || void 0,
|
|
110
|
+
dir: "ltr",
|
|
111
|
+
"data-component": "keypad",
|
|
112
|
+
"data-component-id": M,
|
|
113
|
+
className: W({
|
|
114
|
+
size: o,
|
|
115
|
+
className: [v, x].filter(Boolean).join(" ")
|
|
116
|
+
}),
|
|
117
|
+
onKeyDown: R,
|
|
118
|
+
...C,
|
|
119
|
+
children: [
|
|
120
|
+
G.map(k),
|
|
121
|
+
A ?? /* @__PURE__ */ i(p, { variant: "spacer", size: o, shape: l }),
|
|
122
|
+
k("0"),
|
|
123
|
+
/* @__PURE__ */ i(
|
|
124
|
+
p,
|
|
125
|
+
{
|
|
126
|
+
variant: "action",
|
|
127
|
+
size: o,
|
|
128
|
+
shape: l,
|
|
129
|
+
"data-key-id": "delete",
|
|
130
|
+
"data-action": "delete",
|
|
131
|
+
label: g ?? y("inputs.keypad.delete", "Delete"),
|
|
132
|
+
icon: /* @__PURE__ */ i(z, {}),
|
|
133
|
+
disabled: n,
|
|
134
|
+
"aria-disabled": s || void 0,
|
|
135
|
+
pressed: K === "delete",
|
|
136
|
+
onClick: () => {
|
|
137
|
+
s || r == null || r();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
b.displayName = "Keypad";
|
|
148
|
+
export {
|
|
149
|
+
O as K,
|
|
150
|
+
b as a
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=keypad-DBH_keVs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keypad-DBH_keVs.js","sources":["../../node_modules/lucide-react/dist/esm/icons/delete.mjs","../../src/components/keypad/keypad.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z\",\n key: \"1yo7s0\"\n }\n ],\n [\"path\", { d: \"m12 9 6 6\", key: \"anjzzh\" }],\n [\"path\", { d: \"m18 9-6 6\", key: \"1fp51s\" }]\n];\nconst Delete = createLucideIcon(\"delete\", __iconNode);\n\nexport { __iconNode, Delete as default };\n//# sourceMappingURL=delete.mjs.map\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Delete } from 'lucide-react';\nimport { KeypadButton } from '../keypad-button';\n\n/* -------------------------------------------------------------------- */\n/* Keypad — the 3 × 4 on-screen number pad. */\n/* */\n/* Fixed phone order, never shuffled: 1 2 3 / 4 5 6 / 7 8 9 / slot 0 ⌫. */\n/* The bottom-start slot is empty unless the host fills it (a \"Forgot */\n/* your PIN?\" key, later a biometric key). The grid keeps `dir=\"ltr\"`: */\n/* phone keypads do not mirror in right-to-left languages, like the kit's */\n/* OTPInput boxes. */\n/* */\n/* Physical keys: digits type and Backspace / Delete deletes while focus */\n/* is inside the pad, or anywhere on the page with `captureKeyboard` */\n/* (ignored while focus is in another field). The matching key shows its */\n/* pressed look for a moment, so a keyboard user sees what was typed. */\n/* */\n/* Privacy: every tap is a PIN digit, in the key's text, its `data-key-id` */\n/* and the pressed flash. The root carries `maskClassName` (default */\n/* PostHog's `ph-no-capture`) so session replay and analytics autocapture */\n/* skip the whole pad. */\n/* -------------------------------------------------------------------- */\n\nconst keypadVariants = cva(\n 'ds:grid ds:w-max ds:grid-cols-3 ds:justify-items-center',\n {\n variants: {\n size: {\n md: 'ds:gap-[var(--spacing-sm)]',\n lg: 'ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-md)]',\n },\n },\n defaultVariants: { size: 'lg' },\n },\n);\n\nconst DIGIT_ROWS = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] as const;\n\n/** The replay / analytics marker the pad carries unless told otherwise:\n * PostHog's, the tool of the kit's reference consumer (as Calendar\n * documents for its `maskClassName`). */\nexport const KEYPAD_DEFAULT_MASK_CLASS = 'ph-no-capture';\nconst PRESS_FLASH_MS = 140;\n\n/** Fold Arabic-Indic and extended Arabic-Indic digits to ASCII. */\nfunction toAsciiDigit(key: string): string | null {\n if (/^[0-9]$/.test(key)) return key;\n const code = key.charCodeAt(0);\n if (key.length === 1 && code >= 0x0660 && code <= 0x0669)\n return String(code - 0x0660);\n if (key.length === 1 && code >= 0x06f0 && code <= 0x06f9)\n return String(code - 0x06f0);\n return null;\n}\n\nfunction isEditableTarget(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n return (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n );\n}\n\nexport interface KeypadProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'onKeyDown'>,\n VariantProps<typeof keypadVariants> {\n /** Fires with the digit, `\"0\"` to `\"9\"`, for a tap or a physical key. */\n onDigit?: (digit: string) => void;\n /** Fires for the Delete key, Backspace or Delete. */\n onDelete?: () => void;\n /** The bottom-start cell. Empty by default; pass a `KeypadButton`\n * (`variant=\"action\"`) for a secondary action. */\n bottomLeft?: ReactNode;\n /** Disable every key. */\n disabled?: boolean;\n /** Make Delete do nothing, e.g. while nothing has been typed. It stays\n * focusable (`aria-disabled`), so deleting the last digit never drops\n * focus to the page. */\n deleteDisabled?: boolean;\n /** Listen to physical digits and Backspace anywhere on the page, not only\n * while focus is inside the pad. Keys typed into another field are left\n * alone. Default `false`. */\n captureKeyboard?: boolean;\n /** Key size. Default `lg`. */\n size?: 'md' | 'lg';\n /** Key shape. Default `round`. */\n shape?: 'round' | 'square';\n /** Accessible name of the pad. Default \"Keypad\". */\n label?: string;\n /** Accessible name of the Delete key. Default \"Delete\". */\n deleteLabel?: string;\n /**\n * Privacy / observability seam, NOT a styling hook. The class (or\n * space-separated classes) stamped on the pad's root so session replay\n * and analytics autocapture skip it: every key's text, `data-key-id` and\n * pressed flash is a PIN digit. Default `ph-no-capture` (PostHog). Pass\n * your own tool's marker instead, e.g. `\"ph-no-capture sentry-mask\"`.\n * Pass `\"\"` only when nothing on the page records sessions or clicks.\n */\n maskClassName?: string;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n}\n\n/**\n * The 3 × 4 number pad of a PIN screen. It holds no value: the host keeps\n * the digits (or use `PinEntry`, which does).\n */\nexport const Keypad = forwardRef<HTMLDivElement, KeypadProps>(\n (\n {\n onDigit,\n onDelete,\n bottomLeft,\n disabled = false,\n deleteDisabled = false,\n captureKeyboard = false,\n size = 'lg',\n shape = 'round',\n label,\n deleteLabel,\n maskClassName = KEYPAD_DEFAULT_MASK_CLASS,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [flashKey, setFlashKey] = useState<string | null>(null);\n const flashTimer = useRef<number | undefined>(undefined);\n\n useEffect(() => () => window.clearTimeout(flashTimer.current), []);\n\n const flash = useCallback((key: string) => {\n setFlashKey(key);\n window.clearTimeout(flashTimer.current);\n flashTimer.current = window.setTimeout(\n () => setFlashKey(null),\n PRESS_FLASH_MS,\n );\n }, []);\n\n /** Handles one physical key; true when the pad used it. */\n const handleKey = useCallback(\n (event: KeyboardEvent | ReactKeyboardEvent): boolean => {\n if (disabled) return false;\n if (event.ctrlKey || event.metaKey || event.altKey) return false;\n const digit = toAsciiDigit(event.key);\n if (digit !== null) {\n onDigit?.(digit);\n flash(digit);\n return true;\n }\n if (event.key === 'Backspace' || event.key === 'Delete') {\n if (deleteDisabled) return false;\n onDelete?.();\n flash('delete');\n return true;\n }\n return false;\n },\n [deleteDisabled, disabled, flash, onDelete, onDigit],\n );\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n if (handleKey(event)) event.preventDefault();\n };\n\n useEffect(() => {\n if (!captureKeyboard) return undefined;\n const onWindowKey = (event: KeyboardEvent) => {\n if (event.defaultPrevented) return;\n // Keys inside the pad are already handled by its own listener.\n if (\n event.target instanceof Node &&\n rootRef.current?.contains(event.target)\n )\n return;\n if (isEditableTarget(event.target)) return;\n if (handleKey(event)) event.preventDefault();\n };\n window.addEventListener('keydown', onWindowKey);\n return () => window.removeEventListener('keydown', onWindowKey);\n }, [captureKeyboard, handleKey]);\n\n const setRefs = (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n };\n\n const digitKey = (digit: string) => (\n <KeypadButton\n key={digit}\n digit={digit}\n size={size}\n shape={shape}\n disabled={disabled}\n pressed={flashKey === digit}\n onClick={() => onDigit?.(digit)}\n />\n );\n\n return (\n // A group, not a toolbar: every key stays in the tab order, which is\n // what people expect of a number pad.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- the keydown only adds physical digits; every key is a real button\n <div\n ref={setRefs}\n role=\"group\"\n aria-label={label ?? t('inputs.keypad.label', 'Keypad')}\n aria-disabled={disabled || undefined}\n dir=\"ltr\"\n data-component=\"keypad\"\n data-component-id={id}\n className={keypadVariants({\n size,\n className: [maskClassName, className].filter(Boolean).join(' '),\n })}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {DIGIT_ROWS.map(digitKey)}\n {bottomLeft ?? (\n <KeypadButton variant=\"spacer\" size={size} shape={shape} />\n )}\n {digitKey('0')}\n <KeypadButton\n variant=\"action\"\n size={size}\n shape={shape}\n data-key-id=\"delete\"\n data-action=\"delete\"\n label={deleteLabel ?? t('inputs.keypad.delete', 'Delete')}\n icon={<Delete />}\n disabled={disabled}\n aria-disabled={deleteDisabled || undefined}\n pressed={flashKey === 'delete'}\n onClick={() => {\n if (!deleteDisabled) onDelete?.();\n }}\n />\n </div>\n );\n },\n);\n\nKeypad.displayName = 'Keypad';\n"],"names":["__iconNode","Delete","createLucideIcon","keypadVariants","cva","DIGIT_ROWS","KEYPAD_DEFAULT_MASK_CLASS","PRESS_FLASH_MS","toAsciiDigit","key","code","isEditableTarget","target","Keypad","forwardRef","onDigit","onDelete","bottomLeft","disabled","deleteDisabled","captureKeyboard","size","shape","label","deleteLabel","maskClassName","id","className","rest","ref","t","useTranslation","rootRef","useRef","flashKey","setFlashKey","useState","flashTimer","useEffect","flash","useCallback","handleKey","event","digit","handleKeyDown","onWindowKey","_a","setRefs","node","digitKey","jsx","KeypadButton","jsxs"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAC5C,GACMC,IAASC,EAAiB,UAAUF,CAAU,GCe9CG,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IACN;AAAA,IAEF,iBAAiB,EAAE,MAAM,KAAA;AAAA,EAAK;AAElC,GAEMC,IAAa,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG,GAKlDC,IAA4B,iBACnCC,IAAiB;AAGvB,SAASC,EAAaC,GAA4B;AAChD,MAAI,UAAU,KAAKA,CAAG,EAAG,QAAOA;AAChC,QAAMC,IAAOD,EAAI,WAAW,CAAC;AAC7B,SAAIA,EAAI,WAAW,KAAKC,KAAQ,QAAUA,KAAQ,OACzC,OAAOA,IAAO,IAAM,IACzBD,EAAI,WAAW,KAAKC,KAAQ,QAAUA,KAAQ,OACzC,OAAOA,IAAO,IAAM,IACtB;AACT;AAEA,SAASC,EAAiBC,GAAqC;AAC7D,SAA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