sliccy 6.181.0 → 6.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/.vite/manifest.json +274 -266
- package/dist/ui/assets/SKILL-B4YYagrM.js +1 -0
- package/dist/ui/assets/{SKILL-BpMlcVho.js → SKILL-BbKu0tAh.js} +1 -1
- package/dist/ui/assets/{SKILL-DGelbGt_.js → SKILL-CG7Xvjv7.js} +1 -1
- package/dist/ui/assets/__vite-browser-external-CJkRLpJ-.js +1 -0
- package/dist/ui/assets/{account-store-J3ybiSNw.js → account-store-Ce44FdYj.js} +2 -2
- package/dist/ui/assets/{account-store-0RMtbmqz.js → account-store-D0ciUU3U.js} +1 -1
- package/dist/ui/assets/{adobe-YOeKKYUk.js → adobe-FgsPWBjV.js} +2 -2
- package/dist/ui/assets/{adobe-DEXpooxf.js → adobe-j1r9Po8o.js} +1 -1
- package/dist/ui/assets/{agent-panels-B4hlhzVG.js → agent-panels-DcVWQZVh.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-BR1Hr6tM.js → almost-bash-shell-headless-CsDQjWSX.js} +270 -270
- package/dist/ui/assets/{apply-layout-BgFVMSBx.js → apply-layout-6-QTVrMq.js} +1 -1
- package/dist/ui/assets/{apps-oyrUmtWx.js → apps-C20mWJ8w.js} +1 -1
- package/dist/ui/assets/{azure-openai-Ytc_MWDd.js → azure-openai-CTmHX_BT.js} +1 -1
- package/dist/ui/assets/{azure-openai-B6qTFVGv.js → azure-openai-CotI4RBJ.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-CEXlx0cW.js → backend-hostfs-D46_hViH.js} +1 -1
- package/dist/ui/assets/{browser-DG5MjvHF.js → browser-BM_DFzrh.js} +2 -2
- package/dist/ui/assets/{bsh-watchdog-DBtF-C4h.js → bsh-watchdog-CmaS7wa9.js} +1 -1
- package/dist/ui/assets/{capability-C8I_18AN.js → capability-BgC-ru0t.js} +2 -2
- package/dist/ui/assets/{cdp-DVWJozRc.js → cdp-BvPARz8i.js} +1 -1
- package/dist/ui/assets/{cerebras-BT44OLPt.js → cerebras-CGndqdHt.js} +1 -1
- package/dist/ui/assets/{cerebras-brHRFUH2.js → cerebras-DG7lHBt1.js} +1 -1
- package/dist/ui/assets/{client-Sb_wIqH2.js → client-CmfvXtLV.js} +1 -1
- package/dist/ui/assets/{composer-speech-BZQtz7u1.js → composer-speech-C2InwNBM.js} +1 -1
- package/dist/ui/assets/{connect-surface-D7cq2QI7.js → connect-surface-EWOA61l_.js} +1 -1
- package/dist/ui/assets/{core-B3ULTK7V.js → core-Be1yHH6v.js} +1 -1
- package/dist/ui/assets/{core-aQUekdF7.js → core-D-Fp1HL2.js} +2 -2
- package/dist/ui/assets/{cost-command-DZQVtgRS.js → cost-command-CitGzr6C.js} +1 -1
- package/dist/ui/assets/{directed-approval-DvAxEX5J.js → directed-approval-6QIzcmF_.js} +1 -1
- package/dist/ui/assets/{discovery-preference-C7kFEKRM.js → discovery-preference-MWZVi-PZ.js} +1 -1
- package/dist/ui/assets/dist-C8ZpEU8V.js +3 -0
- package/dist/ui/assets/{emscripten-vfs-hook-agmT6Hsz.js → emscripten-vfs-hook-B9KkLncp.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-CQ05z2Xw.js → ensure-speech-assets-C3v1Nu2n.js} +1 -1
- package/dist/ui/assets/{esbuild-wasm-DS_YG2EY.js → esbuild-wasm-CeZYVyQ9.js} +1 -1
- package/dist/ui/assets/{extension-ops-CmuqbGmo.js → extension-ops-DTRUyGkx.js} +1 -1
- package/dist/ui/assets/{ffmpeg-wasm-B77gfnB_.js → ffmpeg-wasm-CV1BmGNS.js} +1 -1
- package/dist/ui/assets/{float-topology-BvkgNLoi.js → float-topology-B0_dG7En.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-B8Kk1WcF.js → follower-navigate-watcher-DVWQWTGU.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-qxZ9jGOV.js → frozen-archive-writer-DMShgEqJ.js} +1 -1
- package/dist/ui/assets/{fs-Dkh-H6Cd.js → fs-JF56Nord.js} +2 -2
- package/dist/ui/assets/{fs-D6FCLu_F.js → fs-TVcPtHbB.js} +1 -1
- package/dist/ui/assets/{gelatiere-store-ChogqkEu.js → gelatiere-store-BnAzlDHe.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-DxFUh33e.js → gelatiere-unit-5cS02rOR.js} +1 -1
- package/dist/ui/assets/{github-D31l6kcK.js → github-BJKcZ0cU.js} +2 -2
- package/dist/ui/assets/{github-CrHzeKQ8.js → github-DsvjkXr7.js} +1 -1
- package/dist/ui/assets/{github-auth-VTbKhlbJ.js → github-auth-Crm1hubQ.js} +1 -1
- package/dist/ui/assets/{github-copilot-eUb4Djg_.js → github-copilot-BWhNAowY.js} +1 -1
- package/dist/ui/assets/{github-copilot-CVwHDKPD.js → github-copilot-ngj7NQ16.js} +1 -1
- package/dist/ui/assets/{github-install-Dkt1u6HU.js → github-install-DB3-4PDg.js} +1 -1
- package/dist/ui/assets/{github-zip-B6gHXxqd.js → github-zip-CfS9P2dH.js} +1 -1
- package/dist/ui/assets/{guest-tool-gate-YxkVsl15.js → guest-tool-gate-B2z1ggE_.js} +1 -1
- package/dist/ui/assets/{hear-BKQjhhNP.js → hear-akPMJ6kC.js} +1 -1
- package/dist/ui/assets/{help-C7WHd3Ia.js → help-CNHuyT-F.js} +1 -1
- package/dist/ui/assets/{host-command-ODKvqvjN.js → host-command-PUA7nfMk.js} +1 -1
- package/dist/ui/assets/{installer-D35TzRKw.js → installer-CzQ_lEMz.js} +1 -1
- package/dist/ui/assets/{interrupted-work-recovery-BK9ZDM7F.js → interrupted-work-recovery-r9fITX8G.js} +1 -1
- package/dist/ui/assets/js-realm-worker-EkjzOn2Q.js +53 -0
- package/dist/ui/assets/jsh-executor-C849KexO.js +18 -0
- package/dist/ui/assets/{kernel-worker-UUfeG-Eg.js → kernel-worker-B69_4v-D.js} +10 -10
- package/dist/ui/assets/{lick-ws-bridge-DoyPgrSr.js → lick-ws-bridge-BygSyyxa.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-DdgwrW91.js → lick-ws-bridge-DDMdP2AB.js} +1 -1
- package/dist/ui/assets/{live-session-curation-6O9TA5qM.js → live-session-curation-BfplChNV.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-D_7T7FHe.js → live-session-snapshot-BQQH-IkA.js} +1 -1
- package/dist/ui/assets/{local-llm-BYaSa2xI.js → local-llm-BSMA7cC5.js} +1 -1
- package/dist/ui/assets/{local-llm-TK4oGrWD.js → local-llm-CNznNtp9.js} +1 -1
- package/dist/ui/assets/{magick-wasm-DCNZhAyd.js → magick-wasm-KFp97Nzb.js} +1 -1
- package/dist/ui/assets/{main-Bgkf5d3Z.js → main-BsG-jtvC.js} +3 -3
- package/dist/ui/assets/{main-cherry-BUdIAeG5.js → main-cherry-7eVbk29W.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-CNOuxuz4.js → memory-curation-seam-z19QoOG6.js} +1 -1
- package/dist/ui/assets/{memory-health-BSo0HKQx.js → memory-health-CL5kYVAr.js} +1 -1
- package/dist/ui/assets/{memory-write-execute-mQfg-aG4.js → memory-write-execute-C_oehZl_.js} +1 -1
- package/dist/ui/assets/{mount-h-dwh5GL.js → mount-BvxmwqOG.js} +3 -3
- package/dist/ui/assets/{mount-BpcQX-Sq.js → mount-JNIgSYT5.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-C4Ti1B85.js → mount-bridge-client-CaHZ1pkb.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-BMkDfg_K.js → mount-bridge-client-DRVFK3mJ.js} +1 -1
- package/dist/ui/assets/{new-session-CTx7YRbr.js → new-session-qNCtGIiI.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-B18nfDG4.js → oauth-bootstrap-F0HvaeYA.js} +2 -2
- package/dist/ui/assets/{oauth-service-CxXBA9rC.js → oauth-service-Dn_Xz1FZ.js} +1 -1
- package/dist/ui/assets/{oauth-service-B8mWc7rY.js → oauth-service-_PUd0RqU.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-Df3UDgbD.js → onboarding-orchestrator-OKDMP2X_.js} +1 -1
- package/dist/ui/assets/{openai-codex-Cu1dT_JE.js → openai-codex-6hCaJG3N.js} +1 -1
- package/dist/ui/assets/{openai-codex-DBUtEEk3.js → openai-codex-BbYHsYuO.js} +1 -1
- package/dist/ui/assets/{openrouter-BwrZKpwu.js → openrouter-BPYQjzK5.js} +1 -1
- package/dist/ui/assets/{openrouter-CrB0BbnV.js → openrouter-BstowyUr.js} +1 -1
- package/dist/ui/assets/{openrouter-free-B_LRYNX8.js → openrouter-free-B1qsiSWg.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CXqUunRn.js → openrouter-free-DMavbTS5.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Bpzo9cvY.js → openrouter-oauth-CYZRlFsL.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Bnohq7Ac.js → openrouter-oauth-DrKARZLe.js} +1 -1
- package/dist/ui/assets/{opfs-mount-CmDtZOGy.js → opfs-mount-D3x0tHeU.js} +1 -1
- package/dist/ui/assets/{page-approval-service-CYpStEUs.js → page-approval-service-DRZEjhrX.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BFG-ZvfW.js → panel-rpc-handlers-CiSSOSEo.js} +2 -2
- package/dist/ui/assets/{panelize-shell-CLHSr5bz.js → panelize-shell-CILi0yPu.js} +4 -4
- package/dist/ui/assets/{pi-edit-execution-wHbJ4R48.js → pi-edit-execution-CEUeI3PX.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-CrZ9vnOK.js → port-bridge-client-BiWcfZSc.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-BHH6FPBY.js → port-bridge-client-BvO-1Rao.js} +1 -1
- package/dist/ui/assets/{provider-BXK9OD8Z.js → provider-CPes-oeu.js} +2 -2
- package/dist/ui/assets/{provider-DyqdvQeZ.js → provider-Dv9W3IvY.js} +1 -1
- package/dist/ui/assets/{provider-settings-BO6Fedc5.js → provider-settings-CDcPLuoa.js} +1 -1
- package/dist/ui/assets/provider-store-access-B7yFT4hY.js +1 -0
- package/dist/ui/assets/provider-store-access-D2Rj0Y-3.js +1 -0
- package/dist/ui/assets/{providers-BvApGkM9.js → providers-COWrD21n.js} +2 -2
- package/dist/ui/assets/{providers-CAcycJZb.js → providers-DLk_1jra.js} +1 -1
- package/dist/ui/assets/proxied-fetch-DiXk_XGs.js +2 -0
- package/dist/ui/assets/proxied-fetch-J19bK2dG.js +1 -0
- package/dist/ui/assets/{py-live-vfs-Di71Rd2P.js → py-live-vfs-DMc0LhCg.js} +12 -0
- package/dist/ui/assets/{py-live-vfs-CJWt_6ye.js → py-live-vfs-Dm8bBjqR.js} +12 -0
- package/dist/ui/assets/py-realm-worker-BaO89JAR.js +255 -0
- package/dist/ui/assets/{pyodide-W71AWfnt.js → pyodide-DY17DXNV.js} +2 -2
- package/dist/ui/assets/{quick-llm-BENSRBxD.js → quick-llm-ByDw79ph.js} +1 -1
- package/dist/ui/assets/realm-inprocess-BLSq-cQS.js +33 -0
- package/dist/ui/assets/{recovery-screen-Tq3wGnmV.js → recovery-screen-CldB31e2.js} +1 -1
- package/dist/ui/assets/{redirect-uri-Dnc7Ae7l.js → redirect-uri-DlOE4xJ4.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-C8LiE7Sl.js → remote-terminal-view-BpHAWWeD.js} +1 -1
- package/dist/ui/assets/{require-guards-DPd9EYEo.js → require-guards-DPf5QETL.js} +14 -3
- package/dist/ui/assets/{rest-ops-vPHUnWou.js → rest-ops-CPEMTyP-.js} +1 -1
- package/dist/ui/assets/{rest-ops-DABw6D2a.js → rest-ops-DKsDUOxE.js} +1 -1
- package/dist/ui/assets/{restore-DVP0SPlY.js → restore-CaWVAwJN.js} +1 -1
- package/dist/ui/assets/{run-CPT6_R-_.js → run-2oVsdzZj.js} +2 -2
- package/dist/ui/assets/{run-BGZP3j5p.js → run-BA94mtBB.js} +1 -1
- package/dist/ui/assets/{run-CKp8YCSO.js → run-BOMvKGOX.js} +1 -1
- package/dist/ui/assets/{run-C-OJvA2b.js → run-BP0Pyqp1.js} +1 -1
- package/dist/ui/assets/{run-BKItPKix.js → run-BVlVC7jS.js} +10 -10
- package/dist/ui/assets/{run-CX6BUmN-.js → run-C1e4W7pJ.js} +1 -1
- package/dist/ui/assets/{run-CiUSMP3Y.js → run-CH8M889A.js} +3 -3
- package/dist/ui/assets/{run-zLr2k5ZP.js → run-CHKo3g64.js} +1 -1
- package/dist/ui/assets/{run-BV_OY-0v.js → run-CW0-cog1.js} +1 -1
- package/dist/ui/assets/{run-FyOp8GaC.js → run-Dl4OQ_Yd.js} +1 -1
- package/dist/ui/assets/{screencapture-run-BnyfqO9F.js → screencapture-run-Dt7lEfIp.js} +1 -1
- package/dist/ui/assets/{secret-env-Cazzr31P.js → secret-env-iwcdxjpw.js} +1 -1
- package/dist/ui/assets/secret-topology-CZv6A9HW.js +1 -0
- package/dist/ui/assets/{secrets-bridge-client-CiA-2ZIU.js → secrets-bridge-client-B_CG-HIg.js} +1 -1
- package/dist/ui/assets/{secrets-bridge-client-kWWipUuL.js → secrets-bridge-client-CUClOhLJ.js} +1 -1
- package/dist/ui/assets/{session-command-memory-HovmIuMP.js → session-command-memory-mbpebhz_.js} +2 -2
- package/dist/ui/assets/{session-jsonl-PCOch0_B.js → session-jsonl-BIxfXb7u.js} +1 -1
- package/dist/ui/assets/{session-jsonl-DK-0Hm8U.js → session-jsonl-v8KN4g_6.js} +1 -1
- package/dist/ui/assets/{session-search-index-BNvhiRLv.js → session-search-index-CDR-vSNN.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-2RQqEGaT.js → setup-feature-flags-remote-zauTrEL6.js} +1 -1
- package/dist/ui/assets/{setup-model-catalog-B911rONc.js → setup-model-catalog-CC8KX0LB.js} +1 -1
- package/dist/ui/assets/shared-BDXQKitm.js +1 -0
- package/dist/ui/assets/shared-DfMXB1pm.js +4 -0
- package/dist/ui/assets/{signed-fetch-gB25Bw53.js → signed-fetch-D3crNsSs.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-Brcr76an.js → silent-renew-backoff-Bw_c5Dy9.js} +1 -1
- package/dist/ui/assets/slicc-version-BiZFSvt-.js +1 -0
- package/dist/ui/assets/{snapshot-Ci8jnY_A.js → snapshot-CISX8Ybx.js} +1 -1
- package/dist/ui/assets/{snapshot-features-BYEGCVfZ.js → snapshot-features-NmqWLNc6.js} +1 -1
- package/dist/ui/assets/soundscape-Cmr7xPXZ.js +1 -0
- package/dist/ui/assets/{speak-BT4Xdlvj.js → speak-D1JF7Loc.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-8T1XJmL3.js → sprinkle-manager-DYhvCg3m.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-_vOdPt8H.js → sprinkle-renderer-B5O28doL.js} +16 -16
- package/dist/ui/assets/{ssh-BGtVaOJn.js → ssh-DPyBpV4Z.js} +1 -1
- package/dist/ui/assets/{state-nnDajRje.js → state-CcrU6NJk.js} +1 -1
- package/dist/ui/assets/{store-D9XL9aIQ.js → store-D9HgQRdy.js} +1 -1
- package/dist/ui/assets/{store-BxxMrsS7.js → store-DYTzgtEI.js} +1 -1
- package/dist/ui/assets/{sudo-CnXURhFV.js → sudo-BMKHhJ-G.js} +1 -1
- package/dist/ui/assets/{supervisor-fOZGoD0G.js → supervisor-DVWawJTM.js} +1 -1
- package/dist/ui/assets/{sync-dialog-oh_O9Mv5.js → sync-dialog-a3YQ7KdL.js} +1 -1
- package/dist/ui/assets/{transformers-env-zmBF2In6.js → transformers-env-BFCBqwlr.js} +1 -1
- package/dist/ui/assets/{tray-leader-Co-1rs4b.js → tray-leader-zKkaFxIk.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-PpRt0K76.js → tray-leave-runtime-CNc8g3tP.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-DBapPARd.js → tray-runtime-config-DmcF9Q2r.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-DYuM8Ifi.js → tray-sidecar-DqV3sh8H.js} +1 -1
- package/dist/ui/assets/{turn-journal-_Hrn3Aoy.js → turn-journal-Z3e-huge.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-jhAzOLSL.js → upgrade-detection-Bsvrq_lt.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-D1vFOKgN.js → upskill-lick-skip-BQvJXwS8.js} +1 -1
- package/dist/ui/assets/voice-reply-B_BXV7A4.js +1 -0
- package/dist/ui/assets/{wc-attach-BadBFuc7.js → wc-attach-CEkWqpLf.js} +2 -2
- package/dist/ui/assets/{wc-browser-DqUJaWcH.js → wc-browser-DWwB9l3P.js} +1 -1
- package/dist/ui/assets/{wc-computers-CTPf-95b.js → wc-computers-DuGnds2T.js} +1 -1
- package/dist/ui/assets/{wc-detached-UIVnUZp5.js → wc-detached-Bc462J4O.js} +1 -1
- package/dist/ui/assets/{wc-extension-Bxc7adS3.js → wc-extension-DZmTjBxS.js} +2 -2
- package/dist/ui/assets/{wc-follower-CcQiy0Ep.js → wc-follower-C0olroj0.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-DEBzlhDR.js → wc-follower-oauth-BTOd3V8J.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-B3T_MsYw.js → wc-gelatiere-3BBfbusI.js} +1 -1
- package/dist/ui/assets/wc-live-Cc8h6ZH1.js +428 -0
- package/dist/ui/assets/{wc-nav-Cc31eRBb.js → wc-nav-6f53F2ez.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-A_43Ieo4.js → wc-onboarding-D548eykf.js} +2 -2
- package/dist/ui/assets/{wc-permissions-C9woviuI.js → wc-permissions-B3SJSMf9.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-t7YMeS_j.js → wc-placeholder-BS4TqwFw.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-Dfm9QvyE.js → wc-secret-request-DoSFP6An.js} +1 -1
- package/dist/ui/assets/{wc-settings-BD6JONjg.js → wc-settings-B7zv9hl_.js} +3 -3
- package/dist/ui/assets/{wc-shell-Ba5uNdmF.js → wc-shell-pTQjFXvS.js} +362 -199
- package/dist/ui/assets/{wc-shortcut-config-DeU2Q2BU.js → wc-shortcut-config-87PqTsLw.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-D4sQVRG5.js → wc-sprinkles-BMoFsMix.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-CsUhlwMo.js → wc-transcript-export-CP5fUab6.js} +2 -2
- package/dist/ui/assets/{wc-tray-CwvVidS8.js → wc-tray-DW-miPAR.js} +4 -4
- package/dist/ui/assets/welcome-detection-F6VKt_Ix.js +1 -0
- package/dist/ui/assets/{whisper-session-MB0YiZ0q.js → whisper-session-C90nWMGE.js} +2 -2
- package/dist/ui/assets/{xai-grok-rwJAZiuv.js → xai-grok-D0yrS3by.js} +1 -1
- package/dist/ui/assets/{xai-grok-0BxCS34q.js → xai-grok-U-6wly9W.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +1 -1
- package/dist/ui/assets/SKILL-CWxUIsrD.js +0 -1
- package/dist/ui/assets/__vite-browser-external-BlQ4QU88.js +0 -1
- package/dist/ui/assets/js-realm-worker-BIVxi3Fa.js +0 -50
- package/dist/ui/assets/jsh-executor-DhdH2_yG.js +0 -18
- package/dist/ui/assets/provider-store-access-BFeKOGcv.js +0 -1
- package/dist/ui/assets/provider-store-access-C2X0AryS.js +0 -1
- package/dist/ui/assets/proxied-fetch-BlIpeDaL.js +0 -2
- package/dist/ui/assets/proxied-fetch-CNe6icTW.js +0 -1
- package/dist/ui/assets/py-realm-worker-DLb3nkyD.js +0 -244
- package/dist/ui/assets/realm-inprocess-BBw2Fa8u.js +0 -30
- package/dist/ui/assets/secret-topology-DpJD8DzV.js +0 -1
- package/dist/ui/assets/shared-C_68vn79.js +0 -4
- package/dist/ui/assets/shared-mBEktoxE.js +0 -1
- package/dist/ui/assets/slicc-version-CAje2bW-.js +0 -1
- package/dist/ui/assets/soundscape-CdQvLeB0.js +0 -1
- package/dist/ui/assets/voice-reply--Z1dXvPT.js +0 -1
- package/dist/ui/assets/wc-live-B4gJYGS5.js +0 -428
- package/dist/ui/assets/welcome-detection-CIDbn0ev.js +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./__vite-browser-external-5eBdwsFd.js";import{r as n,t as r}from"./multipart-form-data-DopbgwRR.js";import{n as i}from"./slicc-version-BiZFSvt-.js";import{t as a}from"./buffer-polyfill-BccMjOKj.js";import{t as o}from"./buffer-B5d1xHaH.js";import{F as s,I as c,N as l,P as u}from"./shared-DfMXB1pm.js";import{c as d,n as f,o as p,t as m}from"./require-guards-DPf5QETL.js";import{t as h}from"./tmpdir-env-ate4iNcK.js";import{i as g,n as _,r as v,t as y}from"./realm-sync-transport-Bii99lU6.js";import{t as b}from"./realm-browser-fetch-V3uggGbM.js";function x(e){let t=typeof e==`string`?e:e.href;if(!t.startsWith(`file:`))throw TypeError(`fileURLToPath: not a file URL`);let n=new URL(t);if(n.hostname!==``&&n.hostname!==`localhost`)throw Object.assign(TypeError(`File URL host must be "localhost" or empty on posix`),{code:`ERR_INVALID_FILE_URL_HOST`});if(/%2f/i.test(n.pathname))throw Object.assign(TypeError(`File URL path must not include encoded / characters`),{code:`ERR_INVALID_FILE_URL_PATH`});return decodeURIComponent(n.pathname)}function S(e){let t=e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return new URL(`file://${t}`)}const C={URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams,fileURLToPath:x,pathToFileURL:S};function w(e,t){return Object.assign(TypeError(`The "${e}" argument must be of type string or an instance of Buffer or URL. Received ${t===null?`null`:typeof t}`),{code:`ERR_INVALID_ARG_TYPE`})}function T(e){return typeof e==`object`&&!!e&&typeof e.href==`string`&&typeof e.protocol==`string`}function E(e,t=`path`){if(typeof e==`string`)return e;if(T(e)){if(e.protocol!==`file:`)throw Object.assign(TypeError(`The URL must be of scheme file`),{code:`ERR_INVALID_URL_SCHEME`});return C.fileURLToPath(e.href)}if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw w(t,e)}function D(e,t){let n=[...t];switch(e){case`path`:n[0]=E(n[0]);break;case`fd`:typeof n[0]!=`number`&&(n[0]=E(n[0]));break;case`pair`:n[0]=E(n[0],`src`),n[1]=E(n[1],`dest`);break;case`second`:n[1]=E(n[1])}return n}function O(e,t,n={}){let r=e;for(let i of Object.keys(t)){let a=t[i],o=r[i];!a||typeof o!=`function`||(r[i]=((...t)=>{let r;try{r=D(a,t)}catch(e){if(n.promises)return Promise.reject(e);throw e}return o.apply(e,r)}))}}function k(e){if(!e||e===`/`)return`/`;e.startsWith(`/`)||(e=`/`+e);let t=e.split(`/`),n=[];for(let e of t)e!==``&&e!==`.`&&(e===`..`?n.pop():n.push(e));return`/`+n.join(`/`)}function A(e){let t=k(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function j(e){return Object.assign(Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function ee(e){return Object.assign(Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function te(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var ne=class{tree=new Map;initialPaths=new Set;initialContent=new Map;initialKind=new Map;mkdtempCounter=0;tombstones=new Set;removedDirs=new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=new Map,this.tombstones=new Set,this.removedDirs=new Set,this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map,this.tree.set(`/`,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=k(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size}),this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}for(let t of e.entries){let e=A(k(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=A(e)}}wasUsed(){return this.touched}applySnapshot(e){this.loadSnapshot(e)}applySnapshotPreservingMutations(e){let t=this.getMutations();this.loadSnapshot(e);for(let e of t.deleted){if(this.tree.get(e)?.isDirectory){let t=e===`/`?`/`:e+`/`;for(let n of Array.from(this.tree.keys()))n!==e&&n.startsWith(t)&&this.tree.delete(n)}this.tree.delete(e)}for(let e of t.created)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink,symlinkTarget:e.symlinkTarget});for(let e of t.modified)this.ensureParentDirs(e.path),this.tree.set(e.path,{content:e.content,isDirectory:!1})}invalidate(){this.loadSnapshot({entries:[]})}resetBaseline(){this.initialPaths=new Set,this.initialContent=new Map,this.initialKind=new Map;for(let[e,t]of this.tree.entries())this.initialPaths.add(e),this.initialKind.set(e,this.entryKind(t)),!t.isDirectory&&!t.isSymbolicLink&&this.initialContent.set(e,t.content)}entryKind(e){return e.isSymbolicLink?`symlink`:e.isDirectory?`directory`:`file`}resolveEntry(e,t=!1){let n=k(e),r=n.split(`/`).filter(Boolean),i=[],a=new Set,o=0;if(r.length===0){let e=this.tree.get(`/`);return e?{path:`/`,entry:e}:void 0}for(;r.length>0;){let e=r.shift(),s=`/${[...i,e].join(`/`)}`,c=this.tree.get(s);if(!c)return;let l=r.length===0;if(c.isSymbolicLink&&!(t&&l)){if(a.has(s)||o++===40)throw Object.assign(Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...k(e.startsWith(`/`)?e:`${A(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[];continue}if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}ensureParentDirs(e){let t=A(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(k(e))?.partial===!0}commitWrite(e,t){this.writeFile(e,t);let n=k(e);for(this.initialContent.set(n,t);n!==`/`;){let e=this.tree.get(n);e&&(this.initialPaths.add(n),this.initialKind.set(n,this.entryKind(e))),n=A(n)}}readFile(e){this.touched=!0;let t=k(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw j(t);if(n.truncated)throw ee(t);return n.content}writeFile(e,t){this.touched=!0;let n=k(e);this.ensureParentDirs(n),this.tree.set(n,{content:t,isDirectory:!1}),this.tombstones.delete(n),this.removedDirs.delete(n)}exists(e){this.touched=!0;let t=k(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=k(e),n=this.resolveEntry(t);if(!n)throw j(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=k(e),n=this.resolveEntry(t,!0);if(!n)throw j(t);return this.toStat(n.entry)}toStat(e){return{isFile:!e.isDirectory&&!e.isSymbolicLink,isDirectory:e.isDirectory,isSymbolicLink:e.isSymbolicLink===!0,size:e.isDirectory?0:e.size??e.content.byteLength}}readdir(e){this.touched=!0;let t=k(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw j(t);let r=n.path===`/`?`/`:n.path+`/`,i=new Set;for(let e of this.tree.keys()){if(e===t||e===`/`||!e.startsWith(r))continue;let n=e.slice(r.length).split(`/`)[0];n&&i.add(n)}return Array.from(i)}mkdir(e,t,n=!1){this.touched=!0;let r=k(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=A(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw j(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=k(e),r=this.tree.get(n);if(!r)throw j(n);if(r.isDirectory&&!r.isSymbolicLink){let e=n===`/`?`/`:n+`/`,r=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));if(r.length>0&&!t)throw Object.assign(Error(`ENOTEMPTY: directory not empty, '${n}'`),{code:`ENOTEMPTY`});for(let e of r)this.tree.delete(e),this.tombstones.add(e);t&&this.removedDirs.add(n)}this.tree.delete(n),this.tombstones.add(n)}copyFile(e,t){this.touched=!0;let n=k(e),r=this.tree.get(n);if(!r||r.isDirectory)throw j(n);if(r.truncated)throw ee(n);let i=k(t);this.ensureParentDirs(i),this.tree.set(i,{content:r.content.slice(),isDirectory:!1}),this.tombstones.delete(i),this.removedDirs.delete(i)}rename(e,t){this.touched=!0;let n=k(e),r=this.tree.get(n);if(!r)throw j(n);let i=k(t);if(r.isDirectory){let e=n===`/`?`/`:n+`/`,t=Array.from(this.tree.keys()).filter(t=>t!==n&&t.startsWith(e));this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n);for(let e of t){let t=this.tree.get(e),r=i+e.slice(n.length);this.tree.set(r,t),this.tree.delete(e)}this.tombstones.add(n),this.removedDirs.add(n),this.tombstones.delete(i),this.removedDirs.delete(i);return}this.ensureParentDirs(i),this.tree.set(i,r),this.tree.delete(n),this.tombstones.add(n),this.tombstones.delete(i),this.removedDirs.delete(i)}unlink(e){this.touched=!0;let t=k(e),n=this.tree.get(t);if(!n)throw j(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(Error(`EISDIR: illegal operation on a directory, unlink '${t}'`),{code:`EISDIR`});this.tree.delete(t),this.tombstones.add(t)}markRemoved(e,t=!1){this.touched=!0;let n=k(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=k(e);if(this.tombstones.has(t))return!0;for(let e of this.removedDirs)if(t===e||t.startsWith(`${e}/`))return!0;return!1}mkdtemp(e){this.touched=!0;for(let t=0;t<100;t++){let t=`_${String(this.mkdtempCounter).padStart(6,`0`)}`;this.mkdtempCounter++;let n=k(e+t);if(!this.tree.has(n))return this.mkdir(n,!0),n}throw Error(`mkdtemp: failed to create unique directory after 100 attempts`)}getMutations(){let e=[],t=[],n=[];for(let[r,i]of this.tree.entries()){if(r===`/`)continue;if(!this.initialPaths.has(r)){e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}let a=this.initialKind.get(r);if(a!==void 0&&a!==this.entryKind(i)){n.push(r),e.push({path:r,content:i.content,isDirectory:i.isDirectory,isSymbolicLink:i.isSymbolicLink,symlinkTarget:i.symlinkTarget});continue}if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!te(e,i.content)&&t.push({path:r,content:i.content})}}for(let e of this.initialPaths)e!==`/`&&(this.tree.has(e)||n.push(e));return{created:e,modified:t,deleted:n}}};function re(){return globalThis.Buffer}function ie(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function ae(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function oe(e,t){return Object.assign(Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function se(e){return e===`/dev/stdin`||e===`/dev/stdout`||e===`/dev/stderr`}function ce(e){if(e===0||e===`/dev/stdin`)return 0;if(e===1||e===`/dev/stdout`)return 1;if(e===2||e===`/dev/stderr`)return 2}function le(e,t){let n=ce(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw oe(t,e);return!1}function ue(e,t,n){let r=ce(t);if(r===1)return e.writeStdout;if(r===2)return e.writeStderr;if(r!==void 0||typeof t==`number`)throw oe(n,t)}function de(e){return typeof e==`string`?e:ae(we(e))}function fe(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=re();return n?n.from(e):e}function pe(e){return typeof e==`string`?e:e?.encoding}function me(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function he(e,t){if(!t)return;let n={readFile:e.readFile,readFileBinary:e.readFileBinary,writeFile:e.writeFile,writeFileBinary:e.writeFileBinary,appendFile:e.appendFile,access:e.access,exists:e.exists,stat:e.stat};e.readFile=async(e,r)=>{if(!le(e,`read`))return n.readFile(e,r);let i=pe(r);if(i===null||i===`buffer`){let e=re(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>le(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=ue(t,e,`write`);return i?(i(de(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=ue(t,e,`write`);return i?(i(ae(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=ue(t,e,`append`);if(!i)return n.appendFile(e,r);i(de(r))},e.access=async e=>{if(!se(e))return n.access(e)},e.exists=async e=>se(e)||n.exists(e),e.stat=async e=>se(e)?{isFile:!0,isDirectory:!1,size:0}:n.stat(e)}function ge(e,t,n){function r(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return e instanceof ArrayBuffer?new Uint8Array(e):new TextEncoder().encode(typeof e==`string`?e:String(e))}async function i(t,n){let r=typeof n==`string`?n:n?.encoding;if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=re();return r?r.from(n instanceof Uint8Array?n:new Uint8Array(n)):n}return e.call(`vfs`,`readFile`,[t])}async function a(t,n){return typeof n==`string`?e.call(`vfs`,`writeFile`,[t,n]):e.call(`vfs`,`writeFileBinary`,[t,r(n)])}async function o(t,n){if(typeof n==`string`){await e.call(`vfs`,`appendFile`,[t,n]);return}await e.call(`vfs`,`appendFile`,[t,r(n)])}async function s(t,n,r){let i=await e.call(`vfs`,`stat`,[t]);if(i.isFile){let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]);return}if(!i.isDirectory||!r?.recursive)throw Error(`cp: '${t}' is a directory (use {recursive: true})`);await l(n);let a=await e.call(`vfs`,`readDir`,[t]);for(let e of a)await s(`${t}/${e}`,`${n}/${e}`,r)}async function c(t,n){if(n?.force&&!await e.call(`vfs`,`exists`,[t]))return!0;if((await e.call(`vfs`,`stat`,[t])).isFile)return e.call(`vfs`,`rm`,[t]);if(!n?.recursive)throw Error(`rm: '${t}' is a directory (use {recursive: true})`);let r=await e.call(`vfs`,`readDir`,[t]);for(let e of r)await c(`${t}/${e}`,n);return e.call(`vfs`,`rm`,[t])}async function l(t){await e.call(`vfs`,`mkdir`,[t])}async function u(t){for(let n=0;n<5;n++){let n=`${t}${Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,6)}`;if(!await e.call(`vfs`,`exists`,[n]))return await e.call(`vfs`,`mkdir`,[n]),n}throw Error(`mkdtemp: failed to create unique directory after 5 attempts`)}async function d(t,n){try{await e.call(`vfs`,`rename`,[t,n])}catch{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r]),await e.call(`vfs`,`rm`,[t])}}async function f(t){if(!await e.call(`vfs`,`exists`,[t]))throw Object.assign(Error(`ENOENT: no such file or directory, access '${t}'`),{code:`ENOENT`})}let p={readFile:i,readFileBinary:t=>e.call(`vfs`,`readFileBinary`,[t]),writeFile:a,writeFileBinary:(t,n)=>e.call(`vfs`,`writeFileBinary`,[t,n]),appendFile:o,cp:s,rm:c,readDir:t=>e.call(`vfs`,`readDir`,[t]),readdir:t=>e.call(`vfs`,`readDir`,[t]),exists:t=>e.call(`vfs`,`exists`,[t]),stat:t=>e.call(`vfs`,`stat`,[t]),mkdir:(t,n)=>e.call(`vfs`,`mkdir`,[t]),mkdtemp:u,rename:d,access:f,unlink:t=>e.call(`vfs`,`rm`,[t]),rmdir:t=>e.call(`vfs`,`rm`,[t]),copyFile:async(t,n)=>{let r=await e.call(`vfs`,`readFileBinary`,[t]);await e.call(`vfs`,`writeFileBinary`,[n,r])},fetchToFile:async(n,r)=>{let i=await t(n);if(!i.ok)throw Error(`fetch ${i.status} ${i.statusText}`);let a=new Uint8Array(await i.arrayBuffer());return await e.call(`vfs`,`writeFileBinary`,[r,a]),a.byteLength},promises:null};return he(p,n),O(p,_e,{promises:!0}),p.promises=p,p}const _e={readFile:`fd`,readFileBinary:`fd`,writeFile:`fd`,writeFileBinary:`fd`,appendFile:`fd`,cp:`pair`,rm:`path`,readDir:`path`,readdir:`path`,exists:`path`,stat:`path`,mkdir:`path`,mkdtemp:`path`,rename:`pair`,access:`path`,unlink:`path`,rmdir:`path`,copyFile:`pair`,fetchToFile:`second`},ve={readFileSync:`fd`,writeFileSync:`fd`,appendFileSync:`fd`,truncateSync:`path`,existsSync:`path`,accessSync:`path`,mkdirSync:`path`,statSync:`path`,lstatSync:`path`,realpathSync:`path`,readdirSync:`path`,copyFileSync:`pair`,cpSync:`pair`,chmodSync:`path`,mkdtempSync:`path`,rmSync:`path`,rmdirSync:`path`,unlinkSync:`path`,renameSync:`pair`};function M(e,t,n=``){return Object.assign(Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function ye(e,t,n,r={},i){let a=r.recursive===!0;try{return r.requireFile?e.unlink(n):e.rm(n,a),i?.(n),!0}catch(e){if(e?.code!==`ENOENT`)throw e}let o=t;if(!o?.rm||e.isTombstoned(n))return!1;try{if(!o.exists(n))return!1}catch{return!1}return o.rm(n),e.markRemoved(n,a),!0}function be(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>ye(t,n,e,r,l);return{rmSync(e,t){let n=r(e);if(!(t?.force&&!i(n))&&!u(n,{recursive:t?.recursive===!0})&&!t?.force)throw M(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw M(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw M(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw M(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i);try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw M(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw M(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw M(`ENOENT`,a,`rename`)}}}function xe(e,t){if(!t)return;let n={readFileSync:e.readFileSync,writeFileSync:e.writeFileSync,appendFileSync:e.appendFileSync,existsSync:e.existsSync,accessSync:e.accessSync,statSync:e.statSync,lstatSync:e.lstatSync};e.readFileSync=(e,r)=>le(e,`read`)?fe(t.readStdinBytes(),pe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=ue(t,e,`write`);i?i(de(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=ue(t,e,`append`);i?i(de(r)):n.appendFileSync(e,r)},e.existsSync=e=>se(e)||n.existsSync(e),e.accessSync=e=>{se(e)||n.accessSync(e)},e.statSync=e=>se(e)?me():n.statSync(e),e.lstatSync=e=>se(e)?me():n.lstatSync(e)}function Se(e,t,n,r){let i=t=>e===`/`?`/${t}`:`${e}/${t}`,a=new Set(n);for(let e of t)a.add(e);for(let e of a)r(i(e))&&a.delete(e);return[...a]}function Ce(e,t,n){let r=t=>e.isTombstoned(t);try{let i=e.readdir(n);if(!t||!e.isPartial(n)||r(n))return i;try{return Se(n,i,t.readdir(n),r)}catch(e){if(e?.code===`ENOENT`)return i;throw e}}catch(e){let i=e?.code;if(!t||r(n)||i!==`ENOENT`)throw e;return Se(n,[],t.readdir(n),r)}}function we(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)){let t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}return new TextEncoder().encode(String(e))}function Te(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ee(e,t,n,r,i){function a(e){return k(e.startsWith(`/`)?e:t+(t.endsWith(`/`)?``:`/`)+e)}function o(t){try{return e.readFile(t)}catch(r){let i=r?.code;if(n&&!e.isTombstoned(t)&&(i===`ENOENT`||i===`ENOSYNC`))return n.readFile(t);throw r}}let s=(t,r)=>Te(e,n,i,t,r);function c(t){if(e.exists(t))return!0;if(!n||e.isTombstoned(t))return!1;try{return n.exists(t)}catch{return!1}}function l(t){try{return e.stat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.stat(t)}}function u(t){try{return e.lstat(t)}catch(r){let i=r?.code;if(!n||e.isTombstoned(t)||i!==`ENOENT`)throw r;return n.lstat(t)}}let d=e=>({isFile:()=>e.isFile,isDirectory:()=>e.isDirectory,isSymbolicLink:()=>e.isSymbolicLink===!0,isCharacterDevice:()=>!1,size:e.size}),f=(e,t)=>e===`/`?`/${t}`:`${e}/${t}`;function p(t,r){if(!l(t).isDirectory){s(r,o(t));return}e.mkdir(r,!0);for(let i of Ce(e,n,t))p(f(t,i),f(r,i))}let m={...be({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return fe(o(a(e)),pe(t))},writeFileSync(e,t){s(a(e),we(t))},appendFileSync(e,t){let n=a(e),r=new Uint8Array;try{r=o(n)}catch(e){if(e?.code!==`ENOENT`)throw e}let i=we(t),c=new Uint8Array(r.byteLength+i.byteLength);c.set(r),c.set(i,r.byteLength),s(n,c)},truncateSync(e,t=0){let n=a(e),r=o(n),i=new Uint8Array(t);i.set(r.subarray(0,Math.min(t,r.byteLength))),s(n,i)},existsSync(e){return c(a(e))},accessSync(e){let t=a(e);if(!c(t))throw M(`ENOENT`,t,`access`)},mkdirSync(t,n){e.mkdir(a(t),n?.recursive)},statSync:e=>d(l(a(e))),lstatSync:e=>d(u(a(e))),realpathSync(e){let t=a(e);if(!c(t))throw M(`ENOENT`,t,`realpath`);return t},readdirSync(t){return Ce(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},chmodSync(e){let t=a(e);if(!c(t))throw M(`ENOENT`,t,`chmod`)},mkdtempSync(t){return e.mkdtemp(a(t))}};xe(m,r),O(m,ve);let h=m.existsSync;return m.existsSync=e=>{try{return h(e)}catch{return!1}},m}var De=class{_events=new Map;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}addListener(e,t){return this.on(e,t)}off(e,t){let n=this._events.get(e);if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&this._events.delete(e)}return this}removeListener(e,t){return this.off(e,t)}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}removeAllListeners(e){return e===void 0?this._events.clear():this._events.delete(e),this}listenerCount(e){return this._events.get(e)?.length??0}listeners(e){return[...this._events.get(e)??[]]}};const Oe=Object.assign(De,{EventEmitter:De,default:De});function ke(e){let t=e=>{if(typeof e==`string`)return e;if(e instanceof Error)return e.message;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}},n=(e,t,n)=>t===void 0?`${e(`Error:`)} ${n}\n`:t===``?`${e(n)}\n`:`${e(`${t}:`)} ${n}\n`,r=(t,n)=>t===void 0?`${e.color.yellow(`Warning:`)} ${n}\n`:t===``?`${e.color.yellow(n)}\n`:`${e.color.yellow(`${t}:`)} ${n}\n`;return{die(r,i){let a=typeof i==`number`?i:i?.exitCode??1,o=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0,s=t(r);throw e.writeStderr(n(e.color.red,o,s)),e.exit(a),Error(`unreachable`)},out(t){if(typeof t==`string`){e.writeStdout(t.endsWith(`
|
|
2
|
+
`)?t:`${t}\n`);return}try{e.writeStdout(`${JSON.stringify(t,null,2)}\n`)}catch{e.writeStdout(`${String(t)}\n`)}},warn(n,i){let a=typeof i==`object`&&i&&`prefix`in i?i.prefix:void 0;e.writeStderr(r(a,t(n)))},help(t){throw e.writeStdout(t.endsWith(`
|
|
3
|
+
`)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const N={reset:`\x1B[0m`,green:`\x1B[32m`,red:`\x1B[31m`,yellow:`\x1B[33m`,gray:`\x1B[90m`,bold:`\x1B[1m`,cyan:`\x1B[36m`,dim:`\x1B[2m`};function Ae(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${N.reset}`:String(n);return{enabled:t,green:n(N.green),red:n(N.red),yellow:n(N.yellow),gray:n(N.gray),bold:n(N.bold),cyan:n(N.cyan),dim:n(N.dim)}}const je=/\u001b\[[0-9;]*m/g;function Me(e){return e.replace(je,``)}function Ne(e){return Me(e).length}function Pe(e,t){let n=String(e??``);return t<=0?``:Ne(n)<=t?n:t<=1?n.slice(0,t):`${Me(n).slice(0,t-1)}…`}function Fe(e,t){let n=String(e??``),r=Ne(n);return r===t?n:r>t?Pe(n,t):n+` `.repeat(t-r)}function Ie(e,t){if(!e.length)return``;let n=Math.max(...e.map(e=>e.length)),r=[];for(let i=0;i<n;i++)if(t&&t[i]!==void 0)r[i]=t[i];else{let t=0;for(let n of e){let e=i<n.length?String(n[i]??``):``;t=Math.max(t,Ne(e))}r[i]=t}return e.map(e=>r.map((t,n)=>Fe(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
|
|
4
|
+
`)}function Le(e){return e instanceof Date?e:new Date(e)}function Re(e){return e<10?`0${e}`:String(e)}function ze(e,t=`short`){let n=Le(e);if(Number.isNaN(n.getTime()))return String(e);if(t===`iso`)return n.toISOString();if(t===`locale`)return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`}).format(n);if(t===`human`){let e=Date.now()-n.getTime(),t=Math.abs(e);if(t<6e4)return e>=0?`just now`:`in a moment`;let r=(t,n)=>e>=0?`${t} ${n}${t===1?``:`s`} ago`:`in ${t} ${n}${t===1?``:`s`}`;return t<36e5?r(Math.round(t/6e4),`minute`):t<864e5?r(Math.round(t/36e5),`hour`):t<26298e5?r(Math.round(t/864e5),`day`):t<315576e5?r(Math.round(t/26298e5),`month`):r(Math.round(t/315576e5),`year`)}return`${n.getFullYear()}-${Re(n.getMonth()+1)}-${Re(n.getDate())}`}const Be={trunc:Pe,col:Fe,table:Ie,date:ze};var P=class extends Error{actual;expected;operator;generatedMessage;code;constructor(e={}){let t=!e.message;super(e.message||`${Ve(e.actual)} ${e.operator||`!=`} ${Ve(e.expected)}`),this.name=`AssertionError`,this.actual=e.actual,this.expected=e.expected,this.operator=e.operator||``,this.generatedMessage=t,this.code=`ERR_ASSERTION`}};function Ve(e){if(typeof e==`string`)return JSON.stringify(e);if(e==null)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function F(e,t){return e instanceof Error?e:typeof e==`string`?new P({message:e}):t()}function He(e,t,n,r){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!We(e[i],t[i],n,r))return!1;return!0}function Ue(e,t,n,r){let i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let a of i)if(!Object.prototype.hasOwnProperty.call(t,a)||!We(Reflect.get(e,a),Reflect.get(t,a),n,r))return!1;return!0}function We(e,t,n,r){if((n?Object.is(e,t):e===t)||!n&&e==t)return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;let i=e,a=t;return n&&Object.getPrototypeOf(i)!==Object.getPrototypeOf(a)?!1:r.get(i)===a||(r.set(i,a),Array.isArray(e)===Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)?He(e,t,n,r):Ue(i,a,n,r):!1)}function Ge(e,t){try{if(e instanceof t)return!0}catch{}try{return!!t(e)}catch{return!1}}function Ke(e,t){for(let[n,r]of Object.entries(t)){let t=Reflect.get(e,n);if(r instanceof RegExp){if(typeof t!=`string`||!r.test(t))return!1}else if(t!==r)return!1}return!0}function qe(e,t){if(t===void 0)return!0;if(t instanceof RegExp){let n=e instanceof Error?e.message:String(e);return t.test(n)}return typeof t==`function`?Ge(e,t):t&&typeof t==`object`?!e||typeof e!=`object`?!1:Ke(e,t):!1}function Je(e){let t=(e,t)=>{if(!e)throw F(t,()=>new P({message:`The expression evaluated to a falsy value`,actual:e,expected:!0,operator:`==`}))},n=((e,n)=>t(e,n)),r=(e,t,n)=>{if(!Object.is(e,t))throw F(n,()=>new P({actual:e,expected:t,operator:`strictEqual`}))},i=(t,n,i)=>{if(e){r(t,n,i);return}if(t!=n)throw F(i,()=>new P({actual:t,expected:n,operator:`==`}))},a=(e,t,n)=>{if(Object.is(e,t))throw F(n,()=>new P({actual:e,expected:t,operator:`notStrictEqual`}))},o=(t,n,r)=>{if(e){a(t,n,r);return}if(t==n)throw F(r,()=>new P({actual:t,expected:n,operator:`!=`}))},s=(e,t,n)=>{if(!We(e,t,!0,new WeakMap))throw F(n,()=>new P({actual:e,expected:t,operator:`deepStrictEqual`}))},c=(t,n,r)=>{if(e){s(t,n,r);return}if(!We(t,n,!1,new WeakMap))throw F(r,()=>new P({actual:t,expected:n,operator:`deepEqual`}))},l=(e,t,n)=>{if(We(e,t,!0,new WeakMap))throw F(n,()=>new P({actual:e,expected:t,operator:`notDeepStrictEqual`}))};return n.ok=t,n.equal=i,n.notEqual=o,n.strictEqual=r,n.notStrictEqual=a,n.deepEqual=c,n.deepStrictEqual=s,n.notDeepEqual=(t,n,r)=>{if(e){l(t,n,r);return}if(We(t,n,!1,new WeakMap))throw F(r,()=>new P({actual:t,expected:n,operator:`notDeepEqual`}))},n.notDeepStrictEqual=l,n.throws=(e,t,n)=>{let r,i=!1;try{e()}catch(e){r=e,i=!0}if(!i)throw F(typeof t==`string`?t:n,()=>new P({message:`Missing expected exception`,operator:`throws`}));if(!(typeof t==`string`||t instanceof Error)&&!qe(r,t))throw F(n,()=>new P({message:`Got unwanted exception`,actual:r,operator:`throws`}))},n.doesNotThrow=(e,t)=>{try{e()}catch(e){throw F(t,()=>new P({message:`Got unwanted exception`,actual:e,operator:`doesNotThrow`}))}},n.fail=e=>{throw F(e,()=>new P({message:`Failed`,operator:`fail`}))},n.AssertionError=P,n}const Ye=Je(!0);Ye.strict=Ye;const Xe=Je(!1);Xe.strict=Ye;function Ze(e,t){let n=globalThis.Buffer;if(!n)throw Error(`crypto.createHash: Buffer is unavailable in this environment`);return t?n.from(e,t):n.from(e)}var Qe=class{_events=new Map;closeScheduled=!1;writable=!0;readable=!0;on(e,t){let n=this._events.get(e);return n?n.push(t):this._events.set(e,[t]),this}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}off(e,t){let n=this._events.get(e);if(n){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}return this}emit(e,...t){let n=this._events.get(e);if(!n||n.length===0)return!1;for(let e of[...n])e(...t);return!0}pipe(e){return this.on(`data`,t=>e.write(t)),this.once(`end`,()=>e.end()),e}closeOnDestroy(){return this.closeScheduled?this:(this.closeScheduled=!0,queueMicrotask(()=>this.emit(`close`)),this)}removeListener(e,t){return this.off(e,t)}removeAllListeners(){return this._events.clear(),this}},$e=class extends Qe{read(){return null}destroy(){return this.closeOnDestroy()}},et=class extends Qe{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}destroy(){return this.closeOnDestroy()}},tt=class extends Qe{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}read(){return null}destroy(){return this.closeOnDestroy()}};const nt={Readable:$e,Writable:et,Transform:tt,PassThrough:class extends tt{},Stream:Qe};function rt(e,t){return Object.assign(TypeError(t),{code:e})}const it=e=>e.startsWith(`--`)&&e.length>2,at=e=>/^-[^-]/.test(e);function ot(e,t,n){let r=[];for(let i=1;i<e.length;i++)if(t[n(e[i])]?.type!==`string`||i===e.length-1)r.push(`-${e[i]}`);else{r.push(`-${e.slice(i)}`);break}return r}function st(e,t,n){let r=[],i=[...e],a=-1,o=0,s=(e,t,n,r)=>({kind:`option`,name:e,rawName:t,index:a,value:n,inlineValue:r}),c=e=>t[e]?.type===`string`;for(;i.length>0;){let e=i.shift(),l=i[0];if(o>0?o--:a++,e===`--`){r.push({kind:`option-terminator`,index:a});for(let e of i)r.push({kind:`positional`,index:++a,value:e});break}if(at(e)&&e.length===2){let t=n(e[1]);c(t)&&l!==void 0?(i.shift(),r.push(s(t,e,l,!1)),a++):r.push(s(t,e,void 0,void 0));continue}if(at(e)){let a=n(e[1]);if(c(a))r.push(s(a,`-${e[1]}`,e.slice(2),!0));else{let r=ot(e,t,n);i.unshift(...r),o=r.length}continue}if(it(e)){let t=e.indexOf(`=`);if(t!==-1){r.push(s(e.slice(2,t),e.slice(0,t),e.slice(t+1),!0));continue}let n=e.slice(2);c(n)&&l!==void 0?(i.shift(),r.push(s(n,e,l,!1)),a++):r.push(s(n,e,void 0,void 0));continue}r.push({kind:`positional`,index:a,value:e})}return r}function ct(e,t){let n=t?.short?`'-${t.short}, --${e.name}'`:`'--${e.name}'`;if(!t)throw rt(`ERR_PARSE_ARGS_UNKNOWN_OPTION`,`Unknown option '${e.rawName}'${e.rawName.startsWith(`--`)?``:`. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- "-"'`}`);if(t.type===`string`&&typeof e.value!=`string`)throw rt(`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`,`Option ${n.replace(/'$/,` <value>'`)} argument missing`);if(t.type===`boolean`&&e.value!==void 0)throw rt(`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`,`Option ${n} does not take an argument`);let r=e.value!==void 0&&e.value.length>1&&e.value[0]===`-`;if(t.type===`string`&&e.inlineValue===!1&&r)throw rt(`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`,`Option '${e.rawName}' argument is ambiguous.\nDid you forget to specify the option argument for '${e.rawName}'?\nTo specify an option argument starting with a dash use '${e.rawName.startsWith(`--`)?`${e.rawName}=-XYZ`:`--${e.name}=-XYZ' or '${e.rawName}-XYZ`}'.`)}function lt(e,t,n,r){if(!r){e[t]=n;return}let i=e[t];e[t]=Array.isArray(i)?[...i,n]:[n]}function ut(e,t,n){let r=e.slice(3);return n&&e.startsWith(`no-`)?{name:r,negated:!0}:{name:e,negated:!1}}function dt(e,t,n,r,i){let{name:a,negated:o}=ut(t.name,n,i);t.name=a;let s=n[a];r&&ct(t,o&&s?.type!==`boolean`?void 0:s),lt(e,a,o?!1:t.value??!0,s?.multiple===!0)}function ft(e={},t=()=>[]){let n=e.args??t(),r=e.options??{},i=e.strict??!0,a=e.allowPositionals??!i,o=e.allowNegative??!1,s=e=>Object.keys(r).find(t=>r[t].short===e)??e,c=Object.create(null),l=[],u=st(n,r,s);for(let e of u){if(e.kind===`positional`){if(i&&!a)throw rt(`ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL`,`Unexpected argument '${e.value}'. This command does not take positional arguments`);l.push(e.value);continue}e.kind===`option`&&dt(c,e,r,i,o)}for(let[e,t]of Object.entries(r))t.default!==void 0&&c[e]===void 0&&(c[e]=t.default);return e.tokens?{values:c,positionals:l,tokens:u}:{values:c,positionals:l}}const pt=Symbol.for(`nodejs.util.inspect.custom`),mt=Symbol.for(`nodejs.util.promisify.custom`);function ht(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`)}'`}function gt(e){if(e===null)return`null`;let t=typeof e;if(t===`string`)return ht(e);if(t===`number`)return Object.is(e,-0)?`-0`:String(e);if(t===`bigint`)return`${String(e)}n`;if(t===`boolean`||t===`undefined`)return String(e);if(t===`symbol`)return e.toString();if(t===`function`){let t=e.name;return t?`[Function: ${t}]`:`[Function (anonymous)]`}return null}function _t(e){return e instanceof RegExp?e.toString():e instanceof Date?Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString():e instanceof Error?e.stack||`${e.name}: ${e.message}`:null}function vt(e,t,n){if(Array.isArray(e))return e.length===0?`[]`:`[ ${e.map(e=>yt(e,t+1,n)).join(`, `)} ]`;if(e instanceof Map){let r=[...e].map(([e,r])=>`${yt(e,t+1,n)} => ${yt(r,t+1,n)}`);return`Map(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}if(e instanceof Set){let r=[...e].map(e=>yt(e,t+1,n));return`Set(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}let r=Object.keys(e),i=e.constructor?e.constructor.name:``,a=i&&i!==`Object`?`${i} `:``;return r.length===0?`${a}{}`:`${a}{ ${r.map(r=>`${/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(r)?r:ht(r)}: ${yt(e[r],t+1,n)}`).join(`, `)} }`}function yt(e,t,n){let r=gt(e);if(r!==null)return r;let i=e,a=_t(i);if(a!==null)return a;let o=i[pt];if(typeof o==`function`)try{return String(o.call(i,n.maxDepth,n.opts))}catch{}if(n.seen.has(e))return`[Circular *1]`;if(n.maxDepth!==null&&t>n.maxDepth)return Array.isArray(e)?`[Array]`:`[Object]`;n.seen.add(e);try{return vt(i,t,n)}finally{n.seen.delete(e)}}function bt(e,t={}){let n=t.depth===void 0?2:t.depth;return yt(e,0,{seen:new Set,maxDepth:n,opts:t})}function xt(e,t,n,r){if(e===`%%`)return`%`;if(n.i>=t.length)return e;let i=t[n.i];switch(e){case`%s`:return n.i++,typeof i==`string`?i:typeof i==`bigint`?`${String(i)}n`:i==null||typeof i==`number`||typeof i==`boolean`?String(i):bt(i,{depth:r.depth===void 0?2:r.depth});case`%d`:return n.i++,typeof i==`bigint`?`${String(i)}n`:Number.isNaN(Number(i))?`NaN`:String(Number(i));case`%i`:return n.i++,typeof i==`bigint`?`${String(i)}n`:String(Number.parseInt(i,10));case`%f`:return n.i++,String(typeof i==`bigint`?i:Number.parseFloat(i));case`%j`:n.i++;try{return JSON.stringify(i)??`undefined`}catch{return`[Circular]`}case`%o`:return n.i++,bt(i,{depth:4});case`%O`:return n.i++,bt(i,{depth:null});case`%c`:return n.i++,``;default:return e}}function St(e,...t){let n=t[0];if(typeof n!=`string`)return t.map(e=>typeof e==`string`?e:bt(e)).join(` `);let r={i:1},i=n.replace(/%[sdifjoOc%]/g,n=>xt(n,t,r,e));for(;r.i<t.length;r.i++){let e=t[r.i];i+=` ${typeof e==`string`?e:bt(e)}`}return i}function Ct(...e){return St({},...e)}function wt(e,t){if(e==null)throw TypeError(`The constructor to "inherits" must not be null or undefined`);if(t==null)throw TypeError(`The super constructor to "inherits" must not be null or undefined`);if(t.prototype===void 0)throw TypeError(`The super constructor to "inherits" must have a prototype`);e.super_=t,Object.setPrototypeOf(e.prototype,t.prototype)}function Tt(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type function`);let t=e[mt];if(t){if(typeof t!=`function`)throw TypeError(`The [util.promisify.custom] property must be of type function`);return t}function n(...t){return new Promise((n,r)=>{e.call(this,...t,(e,...t)=>{if(e){r(e);return}n(t.length>1?t:t[0])})})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n}function Et(e){return function(t,n,r){if(typeof t!=`function`)throw TypeError(`The "fn" argument must be of type function`);let i=!1;function a(...a){return i||(i=!0,e(r?`[${r}] DeprecationWarning: ${n}`:`DeprecationWarning: ${n}`)),new.target?Reflect.construct(t,a,new.target):t.apply(this,a)}return Object.setPrototypeOf(a,Object.getPrototypeOf(t)),t.prototype&&(a.prototype=t.prototype),a}}const Dt=bt;Dt.custom=pt;const Ot=Tt;Ot.custom=mt;function kt(e,t=()=>[]){return{parseArgs:e=>ft(e,t),format:Ct,formatWithOptions:St,inspect:Dt,inherits:wt,promisify:Ot,deprecate:Et(e)}}const At=kt(()=>{});let jt=1;function Mt(e){if(typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return new TextDecoder().decode(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}return e==null?``:String(e)}function Nt(e,t,n){return Object.assign(TypeError(`The "${e}" argument must be of type ${t}. Received ${n===null?`null`:Array.isArray(n)?`array`:typeof n}`),{code:`ERR_INVALID_ARG_TYPE`})}function Pt(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))throw Nt(`options.env`,`object`,e);let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r!=`string`)throw Nt(`options.env[${n}]`,`string`,r);t[n]=r}return t}function Ft(e){if(e!==void 0){if(typeof e==`string`)return e;if(typeof e==`object`&&e&&typeof e.href==`string`)try{return C.fileURLToPath(e.href)}catch{throw Nt(`options.cwd`,`string or an instance of URL (file:)`,e)}throw Nt(`options.cwd`,`string or an instance of URL`,e)}}function It(e,t){return t===void 0||t===`utf8`||t===`utf-8`?e:t===`buffer`||t===null?Ze(e):Ze(e).toString(t)}function Lt(e,t){if(e.length===0)return It(``,t);if(typeof e[0]==`string`)return e.join(``);let n=globalThis.Buffer;return n?n.concat(e):e[0]}function Rt(e,t,n){t.length>0&&e.emit(`data`,It(t,n)),e.readable=!1,e.emit(`end`)}function zt(e){let t=e=>{typeof e==`function`&&queueMicrotask(e)};return{writable:!0,write(n,r,i){return e.stdin.write(Mt(n)),t(typeof r==`function`?r:i),!0},end(n,r,i){n!==void 0&&typeof n!=`function`&&e.stdin.write(Mt(n)),e.stdin.end(),this.writable=!1,t(typeof n==`function`?n:typeof r==`function`?r:i)}}}var Bt=class extends De{stdout;stderr;stdin;pid;exitCode=null;signalCode=null;killed=!1;spawnfile;spawnargs;handle;constructor(e,t,n,r){super(),this.handle=e,this.pid=jt++,this.spawnfile=n,this.spawnargs=r,this.stdout=new $e,this.stderr=new $e,this.stdin=zt(e),e.done.then(e=>this.finish(e,t),e=>this.emit(`error`,e instanceof Error?e:Error(String(e))))}finish(e,t){Rt(this.stdout,e.stdout,t),Rt(this.stderr,e.stderr,t),this.exitCode=e.exitCode;let n=this.killed?null:e.exitCode,r=this.killed?this.signalCode:null;this.emit(`exit`,n,r),this.emit(`close`,n,r)}kill(e=`SIGTERM`){return this.killed=!0,this.signalCode=e,this.handle.kill(e).catch(()=>{}),!0}};function Vt(e){let t=(t,n,r)=>{if(!e)throw Error(`child_process.${t} is not available in this browser realm (no synchronous bridge — the page has no controlling Service Worker). Use the async form instead: await promisify(${t.replace(/Sync$/,``)})(…).`);return e.run(n,r)},n=e=>{let t=Ft(e.cwd),n=Pt(e.env);return{...e.input===void 0?{}:{input:Mt(e.input)},...e.timeout===void 0?{}:{timeout:e.timeout},...t===void 0?{}:{cwd:t},...n===void 0?{}:{env:n}}},r=(e,r,i,a)=>{let o=a.encoding===void 0?`buffer`:a.encoding,s=t(e,r,n(a)),c=It(s.stdout,o),l=It(s.stderr,o);if(s.exitCode===0)return c;throw Object.assign(Error(`Command failed: ${i}\n${s.stderr}`),{status:s.exitCode,signal:null,stdout:c,stderr:l,output:[null,c,l],pid:jt++})},i=(e,t)=>({args:Array.isArray(e)?e:[],options:(Array.isArray(e)?t:e)??{}});return{execSync:(e,t={})=>r(`execSync`,e,e,t),execFileSync:(e,t,n)=>{let{args:a,options:o}=i(t,n),s=[e,...a];return r(`execFileSync`,s,s.join(` `),o)},spawnSync:(e,r,a)=>{let{args:o,options:s}=i(r,a),c=s.encoding===void 0?`buffer`:s.encoding,l=jt++,u=s.shell?`${e}${o.length?` ${o.join(` `)}`:``}`:[e,...o],d;try{d=t(`spawnSync`,u,n(s))}catch(e){if(e instanceof TypeError)throw e;let t=It(``,c);return{pid:l,status:null,signal:null,stdout:t,stderr:t,output:[null,t,t],error:e instanceof Error?e:Error(String(e))}}let f=It(d.stdout,c),p=It(d.stderr,c);return{pid:l,status:d.exitCode,signal:null,stdout:f,stderr:p,output:[null,f,p]}}}}function Ht(e,t){let n=(t,n,r,i,a)=>{let o=Ft(n.cwd),s=Pt(n.env),c={...o===void 0?{}:{cwd:o},...s===void 0?{}:{env:s}},l=e.start(t,c),u=new Bt(l,r,i,a);return n.input!==void 0&&u.stdin.write(Mt(n.input)),queueMicrotask(()=>l.stdin.end()),u},r=(e,t,n,r)=>{if(typeof r!=`function`)return;let i=[],a=[];e.stdout.on(`data`,e=>i.push(e)),e.stderr.on(`data`,e=>a.push(e)),e.once(`error`,e=>r(e,Lt(i,t),Lt(a,t))),e.once(`close`,(o,s)=>{let c=Lt(i,t),l=Lt(a,t);if(o===0){r(null,c,l);return}r(Object.assign(Error(`Command failed: ${n}\n${Mt(l)}`),{code:o===null?void 0:o,killed:e.killed,signal:s??null,cmd:n}),c,l)})},i=(e,t,i)=>{let a=typeof t==`function`?t:i,o=t&&typeof t==`object`?t:{},s=o.encoding===void 0?`utf8`:o.encoding,c=n(e,o,s,e,[]);return r(c,s,e,a),c},a=(e,t,i,a)=>{let o=[],s={},c;Array.isArray(t)?(o=t,typeof i==`function`?c=i:(s=i??{},c=typeof a==`function`?a:void 0)):typeof t==`function`?c=t:t&&typeof t==`object`&&(s=t,c=typeof i==`function`?i:void 0);let l=s.encoding===void 0?`utf8`:s.encoding,u=[e,...o],d=n(u,s,l,e,o);return r(d,l,u.join(` `),c),d},o=(e,t,r)=>{let i=[],a={};Array.isArray(t)?(i=t,a=r??{}):t&&typeof t==`object`&&(a=t);let o=a.encoding===void 0?`buffer`:a.encoding,s=a.shell?`${e}${i.length?` ${i.join(` `)}`:``}`:[e,...i];return n(s,a,o,e,i)},s=(e,t)=>new Promise((n,r)=>{i(e,t,(e,t,i)=>{if(e){r(Object.assign(e,{stdout:t,stderr:i}));return}n({stdout:t,stderr:i})})}),c=(e,t,n)=>new Promise((r,i)=>{a(e,Array.isArray(t)?t:[],Array.isArray(t)?n:t,(e,t,n)=>{if(e){i(Object.assign(e,{stdout:t,stderr:n}));return}r({stdout:t,stderr:n})})}),l=e=>()=>{throw Error(`child_process.${e} is not available in the browser realm`)},u=Vt(t),d=(e,t)=>{Object.defineProperty(e,mt,{value:t,enumerable:!1,configurable:!0})};return d(i,s),d(a,c),{exec:i,execFile:a,spawn:o,execSync:u.execSync,spawnSync:u.spawnSync,execFileSync:u.execFileSync,fork:l(`fork`),ChildProcess:Bt}}function Ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Wt={exports:{}};
|
|
5
|
+
/**
|
|
6
|
+
* [js-md5]{@link https://github.com/emn178/js-md5}
|
|
7
|
+
*
|
|
8
|
+
* @namespace md5
|
|
9
|
+
* @version 0.9.2
|
|
10
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
11
|
+
* @copyright Chen, Yi-Cyuan 2014-2026
|
|
12
|
+
* @license MIT
|
|
13
|
+
*/
|
|
14
|
+
(function(e){(function(){var t=`input is invalid type`,n=typeof window==`object`,r=n?window:{};r.JS_MD5_NO_WINDOW&&(n=!1),typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope&&(r=self);var i=!r.JS_MD5_NO_COMMON_JS&&e.exports,a=!r.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,o=`0123456789abcdef`.split(``),s=[128,32768,8388608,-2147483648],c=[0,8,16,24],l=[`hex`,`array`,`digest`,`arrayBuffer`];l.push(`buffer`),l.push(`base64`);var u=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),d=[],f;if(a){var p=new ArrayBuffer(68);f=new Uint8Array(p),d=new Uint32Array(p)}var m=Array.isArray;(r.JS_MD5_NO_NODE_JS||!m)&&(m=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var h=ArrayBuffer.isView;a&&(r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!h)&&(h=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e){var n=typeof e;if(n===`string`)return[e,!0];if(n!==`object`||e===null)throw Error(t);if(a&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!m(e)&&!h(e))throw Error(t);return[e,!1]},_=function(e){return function(t){return new x(!0).update(t)[e]()}},v=function(){var e=_(`hex`);e.create=function(){return new x},e.update=function(t){return e.create().update(t)};for(var t=0;t<l.length;++t){var n=l[t];e[n]=_(n)}return e},y=function(e){return function(t,n){return new S(t,!0).update(n)[e]()}},b=function(){var e=y(`hex`);e.create=function(e){return new S(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<l.length;++t){var n=l[t];e[n]=y(n)}return e};function x(e){if(e)d[0]=d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0,this.blocks=d,this.buffer8=f;else if(a){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}x.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=g(e);e=t[0];for(var n=t[1],r,i=0,o,s=e.length,l=this.blocks,u=this.buffer8;i<s;){if(this.hashed&&(this.hashed=!1,l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),n){if(a)for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?u[o++]=r:r<2048?(u[o++]=192|r>>>6,u[o++]=128|r&63):r<55296||r>=57344?(u[o++]=224|r>>>12,u[o++]=128|r>>>6&63,u[o++]=128|r&63):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),u[o++]=240|r>>>18,u[o++]=128|r>>>12&63,u[o++]=128|r>>>6&63,u[o++]=128|r&63);else for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?l[o>>>2]|=r<<c[o++&3]:r<2048?(l[o>>>2]|=(192|r>>>6)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3]):r<55296||r>=57344?(l[o>>>2]|=(224|r>>>12)<<c[o++&3],l[o>>>2]|=(128|r>>>6&63)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),l[o>>>2]|=(240|r>>>18)<<c[o++&3],l[o>>>2]|=(128|r>>>12&63)<<c[o++&3],l[o>>>2]|=(128|r>>>6&63)<<c[o++&3],l[o>>>2]|=(128|r&63)<<c[o++&3])}else if(a)for(o=this.start;i<s&&o<64;++i)u[o++]=e[i];else for(o=this.start;i<s&&o<64;++i)l[o>>>2]|=e[i]<<c[o++&3];this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>>2]|=s[t&3],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},x.prototype.hash=function(){var e,t,n,r,i,a,o=this.blocks;this.first?(e=o[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^e&2004318071)+o[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(e^-271733879))+o[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+o[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+o[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+o[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+o[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+o[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+o[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+o[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+o[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+o[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+o[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+o[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+o[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+o[12]-1926607734,t=(t<<20|t>>>12)+n<<0,i=t^n,e+=(i^r)+o[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[8]-2022574463,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[14]-35309556,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[4]+1272893353,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[10]-1094730640,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[0]-358537222,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[6]+76029189,t=(t<<23|t>>>9)+n<<0,i=t^n,e+=(i^r)+o[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(i^e)+o[12]-421815835,r=(r<<11|r>>>21)+e<<0,a=r^e,n+=(a^t)+o[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(a^n)+o[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+o[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+o[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+o[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+o[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+o[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},x.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return o[e>>>4&15]+o[e&15]+o[e>>>12&15]+o[e>>>8&15]+o[e>>>20&15]+o[e>>>16&15]+o[e>>>28&15]+o[e>>>24&15]+o[t>>>4&15]+o[t&15]+o[t>>>12&15]+o[t>>>8&15]+o[t>>>20&15]+o[t>>>16&15]+o[t>>>28&15]+o[t>>>24&15]+o[n>>>4&15]+o[n&15]+o[n>>>12&15]+o[n>>>8&15]+o[n>>>20&15]+o[n>>>16&15]+o[n>>>28&15]+o[n>>>24&15]+o[r>>>4&15]+o[r&15]+o[r>>>12&15]+o[r>>>8&15]+o[r>>>20&15]+o[r>>>16&15]+o[r>>>28&15]+o[r>>>24&15]},x.prototype.toString=x.prototype.hex,x.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[e&255,e>>>8&255,e>>>16&255,e>>>24&255,t&255,t>>>8&255,t>>>16&255,t>>>24&255,n&255,n>>>8&255,n>>>16&255,n>>>24&255,r&255,r>>>8&255,r>>>16&255,r>>>24&255]},x.prototype.array=x.prototype.digest,x.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.base64=function(){for(var e,t,n,r=``,i=this.array(),a=0;a<15;)e=i[a++],t=i[a++],n=i[a++],r+=u[e>>>2]+u[(e<<4|t>>>4)&63]+u[(t<<2|n>>>6)&63]+u[n&63];return e=i[a],r+=u[e>>>2]+u[e<<4&63]+`==`,r};function S(e,t){var n,r=g(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new x(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}x.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}S.prototype=new x,S.prototype.finalize=function(){if(x.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();x.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),x.prototype.finalize.call(this)}};var C=v();C.md5=C,C.md5.hmac=b(),i?e.exports=C:r.md5=C})()})(Wt);var Gt=Wt.exports,Kt=Ut(Gt),qt=e(((e,n)=>{
|
|
15
|
+
/*
|
|
16
|
+
* [js-sha1]{@link https://github.com/emn178/js-sha1}
|
|
17
|
+
*
|
|
18
|
+
* @version 0.7.0
|
|
19
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
20
|
+
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
21
|
+
* @license MIT
|
|
22
|
+
*/
|
|
23
|
+
(function(){var e=`input is invalid type`,r=typeof window==`object`,i=r?window:{};i.JS_SHA1_NO_WINDOW&&(r=!1);var a=!r&&typeof self==`object`,s=!i.JS_SHA1_NO_NODE_JS&&typeof process==`object`&&process.versions&&process.versions.node;s?i=globalThis:a&&(i=self);var c=!i.JS_SHA1_NO_COMMON_JS&&typeof n==`object`&&n.exports,l=typeof define==`function`&&define.amd,u=!i.JS_SHA1_NO_ARRAY_BUFFER&&typeof ArrayBuffer<`u`,d=`0123456789abcdef`.split(``),f=[-2147483648,8388608,32768,128],p=[24,16,8,0],m=[`hex`,`array`,`digest`,`arrayBuffer`],h=[],g=Array.isArray;(i.JS_SHA1_NO_NODE_JS||!g)&&(g=function(e){return Object.prototype.toString.call(e)===`[object Array]`});var _=ArrayBuffer.isView;u&&(i.JS_SHA1_NO_ARRAY_BUFFER_IS_VIEW||!_)&&(_=function(e){return typeof e==`object`&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(t){var n=typeof t;if(n===`string`)return[t,!0];if(n!==`object`||t===null)throw Error(e);if(u&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!g(t)&&!_(t))throw Error(e);return[t,!1]},y=function(e){return function(t){return new w(!0).update(t)[e]()}},b=function(){var e=y(`hex`);s&&(e=x(e)),e.create=function(){return new w},e.update=function(t){return e.create().update(t)};for(var t=0;t<m.length;++t){var n=m[t];e[n]=y(n)}return e},x=function(n){var r=t(),a=o().Buffer,s=a.from&&!i.JS_SHA1_NO_BUFFER_FROM?a.from:function(e){return new a(e)};return function(t){if(typeof t==`string`)return r.createHash(`sha1`).update(t,`utf8`).digest(`hex`);if(t==null)throw Error(e);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),g(t)||_(t)||t.constructor===a?r.createHash(`sha1`).update(s(t)).digest(`hex`):n(t)}},S=function(e){return function(t,n){return new T(t,!0).update(n)[e]()}},C=function(){var e=S(`hex`);e.create=function(e){return new T(e)},e.update=function(t,n){return e.create(t).update(n)};for(var t=0;t<m.length;++t){var n=m[t];e[n]=S(n)}return e};function w(e){e?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}w.prototype.update=function(e){if(this.finalized)throw Error(`finalize already called`);var t=v(e);e=t[0];for(var n=t[1],r,i=0,a,o=e.length||0,s=this.blocks;i<o;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,this.block=s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),n)for(a=this.start;i<o&&a<64;++i)r=e.charCodeAt(i),r<128?s[a>>>2]|=r<<p[a++&3]:r<2048?(s[a>>>2]|=(192|r>>>6)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]):r<55296||r>=57344?(s[a>>>2]|=(224|r>>>12)<<p[a++&3],s[a>>>2]|=(128|r>>>6&63)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),s[a>>>2]|=(240|r>>>18)<<p[a++&3],s[a>>>2]|=(128|r>>>12&63)<<p[a++&3],s[a>>>2]|=(128|r>>>6&63)<<p[a++&3],s[a>>>2]|=(128|r&63)<<p[a++&3]);else for(a=this.start;i<o&&a<64;++i)s[a>>>2]|=e[i]<<p[a++&3];this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=s[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes%=4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a,o,s,c=this.blocks;for(o=16;o<80;++o)s=c[o-3]^c[o-8]^c[o-14]^c[o-16],c[o]=s<<1|s>>>31;for(o=0;o<20;o+=5)a=t&n|~t&r,s=e<<5|e>>>27,i=s+a+i+1518500249+c[o]<<0,t=t<<30|t>>>2,a=e&t|~e&n,s=i<<5|i>>>27,r=s+a+r+1518500249+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|~i&t,s=r<<5|r>>>27,n=s+a+n+1518500249+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|~r&e,s=n<<5|n>>>27,t=s+a+t+1518500249+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|~n&i,s=t<<5|t>>>27,e=s+a+e+1518500249+c[o+4]<<0,n=n<<30|n>>>2;for(;o<40;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i+1859775393+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r+1859775393+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n+1859775393+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t+1859775393+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e+1859775393+c[o+4]<<0,n=n<<30|n>>>2;for(;o<60;o+=5)a=t&n|t&r|n&r,s=e<<5|e>>>27,i=s+a+i-1894007588+c[o]<<0,t=t<<30|t>>>2,a=e&t|e&n|t&n,s=i<<5|i>>>27,r=s+a+r-1894007588+c[o+1]<<0,e=e<<30|e>>>2,a=i&e|i&t|e&t,s=r<<5|r>>>27,n=s+a+n-1894007588+c[o+2]<<0,i=i<<30|i>>>2,a=r&i|r&e|i&e,s=n<<5|n>>>27,t=s+a+t-1894007588+c[o+3]<<0,r=r<<30|r>>>2,a=n&r|n&i|r&i,s=t<<5|t>>>27,e=s+a+e-1894007588+c[o+4]<<0,n=n<<30|n>>>2;for(;o<80;o+=5)a=t^n^r,s=e<<5|e>>>27,i=s+a+i-899497514+c[o]<<0,t=t<<30|t>>>2,a=e^t^n,s=i<<5|i>>>27,r=s+a+r-899497514+c[o+1]<<0,e=e<<30|e>>>2,a=i^e^t,s=r<<5|r>>>27,n=s+a+n-899497514+c[o+2]<<0,i=i<<30|i>>>2,a=r^i^e,s=n<<5|n>>>27,t=s+a+t-899497514+c[o+3]<<0,r=r<<30|r>>>2,a=n^r^i,s=t<<5|t>>>27,e=s+a+e-899497514+c[o+4]<<0,n=n<<30|n>>>2;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0},w.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return d[e>>>28&15]+d[e>>>24&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>4&15]+d[e&15]+d[t>>>28&15]+d[t>>>24&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>4&15]+d[t&15]+d[n>>>28&15]+d[n>>>24&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>4&15]+d[n&15]+d[r>>>28&15]+d[r>>>24&15]+d[r>>>20&15]+d[r>>>16&15]+d[r>>>12&15]+d[r>>>8&15]+d[r>>>4&15]+d[r&15]+d[i>>>28&15]+d[i>>>24&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>4&15]+d[i&15]},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255]},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};function T(e,t){var n,r=v(e);if(e=r[0],r[1]){var i=[],a=e.length,o=0,s;for(n=0;n<a;++n)s=e.charCodeAt(n),s<128?i[o++]=s:s<2048?(i[o++]=192|s>>>6,i[o++]=128|s&63):s<55296||s>=57344?(i[o++]=224|s>>>12,i[o++]=128|s>>>6&63,i[o++]=128|s&63):(s=65536+((s&1023)<<10|e.charCodeAt(++n)&1023),i[o++]=240|s>>>18,i[o++]=128|s>>>12&63,i[o++]=128|s>>>6&63,i[o++]=128|s&63);e=i}e.length>64&&(e=new w(!0).update(e).array());var c=[],l=[];for(n=0;n<64;++n){var u=e[n]||0;c[n]=92^u,l[n]=54^u}w.call(this,t),this.update(l),this.oKeyPad=c,this.inner=!0,this.sharedMemory=t}T.prototype=new w,T.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();w.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(e),w.prototype.finalize.call(this)}};var E=b();E.sha1=E,E.sha1.hmac=C(),c?n.exports=E:(i.sha1=E,l&&define(function(){return E}))})()}))();const Jt=65536,Yt={md5:Kt,sha1:qt.sha1,sha256:a};function Xt(e,t){return typeof e==`string`?t===`hex`||t===`base64`||t===`base64url`||t===`latin1`||t===`binary`?new Uint8Array(Ze(e,t===`binary`?`latin1`:t)):e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Zt(e){let t=String(e).toLowerCase().replace(`-`,``),n=Yt[t];if(!n)throw Error(`Digest method not supported: ${e}`);let r=n.create(),i=!1,a={update(e,t){if(i)throw Error(`Digest already called`);return r.update(Xt(e,t)),a},digest(e){i=!0;let t=Ze(r.array());return e?t.toString(e):t}};return a}function Qt(){let e=globalThis.crypto;if(!e||typeof e.getRandomValues!=`function`)throw Error(`crypto: globalThis.crypto is unavailable in this environment`);return e}function $t(e){return Qt().getRandomValues(e)}function en(e){for(let t=0;t<e.length;t+=Jt){let n=Math.min(t+Jt,e.length);$t(e.subarray(t,n))}}function tn(e){return e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const I=Array.from({length:256},(e,t)=>(t+256).toString(16).slice(1));function nn(){let e=Qt();if(typeof e.randomUUID==`function`)return e.randomUUID();let t=$t(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,`${I[t[0]]}${I[t[1]]}${I[t[2]]}${I[t[3]]}-${I[t[4]]}${I[t[5]]}-${I[t[6]]}${I[t[7]]}-${I[t[8]]}${I[t[9]]}-${I[t[10]]}${I[t[11]]}${I[t[12]]}${I[t[13]]}${I[t[14]]}${I[t[15]]}`}const rn={randomFillSync(e,t=0,n){let r=tn(e),i=t,a=n===void 0?r.length:i+n;return en(r.subarray(i,a)),e},randomBytes(e){let t=globalThis.Buffer,n=t&&typeof t.allocUnsafe==`function`?t.allocUnsafe(e):new Uint8Array(e);return en(tn(n)),n},randomUUID:nn,getRandomValues(e){return $t(e)},createHash:Zt,get webcrypto(){return Qt()},get subtle(){return Qt().subtle}};function an(e,t){let n=[];for(let r of e)r!==``&&r!==`.`&&(r===`..`?n.length>0&&n[n.length-1]!==`..`?n.pop():t&&n.push(`..`):n.push(r));return n}function on(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=an(e.split(`/`),!t).join(`/`);return r.length===0&&!t&&(r=`.`),r.length>0&&n&&(r+=`/`),(t?`/`:``)+r}function sn(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0).join(`/`);return t.length===0?`.`:on(t)}function cn(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;t--)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)}function ln(e,t){let n=0,r=-1,i=!0;for(let t=e.length-1;t>=0;t--)if(e.charCodeAt(t)===47){if(!i){n=t+1;break}}else r===-1&&(i=!1,r=t+1);let a=r===-1?``:e.slice(n,r);return t&&a.endsWith(t)&&a!==t?a.slice(0,a.length-t.length):a}function un(e){let t=ln(e),n=t.lastIndexOf(`.`);return n<=0?``:t.slice(n)}function dn(){let e=globalThis.process?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}function fn(e,t){let n=``,r=!1;for(let i=t.length-1;i>=-1&&!r;i--){let a=i>=0?t[i]:e();typeof a==`string`&&a.length!==0&&(n=n.length>0?`${a}/${n}`:a,r=a.charCodeAt(0)===47)}let i=an(n.split(`/`),!r).join(`/`);return r?i.length>0?`/${i}`:`/`:i.length>0?i:`.`}function pn(e,t,n){let r=fn(e,[t]),i=fn(e,[n]);if(r===i)return``;let a=r.split(`/`).filter(Boolean),o=i.split(`/`).filter(Boolean),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;return[...a.slice(s).map(()=>`..`),...o.slice(s)].join(`/`)}function mn(e){let t=e.charCodeAt(0)===47?`/`:``,n=ln(e),r=un(e),i=r?n.slice(0,n.length-r.length):n,a=cn(e);return a===`.`&&t===``&&(a=``),{root:t,dir:a,base:n,ext:r,name:i}}function hn(e){let t=e.dir||e.root||``,n=e.base||`${e.name||``}${e.ext||``}`;return t?t===e.root?`${t}${n}`:`${t}/${n}`:n}function gn(e=dn){return{sep:`/`,delimiter:`:`,basename:ln,dirname:cn,extname:un,isAbsolute:e=>e.length>0&&e.charCodeAt(0)===47,join:sn,normalize:on,resolve:(...t)=>fn(e,t),relative:(t,n)=>pn(e,t,n),parse:mn,format:hn}}const _n=gn(),vn=Object.freeze([...l]);function yn(e){return typeof e==`string`&&c(e)}function bn(e){let t=[],n=e;for(;(n===`/`?``:n.slice(n.lastIndexOf(`/`)+1))!==`node_modules`&&t.push(n===`/`||n===``?`/node_modules`:`${n}/node_modules`),n!==`/`&&n!==``;){let e=n.lastIndexOf(`/`);n=e<=0?e===0?`/`:``:n.slice(0,e)}return t}function xn(e){if(e instanceof URL)return C.fileURLToPath(e);if(typeof e==`string`){if(e.startsWith(`file:`))return C.fileURLToPath(e);if(e.startsWith(`/`))return e}throw TypeError(`The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ${String(e)}`)}function Sn(e,t){let n=t.startsWith(`/`)?_n.normalize(t):_n.resolve(e,t);return/\.(?:js|json|cjs|mjs)$/.test(n)?[n]:[n,`${n}.js`,`${n}.json`,`${n}.cjs`,`${n}/index.js`,`${n}/index.json`]}function Cn(e,t,n){for(let r of Sn(e,t))if(n(r))return r}function wn(e,t,n){for(let r of bn(e)){let e=Cn(r,t,n);if(e)return e}}function Tn(e){return e.startsWith(`.`)||e.startsWith(`/`)}function En(e){function t(e){return{exports:{},id:e??``,filename:e??``,loaded:!1}}let n=t;return n.createRequire=t=>Dn(e,t),n.builtinModules=vn,n.isBuiltin=yn,n._nodeModulePaths=bn,n.Module=n,n}function Dn(e,t){let n=xn(t),r=(t=>e.requireFrom(n,t));return r.resolve=(t,r)=>{if(r?.paths&&r.paths.length>0){let n;for(let i of r.paths)try{return e.resolveFrom(On(i),t)}catch(e){n=e}throw n instanceof Error?n:Error(`Cannot find module '${t}'`)}return e.resolveFrom(n,t)},r}function On(e){return`${e.endsWith(`/`)&&e!==`/`?e.slice(0,-1):e}/noop.js`}const kn={platform:()=>`linux`,arch:()=>`x64`,EOL:`
|
|
24
|
+
`,cpus:()=>[{model:`virtual`,speed:0}],hostname:()=>`slicc`,type:()=>`Linux`,release:()=>`0.0.0`};function An(e){return{...kn,tmpdir:()=>h(e),homedir:()=>e?.HOME?.trim()?e.HOME:`/home/user`}}const jn=An(),Mn={isatty:e=>!1,ReadStream:class{},WriteStream:class{}},Nn=new WeakMap;let Pn=new Set,Fn=null;const In=/\bfunction\s*\*?\s*([A-Za-z_$][\w$]*)\s*\(/g,Ln=/\b(?:const|let|class)\s+([A-Za-z_$][\w$]*)/g,Rn=new Set(`arguments await break case catch class const continue debugger default delete do else enum eval export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield`.split(` `));function zn(e,t){return[...new Set([...e.matchAll(t)].map(e=>e[1]))].filter(e=>!Rn.has(e))}function Bn(e){return e.length===0?``:`\n;let __vm_lexcap = (__vm_out.lex = () => ({ ${e.join(`, `)} }));`}function Vn(){return Fn??=Function(`__vm_scope`,`__vm_code`,`__vm_fns`,`__vm_out`,`with (__vm_scope) { __vm_out.value = eval(__vm_code); }
|
|
25
|
+
for (var __vm_i = 0; __vm_i < __vm_fns.length; __vm_i++) {
|
|
26
|
+
try { __vm_out.fns.set(__vm_fns[__vm_i], eval(__vm_fns[__vm_i])); } catch (e) {}
|
|
27
|
+
}`),Fn}function Hn(e){let t=new Map,n=new Proxy(e,{has(e,t){return typeof t==`symbol`||t===`eval`||t.startsWith(`__vm_`)?!1:!Pn.has(t)},get(e,r,i){if(r===Symbol.unscopables)return;if(r in e)return Reflect.get(e,r,i);if(r===`globalThis`)return n;let a=Reflect.get(globalThis,r);return typeof a!=`function`||`prototype`in a?a:(t.has(r)||t.set(r,a.bind(globalThis)),t.get(r))},set(e,t,n){return Reflect.set(e,t,n)}});return n}function Un(e){return typeof e==`string`?e:e?.filename}function Wn(e,t){let n=Un(t);return n?`${e}\n//# sourceURL=${n}`:e}function Gn(e){let t=e??{};return Nn.has(t)||Nn.set(t,Hn(t)),t}function Kn(e){return typeof e==`object`&&!!e&&Nn.has(e)}function qn(e,t,n){let r=Nn.get(t);if(!r)throw TypeError(`The "contextifiedObject" argument must be an vm.Context`);let i=String(e),a=zn(i,In),o=zn(i,Ln),s={value:void 0,fns:new Map},c=Pn;Pn=new Set(a);try{let e=Wn(i+Bn(o),n);Vn().call(r,r,e,a,s)}finally{Pn=c}let l=(e,t)=>t!==void 0&&t!==Reflect.get(globalThis,e);for(let[e,n]of s.fns)typeof n==`function`&&l(e,n)&&Reflect.set(t,e,n);for(let[e,n]of Object.entries(s.lex?.()??{}))l(e,n)&&Reflect.set(t,e,n);return s.value}function Jn(e,t,n){return qn(e,Gn(t),n)}function Yn(e,t){let n=globalThis.eval;return n(Wn(String(e),t))}var Xn=class{#e;#t;constructor(e,t){this.#e=String(e),this.#t=t}runInContext(e){return qn(this.#e,e,this.#t)}runInNewContext(e){return Jn(this.#e,e,this.#t)}runInThisContext(){return Yn(this.#e,this.#t)}};function Zn(e,t=[]){return Function(...t,String(e))}const Qn={Script:Xn,createContext:Gn,isContext:Kn,runInContext:qn,runInNewContext:Jn,runInThisContext:Yn,compileFunction:Zn};var $n=4,er=0,tr=1,nr=2;function rr(e){let t=e.length;for(;--t>=0;)e[t]=0}var ir=29,ar=256,or=286,sr=30,cr=19,lr=573,ur=15,dr=16,fr=7,pr=256,mr=16,hr=17,gr=18,_r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),vr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),yr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),br=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xr=512,L=Array(576);rr(L);var Sr=Array(sr*2);rr(Sr);var Cr=Array(xr);rr(Cr);var wr=Array(256);rr(wr);var Tr=Array(ir);rr(Tr);var Er=Array(sr);rr(Er);var Dr=class{constructor(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}},Or,kr,Ar,jr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},Mr=e=>e<256?Cr[e]:Cr[256+(e>>>7)],Nr=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},R=(e,t,n)=>{e.bi_valid>dr-n?(e.bi_buf|=t<<e.bi_valid&65535,Nr(e,e.bi_buf),e.bi_buf=t>>dr-e.bi_valid,e.bi_valid+=n-dr):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},z=(e,t,n)=>{R(e,n[t*2],n[t*2+1])},Pr=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Fr=e=>{e.bi_valid===16?(Nr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Ir=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=ur;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<lr;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}},Lr=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=ur;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let t=e[o*2+1];t!==0&&(e[o*2]=Pr(r[t]++,t))}},Rr=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<ir-1;r++)for(Tr[r]=n,e=0;e<1<<_r[r];e++)wr[n++]=r;for(wr[n-1]=r,i=0,r=0;r<16;r++)for(Er[r]=i,e=0;e<1<<vr[r];e++)Cr[i++]=r;for(i>>=7;r<sr;r++)for(Er[r]=i<<7,e=0;e<1<<vr[r]-7;e++)Cr[256+i++]=r;for(t=0;t<=ur;t++)a[t]=0;for(e=0;e<=143;)L[e*2+1]=8,e++,a[8]++;for(;e<=255;)L[e*2+1]=9,e++,a[9]++;for(;e<=279;)L[e*2+1]=7,e++,a[7]++;for(;e<=287;)L[e*2+1]=8,e++,a[8]++;for(Lr(L,287,a),e=0;e<sr;e++)Sr[e*2+1]=5,Sr[e*2]=Pr(e,5);Or=new Dr(L,_r,257,or,ur),kr=new Dr(Sr,vr,0,sr,ur),Ar=new Dr([],yr,0,cr,fr)},zr=e=>{let t;for(t=0;t<or;t++)e.dyn_ltree[t*2]=0;for(t=0;t<sr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<cr;t++)e.bl_tree[t*2]=0;e.dyn_ltree[pr*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Br=e=>{e.bi_valid>8?Nr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Vr=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Hr=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Vr(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Vr(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},Ur=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?z(e,i,t):(o=wr[i],z(e,o+ar+1,t),s=_r[o],s!==0&&(i-=Tr[o],R(e,i,s)),r--,o=Mr(r),z(e,o,n),s=vr[o],s!==0&&(r-=Er[o],R(e,r,s)));while(a<e.sym_next);z(e,pr,t)},Wr=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=lr,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Hr(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Hr(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Hr(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Ir(e,t),Lr(n,c,e.bl_count)},Gr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[34]++:e.bl_tree[36]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[32]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},Kr=(e,t,n)=>{let r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do z(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(z(e,hr,e.bl_tree),R(e,s-3,3)):(z(e,gr,e.bl_tree),R(e,s-11,7)):(a!==i&&(z(e,a,e.bl_tree),s--),z(e,mr,e.bl_tree),R(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},qr=e=>{let t;for(Gr(e,e.dyn_ltree,e.l_desc.max_code),Gr(e,e.dyn_dtree,e.d_desc.max_code),Wr(e,e.bl_desc),t=18;t>=3&&e.bl_tree[br[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Jr=(e,t,n,r)=>{let i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i<r;i++)R(e,e.bl_tree[br[i]*2+1],3);Kr(e,e.dyn_ltree,t-1),Kr(e,e.dyn_dtree,n-1)},Yr=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return er;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return tr;for(n=32;n<ar;n++)if(e.dyn_ltree[n*2]!==0)return tr;return er},Xr=!1,Zr=e=>{Xr||=(Rr(),!0),e.l_desc=new jr(e.dyn_ltree,Or),e.d_desc=new jr(e.dyn_dtree,kr),e.bl_desc=new jr(e.bl_tree,Ar),e.bi_buf=0,e.bi_valid=0,zr(e)},Qr=(e,t,n,r)=>{R(e,0+ +!!r,3),Br(e),Nr(e,n),Nr(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},$r=e=>{R(e,2,3),z(e,pr,L),Fr(e)},ei=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===nr&&(e.strm.data_type=Yr(e)),Wr(e,e.l_desc),Wr(e,e.d_desc),o=qr(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?Qr(e,t,n,r):e.strategy===$n||a===i?(R(e,2+ +!!r,3),Ur(e,L,Sr)):(R(e,4+ +!!r,3),Jr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Ur(e,e.dyn_ltree,e.dyn_dtree)),zr(e),r&&Br(e)},B=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(wr[n]+ar+1)*2]++,e.dyn_dtree[Mr(t)*2]++),e.sym_next===e.sym_end),ti=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},ni=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t})()),V=(e,t,n,r)=>{let i=ni,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},H={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`},ri=9,ii=573,U=3,ai=258,W=262,oi=32,si=42,ci=57,li=69,ui=73,di=91,fi=103,pi=113,mi=666,G=1,hi=2,gi=3,_i=4,vi=3,yi=(e,t)=>(e.msg=H[t],t),bi=e=>e*2-(e>4?9:0),K=e=>{let t=e.length;for(;--t>=0;)e[t]=0},xi=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},Si=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Ci=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Si(e,e.ins_h,e.window[t+U-1]);else{let r=e.window,i=r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24;n=e.ins_h=Math.imul(i,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},q=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},J=(e,t)=>{ei(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,q(e.strm)},Y=(e,t)=>{e.pending_buf[e.pending++]=t},wi=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Ti=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=ti(e.adler,t,i,n):e.state.wrap===2&&(e.adler=V(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Ei=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+ai,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=ai-(f-r),r=f-ai,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Di=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-W)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),xi(e),r+=t),e.strm.avail_in===0)break;if(n=Ti(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>U)for(i=e.strstart-e.insert;e.insert&&(Ci(e,i),i++,e.insert--,!(e.lookahead+e.insert<=U)););}else if(e.lookahead+e.insert>=U)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Si(e,e.ins_h,e.window[i+1]);e.insert&&(Ci(e,i),i++,e.insert--,!(e.lookahead+e.insert<U)););}while(e.lookahead<W&&e.strm.avail_in!==0)},Oi=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==4||t===0||r!==i+e.strm.avail_in)))break;o=+(t===4&&r===i+e.strm.avail_in),Qr(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,q(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Ti(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?_i:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?hi:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Ti(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===4)&&t!==0&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=+(t===4&&e.strm.avail_in===0&&r===i),Qr(e,e.block_start,r,o),e.block_start+=r,q(e.strm)),o?gi:G)},ki=(e,t)=>{let n,r;for(;;){if(e.lookahead<W){if(Di(e),e.lookahead<W&&t===0)return G;if(e.lookahead===0)break}if(n=0,e.lookahead>=U&&(n=Ci(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-W&&(e.match_length=Ei(e,n)),e.match_length>=U){if(r=B(e,e.strstart-e.match_start,e.match_length-U),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=U){e.match_length--;do e.strstart++,n=Ci(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=Si(e,e.ins_h,e.window[e.strstart+1]))}else r=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=e.strstart<U-1?e.strstart:U-1,t===4?(J(e,!0),e.strm.avail_out===0?gi:_i):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:hi},Ai=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<W){if(Di(e),e.lookahead<W&&t===0)return G;if(e.lookahead===0)break}if(n=0,e.lookahead>=U&&(n=Ci(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=U-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-W&&(e.match_length=Ei(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===U&&e.strstart-e.match_start>4096)&&(e.match_length=U-1)),e.prev_length>=U&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-U,r=B(e,e.strstart-1-e.prev_match,e.prev_length-U),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Ci(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=U-1,e.strstart++,r&&(J(e,!1),e.strm.avail_out===0))return G}else if(e.match_available){if(r=B(e,0,e.window[e.strstart-1]),r&&J(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return G}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=B(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<U-1?e.strstart:U-1,t===4?(J(e,!0),e.strm.avail_out===0?gi:_i):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:hi},ji=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=ai){if(Di(e),e.lookahead<=ai&&t===0)return G;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=U&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+ai;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=ai-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=U?(n=B(e,1,e.match_length-U),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?gi:_i):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:hi},Mi=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Di(e),e.lookahead===0)){if(t===0)return G;break}if(e.match_length=0,n=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(J(e,!1),e.strm.avail_out===0))return G}return e.insert=0,t===4?(J(e,!0),e.strm.avail_out===0?gi:_i):e.sym_next&&(J(e,!1),e.strm.avail_out===0)?G:hi},X=class{constructor(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}},Ni=[new X(0,0,0,0,Oi),new X(4,4,8,4,ki),new X(4,5,16,8,ki),new X(4,6,32,32,ki),new X(4,4,16,16,Ai),new X(8,16,32,32,Ai),new X(8,16,128,128,Ai),new X(8,32,128,256,Ai),new X(32,128,258,1024,Ai),new X(32,258,258,4096,Ai)],Pi=e=>{e.window_size=2*e.w_size,K(e.head),e.max_lazy_match=Ni[e.level].max_lazy,e.good_match=Ni[e.level].good_length,e.nice_match=Ni[e.level].nice_length,e.max_chain_length=Ni[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=U-1,e.match_available=0,e.ins_h=0},Fi=class{constructor(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ii*2),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),K(this.dyn_ltree),K(this.dyn_dtree),K(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),K(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),K(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}},Ii=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==si&&t.status!==ci&&t.status!==li&&t.status!==ui&&t.status!==di&&t.status!==fi&&t.status!==pi&&t.status!==mi)},Li=e=>{if(Ii(e))return yi(e,-2);e.total_in=e.total_out=0,e.data_type=2;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ci:t.wrap?si:pi,e.adler=t.wrap===2?0:1,t.last_flush=-2,Zr(t),0},Ri=e=>{let t=Li(e);return t===0&&Pi(e.state),t},zi=(e,t,n,r,i,a,o)=>{if(!e)return-2;let s=1;if(t===-1&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>ri||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return yi(e,-2);r===8&&(r=9);let c=new Fi;return e.state=c,c.strm=e,c.status=si,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=+!!o,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+U-1)/U),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=a,c.method=n,Ri(e)},Bi=(e,t)=>{if(Ii(e)||t>5||t<0)return e?yi(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===mi&&t!==4)return yi(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(q(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&bi(t)<=bi(r)&&t!==4)return yi(e,-5);if(n.status===mi&&e.avail_in!==0)return yi(e,-5);if(n.status===si&&n.wrap===0&&(n.status=pi),n.status===si){let t=8+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=2||n.level<2?0:n.level<6?1:n.level===6?2:3,t|=r<<6,n.strstart!==0&&(t|=oi),t+=31-t%31,wi(n,t),n.strstart!==0&&(wi(n,e.adler>>>16),wi(n,e.adler&65535)),e.adler=1,n.status=pi,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===ci){if(e.adler=0,Y(n,31),Y(n,139),Y(n,8),n.gzhead)Y(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Y(n,n.gzhead.time&255),Y(n,n.gzhead.time>>8&255),Y(n,n.gzhead.time>>16&255),Y(n,n.gzhead.time>>24&255),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Y(n,n.gzhead.extra.length&255),Y(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=V(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=li;else if(Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,0),Y(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),Y(n,vi),n.status=pi,q(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===li){if(n.gzhead.extra){let t=n.pending,r=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=i,q(e),n.pending!==0)return n.last_flush=-1,0;t=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=ui}if(n.status===ui){if(n.gzhead.name){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.name.length?n.gzhead.name.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=di}if(n.status===di){if(n.gzhead.comment){let t=n.pending,r;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t)),q(e),n.pending!==0)return n.last_flush=-1,0;t=0}r=n.gzindex<n.gzhead.comment.length?n.gzhead.comment.charCodeAt(n.gzindex++)&255:0,Y(n,r)}while(r!==0);n.gzhead.hcrc&&n.pending>t&&(e.adler=V(e.adler,n.pending_buf,n.pending-t,t))}n.status=fi}if(n.status===fi){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(q(e),n.pending!==0))return n.last_flush=-1,0;Y(n,e.adler&255),Y(n,e.adler>>8&255),e.adler=0}if(n.status=pi,q(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==mi){let r=n.level===0?Oi(n,t):n.strategy===2?Mi(n,t):n.strategy===3?ji(n,t):Ni[n.level].func(n,t);if((r===gi||r===_i)&&(n.status=mi),r===G||r===gi)return e.avail_out===0&&(n.last_flush=-1),0;if(r===hi&&(t===1?$r(n):t!==5&&(Qr(n,0,0,!1),t===3&&(K(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),q(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(Y(n,e.adler&255),Y(n,e.adler>>8&255),Y(n,e.adler>>16&255),Y(n,e.adler>>24&255),Y(n,e.total_in&255),Y(n,e.total_in>>8&255),Y(n,e.total_in>>16&255),Y(n,e.total_in>>24&255)):(wi(n,e.adler>>>16),wi(n,e.adler&65535)),q(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},Vi=e=>{if(Ii(e))return-2;let t=e.state.status;return e.state=null,t===pi?yi(e,-3):0},Hi=(e,t)=>{let n=t.length;if(Ii(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==si||r.lookahead)return-2;if(i===1&&(e.adler=ti(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(K(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Di(r);r.lookahead>=U;){let e=r.strstart,t=r.lookahead-(U-1);do Ci(r,e),e++;while(--t);r.strstart=e,r.lookahead=U-1,Di(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=U-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},Ui=16209,Wi=16191;function Gi(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=e.state;n=e.next_in,w=e.input,r=n+(e.avail_in-5),i=e.next_out,T=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=E.dmax,c=E.wsize,l=E.whave,u=E.wnext,d=E.window,f=E.hold,p=E.bits,m=E.lencode,h=E.distcode,g=(1<<E.lenbits)-1,_=(1<<E.distbits)-1;top:do{p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=m[f&g];dolen:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y===0)T[i++]=v&65535;else if(y&16){b=v&65535,y&=15,y&&(p<y&&(f+=w[n++]<<p,p+=8),b+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=w[n++]<<p,p+=8,f+=w[n++]<<p,p+=8),v=h[f&_];dodist:for(;;){if(y=v>>>24,f>>>=y,p-=y,y=v>>>16&255,y&16){if(x=v&65535,y&=15,p<y&&(f+=w[n++]<<p,p+=8,p<y&&(f+=w[n++]<<p,p+=8)),x+=f&(1<<y)-1,x>s){e.msg=`invalid distance too far back`,E.mode=Ui;break top}if(f>>>=y,p-=y,y=i-a,x>y){if(y=x-y,y>l&&E.sane){e.msg=`invalid distance too far back`,E.mode=Ui;break top}if(S=0,C=d,u===0){if(S+=c-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}else if(u<y){if(S+=c+u-y,y-=u,y<b){b-=y;do T[i++]=d[S++];while(--y);if(S=0,u<b){y=u,b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}}}else if(S+=u-y,y<b){b-=y;do T[i++]=d[S++];while(--y);S=i-x,C=T}for(;b>2;)T[i++]=C[S++],T[i++]=C[S++],T[i++]=C[S++],b-=3;b&&(T[i++]=C[S++],b>1&&(T[i++]=C[S++]))}else{S=i-x;do T[i++]=T[S++],T[i++]=T[S++],T[i++]=T[S++],b-=3;while(b>2);b&&(T[i++]=T[S++],b>1&&(T[i++]=T[S++]))}}else if(y&64){e.msg=`invalid distance code`,E.mode=Ui;break top}else{v=h[(v&65535)+(f&(1<<y)-1)];continue dodist}break}}else if(!(y&64)){v=m[(v&65535)+(f&(1<<y)-1)];continue dolen}else if(y&32){E.mode=Wi;break top}else{e.msg=`invalid literal/length code`,E.mode=Ui;break top}break}}while(n<r&&i<o);b=p>>3,n-=b,p-=b<<3,f&=(1<<p)-1,e.next_in=n,e.next_out=i,e.avail_in=n<r?5+(r-n):5-(n-r),e.avail_out=i<o?257+(o-i):257-(i-o),E.hold=f,E.bits=p}var Ki=15,qi=852,Ji=592,Yi=0,Xi=1,Zi=2,Qi=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),$i=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),ea=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ta=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),na=(e,t,n,r,i,a,o,s)=>{let c=s.bits,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0,y,b,x,S,C,w=null,T,E=new Uint16Array(16),D=new Uint16Array(16),O=null,k,A,j;for(l=0;l<=Ki;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=Ki;f>=1&&E[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(d=1;d<f&&E[d]===0;d++);for(p<d&&(p=d),g=1,l=1;l<=Ki;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===Yi||f!==1))return-1;for(D[1]=0,l=1;l<Ki;l++)D[l+1]=D[l]+E[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[D[t[n+u]]++]=u);if(e===Yi?(w=O=o,T=20):e===Xi?(w=Qi,O=$i,T=257):(w=ea,O=ta,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===Xi&&_>qi||e===Zi&&_>Ji)return 1;for(;;){k=l-h,o[u]+1<T?(A=0,j=o[u]):o[u]>=T?(A=O[o[u]-T],j=w[o[u]-T]):(A=96,j=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|A<<16|j|0;while(b!==0);for(y=1<<l-1;v&y;)y>>=1;if(y===0?v=0:(v&=y-1,v+=y),u++,--E[l]===0){if(l===f)break;l=t[n+o[u]]}if(l>p&&(v&S)!==x){for(h===0&&(h=p),C+=d,m=l-h,g=1<<m;m+h<f&&(g-=E[m+h],!(g<=0));)m++,g<<=1;if(_+=1<<m,e===Xi&&_>qi||e===Zi&&_>Ji)return 1;x=v&S,i[x]=p<<24|m<<16|C-a|0}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},ra=0,ia=1,aa=2,oa=16180,sa=16181,ca=16182,la=16183,ua=16184,da=16185,fa=16186,pa=16187,ma=16188,ha=16189,ga=16190,Z=16191,_a=16192,va=16193,ya=16194,ba=16195,xa=16196,Sa=16197,Ca=16198,wa=16199,Ta=16200,Ea=16201,Da=16202,Oa=16203,ka=16204,Aa=16205,ja=16206,Ma=16207,Na=16208,Q=16209,Pa=16210,Fa=16211,Ia=852,La=592,Ra=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),za=class{constructor(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},Ba=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<oa||t.mode>Fa)},Va=e=>{if(Ba(e))return-2;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=t.wrap&1),t.mode=oa,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Ia),t.distcode=t.distdyn=new Int32Array(La),t.sane=1,t.back=-1,0},Ha=e=>{if(Ba(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Va(e)},Ua=(e,t)=>{let n;if(Ba(e))return-2;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?-2:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Ha(e))},Wa=(e,t)=>{if(!e)return-2;let n=new za;e.state=n,n.strm=e,n.window=null,n.mode=oa;let r=Ua(e,t);return r!==0&&(e.state=null),r},Ga=!0,Ka,qa,Ja=e=>{if(Ga){Ka=new Int32Array(512),qa=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(na(ia,e.lens,0,288,Ka,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;na(aa,e.lens,0,32,qa,0,e.work,{bits:5}),Ga=!1}e.lencode=Ka,e.lenbits=9,e.distcode=qa,e.distbits=5},Ya=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Xa=(e,t)=>{let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=0,_,v,y,b,x,S,C,w,T=new Uint8Array(4),E,D,O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ba(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===Z&&(n.mode=_a),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,d=s,f=c,w=0;inf_leave:for(;;)switch(n.mode){case oa:if(n.wrap===0){n.mode=_a;break}for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,T[0]=l&255,T[1]=l>>>8&255,n.check=V(n.check,T,2,0),l=0,u=0,n.mode=sa;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Q;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(l>>>=4,u-=4,C=(l&15)+8,n.wbits===0&&(n.wbits=C),C>15||C>n.wbits){e.msg=`invalid window size`,n.mode=Q;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?ha:Z,l=0,u=0;break;case sa:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!=8){e.msg=`unknown compression method`,n.mode=Q;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Q;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=V(n.check,T,2,0)),l=0,u=0,n.mode=ca;case ca:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,T[2]=l>>>16&255,T[3]=l>>>24&255,n.check=V(n.check,T,4,0)),l=0,u=0,n.mode=la;case la:for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=V(n.check,T,2,0)),l=0,u=0,n.mode=ua;case ua:if(n.flags&1024){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(T[0]=l&255,T[1]=l>>>8&255,n.check=V(n.check,T,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=da;case da:if(n.flags&1024&&(p=n.length,p>s&&(p=s),p&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+p),C)),n.flags&512&&n.wrap&4&&(n.check=V(n.check,r,p,a)),s-=p,a+=p,n.length-=p),n.length))break inf_leave;n.length=0,n.mode=fa;case fa:if(n.flags&2048){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=V(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.name=null);n.length=0,n.mode=pa;case pa:if(n.flags&4096){if(s===0)break inf_leave;p=0;do C=r[a+p++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C));while(C&&p<s);if(n.flags&512&&n.wrap&4&&(n.check=V(n.check,r,p,a)),s-=p,a+=p,C)break inf_leave}else n.head&&(n.head.comment=null);n.mode=ma;case ma:if(n.flags&512){for(;u<16;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg=`header crc mismatch`,n.mode=Q;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Z;break;case ha:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=Ra(l),l=0,u=0,n.mode=ga;case ga:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,2;e.adler=n.check=1,n.mode=Z;case Z:if(t===5||t===6)break inf_leave;case _a:if(n.last){l>>>=u&7,u-=u&7,n.mode=ja;break}for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,--u,l&3){case 0:n.mode=va;break;case 1:if(Ja(n),n.mode=wa,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=xa;break;case 3:e.msg=`invalid block type`,n.mode=Q}l>>>=2,u-=2;break;case va:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if((l&65535)!=(l>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=Q;break}if(n.length=l&65535,l=0,u=0,n.mode=ya,t===6)break inf_leave;case ya:n.mode=ba;case ba:if(p=n.length,p){if(p>s&&(p=s),p>c&&(p=c),p===0)break inf_leave;i.set(r.subarray(a,a+p),o),s-=p,a+=p,c-=p,o+=p,n.length-=p;break}n.mode=Z;break;case xa:for(;u<14;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg=`too many length or distance symbols`,n.mode=Q;break}n.have=0,n.mode=Sa;case Sa:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.lens[O[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,E={bits:n.lenbits},w=na(ra,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Q;break}n.have=0,n.mode=Ca;case Ca:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(y<16)l>>>=_,u-=_,n.lens[n.have++]=y;else{if(y===16){for(D=_+2;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(l>>>=_,u-=_,n.have===0){e.msg=`invalid bit length repeat`,n.mode=Q;break}C=n.lens[n.have-1],p=3+(l&3),l>>>=2,u-=2}else if(y===17){for(D=_+3;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=3+(l&7),l>>>=3,u-=3}else{for(D=_+7;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=_,u-=_,C=0,p=11+(l&127),l>>>=7,u-=7}if(n.have+p>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=Q;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Q)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Q;break}if(n.lenbits=9,E={bits:n.lenbits},w=na(ia,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Q;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=na(aa,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Q;break}if(n.mode=wa,t===6)break inf_leave;case wa:n.mode=Ta;case Ta:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,Gi(e,f),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===Z&&(n.back=-1);break}for(n.back=0;g=n.lencode[l&(1<<n.lenbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(v&&!(v&240)){for(b=_,x=v,S=y;g=n.lencode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,n.length=y,v===0){n.mode=Aa;break}if(v&32){n.back=-1,n.mode=Z;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Q;break}n.extra=v&15,n.mode=Ea;case Ea:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Da;case Da:for(;g=n.distcode[l&(1<<n.distbits)-1],_=g>>>24,v=g>>>16&255,y=g&65535,!(_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(!(v&240)){for(b=_,x=v,S=y;g=n.distcode[S+((l&(1<<b+x)-1)>>b)],_=g>>>24,v=g>>>16&255,y=g&65535,!(b+_<=u);){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}l>>>=b,u-=b,n.back+=b}if(l>>>=_,u-=_,n.back+=_,v&64){e.msg=`invalid distance code`,n.mode=Q;break}n.offset=y,n.extra=v&15,n.mode=Oa;case Oa:if(n.extra){for(D=n.extra;u<D;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=Q;break}n.mode=ka;case ka:if(c===0)break inf_leave;if(p=f-c,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=Q;break}p>n.wnext?(p-=n.wnext,m=n.wsize-p):m=n.wnext-p,p>n.length&&(p=n.length),h=n.window}else h=i,m=o-n.offset,p=n.length;p>c&&(p=c),c-=p,n.length-=p;do i[o++]=h[m++];while(--p);n.length===0&&(n.mode=Ta);break;case Aa:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=Ta;break;case ja:if(n.wrap){for(;u<32;){if(s===0)break inf_leave;s--,l|=r[a++]<<u,u+=8}if(f-=c,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?V(n.check,i,f,o-f):ti(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:Ra(l))!==n.check){e.msg=`incorrect data check`,n.mode=Q;break}l=0,u=0}n.mode=Ma;case Ma:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg=`incorrect length check`,n.mode=Q;break}l=0,u=0}n.mode=Na;case Na:w=1;break inf_leave;case Q:w=-3;break inf_leave;case Pa:return-4;case Fa:default:return-2}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||f!==e.avail_out&&n.mode<Q&&(n.mode<ja||t!==4))&&Ya(e,e.output,e.next_out,f-e.avail_out)?(n.mode=Pa,-4):(d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?V(n.check,i,f,e.next_out-f):ti(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Z?128:0)+(n.mode===wa||n.mode===ya?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},Za=e=>{if(Ba(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},Qa=(e,t)=>{let n=t.length,r,i,a;return Ba(e)||(r=e.state,r.wrap!==0&&r.mode!==ga)?-2:r.mode===ga&&(i=1,i=ti(i,t,n,0),i!==r.check)?-3:(a=Ya(e,t,n,n),a?(r.mode=Pa,-4):(r.havedict=1,0))},$a=class{constructor(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},eo=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},to=Object.prototype.toString,no={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:new Uint8Array},ro=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},no,e);let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new $a,this.strm.avail_out=0;let n=zi(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(H[n]);to.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(r.length){if(t.gzip)throw Error(`dictionary is not supported with gzip`);if(n=Hi(this.strm,r),n!==0)throw Error(H[n])}}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(a=typeof t==`number`?t:t===!0?4:0,n.input=typeof e==`string`?new TextEncoder().encode(e):to.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===2||a===3)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Bi(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Vi(this.strm);break}if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||H[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=eo(this.chunks)),this.chunks=[]}};function io(e,t={}){let n=new ro(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function ao(e,t={}){return io(e,Object.assign({},t,{raw:!0}))}function oo(e,t={}){return io(e,Object.assign({},t,{gzip:!0}))}var so=Object.prototype.toString,co={chunkSize:65536,windowBits:15,raw:!1,dictionary:new Uint8Array},lo=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},co,e);let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!e.windowBits&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.started=!1,this.chunks=[],this.result=new Uint8Array,this.strm=new $a,this.strm.avail_out=0;let n=Wa(this.strm,t.windowBits);if(n!==0)throw Error(H[n]);so.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=Qa(this.strm,r),n!==0))throw Error(H[n])}push(e,t=!1){let n=this.strm,r=this.options.chunkSize,i,a,o;if(this.ended)return this.err===0;for(a=typeof t==`number`?t:t===!0?4:0,n.input=so.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,n.next_in=0,n.avail_in=n.input.length,this.started||(this.started=!0,this.onStart(n));;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=Xa(n,a),i===2){let e=this.options.dictionary;e.length&&(i=Qa(n,e),i===0?i=Xa(n,a):i===-3&&(i=2))}for(;n.avail_in>0&&i===1&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)Ha(n),i=Xa(n,a);if(i===-2||i===-3||i===2||i===-4)break;if(o=n.avail_out,n.next_out&&(n.avail_out===0||i===1||a>0)&&(this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0),i!==0&&i!==-5||o!==0){if(i===1){i=Za(this.strm);break}if(n.avail_in===0){if(a===4){i=Za(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||H[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=eo(this.chunks)),this.chunks=[]}};function uo(e,t={}){let n=new lo(t);if(n.push(e,!0),n.err)throw Error(n.msg);let r=n.result;return t.toText?new TextDecoder().decode(r):r}function fo(e,t={}){return uo(e,{...t,raw:!0})}function po(e){return typeof e==`string`?new Uint8Array(Ze(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function mo(e){let t={};return e&&(typeof e.level==`number`&&(t.level=e.level),typeof e.windowBits==`number`&&(t.windowBits=e.windowBits),typeof e.memLevel==`number`&&(t.memLevel=e.memLevel),typeof e.strategy==`number`&&(t.strategy=e.strategy)),t}function ho(e,t,n){return Ze(e(po(t),mo(n)))}function go(e,t,n,r){let i=typeof n==`function`?n:r,a=typeof n==`function`?void 0:n;if(typeof i!=`function`)throw TypeError(`zlib: callback is required`);let o;try{o=ho(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const _o={gzipSync:(e,t)=>ho(oo,e,t),gunzipSync:(e,t)=>ho(uo,e,t),deflateSync:(e,t)=>ho(io,e,t),inflateSync:(e,t)=>ho(uo,e,t),deflateRawSync:(e,t)=>ho(ao,e,t),inflateRawSync:(e,t)=>ho(fo,e,t),gzip:(e,t,n)=>go(oo,e,t,n),gunzip:(e,t,n)=>go(uo,e,t,n),deflate:(e,t,n)=>go(io,e,t,n),inflate:(e,t,n)=>go(uo,e,t,n),deflateRaw:(e,t,n)=>go(ao,e,t,n),inflateRaw:(e,t,n)=>go(fo,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function vo(e){let t=[],n={},r=[],i=(e,t)=>{if(e in n){let r=n[e];Array.isArray(r)?r.push(String(t)):n[e]=[String(r),String(t)]}else n[e]=t},a=2;for(;a<e.length;){let n=e[a];if(n===`--`){r.push(...e.slice(a+1));break}if(n.startsWith(`--`)){let t=n.slice(2),r=t.indexOf(`=`);if(r!==-1){i(t.slice(0,r),t.slice(r+1)),a++;continue}let o=e[a+1];if(o!==void 0&&!o.startsWith(`-`)){i(t,o),a+=2;continue}i(t,!0),a++;continue}if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++;continue}t.push(n),a++}return{positional:t,flags:n,subcommand:t.length>0&&/^[a-z][\w-]*$/i.test(t[0])?t[0]:null,passthrough:r}}function yo(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>vo(t),enumerable:!1,writable:!1,configurable:!1}),t}const bo=async(e,t,n)=>{let r=Math.max(1,Math.trunc(e)||1),i=Array(t.length),a=0,o=[],s=async()=>{for(;;){let e=a++;if(e>=t.length)return;i[e]=await n(t[e],e)}};for(let e=0;e<Math.min(r,t.length);e++)o.push(s());return await Promise.all(o),i},xo={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function So(e){if(typeof e==`number`&&Number.isFinite(e))return Math.trunc(e);if(typeof e!=`string`)throw TypeError(`time.parseDuration: spec must be string or number`);let t=e.trim(),n=/^([0-9]+(?:\.[0-9]+)?)\s*(ms|s|m|h|d|w|M|y)?$/.exec(t);if(!n)throw RangeError(`time.parseDuration: unrecognized spec "${e}"`);let r=Number(n[1]),i=n[2]??`ms`;return Math.trunc(r*xo[i])}function Co(e){return e<10?`0${e}`:String(e)}const wo={parseDuration:So,ago(e,t=new Date){return new Date(t.getTime()-So(e))},range(e,t=new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-So(e)),end:n}},future(e,t=new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+So(e))}},gmailDate(e,t=new Date){let n=new Date(t.getTime()-So(e));return`${n.getFullYear()}/${Co(n.getMonth()+1)}/${Co(n.getDate())}`}};function To(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Eo=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Do(e){let t=Number(e);return Number.isFinite(t)?t:0}function Oo(e){return typeof e==`string`?`type string ('${e}')`:typeof e==`boolean`?`type boolean (${e})`:typeof e==`bigint`?`type bigint (${e}n)`:Array.isArray(e)?`an instance of Array`:typeof e==`object`&&e?`an instance of Object`:`type ${typeof e}`}function ko(e){let t=TypeError(`The "code" argument must be of type number. Received ${Oo(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function Ao(e){let t=RangeError(`The value of "code" is out of range. It must be an integer. Received ${String(e)}`);return t.code=`ERR_OUT_OF_RANGE`,t}function jo(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw ko(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw Ao(e)}throw ko(e)}}function Mo(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function No(e){return`${e.map(Mo).join(` `)}\n`}function Po(e){return e===void 0?`default`:String(e)}function Fo(){return typeof performance<`u`?performance.now():Date.now()}function Io(e){return`${e.toFixed(3)}ms`}function Lo(e,t,n){let r=No(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function Ro(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${Mo(r)}`,...i)}function zo(e,t,n,r){e(r.length>0?`Trace: ${r.map(Mo).join(` `)}`:`Trace:`);let i=Error().stack;if(!i)return;let a=i.split(`
|
|
28
|
+
`).slice(3).join(`
|
|
29
|
+
`);if(!a)return;let o=a.endsWith(`
|
|
30
|
+
`)?a:`${a}\n`;t(n>0?`${` `.repeat(n)}${o}`:o)}function Bo(e,t,n){let r=Po(n);if(e.has(r)){t(`Label '${r}' already exists for console.time()`);return}e.set(r,Fo())}function Vo(e,t,n,r){let i=Po(r),a=e.get(i);if(a===void 0){t(`No such label '${i}' for console.timeEnd()`);return}e.delete(i),n(`${i}: ${Io(Fo()-a)}`)}function Ho(e,t,n,r,i){let a=Po(r),o=e.get(a);if(o===void 0){t(`No such label '${a}' for console.timeLog()`);return}let s=`${a}: ${Io(Fo()-o)}`;i.length===0?n(s):n(s,...i)}function Uo(e,t,n){let r=Po(n),i=(e.get(r)??0)+1;e.set(r,i),t(`${r}: ${i}`)}function Wo(e,t,n){let r=Po(n);if(!e.has(r)){t(`Count for '${r}' does not exist`);return}e.set(r,0)}function Go(e,t,n){n.length>0&&t(...n),e.depth+=1}function Ko(e){e.depth>0&&--e.depth}function qo(e,t){let n=new Map,r=new Map,i={depth:0},a=(...t)=>Lo(e,i.depth,t),o=(...e)=>Lo(t,i.depth,e),s=(...e)=>Go(i,a,e);return{log:a,info:a,debug:a,dirxml:a,table:a,warn:o,error:o,dir:(e,t)=>a(e),clear:()=>void 0,group:s,groupCollapsed:s,groupEnd:()=>Ko(i),assert:(e,...t)=>Ro(o,e,t),trace:(...e)=>zo(o,t,i.depth,e),time:e=>Bo(r,o,e),timeEnd:e=>Vo(r,o,a,e),timeLog:(e,...t)=>Ho(r,o,a,e,t),count:e=>Uo(n,a,e),countReset:e=>Wo(n,o,e)}}function Jo(e,t){return e.process===void 0?(e.process=t,()=>{e.process===t&&delete e.process}):()=>void 0}function Yo(e,t){return Object.assign(new De,{write:t=>(e(t),!0),end:()=>void 0,isTTY:t})}function Xo(e,t,n){let r=!!e.env?.NO_COLOR,i=!1,a,o,c=e=>{i=!0,o=e,a=e},l=Qo(e.stdin??``,c),u=yo(e.argv),d=Yo(t,!r),f=Yo(n,!r);return{processShim:{argv:u,env:e.env,versions:{node:s},version:`v${s}`,platform:`linux`,arch:`x64`,cwd:()=>e.cwd,get exitCode(){return a},set exitCode(e){a=jo(e)},exit:(...e)=>{if(e.length===0){let e=Do(a);throw c(e),new Eo(e)}a=jo(e[0]);let t=Do(a);throw c(t),new Eo(t)},stdin:l,stdout:d,stderr:f},getDidCallProcessExit:()=>i,getExitCode:()=>Do(i?o:a),recordExit:c}}var Zo=class extends nt.Stream{isTTY=!1;consumed=!1;flowScheduled=!1;paused=!1;buffer;onExit;constructor(e,t){super(),this.buffer=e,this.onExit=t}read(){return this.consumed?null:(this.consumed=!0,this.buffer.length>0?this.buffer:null)}toString(){return this.buffer}setEncoding(e){return this}pause(){return this.paused=!0,this}resume(){return this.paused=!1,this.scheduleFlow(),this}on(e,t){return super.on(e,t),e===`data`&&this.scheduleFlow(),this}addListener(e,t){return this.on(e,t)}once(e,t){return super.once(e,t),e===`data`&&this.scheduleFlow(),this}scheduleFlow(){this.flowScheduled||(this.flowScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){if(this.paused){this.flowScheduled=!1;return}try{this.consumed||(this.consumed=!0,this.buffer.length>0&&this.emit(`data`,this.buffer)),this.readable=!1,this.emit(`end`),this.emit(`close`)}catch(e){if(e instanceof Eo){this.onExit(e.code);return}throw e}}[Symbol.asyncIterator](){return{next:async()=>this.consumed?{value:void 0,done:!0}:(this.consumed=!0,{value:this.buffer,done:!1})}}};function Qo(e,t){return new Zo(e,t)}function $o(e){if(e===``)return[];let t=e.split(`
|
|
31
|
+
`);return t[t.length-1]===``&&t.pop(),t.map(e=>e.endsWith(`\r`)?e.slice(0,-1):e)}function es(e){if(typeof e==`string`)return e;if(e&&typeof e.read==`function`){let t=e.read();return typeof t==`string`?t:``}return``}function ts(e){return new TextDecoder(`utf-8`).decode(ie(e))}function ns(e){if(e&&typeof e.write==`function`)return e}var rs=class extends De{terminal=!1;lines;cursor=0;closed=!1;flushScheduled=!1;output;onExit;constructor(e,t,n){super(),this.lines=$o(ts(es(e))),this.output=t??n.output,this.onExit=n.onExit}on(e,t){return super.on(e,t),e===`line`&&this.scheduleFlush(),this}once(e,t){return super.once(e,t),e===`line`&&this.scheduleFlush(),this}pause(){return this}resume(){return this}close(){this.closed||(this.closed=!0,this.emit(`close`))}question(e,t,n){let r=typeof t==`function`?t:typeof n==`function`?n:void 0;this.output?.write(String(e));let i=this.cursor<this.lines.length?this.lines[this.cursor++]:``;if(r){queueMicrotask(()=>this.runHandler(()=>r(i)));return}return Promise.resolve(i)}[Symbol.asyncIterator](){return{next:async()=>!this.closed&&this.cursor<this.lines.length?{value:this.lines[this.cursor++],done:!1}:(this.close(),{value:void 0,done:!0})}}scheduleFlush(){this.flushScheduled||this.closed||(this.flushScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.flushScheduled=!1,this.runHandler(()=>{for(;!this.closed&&this.cursor<this.lines.length;)this.emit(`line`,this.lines[this.cursor++]);this.close()})}runHandler(e){try{e()}catch(e){if(e instanceof Eo&&this.onExit){this.closed=!0,this.onExit(e.code);return}throw e}}};function is(e){let t=(t,n)=>{let r,i;if(t&&typeof t==`object`&&`input`in t){let e=t;r=e.input,i=ns(e.output)}else r=t,i=ns(n);if(r==null)throw TypeError(`readline.createInterface: an 'input' stream is required`);return new rs(r,i,e)},n=(...e)=>{let t=e[e.length-1];return typeof t==`function`&&queueMicrotask(()=>t()),!0},r={createInterface:t,Interface:rs,emitKeypressEvents:()=>void 0,cursorTo:n,moveCursor:n,clearLine:n,clearScreenDown:n};return{...r,promises:r}}var as=class extends Error{status;statusText;url;body;constructor(e,t,n,r){let i=typeof r==`string`&&r?`: ${r.slice(0,200)}`:r&&typeof r==`object`?`: ${os(r).slice(0,200)}`:``;super(`HTTP ${e} ${t} ${n}${i}`),this.status=e,this.statusText=t,this.url=n,this.body=r,this.name=`HttpError`}};function os(e){try{return JSON.stringify(e)}catch{return String(e)}}function ss(e){return new Promise(t=>setTimeout(t,e))}function cs(e,t){let n=[];for(let[e,r]of Object.entries(t))if(r!=null){if(Array.isArray(r))for(let t of r)t!=null&&n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`);else n.push(`${encodeURIComponent(e)}=${encodeURIComponent(String(r))}`)}return n.length===0?e:e+(e.includes(`?`)?`&`:`?`)+n.join(`&`)}function ls(e,t,n){let r;return r=/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:e?`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`:t,n?cs(r,n):r}function us(e,t){let n={};if(e)for(let[t,r]of Object.entries(e))n[t]=r;if(t)for(let[e,r]of Object.entries(t))n[e]=r;return n}function ds(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`application/json`)||/[+/]json(;|$|\s)/.test(t)}function fs(e){if(!e)return null;let t=e.trim();if(!t)return null;if(/^\d+(\.\d+)?$/.test(t)){let e=Number(t);if(Number.isFinite(e)&&e>=0)return Math.round(e*1e3)}let n=Date.parse(t);if(Number.isFinite(n)){let e=n-Date.now();return e>0?e:0}return null}async function ps(e){if(ds(e.headers.get(`content-type`))){let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return t}}return e.text()}function ms(e,t){if(e!=null)return typeof e==`string`||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof Blob<`u`&&e instanceof Blob||typeof FormData<`u`&&e instanceof FormData||typeof URLSearchParams<`u`&&e instanceof URLSearchParams||typeof ReadableStream<`u`&&e instanceof ReadableStream?e:typeof e==`object`?(Object.keys(t).some(e=>e.toLowerCase()===`content-type`)||(t[`Content-Type`]=`application/json`),JSON.stringify(e)):String(e)}function hs(e,t){return Object.keys(e).some(e=>e.toLowerCase()===t.toLowerCase())}async function gs(e,t,n){let r=await t(n);r&&!hs(e,`authorization`)&&(e.Authorization=`Bearer ${r}`)}function _s(e,t){if(!t)return{signal:e,clearTimeout:null};let n=new AbortController,r=setTimeout(()=>n.abort(Error(`timeout`)),t),i=()=>clearTimeout(r);return e?{signal:AbortSignal.any([e,n.signal]),clearTimeout:i}:{signal:n.signal,clearTimeout:i}}function vs(e,t){return{body:t,headers:Object.fromEntries(e.headers.entries()),status:e.status}}async function ys(e,t){let n=await ps(e);return t?vs(e,n):n}async function bs(e,t){let n=await ps(e).catch(()=>null);throw new as(e.status,e.statusText,t,n)}function xs(e,t){let n=fs(e.headers.get(`retry-after`));return n===null?500*2**t:n}async function Ss(e,t,n,r){let i=null;for(let a=0;a<e.maxAttempts;a++){let{signal:o,clearTimeout:s}=_s(r.signal,e.timeoutMs),c=o?{...n,signal:o}:n,l;try{l=await e.fetch(t,c)}finally{s?.()}if(i=l,l.ok)return ys(l,r.raw);if(!(a+1<e.maxAttempts&&e.retryOn.has(l.status)))return bs(l,t);await e.sleep(xs(l,a))}if(i)return bs(i,t);throw Error(`http: no attempts made for ${n.method??`GET`} ${t}`)}function Cs(e){let t=e.sleep??ss;function n(n){let r=new Set(n.retry?.on??[]),i=Math.max(1,Math.trunc(n.retry?.maxAttempts??1));async function a(a,o,s={}){let c=ls(n.baseUrl,o,s.params),l=us(n.headers,s.headers);n.token&&await gs(l,n.token,{method:a,path:o,url:c});let u=ms(s.body,l),d={method:a,headers:l};return u!==void 0&&(d.body=u),Ss({fetch:e.fetch,sleep:t,maxAttempts:i,retryOn:r,timeoutMs:n.timeoutMs},c,d,s)}return Object.freeze({get:((e,t)=>a(`GET`,e,t)),post:((e,t)=>a(`POST`,e,t)),put:((e,t)=>a(`PUT`,e,t)),patch:((e,t)=>a(`PATCH`,e,t)),delete:((e,t)=>a(`DELETE`,e,t))})}return Object.freeze({client:n})}function ws(e){let t=new TextEncoder().encode(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function Ts(e,t,n){let r=[];t.model&&r.push(`--model`,String(t.model)),t.thinking&&r.push(`--thinking`,String(t.thinking)),t.schema&&r.push(`--schema-b64`,ws(JSON.stringify(t.schema))),t.readOnly!==void 0&&r.push(`--read-only`,Array.isArray(t.readOnly)?t.readOnly.join(`,`):String(t.readOnly));let i=t.cwd===void 0?n||`.`:String(t.cwd),a=t.allowedCommands===void 0?`*`:String(t.allowedCommands);return[`agent`,...r,i,a,String(e)]}function Es(e,t){let n=t.cwd,r=async(t,r)=>{let i=r??{},a=await e.spawn(Ts(t,i,n)),o=typeof a.exitCode==`number`?a.exitCode:0;return{finalText:String(a.stdout??``).replace(/\n+$/,``),exitCode:o,stderr:String(a.stderr??``).replace(/\n+$/,``)}},i=(async(e,t)=>{let n=t??{},i=await r(e,n);if(i.exitCode!==0)throw Error(`agent: exited with code ${i.exitCode}${i.stderr?`: ${i.stderr}`:``}`);if(n.schema)try{return JSON.parse(i.finalText)}catch{throw Error(`agent: schema response was not valid JSON (exit ${i.exitCode}): ${i.finalText.slice(0,200)}`)}return i.finalText});return i.spawn=r,i}function $(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`&&typeof e.targetId==`string`)return e.targetId;throw TypeError(`browser: expected a tab handle or targetId string`)}function Ds(e){function t(t){return{...t,async update(n){let r={};return n.urlMatch!==void 0&&(r.urlMatch=n.urlMatch===null?null:n.urlMatch instanceof RegExp?n.urlMatch.source:n.urlMatch),n.filter!==void 0&&(r.filter=n.filter),e.call(`browser`,`wsUpdate`,[t.id,r])},async close(){return e.call(`browser`,`wsClose`,[t.id])}}}return{on(n,r={}){let i=$(n),a=r.urlMatch===void 0?void 0:r.urlMatch instanceof RegExp?r.urlMatch.source:r.urlMatch,o,s={filter(e){if(typeof e==`function`||typeof e==`string`)throw TypeError(`browser.websocket: filter must be a declarative JSON object, not a function or string`);return o=e,s},async forward(n){return t(await e.call(`browser`,`wsObserve`,[{targetId:i,urlMatch:a,filter:o,forward:n}]))}};return s},async list(){return e.call(`browser`,`wsList`,[])}}}async function Os(e,t){if(!e&&!(t instanceof Request))return;let n=t instanceof Request?t:null,r=(e?.method??n?.method??`GET`).toUpperCase(),i={};if(e?.headers){if(e.headers instanceof Headers)e.headers.forEach((e,t)=>{i[t]=e});else if(Array.isArray(e.headers))for(let[t,n]of e.headers)i[t]=n;else Object.assign(i,e.headers)}else n&&n.headers.forEach((e,t)=>{i[t]=e});let a,o;if(r!==`GET`&&r!==`HEAD`&&e?.body!==void 0&&e?.body!==null&&e?.body!==``){let t=await ks(e.body);a=t.body,o=t.defaultContentType}return o&&!Object.keys(i).some(e=>e.toLowerCase()===`content-type`)&&(i[`Content-Type`]=o),{method:r,headers:i,body:a}}async function ks(e){if(typeof e==`string`)return{body:e};if(e instanceof URLSearchParams)return{body:e.toString(),defaultContentType:`application/x-www-form-urlencoded;charset=UTF-8`};if(e instanceof Blob)return{body:new Uint8Array(await e.arrayBuffer()),defaultContentType:e.type||`application/octet-stream`};if(e instanceof ArrayBuffer)return{body:new Uint8Array(e).slice(),defaultContentType:`application/octet-stream`};if(ArrayBuffer.isView(e))return{body:new Uint8Array(e.buffer,e.byteOffset,e.byteLength).slice(),defaultContentType:`application/octet-stream`};if(n(e)){let t=await r(e);return{body:t.bytes,defaultContentType:t.contentType}}throw typeof ReadableStream<`u`&&e instanceof ReadableStream?Error(`node fetch shim: ReadableStream request bodies are not supported (collect into a Uint8Array or string before calling fetch)`):Error(`node fetch shim: unsupported request body type (${Object.prototype.toString.call(e)}); use a string, Uint8Array, ArrayBuffer, Blob, FormData, or URLSearchParams`)}function As(e){return{findTab:t=>e.call(`browser`,`findTab`,[Ms(t)]),ensureTab:(t,n={})=>e.call(`browser`,`ensureTab`,[t,Ns(n)]),openWindow:(t,n={})=>e.call(`browser`,`openWindow`,[t,n]),windowBounds:t=>e.call(`browser`,`windowBounds`,[$(t)]),setWindowBounds:(t,n)=>e.call(`browser`,`setWindowBounds`,[$(t),n]),eval:(t,n)=>e.call(`browser`,`eval`,[$(t),js(n,!1)]),evalAsync:(t,n)=>e.call(`browser`,`evalAsync`,[$(t),js(n,!0)]),cookie:(t,n)=>e.call(`browser`,`cookie`,[$(t),n]),localStorage:(t,n)=>e.call(`browser`,`localStorage`,[$(t),n]),fetch:(t,n,r={})=>b(n,r).then(n=>e.call(`browser`,`evalAsync`,[$(t),n])),websocket:Ds(e)}}function js(e,t){if(typeof e==`function`)return`(${e.toString()})()`;if(typeof e==`string`)return e;throw TypeError(`browser.eval/evalAsync: source must be a function or string`)}function Ms(e){let t={};return e.domain!==void 0&&(t.domain=e.domain),e.urlMatch!==void 0&&(t.urlMatch=e.urlMatch instanceof RegExp?e.urlMatch.source:e.urlMatch),t}function Ns(e){return e.matchUrl===void 0?{}:{matchUrl:e.matchUrl instanceof RegExp?e.matchUrl.source:e.matchUrl}}function Ps(e){return{register(t){let n=null,r=e.onEvent(`computer-call`,r=>{let i=r;i.id===t.id&&Is(e,t,i,{getStop:()=>n,setStop:e=>{n=e}})}),i=Fs(t);return e.call(`computer`,`register`,[i]).catch(()=>{}),()=>{n?.(),n=null,r(),e.call(`computer`,`unregister`,[t.id]).catch(()=>{})}}}}function Fs(e){return{id:e.id,kind:`jsh`,title:e.title??e.id,size:e.size??null,state:`live`,capabilities:e.capabilities,pid:null,...e.softKeys?{softKeys:e.softKeys}:{}}}async function Is(e,t,n,r){let i;try{i=await Ls(e,t,n,r)}catch(e){i={error:e instanceof Error?e.message:String(e)}}try{await e.call(`computer`,`reply`,[n.requestId,i])}catch{}}async function Ls(e,t,n,r){switch(n.op){case`screenshot`:return t.screenshot(n.args[0]??{format:`jpeg`});case`text`:return t.text?t.text():null;case`input`:return await t.input(n.args[0]??[]),{ok:!0};case`exec`:if(!t.exec)throw Error(`exec is not supported`);return t.exec(String(n.args[0]??``));case`subscribe`:return Rs(e,t,Number(n.args[0])||2,Number(n.args[1])||void 0,r);case`unsubscribe`:return r.getStop()?.(),r.setStop(null),{ok:!0};default:{let e=n.op;throw Error(`unknown computer op '${String(e)}'`)}}}function Rs(e,t,n,r,i){if(i.getStop()?.(),!t.subscribe)throw Error(`subscribe is not supported`);let a=t.subscribe(n,n=>{e.call(`computer`,`frame`,[t.id,n]).catch(()=>{})},r);return i.setStop(()=>{try{a()}catch{}}),{ok:!0}}function zs(e){return e===`SIGKILL`?137:e===`SIGINT`?130:143}function Bs(e,t,n,r){let i=async()=>{if(!t?.wasUsed())return;let n=t.getMutations();if(n.created.length||n.modified.length||n.deleted.length)try{await e.call(`vfs`,`flushWrites`,[n])}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[realm-exec] pre-exec sync-fs flush failed (will retry at exit): ${t}`);return}t.resetBaseline()},a=async(i=!1)=>{if(t?.wasUsed())try{let r=await e.call(`vfs`,`snapshot`,[n]);i?t.applySnapshotPreservingMutations(r):t.applySnapshot(r)}catch(e){let t=e instanceof Error?e.message:String(e);r?.(`[sync-fs] re-snapshot after exec failed: ${t}\n`)}},o=async t=>{await i();try{return await e.call(`exec`,`run`,[t])}finally{await a()}},s=async t=>{await i();try{return await e.call(`exec`,`spawn`,[t])}finally{await a()}},c=1,l=Object.assign(o,{spawn:s,start:(t,n)=>{let r=c++,o=[],s=!1,l=!1,u=!1,d,f,p=new Promise((e,t)=>{d=e,f=t}),m=()=>{if(s||u||l)return;l=!0;let c=o.length>0?o.join(``):n?.stdin,p={};c!==void 0&&(p.stdin=c),n?.stdinKind!==void 0&&(p.stdinKind=n.stdinKind),n?.args!==void 0&&(p.args=n.args),n?.cwd!==void 0&&(p.cwd=n.cwd),n?.env!==void 0&&(p.env=n.env),(async()=>{try{if(await i(),u){await a(!0);return}s=!0;let n=await e.call(`exec`,`start`,[r,t,p]);await a(!0),d(n)}catch(e){await a(!0),f(e)}})()};return{kill:t=>s?e.call(`exec`,`kill`,[r,t]):(u=!0,d({stdout:``,stderr:``,exitCode:zs(t)}),Promise.resolve(!0)),stdin:{write:e=>{!s&&!u&&o.push(e)},end:()=>m()},done:p}}});return l.exec=l,l}const Vs=new Set([204,205,304]),Hs=new Set([`content-encoding`,`transfer-encoding`,`content-length`]);function Us(e,t){let n=Ws(e.body),r=Gs(e.headers),i=Vs.has(e.status)||n.byteLength===0,a=new Response(i?null:n,{status:e.status,statusText:e.statusText,headers:r});try{Object.defineProperty(a,"url",{value:e.url||t,writable:!1,configurable:!0,enumerable:!1})}catch{}return qs(a,n),a}function Ws(e){return e.byteLength===0?new Uint8Array:e.slice()}function Gs(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!Hs.has(n.toLowerCase()))try{t.set(n,r)}catch{}return t}const Ks=Symbol(`slicc.realmBufferedBody`);function qs(e,t){if(Ks in e)return;Object.defineProperty(e,Ks,{value:!0,configurable:!0});let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`bodyUsed`),r=!1,i=()=>{if(r)throw TypeError(`Failed to read response body: body already used`);return r=!0,Js(e),t},a=async()=>new TextDecoder().decode(i()),o=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);Object.defineProperties(e,{bodyUsed:{configurable:!0,enumerable:!1,get(){return r?!0:n?.get?!!n.get.call(e):!1}},text:{value:a,configurable:!0},json:{value:async()=>JSON.parse(await a()),configurable:!0},arrayBuffer:{value:async()=>o(i()),configurable:!0},blob:{value:async()=>new Blob([o(i())]),configurable:!0},bytes:{value:async()=>i(),configurable:!0}})}function Js(e){try{let t=e.body;t&&!t.locked&&t.getReader()}catch{}}function Ys(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`expected an ArrayBuffer or typed array`)}function Xs(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Zs(e){return e==null?[]:Array.isArray(e)?e:[e]}function Qs(e,t){let n=t.handle,r=new Set,i=new Set,a=!1,o=null,s=e=>{let t=e;if(!t||t.handle!==n)return;let i={reportId:t.reportId,data:Xs(t.bytes)};for(let e of[...r])try{e(i)}catch{}},c=()=>{a||(a=!0,o=e.onEvent?e.onEvent(`hid-input-report`,s):null,e.call(`hid`,`subscribeInputReports`,[n]).catch(()=>{a=!1,o?.(),o=null}))},l=()=>{!a||r.size>0||(a=!1,o?.(),o=null,e.call(`hid`,`unsubscribeInputReports`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`hid`,`open`,[n]),close:()=>e.call(`hid`,`close`,[n]),sendReport:(t,r)=>e.call(`hid`,`sendReport`,[n,t,Ys(r)]),sendFeatureReport:(t,r)=>e.call(`hid`,`sendFeatureReport`,[n,t,Ys(r)]),receiveFeatureReport:async t=>Xs((await e.call(`hid`,`receiveFeatureReport`,[n,t])).bytes),addEventListener(e,t){if(e===`inputreport`)r.add(t),c();else if(e===`disconnect`)i.add(t);else throw TypeError(`hid device: unknown event type '${String(e)}'`)},removeEventListener(e,t){e===`inputreport`?(r.delete(t),l()):e===`disconnect`&&i.delete(t)},onInputReport(e){r.add(e),c()}}}function $s(e){return{list:async()=>(await e.call(`hid`,`list`,[])).map(t=>Qs(e,t)),request:async t=>{let n=(await e.call(`hid`,`request`,[Zs(t)]))[0];if(!n)throw Error(`No device selected.`);return Qs(e,n)}}}function ec(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var tc=class{rpc;targetId;selector;index;constructor(e,t,n,r){this.rpc=e,this.targetId=t,this.selector=n,this.index=r}evalOnElement(e){let t=`(() => { const els = document.querySelectorAll(${JSON.stringify(this.selector)}); const el = els[${this.index}]; ${e} })()`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t])}async textContent(){return this.evalOnElement(`return el ? el.textContent : null;`)}async getAttribute(e){return this.evalOnElement(`return el ? el.getAttribute(${JSON.stringify(e)}) : null;`)}async isVisible(){return this.evalOnElement(`if (!el) return false; const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || s.opacity === '0') return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0;`)}async boundingBox(){return this.evalOnElement(`if (!el) return null; const r = el.getBoundingClientRect(); return { x: r.x, y: r.y, width: r.width, height: r.height };`)}},nc=class{rpc;targetId;onClose;closed=!1;constructor(e,t,n){this.rpc=e,this.targetId=t,this.onClose=n}async goto(e,t){await this.rpc.call(`browser`,`navigateTab`,[this.targetId,e])}async waitForLoadState(e){await this.rpc.call(`browser`,`waitForLoadState`,[this.targetId,e??`load`])}async waitForTimeout(e){await new Promise(t=>setTimeout(t,e))}async evaluate(e,...t){let n=typeof e==`string`?e:`(${e.toString()}).apply(null, JSON.parse(${JSON.stringify(JSON.stringify(t))}))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,n])}async screenshot(e){let t={};e?.fullPage!==void 0&&(t.fullPage=e.fullPage);let n=ec(await this.rpc.call(`browser`,`screenshotTab`,[this.targetId,t]));return e?.path&&await this.rpc.call(`vfs`,`writeFileBinary`,[e.path,n]),n}async $(e){return await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`!!document.querySelector(${JSON.stringify(e)})`])?new tc(this.rpc,this.targetId,e,0):null}async $$(e){let t=await this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.querySelectorAll(${JSON.stringify(e)}).length`]),n=[];for(let r=0;r<t;r++)n.push(new tc(this.rpc,this.targetId,e,r));return n}async $$eval(e,t,...n){if(typeof t==`string`)return this.rpc.call(`browser`,`evalAsync`,[this.targetId,t]);let r=`(${t.toString()}).apply(null, [Array.from(document.querySelectorAll(${JSON.stringify(e)}))].concat(JSON.parse(${JSON.stringify(JSON.stringify(n))})))`;return this.rpc.call(`browser`,`evalAsync`,[this.targetId,r])}async content(){return this.rpc.call(`browser`,`evalAsync`,[this.targetId,`document.documentElement.outerHTML`])}async setViewportSize(e){await this.rpc.call(`browser`,`setViewport`,[this.targetId,e.width,e.height])}async close(){this.closed||(this.closed=!0,await this.rpc.call(`browser`,`closeTab`,[this.targetId]),this.onClose?.())}},rc=class{rpc;openPages=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new nc(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}pages(){return[...this.openPages]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close()}},ic=class{rpc;openPages=[];openContexts=[];constructor(e){this.rpc=e}async newPage(e){let t=await this.rpc.call(`browser`,`createTab`,[`about:blank`]);e?.viewport&&await this.rpc.call(`browser`,`setViewport`,[t,e.viewport.width,e.viewport.height]);let n=new nc(this.rpc,t,()=>{let e=this.openPages.indexOf(n);e!==-1&&this.openPages.splice(e,1)});return this.openPages.push(n),n}async newContext(e){let t=new rc(this.rpc);return this.openContexts.push(t),t}contexts(){return[...this.openContexts]}async close(){let e=this.openPages.splice(0,this.openPages.length);for(let t of e)await t.close();let t=this.openContexts.splice(0,this.openContexts.length);for(let e of t)await e.close()}};function ac(e){let t=async t=>new ic(e),n=async(t,n)=>new ic(e);return{chromium:{launch:t,connect:n,connectOverCDP:n},firefox:{launch:t,connect:n},webkit:{launch:t,connect:n}}}function oc(e){return{...e,time:wo,fmt:Be,pool:bo}}function sc(e,t){return e?.startsWith(`/`)?To(e):t}function cc(e){return e.includes(`require`)||e.includes(`import`)||/(?:^|[;\n}])\s*export\b/.test(e)}async function lc(e,t,n,r){return cc(t)?e.call(`module`,`buildGraph`,[t,sc(r,n),r]):{files:[],entryMap:{},edges:{},edgeErrors:{},errors:{}}}function uc(e){if(typeof e!=`object`||!e)return;let t=e;if(t.__esModule&&!Object.prototype.hasOwnProperty.call(t,`default`)&&Object.isExtensible(t))try{Object.defineProperty(t,"default",{value:t,enumerable:!1,configurable:!0})}catch{}}function dc(e){return{playwright:ac(e)}}function fc(e){let{graph:t,fsBridge:n,processShim:r,childProcess:i,nodeConsole:a,sliccyModules:o,shimmedPackages:s={},nodeReadline:l,nodeOsModule:d=jn,nodeUtilModule:p=At}=e,h=new Map(t.files.map(e=>[e.path,e.cjsSource])),g=new Map(t.files.map(e=>[e.path,e.kind])),_=new Map,v=En({requireFrom:(e,t)=>T(e,t),resolveFrom:(e,t)=>w(e,t)}),y=gn(()=>{let e=r?.cwd?.();return typeof e==`string`&&e.length>0?e:`/`}),b=e=>{if(typeof e==`string`&&e.startsWith(`sliccy:`))return{hit:!0,value:hc(e,o)};let t=e.startsWith(`node:`)?e.slice(5):e,a=pc(t,{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:d,nodeUtilModule:p,nodePathModule:y,nodeReadline:l,nodeModule:v});if(a.hit)return a;if(m.has(t))throw f(e,t);if(u.has(t))throw _c(e,t);return t in s?{hit:!0,value:s[t]}:{hit:!1}},x=(e,n,r)=>{let i=b(n);if(i.hit)return i.value;let a=e?.[n];if(a)return S(a);let o=r===null?t.errors[n]:t.edgeErrors?.[r]?.[n];throw o?Error(o):mc(n)};function S(e){let n=_.get(e);if(n)return n.exports;let i=h.get(e);if(i===void 0)throw Error(`Cannot find module '${e}'`);let o={exports:{}};_.set(e,o);let s=n=>x(t.edges[e],n,e),c=[`module`,`exports`,`require`,`process`,`console`,`Buffer`,`global`],l=[o,o.exports,s,r,a,globalThis.Buffer,globalThis];return g.get(e)!==`esm`&&(c.push(`__dirname`,`__filename`),l.push(To(e),e)),Function(...c,i)(...l),g.get(e)===`cjs`&&uc(o.exports),o.exports}function C(e){return h.has(e)}function w(e,n){if(c(n))return n;let r=t.edges[e]?.[n];if(r)return r;let i=To(e);if(Tn(n)){let e=Cn(i,n,C);if(e)return e}else{let e=wn(i,n,C);if(e)return e}let a=t.edgeErrors?.[e]?.[n];throw a?Error(a):mc(n)}function T(e,t){let n=b(t);return n.hit?n.value:S(w(e,t))}return{require:e=>x(t.entryMap,e,null)}}function pc(e,t){let{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:a,nodeUtilModule:o,nodePathModule:s,nodeReadline:c,nodeModule:l}=t;return e===`fs`||e===`fs/promises`?{hit:!0,value:n}:e===`path`?{hit:!0,value:s}:e===`crypto`?{hit:!0,value:rn}:e===`child_process`?{hit:!0,value:i}:e===`process`?{hit:!0,value:r}:e===`buffer`?{hit:!0,value:{Buffer:globalThis.Buffer}}:e===`assert`?{hit:!0,value:Xe}:e===`assert/strict`?{hit:!0,value:Ye}:e===`util`?{hit:!0,value:o}:e===`events`?{hit:!0,value:Oe}:e===`os`?{hit:!0,value:a}:e===`tty`?{hit:!0,value:Mn}:e===`stream`?{hit:!0,value:nt}:e===`url`?{hit:!0,value:C}:e===`zlib`?{hit:!0,value:_o}:e===`vm`?{hit:!0,value:Qn}:e===`readline`&&c?{hit:!0,value:c}:e===`readline/promises`&&c?{hit:!0,value:c.promises}:e===`module`&&l?{hit:!0,value:l}:{hit:!1}}function mc(e){if(e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`node:`))return Error(`Cannot find module '${e}'`);let t=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0];return Error(`Cannot find module '${e}' (run: ipk install ${t})`)}function hc(e,t){let n=e.slice(7);if(n===``)throw Error(`require('sliccy:'): empty sliccy: module name`);if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`require('${e}'): unknown sliccy: module '${n}'. Known names: ${Object.keys(t).sort().join(`, `)}`);return t[n]}const gc={http:` Use fetch() instead.`,https:` Use fetch() instead.`,crypto:` Use globalThis.crypto (Web Crypto API) instead.`};function _c(e,t){return Error(`require('${e}'): Node built-in '${t}' is not available in the browser environment.${gc[t]||``}`)}async function vc(e,t,n,r){let i=Object.keys(t),a=i.map(e=>t[e]),o=Object.getPrototypeOf(async function(){}).constructor,s=new o(...i,`${r?`"use strict";
|
|
32
|
+
`:``}${e}`);try{return await s(...a),0}catch(e){return e instanceof Eo?e.code:(n(`${e instanceof Error?e.stack??e.message:String(e)}\n`),1)}}function yc(e,t){let n=t.handle;return{...t,open:t=>e.call(`serial`,`open`,[n,t]),close:()=>e.call(`serial`,`close`,[n]),read:(t={})=>e.call(`serial`,`read`,[n,{maxBytes:t.maxBytes??t.bytes,until:t.until?Ys(t.until):void 0,timeoutMs:t.timeoutMs}]),write:t=>e.call(`serial`,`write`,[n,Ys(t)]),getSignals:()=>e.call(`serial`,`getSignals`,[n]),setSignals:t=>e.call(`serial`,`setSignals`,[n,t])}}function bc(e){return{list:async()=>(await e.call(`serial`,`list`,[])).map(t=>yc(e,t)),request:async t=>yc(e,await e.call(`serial`,`request`,[Zs(t)]))}}function xc(e=globalThis,t){let n=e.setTimeout,r=e.clearTimeout,i=e.setInterval,a=e.clearInterval,o=n.bind(e),s=r.bind(e),c=i.bind(e),l=a.bind(e),u=new Set,d=new Set,f=new Set,p=!1,m=()=>{if(f.size===0)return;let e=[...f];f.clear();for(let t of e)t()},h=e=>{if(e==null)return!1;let t=u.delete(e),n=d.delete(e);return t||n},g=(e,n)=>{try{e(...n)}catch(e){if(t?.onCallbackError?.(e),!t?.onCallbackError)throw e}finally{m()}};return{get pendingCount(){return u.size+d.size},install(){p||(p=!0,e.setTimeout=((e,t,...n)=>{if(typeof e!=`function`)return o(e,t,...n);let r=o(()=>{u.delete(r),g(e,n)},t);return u.add(r),r}),e.clearTimeout=(e=>{let t=h(e);s(e),t&&m()}),e.setInterval=((e,t,...n)=>{if(typeof e!=`function`)return c(e,t,...n);let r=c(()=>{g(e,n)},t);return d.add(r),r}),e.clearInterval=(e=>{let t=h(e);l(e),t&&m()}))},restore(){p&&(p=!1,e.setTimeout=n,e.clearTimeout=r,e.setInterval=i,e.clearInterval=a)},clearPending(){for(let e of u)s(e);u.clear();for(let e of d)l(e);d.clear(),m()},tick(){return new Promise(e=>{o(e,0)})},waitForProgress(){return u.size+d.size===0?Promise.resolve():new Promise(e=>{f.add(e)})}}}function Sc(e,t){let n=t.handle,r=e=>({status:e.status,data:Xs(e.bytes)}),i=new Set,a=new Set,o=!1,s=null,c=e=>{let t=e;if(!t||t.handle!==n)return;let r=t.type===`disconnect`?i:a;for(let e of[...r])try{e(t)}catch{}},l=()=>{o||(o=!0,s=e.onEvent?e.onEvent(`usb-claim-event`,c):null,e.call(`usb`,`subscribeClaimEvents`,[n]).catch(()=>{o=!1,s?.(),s=null}))},u=()=>{!o||i.size>0||a.size>0||(o=!1,s?.(),s=null,e.call(`usb`,`unsubscribeClaimEvents`,[n]).catch(()=>{}))};return{...t,open:()=>e.call(`usb`,`open`,[n]),close:t=>e.call(`usb`,`close`,t?.force?[n,{force:!0}]:[n]),reset:t=>e.call(`usb`,`reset`,t?.force?[n,{force:!0}]:[n]),clearHalt:(t,r)=>e.call(`usb`,`clearHalt`,[n,t,r]),selectConfiguration:t=>e.call(`usb`,`selectConfig`,[n,t]),claimInterface:(t,r)=>e.call(`usb`,`claim`,r?.wait?[n,t,{wait:!0}]:[n,t]),releaseInterface:t=>e.call(`usb`,`release`,[n,t]),controlTransferIn:async(t,i)=>r(await e.call(`usb`,`controlIn`,[n,t,i])),controlTransferOut:(t,r)=>e.call(`usb`,`controlOut`,[n,t,Ys(r)]),transferIn:async(t,i)=>r(await e.call(`usb`,`transferIn`,[n,t,i])),transferOut:(t,r)=>e.call(`usb`,`transferOut`,[n,t,Ys(r)]),addEventListener(e,t){if(e===`disconnect`)i.add(t);else if(e===`claim-lost`)a.add(t);else throw TypeError(`usb device: unknown event type '${String(e)}'`);l()},removeEventListener(e,t){e===`disconnect`?i.delete(t):e===`claim-lost`&&a.delete(t),u()}}}function Cc(e){return{list:async()=>(await e.call(`usb`,`list`,[])).map(t=>Sc(e,t)),request:async t=>Sc(e,await e.call(`usb`,`request`,[Zs(t)]))}}function wc(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}function Tc(e){if(!e)return e;let t=e.startsWith(`/`),n=e.split(`/`).filter(e=>e.length>0),r=n.indexOf(`scripts`);if(r<0)return e;let i=n.slice(0,r);return i.length===0?t?`/`:``:(t?`/`:``)+i.join(`/`)}function Ec(e){return/^[A-Za-z0-9_\-./:@]+$/.test(e)?e:`'`+e.replace(/'/g,`'\\''`)+`'`}function Dc(e,t){return e===``?t:e===`/`?`/${t}`:`${e}/${t}`}function Oc(e){let t=wc(e.argv[1]??``),n=Tc(t),r=Dc(n,`references`),i=Dc(n,`assets`),a=Dc(t,`.config`);async function o(){let t;try{t=await e.fs.exists(a)}catch{return null}if(!t)return null;let n;try{n=await e.fs.readFile(a)}catch{return null}let r=typeof n==`string`?n:String(n);if(!r.trim())return null;let i;try{i=JSON.parse(r)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`skill.config(): failed to parse ${a}: ${t}`)}if(i&&typeof i==`object`&&!Array.isArray(i))return i;throw Error(`skill.config(): ${a} must contain a JSON object`)}async function s(t){let n=await o();if(t===void 0)return n;if(typeof t!=`object`||!t||Array.isArray(t))throw TypeError(`skill.config(updates): updates must be a plain object`);let r={...n??{},...t};return await e.fs.writeFile(a,JSON.stringify(r,null,2)+`
|
|
33
|
+
`),r}async function c(t){if(typeof t!=`string`||!t.trim())throw TypeError(`skill.token(providerId): providerId must be a non-empty string`);let n=`oauth-token ${Ec(t)}`,{stdout:r,stderr:i,exitCode:a}=await e.exec(n);if(a!==0){let e=i.trim()||`oauth-token exited with code ${a}`;throw Error(`skill.token('${t}'): ${e}`)}return r.replace(/\r?\n+$/,``)}return Object.freeze({dir:t,root:n,refs:r,assets:i,config:s,token:c})}const kc=65536;function Ac(e,t){if(!t)return e;let n=e+t;return n.length<=kc?n:n.slice(n.length-kc)}async function jc(e,t,n){let r;try{r=await e.call(`vfs`,`snapshot`,[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),r={entries:[]}}return new ne(r)}function Mc(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function Nc(e,t,n,r){globalThis.__slicc_mountVfs=async(i,a)=>{let{mountVfsIntoEmscripten:o}=await import(`./emscripten-vfs-hook-Dydz8mUS.js`);return o(i,{bridge:e,syncFs:t,cwd:n,warn:e=>r.writeStderr(`slicc: ${e}\n`)},a)}}function Pc(e,t,n,r,i){let a=_(e,t),o=y(e,a);if(Object.assign(r,Ee(n,e.cwd,o,i,{write:(e,n)=>{t.postMessage({type:`realm-fs-write`,path:e,bytes:n})},delete:e=>{t.postMessage({type:`realm-fs-delete`,path:e})}})),o&&Nc(o,n,e.cwd,i),e.syncFsToken)return g(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:v(a)}:{}})}function Fc(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function Ic(e,t,n){let r=Ae({isTTY:!e,noColor:e});return{colorApi:r,cliApi:ke({writeStdout:t,writeStderr:n,exit:e=>{throw new Eo(e)},color:r})}}function Lc(e,t,n){return{readStdinBytes:()=>ie(e.stdin??``),writeStdout:t,writeStderr:n}}function Rc(e){return{usbBridge:Cc(e),serialBridge:bc(e),hidBridge:$s(e),computerBridge:Ps(e)}}async function zc(e,t){let n=e.captureOutput!==!1,r={stdout:``,stderr:``},i=(e,i)=>{let a=typeof i==`string`?i:String(i);e===`stdout`?r.stdout=n?r.stdout+a:Ac(r.stdout,a):r.stderr=n?r.stderr+a:Ac(r.stderr,a),t.postMessage({type:`realm-output`,stream:e,chunk:a})},a=e=>{i(`stdout`,e)},o=e=>{i(`stderr`,e)},s=qo(a,o),c=Xo(e,a,o),{colorApi:l,cliApi:u}=Ic(!!e.env?.NO_COLOR,a,o),f=new d(t),p=Lc(e,a,o),m=ge(f,E,p),h=await jc(f,e.cwd,Mc(e,o)),g=Pc(e,t,h,m,p),_=Bs(f,h,e.cwd,o),v=Es(_,{cwd:e.cwd}),y=Oc({argv:e.argv,fs:m,exec:_}),b=As(f),{usbBridge:x,serialBridge:S,hidBridge:C,computerBridge:w}=Rc(f),T=Cs({fetch:E});async function E(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return Us(await f.call(`fetch`,`request`,[n,await Os(t,e)]),n)}let D=oc({exec:_,agent:v,skill:y,http:T,browser:b,usb:x,serial:S,hid:C,computer:w,cli:u,color:l}),O=e.filename,k=To(O),A=await lc(f,e.code,e.cwd,O),j=fc({graph:A,fsBridge:m,processShim:c.processShim,childProcess:Ht(_,g),nodeConsole:s,sliccyModules:D,shimmedPackages:dc(f),nodeReadline:is({output:{write:a},onExit:c.recordExit}),nodeOsModule:An(e.env),nodeUtilModule:kt(e=>o(`${e}\n`),()=>c.processShim.argv.slice(2))}).require,ee={exports:{},filename:e.filename},te=A.entrySource!==void 0;await Bc({entryCode:A.entrySource??e.code,isEsmEntry:te,entryIsModule:A.entryIsModule===!0,filename:O,dirname:k,proc:c,nodeConsole:s,requireShim:j,moduleShim:ee,realmFetch:E,writeStderr:o,rpc:f,syncFs:h,output:r,port:t})}async function Bc(e){let t=globalThis;Fc(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=xc(globalThis,{onCallbackError(e){if(!(e instanceof Eo))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-DtLxL_rB.js`),i=r(globalThis);n.install(),i.install();let a=Jo(globalThis,e.proc.processShim);try{let r=await Vc({entryCode:e.entryCode,bridges:{process:e.proc.processShim,console:e.nodeConsole,require:e.requireShim,module:e.moduleShim,exports:e.moduleShim.exports,fetch:e.realmFetch,...e.entryIsModule?{}:{__dirname:e.dirname,__filename:e.filename}},writeStderr:e.writeStderr,isEsmEntry:e.isEsmEntry,rpc:e.rpc,syncFs:e.syncFs,proc:e.proc,timers:n,bodyReads:i});delete t.__slicc_compileWasm,delete t.__slicc_mountVfs,e.rpc.dispose(),e.port.postMessage({type:`realm-done`,stdout:e.output.stdout,stderr:e.output.stderr,exitCode:r})}finally{n.clearPending(),n.restore(),i.restore(),a()}}async function Vc(e){let t=await vc(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await Hc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await Uc(e.rpc,e.timers,e.bodyReads,e.proc),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await Hc(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function Hc(e,t,n){let r=t.getMutations();if(r.created.length||r.modified.length||r.deleted.length)try{await e.call(`vfs`,`flushWrites`,[r]),t.resetBaseline()}catch(e){let t=e instanceof Error?e.message:String(e);n(`[sync-fs] ERROR: flush failed — ${r.created.length+r.modified.length} write(s) + ${r.deleted.length} delete(s) were NOT persisted: ${t}\n`)}}async function Uc(e,t,n,r){for(await t.tick();!r.getDidCallProcessExit()&&(e.pendingCount>0||t.pendingCount>0||n.pendingCount>0);){let i=[];if(e.pendingCount>0&&i.push(e.waitForProgress()),t.pendingCount>0&&i.push(t.waitForProgress()),n.pendingCount>0&&i.push(n.waitForProgress()),i.length===0)break;await Promise.race(i),r.getDidCallProcessExit()||await t.tick()}}function Wc(){let e=new Set,t=new Set;return{realmSide:{postMessage:e=>{queueMicrotask(()=>{for(let n of[...t])n({data:e})})},addEventListener:(t,n)=>{e.add(n)},removeEventListener:(t,n)=>{e.delete(n)}},hostSide:{postMessage:t=>{queueMicrotask(()=>{for(let n of[...e])n({data:t})})},addEventListener:(e,n)=>{t.add(n)},removeEventListener:(e,n)=>{t.delete(n)}}}}function Gc(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=Wc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&zc(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}function Kc(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=Wc(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`py`&&p(n,t).catch(e=>{let n={type:`realm-error`,message:e instanceof Error?e.message:String(e)};t.postMessage(n)})};return t.addEventListener(`message`,r),{controlPort:n,terminate(){t.removeEventListener(`message`,r)}}}}export{Gc as createInProcessJsRealmFactory,Kc as createInProcessPyRealmFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./api-endpoint-DuEQRZ4g.js";import{h as t}from"./main-
|
|
1
|
+
import{o as e}from"./api-endpoint-DuEQRZ4g.js";import{h as t}from"./main-BsG-jtvC.js";async function n(){try{let e=await navigator.serviceWorker?.getRegistrations?.();e&&await Promise.all(e.map(e=>e.unregister().catch(()=>!1)))}catch{}try{let e=await indexedDB.databases();await Promise.all(e.filter(e=>!!e.name).map(e=>new Promise(t=>{let n=indexedDB.deleteDatabase(e.name);n.onsuccess=()=>t(),n.onerror=()=>t(),n.onblocked=()=>t()})))}catch{}try{let e=navigator.storage;if(typeof e?.getDirectory==`function`){let t=await e.getDirectory(),n=[];for await(let e of t.keys())n.push(e);await Promise.all(n.map(e=>t.removeEntry(e,{recursive:!0}).catch(()=>{})))}}catch{}}function r(r,i,a={}){if(r.dataset.recoveryBusy===`1`)return;let o=a.wipe??n,s=a.reload??(()=>location.reload()),c=i instanceof Error?i.message:String(i),l=a.verdict===`browser-wedged`,u=e(i),d=l||u,f=document.createElement(`div`);f.style.cssText=`padding:2rem;text-align:center;font-family:system-ui;`;let p=document.createElement(`h1`);p.style.color=`var(--s2-negative, #e34850)`,p.textContent=l?`Your browser needs a restart`:`Failed to start`;let m=document.createElement(`p`);m.style.color=`var(--s2-content-tertiary, #717171)`,m.textContent=c;let h=document.createElement(`div`);h.style.cssText=`display:flex;gap:0.75rem;justify-content:center;flex-wrap:wrap;margin-top:1.5rem;`;let g=document.createElement(`button`);g.type=`button`,g.textContent=`Reset local data & reload`,g.dataset.variant=d?`demoted`:`destructive`,g.style.cssText=d?`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-content-tertiary, #717171);background:transparent;color:inherit;border-radius:4px;`:`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-negative, #e34850);background:var(--s2-negative, #e34850);color:#fff;border-radius:4px;`;let _=document.createElement(`button`);if(_.type=`button`,_.textContent=`Reload`,_.style.cssText=l?`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-accent, #0265dc);background:var(--s2-accent, #0265dc);color:#fff;border-radius:4px;`:`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-content-tertiary, #717171);background:transparent;color:inherit;border-radius:4px;`,g.addEventListener(`click`,()=>{g.disabled=!0,_.disabled=!0,g.textContent=`Resetting…`,r.dataset.recoveryBusy=`1`,(async()=>{try{await o()}catch{}for(let e of t)try{localStorage.removeItem(e)}catch{}s()})()}),_.addEventListener(`click`,()=>{s()}),l){let e=document.createElement(`p`);e.style.cssText=`max-width:34rem;margin:1rem auto 0;`,e.textContent=`This browser has stopped starting web workers — a browser process issue, not a problem with your data. Quit the browser completely, reopen it, and come back. Your local data is intact; resetting it will not fix this.`,f.append(p,m,e),h.append(_,g)}else f.append(p,m),h.append(g,_);for(f.append(h);r.firstChild;)r.removeChild(r.firstChild);r.appendChild(f)}export{r as renderBootRecoveryScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function e(e){if(e===`extension-direct`){let e=chrome;return e.identity?.getRedirectURL?.(`mcp-callback`)??`https://${e.runtime?.id??``}.chromiumapp.org/mcp-callback`}if(e===`node-rest`){let{getLocalApiBaseUrl:e}=await import(`./proxied-fetch-
|
|
1
|
+
async function e(e){if(e===`extension-direct`){let e=chrome;return e.identity?.getRedirectURL?.(`mcp-callback`)??`https://${e.runtime?.id??``}.chromiumapp.org/mcp-callback`}if(e===`node-rest`){let{getLocalApiBaseUrl:e}=await import(`./proxied-fetch-J19bK2dG.js`).then(e=>e.i),t=e();if(t)return`${t}/auth/callback`}let{getOAuthPageOrigin:t}=await import(`./oauth-service-Dn_Xz1FZ.js`),{origin:n}=await t();return`${n}${e===`extension-delegate`?`/auth/mcp-callback`:`/auth/callback`}`}export{e as t};
|
package/dist/ui/assets/{remote-terminal-view-C8LiE7Sl.js → remote-terminal-view-BpHAWWeD.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/readline-BOCWRKSR.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/xterm-B5LH8GIb.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./preload-helper-Czpn1I53.js";import{
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./preload-helper-Czpn1I53.js";import{ht as n,mt as r}from"./wc-shell-pTQjFXvS.js";import"./tool-ui-eSQ1g2I1.js";import{t as i}from"./permissions-surface-registry-CilCRwhh.js";import{storePendingHandle as a}from"./mount-picker-popup-qcWGbpG5.js";import{r as o,t as s}from"./hid-device-registry-B2R-0rNt.js";import"./browser-DGwroBSO.js";import{a as c,n as l}from"./serial-port-registry-CCqklAEr.js";import{a as u,t as d}from"./usb-device-registry--JwKRTYp.js";import"./usb-operations-v1mGAdRY.js";import{t as f}from"./terminal-session-client-ADzaWGFd.js";function p(e,t){let n=[],r=new Map,i=new Set;for(let a=0;a<e.length;a++){let o=e[a];o.startsWith(`-`)?t.has(o)?r.set(o,e[++a]??``):i.add(o):n.push(o)}return{positionals:n,flags:r,bools:i}}new TextDecoder(`utf-8`,{fatal:!1}),new TextEncoder;var m=new Set([`--vid`,`--pid`,`--baud`,`--data-bits`,`--stop-bits`,`--parity`,`--flow-control`,`--buffer-size`,`--bytes`,`--until`,`--timeout-ms`,`--dtr`,`--rts`,`--break`,`--__resolved`]);function h(e){return p(e,m)}function g(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function _(e){let t={};return e.has(`--vid`)&&(t.usbVendorId=g(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.usbProductId=g(e.get(`--pid`),`pid`)),Object.keys(t).length>0?[t]:[]}`${l}${l}`;var v=new Set([`--port`,`--baud`,`--vid`,`--pid`]),y=115200;function b(e){return p(e,v)}`${y}`;var x=new Set([`--vid`,`--pid`,`--usage-page`,`--usage`,`--__resolved`,`--timeout`]);function S(e){return p(e,x)}function C(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function w(e){let t={};return e.has(`--vid`)&&(t.vendorId=C(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.productId=C(e.get(`--pid`),`pid`)),e.has(`--usage-page`)&&(t.usagePage=C(e.get(`--usage-page`),`usage-page`)),e.has(`--usage`)&&(t.usage=C(e.get(`--usage`),`usage`)),Object.keys(t).length>0?[t]:[]}`${s}`;var T=new Set([`--vid`,`--pid`,`--class`,`--subclass`,`--protocol`,`--serial`,`--request-type`,`--recipient`,`--request`,`--value`,`--index`,`--__resolved`]);function E(e){return p(e,T)}function D(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function O(e){let t={};return e.has(`--vid`)&&(t.vendorId=D(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.productId=D(e.get(`--pid`),`pid`)),e.has(`--class`)&&(t.classCode=D(e.get(`--class`),`class`)),e.has(`--subclass`)&&(t.subclassCode=D(e.get(`--subclass`),`subclass`)),e.has(`--protocol`)&&(t.protocolCode=D(e.get(`--protocol`),`protocol`)),e.has(`--serial`)&&(t.serialNumber=e.get(`--serial`)),Object.keys(t).length>0?[t]:[]}`${d}`;function k(e){let{border:t,...n}=r(e);return n}var A=`\x1B[34m/\x1B[0m \x1B[90m$\x1B[0m `,j=class{options;client;terminal=null;fitAddon=null;terminalHost=null;previewHost=null;previewUrls=[];hasPreview=!1;previewStateListener=null;resizeObserver=null;unwatchTheme=null;mountRoot=null;readline=null;disposed=!1;abortPromptLoop=null;programmaticResolve=null;isExecuting=!1;suppressOutput=!1;tabBusy=!1;constructor(e){this.options=e;let t=e.sid??`panel-terminal-${Date.now()}`;this.client=new f({client:e.client,sid:t,onEvent:e=>this.handleEvent(e)})}async mount(r){let{Terminal:i}=await t(async()=>{let{Terminal:e}=await import(`./xterm-C3BHN0de.js`);return{Terminal:e}},[]),{FitAddon:a}=await t(async()=>{let{FitAddon:e}=await import(`./addon-fit-DIOBYJe3.js`);return{FitAddon:e}},[]),{Readline:o}=await t(async()=>{let{Readline:t}=await import(`./readline-BOCWRKSR.js`).then(t=>e(t.default,1));return{Readline:t}},__vite__mapDeps([0,1]));await t(()=>Promise.resolve({}),__vite__mapDeps([2])),this.mountRoot=r,this.terminal=new i({cursorBlink:!0,fontSize:11,fontFamily:`'Source Code Pro', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace`,theme:k(r),convertEol:!0}),this.unwatchTheme?.(),this.unwatchTheme=n(r,()=>{this.terminal&&(this.terminal.options.theme=k(this.mountRoot))}),this.fitAddon=new a,this.terminal.loadAddon(this.fitAddon),r.replaceChildren(),this.terminalHost=document.createElement(`div`),this.terminalHost.className=`terminal-panel__terminal-host`,r.appendChild(this.terminalHost),this.previewHost=document.createElement(`div`),this.previewHost.className=`terminal-panel__preview`,r.appendChild(this.previewHost),this.terminal.open(this.terminalHost),this.fitAddon.fit(),this.resizeObserver=new ResizeObserver(()=>this.refit()),this.resizeObserver.observe(this.terminalHost),this.readline=new o,this.neutralizeReadlineHistoryPersistence(),this.terminal.loadAddon(this.readline),this.readline.setCtrlCHandler(()=>this.signalInterruptDuringExec()),this.setupInput(),this.terminal.writeln(`\x1B[1mslicc\x1B[0m \x1B[90mshell (kernel)\x1B[0m`),this.terminal.writeln(`\x1B[90mType "help" for available commands.\x1B[0m
|
|
3
3
|
`),await this.client.open({cwd:this.options.cwd,env:this.options.env}),this.runPromptLoop()}refit(){this.fitAddon?.fit()}clearTerminal(){this.terminal?.clear()}async executeCommandInTerminal(e){let t=e.trim();if(!t)return{stdout:``,stderr:``,exitCode:0};if(!this.terminal||!this.readline)return this.client.exec(t);if(this.isExecuting||this.programmaticResolve||this.readline.getLine().length>0)return{stdout:``,stderr:`terminal is busy; finish current input first
|
|
4
4
|
`,exitCode:1};let n=new Promise(e=>{this.programmaticResolve=e});return this.readline.updateLine(t),this.terminal.input(`\r`),n}setPreviewStateListener(e){this.previewStateListener=e,e?.(this.hasPreview)}dispose(){this.disposed=!0,this.abortPromptLoop?.(Error(`terminal disposed`)),this.abortPromptLoop=null,this.clearMediaPreview(),this.unwatchTheme?.(),this.unwatchTheme=null,this.mountRoot=null,this.resizeObserver?.disconnect(),this.resizeObserver=null,this.terminal?.dispose(),this.terminal=null,this.readline=null,this.fitAddon=null,this.terminalHost=null,this.previewHost=null,this.client.close(),this.client.dispose()}renderMediaPreview(e){if(!this.previewHost)return;let t=Uint8Array.from(atob(e.data),e=>e.charCodeAt(0)),n=URL.createObjectURL(new Blob([t],{type:e.mediaType}));this.previewUrls.push(n);let r=document.createElement(`div`);r.className=`terminal-panel__preview-item`;let i=document.createElement(`div`);i.className=`terminal-panel__preview-label`;let a=e.path.split(`/`).pop()??e.path;if(i.textContent=`${a} · ${e.mediaType}`,r.appendChild(i),e.mediaType.startsWith(`video/`)){let e=document.createElement(`video`);e.className=`terminal-panel__preview-media`,e.controls=!0,e.autoplay=!0,e.loop=!0,e.muted=!0,e.playsInline=!0,e.src=n,e.addEventListener(`loadedmetadata`,()=>this.refit(),{once:!0}),r.appendChild(e)}else{let e=document.createElement(`img`);e.className=`terminal-panel__preview-media`,e.alt=a,e.src=n,e.addEventListener(`load`,()=>this.refit(),{once:!0}),r.appendChild(e)}this.previewHost.appendChild(r),this.previewHost.classList.add(`terminal-panel__preview--visible`),this.hasPreview=!0,this.previewStateListener?.(!0)}clearMediaPreview(){for(let e of this.previewUrls)URL.revokeObjectURL(e);this.previewUrls=[],this.previewHost&&(this.previewHost.replaceChildren(),this.previewHost.classList.remove(`terminal-panel__preview--visible`)),this.hasPreview=!1,this.previewStateListener?.(!1)}async runPromptLoop(){for(;!this.disposed&&this.readline&&this.terminal;){let e;try{e=await this.readNextLine()}catch{break}finally{this.abortPromptLoop=null}let t=this.programmaticResolve!==null,n=await this.processLine(e,t);this.programmaticResolve&&=(this.programmaticResolve(n),null)}}readNextLine(){let e=this.terminal,t=this.readline;if(!e||!t)return Promise.reject(Error(`terminal not mounted`));let n=new Promise((e,t)=>{this.abortPromptLoop=t}),r=new Promise((n,r)=>{e.write(``,()=>{e.buffer.active.cursorX>0&&e.write(`\x1B[7m%\x1B[0m\r
|
|
5
5
|
`),t.read(A).then(n,r)})});return Promise.race([r,n])}async processLine(e,t=!1){let n=e.trim();return!n||!t&&await this.tryRunPicker(n)?{stdout:``,stderr:``,exitCode:0}:this.runRemote(n)}async tryRunPicker(e){let t=M(e);if(t)return await this.runRemoteWithLocalPicker(e,t),!0;let n=z(e);if(n)return await this.runRemoteWithUsbPicker(n),!0;let r=B(e);if(r)return await this.runRemoteWithHidPicker(r),!0;let i=H(e);if(i)return await this.runRemoteWithSerialPicker(i),!0;let a=U(e);if(a)return await this.runRemoteWithEsptoolPicker(e,a),!0;let o=R(e);return o?(await this.runRemoteWithScreenShare(o.name),!0):!1}setupInput(){this.terminal&&(this.terminal.onData(e=>{e===` `&&this.handleTab()}),this.terminal.attachCustomKeyEventHandler(e=>!(e.type===`keydown`&&e.key===`Enter`&&this.tabBusy)))}signalInterruptDuringExec(){this.isExecuting&&(this.terminal?.writeln(`^C`),this.client.signal(`SIGINT`))}neutralizeReadlineHistoryPersistence(){let e=this.readline.history;e&&(e.entries=[],e.cursor=-1,e.saveToLocalStorage=()=>void 0,e.restoreFromLocalStorage=()=>void 0)}reanchorReadline(){if(!this.terminal||!this.readline)return;let e=this.readline.state;e&&(e.getTty().anchorRow=this.terminal.buffer.active.cursorY,e.refresh())}async handleTab(){if(!(!this.terminal||!this.readline)&&!(this.isExecuting||this.tabBusy)){this.tabBusy=!0,this.isExecuting=!0;try{let{currentWord:e,isFirstWord:t,compgenCmd:n}=G(this.readline.getLine());this.suppressOutput=!0;let r=``;try{r=(await this.client.exec(n)).stdout}finally{this.suppressOutput=!1}let i=r.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./runtime-env-DadgceZk.js";import{r as t}from"./fetch-body-CuwTaJC_.js";import{a as n,t as r}from"./path-utils-DNJG-zQf.js";import{C as i,_ as a}from"./shared-
|
|
1
|
+
import{t as e}from"./runtime-env-DadgceZk.js";import{r as t}from"./fetch-body-CuwTaJC_.js";import{a as n,t as r}from"./path-utils-DNJG-zQf.js";import{C as i,_ as a}from"./shared-DfMXB1pm.js";function o(t,n){let r=e(),i=`/preview${t}${n?`?projectRoot=${encodeURIComponent(n)}`:``}`;if(r){let e=globalThis.chrome?.runtime?.getURL;if(e)return e(i)}let a=`http://localhost:5710`;return typeof window<`u`&&window.location?.origin?a=window.location.origin:typeof self<`u`&&self.location?.origin&&(a=self.location.origin),`${a}${i}`}async function s(e){let t=await crypto.subtle.digest(`SHA-256`,e);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function c(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function l(e){return new Promise(t=>setTimeout(t,e))}async function u(e,n,r){let i;try{i=await e(n.url,{method:`GET`,headers:{Accept:`application/octet-stream`},timeoutMs:r})}catch(e){let t=e instanceof Error?e.message:String(e);return{ok:!1,retriable:!0,error:Error(`${n.label}: network error (${t})`)}}if(i.status>=500&&i.status<600)return{ok:!1,retriable:!0,error:Error(`${n.label}: server error HTTP ${i.status}`)};if(i.status<200||i.status>=300){let e=i.statusText?` ${i.statusText}`:``;return{ok:!1,retriable:!1,error:Error(`${n.label}: HTTP ${i.status}${e}`)}}let a=t(i.body);return!(a instanceof Uint8Array)||a.length===0?{ok:!1,retriable:!1,error:Error(`${n.label}: response body was empty`)}:{ok:!0,bytes:a}}async function d(e,t,n){let r;for(let i=1;i<=3;i++){let a=await u(e,t,n);if(a.ok)return a.bytes;if(r=a.error,!a.retriable||i===3)throw a.error;await l(250*i)}throw r??Error(`${t.label}: download failed`)}async function ee(e,t){let n=await s(e);if(n!==t.sha256.toLowerCase())throw Error(`${t.label}: sha256 mismatch (expected ${t.sha256.toLowerCase()}, got ${n})`)}async function f(e,t){if(!c(t.url))throw Error(`${t.label}: refused to fetch non-https URL '${t.url}'`);let n=await d(e,t,t.timeoutMs??6e4);return await ee(n,t),n}const p=`pyproject.toml`,m=`uv.lock`,h=`/workspace`;function g(e){return e.trim().toLowerCase().replace(/[-_.]+/g,`-`)}function _(e){let t=e.indexOf(`==`);return(t===-1?e:e.slice(0,t)).trim()}function v(e){let t=e.indexOf(`==`);return t===-1?{name:e.trim(),version:``}:{name:e.slice(0,t).trim(),version:e.slice(t+2).trim()}}async function y(e,t){let i=t?.startsWith(`/`)?t:h;for(;;){if(await e.exists(r(i,p)))return i;if(i===`/`)return null;i=n(i).dir}}async function te(e,t){return await y(e,t)??h}function b(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`'`&&!n)t=!t;else if(i===`"`&&!t)n=!n;else if(i===`#`&&!t&&!n)return e.slice(0,r)}return e}function x(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1):null}function ne(e,t,n){let r=n,i=t;for(;!r.includes(`]`)&&i+1<e.length;)i+=1,r+=`\n${b(e[i])}`;let a=[];for(let e of r.matchAll(/["']([^"']*)["']/g))e[1].trim()&&a.push(e[1].trim());return{items:a,lastIndex:i}}function re(e){let t=e.split(`
|
|
2
2
|
`),n=``,r=`workspace`,i=`0.1.0`,a=[];for(let e=0;e<t.length;e++){let o=b(t[e]).trim();if(!o)continue;if(o.startsWith(`[`)){n=o;continue}if(n!==`[project]`)continue;let s=o.indexOf(`=`);if(s===-1)continue;let c=o.slice(0,s).trim(),l=o.slice(s+1).trim();if(c===`name`)r=x(l)??r;else if(c===`version`)i=x(l)??i;else if(c===`dependencies`){let n=ne(t,e,l);a=n.items,e=n.lastIndex}}return{name:r,version:i,dependencies:a}}function S(e){return e.length===0?`dependencies = []`:`dependencies = [\n${e.map(e=>` "${e}",`).join(`
|
|
3
3
|
`)}\n]`}function C(e){let t=S(e.dependencies);return`[project]\nname = "${e.name}"\nversion = "${e.version}"\n${t}\n`}function ie(e,t){let n=b(e[t]),r=t;for(;!n.includes(`]`)&&r+1<e.length;)r+=1,n+=`\n${b(e[r])}`;return r}function ae(e){let t={depsStart:-1,depsEnd:-1,projectHeaderIndex:-1,projectSectionEnd:-1},n=``;for(let r=0;r<e.length;r++){let i=b(e[r]).trim();if(i.startsWith(`[`)){t.projectHeaderIndex!==-1&&t.projectSectionEnd===-1&&r>t.projectHeaderIndex&&(t.projectSectionEnd=r),n=i,i===`[project]`&&(t.projectHeaderIndex=r);continue}if(n!==`[project]`||t.depsStart!==-1)continue;let a=i.indexOf(`=`);a!==-1&&i.slice(0,a).trim()===`dependencies`&&(t.depsStart=r,t.depsEnd=ie(e,r))}return t}function oe(e,t){let n=S(t.dependencies).split(`
|
|
4
4
|
`),r=e.split(`
|
|
@@ -227,7 +227,7 @@ import _slicc_fs_js as _bridge
|
|
|
227
227
|
_build_slicc_module(_bridge)
|
|
228
228
|
del _build_slicc_module
|
|
229
229
|
del _bridge
|
|
230
|
-
`)}const W=a(`pyodide`,`314.0.6`),G=`https://cdn.jsdelivr.net/pyodide/v${W}/full/`,K=`pyodide is not installed in node_modules: run \`ipk add pyodide@${W}\` (no network fallback)`,q={asmJs:`pyodide.asm.mjs`,asmWasm:`pyodide.asm.wasm`,stdlibZip:`python_stdlib.zip`,lockJson:`pyodide-lock.json`};async function ke(e){let t;try{t=await i(`pyodide/package.json`,e.fromDir,e.reader)}catch{return null}if(t.type!==`file`)return null;let r=n(t.path).dir;for(let t of Object.values(q))if(!await e.reader.exists(`${r}/${t}`))return null;return r}async function Ae(e,t){try{let[n,r,i,a]=await Promise.all([e.call(`vfs`,`readFile`,[`${t}/${q.asmJs}`]),e.call(`vfs`,`readFileBinary`,[`${t}/${q.asmWasm}`]),e.call(`vfs`,`readFileBinary`,[`${t}/${q.stdlibZip}`]),e.call(`vfs`,`readFile`,[`${t}/${q.lockJson}`])]);return{asmJsSource:n,asmWasmBytes:r instanceof Uint8Array?r:new Uint8Array(r),stdlibBytes:i instanceof Uint8Array?i:new Uint8Array(i),lockJsonString:a}}catch{return null}}function je(e,t){let n=e+q.asmWasm,r=globalThis.fetch,i=!0,a=(e,i)=>(typeof e==`string`?e:e instanceof URL?e.href:e.url)===n?Promise.resolve(new Response(t,{headers:{"Content-Type":`application/wasm`}})):r(e,i);return globalThis.fetch=a,{restore:()=>{i&&(i=!1,globalThis.fetch===a&&(globalThis.fetch=r))}}}async function Me(e,t,n){let r=await Ae(n,t);if(!r)throw Error(K);let i=URL.createObjectURL(new Blob([r.asmJsSource],{type:`text/javascript`})),a=URL.createObjectURL(new Blob([r.stdlibBytes],{type:`application/zip`})),s=`slicc-pyodide://local/${crypto.randomUUID()}/`,c=je(s,r.asmWasmBytes);try{let t=await import(i);return await e.loadPyodide({indexURL:s,lockFileContents:r.lockJsonString,stdLibURL:a,createPyodideModule:t.default,packageBaseUrl:o(`/workspace/python_wheels/`)})}finally{c.restore(),URL.revokeObjectURL(i),URL.revokeObjectURL(a)}}async function Ne(e,t,n=()=>import(`./pyodide-65Z_RapY.js`)){let r=[],i=[],a=new U(t),o;try{let t=await n();o=e.pyodideAssetRoot?await Me(t,e.pyodideAssetRoot,a):await t.loadPyodide({indexURL:e.pyodideIndexURL})}catch(e){a.dispose();let n={type:`realm-error`,message:`loadPyodide: ${e instanceof Error?e.message:String(e)}`};t.postMessage(n);return}let s=e=>{i.push(`Warning: ${e}\n`)},c=[],l,u;try{await Pe(o,a,s,Fe(e.pyodideAssetRoot));let{mountPyLiveVfs:n}=await import(`./py-live-vfs-
|
|
230
|
+
`)}const W=a(`pyodide`,`314.0.6`),G=`https://cdn.jsdelivr.net/pyodide/v${W}/full/`,K=`pyodide is not installed in node_modules: run \`ipk add pyodide@${W}\` (no network fallback)`,q={asmJs:`pyodide.asm.mjs`,asmWasm:`pyodide.asm.wasm`,stdlibZip:`python_stdlib.zip`,lockJson:`pyodide-lock.json`};async function ke(e){let t;try{t=await i(`pyodide/package.json`,e.fromDir,e.reader)}catch{return null}if(t.type!==`file`)return null;let r=n(t.path).dir;for(let t of Object.values(q))if(!await e.reader.exists(`${r}/${t}`))return null;return r}async function Ae(e,t){try{let[n,r,i,a]=await Promise.all([e.call(`vfs`,`readFile`,[`${t}/${q.asmJs}`]),e.call(`vfs`,`readFileBinary`,[`${t}/${q.asmWasm}`]),e.call(`vfs`,`readFileBinary`,[`${t}/${q.stdlibZip}`]),e.call(`vfs`,`readFile`,[`${t}/${q.lockJson}`])]);return{asmJsSource:n,asmWasmBytes:r instanceof Uint8Array?r:new Uint8Array(r),stdlibBytes:i instanceof Uint8Array?i:new Uint8Array(i),lockJsonString:a}}catch{return null}}function je(e,t){let n=e+q.asmWasm,r=globalThis.fetch,i=!0,a=(e,i)=>(typeof e==`string`?e:e instanceof URL?e.href:e.url)===n?Promise.resolve(new Response(t,{headers:{"Content-Type":`application/wasm`}})):r(e,i);return globalThis.fetch=a,{restore:()=>{i&&(i=!1,globalThis.fetch===a&&(globalThis.fetch=r))}}}async function Me(e,t,n){let r=await Ae(n,t);if(!r)throw Error(K);let i=URL.createObjectURL(new Blob([r.asmJsSource],{type:`text/javascript`})),a=URL.createObjectURL(new Blob([r.stdlibBytes],{type:`application/zip`})),s=`slicc-pyodide://local/${crypto.randomUUID()}/`,c=je(s,r.asmWasmBytes);try{let t=await import(i);return await e.loadPyodide({indexURL:s,lockFileContents:r.lockJsonString,stdLibURL:a,createPyodideModule:t.default,packageBaseUrl:o(`/workspace/python_wheels/`)})}finally{c.restore(),URL.revokeObjectURL(i),URL.revokeObjectURL(a)}}async function Ne(e,t,n=()=>import(`./pyodide-65Z_RapY.js`)){let r=[],i=[],a=new U(t),o;try{let t=await n();o=e.pyodideAssetRoot?await Me(t,e.pyodideAssetRoot,a):await t.loadPyodide({indexURL:e.pyodideIndexURL})}catch(e){a.dispose();let n={type:`realm-error`,message:`loadPyodide: ${e instanceof Error?e.message:String(e)}`};t.postMessage(n);return}let s=e=>{i.push(`Warning: ${e}\n`)},c=[],l,u;try{await Pe(o,a,s,Fe(e.pyodideAssetRoot));let{mountPyLiveVfs:n}=await import(`./py-live-vfs-DMc0LhCg.js`);l=n(o,e,t,s),l||(c=await Ue(o,e,s),await We(o,e,s)),await Ve(o,a,e,s),await Ge(o,a,s);try{o.FS.chdir(e.cwd)}catch{}Ke(o,e,r,i),u=await Ye(o,i),l?Je(l,s):await Xe(c,e,a,s)}catch(e){a.dispose();let n={type:`realm-error`,message:`${e instanceof Error?e.message:String(e)}${i.length?`\n${i.join(``)}`:``}`};t.postMessage(n);return}a.dispose();let d={type:`realm-done`,stdout:r.join(``),stderr:i.join(``),exitCode:u};t.postMessage(d)}const J=`/workspace/python_wheels`;async function Pe(e,t,n,r){await Ie(t,n,r);try{await e.loadPackage([`micropip`])}catch(e){n(`micropip preload failed: ${Z(e)}`)}}function Fe(e){return e?`${e}/${q.lockJson}`:`/workspace/node_modules/pyodide/pyodide-lock.json`}const Y=1e4,X=new WeakMap;function Ie(e,t,n){let r=X.get(e);if(r)return r;let i=Le(e,t,n);return X.set(e,i),i}async function Le(e,t,n){let r;try{if(!await e.call(`vfs`,`exists`,[n]))return;let t=await e.call(`vfs`,`readFile`,[n]),i=JSON.parse(t);for(let[e,t]of Object.entries(i.packages??{}))if(t?.file_name&&g(t.name??e)===`micropip`){r=t;break}}catch(e){t(`micropip wheel staging skipped: ${Z(e)}`);return}if(!r?.file_name||!r.sha256)return;let i=`${J}/${r.file_name}`;try{if(await e.call(`vfs`,`exists`,[i]))return;let t=await f(Re(e),{url:`${G}${r.file_name}`,sha256:r.sha256,label:`micropip wheel`,timeoutMs:Y});await e.call(`vfs`,`mkdir`,[J]),await e.call(`vfs`,`writeFileBinary`,[i,t])}catch(e){t(`micropip wheel staging failed: ${Z(e)}`)}}function Re(e){return async(t,n)=>{let r={method:n?.method??`GET`,...n?.headers?{headers:n.headers}:{},...n?.body===void 0?{}:{body:n.body}},i=await ze(e.call(`fetch`,`request`,[t,r]),n?.timeoutMs??Y,t);return{status:i.status,statusText:i.statusText,headers:i.headers,body:i.body instanceof Uint8Array?i.body:new Uint8Array(i.body),url:i.url}}}function ze(e,t,n){let r,i=new Promise((e,i)=>{r=setTimeout(()=>i(Error(`request to ${n} timed out after ${t}ms`)),t)});return Promise.race([e,i]).finally(()=>clearTimeout(r))}function Be(e){return{exists:t=>e.call(`vfs`,`exists`,[t]),readFile:t=>e.call(`vfs`,`readFile`,[t])}}async function Ve(e,t,n,r){let i=Be(t),a;try{a=await y(i,n.cwd)}catch(e){r(`manifest discovery failed: ${Z(e)}`);return}if(a===null)return;let o,s;try{let[e,t]=await Promise.all([E(i,a),D(i,a)]);o=e.dependencies,s=t}catch(e){r(`manifest read failed: ${Z(e)}`);return}let c=new Map;for(let e of s)c.set(g(e.name),e);for(let t of o){let{name:n}=v(t);if(!n)continue;let i=c.get(g(n));if(!i){r(`no integrity pin for \`${n}\`; run \`di sync\` to repair`);continue}await He(e,i,r)}}async function He(e,t,n){switch(t.source){case`pyodide-cdn`:try{await e.loadPackage([t.name])}catch(e){n(`activation of \`${t.name}\` failed: ${Z(e)}`)}return;case`pypi`:try{let n=`${J}/${t.fileName}`;await e.runPythonAsync(`import micropip; await micropip.install('emfs:${n}')`)}catch(e){n(`activation of \`${t.name}\` failed: ${Z(e)}`)}return;default:n(`unknown source \`${t.source}\` for \`${t.name}\`; skipping`)}}async function Ue(e,t,n){if(t.opfsMountDbName===void 0)return[];let r=t.pyodideMountDirs??[t.cwd,`/tmp`],i=t.mountPoints??[],a=new Set(i.map(e=>e.path));try{return(await Qe(e,r,t.opfsMountDbName,n,{skipMountPaths:a})).mounts}catch(e){return n(`VFS→Pyodide OPFS mount failed: ${Z(e)}`),[]}}async function We(e,t,n){let r=t.mountPoints??[];if(r.length!==0){try{we(e.FS,r.map(e=>e.path),n)}catch(e){n(`bomb overlay install failed: ${Z(e)}`)}try{await Ee(e,r.map(e=>e.path))}catch(e){n(`python mount guard install failed: ${Z(e)}`)}}}async function Ge(e,t,n){try{await Oe(e,t)}catch(e){n(`slicc.fs registration failed: ${Z(e)}`)}}function Ke(e,t,n,r){e.setStdout({batched:e=>n.push(e+`
|
|
231
231
|
`)}),e.setStderr({batched:e=>r.push(e+`
|
|
232
232
|
`)});let i=!1;e.setStdin({stdin:()=>i||!t.stdin?null:(i=!0,t.stdin)}),qe(e,t.env),e.globals.set(`__slicc_code`,t.code),e.globals.set(`__slicc_filename`,t.filename),e.globals.set(`__slicc_argv`,t.argv)}function qe(e,t){if(!(!t||Object.keys(t).length===0)){e.globals.set(`__slicc_env`,e.toPy(t));try{e.runPython(`import os; os.environ.update(__slicc_env)`)}finally{e.runPython(`del __slicc_env`)}}}function Je(e,t){try{e.flush()}catch(e){t(`Pyodide→VFS flush failed: ${Z(e)}`)}}async function Ye(e,t){let n;try{await e.runPythonAsync(`
|
|
233
233
|
import sys
|
|
@@ -235,7 +235,18 @@ import traceback
|
|
|
235
235
|
|
|
236
236
|
__slicc_exit_code = 0
|
|
237
237
|
try:
|
|
238
|
-
|
|
238
|
+
# A real list: the JS array arrives as a JsProxy, whose slices
|
|
239
|
+
# (sys.argv[1:], what argparse-style CLIs read) are not lists of str.
|
|
240
|
+
sys.argv = list(__slicc_argv)
|
|
241
|
+
# Like CPython: a script's own directory replaces Pyodide's leading ''
|
|
242
|
+
# (the cwd, kept for -c and stdin), so it can import its sibling package.
|
|
243
|
+
if __slicc_filename not in ("-c", "<stdin>"):
|
|
244
|
+
import os.path
|
|
245
|
+
__slicc_dir = os.path.dirname(os.path.abspath(__slicc_filename))
|
|
246
|
+
if sys.path and sys.path[0] == "":
|
|
247
|
+
sys.path[0] = __slicc_dir
|
|
248
|
+
else:
|
|
249
|
+
sys.path.insert(0, __slicc_dir)
|
|
239
250
|
exec(compile(__slicc_code, __slicc_filename, "exec"), {"__name__": "__main__", "__file__": __slicc_filename})
|
|
240
251
|
except SystemExit as exc:
|
|
241
252
|
code = exc.code
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./base64-BPBW1Gzr.js";import{t}from"./content-type-_QKWY0B2.js";import{c as n,r,s as i,t as a}from"./proxied-fetch-
|
|
1
|
+
import{r as e}from"./base64-BPBW1Gzr.js";import{t}from"./content-type-_QKWY0B2.js";import{c as n,r,s as i,t as a}from"./proxied-fetch-J19bK2dG.js";import{s as o,t as s}from"./api-endpoint-D8lUKmPu.js";import{c,l,s as u}from"./types-BfwydWt7.js";import{n as d,t as f}from"./rest-paths-Dia19u9P.js";import{t as p}from"./request-body-BF4moGct.js";const m=d;function h(e){return e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`)}function g(e,t,n){if(n)return t;let r=AbortSignal.timeout(e);return t&&typeof AbortSignal.any==`function`?AbortSignal.any([r,t]):r}function _(e){let t=e.fetchImpl??((...e)=>globalThis.fetch(...e)),n=e.resolveUrl??o,r=e.headers??s,i=e.controlTimeoutMs??m;async function a(e,r){try{return await t(n(e),r)}catch(e){return e instanceof Error?e:Error(String(e))}}return{headers:r,send:a,async callJson(e,t,n,o){let s=o?.timeoutMs??i,c=g(s,o?.signal,o?.humanPaced===!0),l={method:e,headers:r({"Content-Type":`application/json`}),...c?{signal:c}:{}};n!==void 0&&(l.body=JSON.stringify(n));let u=await a(t,l);if(u instanceof Error)return{status:0,ok:!1,body:{error:h(u)?`no answer within ${s}ms`:u.message}};let d=await u.json().catch(()=>void 0);return{status:u.status,ok:u.ok,body:d}}}}function v(e,t){let n=e.body?.error;return typeof n==`string`&&n.length>0?n:e.status===0?`${t} (transport unreachable)`:`${t} (HTTP ${e.status})`}function y(e){return e.status===0?void 0:e.status}function b(e,t,n,r){return u(e,t,v(n,r),y(n))}async function x(e,t){let n=await e.callJson(`GET`,f.secretsMasked);return n.ok?Array.isArray(n.body)?{ok:!0,value:n.body}:u(`secrets`,t,`masked secrets response is not an array`):b(`secrets`,t,n,`masked secrets request failed`)}function S(e){return{async listMaskedEnv(){let t=await x(e,`listMaskedEnv`);return t.ok?{ok:!0,value:{entries:t.value}}:t},async getMasked(t){let n=await x(e,`getMasked`);if(!n.ok)return n;let r=n.value.find(e=>e.name===t.name);return r?{ok:!0,value:r}:u(`secrets`,`getMasked`,`no secret named "${t.name}"`,404)},async set(t){let n=t.scope===`persisted`,r=n?f.secretsPersisted:f.secretsSession,i=await e.callJson(`POST`,r,{name:t.name,value:t.value,domains:[...t.domains??[]]});return n&&i.status===404?c(`secrets`,`set`,`this server has no persisted-secret write route (upgrade it; the route shipped in #2823), retry with scope: 'session'`):i.ok?{ok:!0,value:void 0}:b(`secrets`,`set`,i,`set secret failed`)},async delete(t){let n=await e.callJson(`DELETE`,`${f.secretsPersisted}/${encodeURIComponent(t.name)}`);if(!n.ok)return b(`secrets`,`delete`,n,`delete secret failed`);let r=n.body;return{ok:!0,value:{removed:r?.removed??!0,fromSession:r?.fromSession===!0}}}}}async function C(o,s){let c={method:s.method??`GET`,headers:o.headers({...n(s.headers),"X-Target-URL":s.url}),cache:`no-store`};s.signal&&(c.signal=s.signal);let l=p(s);if(l!==void 0){if(l.byteLength>33554432)return u(`network`,`crossOriginFetch`,`request body is ${l.byteLength} bytes, over the ${a}-byte proxy limit`);c.body=l}let d=await o.send(f.fetchProxy,c);if(d instanceof Error)return u(`network`,`crossOriginFetch`,h(d)?`request cancelled`:d.message);if(d.headers.get(`x-proxy-error`)===`1`){let e=await d.text().catch(()=>``);return u(`network`,`crossOriginFetch`,e||`fetch-proxy reported an error`,d.status)}let m=r(),g=Number(d.headers.get(`content-length`)??``);if(Number.isFinite(g)&&g>m)return u(`network`,`crossOriginFetch`,`response body is ${g} bytes, over the ${m}-byte download limit`,d.status);let _;try{_=new Uint8Array(await d.arrayBuffer())}catch(e){return u(`network`,`crossOriginFetch`,h(e)?`response body cancelled`:`response body failed: ${e instanceof Error?e.message:String(e)}`,d.status)}if(_.byteLength>m)return u(`network`,`crossOriginFetch`,`response body is ${_.byteLength} bytes, over the ${m}-byte download limit`,d.status);let v={};d.headers.forEach((e,t)=>{v[t]=e});let y=i(v),b=t(y[`content-type`]??``);return{ok:!0,value:{status:d.status,ok:d.ok,statusText:d.statusText,headers:y,body:b?new TextDecoder().decode(_):e(_),bodyEncoding:b?`text`:`base64`,url:s.url}}}async function w(e,t){let n=t.backend===`s3`?f.s3SignAndForward:f.daSignAndForward,r=await e.callJson(`POST`,n,t.envelope,{timeoutMs:12e4}),i=r.body;return i&&typeof i==`object`&&typeof i.ok==`boolean`?{ok:!0,value:i}:b(`mounts`,`signRequest`,r,`sign-and-forward response is not an envelope`)}async function T(e,t){let n=t.suggestedPattern??t.detail,r=await e.callJson(`POST`,f.sudoApprove,{kind:t.kind,detail:t.detail,suggestedPattern:n,...t.requester?{requester:t.requester}:{},...t.reason?{reason:t.reason}:{},...t.approver?{approver:t.approver}:{}},{humanPaced:!0,...t.signal?{signal:t.signal}:{}});return r.ok?{ok:!0,value:l(r.body,n)}:b(`approvals`,`request`,r,`approval endpoint returned non-OK`)}function E(e){let t=_(e);return{crossOriginFetch:e=>C(t,e),secrets:S(t),signRequest:e=>w(t,e),requestApproval:e=>T(t,e)}}export{E as createRestOps};
|