@opengeni/react 6.40.0 → 6.41.1-canary.45704649926001
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/app/app-state.js +34 -34
- package/dist/app/components/Composer.js +45 -45
- package/dist/app/components/add-card-dialog.js +3 -3
- package/dist/app/components/add-card.js +2 -2
- package/dist/app/components/agent/agent-capability-picker.js +10 -10
- package/dist/app/components/agents/agent-can-use.js +51 -50
- package/dist/app/components/agents/agent-cost.js +2 -2
- package/dist/app/components/agents/agent-form-page.js +153 -152
- package/dist/app/components/agents/agent-form-page.js.map +1 -1
- package/dist/app/components/agents/agent-page.js +134 -133
- package/dist/app/components/agents/agent-setup-sections.js +81 -80
- package/dist/app/components/agents/agent-skills.js +15 -15
- package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
- package/dist/app/components/agents/agent-trigger-dialog.js +35 -35
- package/dist/app/components/agents/agent-trigger-picker.js +8 -8
- package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
- package/dist/app/components/agents/agents-page.js +99 -98
- package/dist/app/components/agents/agents-page.js.map +1 -1
- package/dist/app/components/agents/composer-agent-chip.js +60 -59
- package/dist/app/components/agents/session-agent-chip.js +55 -54
- package/dist/app/components/artifacts/app-package.js +13 -13
- package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
- package/dist/app/components/artifacts/artifact-library.js +30 -30
- package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
- package/dist/app/components/artifacts/artifact-viewer.js +64 -63
- package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
- package/dist/app/components/artifacts/chat-interactive-block.js +30 -28
- package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
- package/dist/app/components/artifacts/copy-artifact-link.js +3 -3
- package/dist/app/components/artifacts/file-reach-dialog.js +13 -13
- package/dist/app/components/artifacts/inline-chat-image.js +52 -51
- package/dist/app/components/artifacts/ready-made-apps.js +13 -13
- package/dist/app/components/artifacts/retained-file-preview.js +57 -56
- package/dist/app/components/artifacts/retained-text-preview.js +7 -7
- package/dist/app/components/artifacts/site-actions.js +11 -11
- package/dist/app/components/artifacts/site-audience.js +8 -8
- package/dist/app/components/artifacts/site-conversations.js +34 -34
- package/dist/app/components/artifacts/site-data.js +30 -30
- package/dist/app/components/artifacts/site-public-link.js +1 -1
- package/dist/app/components/artifacts/site-publishing-page.js +72 -72
- package/dist/app/components/artifacts/site-publishing.js +55 -55
- package/dist/app/components/artifacts/site-settings.js +71 -71
- package/dist/app/components/artifacts/site-version-menu.js +9 -9
- package/dist/app/components/billing-class-mark.js +7 -7
- package/dist/app/components/capabilities/capability-detail-sheet.js +18 -18
- package/dist/app/components/capabilities/capability-logo-source.js +31 -30
- package/dist/app/components/capabilities/capability-logo.js +1 -1
- package/dist/app/components/capabilities/connection-account-picker.js +2 -2
- package/dist/app/components/capabilities/connection-ownership-selector.js +4 -4
- package/dist/app/components/capabilities/connector-tool-permissions.js +7 -7
- package/dist/app/components/capabilities/detail-dialog.js +3 -3
- package/dist/app/components/capabilities/native-connect-setup.js +36 -35
- package/dist/app/components/capabilities/own-logins-shared-heads-up.js +7 -7
- package/dist/app/components/capabilities/perform-capability-action.js +3 -3
- package/dist/app/components/capabilities/prepared-mcp-setup-card.js +35 -34
- package/dist/app/components/capabilities/session-capability-card.js +142 -141
- package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
- package/dist/app/components/capabilities/session-chrome-card.js +49 -49
- package/dist/app/components/capabilities/session-connect-inputs-card.js +38 -37
- package/dist/app/components/capabilities/session-custom-mcp-card.js +43 -42
- package/dist/app/components/capabilities/session-github-card.js +49 -48
- package/dist/app/components/capabilities/session-machine-card.js +50 -50
- package/dist/app/components/capabilities/session-personal-github-card.js +35 -34
- package/dist/app/components/capabilities/session-plugin-card.js +23 -22
- package/dist/app/components/capabilities/use-capabilities-catalog.js +4 -4
- package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
- package/dist/app/components/command-menu/chat-status.js +25 -25
- package/dist/app/components/command-menu/chat-switcher.js +90 -89
- package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
- package/dist/app/components/command-menu/command-menu.js +118 -117
- package/dist/app/components/command-menu/command-menu.js.map +1 -1
- package/dist/app/components/command-menu/shortcut-sheet.js +26 -26
- package/dist/app/components/composer-capabilities-menu-body.js +7 -7
- package/dist/app/components/composer-mobile-plus-panel.js +32 -32
- package/dist/app/components/composer-mobile-plus.js +5 -5
- package/dist/app/components/credit-amount-picker.js +2 -2
- package/dist/app/components/credit-required-gate.js +6 -6
- package/dist/app/components/credit-required-prompt.js +27 -27
- package/dist/app/components/credits/checkout-credits-celebration.js +4 -4
- package/dist/app/components/credits/checkout-return.js +4 -4
- package/dist/app/components/credits/coupon-redeem.js +1 -1
- package/dist/app/components/credits/credit-refusal-notice.js +8 -8
- package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
- package/dist/app/components/cross-slot-deep-link-recovery.js +2 -2
- package/dist/app/components/desktop/app-shots.js +10 -10
- package/dist/app/components/desktop/app-update.js +3 -3
- package/dist/app/components/desktop/computer-use.js +4 -4
- package/dist/app/components/desktop/this-computer.js +8 -8
- package/dist/app/components/feedback.js +11 -11
- package/dist/app/components/follow-up-repository-menu-body.js +12 -12
- package/dist/app/components/follow-up-repository-picker.js +1 -1
- package/dist/app/components/github-app-connect-launcher.js +2 -2
- package/dist/app/components/in-app-help-link.js +3 -3
- package/dist/app/components/knowledge/agent-learning-settings.js +5 -5
- package/dist/app/components/machines/connect-machine-dialog.js +25 -25
- package/dist/app/components/manual-repository-editor.js +1 -1
- package/dist/app/components/markdown.js +18 -17
- package/dist/app/components/model-identity.js +3 -3
- package/dist/app/components/models/models-ui.js +17 -17
- package/dist/app/components/models/provider-mark.js +3 -3
- package/dist/app/components/models/subscription-usage.js +5 -5
- package/dist/app/components/my-things.js +19 -19
- package/dist/app/components/own-where-it-works.js +12 -12
- package/dist/app/components/personal-resource-attachment-surface.js +4 -4
- package/dist/app/components/pickers.js +12 -12
- package/dist/app/components/rail/channel-create-dialog.js +6 -6
- package/dist/app/components/rail/project-glyph.js +54 -53
- package/dist/app/components/rail/project-profile.js +76 -75
- package/dist/app/components/rail/rail-context.js +2 -2
- package/dist/app/components/rail/rail-sections.js +155 -154
- package/dist/app/components/rail/session-header.js +125 -124
- package/dist/app/components/rail/session-list.js +153 -152
- package/dist/app/components/rail/session-row-content.js +6 -6
- package/dist/app/components/rail/session-row-hover-details.js +36 -36
- package/dist/app/components/rail/session-shell.js +194 -193
- package/dist/app/components/rail/site-session-group-heading.js +37 -37
- package/dist/app/components/repository-picker.js +12 -12
- package/dist/app/components/secrets/session-secrets-panel.js +3 -3
- package/dist/app/components/session/agent-configuration-panel.js +53 -53
- package/dist/app/components/session/artifact-session-page.js +8 -8
- package/dist/app/components/session/banners.js +22 -21
- package/dist/app/components/session/chat-avatar.js +54 -53
- package/dist/app/components/session/console-new-conversation.js +105 -104
- package/dist/app/components/session/descendant-requests.js +101 -100
- package/dist/app/components/session/descendant-requests.js.map +1 -1
- package/dist/app/components/session/editable-artifacts-workspace.js +62 -60
- package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
- package/dist/app/components/session/failed-session-banner.js +28 -28
- package/dist/app/components/session/failure-recovery-boundary.js +3 -3
- package/dist/app/components/session/human-input-delegation-record.js +3 -3
- package/dist/app/components/session/human-input.js +88 -87
- package/dist/app/components/session/inspector.js +136 -135
- package/dist/app/components/session/inspector.js.map +1 -1
- package/dist/app/components/session/linked-panel.js +3 -3
- package/dist/app/components/session/message-actions.js +11 -11
- package/dist/app/components/session/model-recovery-notice.js +4 -4
- package/dist/app/components/session/new-session-settings-menu.js +32 -32
- package/dist/app/components/session/new-session-setup-strip.js +58 -57
- package/dist/app/components/session/own-account-wait-notice.js +8 -8
- package/dist/app/components/session/pinned-account-wait-notice.js +8 -8
- package/dist/app/components/session/pull-request-panel.js +26 -25
- package/dist/app/components/session/sandbox-recovery-actions.js +5 -5
- package/dist/app/components/session/sandbox-switcher.js +22 -22
- package/dist/app/components/session/sandbox-workspace.js +118 -117
- package/dist/app/components/session/search-markdown-highlight.js +19 -18
- package/dist/app/components/session/search-results-view.js +20 -19
- package/dist/app/components/session/session-admin-access.js +12 -12
- package/dist/app/components/session/session-admission-notice.js +11 -11
- package/dist/app/components/session/session-avatar-picker.js +61 -60
- package/dist/app/components/session/session-avatar.js +56 -55
- package/dist/app/components/session/session-machine-access-notice.js +11 -11
- package/dist/app/components/session/session-profile-dialog.js +72 -71
- package/dist/app/components/session/session-profile-editor.js +73 -72
- package/dist/app/components/session/session-retention.js +8 -8
- package/dist/app/components/session/session-search-dialog.js +26 -25
- package/dist/app/components/session/session-search-dialog.js.map +1 -1
- package/dist/app/components/session/session-skill-reviews.js +5 -5
- package/dist/app/components/session/session-tenancy-control.js +25 -25
- package/dist/app/components/session/session-unattended-setting.js +4 -4
- package/dist/app/components/session/session-usage-limit-section.js +13 -13
- package/dist/app/components/session/share-chat-dialog.js +12 -12
- package/dist/app/components/session/subagents.js +22 -22
- package/dist/app/components/session/subscription-account-indicator.js +25 -25
- package/dist/app/components/session/subscription-account-menu.js +7 -7
- package/dist/app/components/session-connectors-menu-body.js +11 -11
- package/dist/app/components/settings/row-select.js +6 -6
- package/dist/app/components/transcription-settings.js +10 -10
- package/dist/app/components/ui/destructive-confirm.js +11 -11
- package/dist/app/components/usage/usage-entry.js +8 -8
- package/dist/app/components/window-bar.js +25 -25
- package/dist/app/components/workspace-composer-plus.js +46 -45
- package/dist/app/components/workspace-reach.d.ts +2 -0
- package/dist/app/components/workspace-reach.js +6 -6
- package/dist/app/embed/session-app.js +406 -405
- package/dist/app/lib/actions/actions-provider.js +18 -18
- package/dist/app/lib/agent-capabilities.js +4 -4
- package/dist/app/lib/app-connect-card.js +16 -16
- package/dist/app/lib/app-shared-key-dialog.js +9 -9
- package/dist/app/lib/app-surfaces.js +1 -1
- package/dist/app/lib/app-sync-opt-in.js +7 -7
- package/dist/app/lib/codex-usage-query.js +3 -3
- package/dist/app/lib/composer-agent.js +2 -2
- package/dist/app/lib/composer-connectors.js +35 -34
- package/dist/app/lib/composer-send-blocking.js +2 -2
- package/dist/app/lib/console-site.js +9 -9
- package/dist/app/lib/console-text.js +2 -2
- package/dist/app/lib/events.js +32 -31
- package/dist/app/lib/failed-session-copy.js +5 -5
- package/dist/app/lib/feedback-capture.js +2 -2
- package/dist/app/lib/model-access-onboarding.js +4 -4
- package/dist/app/lib/move-chat-to-machine.js +5 -5
- package/dist/app/lib/personal-resource-attachments.js +1 -1
- package/dist/app/lib/session-branch-cache.js +18 -18
- package/dist/app/lib/session-create.js +5 -5
- package/dist/app/lib/session-group-pagination.js +18 -18
- package/dist/app/lib/session-hover-facts.js +25 -25
- package/dist/app/lib/session-list-dirty-scopes.js +19 -19
- package/dist/app/lib/session-model.js +2 -2
- package/dist/app/lib/session-rail.js +15 -15
- package/dist/app/lib/session-rename.js +3 -3
- package/dist/app/lib/sessions-group.js +23 -23
- package/dist/app/lib/site-tool-consent-dialog.js +24 -24
- package/dist/app/lib/site-tool-consent.js +1 -1
- package/dist/app/lib/turn-failure-analytics.js +6 -6
- package/dist/app/lib/use-artifact-catalog.js +2 -2
- package/dist/app/lib/use-duplicate-site.js +4 -4
- package/dist/app/lib/use-follow-up-repositories.js +9 -9
- package/dist/app/lib/use-personal-resource-attachment.js +2 -2
- package/dist/app/lib/use-workspace-integrations.js +2 -2
- package/dist/app/lib/use-workspace-machines.js +10 -10
- package/dist/app/lib/use-workspace-model-catalog.js +6 -6
- package/dist/app/lib/use-workspace-rigs.js +6 -6
- package/dist/app/lib/workspace-navigation-preference.js +5 -5
- package/dist/app/lib/workspace-scope-context.js +4 -4
- package/dist/app/routes/app-page-view.js +52 -50
- package/dist/app/routes/app-page-view.js.map +1 -1
- package/dist/app/routes/app-page.js +2 -2
- package/dist/app/routes/artifacts.js +170 -168
- package/dist/app/routes/artifacts.js.map +1 -1
- package/dist/app/routes/retained-artifact.js +110 -109
- package/dist/app/routes/retained-artifact.js.map +1 -1
- package/dist/app/routes/session-unavailable.js +6 -6
- package/dist/app/routes/session.js +249 -248
- package/dist/app/routes/sessions-index-hydration.js +6 -6
- package/dist/app/routes/sessions-index.js +204 -203
- package/dist/app/routes/site-view.js +210 -209
- package/dist/app/routes/site-view.js.map +1 -1
- package/dist/artifacts-document.js +4 -4
- package/dist/artifacts-presentation.js +9 -9
- package/dist/artifacts-spreadsheet.js +4 -4
- package/dist/artifacts.js +53 -51
- package/dist/automation-model.js +6 -6
- package/dist/automations.js +64 -64
- package/dist/browser-viewer-TRPZI6NT.js +23 -0
- package/dist/chat-interactive-block-Y4BS4JCM.js +24 -0
- package/dist/chunk-22E2YJHT.js +469 -0
- package/dist/chunk-2T6TN2YL.js +538 -0
- package/dist/chunk-2WNN26NW.js +175 -0
- package/dist/chunk-3432A6XB.js +88 -0
- package/dist/chunk-35U7NSOR.js +366 -0
- package/dist/chunk-3EPR76WS.js +773 -0
- package/dist/chunk-3FXXEU5D.js +144 -0
- package/dist/chunk-3MXOPOEU.js +650 -0
- package/dist/chunk-3PKDU4JI.js +340 -0
- package/dist/chunk-3PMO2BIV.js +12 -0
- package/dist/chunk-3XWHJNFY.js +48 -0
- package/dist/chunk-45WD2PKE.js +401 -0
- package/dist/chunk-4H2OWNRA.js +598 -0
- package/dist/chunk-4HVGOTMU.js +263 -0
- package/dist/chunk-4JER2ZMV.js +818 -0
- package/dist/chunk-4LVZ2VOQ.js +214 -0
- package/dist/chunk-4OGDD2EM.js +2434 -0
- package/dist/chunk-4PQC6WMF.js +54 -0
- package/dist/chunk-4UVSWAT3.js +794 -0
- package/dist/chunk-53A47RBX.js +214 -0
- package/dist/chunk-552KKENW.js +114 -0
- package/dist/chunk-55F7L6M3.js +177 -0
- package/dist/chunk-5AHIKB3O.js +449 -0
- package/dist/chunk-5KQD6MLJ.js +3996 -0
- package/dist/chunk-5KQD6MLJ.js.map +1 -0
- package/dist/chunk-5N4L5WTE.js +199 -0
- package/dist/chunk-5OUJCVZI.js +79 -0
- package/dist/chunk-5OYXQ7MH.js +65 -0
- package/dist/chunk-5RGF74K5.js +371 -0
- package/dist/chunk-5RGF74K5.js.map +1 -0
- package/dist/chunk-5TAVVMFX.js +225 -0
- package/dist/chunk-5Y3LYRNH.js +269 -0
- package/dist/chunk-5ZJKKE4T.js +386 -0
- package/dist/chunk-62DPSQRZ.js +57 -0
- package/dist/chunk-64KMWTJ6.js +608 -0
- package/dist/chunk-6F34IWSA.js +47 -0
- package/dist/chunk-6F34IWSA.js.map +1 -0
- package/dist/chunk-6MZBNUS7.js +73 -0
- package/dist/chunk-6YCE4ZC4.js +250 -0
- package/dist/chunk-6YROWWMX.js +175 -0
- package/dist/chunk-73RZ72VU.js +1236 -0
- package/dist/chunk-74KV436L.js +84 -0
- package/dist/chunk-7HKGLPV5.js +83 -0
- package/dist/chunk-7JSWODT6.js +466 -0
- package/dist/chunk-7K3PKWER.js +428 -0
- package/dist/chunk-7MPWC42V.js +1356 -0
- package/dist/chunk-7REO6FRN.js +141 -0
- package/dist/chunk-7V3OL7JC.js +850 -0
- package/dist/chunk-7V3OL7JC.js.map +1 -0
- package/dist/chunk-7YMWRNRQ.js +145 -0
- package/dist/chunk-A6H3KJ7G.js +131 -0
- package/dist/chunk-AGQIE6YU.js +1769 -0
- package/dist/chunk-AHQM4I5V.js +373 -0
- package/dist/chunk-AMTRO7XF.js +172 -0
- package/dist/chunk-AO4LTCG7.js +91 -0
- package/dist/chunk-APJ22OZV.js +2580 -0
- package/dist/chunk-APWL37KW.js +407 -0
- package/dist/chunk-AQEJOBQ2.js +15 -0
- package/dist/chunk-ARKNT6BX.js +234 -0
- package/dist/chunk-B2IHDMAR.js +211 -0
- package/dist/chunk-BCKIV26W.js +112 -0
- package/dist/chunk-BE26JUSD.js +259 -0
- package/dist/chunk-BOVCD6KD.js +171 -0
- package/dist/chunk-BQWV66A6.js +129 -0
- package/dist/chunk-BSQJXGGP.js +441 -0
- package/dist/chunk-BZY3MEVZ.js +3183 -0
- package/dist/chunk-C3D3OOEY.js +335 -0
- package/dist/chunk-CDHYO3DP.js +82 -0
- package/dist/chunk-CDV5JGVI.js +79 -0
- package/dist/chunk-CNW45M7G.js +207 -0
- package/dist/chunk-CUVQ37HB.js +150 -0
- package/dist/chunk-D32T3IIC.js +532 -0
- package/dist/chunk-D32VVOBJ.js +738 -0
- package/dist/chunk-D32VVOBJ.js.map +1 -0
- package/dist/chunk-D65BSM64.js +371 -0
- package/dist/chunk-D7435DWV.js +570 -0
- package/dist/chunk-DFH3M7B3.js +72 -0
- package/dist/chunk-DGWBQ76M.js +162 -0
- package/dist/chunk-DHJDTGSJ.js +372 -0
- package/dist/chunk-DKEFTNCD.js +400 -0
- package/dist/chunk-DNAF6MT4.js +107 -0
- package/dist/chunk-DSJ7K5IF.js +380 -0
- package/dist/chunk-DSJ7K5IF.js.map +1 -0
- package/dist/chunk-E35XY7DS.js +27 -0
- package/dist/chunk-E5T5WIIP.js +396 -0
- package/dist/chunk-EL6ECD34.js +166 -0
- package/dist/chunk-ELR6ITRC.js +467 -0
- package/dist/chunk-EPE3V2VE.js +851 -0
- package/dist/chunk-EYGQHHVW.js +584 -0
- package/dist/chunk-EYQEJHYP.js +307 -0
- package/dist/chunk-EZTH2XMH.js +276 -0
- package/dist/chunk-F3QVHVFS.js +287 -0
- package/dist/chunk-F5VWPREQ.js +1187 -0
- package/dist/chunk-FM7AQUBL.js +113 -0
- package/dist/chunk-FP6BUXJM.js +100 -0
- package/dist/chunk-FVU52L3I.js +249 -0
- package/dist/chunk-FZKNXNNO.js +218 -0
- package/dist/chunk-G3IXJWRY.js +236 -0
- package/dist/chunk-G6EI2O3N.js +333 -0
- package/dist/chunk-G7KHMA3E.js +256 -0
- package/dist/chunk-G7KHMA3E.js.map +1 -0
- package/dist/chunk-GB5T6YMZ.js +401 -0
- package/dist/chunk-GBLD6FOG.js +157 -0
- package/dist/chunk-GJBFFXCY.js +137 -0
- package/dist/chunk-GJDP2K2S.js +66 -0
- package/dist/chunk-GP26XTDX.js +187 -0
- package/dist/chunk-GTE6WP4N.js +606 -0
- package/dist/chunk-GWG3OAV7.js +108 -0
- package/dist/chunk-GXMHTMM6.js +931 -0
- package/dist/chunk-GYRN5O2E.js +107 -0
- package/dist/chunk-GZX7W2WW.js +65 -0
- package/dist/chunk-H3QI2G2B.js +403 -0
- package/dist/chunk-H7D4DVWY.js +849 -0
- package/dist/chunk-HCDGBBBJ.js +191 -0
- package/dist/chunk-HDSH6MIJ.js +3851 -0
- package/dist/chunk-HOEUPZ6O.js +89 -0
- package/dist/chunk-HPQRWTQB.js +772 -0
- package/dist/chunk-HUKGLWAY.js +174 -0
- package/dist/chunk-HUTQJY3F.js +23 -0
- package/dist/chunk-HWOYJOKK.js +266 -0
- package/dist/chunk-HZR3WGUP.js +96 -0
- package/dist/chunk-I7YUDPDR.js +138 -0
- package/dist/chunk-IDII52M4.js +27 -0
- package/dist/chunk-IDPWEUM7.js +103 -0
- package/dist/chunk-IEWQFGEC.js +192 -0
- package/dist/chunk-IKWGPFT5.js +300 -0
- package/dist/chunk-IKWGPFT5.js.map +1 -0
- package/dist/chunk-IMTACEXF.js +351 -0
- package/dist/chunk-IVWT6M6N.js +114 -0
- package/dist/chunk-JE2YXAVR.js +485 -0
- package/dist/chunk-JE2YXAVR.js.map +1 -0
- package/dist/chunk-JEUPIHIP.js +111 -0
- package/dist/chunk-JF4WX3GQ.js +168 -0
- package/dist/chunk-JJPYXUKC.js +2591 -0
- package/dist/chunk-JNHWTYDD.js +43 -0
- package/dist/chunk-JP7AOJWD.js +46 -0
- package/dist/chunk-JTWT2WQA.js +297 -0
- package/dist/chunk-JW3WIHWO.js +117 -0
- package/dist/chunk-JW7RJMEZ.js +134 -0
- package/dist/chunk-K76PXR3O.js +2317 -0
- package/dist/chunk-KCNIQN6V.js +107 -0
- package/dist/chunk-KH6KHYST.js +231 -0
- package/dist/chunk-KK4SEN7N.js +247 -0
- package/dist/chunk-KOKRGAAI.js +383 -0
- package/dist/chunk-KQFNTGAF.js +187 -0
- package/dist/chunk-KRLNC6TH.js +50 -0
- package/dist/chunk-KYDLVMKA.js +99 -0
- package/dist/chunk-KZQDP2JM.js +155 -0
- package/dist/chunk-L2EZ2HOX.js +132 -0
- package/dist/chunk-L2UAFR2D.js +33 -0
- package/dist/chunk-L4R7ORMD.js +4596 -0
- package/dist/chunk-LCLWN64E.js +227 -0
- package/dist/chunk-LFQI2C46.js +175 -0
- package/dist/chunk-LLYX4F5A.js +1628 -0
- package/dist/chunk-LQX5QCDS.js +215 -0
- package/dist/chunk-LRMHASG2.js +196 -0
- package/dist/chunk-LVUSG56I.js +5930 -0
- package/dist/chunk-LVUSG56I.js.map +1 -0
- package/dist/chunk-M5FX5KH5.js +629 -0
- package/dist/chunk-MLOTUQJJ.js +201 -0
- package/dist/chunk-MPUKGKXZ.js +209 -0
- package/dist/chunk-MS6LW4VU.js +283 -0
- package/dist/chunk-MWN7LDYV.js +4601 -0
- package/dist/chunk-MWN7LDYV.js.map +1 -0
- package/dist/chunk-MXPW4F74.js +278 -0
- package/dist/chunk-MZ7GJX5S.js +158 -0
- package/dist/chunk-N5OUIUYD.js +1260 -0
- package/dist/chunk-N6FNORC7.js +412 -0
- package/dist/chunk-NALVKY4U.js +113 -0
- package/dist/chunk-NJ77ZL5T.js +5222 -0
- package/dist/chunk-NM2DNJDJ.js +270 -0
- package/dist/chunk-NNKRRF7E.js +110 -0
- package/dist/chunk-NP5UFWU4.js +318 -0
- package/dist/chunk-NV3AEIFO.js +118 -0
- package/dist/chunk-O6JDF7KH.js +828 -0
- package/dist/chunk-OERZH3J4.js +251 -0
- package/dist/chunk-OKHWTWWU.js +1152 -0
- package/dist/chunk-OLAIUVGT.js +274 -0
- package/dist/chunk-OO36IUMS.js +270 -0
- package/dist/chunk-OVDK7K2Z.js +57 -0
- package/dist/chunk-OX5ZCHZQ.js +63 -0
- package/dist/chunk-P6LLCGPO.js +515 -0
- package/dist/chunk-PA2CUHTD.js +505 -0
- package/dist/chunk-PB4CQIRA.js +4979 -0
- package/dist/chunk-PBV2P632.js +566 -0
- package/dist/chunk-PCSRHFRF.js +75 -0
- package/dist/chunk-PEPWW5BC.js +436 -0
- package/dist/chunk-PMBZMVKE.js +33 -0
- package/dist/chunk-PP32RE26.js +34 -0
- package/dist/chunk-PTXAPI3Q.js +73 -0
- package/dist/chunk-PULNNF7G.js +56 -0
- package/dist/chunk-Q6KNROUT.js +158 -0
- package/dist/chunk-QEGP3HSW.js +184 -0
- package/dist/chunk-QEGP3HSW.js.map +1 -0
- package/dist/chunk-QGJIFIKN.js +1032 -0
- package/dist/chunk-QKKKORGL.js +41 -0
- package/dist/chunk-QKUMMG6P.js +85 -0
- package/dist/chunk-QNOWKKZ4.js +40 -0
- package/dist/chunk-QSWD3AHE.js +84 -0
- package/dist/chunk-QZ4U2VL5.js +391 -0
- package/dist/chunk-QZJNCLHV.js +271 -0
- package/dist/chunk-R6CFPY3F.js +278 -0
- package/dist/chunk-R6QRUYUH.js +406 -0
- package/dist/chunk-RE3GAQI5.js +2984 -0
- package/dist/chunk-RFHUVPFA.js +1184 -0
- package/dist/chunk-RH45HT5T.js +3690 -0
- package/dist/chunk-RJNQTZ5O.js +439 -0
- package/dist/chunk-RN24AP7Q.js +247 -0
- package/dist/chunk-RN24AP7Q.js.map +1 -0
- package/dist/chunk-S2BJTAAB.js +37 -0
- package/dist/chunk-S56PWXIX.js +138 -0
- package/dist/chunk-S6BDABIC.js +1390 -0
- package/dist/chunk-S6BDABIC.js.map +1 -0
- package/dist/chunk-S6FFDIHD.js +640 -0
- package/dist/chunk-S6MAMIK2.js +56 -0
- package/dist/chunk-SERTO6H6.js +311 -0
- package/dist/chunk-STOOH7EI.js +200 -0
- package/dist/chunk-SWSTEUXX.js +121 -0
- package/dist/chunk-SWZN7NNZ.js +1029 -0
- package/dist/chunk-SYDF57KS.js +178 -0
- package/dist/chunk-T275CUVD.js +29 -0
- package/dist/chunk-T4OT7QWP.js +378 -0
- package/dist/chunk-TCSRY2NP.js +2582 -0
- package/dist/chunk-TCX5OA2X.js +1177 -0
- package/dist/chunk-TDW5CSO5.js +3158 -0
- package/dist/chunk-TGG3ODCS.js +99 -0
- package/dist/chunk-TILSTYUC.js +505 -0
- package/dist/chunk-TJ5DYWXU.js +1333 -0
- package/dist/chunk-TNRI4ZE6.js +391 -0
- package/dist/chunk-TPIFVUMF.js +188 -0
- package/dist/chunk-TSW6OF22.js +162 -0
- package/dist/chunk-TTSTBHGR.js +1095 -0
- package/dist/chunk-U3JYAWMR.js +170 -0
- package/dist/chunk-U7ODSHA5.js +124 -0
- package/dist/chunk-UEGEPRNP.js +48 -0
- package/dist/chunk-UGIA2YEJ.js +83 -0
- package/dist/chunk-UHLKKDNF.js +432 -0
- package/dist/chunk-ULVXKIPX.js +26 -0
- package/dist/chunk-UN37ZY6R.js +10074 -0
- package/dist/chunk-UN37ZY6R.js.map +1 -0
- package/dist/chunk-USUDKZ5G.js +98 -0
- package/dist/chunk-UVO6I2F6.js +85 -0
- package/dist/chunk-V6NVG4K2.js +357 -0
- package/dist/chunk-VCMQFD3G.js +1185 -0
- package/dist/chunk-VKPBDNIO.js +246 -0
- package/dist/chunk-VLDKWGHD.js +61 -0
- package/dist/chunk-VM2NA2EL.js +905 -0
- package/dist/chunk-VMZTCVEL.js +114 -0
- package/dist/chunk-VQH5AXZY.js +269 -0
- package/dist/chunk-VTBTW6N4.js +114 -0
- package/dist/chunk-VV7PLDX4.js +230 -0
- package/dist/chunk-VYGGLH5H.js +50 -0
- package/dist/chunk-VYQHHTQ4.js +133 -0
- package/dist/chunk-VYSGRD2W.js +292 -0
- package/dist/chunk-W4W63LTP.js +1309 -0
- package/dist/chunk-WFC2JA6D.js +2335 -0
- package/dist/chunk-WFC2JA6D.js.map +1 -0
- package/dist/chunk-WHTRR66J.js +197 -0
- package/dist/chunk-WICIQFHJ.js +42 -0
- package/dist/chunk-WJYYMCCC.js +283 -0
- package/dist/chunk-WSJOWQJE.js +399 -0
- package/dist/chunk-WY333GHH.js +108 -0
- package/dist/chunk-WY333GHH.js.map +1 -0
- package/dist/chunk-WYDUXZ2R.js +353 -0
- package/dist/chunk-X62CN4YR.js +3321 -0
- package/dist/chunk-XFQHKMO6.js +1024 -0
- package/dist/chunk-XGJ7XZHS.js +527 -0
- package/dist/chunk-XJFJNOEV.js +723 -0
- package/dist/chunk-XKJLHMXZ.js +234 -0
- package/dist/chunk-XLFPJVQS.js +103 -0
- package/dist/chunk-XM4ZLZFW.js +129 -0
- package/dist/chunk-Y2GAWEJD.js +1021 -0
- package/dist/chunk-Y3A74SVK.js +296 -0
- package/dist/chunk-YANEVGI3.js +92 -0
- package/dist/chunk-YHHSO5QR.js +128 -0
- package/dist/chunk-YOSOCHCB.js +52 -0
- package/dist/chunk-YP4SNX4P.js +220 -0
- package/dist/chunk-YQH6AMIH.js +176 -0
- package/dist/chunk-YRWL2IAE.js +165 -0
- package/dist/chunk-YTWRQ3WK.js +251 -0
- package/dist/chunk-YV5GGSLK.js +20 -0
- package/dist/chunk-YXUDK37V.js +126 -0
- package/dist/chunk-YYM5TSCR.js +75 -0
- package/dist/chunk-ZG2CKFQF.js +202 -0
- package/dist/chunk-ZGJXO2HH.js +93 -0
- package/dist/chunk-ZGV76PZ4.js +3070 -0
- package/dist/chunk-ZOBUR2VC.js +229 -0
- package/dist/components/artifacts/artifact-chrome.d.ts +4 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +13 -0
- package/dist/components/artifacts/inline-html-document.d.ts +10 -1
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -0
- package/dist/components/preview-loading.d.ts +3 -1
- package/dist/composer.js +37 -37
- package/dist/computer-viewer-S6AL3XDT.js +21 -0
- package/dist/connect.js +38 -37
- package/dist/connection-step-up-XGPZKQEL.js +149 -0
- package/dist/connection-step-up-XGPZKQEL.js.map +1 -0
- package/dist/desktop-dictation.js +23 -23
- package/dist/desktop.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/embedded-new-voice-T3BXRYJX.js +25 -0
- package/dist/embedded-voice-ZJXMF3RP.js +25 -0
- package/dist/fleet-decision-row-AUCMLBCV.js +361 -0
- package/dist/in-chat-connect-model.js +5 -5
- package/dist/index.js +296 -295
- package/dist/interaction.js +9 -9
- package/dist/latest-question-D5BKKEP6.js +1 -1
- package/dist/machine-request-model.js +1 -1
- package/dist/machines.js +8 -8
- package/dist/meetings/meeting-detail-page.d.ts +14 -0
- package/dist/meetings/meeting-notes.d.ts +6 -2
- package/dist/meetings/meeting-transcript.d.ts +3 -1
- package/dist/meetings-recorder.js +1 -1
- package/dist/meetings.js +367 -260
- package/dist/meetings.js.map +1 -1
- package/dist/messages/en.d.ts +6 -2
- package/dist/messages.js +1 -1
- package/dist/model-policy-picker-menu-TO57YUQ6.js +23 -0
- package/dist/native-previews.js +1 -1
- package/dist/payment-page-card-DFGDAMTG.js +227 -0
- package/dist/platform-activity-row-ZMBEJGXN.js +156 -0
- package/dist/queue-surface-implementation-KDK5CYH6.js +933 -0
- package/dist/realtime.js +17 -17
- package/dist/recorder-host-3HLYRL4H.js +80 -0
- package/dist/recordings.js +3 -3
- package/dist/sandbox-files-UOZ4OJZU.js +29 -0
- package/dist/session-app.js +406 -405
- package/dist/session-connect-cards-VZIYLH45.js +28 -0
- package/dist/session-list-model.js +2 -2
- package/dist/session-realtime-2ZGJWVZP.js +30 -0
- package/dist/session-realtime.js +2 -2
- package/dist/session-ui.js +98 -97
- package/dist/session.js +40 -40
- package/dist/sites.js +3 -3
- package/dist/skills.js +32 -32
- package/dist/terminal.js +2 -2
- package/dist/testing/meetings-fixture.d.ts +8 -0
- package/dist/testing/meetings-fixture.js +22 -1
- package/dist/testing/meetings-fixture.js.map +1 -1
- package/dist/this-computer.js +3 -3
- package/dist/timeline-annotation-markers-KBTFWLME.js +157 -0
- package/dist/timeline-annotation-selection-VI4YSDR5.js +208 -0
- package/dist/timeline-annotations-dialog-4PLWNLRB.js +283 -0
- package/dist/timeline-model.js +37 -37
- package/dist/ui/access-list.js +24 -24
- package/dist/ui/cadence-picker.js +7 -7
- package/dist/ui/capability-page.js +10 -10
- package/dist/ui/choice-cards.js +3 -3
- package/dist/ui/confirm-dialog.js +4 -4
- package/dist/ui/copy-field.js +3 -3
- package/dist/ui/detail-page.js +6 -6
- package/dist/ui/detail-sheet.js +6 -6
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/diff-view.js +3 -3
- package/dist/ui/disclosure.js +7 -7
- package/dist/ui/email-chips-input.js +3 -3
- package/dist/ui/field.js +2 -2
- package/dist/ui/flush-form-page.js +8 -8
- package/dist/ui/form-dialog.js +7 -7
- package/dist/ui/list-row.js +7 -7
- package/dist/ui/load-failure.js +3 -3
- package/dist/ui/relative-time.js +3 -3
- package/dist/ui/revision-history.js +16 -16
- package/dist/ui/role-select.js +13 -13
- package/dist/ui/select-menu.js +5 -5
- package/dist/ui/settings-nav.js +6 -6
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/usage-meter.js +4 -4
- package/dist/usage.js +3 -3
- package/dist/workbench.js +11 -11
- package/package.json +6 -5
- package/src/app/components/session/sandbox-recovery-actions.test.tsx +26 -0
- package/src/app/components/session/sandbox-recovery-actions.tsx +2 -1
- package/src/app/components/workspace-reach.tsx +2 -0
- package/src/components/artifacts/artifact-chrome.tsx +6 -0
- package/src/components/artifacts/artifact-sandbox.tsx +119 -20
- package/src/components/artifacts/chat-interactive-block.tsx +1 -0
- package/src/components/artifacts/inline-html-document.ts +13 -3
- package/src/components/artifacts/published-html-artifact-frame.tsx +60 -4
- package/src/components/preview-loading.tsx +2 -2
- package/src/meetings/meeting-detail-page.tsx +232 -112
- package/src/meetings/meeting-notes.tsx +48 -24
- package/src/meetings/meeting-transcript.tsx +75 -57
- package/src/meetings/meetings-pages.test.tsx +181 -2
- package/src/messages/en.ts +6 -2
- package/src/testing/meetings-fixture.ts +35 -1
- package/styles/compiled.css +8 -0
- package/styles/index.css +7 -0
- package/dist/browser-viewer-KFMM5S2B.js +0 -23
- package/dist/chat-interactive-block-5DJ72HU7.js +0 -22
- package/dist/chunk-2B3RQRNQ.js +0 -584
- package/dist/chunk-2DA7DTHO.js +0 -83
- package/dist/chunk-2GXAXCS2.js +0 -401
- package/dist/chunk-2JTZMHQK.js +0 -57
- package/dist/chunk-2LRJ32SO.js +0 -114
- package/dist/chunk-2VK7FJNR.js +0 -307
- package/dist/chunk-2YJS75C3.js +0 -269
- package/dist/chunk-2YNEUYWM.js +0 -231
- package/dist/chunk-2ZR75AUO.js +0 -225
- package/dist/chunk-32LD46VC.js +0 -72
- package/dist/chunk-3FVVZW7J.js +0 -84
- package/dist/chunk-4327UGUS.js +0 -79
- package/dist/chunk-45TILHFZ.js +0 -249
- package/dist/chunk-4AUSS7CX.js +0 -318
- package/dist/chunk-4ECOHGUL.js +0 -818
- package/dist/chunk-4FKE42TW.js +0 -1333
- package/dist/chunk-4K5UVYZQ.js +0 -113
- package/dist/chunk-4UZE7ZT4.js +0 -54
- package/dist/chunk-4XQH4XPP.js +0 -400
- package/dist/chunk-4Z7BPBS7.js +0 -34
- package/dist/chunk-56KVDNOS.js +0 -98
- package/dist/chunk-56NHT2TZ.js +0 -56
- package/dist/chunk-57QWSJLX.js +0 -114
- package/dist/chunk-5AGRFQSH.js +0 -432
- package/dist/chunk-5JMX5FRF.js +0 -1309
- package/dist/chunk-5UTHPGFF.js +0 -93
- package/dist/chunk-5VPQVMJI.js +0 -84
- package/dist/chunk-5WJCOFIU.js +0 -207
- package/dist/chunk-62T2ZPD5.js +0 -266
- package/dist/chunk-63AVTSUI.js +0 -383
- package/dist/chunk-6CDBX3XG.js +0 -33
- package/dist/chunk-6D3D2JWY.js +0 -278
- package/dist/chunk-6GUG7FXP.js +0 -380
- package/dist/chunk-6GUG7FXP.js.map +0 -1
- package/dist/chunk-6JGMBTXP.js +0 -114
- package/dist/chunk-6LYBRPUG.js +0 -931
- package/dist/chunk-6PHBW7SS.js +0 -287
- package/dist/chunk-6S2XVKNI.js +0 -91
- package/dist/chunk-6TWS6AXT.js +0 -1021
- package/dist/chunk-6VEIDSF4.js +0 -73
- package/dist/chunk-76NGRVCY.js +0 -340
- package/dist/chunk-7FFZLLCH.js +0 -391
- package/dist/chunk-7RRDXPNC.js +0 -111
- package/dist/chunk-7TLYFHMT.js +0 -851
- package/dist/chunk-7V2CQLTN.js +0 -20
- package/dist/chunk-7VDWXFTL.js +0 -772
- package/dist/chunk-A2OMNLDF.js +0 -150
- package/dist/chunk-A3QEJ2IZ.js +0 -229
- package/dist/chunk-A6Q6EUBR.js +0 -209
- package/dist/chunk-AJSRYRJS.js +0 -138
- package/dist/chunk-APNPWJCK.js +0 -66
- package/dist/chunk-ARNQH2XE.js +0 -178
- package/dist/chunk-B6AH43UQ.js +0 -2434
- package/dist/chunk-BIXGAYDJ.js +0 -276
- package/dist/chunk-BJ3WRO2K.js +0 -441
- package/dist/chunk-BO3D22BS.js +0 -12
- package/dist/chunk-BR62BHVY.js +0 -357
- package/dist/chunk-BTMSR4OA.js +0 -214
- package/dist/chunk-BVZYHORS.js +0 -40
- package/dist/chunk-BWBBS6HJ.js +0 -42
- package/dist/chunk-C22UPHA2.js +0 -274
- package/dist/chunk-C2EERTYX.js +0 -353
- package/dist/chunk-C2F6SKOS.js +0 -270
- package/dist/chunk-C625ODRG.js +0 -92
- package/dist/chunk-CAF3HFJH.js +0 -184
- package/dist/chunk-CAF3HFJH.js.map +0 -1
- package/dist/chunk-CC4JBFWY.js +0 -85
- package/dist/chunk-CDB66JAO.js +0 -283
- package/dist/chunk-CG2HT7TI.js +0 -269
- package/dist/chunk-CNNOPEAK.js +0 -570
- package/dist/chunk-CRBHMSAP.js +0 -469
- package/dist/chunk-CSK2WOOX.js +0 -83
- package/dist/chunk-CTBPPPLR.js +0 -2580
- package/dist/chunk-CTOLX2EW.js +0 -2317
- package/dist/chunk-CVDY7P3E.js +0 -246
- package/dist/chunk-CX3Z7W5Y.js +0 -107
- package/dist/chunk-D5K2BS5Q.js +0 -259
- package/dist/chunk-DA7XLT5F.js +0 -366
- package/dist/chunk-DAKKJ3XM.js +0 -298
- package/dist/chunk-DAKKJ3XM.js.map +0 -1
- package/dist/chunk-DC6KFW2R.js +0 -333
- package/dist/chunk-DIHPR5KJ.js +0 -15
- package/dist/chunk-DLMYANZX.js +0 -3851
- package/dist/chunk-DRAG2LZP.js +0 -171
- package/dist/chunk-E2SGFW2B.js +0 -3321
- package/dist/chunk-EAXZSBWV.js +0 -412
- package/dist/chunk-EFKWOXBP.js +0 -428
- package/dist/chunk-EGD5RPRX.js +0 -401
- package/dist/chunk-ELC2ZPHI.js +0 -1177
- package/dist/chunk-EZ5ZBOGQ.js +0 -1032
- package/dist/chunk-F2JKNL73.js +0 -187
- package/dist/chunk-F3LIUDXN.js +0 -738
- package/dist/chunk-F3LIUDXN.js.map +0 -1
- package/dist/chunk-FAB5SXNO.js +0 -640
- package/dist/chunk-FQ33JHJN.js +0 -63
- package/dist/chunk-FX343J2L.js +0 -132
- package/dist/chunk-FXFOKD7A.js +0 -449
- package/dist/chunk-FY42DW2R.js +0 -515
- package/dist/chunk-G4E5WKY7.js +0 -65
- package/dist/chunk-GFTV3RR6.js +0 -187
- package/dist/chunk-GGBMQNAB.js +0 -33
- package/dist/chunk-GGU7KV4G.js +0 -124
- package/dist/chunk-GIHE7U3Y.js +0 -174
- package/dist/chunk-GRGK3JJI.js +0 -10074
- package/dist/chunk-GRGK3JJI.js.map +0 -1
- package/dist/chunk-GT3FJVU6.js +0 -4596
- package/dist/chunk-GTGPKGWC.js +0 -65
- package/dist/chunk-GY6DSWBM.js +0 -82
- package/dist/chunk-H3EP6GNA.js +0 -538
- package/dist/chunk-HD2MCYQF.js +0 -234
- package/dist/chunk-HE4VN5D3.js +0 -4979
- package/dist/chunk-HFROJDFQ.js +0 -118
- package/dist/chunk-HHFFPE67.js +0 -220
- package/dist/chunk-HJ2CDFZX.js +0 -117
- package/dist/chunk-HJ2J2XQI.js +0 -88
- package/dist/chunk-HLLZPULI.js +0 -172
- package/dist/chunk-HPYQ5MES.js +0 -103
- package/dist/chunk-HRLJNDDC.js +0 -197
- package/dist/chunk-HVGM5IME.js +0 -170
- package/dist/chunk-HZE6V7GW.js +0 -214
- package/dist/chunk-I5DW76GB.js +0 -200
- package/dist/chunk-I7MZOZGC.js +0 -121
- package/dist/chunk-IB2EX6GX.js +0 -292
- package/dist/chunk-IEDDIJ6B.js +0 -4601
- package/dist/chunk-IEDDIJ6B.js.map +0 -1
- package/dist/chunk-IGFZFLI2.js +0 -1390
- package/dist/chunk-IGFZFLI2.js.map +0 -1
- package/dist/chunk-IIMRBCA4.js +0 -271
- package/dist/chunk-IIWNSYFA.js +0 -129
- package/dist/chunk-IN2ZJR2A.js +0 -96
- package/dist/chunk-IUPIJWFK.js +0 -905
- package/dist/chunk-IZA2KBYK.js +0 -57
- package/dist/chunk-IZZINUFM.js +0 -527
- package/dist/chunk-JFEAJRG6.js +0 -1029
- package/dist/chunk-JG7MEMJP.js +0 -1184
- package/dist/chunk-JIZWFW5A.js +0 -107
- package/dist/chunk-JJKUERR4.js +0 -131
- package/dist/chunk-JL4PMUDG.js +0 -192
- package/dist/chunk-JTWK3VE7.js +0 -202
- package/dist/chunk-JV2TJLUW.js +0 -144
- package/dist/chunk-KBDWMUYA.js +0 -175
- package/dist/chunk-KF65UG2L.js +0 -1628
- package/dist/chunk-KFYLTQGK.js +0 -133
- package/dist/chunk-KJI2DVSO.js +0 -26
- package/dist/chunk-KLYBSXHE.js +0 -3183
- package/dist/chunk-KPD6TBO4.js +0 -89
- package/dist/chunk-KTGKGHEA.js +0 -75
- package/dist/chunk-KUYQTNVT.js +0 -794
- package/dist/chunk-KZE7M52Y.js +0 -598
- package/dist/chunk-KZYZ3JHS.js +0 -112
- package/dist/chunk-L6WVCO6D.js +0 -61
- package/dist/chunk-L7T7M2P3.js +0 -5222
- package/dist/chunk-LKF6IPFC.js +0 -247
- package/dist/chunk-LLU7VKCZ.js +0 -188
- package/dist/chunk-LWEJGMVO.js +0 -50
- package/dist/chunk-LX5IEXDF.js +0 -505
- package/dist/chunk-LYEALWBN.js +0 -251
- package/dist/chunk-M722GGD3.js +0 -566
- package/dist/chunk-MCPKUVMQ.js +0 -99
- package/dist/chunk-MDGNCUAC.js +0 -145
- package/dist/chunk-MFLU3466.js +0 -99
- package/dist/chunk-MITT6IZG.js +0 -134
- package/dist/chunk-MN4LJYKQ.js +0 -608
- package/dist/chunk-MNCBL5AX.js +0 -449
- package/dist/chunk-MNCBL5AX.js.map +0 -1
- package/dist/chunk-MO3XJQN2.js +0 -629
- package/dist/chunk-MPP6BEAN.js +0 -158
- package/dist/chunk-MQRUZ2LW.js +0 -335
- package/dist/chunk-MRJFF5KY.js +0 -351
- package/dist/chunk-MUB44LD3.js +0 -75
- package/dist/chunk-MYDFABO6.js +0 -296
- package/dist/chunk-NJVHMK5R.js +0 -3158
- package/dist/chunk-NO6VQNWH.js +0 -396
- package/dist/chunk-NUF43R2F.js +0 -278
- package/dist/chunk-NUM3QV66.js +0 -107
- package/dist/chunk-NW4RPGET.js +0 -48
- package/dist/chunk-NZBZLY7H.js +0 -165
- package/dist/chunk-O664PL2U.js +0 -47
- package/dist/chunk-O664PL2U.js.map +0 -1
- package/dist/chunk-OCS3KIYC.js +0 -378
- package/dist/chunk-OKI45WHM.js +0 -311
- package/dist/chunk-ONF5M5GP.js +0 -283
- package/dist/chunk-OPCPBLHA.js +0 -79
- package/dist/chunk-OROXCA6L.js +0 -251
- package/dist/chunk-OTMJS3FV.js +0 -56
- package/dist/chunk-OXM267RC.js +0 -128
- package/dist/chunk-P5FLGDXW.js +0 -723
- package/dist/chunk-PC3FWPOP.js +0 -828
- package/dist/chunk-PPQJIVGM.js +0 -175
- package/dist/chunk-PQOVMZI2.js +0 -372
- package/dist/chunk-PVGD2RAV.js +0 -5926
- package/dist/chunk-PVGD2RAV.js.map +0 -1
- package/dist/chunk-PYU7CLEG.js +0 -215
- package/dist/chunk-Q2N5UR7Q.js +0 -505
- package/dist/chunk-Q4GB2QU3.js +0 -199
- package/dist/chunk-Q4RJKXQM.js +0 -606
- package/dist/chunk-Q4ZNRQKH.js +0 -196
- package/dist/chunk-Q7QXSQ46.js +0 -1185
- package/dist/chunk-QAVSUXLA.js +0 -773
- package/dist/chunk-QBJDMSFA.js +0 -27
- package/dist/chunk-QCB3WNCA.js +0 -176
- package/dist/chunk-QIOIJ7K5.js +0 -162
- package/dist/chunk-QR72J6WR.js +0 -650
- package/dist/chunk-QUTMVW4P.js +0 -141
- package/dist/chunk-QUXQYYZO.js +0 -73
- package/dist/chunk-RDHK2NYW.js +0 -129
- package/dist/chunk-RFBYAUZH.js +0 -311
- package/dist/chunk-RFBYAUZH.js.map +0 -1
- package/dist/chunk-RGCCRYTY.js +0 -46
- package/dist/chunk-RSTS3RWN.js +0 -211
- package/dist/chunk-RY7YRYVT.js +0 -126
- package/dist/chunk-S4LRL5BA.js +0 -439
- package/dist/chunk-S62CVC5C.js +0 -850
- package/dist/chunk-S62CVC5C.js.map +0 -1
- package/dist/chunk-SHVW3C3Y.js +0 -50
- package/dist/chunk-SL4CLUHR.js +0 -48
- package/dist/chunk-SOPKVWZJ.js +0 -1187
- package/dist/chunk-ST3H53IJ.js +0 -201
- package/dist/chunk-SYYFA7W7.js +0 -23
- package/dist/chunk-TBUWK3RP.js +0 -399
- package/dist/chunk-TC42NAIJ.js +0 -177
- package/dist/chunk-TJBTP6LH.js +0 -297
- package/dist/chunk-TQQALBLU.js +0 -391
- package/dist/chunk-TW56PZBB.js +0 -407
- package/dist/chunk-U6XRXK2T.js +0 -1356
- package/dist/chunk-U735UBHS.js +0 -2431
- package/dist/chunk-U735UBHS.js.map +0 -1
- package/dist/chunk-UAKG7GLE.js +0 -155
- package/dist/chunk-UB4GKFCI.js +0 -1095
- package/dist/chunk-UEAAF27Y.js +0 -108
- package/dist/chunk-UITWSZH3.js +0 -162
- package/dist/chunk-UQ67SEGH.js +0 -234
- package/dist/chunk-URSNCM57.js +0 -37
- package/dist/chunk-V77BSX2F.js +0 -1152
- package/dist/chunk-VATOL3OZ.js +0 -110
- package/dist/chunk-VEJG6GQQ.js +0 -103
- package/dist/chunk-VFQZPHZR.js +0 -436
- package/dist/chunk-VFZJV26C.js +0 -41
- package/dist/chunk-VJZPVP6C.js +0 -230
- package/dist/chunk-VQL7FHIF.js +0 -27
- package/dist/chunk-VSS6LRAK.js +0 -263
- package/dist/chunk-VSSXDLO3.js +0 -467
- package/dist/chunk-VVCKB62D.js +0 -1024
- package/dist/chunk-VVJDYTD4.js +0 -168
- package/dist/chunk-VVXOG3ZC.js +0 -52
- package/dist/chunk-W2EX346X.js +0 -85
- package/dist/chunk-W3R4C7Z2.js +0 -166
- package/dist/chunk-W43FINJV.js +0 -218
- package/dist/chunk-W6PJWSZ6.js +0 -1769
- package/dist/chunk-WCP32H3P.js +0 -2984
- package/dist/chunk-WKELNNIG.js +0 -3690
- package/dist/chunk-WRFXCMRW.js +0 -2591
- package/dist/chunk-WRLEHV4A.js +0 -386
- package/dist/chunk-WTNQHM6Q.js +0 -43
- package/dist/chunk-WTZ6OJUY.js +0 -3070
- package/dist/chunk-WVFMFQRZ.js +0 -256
- package/dist/chunk-WVFMFQRZ.js.map +0 -1
- package/dist/chunk-WYIC3CXE.js +0 -157
- package/dist/chunk-WZABXFUL.js +0 -246
- package/dist/chunk-WZABXFUL.js.map +0 -1
- package/dist/chunk-X3GBTLKD.js +0 -175
- package/dist/chunk-XBOLFS6I.js +0 -532
- package/dist/chunk-XF4UH54P.js +0 -250
- package/dist/chunk-XHPBQTJP.js +0 -1260
- package/dist/chunk-XQ4TJITR.js +0 -270
- package/dist/chunk-XRFMGLCE.js +0 -466
- package/dist/chunk-XV2F7PGS.js +0 -236
- package/dist/chunk-Y2EQTW5Q.js +0 -100
- package/dist/chunk-YAOXCAQD.js +0 -371
- package/dist/chunk-YCDB3HPS.js +0 -137
- package/dist/chunk-YCONEOZQ.js +0 -191
- package/dist/chunk-YG243U6J.js +0 -158
- package/dist/chunk-YGQANOSV.js +0 -113
- package/dist/chunk-YKRWKRNX.js +0 -138
- package/dist/chunk-YKT5NYYJ.js +0 -3996
- package/dist/chunk-YKT5NYYJ.js.map +0 -1
- package/dist/chunk-YLWABUFE.js +0 -406
- package/dist/chunk-YOKIE7NG.js +0 -227
- package/dist/chunk-YRCDL3GO.js +0 -2582
- package/dist/chunk-YVBAYE7Y.js +0 -1236
- package/dist/chunk-YYKPRX4P.js +0 -29
- package/dist/chunk-Z4MW635R.js +0 -849
- package/dist/chunk-Z7IPPKG6.js +0 -403
- package/dist/chunk-ZFGXQ54H.js +0 -114
- package/dist/chunk-ZGBXHHCL.js +0 -373
- package/dist/computer-viewer-AVH5J4TC.js +0 -21
- package/dist/connection-step-up-T2B25VP7.js +0 -148
- package/dist/connection-step-up-T2B25VP7.js.map +0 -1
- package/dist/embedded-new-voice-M6PBWMQZ.js +0 -25
- package/dist/embedded-voice-7USALJKI.js +0 -25
- package/dist/fleet-decision-row-XY6OZPHA.js +0 -361
- package/dist/model-policy-picker-menu-S5RTVLMQ.js +0 -23
- package/dist/payment-page-card-XSY5NO7D.js +0 -227
- package/dist/platform-activity-row-77WER5O3.js +0 -156
- package/dist/queue-surface-implementation-SDV7I32L.js +0 -933
- package/dist/recorder-host-7GNQG6BB.js +0 -80
- package/dist/sandbox-files-JOH2Q57T.js +0 -29
- package/dist/session-connect-cards-HZIR4ZWT.js +0 -28
- package/dist/session-realtime-OPCPTIAP.js +0 -30
- package/dist/timeline-annotation-markers-WXCRA4BY.js +0 -157
- package/dist/timeline-annotation-selection-YBZQNCNX.js +0 -208
- package/dist/timeline-annotations-dialog-4WVXTKFW.js +0 -283
- /package/dist/{browser-viewer-KFMM5S2B.js.map → browser-viewer-TRPZI6NT.js.map} +0 -0
- /package/dist/{chat-interactive-block-5DJ72HU7.js.map → chat-interactive-block-Y4BS4JCM.js.map} +0 -0
- /package/dist/{chunk-CRBHMSAP.js.map → chunk-22E2YJHT.js.map} +0 -0
- /package/dist/{chunk-H3EP6GNA.js.map → chunk-2T6TN2YL.js.map} +0 -0
- /package/dist/{chunk-KBDWMUYA.js.map → chunk-2WNN26NW.js.map} +0 -0
- /package/dist/{chunk-HJ2J2XQI.js.map → chunk-3432A6XB.js.map} +0 -0
- /package/dist/{chunk-DA7XLT5F.js.map → chunk-35U7NSOR.js.map} +0 -0
- /package/dist/{chunk-QAVSUXLA.js.map → chunk-3EPR76WS.js.map} +0 -0
- /package/dist/{chunk-JV2TJLUW.js.map → chunk-3FXXEU5D.js.map} +0 -0
- /package/dist/{chunk-QR72J6WR.js.map → chunk-3MXOPOEU.js.map} +0 -0
- /package/dist/{chunk-76NGRVCY.js.map → chunk-3PKDU4JI.js.map} +0 -0
- /package/dist/{chunk-BO3D22BS.js.map → chunk-3PMO2BIV.js.map} +0 -0
- /package/dist/{chunk-SL4CLUHR.js.map → chunk-3XWHJNFY.js.map} +0 -0
- /package/dist/{chunk-EGD5RPRX.js.map → chunk-45WD2PKE.js.map} +0 -0
- /package/dist/{chunk-KZE7M52Y.js.map → chunk-4H2OWNRA.js.map} +0 -0
- /package/dist/{chunk-VSS6LRAK.js.map → chunk-4HVGOTMU.js.map} +0 -0
- /package/dist/{chunk-4ECOHGUL.js.map → chunk-4JER2ZMV.js.map} +0 -0
- /package/dist/{chunk-HZE6V7GW.js.map → chunk-4LVZ2VOQ.js.map} +0 -0
- /package/dist/{chunk-B6AH43UQ.js.map → chunk-4OGDD2EM.js.map} +0 -0
- /package/dist/{chunk-4UZE7ZT4.js.map → chunk-4PQC6WMF.js.map} +0 -0
- /package/dist/{chunk-KUYQTNVT.js.map → chunk-4UVSWAT3.js.map} +0 -0
- /package/dist/{chunk-BTMSR4OA.js.map → chunk-53A47RBX.js.map} +0 -0
- /package/dist/{chunk-57QWSJLX.js.map → chunk-552KKENW.js.map} +0 -0
- /package/dist/{chunk-TC42NAIJ.js.map → chunk-55F7L6M3.js.map} +0 -0
- /package/dist/{chunk-FXFOKD7A.js.map → chunk-5AHIKB3O.js.map} +0 -0
- /package/dist/{chunk-Q4GB2QU3.js.map → chunk-5N4L5WTE.js.map} +0 -0
- /package/dist/{chunk-4327UGUS.js.map → chunk-5OUJCVZI.js.map} +0 -0
- /package/dist/{chunk-GTGPKGWC.js.map → chunk-5OYXQ7MH.js.map} +0 -0
- /package/dist/{chunk-2ZR75AUO.js.map → chunk-5TAVVMFX.js.map} +0 -0
- /package/dist/{chunk-2YJS75C3.js.map → chunk-5Y3LYRNH.js.map} +0 -0
- /package/dist/{chunk-WRLEHV4A.js.map → chunk-5ZJKKE4T.js.map} +0 -0
- /package/dist/{chunk-2JTZMHQK.js.map → chunk-62DPSQRZ.js.map} +0 -0
- /package/dist/{chunk-MN4LJYKQ.js.map → chunk-64KMWTJ6.js.map} +0 -0
- /package/dist/{chunk-QUXQYYZO.js.map → chunk-6MZBNUS7.js.map} +0 -0
- /package/dist/{chunk-XF4UH54P.js.map → chunk-6YCE4ZC4.js.map} +0 -0
- /package/dist/{chunk-X3GBTLKD.js.map → chunk-6YROWWMX.js.map} +0 -0
- /package/dist/{chunk-YVBAYE7Y.js.map → chunk-73RZ72VU.js.map} +0 -0
- /package/dist/{chunk-5VPQVMJI.js.map → chunk-74KV436L.js.map} +0 -0
- /package/dist/{chunk-CSK2WOOX.js.map → chunk-7HKGLPV5.js.map} +0 -0
- /package/dist/{chunk-XRFMGLCE.js.map → chunk-7JSWODT6.js.map} +0 -0
- /package/dist/{chunk-EFKWOXBP.js.map → chunk-7K3PKWER.js.map} +0 -0
- /package/dist/{chunk-U6XRXK2T.js.map → chunk-7MPWC42V.js.map} +0 -0
- /package/dist/{chunk-QUTMVW4P.js.map → chunk-7REO6FRN.js.map} +0 -0
- /package/dist/{chunk-MDGNCUAC.js.map → chunk-7YMWRNRQ.js.map} +0 -0
- /package/dist/{chunk-JJKUERR4.js.map → chunk-A6H3KJ7G.js.map} +0 -0
- /package/dist/{chunk-W6PJWSZ6.js.map → chunk-AGQIE6YU.js.map} +0 -0
- /package/dist/{chunk-ZGBXHHCL.js.map → chunk-AHQM4I5V.js.map} +0 -0
- /package/dist/{chunk-HLLZPULI.js.map → chunk-AMTRO7XF.js.map} +0 -0
- /package/dist/{chunk-6S2XVKNI.js.map → chunk-AO4LTCG7.js.map} +0 -0
- /package/dist/{chunk-CTBPPPLR.js.map → chunk-APJ22OZV.js.map} +0 -0
- /package/dist/{chunk-TW56PZBB.js.map → chunk-APWL37KW.js.map} +0 -0
- /package/dist/{chunk-DIHPR5KJ.js.map → chunk-AQEJOBQ2.js.map} +0 -0
- /package/dist/{chunk-HD2MCYQF.js.map → chunk-ARKNT6BX.js.map} +0 -0
- /package/dist/{chunk-RSTS3RWN.js.map → chunk-B2IHDMAR.js.map} +0 -0
- /package/dist/{chunk-KZYZ3JHS.js.map → chunk-BCKIV26W.js.map} +0 -0
- /package/dist/{chunk-D5K2BS5Q.js.map → chunk-BE26JUSD.js.map} +0 -0
- /package/dist/{chunk-DRAG2LZP.js.map → chunk-BOVCD6KD.js.map} +0 -0
- /package/dist/{chunk-IIWNSYFA.js.map → chunk-BQWV66A6.js.map} +0 -0
- /package/dist/{chunk-BJ3WRO2K.js.map → chunk-BSQJXGGP.js.map} +0 -0
- /package/dist/{chunk-KLYBSXHE.js.map → chunk-BZY3MEVZ.js.map} +0 -0
- /package/dist/{chunk-MQRUZ2LW.js.map → chunk-C3D3OOEY.js.map} +0 -0
- /package/dist/{chunk-GY6DSWBM.js.map → chunk-CDHYO3DP.js.map} +0 -0
- /package/dist/{chunk-OPCPBLHA.js.map → chunk-CDV5JGVI.js.map} +0 -0
- /package/dist/{chunk-5WJCOFIU.js.map → chunk-CNW45M7G.js.map} +0 -0
- /package/dist/{chunk-A2OMNLDF.js.map → chunk-CUVQ37HB.js.map} +0 -0
- /package/dist/{chunk-XBOLFS6I.js.map → chunk-D32T3IIC.js.map} +0 -0
- /package/dist/{chunk-YAOXCAQD.js.map → chunk-D65BSM64.js.map} +0 -0
- /package/dist/{chunk-CNNOPEAK.js.map → chunk-D7435DWV.js.map} +0 -0
- /package/dist/{chunk-32LD46VC.js.map → chunk-DFH3M7B3.js.map} +0 -0
- /package/dist/{chunk-QIOIJ7K5.js.map → chunk-DGWBQ76M.js.map} +0 -0
- /package/dist/{chunk-PQOVMZI2.js.map → chunk-DHJDTGSJ.js.map} +0 -0
- /package/dist/{chunk-4XQH4XPP.js.map → chunk-DKEFTNCD.js.map} +0 -0
- /package/dist/{chunk-JIZWFW5A.js.map → chunk-DNAF6MT4.js.map} +0 -0
- /package/dist/{chunk-QBJDMSFA.js.map → chunk-E35XY7DS.js.map} +0 -0
- /package/dist/{chunk-NO6VQNWH.js.map → chunk-E5T5WIIP.js.map} +0 -0
- /package/dist/{chunk-W3R4C7Z2.js.map → chunk-EL6ECD34.js.map} +0 -0
- /package/dist/{chunk-VSSXDLO3.js.map → chunk-ELR6ITRC.js.map} +0 -0
- /package/dist/{chunk-7TLYFHMT.js.map → chunk-EPE3V2VE.js.map} +0 -0
- /package/dist/{chunk-2B3RQRNQ.js.map → chunk-EYGQHHVW.js.map} +0 -0
- /package/dist/{chunk-2VK7FJNR.js.map → chunk-EYQEJHYP.js.map} +0 -0
- /package/dist/{chunk-BIXGAYDJ.js.map → chunk-EZTH2XMH.js.map} +0 -0
- /package/dist/{chunk-6PHBW7SS.js.map → chunk-F3QVHVFS.js.map} +0 -0
- /package/dist/{chunk-SOPKVWZJ.js.map → chunk-F5VWPREQ.js.map} +0 -0
- /package/dist/{chunk-YGQANOSV.js.map → chunk-FM7AQUBL.js.map} +0 -0
- /package/dist/{chunk-Y2EQTW5Q.js.map → chunk-FP6BUXJM.js.map} +0 -0
- /package/dist/{chunk-45TILHFZ.js.map → chunk-FVU52L3I.js.map} +0 -0
- /package/dist/{chunk-W43FINJV.js.map → chunk-FZKNXNNO.js.map} +0 -0
- /package/dist/{chunk-XV2F7PGS.js.map → chunk-G3IXJWRY.js.map} +0 -0
- /package/dist/{chunk-DC6KFW2R.js.map → chunk-G6EI2O3N.js.map} +0 -0
- /package/dist/{chunk-2GXAXCS2.js.map → chunk-GB5T6YMZ.js.map} +0 -0
- /package/dist/{chunk-WYIC3CXE.js.map → chunk-GBLD6FOG.js.map} +0 -0
- /package/dist/{chunk-YCDB3HPS.js.map → chunk-GJBFFXCY.js.map} +0 -0
- /package/dist/{chunk-APNPWJCK.js.map → chunk-GJDP2K2S.js.map} +0 -0
- /package/dist/{chunk-GFTV3RR6.js.map → chunk-GP26XTDX.js.map} +0 -0
- /package/dist/{chunk-Q4RJKXQM.js.map → chunk-GTE6WP4N.js.map} +0 -0
- /package/dist/{chunk-UEAAF27Y.js.map → chunk-GWG3OAV7.js.map} +0 -0
- /package/dist/{chunk-6LYBRPUG.js.map → chunk-GXMHTMM6.js.map} +0 -0
- /package/dist/{chunk-NUM3QV66.js.map → chunk-GYRN5O2E.js.map} +0 -0
- /package/dist/{chunk-G4E5WKY7.js.map → chunk-GZX7W2WW.js.map} +0 -0
- /package/dist/{chunk-Z7IPPKG6.js.map → chunk-H3QI2G2B.js.map} +0 -0
- /package/dist/{chunk-Z4MW635R.js.map → chunk-H7D4DVWY.js.map} +0 -0
- /package/dist/{chunk-YCONEOZQ.js.map → chunk-HCDGBBBJ.js.map} +0 -0
- /package/dist/{chunk-DLMYANZX.js.map → chunk-HDSH6MIJ.js.map} +0 -0
- /package/dist/{chunk-KPD6TBO4.js.map → chunk-HOEUPZ6O.js.map} +0 -0
- /package/dist/{chunk-7VDWXFTL.js.map → chunk-HPQRWTQB.js.map} +0 -0
- /package/dist/{chunk-GIHE7U3Y.js.map → chunk-HUKGLWAY.js.map} +0 -0
- /package/dist/{chunk-SYYFA7W7.js.map → chunk-HUTQJY3F.js.map} +0 -0
- /package/dist/{chunk-62T2ZPD5.js.map → chunk-HWOYJOKK.js.map} +0 -0
- /package/dist/{chunk-IN2ZJR2A.js.map → chunk-HZR3WGUP.js.map} +0 -0
- /package/dist/{chunk-YKRWKRNX.js.map → chunk-I7YUDPDR.js.map} +0 -0
- /package/dist/{chunk-VQL7FHIF.js.map → chunk-IDII52M4.js.map} +0 -0
- /package/dist/{chunk-HPYQ5MES.js.map → chunk-IDPWEUM7.js.map} +0 -0
- /package/dist/{chunk-JL4PMUDG.js.map → chunk-IEWQFGEC.js.map} +0 -0
- /package/dist/{chunk-MRJFF5KY.js.map → chunk-IMTACEXF.js.map} +0 -0
- /package/dist/{chunk-2LRJ32SO.js.map → chunk-IVWT6M6N.js.map} +0 -0
- /package/dist/{chunk-7RRDXPNC.js.map → chunk-JEUPIHIP.js.map} +0 -0
- /package/dist/{chunk-VVJDYTD4.js.map → chunk-JF4WX3GQ.js.map} +0 -0
- /package/dist/{chunk-WRFXCMRW.js.map → chunk-JJPYXUKC.js.map} +0 -0
- /package/dist/{chunk-WTNQHM6Q.js.map → chunk-JNHWTYDD.js.map} +0 -0
- /package/dist/{chunk-RGCCRYTY.js.map → chunk-JP7AOJWD.js.map} +0 -0
- /package/dist/{chunk-TJBTP6LH.js.map → chunk-JTWT2WQA.js.map} +0 -0
- /package/dist/{chunk-HJ2CDFZX.js.map → chunk-JW3WIHWO.js.map} +0 -0
- /package/dist/{chunk-MITT6IZG.js.map → chunk-JW7RJMEZ.js.map} +0 -0
- /package/dist/{chunk-CTOLX2EW.js.map → chunk-K76PXR3O.js.map} +0 -0
- /package/dist/{chunk-CX3Z7W5Y.js.map → chunk-KCNIQN6V.js.map} +0 -0
- /package/dist/{chunk-2YNEUYWM.js.map → chunk-KH6KHYST.js.map} +0 -0
- /package/dist/{chunk-LKF6IPFC.js.map → chunk-KK4SEN7N.js.map} +0 -0
- /package/dist/{chunk-63AVTSUI.js.map → chunk-KOKRGAAI.js.map} +0 -0
- /package/dist/{chunk-F2JKNL73.js.map → chunk-KQFNTGAF.js.map} +0 -0
- /package/dist/{chunk-SHVW3C3Y.js.map → chunk-KRLNC6TH.js.map} +0 -0
- /package/dist/{chunk-MFLU3466.js.map → chunk-KYDLVMKA.js.map} +0 -0
- /package/dist/{chunk-UAKG7GLE.js.map → chunk-KZQDP2JM.js.map} +0 -0
- /package/dist/{chunk-FX343J2L.js.map → chunk-L2EZ2HOX.js.map} +0 -0
- /package/dist/{chunk-GGBMQNAB.js.map → chunk-L2UAFR2D.js.map} +0 -0
- /package/dist/{chunk-GT3FJVU6.js.map → chunk-L4R7ORMD.js.map} +0 -0
- /package/dist/{chunk-YOKIE7NG.js.map → chunk-LCLWN64E.js.map} +0 -0
- /package/dist/{chunk-PPQJIVGM.js.map → chunk-LFQI2C46.js.map} +0 -0
- /package/dist/{chunk-KF65UG2L.js.map → chunk-LLYX4F5A.js.map} +0 -0
- /package/dist/{chunk-PYU7CLEG.js.map → chunk-LQX5QCDS.js.map} +0 -0
- /package/dist/{chunk-Q4ZNRQKH.js.map → chunk-LRMHASG2.js.map} +0 -0
- /package/dist/{chunk-MO3XJQN2.js.map → chunk-M5FX5KH5.js.map} +0 -0
- /package/dist/{chunk-ST3H53IJ.js.map → chunk-MLOTUQJJ.js.map} +0 -0
- /package/dist/{chunk-A6Q6EUBR.js.map → chunk-MPUKGKXZ.js.map} +0 -0
- /package/dist/{chunk-ONF5M5GP.js.map → chunk-MS6LW4VU.js.map} +0 -0
- /package/dist/{chunk-NUF43R2F.js.map → chunk-MXPW4F74.js.map} +0 -0
- /package/dist/{chunk-MPP6BEAN.js.map → chunk-MZ7GJX5S.js.map} +0 -0
- /package/dist/{chunk-XHPBQTJP.js.map → chunk-N5OUIUYD.js.map} +0 -0
- /package/dist/{chunk-EAXZSBWV.js.map → chunk-N6FNORC7.js.map} +0 -0
- /package/dist/{chunk-4K5UVYZQ.js.map → chunk-NALVKY4U.js.map} +0 -0
- /package/dist/{chunk-L7T7M2P3.js.map → chunk-NJ77ZL5T.js.map} +0 -0
- /package/dist/{chunk-XQ4TJITR.js.map → chunk-NM2DNJDJ.js.map} +0 -0
- /package/dist/{chunk-VATOL3OZ.js.map → chunk-NNKRRF7E.js.map} +0 -0
- /package/dist/{chunk-4AUSS7CX.js.map → chunk-NP5UFWU4.js.map} +0 -0
- /package/dist/{chunk-HFROJDFQ.js.map → chunk-NV3AEIFO.js.map} +0 -0
- /package/dist/{chunk-PC3FWPOP.js.map → chunk-O6JDF7KH.js.map} +0 -0
- /package/dist/{chunk-OROXCA6L.js.map → chunk-OERZH3J4.js.map} +0 -0
- /package/dist/{chunk-V77BSX2F.js.map → chunk-OKHWTWWU.js.map} +0 -0
- /package/dist/{chunk-C22UPHA2.js.map → chunk-OLAIUVGT.js.map} +0 -0
- /package/dist/{chunk-C2F6SKOS.js.map → chunk-OO36IUMS.js.map} +0 -0
- /package/dist/{chunk-IZA2KBYK.js.map → chunk-OVDK7K2Z.js.map} +0 -0
- /package/dist/{chunk-FQ33JHJN.js.map → chunk-OX5ZCHZQ.js.map} +0 -0
- /package/dist/{chunk-FY42DW2R.js.map → chunk-P6LLCGPO.js.map} +0 -0
- /package/dist/{chunk-LX5IEXDF.js.map → chunk-PA2CUHTD.js.map} +0 -0
- /package/dist/{chunk-HE4VN5D3.js.map → chunk-PB4CQIRA.js.map} +0 -0
- /package/dist/{chunk-M722GGD3.js.map → chunk-PBV2P632.js.map} +0 -0
- /package/dist/{chunk-KTGKGHEA.js.map → chunk-PCSRHFRF.js.map} +0 -0
- /package/dist/{chunk-VFQZPHZR.js.map → chunk-PEPWW5BC.js.map} +0 -0
- /package/dist/{chunk-6CDBX3XG.js.map → chunk-PMBZMVKE.js.map} +0 -0
- /package/dist/{chunk-4Z7BPBS7.js.map → chunk-PP32RE26.js.map} +0 -0
- /package/dist/{chunk-6VEIDSF4.js.map → chunk-PTXAPI3Q.js.map} +0 -0
- /package/dist/{chunk-OTMJS3FV.js.map → chunk-PULNNF7G.js.map} +0 -0
- /package/dist/{chunk-YG243U6J.js.map → chunk-Q6KNROUT.js.map} +0 -0
- /package/dist/{chunk-EZ5ZBOGQ.js.map → chunk-QGJIFIKN.js.map} +0 -0
- /package/dist/{chunk-VFZJV26C.js.map → chunk-QKKKORGL.js.map} +0 -0
- /package/dist/{chunk-W2EX346X.js.map → chunk-QKUMMG6P.js.map} +0 -0
- /package/dist/{chunk-BVZYHORS.js.map → chunk-QNOWKKZ4.js.map} +0 -0
- /package/dist/{chunk-3FVVZW7J.js.map → chunk-QSWD3AHE.js.map} +0 -0
- /package/dist/{chunk-7FFZLLCH.js.map → chunk-QZ4U2VL5.js.map} +0 -0
- /package/dist/{chunk-IIMRBCA4.js.map → chunk-QZJNCLHV.js.map} +0 -0
- /package/dist/{chunk-6D3D2JWY.js.map → chunk-R6CFPY3F.js.map} +0 -0
- /package/dist/{chunk-YLWABUFE.js.map → chunk-R6QRUYUH.js.map} +0 -0
- /package/dist/{chunk-WCP32H3P.js.map → chunk-RE3GAQI5.js.map} +0 -0
- /package/dist/{chunk-JG7MEMJP.js.map → chunk-RFHUVPFA.js.map} +0 -0
- /package/dist/{chunk-WKELNNIG.js.map → chunk-RH45HT5T.js.map} +0 -0
- /package/dist/{chunk-S4LRL5BA.js.map → chunk-RJNQTZ5O.js.map} +0 -0
- /package/dist/{chunk-URSNCM57.js.map → chunk-S2BJTAAB.js.map} +0 -0
- /package/dist/{chunk-AJSRYRJS.js.map → chunk-S56PWXIX.js.map} +0 -0
- /package/dist/{chunk-FAB5SXNO.js.map → chunk-S6FFDIHD.js.map} +0 -0
- /package/dist/{chunk-56NHT2TZ.js.map → chunk-S6MAMIK2.js.map} +0 -0
- /package/dist/{chunk-OKI45WHM.js.map → chunk-SERTO6H6.js.map} +0 -0
- /package/dist/{chunk-I5DW76GB.js.map → chunk-STOOH7EI.js.map} +0 -0
- /package/dist/{chunk-I7MZOZGC.js.map → chunk-SWSTEUXX.js.map} +0 -0
- /package/dist/{chunk-JFEAJRG6.js.map → chunk-SWZN7NNZ.js.map} +0 -0
- /package/dist/{chunk-ARNQH2XE.js.map → chunk-SYDF57KS.js.map} +0 -0
- /package/dist/{chunk-YYKPRX4P.js.map → chunk-T275CUVD.js.map} +0 -0
- /package/dist/{chunk-OCS3KIYC.js.map → chunk-T4OT7QWP.js.map} +0 -0
- /package/dist/{chunk-YRCDL3GO.js.map → chunk-TCSRY2NP.js.map} +0 -0
- /package/dist/{chunk-ELC2ZPHI.js.map → chunk-TCX5OA2X.js.map} +0 -0
- /package/dist/{chunk-NJVHMK5R.js.map → chunk-TDW5CSO5.js.map} +0 -0
- /package/dist/{chunk-MCPKUVMQ.js.map → chunk-TGG3ODCS.js.map} +0 -0
- /package/dist/{chunk-Q2N5UR7Q.js.map → chunk-TILSTYUC.js.map} +0 -0
- /package/dist/{chunk-4FKE42TW.js.map → chunk-TJ5DYWXU.js.map} +0 -0
- /package/dist/{chunk-TQQALBLU.js.map → chunk-TNRI4ZE6.js.map} +0 -0
- /package/dist/{chunk-LLU7VKCZ.js.map → chunk-TPIFVUMF.js.map} +0 -0
- /package/dist/{chunk-UITWSZH3.js.map → chunk-TSW6OF22.js.map} +0 -0
- /package/dist/{chunk-UB4GKFCI.js.map → chunk-TTSTBHGR.js.map} +0 -0
- /package/dist/{chunk-HVGM5IME.js.map → chunk-U3JYAWMR.js.map} +0 -0
- /package/dist/{chunk-GGU7KV4G.js.map → chunk-U7ODSHA5.js.map} +0 -0
- /package/dist/{chunk-NW4RPGET.js.map → chunk-UEGEPRNP.js.map} +0 -0
- /package/dist/{chunk-2DA7DTHO.js.map → chunk-UGIA2YEJ.js.map} +0 -0
- /package/dist/{chunk-5AGRFQSH.js.map → chunk-UHLKKDNF.js.map} +0 -0
- /package/dist/{chunk-KJI2DVSO.js.map → chunk-ULVXKIPX.js.map} +0 -0
- /package/dist/{chunk-56KVDNOS.js.map → chunk-USUDKZ5G.js.map} +0 -0
- /package/dist/{chunk-CC4JBFWY.js.map → chunk-UVO6I2F6.js.map} +0 -0
- /package/dist/{chunk-BR62BHVY.js.map → chunk-V6NVG4K2.js.map} +0 -0
- /package/dist/{chunk-Q7QXSQ46.js.map → chunk-VCMQFD3G.js.map} +0 -0
- /package/dist/{chunk-CVDY7P3E.js.map → chunk-VKPBDNIO.js.map} +0 -0
- /package/dist/{chunk-L6WVCO6D.js.map → chunk-VLDKWGHD.js.map} +0 -0
- /package/dist/{chunk-IUPIJWFK.js.map → chunk-VM2NA2EL.js.map} +0 -0
- /package/dist/{chunk-6JGMBTXP.js.map → chunk-VMZTCVEL.js.map} +0 -0
- /package/dist/{chunk-CG2HT7TI.js.map → chunk-VQH5AXZY.js.map} +0 -0
- /package/dist/{chunk-ZFGXQ54H.js.map → chunk-VTBTW6N4.js.map} +0 -0
- /package/dist/{chunk-VJZPVP6C.js.map → chunk-VV7PLDX4.js.map} +0 -0
- /package/dist/{chunk-LWEJGMVO.js.map → chunk-VYGGLH5H.js.map} +0 -0
- /package/dist/{chunk-KFYLTQGK.js.map → chunk-VYQHHTQ4.js.map} +0 -0
- /package/dist/{chunk-IB2EX6GX.js.map → chunk-VYSGRD2W.js.map} +0 -0
- /package/dist/{chunk-5JMX5FRF.js.map → chunk-W4W63LTP.js.map} +0 -0
- /package/dist/{chunk-HRLJNDDC.js.map → chunk-WHTRR66J.js.map} +0 -0
- /package/dist/{chunk-BWBBS6HJ.js.map → chunk-WICIQFHJ.js.map} +0 -0
- /package/dist/{chunk-CDB66JAO.js.map → chunk-WJYYMCCC.js.map} +0 -0
- /package/dist/{chunk-TBUWK3RP.js.map → chunk-WSJOWQJE.js.map} +0 -0
- /package/dist/{chunk-C2EERTYX.js.map → chunk-WYDUXZ2R.js.map} +0 -0
- /package/dist/{chunk-E2SGFW2B.js.map → chunk-X62CN4YR.js.map} +0 -0
- /package/dist/{chunk-VVCKB62D.js.map → chunk-XFQHKMO6.js.map} +0 -0
- /package/dist/{chunk-IZZINUFM.js.map → chunk-XGJ7XZHS.js.map} +0 -0
- /package/dist/{chunk-P5FLGDXW.js.map → chunk-XJFJNOEV.js.map} +0 -0
- /package/dist/{chunk-UQ67SEGH.js.map → chunk-XKJLHMXZ.js.map} +0 -0
- /package/dist/{chunk-VEJG6GQQ.js.map → chunk-XLFPJVQS.js.map} +0 -0
- /package/dist/{chunk-RDHK2NYW.js.map → chunk-XM4ZLZFW.js.map} +0 -0
- /package/dist/{chunk-6TWS6AXT.js.map → chunk-Y2GAWEJD.js.map} +0 -0
- /package/dist/{chunk-MYDFABO6.js.map → chunk-Y3A74SVK.js.map} +0 -0
- /package/dist/{chunk-C625ODRG.js.map → chunk-YANEVGI3.js.map} +0 -0
- /package/dist/{chunk-OXM267RC.js.map → chunk-YHHSO5QR.js.map} +0 -0
- /package/dist/{chunk-VVXOG3ZC.js.map → chunk-YOSOCHCB.js.map} +0 -0
- /package/dist/{chunk-HHFFPE67.js.map → chunk-YP4SNX4P.js.map} +0 -0
- /package/dist/{chunk-QCB3WNCA.js.map → chunk-YQH6AMIH.js.map} +0 -0
- /package/dist/{chunk-NZBZLY7H.js.map → chunk-YRWL2IAE.js.map} +0 -0
- /package/dist/{chunk-LYEALWBN.js.map → chunk-YTWRQ3WK.js.map} +0 -0
- /package/dist/{chunk-7V2CQLTN.js.map → chunk-YV5GGSLK.js.map} +0 -0
- /package/dist/{chunk-RY7YRYVT.js.map → chunk-YXUDK37V.js.map} +0 -0
- /package/dist/{chunk-MUB44LD3.js.map → chunk-YYM5TSCR.js.map} +0 -0
- /package/dist/{chunk-JTWK3VE7.js.map → chunk-ZG2CKFQF.js.map} +0 -0
- /package/dist/{chunk-5UTHPGFF.js.map → chunk-ZGJXO2HH.js.map} +0 -0
- /package/dist/{chunk-WTZ6OJUY.js.map → chunk-ZGV76PZ4.js.map} +0 -0
- /package/dist/{chunk-A3QEJ2IZ.js.map → chunk-ZOBUR2VC.js.map} +0 -0
- /package/dist/{computer-viewer-AVH5J4TC.js.map → computer-viewer-S6AL3XDT.js.map} +0 -0
- /package/dist/{embedded-new-voice-M6PBWMQZ.js.map → embedded-new-voice-T3BXRYJX.js.map} +0 -0
- /package/dist/{embedded-voice-7USALJKI.js.map → embedded-voice-ZJXMF3RP.js.map} +0 -0
- /package/dist/{fleet-decision-row-XY6OZPHA.js.map → fleet-decision-row-AUCMLBCV.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-S5RTVLMQ.js.map → model-policy-picker-menu-TO57YUQ6.js.map} +0 -0
- /package/dist/{payment-page-card-XSY5NO7D.js.map → payment-page-card-DFGDAMTG.js.map} +0 -0
- /package/dist/{platform-activity-row-77WER5O3.js.map → platform-activity-row-ZMBEJGXN.js.map} +0 -0
- /package/dist/{queue-surface-implementation-SDV7I32L.js.map → queue-surface-implementation-KDK5CYH6.js.map} +0 -0
- /package/dist/{recorder-host-7GNQG6BB.js.map → recorder-host-3HLYRL4H.js.map} +0 -0
- /package/dist/{sandbox-files-JOH2Q57T.js.map → sandbox-files-UOZ4OJZU.js.map} +0 -0
- /package/dist/{session-connect-cards-HZIR4ZWT.js.map → session-connect-cards-VZIYLH45.js.map} +0 -0
- /package/dist/{session-realtime-OPCPTIAP.js.map → session-realtime-2ZGJWVZP.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-WXCRA4BY.js.map → timeline-annotation-markers-KBTFWLME.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-YBZQNCNX.js.map → timeline-annotation-selection-VI4YSDR5.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-4WVXTKFW.js.map → timeline-annotations-dialog-4PLWNLRB.js.map} +0 -0
|
@@ -0,0 +1,1628 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useOpenGeniText
|
|
4
|
+
} from "./chunk-LVUSG56I.js";
|
|
5
|
+
|
|
6
|
+
// src/hooks/use-transcription.ts
|
|
7
|
+
import {
|
|
8
|
+
authorizeTranscriptionAdapter,
|
|
9
|
+
createTranscriptionSessionRequest
|
|
10
|
+
} from "@opengeni/sdk";
|
|
11
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
+
var INITIAL_TRANSCRIPTION_CONTROL_STATE = {
|
|
13
|
+
status: "idle",
|
|
14
|
+
generation: 0,
|
|
15
|
+
localSessionId: null,
|
|
16
|
+
providerSessionId: null,
|
|
17
|
+
lastSequence: 0,
|
|
18
|
+
partial: "",
|
|
19
|
+
error: null,
|
|
20
|
+
acceptedFinalIds: [],
|
|
21
|
+
audioMilliseconds: 0,
|
|
22
|
+
costUsd: null
|
|
23
|
+
};
|
|
24
|
+
function transitionTranscriptionControl(state, action) {
|
|
25
|
+
if (action.type === "reset") {
|
|
26
|
+
return {
|
|
27
|
+
state: { ...INITIAL_TRANSCRIPTION_CONTROL_STATE, generation: state.generation },
|
|
28
|
+
commit: null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (action.type === "start") {
|
|
32
|
+
if (action.generation <= state.generation) return { state, commit: null };
|
|
33
|
+
return {
|
|
34
|
+
state: {
|
|
35
|
+
...INITIAL_TRANSCRIPTION_CONTROL_STATE,
|
|
36
|
+
status: "requesting-permission",
|
|
37
|
+
generation: action.generation,
|
|
38
|
+
localSessionId: action.localSessionId
|
|
39
|
+
},
|
|
40
|
+
commit: null
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (action.generation !== state.generation) return { state, commit: null };
|
|
44
|
+
if (action.type === "start.failed") {
|
|
45
|
+
if (state.status === "closed" || state.status === "error") return { state, commit: null };
|
|
46
|
+
return {
|
|
47
|
+
state: {
|
|
48
|
+
...state,
|
|
49
|
+
status: "error",
|
|
50
|
+
partial: "",
|
|
51
|
+
error: { code: normalizeTranscriptionErrorCode(action.code), recoverable: false }
|
|
52
|
+
},
|
|
53
|
+
commit: null
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (action.type === "cancel") {
|
|
57
|
+
if (!isActiveTranscriptionStatus(state.status)) return { state, commit: null };
|
|
58
|
+
return {
|
|
59
|
+
state: { ...state, status: "cancelling", partial: "", error: null },
|
|
60
|
+
commit: null
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (action.type === "cancel.settled") {
|
|
64
|
+
if (state.status !== "cancelling") return { state, commit: null };
|
|
65
|
+
return { state: { ...state, status: "closed", partial: "" }, commit: null };
|
|
66
|
+
}
|
|
67
|
+
const event = action.event;
|
|
68
|
+
if (event.localSessionId !== state.localSessionId) return { state, commit: null };
|
|
69
|
+
if (!Number.isSafeInteger(event.sequence) || event.sequence <= state.lastSequence) {
|
|
70
|
+
return { state, commit: null };
|
|
71
|
+
}
|
|
72
|
+
if (state.status === "closed" || state.status === "error") return { state, commit: null };
|
|
73
|
+
if (state.status === "cancelling" && event.type !== "session.closed") {
|
|
74
|
+
return { state: { ...state, lastSequence: event.sequence }, commit: null };
|
|
75
|
+
}
|
|
76
|
+
const sequenced = { ...state, lastSequence: event.sequence };
|
|
77
|
+
switch (event.type) {
|
|
78
|
+
case "permission.requested":
|
|
79
|
+
return {
|
|
80
|
+
state: { ...sequenced, status: "requesting-permission", partial: "", error: null },
|
|
81
|
+
commit: null
|
|
82
|
+
};
|
|
83
|
+
case "session.opened":
|
|
84
|
+
return {
|
|
85
|
+
state: {
|
|
86
|
+
...sequenced,
|
|
87
|
+
status: "listening",
|
|
88
|
+
providerSessionId: event.providerSessionId,
|
|
89
|
+
error: null
|
|
90
|
+
},
|
|
91
|
+
commit: null
|
|
92
|
+
};
|
|
93
|
+
case "transcript.partial":
|
|
94
|
+
return {
|
|
95
|
+
state: { ...sequenced, status: "listening", partial: event.text, error: null },
|
|
96
|
+
commit: null
|
|
97
|
+
};
|
|
98
|
+
case "transcript.final": {
|
|
99
|
+
const text = event.text.trim();
|
|
100
|
+
const duplicate = state.acceptedFinalIds.includes(event.providerAcceptanceId);
|
|
101
|
+
const acceptedFinalIds = duplicate || text.length === 0 ? state.acceptedFinalIds : [...state.acceptedFinalIds, event.providerAcceptanceId];
|
|
102
|
+
return {
|
|
103
|
+
state: {
|
|
104
|
+
...sequenced,
|
|
105
|
+
status: "listening",
|
|
106
|
+
partial: "",
|
|
107
|
+
error: null,
|
|
108
|
+
acceptedFinalIds
|
|
109
|
+
},
|
|
110
|
+
commit: duplicate || text.length === 0 ? null : text
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
case "usage":
|
|
114
|
+
return {
|
|
115
|
+
state: {
|
|
116
|
+
...sequenced,
|
|
117
|
+
audioMilliseconds: Math.max(state.audioMilliseconds, event.audioMilliseconds),
|
|
118
|
+
costUsd: event.costUsd
|
|
119
|
+
},
|
|
120
|
+
commit: null
|
|
121
|
+
};
|
|
122
|
+
case "session.reconnecting":
|
|
123
|
+
return {
|
|
124
|
+
state: { ...sequenced, status: "reconnecting", partial: "", error: null },
|
|
125
|
+
commit: null
|
|
126
|
+
};
|
|
127
|
+
case "session.error":
|
|
128
|
+
return {
|
|
129
|
+
state: {
|
|
130
|
+
...sequenced,
|
|
131
|
+
status: event.recoverable ? "reconnecting" : "error",
|
|
132
|
+
partial: "",
|
|
133
|
+
error: {
|
|
134
|
+
code: normalizeTranscriptionErrorCode(event.code),
|
|
135
|
+
recoverable: event.recoverable
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
commit: null
|
|
139
|
+
};
|
|
140
|
+
case "session.closed":
|
|
141
|
+
return {
|
|
142
|
+
state: {
|
|
143
|
+
...sequenced,
|
|
144
|
+
status: event.reason === "error" ? "error" : "closed",
|
|
145
|
+
partial: ""
|
|
146
|
+
},
|
|
147
|
+
commit: null
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function appendFinalTranscript(draft, transcript) {
|
|
152
|
+
const final = transcript.trim();
|
|
153
|
+
if (!final) return draft;
|
|
154
|
+
if (!draft) return final;
|
|
155
|
+
return /\s$/u.test(draft) ? `${draft}${final}` : `${draft} ${final}`;
|
|
156
|
+
}
|
|
157
|
+
var DEFAULT_TRANSCRIPTION_LIFECYCLE_TIMEOUTS = {
|
|
158
|
+
startMs: 15e3,
|
|
159
|
+
cleanupMs: 2e3
|
|
160
|
+
};
|
|
161
|
+
function useTranscription({
|
|
162
|
+
adapter,
|
|
163
|
+
policy,
|
|
164
|
+
selection = { kind: "primary" },
|
|
165
|
+
value,
|
|
166
|
+
setValue,
|
|
167
|
+
focusInput,
|
|
168
|
+
disabled = false,
|
|
169
|
+
createLocalSessionId = defaultLocalSessionId,
|
|
170
|
+
lifecycleTimeouts,
|
|
171
|
+
onDiagnostic
|
|
172
|
+
}) {
|
|
173
|
+
const t = useOpenGeniText();
|
|
174
|
+
const [state, setState] = useState(INITIAL_TRANSCRIPTION_CONTROL_STATE);
|
|
175
|
+
const stateRef = useRef(state);
|
|
176
|
+
const valueRef = useRef(value);
|
|
177
|
+
const sessionRef = useRef(null);
|
|
178
|
+
const pendingStartRef = useRef(null);
|
|
179
|
+
const activePolicyRef = useRef(null);
|
|
180
|
+
valueRef.current = value;
|
|
181
|
+
const startTimeoutMs = normalizeTimeout(
|
|
182
|
+
lifecycleTimeouts?.startMs,
|
|
183
|
+
DEFAULT_TRANSCRIPTION_LIFECYCLE_TIMEOUTS.startMs
|
|
184
|
+
);
|
|
185
|
+
const cleanupTimeoutMs = normalizeTimeout(
|
|
186
|
+
lifecycleTimeouts?.cleanupMs,
|
|
187
|
+
DEFAULT_TRANSCRIPTION_LIFECYCLE_TIMEOUTS.cleanupMs
|
|
188
|
+
);
|
|
189
|
+
const reportDiagnostic = useCallback(
|
|
190
|
+
(diagnostic) => {
|
|
191
|
+
if (!onDiagnostic) return;
|
|
192
|
+
try {
|
|
193
|
+
onDiagnostic(normalizeTranscriptionDiagnostic(t, diagnostic));
|
|
194
|
+
} catch {
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
[onDiagnostic, t]
|
|
198
|
+
);
|
|
199
|
+
const cleanupRuntimeRef = useRef({ cleanupTimeoutMs, reportDiagnostic });
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
cleanupRuntimeRef.current = { cleanupTimeoutMs, reportDiagnostic };
|
|
202
|
+
}, [cleanupTimeoutMs, reportDiagnostic]);
|
|
203
|
+
const policyRevision = useMemo(
|
|
204
|
+
() => transcriptionPolicyRevision(policy, selection),
|
|
205
|
+
[policy, selection]
|
|
206
|
+
);
|
|
207
|
+
const authorization = useMemo(
|
|
208
|
+
() => adapter ? authorizeTranscriptionAdapter(policy, adapter.descriptor, selection) : null,
|
|
209
|
+
[adapter, policy, selection]
|
|
210
|
+
);
|
|
211
|
+
const unavailableReason = disabled ? "composer_disabled" : !policy.enabled ? "disabled" : !policy.acceptanceId ? "unaccepted" : !policy.primary ? "target_missing" : !adapter ? "adapter_missing" : authorization?.authorized ? null : authorization?.reason ?? "unaccepted";
|
|
212
|
+
const apply = useCallback(
|
|
213
|
+
(action) => {
|
|
214
|
+
const transition = transitionTranscriptionControl(stateRef.current, action);
|
|
215
|
+
if (transition.state !== stateRef.current) {
|
|
216
|
+
stateRef.current = transition.state;
|
|
217
|
+
setState(transition.state);
|
|
218
|
+
}
|
|
219
|
+
if (transition.commit !== null) {
|
|
220
|
+
const next = appendFinalTranscript(valueRef.current, transition.commit);
|
|
221
|
+
valueRef.current = next;
|
|
222
|
+
setValue(next);
|
|
223
|
+
focusInput();
|
|
224
|
+
}
|
|
225
|
+
return transition.state;
|
|
226
|
+
},
|
|
227
|
+
[focusInput, setValue]
|
|
228
|
+
);
|
|
229
|
+
const releaseTerminalSession = useCallback(
|
|
230
|
+
(generation) => {
|
|
231
|
+
const active = sessionRef.current;
|
|
232
|
+
if (!active || active.generation !== generation) return;
|
|
233
|
+
sessionRef.current = null;
|
|
234
|
+
if (activePolicyRef.current?.generation === generation) activePolicyRef.current = null;
|
|
235
|
+
detachSessionCleanup(t, active.session, {
|
|
236
|
+
cleanupTimeoutMs,
|
|
237
|
+
reportDiagnostic
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
[cleanupTimeoutMs, reportDiagnostic, t]
|
|
241
|
+
);
|
|
242
|
+
const start = useCallback(async () => {
|
|
243
|
+
if (!adapter || unavailableReason !== null || isActiveTranscriptionStatus(stateRef.current.status)) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
const generation = stateRef.current.generation + 1;
|
|
247
|
+
const localSessionId = createLocalSessionId();
|
|
248
|
+
apply({ type: "start", generation, localSessionId });
|
|
249
|
+
const request = createTranscriptionSessionRequest({
|
|
250
|
+
policy,
|
|
251
|
+
adapter,
|
|
252
|
+
localSessionId,
|
|
253
|
+
selection,
|
|
254
|
+
sequenceFloor: 0
|
|
255
|
+
});
|
|
256
|
+
if (!request) {
|
|
257
|
+
apply({
|
|
258
|
+
type: "start.failed",
|
|
259
|
+
generation,
|
|
260
|
+
code: "policy_blocked"
|
|
261
|
+
});
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
activePolicyRef.current = { generation, revision: policyRevision };
|
|
265
|
+
const controller = new AbortController();
|
|
266
|
+
pendingStartRef.current = { generation, controller };
|
|
267
|
+
let boundarySettled = false;
|
|
268
|
+
let accepted = false;
|
|
269
|
+
const observedStart = Promise.resolve().then(
|
|
270
|
+
() => adapter.start(
|
|
271
|
+
request,
|
|
272
|
+
(event) => {
|
|
273
|
+
apply({ type: "event", generation, event });
|
|
274
|
+
if (event.type === "session.error" && !event.recoverable) {
|
|
275
|
+
releaseTerminalSession(generation);
|
|
276
|
+
} else if (event.type === "session.closed") {
|
|
277
|
+
releaseTerminalSession(generation);
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
signal: controller.signal,
|
|
282
|
+
reportDiagnostic
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
).then(
|
|
286
|
+
(session) => {
|
|
287
|
+
if (boundarySettled && !accepted) {
|
|
288
|
+
detachSessionCleanup(t, session, {
|
|
289
|
+
cancelReason: "stale-generation",
|
|
290
|
+
cleanupTimeoutMs,
|
|
291
|
+
reportDiagnostic
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return { kind: "session", session };
|
|
295
|
+
},
|
|
296
|
+
(error) => {
|
|
297
|
+
if (boundarySettled) {
|
|
298
|
+
reportDiagnostic({
|
|
299
|
+
operation: "start",
|
|
300
|
+
code: classifyStartError(error),
|
|
301
|
+
detail: diagnosticDetail(t, error)
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
return { kind: "error", error };
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
let abortListener = null;
|
|
308
|
+
const aborted = new Promise((resolve) => {
|
|
309
|
+
if (controller.signal.aborted) {
|
|
310
|
+
resolve({ kind: "aborted" });
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
abortListener = () => resolve({ kind: "aborted" });
|
|
314
|
+
controller.signal.addEventListener("abort", abortListener, { once: true });
|
|
315
|
+
});
|
|
316
|
+
let timeoutId = null;
|
|
317
|
+
const timedOut = new Promise((resolve) => {
|
|
318
|
+
timeoutId = setTimeout(() => resolve({ kind: "timeout" }), startTimeoutMs);
|
|
319
|
+
});
|
|
320
|
+
const outcome = await Promise.race([observedStart, aborted, timedOut]);
|
|
321
|
+
boundarySettled = true;
|
|
322
|
+
if (timeoutId !== null) clearTimeout(timeoutId);
|
|
323
|
+
if (abortListener) controller.signal.removeEventListener("abort", abortListener);
|
|
324
|
+
if (pendingStartRef.current?.generation === generation) pendingStartRef.current = null;
|
|
325
|
+
if (outcome.kind === "aborted") return false;
|
|
326
|
+
if (outcome.kind === "timeout") {
|
|
327
|
+
controller.abort("transcription-start-timeout");
|
|
328
|
+
if (activePolicyRef.current?.generation === generation) activePolicyRef.current = null;
|
|
329
|
+
reportDiagnostic({
|
|
330
|
+
operation: "start",
|
|
331
|
+
code: "timeout",
|
|
332
|
+
detail: t("hooks.useTranscription.transcriptionAdapterStartExceededStarttimeoutms", {
|
|
333
|
+
startTimeoutMs
|
|
334
|
+
})
|
|
335
|
+
});
|
|
336
|
+
apply({ type: "start.failed", generation, code: "timeout" });
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
if (outcome.kind === "error") {
|
|
340
|
+
if (activePolicyRef.current?.generation === generation) activePolicyRef.current = null;
|
|
341
|
+
const code = classifyStartError(outcome.error);
|
|
342
|
+
reportDiagnostic({
|
|
343
|
+
operation: "start",
|
|
344
|
+
code,
|
|
345
|
+
detail: diagnosticDetail(t, outcome.error)
|
|
346
|
+
});
|
|
347
|
+
if (!controller.signal.aborted) {
|
|
348
|
+
apply({ type: "start.failed", generation, code });
|
|
349
|
+
}
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
const current = stateRef.current;
|
|
353
|
+
if (current.generation !== generation || current.localSessionId !== localSessionId || current.status === "cancelling" || !isActiveTranscriptionStatus(current.status)) {
|
|
354
|
+
if (activePolicyRef.current?.generation === generation) activePolicyRef.current = null;
|
|
355
|
+
detachSessionCleanup(t, outcome.session, {
|
|
356
|
+
...current.status === "error" ? {} : { cancelReason: "stale-generation" },
|
|
357
|
+
cleanupTimeoutMs,
|
|
358
|
+
reportDiagnostic
|
|
359
|
+
});
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
accepted = true;
|
|
363
|
+
sessionRef.current = { generation, session: outcome.session };
|
|
364
|
+
return true;
|
|
365
|
+
}, [
|
|
366
|
+
adapter,
|
|
367
|
+
apply,
|
|
368
|
+
createLocalSessionId,
|
|
369
|
+
cleanupTimeoutMs,
|
|
370
|
+
policy,
|
|
371
|
+
policyRevision,
|
|
372
|
+
releaseTerminalSession,
|
|
373
|
+
reportDiagnostic,
|
|
374
|
+
selection,
|
|
375
|
+
startTimeoutMs,
|
|
376
|
+
unavailableReason,
|
|
377
|
+
t
|
|
378
|
+
]);
|
|
379
|
+
const cancel = useCallback(async () => {
|
|
380
|
+
const current = stateRef.current;
|
|
381
|
+
if (!isActiveTranscriptionStatus(current.status)) return false;
|
|
382
|
+
const generation = current.generation;
|
|
383
|
+
apply({ type: "cancel", generation });
|
|
384
|
+
const pending = pendingStartRef.current;
|
|
385
|
+
if (pending?.generation === generation) {
|
|
386
|
+
pendingStartRef.current = null;
|
|
387
|
+
pending.controller.abort("transcription-locally-cancelled");
|
|
388
|
+
}
|
|
389
|
+
const active = sessionRef.current;
|
|
390
|
+
sessionRef.current = null;
|
|
391
|
+
if (activePolicyRef.current?.generation === generation) activePolicyRef.current = null;
|
|
392
|
+
apply({ type: "cancel.settled", generation });
|
|
393
|
+
focusInput();
|
|
394
|
+
if (active?.generation === generation) {
|
|
395
|
+
detachSessionCleanup(t, active.session, {
|
|
396
|
+
cancelReason: "user-cancelled",
|
|
397
|
+
cleanupTimeoutMs,
|
|
398
|
+
reportDiagnostic
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
return true;
|
|
402
|
+
}, [apply, cleanupTimeoutMs, focusInput, reportDiagnostic, t]);
|
|
403
|
+
const reset = useCallback(() => apply({ type: "reset" }), [apply]);
|
|
404
|
+
useEffect(() => {
|
|
405
|
+
if (!isActiveTranscriptionStatus(state.status)) return;
|
|
406
|
+
const onKeyDown = (event) => {
|
|
407
|
+
if (event.key !== "Escape") return;
|
|
408
|
+
event.preventDefault();
|
|
409
|
+
void cancel();
|
|
410
|
+
};
|
|
411
|
+
document.addEventListener("keydown", onKeyDown);
|
|
412
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
413
|
+
}, [cancel, state.status]);
|
|
414
|
+
useEffect(() => {
|
|
415
|
+
if (!isActiveTranscriptionStatus(state.status)) return;
|
|
416
|
+
const activePolicy = activePolicyRef.current;
|
|
417
|
+
if (unavailableReason === null && activePolicy?.generation === state.generation && activePolicy.revision === policyRevision) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
void cancel();
|
|
421
|
+
}, [cancel, policyRevision, state.generation, state.status, unavailableReason]);
|
|
422
|
+
useEffect(
|
|
423
|
+
() => () => {
|
|
424
|
+
const pending = pendingStartRef.current;
|
|
425
|
+
pendingStartRef.current = null;
|
|
426
|
+
pending?.controller.abort("transcription-component-unmounted");
|
|
427
|
+
const active = sessionRef.current;
|
|
428
|
+
sessionRef.current = null;
|
|
429
|
+
activePolicyRef.current = null;
|
|
430
|
+
stateRef.current = {
|
|
431
|
+
...stateRef.current,
|
|
432
|
+
generation: stateRef.current.generation + 1,
|
|
433
|
+
status: "closed",
|
|
434
|
+
partial: ""
|
|
435
|
+
};
|
|
436
|
+
if (active) {
|
|
437
|
+
const runtime = cleanupRuntimeRef.current;
|
|
438
|
+
detachSessionCleanup(t, active.session, {
|
|
439
|
+
cancelReason: "component-unmounted",
|
|
440
|
+
cleanupTimeoutMs: runtime.cleanupTimeoutMs,
|
|
441
|
+
reportDiagnostic: runtime.reportDiagnostic
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
[t]
|
|
446
|
+
);
|
|
447
|
+
return {
|
|
448
|
+
state,
|
|
449
|
+
available: unavailableReason === null,
|
|
450
|
+
unavailableReason,
|
|
451
|
+
start,
|
|
452
|
+
cancel,
|
|
453
|
+
reset
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function isActiveTranscriptionStatus(status) {
|
|
457
|
+
return status === "requesting-permission" || status === "listening" || status === "reconnecting" || status === "cancelling";
|
|
458
|
+
}
|
|
459
|
+
function defaultLocalSessionId() {
|
|
460
|
+
return globalThis.crypto.randomUUID();
|
|
461
|
+
}
|
|
462
|
+
function classifyStartError(error) {
|
|
463
|
+
if (isRecord(error)) {
|
|
464
|
+
const normalized = normalizeTranscriptionErrorCode(error.code);
|
|
465
|
+
if (normalized !== "unknown") return normalized;
|
|
466
|
+
}
|
|
467
|
+
if (typeof DOMException !== "undefined" && error instanceof DOMException) {
|
|
468
|
+
if (error.name === "NotAllowedError") return "permission_denied";
|
|
469
|
+
if (error.name === "NotSupportedError") return "not_supported";
|
|
470
|
+
if (error.name === "TimeoutError") return "timeout";
|
|
471
|
+
if (error.name === "AbortError") return "cancelled";
|
|
472
|
+
}
|
|
473
|
+
return "unknown";
|
|
474
|
+
}
|
|
475
|
+
function normalizeTranscriptionErrorCode(code) {
|
|
476
|
+
switch (code) {
|
|
477
|
+
case "insufficient_credits":
|
|
478
|
+
case "allowance_exhausted":
|
|
479
|
+
case "monthly_model_cost_limit":
|
|
480
|
+
case "unavailable":
|
|
481
|
+
case "too_large":
|
|
482
|
+
case "invalid_audio":
|
|
483
|
+
case "permission_denied":
|
|
484
|
+
case "not_supported":
|
|
485
|
+
case "network":
|
|
486
|
+
case "provider":
|
|
487
|
+
case "policy_blocked":
|
|
488
|
+
case "timeout":
|
|
489
|
+
case "cancelled":
|
|
490
|
+
case "unknown":
|
|
491
|
+
return code;
|
|
492
|
+
default:
|
|
493
|
+
return "unknown";
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function normalizeTranscriptionDiagnostic(t, diagnostic) {
|
|
497
|
+
const source = isRecord(diagnostic) ? diagnostic : {};
|
|
498
|
+
const operation = source.operation === "start" || source.operation === "session" || source.operation === "cancel" || source.operation === "close" ? source.operation : "session";
|
|
499
|
+
const rawDetail = typeof source.detail === "string" ? source.detail : t("hooks.useTranscription.noDiagnosticDetail");
|
|
500
|
+
return {
|
|
501
|
+
operation,
|
|
502
|
+
code: normalizeTranscriptionErrorCode(source.code),
|
|
503
|
+
detail: rawDetail
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
function detachSessionCleanup(t, session, options) {
|
|
507
|
+
if (options.cancelReason) {
|
|
508
|
+
void runBoundedCleanup(
|
|
509
|
+
t,
|
|
510
|
+
"cancel",
|
|
511
|
+
() => session.cancel(options.cancelReason),
|
|
512
|
+
options.cleanupTimeoutMs,
|
|
513
|
+
options.reportDiagnostic
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
void runBoundedCleanup(
|
|
517
|
+
t,
|
|
518
|
+
"close",
|
|
519
|
+
() => session.close(),
|
|
520
|
+
options.cleanupTimeoutMs,
|
|
521
|
+
options.reportDiagnostic
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
async function runBoundedCleanup(t, operation, invoke, timeoutMs, reportDiagnostic) {
|
|
525
|
+
let timeoutId = null;
|
|
526
|
+
const result = Promise.resolve().then(invoke).then(
|
|
527
|
+
() => ({ kind: "settled" }),
|
|
528
|
+
(error) => ({ kind: "rejected", error })
|
|
529
|
+
);
|
|
530
|
+
const timeout = new Promise((resolve) => {
|
|
531
|
+
timeoutId = setTimeout(() => resolve({ kind: "timeout" }), timeoutMs);
|
|
532
|
+
});
|
|
533
|
+
const outcome = await Promise.race([result, timeout]);
|
|
534
|
+
if (timeoutId !== null) clearTimeout(timeoutId);
|
|
535
|
+
if (outcome.kind === "settled") return;
|
|
536
|
+
reportDiagnostic({
|
|
537
|
+
operation,
|
|
538
|
+
code: outcome.kind === "timeout" ? "timeout" : "provider",
|
|
539
|
+
detail: outcome.kind === "timeout" ? t("hooks.useTranscription.transcriptionOperationExceededTimeoutmsMs", {
|
|
540
|
+
operation,
|
|
541
|
+
timeoutMs
|
|
542
|
+
}) : diagnosticDetail(t, outcome.error)
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
function diagnosticDetail(t, error) {
|
|
546
|
+
if (error instanceof Error) return error.message;
|
|
547
|
+
return typeof error === "string" ? error : t("hooks.useTranscription.unknownTranscriptionAdapterFailure");
|
|
548
|
+
}
|
|
549
|
+
function normalizeTimeout(value, fallback) {
|
|
550
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 1 ? Math.min(Math.floor(value), 6e4) : fallback;
|
|
551
|
+
}
|
|
552
|
+
function isRecord(value) {
|
|
553
|
+
return typeof value === "object" && value !== null;
|
|
554
|
+
}
|
|
555
|
+
function transcriptionPolicyRevision(policy, selection) {
|
|
556
|
+
const targetKey = (target) => target ? [
|
|
557
|
+
target.provider,
|
|
558
|
+
target.model ?? "",
|
|
559
|
+
target.credentialMode,
|
|
560
|
+
target.credentialConnectionId ?? "",
|
|
561
|
+
target.region ?? ""
|
|
562
|
+
].join("\0") : "";
|
|
563
|
+
return [
|
|
564
|
+
policy.enabled ? "1" : "0",
|
|
565
|
+
policy.acceptanceId ?? "",
|
|
566
|
+
targetKey(policy.primary),
|
|
567
|
+
policy.language ?? "",
|
|
568
|
+
policy.autoDetectLanguage ? "1" : "0",
|
|
569
|
+
policy.diarization.enabled ? "1" : "0",
|
|
570
|
+
policy.diarization.maxSpeakers?.toString() ?? "",
|
|
571
|
+
policy.retention.mode,
|
|
572
|
+
policy.retention.maxDays?.toString() ?? "",
|
|
573
|
+
policy.privacy.allowProviderLogging ? "1" : "0",
|
|
574
|
+
policy.privacy.allowProviderTraining ? "1" : "0",
|
|
575
|
+
policy.fallback.mode,
|
|
576
|
+
policy.fallback.targets.map(targetKey).join(""),
|
|
577
|
+
policy.cost.currency,
|
|
578
|
+
policy.cost.maxPerHour?.toString() ?? "",
|
|
579
|
+
policy.cost.maxPerMonth?.toString() ?? "",
|
|
580
|
+
selection.kind,
|
|
581
|
+
selection.kind === "fallback" ? selection.index.toString() : ""
|
|
582
|
+
].join("");
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// src/hooks/use-voice-input.ts
|
|
586
|
+
import {
|
|
587
|
+
OpenGeniRecordingsClient,
|
|
588
|
+
RecordingUploader,
|
|
589
|
+
browserRecorderPlatform,
|
|
590
|
+
uploadRecordingAudio
|
|
591
|
+
} from "@opengeni/sdk/recordings";
|
|
592
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
593
|
+
var VOICE_RECORDING_TIMESLICE_MILLISECONDS = 5e3;
|
|
594
|
+
var VOICE_RECORDING_OWNER_HEARTBEAT_MILLISECONDS = 5e3;
|
|
595
|
+
var VOICE_RECORDING_OWNER_STALE_MILLISECONDS = 3e4;
|
|
596
|
+
var VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS = 600;
|
|
597
|
+
var VOICE_RECORDING_RESUMABLE_CLIENT_MAX_DURATION_SECONDS = 8 * 60 * 60;
|
|
598
|
+
var ACCIDENTAL_START_MAX_MILLISECONDS = 3e3;
|
|
599
|
+
var DEFAULT_POLL_MILLISECONDS = 1e3;
|
|
600
|
+
var MAX_POLL_MILLISECONDS = 15e3;
|
|
601
|
+
var TRANSCRIPT_WAIT_SECONDS = 20;
|
|
602
|
+
var TAKEN_STORAGE_KEY = "opengeni.voice-input.taken.v1";
|
|
603
|
+
var MIME_PREFERENCES = ["audio/webm;codecs=opus", "audio/mp4", "audio/ogg;codecs=opus"];
|
|
604
|
+
var currentDate = () => /* @__PURE__ */ new Date();
|
|
605
|
+
var recordingClients = /* @__PURE__ */ new WeakMap();
|
|
606
|
+
function dictationClient(explicit, client) {
|
|
607
|
+
let candidate = explicit;
|
|
608
|
+
if (!candidate && client && typeof client.requestJson === "function") {
|
|
609
|
+
candidate = recordingClients.get(client);
|
|
610
|
+
if (!candidate) {
|
|
611
|
+
const created = new OpenGeniRecordingsClient(client);
|
|
612
|
+
recordingClients.set(client, created);
|
|
613
|
+
candidate = created;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (!candidate) return null;
|
|
617
|
+
const methods = candidate;
|
|
618
|
+
const required = [
|
|
619
|
+
"createRecording",
|
|
620
|
+
"createRecordingUploads",
|
|
621
|
+
"completeRecordingChunks",
|
|
622
|
+
"finalizeRecording",
|
|
623
|
+
"deleteRecording",
|
|
624
|
+
"listRecordings",
|
|
625
|
+
"listRecordingTranscriptVersions",
|
|
626
|
+
"getRecordingTranscript",
|
|
627
|
+
"createRecordingTranscript"
|
|
628
|
+
];
|
|
629
|
+
return required.every((method) => typeof methods[method] === "function") ? candidate : null;
|
|
630
|
+
}
|
|
631
|
+
async function reportDictationTimings(client, workspaceId, recordingId, timings) {
|
|
632
|
+
try {
|
|
633
|
+
await client?.reportRecordingTimings?.(workspaceId, recordingId, {
|
|
634
|
+
purpose: "dictation",
|
|
635
|
+
...timings
|
|
636
|
+
});
|
|
637
|
+
} catch {
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function useVoiceInput(options) {
|
|
641
|
+
const { workspaceId, capability, enabled, value, focusInput, disabled = false } = options;
|
|
642
|
+
const sdkClient = options.client;
|
|
643
|
+
const recordings = useMemo2(
|
|
644
|
+
() => dictationClient(options.recordings, sdkClient),
|
|
645
|
+
[options.recordings, sdkClient]
|
|
646
|
+
);
|
|
647
|
+
const defaultPlatform = useMemo2(() => browserRecorderPlatform(), []);
|
|
648
|
+
const platform = options.platform ?? defaultPlatform;
|
|
649
|
+
const durable = Boolean(recordings && capability?.resumable && platform.supported);
|
|
650
|
+
const [status, setStatus] = useState2("idle");
|
|
651
|
+
const [error, setError] = useState2(null);
|
|
652
|
+
const [stream, setStream] = useState2(null);
|
|
653
|
+
const [recordingId, setRecordingId] = useState2(null);
|
|
654
|
+
const [durationSeconds, setDurationSeconds] = useState2(0);
|
|
655
|
+
const [recordingStartedAt, setRecordingStartedAt] = useState2(null);
|
|
656
|
+
const [savedTranscript, setSavedTranscript] = useState2(null);
|
|
657
|
+
const [held, setHeld] = useState2(false);
|
|
658
|
+
const errorRef = useRef2(null);
|
|
659
|
+
errorRef.current = error;
|
|
660
|
+
const latest = useRef2({
|
|
661
|
+
...options,
|
|
662
|
+
recordings,
|
|
663
|
+
platform,
|
|
664
|
+
durable,
|
|
665
|
+
disabled,
|
|
666
|
+
value
|
|
667
|
+
});
|
|
668
|
+
latest.current = { ...options, recordings, platform, durable, disabled, value };
|
|
669
|
+
const statusRef = useRef2(status);
|
|
670
|
+
statusRef.current = status;
|
|
671
|
+
const generationRef = useRef2(0);
|
|
672
|
+
const dictationRef = useRef2(null);
|
|
673
|
+
const recorderRef = useRef2(null);
|
|
674
|
+
const oneShotRef = useRef2(null);
|
|
675
|
+
const oneShotLanguage = useRef2(null);
|
|
676
|
+
const gatingRef = useRef2(false);
|
|
677
|
+
const stopTimerRef = useRef2(null);
|
|
678
|
+
const uploaderRef = useRef2(null);
|
|
679
|
+
const audioCopies = useRef2(/* @__PURE__ */ new Map());
|
|
680
|
+
const handed = useRef2(null);
|
|
681
|
+
const startedAtRef = useRef2(0);
|
|
682
|
+
const oneShotText = useRef2(null);
|
|
683
|
+
const watchRef = useRef2(async () => void 0);
|
|
684
|
+
const loadSavedRef = useRef2(async () => void 0);
|
|
685
|
+
const now = useCallback2(() => (latest.current.now ?? currentDate)(), []);
|
|
686
|
+
const maxRecordingSeconds = capability ? durable && capability.resumable ? Math.min(
|
|
687
|
+
capability.resumable.maxDurationSeconds,
|
|
688
|
+
VOICE_RECORDING_RESUMABLE_CLIENT_MAX_DURATION_SECONDS
|
|
689
|
+
) : Math.min(capability.maxDurationSeconds, VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS) : null;
|
|
690
|
+
const maxRecordingSecondsRef = useRef2(maxRecordingSeconds);
|
|
691
|
+
maxRecordingSecondsRef.current = maxRecordingSeconds;
|
|
692
|
+
const transport = useMemo2(() => {
|
|
693
|
+
const current = () => {
|
|
694
|
+
const found = latest.current.recordings;
|
|
695
|
+
if (!found) throw new Error("Dictation needs a recordings client.");
|
|
696
|
+
return found;
|
|
697
|
+
};
|
|
698
|
+
return {
|
|
699
|
+
createRecording: (...args) => current().createRecording(...args),
|
|
700
|
+
createRecordingUploads: (...args) => current().createRecordingUploads(...args),
|
|
701
|
+
completeRecordingChunks: (...args) => current().completeRecordingChunks(...args),
|
|
702
|
+
finalizeRecording: (...args) => current().finalizeRecording(...args),
|
|
703
|
+
reportRecordingTimings: async (...args) => current().reportRecordingTimings?.(...args),
|
|
704
|
+
deleteRecording: (...args) => current().deleteRecording(...args)
|
|
705
|
+
};
|
|
706
|
+
}, []);
|
|
707
|
+
const uploader = useCallback2(() => {
|
|
708
|
+
if (!uploaderRef.current) {
|
|
709
|
+
const current = latest.current.platform;
|
|
710
|
+
const isCaptureActive = current.isCaptureActive;
|
|
711
|
+
uploaderRef.current = new RecordingUploader({
|
|
712
|
+
client: transport,
|
|
713
|
+
store: copyingStore(current.createStore(), audioCopies.current),
|
|
714
|
+
...current.fetch ? { fetch: current.fetch } : {},
|
|
715
|
+
...isCaptureActive ? { isCaptureActive: (id) => isCaptureActive(id) } : {}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
return uploaderRef.current;
|
|
719
|
+
}, [transport]);
|
|
720
|
+
const clearStopTimer = () => {
|
|
721
|
+
if (stopTimerRef.current) clearTimeout(stopTimerRef.current);
|
|
722
|
+
stopTimerRef.current = null;
|
|
723
|
+
};
|
|
724
|
+
const settleIdle = useCallback2(() => {
|
|
725
|
+
dictationRef.current = null;
|
|
726
|
+
recorderRef.current = null;
|
|
727
|
+
oneShotRef.current = null;
|
|
728
|
+
handed.current = null;
|
|
729
|
+
clearStopTimer();
|
|
730
|
+
setStatus("idle");
|
|
731
|
+
setError(null);
|
|
732
|
+
setStream(null);
|
|
733
|
+
setRecordingId(null);
|
|
734
|
+
setDurationSeconds(0);
|
|
735
|
+
setRecordingStartedAt(null);
|
|
736
|
+
setSavedTranscript(null);
|
|
737
|
+
setHeld(false);
|
|
738
|
+
}, []);
|
|
739
|
+
const hold = useCallback2(
|
|
740
|
+
(dictation, next, code = null, autoInsert = false) => {
|
|
741
|
+
dictationRef.current = { ...dictation, autoInsert };
|
|
742
|
+
setRecordingId(dictation.recordingId);
|
|
743
|
+
setSavedTranscript(dictation.text);
|
|
744
|
+
setHeld(true);
|
|
745
|
+
setStatus(next);
|
|
746
|
+
setError(code);
|
|
747
|
+
setStream(null);
|
|
748
|
+
setRecordingStartedAt(null);
|
|
749
|
+
},
|
|
750
|
+
[]
|
|
751
|
+
);
|
|
752
|
+
const insertText = useCallback2((text) => {
|
|
753
|
+
const { setValue: write, focusInput: focus } = latest.current;
|
|
754
|
+
write(appendFinalTranscript(latest.current.value, text));
|
|
755
|
+
focus();
|
|
756
|
+
}, []);
|
|
757
|
+
const giveAudio = useCallback2((audio) => {
|
|
758
|
+
try {
|
|
759
|
+
latest.current.onAudio?.(audio);
|
|
760
|
+
} catch {
|
|
761
|
+
}
|
|
762
|
+
}, []);
|
|
763
|
+
const offerSaved = useCallback2(
|
|
764
|
+
async (generation) => {
|
|
765
|
+
const client = latest.current.recordings;
|
|
766
|
+
const workspace = latest.current.workspaceId;
|
|
767
|
+
if (!client || !latest.current.durable || latest.current.recover === false) return;
|
|
768
|
+
const resumed = await uploader().resume({
|
|
769
|
+
only: (stored) => stored.create.purpose === "dictation" && stored.workspaceId === workspace
|
|
770
|
+
}).catch(() => []);
|
|
771
|
+
let listed;
|
|
772
|
+
try {
|
|
773
|
+
listed = await client.listRecordings(workspace, { purpose: "dictation", limit: 10 });
|
|
774
|
+
} catch {
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const saved = listed?.recordings;
|
|
778
|
+
if (!Array.isArray(saved)) return;
|
|
779
|
+
if (generation !== generationRef.current || dictationRef.current) return;
|
|
780
|
+
const taken = readTaken();
|
|
781
|
+
const offered = saved.filter(
|
|
782
|
+
(recording) => recording !== null && typeof recording?.id === "string"
|
|
783
|
+
);
|
|
784
|
+
const listedIds = new Set(offered.map((recording) => recording.id));
|
|
785
|
+
for (const recording of offered) {
|
|
786
|
+
if (taken.has(recording.id)) {
|
|
787
|
+
void client.deleteRecording(workspace, recording.id).then(
|
|
788
|
+
() => forgetTaken(recording.id),
|
|
789
|
+
(cause) => {
|
|
790
|
+
if (httpStatus(cause) === 404) forgetTaken(recording.id);
|
|
791
|
+
}
|
|
792
|
+
);
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
const dictation = {
|
|
796
|
+
recordingId: recording.id,
|
|
797
|
+
autoInsert: false,
|
|
798
|
+
fresh: false,
|
|
799
|
+
text: null
|
|
800
|
+
};
|
|
801
|
+
if (recording.state === "capturing") {
|
|
802
|
+
if (!resumed.includes(recording.id)) continue;
|
|
803
|
+
hold(dictation, "retrying");
|
|
804
|
+
void uploader().finish(recording.id).then(
|
|
805
|
+
(upload) => {
|
|
806
|
+
if (generation !== generationRef.current) return;
|
|
807
|
+
if (upload.discarded) settleIdle();
|
|
808
|
+
else if (upload.failed)
|
|
809
|
+
hold(dictation, "error", voiceInputCode(upload.failed.code));
|
|
810
|
+
else void watchRef.current(dictation, null, generation);
|
|
811
|
+
},
|
|
812
|
+
() => void 0
|
|
813
|
+
);
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
if (recording.state === "failed") {
|
|
817
|
+
hold(
|
|
818
|
+
dictation,
|
|
819
|
+
"error",
|
|
820
|
+
voiceInputCode(recording.transcript?.errorCode ?? recording.errorCode)
|
|
821
|
+
);
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
hold(dictation, recording.state === "ready" ? "transcribing" : "retrying");
|
|
825
|
+
void watchRef.current(dictation, null, generation);
|
|
826
|
+
return;
|
|
827
|
+
}
|
|
828
|
+
const unlisted = resumed.filter((id) => !listedIds.has(id));
|
|
829
|
+
if (unlisted.length > 0) {
|
|
830
|
+
void Promise.any(unlisted.map((id) => uploader().finish(id))).then(
|
|
831
|
+
() => {
|
|
832
|
+
if (generation === generationRef.current && !dictationRef.current) {
|
|
833
|
+
void loadSavedRef.current(generation);
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
() => void 0
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
[hold, settleIdle, uploader]
|
|
841
|
+
);
|
|
842
|
+
const loadSaved = useCallback2(
|
|
843
|
+
(generation) => offerSaved(generation).catch(() => void 0),
|
|
844
|
+
[offerSaved]
|
|
845
|
+
);
|
|
846
|
+
loadSavedRef.current = loadSaved;
|
|
847
|
+
const take = useCallback2(
|
|
848
|
+
async (dictation, text, generation, timing) => {
|
|
849
|
+
const client = latest.current.recordings;
|
|
850
|
+
const workspace = latest.current.workspaceId;
|
|
851
|
+
let insert = true;
|
|
852
|
+
if (client) {
|
|
853
|
+
try {
|
|
854
|
+
await client.deleteRecording(workspace, dictation.recordingId);
|
|
855
|
+
} catch (cause) {
|
|
856
|
+
if (httpStatus(cause) === 404) {
|
|
857
|
+
insert = false;
|
|
858
|
+
} else {
|
|
859
|
+
rememberTaken(dictation.recordingId);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
if (generation !== generationRef.current) {
|
|
864
|
+
if (insert && text.trim()) rememberTaken(dictation.recordingId);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
if (insert && text.trim()) insertText(text);
|
|
868
|
+
if (timing) {
|
|
869
|
+
const stopToComposerMs = insert && text.trim() ? performance.now() - timing.stoppedAtMs : void 0;
|
|
870
|
+
void reportDictationTimings(client, workspace, dictation.recordingId, {
|
|
871
|
+
transcriptWaitMs: timing.transcriptWaitMs,
|
|
872
|
+
stopToTranscriptMs: timing.stopToTranscriptMs,
|
|
873
|
+
stopToComposerMs
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
settleIdle();
|
|
877
|
+
void loadSaved(generation);
|
|
878
|
+
},
|
|
879
|
+
[insertText, loadSaved, settleIdle]
|
|
880
|
+
);
|
|
881
|
+
const watch = useCallback2(
|
|
882
|
+
async (dictation, versionId, generation) => {
|
|
883
|
+
const client = latest.current.recordings;
|
|
884
|
+
const workspace = latest.current.workspaceId;
|
|
885
|
+
if (!client) return;
|
|
886
|
+
const waitingStarted = performance.now();
|
|
887
|
+
let delay = latest.current.pollIntervalMilliseconds ?? DEFAULT_POLL_MILLISECONDS;
|
|
888
|
+
for (; ; ) {
|
|
889
|
+
if (generation !== generationRef.current) return;
|
|
890
|
+
let version;
|
|
891
|
+
const asked = Date.now();
|
|
892
|
+
try {
|
|
893
|
+
const versions = await client.listRecordingTranscriptVersions(
|
|
894
|
+
workspace,
|
|
895
|
+
dictation.recordingId,
|
|
896
|
+
{ waitSeconds: TRANSCRIPT_WAIT_SECONDS, ...versionId ? { waitFor: versionId } : {} }
|
|
897
|
+
);
|
|
898
|
+
version = versionId ? versions.find((item) => item.id === versionId) : [...versions].sort((left, right) => right.createdAt.localeCompare(left.createdAt))[0];
|
|
899
|
+
} catch (cause) {
|
|
900
|
+
if (httpStatus(cause) === 404) {
|
|
901
|
+
if (generation === generationRef.current) settleIdle();
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
delay = Math.min(MAX_POLL_MILLISECONDS, delay * 2);
|
|
905
|
+
}
|
|
906
|
+
if (generation !== generationRef.current) return;
|
|
907
|
+
if (version?.state === "failed") {
|
|
908
|
+
hold(dictation, "error", voiceInputCode(version.errorCode));
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
if (version?.state === "complete") {
|
|
912
|
+
const text = await transcriptText(client, workspace, dictation.recordingId, version.id);
|
|
913
|
+
if (generation !== generationRef.current) return;
|
|
914
|
+
if (text === null) {
|
|
915
|
+
delay = Math.min(MAX_POLL_MILLISECONDS, delay * 2);
|
|
916
|
+
} else {
|
|
917
|
+
const ready = performance.now();
|
|
918
|
+
const timing = dictation.stoppedAtMs === void 0 ? void 0 : {
|
|
919
|
+
stoppedAtMs: dictation.stoppedAtMs,
|
|
920
|
+
transcriptWaitMs: ready - waitingStarted,
|
|
921
|
+
stopToTranscriptMs: ready - dictation.stoppedAtMs
|
|
922
|
+
};
|
|
923
|
+
const current = dictationRef.current;
|
|
924
|
+
const automatic = current?.recordingId === dictation.recordingId && current.autoInsert && !latest.current.disabled;
|
|
925
|
+
if (automatic) {
|
|
926
|
+
await take(dictation, text, generation, timing);
|
|
927
|
+
} else {
|
|
928
|
+
if (timing) {
|
|
929
|
+
void reportDictationTimings(client, workspace, dictation.recordingId, {
|
|
930
|
+
transcriptWaitMs: timing.transcriptWaitMs,
|
|
931
|
+
stopToTranscriptMs: timing.stopToTranscriptMs
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
const waitingForSend = current?.recordingId === dictation.recordingId && current.autoInsert;
|
|
935
|
+
hold({ ...dictation, text }, "transcript-ready", null, waitingForSend);
|
|
936
|
+
}
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
await sleep(Math.max(0, delay - (Date.now() - asked)));
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
[hold, settleIdle, take]
|
|
944
|
+
);
|
|
945
|
+
watchRef.current = watch;
|
|
946
|
+
const finishOneShot = useCallback2(
|
|
947
|
+
async (capture, generation, autoInsert) => {
|
|
948
|
+
const audio = await capture.stop();
|
|
949
|
+
oneShotRef.current = null;
|
|
950
|
+
if (generation !== generationRef.current) return;
|
|
951
|
+
if (!audio || audio.size === 0) {
|
|
952
|
+
settleIdle();
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
const copy = {
|
|
956
|
+
recordingId: null,
|
|
957
|
+
audio,
|
|
958
|
+
durationMilliseconds: Math.round(capture.durationSeconds() * 1e3)
|
|
959
|
+
};
|
|
960
|
+
giveAudio(copy);
|
|
961
|
+
handed.current = copy;
|
|
962
|
+
const maxBytes = latest.current.capability?.maxSizeBytes;
|
|
963
|
+
if (maxBytes !== void 0 && audio.size > maxBytes) {
|
|
964
|
+
settleIdle();
|
|
965
|
+
setStatus("error");
|
|
966
|
+
setError("too_large");
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
const client = latest.current.client;
|
|
970
|
+
if (!client) return;
|
|
971
|
+
setStatus("transcribing");
|
|
972
|
+
try {
|
|
973
|
+
const response = await client.transcribeAudio(latest.current.workspaceId, {
|
|
974
|
+
audio,
|
|
975
|
+
mimeType: audio.type || capture.mimeType,
|
|
976
|
+
durationSeconds: capture.durationSeconds(),
|
|
977
|
+
...oneShotLanguage.current ? { language: oneShotLanguage.current } : {}
|
|
978
|
+
});
|
|
979
|
+
if (generation !== generationRef.current) return;
|
|
980
|
+
if (autoInsert && !latest.current.disabled) {
|
|
981
|
+
insertText(response.text);
|
|
982
|
+
settleIdle();
|
|
983
|
+
} else {
|
|
984
|
+
oneShotText.current = response.text;
|
|
985
|
+
setSavedTranscript(response.text);
|
|
986
|
+
setHeld(true);
|
|
987
|
+
setStatus("transcript-ready");
|
|
988
|
+
}
|
|
989
|
+
} catch (cause) {
|
|
990
|
+
if (generation !== generationRef.current) return;
|
|
991
|
+
settleIdle();
|
|
992
|
+
setStatus("error");
|
|
993
|
+
setError(errorCode(cause));
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
[giveAudio, insertText, settleIdle]
|
|
997
|
+
);
|
|
998
|
+
const finishCapture = useCallback2(
|
|
999
|
+
async (autoInsert) => {
|
|
1000
|
+
const stoppedAtMs = performance.now();
|
|
1001
|
+
const generation = generationRef.current;
|
|
1002
|
+
clearStopTimer();
|
|
1003
|
+
const oneShot = oneShotRef.current;
|
|
1004
|
+
if (oneShot) {
|
|
1005
|
+
setStatus("saving");
|
|
1006
|
+
setStream(null);
|
|
1007
|
+
await finishOneShot(oneShot, generation, autoInsert);
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
const recorder = recorderRef.current;
|
|
1011
|
+
if (!recorder) return;
|
|
1012
|
+
const id = recorder.snapshot.recordingId;
|
|
1013
|
+
const elapsed = recorder.snapshot.elapsedMilliseconds;
|
|
1014
|
+
setStatus(autoInsert ? "saving" : "recovered");
|
|
1015
|
+
setStream(null);
|
|
1016
|
+
setRecordingStartedAt(null);
|
|
1017
|
+
if (dictationRef.current) dictationRef.current.autoInsert = autoInsert;
|
|
1018
|
+
let upload;
|
|
1019
|
+
try {
|
|
1020
|
+
upload = await recorder.stop();
|
|
1021
|
+
} catch {
|
|
1022
|
+
upload = null;
|
|
1023
|
+
}
|
|
1024
|
+
recorderRef.current = null;
|
|
1025
|
+
const audio = id ? takeCopy(audioCopies.current, id) : null;
|
|
1026
|
+
if (generation !== generationRef.current || !id) return;
|
|
1027
|
+
if (!upload || upload.discarded) {
|
|
1028
|
+
settleIdle();
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
if (audio && latest.current.onAudio && !upload.failed) {
|
|
1032
|
+
const copy = { recordingId: id, audio, durationMilliseconds: elapsed };
|
|
1033
|
+
giveAudio(copy);
|
|
1034
|
+
handed.current = copy;
|
|
1035
|
+
}
|
|
1036
|
+
const dictation = dictationRef.current ?? {
|
|
1037
|
+
recordingId: id,
|
|
1038
|
+
autoInsert,
|
|
1039
|
+
fresh: true,
|
|
1040
|
+
text: null
|
|
1041
|
+
};
|
|
1042
|
+
if (upload.failed) {
|
|
1043
|
+
await uploader().discard(id).catch(() => void 0);
|
|
1044
|
+
settleIdle();
|
|
1045
|
+
setStatus("error");
|
|
1046
|
+
setError(voiceInputCode(upload.failed.code));
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
const versionId = uploader().finalized.get(id)?.transcript.id ?? null;
|
|
1050
|
+
if (dictation.autoInsert) setStatus("transcribing");
|
|
1051
|
+
else hold(dictation, "recovered");
|
|
1052
|
+
await watch({ ...dictation, stoppedAtMs }, versionId, generation);
|
|
1053
|
+
},
|
|
1054
|
+
[finishOneShot, giveAudio, hold, settleIdle, uploader, watch]
|
|
1055
|
+
);
|
|
1056
|
+
const stop = useCallback2(() => {
|
|
1057
|
+
if (statusRef.current !== "recording") return;
|
|
1058
|
+
void finishCapture(true);
|
|
1059
|
+
}, [finishCapture]);
|
|
1060
|
+
const beginCapture = useCallback2(
|
|
1061
|
+
(input, id) => {
|
|
1062
|
+
startedAtRef.current = now().getTime();
|
|
1063
|
+
setStream(input);
|
|
1064
|
+
setRecordingId(id);
|
|
1065
|
+
setDurationSeconds(0);
|
|
1066
|
+
setRecordingStartedAt(startedAtRef.current);
|
|
1067
|
+
setStatus("recording");
|
|
1068
|
+
const limit = maxRecordingSecondsRef.current;
|
|
1069
|
+
if (limit) {
|
|
1070
|
+
stopTimerRef.current = setTimeout(() => {
|
|
1071
|
+
if (statusRef.current === "recording") void finishCapture(true);
|
|
1072
|
+
}, limit * 1e3);
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
[finishCapture, now]
|
|
1076
|
+
);
|
|
1077
|
+
const start = useCallback2(async () => {
|
|
1078
|
+
const startable = () => {
|
|
1079
|
+
const current2 = latest.current;
|
|
1080
|
+
return !(!current2.durable && !current2.client || !current2.capability?.available || !current2.enabled || current2.disabled || statusRef.current === "requesting-permission" || statusRef.current === "recording" || statusRef.current === "saving" || statusRef.current === "transcribing" || dictationRef.current);
|
|
1081
|
+
};
|
|
1082
|
+
if (gatingRef.current || !startable()) return false;
|
|
1083
|
+
const gate = latest.current.beforeStart;
|
|
1084
|
+
if (gate) {
|
|
1085
|
+
gatingRef.current = true;
|
|
1086
|
+
let allowed = false;
|
|
1087
|
+
try {
|
|
1088
|
+
allowed = await gate();
|
|
1089
|
+
} catch {
|
|
1090
|
+
allowed = false;
|
|
1091
|
+
} finally {
|
|
1092
|
+
gatingRef.current = false;
|
|
1093
|
+
}
|
|
1094
|
+
if (!allowed || !startable()) return false;
|
|
1095
|
+
}
|
|
1096
|
+
const current = latest.current;
|
|
1097
|
+
if (!current.capability) return false;
|
|
1098
|
+
const generation = ++generationRef.current;
|
|
1099
|
+
setStatus("requesting-permission");
|
|
1100
|
+
setError(null);
|
|
1101
|
+
const language = current.language || null;
|
|
1102
|
+
if (!current.durable) {
|
|
1103
|
+
oneShotLanguage.current = language;
|
|
1104
|
+
const capture = await startOneShot(current.capability.acceptedMimeTypes);
|
|
1105
|
+
if (generation !== generationRef.current) {
|
|
1106
|
+
if (!(capture instanceof Error)) await capture.stop();
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
if (capture instanceof Error) {
|
|
1110
|
+
setStatus("error");
|
|
1111
|
+
setError(errorCode(capture));
|
|
1112
|
+
return false;
|
|
1113
|
+
}
|
|
1114
|
+
oneShotRef.current = capture;
|
|
1115
|
+
beginCapture(capture.stream, null);
|
|
1116
|
+
return true;
|
|
1117
|
+
}
|
|
1118
|
+
const transcription = dictationTranscription(language, current.keyterms, current.model);
|
|
1119
|
+
audioCopies.current.clear();
|
|
1120
|
+
const copying = Boolean(current.onAudio);
|
|
1121
|
+
const recorder = current.platform.createRecorder({
|
|
1122
|
+
client: transport,
|
|
1123
|
+
workspaceId: current.workspaceId,
|
|
1124
|
+
purpose: "dictation",
|
|
1125
|
+
microphone: true,
|
|
1126
|
+
...transcription ? { transcription } : {},
|
|
1127
|
+
uploader: uploader(),
|
|
1128
|
+
timesliceMilliseconds: VOICE_RECORDING_TIMESLICE_MILLISECONDS,
|
|
1129
|
+
keepAwake: false,
|
|
1130
|
+
onChange: (snapshot2) => {
|
|
1131
|
+
if (recorderRef.current !== recorder) return;
|
|
1132
|
+
if (copying && snapshot2.recordingId && !audioCopies.current.has(snapshot2.recordingId)) {
|
|
1133
|
+
audioCopies.current.set(snapshot2.recordingId, { mimeType: null, parts: [] });
|
|
1134
|
+
}
|
|
1135
|
+
setDurationSeconds(snapshot2.elapsedMilliseconds / 1e3);
|
|
1136
|
+
if (snapshot2.state === "recording" && snapshot2.upload?.failed) {
|
|
1137
|
+
const code = voiceInputCode(snapshot2.upload.failed.code);
|
|
1138
|
+
recorderRef.current = null;
|
|
1139
|
+
dictationRef.current = null;
|
|
1140
|
+
void recorder.discard().catch(() => void 0);
|
|
1141
|
+
settleIdle();
|
|
1142
|
+
setStatus("error");
|
|
1143
|
+
setError(code);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
recorderRef.current = recorder;
|
|
1148
|
+
await recorder.start();
|
|
1149
|
+
if (generation !== generationRef.current) {
|
|
1150
|
+
await recorder.discard().catch(() => void 0);
|
|
1151
|
+
return false;
|
|
1152
|
+
}
|
|
1153
|
+
const snapshot = recorder.snapshot;
|
|
1154
|
+
if (snapshot.state !== "recording" || !snapshot.recordingId) {
|
|
1155
|
+
recorderRef.current = null;
|
|
1156
|
+
setStatus("error");
|
|
1157
|
+
setError(captureCode(snapshot.error?.code ?? null));
|
|
1158
|
+
return false;
|
|
1159
|
+
}
|
|
1160
|
+
dictationRef.current = {
|
|
1161
|
+
recordingId: snapshot.recordingId,
|
|
1162
|
+
autoInsert: true,
|
|
1163
|
+
fresh: true,
|
|
1164
|
+
text: null
|
|
1165
|
+
};
|
|
1166
|
+
beginCapture(recorder.inputStream?.(0) ?? null, snapshot.recordingId);
|
|
1167
|
+
return true;
|
|
1168
|
+
}, [beginCapture, settleIdle, transport, uploader]);
|
|
1169
|
+
const discard = useCallback2(async () => {
|
|
1170
|
+
const generation = ++generationRef.current;
|
|
1171
|
+
const recorder = recorderRef.current;
|
|
1172
|
+
const oneShot = oneShotRef.current;
|
|
1173
|
+
const dictation = dictationRef.current;
|
|
1174
|
+
settleIdle();
|
|
1175
|
+
oneShotText.current = null;
|
|
1176
|
+
audioCopies.current.clear();
|
|
1177
|
+
if (oneShot) await oneShot.stop().catch(() => void 0);
|
|
1178
|
+
if (recorder) {
|
|
1179
|
+
await recorder.discard().catch(() => void 0);
|
|
1180
|
+
} else if (dictation) {
|
|
1181
|
+
await uploader().discard(dictation.recordingId).catch(() => void 0);
|
|
1182
|
+
await latest.current.recordings?.deleteRecording(latest.current.workspaceId, dictation.recordingId).catch(() => void 0);
|
|
1183
|
+
}
|
|
1184
|
+
focusInput();
|
|
1185
|
+
if (generation === generationRef.current) void loadSaved(generation);
|
|
1186
|
+
}, [focusInput, loadSaved, settleIdle, uploader]);
|
|
1187
|
+
const cancel = useCallback2(() => {
|
|
1188
|
+
const current = statusRef.current;
|
|
1189
|
+
if (current === "requesting-permission") {
|
|
1190
|
+
generationRef.current += 1;
|
|
1191
|
+
settleIdle();
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
const dictation = dictationRef.current;
|
|
1195
|
+
const keep = (copy) => {
|
|
1196
|
+
if (copy && copy.durationMilliseconds >= ACCIDENTAL_START_MAX_MILLISECONDS) {
|
|
1197
|
+
giveAudio({ ...copy, cancelled: true });
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
if (current === "recording") {
|
|
1201
|
+
const recorder = recorderRef.current;
|
|
1202
|
+
const id = recorder?.snapshot.recordingId ?? null;
|
|
1203
|
+
if (recorder && id && latest.current.onAudio) {
|
|
1204
|
+
const audio = takeCopy(audioCopies.current, id);
|
|
1205
|
+
const spoken = Math.max(
|
|
1206
|
+
recorder.snapshot.elapsedMilliseconds,
|
|
1207
|
+
now().getTime() - startedAtRef.current
|
|
1208
|
+
);
|
|
1209
|
+
if (audio) keep({ recordingId: id, audio, durationMilliseconds: spoken });
|
|
1210
|
+
}
|
|
1211
|
+
void discard();
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
if (current !== "saving" && current !== "transcribing" && current !== "retrying") return;
|
|
1215
|
+
if (dictation && !dictation.fresh) {
|
|
1216
|
+
dictation.autoInsert = false;
|
|
1217
|
+
setHeld(true);
|
|
1218
|
+
setStatus("recovered");
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
if (handed.current) {
|
|
1222
|
+
keep(handed.current);
|
|
1223
|
+
} else if (dictation && latest.current.onAudio) {
|
|
1224
|
+
const audio = takeCopy(audioCopies.current, dictation.recordingId);
|
|
1225
|
+
const recorder = recorderRef.current;
|
|
1226
|
+
if (audio) {
|
|
1227
|
+
keep({
|
|
1228
|
+
recordingId: dictation.recordingId,
|
|
1229
|
+
audio,
|
|
1230
|
+
durationMilliseconds: recorder?.snapshot.elapsedMilliseconds ?? 0
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
void discard();
|
|
1235
|
+
}, [discard, giveAudio, now, settleIdle]);
|
|
1236
|
+
const setAside = useCallback2(() => {
|
|
1237
|
+
const current = statusRef.current;
|
|
1238
|
+
if (current === "requesting-permission") {
|
|
1239
|
+
generationRef.current += 1;
|
|
1240
|
+
settleIdle();
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
if (current === "recording") {
|
|
1244
|
+
const elapsed = now().getTime() - startedAtRef.current;
|
|
1245
|
+
if (elapsed < ACCIDENTAL_START_MAX_MILLISECONDS) {
|
|
1246
|
+
void discard();
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
void finishCapture(false);
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
if (current === "saving" || current === "transcribing" || current === "retrying") {
|
|
1253
|
+
const dictation = dictationRef.current;
|
|
1254
|
+
if (!dictation) return;
|
|
1255
|
+
dictation.autoInsert = false;
|
|
1256
|
+
setHeld(true);
|
|
1257
|
+
setStatus("recovered");
|
|
1258
|
+
}
|
|
1259
|
+
}, [discard, finishCapture, now, settleIdle]);
|
|
1260
|
+
const retry = useCallback2(() => {
|
|
1261
|
+
const dictation = dictationRef.current;
|
|
1262
|
+
const client = latest.current.recordings;
|
|
1263
|
+
if (!dictation || dictation.text !== null || !client || latest.current.disabled) return;
|
|
1264
|
+
const generation = ++generationRef.current;
|
|
1265
|
+
const failed = statusRef.current === "error" || errorRef.current !== null;
|
|
1266
|
+
dictation.autoInsert = true;
|
|
1267
|
+
setHeld(false);
|
|
1268
|
+
setError(null);
|
|
1269
|
+
setStatus("transcribing");
|
|
1270
|
+
void (async () => {
|
|
1271
|
+
let versionId = null;
|
|
1272
|
+
if (failed) {
|
|
1273
|
+
try {
|
|
1274
|
+
versionId = (await client.createRecordingTranscript(
|
|
1275
|
+
latest.current.workspaceId,
|
|
1276
|
+
dictation.recordingId
|
|
1277
|
+
)).id;
|
|
1278
|
+
} catch (cause) {
|
|
1279
|
+
if (generation !== generationRef.current) return;
|
|
1280
|
+
if (httpStatus(cause) === 404) {
|
|
1281
|
+
settleIdle();
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
hold(dictation, "error", errorCode(cause));
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
await watch(dictation, versionId, generation);
|
|
1289
|
+
})();
|
|
1290
|
+
}, [hold, settleIdle, watch]);
|
|
1291
|
+
const insertSavedTranscript = useCallback2(async () => {
|
|
1292
|
+
if (latest.current.disabled) return;
|
|
1293
|
+
const generation = ++generationRef.current;
|
|
1294
|
+
const dictation = dictationRef.current;
|
|
1295
|
+
if (oneShotText.current !== null) {
|
|
1296
|
+
insertText(oneShotText.current);
|
|
1297
|
+
oneShotText.current = null;
|
|
1298
|
+
settleIdle();
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
if (!dictation || dictation.text === null) return;
|
|
1302
|
+
await take(dictation, dictation.text, generation);
|
|
1303
|
+
}, [insertText, settleIdle, take]);
|
|
1304
|
+
const release = useCallback2(() => {
|
|
1305
|
+
generationRef.current += 1;
|
|
1306
|
+
void recorderRef.current?.stop().catch(() => void 0);
|
|
1307
|
+
void oneShotRef.current?.stop().catch(() => void 0);
|
|
1308
|
+
oneShotText.current = null;
|
|
1309
|
+
audioCopies.current.clear();
|
|
1310
|
+
settleIdle();
|
|
1311
|
+
}, [settleIdle]);
|
|
1312
|
+
const transcribe = useCallback2(
|
|
1313
|
+
async (audio, timing = {}) => {
|
|
1314
|
+
const current = latest.current;
|
|
1315
|
+
const client = current.recordings;
|
|
1316
|
+
if (!client || !current.durable || current.disabled || !current.enabled || !current.capability?.available || statusRef.current !== "idle" || audio.size === 0) {
|
|
1317
|
+
return false;
|
|
1318
|
+
}
|
|
1319
|
+
const generation = ++generationRef.current;
|
|
1320
|
+
const newId = crypto.randomUUID();
|
|
1321
|
+
const transcription = dictationTranscription(
|
|
1322
|
+
current.language || null,
|
|
1323
|
+
current.keyterms,
|
|
1324
|
+
current.model
|
|
1325
|
+
);
|
|
1326
|
+
const dictation = {
|
|
1327
|
+
recordingId: newId,
|
|
1328
|
+
autoInsert: true,
|
|
1329
|
+
fresh: true,
|
|
1330
|
+
text: null
|
|
1331
|
+
};
|
|
1332
|
+
dictationRef.current = dictation;
|
|
1333
|
+
setRecordingId(newId);
|
|
1334
|
+
setError(null);
|
|
1335
|
+
setStatus("saving");
|
|
1336
|
+
let upload;
|
|
1337
|
+
try {
|
|
1338
|
+
upload = await uploadRecordingAudio({
|
|
1339
|
+
uploader: uploader(),
|
|
1340
|
+
workspaceId: current.workspaceId,
|
|
1341
|
+
recordingId: newId,
|
|
1342
|
+
audio,
|
|
1343
|
+
durationMilliseconds: timing.durationMilliseconds ?? 0,
|
|
1344
|
+
create: { purpose: "dictation", ...transcription ? { transcription } : {} }
|
|
1345
|
+
});
|
|
1346
|
+
} catch (cause) {
|
|
1347
|
+
if (generation !== generationRef.current) return false;
|
|
1348
|
+
settleIdle();
|
|
1349
|
+
setStatus("error");
|
|
1350
|
+
setError(errorCode(cause));
|
|
1351
|
+
return false;
|
|
1352
|
+
}
|
|
1353
|
+
if (generation !== generationRef.current) return true;
|
|
1354
|
+
if (upload.discarded || upload.failed) {
|
|
1355
|
+
await uploader().discard(newId).catch(() => void 0);
|
|
1356
|
+
settleIdle();
|
|
1357
|
+
setStatus("error");
|
|
1358
|
+
setError(upload.failed ? voiceInputCode(upload.failed.code) : "invalid_audio");
|
|
1359
|
+
return false;
|
|
1360
|
+
}
|
|
1361
|
+
if (dictation.autoInsert) setStatus("transcribing");
|
|
1362
|
+
else hold(dictation, "recovered");
|
|
1363
|
+
void watch(dictation, uploader().finalized.get(newId)?.transcript.id ?? null, generation);
|
|
1364
|
+
return true;
|
|
1365
|
+
},
|
|
1366
|
+
[hold, settleIdle, uploader, watch]
|
|
1367
|
+
);
|
|
1368
|
+
useEffect2(() => {
|
|
1369
|
+
const dictation = dictationRef.current;
|
|
1370
|
+
if (disabled || status !== "transcript-ready" || !dictation?.autoInsert || !dictation.text)
|
|
1371
|
+
return;
|
|
1372
|
+
void take(dictation, dictation.text, ++generationRef.current);
|
|
1373
|
+
}, [disabled, status, take]);
|
|
1374
|
+
useEffect2(() => {
|
|
1375
|
+
const generation = ++generationRef.current;
|
|
1376
|
+
const recorder = recorderRef.current;
|
|
1377
|
+
if (recorder) {
|
|
1378
|
+
void recorder.stop().catch(() => void 0);
|
|
1379
|
+
}
|
|
1380
|
+
void oneShotRef.current?.stop().catch(() => void 0);
|
|
1381
|
+
settleIdle();
|
|
1382
|
+
oneShotText.current = null;
|
|
1383
|
+
if (durable) void loadSaved(generation);
|
|
1384
|
+
}, [workspaceId, durable, loadSaved, settleIdle]);
|
|
1385
|
+
const level = useCallback2(() => {
|
|
1386
|
+
const levels = recorderRef.current?.levels();
|
|
1387
|
+
const first = levels?.[0];
|
|
1388
|
+
return typeof first === "number" ? first : null;
|
|
1389
|
+
}, []);
|
|
1390
|
+
useEffect2(
|
|
1391
|
+
() => () => {
|
|
1392
|
+
generationRef.current += 1;
|
|
1393
|
+
clearStopTimer();
|
|
1394
|
+
void recorderRef.current?.stop().catch(() => void 0);
|
|
1395
|
+
recorderRef.current = null;
|
|
1396
|
+
void oneShotRef.current?.stop().catch(() => void 0);
|
|
1397
|
+
oneShotRef.current = null;
|
|
1398
|
+
uploaderRef.current = null;
|
|
1399
|
+
},
|
|
1400
|
+
[]
|
|
1401
|
+
);
|
|
1402
|
+
return {
|
|
1403
|
+
status,
|
|
1404
|
+
error,
|
|
1405
|
+
available: Boolean(
|
|
1406
|
+
capability?.available && enabled && !disabled && (durable || canRecordInMemory())
|
|
1407
|
+
),
|
|
1408
|
+
stream,
|
|
1409
|
+
recordingId,
|
|
1410
|
+
durationSeconds,
|
|
1411
|
+
recordingStartedAt: status === "recording" ? recordingStartedAt : null,
|
|
1412
|
+
maxRecordingSeconds,
|
|
1413
|
+
locallySaved: durable && recordingId !== null,
|
|
1414
|
+
hasRecoverableRecording: held && status !== "recording",
|
|
1415
|
+
savedTranscript,
|
|
1416
|
+
level,
|
|
1417
|
+
start,
|
|
1418
|
+
stop,
|
|
1419
|
+
retry,
|
|
1420
|
+
insertSavedTranscript,
|
|
1421
|
+
cancel,
|
|
1422
|
+
setAside,
|
|
1423
|
+
discard,
|
|
1424
|
+
release,
|
|
1425
|
+
transcribe
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
function takeCopy(copies, recordingId) {
|
|
1429
|
+
const copy = copies.get(recordingId);
|
|
1430
|
+
copies.delete(recordingId);
|
|
1431
|
+
const parts = copy?.parts.filter((part) => part !== void 0) ?? [];
|
|
1432
|
+
if (!copy || parts.length === 0) return null;
|
|
1433
|
+
return new Blob(parts, copy.mimeType ? { type: copy.mimeType } : {});
|
|
1434
|
+
}
|
|
1435
|
+
function dictationTranscription(language, keyterms, model) {
|
|
1436
|
+
const terms = (keyterms ?? []).map((term) => term.trim()).filter(Boolean);
|
|
1437
|
+
if (!model && !language && terms.length === 0) return null;
|
|
1438
|
+
return {
|
|
1439
|
+
...model ? { providerId: model.providerId, model: model.model } : {},
|
|
1440
|
+
...language ? { language } : {},
|
|
1441
|
+
...terms.length > 0 ? { keyterms: terms.slice(0, 100) } : {}
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
function copyingStore(store, copies) {
|
|
1445
|
+
return {
|
|
1446
|
+
putRecording: async (recording) => {
|
|
1447
|
+
const copy = copies.get(recording.recordingId);
|
|
1448
|
+
if (copy && !copy.mimeType) {
|
|
1449
|
+
copy.mimeType = recording.create.tracks.find((track) => track.trackNumber === 0)?.mimeType ?? null;
|
|
1450
|
+
}
|
|
1451
|
+
await store.putRecording(recording);
|
|
1452
|
+
},
|
|
1453
|
+
getRecording: (recordingId) => store.getRecording(recordingId),
|
|
1454
|
+
listRecordings: () => store.listRecordings(),
|
|
1455
|
+
deleteRecording: (recordingId) => store.deleteRecording(recordingId),
|
|
1456
|
+
putChunk: async (chunk) => {
|
|
1457
|
+
await store.putChunk(chunk);
|
|
1458
|
+
const copy = copies.get(chunk.recordingId);
|
|
1459
|
+
if (copy && chunk.trackNumber === 0) copy.parts[chunk.chunkNumber] = chunk.bytes;
|
|
1460
|
+
},
|
|
1461
|
+
listChunks: (recordingId) => store.listChunks(recordingId),
|
|
1462
|
+
readChunk: (recordingId, trackNumber, chunkNumber) => store.readChunk(recordingId, trackNumber, chunkNumber),
|
|
1463
|
+
deleteChunks: (recordingId, trackNumber, chunkNumbers) => store.deleteChunks(recordingId, trackNumber, chunkNumbers)
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
async function transcriptText(client, workspaceId, recordingId, versionId) {
|
|
1467
|
+
const parts = [];
|
|
1468
|
+
let after;
|
|
1469
|
+
try {
|
|
1470
|
+
for (; ; ) {
|
|
1471
|
+
const page = await client.getRecordingTranscript(workspaceId, recordingId, {
|
|
1472
|
+
versionId,
|
|
1473
|
+
...after !== void 0 ? { after } : {},
|
|
1474
|
+
limit: 500
|
|
1475
|
+
});
|
|
1476
|
+
for (const segment of page.segments) parts.push(segment.text.trim());
|
|
1477
|
+
if (page.nextAfter === null) break;
|
|
1478
|
+
after = page.nextAfter;
|
|
1479
|
+
}
|
|
1480
|
+
} catch {
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
return parts.filter(Boolean).join(" ");
|
|
1484
|
+
}
|
|
1485
|
+
function canRecordInMemory() {
|
|
1486
|
+
return typeof MediaRecorder !== "undefined" && typeof navigator !== "undefined" && typeof navigator.mediaDevices?.getUserMedia === "function";
|
|
1487
|
+
}
|
|
1488
|
+
async function startOneShot(accepted) {
|
|
1489
|
+
let stream;
|
|
1490
|
+
try {
|
|
1491
|
+
stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
1492
|
+
} catch (cause) {
|
|
1493
|
+
return cause instanceof Error ? cause : new Error(String(cause));
|
|
1494
|
+
}
|
|
1495
|
+
try {
|
|
1496
|
+
const preferred = chooseMimeType(accepted);
|
|
1497
|
+
const recorder = new MediaRecorder(stream, preferred ? { mimeType: preferred } : void 0);
|
|
1498
|
+
const parts = [];
|
|
1499
|
+
recorder.ondataavailable = (event) => {
|
|
1500
|
+
if (event.data.size > 0) parts.push(event.data);
|
|
1501
|
+
};
|
|
1502
|
+
const startedAt = performance.now();
|
|
1503
|
+
recorder.start(VOICE_RECORDING_TIMESLICE_MILLISECONDS);
|
|
1504
|
+
let stopped = null;
|
|
1505
|
+
return {
|
|
1506
|
+
stream,
|
|
1507
|
+
mimeType: recorder.mimeType || preferred || "audio/webm",
|
|
1508
|
+
durationSeconds: () => (performance.now() - startedAt) / 1e3,
|
|
1509
|
+
stop: () => stopped ??= new Promise((resolve) => {
|
|
1510
|
+
const done = () => {
|
|
1511
|
+
for (const track of stream.getTracks()) track.stop();
|
|
1512
|
+
resolve(
|
|
1513
|
+
parts.length > 0 ? new Blob(parts, { type: recorder.mimeType || preferred || "audio/webm" }) : null
|
|
1514
|
+
);
|
|
1515
|
+
};
|
|
1516
|
+
if (recorder.state === "inactive") return done();
|
|
1517
|
+
recorder.addEventListener("stop", done, { once: true });
|
|
1518
|
+
recorder.stop();
|
|
1519
|
+
})
|
|
1520
|
+
};
|
|
1521
|
+
} catch (cause) {
|
|
1522
|
+
for (const track of stream.getTracks()) track.stop();
|
|
1523
|
+
return cause instanceof Error ? cause : new Error(String(cause));
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
function chooseMimeType(accepted) {
|
|
1527
|
+
const normalized = accepted.map((value) => value.trim().toLowerCase());
|
|
1528
|
+
return MIME_PREFERENCES.find((mimeType) => {
|
|
1529
|
+
const bare = mimeType.split(";")[0] ?? mimeType;
|
|
1530
|
+
const allowed = normalized.includes(mimeType) || normalized.includes(bare) || normalized.some((candidate) => candidate.split(";")[0] === bare);
|
|
1531
|
+
return allowed && (typeof MediaRecorder.isTypeSupported !== "function" || MediaRecorder.isTypeSupported(mimeType));
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
function voiceInputCode(code) {
|
|
1535
|
+
if (!code) return "unknown";
|
|
1536
|
+
if (code.startsWith("voice_")) return voiceInputCode(code.slice("voice_".length));
|
|
1537
|
+
if (code === "provider_quota_exceeded") return code;
|
|
1538
|
+
if (code.startsWith("provider_")) return "provider";
|
|
1539
|
+
switch (code) {
|
|
1540
|
+
case "insufficient_credits":
|
|
1541
|
+
case "allowance_exhausted":
|
|
1542
|
+
case "monthly_model_cost_limit":
|
|
1543
|
+
case "policy_blocked":
|
|
1544
|
+
case "region_restricted":
|
|
1545
|
+
case "not_supported":
|
|
1546
|
+
case "unavailable":
|
|
1547
|
+
case "too_large":
|
|
1548
|
+
case "invalid_audio":
|
|
1549
|
+
case "network":
|
|
1550
|
+
case "provider":
|
|
1551
|
+
case "timeout":
|
|
1552
|
+
return code;
|
|
1553
|
+
case "upstream_unavailable":
|
|
1554
|
+
case "storage_unavailable":
|
|
1555
|
+
return "unavailable";
|
|
1556
|
+
default:
|
|
1557
|
+
return "unknown";
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
function captureCode(code) {
|
|
1561
|
+
switch (code) {
|
|
1562
|
+
case "microphone_denied":
|
|
1563
|
+
return "permission_denied";
|
|
1564
|
+
case "unsupported":
|
|
1565
|
+
case "microphone_unavailable":
|
|
1566
|
+
return "not_supported";
|
|
1567
|
+
case "upload_failed":
|
|
1568
|
+
return "unavailable";
|
|
1569
|
+
default:
|
|
1570
|
+
return "unknown";
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function errorCode(error) {
|
|
1574
|
+
const details = error.details;
|
|
1575
|
+
if (typeof details?.transcriptionCode === "string") return details.transcriptionCode;
|
|
1576
|
+
if (typeof details?.code === "string") return voiceInputCode(details.code);
|
|
1577
|
+
if (error && typeof error === "object" && "code" in error && typeof error.code === "string") {
|
|
1578
|
+
return voiceInputCode(error.code);
|
|
1579
|
+
}
|
|
1580
|
+
if (error instanceof DOMException && error.name === "NotAllowedError") return "permission_denied";
|
|
1581
|
+
if (error instanceof DOMException && error.name === "NotSupportedError") return "not_supported";
|
|
1582
|
+
if (error instanceof TypeError) return "network";
|
|
1583
|
+
return "unknown";
|
|
1584
|
+
}
|
|
1585
|
+
function httpStatus(error) {
|
|
1586
|
+
const status = error?.status;
|
|
1587
|
+
return typeof status === "number" ? status : null;
|
|
1588
|
+
}
|
|
1589
|
+
function sleep(milliseconds) {
|
|
1590
|
+
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
1591
|
+
}
|
|
1592
|
+
function readTaken() {
|
|
1593
|
+
try {
|
|
1594
|
+
const raw = globalThis.localStorage?.getItem(TAKEN_STORAGE_KEY);
|
|
1595
|
+
const parsed = raw ? JSON.parse(raw) : [];
|
|
1596
|
+
return new Set(Array.isArray(parsed) ? parsed.filter((id) => typeof id === "string") : []);
|
|
1597
|
+
} catch {
|
|
1598
|
+
return /* @__PURE__ */ new Set();
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
function writeTaken(ids) {
|
|
1602
|
+
try {
|
|
1603
|
+
globalThis.localStorage?.setItem(TAKEN_STORAGE_KEY, JSON.stringify([...ids].slice(-50)));
|
|
1604
|
+
} catch {
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
function rememberTaken(recordingId) {
|
|
1608
|
+
const ids = readTaken();
|
|
1609
|
+
ids.add(recordingId);
|
|
1610
|
+
writeTaken(ids);
|
|
1611
|
+
}
|
|
1612
|
+
function forgetTaken(recordingId) {
|
|
1613
|
+
const ids = readTaken();
|
|
1614
|
+
if (ids.delete(recordingId)) writeTaken(ids);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
export {
|
|
1618
|
+
INITIAL_TRANSCRIPTION_CONTROL_STATE,
|
|
1619
|
+
transitionTranscriptionControl,
|
|
1620
|
+
appendFinalTranscript,
|
|
1621
|
+
useTranscription,
|
|
1622
|
+
VOICE_RECORDING_TIMESLICE_MILLISECONDS,
|
|
1623
|
+
VOICE_RECORDING_OWNER_HEARTBEAT_MILLISECONDS,
|
|
1624
|
+
VOICE_RECORDING_OWNER_STALE_MILLISECONDS,
|
|
1625
|
+
VOICE_RECORDING_CLIENT_MAX_DURATION_SECONDS,
|
|
1626
|
+
useVoiceInput
|
|
1627
|
+
};
|
|
1628
|
+
//# sourceMappingURL=chunk-LLYX4F5A.js.map
|