sliccy 6.257.13 → 6.258.1

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.
Files changed (141) hide show
  1. package/dist/ui/.vite/manifest.json +180 -180
  2. package/dist/ui/assets/{account-store-ReUHUaal.js → account-store-D2ZhzT6k.js} +1 -1
  3. package/dist/ui/assets/{account-store-8paggIye.js → account-store-dUOszes2.js} +1 -1
  4. package/dist/ui/assets/adobe-26My-Q5F.js +1 -0
  5. package/dist/ui/assets/adobe-CWgsY48d.js +2 -0
  6. package/dist/ui/assets/{agent-panels-DC_0m1kB.js → agent-panels-BIl3niob.js} +1 -1
  7. package/dist/ui/assets/{almost-bash-shell-headless-CeWi8FZy.js → almost-bash-shell-headless-eKjbOy1P.js} +14 -14
  8. package/dist/ui/assets/{apply-layout-BjTA9Mhu.js → apply-layout-uGW_89wB.js} +1 -1
  9. package/dist/ui/assets/{azure-openai-Dutj0rGR.js → azure-openai-03JOHdox.js} +1 -1
  10. package/dist/ui/assets/{azure-openai-Bn_dOo0r.js → azure-openai-C08YQcd6.js} +1 -1
  11. package/dist/ui/assets/{bunny-probe-UxBT7gjN.js → bunny-probe-BZ4n-c63.js} +1 -1
  12. package/dist/ui/assets/{bunny-run-BcJ1ZpBQ.js → bunny-run-BkqQNY38.js} +1 -1
  13. package/dist/ui/assets/{cdp-DhmEdJkx.js → cdp-CIaoY_-T.js} +3 -3
  14. package/dist/ui/assets/{cerebras-DI-sLZy5.js → cerebras-Dyaslk9C.js} +1 -1
  15. package/dist/ui/assets/{cerebras-6GA7LaCb.js → cerebras-I9XfG9qE.js} +1 -1
  16. package/dist/ui/assets/{composer-speech-o95m5Cw2.js → composer-speech-D3Q7wRzB.js} +1 -1
  17. package/dist/ui/assets/{connect-surface-DK-DNp1w.js → connect-surface-DGGXkOjg.js} +1 -1
  18. package/dist/ui/assets/{directed-approval-CWL9KkPM.js → directed-approval-DmQxY_To.js} +1 -1
  19. package/dist/ui/assets/{emscripten-vfs-hook-H1nBcIIu.js → emscripten-vfs-hook-90Gqrsgb.js} +1 -1
  20. package/dist/ui/assets/{fast-path-C3_7WG0n.js → fast-path-PIOCBgFf.js} +1 -1
  21. package/dist/ui/assets/{frozen-archive-writer-C8H39dn3.js → frozen-archive-writer-NpztAvQY.js} +1 -1
  22. package/dist/ui/assets/{frozen-session-delete-DkwFgbtZ.js → frozen-session-delete-CbC408cI.js} +1 -1
  23. package/dist/ui/assets/{frozen-session-identity-D-m-HbBf.js → frozen-session-identity-Bbl7jYAA.js} +1 -1
  24. package/dist/ui/assets/{gelatiere-unit-7s64VLBS.js → gelatiere-unit-CKOAJuCh.js} +1 -1
  25. package/dist/ui/assets/{github-Bzp_P27X.js → github-B7Smd-th.js} +1 -1
  26. package/dist/ui/assets/{github-BeKa3ygN.js → github-DVlGl1gC.js} +1 -1
  27. package/dist/ui/assets/{github-copilot-Dxag5hrm.js → github-copilot-5S8ir1m3.js} +1 -1
  28. package/dist/ui/assets/{github-copilot-DnB1bKDH.js → github-copilot-CM9DklaN.js} +1 -1
  29. package/dist/ui/assets/{hear-rIIcmoTn.js → hear-Wv8MqFuG.js} +1 -1
  30. package/dist/ui/assets/{hidden-page-input-DNB1__Q1.js → hidden-page-input-IkLF_7ZU.js} +1 -1
  31. package/dist/ui/assets/{hidden-page-input-CKVOnpCZ.js → hidden-page-input-vcMEY8NI.js} +1 -1
  32. package/dist/ui/assets/{js-realm-worker-gD3Hmuvc.js → js-realm-worker-UD39nhWx.js} +3 -3
  33. package/dist/ui/assets/{jsh-executor-4l6mEfX3.js → jsh-executor-B-PE4CUq.js} +3 -3
  34. package/dist/ui/assets/{kernel-worker-C4JX2Lhc.js → kernel-worker-Bh8mq5dQ.js} +9 -9
  35. package/dist/ui/assets/{lick-ws-bridge-zUd1fMUr.js → lick-ws-bridge-D70rQOdJ.js} +1 -1
  36. package/dist/ui/assets/{lick-ws-bridge-CD69ZGXS.js → lick-ws-bridge-DwKxGu83.js} +1 -1
  37. package/dist/ui/assets/{live-session-curation-NZzspAZQ.js → live-session-curation-4U8KqRuP.js} +1 -1
  38. package/dist/ui/assets/{live-session-curation-DOcwSrnr.js → live-session-curation-Ba3KZ74T.js} +1 -1
  39. package/dist/ui/assets/{live-session-snapshot-zJLD4Vm7.js → live-session-snapshot-DDTVMYYw.js} +1 -1
  40. package/dist/ui/assets/{local-llm-pIYWuo2K.js → local-llm-BfCeQCdd.js} +1 -1
  41. package/dist/ui/assets/{local-llm-CoqVNw1-.js → local-llm-tV_8QqUD.js} +1 -1
  42. package/dist/ui/assets/{main-BVtIfyjF.js → main-Dna00i-n.js} +3 -3
  43. package/dist/ui/assets/{main-cherry--itiJ8U5.js → main-cherry-F3i8LCUD.js} +1 -1
  44. package/dist/ui/assets/{mcp-command-D4b0GURb.js → mcp-command-BkdE_xO8.js} +10 -10
  45. package/dist/ui/assets/{memory-curation-seam-DkSMkxhA.js → memory-curation-seam-CPrBnduz.js} +1 -1
  46. package/dist/ui/assets/{memory-write-execute-CHT2JaRt.js → memory-write-execute-qnJKEwCb.js} +1 -1
  47. package/dist/ui/assets/{merge-folded-cost-into-frozen-Hmtv3u1N.js → merge-folded-cost-into-frozen-qNb6SKWS.js} +1 -1
  48. package/dist/ui/assets/{new-session-DqEVKTr2.js → new-session-Bq06wCYL.js} +2 -2
  49. package/dist/ui/assets/{oauth-bootstrap-DKQmUBa6.js → oauth-bootstrap-03xoL9D1.js} +2 -2
  50. package/dist/ui/assets/{onboarding-orchestrator-DXvXu1J9.js → onboarding-orchestrator-ZqapYjJ4.js} +1 -1
  51. package/dist/ui/assets/{openai-codex-C9MRCHw7.js → openai-codex-cWjBOdvZ.js} +1 -1
  52. package/dist/ui/assets/{openai-codex-DcvG9HUm.js → openai-codex-j6cdsOW6.js} +1 -1
  53. package/dist/ui/assets/{openrouter-BLT0d2Q8.js → openrouter-Co5cPs8f.js} +1 -1
  54. package/dist/ui/assets/{openrouter-D7kcuCF2.js → openrouter-DaeVDKQM.js} +1 -1
  55. package/dist/ui/assets/{openrouter-free-BIDJJhLB.js → openrouter-free-CjxMMT6E.js} +1 -1
  56. package/dist/ui/assets/{openrouter-free-DHVhm28U.js → openrouter-free-E2S3ik1W.js} +1 -1
  57. package/dist/ui/assets/{openrouter-oauth-CrlQQ_2x.js → openrouter-oauth-CpiX5giq.js} +1 -1
  58. package/dist/ui/assets/{openrouter-oauth-DUN6N3q8.js → openrouter-oauth-DXpCrgq1.js} +1 -1
  59. package/dist/ui/assets/{panel-rpc-handlers-CUGHIICW.js → panel-rpc-handlers-VocjxUzM.js} +2 -2
  60. package/dist/ui/assets/{panelize-shell-qMvuiegF.js → panelize-shell-CcJyYyti.js} +1 -1
  61. package/dist/ui/assets/{pi-edit-execution-DAgLrT1c.js → pi-edit-execution-DzL5Y9Lr.js} +1 -1
  62. package/dist/ui/assets/{provider-Vm2WkktW.js → provider-CSYiX1uH.js} +1 -1
  63. package/dist/ui/assets/{provider-Dgf6fUpt.js → provider-DveI2UKB.js} +1 -1
  64. package/dist/ui/assets/{provider-settings-ClX6sVSz.js → provider-settings-D1GTGx9D.js} +1 -1
  65. package/dist/ui/assets/provider-store-access-8FRmMgQy.js +1 -0
  66. package/dist/ui/assets/{provider-store-access-xLHsxzw1.js → provider-store-access-BfkRcIL3.js} +1 -1
  67. package/dist/ui/assets/{providers-C3xoqmwi.js → providers-C1s0rNX1.js} +1 -1
  68. package/dist/ui/assets/{providers-DRfjVuQU.js → providers-Dn1jvUQo.js} +2 -2
  69. package/dist/ui/assets/{quick-llm-FWCqnMx-.js → quick-llm-B24Z_0t0.js} +1 -1
  70. package/dist/ui/assets/{realm-inprocess-CVgRJnFl.js → realm-inprocess-BKQjSHYg.js} +3 -3
  71. package/dist/ui/assets/{realm-unhandled-rejections-DEF7XXLw.js → realm-unhandled-rejections-CHNRwgmK.js} +1 -1
  72. package/dist/ui/assets/{realm-unhandled-rejections-DPdMua_J.js → realm-unhandled-rejections-MrwKDgWm.js} +1 -1
  73. package/dist/ui/assets/{remote-terminal-view-C2wMSpEe.js → remote-terminal-view-C-PC19Ea.js} +2 -2
  74. package/dist/ui/assets/{restore-CCE9hWjk.js → restore-DYffbww6.js} +1 -1
  75. package/dist/ui/assets/{run-CR8GP7WW.js → run-B8TlLxCf.js} +1 -1
  76. package/dist/ui/assets/{run-COj_qH-e.js → run-BEetCSTE.js} +1 -1
  77. package/dist/ui/assets/{run-0_GPFYFj.js → run-CGnGcYWM.js} +2 -2
  78. package/dist/ui/assets/{run-f2G7tKwU.js → run-CxNqD-uc.js} +2 -2
  79. package/dist/ui/assets/{run-B-ZcNp7l.js → run-DybeSTUb.js} +2 -2
  80. package/dist/ui/assets/{run-CidpcrZZ.js → run-EvVln7hh.js} +2 -2
  81. package/dist/ui/assets/{serve-command-B8765qRW.js → serve-command-B8D2hyZi.js} +2 -2
  82. package/dist/ui/assets/{serve-runtime-CNQuxT8u.js → serve-runtime-CITAfwSf.js} +1 -1
  83. package/dist/ui/assets/{session-command-memory-DeIgjYsl.js → session-command-memory-B9E-G2JW.js} +2 -2
  84. package/dist/ui/assets/{session-jsonl-Bx5djUku.js → session-jsonl-DT985qCt.js} +1 -1
  85. package/dist/ui/assets/{session-search-index-BQ0TMpQY.js → session-search-index-CbbCCPP0.js} +1 -1
  86. package/dist/ui/assets/{setup-feature-flags-remote-DrcqWLH-.js → setup-feature-flags-remote-DAxhIJE1.js} +1 -1
  87. package/dist/ui/assets/{setup-model-catalog-DP5P4C3Z.js → setup-model-catalog-DLFj0-uU.js} +1 -1
  88. package/dist/ui/assets/{silent-renew-backoff-CAXHQUI1.js → silent-renew-backoff-BFFeKA_b.js} +1 -1
  89. package/dist/ui/assets/slicc-version-Dsikwc4L.js +1 -0
  90. package/dist/ui/assets/{soundscape-CXL-ACwN.js → soundscape-F9imCH6i.js} +1 -1
  91. package/dist/ui/assets/{speak-y1pUMbi_.js → speak-Cde7daoP.js} +1 -1
  92. package/dist/ui/assets/{sprinkle-manager-Dx8QsQ__.js → sprinkle-manager-BE4INv70.js} +1 -1
  93. package/dist/ui/assets/{sprinkle-renderer-BBVfvnoS.js → sprinkle-renderer-BHHPI0nm.js} +1 -1
  94. package/dist/ui/assets/src-CuoyJkC_.js +589 -0
  95. package/dist/ui/assets/{ssh-D7jgbIpr.js → ssh-CWsofZan.js} +1 -1
  96. package/dist/ui/assets/{sudo-CNPuIoQR.js → sudo-BIgM8fvU.js} +1 -1
  97. package/dist/ui/assets/{supervisor-CtMY2xsm.js → supervisor-BNhYE4U7.js} +1 -1
  98. package/dist/ui/assets/{sync-dialog-BI955PU-.js → sync-dialog-BdgPQ67J.js} +1 -1
  99. package/dist/ui/assets/{transformers-env-D4DUK5el.js → transformers-env-B_IUlLgN.js} +1 -1
  100. package/dist/ui/assets/{tray-leader-CJD7P-WS.js → tray-leader-FiaVulXn.js} +1 -1
  101. package/dist/ui/assets/{tray-leave-runtime-DuTYhYbO.js → tray-leave-runtime-Cjj65KW1.js} +1 -1
  102. package/dist/ui/assets/{tray-sidecar-C8ve-Nw8.js → tray-sidecar-CHsrTBaC.js} +1 -1
  103. package/dist/ui/assets/{upgrade-detection-ByWhh6Zo.js → upgrade-detection-CwN7vZBE.js} +1 -1
  104. package/dist/ui/assets/{upgrade-to-seven-C6zBpYgO.js → upgrade-to-seven-Dbx7sOwB.js} +1 -1
  105. package/dist/ui/assets/{voice-reply-COEfpHYp.js → voice-reply-CJdjma1O.js} +1 -1
  106. package/dist/ui/assets/{wc-attach-amEbsnwd.js → wc-attach-0B0Ux1U0.js} +2 -2
  107. package/dist/ui/assets/{wc-browser-UiFVuCJA.js → wc-browser-BdzVV2D3.js} +1 -1
  108. package/dist/ui/assets/{wc-computers-DY_ixJFc.js → wc-computers-lJ9JukEw.js} +1 -1
  109. package/dist/ui/assets/{wc-detached-D0XtEPHf.js → wc-detached-CxGtASJd.js} +1 -1
  110. package/dist/ui/assets/{wc-extension-C8JUduQN.js → wc-extension-DGqrgtYn.js} +2 -2
  111. package/dist/ui/assets/{wc-follower-SOjc8jBc.js → wc-follower-BSxRBMkV.js} +3 -3
  112. package/dist/ui/assets/{wc-follower-oauth-DgtpX_ff.js → wc-follower-oauth-DS61knqk.js} +1 -1
  113. package/dist/ui/assets/{wc-gelatiere-BcV_pjcY.js → wc-gelatiere-B_405RUs.js} +1 -1
  114. package/dist/ui/assets/{wc-live-Cnf2K-dw.js → wc-live-C_bpkZda.js} +5 -5
  115. package/dist/ui/assets/{wc-nav-DAjXvBdM.js → wc-nav-C5odUfR9.js} +2 -2
  116. package/dist/ui/assets/{wc-onboarding-gNubI-ny.js → wc-onboarding-Cwlc4E6D.js} +2 -2
  117. package/dist/ui/assets/{wc-permissions-BImN2uI_.js → wc-permissions-D9GQzuNZ.js} +2 -2
  118. package/dist/ui/assets/{wc-placeholder-BeD2fAxV.js → wc-placeholder-D6vwO4Ty.js} +2 -2
  119. package/dist/ui/assets/{wc-profile-export-Bq0GTftE.js → wc-profile-export-CQzOGfwp.js} +3 -3
  120. package/dist/ui/assets/{wc-secret-request-Buh8hWoU.js → wc-secret-request-BaQLLIcX.js} +1 -1
  121. package/dist/ui/assets/{wc-settings-Bc00yWok.js → wc-settings-ikfko2g_.js} +3 -3
  122. package/dist/ui/assets/{wc-shell-CYTmrD9a.js → wc-shell-BElc8Rz-.js} +3 -3
  123. package/dist/ui/assets/{wc-shortcut-config-Bu3J31Wa.js → wc-shortcut-config-CzvdvUCQ.js} +1 -1
  124. package/dist/ui/assets/{wc-sprinkles-B20bnDX0.js → wc-sprinkles-B6JVOIlW.js} +2 -2
  125. package/dist/ui/assets/{wc-transcript-export-D7JEcoC_.js → wc-transcript-export-DZs7KnzN.js} +2 -2
  126. package/dist/ui/assets/{wc-tray-Dquvfnn9.js → wc-tray-RcNgGI_g.js} +4 -4
  127. package/dist/ui/assets/{welcome-detection-CySzMHmZ.js → welcome-detection-DG7h-lE5.js} +1 -1
  128. package/dist/ui/assets/{whisper-session-3gk4JYRv.js → whisper-session-gDGQdpi6.js} +2 -2
  129. package/dist/ui/assets/{xai-grok-Dc42Hd-i.js → xai-grok-BdTfTYgT.js} +1 -1
  130. package/dist/ui/assets/{xai-grok-C5tAf6n_.js → xai-grok-CR5yYqkh.js} +1 -1
  131. package/dist/ui/index.html +3 -3
  132. package/dist/ui/llm-proxy-sw.js +1 -1
  133. package/dist/ui/packages/webapp/index.html +3 -3
  134. package/dist/ui/packages/webapp/upgrade-to-seven.html +1 -1
  135. package/dist/ui/upgrade-to-seven.html +1 -1
  136. package/package.json +4 -4
  137. package/dist/ui/assets/adobe-9SpYFipV.js +0 -2
  138. package/dist/ui/assets/adobe-gPGCITtY.js +0 -1
  139. package/dist/ui/assets/provider-store-access-CTqs0In3.js +0 -1
  140. package/dist/ui/assets/slicc-version-CTDTFl1_.js +0 -1
  141. package/dist/ui/assets/src-Df5xrYjI.js +0 -589
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-BNaE-Ejt.js";import{t}from"./__vite-browser-external-BgBiNJg0.js";import{r as n,t as r}from"./multipart-form-data-3HUetSRI.js";import{n as i}from"./slicc-version-CTDTFl1_.js";import{t as a}from"./src-RA_OX75a.js";import{t as o}from"./buffer-nxyI8h4F.js";import"./buffer-polyfill-BY2Nyxa2.js";import{i as s,n as c,r as l,t as u}from"./node-builtins-C5MnMa2-.js";import{c as d,n as f,o as p,t as m}from"./require-guards-C_oYAtki.js";import{t as h}from"./tmpdir-env-ate4iNcK.js";import{h as g}from"./kernel-worker-C4JX2Lhc.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./realm-sync-transport-pym2kSgT.js";import{t as C}from"./realm-browser-fetch-V3uggGbM.js";function w(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(/* @__PURE__ */ 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(/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`),{code:`ERR_INVALID_FILE_URL_PATH`});return decodeURIComponent(n.pathname)}function T(e){let t=e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return new URL(`file://${t}`)}const E={URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams,fileURLToPath:w,pathToFileURL:T};function D(e,t){return Object.assign(/* @__PURE__ */ 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 O(e){return typeof e==`object`&&!!e&&typeof e.href==`string`&&typeof e.protocol==`string`}function k(e,t=`path`){if(typeof e==`string`)return e;if(O(e)){if(e.protocol!==`file:`)throw Object.assign(/* @__PURE__ */ TypeError(`The URL must be of scheme file`),{code:`ERR_INVALID_URL_SCHEME`});return E.fileURLToPath(e.href)}if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw D(t,e)}function ee(e,t){let n=[...t];switch(e){case`path`:n[0]=k(n[0]);break;case`fd`:typeof n[0]!=`number`&&(n[0]=k(n[0]));break;case`pair`:n[0]=k(n[0],`src`),n[1]=k(n[1],`dest`);break;case`second`:n[1]=k(n[1])}return n}function A(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=ee(a,t)}catch(e){if(n.promises)return Promise.reject(e);throw e}return o.apply(e,r)}))}}function te(e){let t=!!e.isDirectory,n=e.mtimeMs??0;return{isFile:()=>!!e.isFile,isDirectory:()=>t,isSymbolicLink:()=>!!e.isSymbolicLink,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:e.size??0,mode:e.mode??(t?16877:33188),mtimeMs:n,mtime:new Date(n)}}const ne=/* @__PURE__ */ new Set([`stat`,`lstat`]);function re(e){if(e.length===0)return e;if(e.length===1||e[1]===void 0)return[e[0],null];let t=e[1];return typeof t==`object`&&t&&!ArrayBuffer.isView(t)&&t.encoding===void 0?[e[0],{...t,encoding:null}]:e}function ie(e){if(e instanceof Error&&e.code===void 0){let t=/^(E[A-Z]+)\b/.exec(e.message)?.[1];t&&Object.assign(e,{code:t})}return e}function ae(e,t){return ne.has(e)?te(t):t}function oe(e,t,n,r){let i=e===`readFile`?re(r):r;return t.apply(n,i)}function se(e){let t={};for(let[n,r]of Object.entries(e))n!==`promises`&&(t[n]=typeof r==`function`?async(...t)=>{try{return ae(n,await oe(n,r,e,t))}catch(e){throw ie(e)}}:r);return t}function ce(e){let t=e;for(let[e,n]of Object.entries(t))e!==`promises`&&typeof n==`function`&&(t[e]=function(...t){let r=t[t.length-1];if(typeof r!=`function`)return n.apply(this,t);t.pop();let i;try{i=Promise.resolve(oe(e,n,this,t))}catch(e){i=Promise.reject(e)}i.then(t=>e===`exists`?r(t):r(null,ae(e,t)),t=>r(e!==`exists`&&ie(t)))})}function le(e,t){return Object.assign(/* @__PURE__ */ Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function ue(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function de(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function fe(){return{readSync:e=>{throw le(`read`,e)},writeSync:e=>{throw le(`write`,e)}}}function pe(e){let t=0;return{readSync(n,r,i,a){if(n!==0)throw le(`read`,n);let o=ue(r),s=typeof i==`object`&&i?i:{offset:i,length:a},c=s.offset??0,l=s.length??o.length-c,u=e.readStdinBytes(),d=Math.max(0,Math.min(l,u.length-t));return o.set(u.subarray(t,t+d),c),t+=d,d},writeSync(t,n,r,i){let a=t===1?e.writeStdout:t===2?e.writeStderr:void 0;if(!a)throw le(`write`,t);if(typeof n==`string`)return a(n),new TextEncoder().encode(n).length;if(!ArrayBuffer.isView(n))throw TypeError(`writeSync: data must be a string or buffer`);let o=ue(n),s=typeof r==`number`?r:0,c=o.subarray(s,i===void 0?void 0:s+i);return a(de(c)),c.length}}}function j(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 me(e){let t=j(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function M(e){return Object.assign(/* @__PURE__ */ Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function he(e){return Object.assign(/* @__PURE__ */ Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function ge(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 _e=class{tree=/* @__PURE__ */ new Map;initialPaths=/* @__PURE__ */ new Set;initialContent=/* @__PURE__ */ new Map;initialKind=/* @__PURE__ */ new Map;mkdtempCounter=0;tombstones=/* @__PURE__ */ new Set;removedDirs=/* @__PURE__ */ new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=/* @__PURE__ */ new Map,this.tombstones=/* @__PURE__ */ new Set,this.removedDirs=/* @__PURE__ */ new Set,this.initialPaths=/* @__PURE__ */ new Set,this.initialContent=/* @__PURE__ */ new Map,this.initialKind=/* @__PURE__ */ new Map,this.tree.set(`/`,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=j(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size,...t.partial?{partial:!0}:{}}),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=me(j(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=me(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=/* @__PURE__ */ new Set,this.initialContent=/* @__PURE__ */ new Map,this.initialKind=/* @__PURE__ */ 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=j(e),r=n.split(`/`).filter(Boolean),i=[],a=/* @__PURE__ */ 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(/* @__PURE__ */ Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...j(e.startsWith(`/`)?e:`${me(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[]}else{if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}}ensureParentDirs(e){let t=me(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(j(e))?.partial===!0}hasPartialWithin(e){let t=j(e),n=t===`/`?`/`:`${t}/`;for(let[e,r]of this.tree)if(r.partial&&(e===t||e.startsWith(n)))return!0;return!1}commitWrite(e,t){this.writeFile(e,t);let n=j(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=me(n)}}readFile(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw M(t);if(n.truncated)throw he(t);return n.content}writeFile(e,t){this.touched=!0;let n=j(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=j(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t);if(!n)throw M(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t,!0);if(!n)throw M(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=j(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw M(t);let r=n.path===`/`?`/`:n.path+`/`,i=/* @__PURE__ */ 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=j(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(/* @__PURE__ */ Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=me(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw M(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=j(e),r=this.tree.get(n);if(!r)throw M(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(/* @__PURE__ */ 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=j(e),r=this.tree.get(n);if(!r||r.isDirectory)throw M(n);if(r.truncated)throw he(n);let i=j(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=j(e),r=this.tree.get(n);if(!r)throw M(n);let i=j(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)}else 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=j(e),n=this.tree.get(t);if(!n)throw M(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(/* @__PURE__ */ 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=j(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=j(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=j(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});else if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!ge(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 ve(){return globalThis.Buffer}function ye(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function be(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function xe(e,t){return Object.assign(/* @__PURE__ */ 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 we(e,t){let n=Ce(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw xe(t,e);return!1}function Te(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 xe(n,t)}function Ee(e){return typeof e==`string`?e:be(We(e))}function De(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=ve();return n?n.from(e):e}function Oe(e){return e===null?null:typeof e==`string`?e:e?.encoding}function ke(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function Ae(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(!we(e,`read`))return n.readFile(e,r);let i=Oe(r);if(i===null||i===`buffer`){let e=ve(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>we(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=Te(t,e,`write`);return i?(i(Ee(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=Te(t,e,`write`);return i?(i(be(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=Te(t,e,`append`);if(!i)return n.appendFile(e,r);i(Ee(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 je(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=Oe(n);if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=ve();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){typeof n==`string`?await e.call(`vfs`,`appendFile`,[t,n]):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(/* @__PURE__ */ 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 Ae(p,n),A(p,Me,{promises:!0}),p.promises=se(p),ce(p),p}const Me={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`},Ne={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`,utimesSync:`path`,mkdtempSync:`path`,rmSync:`path`,rmdirSync:`path`,unlinkSync:`path`,renameSync:`pair`};function N(e,t,n=``){return Object.assign(/* @__PURE__ */ Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function Pe(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 Fe(e,t,n){let r=t;if(r?.rename&&r.rmdir&&r.rm&&e.hasPartialWithin(n))return r}function Ie(e,t,n){b(e,t);try{n()}finally{e.invalidate()}}function Le(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>{let i=r?.requireFile?void 0:Fe(t,n,e);return i?(Ie(t,i,()=>r?.recursive?i.rm(e):i.rmdir(e)),!0):Pe(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 N(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw N(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw N(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw N(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i),d=Fe(t,n,a);if(d)Ie(t,d,()=>d.rename(a,l));else{try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw N(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw N(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw N(`ENOENT`,a,`rename`)}}}}function Re(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)=>we(e,`read`)?De(t.readStdinBytes(),Oe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=Te(t,e,`write`);i?i(Ee(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=Te(t,e,`append`);i?i(Ee(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)?ke():n.statSync(e),e.lstatSync=e=>Se(e)?ke():n.lstatSync(e),Object.assign(e,pe(t))}function ze(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 Be(e,t){if(e instanceof Date)return e.getTime();if(typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)))return Number(e)*1e3;if(typeof e==`number`){if(!Number.isFinite(e))throw Object.assign(/* @__PURE__ */ TypeError(`The "${t}" argument must be of type number, string or Date`),{code:`ERR_INVALID_ARG_TYPE`});return e<0?Date.now():e*1e3}throw Object.assign(/* @__PURE__ */ TypeError(`The "${t}" argument must be of type number, string or Date`),{code:`ERR_INVALID_ARG_TYPE`})}function Ve(e,t,n,r,i){let a=e?.utimes;if(e&&typeof a==`function`&&!t.isTombstoned(n))try{a.call(e,n,r,i)}catch(e){let r=e?.code;if(r===`ENOSYS`||r===`ENOENT`&&t.exists(n))return;throw e}}function He(e,t,n,r){return{chmodSync(n){let r=e(n);if(!t(r))throw N(`ENOENT`,r,`chmod`)},utimesSync(i,a,o){let s=Be(a,`atime`),c=Be(o,`mtime`),l=e(i);if(!t(l))throw N(`ENOENT`,l,`utime`);Ve(n,r,l,s,c)}}}function Ue(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 ze(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 ze(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 Ge(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ke(e,t,n,r,i){function a(e){return j(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)=>Ge(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));else{e.mkdir(r,!0);for(let i of Ue(e,n,t))p(f(t,i),f(r,i))}}let m={...Le({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return De(o(a(e)),Oe(t))},writeFileSync(e,t){s(a(e),We(t))},appendFileSync(e,t){let n=a(e),r=/* @__PURE__ */ 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 N(`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 N(`ENOENT`,t,`realpath`);return t},readdirSync(t){return Ue(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},...He(a,c,n,e),mkdtempSync(t){return e.mkdtemp(a(t))}},h=Object.assign(m,fe());Re(h,r),A(h,Ne);let g=h.existsSync;return h.existsSync=e=>{try{return g(e)}catch{return!1}},h}var qe=class{_events=/* @__PURE__ */ 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 Je=Object.assign(qe,{EventEmitter:qe,default:qe});function Ye(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(`
1
+ import{t as e}from"./rolldown-runtime-BNaE-Ejt.js";import{t}from"./__vite-browser-external-BgBiNJg0.js";import{r as n,t as r}from"./multipart-form-data-3HUetSRI.js";import{n as i}from"./slicc-version-Dsikwc4L.js";import{t as a}from"./src-RA_OX75a.js";import{t as o}from"./buffer-nxyI8h4F.js";import"./buffer-polyfill-BY2Nyxa2.js";import{i as s,n as c,r as l,t as u}from"./node-builtins-C5MnMa2-.js";import{c as d,n as f,o as p,t as m}from"./require-guards-C_oYAtki.js";import{t as h}from"./tmpdir-env-ate4iNcK.js";import{h as g}from"./kernel-worker-Bh8mq5dQ.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./realm-sync-transport-pym2kSgT.js";import{t as C}from"./realm-browser-fetch-V3uggGbM.js";function w(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(/* @__PURE__ */ 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(/* @__PURE__ */ TypeError(`File URL path must not include encoded / characters`),{code:`ERR_INVALID_FILE_URL_PATH`});return decodeURIComponent(n.pathname)}function T(e){let t=e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`);return new URL(`file://${t}`)}const E={URL:globalThis.URL,URLSearchParams:globalThis.URLSearchParams,fileURLToPath:w,pathToFileURL:T};function D(e,t){return Object.assign(/* @__PURE__ */ 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 O(e){return typeof e==`object`&&!!e&&typeof e.href==`string`&&typeof e.protocol==`string`}function k(e,t=`path`){if(typeof e==`string`)return e;if(O(e)){if(e.protocol!==`file:`)throw Object.assign(/* @__PURE__ */ TypeError(`The URL must be of scheme file`),{code:`ERR_INVALID_URL_SCHEME`});return E.fileURLToPath(e.href)}if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw D(t,e)}function ee(e,t){let n=[...t];switch(e){case`path`:n[0]=k(n[0]);break;case`fd`:typeof n[0]!=`number`&&(n[0]=k(n[0]));break;case`pair`:n[0]=k(n[0],`src`),n[1]=k(n[1],`dest`);break;case`second`:n[1]=k(n[1])}return n}function A(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=ee(a,t)}catch(e){if(n.promises)return Promise.reject(e);throw e}return o.apply(e,r)}))}}function te(e){let t=!!e.isDirectory,n=e.mtimeMs??0;return{isFile:()=>!!e.isFile,isDirectory:()=>t,isSymbolicLink:()=>!!e.isSymbolicLink,isBlockDevice:()=>!1,isCharacterDevice:()=>!1,isFIFO:()=>!1,isSocket:()=>!1,size:e.size??0,mode:e.mode??(t?16877:33188),mtimeMs:n,mtime:new Date(n)}}const ne=/* @__PURE__ */ new Set([`stat`,`lstat`]);function re(e){if(e.length===0)return e;if(e.length===1||e[1]===void 0)return[e[0],null];let t=e[1];return typeof t==`object`&&t&&!ArrayBuffer.isView(t)&&t.encoding===void 0?[e[0],{...t,encoding:null}]:e}function ie(e){if(e instanceof Error&&e.code===void 0){let t=/^(E[A-Z]+)\b/.exec(e.message)?.[1];t&&Object.assign(e,{code:t})}return e}function ae(e,t){return ne.has(e)?te(t):t}function oe(e,t,n,r){let i=e===`readFile`?re(r):r;return t.apply(n,i)}function se(e){let t={};for(let[n,r]of Object.entries(e))n!==`promises`&&(t[n]=typeof r==`function`?async(...t)=>{try{return ae(n,await oe(n,r,e,t))}catch(e){throw ie(e)}}:r);return t}function ce(e){let t=e;for(let[e,n]of Object.entries(t))e!==`promises`&&typeof n==`function`&&(t[e]=function(...t){let r=t[t.length-1];if(typeof r!=`function`)return n.apply(this,t);t.pop();let i;try{i=Promise.resolve(oe(e,n,this,t))}catch(e){i=Promise.reject(e)}i.then(t=>e===`exists`?r(t):r(null,ae(e,t)),t=>r(e!==`exists`&&ie(t)))})}function le(e,t){return Object.assign(/* @__PURE__ */ Error(`EBADF: bad file descriptor, ${e} ${String(t)}`),{code:`EBADF`})}function ue(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function de(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function fe(){return{readSync:e=>{throw le(`read`,e)},writeSync:e=>{throw le(`write`,e)}}}function pe(e){let t=0;return{readSync(n,r,i,a){if(n!==0)throw le(`read`,n);let o=ue(r),s=typeof i==`object`&&i?i:{offset:i,length:a},c=s.offset??0,l=s.length??o.length-c,u=e.readStdinBytes(),d=Math.max(0,Math.min(l,u.length-t));return o.set(u.subarray(t,t+d),c),t+=d,d},writeSync(t,n,r,i){let a=t===1?e.writeStdout:t===2?e.writeStderr:void 0;if(!a)throw le(`write`,t);if(typeof n==`string`)return a(n),new TextEncoder().encode(n).length;if(!ArrayBuffer.isView(n))throw TypeError(`writeSync: data must be a string or buffer`);let o=ue(n),s=typeof r==`number`?r:0,c=o.subarray(s,i===void 0?void 0:s+i);return a(de(c)),c.length}}}function j(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 me(e){let t=j(e);if(t===`/`)return`/`;let n=t.lastIndexOf(`/`);return n===0?`/`:t.slice(0,n)}function M(e){return Object.assign(/* @__PURE__ */ Error(`ENOENT: no such file or directory, '${e}'`),{code:`ENOENT`})}function he(e){return Object.assign(/* @__PURE__ */ Error(`ENOSYNC: file too large for sync access, '${e}' — use async readFile() instead`),{code:`ENOSYNC`})}function ge(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 _e=class{tree=/* @__PURE__ */ new Map;initialPaths=/* @__PURE__ */ new Set;initialContent=/* @__PURE__ */ new Map;initialKind=/* @__PURE__ */ new Map;mkdtempCounter=0;tombstones=/* @__PURE__ */ new Set;removedDirs=/* @__PURE__ */ new Set;touched=!1;constructor(e){this.loadSnapshot(e)}loadSnapshot(e){this.tree=/* @__PURE__ */ new Map,this.tombstones=/* @__PURE__ */ new Set,this.removedDirs=/* @__PURE__ */ new Set,this.initialPaths=/* @__PURE__ */ new Set,this.initialContent=/* @__PURE__ */ new Map,this.initialKind=/* @__PURE__ */ new Map,this.tree.set(`/`,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0}),this.initialPaths.add(`/`),this.initialKind.set(`/`,`directory`);for(let t of e.entries){let e=j(t.path);this.tree.set(e,{content:t.content,isDirectory:t.isDirectory,isSymbolicLink:t.isSymbolicLink,symlinkTarget:t.symlinkTarget,truncated:t.truncated,size:t.size,...t.partial?{partial:!0}:{}}),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=me(j(t.path));for(;e!==`/`&&!this.tree.has(e);)this.tree.set(e,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0}),this.initialPaths.add(e),this.initialKind.set(e,`directory`),e=me(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=/* @__PURE__ */ new Set,this.initialContent=/* @__PURE__ */ new Map,this.initialKind=/* @__PURE__ */ 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=j(e),r=n.split(`/`).filter(Boolean),i=[],a=/* @__PURE__ */ 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(/* @__PURE__ */ Error(`ELOOP: too many symbolic links, '${n}'`),{code:`ELOOP`});a.add(s);let e=c.symlinkTarget??``;r=[...j(e.startsWith(`/`)?e:`${me(s)}/${e}`).split(`/`).filter(Boolean),...r],i=[]}else{if(!l&&!c.isDirectory)return;if(i.push(e),l)return{path:s,entry:c}}}}ensureParentDirs(e){let t=me(e);t!==`/`&&(this.tree.has(t)||this.mkdir(t,!0,!0))}isPartial(e){return this.tree.get(j(e))?.partial===!0}hasPartialWithin(e){let t=j(e),n=t===`/`?`/`:`${t}/`;for(let[e,r]of this.tree)if(r.partial&&(e===t||e.startsWith(n)))return!0;return!1}commitWrite(e,t){this.writeFile(e,t);let n=j(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=me(n)}}readFile(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t)?.entry;if(!n||n.isDirectory)throw M(t);if(n.truncated)throw he(t);return n.content}writeFile(e,t){this.touched=!0;let n=j(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=j(e);return this.tree.has(t)}stat(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t);if(!n)throw M(t);return this.toStat(n.entry)}lstat(e){this.touched=!0;let t=j(e),n=this.resolveEntry(t,!0);if(!n)throw M(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=j(e),n=this.resolveEntry(t);if(!n?.entry.isDirectory)throw M(t);let r=n.path===`/`?`/`:n.path+`/`,i=/* @__PURE__ */ 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=j(e);if(this.tree.has(r)){if(this.tree.get(r).isDirectory)return;throw Object.assign(/* @__PURE__ */ Error(`EEXIST: file already exists, '${r}'`),{code:`EEXIST`})}let i=me(r);if(i!==`/`&&!this.tree.has(i)){if(!t)throw M(r);this.mkdir(i,!0,n)}this.tree.set(r,{content:/* @__PURE__ */ new Uint8Array,isDirectory:!0,...n?{partial:!0}:{}}),this.tombstones.delete(r),this.removedDirs.delete(r)}rm(e,t){this.touched=!0;let n=j(e),r=this.tree.get(n);if(!r)throw M(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(/* @__PURE__ */ 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=j(e),r=this.tree.get(n);if(!r||r.isDirectory)throw M(n);if(r.truncated)throw he(n);let i=j(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=j(e),r=this.tree.get(n);if(!r)throw M(n);let i=j(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)}else 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=j(e),n=this.tree.get(t);if(!n)throw M(t);if(n.isDirectory&&!n.isSymbolicLink)throw Object.assign(/* @__PURE__ */ 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=j(e);this.tombstones.add(n),t&&this.removedDirs.add(n)}isTombstoned(e){let t=j(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=j(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});else if(!i.isDirectory&&!i.isSymbolicLink){let e=this.initialContent.get(r);e&&!ge(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 ve(){return globalThis.Buffer}function ye(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t}function be(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return t}function xe(e,t){return Object.assign(/* @__PURE__ */ 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 we(e,t){let n=Ce(e);if(n===0)return!0;if(n!==void 0||typeof e==`number`)throw xe(t,e);return!1}function Te(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 xe(n,t)}function Ee(e){return typeof e==`string`?e:be(We(e))}function De(e,t){if(t===`utf8`||t===`utf-8`)return new TextDecoder().decode(e);let n=ve();return n?n.from(e):e}function Oe(e){return e===null?null:typeof e==`string`?e:e?.encoding}function ke(){return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,isCharacterDevice:()=>!0,size:0}}function Ae(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(!we(e,`read`))return n.readFile(e,r);let i=Oe(r);if(i===null||i===`buffer`){let e=ve(),n=t.readStdinBytes();return e?e.from(n):n}return new TextDecoder().decode(t.readStdinBytes())},e.readFileBinary=async e=>we(e,`read`)?t.readStdinBytes():n.readFileBinary(e),e.writeFile=async(e,r)=>{let i=Te(t,e,`write`);return i?(i(Ee(r)),!0):n.writeFile(e,r)},e.writeFileBinary=async(e,r)=>{let i=Te(t,e,`write`);return i?(i(be(r)),!0):n.writeFileBinary(e,r)},e.appendFile=async(e,r)=>{let i=Te(t,e,`append`);if(!i)return n.appendFile(e,r);i(Ee(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 je(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=Oe(n);if(r===null||r===`buffer`){let n=await e.call(`vfs`,`readFileBinary`,[t]),r=ve();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){typeof n==`string`?await e.call(`vfs`,`appendFile`,[t,n]):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(/* @__PURE__ */ 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 Ae(p,n),A(p,Me,{promises:!0}),p.promises=se(p),ce(p),p}const Me={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`},Ne={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`,utimesSync:`path`,mkdtempSync:`path`,rmSync:`path`,rmdirSync:`path`,unlinkSync:`path`,renameSync:`pair`};function N(e,t,n=``){return Object.assign(/* @__PURE__ */ Error(`${e}: sync-fs, ${n?`${n} `:``}'${t}'`),{code:e})}function Pe(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 Fe(e,t,n){let r=t;if(r?.rename&&r.rmdir&&r.rm&&e.hasPartialWithin(n))return r}function Ie(e,t,n){b(e,t);try{n()}finally{e.invalidate()}}function Le(e){let{syncFs:t,bridge:n,resolve:r,existsResolved:i,lstatResolved:a,statResolved:o,readBytes:s,writeThrough:c,persistDelete:l}=e,u=(e,r)=>{let i=r?.requireFile?void 0:Fe(t,n,e);return i?(Ie(t,i,()=>r?.recursive?i.rm(e):i.rmdir(e)),!0):Pe(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 N(`ENOENT`,n,`rm`)},rmdirSync(e,t){let n=r(e);if(i(n)&&!a(n).isDirectory)throw N(`ENOTDIR`,n,`rmdir`);if(!u(n,{recursive:t?.recursive===!0}))throw N(`ENOENT`,n,`rmdir`)},unlinkSync(e){let t=r(e);if(!u(t,{requireFile:!0}))throw N(`ENOENT`,t,`unlink`)},renameSync(e,i){let a=r(e),l=r(i),d=Fe(t,n,a);if(d)Ie(t,d,()=>d.rename(a,l));else{try{t.rename(a,l);return}catch(e){if(e?.code!==`ENOENT`)throw e}if(!n||t.isTombstoned(a))throw N(`ENOENT`,a,`rename`);if(o(a).isDirectory)throw N(`EISDIR`,a,`rename`);if(c(l,s(a)),!u(a,{requireFile:!0}))throw N(`ENOENT`,a,`rename`)}}}}function Re(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)=>we(e,`read`)?De(t.readStdinBytes(),Oe(r)):n.readFileSync(e,r),e.writeFileSync=(e,r)=>{let i=Te(t,e,`write`);i?i(Ee(r)):n.writeFileSync(e,r)},e.appendFileSync=(e,r)=>{let i=Te(t,e,`append`);i?i(Ee(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)?ke():n.statSync(e),e.lstatSync=e=>Se(e)?ke():n.lstatSync(e),Object.assign(e,pe(t))}function ze(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 Be(e,t){if(e instanceof Date)return e.getTime();if(typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)))return Number(e)*1e3;if(typeof e==`number`){if(!Number.isFinite(e))throw Object.assign(/* @__PURE__ */ TypeError(`The "${t}" argument must be of type number, string or Date`),{code:`ERR_INVALID_ARG_TYPE`});return e<0?Date.now():e*1e3}throw Object.assign(/* @__PURE__ */ TypeError(`The "${t}" argument must be of type number, string or Date`),{code:`ERR_INVALID_ARG_TYPE`})}function Ve(e,t,n,r,i){let a=e?.utimes;if(e&&typeof a==`function`&&!t.isTombstoned(n))try{a.call(e,n,r,i)}catch(e){let r=e?.code;if(r===`ENOSYS`||r===`ENOENT`&&t.exists(n))return;throw e}}function He(e,t,n,r){return{chmodSync(n){let r=e(n);if(!t(r))throw N(`ENOENT`,r,`chmod`)},utimesSync(i,a,o){let s=Be(a,`atime`),c=Be(o,`mtime`),l=e(i);if(!t(l))throw N(`ENOENT`,l,`utime`);Ve(n,r,l,s,c)}}}function Ue(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 ze(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 ze(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 Ge(e,t,n,r,i){t?(t.writeFile(r,i),e.commitWrite(r,i)):(e.writeFile(r,i),n?.write?.(r,i))}function Ke(e,t,n,r,i){function a(e){return j(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)=>Ge(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));else{e.mkdir(r,!0);for(let i of Ue(e,n,t))p(f(t,i),f(r,i))}}let m={...Le({syncFs:e,bridge:n,persistDelete:i?.delete,resolve:a,existsResolved:c,statResolved:l,lstatResolved:u,readBytes:o,writeThrough:s}),readFileSync(e,t){return De(o(a(e)),Oe(t))},writeFileSync(e,t){s(a(e),We(t))},appendFileSync(e,t){let n=a(e),r=/* @__PURE__ */ 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 N(`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 N(`ENOENT`,t,`realpath`);return t},readdirSync(t){return Ue(e,n,a(t))},copyFileSync(e,t){s(a(t),o(a(e)))},cpSync(e,t){p(a(e),a(t))},...He(a,c,n,e),mkdtempSync(t){return e.mkdtemp(a(t))}},h=Object.assign(m,fe());Re(h,r),A(h,Ne);let g=h.existsSync;return h.existsSync=e=>{try{return g(e)}catch{return!1}},h}var qe=class{_events=/* @__PURE__ */ 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 Je=Object.assign(qe,{EventEmitter:qe,default:qe});function Ye(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
2
  `)?t:`${t}\n`);else 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
3
  `)?t:`${t}\n`),e.exit(0),Error(`unreachable`)}}}const Xe={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 Ze(e){let t=e.isTTY&&!e.noColor,n=e=>n=>t?`${e}${n}${Xe.reset}`:String(n);return{enabled:t,green:n(Xe.green),red:n(Xe.red),yellow:n(Xe.yellow),gray:n(Xe.gray),bold:n(Xe.bold),cyan:n(Xe.cyan),dim:n(Xe.dim)}}const Qe=/\u001b\[[0-9;]*m/g;function $e(e){return e.replace(Qe,``)}function et(e){return $e(e).length}function tt(e,t){let n=String(e??``);return t<=0?``:et(n)<=t?n:t<=1?n.slice(0,t):`${$e(n).slice(0,t-1)}…`}function nt(e,t){let n=String(e??``),r=et(n);return r===t?n:r>t?tt(n,t):n+` `.repeat(t-r)}function rt(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,et(e))}r[i]=t}return e.map(e=>r.map((t,n)=>nt(n<e.length?String(e[n]??``):``,t)).join(` `).replace(/\s+$/,``)).join(`
4
4
  `)}function it(e){return e instanceof Date?e:new Date(e)}function at(e){return e<10?`0${e}`:String(e)}function ot(e,t=`short`){let n=it(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()}-${at(n.getMonth()+1)}-${at(n.getDate())}`}const st={trunc:tt,col:nt,table:rt,date:ot};var P=class extends Error{actual;expected;operator;generatedMessage;code;constructor(e={}){let t=!e.message;super(e.message||`${ct(e.actual)} ${e.operator||`!=`} ${ct(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 ct(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 lt(e,t,n,r){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!dt(e[i],t[i],n,r))return!1;return!0}function ut(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)||!dt(Reflect.get(e,a),Reflect.get(t,a),n,r))return!1;return!0}function dt(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)?lt(e,t,n,r):ut(i,a,n,r):!1)}function ft(e,t){try{if(e instanceof t)return!0}catch{}try{return!!t(e)}catch{return!1}}function pt(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 mt(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`?ft(e,t):t&&typeof t==`object`?!e||typeof e!=`object`?!1:pt(e,t):!1}function ht(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);else 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);else if(t==n)throw F(r,()=>new P({actual:t,expected:n,operator:`!=`}))},s=(e,t,n)=>{if(!dt(e,t,!0,/* @__PURE__ */ new WeakMap))throw F(n,()=>new P({actual:e,expected:t,operator:`deepStrictEqual`}))},c=(t,n,r)=>{if(e)s(t,n,r);else if(!dt(t,n,!1,/* @__PURE__ */ new WeakMap))throw F(r,()=>new P({actual:t,expected:n,operator:`deepEqual`}))},l=(e,t,n)=>{if(dt(e,t,!0,/* @__PURE__ */ 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);else if(dt(t,n,!1,/* @__PURE__ */ 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)&&!mt(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 gt=ht(!0);gt.strict=gt;const _t=ht(!1);_t.strict=gt;function vt(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 yt=class{_events=/* @__PURE__ */ 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.closeScheduled=!0,queueMicrotask(()=>this.emit(`close`))),this}removeListener(e,t){return this.off(e,t)}removeAllListeners(){return this._events.clear(),this}},bt=class extends yt{read(){return null}destroy(){return this.closeOnDestroy()}},xt=class extends yt{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}destroy(){return this.closeOnDestroy()}},St=class extends yt{write(e,t,n){return n&&queueMicrotask(n),!0}end(e){return e&&queueMicrotask(e),this}read(){return null}destroy(){return this.closeOnDestroy()}};const Ct={Readable:bt,Writable:xt,Transform:St,PassThrough:class extends St{},Stream:yt};function wt(e,t){return Object.assign(TypeError(t),{code:e})}const Tt=e=>e.startsWith(`--`)&&e.length>2,Et=e=>/^-[^-]/.test(e);function Dt(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 Ot(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(Et(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))}else if(Et(e)){let a=n(e[1]);if(c(a))r.push(s(a,`-${e[1]}`,e.slice(2),!0));else{let r=Dt(e,t,n);i.unshift(...r),o=r.length}}else if(Tt(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))}else r.push({kind:`positional`,index:a,value:e})}return r}function kt(e,t){let n=t?.short?`'-${t.short}, --${e.name}'`:`'--${e.name}'`;if(!t)throw wt(`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 wt(`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`,`Option ${n.replace(/'$/,` <value>'`)} argument missing`);if(t.type===`boolean`&&e.value!==void 0)throw wt(`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 wt(`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 At(e,t,n,r){if(!r){e[t]=n;return}let i=e[t];e[t]=Array.isArray(i)?[...i,n]:[n]}function jt(e,t,n){let r=e.slice(3);return n&&e.startsWith(`no-`)?{name:r,negated:!0}:{name:e,negated:!1}}function Mt(e,t,n,r,i){let{name:a,negated:o}=jt(t.name,n,i);t.name=a;let s=n[a];r&&kt(t,o&&s?.type!==`boolean`?void 0:s),At(e,a,o?!1:t.value??!0,s?.multiple===!0)}function Nt(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=Ot(n,r,s);for(let e of u)if(e.kind===`positional`){if(i&&!a)throw wt(`ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL`,`Unexpected argument '${e.value}'. This command does not take positional arguments`);l.push(e.value)}else e.kind===`option`&&Mt(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`),Ft=Symbol.for(`nodejs.util.promisify.custom`);function It(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`)}'`}function Lt(e){if(e===null)return`null`;let t=typeof e;if(t===`string`)return It(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 Rt(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 zt(e,t,n){if(Array.isArray(e))return e.length===0?`[]`:`[ ${e.map(e=>Bt(e,t+1,n)).join(`, `)} ]`;if(e instanceof Map){let r=[...e].map(([e,r])=>`${Bt(e,t+1,n)} => ${Bt(r,t+1,n)}`);return`Map(${e.size}) {${r.length?` ${r.join(`, `)} `:``}}`}if(e instanceof Set){let r=[...e].map(e=>Bt(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:It(r)}: ${Bt(e[r],t+1,n)}`).join(`, `)} }`}function Bt(e,t,n){let r=Lt(e);if(r!==null)return r;let i=e,a=Rt(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 zt(i,t,n)}finally{n.seen.delete(e)}}function Vt(e,t={}){let n=t.depth===void 0?2:t.depth;return Bt(e,0,{seen:/* @__PURE__ */ new Set,maxDepth:n,opts:t})}function Ht(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):Vt(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++,Vt(i,{depth:4});case`%O`:return n.i++,Vt(i,{depth:null});case`%c`:return n.i++,``;default:return e}}function Ut(e,...t){let n=t[0];if(typeof n!=`string`)return t.map(e=>typeof e==`string`?e:Vt(e)).join(` `);let r={i:1},i=n.replace(/%[sdifjoOc%]/g,n=>Ht(n,t,r,e));for(;r.i<t.length;r.i++){let e=t[r.i];i+=` ${typeof e==`string`?e:Vt(e)}`}return i}function Wt(...e){return Ut({},...e)}function Gt(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 Kt(e){if(typeof e!=`function`)throw TypeError(`The "original" argument must be of type function`);let t=e[Ft];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)=>{e?r(e):n(t.length>1?t:t[0])})})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)),n}function qt(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 Jt=Vt;Jt.custom=Pt;const Yt=Kt;Yt.custom=Ft;function Xt(e,t=()=>[]){return{parseArgs:e=>Nt(e,t),format:Wt,formatWithOptions:Ut,inspect:Jt,inherits:Gt,promisify:Yt,deprecate:qt(e)}}const Zt=Xt(()=>{});let Qt=1;function $t(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 en(e,t,n){return Object.assign(/* @__PURE__ */ 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 tn(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))throw en(`options.env`,`object`,e);let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(typeof r!=`string`)throw en(`options.env[${n}]`,`string`,r);t[n]=r}return t}function nn(e){if(e!==void 0){if(typeof e==`string`)return e;if(typeof e==`object`&&e&&typeof e.href==`string`)try{return E.fileURLToPath(e.href)}catch{throw en(`options.cwd`,`string or an instance of URL (file:)`,e)}throw en(`options.cwd`,`string or an instance of URL`,e)}}function rn(e,t){return t===void 0||t===`utf8`||t===`utf-8`?e:t===`buffer`||t===null?vt(e):vt(e).toString(t)}function an(e,t){if(e.length===0)return rn(``,t);if(typeof e[0]==`string`)return e.join(``);let n=globalThis.Buffer;return n?n.concat(e):e[0]}function on(e,t,n){t.length>0&&e.emit(`data`,rn(t,n)),e.readable=!1,e.emit(`end`)}function sn(e){let t=e=>{typeof e==`function`&&queueMicrotask(e)};return{writable:!0,write(n,r,i){return e.stdin.write($t(n)),t(typeof r==`function`?r:i),!0},end(n,r,i){n!==void 0&&typeof n!=`function`&&e.stdin.write($t(n)),e.stdin.end(),this.writable=!1,t(typeof n==`function`?n:typeof r==`function`?r:i)}}}var cn=class extends qe{stdout;stderr;stdin;pid;exitCode=null;signalCode=null;killed=!1;spawnfile;spawnargs;handle;constructor(e,t,n,r){super(),this.handle=e,this.pid=Qt++,this.spawnfile=n,this.spawnargs=r,this.stdout=new bt,this.stderr=new bt,this.stdin=sn(e),e.done.then(e=>this.finish(e,t),e=>this.emit(`error`,e instanceof Error?e:Error(String(e))))}finish(e,t){on(this.stdout,e.stdout,t),on(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 ln(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=nn(e.cwd),n=tn(e.env);return{...e.input===void 0?{}:{input:$t(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=rn(s.stdout,o),l=rn(s.stderr,o);if(s.exitCode===0)return c;throw Object.assign(/* @__PURE__ */ Error(`Command failed: ${i}\n${s.stderr}`),{status:s.exitCode,signal:null,stdout:c,stderr:l,output:[null,c,l],pid:Qt++})},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=Qt++,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=rn(``,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=rn(d.stdout,c),p=rn(d.stderr,c);return{pid:l,status:d.exitCode,signal:null,stdout:f,stderr:p,output:[null,f,p]}}}}function un(e,t){let n=(t,n,r,i,a)=>{let o=nn(n.cwd),s=tn(n.env),c={...o===void 0?{}:{cwd:o},...s===void 0?{}:{env:s}},l=e.start(t,c),u=new cn(l,r,i,a);return n.input!==void 0&&u.stdin.write($t(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,an(i,t),an(a,t))),e.once(`close`,(o,s)=>{let c=an(i,t),l=an(a,t);r(o===0?null:Object.assign(/* @__PURE__ */ Error(`Command failed: ${n}\n${$t(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)=>{e?r(Object.assign(e,{stdout:t,stderr:i})):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)=>{e?i(Object.assign(e,{stdout:t,stderr:n})):r({stdout:t,stderr:n})})}),l=e=>()=>{throw Error(`child_process.${e} is not available in the browser realm`)},u=ln(t),d=(e,t)=>{Object.defineProperty(e,Ft,{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:cn}}function dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var fn={exports:{}};
@@ -30,7 +30,7 @@ a&&(r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!h)&&(h=function(e){return typeof e==`obje
30
30
  `,cpus:()=>[{model:`virtual`,speed:0}],hostname:()=>`slicc`,type:()=>`Linux`,release:()=>`0.0.0`};function Zn(e){return{...Xn,tmpdir:()=>h(e),homedir:()=>e?.HOME?.trim()?e.HOME:`/home/user`}}const Qn=Zn(),$n={isatty:e=>!1,ReadStream:class{},WriteStream:class{}},er=/* @__PURE__ */ new WeakMap;let tr=/* @__PURE__ */ new Set,nr=null;const rr=/\bfunction\s*\*?\s*([A-Za-z_$][\w$]*)\s*\(/g,ir=/\b(?:const|let|class)\s+([A-Za-z_$][\w$]*)/g,ar=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 or(e,t){return[...new Set([...e.matchAll(t)].map(e=>e[1]))].filter(e=>!ar.has(e))}function sr(e){return e.length===0?``:`\n;let __vm_lexcap = (__vm_out.lex = () => ({ ${e.join(`, `)} }));`}function cr(){return nr??=Function(`__vm_scope`,`__vm_code`,`__vm_fns`,`__vm_out`,`with (__vm_scope) { __vm_out.value = eval(__vm_code); }
31
31
  for (var __vm_i = 0; __vm_i < __vm_fns.length; __vm_i++) {
32
32
  try { __vm_out.fns.set(__vm_fns[__vm_i], eval(__vm_fns[__vm_i])); } catch (e) {}
33
- }`),nr}function lr(e){let t=/* @__PURE__ */ new Map,n=new Proxy(e,{has(e,t){return typeof t==`symbol`||t===`eval`||t.startsWith(`__vm_`)?!1:!tr.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 ur(e){return typeof e==`string`?e:e?.filename}function dr(e,t){let n=ur(t);return n?`${e}\n//# sourceURL=${n}`:e}function fr(e){let t=e??{};return er.has(t)||er.set(t,lr(t)),t}function pr(e){return typeof e==`object`&&!!e&&er.has(e)}function mr(e,t,n){let r=er.get(t);if(!r)throw TypeError(`The "contextifiedObject" argument must be an vm.Context`);let i=String(e),a=or(i,rr),o=or(i,ir),s={value:void 0,fns:/* @__PURE__ */ new Map},c=tr;tr=new Set(a);try{let e=dr(i+sr(o),n);cr().call(r,r,e,a,s)}finally{tr=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 hr(e,t,n){return mr(e,fr(t),n)}function gr(e,t){let n=globalThis.eval;return n(dr(String(e),t))}var _r=class{#e;#t;constructor(e,t){this.#e=String(e),this.#t=t}runInContext(e){return mr(this.#e,e,this.#t)}runInNewContext(e){return hr(this.#e,e,this.#t)}runInThisContext(){return gr(this.#e,this.#t)}};function vr(e,t=[]){return Function(...t,String(e))}const yr={Script:_r,createContext:fr,isContext:pr,runInContext:mr,runInNewContext:hr,runInThisContext:gr,compileFunction:vr};var br=4,xr=0,Sr=1,Cr=2;function wr(e){let t=e.length;for(;--t>=0;)e[t]=0}var Tr=29,Er=256,Dr=286,Or=30,kr=19,Ar=573,jr=15,Mr=16,Nr=7,Pr=256,Fr=16,Ir=17,Lr=18,Rr=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]),zr=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]),Br=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Vr=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hr=512,L=Array(576);wr(L);var Ur=Array(Or*2);wr(Ur);var Wr=Array(Hr);wr(Wr);var Gr=Array(256);wr(Gr);var Kr=Array(Tr);wr(Kr);var qr=Array(Or);wr(qr);var Jr=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}},Yr,Xr,Zr,Qr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},$r=e=>e<256?Wr[e]:Wr[256+(e>>>7)],ei=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},R=(e,t,n)=>{e.bi_valid>Mr-n?(e.bi_buf|=t<<e.bi_valid&65535,ei(e,e.bi_buf),e.bi_buf=t>>Mr-e.bi_valid,e.bi_valid+=n-Mr):(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])},ti=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ni=e=>{e.bi_valid===16?(ei(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)},ri=(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<=jr;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Ar;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--)}},ii=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=jr;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]=ti(r[t]++,t))}},ai=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<Tr-1;r++)for(Kr[r]=n,e=0;e<1<<Rr[r];e++)Gr[n++]=r;for(Gr[n-1]=r,i=0,r=0;r<16;r++)for(qr[r]=i,e=0;e<1<<zr[r];e++)Wr[i++]=r;for(i>>=7;r<Or;r++)for(qr[r]=i<<7,e=0;e<1<<zr[r]-7;e++)Wr[256+i++]=r;for(t=0;t<=jr;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(ii(L,287,a),e=0;e<Or;e++)Ur[e*2+1]=5,Ur[e*2]=ti(e,5);Yr=new Jr(L,Rr,257,Dr,jr),Xr=new Jr(Ur,zr,0,Or,jr),Zr=new Jr([],Br,0,kr,Nr)},oi=e=>{let t=0;for(;t<Dr;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Or;t++)e.dyn_dtree[t*2]=0;for(t=0;t<kr;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},si=e=>{e.bi_valid>8?ei(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ci=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},li=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&ci(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ci(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},ui=(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=Gr[i],z(e,o+Er+1,t),s=Rr[o],s!==0&&(i-=Kr[o],R(e,i,s)),r--,o=$r(r),z(e,o,n),s=zr[o],s!==0&&(r-=qr[o],R(e,r,s)));while(a<e.sym_next);z(e,Pr,t)},di=(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=Ar,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--)li(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],li(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++,li(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],ri(e,t),ii(n,c,e.bl_count)},fi=(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))},pi=(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,Ir,e.bl_tree),R(e,s-3,3)):(z(e,Lr,e.bl_tree),R(e,s-11,7)):(a!==i&&(z(e,a,e.bl_tree),s--),z(e,Fr,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)}},mi=e=>{let t;for(fi(e,e.dyn_ltree,e.l_desc.max_code),fi(e,e.dyn_dtree,e.d_desc.max_code),di(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Vr[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},hi=(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[Vr[i]*2+1],3);pi(e,e.dyn_ltree,t-1),pi(e,e.dyn_dtree,n-1)},gi=e=>{let t=4093624447,n=0;for(;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return xr;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Sr;for(n=32;n<Er;n++)if(e.dyn_ltree[n*2]!==0)return Sr;return xr},_i=!1,vi=e=>{_i||=(ai(),!0),e.l_desc=new Qr(e.dyn_ltree,Yr),e.d_desc=new Qr(e.dyn_dtree,Xr),e.bl_desc=new Qr(e.bl_tree,Zr),e.bi_buf=0,e.bi_valid=0,oi(e)},yi=(e,t,n,r)=>{R(e,0+ +!!r,3),si(e),ei(e,n),ei(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},bi=e=>{R(e,2,3),z(e,Pr,L),ni(e)},xi=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===Cr&&(e.strm.data_type=gi(e)),di(e,e.l_desc),di(e,e.d_desc),o=mi(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,(a<=i||e.strategy===br)&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?yi(e,t,n,r):e.strategy===br||a===i?(R(e,2+ +!!r,3),ui(e,L,Ur)):(R(e,4+ +!!r,3),hi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),ui(e,e.dyn_ltree,e.dyn_dtree)),oi(e),r&&si(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[(Gr[n]+Er+1)*2]++,e.dyn_dtree[$r(t)*2]++),e.sym_next===e.sym_end),Si=(e,t,n,r)=>{let i=e&65535,a=e>>>16&65535,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},Ci=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=Ci,a=r+n;e^=-1;for(let n=r;n<a;n++)e=e>>>8^i[(e^t[n])&255];return e^-1},wi={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`},Ti=9,Ei=573,H=3,Di=258,U=262,Oi=32,ki=42,Ai=57,ji=69,Mi=73,Ni=91,Pi=103,Fi=113,Ii=666,W=1,Li=2,Ri=3,zi=4,Bi=3,Vi=(e,t)=>(e.msg=wi[t],t),Hi=e=>e*2-(e>4?9:0),G=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Ui=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)},Wi=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Gi=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Wi(e,e.ins_h,e.window[t+H-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},K=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))},q=(e,t)=>{xi(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,K(e.strm)},J=(e,t)=>{e.pending_buf[e.pending++]=t},Ki=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},qi=(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=Si(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)},Ji=(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-U?e.strstart-(e.w_size-U):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Di,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=Di-(f-r),r=f-Di,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},Yi=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-U)&&(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),Ui(e),r+=t),e.strm.avail_in===0)break;if(n=qi(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>H)for(i=e.strstart-e.insert;e.insert&&(Gi(e,i),i++,e.insert--,!(e.lookahead+e.insert<=H)););}else if(e.lookahead+e.insert>=H)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Wi(e,e.ins_h,e.window[i+1]);e.insert&&(Gi(e,i),i++,e.insert--,!(e.lookahead+e.insert<H)););}while(e.lookahead<U&&e.strm.avail_in!==0)},Xi=(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),yi(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,K(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&&(qi(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?zi:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?Li:(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&&(qi(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),yi(e,e.block_start,r,o),e.block_start+=r,K(e.strm)),o?Ri:W)},Zi=(e,t)=>{let n,r;for(;;){if(e.lookahead<U){if(Yi(e),e.lookahead<U&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Gi(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-U&&(e.match_length=Ji(e,n)),e.match_length>=H){if(r=B(e,e.strstart-e.match_start,e.match_length-H),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=H){e.match_length--;do e.strstart++,n=Gi(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=Wi(e,e.ins_h,e.window[e.strstart+1]))}else r=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=e.strstart<H-1?e.strstart:H-1,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},Qi=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<U){if(Yi(e),e.lookahead<U&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Gi(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=H-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-U&&(e.match_length=Ji(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===H&&e.strstart-e.match_start>4096)&&(e.match_length=H-1)),e.prev_length>=H&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-H,r=B(e,e.strstart-1-e.prev_match,e.prev_length-H),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Gi(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=H-1,e.strstart++,r&&(q(e,!1),e.strm.avail_out===0))return W}else if(e.match_available){if(r=B(e,0,e.window[e.strstart-1]),r&&q(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return W}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<H-1?e.strstart:H-1,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},$i=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=Di){if(Yi(e),e.lookahead<=Di&&t===0)return W;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=H&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Di;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=Di-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=H?(n=B(e,1,e.match_length-H),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&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},ea=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Yi(e),e.lookahead===0)){if(t===0)return W;break}if(e.match_length=0,n=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},Y=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}},ta=[new Y(0,0,0,0,Xi),new Y(4,4,8,4,Zi),new Y(4,5,16,8,Zi),new Y(4,6,32,32,Zi),new Y(4,4,16,16,Qi),new Y(8,16,32,32,Qi),new Y(8,16,128,128,Qi),new Y(8,32,128,256,Qi),new Y(32,128,258,1024,Qi),new Y(32,258,258,4096,Qi)],na=e=>{e.window_size=2*e.w_size,G(e.head),e.max_lazy_match=ta[e.level].max_lazy,e.good_match=ta[e.level].good_length,e.nice_match=ta[e.level].nice_length,e.max_chain_length=ta[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=H-1,e.match_available=0,e.ins_h=0},ra=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(Ei*2),this.dyn_dtree=/* @__PURE__ */ new Uint16Array(122),this.bl_tree=/* @__PURE__ */ new Uint16Array(78),G(this.dyn_ltree),G(this.dyn_dtree),G(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=/* @__PURE__ */ new Uint16Array(16),this.heap=/* @__PURE__ */ new Uint16Array(573),G(this.heap),this.heap_len=0,this.heap_max=0,this.depth=/* @__PURE__ */ new Uint16Array(573),G(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}},ia=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==ki&&t.status!==Ai&&t.status!==ji&&t.status!==Mi&&t.status!==Ni&&t.status!==Pi&&t.status!==Fi&&t.status!==Ii)},aa=e=>{if(ia(e))return Vi(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?Ai:t.wrap?ki:Fi,e.adler=t.wrap===2?0:1,t.last_flush=-2,vi(t),0},oa=e=>{let t=aa(e);return t===0&&na(e.state),t},sa=(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>Ti||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return Vi(e,-2);r===8&&(r=9);let c=new ra;return e.state=c,c.strm=e,c.status=ki,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+H-1)/H),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,oa(e)},ca=(e,t)=>{if(ia(e)||t>5||t<0)return e?Vi(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Ii&&t!==4)return Vi(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(K(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&Hi(t)<=Hi(r)&&t!==4)return Vi(e,-5);if(n.status===Ii&&e.avail_in!==0)return Vi(e,-5);if(n.status===ki&&n.wrap===0&&(n.status=Fi),n.status===ki){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,Ki(n,t),n.strstart!==0&&(Ki(n,e.adler>>>16),Ki(n,e.adler&65535)),e.adler=1,n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Ai){if(e.adler=0,J(n,31),J(n,139),J(n,8),n.gzhead)J(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),J(n,n.gzhead.time&255),J(n,n.gzhead.time>>8&255),J(n,n.gzhead.time>>16&255),J(n,n.gzhead.time>>24&255),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(J(n,n.gzhead.extra.length&255),J(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=ji;else if(J(n,0),J(n,0),J(n,0),J(n,0),J(n,0),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,Bi),n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===ji){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,K(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=Mi}if(n.status===Mi){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)),K(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,J(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=Ni}if(n.status===Ni){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)),K(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,J(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=Pi}if(n.status===Pi){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(K(e),n.pending!==0))return n.last_flush=-1,0;J(n,e.adler&255),J(n,e.adler>>8&255),e.adler=0}if(n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==Ii){let r=n.level===0?Xi(n,t):n.strategy===2?ea(n,t):n.strategy===3?$i(n,t):ta[n.level].func(n,t);if((r===Ri||r===zi)&&(n.status=Ii),r===W||r===Ri)return e.avail_out===0&&(n.last_flush=-1),0;if(r===Li&&(t===1?bi(n):t!==5&&(yi(n,0,0,!1),t===3&&(G(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),K(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(J(n,e.adler&255),J(n,e.adler>>8&255),J(n,e.adler>>16&255),J(n,e.adler>>24&255),J(n,e.total_in&255),J(n,e.total_in>>8&255),J(n,e.total_in>>16&255),J(n,e.total_in>>24&255)):(Ki(n,e.adler>>>16),Ki(n,e.adler&65535)),K(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},la=e=>{if(ia(e))return-2;let t=e.state.status;return e.state=null,t===Fi?Vi(e,-3):0},ua=(e,t)=>{let n=t.length;if(ia(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ki||r.lookahead)return-2;if(i===1&&(e.adler=Si(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(G(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,Yi(r);r.lookahead>=H;){let e=r.strstart,t=r.lookahead-(H-1);do Gi(r,e),e++;while(--t);r.strstart=e,r.lookahead=H-1,Yi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=H-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},da=16209,fa=16191;function pa(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=da;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=da;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=da;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=fa;break top}else{e.msg=`invalid literal/length code`,E.mode=da;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 ma=15,ha=852,ga=592,_a=0,va=1,ya=2,ba=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]),xa=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]),Sa=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]),Ca=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]),wa=(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=/* @__PURE__ */ new Uint16Array(16),D=/* @__PURE__ */ new Uint16Array(16),O=null,k,ee,A;for(l=0;l<=ma;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=ma;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<=ma;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===_a||f!==1))return-1;for(D[1]=0,l=1;l<ma;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===_a?(w=O=o,T=20):e===va?(w=ba,O=xa,T=257):(w=Sa,O=Ca,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===va&&_>ha||e===ya&&_>ga)return 1;for(;;){k=l-h,o[u]+1<T?(ee=0,A=o[u]):o[u]>=T?(ee=O[o[u]-T],A=w[o[u]-T]):(ee=96,A=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|ee<<16|A;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===va&&_>ha||e===ya&&_>ga)return 1;x=v&S,i[x]=p<<24|m<<16|C-a}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},Ta=0,Ea=1,Da=2,Oa=16180,ka=16181,Aa=16182,ja=16183,Ma=16184,Na=16185,Pa=16186,Fa=16187,Ia=16188,La=16189,Ra=16190,X=16191,za=16192,Ba=16193,Va=16194,Ha=16195,Ua=16196,Wa=16197,Ga=16198,Ka=16199,qa=16200,Ja=16201,Ya=16202,Xa=16203,Za=16204,Qa=16205,$a=16206,eo=16207,to=16208,Z=16209,no=16210,ro=16211,io=852,ao=592,oo=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),so=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=/* @__PURE__ */ new Uint16Array(320),this.work=/* @__PURE__ */ new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},co=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<Oa||t.mode>ro)},lo=e=>{if(co(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(io),t.distcode=t.distdyn=new Int32Array(ao),t.sane=1,t.back=-1,0},uo=e=>{if(co(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,lo(e)},fo=(e,t)=>{let n;if(co(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,uo(e))},po=(e,t)=>{if(!e)return-2;let n=new so;e.state=n,n.strm=e,n.window=null,n.mode=Oa;let r=fo(e,t);return r!==0&&(e.state=null),r},mo=!0,ho,go,_o=e=>{if(mo){ho=/* @__PURE__ */ new Int32Array(512),go=/* @__PURE__ */ 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(wa(Ea,e.lens,0,288,ho,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wa(Da,e.lens,0,32,go,0,e.work,{bits:5}),mo=!1}e.lencode=ho,e.lenbits=9,e.distcode=go,e.distbits=5},vo=(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},yo=(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=/* @__PURE__ */ 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(co(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===X&&(n.mode=za),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=za;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=ka;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Z;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Z;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=Z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?La:X,l=0,u=0;break;case ka: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=Z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Z;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=Aa;case Aa:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l>>>0),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=ja;case ja: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=Ma;case Ma: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=Na;case Na: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=Pa;case Pa: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=Fa;case Fa: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=Ia;case Ia: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=Z;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=X;break;case La:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=oo(l),l=0,u=0,n.mode=Ra;case Ra: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=X;case X:if(t===5||t===6)break inf_leave;case za:if(n.last){l>>>=u&7,u-=u&7,n.mode=$a;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=Ba;break;case 1:if(_o(n),n.mode=Ka,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Ua;break;case 3:e.msg=`invalid block type`,n.mode=Z}l>>>=2,u-=2;break;case Ba: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=Z;break}if(n.length=l&65535,l=0,u=0,n.mode=Va,t===6)break inf_leave;case Va:n.mode=Ha;case Ha: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=X;break;case Ua: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=Z;break}n.have=0,n.mode=Wa;case Wa: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=wa(Ta,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Z;break}n.have=0,n.mode=Ga;case Ga: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=Z;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=Z;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Z;break}if(n.lenbits=9,E={bits:n.lenbits},w=wa(Ea,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Z;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=wa(Da,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Z;break}if(n.mode=Ka,t===6)break inf_leave;case Ka:n.mode=qa;case qa: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,pa(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===X&&(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=Qa;break}if(v&32){n.back=-1,n.mode=X;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Z;break}n.extra=v&15,n.mode=Ja;case Ja: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=Ya;case Ya: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=Z;break}n.offset=y,n.extra=v&15,n.mode=Xa;case Xa: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=Z;break}n.mode=Za;case Za: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=Z;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=qa);break;case Qa:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=qa;break;case $a: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):Si(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:oo(l))!==n.check){e.msg=`incorrect data check`,n.mode=Z;break}l=0,u=0}n.mode=eo;case eo: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|0)){e.msg=`incorrect length check`,n.mode=Z;break}l=0,u=0}n.mode=to;case to:w=1;break inf_leave;case Z:w=-3;break inf_leave;case no:return-4;case ro: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<Z&&(n.mode<$a||t!==4))&&vo(e,e.output,e.next_out,f-e.avail_out)?(n.mode=no,-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):Si(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===Ka||n.mode===Va?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},bo=e=>{if(co(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xo=(e,t)=>{let n=t.length,r,i,a;return co(e)||(r=e.state,r.wrap!==0&&r.mode!==Ra)?-2:r.mode===Ra&&(i=1,i=Si(i,t,n,0),i!==r.check)?-3:(a=vo(e,t,n,n),a?(r.mode=no,-4):(r.havedict=1,0))},So=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}},Co=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},wo=Object.prototype.toString,To={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:/* @__PURE__ */ new Uint8Array},Eo=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},To,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=/* @__PURE__ */ new Uint8Array,this.strm=new So,this.strm.avail_out=0;let n=sa(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(wi[n]);wo.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=ua(this.strm,r),n!==0)throw Error(wi[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):wo.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;else{if(i=ca(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=la(this.strm);break}if(n.avail_out===0)this.onData(n.output);else if(a>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||wi[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Co(this.chunks)),this.chunks=[]}};function Do(e,t={}){let n=new Eo(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function Oo(e,t={}){return Do(e,Object.assign({},t,{raw:!0}))}function ko(e,t={}){return Do(e,Object.assign({},t,{gzip:!0}))}var Ao=Object.prototype.toString,jo={chunkSize:65536,windowBits:15,raw:!1,dictionary:/* @__PURE__ */ new Uint8Array},Mo=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},jo,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=/* @__PURE__ */ new Uint8Array,this.strm=new So,this.strm.avail_out=0;let n=po(this.strm,t.windowBits);if(n!==0)throw Error(wi[n]);Ao.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xo(this.strm,r),n!==0))throw Error(wi[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=Ao.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=yo(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xo(n,e),i===0?i=yo(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;)uo(n),i=yo(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=bo(this.strm);break}if(n.avail_in===0){if(a===4){i=bo(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||wi[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Co(this.chunks)),this.chunks=[]}};function No(e,t={}){let n=new Mo(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 Po(e,t={}){return No(e,{...t,raw:!0})}function Fo(e){return typeof e==`string`?new Uint8Array(vt(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Io(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 Lo(e,t,n){return vt(e(Fo(t),Io(n)))}function Ro(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=Lo(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const zo={gzipSync:(e,t)=>Lo(ko,e,t),gunzipSync:(e,t)=>Lo(No,e,t),deflateSync:(e,t)=>Lo(Do,e,t),inflateSync:(e,t)=>Lo(No,e,t),deflateRawSync:(e,t)=>Lo(Oo,e,t),inflateRawSync:(e,t)=>Lo(Po,e,t),gzip:(e,t,n)=>Ro(ko,e,t,n),gunzip:(e,t,n)=>Ro(No,e,t,n),deflate:(e,t,n)=>Ro(Do,e,t,n),inflate:(e,t,n)=>Ro(No,e,t,n),deflateRaw:(e,t,n)=>Ro(Oo,e,t,n),inflateRaw:(e,t,n)=>Ro(Po,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function Bo(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++}else if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++}else 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 Vo(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>Bo(t),enumerable:!1,writable:!1,configurable:!1}),t}const Ho=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},Uo={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function Wo(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*Uo[i])}function Go(e){return e<10?`0${e}`:String(e)}const Ko={parseDuration:Wo,ago(e,t=/* @__PURE__ */ new Date){return new Date(t.getTime()-Wo(e))},range(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-Wo(e)),end:n}},future(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+Wo(e))}},gmailDate(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime()-Wo(e));return`${n.getFullYear()}/${Go(n.getMonth()+1)}/${Go(n.getDate())}`}};function qo(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Q=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Jo(e){let t=Number(e);return Number.isFinite(t)?t:0}function Yo(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 Xo(e){let t=/* @__PURE__ */ TypeError(`The "code" argument must be of type number. Received ${Yo(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function Zo(e){let t=/* @__PURE__ */ 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 Qo(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw Xo(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw Zo(e)}throw Xo(e)}}function $o(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function es(e){return`${e.map($o).join(` `)}\n`}function ts(e){return e===void 0?`default`:String(e)}function ns(){return typeof performance<`u`?performance.now():Date.now()}function rs(e){return`${e.toFixed(3)}ms`}function is(e,t,n){let r=es(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function as(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${$o(r)}`,...i)}function os(e,t,n,r){e(r.length>0?`Trace: ${r.map($o).join(` `)}`:`Trace:`);let i=(/* @__PURE__ */ Error()).stack;if(!i)return;let a=i.split(`
33
+ }`),nr}function lr(e){let t=/* @__PURE__ */ new Map,n=new Proxy(e,{has(e,t){return typeof t==`symbol`||t===`eval`||t.startsWith(`__vm_`)?!1:!tr.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 ur(e){return typeof e==`string`?e:e?.filename}function dr(e,t){let n=ur(t);return n?`${e}\n//# sourceURL=${n}`:e}function fr(e){let t=e??{};return er.has(t)||er.set(t,lr(t)),t}function pr(e){return typeof e==`object`&&!!e&&er.has(e)}function mr(e,t,n){let r=er.get(t);if(!r)throw TypeError(`The "contextifiedObject" argument must be an vm.Context`);let i=String(e),a=or(i,rr),o=or(i,ir),s={value:void 0,fns:/* @__PURE__ */ new Map},c=tr;tr=new Set(a);try{let e=dr(i+sr(o),n);cr().call(r,r,e,a,s)}finally{tr=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 hr(e,t,n){return mr(e,fr(t),n)}function gr(e,t){let n=globalThis.eval;return n(dr(String(e),t))}var _r=class{#e;#t;constructor(e,t){this.#e=String(e),this.#t=t}runInContext(e){return mr(this.#e,e,this.#t)}runInNewContext(e){return hr(this.#e,e,this.#t)}runInThisContext(){return gr(this.#e,this.#t)}};function vr(e,t=[]){return Function(...t,String(e))}const yr={Script:_r,createContext:fr,isContext:pr,runInContext:mr,runInNewContext:hr,runInThisContext:gr,compileFunction:vr};var br=4,xr=0,Sr=1,Cr=2;function wr(e){let t=e.length;for(;--t>=0;)e[t]=0}var Tr=29,Er=256,Dr=286,Or=30,kr=19,Ar=573,jr=15,Mr=16,Nr=7,Pr=256,Fr=16,Ir=17,Lr=18,Rr=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]),zr=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]),Br=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Vr=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hr=512,L=Array(576);wr(L);var Ur=Array(Or*2);wr(Ur);var Wr=Array(Hr);wr(Wr);var Gr=Array(256);wr(Gr);var Kr=Array(Tr);wr(Kr);var qr=Array(Or);wr(qr);var Jr=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}},Yr,Xr,Zr,Qr=class{constructor(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}},$r=e=>e<256?Wr[e]:Wr[256+(e>>>7)],ei=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},R=(e,t,n)=>{e.bi_valid>Mr-n?(e.bi_buf|=t<<e.bi_valid&65535,ei(e,e.bi_buf),e.bi_buf=t>>Mr-e.bi_valid,e.bi_valid+=n-Mr):(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])},ti=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ni=e=>{e.bi_valid===16?(ei(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)},ri=(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<=jr;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<Ar;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--)}},ii=(e,t,n)=>{let r=Array(16),i=0,a,o;for(a=1;a<=jr;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]=ti(r[t]++,t))}},ai=()=>{let e,t,n,r,i,a=Array(16);for(n=0,r=0;r<Tr-1;r++)for(Kr[r]=n,e=0;e<1<<Rr[r];e++)Gr[n++]=r;for(Gr[n-1]=r,i=0,r=0;r<16;r++)for(qr[r]=i,e=0;e<1<<zr[r];e++)Wr[i++]=r;for(i>>=7;r<Or;r++)for(qr[r]=i<<7,e=0;e<1<<zr[r]-7;e++)Wr[256+i++]=r;for(t=0;t<=jr;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(ii(L,287,a),e=0;e<Or;e++)Ur[e*2+1]=5,Ur[e*2]=ti(e,5);Yr=new Jr(L,Rr,257,Dr,jr),Xr=new Jr(Ur,zr,0,Or,jr),Zr=new Jr([],Br,0,kr,Nr)},oi=e=>{let t=0;for(;t<Dr;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Or;t++)e.dyn_dtree[t*2]=0;for(t=0;t<kr;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},si=e=>{e.bi_valid>8?ei(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ci=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},li=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&ci(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ci(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},ui=(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=Gr[i],z(e,o+Er+1,t),s=Rr[o],s!==0&&(i-=Kr[o],R(e,i,s)),r--,o=$r(r),z(e,o,n),s=zr[o],s!==0&&(r-=qr[o],R(e,r,s)));while(a<e.sym_next);z(e,Pr,t)},di=(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=Ar,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--)li(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],li(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++,li(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],ri(e,t),ii(n,c,e.bl_count)},fi=(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))},pi=(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,Ir,e.bl_tree),R(e,s-3,3)):(z(e,Lr,e.bl_tree),R(e,s-11,7)):(a!==i&&(z(e,a,e.bl_tree),s--),z(e,Fr,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)}},mi=e=>{let t;for(fi(e,e.dyn_ltree,e.l_desc.max_code),fi(e,e.dyn_dtree,e.d_desc.max_code),di(e,e.bl_desc),t=18;t>=3&&e.bl_tree[Vr[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},hi=(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[Vr[i]*2+1],3);pi(e,e.dyn_ltree,t-1),pi(e,e.dyn_dtree,n-1)},gi=e=>{let t=4093624447,n=0;for(;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return xr;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return Sr;for(n=32;n<Er;n++)if(e.dyn_ltree[n*2]!==0)return Sr;return xr},_i=!1,vi=e=>{_i||=(ai(),!0),e.l_desc=new Qr(e.dyn_ltree,Yr),e.d_desc=new Qr(e.dyn_dtree,Xr),e.bl_desc=new Qr(e.bl_tree,Zr),e.bi_buf=0,e.bi_valid=0,oi(e)},yi=(e,t,n,r)=>{R(e,0+ +!!r,3),si(e),ei(e,n),ei(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},bi=e=>{R(e,2,3),z(e,Pr,L),ni(e)},xi=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===Cr&&(e.strm.data_type=gi(e)),di(e,e.l_desc),di(e,e.d_desc),o=mi(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,(a<=i||e.strategy===br)&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?yi(e,t,n,r):e.strategy===br||a===i?(R(e,2+ +!!r,3),ui(e,L,Ur)):(R(e,4+ +!!r,3),hi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),ui(e,e.dyn_ltree,e.dyn_dtree)),oi(e),r&&si(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[(Gr[n]+Er+1)*2]++,e.dyn_dtree[$r(t)*2]++),e.sym_next===e.sym_end),Si=(e,t,n,r)=>{let i=e&65535,a=e>>>16&65535,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},Ci=(()=>{let e=/* @__PURE__ */ new Uint32Array(2048),t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}for(let n=0;n<256;n++){t=e[n];for(let r=256;r<2048;r+=256)t=e[t&255]^t>>>8,e[r+n]=t}return e})(),V=(e,t,n,r)=>{let i=Ci,a=r+n,o=r;e^=-1;for(let n=a-7;o<n;o+=8)e^=t[o]|t[o+1]<<8|t[o+2]<<16|t[o+3]<<24,e=i[1792+(e&255)]^i[1536+(e>>>8&255)]^i[1280+(e>>>16&255)]^i[1024+(e>>>24)]^i[768+t[o+4]]^i[512+t[o+5]]^i[256+t[o+6]]^i[t[o+7]];for(;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},wi={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`},Ti=9,Ei=573,H=3,Di=258,U=262,Oi=32,ki=42,Ai=57,ji=69,Mi=73,Ni=91,Pi=103,Fi=113,Ii=666,W=1,Li=2,Ri=3,zi=4,Bi=3,Vi=(e,t)=>(e.msg=wi[t],t),Hi=e=>e*2-(e>4?9:0),G=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Ui=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)},Wi=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Gi=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=Wi(e,e.ins_h,e.window[t+H-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},K=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))},q=(e,t)=>{xi(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,K(e.strm)},J=(e,t)=>{e.pending_buf[e.pending++]=t},Ki=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},qi=(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=Si(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)},Ji=(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-U?e.strstart-(e.w_size-U):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+Di,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=Di-(f-r),r=f-Di,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},Yi=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-U)&&(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),Ui(e),r+=t),e.strm.avail_in===0)break;if(n=qi(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,!e.legacy_hash){if(e.lookahead+e.insert>H)for(i=e.strstart-e.insert;e.insert&&(Gi(e,i),i++,e.insert--,!(e.lookahead+e.insert<=H)););}else if(e.lookahead+e.insert>=H)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Wi(e,e.ins_h,e.window[i+1]);e.insert&&(Gi(e,i),i++,e.insert--,!(e.lookahead+e.insert<H)););}while(e.lookahead<U&&e.strm.avail_in!==0)},Xi=(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),yi(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,K(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&&(qi(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?zi:t!==0&&t!==4&&e.strm.avail_in===0&&e.strstart===e.block_start?Li:(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&&(qi(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),yi(e,e.block_start,r,o),e.block_start+=r,K(e.strm)),o?Ri:W)},Zi=(e,t)=>{let n,r;for(;;){if(e.lookahead<U){if(Yi(e),e.lookahead<U&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Gi(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-U&&(e.match_length=Ji(e,n)),e.match_length>=H){if(r=B(e,e.strstart-e.match_start,e.match_length-H),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=H){e.match_length--;do e.strstart++,n=Gi(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=Wi(e,e.ins_h,e.window[e.strstart+1]))}else r=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=e.strstart<H-1?e.strstart:H-1,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},Qi=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<U){if(Yi(e),e.lookahead<U&&t===0)return W;if(e.lookahead===0)break}if(n=0,e.lookahead>=H&&(n=Gi(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=H-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-U&&(e.match_length=Ji(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===H&&e.strstart-e.match_start>4096)&&(e.match_length=H-1)),e.prev_length>=H&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-H,r=B(e,e.strstart-1-e.prev_match,e.prev_length-H),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Gi(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=H-1,e.strstart++,r&&(q(e,!1),e.strm.avail_out===0))return W}else if(e.match_available){if(r=B(e,0,e.window[e.strstart-1]),r&&q(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return W}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<H-1?e.strstart:H-1,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},$i=(e,t)=>{let n,r,i,a,o=e.window;for(;;){if(e.lookahead<=Di){if(Yi(e),e.lookahead<=Di&&t===0)return W;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=H&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Di;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=Di-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=H?(n=B(e,1,e.match_length-H),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&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},ea=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Yi(e),e.lookahead===0)){if(t===0)return W;break}if(e.match_length=0,n=B(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(q(e,!1),e.strm.avail_out===0))return W}return e.insert=0,t===4?(q(e,!0),e.strm.avail_out===0?Ri:zi):e.sym_next&&(q(e,!1),e.strm.avail_out===0)?W:Li},Y=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}},ta=[new Y(0,0,0,0,Xi),new Y(4,4,8,4,Zi),new Y(4,5,16,8,Zi),new Y(4,6,32,32,Zi),new Y(4,4,16,16,Qi),new Y(8,16,32,32,Qi),new Y(8,16,128,128,Qi),new Y(8,32,128,256,Qi),new Y(32,128,258,1024,Qi),new Y(32,258,258,4096,Qi)],na=e=>{e.window_size=2*e.w_size,G(e.head),e.max_lazy_match=ta[e.level].max_lazy,e.good_match=ta[e.level].good_length,e.nice_match=ta[e.level].nice_length,e.max_chain_length=ta[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=H-1,e.match_available=0,e.ins_h=0},ra=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(Ei*2),this.dyn_dtree=/* @__PURE__ */ new Uint16Array(122),this.bl_tree=/* @__PURE__ */ new Uint16Array(78),G(this.dyn_ltree),G(this.dyn_dtree),G(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=/* @__PURE__ */ new Uint16Array(16),this.heap=/* @__PURE__ */ new Uint16Array(573),G(this.heap),this.heap_len=0,this.heap_max=0,this.depth=/* @__PURE__ */ new Uint16Array(573),G(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}},ia=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.status!==ki&&t.status!==Ai&&t.status!==ji&&t.status!==Mi&&t.status!==Ni&&t.status!==Pi&&t.status!==Fi&&t.status!==Ii)},aa=e=>{if(ia(e))return Vi(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?Ai:t.wrap?ki:Fi,e.adler=t.wrap===2?0:1,t.last_flush=-2,vi(t),0},oa=e=>{let t=aa(e);return t===0&&na(e.state),t},sa=(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>Ti||n!==8||r<8||r>15||t<0||t>9||a<0||a>4||r===8&&s!==1)return Vi(e,-2);r===8&&(r=9);let c=new ra;return e.state=c,c.strm=e,c.status=ki,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+H-1)/H),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,oa(e)},ca=(e,t)=>{if(ia(e)||t>5||t<0)return e?Vi(e,-2):-2;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Ii&&t!==4)return Vi(e,e.avail_out===0?-5:-2);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(K(e),e.avail_out===0)return n.last_flush=-1,0}else if(e.avail_in===0&&Hi(t)<=Hi(r)&&t!==4)return Vi(e,-5);if(n.status===Ii&&e.avail_in!==0)return Vi(e,-5);if(n.status===ki&&n.wrap===0&&(n.status=Fi),n.status===ki){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,Ki(n,t),n.strstart!==0&&(Ki(n,e.adler>>>16),Ki(n,e.adler&65535)),e.adler=1,n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===Ai){if(e.adler=0,J(n,31),J(n,139),J(n,8),n.gzhead)J(n,+!!n.gzhead.text+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),J(n,n.gzhead.time&255),J(n,n.gzhead.time>>8&255),J(n,n.gzhead.time>>16&255),J(n,n.gzhead.time>>24&255),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(J(n,n.gzhead.extra.length&255),J(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=ji;else if(J(n,0),J(n,0),J(n,0),J(n,0),J(n,0),J(n,n.level===9?2:n.strategy>=2||n.level<2?4:0),J(n,Bi),n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(n.status===ji){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,K(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=Mi}if(n.status===Mi){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)),K(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,J(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=Ni}if(n.status===Ni){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)),K(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,J(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=Pi}if(n.status===Pi){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(K(e),n.pending!==0))return n.last_flush=-1,0;J(n,e.adler&255),J(n,e.adler>>8&255),e.adler=0}if(n.status=Fi,K(e),n.pending!==0)return n.last_flush=-1,0}if(e.avail_in!==0||n.lookahead!==0||t!==0&&n.status!==Ii){let r=n.level===0?Xi(n,t):n.strategy===2?ea(n,t):n.strategy===3?$i(n,t):ta[n.level].func(n,t);if((r===Ri||r===zi)&&(n.status=Ii),r===W||r===Ri)return e.avail_out===0&&(n.last_flush=-1),0;if(r===Li&&(t===1?bi(n):t!==5&&(yi(n,0,0,!1),t===3&&(G(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),K(e),e.avail_out===0))return n.last_flush=-1,0}return t===4?n.wrap<=0?1:(n.wrap===2?(J(n,e.adler&255),J(n,e.adler>>8&255),J(n,e.adler>>16&255),J(n,e.adler>>24&255),J(n,e.total_in&255),J(n,e.total_in>>8&255),J(n,e.total_in>>16&255),J(n,e.total_in>>24&255)):(Ki(n,e.adler>>>16),Ki(n,e.adler&65535)),K(e),n.wrap>0&&(n.wrap=-n.wrap),+(n.pending===0)):0},la=e=>{if(ia(e))return-2;let t=e.state.status;return e.state=null,t===Fi?Vi(e,-3):0},ua=(e,t)=>{let n=t.length;if(ia(e))return-2;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ki||r.lookahead)return-2;if(i===1&&(e.adler=Si(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(G(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,Yi(r);r.lookahead>=H;){let e=r.strstart,t=r.lookahead-(H-1);do Gi(r,e),e++;while(--t);r.strstart=e,r.lookahead=H-1,Yi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=H-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,0},da=16209,fa=16191;function pa(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=da;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=da;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=da;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=fa;break top}else{e.msg=`invalid literal/length code`,E.mode=da;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 ma=15,ha=852,ga=592,_a=0,va=1,ya=2,ba=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]),xa=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]),Sa=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]),Ca=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]),wa=(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=/* @__PURE__ */ new Uint16Array(16),D=/* @__PURE__ */ new Uint16Array(16),O=null,k,ee,A;for(l=0;l<=ma;l++)E[l]=0;for(u=0;u<r;u++)E[t[n+u]]++;for(p=c,f=ma;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<=ma;l++)if(g<<=1,g-=E[l],g<0)return-1;if(g>0&&(e===_a||f!==1))return-1;for(D[1]=0,l=1;l<ma;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===_a?(w=O=o,T=20):e===va?(w=ba,O=xa,T=257):(w=Sa,O=Ca,T=0),v=0,u=0,l=d,C=a,m=p,h=0,x=-1,_=1<<p,S=_-1,e===va&&_>ha||e===ya&&_>ga)return 1;for(;;){k=l-h,o[u]+1<T?(ee=0,A=o[u]):o[u]>=T?(ee=O[o[u]-T],A=w[o[u]-T]):(ee=96,A=0),y=1<<l-h,b=1<<m,d=b;do b-=y,i[C+(v>>h)+b]=k<<24|ee<<16|A;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===va&&_>ha||e===ya&&_>ga)return 1;x=v&S,i[x]=p<<24|m<<16|C-a}}return v!==0&&(i[C+v]=l-h<<24|4194304),s.bits=p,0},Ta=0,Ea=1,Da=2,Oa=16180,ka=16181,Aa=16182,ja=16183,Ma=16184,Na=16185,Pa=16186,Fa=16187,Ia=16188,La=16189,Ra=16190,X=16191,za=16192,Ba=16193,Va=16194,Ha=16195,Ua=16196,Wa=16197,Ga=16198,Ka=16199,qa=16200,Ja=16201,Ya=16202,Xa=16203,Za=16204,Qa=16205,$a=16206,eo=16207,to=16208,Z=16209,no=16210,ro=16211,io=852,ao=592,oo=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24),so=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=/* @__PURE__ */ new Uint16Array(320),this.work=/* @__PURE__ */ new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}},co=e=>{if(!e)return 1;let t=e.state;return+(!t||t.strm!==e||t.mode<Oa||t.mode>ro)},lo=e=>{if(co(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(io),t.distcode=t.distdyn=new Int32Array(ao),t.sane=1,t.back=-1,0},uo=e=>{if(co(e))return-2;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,lo(e)},fo=(e,t)=>{let n;if(co(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,uo(e))},po=(e,t)=>{if(!e)return-2;let n=new so;e.state=n,n.strm=e,n.window=null,n.mode=Oa;let r=fo(e,t);return r!==0&&(e.state=null),r},mo=!0,ho,go,_o=e=>{if(mo){ho=/* @__PURE__ */ new Int32Array(512),go=/* @__PURE__ */ 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(wa(Ea,e.lens,0,288,ho,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;wa(Da,e.lens,0,32,go,0,e.work,{bits:5}),mo=!1}e.lencode=ho,e.lenbits=9,e.distcode=go,e.distbits=5},vo=(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},yo=(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=/* @__PURE__ */ 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(co(e)||!e.output||!e.input&&e.avail_in!==0)return-2;n=e.state,n.mode===X&&(n.mode=za),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=za;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=ka;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg=`incorrect header check`,n.mode=Z;break}if((l&15)!=8){e.msg=`unknown compression method`,n.mode=Z;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=Z;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?La:X,l=0,u=0;break;case ka: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=Z;break}if(n.flags&57344){e.msg=`unknown header flags set`,n.mode=Z;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=Aa;case Aa:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l>>>0),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=ja;case ja: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=Ma;case Ma: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=Na;case Na: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=Pa;case Pa: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),n.length++);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=Fa;case Fa: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),n.length++);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=Ia;case Ia: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=Z;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=X;break;case La:for(;u<32;){if(s===0)break inf_leave;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=oo(l),l=0,u=0,n.mode=Ra;case Ra: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=X;case X:if(t===5||t===6)break inf_leave;case za:if(n.last){l>>>=u&7,u-=u&7,n.mode=$a;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=Ba;break;case 1:if(_o(n),n.mode=Ka,t===6){l>>>=2,u-=2;break inf_leave}break;case 2:n.mode=Ua;break;case 3:e.msg=`invalid block type`,n.mode=Z}l>>>=2,u-=2;break;case Ba: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=Z;break}if(n.length=l&65535,l=0,u=0,n.mode=Va,t===6)break inf_leave;case Va:n.mode=Ha;case Ha: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=X;break;case Ua: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=Z;break}n.have=0,n.mode=Wa;case Wa: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=wa(Ta,n.lens,0,19,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid code lengths set`,n.mode=Z;break}n.have=0,n.mode=Ga;case Ga: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=Z;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=Z;break}for(;p--;)n.lens[n.have++]=C}}if(n.mode===Z)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=Z;break}if(n.lenbits=9,E={bits:n.lenbits},w=wa(Ea,n.lens,0,n.nlen,n.lencode,0,n.work,E),n.lenbits=E.bits,w){e.msg=`invalid literal/lengths set`,n.mode=Z;break}if(n.distbits=6,n.distcode=n.distdyn,E={bits:n.distbits},w=wa(Da,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,E),n.distbits=E.bits,w){e.msg=`invalid distances set`,n.mode=Z;break}if(n.mode=Ka,t===6)break inf_leave;case Ka:n.mode=qa;case qa: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,pa(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===X&&(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=Qa;break}if(v&32){n.back=-1,n.mode=X;break}if(v&64){e.msg=`invalid literal/length code`,n.mode=Z;break}n.extra=v&15,n.mode=Ja;case Ja: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=Ya;case Ya: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=Z;break}n.offset=y,n.extra=v&15,n.mode=Xa;case Xa: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=Z;break}n.mode=Za;case Za: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=Z;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=qa);break;case Qa:if(c===0)break inf_leave;i[o++]=n.length,c--,n.mode=qa;break;case $a: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):Si(n.check,i,f,o-f)),f=c,n.wrap&4&&(n.flags?l:oo(l))!==n.check){e.msg=`incorrect data check`,n.mode=Z;break}l=0,u=0}n.mode=eo;case eo: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|0)){e.msg=`incorrect length check`,n.mode=Z;break}l=0,u=0}n.mode=to;case to:w=1;break inf_leave;case Z:w=-3;break inf_leave;case no:return-4;case ro: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<Z&&(n.mode<$a||t!==4))&&vo(e,e.output,e.next_out,f-e.avail_out)?(n.mode=no,-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):Si(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===Ka||n.mode===Va?256:0),(d===0&&f===0||t===4)&&w===0&&(w=-5),w)},bo=e=>{if(co(e))return-2;let t=e.state;return t.window&&=null,e.state=null,0},xo=(e,t)=>{let n=t.length,r,i,a;return co(e)||(r=e.state,r.wrap!==0&&r.mode!==Ra)?-2:r.mode===Ra&&(i=1,i=Si(i,t,n,0),i!==r.check)?-3:(a=vo(e,t,n,n),a?(r.mode=no,-4):(r.havedict=1,0))},So=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}},Co=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},wo=Object.prototype.toString,To={level:-1,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,raw:!1,gzip:!1,legacyHash:!1,dictionary:/* @__PURE__ */ new Uint8Array},Eo=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},To,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=/* @__PURE__ */ new Uint8Array,this.strm=new So,this.strm.avail_out=0;let n=sa(this.strm,t.level,8,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==0)throw Error(wi[n]);wo.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=ua(this.strm,r),n!==0)throw Error(wi[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):wo.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;else{if(i=ca(n,a),i===-2)break;if(i===1){n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=la(this.strm);break}if(n.avail_out===0)this.onData(n.output);else if(a>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(n.avail_in===0)return!0}return this.err=i,this.msg=n.msg||wi[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Co(this.chunks)),this.chunks=[]}};function Do(e,t={}){let n=new Eo(t);if(n.push(e,!0),n.err)throw Error(n.msg);return n.result}function Oo(e,t={}){return Do(e,Object.assign({},t,{raw:!0}))}function ko(e,t={}){return Do(e,Object.assign({},t,{gzip:!0}))}var Ao=Object.prototype.toString,jo={chunkSize:65536,windowBits:15,raw:!1,dictionary:/* @__PURE__ */ new Uint8Array},Mo=class{options;err;msg;ended;started;chunks;strm;result;constructor(e={}){this.options=Object.assign({},jo,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=/* @__PURE__ */ new Uint8Array,this.strm=new So,this.strm.avail_out=0;let n=po(this.strm,t.windowBits);if(n!==0)throw Error(wi[n]);Ao.call(t.dictionary)===`[object ArrayBuffer]`&&(t.dictionary=new Uint8Array(t.dictionary));let r=t.dictionary;if(t.raw&&r.length&&(n=xo(this.strm,r),n!==0))throw Error(wi[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=Ao.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=yo(n,a),i===2){let e=this.options.dictionary;e.length&&(i=xo(n,e),i===0?i=yo(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;)uo(n),i=yo(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=bo(this.strm);break}if(n.avail_in===0){if(a===4){i=bo(this.strm),i===0&&(i=-5);break}return!0}}}return this.err=i,this.msg=n.msg||wi[i],this.ended=!0,this.onEnd(i),i===0}onStart(e){}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.result=Co(this.chunks)),this.chunks=[]}};function No(e,t={}){let n=new Mo(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 Po(e,t={}){return No(e,{...t,raw:!0})}function Fo(e){return typeof e==`string`?new Uint8Array(vt(e,`utf8`)):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Io(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 Lo(e,t,n){return vt(e(Fo(t),Io(n)))}function Ro(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=Lo(e,t,a)}catch(e){queueMicrotask(()=>i(e instanceof Error?e:Error(String(e))));return}queueMicrotask(()=>i(null,o))}const zo={gzipSync:(e,t)=>Lo(ko,e,t),gunzipSync:(e,t)=>Lo(No,e,t),deflateSync:(e,t)=>Lo(Do,e,t),inflateSync:(e,t)=>Lo(No,e,t),deflateRawSync:(e,t)=>Lo(Oo,e,t),inflateRawSync:(e,t)=>Lo(Po,e,t),gzip:(e,t,n)=>Ro(ko,e,t,n),gunzip:(e,t,n)=>Ro(No,e,t,n),deflate:(e,t,n)=>Ro(Do,e,t,n),inflate:(e,t,n)=>Ro(No,e,t,n),deflateRaw:(e,t,n)=>Ro(Oo,e,t,n),inflateRaw:(e,t,n)=>Ro(Po,e,t,n),constants:{Z_NO_FLUSH:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1}};function Bo(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++}else if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))i(e,!0);a++}else 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 Vo(e){let t=[...e];return Object.defineProperty(t,"parseFlags",{value:()=>Bo(t),enumerable:!1,writable:!1,configurable:!1}),t}const Ho=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},Uo={ms:1,s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:26298e5,y:315576e5};function Wo(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*Uo[i])}function Go(e){return e<10?`0${e}`:String(e)}const Ko={parseDuration:Wo,ago(e,t=/* @__PURE__ */ new Date){return new Date(t.getTime()-Wo(e))},range(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime());return{start:new Date(n.getTime()-Wo(e)),end:n}},future(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime());return{start:n,end:new Date(n.getTime()+Wo(e))}},gmailDate(e,t=/* @__PURE__ */ new Date){let n=new Date(t.getTime()-Wo(e));return`${n.getFullYear()}/${Go(n.getMonth()+1)}/${Go(n.getDate())}`}};function qo(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}var Q=class extends Error{code;constructor(e){super(`Process exited with code ${e}`),this.code=e,this.name=`NodeExitError`}};function Jo(e){let t=Number(e);return Number.isFinite(t)?t:0}function Yo(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 Xo(e){let t=/* @__PURE__ */ TypeError(`The "code" argument must be of type number. Received ${Yo(e)}`);return t.code=`ERR_INVALID_ARG_TYPE`,t}function Zo(e){let t=/* @__PURE__ */ 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 Qo(e){if(e!=null){if(typeof e==`string`){let t=Number(e);if(e!==``&&Number.isInteger(t))return t===0?0:t;throw Xo(e)}if(typeof e==`number`){if(Number.isInteger(e))return e===0?0:e;throw Zo(e)}throw Xo(e)}}function $o(e){if(typeof e==`string`)return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function es(e){return`${e.map($o).join(` `)}\n`}function ts(e){return e===void 0?`default`:String(e)}function ns(){return typeof performance<`u`?performance.now():Date.now()}function rs(e){return`${e.toFixed(3)}ms`}function is(e,t,n){let r=es(n);e(t>0?`${` `.repeat(t)}${r}`:r)}function as(e,t,n){if(t)return;if(n.length===0){e(`Assertion failed`);return}let[r,...i]=n;e(`Assertion failed: ${$o(r)}`,...i)}function os(e,t,n,r){e(r.length>0?`Trace: ${r.map($o).join(` `)}`:`Trace:`);let i=(/* @__PURE__ */ Error()).stack;if(!i)return;let a=i.split(`
34
34
  `).slice(3).join(`
35
35
  `);if(!a)return;let o=a.endsWith(`
36
36
  `)?a:`${a}\n`;t(n>0?`${` `.repeat(n)}${o}`:o)}function ss(e,t,n){let r=ts(n);e.has(r)?t(`Label '${r}' already exists for console.time()`):e.set(r,ns())}function cs(e,t,n,r){let i=ts(r),a=e.get(i);a===void 0?t(`No such label '${i}' for console.timeEnd()`):(e.delete(i),n(`${i}: ${rs(ns()-a)}`))}function ls(e,t,n,r,i){let a=ts(r),o=e.get(a);if(o===void 0){t(`No such label '${a}' for console.timeLog()`);return}let s=`${a}: ${rs(ns()-o)}`;i.length===0?n(s):n(s,...i)}function us(e,t,n){let r=ts(n),i=(e.get(r)??0)+1;e.set(r,i),t(`${r}: ${i}`)}function ds(e,t,n){let r=ts(n);e.has(r)?e.set(r,0):t(`Count for '${r}' does not exist`)}function fs(e,t,n){n.length>0&&t(...n),e.depth+=1}function ps(e){e.depth>0&&--e.depth}function ms(e,t){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i={depth:0},a=(...t)=>is(e,i.depth,t),o=(...e)=>is(t,i.depth,e),s=(...e)=>fs(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:()=>ps(i),assert:(e,...t)=>as(o,e,t),trace:(...e)=>os(o,t,i.depth,e),time:e=>ss(r,o,e),timeEnd:e=>cs(r,o,a,e),timeLog:(e,...t)=>ls(r,o,a,e,t),count:e=>us(n,a,e),countReset:e=>ds(n,o,e)}}function hs(e,t){return e.process===void 0?(e.process=t,()=>{e.process===t&&delete e.process}):()=>void 0}function gs(e,t,n){return Object.assign(new qe,{fd:e,write:e=>(t(e),!0),end:()=>void 0,isTTY:n})}function _s(e,t,n){let r=!!e.env?.NO_COLOR,i=!1,a,o,s=e=>{i=!0,o=e,a=e},c=ys(e.stdin??``,s),u=Vo(e.argv),d=gs(1,t,!r),f=gs(2,n,!r);return{processShim:{argv:u,env:e.env,versions:{node:l},version:`v${l}`,platform:`linux`,arch:`x64`,cwd:()=>e.cwd,get exitCode(){return a},set exitCode(e){a=Qo(e)},exit:(...e)=>{if(e.length===0){let e=Jo(a);throw s(e),new Q(e)}a=Qo(e[0]);let t=Jo(a);throw s(t),new Q(t)},stdin:c,stdout:d,stderr:f},getDidCallProcessExit:()=>i,getExitCode:()=>Jo(i?o:a),recordExit:s}}var vs=class extends Ct.Stream{isTTY=!1;fd=0;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;else 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 Q){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 ys(e,t){return new vs(e,t)}function bs(e){if(e===``)return[];let t=e.split(`
@@ -38,4 +38,4 @@ for (var __vm_i = 0; __vm_i < __vm_fns.length; __vm_i++) {
38
38
  `)){if(a.startsWith(`agent-session: `)){let e=a.slice(15),t=e.lastIndexOf(` `),i=t===-1?``:e.slice(0,t),o=t===-1?``:e.slice(t+1);if(i&&(o===`created`||o===`resumed`)){n=i,r=o;continue}}else if(a.startsWith(`agent-usage: `))try{let e=JSON.parse(a.slice(13));if(e&&typeof e.input==`number`&&typeof e.cost==`number`){i=e;continue}}catch{}a!==``&&t.push(a)}return{stderr:t.join(`
39
39
  `),sessionId:n,sessionStatus:r,usage:i}}function Zs(e,t){let n=t.cwd,r=async(t,r)=>{let i=r??{};if(i.resume===!0&&(i.session===void 0||i.session===``))return{finalText:``,exitCode:1,stderr:`agent: resume requires a session id`};let a=await e.spawn(Ys(t,i,n)),o=typeof a.exitCode==`number`?a.exitCode:0,s=String(a.stdout??``).replace(/\n+$/,``),c=Xs(String(a.stderr??``).replace(/\n+$/,``));return{finalText:s,exitCode:o,stderr:c.stderr,...c.sessionId?{sessionId:c.sessionId,sessionStatus:c.sessionStatus}:{},...c.usage?{usage:c.usage}:{}}},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}`:``}`);let a=i.finalText;if(n.schema)try{a=JSON.parse(i.finalText)}catch{throw Error(`agent: schema response was not valid JSON (exit ${i.exitCode}): ${i.finalText.slice(0,200)}`)}if(n.session!==void 0||n.resume===!0||n.envelope===!0){let e={output:a};return i.sessionId&&(e.sessionId=i.sessionId,e.sessionStatus=i.sessionStatus),i.usage&&(e.usage=i.usage),e}return a});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 Qs(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 $s(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 ec(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 ec(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 tc(e){return{findTab:t=>e.call(`browser`,`findTab`,[rc(t)]),ensureTab:(t,n={})=>e.call(`browser`,`ensureTab`,[t,ic(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),nc(n,!1)]),evalAsync:(t,n)=>e.call(`browser`,`evalAsync`,[$(t),nc(n,!0)]),cookie:(t,n)=>e.call(`browser`,`cookie`,[$(t),n]),localStorage:(t,n)=>e.call(`browser`,`localStorage`,[$(t),n]),fetch:(t,n,r={})=>C(n,r).then(n=>e.call(`browser`,`evalAsync`,[$(t),n])),websocket:Qs(e)}}function nc(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 rc(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 ic(e){return e.matchUrl===void 0?{}:{matchUrl:e.matchUrl instanceof RegExp?e.matchUrl.source:e.matchUrl}}function ac(e){return{register(t){let n=null,r=e.onEvent(`computer-call`,r=>{let i=r;i.id===t.id&&sc(e,t,i,{getStop:()=>n,setStop:e=>{n=e}})}),i=oc(t);return e.call(`computer`,`register`,[i]).catch(()=>{}),()=>{n?.(),n=null,r(),e.call(`computer`,`unregister`,[t.id]).catch(()=>{})}}}}function oc(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 sc(e,t,n,r){let i;try{i=await cc(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 cc(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 lc(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 lc(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 uc(e){return e===`SIGKILL`?137:e===`SIGINT`?130:143}function dc(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:uc(t)}),Promise.resolve(!0)),stdin:{write:e=>{!s&&!u&&o.push(e)},end:()=>m()},done:p}}});return l.exec=l,l}const fc=/* @__PURE__ */ new Set([204,205,304]),pc=/* @__PURE__ */ new Set([`content-encoding`,`transfer-encoding`,`content-length`]);function mc(e,t){let n=hc(e.body),r=gc(e.headers),i=fc.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 vc(a,n),a}function hc(e){return e.byteLength===0?/* @__PURE__ */ new Uint8Array:e.slice()}function gc(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(!pc.has(n.toLowerCase()))try{t.set(n,r)}catch{}return t}const _c=Symbol(`slicc.realmBufferedBody`);function vc(e,t){if(_c in e)return;Object.defineProperty(e,_c,{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,yc(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 yc(e){try{let t=e.body;t&&!t.locked&&t.getReader()}catch{}}function bc(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 xc(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Sc(e){return e==null?[]:Array.isArray(e)?e:[e]}function Cc(e,t){let n=t.handle,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=!1,o=null,s=e=>{let t=e;if(!t||t.handle!==n)return;let i={reportId:t.reportId,data:xc(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,bc(r)]),sendFeatureReport:(t,r)=>e.call(`hid`,`sendFeatureReport`,[n,t,bc(r)]),receiveFeatureReport:async t=>xc((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 wc(e){return{list:async()=>(await e.call(`hid`,`list`,[])).map(t=>Cc(e,t)),request:async t=>{let n=(await e.call(`hid`,`request`,[Sc(t)]))[0];if(!n)throw Error(`No device selected.`);return Cc(e,n)}}}function Tc(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 Ec=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 };`)}},Dc=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=Tc(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 Ec(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 Ec(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?.())}},Oc=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 Dc(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()}},kc=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 Dc(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 Oc(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 kc(e),n=async(t,n)=>new kc(e);return{chromium:{launch:t,connect:n,connectOverCDP:n},firefox:{launch:t,connect:n},webkit:{launch:t,connect:n}}}function jc(e){return{...e,time:Ko,fmt:st,pool:Ho}}function Mc(e,t){return e?.startsWith(`/`)?qo(e):t}function Nc(e){return e.includes(`require`)||e.includes(`import`)||/(?:^|[;\n}])\s*export\b/.test(e)}async function Pc(e,t,n,r){return Nc(t)?e.call(`module`,`buildGraph`,[t,Mc(r,n),r]):{files:[],entryMap:{},edges:{},edgeErrors:{},errors:{}}}function Fc(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 Ic(e){return{playwright:Ac(e)}}function Lc(e){let{graph:t,fsBridge:n,processShim:r,childProcess:i,nodeConsole:a,sliccyModules:o,shimmedPackages:l={},nodeReadline:u,nodeOsModule:d=Qn,nodeUtilModule:p=Zt}=e,h=new Map(t.files.map(e=>[e.path,e.cjsSource])),g=new Map(t.files.map(e=>[e.path,e.kind])),_=/* @__PURE__ */ new Map,v=qn({requireFrom:(e,t)=>T(e,t),resolveFrom:(e,t)=>w(e,t)}),y=Ln(()=>{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:Bc(e,o)};let t=e.startsWith(`node:`)?e.slice(5):e,a=Rc(t,{fsBridge:n,processShim:r,childProcess:i,nodeOsModule:d,nodeUtilModule:p,nodePathModule:y,nodeReadline:u,nodeModule:v});if(a.hit)return a;if(m.has(t))throw f(e,t);if(c.has(t))throw Hc(e,t);return t in l?{hit:!0,value:l[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):zc(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(qo(e),e)),Function(...c,i)(...l),g.get(e)===`cjs`&&Fc(o.exports),o.exports}function C(e){return h.has(e)}function w(e,n){if(s(n))return n;let r=t.edges[e]?.[n];if(r)return r;let i=qo(e);if(Kn(n)){let e=Wn(i,n,C);if(e)return e}else{let e=Gn(i,n,C);if(e)return e}let a=t.edgeErrors?.[e]?.[n];throw a?Error(a):zc(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 Rc(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:Tn}: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:_t}:e===`assert/strict`?{hit:!0,value:gt}:e===`util`?{hit:!0,value:o}:e===`events`?{hit:!0,value:Je}:e===`os`?{hit:!0,value:a}:e===`tty`?{hit:!0,value:$n}:e===`stream`?{hit:!0,value:Ct}:e===`url`?{hit:!0,value:E}:e===`zlib`?{hit:!0,value:zo}:e===`vm`?{hit:!0,value:yr}: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 zc(e){if(e.startsWith(`.`)||e.startsWith(`/`)||e.startsWith(`node:`))return/* @__PURE__ */ Error(`Cannot find module '${e}'`);let t=e.startsWith(`@`)?e.split(`/`).slice(0,2).join(`/`):e.split(`/`)[0];return/* @__PURE__ */ Error(`Cannot find module '${e}' (run: ipk install ${t})`)}function Bc(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 Vc={http:` Use fetch() instead.`,https:` Use fetch() instead.`,crypto:` Use globalThis.crypto (Web Crypto API) instead.`};function Hc(e,t){return/* @__PURE__ */ Error(`require('${e}'): Node built-in '${t}' is not available in the browser environment.${Vc[t]||``}`)}async function Uc(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";
40
40
  `:``}${e}`);try{return await s(...a),0}catch(e){return e instanceof Q?e.code:(n(`${e instanceof Error?e.stack??e.message:String(e)}\n`),1)}}function Wc(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?bc(t.until):void 0,timeoutMs:t.timeoutMs}]),write:t=>e.call(`serial`,`write`,[n,bc(t)]),getSignals:()=>e.call(`serial`,`getSignals`,[n]),setSignals:t=>e.call(`serial`,`setSignals`,[n,t])}}function Gc(e){return{list:async()=>(await e.call(`serial`,`list`,[])).map(t=>Wc(e,t)),request:async t=>Wc(e,await e.call(`serial`,`request`,[Sc(t)]))}}function Kc(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=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set,f=/* @__PURE__ */ 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 qc(e,t){let n=t.handle,r=e=>({status:e.status,data:xc(e.bytes)}),i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ 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,bc(r)]),transferIn:async(t,i)=>r(await e.call(`usb`,`transferIn`,[n,t,i])),transferOut:(t,r)=>e.call(`usb`,`transferOut`,[n,t,bc(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 Jc(e){return{list:async()=>(await e.call(`usb`,`list`,[])).map(t=>qc(e,t)),request:async t=>qc(e,await e.call(`usb`,`request`,[Sc(t)]))}}function Yc(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t<0?``:t===0?`/`:e.substring(0,t)}function Xc(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 Zc(e){return/^[A-Za-z0-9_\-./:@]+$/.test(e)?e:`'`+e.replace(/'/g,`'\\''`)+`'`}function Qc(e,t){return e===``?t:e===`/`?`/${t}`:`${e}/${t}`}function $c(e){let t=Yc(e.argv[1]??``),n=Xc(t),r=Qc(n,`references`),i=Qc(n,`assets`),a=Qc(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)+`
41
- `),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 ${Zc(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 el=65536;function tl(e,t){if(!t)return e;let n=e+t;return n.length<=el?n:n.slice(n.length-el)}async function nl(e,t,n,r){let i;try{i=await e.call(`vfs`,`snapshot`,r?[t,r]:[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),i={entries:[]}}return new _e(i)}function rl(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function il(e,t,n,r){globalThis.__slicc_mountVfs=async(i,a)=>{let{mountVfsIntoEmscripten:o}=await import(`./emscripten-vfs-hook-C43De1yx.js`);return o(i,{bridge:e,syncFs:t,cwd:n,warn:e=>r.writeStderr(`slicc: ${e}\n`)},a)}}function al(e,t,n,r,i){let a=x(e,t),o=y(e,a);if(Object.assign(r,Ke(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&&il(o,n,e.cwd,i),e.syncFsToken)return _(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:v(a),noDefaultDeadline:!0}:{}})}function ol(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function sl(e,t,n){let r=Ze({isTTY:!e,noColor:e});return{colorApi:r,cliApi:Ye({writeStdout:t,writeStderr:n,exit:e=>{throw new Q(e)},color:r})}}function cl(e,t,n){return{readStdinBytes:()=>ye(e.stdin??``),writeStdout:t,writeStderr:n}}function ll(e){return{usbBridge:Jc(e),serialBridge:Gc(e),hidBridge:wc(e),computerBridge:ac(e)}}async function ul(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:tl(r.stdout,a):r.stderr=n?r.stderr+a:tl(r.stderr,a),t.postMessage({type:`realm-output`,stream:e,chunk:a})},a=e=>{i(`stdout`,e)},o=e=>{i(`stderr`,e)},s=ms(a,o),c=_s(e,a,o),{colorApi:l,cliApi:u}=sl(!!e.env?.NO_COLOR,a,o),f=new d(t),p=cl(e,a,o),m=je(f,D,p),h=await nl(f,e.cwd,rl(e,o),S(e)?{timeBudgetMs:150}:void 0),g=al(e,t,h,m,p),_=dc(f,h,e.cwd,o),v=Zs(_,{cwd:e.cwd}),y=$c({argv:e.argv,fs:m,exec:_}),b=tc(f),{usbBridge:x,serialBridge:C,hidBridge:w,computerBridge:T}=ll(f),E=qs({fetch:D});async function D(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return mc(await f.call(`fetch`,`request`,[n,await $s(t,e)]),n)}let O=jc({exec:_,agent:v,skill:y,http:E,browser:b,usb:x,serial:C,hid:w,computer:T,cli:u,color:l}),k=e.filename,ee=qo(k),A=await Pc(f,e.code,e.cwd,k),te=Lc({graph:A,fsBridge:m,processShim:c.processShim,childProcess:un(_,g),nodeConsole:s,sliccyModules:O,shimmedPackages:Ic(f),nodeReadline:Ts({output:{write:a},onExit:c.recordExit}),nodeOsModule:Zn(e.env),nodeUtilModule:Xt(e=>o(`${e}\n`),()=>c.processShim.argv.slice(2))}).require,ne={exports:{},filename:e.filename},re=A.entrySource!==void 0;await dl({entryCode:A.entrySource??e.code,isEsmEntry:re,entryIsModule:A.entryIsModule===!0,filename:k,dirname:ee,proc:c,nodeConsole:s,requireShim:te,moduleShim:ne,realmFetch:D,writeStderr:o,rpc:f,syncFs:h,output:r,port:t})}async function dl(e){let t=globalThis;ol(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=Kc(globalThis,{onCallbackError(e){if(!(e instanceof Q))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-BczvKQ6G.js`),i=r(globalThis);n.install(),i.install();let a=hs(globalThis,e.proc.processShim),{watchUnhandledRejections:o}=await import(`./realm-unhandled-rejections-DEF7XXLw.js`),s=o(globalThis,{writeStderr:e.writeStderr,didExit:e.proc.getDidCallProcessExit,recordExit:e.proc.recordExit});try{let r=await fl({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,fatal:s.fatal});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{s.dispose(),n.clearPending(),n.restore(),i.restore(),a()}}async function fl(e){let t=await Uc(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await pl(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await ml(e.rpc,e.timers,e.bodyReads,e.proc,e.fatal),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await pl(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function pl(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 ml(e,t,n,r,i){await t.tick();let a=0;for(;!r.getDidCallProcessExit()&&a<2;){let o=[];e.pendingCount>0&&o.push(e.waitForProgress()),t.pendingCount>0&&o.push(t.waitForProgress()),n.pendingCount>0&&o.push(n.waitForProgress()),o.length===0?(a+=1,await t.tick()):(a=0,o.push(i),await Promise.race(o),r.getDidCallProcessExit()||await t.tick())}}function hl(){let e=/* @__PURE__ */ new Set,t=/* @__PURE__ */ 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 gl(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=hl(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&ul(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 _l(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=hl(),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{gl as createInProcessJsRealmFactory,_l as createInProcessPyRealmFactory,Q as t};
41
+ `),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 ${Zc(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 el=65536;function tl(e,t){if(!t)return e;let n=e+t;return n.length<=el?n:n.slice(n.length-el)}async function nl(e,t,n,r){let i;try{i=await e.call(`vfs`,`snapshot`,r?[t,r]:[t])}catch(e){n?.(e instanceof Error?e.message:String(e)),i={entries:[]}}return new _e(i)}function rl(e,t){if(e.syncFsToken)return e=>t(`[sync-fs] snapshot failed, sync metadata will be incomplete: ${e}\n`)}function il(e,t,n,r){globalThis.__slicc_mountVfs=async(i,a)=>{let{mountVfsIntoEmscripten:o}=await import(`./emscripten-vfs-hook-C43De1yx.js`);return o(i,{bridge:e,syncFs:t,cwd:n,warn:e=>r.writeStderr(`slicc: ${e}\n`)},a)}}function al(e,t,n,r,i){let a=x(e,t),o=y(e,a);if(Object.assign(r,Ke(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&&il(o,n,e.cwd,i),e.syncFsToken)return _(e.syncFsToken,{syncFs:n,...o?{fsBridge:o}:{},...a?{transport:v(a),noDefaultDeadline:!0}:{}})}function ol(e=globalThis){Object.prototype.hasOwnProperty.call(e,`SLICC_VERSION`)||Object.defineProperty(e,"SLICC_VERSION",{value:i().version,writable:!1,enumerable:!1,configurable:!1})}function sl(e,t,n){let r=Ze({isTTY:!e,noColor:e});return{colorApi:r,cliApi:Ye({writeStdout:t,writeStderr:n,exit:e=>{throw new Q(e)},color:r})}}function cl(e,t,n){return{readStdinBytes:()=>ye(e.stdin??``),writeStdout:t,writeStderr:n}}function ll(e){return{usbBridge:Jc(e),serialBridge:Gc(e),hidBridge:wc(e),computerBridge:ac(e)}}async function ul(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:tl(r.stdout,a):r.stderr=n?r.stderr+a:tl(r.stderr,a),t.postMessage({type:`realm-output`,stream:e,chunk:a})},a=e=>{i(`stdout`,e)},o=e=>{i(`stderr`,e)},s=ms(a,o),c=_s(e,a,o),{colorApi:l,cliApi:u}=sl(!!e.env?.NO_COLOR,a,o),f=new d(t),p=cl(e,a,o),m=je(f,D,p),h=await nl(f,e.cwd,rl(e,o),S(e)?{timeBudgetMs:150}:void 0),g=al(e,t,h,m,p),_=dc(f,h,e.cwd,o),v=Zs(_,{cwd:e.cwd}),y=$c({argv:e.argv,fs:m,exec:_}),b=tc(f),{usbBridge:x,serialBridge:C,hidBridge:w,computerBridge:T}=ll(f),E=qs({fetch:D});async function D(e,t){let n=e instanceof Request?e.url:e instanceof URL?e.toString():String(e);return mc(await f.call(`fetch`,`request`,[n,await $s(t,e)]),n)}let O=jc({exec:_,agent:v,skill:y,http:E,browser:b,usb:x,serial:C,hid:w,computer:T,cli:u,color:l}),k=e.filename,ee=qo(k),A=await Pc(f,e.code,e.cwd,k),te=Lc({graph:A,fsBridge:m,processShim:c.processShim,childProcess:un(_,g),nodeConsole:s,sliccyModules:O,shimmedPackages:Ic(f),nodeReadline:Ts({output:{write:a},onExit:c.recordExit}),nodeOsModule:Zn(e.env),nodeUtilModule:Xt(e=>o(`${e}\n`),()=>c.processShim.argv.slice(2))}).require,ne={exports:{},filename:e.filename},re=A.entrySource!==void 0;await dl({entryCode:A.entrySource??e.code,isEsmEntry:re,entryIsModule:A.entryIsModule===!0,filename:k,dirname:ee,proc:c,nodeConsole:s,requireShim:te,moduleShim:ne,realmFetch:D,writeStderr:o,rpc:f,syncFs:h,output:r,port:t})}async function dl(e){let t=globalThis;ol(),t.__slicc_compileWasm=t=>e.rpc.call(`wasm`,`compile`,[t]);let n=Kc(globalThis,{onCallbackError(e){if(!(e instanceof Q))throw e}}),{createBodyReadHandleTracker:r}=await import(`./realm-body-handles-BczvKQ6G.js`),i=r(globalThis);n.install(),i.install();let a=hs(globalThis,e.proc.processShim),{watchUnhandledRejections:o}=await import(`./realm-unhandled-rejections-CHNRwgmK.js`),s=o(globalThis,{writeStderr:e.writeStderr,didExit:e.proc.getDidCallProcessExit,recordExit:e.proc.recordExit});try{let r=await fl({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,fatal:s.fatal});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{s.dispose(),n.clearPending(),n.restore(),i.restore(),a()}}async function fl(e){let t=await Uc(e.entryCode,e.bridges,e.writeStderr,e.isEsmEntry);return await pl(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()?(e.timers.clearPending(),e.proc.getExitCode()):(await ml(e.rpc,e.timers,e.bodyReads,e.proc,e.fatal),e.proc.getDidCallProcessExit()&&e.timers.clearPending(),await pl(e.rpc,e.syncFs,e.writeStderr),e.proc.getDidCallProcessExit()||t===0?e.proc.getExitCode():t)}async function pl(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 ml(e,t,n,r,i){await t.tick();let a=0;for(;!r.getDidCallProcessExit()&&a<2;){let o=[];e.pendingCount>0&&o.push(e.waitForProgress()),t.pendingCount>0&&o.push(t.waitForProgress()),n.pendingCount>0&&o.push(n.waitForProgress()),o.length===0?(a+=1,await t.tick()):(a=0,o.push(i),await Promise.race(o),r.getDidCallProcessExit()||await t.tick())}}function hl(){let e=/* @__PURE__ */ new Set,t=/* @__PURE__ */ 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 gl(){return async({kind:e})=>{if(e!==`js`)throw Error(`createInProcessJsRealmFactory: only kind:js is supported`);let{realmSide:t,hostSide:n}=hl(),r=e=>{if(e.data?.type!==`realm-init`)return;t.removeEventListener(`message`,r);let n=e.data;n.kind===`js`&&ul(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 _l(){return async({kind:e})=>{if(e!==`py`)throw Error(`createInProcessPyRealmFactory: only kind:py is supported`);let{realmSide:t,hostSide:n}=hl(),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{gl as createInProcessJsRealmFactory,_l as createInProcessPyRealmFactory,Q as t};
@@ -1 +1 @@
1
- import{t as e}from"./realm-inprocess-CVgRJnFl.js";function t(e){return e instanceof Error?`${e.stack??`${e.name}: ${e.message}`}\n`:`Uncaught ${typeof e==`string`?`'${e}'`:String(e)}\n`}function n(n,r){let i=()=>void 0,a=new Promise(e=>{i=e});if(typeof n.addEventListener!=`function`)return{fatal:a,dispose:()=>void 0};let o=n=>{let a=n.reason;n.preventDefault(),!(a instanceof e||r.didExit())&&(r.writeStderr(t(a)),r.recordExit(1),i())};return n.addEventListener(`unhandledrejection`,o),{fatal:a,dispose:()=>n.removeEventListener?.(`unhandledrejection`,o)}}export{n as watchUnhandledRejections};
1
+ import{t as e}from"./realm-inprocess-BKQjSHYg.js";function t(e){return e instanceof Error?`${e.stack??`${e.name}: ${e.message}`}\n`:`Uncaught ${typeof e==`string`?`'${e}'`:String(e)}\n`}function n(n,r){let i=()=>void 0,a=new Promise(e=>{i=e});if(typeof n.addEventListener!=`function`)return{fatal:a,dispose:()=>void 0};let o=n=>{let a=n.reason;n.preventDefault(),!(a instanceof e||r.didExit())&&(r.writeStderr(t(a)),r.recordExit(1),i())};return n.addEventListener(`unhandledrejection`,o),{fatal:a,dispose:()=>n.removeEventListener?.(`unhandledrejection`,o)}}export{n as watchUnhandledRejections};
@@ -1 +1 @@
1
- import{t as e}from"./js-realm-worker-gD3Hmuvc.js";function t(e){return e instanceof Error?`${e.stack??`${e.name}: ${e.message}`}\n`:`Uncaught ${typeof e==`string`?`'${e}'`:String(e)}\n`}function n(n,r){let i=()=>void 0,a=new Promise(e=>{i=e});if(typeof n.addEventListener!=`function`)return{fatal:a,dispose:()=>void 0};let o=n=>{let a=n.reason;n.preventDefault(),!(a instanceof e||r.didExit())&&(r.writeStderr(t(a)),r.recordExit(1),i())};return n.addEventListener(`unhandledrejection`,o),{fatal:a,dispose:()=>n.removeEventListener?.(`unhandledrejection`,o)}}export{n as watchUnhandledRejections};
1
+ import{t as e}from"./js-realm-worker-UD39nhWx.js";function t(e){return e instanceof Error?`${e.stack??`${e.name}: ${e.message}`}\n`:`Uncaught ${typeof e==`string`?`'${e}'`:String(e)}\n`}function n(n,r){let i=()=>void 0,a=new Promise(e=>{i=e});if(typeof n.addEventListener!=`function`)return{fatal:a,dispose:()=>void 0};let o=n=>{let a=n.reason;n.preventDefault(),!(a instanceof e||r.didExit())&&(r.writeStderr(t(a)),r.recordExit(1),i())};return n.addEventListener(`unhandledrejection`,o),{fatal:a,dispose:()=>n.removeEventListener?.(`unhandledrejection`,o)}}export{n as watchUnhandledRejections};