agentroam-runtime-darwin-arm64 0.2.0-preview.65 → 0.2.0-preview.67
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/manifest.json +2 -2
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +9 -9
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +3 -3
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +1 -15
- package/runtime/.next/server/app/api/agent/run/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +5 -19
- package/runtime/.next/server/app/api/agent/stream/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +3 -3
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +3 -3
- package/runtime/.next/server/app/api/push/subscribe/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +3 -3
- package/runtime/.next/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/push/vapid/route.js +3 -3
- package/runtime/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +4 -4
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +30 -30
- package/runtime/.next/server/chunks/5303.js +2 -2
- package/runtime/.next/server/chunks/6977.js +4 -0
- package/runtime/.next/server/chunks/9362.js +15 -0
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/pages/404.html +1 -1
- package/runtime/.next/server/pages/500.html +1 -1
- package/runtime/.next/server/server-reference-manifest.json +1 -1
- package/runtime/.next/server/webpack-runtime.js +1 -1
- package/runtime/.next/static/chunks/app/web/{error-17e28c153738a003.js → error-3235f39be6c933cc.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-2775b74d2fa28e3d.js +1 -0
- package/runtime/.next/static/chunks/app/web/{page-9d2cdb1ef9ad40b2.js → page-351c1dc072843d5b.js} +1 -1
- package/runtime/.next/static/chunks/{main-app-a953e6764afe1e60.js → main-app-e8101d77b5e3cc22.js} +1 -1
- package/runtime/.next/static/css/afa521adcec25f87.css +1 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
- package/runtime/node_modules/.package-lock.json +11 -11
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +72 -69
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +39 -39
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-nxm5bcfb.mjs → core-4pv47a2z.mjs} +4 -4
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-bz5kkzv0.mjs +40 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-c86d180z.mjs +52 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-1qw7dszx.mjs → core-pzfwbvz7.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +11 -11
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +19 -20
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +23 -24
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +14 -14
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +60 -60
- package/runtime/package-lock.json +35 -35
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{AiHubPane-Cd-7gwJs.js → AiHubPane-HvNAeqL7.js} +1 -1
- package/runtime/webapp/dist/assets/{App-DQqv62sH.js → App-sT3zFETY.js} +22 -22
- package/runtime/webapp/dist/assets/BrowserLivePanel-ua0SDLXi.js +76 -0
- package/runtime/webapp/dist/assets/{CollaborationDashboard-qQQqXrQI.js → CollaborationDashboard-cjhodfE8.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationPage-BS3Z5dAy.js → CollaborationPage-tTPizQue.js} +1 -1
- package/runtime/webapp/dist/assets/{FilePreview-C4gxZRtw.js → FilePreview-cBO9eSzP.js} +3 -3
- package/runtime/webapp/dist/assets/{FileTree-DrpruRST.js → FileTree-Dmi8qK5r.js} +1 -1
- package/runtime/webapp/dist/assets/{FlowStudioPane-BjOuLwks.js → FlowStudioPane-a42btYRt.js} +1 -1
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-B1AGyJrT.js → RemoteDesktopPage-CRgO_MeY.js} +1 -1
- package/runtime/webapp/dist/assets/{TerminalPane-BxEtw8rn.js → TerminalPane-C6IOQtLp.js} +1 -1
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-BHgKdAyZ.js → abnfDiagram-VCTEODGH-BnPzSGXs.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-B8zNXyCl.js → arc-D6SG3Tqg.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-D596eLfj.js → architectureDiagram-5GKGNRK7-DeFghmeG.js} +1 -1
- package/runtime/webapp/dist/assets/{artifact-links-DwSH3xn_.js → artifact-links-CSP8FnHR.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-C4eZ-RzC.js → blockDiagram-I7D4REHJ-BDR3fJKn.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-Cxe44X-3.js → c4Diagram-7LVT6UL2-C7-CV6ba.js} +1 -1
- package/runtime/webapp/dist/assets/channel-Bu67et9K.js +1 -0
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-D_syaagC.js → chunk-2Q5K7J3B-Dr3WMJYV.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-q_wDWTVC.js → chunk-5VM5RSS4-CHaTVVwk.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-C5U_ckFK.js → chunk-F27PBJKO-BtespMYN.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-5a_rZZVM.js → chunk-IMKFNOWR-2fg__aRG.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-DR8znCWR.js → chunk-JWPE2WC7-DaP4IRoM.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-3vOXloa3.js → chunk-POPQ4Y6H-DHdcRAlF.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-y9Uxi4pg.js → chunk-SVP7TREG-CppcHyhw.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-Bi7VvqOR.js → chunk-TICWLB2K-CcTgoJc-.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CRpw-5Cj.js → chunk-XXDRQBXY-Lsme90zQ.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BbPEBERA.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BbPEBERA.js +1 -0
- package/runtime/webapp/dist/assets/{clipboard-BKglnESD.js → clipboard-CmAHVNMn.js} +1 -1
- package/runtime/webapp/dist/assets/{codeSyntax-Dmbrlor0.js → codeSyntax-B_DLp7m_.js} +1 -1
- package/runtime/webapp/dist/assets/{collaboration-BZSnjFZ-.js → collaboration-B5mbAmrC.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-4JQKrvR5.js → cose-bilkent-JH36ORCC-mgs418Ac.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BO4eLWHY.js → cynefin-OW5HDTMX-CvzwyYLT.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-Dg-Bt9fs.js → cynefinDiagram-5FMLGOSQ-D3RxpH4Y.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-utMMpYq0.js → dagre-GXQ25YYZ-C7OiYbvG.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-BUzOnotG.js → diagram-S7CK7UJ4-Be8c_enH.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-Bkesml6e.js → diagram-UQ7AKVKN-Djppm43c.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-P-Qqxnpn.js → diagram-VSXAHHWV-C9Hm5_Iv.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-xpyBMRkH.js → diagram-VX7I27RA-BI0iL1pP.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-FMNqO2NJ.js → diagram-Z3DM3KII-CVJa6U-f.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-D8-cmvEK.js → ebnfDiagram-PWID7BFC-BVF_KmpZ.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-mEgSpGUN.js → erDiagram-RLTQ6QDP-BoUcAbOY.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-DgQXHGm7.js → file-types-DT3kuLgW.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-DJWXgpoo.js → flowDiagram-HODETNUW-BxdlVA58.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-B5HA7Xox.js → ganttDiagram-EL5Y4UJY-Dlte1FdK.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-CP4Zmize.js → gitGraphDiagram-WWUBYQGX-4U23WKot.js} +1 -1
- package/runtime/webapp/dist/assets/{index-BReRPZnZ.js → index-C5lu8vsB.js} +3 -3
- package/runtime/webapp/dist/assets/{index-DfpiL3X7.css → index-DHlGkRUQ.css} +1 -1
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-DApDSX70.js → infoDiagram-27XIBGKW-BxInW3HP.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-BCYtD2Fm.js → ishikawaDiagram-5VMMS53U-C7nPcZCI.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-D3WEyKHq.js → journeyDiagram-3NMN7TZE-SnpiomDY.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-Q6vb0ZbD.js → kanban-definition-UXKFOSKX-GyeEsAU9.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-Bp7cvpx1.js → layout-BIyZgNCJ.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-4ik7NzLN.js → linear-IDCh5Dte.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-BCsj2yyN.js → loader-circle-CgeEpRSN.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-CmhaKXiP.js → mermaid.core-B0LwlZaW.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-DabuuB2q.js → mindmap-definition-YA3MSWOX-9K5XFO1p.js} +1 -1
- package/runtime/webapp/dist/assets/{page-Cgp9NEw1.js → page-BtJOUBkb.js} +3 -3
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-eIBdAhCQ.js → pegDiagram-XKGWAZYB-CD6XsTyR.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-DUd7f60Q.js → pieDiagram-E7YTZNPT-db0apgdk.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-BPSqBWPV.js → quadrantDiagram-AXDQQJYC-CkKhwUbI.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CHqMz56-.js → railroadDiagram-O6MQD6OU-D6lFmRc9.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-BfOzGN7B.js → requirementDiagram-BXWQKSXE-45r_leK5.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-ccw-p76OF6j6.js → rotate-ccw-CGTxCXRR.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-D5iQzT0K.js → rotate-cw-BTUsFDVV.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-BFOPAhWl.js → sankeyDiagram-P5KCCOFB-DZqPxPOL.js} +1 -1
- package/runtime/webapp/dist/assets/{send-DdY_K1RT.js → send-B-6udpOE.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-CdQhFjho.js → sequenceDiagram-WJ2MYXX4-5nLILN8w.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-BP_2bwHb.js → sizeCapture-INFHLROL-BvatjuQt.js} +1 -1
- package/runtime/webapp/dist/assets/{smartphone-C2--txxG.js → smartphone-xdULmq7H.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D2_O1o9C.js → stateDiagram-D77RDMKH-D5Pd-6ag.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Dw54mhyp.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-BwEWz-Bu.js → swimlanes-42K2YHIH-Ck3iwi4M.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-Dnta8bTC.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-DqDB5dmr.js → timeline-definition-24CTP7MA-edxwD-FN.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-CZx0p0L3.js → trash-2-B8d7FxiV.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-Cf4VnZ2O.js → vennDiagram-4TSXK5OY-CoAScFug.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-D9FBNJOU.js → wardleyDiagram-VM6X3IG4-ByIW81UU.js} +1 -1
- package/runtime/webapp/dist/assets/{web-BVybOQy8.js → web-Cd8qQxlG.js} +1 -1
- package/runtime/webapp/dist/assets/{web-CT9Joona.js → web-Rzucq1ai.js} +1 -1
- package/runtime/webapp/dist/assets/{x-COYLzqlQ.js → x-hWBhjQHG.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-BRVtPtRz.js → xychartDiagram-S5SC5T6Z-Cn2wgEBS.js} +1 -1
- package/runtime/webapp/dist/index.html +2 -2
- package/runtime/.next/static/chunks/app/web/layout-60e82f81fa232177.js +0 -1
- package/runtime/.next/static/css/1c4153a5b834f93f.css +0 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cz9sh4ze.mjs +0 -40
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-nmrdrt5c.mjs +0 -52
- package/runtime/webapp/dist/assets/BrowserLivePanel-DDrnghqj.js +0 -76
- package/runtime/webapp/dist/assets/channel-8FdPmR58.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-CCHBpIvI.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-CCHBpIvI.js +0 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-b3DtWIlg.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CxL0Wh2Z.js +0 -8
- /package/runtime/.next/static/{nDZmrx61FQSBYCG7rH1JD → kTPKqrNQynnGgJq-2MSrk}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{nDZmrx61FQSBYCG7rH1JD → kTPKqrNQynnGgJq-2MSrk}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./page-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./page-BtJOUBkb.js","./smartphone-xdULmq7H.js","./x-hWBhjQHG.js","./artifact-links-CSP8FnHR.js","./trash-2-B8d7FxiV.js","./clipboard-CmAHVNMn.js","./CollaborationTabBridge-Dqnn1SXm.js","./RemoteDesktopTabBridge-Cp9mLtcY.js","./CollaborationPage-tTPizQue.js","./collaboration-B5mbAmrC.js","./collaboration-CXGccxVl.css","./loader-circle-CgeEpRSN.js","./CollaborationDashboard-cjhodfE8.js","./file-types-DT3kuLgW.js","./CollaborationDashboard-CCXC6JuQ.css","./RemoteDesktopPage-CRgO_MeY.js","./BrowserLivePanel-ua0SDLXi.js","./rotate-ccw-CGTxCXRR.js","./App-sT3zFETY.js","./FilePreview-cBO9eSzP.js","./FilePreview-Zls_kcY7.css","./send-B-6udpOE.js","./rotate-cw-BTUsFDVV.js","./FileTree-Dmi8qK5r.js","./App-CMOzoP5A.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function n(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(c){if(c.ep)return;c.ep=!0;const f=n(c);fetch(c.href,f)}})();const S3="modulepreload",I3=function(e,t){return new URL(e,t).href},oh={},yi=function(t,n,o){let c=Promise.resolve();if(n&&n.length>0){const g=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),w=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));c=Promise.allSettled(n.map(m=>{if(m=I3(m,o),m in oh)return;oh[m]=!0;const b=m.endsWith(".css"),y=b?'[rel="stylesheet"]':"";if(o)for(let T=g.length-1;T>=0;T--){const D=g[T];if(D.href===m&&(!b||D.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${y}`))return;const S=document.createElement("link");if(S.rel=b?"stylesheet":S3,b||(S.as="script"),S.crossOrigin="",S.href=m,w&&S.setAttribute("nonce",w),document.head.appendChild(S),b)return new Promise((T,D)=>{S.addEventListener("load",T),S.addEventListener("error",()=>D(Error(`Unable to preload CSS for ${m}`)))})}))}function f(g){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=g,window.dispatchEvent(x),!x.defaultPrevented)throw g}return c.then(g=>{for(const x of g||[])x.status==="rejected"&&f(x.reason);return t().catch(f)})};var xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E2={exports:{}},mc={},C2={exports:{}},Se={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -473,7 +473,7 @@ Error generating stack: `+f.message+`
|
|
|
473
473
|
`),r.append(`>>
|
|
474
474
|
`),r.toString()}setMode(r){this.mode=r}setECLevel(r){this.ecLevel=r}setVersion(r){this.version=r}setMaskPattern(r){this.maskPattern=r}setMatrix(r){this.matrix=r}static isValidMaskPattern(r){return r>=0&&r<hi.NUM_MASK_PATTERNS}}hi.NUM_MASK_PATTERNS=8;class je extends m{}je.kind="WriterException";class me{constructor(){}static clearMatrix(r){r.clear(255)}static buildMatrix(r,i,s,a,l){me.clearMatrix(l),me.embedBasicPatterns(s,l),me.embedTypeInfo(i,a,l),me.maybeEmbedVersionInfo(s,l),me.embedDataBits(r,a,l)}static embedBasicPatterns(r,i){me.embedPositionDetectionPatternsAndSeparators(i),me.embedDarkDotAtLeftBottomCorner(i),me.maybeEmbedPositionAdjustmentPatterns(r,i),me.embedTimingPatterns(i)}static embedTypeInfo(r,i,s){const a=new j;me.makeTypeInfoBits(r,i,a);for(let l=0,u=a.getSize();l<u;++l){const d=a.get(a.getSize()-1-l),h=me.TYPE_INFO_COORDINATES[l],p=h[0],v=h[1];if(s.setBoolean(p,v,d),l<8){const C=s.getWidth()-l-1;s.setBoolean(C,8,d)}else{const A=s.getHeight()-7+(l-8);s.setBoolean(8,A,d)}}}static maybeEmbedVersionInfo(r,i){if(r.getVersionNumber()<7)return;const s=new j;me.makeVersionInfoBits(r,s);let a=6*3-1;for(let l=0;l<6;++l)for(let u=0;u<3;++u){const d=s.get(a);a--,i.setBoolean(l,i.getHeight()-11+u,d),i.setBoolean(i.getHeight()-11+u,l,d)}}static embedDataBits(r,i,s){let a=0,l=-1,u=s.getWidth()-1,d=s.getHeight()-1;for(;u>0;){for(u===6&&(u-=1);d>=0&&d<s.getHeight();){for(let h=0;h<2;++h){const p=u-h;if(!me.isEmpty(s.get(p,d)))continue;let v;a<r.getSize()?(v=r.get(a),++a):v=!1,i!==255&&ot.getDataMaskBit(i,p,d)&&(v=!v),s.setBoolean(p,d,v)}d+=l}l=-l,d+=l,u-=2}if(a!==r.getSize())throw new je("Not all bits consumed: "+a+"/"+r.getSize())}static findMSBSet(r){return 32-O.numberOfLeadingZeros(r)}static calculateBCHCode(r,i){if(i===0)throw new y("0 polynomial");const s=me.findMSBSet(i);for(r<<=s-1;me.findMSBSet(r)>=s;)r^=i<<me.findMSBSet(r)-s;return r}static makeTypeInfoBits(r,i,s){if(!hi.isValidMaskPattern(i))throw new je("Invalid mask pattern");const a=r.getBits()<<3|i;s.appendBits(a,5);const l=me.calculateBCHCode(a,me.TYPE_INFO_POLY);s.appendBits(l,10);const u=new j;if(u.appendBits(me.TYPE_INFO_MASK_PATTERN,15),s.xor(u),s.getSize()!==15)throw new je("should not happen but we got: "+s.getSize())}static makeVersionInfoBits(r,i){i.appendBits(r.getVersionNumber(),6);const s=me.calculateBCHCode(r.getVersionNumber(),me.VERSION_INFO_POLY);if(i.appendBits(s,12),i.getSize()!==18)throw new je("should not happen but we got: "+i.getSize())}static isEmpty(r){return r===255}static embedTimingPatterns(r){for(let i=8;i<r.getWidth()-8;++i){const s=(i+1)%2;me.isEmpty(r.get(i,6))&&r.setNumber(i,6,s),me.isEmpty(r.get(6,i))&&r.setNumber(6,i,s)}}static embedDarkDotAtLeftBottomCorner(r){if(r.get(8,r.getHeight()-8)===0)throw new je;r.setNumber(8,r.getHeight()-8,1)}static embedHorizontalSeparationPattern(r,i,s){for(let a=0;a<8;++a){if(!me.isEmpty(s.get(r+a,i)))throw new je;s.setNumber(r+a,i,0)}}static embedVerticalSeparationPattern(r,i,s){for(let a=0;a<7;++a){if(!me.isEmpty(s.get(r,i+a)))throw new je;s.setNumber(r,i+a,0)}}static embedPositionAdjustmentPattern(r,i,s){for(let a=0;a<5;++a){const l=me.POSITION_ADJUSTMENT_PATTERN[a];for(let u=0;u<5;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPattern(r,i,s){for(let a=0;a<7;++a){const l=me.POSITION_DETECTION_PATTERN[a];for(let u=0;u<7;++u)s.setNumber(r+u,i+a,l[u])}}static embedPositionDetectionPatternsAndSeparators(r){const i=me.POSITION_DETECTION_PATTERN[0].length;me.embedPositionDetectionPattern(0,0,r),me.embedPositionDetectionPattern(r.getWidth()-i,0,r),me.embedPositionDetectionPattern(0,r.getWidth()-i,r);const s=8;me.embedHorizontalSeparationPattern(0,s-1,r),me.embedHorizontalSeparationPattern(r.getWidth()-s,s-1,r),me.embedHorizontalSeparationPattern(0,r.getWidth()-s,r);const a=7;me.embedVerticalSeparationPattern(a,0,r),me.embedVerticalSeparationPattern(r.getHeight()-a-1,0,r),me.embedVerticalSeparationPattern(a,r.getHeight()-a,r)}static maybeEmbedPositionAdjustmentPatterns(r,i){if(r.getVersionNumber()<2)return;const s=r.getVersionNumber()-1,a=me.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[s];for(let l=0,u=a.length;l!==u;l++){const d=a[l];if(d>=0)for(let h=0;h!==u;h++){const p=a[h];p>=0&&me.isEmpty(i.get(p,d))&&me.embedPositionAdjustmentPattern(p-2,d-2,i)}}}}me.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),me.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),me.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),me.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),me.VERSION_INFO_POLY=7973,me.TYPE_INFO_POLY=1335,me.TYPE_INFO_MASK_PATTERN=21522;class p3{constructor(r,i){this.dataBytes=r,this.errorCorrectionBytes=i}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Ge{constructor(){}static calculateMaskPenalty(r){return ot.applyMaskPenaltyRule1(r)+ot.applyMaskPenaltyRule2(r)+ot.applyMaskPenaltyRule3(r)+ot.applyMaskPenaltyRule4(r)}static encode(r,i,s=null){let a=Ge.DEFAULT_BYTE_MODE_ENCODING;const l=s!==null&&s.get(vt.CHARACTER_SET)!==void 0;l&&(a=s.get(vt.CHARACTER_SET).toString());const u=this.chooseMode(r,a),d=new j;if(u===ge.BYTE&&(l||Ge.DEFAULT_BYTE_MODE_ENCODING!==a)){const ee=H.getCharacterSetECIByName(a);ee!==void 0&&this.appendECI(ee,d)}this.appendModeInfo(u,d);const h=new j;this.appendBytes(r,u,h,a);let p;if(s!==null&&s.get(vt.QR_VERSION)!==void 0){const ee=Number.parseInt(s.get(vt.QR_VERSION).toString(),10);p=de.getVersionForNumber(ee);const Z=this.calculateBitsNeeded(u,d,h,p);if(!this.willFit(Z,p,i))throw new je("Data too big for requested version")}else p=this.recommendVersion(i,u,d,h);const v=new j;v.appendBitArray(d);const C=u===ge.BYTE?h.getSizeInBytes():r.length;this.appendLengthInfo(C,p,u,v),v.appendBitArray(h);const A=p.getECBlocksForLevel(i),_=p.getTotalCodewords()-A.getTotalECCodewords();this.terminateBits(_,v);const M=this.interleaveWithECBytes(v,p.getTotalCodewords(),_,A.getNumBlocks()),P=new hi;P.setECLevel(i),P.setMode(u),P.setVersion(p);const F=p.getDimensionForVersion(),G=new Aa(F,F),q=this.chooseMaskPattern(M,i,p,G);return P.setMaskPattern(q),me.buildMatrix(M,i,p,q,G),P.setMatrix(G),P}static recommendVersion(r,i,s,a){const l=this.calculateBitsNeeded(i,s,a,de.getVersionForNumber(1)),u=this.chooseVersion(l,r),d=this.calculateBitsNeeded(i,s,a,u);return this.chooseVersion(d,r)}static calculateBitsNeeded(r,i,s,a){return i.getSize()+r.getCharacterCountBits(a)+s.getSize()}static getAlphanumericCode(r){return r<Ge.ALPHANUMERIC_TABLE.length?Ge.ALPHANUMERIC_TABLE[r]:-1}static chooseMode(r,i=null){if(H.SJIS.getName()===i&&this.isOnlyDoubleByteKanji(r))return ge.KANJI;let s=!1,a=!1;for(let l=0,u=r.length;l<u;++l){const d=r.charAt(l);if(Ge.isDigit(d))s=!0;else if(this.getAlphanumericCode(d.charCodeAt(0))!==-1)a=!0;else return ge.BYTE}return a?ge.ALPHANUMERIC:s?ge.NUMERIC:ge.BYTE}static isOnlyDoubleByteKanji(r){let i;try{i=te.encode(r,H.SJIS)}catch{return!1}const s=i.length;if(s%2!==0)return!1;for(let a=0;a<s;a+=2){const l=i[a]&255;if((l<129||l>159)&&(l<224||l>235))return!1}return!0}static chooseMaskPattern(r,i,s,a){let l=Number.MAX_SAFE_INTEGER,u=-1;for(let d=0;d<hi.NUM_MASK_PATTERNS;d++){me.buildMatrix(r,i,s,d,a);let h=this.calculateMaskPenalty(a);h<l&&(l=h,u=d)}return u}static chooseVersion(r,i){for(let s=1;s<=40;s++){const a=de.getVersionForNumber(s);if(Ge.willFit(r,a,i))return a}throw new je("Data too big")}static willFit(r,i,s){const a=i.getTotalCodewords(),u=i.getECBlocksForLevel(s).getTotalECCodewords(),d=a-u,h=(r+7)/8;return d>=h}static terminateBits(r,i){const s=r*8;if(i.getSize()>s)throw new je("data bits cannot fit in the QR Code"+i.getSize()+" > "+s);for(let u=0;u<4&&i.getSize()<s;++u)i.appendBit(!1);const a=i.getSize()&7;if(a>0)for(let u=a;u<8;u++)i.appendBit(!1);const l=r-i.getSizeInBytes();for(let u=0;u<l;++u)i.appendBits(u&1?17:236,8);if(i.getSize()!==s)throw new je("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(r,i,s,a,l,u){if(a>=s)throw new je("Block ID too large");const d=r%s,h=s-d,p=Math.floor(r/s),v=p+1,C=Math.floor(i/s),A=C+1,_=p-C,M=v-A;if(_!==M)throw new je("EC bytes mismatch");if(s!==h+d)throw new je("RS blocks mismatch");if(r!==(C+_)*h+(A+M)*d)throw new je("Total bytes mismatch");a<h?(l[0]=C,u[0]=_):(l[0]=A,u[0]=M)}static interleaveWithECBytes(r,i,s,a){if(r.getSizeInBytes()!==s)throw new je("Number of bits and data bytes does not match");let l=0,u=0,d=0;const h=new Array;for(let v=0;v<a;++v){const C=new Int32Array(1),A=new Int32Array(1);Ge.getNumDataBytesAndNumECBytesForBlockID(i,s,a,v,C,A);const _=C[0],M=new Uint8Array(_);r.toBytes(8*l,M,0,_);const P=Ge.generateECBytes(M,A[0]);h.push(new p3(M,P)),u=Math.max(u,_),d=Math.max(d,P.length),l+=C[0]}if(s!==l)throw new je("Data bytes does not match offset");const p=new j;for(let v=0;v<u;++v)for(const C of h){const A=C.getDataBytes();v<A.length&&p.appendBits(A[v],8)}for(let v=0;v<d;++v)for(const C of h){const A=C.getErrorCorrectionBytes();v<A.length&&p.appendBits(A[v],8)}if(i!==p.getSizeInBytes())throw new je("Interleaving error: "+i+" and "+p.getSizeInBytes()+" differ.");return p}static generateECBytes(r,i){const s=r.length,a=new Int32Array(s+i);for(let u=0;u<s;u++)a[u]=r[u]&255;new hu(Ie.QR_CODE_FIELD_256).encode(a,i);const l=new Uint8Array(i);for(let u=0;u<i;u++)l[u]=a[s+u];return l}static appendModeInfo(r,i){i.appendBits(r.getBits(),4)}static appendLengthInfo(r,i,s,a){const l=s.getCharacterCountBits(i);if(r>=1<<l)throw new je(r+" is bigger than "+((1<<l)-1));a.appendBits(r,l)}static appendBytes(r,i,s,a){switch(i){case ge.NUMERIC:Ge.appendNumericBytes(r,s);break;case ge.ALPHANUMERIC:Ge.appendAlphanumericBytes(r,s);break;case ge.BYTE:Ge.append8BitBytes(r,s,a);break;case ge.KANJI:Ge.appendKanjiBytes(r,s);break;default:throw new je("Invalid mode: "+i)}}static getDigit(r){return r.charCodeAt(0)-48}static isDigit(r){const i=Ge.getDigit(r);return i>=0&&i<=9}static appendNumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=Ge.getDigit(r.charAt(a));if(a+2<s){const u=Ge.getDigit(r.charAt(a+1)),d=Ge.getDigit(r.charAt(a+2));i.appendBits(l*100+u*10+d,10),a+=3}else if(a+1<s){const u=Ge.getDigit(r.charAt(a+1));i.appendBits(l*10+u,7),a+=2}else i.appendBits(l,4),a++}}static appendAlphanumericBytes(r,i){const s=r.length;let a=0;for(;a<s;){const l=Ge.getAlphanumericCode(r.charCodeAt(a));if(l===-1)throw new je;if(a+1<s){const u=Ge.getAlphanumericCode(r.charCodeAt(a+1));if(u===-1)throw new je;i.appendBits(l*45+u,11),a+=2}else i.appendBits(l,6),a++}}static append8BitBytes(r,i,s){let a;try{a=te.encode(r,s)}catch(l){throw new je(l)}for(let l=0,u=a.length;l!==u;l++){const d=a[l];i.appendBits(d,8)}}static appendKanjiBytes(r,i){let s;try{s=te.encode(r,H.SJIS)}catch(l){throw new je(l)}const a=s.length;for(let l=0;l<a;l+=2){const u=s[l]&255,d=s[l+1]&255,h=u<<8&4294967295|d;let p=-1;if(h>=33088&&h<=40956?p=h-33088:h>=57408&&h<=60351&&(p=h-49472),p===-1)throw new je("Invalid byte sequence");const v=(p>>8)*192+(p&255);i.appendBits(v,13)}}static appendECI(r,i){i.appendBits(ge.ECI.getBits(),4),i.appendBits(r.getValue(),8)}}Ge.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Ge.DEFAULT_BYTE_MODE_ENCODING=H.UTF8.getName();class gi{write(r,i,s,a=null){if(r.length===0)throw new y("Found empty contents");if(i<0||s<0)throw new y("Requested dimensions are too small: "+i+"x"+s);let l=Ve.L,u=gi.QUIET_ZONE_SIZE;a!==null&&(a.get(vt.ERROR_CORRECTION)!==void 0&&(l=Ve.fromString(a.get(vt.ERROR_CORRECTION).toString())),a.get(vt.MARGIN)!==void 0&&(u=Number.parseInt(a.get(vt.MARGIN).toString(),10)));const d=Ge.encode(r,l,a);return this.renderResult(d,i,s,u)}writeToDom(r,i,s,a,l=null){typeof r=="string"&&(r=document.querySelector(r));const u=this.write(i,s,a,l);r&&r.appendChild(u)}renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Kr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,v=Math.max(i,h),C=Math.max(s,p),A=Math.min(Math.floor(v/h),Math.floor(C/p)),_=Math.floor((v-u*A)/2),M=Math.floor((C-d*A)/2),P=this.createSVGElement(v,C);for(let F=0,G=M;F<d;F++,G+=A)for(let q=0,ee=_;q<u;q++,ee+=A)if(l.get(q,F)===1){const Z=this.createSvgRectElement(ee,G,A,A);P.appendChild(Z)}return P}createSVGElement(r,i){const s=document.createElementNS(gi.SVG_NS,"svg");return s.setAttributeNS(null,"height",r.toString()),s.setAttributeNS(null,"width",i.toString()),s}createSvgRectElement(r,i,s,a){const l=document.createElementNS(gi.SVG_NS,"rect");return l.setAttributeNS(null,"x",r.toString()),l.setAttributeNS(null,"y",i.toString()),l.setAttributeNS(null,"height",s.toString()),l.setAttributeNS(null,"width",a.toString()),l.setAttributeNS(null,"fill","#000000"),l}}gi.QUIET_ZONE_SIZE=4,gi.SVG_NS="http://www.w3.org/2000/svg";class Vi{encode(r,i,s,a,l){if(r.length===0)throw new y("Found empty contents");if(i!==ce.QR_CODE)throw new y("Can only encode QR_CODE, but got "+i);if(s<0||a<0)throw new y(`Requested dimensions are too small: ${s}x${a}`);let u=Ve.L,d=Vi.QUIET_ZONE_SIZE;l!==null&&(l.get(vt.ERROR_CORRECTION)!==void 0&&(u=Ve.fromString(l.get(vt.ERROR_CORRECTION).toString())),l.get(vt.MARGIN)!==void 0&&(d=Number.parseInt(l.get(vt.MARGIN).toString(),10)));const h=Ge.encode(r,u,l);return Vi.renderResult(h,s,a,d)}static renderResult(r,i,s,a){const l=r.getMatrix();if(l===null)throw new Kr;const u=l.getWidth(),d=l.getHeight(),h=u+a*2,p=d+a*2,v=Math.max(i,h),C=Math.max(s,p),A=Math.min(Math.floor(v/h),Math.floor(C/p)),_=Math.floor((v-u*A)/2),M=Math.floor((C-d*A)/2),P=new he(v,C);for(let F=0,G=M;F<d;F++,G+=A)for(let q=0,ee=_;q<u;q++,ee+=A)l.get(q,F)===1&&P.setRegion(ee,G,A,A);return P}}Vi.QUIET_ZONE_SIZE=4;class m3{encode(r,i,s,a,l){let u;switch(i){case ce.QR_CODE:u=new Vi;break;default:throw new y("No encoder available for format "+i)}return u.encode(r,i,s,a,l)}}class Jr extends ie{constructor(r,i,s,a,l,u,d,h){if(super(u,d),this.yuvData=r,this.dataWidth=i,this.dataHeight=s,this.left=a,this.top=l,a+u>i||l+d>s)throw new y("Crop rectangle does not fit within image data.");h&&this.reverseHorizontal(u,d)}getRow(r,i){if(r<0||r>=this.getHeight())throw new y("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return k.arraycopy(this.yuvData,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.yuvData;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return k.arraycopy(this.yuvData,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;k.arraycopy(this.yuvData,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new Jr(this.yuvData,this.dataWidth,this.dataHeight,this.left+r,this.top+i,s,a,!1)}renderThumbnail(){const r=this.getWidth()/Jr.THUMBNAIL_SCALE_FACTOR,i=this.getHeight()/Jr.THUMBNAIL_SCALE_FACTOR,s=new Int32Array(r*i),a=this.yuvData;let l=this.top*this.dataWidth+this.left;for(let u=0;u<i;u++){const d=u*r;for(let h=0;h<r;h++){const p=a[l+h*Jr.THUMBNAIL_SCALE_FACTOR]&255;s[d+h]=4278190080|p*65793}l+=this.dataWidth*Jr.THUMBNAIL_SCALE_FACTOR}return s}getThumbnailWidth(){return this.getWidth()/Jr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Jr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(r,i){const s=this.yuvData;for(let a=0,l=this.top*this.dataWidth+this.left;a<i;a++,l+=this.dataWidth){const u=l+r/2;for(let d=l,h=l+r-1;d<u;d++,h--){const p=s[d];s[d]=s[h],s[h]=p}}}invert(){return new fe(this)}}Jr.THUMBNAIL_SCALE_FACTOR=2;class gu extends ie{constructor(r,i,s,a,l,u,d){if(super(i,s),this.dataWidth=a,this.dataHeight=l,this.left=u,this.top=d,r.BYTES_PER_ELEMENT===4){const h=i*s,p=new Uint8ClampedArray(h);for(let v=0;v<h;v++){const C=r[v],A=C>>16&255,_=C>>7&510,M=C&255;p[v]=(A+_+M)/4&255}this.luminances=p}else this.luminances=r;if(a===void 0&&(this.dataWidth=i),l===void 0&&(this.dataHeight=s),u===void 0&&(this.left=0),d===void 0&&(this.top=0),this.left+i>this.dataWidth||this.top+s>this.dataHeight)throw new y("Crop rectangle does not fit within image data.")}getRow(r,i){if(r<0||r>=this.getHeight())throw new y("Requested row is outside the image: "+r);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(r+this.top)*this.dataWidth+this.left;return k.arraycopy(this.luminances,a,i,0,s),i}getMatrix(){const r=this.getWidth(),i=this.getHeight();if(r===this.dataWidth&&i===this.dataHeight)return this.luminances;const s=r*i,a=new Uint8ClampedArray(s);let l=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return k.arraycopy(this.luminances,l,a,0,s),a;for(let u=0;u<i;u++){const d=u*r;k.arraycopy(this.luminances,l,a,d,r),l+=this.dataWidth}return a}isCropSupported(){return!0}crop(r,i,s,a){return new gu(this.luminances,s,a,this.dataWidth,this.dataHeight,this.left+r,this.top+i)}invert(){return new fe(this)}}class th extends H{static forName(r){return this.getCharacterSetECIByName(r)}}class pu{}pu.ISO_8859_1=H.ISO8859_1;class rh{isCompact(){return this.compact}setCompact(r){this.compact=r}getSize(){return this.size}setSize(r){this.size=r}getLayers(){return this.layers}setLayers(r){this.layers=r}getCodeWords(){return this.codeWords}setCodeWords(r){this.codeWords=r}getMatrix(){return this.matrix}setMatrix(r){this.matrix=r}}class nh{static singletonList(r){return[r]}static min(r,i){return r.sort(i)[0]}}class x3{constructor(r){this.previous=r}getPrevious(){return this.previous}}class Hi extends x3{constructor(r,i,s){super(r),this.value=i,this.bitCount=s}appendTo(r,i){r.appendBits(this.value,this.bitCount)}add(r,i){return new Hi(this,r,i)}addBinaryShift(r,i){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Hi(this,r,i)}toString(){let r=this.value&(1<<this.bitCount)-1;return r|=1<<this.bitCount,"<"+O.toBinaryString(r|1<<this.bitCount).substring(1)+">"}}class mu extends Hi{constructor(r,i,s){super(r,0,0),this.binaryShiftStart=i,this.binaryShiftByteCount=s}appendTo(r,i){for(let s=0;s<this.binaryShiftByteCount;s++)(s===0||s===31&&this.binaryShiftByteCount<=62)&&(r.appendBits(31,5),this.binaryShiftByteCount>62?r.appendBits(this.binaryShiftByteCount-31,16):s===0?r.appendBits(Math.min(this.binaryShiftByteCount,31),5):r.appendBits(this.binaryShiftByteCount-31,5)),r.appendBits(i[this.binaryShiftStart+s],8)}addBinaryShift(r,i){return new mu(this,r,i)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function w3(E,r,i){return new mu(E,r,i)}function Xs(E,r,i){return new Hi(E,r,i)}const v3=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Fn=0,Sa=1,Sr=2,ih=3,en=4,y3=new Hi(null,0,0),xu=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function E3(E){for(let r of E)I.fill(r,-1);return E[Fn][en]=0,E[Sa][en]=0,E[Sa][Fn]=28,E[ih][en]=0,E[Sr][en]=0,E[Sr][Fn]=15,E}const sh=E3(I.createInt32Array(6,6));class tn{constructor(r,i,s,a){this.token=r,this.mode=i,this.binaryShiftByteCount=s,this.bitCount=a}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(r,i){let s=this.bitCount,a=this.token;if(r!==this.mode){let u=xu[this.mode][r];a=Xs(a,u&65535,u>>16),s+=u>>16}let l=r===Sr?4:5;return a=Xs(a,i,l),new tn(a,r,0,s+l)}shiftAndAppend(r,i){let s=this.token,a=this.mode===Sr?4:5;return s=Xs(s,sh[this.mode][r],a),s=Xs(s,i,5),new tn(s,this.mode,0,this.bitCount+a+5)}addBinaryShiftChar(r){let i=this.token,s=this.mode,a=this.bitCount;if(this.mode===en||this.mode===Sr){let d=xu[s][Fn];i=Xs(i,d&65535,d>>16),a+=d>>16,s=Fn}let l=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,u=new tn(i,s,this.binaryShiftByteCount+1,a+l);return u.binaryShiftByteCount===2078&&(u=u.endBinaryShift(r+1)),u}endBinaryShift(r){if(this.binaryShiftByteCount===0)return this;let i=this.token;return i=w3(i,r-this.binaryShiftByteCount,this.binaryShiftByteCount),new tn(i,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(r){let i=this.bitCount+(xu[this.mode][r.mode]>>16);return this.binaryShiftByteCount<r.binaryShiftByteCount?i+=tn.calculateBinaryShiftCost(r)-tn.calculateBinaryShiftCost(this):this.binaryShiftByteCount>r.binaryShiftByteCount&&r.binaryShiftByteCount>0&&(i+=10),i<=r.bitCount}toBitArray(r){let i=[];for(let a=this.endBinaryShift(r.length).token;a!==null;a=a.getPrevious())i.unshift(a);let s=new j;for(const a of i)a.appendTo(s,r);return s}toString(){return J.format("%s bits=%d bytes=%d",v3[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(r){return r.binaryShiftByteCount>62?21:r.binaryShiftByteCount>31?20:r.binaryShiftByteCount>0?10:0}}tn.INITIAL_STATE=new tn(y3,Fn,0,0);function C3(E){const r=J.getCharCode(" "),i=J.getCharCode("."),s=J.getCharCode(",");E[Fn][r]=1;const a=J.getCharCode("Z"),l=J.getCharCode("A");for(let A=l;A<=a;A++)E[Fn][A]=A-l+2;E[Sa][r]=1;const u=J.getCharCode("z"),d=J.getCharCode("a");for(let A=d;A<=u;A++)E[Sa][A]=A-d+2;E[Sr][r]=1;const h=J.getCharCode("9"),p=J.getCharCode("0");for(let A=p;A<=h;A++)E[Sr][A]=A-p+2;E[Sr][s]=12,E[Sr][i]=13;const v=["\0"," ","","","","","","","\x07","\b"," ",`
|
|
475
475
|
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let A=0;A<v.length;A++)E[ih][J.getCharCode(v[A])]=A;const C=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let A=0;A<C.length;A++)J.getCharCode(C[A])>0&&(E[en][J.getCharCode(C[A])]=A);return E}const wu=C3(I.createInt32Array(5,256));class Ys{constructor(r){this.text=r}encode(){const r=J.getCharCode(" "),i=J.getCharCode(`
|
|
476
|
-
`);let s=nh.singletonList(tn.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case J.getCharCode("\r"):u=d===i?2:0;break;case J.getCharCode("."):u=d===r?3:0;break;case J.getCharCode(","):u=d===r?4:0;break;case J.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Ys.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return nh.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Ys.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=wu[r.getMode()][a]>0,u=null;for(let d=0;d<=en;d++){let h=wu[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&sh[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||wu[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(en,s)),r.getMode()!==en&&a.push(l.shiftAndAppend(en,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class Oe{constructor(){}static encodeBytes(r){return Oe.encode(r,Oe.DEFAULT_EC_PERCENT,Oe.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Ys(r).encode(),l=O.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,v,C;if(s!==Oe.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?Oe.MAX_NB_BITS_COMPACT:Oe.MAX_NB_BITS))throw new y(J.format("Illegal value %s for layers",s));p=Oe.totalBitsInLayer(h,d),v=Oe.WORD_SIZE[h];let Z=p-p%v;if(C=Oe.stuffBits(a,v),C.getSize()+l>Z)throw new y("Data to large for user specified layer");if(d&&C.getSize()>v*64)throw new y("Data to large for user specified layer")}else{v=0,C=null;for(let Z=0;;Z++){if(Z>Oe.MAX_NB_BITS)throw new y("Data too large for an Aztec code");if(d=Z<=3,h=d?Z+1:Z,p=Oe.totalBitsInLayer(h,d),u>p)continue;(C==null||v!==Oe.WORD_SIZE[h])&&(v=Oe.WORD_SIZE[h],C=Oe.stuffBits(a,v));let Te=p-p%v;if(!(d&&C.getSize()>v*64)&&C.getSize()+l<=Te)break}}let A=Oe.generateCheckWords(C,p,v),_=C.getSize()/v,M=Oe.generateModeMessage(d,h,_),P=(d?11:14)+h*4,F=new Int32Array(P),G;if(d){G=P;for(let Z=0;Z<F.length;Z++)F[Z]=Z}else{G=P+1+2*O.truncDivision(O.truncDivision(P,2)-1,15);let Z=O.truncDivision(P,2),Te=O.truncDivision(G,2);for(let ye=0;ye<Z;ye++){let rr=ye+O.truncDivision(ye,15);F[Z-ye-1]=Te-rr-1,F[Z+ye]=Te+rr+1}}let q=new he(G);for(let Z=0,Te=0;Z<h;Z++){let ye=(h-Z)*4+(d?9:12);for(let rr=0;rr<ye;rr++){let Br=rr*2;for(let nr=0;nr<2;nr++)A.get(Te+Br+nr)&&q.set(F[Z*2+nr],F[Z*2+rr]),A.get(Te+ye*2+Br+nr)&&q.set(F[Z*2+rr],F[P-1-Z*2-nr]),A.get(Te+ye*4+Br+nr)&&q.set(F[P-1-Z*2-nr],F[P-1-Z*2-rr]),A.get(Te+ye*6+Br+nr)&&q.set(F[P-1-Z*2-rr],F[Z*2+nr])}Te+=ye*8}if(Oe.drawModeMessage(q,d,G,M),d)Oe.drawBullsEye(q,O.truncDivision(G,2),5);else{Oe.drawBullsEye(q,O.truncDivision(G,2),7);for(let Z=0,Te=0;Z<O.truncDivision(P,2)-1;Z+=15,Te+=16)for(let ye=O.truncDivision(G,2)&1;ye<G;ye+=2)q.set(O.truncDivision(G,2)-Te,ye),q.set(O.truncDivision(G,2)+Te,ye),q.set(ye,O.truncDivision(G,2)-Te),q.set(ye,O.truncDivision(G,2)+Te)}let ee=new rh;return ee.setCompact(d),ee.setSize(G),ee.setLayers(h),ee.setCodeWords(_),ee.setMatrix(q),ee}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new j;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=Oe.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=Oe.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=O.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+O.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new hu(Oe.getGF(s)),u=O.truncDivision(i,s),d=Oe.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new j;p.appendBits(0,h);for(const v of Array.from(d))p.appendBits(v,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Ie.AZTEC_PARAM;case 6:return Ie.AZTEC_DATA_6;case 8:return Ie.AZTEC_DATA_8;case 10:return Ie.AZTEC_DATA_10;case 12:return Ie.AZTEC_DATA_12;default:throw new y("Unsupported word size "+r)}}static stuffBits(r,i){let s=new j,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}Oe.DEFAULT_EC_PERCENT=33,Oe.DEFAULT_AZTEC_LAYERS=0,Oe.MAX_NB_BITS=32,Oe.MAX_NB_BITS_COMPACT=4,Oe.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Ia{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=pu.ISO_8859_1,d=Oe.DEFAULT_EC_PERCENT,h=Oe.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(vt.CHARACTER_SET)&&(u=th.forName(l.get(vt.CHARACTER_SET).toString())),l.has(vt.ERROR_CORRECTION)&&(d=O.parseInt(l.get(vt.ERROR_CORRECTION).toString())),l.has(vt.AZTEC_LAYERS)&&(h=O.parseInt(l.get(vt.AZTEC_LAYERS).toString()))),Ia.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==ce.AZTEC)throw new y("Can only encode AZTEC, but got "+i);let h=Oe.encode(J.getBytes(r,l),u,d);return Ia.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Kr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),v=(d-l*p)/2,C=(h-u*p)/2,A=new he(d,h);for(let _=0,M=C;_<u;_++,M+=p)for(let P=0,F=v;P<l;P++,F+=p)a.get(P,_)&&A.setRegion(F,M,p,p);return A}}n.AbstractExpandedDecoder=nu,n.ArgumentException=b,n.ArithmeticException=Dr,n.AztecCode=rh,n.AztecCodeReader=xa,n.AztecCodeWriter=Ia,n.AztecDecoder=$e,n.AztecDetector=z0,n.AztecDetectorResult=j0,n.AztecEncoder=Oe,n.AztecHighLevelEncoder=Ys,n.AztecPoint=Ht,n.BarcodeFormat=ce,n.Binarizer=D,n.BinaryBitmap=S,n.BitArray=j,n.BitMatrix=he,n.BitSource=au,n.BrowserAztecCodeReader=Yv,n.BrowserBarcodeReader=Jv,n.BrowserCodeReader=qt,n.BrowserDatamatrixCodeReader=t3,n.BrowserMultiFormatReader=d3,n.BrowserPDF417Reader=h3,n.BrowserQRCodeReader=g3,n.BrowserQRCodeSvgWriter=gi,n.CharacterSetECI=H,n.ChecksumException=T,n.Code128Reader=re,n.Code39Reader=xt,n.DataMatrixDecodedBitStreamParser=Mn,n.DataMatrixReader=Pn,n.DecodeHintType=W,n.DecoderResult=On,n.DefaultGridSampler=W0,n.DetectorResult=ma,n.EAN13Reader=ci,n.EncodeHintType=vt,n.Exception=m,n.FormatException=L,n.GenericGF=Ie,n.GenericGFPoly=_t,n.GlobalHistogramBinarizer=ke,n.GridSampler=Jc,n.GridSamplerInstance=kn,n.HTMLCanvasElementLuminanceSource=we,n.HybridBinarizer=xe,n.ITFReader=Ue,n.IllegalArgumentException=y,n.IllegalStateException=Kr,n.InvertedLuminanceSource=fe,n.LuminanceSource=ie,n.MathUtils=_e,n.MultiFormatOneDReader=zi,n.MultiFormatReader=eh,n.MultiFormatWriter=m3,n.NotFoundException=$,n.OneDReader=gt,n.PDF417DecodedBitStreamParser=V,n.PDF417DecoderErrorCorrection=Y0,n.PDF417Reader=kt,n.PDF417ResultMetadata=Z0,n.PerspectiveTransform=Mr,n.PlanarYUVLuminanceSource=Jr,n.QRCodeByteMatrix=Aa,n.QRCodeDataMask=br,n.QRCodeDecodedBitStreamParser=Je,n.QRCodeDecoderErrorCorrectionLevel=Ve,n.QRCodeDecoderFormatInformation=jt,n.QRCodeEncoder=Ge,n.QRCodeEncoderQRCode=hi,n.QRCodeMaskUtil=ot,n.QRCodeMatrixUtil=me,n.QRCodeMode=ge,n.QRCodeReader=Bn,n.QRCodeVersion=de,n.QRCodeWriter=Vi,n.RGBLuminanceSource=gu,n.RSS14Reader=st,n.RSSExpandedReader=K,n.ReaderException=ba,n.ReedSolomonDecoder=Us,n.ReedSolomonEncoder=hu,n.ReedSolomonException=Fi,n.Result=ze,n.ResultMetadataType=qe,n.ResultPoint=ue,n.StringUtils=J,n.UnsupportedOperationException=se,n.VideoInputDevice=De,n.WhiteRectangleDetector=dn,n.WriterException=je,n.ZXingArrays=I,n.ZXingCharset=th,n.ZXingInteger=O,n.ZXingStandardCharsets=pu,n.ZXingStringBuilder=ne,n.ZXingStringEncoding=te,n.ZXingSystem=k,n.createAbstractExpandedDecoder=G0,Object.defineProperty(n,"__esModule",{value:!0})})})(X1,X1.exports);var et=X1.exports;const uR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var r2=function(){function e(t,n,o){if(this.formatMap=new Map([[oe.QR_CODE,et.BarcodeFormat.QR_CODE],[oe.AZTEC,et.BarcodeFormat.AZTEC],[oe.CODABAR,et.BarcodeFormat.CODABAR],[oe.CODE_39,et.BarcodeFormat.CODE_39],[oe.CODE_93,et.BarcodeFormat.CODE_93],[oe.CODE_128,et.BarcodeFormat.CODE_128],[oe.DATA_MATRIX,et.BarcodeFormat.DATA_MATRIX],[oe.MAXICODE,et.BarcodeFormat.MAXICODE],[oe.ITF,et.BarcodeFormat.ITF],[oe.EAN_13,et.BarcodeFormat.EAN_13],[oe.EAN_8,et.BarcodeFormat.EAN_8],[oe.PDF_417,et.BarcodeFormat.PDF_417],[oe.RSS_14,et.BarcodeFormat.RSS_14],[oe.RSS_EXPANDED,et.BarcodeFormat.RSS_EXPANDED],[oe.UPC_A,et.BarcodeFormat.UPC_A],[oe.UPC_E,et.BarcodeFormat.UPC_E],[oe.UPC_EAN_EXTENSION,et.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!uR)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(et.DecodeHintType.POSSIBLE_FORMATS,c),f.set(et.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new et.MultiFormatReader(this.verbose,this.hints),o=new et.HTMLCanvasElementLuminanceSource(t),c=new et.BinaryBitmap(new et.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:Fv.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),fR=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},n2=function(){function e(t,n,o){if(this.formatMap=new Map([[oe.QR_CODE,"qr_code"],[oe.AZTEC,"aztec"],[oe.CODABAR,"codabar"],[oe.CODE_39,"code_39"],[oe.CODE_93,"code_93"],[oe.CODE_128,"code_128"],[oe.DATA_MATRIX,"data_matrix"],[oe.ITF,"itf"],[oe.EAN_13,"ean_13"],[oe.EAN_8,"ean_8"],[oe.PDF_417,"pdf417"],[oe.UPC_A,"upc_a"],[oe.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return fR(this,void 0,void 0,function(){var n,o;return dR(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:Fv.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],x=g.boundingBox.width*g.boundingBox.height;x>o&&(o=x,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),i2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},s2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},hR=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&n2.isSupported()?(this.primaryDecoder=new n2(t,o,c),this.secondaryDecoder=new r2(t,o,c)):this.primaryDecoder=new r2(t,o,c)}return e.prototype.decodeAsync=function(t){return i2(this,void 0,void 0,function(){var n;return s2(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return i2(this,void 0,void 0,function(){var n,o;return s2(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),F0=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fc=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dc=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},jv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),gR=function(e){F0(t,e);function t(n,o){return e.call(this,n,o)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(jv),pR=function(e){F0(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(gR),mR=function(e){F0(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(jv),xR=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new pR(this.track)},e.prototype.torchFeature=function(){return new mR(this.track)},e}(),wR=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return fc(this,void 0,void 0,function(){var f,g;return dc(this,function(x){switch(x.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:x.sent(),x.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return fc(this,void 0,void 0,function(){return dc(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(x){t.mediaStream.removeTrack(x),x.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new xR(this.getFirstTrackOrFail())},e}(),vR=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return fc(this,void 0,void 0,function(){return dc(this,function(c){return[2,wR.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return fc(this,void 0,void 0,function(){var n,o;return dc(this,function(c){switch(c.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return o=c.sent(),[2,new e(o)]}})})},e}(),o2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},a2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},yR=function(){function e(){}return e.failIfNotSupported=function(){return o2(this,void 0,void 0,function(){return a2(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return o2(this,void 0,void 0,function(){return a2(this,function(n){return[2,vR.create(t)]})})},e}(),ER=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},CR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},bR=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=ds.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=ds.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return ER(this,void 0,void 0,function(){var t,n,o,c,f,g,x;return CR(this,function(w){switch(w.label){case 0:return t=function(m){for(var b=m.getVideoTracks(),y=0,S=b;y<S.length;y++){var T=S[y];T.enabled=!1,T.stop(),m.removeTrack(T)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=w.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=w.sent(),c=[],f=0,g=o;f<g.length;f++)x=g[f],x.kind==="videoinput"&&c.push({id:x.deviceId,label:x.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],x=0,w=f;x<w.length;x++){var m=w[x];m.kind==="video"&&g.push({id:m.id,label:m.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),at;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(at||(at={}));var AR=function(){function e(){this.state=at.NOT_STARTED,this.onGoingTransactionNewState=at.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===at.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=at.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===at.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=at.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==at.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case at.UNKNOWN:throw"Transition from unknown is not allowed";case at.NOT_STARTED:this.failIfNewStateIs(t,[at.PAUSED]);break;case at.SCANNING:break;case at.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),SR=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===at.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==at.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===at.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===at.PAUSED},e}(),IR=function(){function e(){}return e.create=function(){return new SR(new AR)},e}(),TR=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),hr=function(e){TR(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(aR),RR=function(){function e(t,n){this.logger=n,this.fps=hr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=hr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Uv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!hn(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),f_=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new cR(this.verbose),this.qrcode=new hR(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=IR.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var x=RR.create(n,this.logger);this.clearElement();var w=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?w=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=w,b=document.getElementById(this.elementId);b.clientWidth?b.clientWidth:hr.DEFAULT_WIDTH,b.style.position="relative",this.shouldScan=!0,this.element=b;var y=this,S=this.stateManagerProxy.startTransition(at.SCANNING);return new Promise(function(T,D){var k=m?x.videoConstraints:y.createVideoConstraints(t);if(!k){S.cancel(),D("videoConstraints should be defined");return}var Y={};(!m||x.aspectRatio)&&(Y.aspectRatio=x.aspectRatio);var N={onRenderSurfaceReady:function(I,O){y.setupUi(I,O,x),y.isScanning=!0,y.foreverScan(x,o,g)}};yR.failIfNotSupported().then(function(I){I.create(k).then(function(O){return O.render(f.element,Y,N).then(function(j){y.renderedCamera=j,S.execute(),T(null)}).catch(function(j){S.cancel(),D(j)})}).catch(function(O){S.cancel(),D(ds.errorGettingUserMedia(O))})}).catch(function(I){S.cancel(),D(ds.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(at.PAUSED),this.showPausedState(),(hn(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(at.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(at.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(hr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(hn(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var x=g.width,w=g.height,m=document.getElementById(o.elementId),b=m.clientWidth?m.clientWidth:hr.DEFAULT_WIDTH,y=Math.max(m.clientHeight?m.clientHeight:w,hr.FILE_SCAN_MIN_HEIGHT),S=o.computeCanvasDrawConfig(x,w,b,y);if(n){var T=o.createCanvasElement(b,y,"qr-canvas-visible");T.style.display="inline-block",m.appendChild(T);var D=T.getContext("2d");if(!D)throw"Unable to get 2d context from canvas";D.canvas.width=b,D.canvas.height=y,D.drawImage(g,0,0,x,w,S.x,S.y,S.width,S.height)}var k=hr.FILE_SCAN_HIDDEN_CANVAS_PADDING,Y=Math.max(g.width,S.width),N=Math.max(g.height,S.height),I=Y+2*k,O=N+2*k,j=o.createCanvasElement(I,O);m.appendChild(j);var z=j.getContext("2d");if(!z)throw"Unable to get 2d context from canvas";z.canvas.width=I,z.canvas.height=O,z.drawImage(g,0,0,x,w,k,k,Y,N);try{o.qrcode.decodeRobustlyAsync(j).then(function(W){c(t2.createFromQrcodeResult(W))}).catch(f)}catch(W){f("QR code parse error, error = ".concat(W))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return bR.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!Uv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[oe.QR_CODE,oe.AZTEC,oe.CODABAR,oe.CODE_39,oe.CODE_93,oe.CODE_128,oe.DATA_MATRIX,oe.MAXICODE,oe.ITF,oe.EAN_13,oe.EAN_8,oe.PDF_417,oe.RSS_14,oe.RSS_EXPANDED,oe.UPC_A,oe.UPC_E,oe.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];oR(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(hn(t))return!0;if(!hn(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(hn(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return hn(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),x=function(m){if(m<hr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(hr.MIN_QR_BOX_SIZE,"px.")},w=function(m){return m>t&&(c.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),m=t),m};x(g.width),x(g.height),g.width=w(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=hn(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,x={x:0,y:0,width:t,height:n},w=g?this.getShadedRegionBounds(t,n,f):x,m=this.createCanvasElement(w.width,w.height),b={willReadFrequently:!0},y=m.getContext("2d",b);y.canvas.width=w.width,y.canvas.height=w.height,this.element.append(m),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=w,this.context=y,this.canvasElement=m},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=ds.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,t2.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=ds.codeParseError(c);return n(f,lR.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,x=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var w=this.qrRegion.width*g,m=this.qrRegion.height*x,b=this.qrRegion.x*g,y=this.qrRegion.y*x;this.context.drawImage(f,b,y,w,m,0,0,this.qrRegion.width,this.qrRegion.height);var S=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(T){!T&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){S()})):S()}).catch(function(T){c.logger.logError("Error happend while scanning context",T),S()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(D){if(D in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(D,"'")},x=Object.keys(t);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var w=Object.keys(t)[0];if(w!==n&&w!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(w===n){var m=t.facingMode;if(typeof m=="string"){if(g(m))return{facingMode:m}}else if(typeof m=="object")if(f in m){if(g(m["".concat(f)]))return{facingMode:{exact:m["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var b=typeof m;throw"Invalid type of 'facingMode' = ".concat(b)}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(f in y)return{deviceId:{exact:y["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var S=typeof y;throw"Invalid type of 'deviceId' = ".concat(S)}}}var T=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(T)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var x=t,w=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(w)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?hr.BORDER_SHADER_MATCH_COLOR:hr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=hn(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,x=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(hr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var w=5,m=40;this.insertShaderBorders(f,m,w,-w,null,0,!0),this.insertShaderBorders(f,m,w,-w,null,0,!1),this.insertShaderBorders(f,m,w,null,-w,0,!0),this.insertShaderBorders(f,m,w,null,-w,0,!1),this.insertShaderBorders(f,w,m+w,-w,null,-w,!0),this.insertShaderBorders(f,w,m+w,null,-w,-w,!0),this.insertShaderBorders(f,w,m+w,-w,null,-w,!1),this.insertShaderBorders(f,w,m+w,null,-w,-w,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,x){var w=document.createElement("div");w.style.position="absolute",w.style.backgroundColor=hr.BORDER_SHADER_DEFAULT_COLOR,w.style.width="".concat(n,"px"),w.style.height="".concat(o,"px"),c!==null&&(w.style.top="".concat(c,"px")),f!==null&&(w.style.bottom="".concat(f,"px")),x?w.style.left="".concat(g,"px"):w.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(w),t.appendChild(w)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),l2;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(l2||(l2={}));var Y1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(Y1||(Y1={}));var K1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(K1||(K1={}));var Z1;(function(e){e[e.ALL=17]="ALL"})(Z1||(Z1={}));const _R=Object.assign(Object.assign({},oe),Z1);var c2;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(c2||(c2={}));const OR=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function NR(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const kR=ga("CapacitorBarcodeScanner",{web:()=>(NR(OR),yi(()=>import("./web-CT9Joona.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class DR{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||Y1.BACK,t.scanOrientation=t.scanOrientation||K1.ADAPTIVE,kR.scanBarcode(t)}}const Nf=ga("SecureStoragePlugin",{web:()=>yi(()=>import("./web-BVybOQy8.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function MR(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=un.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=un.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class Wv{ready(){if(!Ds.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await Nf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await Nf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await Nf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function zv(){if(!Ds.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await DR.scanBarcode({hint:_R.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class $v{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,x=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),w=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&x.origin===g.origin&&w.set("authorization",`Bearer ${g.token}`);const m=await this.transport(c,{...f,headers:w,credentials:"omit",redirect:"error"});if(g&&this.session===g&&x.origin===g.origin&&(m.status===401||m.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return m}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=MR(t),c=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:AbortSignal.timeout(1e4)});if(!c.ok)throw new Error(c.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":c.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。");const f=await c.json();if(typeof f.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(f.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,f.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${f.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:f.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}function Vv(e,t,n,o){const c=new URL(t);return(f,g)=>{const x=typeof f=="string"?f:f instanceof URL?f.href:f.url,w=new URL(x,c),m=w.protocol===c.protocol&&w.host===c.host;if(w.pathname.startsWith("/api/")&&(m||w.origin===e)){const b=new URL(w.pathname+w.search,e);return n.fetch(f instanceof Request?new Request(b,f):b,g)}return o(f,g)}}function PR(e,t){const n=new URL(e,"https://agentroam.local");if(n.pathname!=="/app/")throw new Error("Invalid workspace frame path");const o=new URL(t);return o.search=n.search,o.searchParams.set("workspace","1"),o.hash="",o.href}function Q1(e){YT(KT(e.url,void 0,Pv())),new Iv().save(e)}async function BR(e,t,n,o){e.render(B.jsx(L0,{})),window.__agentroamNativeFrame={origin:t.url,fetch:n.fetch},globalThis.fetch=Vv(t.url,location.href,n,o);const c=async g=>{const x=await n.pair(g);Q1(x),location.reload()};$T({origin:t.url,frameUrl:g=>PR(g,location.href),pair:c,scan:async()=>{const g=await zv();g&&await c(g)},switchComputer:async g=>{const x=un.parse(g);if(!x)throw new Error("电脑地址无效,请重新扫码。");const w=new $v(new Wv,o,()=>{});await w.resume(x);const m=await w.fetch(x.api("/api/web-auth/status"),{signal:AbortSignal.timeout(5e3)}),b=m.ok?await m.json():null;if(!(b!=null&&b.authenticated)||b.locked)throw new Error("这台电脑需要重新授权,请点击扫码添加电脑。");Q1(x),location.reload()}});const{default:f}=await yi(async()=>{const{default:g}=await import("./page-Cgp9NEw1.js").then(x=>x.p);return{default:g}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);e.render(B.jsx(pe.StrictMode,{children:B.jsx(f,{})}))}function LR(){if(window.parent===window||new URLSearchParams(location.search).get("workspace")!=="1")return null;try{const e=new URL(window.parent.location.href);return e.protocol!==location.protocol||e.host!==location.host?null:window.parent.__agentroamNativeFrame??null}catch{return null}}function FR(e){return async(t,n)=>{const o=new Request(t,n);return e.fetch(o.url,{method:o.method,headers:Object.fromEntries(o.headers),body:o.method==="GET"||o.method==="HEAD"?void 0:await o.arrayBuffer(),signal:o.signal,cache:o.cache})}}var hc;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(hc||(hc={}));var u2;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(u2||(u2={}));const kf=ga("StatusBar");function UR(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?hc.Light:hc.Dark}}function jR(){if(Ds.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ul.getState().skin;let t=!1,n=kf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=UR(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await kf.setBackgroundColor({color:g.color}),await kf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const WR="/service-worker.js";function zR(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function $R(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function f2(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(WR),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:$R(t)});await e.post("/api/push/subscribe",c.toJSON())}function VR(e){zR()&&(async()=>{try{if(Notification.permission==="granted"){await f2(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await f2(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Df extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const d2=10,HR=13,mi=32;function Mf(e){}function GR(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Mf,onError:n=Mf,onRetry:o=Mf,onComment:c,maxBufferSize:f}=e,g=[];let x=0,w=!0,m,b="",y=0,S,T=!1;function D(z){if(T)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(w&&(w=!1,z.charCodeAt(0)===239&&z.charCodeAt(1)===187&&z.charCodeAt(2)===191&&(z=z.slice(3))),g.length===0){const X=Y(z);X!==""&&(g.push(X),x=X.length),k();return}if(z.indexOf(`
|
|
476
|
+
`);let s=nh.singletonList(tn.INITIAL_STATE);for(let l=0;l<this.text.length;l++){let u,d=l+1<this.text.length?this.text[l+1]:0;switch(this.text[l]){case J.getCharCode("\r"):u=d===i?2:0;break;case J.getCharCode("."):u=d===r?3:0;break;case J.getCharCode(","):u=d===r?4:0;break;case J.getCharCode(":"):u=d===r?5:0;break;default:u=0}u>0?(s=Ys.updateStateListForPair(s,l,u),l++):s=this.updateStateListForChar(s,l)}return nh.min(s,(l,u)=>l.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,i){const s=[];for(let a of r)this.updateStateForChar(a,i,s);return Ys.simplifyStates(s)}updateStateForChar(r,i,s){let a=this.text[i]&255,l=wu[r.getMode()][a]>0,u=null;for(let d=0;d<=en;d++){let h=wu[d][a];if(h>0){if(u==null&&(u=r.endBinaryShift(i)),!l||d===r.getMode()||d===Sr){const p=u.latchAndAppend(d,h);s.push(p)}if(!l&&sh[r.getMode()][d]>=0){const p=u.shiftAndAppend(d,h);s.push(p)}}}if(r.getBinaryShiftByteCount()>0||wu[r.getMode()][a]===0){let d=r.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(r,i,s){const a=[];for(let l of r)this.updateStateForPair(l,i,s,a);return this.simplifyStates(a)}static updateStateForPair(r,i,s,a){let l=r.endBinaryShift(i);if(a.push(l.latchAndAppend(en,s)),r.getMode()!==en&&a.push(l.shiftAndAppend(en,s)),s===3||s===4){let u=l.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(u)}if(r.getBinaryShiftByteCount()>0){let u=r.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(u)}}static simplifyStates(r){let i=[];for(const s of r){let a=!0;for(const l of i){if(l.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(l)&&(i=i.filter(u=>u!==l))}a&&i.push(s)}return i}}class Oe{constructor(){}static encodeBytes(r){return Oe.encode(r,Oe.DEFAULT_EC_PERCENT,Oe.DEFAULT_AZTEC_LAYERS)}static encode(r,i,s){let a=new Ys(r).encode(),l=O.truncDivision(a.getSize()*i,100)+11,u=a.getSize()+l,d,h,p,v,C;if(s!==Oe.DEFAULT_AZTEC_LAYERS){if(d=s<0,h=Math.abs(s),h>(d?Oe.MAX_NB_BITS_COMPACT:Oe.MAX_NB_BITS))throw new y(J.format("Illegal value %s for layers",s));p=Oe.totalBitsInLayer(h,d),v=Oe.WORD_SIZE[h];let Z=p-p%v;if(C=Oe.stuffBits(a,v),C.getSize()+l>Z)throw new y("Data to large for user specified layer");if(d&&C.getSize()>v*64)throw new y("Data to large for user specified layer")}else{v=0,C=null;for(let Z=0;;Z++){if(Z>Oe.MAX_NB_BITS)throw new y("Data too large for an Aztec code");if(d=Z<=3,h=d?Z+1:Z,p=Oe.totalBitsInLayer(h,d),u>p)continue;(C==null||v!==Oe.WORD_SIZE[h])&&(v=Oe.WORD_SIZE[h],C=Oe.stuffBits(a,v));let Te=p-p%v;if(!(d&&C.getSize()>v*64)&&C.getSize()+l<=Te)break}}let A=Oe.generateCheckWords(C,p,v),_=C.getSize()/v,M=Oe.generateModeMessage(d,h,_),P=(d?11:14)+h*4,F=new Int32Array(P),G;if(d){G=P;for(let Z=0;Z<F.length;Z++)F[Z]=Z}else{G=P+1+2*O.truncDivision(O.truncDivision(P,2)-1,15);let Z=O.truncDivision(P,2),Te=O.truncDivision(G,2);for(let ye=0;ye<Z;ye++){let rr=ye+O.truncDivision(ye,15);F[Z-ye-1]=Te-rr-1,F[Z+ye]=Te+rr+1}}let q=new he(G);for(let Z=0,Te=0;Z<h;Z++){let ye=(h-Z)*4+(d?9:12);for(let rr=0;rr<ye;rr++){let Br=rr*2;for(let nr=0;nr<2;nr++)A.get(Te+Br+nr)&&q.set(F[Z*2+nr],F[Z*2+rr]),A.get(Te+ye*2+Br+nr)&&q.set(F[Z*2+rr],F[P-1-Z*2-nr]),A.get(Te+ye*4+Br+nr)&&q.set(F[P-1-Z*2-nr],F[P-1-Z*2-rr]),A.get(Te+ye*6+Br+nr)&&q.set(F[P-1-Z*2-rr],F[Z*2+nr])}Te+=ye*8}if(Oe.drawModeMessage(q,d,G,M),d)Oe.drawBullsEye(q,O.truncDivision(G,2),5);else{Oe.drawBullsEye(q,O.truncDivision(G,2),7);for(let Z=0,Te=0;Z<O.truncDivision(P,2)-1;Z+=15,Te+=16)for(let ye=O.truncDivision(G,2)&1;ye<G;ye+=2)q.set(O.truncDivision(G,2)-Te,ye),q.set(O.truncDivision(G,2)+Te,ye),q.set(ye,O.truncDivision(G,2)-Te),q.set(ye,O.truncDivision(G,2)+Te)}let ee=new rh;return ee.setCompact(d),ee.setSize(G),ee.setLayers(h),ee.setCodeWords(_),ee.setMatrix(q),ee}static drawBullsEye(r,i,s){for(let a=0;a<s;a+=2)for(let l=i-a;l<=i+a;l++)r.set(l,i-a),r.set(l,i+a),r.set(i-a,l),r.set(i+a,l);r.set(i-s,i-s),r.set(i-s+1,i-s),r.set(i-s,i-s+1),r.set(i+s,i-s),r.set(i+s,i-s+1),r.set(i+s,i+s-1)}static generateModeMessage(r,i,s){let a=new j;return r?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=Oe.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=Oe.generateCheckWords(a,40,4)),a}static drawModeMessage(r,i,s,a){let l=O.truncDivision(s,2);if(i)for(let u=0;u<7;u++){let d=l-3+u;a.get(u)&&r.set(d,l-5),a.get(u+7)&&r.set(l+5,d),a.get(20-u)&&r.set(d,l+5),a.get(27-u)&&r.set(l-5,d)}else for(let u=0;u<10;u++){let d=l-5+u+O.truncDivision(u,5);a.get(u)&&r.set(d,l-7),a.get(u+10)&&r.set(l+7,d),a.get(29-u)&&r.set(d,l+7),a.get(39-u)&&r.set(l-7,d)}}static generateCheckWords(r,i,s){let a=r.getSize()/s,l=new hu(Oe.getGF(s)),u=O.truncDivision(i,s),d=Oe.bitsToWords(r,s,u);l.encode(d,u-a);let h=i%s,p=new j;p.appendBits(0,h);for(const v of Array.from(d))p.appendBits(v,s);return p}static bitsToWords(r,i,s){let a=new Int32Array(s),l,u;for(l=0,u=r.getSize()/i;l<u;l++){let d=0;for(let h=0;h<i;h++)d|=r.get(l*i+h)?1<<i-h-1:0;a[l]=d}return a}static getGF(r){switch(r){case 4:return Ie.AZTEC_PARAM;case 6:return Ie.AZTEC_DATA_6;case 8:return Ie.AZTEC_DATA_8;case 10:return Ie.AZTEC_DATA_10;case 12:return Ie.AZTEC_DATA_12;default:throw new y("Unsupported word size "+r)}}static stuffBits(r,i){let s=new j,a=r.getSize(),l=(1<<i)-2;for(let u=0;u<a;u+=i){let d=0;for(let h=0;h<i;h++)(u+h>=a||r.get(u+h))&&(d|=1<<i-1-h);(d&l)===l?(s.appendBits(d&l,i),u--):d&l?s.appendBits(d,i):(s.appendBits(d|1,i),u--)}return s}static totalBitsInLayer(r,i){return((i?88:112)+16*r)*r}}Oe.DEFAULT_EC_PERCENT=33,Oe.DEFAULT_AZTEC_LAYERS=0,Oe.MAX_NB_BITS=32,Oe.MAX_NB_BITS_COMPACT=4,Oe.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Ia{encode(r,i,s,a){return this.encodeWithHints(r,i,s,a,null)}encodeWithHints(r,i,s,a,l){let u=pu.ISO_8859_1,d=Oe.DEFAULT_EC_PERCENT,h=Oe.DEFAULT_AZTEC_LAYERS;return l!=null&&(l.has(vt.CHARACTER_SET)&&(u=th.forName(l.get(vt.CHARACTER_SET).toString())),l.has(vt.ERROR_CORRECTION)&&(d=O.parseInt(l.get(vt.ERROR_CORRECTION).toString())),l.has(vt.AZTEC_LAYERS)&&(h=O.parseInt(l.get(vt.AZTEC_LAYERS).toString()))),Ia.encodeLayers(r,i,s,a,u,d,h)}static encodeLayers(r,i,s,a,l,u,d){if(i!==ce.AZTEC)throw new y("Can only encode AZTEC, but got "+i);let h=Oe.encode(J.getBytes(r,l),u,d);return Ia.renderResult(h,s,a)}static renderResult(r,i,s){let a=r.getMatrix();if(a==null)throw new Kr;let l=a.getWidth(),u=a.getHeight(),d=Math.max(i,l),h=Math.max(s,u),p=Math.min(d/l,h/u),v=(d-l*p)/2,C=(h-u*p)/2,A=new he(d,h);for(let _=0,M=C;_<u;_++,M+=p)for(let P=0,F=v;P<l;P++,F+=p)a.get(P,_)&&A.setRegion(F,M,p,p);return A}}n.AbstractExpandedDecoder=nu,n.ArgumentException=b,n.ArithmeticException=Dr,n.AztecCode=rh,n.AztecCodeReader=xa,n.AztecCodeWriter=Ia,n.AztecDecoder=$e,n.AztecDetector=z0,n.AztecDetectorResult=j0,n.AztecEncoder=Oe,n.AztecHighLevelEncoder=Ys,n.AztecPoint=Ht,n.BarcodeFormat=ce,n.Binarizer=D,n.BinaryBitmap=S,n.BitArray=j,n.BitMatrix=he,n.BitSource=au,n.BrowserAztecCodeReader=Yv,n.BrowserBarcodeReader=Jv,n.BrowserCodeReader=qt,n.BrowserDatamatrixCodeReader=t3,n.BrowserMultiFormatReader=d3,n.BrowserPDF417Reader=h3,n.BrowserQRCodeReader=g3,n.BrowserQRCodeSvgWriter=gi,n.CharacterSetECI=H,n.ChecksumException=T,n.Code128Reader=re,n.Code39Reader=xt,n.DataMatrixDecodedBitStreamParser=Mn,n.DataMatrixReader=Pn,n.DecodeHintType=W,n.DecoderResult=On,n.DefaultGridSampler=W0,n.DetectorResult=ma,n.EAN13Reader=ci,n.EncodeHintType=vt,n.Exception=m,n.FormatException=L,n.GenericGF=Ie,n.GenericGFPoly=_t,n.GlobalHistogramBinarizer=ke,n.GridSampler=Jc,n.GridSamplerInstance=kn,n.HTMLCanvasElementLuminanceSource=we,n.HybridBinarizer=xe,n.ITFReader=Ue,n.IllegalArgumentException=y,n.IllegalStateException=Kr,n.InvertedLuminanceSource=fe,n.LuminanceSource=ie,n.MathUtils=_e,n.MultiFormatOneDReader=zi,n.MultiFormatReader=eh,n.MultiFormatWriter=m3,n.NotFoundException=$,n.OneDReader=gt,n.PDF417DecodedBitStreamParser=V,n.PDF417DecoderErrorCorrection=Y0,n.PDF417Reader=kt,n.PDF417ResultMetadata=Z0,n.PerspectiveTransform=Mr,n.PlanarYUVLuminanceSource=Jr,n.QRCodeByteMatrix=Aa,n.QRCodeDataMask=br,n.QRCodeDecodedBitStreamParser=Je,n.QRCodeDecoderErrorCorrectionLevel=Ve,n.QRCodeDecoderFormatInformation=jt,n.QRCodeEncoder=Ge,n.QRCodeEncoderQRCode=hi,n.QRCodeMaskUtil=ot,n.QRCodeMatrixUtil=me,n.QRCodeMode=ge,n.QRCodeReader=Bn,n.QRCodeVersion=de,n.QRCodeWriter=Vi,n.RGBLuminanceSource=gu,n.RSS14Reader=st,n.RSSExpandedReader=K,n.ReaderException=ba,n.ReedSolomonDecoder=Us,n.ReedSolomonEncoder=hu,n.ReedSolomonException=Fi,n.Result=ze,n.ResultMetadataType=qe,n.ResultPoint=ue,n.StringUtils=J,n.UnsupportedOperationException=se,n.VideoInputDevice=De,n.WhiteRectangleDetector=dn,n.WriterException=je,n.ZXingArrays=I,n.ZXingCharset=th,n.ZXingInteger=O,n.ZXingStandardCharsets=pu,n.ZXingStringBuilder=ne,n.ZXingStringEncoding=te,n.ZXingSystem=k,n.createAbstractExpandedDecoder=G0,Object.defineProperty(n,"__esModule",{value:!0})})})(X1,X1.exports);var et=X1.exports;const uR=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var r2=function(){function e(t,n,o){if(this.formatMap=new Map([[oe.QR_CODE,et.BarcodeFormat.QR_CODE],[oe.AZTEC,et.BarcodeFormat.AZTEC],[oe.CODABAR,et.BarcodeFormat.CODABAR],[oe.CODE_39,et.BarcodeFormat.CODE_39],[oe.CODE_93,et.BarcodeFormat.CODE_93],[oe.CODE_128,et.BarcodeFormat.CODE_128],[oe.DATA_MATRIX,et.BarcodeFormat.DATA_MATRIX],[oe.MAXICODE,et.BarcodeFormat.MAXICODE],[oe.ITF,et.BarcodeFormat.ITF],[oe.EAN_13,et.BarcodeFormat.EAN_13],[oe.EAN_8,et.BarcodeFormat.EAN_8],[oe.PDF_417,et.BarcodeFormat.PDF_417],[oe.RSS_14,et.BarcodeFormat.RSS_14],[oe.RSS_EXPANDED,et.BarcodeFormat.RSS_EXPANDED],[oe.UPC_A,et.BarcodeFormat.UPC_A],[oe.UPC_E,et.BarcodeFormat.UPC_E],[oe.UPC_EAN_EXTENSION,et.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!uR)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var c=this.createZXingFormats(t),f=new Map;f.set(et.DecodeHintType.POSSIBLE_FORMATS,c),f.set(et.DecodeHintType.TRY_HARDER,!1),this.hints=f}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,c){try{o(n.decode(t))}catch(f){c(f)}})},e.prototype.decode=function(t){var n=new et.MultiFormatReader(this.verbose,this.hints),o=new et.HTMLCanvasElementLuminanceSource(t),c=new et.BinaryBitmap(new et.HybridBinarizer(o)),f=n.decode(c);return{text:f.text,format:Fv.create(this.toHtml5QrcodeSupportedFormats(f.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.logError("".concat(f," is not supported by")+"ZXingHtml5QrcodeShim")}return n},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e}(),fR=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},n2=function(){function e(t,n,o){if(this.formatMap=new Map([[oe.QR_CODE,"qr_code"],[oe.AZTEC,"aztec"],[oe.CODABAR,"codabar"],[oe.CODE_39,"code_39"],[oe.CODE_93,"code_93"],[oe.CODE_128,"code_128"],[oe.DATA_MATRIX,"data_matrix"],[oe.ITF,"itf"],[oe.EAN_13,"ean_13"],[oe.EAN_8,"ean_8"],[oe.PDF_417,"pdf417"],[oe.UPC_A,"upc_a"],[oe.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var c=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(c),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t<"u"},e.prototype.decodeAsync=function(t){return fR(this,void 0,void 0,function(){var n,o;return dR(this,function(c){switch(c.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=c.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:Fv.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,c=0,f=t;c<f.length;c++){var g=f[c],x=g.boundingBox.width*g.boundingBox.height;x>o&&(o=x,n=g)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,c=t;o<c.length;o++){var f=c[o];this.formatMap.has(f)?n.push(this.formatMap.get(f)):this.logger.warn("".concat(f," is not supported by")+"BarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,c){t.set(n,o)}),t},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e}(),i2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},s2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},hR=function(){function e(t,n,o,c){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,n&&n2.isSupported()?(this.primaryDecoder=new n2(t,o,c),this.secondaryDecoder=new r2(t,o,c)):this.primaryDecoder=new r2(t,o,c)}return e.prototype.decodeAsync=function(t){return i2(this,void 0,void 0,function(){var n;return s2(this,function(o){switch(o.label){case 0:n=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(n),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(t){return i2(this,void 0,void 0,function(){var n,o;return s2(this,function(c){switch(c.label){case 0:n=performance.now(),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,c.sent()];case 3:if(o=c.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw o;case 4:return this.possiblyLogPerformance(n),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(t){if(this.verbose){var n=performance.now()-t;this.executionResults.push(n),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var c=o[n];t+=c}var f=t/this.executionResults.length;console.log("".concat(f," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e}(),F0=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),fc=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},dc=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},jv=function(){function e(t,n){this.name=t,this.track=n}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(t){var n={};n[this.name]=t;var o={advanced:[n]};return this.track.applyConstraints(o)},e.prototype.value=function(){var t=this.track.getSettings();if(this.name in t){var n=t[this.name];return n}return null},e}(),gR=function(e){F0(t,e);function t(n,o){return e.call(this,n,o)||this}return t.prototype.min=function(){return this.getCapabilities().min},t.prototype.max=function(){return this.getCapabilities().max},t.prototype.step=function(){return this.getCapabilities().step},t.prototype.apply=function(n){var o={};o[this.name]=n;var c={advanced:[o]};return this.track.applyConstraints(c)},t.prototype.getCapabilities=function(){this.failIfNotSupported();var n=this.track.getCapabilities(),o=n[this.name];return{min:o.min,max:o.max,step:o.step}},t.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},t}(jv),pR=function(e){F0(t,e);function t(n){return e.call(this,"zoom",n)||this}return t}(gR),mR=function(e){F0(t,e);function t(n){return e.call(this,"torch",n)||this}return t}(jv),xR=function(){function e(t){this.track=t}return e.prototype.zoomFeature=function(){return new pR(this.track)},e.prototype.torchFeature=function(){return new mR(this.track)},e}(),wR=function(){function e(t,n,o){this.isClosed=!1,this.parentElement=t,this.mediaStream=n,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width="".concat(t,"px"),n.style.display="block",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var n=function(){var o=t.surface.clientWidth,c=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(o,c),t.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(t,n,o,c){return fc(this,void 0,void 0,function(){var f,g;return dc(this,function(x){switch(x.label){case 0:return f=new e(t,n,c),o.aspectRatio?(g={aspectRatio:o.aspectRatio},[4,f.getFirstTrackOrFail().applyConstraints(g)]):[3,2];case 1:x.sent(),x.label=2;case 2:return f.setupSurface(),[2,f]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(t){this.failIfClosed();var n=this,o=function(){setTimeout(t,200),n.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(t){return fc(this,void 0,void 0,function(){return dc(this,function(n){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(n,o){var c=t.mediaStream.getVideoTracks(),f=c.length,g=0;t.mediaStream.getVideoTracks().forEach(function(x){t.mediaStream.removeTrack(x),x.stop(),++g,g>=f&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),n())})})},e.prototype.getCapabilities=function(){return new xR(this.getFirstTrackOrFail())},e}(),vR=function(){function e(t){this.mediaStream=t}return e.prototype.render=function(t,n,o){return fc(this,void 0,void 0,function(){return dc(this,function(c){return[2,wR.create(t,this.mediaStream,n,o)]})})},e.create=function(t){return fc(this,void 0,void 0,function(){var n,o;return dc(this,function(c){switch(c.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:t},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return o=c.sent(),[2,new e(o)]}})})},e}(),o2=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},a2=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},yR=function(){function e(){}return e.failIfNotSupported=function(){return o2(this,void 0,void 0,function(){return a2(this,function(t){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(t){return o2(this,void 0,void 0,function(){return a2(this,function(n){return[2,vR.create(t)]})})},e}(),ER=function(e,t,n,o){function c(f){return f instanceof n?f:new n(function(g){g(f)})}return new(n||(n=Promise))(function(f,g){function x(b){try{m(o.next(b))}catch(y){g(y)}}function w(b){try{m(o.throw(b))}catch(y){g(y)}}function m(b){b.done?f(b.value):c(b.value).then(x,w)}m((o=o.apply(e,t||[])).next())})},CR=function(e,t){var n={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},o,c,f,g;return g={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function x(m){return function(b){return w([m,b])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(n=0)),n;)try{if(o=1,c&&(f=m[0]&2?c.return:m[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,m[1])).done)return f;switch(c=0,f&&(m=[m[0]&2,f.value]),m[0]){case 0:case 1:f=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,c=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(f=n.trys,!(f=f.length>0&&f[f.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!f||m[1]>f[0]&&m[1]<f[3])){n.label=m[1];break}if(m[0]===6&&n.label<f[1]){n.label=f[1],f=m;break}if(f&&n.label<f[2]){n.label=f[2],n.ops.push(m);break}f[2]&&n.ops.pop(),n.trys.pop();continue}m=t.call(e,n)}catch(b){m=[6,b],c=0}finally{o=f=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},bR=function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;return MediaStreamTrack&&t.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var t=ds.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(t=ds.insecureContextCameraQueryError()),Promise.reject(t)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var t=location.host.split(":")[0];return t==="127.0.0.1"||t==="localhost"},e.getCamerasFromMediaDevices=function(){return ER(this,void 0,void 0,function(){var t,n,o,c,f,g,x;return CR(this,function(w){switch(w.label){case 0:return t=function(m){for(var b=m.getVideoTracks(),y=0,S=b;y<S.length;y++){var T=S[y];T.enabled=!1,T.stop(),m.removeTrack(T)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return n=w.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=w.sent(),c=[],f=0,g=o;f<g.length;f++)x=g[f],x.kind==="videoinput"&&c.push({id:x.deviceId,label:x.label});return t(n),[2,c]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(f){for(var g=[],x=0,w=f;x<w.length;x++){var m=w[x];m.kind==="video"&&g.push({id:m.id,label:m.label})}t(g)},c=MediaStreamTrack;c.getSources(o)})},e}(),at;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(at||(at={}));var AR=function(){function e(){this.state=at.NOT_STARTED,this.onGoingTransactionNewState=at.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===at.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=at.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===at.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=at.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==at.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case at.UNKNOWN:throw"Transition from unknown is not allowed";case at.NOT_STARTED:this.failIfNewStateIs(t,[at.PAUSED]);break;case at.SCANNING:break;case at.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,c=n;o<c.length;o++){var f=c[o];if(t===f)throw"Cannot transition from ".concat(this.state," to ").concat(t)}},e}(),SR=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===at.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==at.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===at.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===at.PAUSED},e}(),IR=function(){function e(){}return e.create=function(){return new SR(new AR)},e}(),TR=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(o[f]=c[f])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),hr=function(e){TR(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(aR),RR=function(){function e(t,n){this.logger=n,this.fps=hr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=hr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Uv.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!hn(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),f_=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(o=n,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new cR(this.verbose),this.qrcode=new hR(this.getSupportedFormats(n),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=IR.create()}return e.prototype.start=function(t,n,o,c){var f=this;if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var g;c?g=c:g=this.verbose?this.logger.log:function(){};var x=RR.create(n,this.logger);this.clearElement();var w=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?w=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=w,b=document.getElementById(this.elementId);b.clientWidth?b.clientWidth:hr.DEFAULT_WIDTH,b.style.position="relative",this.shouldScan=!0,this.element=b;var y=this,S=this.stateManagerProxy.startTransition(at.SCANNING);return new Promise(function(T,D){var k=m?x.videoConstraints:y.createVideoConstraints(t);if(!k){S.cancel(),D("videoConstraints should be defined");return}var Y={};(!m||x.aspectRatio)&&(Y.aspectRatio=x.aspectRatio);var N={onRenderSurfaceReady:function(I,O){y.setupUi(I,O,x),y.isScanning=!0,y.foreverScan(x,o,g)}};yR.failIfNotSupported().then(function(I){I.create(k).then(function(O){return O.render(f.element,Y,N).then(function(j){y.renderedCamera=j,S.execute(),T(null)}).catch(function(j){S.cancel(),D(j)})}).catch(function(O){S.cancel(),D(ds.errorGettingUserMedia(O))})}).catch(function(I){S.cancel(),D(ds.cameraStreamingNotSupported())})})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(at.PAUSED),this.showPausedState(),(hn(t)||t!==!0)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(at.SCANNING),t.hidePausedState()};if(!this.renderedCamera.isPaused()){n();return}this.renderedCamera.resume(function(){n()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(at.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(t.element){var f=document.getElementById(hr.SHADED_REGION_ELEMENT_ID);f&&t.element.removeChild(f)}},c=this;return this.renderedCamera.close().then(function(){return c.renderedCamera=null,c.element&&(c.element.removeChild(c.canvasElement),c.canvasElement=null),o(),c.qrRegion&&(c.qrRegion=null),c.context&&(c.context=null),n.execute(),c.hidePausedState(),c.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(hn(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(c,f){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var g=new Image;g.onload=function(){var x=g.width,w=g.height,m=document.getElementById(o.elementId),b=m.clientWidth?m.clientWidth:hr.DEFAULT_WIDTH,y=Math.max(m.clientHeight?m.clientHeight:w,hr.FILE_SCAN_MIN_HEIGHT),S=o.computeCanvasDrawConfig(x,w,b,y);if(n){var T=o.createCanvasElement(b,y,"qr-canvas-visible");T.style.display="inline-block",m.appendChild(T);var D=T.getContext("2d");if(!D)throw"Unable to get 2d context from canvas";D.canvas.width=b,D.canvas.height=y,D.drawImage(g,0,0,x,w,S.x,S.y,S.width,S.height)}var k=hr.FILE_SCAN_HIDDEN_CANVAS_PADDING,Y=Math.max(g.width,S.width),N=Math.max(g.height,S.height),I=Y+2*k,O=N+2*k,j=o.createCanvasElement(I,O);m.appendChild(j);var z=j.getContext("2d");if(!z)throw"Unable to get 2d context from canvas";z.canvas.width=I,z.canvas.height=O,z.drawImage(g,0,0,x,w,k,k,Y,N);try{o.qrcode.decodeRobustlyAsync(j).then(function(W){c(t2.createFromQrcodeResult(W))}).catch(f)}catch(W){f("QR code parse error, error = ".concat(W))}},g.onerror=f,g.onabort=f,g.onstalled=f,g.onsuspend=f,g.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return bR.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(t){if(t){if(!Uv.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},e.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},e.prototype.getSupportedFormats=function(t){var n=[oe.QR_CODE,oe.AZTEC,oe.CODABAR,oe.CODE_39,oe.CODE_93,oe.CODE_128,oe.DATA_MATRIX,oe.MAXICODE,oe.ITF,oe.EAN_13,oe.EAN_8,oe.PDF_417,oe.RSS_14,oe.RSS_EXPANDED,oe.UPC_A,oe.UPC_E,oe.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],c=0,f=t.formatsToSupport;c<f.length;c++){var g=f[c];oR(g)?o.push(g):this.logger.warn("Invalid format: ".concat(g," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.getUseBarCodeDetectorIfSupported=function(t){if(hn(t))return!0;if(!hn(t.useBarCodeDetectorIfSupported))return t.useBarCodeDetectorIfSupported!==!1;if(hn(t.experimentalFeatures))return!0;var n=t.experimentalFeatures;return hn(n.useBarCodeDetectorIfSupported)?!0:n.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(t,n,o){var c=this,f=o.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(t,n,f),x=function(m){if(m<hr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(hr.MIN_QR_BOX_SIZE,"px.")},w=function(m){return m>t&&(c.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),m=t),m};x(g.width),x(g.height),g.width=w(g.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(c){throw new Error("qrbox config was passed as a function but it failed with unknown error"+c)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var c=hn(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(c);var f=this.toQrdimensions(t,n,c);f.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var g=o.isShadedBoxEnabled()&&f.height<=n,x={x:0,y:0,width:t,height:n},w=g?this.getShadedRegionBounds(t,n,f):x,m=this.createCanvasElement(w.width,w.height),b={willReadFrequently:!0},y=m.getContext("2d",b);y.canvas.width=w.width,y.canvas.height=w.height,this.element.append(m),g&&this.possiblyInsertShadingElement(this.element,t,n,f),this.createScannerPausedUiElement(this.element),this.qrRegion=w,this.context=y,this.canvasElement=m},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText=ds.scannerPaused(),n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="rgba(9, 9, 9, 0.46)",n.style.color="#FFECEC",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(c){return t(c.text,t2.createFromQrcodeResult(c)),o.possiblyUpdateShaders(!0),!0}).catch(function(c){o.possiblyUpdateShaders(!1);var f=ds.codeParseError(c);return n(f,lR.createFrom(f)),!1})},e.prototype.foreverScan=function(t,n,o){var c=this;if(this.shouldScan&&this.renderedCamera){var f=this.renderedCamera.getSurface(),g=f.videoWidth/f.clientWidth,x=f.videoHeight/f.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var w=this.qrRegion.width*g,m=this.qrRegion.height*x,b=this.qrRegion.x*g,y=this.qrRegion.y*x;this.context.drawImage(f,b,y,w,m,0,0,this.qrRegion.width,this.qrRegion.height);var S=function(){c.foreverScanTimeout=setTimeout(function(){c.foreverScan(t,n,o)},c.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(T){!T&&t.disableFlip!==!0?(c.context.translate(c.context.canvas.width,0),c.context.scale(-1,1),c.scanContext(n,o).finally(function(){S()})):S()}).catch(function(T){c.logger.logError("Error happend while scanning context",T),S()})}},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",c={user:!0,environment:!0},f="exact",g=function(D){if(D in c)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(D,"'")},x=Object.keys(t);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var w=Object.keys(t)[0];if(w!==n&&w!==o)throw"Only '".concat(n,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(w===n){var m=t.facingMode;if(typeof m=="string"){if(g(m))return{facingMode:m}}else if(typeof m=="object")if(f in m){if(g(m["".concat(f)]))return{facingMode:{exact:m["".concat(f)]}}}else throw"'facingMode' should be string or object with"+" ".concat(f," as key.");else{var b=typeof m;throw"Invalid type of 'facingMode' = ".concat(b)}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(f in y)return{deviceId:{exact:y["".concat(f)]}};throw"'deviceId' should be string or object with"+" ".concat(f," as key.")}else{var S=typeof y;throw"Invalid type of 'deviceId' = ".concat(S)}}}var T=typeof t;throw"Invalid type of 'cameraIdOrConfig' = ".concat(T)},e.prototype.computeCanvasDrawConfig=function(t,n,o,c){if(t<=o&&n<=c){var f=(o-t)/2,g=(c-n)/2;return{x:f,y:g,width:t,height:n}}else{var x=t,w=n;return t>o&&(n=o/t*n,t=o),n>c&&(t=c/n*t,n=c),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(w)+" to ".concat(t,"X").concat(n,".")),this.computeCanvasDrawConfig(t,n,o,c)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?hr.BORDER_SHADER_MATCH_COLOR:hr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var c=t,f=n,g=document.createElement("canvas");return g.style.width="".concat(c,"px"),g.style.height="".concat(f,"px"),g.style.display="none",g.id=hn(o)?"qr-canvas":o,g},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,c){if(!(n-c.width<1||o-c.height<1)){var f=document.createElement("div");f.style.position="absolute";var g=(n-c.width)/2,x=(o-c.height)/2;if(f.style.borderLeft="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderRight="".concat(g,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),f.style.boxSizing="border-box",f.style.top="0px",f.style.bottom="0px",f.style.left="0px",f.style.right="0px",f.id="".concat(hr.SHADED_REGION_ELEMENT_ID),n-c.width<11||o-c.height<11)this.hasBorderShaders=!1;else{var w=5,m=40;this.insertShaderBorders(f,m,w,-w,null,0,!0),this.insertShaderBorders(f,m,w,-w,null,0,!1),this.insertShaderBorders(f,m,w,null,-w,0,!0),this.insertShaderBorders(f,m,w,null,-w,0,!1),this.insertShaderBorders(f,w,m+w,-w,null,-w,!0),this.insertShaderBorders(f,w,m+w,null,-w,-w,!0),this.insertShaderBorders(f,w,m+w,-w,null,-w,!1),this.insertShaderBorders(f,w,m+w,null,-w,-w,!1),this.hasBorderShaders=!0}t.append(f)}},e.prototype.insertShaderBorders=function(t,n,o,c,f,g,x){var w=document.createElement("div");w.style.position="absolute",w.style.backgroundColor=hr.BORDER_SHADER_DEFAULT_COLOR,w.style.width="".concat(n,"px"),w.style.height="".concat(o,"px"),c!==null&&(w.style.top="".concat(c,"px")),f!==null&&(w.style.bottom="".concat(f,"px")),x?w.style.left="".concat(g,"px"):w.style.right="".concat(g,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(w),t.appendChild(w)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),l2;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(l2||(l2={}));var Y1;(function(e){e[e.BACK=1]="BACK",e[e.FRONT=2]="FRONT"})(Y1||(Y1={}));var K1;(function(e){e[e.PORTRAIT=1]="PORTRAIT",e[e.LANDSCAPE=2]="LANDSCAPE",e[e.ADAPTIVE=3]="ADAPTIVE"})(K1||(K1={}));var Z1;(function(e){e[e.ALL=17]="ALL"})(Z1||(Z1={}));const _R=Object.assign(Object.assign({},oe),Z1);var c2;(function(e){e.ZXING="zxing",e.MLKIT="mlkit"})(c2||(c2={}));const OR=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function NR(e){const t="custom-style-os-cap-barcode";let n=document.getElementById(t);if(n||(n=document.createElement("style"),n.type="text/css",n.id=t,document.head.appendChild(n)),n.sheet){for(;n.sheet.cssRules.length;)n.sheet.deleteRule(0);for(const{selector:o,css:c}of e)n.sheet.insertRule(`${o} { ${c} }`)}else{n.textContent="";for(const{selector:o,css:c}of e)n.textContent+=`${o} { ${c} }`}}const kR=ga("CapacitorBarcodeScanner",{web:()=>(NR(OR),yi(()=>import("./web-Rzucq1ai.js"),[],import.meta.url).then(e=>new e.CapacitorBarcodeScannerWeb))});class DR{static async scanBarcode(t){return t.scanInstructions=t.scanInstructions||" ",t.scanButton=t.scanButton||!1,t.scanText=t.scanText||" ",t.cameraDirection=t.cameraDirection||Y1.BACK,t.scanOrientation=t.scanOrientation||K1.ADAPTIVE,kR.scanBarcode(t)}}const Nf=ga("SecureStoragePlugin",{web:()=>yi(()=>import("./web-Cd8qQxlG.js"),[],import.meta.url).then(e=>new e.SecureStoragePluginWeb)});function MR(e){try{if(e.length>2048)throw new Error;if(!e.startsWith("{")){const c=new URL(e);if(!["http:","https:"].includes(c.protocol)||c.username||c.password||c.pathname!=="/pair"||c.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(c.hash))throw new Error;const f=un.parse(c.origin);if(!f)throw new Error;return{endpoint:f,grant:c.hash.slice(6)}}const t=JSON.parse(e);if(t.type!=="agentroam-pair"||t.version!==1||typeof t.server!="string"||typeof t.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(t.grant))throw new Error;const n=new URL(t.server);if(n.username||n.password||n.search||n.hash||n.pathname!=="/")throw new Error;const o=un.parse(t.server);if(!o)throw new Error;return{endpoint:o,grant:t.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class Wv{ready(){if(!Ds.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(t){this.ready();try{return(await Nf.get({key:`agentroam-device:${t}`})).value}catch(n){if(String(n).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(t,n){this.ready(),await Nf.set({key:`agentroam-device:${t}`,value:n})}async remove(t){this.ready();try{await Nf.remove({key:`agentroam-device:${t}`})}catch(n){if(!String(n).includes("does not exist"))throw n}}}async function zv(){if(!Ds.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await DR.scanBarcode({hint:_R.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(e){if(/cancel/i.test(String(e)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class $v{constructor(t,n=(...c)=>fetch(...c),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=t,this.transport=n,this.onRevoked=o,this.session=null,this.fetch=async(c,f={})=>{const g=this.session,x=new URL(typeof c=="string"?c:c instanceof URL?c.href:c.url),w=new Headers(f.headers??(c instanceof Request?c.headers:void 0));g&&x.origin===g.origin&&w.set("authorization",`Bearer ${g.token}`);const m=await this.transport(c,{...f,headers:w,credentials:"omit",redirect:"error"});if(g&&this.session===g&&x.origin===g.origin&&(m.status===401||m.status===423)){this.session=null;try{await this.storage.remove(g.origin)}finally{this.onRevoked()}}return m}}async resume(t){const n=await this.storage.get(t.url);this.session=n?{origin:t.url,token:n}:null}async pair(t){const{endpoint:n,grant:o}=MR(t),c=await this.transport(n.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:AbortSignal.timeout(1e4)});if(!c.ok)throw new Error(c.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":c.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。");const f=await c.json();if(typeof f.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(f.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(n.url,f.token)}catch{throw await this.transport(n.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${f.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:n.url,token:f.token},n}async checkAuthorization(){const t=this.session;if(!t)return;const n=await this.fetch(`${t.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!n.ok)return;const o=await n.json();if(this.session===t&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(t.origin)}finally{this.onRevoked()}}}}function Vv(e,t,n,o){const c=new URL(t);return(f,g)=>{const x=typeof f=="string"?f:f instanceof URL?f.href:f.url,w=new URL(x,c),m=w.protocol===c.protocol&&w.host===c.host;if(w.pathname.startsWith("/api/")&&(m||w.origin===e)){const b=new URL(w.pathname+w.search,e);return n.fetch(f instanceof Request?new Request(b,f):b,g)}return o(f,g)}}function PR(e,t){const n=new URL(e,"https://agentroam.local");if(n.pathname!=="/app/")throw new Error("Invalid workspace frame path");const o=new URL(t);return o.search=n.search,o.searchParams.set("workspace","1"),o.hash="",o.href}function Q1(e){YT(KT(e.url,void 0,Pv())),new Iv().save(e)}async function BR(e,t,n,o){e.render(B.jsx(L0,{})),window.__agentroamNativeFrame={origin:t.url,fetch:n.fetch},globalThis.fetch=Vv(t.url,location.href,n,o);const c=async g=>{const x=await n.pair(g);Q1(x),location.reload()};$T({origin:t.url,frameUrl:g=>PR(g,location.href),pair:c,scan:async()=>{const g=await zv();g&&await c(g)},switchComputer:async g=>{const x=un.parse(g);if(!x)throw new Error("电脑地址无效,请重新扫码。");const w=new $v(new Wv,o,()=>{});await w.resume(x);const m=await w.fetch(x.api("/api/web-auth/status"),{signal:AbortSignal.timeout(5e3)}),b=m.ok?await m.json():null;if(!(b!=null&&b.authenticated)||b.locked)throw new Error("这台电脑需要重新授权,请点击扫码添加电脑。");Q1(x),location.reload()}});const{default:f}=await yi(async()=>{const{default:g}=await import("./page-BtJOUBkb.js").then(x=>x.p);return{default:g}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);e.render(B.jsx(pe.StrictMode,{children:B.jsx(f,{})}))}function LR(){if(window.parent===window||new URLSearchParams(location.search).get("workspace")!=="1")return null;try{const e=new URL(window.parent.location.href);return e.protocol!==location.protocol||e.host!==location.host?null:window.parent.__agentroamNativeFrame??null}catch{return null}}function FR(e){return async(t,n)=>{const o=new Request(t,n);return e.fetch(o.url,{method:o.method,headers:Object.fromEntries(o.headers),body:o.method==="GET"||o.method==="HEAD"?void 0:await o.arrayBuffer(),signal:o.signal,cache:o.cache})}}var hc;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(hc||(hc={}));var u2;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(u2||(u2={}));const kf=ga("StatusBar");function UR(e){const t=/^#([a-f\d]{6})$/i.exec(e.trim());if(!t)return null;const n=[0,2,4].map(c=>{const f=parseInt(t[1].slice(c,c+2),16)/255;return f<=.04045?f/12.92:((f+.055)/1.055)**2.4}),o=.2126*n[0]+.7152*n[1]+.0722*n[2];return{color:`#${t[1]}`,style:o>.179?hc.Light:hc.Dark}}function jR(){if(Ds.getPlatform()!=="android")return()=>{};const e=document.documentElement;e.dataset.skin=Ul.getState().skin;let t=!1,n=kf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const g=UR(getComputedStyle(e).getPropertyValue("--bg-deepest"));g&&(n=n.then(async()=>{t||(await kf.setBackgroundColor({color:g.color}),await kf.setStyle({style:g.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},c=new MutationObserver(o);c.observe(e,{attributes:!0,attributeFilter:["data-skin"]});const f=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",f),window.addEventListener("focus",o),o(),()=>{t=!0,c.disconnect(),document.removeEventListener("visibilitychange",f),window.removeEventListener("focus",o)}}const WR="/service-worker.js";function zR(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function $R(e){const t="=".repeat((4-e.length%4)%4),n=`${e}${t}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(n),c=new Uint8Array(new ArrayBuffer(o.length));for(let f=0;f<o.length;f+=1)c[f]=o.charCodeAt(f);return c}async function f2(e){const{publicKey:t}=await e.get("/api/push/vapid");if(!t)return;const n=await navigator.serviceWorker.register(WR),c=await n.pushManager.getSubscription()??await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:$R(t)});await e.post("/api/push/subscribe",c.toJSON())}function VR(e){zR()&&(async()=>{try{if(Notification.permission==="granted"){await f2(e);return}if(Notification.permission!=="default")return;const t=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await f2(e)}catch{}})()};document.addEventListener("pointerdown",t,{once:!0})}catch{}})()}class Df extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const d2=10,HR=13,mi=32;function Mf(e){}function GR(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Mf,onError:n=Mf,onRetry:o=Mf,onComment:c,maxBufferSize:f}=e,g=[];let x=0,w=!0,m,b="",y=0,S,T=!1;function D(z){if(T)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(w&&(w=!1,z.charCodeAt(0)===239&&z.charCodeAt(1)===187&&z.charCodeAt(2)===191&&(z=z.slice(3))),g.length===0){const X=Y(z);X!==""&&(g.push(X),x=X.length),k();return}if(z.indexOf(`
|
|
477
477
|
`)===-1&&z.indexOf("\r")===-1){g.push(z),x+=z.length,k();return}g.push(z);const W=g.join("");g.length=0,x=0;const L=Y(W);L!==""&&(g.push(L),x=L.length),k()}function k(){f!==void 0&&(x+b.length<=f||(T=!0,g.length=0,x=0,m=void 0,b="",y=0,S=void 0,n(new Df(`Buffered data exceeded max buffer size of ${f} characters`,{type:"max-buffer-size-exceeded"}))))}function Y(z){let W=0;if(z.indexOf("\r")===-1){let L=z.indexOf(`
|
|
478
478
|
`,W);for(;L!==-1;){if(W===L){y>0&&t({id:m,event:S,data:b}),m=void 0,b="",y=0,S=void 0,W=L+1,L=z.indexOf(`
|
|
479
479
|
`,W);continue}const X=z.charCodeAt(W);if(h2(z,W,X)){const H=z.charCodeAt(W+5)===mi?W+6:W+5,se=z.slice(H,L);if(y===0&&z.charCodeAt(L+1)===d2){t({id:m,event:S,data:se}),m=void 0,b="",S=void 0,W=L+2,L=z.indexOf(`
|
|
@@ -482,4 +482,4 @@ ${se}`,y++}else g2(z,W,X)?S=z.slice(z.charCodeAt(W+6)===mi?W+7:W+6,L)||void 0:N(
|
|
|
482
482
|
`,W)}return z.slice(W)}for(;W<z.length;){const L=z.indexOf("\r",W),X=z.indexOf(`
|
|
483
483
|
`,W);let H=-1;if(L!==-1&&X!==-1?H=L<X?L:X:L!==-1?L===z.length-1?H=-1:H=L:X!==-1&&(H=X),H===-1)break;N(z,W,H),W=H+1,z.charCodeAt(W-1)===HR&&z.charCodeAt(W)===d2&&W++}return z.slice(W)}function N(z,W,L){if(W===L){O();return}const X=z.charCodeAt(W);if(h2(z,W,X)){const he=z.charCodeAt(W+5)===mi?W+6:W+5,$=z.slice(he,L);b=y===0?$:`${b}
|
|
484
484
|
${$}`,y++;return}if(g2(z,W,X)){S=z.slice(z.charCodeAt(W+6)===mi?W+7:W+6,L)||void 0;return}if(X===105&&z.charCodeAt(W+1)===100&&z.charCodeAt(W+2)===58){const he=z.slice(z.charCodeAt(W+3)===mi?W+4:W+3,L);he.includes("\0")||(m=he);return}if(X===58){if(c){const he=z.slice(W,L);c(he.slice(z.charCodeAt(W+1)===mi?2:1))}return}const H=z.slice(W,L),se=H.indexOf(":");if(se===-1){I(H,"",H);return}const te=H.slice(0,se),J=H.charCodeAt(se+1)===mi?2:1,ne=H.slice(se+J);I(te,ne,H)}function I(z,W,L){switch(z){case"event":S=W||void 0;break;case"data":b=y===0?W:`${b}
|
|
485
|
-
${W}`,y++;break;case"id":W.includes("\0")||(m=W);break;case"retry":/^\d+$/.test(W)?o(parseInt(W,10)):n(new Df(`Invalid \`retry\` value: "${W}"`,{type:"invalid-retry",value:W,line:L}));break;default:n(new Df(`Unknown field "${z.length>20?`${z.slice(0,20)}…`:z}"`,{type:"unknown-field",field:z,value:W,line:L}));break}}function O(){y>0&&t({id:m,event:S,data:b}),m=void 0,b="",y=0,S=void 0}function j(z={}){if(z.consume&&g.length>0){const W=g.join("");N(W,0,W.length)}w=!0,m=void 0,b="",y=0,S=void 0,g.length=0,x=0,T=!1}return{feed:D,reset:j}}function h2(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function g2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class p2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(m2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(m2(this),n)}}function XR(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function q1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(q1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${q1(e.cause)}`:e.message:`${e}`}function m2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Hv=e=>{throw TypeError(e)},U0=(e,t,n)=>t.has(e)||Hv("Cannot "+n),Ae=(e,t,n)=>(U0(e,t,"read from private field"),n?n.call(e):t.get(e)),yt=(e,t,n)=>t.has(e)?Hv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,o)=>(U0(e,t,"write to private field"),t.set(e,n),n),gn=(e,t,n)=>(U0(e,t,"access private method"),n),ir,vi,Zi,_l,gc,No,hs,ko,Vn,Qi,Es,qi,xo,Fr,J1,ed,td,x2,rd,nd,wo,id,sd;let Ol=class extends EventTarget{constructor(t,n){var o,c;super(),yt(this,Fr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,yt(this,ir),yt(this,vi),yt(this,Zi),yt(this,_l),yt(this,gc),yt(this,No),yt(this,hs),yt(this,ko,null),yt(this,Vn),yt(this,Qi),yt(this,Es,null),yt(this,qi,null),yt(this,xo,null),yt(this,ed,async f=>{var g;Ae(this,Qi).reset();const{body:x,redirected:w,status:m,headers:b}=f;if(m===204){gn(this,Fr,wo).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(w?Ze(this,Zi,new URL(f.url)):Ze(this,Zi,void 0),m!==200){gn(this,Fr,wo).call(this,`Non-200 status code (${m})`,m);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){gn(this,Fr,wo).call(this,'Invalid content type, expected "text/event-stream"',m);return}if(Ae(this,ir)===this.CLOSED)return;Ze(this,ir,this.OPEN);const y=new Event("open");if((g=Ae(this,xo))==null||g.call(this,y),this.dispatchEvent(y),typeof x!="object"||!x||!("getReader"in x)){gn(this,Fr,wo).call(this,"Invalid response body, expected a web ReadableStream",m),this.close();return}const S=new TextDecoder,T=x.getReader();let D=!0;do{const{done:k,value:Y}=await T.read();Y&&Ae(this,Qi).feed(S.decode(Y,{stream:!k})),k&&(D=!1,Ae(this,Qi).reset(),gn(this,Fr,id).call(this))}while(D)}),yt(this,td,f=>{Ze(this,Vn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&gn(this,Fr,id).call(this,q1(f))}),yt(this,rd,f=>{typeof f.id=="string"&&Ze(this,ko,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ae(this,Zi)?Ae(this,Zi).origin:Ae(this,vi).origin,lastEventId:f.id||""});Ae(this,qi)&&(!f.event||f.event==="message")&&Ae(this,qi).call(this,g),this.dispatchEvent(g)}),yt(this,nd,f=>{Ze(this,No,f)}),yt(this,sd,()=>{Ze(this,hs,void 0),Ae(this,ir)===this.CONNECTING&&gn(this,Fr,J1).call(this)});try{if(t instanceof URL)Ze(this,vi,t);else if(typeof t=="string")Ze(this,vi,new URL(t,YR()));else throw new Error("Invalid URL")}catch{throw XR("An invalid or illegal string was specified")}Ze(this,Qi,GR({onEvent:Ae(this,rd),onRetry:Ae(this,nd)})),Ze(this,ir,this.CONNECTING),Ze(this,No,3e3),Ze(this,gc,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Ze(this,_l,(c=n==null?void 0:n.withCredentials)!=null?c:!1),gn(this,Fr,J1).call(this)}get readyState(){return Ae(this,ir)}get url(){return Ae(this,vi).href}get withCredentials(){return Ae(this,_l)}get onerror(){return Ae(this,Es)}set onerror(t){Ze(this,Es,t)}get onmessage(){return Ae(this,qi)}set onmessage(t){Ze(this,qi,t)}get onopen(){return Ae(this,xo)}set onopen(t){Ze(this,xo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ae(this,hs)&&clearTimeout(Ae(this,hs)),Ae(this,ir)!==this.CLOSED&&(Ae(this,Vn)&&Ae(this,Vn).abort(),Ze(this,ir,this.CLOSED),Ze(this,Vn,void 0))}};ir=new WeakMap,vi=new WeakMap,Zi=new WeakMap,_l=new WeakMap,gc=new WeakMap,No=new WeakMap,hs=new WeakMap,ko=new WeakMap,Vn=new WeakMap,Qi=new WeakMap,Es=new WeakMap,qi=new WeakMap,xo=new WeakMap,Fr=new WeakSet,J1=function(){Ze(this,ir,this.CONNECTING),Ze(this,Vn,new AbortController),Ae(this,gc)(Ae(this,vi),gn(this,Fr,x2).call(this)).then(Ae(this,ed)).catch(Ae(this,td))},ed=new WeakMap,td=new WeakMap,x2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ae(this,ko)?{"Last-Event-ID":Ae(this,ko)}:void 0},cache:"no-store",signal:(e=Ae(this,Vn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},rd=new WeakMap,nd=new WeakMap,wo=function(e,t){var n;Ae(this,ir)!==this.CLOSED&&Ze(this,ir,this.CLOSED);const o=new p2("error",{code:t,message:e});(n=Ae(this,Es))==null||n.call(this,o),this.dispatchEvent(o)},id=function(e,t){var n;if(Ae(this,ir)===this.CLOSED)return;Ze(this,ir,this.CONNECTING);const o=new p2("error",{code:t,message:e});(n=Ae(this,Es))==null||n.call(this,o),this.dispatchEvent(o),Ze(this,hs,setTimeout(Ae(this,sd),Ae(this,No)))},sd=new WeakMap,Ol.CONNECTING=0,Ol.OPEN=1,Ol.CLOSED=2;function YR(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}x7();I9();O9();D9();B9();h9({baseUrl:()=>ra,source:"webapp"});document.body.dataset.webShell="1";const Qc=new rT,ii=LR(),Gv=Qc.isNativeApp()||!!ii;Gv&&(document.body.dataset.nativeApp="1");jR();if(!Qc.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Fg.find(o=>o.id===Ul.getState().skin)??Fg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ul.subscribe(e)}const qc=globalThis.fetch.bind(globalThis),pt=Qc.isNativeApp()&&!ii?new $v(new Wv,qc):null,ta=ii?FR(ii):pt==null?void 0:pt.fetch;ii&&ta&&(globalThis.fetch=Vv(ii.origin,location.href,{fetch:ta},qc));const pc=new c9(ta),KR=window.parent===window?void 0:new V9,ZR=window.parent===window?void 0:new eT;let ra="";async function w2(e){const{wsNonce:t}=await pc.get("/api/web-console/bootstrap"),n=new URL(e,ra||location.href);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("nonce",t),new WebSocket(n)}const v2=new v9(pc,new b9,KR,e=>ta?new Ol(ra+e,{fetch:ta}):new EventSource(ra+e),new E9({openSocket:()=>w2("/ws/voice")}),new C9(()=>w2("/ws/voice/tts")));window.browserLiveApi=ZR;const Xv=document.getElementById("root");if(!Xv)throw new Error("#root missing");const Do=bv(Xv);pt&&window.parent===window&&Do.render(B.jsx(L0,{}));function QR(){return pe.useEffect(()=>{F9()},[]),null}(async()=>{pt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new tT(Qc,new Iv,new iT(pt?async(n,o)=>{const c=un.parse(String(n));return c&&await pt.resume(c),pt.fetch(n,o)}:void 0));if(ii){await ad(un.parse(ii.origin));return}const t=await e.planStartup();if(t.mode==="setup"){od(t.failure);return}await ad(t.mode==="ready"?t.endpoint:null)})().catch(e=>{pt&&od(e instanceof Error?e.message:"连接失败,请重新扫码。")});function od(e=""){globalThis.fetch=qc,delete window.__agentroamNativeFrame,Do.render(B.jsx(zT,{initialFailure:e,onScan:async()=>{const t=await zv();if(!t||!pt)return;const n=await pt.pair(t);Q1(n),await ad(n)}}))}async function ad(e){try{if(e&&(await(pt==null?void 0:pt.resume(e)),pc.setBaseUrl(e.url),ra=e.url),pt&&e&&window.parent===window){await BR(Do,e,pt,qc),setInterval(()=>{pt.checkAuthorization().catch(()=>{})},1e4);return}window.agentApi=v2,await v2.refreshServerModel(),!Gv&&window.parent===window&&VR(pc);const t=new URLSearchParams(location.search).get("view"),{default:n}=t==="collaboration"?await yi(()=>import("./CollaborationPage-BS3Z5dAy.js").then(o=>o.a),__vite__mapDeps([8,3,9,10,6,11,2]),import.meta.url):t==="collaboration-dashboard"?await yi(()=>import("./CollaborationDashboard-qQQqXrQI.js").then(o=>o.b),__vite__mapDeps([12,6,13,2,4,9,10,14]),import.meta.url):t==="remote-desktop"?await yi(()=>import("./RemoteDesktopPage-B1AGyJrT.js"),__vite__mapDeps([15,16,11,5,17,2,7]),import.meta.url):await yi(()=>import("./App-DQqv62sH.js"),__vite__mapDeps([18,5,2,3,1,8,9,10,6,11,16,17,19,4,20,13,12,14,21,22,23,24]),import.meta.url);Do.render(B.jsxs(pe.StrictMode,{children:[B.jsx(w7.Provider,{value:B.jsx(o9,{}),children:B.jsx(n,{})}),B.jsx(QR,{})]})),pt&&setInterval(()=>{pt.checkAuthorization().catch(()=>{})},1e4),e||(window.addEventListener("webapp:unauthorized",()=>location.reload()),qR())}catch(t){if(pt&&window.parent===window){od(t instanceof Error?t.message:"连接失败,请重新扫码。");return}Do.render(B.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:B.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[B.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),B.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:t instanceof Error?`${t.name}: ${t.message}`:String(t)}),B.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function qR(){const e=[...document.scripts].map(n=>n.src).join(",").match(/index-([^/]+)\.js/),t=e?e[1]:null;t&&setInterval(async()=>{try{const n=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(n.status===401||n.status===423){location.reload();return}const c=((await n.json()).buildId||"").replace(/^index-|\.js$/g,"");c&&c!==t&&location.reload()}catch{}},6e4)}export{H9 as $,LT as A,w7 as B,K1 as C,Rv as D,fT as E,r_ as F,U9 as G,f_ as H,o_ as I,a_ as J,L0 as K,gT as L,mT as M,TT as N,s_ as O,yT as P,X9 as Q,Nv as R,OT as S,G9 as T,ET as U,IT as V,Lv as W,AT as X,RT as Y,t_ as Z,n_ as _,_R as a,yi as a0,z3 as a1,H7 as a2,CT as a3,M9 as a4,MT as a5,H1 as a6,UT as a7,JR as a8,Fg as a9,e_ as aa,VT as b,At as c,dT as d,cT as e,Oo as f,wT as g,xn as h,q7 as i,B as j,y2 as k,xT as l,l_ as m,Mv as n,Pv as o,KT as p,i_ as q,pe as r,YT as s,ZT as t,Ul as u,c_ as v,XT as w,hT as x,u_ as y,vT as z};
|
|
485
|
+
${W}`,y++;break;case"id":W.includes("\0")||(m=W);break;case"retry":/^\d+$/.test(W)?o(parseInt(W,10)):n(new Df(`Invalid \`retry\` value: "${W}"`,{type:"invalid-retry",value:W,line:L}));break;default:n(new Df(`Unknown field "${z.length>20?`${z.slice(0,20)}…`:z}"`,{type:"unknown-field",field:z,value:W,line:L}));break}}function O(){y>0&&t({id:m,event:S,data:b}),m=void 0,b="",y=0,S=void 0}function j(z={}){if(z.consume&&g.length>0){const W=g.join("");N(W,0,W.length)}w=!0,m=void 0,b="",y=0,S=void 0,g.length=0,x=0,T=!1}return{feed:D,reset:j}}function h2(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function g2(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class p2 extends Event{constructor(t,n){var o,c;super(t),this.code=(o=n==null?void 0:n.code)!=null?o:void 0,this.message=(c=n==null?void 0:n.message)!=null?c:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,o){return o(m2(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(m2(this),n)}}function XR(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function q1(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(q1).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${q1(e.cause)}`:e.message:`${e}`}function m2(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Hv=e=>{throw TypeError(e)},U0=(e,t,n)=>t.has(e)||Hv("Cannot "+n),Ae=(e,t,n)=>(U0(e,t,"read from private field"),n?n.call(e):t.get(e)),yt=(e,t,n)=>t.has(e)?Hv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=(e,t,n,o)=>(U0(e,t,"write to private field"),t.set(e,n),n),gn=(e,t,n)=>(U0(e,t,"access private method"),n),ir,vi,Zi,_l,gc,No,hs,ko,Vn,Qi,Es,qi,xo,Fr,J1,ed,td,x2,rd,nd,wo,id,sd;let Ol=class extends EventTarget{constructor(t,n){var o,c;super(),yt(this,Fr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,yt(this,ir),yt(this,vi),yt(this,Zi),yt(this,_l),yt(this,gc),yt(this,No),yt(this,hs),yt(this,ko,null),yt(this,Vn),yt(this,Qi),yt(this,Es,null),yt(this,qi,null),yt(this,xo,null),yt(this,ed,async f=>{var g;Ae(this,Qi).reset();const{body:x,redirected:w,status:m,headers:b}=f;if(m===204){gn(this,Fr,wo).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(w?Ze(this,Zi,new URL(f.url)):Ze(this,Zi,void 0),m!==200){gn(this,Fr,wo).call(this,`Non-200 status code (${m})`,m);return}if(!(b.get("content-type")||"").startsWith("text/event-stream")){gn(this,Fr,wo).call(this,'Invalid content type, expected "text/event-stream"',m);return}if(Ae(this,ir)===this.CLOSED)return;Ze(this,ir,this.OPEN);const y=new Event("open");if((g=Ae(this,xo))==null||g.call(this,y),this.dispatchEvent(y),typeof x!="object"||!x||!("getReader"in x)){gn(this,Fr,wo).call(this,"Invalid response body, expected a web ReadableStream",m),this.close();return}const S=new TextDecoder,T=x.getReader();let D=!0;do{const{done:k,value:Y}=await T.read();Y&&Ae(this,Qi).feed(S.decode(Y,{stream:!k})),k&&(D=!1,Ae(this,Qi).reset(),gn(this,Fr,id).call(this))}while(D)}),yt(this,td,f=>{Ze(this,Vn,void 0),!(f.name==="AbortError"||f.type==="aborted")&&gn(this,Fr,id).call(this,q1(f))}),yt(this,rd,f=>{typeof f.id=="string"&&Ze(this,ko,f.id);const g=new MessageEvent(f.event||"message",{data:f.data,origin:Ae(this,Zi)?Ae(this,Zi).origin:Ae(this,vi).origin,lastEventId:f.id||""});Ae(this,qi)&&(!f.event||f.event==="message")&&Ae(this,qi).call(this,g),this.dispatchEvent(g)}),yt(this,nd,f=>{Ze(this,No,f)}),yt(this,sd,()=>{Ze(this,hs,void 0),Ae(this,ir)===this.CONNECTING&&gn(this,Fr,J1).call(this)});try{if(t instanceof URL)Ze(this,vi,t);else if(typeof t=="string")Ze(this,vi,new URL(t,YR()));else throw new Error("Invalid URL")}catch{throw XR("An invalid or illegal string was specified")}Ze(this,Qi,GR({onEvent:Ae(this,rd),onRetry:Ae(this,nd)})),Ze(this,ir,this.CONNECTING),Ze(this,No,3e3),Ze(this,gc,(o=n==null?void 0:n.fetch)!=null?o:globalThis.fetch),Ze(this,_l,(c=n==null?void 0:n.withCredentials)!=null?c:!1),gn(this,Fr,J1).call(this)}get readyState(){return Ae(this,ir)}get url(){return Ae(this,vi).href}get withCredentials(){return Ae(this,_l)}get onerror(){return Ae(this,Es)}set onerror(t){Ze(this,Es,t)}get onmessage(){return Ae(this,qi)}set onmessage(t){Ze(this,qi,t)}get onopen(){return Ae(this,xo)}set onopen(t){Ze(this,xo,t)}addEventListener(t,n,o){const c=n;super.addEventListener(t,c,o)}removeEventListener(t,n,o){const c=n;super.removeEventListener(t,c,o)}close(){Ae(this,hs)&&clearTimeout(Ae(this,hs)),Ae(this,ir)!==this.CLOSED&&(Ae(this,Vn)&&Ae(this,Vn).abort(),Ze(this,ir,this.CLOSED),Ze(this,Vn,void 0))}};ir=new WeakMap,vi=new WeakMap,Zi=new WeakMap,_l=new WeakMap,gc=new WeakMap,No=new WeakMap,hs=new WeakMap,ko=new WeakMap,Vn=new WeakMap,Qi=new WeakMap,Es=new WeakMap,qi=new WeakMap,xo=new WeakMap,Fr=new WeakSet,J1=function(){Ze(this,ir,this.CONNECTING),Ze(this,Vn,new AbortController),Ae(this,gc)(Ae(this,vi),gn(this,Fr,x2).call(this)).then(Ae(this,ed)).catch(Ae(this,td))},ed=new WeakMap,td=new WeakMap,x2=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ae(this,ko)?{"Last-Event-ID":Ae(this,ko)}:void 0},cache:"no-store",signal:(e=Ae(this,Vn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},rd=new WeakMap,nd=new WeakMap,wo=function(e,t){var n;Ae(this,ir)!==this.CLOSED&&Ze(this,ir,this.CLOSED);const o=new p2("error",{code:t,message:e});(n=Ae(this,Es))==null||n.call(this,o),this.dispatchEvent(o)},id=function(e,t){var n;if(Ae(this,ir)===this.CLOSED)return;Ze(this,ir,this.CONNECTING);const o=new p2("error",{code:t,message:e});(n=Ae(this,Es))==null||n.call(this,o),this.dispatchEvent(o),Ze(this,hs,setTimeout(Ae(this,sd),Ae(this,No)))},sd=new WeakMap,Ol.CONNECTING=0,Ol.OPEN=1,Ol.CLOSED=2;function YR(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}x7();I9();O9();D9();B9();h9({baseUrl:()=>ra,source:"webapp"});document.body.dataset.webShell="1";const Qc=new rT,ii=LR(),Gv=Qc.isNativeApp()||!!ii;Gv&&(document.body.dataset.nativeApp="1");jR();if(!Qc.isNativeApp()&&window.parent===window){const e=document.createElement("link");e.rel="manifest",e.href="/manifest.webmanifest",document.head.append(e);const t=document.querySelector('link[rel="apple-touch-icon"]');t&&(t.href="/pwa/icon-192.png");const n=document.createElement("script");n.src="/pwa/install.js",document.head.append(n)}if(window.parent===window){const e=()=>{const t=Fg.find(o=>o.id===Ul.getState().skin)??Fg[0];document.body.style.background=t.preview[0];let n=document.querySelector('meta[name="theme-color"]');n||(n=document.createElement("meta"),n.name="theme-color",document.head.append(n)),n.content=t.preview[0]};e(),Ul.subscribe(e)}const qc=globalThis.fetch.bind(globalThis),pt=Qc.isNativeApp()&&!ii?new $v(new Wv,qc):null,ta=ii?FR(ii):pt==null?void 0:pt.fetch;ii&&ta&&(globalThis.fetch=Vv(ii.origin,location.href,{fetch:ta},qc));const pc=new c9(ta),KR=window.parent===window?void 0:new V9,ZR=window.parent===window?void 0:new eT;let ra="";async function w2(e){const{wsNonce:t}=await pc.get("/api/web-console/bootstrap"),n=new URL(e,ra||location.href);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("nonce",t),new WebSocket(n)}const v2=new v9(pc,new b9,KR,e=>ta?new Ol(ra+e,{fetch:ta}):new EventSource(ra+e),new E9({openSocket:()=>w2("/ws/voice")}),new C9(()=>w2("/ws/voice/tts")));window.browserLiveApi=ZR;const Xv=document.getElementById("root");if(!Xv)throw new Error("#root missing");const Do=bv(Xv);pt&&window.parent===window&&Do.render(B.jsx(L0,{}));function QR(){return pe.useEffect(()=>{F9()},[]),null}(async()=>{pt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const e=new tT(Qc,new Iv,new iT(pt?async(n,o)=>{const c=un.parse(String(n));return c&&await pt.resume(c),pt.fetch(n,o)}:void 0));if(ii){await ad(un.parse(ii.origin));return}const t=await e.planStartup();if(t.mode==="setup"){od(t.failure);return}await ad(t.mode==="ready"?t.endpoint:null)})().catch(e=>{pt&&od(e instanceof Error?e.message:"连接失败,请重新扫码。")});function od(e=""){globalThis.fetch=qc,delete window.__agentroamNativeFrame,Do.render(B.jsx(zT,{initialFailure:e,onScan:async()=>{const t=await zv();if(!t||!pt)return;const n=await pt.pair(t);Q1(n),await ad(n)}}))}async function ad(e){try{if(e&&(await(pt==null?void 0:pt.resume(e)),pc.setBaseUrl(e.url),ra=e.url),pt&&e&&window.parent===window){await BR(Do,e,pt,qc),setInterval(()=>{pt.checkAuthorization().catch(()=>{})},1e4);return}window.agentApi=v2,await v2.refreshServerModel(),!Gv&&window.parent===window&&VR(pc);const t=new URLSearchParams(location.search).get("view"),{default:n}=t==="collaboration"?await yi(()=>import("./CollaborationPage-tTPizQue.js").then(o=>o.a),__vite__mapDeps([8,3,9,10,6,11,2]),import.meta.url):t==="collaboration-dashboard"?await yi(()=>import("./CollaborationDashboard-cjhodfE8.js").then(o=>o.b),__vite__mapDeps([12,6,13,2,4,9,10,14]),import.meta.url):t==="remote-desktop"?await yi(()=>import("./RemoteDesktopPage-CRgO_MeY.js"),__vite__mapDeps([15,16,11,5,17,2,7]),import.meta.url):await yi(()=>import("./App-sT3zFETY.js"),__vite__mapDeps([18,5,2,3,1,8,9,10,6,11,16,17,19,4,20,13,12,14,21,22,23,24]),import.meta.url);Do.render(B.jsxs(pe.StrictMode,{children:[B.jsx(w7.Provider,{value:B.jsx(o9,{}),children:B.jsx(n,{})}),B.jsx(QR,{})]})),pt&&setInterval(()=>{pt.checkAuthorization().catch(()=>{})},1e4),e||(window.addEventListener("webapp:unauthorized",()=>location.reload()),qR())}catch(t){if(pt&&window.parent===window){od(t instanceof Error?t.message:"连接失败,请重新扫码。");return}Do.render(B.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:B.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[B.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),B.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:t instanceof Error?`${t.name}: ${t.message}`:String(t)}),B.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function qR(){const e=[...document.scripts].map(n=>n.src).join(",").match(/index-([^/]+)\.js/),t=e?e[1]:null;t&&setInterval(async()=>{try{const n=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(n.status===401||n.status===423){location.reload();return}const c=((await n.json()).buildId||"").replace(/^index-|\.js$/g,"");c&&c!==t&&location.reload()}catch{}},6e4)}export{H9 as $,LT as A,w7 as B,K1 as C,Rv as D,fT as E,r_ as F,U9 as G,f_ as H,o_ as I,a_ as J,L0 as K,gT as L,mT as M,TT as N,s_ as O,yT as P,X9 as Q,Nv as R,OT as S,G9 as T,ET as U,IT as V,Lv as W,AT as X,RT as Y,t_ as Z,n_ as _,_R as a,yi as a0,z3 as a1,H7 as a2,CT as a3,M9 as a4,MT as a5,H1 as a6,UT as a7,JR as a8,Fg as a9,e_ as aa,VT as b,At as c,dT as d,cT as e,Oo as f,wT as g,xn as h,q7 as i,B as j,y2 as k,xT as l,l_ as m,Mv as n,Pv as o,KT as p,i_ as q,pe as r,YT as s,ZT as t,Ul as u,c_ as v,XT as w,hT as x,u_ as y,vT as z};
|