@socketsecurity/lib 3.2.2 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/abort.js +1 -1
- package/dist/agent.js +1 -1
- package/dist/ansi.js +1 -1
- package/dist/argv/flags.js +1 -1
- package/dist/argv/parse.js +1 -1
- package/dist/arrays.js +1 -1
- package/dist/bin.js +1 -1
- package/dist/cacache.js +1 -1
- package/dist/cache-with-ttl.js +1 -1
- package/dist/constants/agents.js +1 -1
- package/dist/constants/core.js +1 -1
- package/dist/constants/encoding.js +1 -1
- package/dist/constants/github.js +1 -1
- package/dist/constants/licenses.js +1 -1
- package/dist/constants/node.js +1 -1
- package/dist/constants/packages.js +1 -1
- package/dist/constants/paths.js +1 -1
- package/dist/constants/platform.js +1 -1
- package/dist/constants/process.js +1 -1
- package/dist/constants/socket.js +1 -1
- package/dist/constants/testing.js +1 -1
- package/dist/constants/time.js +1 -1
- package/dist/constants/typescript.js +1 -1
- package/dist/cover/code.js +1 -1
- package/dist/cover/formatters.js +1 -1
- package/dist/cover/type.js +1 -1
- package/dist/cover/types.js +1 -1
- package/dist/debug.js +1 -1
- package/dist/dlx-binary.js +1 -1
- package/dist/dlx-manifest.js +1 -1
- package/dist/dlx-package.js +1 -1
- package/dist/dlx.js +1 -1
- package/dist/effects/pulse-frames.js +4 -4
- package/dist/effects/text-shimmer.js +1 -1
- package/dist/effects/types.js +1 -1
- package/dist/effects/ultra.js +1 -1
- package/dist/env/ci.js +1 -1
- package/dist/env/debug.js +1 -1
- package/dist/env/github.js +1 -1
- package/dist/env/helpers.js +1 -1
- package/dist/env/home.js +1 -1
- package/dist/env/locale.js +1 -1
- package/dist/env/node-auth-token.js +1 -1
- package/dist/env/node-env.js +1 -1
- package/dist/env/npm.js +1 -1
- package/dist/env/package-manager.js +1 -1
- package/dist/env/path.js +1 -1
- package/dist/env/pre-commit.js +1 -1
- package/dist/env/rewire.js +1 -1
- package/dist/env/shell.js +1 -1
- package/dist/env/socket-cli-shadow.js +1 -1
- package/dist/env/socket-cli.js +1 -1
- package/dist/env/socket.js +1 -1
- package/dist/env/temp-dir.js +1 -1
- package/dist/env/term.js +1 -1
- package/dist/env/test.js +1 -1
- package/dist/env/windows.js +1 -1
- package/dist/env/xdg.js +1 -1
- package/dist/env.js +1 -1
- package/dist/external/@inquirer/confirm.js +16 -15
- package/dist/external/@inquirer/input.js +16 -15
- package/dist/external/@inquirer/password.js +17 -16
- package/dist/external/@inquirer/search.js +18 -17
- package/dist/external/@inquirer/select.js +19 -18
- package/dist/external/@npmcli/package-json/lib/read-package.js +7 -1
- package/dist/external/@npmcli/package-json/lib/sort.js +6 -1
- package/dist/external/@npmcli/package-json.js +18 -0
- package/dist/external/@npmcli/promise-spawn.js +2 -1
- package/dist/external/@socketregistry/is-unicode-supported.js +2 -1
- package/dist/external/@socketregistry/packageurl-js.js +3 -2
- package/dist/external/@socketregistry/yocto-spinner.js +5 -4
- package/dist/external/@yarnpkg/extensions.js +2 -1
- package/dist/external/cacache.js +10 -9
- package/dist/external/debug.js +2 -5
- package/dist/external/del.js +3 -2
- package/dist/external/fast-glob.js +3 -2
- package/dist/external/fast-sort.js +2 -1
- package/dist/external/get-east-asian-width.js +2 -1
- package/dist/external/libnpmexec.js +6 -0
- package/dist/external/libnpmpack.js +68 -71
- package/dist/external/make-fetch-happen.js +17 -20
- package/dist/external/normalize-package-data.js +3 -2
- package/dist/external/npm-package-arg.js +3 -2
- package/dist/external/pacote.js +38 -41
- package/dist/external/picomatch.js +2 -1
- package/dist/external/semver.js +2 -1
- package/dist/external/spdx-correct.js +2 -1
- package/dist/external/spdx-expression-parse.js +2 -1
- package/dist/external/streaming-iterables.js +2 -1
- package/dist/external/validate-npm-package-name.js +2 -1
- package/dist/external/which.js +2 -1
- package/dist/external/yargs-parser.js +2 -1
- package/dist/external/yoctocolors-cjs.js +2 -1
- package/dist/external/zod.js +10 -9
- package/dist/fs.js +1 -1
- package/dist/functions.js +1 -1
- package/dist/git.js +1 -1
- package/dist/github.js +1 -1
- package/dist/globs.js +1 -1
- package/dist/http-request.js +1 -1
- package/dist/ipc.js +1 -1
- package/dist/json.js +1 -1
- package/dist/links/index.js +1 -1
- package/dist/logger.d.ts +29 -4
- package/dist/logger.js +34 -5
- package/dist/maintained-node-versions.js +1 -1
- package/dist/memoization.js +1 -1
- package/dist/objects.js +1 -1
- package/dist/packages/editable.js +1 -1
- package/dist/packages/exports.js +1 -1
- package/dist/packages/isolation.js +1 -1
- package/dist/packages/licenses.js +1 -1
- package/dist/packages/manifest.js +1 -1
- package/dist/packages/normalize.js +1 -1
- package/dist/packages/operations.js +1 -1
- package/dist/packages/paths.js +1 -1
- package/dist/packages/provenance.js +1 -1
- package/dist/packages/specs.js +1 -1
- package/dist/packages/validation.js +1 -1
- package/dist/packages.js +1 -1
- package/dist/path.js +1 -1
- package/dist/paths/rewire.js +1 -1
- package/dist/paths.js +1 -1
- package/dist/performance.js +1 -1
- package/dist/process-lock.js +1 -1
- package/dist/promise-queue.js +1 -1
- package/dist/promises.js +1 -1
- package/dist/regexps.js +1 -1
- package/dist/sea.js +1 -1
- package/dist/shadow.js +1 -1
- package/dist/signal-exit.js +1 -1
- package/dist/sorts.js +1 -1
- package/dist/spawn.js +1 -1
- package/dist/spinner.js +1 -1
- package/dist/ssri.js +1 -1
- package/dist/stdio/clear.js +1 -1
- package/dist/stdio/divider.js +1 -1
- package/dist/stdio/footer.js +1 -1
- package/dist/stdio/header.js +1 -1
- package/dist/stdio/mask.js +1 -1
- package/dist/stdio/progress.js +1 -1
- package/dist/stdio/prompts.js +1 -1
- package/dist/stdio/stderr.js +1 -1
- package/dist/stdio/stdout.js +1 -1
- package/dist/streams.js +1 -1
- package/dist/strings.js +1 -1
- package/dist/suppress-warnings.js +1 -1
- package/dist/tables.js +1 -1
- package/dist/temporary-executor.js +1 -1
- package/dist/themes/context.js +1 -1
- package/dist/themes/index.js +1 -1
- package/dist/themes/themes.js +1 -1
- package/dist/themes/types.js +1 -1
- package/dist/themes/utils.js +1 -1
- package/dist/types.js +1 -1
- package/dist/url.js +1 -1
- package/dist/utils/get-ipc.js +1 -1
- package/dist/validation/json-parser.js +1 -1
- package/dist/validation/types.js +1 -1
- package/dist/versions.js +1 -1
- package/dist/words.js +1 -1
- package/dist/zod.js +1 -1
- package/package.json +1 -1
- package/dist/abort.js.map +0 -7
- package/dist/agent.js.map +0 -7
- package/dist/ansi.js.map +0 -7
- package/dist/argv/flags.js.map +0 -7
- package/dist/argv/parse.js.map +0 -7
- package/dist/arrays.js.map +0 -7
- package/dist/bin.js.map +0 -7
- package/dist/cacache.js.map +0 -7
- package/dist/cache-with-ttl.js.map +0 -7
- package/dist/constants/agents.js.map +0 -7
- package/dist/constants/core.js.map +0 -7
- package/dist/constants/encoding.js.map +0 -7
- package/dist/constants/github.js.map +0 -7
- package/dist/constants/licenses.js.map +0 -7
- package/dist/constants/node.js.map +0 -7
- package/dist/constants/packages.js.map +0 -7
- package/dist/constants/paths.js.map +0 -7
- package/dist/constants/platform.js.map +0 -7
- package/dist/constants/process.js.map +0 -7
- package/dist/constants/socket.js.map +0 -7
- package/dist/constants/testing.js.map +0 -7
- package/dist/constants/time.js.map +0 -7
- package/dist/constants/typescript.js.map +0 -7
- package/dist/cover/code.js.map +0 -7
- package/dist/cover/formatters.js.map +0 -7
- package/dist/cover/type.js.map +0 -7
- package/dist/cover/types.js.map +0 -7
- package/dist/debug.js.map +0 -7
- package/dist/dlx-binary.js.map +0 -7
- package/dist/dlx-manifest.js.map +0 -7
- package/dist/dlx-package.js.map +0 -7
- package/dist/dlx.js.map +0 -7
- package/dist/effects/pulse-frames.js.map +0 -7
- package/dist/effects/text-shimmer.js.map +0 -7
- package/dist/effects/types.js.map +0 -7
- package/dist/effects/ultra.js.map +0 -7
- package/dist/env/ci.js.map +0 -7
- package/dist/env/debug.js.map +0 -7
- package/dist/env/github.js.map +0 -7
- package/dist/env/helpers.js.map +0 -7
- package/dist/env/home.js.map +0 -7
- package/dist/env/locale.js.map +0 -7
- package/dist/env/node-auth-token.js.map +0 -7
- package/dist/env/node-env.js.map +0 -7
- package/dist/env/npm.js.map +0 -7
- package/dist/env/package-manager.js.map +0 -7
- package/dist/env/path.js.map +0 -7
- package/dist/env/pre-commit.js.map +0 -7
- package/dist/env/rewire.js.map +0 -7
- package/dist/env/shell.js.map +0 -7
- package/dist/env/socket-cli-shadow.js.map +0 -7
- package/dist/env/socket-cli.js.map +0 -7
- package/dist/env/socket.js.map +0 -7
- package/dist/env/temp-dir.js.map +0 -7
- package/dist/env/term.js.map +0 -7
- package/dist/env/test.js.map +0 -7
- package/dist/env/windows.js.map +0 -7
- package/dist/env/xdg.js.map +0 -7
- package/dist/env.js.map +0 -7
- package/dist/external/@npmcli/package-json/index.js +0 -1
- package/dist/external/@socketregistry/is-unicode-supported.d.ts +0 -2
- package/dist/external/@socketregistry/yocto-spinner.d.ts +0 -12
- package/dist/external/@yarnpkg/extensions.d.ts +0 -4
- package/dist/external/cacache.d.ts +0 -86
- package/dist/external/debug.d.ts +0 -22
- package/dist/external/del.d.ts +0 -1
- package/dist/external/fast-sort.d.ts +0 -3
- package/dist/external/get-east-asian-width.d.ts +0 -5
- package/dist/external/libnpmexec.d.ts +0 -33
- package/dist/external/libnpmpack.d.ts +0 -2
- package/dist/external/make-fetch-happen.d.ts +0 -15
- package/dist/external/pacote.d.ts +0 -14
- package/dist/external/semver.d.ts +0 -2
- package/dist/external/yargs-parser.d.ts +0 -2
- package/dist/external/yoctocolors-cjs.d.ts +0 -52
- package/dist/external/zod.d.ts +0 -1
- package/dist/fs.js.map +0 -7
- package/dist/functions.js.map +0 -7
- package/dist/git.js.map +0 -7
- package/dist/github.js.map +0 -7
- package/dist/globs.js.map +0 -7
- package/dist/http-request.js.map +0 -7
- package/dist/ipc.js.map +0 -7
- package/dist/json.js.map +0 -7
- package/dist/links/index.js.map +0 -7
- package/dist/logger.js.map +0 -7
- package/dist/maintained-node-versions.js.map +0 -7
- package/dist/memoization.js.map +0 -7
- package/dist/objects.js.map +0 -7
- package/dist/packages/editable.js.map +0 -7
- package/dist/packages/exports.js.map +0 -7
- package/dist/packages/isolation.js.map +0 -7
- package/dist/packages/licenses.js.map +0 -7
- package/dist/packages/manifest.js.map +0 -7
- package/dist/packages/normalize.js.map +0 -7
- package/dist/packages/operations.js.map +0 -7
- package/dist/packages/paths.js.map +0 -7
- package/dist/packages/provenance.js.map +0 -7
- package/dist/packages/specs.js.map +0 -7
- package/dist/packages/validation.js.map +0 -7
- package/dist/packages.js.map +0 -7
- package/dist/path.js.map +0 -7
- package/dist/paths/rewire.js.map +0 -7
- package/dist/paths.js.map +0 -7
- package/dist/performance.js.map +0 -7
- package/dist/process-lock.js.map +0 -7
- package/dist/promise-queue.js.map +0 -7
- package/dist/promises.js.map +0 -7
- package/dist/regexps.js.map +0 -7
- package/dist/sea.js.map +0 -7
- package/dist/shadow.js.map +0 -7
- package/dist/signal-exit.js.map +0 -7
- package/dist/sorts.js.map +0 -7
- package/dist/spawn.js.map +0 -7
- package/dist/spinner.js.map +0 -7
- package/dist/ssri.js.map +0 -7
- package/dist/stdio/clear.js.map +0 -7
- package/dist/stdio/divider.js.map +0 -7
- package/dist/stdio/footer.js.map +0 -7
- package/dist/stdio/header.js.map +0 -7
- package/dist/stdio/mask.js.map +0 -7
- package/dist/stdio/progress.js.map +0 -7
- package/dist/stdio/prompts.js.map +0 -7
- package/dist/stdio/stderr.js.map +0 -7
- package/dist/stdio/stdout.js.map +0 -7
- package/dist/streams.js.map +0 -7
- package/dist/strings.js.map +0 -7
- package/dist/suppress-warnings.js.map +0 -7
- package/dist/tables.js.map +0 -7
- package/dist/temporary-executor.js.map +0 -7
- package/dist/themes/context.js.map +0 -7
- package/dist/themes/index.js.map +0 -7
- package/dist/themes/themes.js.map +0 -7
- package/dist/themes/types.js.map +0 -7
- package/dist/themes/utils.js.map +0 -7
- package/dist/types.js.map +0 -7
- package/dist/url.js.map +0 -7
- package/dist/utils/get-ipc.js.map +0 -7
- package/dist/validation/json-parser.js.map +0 -7
- package/dist/validation/types.js.map +0 -7
- package/dist/versions.js.map +0 -7
- package/dist/words.js.map +0 -7
- package/dist/zod.js.map +0 -7
package/dist/external/pacote.js
CHANGED
|
@@ -1,69 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Bundled from pacote
|
|
3
4
|
* This is a zero-dependency bundle created by esbuild.
|
|
4
5
|
*/
|
|
5
|
-
var
|
|
6
|
-
`,y2=" ",S2=/^\uFEFF/,E2=/^\s*[{[]((?:\r?\n)+)([\s\t]*)/,w2=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,YI=/^Unexpected token '?(.)'?(,)? /i,_2=o(i=>{let e=i.charCodeAt(0).toString(16).toUpperCase();return`0x${e.length%2?"0":""}${e}`},"hexify"),XI=o(i=>String(i).replace(S2,""),"stripBOM"),xm=o((i,e,t=0)=>({message:`${i} while parsing ${e}`,position:t}),"makeParsedError"),b2=o((i,e,t=20)=>{let r=i.message;if(!e)return xm(r,"empty string");let s=r.match(YI),n=r.match(/ position\s+(\d+)/i);s&&(r=r.replace(YI,`Unexpected token ${JSON.stringify(s[1])} (${_2(s[1])})$2 `));let a;if(n?a=+n[1]:r.match(/^Unexpected end of JSON.*/i)&&(a=e.length-1),a==null)return xm(r,`'${e.slice(0,t*2)}'`);let c=a<=t?0:a-t,u=a+t>=e.length?e.length:a+t,l=`${c?"...":""}${e.slice(c,u)}${u===e.length?"":"..."}`;return xm(r,`${e===l?"":"near "}${JSON.stringify(l)}`,a)},"parseError"),Zu=class extends SyntaxError{static{o(this,"JSONParseError")}constructor(e,t,r,s){let n=b2(e,t,r);super(n.message),Object.assign(this,n),this.code="EJSONPARSE",this.systemError=e,Error.captureStackTrace(this,s||this.constructor)}get name(){return this.constructor.name}set name(e){}get[Symbol.toStringTag](){return this.constructor.name}},QI=o((i,e)=>{let t=JSON.parse(i,e);if(t&&typeof t=="object"){let r=i.match(w2)||i.match(E2)||[null,"",""];t[m2]=r[1]??g2,t[p2]=r[2]??y2}return t},"parseJson"),Yu=o((i,e,t)=>{let r=XI(i);try{return QI(r,e)}catch(s){if(typeof i!="string"&&!Buffer.isBuffer(i)){let n=Array.isArray(i)&&i.length===0?"an empty array":String(i);throw Object.assign(new TypeError(`Cannot parse ${n}`),{code:"EJSONPARSE",systemError:s})}throw new Zu(s,r,t,Yu)}},"parseJsonError");eO.exports=Yu;Yu.JSONParseError=Zu;Yu.noExceptions=(i,e)=>{try{return QI(XI(i),e)}catch{}}});var rO=d((Ple,iO)=>{var Mm=new Set(["dependencies","optionalDependencies","devDependencies","peerDependencies"]),I2=o(i=>{for(let e of Mm)i&&i[e]&&(i[e]=Object.keys(i[e]).sort((t,r)=>t.localeCompare(r,"en")).reduce((t,r)=>(t[r]=i[e][r],t),{}));return i},"orderDeps"),tO=o(({content:i,originalContent:e})=>{let t=I2({...i});if(t.dependencies&&t.optionalDependencies)for(let c of Object.keys(t.optionalDependencies))delete t.dependencies[c];let r={...e};for(let c of Mm)t[c]&&(r[c]=t[c]),t[c]&&typeof t=="object"&&Object.keys(t[c]).length===0&&delete r[c];let{dependencies:s,peerDependencies:n}=e||{},{peerDependencies:a}=r;if(s&&n&&a)for(let c of Object.keys(n))s[c]!==void 0&&a[c]!==void 0&&(r.dependencies=r.dependencies||{},r.dependencies[c]=a[c]);return r},"updateDependencies");tO.knownKeys=Mm;iO.exports=tO});var nO=d((xle,sO)=>{var O2=o(({content:i,originalContent:e={}})=>{let t=i.scripts;if(!t)return e;if(o(()=>Object.entries(t).some(([s,n])=>typeof s!="string"||typeof n!="string"),"hasInvalidScripts")())throw Object.assign(new TypeError("package.json scripts should be a key-value pair of strings."),{code:"ESCRIPTSINVALID"});return{...e,scripts:{...t}}},"updateScripts");sO.exports=O2});var aO=d((Mle,oO)=>{var v2=o(({content:i,originalContent:e={}})=>{let t=i.workspaces;if(!t)return e;let r=o(()=>t.some(s=>typeof s!="string"),"hasInvalidWorkspaces");if(!t.length||r())throw Object.assign(new TypeError("workspaces should be an array of strings."),{code:"EWORKSPACESINVALID"});return{...e,workspaces:[...t]}},"updateWorkspaces");oO.exports=v2});var wa=d((kle,cO)=>{"use strict";var C2=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>{}:()=>{};cO.exports=C2});var _a=d((Fle,uO)=>{"use strict";var R2="2.0.0",A2=Number.MAX_SAFE_INTEGER||9007199254740991,T2=16,N2=250,P2=["major","premajor","minor","preminor","patch","prepatch","prerelease"];uO.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:T2,MAX_SAFE_BUILD_LENGTH:N2,MAX_SAFE_INTEGER:A2,RELEASE_TYPES:P2,SEMVER_SPEC_VERSION:R2,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var pn=d((oi,lO)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Bm,MAX_SAFE_BUILD_LENGTH:D2,MAX_LENGTH:x2}=_a(),L2=wa();oi=lO.exports={};var M2=oi.re=[],B2=oi.safeRe=[],C=oi.src=[],k2=oi.safeSrc=[],R=oi.t={},F2=0,km="[a-zA-Z0-9-]",U2=[["\\s",1],["\\d",x2],[km,D2]],j2=o(i=>{for(let[e,t]of U2)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},"makeSafeRegex"),B=o((i,e,t)=>{let r=j2(e),s=F2++;L2(i,s,e),R[i]=s,C[s]=e,k2[s]=r,M2[s]=new RegExp(e,t?"g":void 0),B2[s]=new RegExp(r,t?"g":void 0)},"createToken");B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${km}*`);B("MAINVERSION",`(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${C[R.PRERELEASEIDENTIFIER]}(?:\\.${C[R.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${C[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[R.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${km}+`);B("BUILD",`(?:\\+(${C[R.BUILDIDENTIFIER]}(?:\\.${C[R.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${C[R.MAINVERSION]}${C[R.PRERELEASE]}?${C[R.BUILD]}?`);B("FULL",`^${C[R.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${C[R.MAINVERSIONLOOSE]}${C[R.PRERELEASELOOSE]}?${C[R.BUILD]}?`);B("LOOSE",`^${C[R.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${C[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${C[R.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:${C[R.PRERELEASE]})?${C[R.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:${C[R.PRERELEASELOOSE]})?${C[R.BUILD]}?)?)?`);B("XRANGE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Bm}})(?:\\.(\\d{1,${Bm}}))?(?:\\.(\\d{1,${Bm}}))?`);B("COERCE",`${C[R.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",C[R.COERCEPLAIN]+`(?:${C[R.PRERELEASE]})?(?:${C[R.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",C[R.COERCE],!0);B("COERCERTLFULL",C[R.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${C[R.LONETILDE]}\\s+`,!0);oi.tildeTrimReplace="$1~";B("TILDE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${C[R.LONECARET]}\\s+`,!0);oi.caretTrimReplace="$1^";B("CARET",`^${C[R.LONECARET]}${C[R.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${C[R.LONECARET]}${C[R.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${C[R.GTLT]}\\s*(${C[R.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]}|${C[R.XRANGEPLAIN]})`,!0);oi.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${C[R.XRANGEPLAIN]})\\s+-\\s+(${C[R.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${C[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[R.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Xu=d((jle,hO)=>{"use strict";var $2=Object.freeze({loose:!0}),q2=Object.freeze({}),V2=o(i=>i?typeof i!="object"?$2:i:q2,"parseOptions");hO.exports=V2});var Fm=d((qle,pO)=>{"use strict";var fO=/^[0-9]+$/,dO=o((i,e)=>{let t=fO.test(i),r=fO.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},"compareIdentifiers"),z2=o((i,e)=>dO(e,i),"rcompareIdentifiers");pO.exports={compareIdentifiers:dO,rcompareIdentifiers:z2}});var Le=d((zle,gO)=>{"use strict";var Qu=wa(),{MAX_LENGTH:mO,MAX_SAFE_INTEGER:el}=_a(),{safeRe:tl,t:il}=pn(),H2=Xu(),{compareIdentifiers:mn}=Fm(),Um=class i{static{o(this,"SemVer")}constructor(e,t){if(t=H2(t),e instanceof i){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>mO)throw new TypeError(`version is longer than ${mO} characters`);Qu("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?tl[il.LOOSE]:tl[il.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>el||this.major<0)throw new TypeError("Invalid major version");if(this.minor>el||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>el||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<el)return n}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Qu("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),mn(this.major,e.major)||mn(this.minor,e.minor)||mn(this.patch,e.patch)}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],s=e.prerelease[t];if(Qu("prerelease compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return mn(r,s)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],s=e.build[t];if(Qu("build compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return mn(r,s)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?tl[il.PRERELEASELOOSE]:tl[il.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let n=[t,s];r===!1&&(n=[t]),mn(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};gO.exports=Um});var ls=d((Gle,SO)=>{"use strict";var yO=Le(),G2=o((i,e,t=!1)=>{if(i instanceof yO)return i;try{return new yO(i,e)}catch(r){if(!t)return null;throw r}},"parse");SO.exports=G2});var jm=d((Jle,EO)=>{"use strict";var W2=ls(),J2=o((i,e)=>{let t=W2(i,e);return t?t.version:null},"valid");EO.exports=J2});var $m=d((Zle,wO)=>{"use strict";var K2=ls(),Z2=o((i,e)=>{let t=K2(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");wO.exports=Z2});var _t=d((Xle,_O)=>{var Y2=Symbol("proc-log.meta");_O.exports={META:Y2,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...i){return process.emit("output","standard",...i)},"standard"),error:o(function(...i){return process.emit("output","error",...i)},"error"),buffer:o(function(...i){return process.emit("output","buffer",...i)},"buffer"),flush:o(function(...i){return process.emit("output","flush",...i)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...i){return process.emit("log","error",...i)},"error"),notice:o(function(...i){return process.emit("log","notice",...i)},"notice"),warn:o(function(...i){return process.emit("log","warn",...i)},"warn"),info:o(function(...i){return process.emit("log","info",...i)},"info"),verbose:o(function(...i){return process.emit("log","verbose",...i)},"verbose"),http:o(function(...i){return process.emit("log","http",...i)},"http"),silly:o(function(...i){return process.emit("log","silly",...i)},"silly"),timing:o(function(...i){return process.emit("log","timing",...i)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(i,e){process.emit("time","start",i);function t(){return process.emit("time","end",i)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(i){return process.emit("time","end",i)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(i){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof i=="function"){let t=i();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...i){let e,t,r=new Promise((s,n)=>{e=s,t=n});return process.emit("input","read",e,t,...i),r},"read")}}});var hs=d(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.LRUCache=void 0;var X2=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,IO=new Set,qm=typeof process=="object"&&process?process:{},OO=o((i,e,t,r)=>{typeof qm.emitWarning=="function"&&qm.emitWarning(i,e,t,r)},"emitWarning"),rl=globalThis.AbortController,bO=globalThis.AbortSignal;if(typeof rl>"u"){bO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},rl=class{static{o(this,"AbortController")}constructor(){e()}signal=new bO;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=qm.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,OO("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var Q2=o(i=>!IO.has(i),"shouldWarn"),ihe=Symbol("type"),gr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),vO=o(i=>gr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?gn:null:null,"getUintArray"),gn=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Vm=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=vO(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},zm=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;#c;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#h;#o;#d;#a;#p;#y;#_;#m;#R;#w;#b;#v;#I;#E;#N;#O;#l;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#I,sizes:e.#b,keyMap:e.#o,keyList:e.#d,valList:e.#a,next:e.#p,prev:e.#y,get head(){return e.#_},get tail(){return e.#m},free:e.#R,isBackgroundFetch:o(t=>e.#g(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#j(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#D(t),"indexes"),rindexes:o(t=>e.#L(t),"rindexes"),isStale:o(t=>e.#A(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#n}get fetchMethod(){return this.#u}get memoMethod(){return this.#c}get dispose(){return this.#i}get onInsert(){return this.#r}get disposeAfter(){return this.#s}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,onInsert:h,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:S,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:v,ignoreFetchAbort:N,perf:P}=e;if(P!==void 0&&typeof P?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=P??X2,t!==0&&!gr(t))throw new TypeError("max option must be a nonnegative integer");let U=t?vO(t):Array;if(!U)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#u=E,this.#N=!!E,this.#o=new Map,this.#d=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new U(t),this.#y=new U(t),this.#_=0,this.#m=0,this.#R=Vm.create(t),this.#n=0,this.#h=0,typeof l=="function"&&(this.#i=l),typeof h=="function"&&(this.#r=h),typeof f=="function"?(this.#s=f,this.#w=[]):(this.#s=void 0,this.#w=void 0),this.#E=!!this.#i,this.#l=!!this.#r,this.#O=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#t!==0&&!gr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#B()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ee="LRU_CACHE_UNBOUNDED";Q2(ee)&&(IO.add(ee),OO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,i))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#B(){let e=new gn(this.#e),t=new gn(this.#e);this.#I=e,this.#v=t,this.#k=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#A(n)&&this.#M(this.#d[n],"expire")},a+1);u.unref&&u.unref()}},this.#C=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#T=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#A=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#C=o(()=>{},"#updateItemAge");#T=o(()=>{},"#statusTTL");#k=o(()=>{},"#setItemTTL");#A=o(()=>!1,"#isStale");#$(){let e=new gn(this.#e);this.#h=0,this.#b=e,this.#P=t=>{this.#h-=e[t],e[t]=0},this.#F=(t,r,s,n)=>{if(this.#g(r))return 0;if(!gr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!gr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#x=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#h>n;)this.#U(!0)}this.#h+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#h)}}#P=o(e=>{},"#removeItemSize");#x=o((e,t,r)=>{},"#addItemSize");#F=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#D({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#m;!(!this.#S(t)||((e||!this.#A(t))&&(yield t),t===this.#_));)t=this.#y[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#_;!(!this.#S(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#p[t]}#S(e){return e!==void 0&&this.#o.get(this.#d[e])===e}*entries(){for(let e of this.#D())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*rentries(){for(let e of this.#L())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*keys(){for(let e of this.#D()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*values(){for(let e of this.#D())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#L())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(let r of this.#L()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#A(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#a[t],s=this.#g(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#I&&this.#v){let a=this.#I[t],c=this.#v[t];if(a&&c){let u=a-(this.#f.now()-c);n.ttl=u,n.start=Date.now()}}return this.#b&&(n.size=this.#b[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let r=this.#d[t],s=this.#a[t],n=this.#g(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#I&&this.#v){a.ttl=this.#I[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#b&&(a.size=this.#b[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=this.#f.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#F(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#M(e,"set"),this;let f=this.#n===0?void 0:this.#o.get(e);if(f===void 0)f=this.#n===0?this.#m:this.#R.length!==0?this.#R.pop():this.#n===this.#e?this.#U(!1):this.#n,this.#d[f]=e,this.#a[f]=t,this.#o.set(e,f),this.#p[this.#m]=f,this.#y[f]=this.#m,this.#m=f,this.#n++,this.#x(f,h,u),u&&(u.set="add"),l=!1,this.#l&&this.#r?.(t,e,"add");else{this.#V(f);let p=this.#a[f];if(t!==p){if(this.#N&&this.#g(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#E&&this.#i?.(m,e,"set"),this.#O&&this.#w?.push([m,e,"set"]))}else a||(this.#E&&this.#i?.(p,e,"set"),this.#O&&this.#w?.push([p,e,"set"]));if(this.#P(f),this.#x(f,h,u),this.#a[f]=t,u){u.set="replace";let m=p&&this.#g(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#l&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#I&&this.#B(),this.#I&&(l||this.#k(f,s,n),u&&this.#T(u,f)),!a&&this.#O&&this.#w){let p=this.#w,m;for(;m=p?.shift();)this.#s?.(...m)}return this}pop(){try{for(;this.#n;){let e=this.#a[this.#_];if(this.#U(!0),this.#g(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#O&&this.#w){let e=this.#w,t;for(;t=e?.shift();)this.#s?.(...t)}}}#U(e){let t=this.#_,r=this.#d[t],s=this.#a[t];return this.#N&&this.#g(s)?s.__abortController.abort(new Error("evicted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(s,r,"evict"),this.#O&&this.#w?.push([s,r,"evict"])),this.#P(t),e&&(this.#d[t]=void 0,this.#a[t]=void 0,this.#R.push(t)),this.#n===1?(this.#_=this.#m=0,this.#R.length=0):this.#_=this.#p[t],this.#o.delete(r),this.#n--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#o.get(e);if(n!==void 0){let a=this.#a[n];if(this.#g(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#A(n))s&&(s.has="stale",this.#T(s,n));else return r&&this.#C(n),s&&(s.has="hit",this.#T(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#o.get(e);if(s===void 0||!r&&this.#A(s))return;let n=this.#a[s];return this.#g(n)?n.__staleWhileFetching:n}#j(e,t,r,s){let n=t===void 0?void 0:this.#a[t];if(this.#g(n))return n;let a=new rl,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m,w=this.#a[t];return(w===m||_&&S&&w===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#a[t]=b.__staleWhileFetching:this.#M(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#a[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#M(e,"fetch"):E||(this.#a[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#u?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#o.get(e)):this.#a[t]=y,y}#g(e){if(!this.#N)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof rl}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#N)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#o.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#j(e,w,b,g);return I.__returned=I}else{let I=this.#a[w];if(this.#g(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#A(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#V(w),s&&this.#C(w),E&&this.#T(E,w),I;let N=this.#j(e,w,b,g),U=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",U&&v&&(E.returnedStale=!0)),U?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#o.get(e);if(c!==void 0){let u=this.#a[c],l=this.#g(u);return a&&this.#T(a,c),this.#A(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#M(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#V(c),s&&this.#C(c),u))}else a&&(a.get="miss")}#q(e,t){this.#y[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#_?this.#_=this.#p[e]:this.#q(this.#y[e],this.#p[e]),this.#q(this.#m,e),this.#m=e)}delete(e){return this.#M(e,"delete")}#M(e,t){let r=!1;if(this.#n!==0){let s=this.#o.get(e);if(s!==void 0)if(r=!0,this.#n===1)this.#z(t);else{this.#P(s);let n=this.#a[s];if(this.#g(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(n,e,t),this.#O&&this.#w?.push([n,e,t])),this.#o.delete(e),this.#d[s]=void 0,this.#a[s]=void 0,s===this.#m)this.#m=this.#y[s];else if(s===this.#_)this.#_=this.#p[s];else{let a=this.#y[s];this.#p[a]=this.#p[s];let c=this.#p[s];this.#y[c]=this.#y[s]}this.#n--,this.#R.push(s)}}if(this.#O&&this.#w?.length){let s=this.#w,n;for(;n=s?.shift();)this.#s?.(...n)}return r}clear(){return this.#z("delete")}#z(e){for(let t of this.#L({allowStale:!0})){let r=this.#a[t];if(this.#g(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#d[t];this.#E&&this.#i?.(r,s,e),this.#O&&this.#w?.push([r,s,e])}}if(this.#o.clear(),this.#a.fill(void 0),this.#d.fill(void 0),this.#I&&this.#v&&(this.#I.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#_=0,this.#m=0,this.#R.length=0,this.#h=0,this.#n=0,this.#O&&this.#w){let t=this.#w,r;for(;r=t?.shift();)this.#s?.(...r)}}};sl.LRUCache=zm});var AO=d((nhe,RO)=>{"use strict";var G=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ge=o(i=>i?encodeURIComponent(i):"","maybeEncode"),CO=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),e$={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${G("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${G("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${G("/",r,"/",ge(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ge(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${G("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${G("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:CO},yr={};yr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${G(i,"@")}raw.githubusercontent.com/${e}/${t}/${ge(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};yr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ge(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};yr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};yr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${G("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${G("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${G("/",ge(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${G("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${G("/",ge(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${G("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${G("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${G("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ge(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+CO(i)},"hashformat")};yr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ge(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${G("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ge(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(yr))yr[i]=Object.assign({},e$,e);RO.exports=yr});var Gm=d((ahe,NO)=>{var t$=require("url"),Hm=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),TO=o(i=>{try{return new t$.URL(i)}catch{}},"safeUrl"),i$=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r)||i.substr(t,3)==="://")return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),r$=o(i=>{let e=Hm(i,"@","#"),t=Hm(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),Hm(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");NO.exports=(i,e)=>{let t=e?i$(i,e):i;return TO(t)||TO(r$(t))}});var DO=d((uhe,PO)=>{"use strict";var s$=Gm(),n$=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");PO.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=n$(i)?`github:${i}`:i,n=s$(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var ol=d((hhe,xO)=>{"use strict";var{LRUCache:o$}=hs(),a$=AO(),c$=DO(),u$=Gm(),Wm=new o$({max:1e3});function l$(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(l$,"unknownHostedUrl");var nl=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Wm.has(r)){let s=c$(e,t,{gitHosts:i.#e,protocols:i.#t});Wm.set(r,s?new i(...s):void 0)}return Wm.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=l$(s);return i.fromUrl(a,t)||a}static parseUrl(e){return u$(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[i,e]of Object.entries(a$))nl.addHost(i,e);xO.exports=nl});var MO=d(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.range=fs.balanced=void 0;var h$=o((i,e,t)=>{let r=i instanceof RegExp?LO(i,t):i,s=e instanceof RegExp?LO(e,t):e,n=r!==null&&s!=null&&(0,fs.range)(r,s,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+s.length)}},"balanced");fs.balanced=h$;var LO=o((i,e)=>{let t=e.match(i);return t?t[0]:null},"maybeMatch"),f$=o((i,e,t)=>{let r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;){if(h===u)r.push(h),u=t.indexOf(i,h+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,l])}else s=r.pop(),s!==void 0&&s<n&&(n=s,a=l),l=t.indexOf(e,h+1);h=u<l&&u>=0?u:l}r.length&&a!==void 0&&(c=[n,a])}return c},"range");fs.range=f$});var qO=d(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.expand=v$;var BO=MO(),kO="\0SLASH"+Math.random()+"\0",FO="\0OPEN"+Math.random()+"\0",Km="\0CLOSE"+Math.random()+"\0",UO="\0COMMA"+Math.random()+"\0",jO="\0PERIOD"+Math.random()+"\0",d$=new RegExp(kO,"g"),p$=new RegExp(FO,"g"),m$=new RegExp(Km,"g"),g$=new RegExp(UO,"g"),y$=new RegExp(jO,"g"),S$=/\\\\/g,E$=/\\{/g,w$=/\\}/g,_$=/\\,/g,b$=/\\./g;function Jm(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}o(Jm,"numeric");function I$(i){return i.replace(S$,kO).replace(E$,FO).replace(w$,Km).replace(_$,UO).replace(b$,jO)}o(I$,"escapeBraces");function O$(i){return i.replace(d$,"\\").replace(p$,"{").replace(m$,"}").replace(g$,",").replace(y$,".")}o(O$,"unescapeBraces");function $O(i){if(!i)return[""];let e=[],t=(0,BO.balanced)("{","}",i);if(!t)return i.split(",");let{pre:r,body:s,post:n}=t,a=r.split(",");a[a.length-1]+="{"+s+"}";let c=$O(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o($O,"parseCommaParts");function v$(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),ba(I$(i),!0).map(O$)):[]}o(v$,"expand");function C$(i){return"{"+i+"}"}o(C$,"embrace");function R$(i){return/^-?0\d/.test(i)}o(R$,"isPadded");function A$(i,e){return i<=e}o(A$,"lte");function T$(i,e){return i>=e}o(T$,"gte");function ba(i,e){let t=[],r=(0,BO.balanced)("{","}",i);if(!r)return[i];let s=r.pre,n=r.post.length?ba(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=s+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=a||c,l=r.body.indexOf(",")>=0;if(!u&&!l)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+Km+r.post,ba(i)):[i];let h;if(u)h=r.body.split(/\.\./);else if(h=$O(r.body),h.length===1&&h[0]!==void 0&&(h=ba(h[0],!1).map(C$),h.length===1))return n.map(p=>r.pre+h[0]+p);let f;if(u&&h[0]!==void 0&&h[1]!==void 0){let p=Jm(h[0]),m=Jm(h[1]),y=Math.max(h[0].length,h[1].length),g=h.length===3&&h[2]!==void 0?Math.abs(Jm(h[2])):1,S=A$;m<p&&(g*=-1,S=T$);let _=h.some(R$);f=[];for(let b=p;S(b,m);b+=g){let w;if(c)w=String.fromCharCode(b),w==="\\"&&(w="");else if(w=String(b),_){let I=y-w.length;if(I>0){let v=new Array(I+1).join("0");b<0?w="-"+v+w.slice(1):w=v+w}}f.push(w)}}else{f=[];for(let p=0;p<h.length;p++)f.push.apply(f,ba(h[p],!1))}for(let p=0;p<f.length;p++)for(let m=0;m<n.length;m++){let y=s+f[p]+n[m];(!e||u||y)&&t.push(y)}}return t}o(ba,"expand_")});var VO=d(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.assertValidPattern=void 0;var N$=1024*64,P$=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>N$)throw new TypeError("pattern is too long")},"assertValidPattern");al.assertValidPattern=P$});var HO=d(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.parseClass=void 0;var D$={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ia=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),x$=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),zO=o(i=>i.join(""),"rangesToString"),L$=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(D$))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(Ia(f)+"-"+Ia(g)):g===f&&r.push(Ia(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(Ia(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(Ia(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[x$(g),!1,h-t,!1]}let p="["+(l?"^":"")+zO(r)+"]",m="["+(l?"":"^")+zO(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");cl.parseClass=L$});var ll=d(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.unescape=void 0;var M$=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");ul.unescape=M$});var Qm=d(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.AST=void 0;var B$=HO(),hl=ll(),k$=new Set(["!","?","+","*","@"]),GO=o(i=>k$.has(i),"isExtglobType"),F$="(?!(?:^|/)\\.\\.?(?:$|/))",fl="(?!\\.)",U$=new Set(["[","."]),j$=new Set(["..","."]),$$=new Set("().*{}+?[]^$\\!"),q$=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Xm="[^/]",WO=Xm+"*?",JO=Xm+"+?",Ym=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&GO(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(GO(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&j$.has(this.#r[0]))){let y=U$,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?F$:S?fl:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,hl.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,hl.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!fl?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?fl:"")+JO;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?fl:"")+WO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,hl.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=($$.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,B$.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=JO:n+=WO,t=!0;continue}if(u==="?"){n+=Xm,t=!0;continue}n+=q$(u)}return[n,(0,hl.unescape)(e),!!t,a]}};dl.AST=Ym});var eg=d(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.escape=void 0;var V$=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");pl.escape=V$});var Ui=d(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.unescape=T.escape=T.AST=T.Minimatch=T.match=T.makeRe=T.braceExpand=T.defaults=T.filter=T.GLOBSTAR=T.sep=T.minimatch=void 0;var z$=qO(),ml=VO(),YO=Qm(),H$=eg(),G$=ll(),W$=o((i,e,t={})=>((0,ml.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new ds(e,t).match(i)),"minimatch");T.minimatch=W$;var J$=/^\*+([^+@!?\*\[\(]*)$/,K$=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),Z$=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),Y$=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),X$=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),Q$=/^\*+\.\*+$/,eq=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),tq=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),iq=/^\.\*+$/,rq=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),sq=/^\*+$/,nq=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),oq=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),aq=/^\?+([^+@!?\*\[\(]*)?$/,cq=o(([i,e=""])=>{let t=XO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),uq=o(([i,e=""])=>{let t=QO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),lq=o(([i,e=""])=>{let t=QO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),hq=o(([i,e=""])=>{let t=XO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),XO=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),QO=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),ev=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",KO={win32:{sep:"\\"},posix:{sep:"/"}};T.sep=ev==="win32"?KO.win32.sep:KO.posix.sep;T.minimatch.sep=T.sep;T.GLOBSTAR=Symbol("globstar **");T.minimatch.GLOBSTAR=T.GLOBSTAR;var fq="[^/]",dq=fq+"*?",pq="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",mq="(?:(?!(?:\\/|^)\\.).)*?",gq=o((i,e={})=>t=>(0,T.minimatch)(t,i,e),"filter");T.filter=gq;T.minimatch.filter=T.filter;var bt=o((i,e={})=>Object.assign({},i,e),"ext"),yq=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return T.minimatch;let e=T.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,bt(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,bt(i,n))}static defaults(s){return e.defaults(bt(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,bt(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,bt(i,n))}},unescape:o((r,s={})=>e.unescape(r,bt(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,bt(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,bt(i,s)),"filter"),defaults:o(r=>e.defaults(bt(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,bt(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,bt(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,bt(i,n)),"match"),sep:e.sep,GLOBSTAR:T.GLOBSTAR})},"defaults");T.defaults=yq;T.minimatch.defaults=T.defaults;var Sq=o((i,e={})=>((0,ml.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,z$.expand)(i)),"braceExpand");T.braceExpand=Sq;T.minimatch.braceExpand=T.braceExpand;var Eq=o((i,e={})=>new ds(i,e).makeRe(),"makeRe");T.makeRe=Eq;T.minimatch.makeRe=T.makeRe;var wq=o((i,e,t={})=>{let r=new ds(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");T.match=wq;T.minimatch.match=T.match;var ZO=/[?*]|[+@!]\(.*?\)|\[|\]/,_q=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),ds=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,ml.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||ev,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!ZO.test(n[2]))&&!ZO.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===T.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
|
|
6
|
+
"use strict";var Mj=Object.create;var $u=Object.defineProperty;var Bj=Object.getOwnPropertyDescriptor;var kj=Object.getOwnPropertyNames;var Fj=Object.getPrototypeOf,Uj=Object.prototype.hasOwnProperty;var o=(i,e)=>$u(i,"name",{value:e,configurable:!0});var jj=(i,e)=>()=>(i&&(e=i(i=0)),e);var d=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),$j=(i,e)=>{for(var t in e)$u(i,t,{get:e[t],enumerable:!0})},qj=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kj(e))!Uj.call(i,s)&&s!==t&&$u(i,s,{get:()=>e[s],enumerable:!(r=Bj(e,s))||r.enumerable});return i};var Vj=(i,e,t)=>(t=i!=null?Mj(Fj(i)):{},qj(e||!i||!i.__esModule?$u(t,"default",{value:i,enumerable:!0}):t,i));var bm=d((kue,FI)=>{"use strict";var zj=Symbol.for("indent"),Hj=Symbol.for("newline"),Gj=`
|
|
7
|
+
`,Wj=" ",Jj=/^\uFEFF/,Kj=/^\s*[{[]((?:\r?\n)+)([\s\t]*)/,Zj=/^(?:\{\}|\[\])((?:\r?\n)+)?$/,MI=/^Unexpected token '?(.)'?(,)? /i,Yj=o(i=>{let e=i.charCodeAt(0).toString(16).toUpperCase();return`0x${e.length%2?"0":""}${e}`},"hexify"),BI=o(i=>String(i).replace(Jj,""),"stripBOM"),_m=o((i,e,t=0)=>({message:`${i} while parsing ${e}`,position:t}),"makeParsedError"),Xj=o((i,e,t=20)=>{let r=i.message;if(!e)return _m(r,"empty string");let s=r.match(MI),n=r.match(/ position\s+(\d+)/i);s&&(r=r.replace(MI,`Unexpected token ${JSON.stringify(s[1])} (${Yj(s[1])})$2 `));let a;if(n?a=+n[1]:r.match(/^Unexpected end of JSON.*/i)&&(a=e.length-1),a==null)return _m(r,`'${e.slice(0,t*2)}'`);let c=a<=t?0:a-t,u=a+t>=e.length?e.length:a+t,l=`${c?"...":""}${e.slice(c,u)}${u===e.length?"":"..."}`;return _m(r,`${e===l?"":"near "}${JSON.stringify(l)}`,a)},"parseError"),qu=class extends SyntaxError{static{o(this,"JSONParseError")}constructor(e,t,r,s){let n=Xj(e,t,r);super(n.message),Object.assign(this,n),this.code="EJSONPARSE",this.systemError=e,Error.captureStackTrace(this,s||this.constructor)}get name(){return this.constructor.name}set name(e){}get[Symbol.toStringTag](){return this.constructor.name}},kI=o((i,e)=>{let t=JSON.parse(i,e);if(t&&typeof t=="object"){let r=i.match(Zj)||i.match(Kj)||[null,"",""];t[Hj]=r[1]??Gj,t[zj]=r[2]??Wj}return t},"parseJson"),Vu=o((i,e,t)=>{let r=BI(i);try{return kI(r,e)}catch(s){if(typeof i!="string"&&!Buffer.isBuffer(i)){let n=Array.isArray(i)&&i.length===0?"an empty array":String(i);throw Object.assign(new TypeError(`Cannot parse ${n}`),{code:"EJSONPARSE",systemError:s})}throw new qu(s,r,t,Vu)}},"parseJsonError");FI.exports=Vu;Vu.JSONParseError=qu;Vu.noExceptions=(i,e)=>{try{return kI(BI(i),e)}catch{}}});var $I=d((Uue,jI)=>{var Im=new Set(["dependencies","optionalDependencies","devDependencies","peerDependencies"]),Qj=o(i=>{for(let e of Im)i&&i[e]&&(i[e]=Object.keys(i[e]).sort((t,r)=>t.localeCompare(r,"en")).reduce((t,r)=>(t[r]=i[e][r],t),{}));return i},"orderDeps"),UI=o(({content:i,originalContent:e})=>{let t=Qj({...i});if(t.dependencies&&t.optionalDependencies)for(let c of Object.keys(t.optionalDependencies))delete t.dependencies[c];let r={...e};for(let c of Im)t[c]&&(r[c]=t[c]),t[c]&&typeof t=="object"&&Object.keys(t[c]).length===0&&delete r[c];let{dependencies:s,peerDependencies:n}=e||{},{peerDependencies:a}=r;if(s&&n&&a)for(let c of Object.keys(n))s[c]!==void 0&&a[c]!==void 0&&(r.dependencies=r.dependencies||{},r.dependencies[c]=a[c]);return r},"updateDependencies");UI.knownKeys=Im;jI.exports=UI});var VI=d(($ue,qI)=>{var e$=o(({content:i,originalContent:e={}})=>{let t=i.scripts;if(!t)return e;if(o(()=>Object.entries(t).some(([s,n])=>typeof s!="string"||typeof n!="string"),"hasInvalidScripts")())throw Object.assign(new TypeError("package.json scripts should be a key-value pair of strings."),{code:"ESCRIPTSINVALID"});return{...e,scripts:{...t}}},"updateScripts");qI.exports=e$});var HI=d((Vue,zI)=>{var t$=o(({content:i,originalContent:e={}})=>{let t=i.workspaces;if(!t)return e;let r=o(()=>t.some(s=>typeof s!="string"),"hasInvalidWorkspaces");if(!t.length||r())throw Object.assign(new TypeError("workspaces should be an array of strings."),{code:"EWORKSPACESINVALID"});return{...e,workspaces:[...t]}},"updateWorkspaces");zI.exports=t$});var ha=d((Hue,GI)=>{"use strict";var i$=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>{}:()=>{};GI.exports=i$});var fa=d((Gue,WI)=>{"use strict";var r$="2.0.0",s$=Number.MAX_SAFE_INTEGER||9007199254740991,n$=16,o$=250,a$=["major","premajor","minor","preminor","patch","prepatch","prerelease"];WI.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:n$,MAX_SAFE_BUILD_LENGTH:o$,MAX_SAFE_INTEGER:s$,RELEASE_TYPES:a$,SEMVER_SPEC_VERSION:r$,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cn=d((ii,JI)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Om,MAX_SAFE_BUILD_LENGTH:c$,MAX_LENGTH:u$}=fa(),l$=ha();ii=JI.exports={};var h$=ii.re=[],f$=ii.safeRe=[],R=ii.src=[],d$=ii.safeSrc=[],A=ii.t={},p$=0,vm="[a-zA-Z0-9-]",m$=[["\\s",1],["\\d",u$],[vm,c$]],g$=o(i=>{for(let[e,t]of m$)i=i.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return i},"makeSafeRegex"),B=o((i,e,t)=>{let r=g$(e),s=p$++;l$(i,s,e),A[i]=s,R[s]=e,d$[s]=r,h$[s]=new RegExp(e,t?"g":void 0),f$[s]=new RegExp(r,t?"g":void 0)},"createToken");B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${vm}*`);B("MAINVERSION",`(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})\\.(${R[A.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})\\.(${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${R[A.NONNUMERICIDENTIFIER]}|${R[A.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${R[A.PRERELEASEIDENTIFIER]}(?:\\.${R[A.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${R[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[A.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${vm}+`);B("BUILD",`(?:\\+(${R[A.BUILDIDENTIFIER]}(?:\\.${R[A.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${R[A.MAINVERSION]}${R[A.PRERELEASE]}?${R[A.BUILD]}?`);B("FULL",`^${R[A.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${R[A.MAINVERSIONLOOSE]}${R[A.PRERELEASELOOSE]}?${R[A.BUILD]}?`);B("LOOSE",`^${R[A.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${R[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${R[A.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:\\.(${R[A.XRANGEIDENTIFIER]})(?:${R[A.PRERELEASE]})?${R[A.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[A.XRANGEIDENTIFIERLOOSE]})(?:${R[A.PRERELEASELOOSE]})?${R[A.BUILD]}?)?)?`);B("XRANGE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${R[A.GTLT]}\\s*${R[A.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Om}})(?:\\.(\\d{1,${Om}}))?(?:\\.(\\d{1,${Om}}))?`);B("COERCE",`${R[A.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",R[A.COERCEPLAIN]+`(?:${R[A.PRERELEASE]})?(?:${R[A.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",R[A.COERCE],!0);B("COERCERTLFULL",R[A.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${R[A.LONETILDE]}\\s+`,!0);ii.tildeTrimReplace="$1~";B("TILDE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${R[A.LONETILDE]}${R[A.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${R[A.LONECARET]}\\s+`,!0);ii.caretTrimReplace="$1^";B("CARET",`^${R[A.LONECARET]}${R[A.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${R[A.LONECARET]}${R[A.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${R[A.GTLT]}\\s*(${R[A.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${R[A.GTLT]}\\s*(${R[A.LOOSEPLAIN]}|${R[A.XRANGEPLAIN]})`,!0);ii.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${R[A.XRANGEPLAIN]})\\s+-\\s+(${R[A.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${R[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[A.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var zu=d((Jue,KI)=>{"use strict";var y$=Object.freeze({loose:!0}),S$=Object.freeze({}),E$=o(i=>i?typeof i!="object"?y$:i:S$,"parseOptions");KI.exports=E$});var Rm=d((Zue,XI)=>{"use strict";var ZI=/^[0-9]+$/,YI=o((i,e)=>{let t=ZI.test(i),r=ZI.test(e);return t&&r&&(i=+i,e=+e),i===e?0:t&&!r?-1:r&&!t?1:i<e?-1:1},"compareIdentifiers"),w$=o((i,e)=>YI(e,i),"rcompareIdentifiers");XI.exports={compareIdentifiers:YI,rcompareIdentifiers:w$}});var De=d((Xue,eO)=>{"use strict";var Hu=ha(),{MAX_LENGTH:QI,MAX_SAFE_INTEGER:Gu}=fa(),{safeRe:Wu,t:Ju}=cn(),_$=zu(),{compareIdentifiers:un}=Rm(),Am=class i{static{o(this,"SemVer")}constructor(e,t){if(t=_$(t),e instanceof i){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>QI)throw new TypeError(`version is longer than ${QI} characters`);Hu("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Wu[Ju.LOOSE]:Wu[Ju.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Gu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gu||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<Gu)return n}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Hu("SemVer.compare",this.version,this.options,e),!(e instanceof i)){if(typeof e=="string"&&e===this.version)return 0;e=new i(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof i||(e=new i(e,this.options)),un(this.major,e.major)||un(this.minor,e.minor)||un(this.patch,e.patch)}comparePre(e){if(e instanceof i||(e=new i(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],s=e.prerelease[t];if(Hu("prerelease compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}compareBuild(e){e instanceof i||(e=new i(e,this.options));let t=0;do{let r=this.build[t],s=e.build[t];if(Hu("build compare",t,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return un(r,s)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let s=`-${t}`.match(this.options.loose?Wu[Ju.PRERELEASELOOSE]:Wu[Ju.PRERELEASE]);if(!s||s[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(t){let n=[t,s];r===!1&&(n=[t]),un(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};eO.exports=Am});var ns=d((ele,iO)=>{"use strict";var tO=De(),b$=o((i,e,t=!1)=>{if(i instanceof tO)return i;try{return new tO(i,e)}catch(r){if(!t)return null;throw r}},"parse");iO.exports=b$});var Tm=d((ile,rO)=>{"use strict";var I$=ns(),O$=o((i,e)=>{let t=I$(i,e);return t?t.version:null},"valid");rO.exports=O$});var Cm=d((sle,sO)=>{"use strict";var v$=ns(),R$=o((i,e)=>{let t=v$(i.trim().replace(/^[=v]+/,""),e);return t?t.version:null},"clean");sO.exports=R$});var St=d((ole,nO)=>{var A$=Symbol("proc-log.meta");nO.exports={META:A$,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:o(function(...i){return process.emit("output","standard",...i)},"standard"),error:o(function(...i){return process.emit("output","error",...i)},"error"),buffer:o(function(...i){return process.emit("output","buffer",...i)},"buffer"),flush:o(function(...i){return process.emit("output","flush",...i)},"flush")},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:o(function(...i){return process.emit("log","error",...i)},"error"),notice:o(function(...i){return process.emit("log","notice",...i)},"notice"),warn:o(function(...i){return process.emit("log","warn",...i)},"warn"),info:o(function(...i){return process.emit("log","info",...i)},"info"),verbose:o(function(...i){return process.emit("log","verbose",...i)},"verbose"),http:o(function(...i){return process.emit("log","http",...i)},"http"),silly:o(function(...i){return process.emit("log","silly",...i)},"silly"),timing:o(function(...i){return process.emit("log","timing",...i)},"timing"),pause:o(function(){return process.emit("log","pause")},"pause"),resume:o(function(){return process.emit("log","resume")},"resume")},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:o(function(i,e){process.emit("time","start",i);function t(){return process.emit("time","end",i)}if(o(t,"end"),typeof e=="function"){let r=e();return r&&r.finally?r.finally(t):(t(),r)}return t},"start"),end:o(function(i){return process.emit("time","end",i)},"end")},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:o(function(i){process.emit("input","start");function e(){return process.emit("input","end")}if(o(e,"end"),typeof i=="function"){let t=i();return t&&t.finally?t.finally(e):(e(),t)}return e},"start"),end:o(function(){return process.emit("input","end")},"end"),read:o(function(...i){let e,t,r=new Promise((s,n)=>{e=s,t=n});return process.emit("input","read",e,t,...i),r},"read")}}});var os=d(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.LRUCache=void 0;var T$=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,aO=new Set,Nm=typeof process=="object"&&process?process:{},cO=o((i,e,t,r)=>{typeof Nm.emitWarning=="function"&&Nm.emitWarning(i,e,t,r)},"emitWarning"),Ku=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof Ku>"u"){oO=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ku=class{static{o(this,"AbortController")}constructor(){e()}signal=new oO;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Nm.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,cO("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var C$=o(i=>!aO.has(i),"shouldWarn"),lle=Symbol("type"),fr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),uO=o(i=>fr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?ln:null:null,"getUintArray"),ln=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Pm=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=uO(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Dm=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;#c;#f;get perf(){return this.#f}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;#N;#O;#l;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#I,sizes:e.#b,keyMap:e.#o,keyList:e.#d,valList:e.#a,next:e.#p,prev:e.#y,get head(){return e.#_},get tail(){return e.#m},free:e.#A,isBackgroundFetch:o(t=>e.#g(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#j(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#V(t),"moveToTail"),indexes:o(t=>e.#D(t),"indexes"),rindexes:o(t=>e.#L(t),"rindexes"),isStale:o(t=>e.#T(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#n}get fetchMethod(){return this.#u}get memoMethod(){return this.#c}get dispose(){return this.#i}get onInsert(){return this.#r}get disposeAfter(){return this.#s}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,onInsert:h,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:m,maxSize:y=0,maxEntrySize:g=0,sizeCalculation:S,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:v,ignoreFetchAbort:N,perf:P}=e;if(P!==void 0&&typeof P?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#f=P??T$,t!==0&&!fr(t))throw new TypeError("max option must be a nonnegative integer");let $=t?uO(t):Array;if(!$)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=y,this.maxEntrySize=g||this.#t,this.sizeCalculation=S,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#u=E,this.#N=!!E,this.#o=new Map,this.#d=new Array(t).fill(void 0),this.#a=new Array(t).fill(void 0),this.#p=new $(t),this.#y=new $(t),this.#_=0,this.#m=0,this.#A=Pm.create(t),this.#n=0,this.#h=0,typeof l=="function"&&(this.#i=l),typeof h=="function"&&(this.#r=h),typeof f=="function"?(this.#s=f,this.#w=[]):(this.#s=void 0,this.#w=void 0),this.#E=!!this.#i,this.#l=!!this.#r,this.#O=!!this.#s,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#t!==0&&!fr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!fr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=fr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!fr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#B()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let ee="LRU_CACHE_UNBOUNDED";C$(ee)&&(aO.add(ee),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,i))}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#B(){let e=new ln(this.#e),t=new ln(this.#e);this.#I=e,this.#v=t,this.#k=(n,a,c=this.#f.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#T(n)&&this.#M(this.#d[n],"expire")},a+1);u.unref&&u.unref()}},this.#R=n=>{t[n]=e[n]!==0?this.#f.now():0},this.#C=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=this.#f.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#T=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#R=o(()=>{},"#updateItemAge");#C=o(()=>{},"#statusTTL");#k=o(()=>{},"#setItemTTL");#T=o(()=>!1,"#isStale");#$(){let e=new ln(this.#e);this.#h=0,this.#b=e,this.#P=t=>{this.#h-=e[t],e[t]=0},this.#F=(t,r,s,n)=>{if(this.#g(r))return 0;if(!fr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!fr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#x=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#h>n;)this.#U(!0)}this.#h+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#h)}}#P=o(e=>{},"#removeItemSize");#x=o((e,t,r)=>{},"#addItemSize");#F=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#D({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#m;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#_));)t=this.#y[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#_;!(!this.#S(t)||((e||!this.#T(t))&&(yield t),t===this.#m));)t=this.#p[t]}#S(e){return e!==void 0&&this.#o.get(this.#d[e])===e}*entries(){for(let e of this.#D())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*rentries(){for(let e of this.#L())this.#a[e]!==void 0&&this.#d[e]!==void 0&&!this.#g(this.#a[e])&&(yield[this.#d[e],this.#a[e]])}*keys(){for(let e of this.#D()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#g(this.#a[e])&&(yield t)}}*values(){for(let e of this.#D())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}*rvalues(){for(let e of this.#L())this.#a[e]!==void 0&&!this.#g(this.#a[e])&&(yield this.#a[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#d[r],this))return this.get(this.#d[r],t)}}forEach(e,t=this){for(let r of this.#D()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}rforEach(e,t=this){for(let r of this.#L()){let s=this.#a[r],n=this.#g(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#d[r],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#T(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#a[t],s=this.#g(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#I&&this.#v){let a=this.#I[t],c=this.#v[t];if(a&&c){let u=a-(this.#f.now()-c);n.ttl=u,n.start=Date.now()}}return this.#b&&(n.size=this.#b[t]),n}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let r=this.#d[t],s=this.#a[t],n=this.#g(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#I&&this.#v){a.ttl=this.#I[t];let c=this.#f.now()-this.#v[t];a.start=Math.floor(Date.now()-c)}this.#b&&(a.size=this.#b[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=this.#f.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#F(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#M(e,"set"),this;let f=this.#n===0?void 0:this.#o.get(e);if(f===void 0)f=this.#n===0?this.#m:this.#A.length!==0?this.#A.pop():this.#n===this.#e?this.#U(!1):this.#n,this.#d[f]=e,this.#a[f]=t,this.#o.set(e,f),this.#p[this.#m]=f,this.#y[f]=this.#m,this.#m=f,this.#n++,this.#x(f,h,u),u&&(u.set="add"),l=!1,this.#l&&this.#r?.(t,e,"add");else{this.#V(f);let p=this.#a[f];if(t!==p){if(this.#N&&this.#g(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#E&&this.#i?.(m,e,"set"),this.#O&&this.#w?.push([m,e,"set"]))}else a||(this.#E&&this.#i?.(p,e,"set"),this.#O&&this.#w?.push([p,e,"set"]));if(this.#P(f),this.#x(f,h,u),this.#a[f]=t,u){u.set="replace";let m=p&&this.#g(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update");this.#l&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#I&&this.#B(),this.#I&&(l||this.#k(f,s,n),u&&this.#C(u,f)),!a&&this.#O&&this.#w){let p=this.#w,m;for(;m=p?.shift();)this.#s?.(...m)}return this}pop(){try{for(;this.#n;){let e=this.#a[this.#_];if(this.#U(!0),this.#g(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#O&&this.#w){let e=this.#w,t;for(;t=e?.shift();)this.#s?.(...t)}}}#U(e){let t=this.#_,r=this.#d[t],s=this.#a[t];return this.#N&&this.#g(s)?s.__abortController.abort(new Error("evicted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(s,r,"evict"),this.#O&&this.#w?.push([s,r,"evict"])),this.#P(t),e&&(this.#d[t]=void 0,this.#a[t]=void 0,this.#A.push(t)),this.#n===1?(this.#_=this.#m=0,this.#A.length=0):this.#_=this.#p[t],this.#o.delete(r),this.#n--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#o.get(e);if(n!==void 0){let a=this.#a[n];if(this.#g(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#T(n))s&&(s.has="stale",this.#C(s,n));else return r&&this.#R(n),s&&(s.has="hit",this.#C(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#o.get(e);if(s===void 0||!r&&this.#T(s))return;let n=this.#a[s];return this.#g(n)?n.__staleWhileFetching:n}#j(e,t,r,s){let n=t===void 0?void 0:this.#a[t];if(this.#g(n))return n;let a=new Ku,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m,w=this.#a[t];return(w===m||_&&S&&w===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#a[t]=b.__staleWhileFetching:this.#M(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#a[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#M(e,"fetch"):E||(this.#a[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#u?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#o.get(e)):this.#a[t]=y,y}#g(e){if(!this.#N)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ku}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#N)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#o.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#j(e,w,b,g);return I.__returned=I}else{let I=this.#a[w];if(this.#g(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#T(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#V(w),s&&this.#R(w),E&&this.#C(E,w),I;let N=this.#j(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#o.get(e);if(c!==void 0){let u=this.#a[c],l=this.#g(u);return a&&this.#C(a,c),this.#T(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#M(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#V(c),s&&this.#R(c),u))}else a&&(a.get="miss")}#q(e,t){this.#y[t]=e,this.#p[e]=t}#V(e){e!==this.#m&&(e===this.#_?this.#_=this.#p[e]:this.#q(this.#y[e],this.#p[e]),this.#q(this.#m,e),this.#m=e)}delete(e){return this.#M(e,"delete")}#M(e,t){let r=!1;if(this.#n!==0){let s=this.#o.get(e);if(s!==void 0)if(r=!0,this.#n===1)this.#z(t);else{this.#P(s);let n=this.#a[s];if(this.#g(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#O)&&(this.#E&&this.#i?.(n,e,t),this.#O&&this.#w?.push([n,e,t])),this.#o.delete(e),this.#d[s]=void 0,this.#a[s]=void 0,s===this.#m)this.#m=this.#y[s];else if(s===this.#_)this.#_=this.#p[s];else{let a=this.#y[s];this.#p[a]=this.#p[s];let c=this.#p[s];this.#y[c]=this.#y[s]}this.#n--,this.#A.push(s)}}if(this.#O&&this.#w?.length){let s=this.#w,n;for(;n=s?.shift();)this.#s?.(...n)}return r}clear(){return this.#z("delete")}#z(e){for(let t of this.#L({allowStale:!0})){let r=this.#a[t];if(this.#g(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#d[t];this.#E&&this.#i?.(r,s,e),this.#O&&this.#w?.push([r,s,e])}}if(this.#o.clear(),this.#a.fill(void 0),this.#d.fill(void 0),this.#I&&this.#v&&(this.#I.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#_=0,this.#m=0,this.#A.length=0,this.#h=0,this.#n=0,this.#O&&this.#w){let t=this.#w,r;for(;r=t?.shift();)this.#s?.(...r)}}};Zu.LRUCache=Dm});var fO=d((dle,hO)=>{"use strict";var G=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ge=o(i=>i?encodeURIComponent(i):"","maybeEncode"),lO=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),N$={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${G("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${G("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ge(r||"HEAD")}/${n}${G("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${G("/",r,"/",ge(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ge(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${G("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${G("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:lO},dr={};dr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${G(i,"@")}raw.githubusercontent.com/${e}/${t}/${ge(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${G(i,"@")}${e}/${t}/${r}.git${G("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};dr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${G("/",s,"/",ge(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ge(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};dr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ge(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};dr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${G("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${G("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${G("/",ge(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${G("/",ge(t))}${G("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${G("/",ge(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${G("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${G("/",ge(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${G("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${G("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${G("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ge(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+lO(i)},"hashformat")};dr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ge(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${G("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ge(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(dr))dr[i]=Object.assign({},N$,e);hO.exports=dr});var Lm=d((mle,pO)=>{var P$=require("url"),xm=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),dO=o(i=>{try{return new P$.URL(i)}catch{}},"safeUrl"),D$=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r)||i.substr(t,3)==="://")return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),x$=o(i=>{let e=xm(i,"@","#"),t=xm(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),xm(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");pO.exports=(i,e)=>{let t=e?D$(i,e):i;return dO(t)||dO(x$(t))}});var gO=d((yle,mO)=>{"use strict";var L$=Lm(),M$=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");mO.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=M$(i)?`github:${i}`:i,n=L$(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var Xu=d((Ele,yO)=>{"use strict";var{LRUCache:B$}=os(),k$=fO(),F$=gO(),U$=Lm(),Mm=new B$({max:1e3});function j$(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(j$,"unknownHostedUrl");var Yu=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Mm.has(r)){let s=F$(e,t,{gitHosts:i.#e,protocols:i.#t});Mm.set(r,s?new i(...s):void 0)}return Mm.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=j$(s);return i.fromUrl(a,t)||a}static parseUrl(e){return U$(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[i,e]of Object.entries(k$))Yu.addHost(i,e);yO.exports=Yu});var EO=d(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.range=as.balanced=void 0;var $$=o((i,e,t)=>{let r=i instanceof RegExp?SO(i,t):i,s=e instanceof RegExp?SO(e,t):e,n=r!==null&&s!=null&&(0,as.range)(r,s,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+s.length)}},"balanced");as.balanced=$$;var SO=o((i,e)=>{let t=e.match(i);return t?t[0]:null},"maybeMatch"),q$=o((i,e,t)=>{let r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;){if(h===u)r.push(h),u=t.indexOf(i,h+1);else if(r.length===1){let f=r.pop();f!==void 0&&(c=[f,l])}else s=r.pop(),s!==void 0&&s<n&&(n=s,a=l),l=t.indexOf(e,h+1);h=u<l&&u>=0?u:l}r.length&&a!==void 0&&(c=[n,a])}return c},"range");as.range=q$});var RO=d(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.expand=t2;var wO=EO(),_O="\0SLASH"+Math.random()+"\0",bO="\0OPEN"+Math.random()+"\0",km="\0CLOSE"+Math.random()+"\0",IO="\0COMMA"+Math.random()+"\0",OO="\0PERIOD"+Math.random()+"\0",V$=new RegExp(_O,"g"),z$=new RegExp(bO,"g"),H$=new RegExp(km,"g"),G$=new RegExp(IO,"g"),W$=new RegExp(OO,"g"),J$=/\\\\/g,K$=/\\{/g,Z$=/\\}/g,Y$=/\\,/g,X$=/\\./g;function Bm(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}o(Bm,"numeric");function Q$(i){return i.replace(J$,_O).replace(K$,bO).replace(Z$,km).replace(Y$,IO).replace(X$,OO)}o(Q$,"escapeBraces");function e2(i){return i.replace(V$,"\\").replace(z$,"{").replace(H$,"}").replace(G$,",").replace(W$,".")}o(e2,"unescapeBraces");function vO(i){if(!i)return[""];let e=[],t=(0,wO.balanced)("{","}",i);if(!t)return i.split(",");let{pre:r,body:s,post:n}=t,a=r.split(",");a[a.length-1]+="{"+s+"}";let c=vO(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(vO,"parseCommaParts");function t2(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),da(Q$(i),!0).map(e2)):[]}o(t2,"expand");function i2(i){return"{"+i+"}"}o(i2,"embrace");function r2(i){return/^-?0\d/.test(i)}o(r2,"isPadded");function s2(i,e){return i<=e}o(s2,"lte");function n2(i,e){return i>=e}o(n2,"gte");function da(i,e){let t=[],r=(0,wO.balanced)("{","}",i);if(!r)return[i];let s=r.pre,n=r.post.length?da(r.post,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<n.length;a++){let c=s+"{"+r.body+"}"+n[a];t.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=a||c,l=r.body.indexOf(",")>=0;if(!u&&!l)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+km+r.post,da(i)):[i];let h;if(u)h=r.body.split(/\.\./);else if(h=vO(r.body),h.length===1&&h[0]!==void 0&&(h=da(h[0],!1).map(i2),h.length===1))return n.map(p=>r.pre+h[0]+p);let f;if(u&&h[0]!==void 0&&h[1]!==void 0){let p=Bm(h[0]),m=Bm(h[1]),y=Math.max(h[0].length,h[1].length),g=h.length===3&&h[2]!==void 0?Math.abs(Bm(h[2])):1,S=s2;m<p&&(g*=-1,S=n2);let _=h.some(r2);f=[];for(let b=p;S(b,m);b+=g){let w;if(c)w=String.fromCharCode(b),w==="\\"&&(w="");else if(w=String(b),_){let I=y-w.length;if(I>0){let v=new Array(I+1).join("0");b<0?w="-"+v+w.slice(1):w=v+w}}f.push(w)}}else{f=[];for(let p=0;p<h.length;p++)f.push.apply(f,da(h[p],!1))}for(let p=0;p<f.length;p++)for(let m=0;m<n.length;m++){let y=s+f[p]+n[m];(!e||u||y)&&t.push(y)}}return t}o(da,"expand_")});var AO=d(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.assertValidPattern=void 0;var o2=1024*64,a2=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>o2)throw new TypeError("pattern is too long")},"assertValidPattern");Qu.assertValidPattern=a2});var CO=d(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.parseClass=void 0;var c2={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},pa=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),u2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),TO=o(i=>i.join(""),"rangesToString"),l2=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(c2))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(pa(f)+"-"+pa(g)):g===f&&r.push(pa(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(pa(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(pa(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[u2(g),!1,h-t,!1]}let p="["+(l?"^":"")+TO(r)+"]",m="["+(l?"":"^")+TO(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");el.parseClass=l2});var il=d(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.unescape=void 0;var h2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");tl.unescape=h2});var $m=d(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.AST=void 0;var f2=CO(),rl=il(),d2=new Set(["!","?","+","*","@"]),NO=o(i=>d2.has(i),"isExtglobType"),p2="(?!(?:^|/)\\.\\.?(?:$|/))",sl="(?!\\.)",m2=new Set(["[","."]),g2=new Set(["..","."]),y2=new Set("().*{}+?[]^$\\!"),S2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),jm="[^/]",PO=jm+"*?",DO=jm+"+?",Um=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&NO(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(NO(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&g2.has(this.#r[0]))){let y=m2,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?p2:S?sl:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,rl.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,rl.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!sl?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?sl:"")+DO;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?sl:"")+PO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,rl.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(y2.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,f2.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=DO:n+=PO,t=!0;continue}if(u==="?"){n+=jm,t=!0;continue}n+=S2(u)}return[n,(0,rl.unescape)(e),!!t,a]}};nl.AST=Um});var qm=d(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.escape=void 0;var E2=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");ol.escape=E2});var Mi=d(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.unescape=C.escape=C.AST=C.Minimatch=C.match=C.makeRe=C.braceExpand=C.defaults=C.filter=C.GLOBSTAR=C.sep=C.minimatch=void 0;var w2=RO(),al=AO(),MO=$m(),_2=qm(),b2=il(),I2=o((i,e,t={})=>((0,al.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cs(e,t).match(i)),"minimatch");C.minimatch=I2;var O2=/^\*+([^+@!?\*\[\(]*)$/,v2=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),R2=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),A2=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),T2=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),C2=/^\*+\.\*+$/,N2=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),P2=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),D2=/^\.\*+$/,x2=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),L2=/^\*+$/,M2=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),B2=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),k2=/^\?+([^+@!?\*\[\(]*)?$/,F2=o(([i,e=""])=>{let t=BO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),U2=o(([i,e=""])=>{let t=kO([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),j2=o(([i,e=""])=>{let t=kO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),$2=o(([i,e=""])=>{let t=BO([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),BO=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),kO=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),FO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",xO={win32:{sep:"\\"},posix:{sep:"/"}};C.sep=FO==="win32"?xO.win32.sep:xO.posix.sep;C.minimatch.sep=C.sep;C.GLOBSTAR=Symbol("globstar **");C.minimatch.GLOBSTAR=C.GLOBSTAR;var q2="[^/]",V2=q2+"*?",z2="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",H2="(?:(?!(?:\\/|^)\\.).)*?",G2=o((i,e={})=>t=>(0,C.minimatch)(t,i,e),"filter");C.filter=G2;C.minimatch.filter=C.filter;var Et=o((i,e={})=>Object.assign({},i,e),"ext"),W2=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return C.minimatch;let e=C.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Et(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Et(i,n))}static defaults(s){return e.defaults(Et(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Et(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Et(i,n))}},unescape:o((r,s={})=>e.unescape(r,Et(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Et(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Et(i,s)),"filter"),defaults:o(r=>e.defaults(Et(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Et(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Et(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Et(i,n)),"match"),sep:e.sep,GLOBSTAR:C.GLOBSTAR})},"defaults");C.defaults=W2;C.minimatch.defaults=C.defaults;var J2=o((i,e={})=>((0,al.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,w2.expand)(i)),"braceExpand");C.braceExpand=J2;C.minimatch.braceExpand=C.braceExpand;var K2=o((i,e={})=>new cs(i,e).makeRe(),"makeRe");C.makeRe=K2;C.minimatch.makeRe=C.makeRe;var Z2=o((i,e,t={})=>{let r=new cs(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");C.match=Z2;C.minimatch.match=C.match;var LO=/[?*]|[+@!]\(.*?\)|\[|\]/,Y2=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cs=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,al.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||FO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!LO.test(n[2]))&&!LO.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===C.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
|
|
7
8
|
globstar while`,e,p,t,m,y),this.matchOne(e.slice(p),t.slice(m),r))return this.debug("globstar found match!",p,u,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,p,t,m);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(r&&(this.debug(`
|
|
8
|
-
>>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,T.braceExpand)(this.pattern,this.options)}parse(e){(0,ml.assertValidPattern)(e);let t=this.options;if(e==="**")return T.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(sq))?s=t.dot?oq:nq:(r=e.match(J$))?s=(t.nocase?t.dot?X$:Y$:t.dot?Z$:K$)(r[1]):(r=e.match(aq))?s=(t.nocase?t.dot?uq:cq:t.dot?lq:hq)(r):(r=e.match(Q$))?s=t.dot?tq:eq:(r=e.match(iq))&&(s=rq);let n=YO.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?dq:t.dot?pq:mq,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?_q(h):h===T.GLOBSTAR?T.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==T.GLOBSTAR||m===T.GLOBSTAR||(m===void 0?p!==void 0&&p!==T.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==T.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=T.GLOBSTAR))}),l.filter(h=>h!==T.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return T.minimatch.defaults(e).Minimatch}};T.Minimatch=ds;var bq=Qm();Object.defineProperty(T,"AST",{enumerable:!0,get:o(function(){return bq.AST},"get")});var Iq=eg();Object.defineProperty(T,"escape",{enumerable:!0,get:o(function(){return Iq.escape},"get")});var Oq=ll();Object.defineProperty(T,"unescape",{enumerable:!0,get:o(function(){return Oq.unescape},"get")});T.minimatch.AST=YO.AST;T.minimatch.Minimatch=ds;T.minimatch.escape=H$.escape;T.minimatch.unescape=G$.unescape});var te=d(He=>{"use strict";var vq=He&&He.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(He,"__esModule",{value:!0});He.Minipass=He.isWritable=He.isReadable=He.isStream=void 0;var tv=typeof process=="object"&&process?process:{stdout:null,stderr:null},ag=require("node:events"),nv=vq(require("node:stream")),Cq=require("node:string_decoder"),Rq=o(i=>!!i&&typeof i=="object"&&(i instanceof bl||i instanceof nv.default||(0,He.isReadable)(i)||(0,He.isWritable)(i)),"isStream");He.isStream=Rq;var Aq=o(i=>!!i&&typeof i=="object"&&i instanceof ag.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==nv.default.Writable.prototype.pipe,"isReadable");He.isReadable=Aq;var Tq=o(i=>!!i&&typeof i=="object"&&i instanceof ag.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function","isWritable");He.isWritable=Tq;var ji=Symbol("EOF"),$i=Symbol("maybeEmitEnd"),Sr=Symbol("emittedEnd"),gl=Symbol("emittingEnd"),Oa=Symbol("emittedError"),yl=Symbol("closed"),iv=Symbol("read"),Sl=Symbol("flush"),rv=Symbol("flushChunk"),Wt=Symbol("encoding"),yn=Symbol("decoder"),ve=Symbol("flowing"),va=Symbol("paused"),Sn=Symbol("resume"),Ce=Symbol("buffer"),ze=Symbol("pipes"),Re=Symbol("bufferLength"),tg=Symbol("bufferPush"),El=Symbol("bufferShift"),Me=Symbol("objectMode"),pe=Symbol("destroyed"),ig=Symbol("error"),rg=Symbol("emitData"),sv=Symbol("emitEnd"),sg=Symbol("emitEnd2"),ai=Symbol("async"),ng=Symbol("abort"),wl=Symbol("aborted"),Ca=Symbol("signal"),ps=Symbol("dataListeners"),ht=Symbol("discarded"),Ra=o(i=>Promise.resolve().then(i),"defer"),Nq=o(i=>i(),"nodefer"),Pq=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),Dq=o(i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBufferLike"),xq=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),_l=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Sn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},og=class extends _l{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},Lq=o(i=>!!i.objectMode,"isObjectModeOptions"),Mq=o(i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer","isEncodingOptions"),bl=class extends ag.EventEmitter{static{o(this,"Minipass")}[ve]=!1;[va]=!1;[ze]=[];[Ce]=[];[Me];[Wt];[ai];[yn];[ji]=!1;[Sr]=!1;[gl]=!1;[yl]=!1;[Oa]=null;[Re]=0;[pe]=!1;[Ca];[wl]=!1;[ps]=0;[ht]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Lq(t)?(this[Me]=!0,this[Wt]=null):Mq(t)?(this[Wt]=t.encoding,this[Me]=!1):(this[Me]=!1,this[Wt]=null),this[ai]=!!t.async,this[yn]=this[Wt]?new Cq.StringDecoder(this[Wt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Ce],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[ze],"get")});let{signal:r}=t;r&&(this[Ca]=r,r.aborted?this[ng]():r.addEventListener("abort",()=>this[ng]()))}get bufferLength(){return this[Re]}get encoding(){return this[Wt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Me]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ai]}set async(e){this[ai]=this[ai]||!!e}[ng](){this[wl]=!0,this.emit("abort",this[Ca]?.reason),this.destroy(this[Ca]?.reason)}get aborted(){return this[wl]}set aborted(e){}write(e,t,r){if(this[wl])return!1;if(this[ji])throw new Error("write after end");if(this[pe])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[ai]?Ra:Nq;if(!this[Me]&&!Buffer.isBuffer(e)){if(xq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Dq(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Me]?(this[ve]&&this[Re]!==0&&this[Sl](!0),this[ve]?this.emit("data",e):this[tg](e),this[Re]!==0&&this.emit("readable"),r&&s(r),this[ve]):e.length?(typeof e=="string"&&!(t===this[Wt]&&!this[yn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Wt]&&(e=this[yn].write(e)),this[ve]&&this[Re]!==0&&this[Sl](!0),this[ve]?this.emit("data",e):this[tg](e),this[Re]!==0&&this.emit("readable"),r&&s(r),this[ve]):(this[Re]!==0&&this.emit("readable"),r&&s(r),this[ve])}read(e){if(this[pe])return null;if(this[ht]=!1,this[Re]===0||e===0||e&&e>this[Re])return this[$i](),null;this[Me]&&(e=null),this[Ce].length>1&&!this[Me]&&(this[Ce]=[this[Wt]?this[Ce].join(""):Buffer.concat(this[Ce],this[Re])]);let t=this[iv](e||null,this[Ce][0]);return this[$i](),t}[iv](e,t){if(this[Me])this[El]();else{let r=t;e===r.length||e===null?this[El]():typeof r=="string"?(this[Ce][0]=r.slice(e),t=r.slice(0,e),this[Re]-=e):(this[Ce][0]=r.subarray(e),t=r.subarray(0,e),this[Re]-=e)}return this.emit("data",t),!this[Ce].length&&!this[ji]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[ji]=!0,this.writable=!1,(this[ve]||!this[va])&&this[$i](),this}[Sn](){this[pe]||(!this[ps]&&!this[ze].length&&(this[ht]=!0),this[va]=!1,this[ve]=!0,this.emit("resume"),this[Ce].length?this[Sl]():this[ji]?this[$i]():this.emit("drain"))}resume(){return this[Sn]()}pause(){this[ve]=!1,this[va]=!0,this[ht]=!1}get destroyed(){return this[pe]}get flowing(){return this[ve]}get paused(){return this[va]}[tg](e){this[Me]?this[Re]+=1:this[Re]+=e.length,this[Ce].push(e)}[El](){return this[Me]?this[Re]-=1:this[Re]-=this[Ce][0].length,this[Ce].shift()}[Sl](e=!1){do;while(this[rv](this[El]())&&this[Ce].length);!e&&!this[Ce].length&&!this[ji]&&this.emit("drain")}[rv](e){return this.emit("data",e),this[ve]}pipe(e,t){if(this[pe])return e;this[ht]=!1;let r=this[Sr];return t=t||{},e===tv.stdout||e===tv.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[ze].push(t.proxyErrors?new og(this,e,t):new _l(this,e,t)),this[ai]?Ra(()=>this[Sn]()):this[Sn]()),e}unpipe(e){let t=this[ze].find(r=>r.dest===e);t&&(this[ze].length===1?(this[ve]&&this[ps]===0&&(this[ve]=!1),this[ze]=[]):this[ze].splice(this[ze].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ht]=!1,this[ps]++,!this[ze].length&&!this[ve]&&this[Sn]();else if(e==="readable"&&this[Re]!==0)super.emit("readable");else if(Pq(e)&&this[Sr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Oa]){let s=t;this[ai]?Ra(()=>s.call(this,this[Oa])):s.call(this,this[Oa])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[ps]=this.listeners("data").length,this[ps]===0&&!this[ht]&&!this[ze].length&&(this[ve]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ps]=0,!this[ht]&&!this[ze].length&&(this[ve]=!1)),t}get emittedEnd(){return this[Sr]}[$i](){!this[gl]&&!this[Sr]&&!this[pe]&&this[Ce].length===0&&this[ji]&&(this[gl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[yl]&&this.emit("close"),this[gl]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==pe&&this[pe])return!1;if(e==="data")return!this[Me]&&!r?!1:this[ai]?(Ra(()=>this[rg](r)),!0):this[rg](r);if(e==="end")return this[sv]();if(e==="close"){if(this[yl]=!0,!this[Sr]&&!this[pe])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Oa]=r,super.emit(ig,r);let n=!this[Ca]||this.listeners("error").length?super.emit("error",r):!1;return this[$i](),n}else if(e==="resume"){let n=super.emit("resume");return this[$i](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...t);return this[$i](),s}[rg](e){for(let r of this[ze])r.dest.write(e)===!1&&this.pause();let t=this[ht]?!1:super.emit("data",e);return this[$i](),t}[sv](){return this[Sr]?!1:(this[Sr]=!0,this.readable=!1,this[ai]?(Ra(()=>this[sg]()),!0):this[sg]())}[sg](){if(this[yn]){let t=this[yn].end();if(t){for(let r of this[ze])r.dest.write(t);this[ht]||super.emit("data",t)}}for(let t of this[ze])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Me]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Me]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[Me])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Wt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(pe,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ht]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ji])return t();let n,a,c=o(f=>{this.off("data",u),this.off("end",l),this.off(pe,h),t(),a(f)},"onerr"),u=o(f=>{this.off("error",c),this.off("end",l),this.off(pe,h),this.pause(),n({value:f,done:!!this[ji]})},"ondata"),l=o(()=>{this.off("error",c),this.off("data",u),this.off(pe,h),t(),n({done:!0,value:void 0})},"onend"),h=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,p)=>{a=p,n=f,this.once(pe,h),this.once("error",c),this.once("end",l),this.once("data",u)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ht]=!1;let e=!1,t=o(()=>(this.pause(),this.off(ig,t),this.off(pe,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}},"next");return this.once("end",t),this.once(ig,t),this.once(pe,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[pe])return e?this.emit("error",e):this.emit(pe),this;this[pe]=!0,this[ht]=!0,this[Ce].length=0,this[Re]=0;let t=this;return typeof t.close=="function"&&!this[yl]&&t.close(),e?this.emit("error",e):this.emit(pe),this}static get isStream(){return He.isStream}};He.Minipass=bl});var wv=d(W=>{"use strict";var Bq=W&&W.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),kq=W&&W.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Fq=W&&W.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Bq(e,i,t);return kq(e,i),e};Object.defineProperty(W,"__esModule",{value:!0});W.PathScurry=W.Path=W.PathScurryDarwin=W.PathScurryPosix=W.PathScurryWin32=W.PathScurryBase=W.PathPosix=W.PathWin32=W.PathBase=W.ChildrenCache=W.ResolveCache=void 0;var hv=hs(),Rl=require("node:path"),Uq=require("node:url"),Ta=require("fs"),jq=Fq(require("node:fs")),$q=Ta.realpathSync.native,Il=require("node:fs/promises"),ov=te(),Na={lstatSync:Ta.lstatSync,readdir:Ta.readdir,readdirSync:Ta.readdirSync,readlinkSync:Ta.readlinkSync,realpathSync:$q,promises:{lstat:Il.lstat,readdir:Il.readdir,readlink:Il.readlink,realpath:Il.realpath}},fv=o(i=>!i||i===Na||i===jq?Na:{...Na,...i,promises:{...Na.promises,...i.promises||{}}},"fsFromOption"),dv=/^\\\\\?\\([a-z]:)\\?$/i,qq=o(i=>i.replace(/\//g,"\\").replace(dv,"$1\\"),"uncToDrive"),Vq=/[\\\/]/,Ot=0,pv=1,mv=2,ci=4,gv=6,yv=8,ms=10,Sv=12,It=15,Aa=~It,cg=16,av=32,Pa=64,Jt=128,Ol=256,Cl=512,cv=Pa|Jt|Cl,zq=1023,ug=o(i=>i.isFile()?yv:i.isDirectory()?ci:i.isSymbolicLink()?ms:i.isCharacterDevice()?mv:i.isBlockDevice()?gv:i.isSocket()?Sv:i.isFIFO()?pv:Ot,"entToType"),uv=new Map,Da=o(i=>{let e=uv.get(i);if(e)return e;let t=i.normalize("NFKD");return uv.set(i,t),t},"normalize"),lv=new Map,vl=o(i=>{let e=lv.get(i);if(e)return e;let t=Da(i.toLowerCase());return lv.set(i,t),t},"normalizeNocase"),xa=class extends hv.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};W.ResolveCache=xa;var Al=class extends hv.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};W.ChildrenCache=Al;var Ev=Symbol("PathScurry setAsCwd"),De=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#s;get uid(){return this.#s}#u;get gid(){return this.#u}#c;get rdev(){return this.#c}#f;get blksize(){return this.#f}#n;get ino(){return this.#n}#h;get size(){return this.#h}#o;get blocks(){return this.#o}#d;get atimeMs(){return this.#d}#a;get mtimeMs(){return this.#a}#p;get ctimeMs(){return this.#p}#y;get birthtimeMs(){return this.#y}#_;get atime(){return this.#_}#m;get mtime(){return this.#m}#R;get ctime(){return this.#R}#w;get birthtime(){return this.#w}#b;#v;#I;#E;#N;#O;#l;#B;#C;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Ot,r,s,n,a,c){this.name=e,this.#b=n?vl(e):Da(e),this.#l=t&zq,this.nocase=n,this.roots=s,this.root=r||this,this.#B=a,this.#I=c.fullpath,this.#N=c.relative,this.#O=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=fv(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(s):this.#k(s)}#k(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#B.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#B.set(this,t),this.#l&=~cg,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?vl(e):Da(e);for(let u of r)if(u.#b===s)return u;let n=this.parent?this.sep:"",a=this.#I?this.#I+n+e:void 0,c=this.newChild(e,Ot,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#l|=Jt),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,t=this.parent;if(!t)return this.#O=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#I=s}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#E=`//?/${s}`:this.#E=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#l&It)===Ot}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#l&It)===yv}isDirectory(){return(this.#l&It)===ci}isCharacterDevice(){return(this.#l&It)===mv}isBlockDevice(){return(this.#l&It)===gv}isFIFO(){return(this.#l&It)===pv}isSocket(){return(this.#l&It)===Sv}isSymbolicLink(){return(this.#l&ms)===ms}lstatCached(){return this.#l&av?this:void 0}readlinkCached(){return this.#C}realpathCached(){return this.#T}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#C)return!0;if(!this.parent)return!1;let e=this.#l&It;return!(e!==Ot&&e!==ms||this.#l&Ol||this.#l&Jt)}calledReaddir(){return!!(this.#l&cg)}isENOENT(){return!!(this.#l&Jt)}isNamed(e){return this.nocase?this.#b===vl(e):this.#b===Da(e)}async readlink(){let e=this.#C;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#C=r}catch(t){this.#S(t.code);return}}readlinkSync(){let e=this.#C;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#C=r}catch(t){this.#S(t.code);return}}#A(e){this.#l|=cg;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#l&Jt||(this.#l=(this.#l|Jt)&Aa,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#x(){this.#l|=Cl,this.#F()}#F(){if(this.#l&Pa)return;let e=this.#l;(e&It)===ci&&(e&=Aa),this.#l=e|Pa,this.#P()}#D(e=""){e==="ENOTDIR"||e==="EPERM"?this.#F():e==="ENOENT"?this.#$():this.children().provisional=0}#L(e=""){e==="ENOTDIR"?this.parent.#F():e==="ENOENT"&&this.#$()}#S(e=""){let t=this.#l;t|=Ol,e==="ENOENT"&&(t|=Jt),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Aa),this.#l=t,e==="ENOTDIR"&&this.parent&&this.parent.#F()}#U(e,t){return this.#g(e,t)||this.#j(e,t)}#j(e,t){let r=ug(e),s=this.newChild(e.name,r,{parent:this}),n=s.#l&It;return n!==ci&&n!==ms&&n!==Ot&&(s.#l|=Pa),t.unshift(s),t.provisional++,s}#g(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?vl(e.name):Da(e.name))===s.#b)return this.#q(e,s,r,t)}}#q(e,t,r,s){let n=t.name;return t.#l=t.#l&Aa|ug(e),n!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#l&Jt)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#L(e.code)}}lstatSync(){if((this.#l&Jt)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#L(e.code)}}#V(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:n,blksize:a,blocks:c,ctime:u,ctimeMs:l,dev:h,gid:f,ino:p,mode:m,mtime:y,mtimeMs:g,nlink:S,rdev:E,size:_,uid:b}=e;this.#_=t,this.#d=r,this.#w=s,this.#y=n,this.#f=a,this.#o=c,this.#R=u,this.#p=l,this.#t=h,this.#u=f,this.#n=p,this.#i=m,this.#m=y,this.#a=g,this.#r=S,this.#c=E,this.#h=_,this.#s=b;let w=ug(e);this.#l=this.#l&Aa|w|av,w!==Ot&&w!==ci&&w!==ms&&(this.#l|=Pa)}#M=[];#z=!1;#G(e){this.#z=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#D(n.code),r.provisional=0;else{for(let c of a)this.#U(c,r);this.#A(r)}this.#G(r.slice(0,r.provisional))})}#H;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#H)await this.#H;else{let r=o(()=>{},"resolve");this.#H=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#U(s,e);this.#A(e)}catch(s){this.#D(s.code),e.provisional=0}this.#H=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#U(r,e);this.#A(e)}catch(r){this.#D(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#l&cv)return!1;let e=It&this.#l;return e===Ot||e===ci||e===ms}shouldWalk(e,t){return(this.#l&ci)===ci&&!(this.#l&cv)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#T)return this.#T;if(!((Cl|Ol|Jt)&this.#l))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#T=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#T)return this.#T;if(!((Cl|Ol|Jt)&this.#l))try{let e=this.#e.realpathSync(this.fullpath());return this.#T=this.resolve(e)}catch{this.#x()}}[Ev](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#N=r.join(this.sep),s.#O=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#N=void 0,s.#O=void 0,s=s.parent}};W.PathBase=De;var La=class i extends De{static{o(this,"PathWin32")}sep="\\";splitSep=Vq;constructor(e,t=Ot,r,s,n,a,c){super(e,t,r,s,n,a,c)}newChild(e,t=Ot,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Rl.win32.parse(e).root}getRoot(e){if(e=qq(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new ka(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(dv,"$1\\"),e===t}};W.PathWin32=La;var Ma=class i extends De{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Ot,r,s,n,a,c){super(e,t,r,s,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Ot,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};W.PathPosix=Ma;var Ba=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:n=16*1024,fs:a=Na}={}){this.#r=fv(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Uq.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new xa,this.#t=new xa,this.#i=new Al(n);let u=c.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,h=u.length-1,f=t.sep,p=this.rootPath,m=!1;for(let y of u){let g=h--;l=l.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(m?"":f)+y}),m=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set,l=o((f,p)=>{u.add(f),f.readdirCB((m,y)=>{if(m)return p(m);let g=y.length;if(!g)return p();let S=o(()=>{--g===0&&p()},"next");for(let E of y)(!n||n(E))&&c.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(u,a)?l(_,S):S()):E.shouldWalk(u,a)?l(E,S):S()},!0)},"walk"),h=e;return new Promise((f,p)=>{l(h,m=>{if(m)return p(m);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let h=l.readdirSync();for(let f of h){(!n||n(f))&&c.push(r?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(s&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(u,a)&&u.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let u of c){let l=u.readdirSync();for(let h of l){(!n||n(h))&&(yield r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(s&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new ov.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let u=new Set,l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=o((S,E,_=!1)=>{if(S)return c.emit("error",S);if(s&&!_){let b=[];for(let w of E)w.isSymbolicLink()&&b.push(w.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(b.length){Promise.all(b).then(()=>y(null,E,!0));return}}for(let b of E)b&&(!n||n(b))&&(c.write(r?b:b.fullpath())||(p=!0));h--;for(let b of E){let w=b.realpathCached()||b;w.shouldWalk(u,a)&&l.push(w)}p&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;m.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof De||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new ov.Minipass({objectMode:!0}),u=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=m.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(p=!0));h--;for(let g of y){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(u,a)&&l.push(S)}}p&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Ev](t)}};W.PathScurryBase=Ba;var ka=class extends Ba{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Rl.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Rl.win32.parse(e).root.toUpperCase()}newRoot(e){return new La(this.rootPath,ci,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};W.PathScurryWin32=ka;var Fa=class extends Ba{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Rl.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ma(this.rootPath,ci,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};W.PathScurryPosix=Fa;var Tl=class extends Fa{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};W.PathScurryDarwin=Tl;W.Path=process.platform==="win32"?La:Ma;W.PathScurry=process.platform==="win32"?ka:process.platform==="darwin"?Tl:Fa});var hg=d(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.Pattern=void 0;var Hq=Ui(),Gq=o(i=>i.length>=1,"isPatternList"),Wq=o(i=>i.length>=1,"isGlobList"),lg=class i{static{o(this,"Pattern")}#e;#t;#i;length;#r;#s;#u;#c;#f;#n;#h=!0;constructor(e,t,r,s){if(!Gq(e))throw new TypeError("empty pattern list");if(!Wq(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[n,a,c,u,...l]=this.#e,[h,f,p,m,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let g=[n,a,c,u,""].join("/"),S=[h,f,p,m,""].join("/");this.#e=[g,...l],this.#t=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...u]=this.#t;a[0]===""&&(a.shift(),u.shift());let l=n+"/",h=c+"/";this.#e=[l,...a],this.#t=[h,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===Hq.GLOBSTAR}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#u=this.#u||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new i(this.#e,this.#t,this.#i+1,this.#r),this.#s.#n=this.#n,this.#s.#f=this.#f,this.#s.#c=this.#c,this.#s):this.#s=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#n!==void 0?this.#n:this.#n=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};Nl.Pattern=lg});var dg=d(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.Ignore=void 0;var _v=Ui(),Jq=hg(),Kq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",fg=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:n,platform:a=Kq}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new _v.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],n=t.globParts[r];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Jq.Pattern(s,n,0,this.platform),c=new _v.Minimatch(a.globString(),this.mmopts),u=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(c):this.relative.push(c),u&&(l?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};Pl.Ignore=fg});var Iv=d(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.Processor=ui.SubWalks=ui.MatchRecord=ui.HasWalkedCache=void 0;var bv=Ui(),Dl=class i{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};ui.HasWalkedCache=Dl;var xl=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let s=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};ui.MatchRecord=xl;var Ll=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ui.SubWalks=Ll;var pg=class i{static{o(this,"Processor")}hasWalkedCache;matches=new xl;subwalks=new Ll;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Dl}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,n]of r){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let u,l,h=!1;for(;typeof(u=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(u),n=l,h=!0;if(u=n.pattern(),l=n.rest(),h){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(s.resolve(u),c,f);continue}else if(u===bv.GLOBSTAR){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let f=l?.pattern(),p=l?.rest();if(!l||(f===""||f===".")&&!p)this.matches.add(s,c,f===""||f===".");else if(f===".."){let m=s.parent||s;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,c,!0)}}else u instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),u=a.pattern(),l=a.rest();u===bv.GLOBSTAR?s.testGlobstar(n,a,l,c):u instanceof RegExp?s.testRegExp(n,u,l,c):s.testString(n,u,l,c)}return s}testGlobstar(e,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};ui.Processor=pg});var Cv=d(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GlobStream=Er.GlobWalker=Er.GlobUtil=void 0;var Zq=te(),Ov=dg(),vv=Iv(),Yq=o((i,e)=>typeof i=="string"?new Ov.Ignore([i],e):Array.isArray(i)?new Ov.Ignore(i,e):i,"makeIgnore"),Ua=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=Yq(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#s(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new vv.Processor(this.opts),r)}walkCB2(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirCached();c.calledReaddir()?this.walkCB3(c,u,r,a):c.readdirCB((l,h)=>this.walkCB3(c,h,r,a),!0)}a()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let[c,u]of r.subwalks.entries())n++,this.walkCB2(c,u,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new vv.Processor(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirSync();this.walkCB3Sync(c,u,r,a)}a()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let[c,u]of r.subwalks.entries())n++,this.walkCB2Sync(c,u,r.child(),a);a()}};Er.GlobUtil=Ua;var mg=class extends Ua{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};Er.GlobWalker=mg;var gg=class extends Ua{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Zq.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};Er.GlobStream=gg});var Sg=d(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.Glob=void 0;var Xq=Ui(),Qq=require("node:url"),Ml=wv(),eV=hg(),Bl=Cv(),tV=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yg=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,Qq.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=t.platform||tV,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=t.platform==="win32"?Ml.PathScurryWin32:t.platform==="darwin"?Ml.PathScurryDarwin:t.platform?Ml.PathScurryPosix:Ml.PathScurry;this.scurry=new u(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(u=>new Xq.Minimatch(u,s)),[a,c]=n.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=a.map((u,l)=>{let h=c[l];if(!h)throw new Error("invalid pattern object");return new eV.Pattern(u,h,0,this.platform)})}async walk(){return[...await new Bl.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Bl.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Bl.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Bl.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};kl.Glob=yg});var Eg=d(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});Fl.hasMagic=void 0;var iV=Ui(),rV=o((i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new iV.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Fl.hasMagic=rV});var Ig=d(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.glob=q.sync=q.iterate=q.iterateSync=q.stream=q.streamSync=q.Ignore=q.hasMagic=q.Glob=q.unescape=q.escape=void 0;q.globStreamSync=ja;q.globStream=wg;q.globSync=_g;q.globIterateSync=$a;q.globIterate=bg;var Rv=Ui(),gs=Sg(),sV=Eg(),Tv=Ui();Object.defineProperty(q,"escape",{enumerable:!0,get:o(function(){return Tv.escape},"get")});Object.defineProperty(q,"unescape",{enumerable:!0,get:o(function(){return Tv.unescape},"get")});var nV=Sg();Object.defineProperty(q,"Glob",{enumerable:!0,get:o(function(){return nV.Glob},"get")});var oV=Eg();Object.defineProperty(q,"hasMagic",{enumerable:!0,get:o(function(){return oV.hasMagic},"get")});var aV=dg();Object.defineProperty(q,"Ignore",{enumerable:!0,get:o(function(){return aV.Ignore},"get")});function ja(i,e={}){return new gs.Glob(i,e).streamSync()}o(ja,"globStreamSync");function wg(i,e={}){return new gs.Glob(i,e).stream()}o(wg,"globStream");function _g(i,e={}){return new gs.Glob(i,e).walkSync()}o(_g,"globSync");async function Av(i,e={}){return new gs.Glob(i,e).walk()}o(Av,"glob_");function $a(i,e={}){return new gs.Glob(i,e).iterateSync()}o($a,"globIterateSync");function bg(i,e={}){return new gs.Glob(i,e).iterate()}o(bg,"globIterate");q.streamSync=ja;q.stream=Object.assign(wg,{sync:ja});q.iterateSync=$a;q.iterate=Object.assign(bg,{sync:$a});q.sync=Object.assign(_g,{stream:ja,iterate:$a});q.glob=Object.assign(Av,{glob:Av,globSync:_g,sync:q.sync,globStream:wg,stream:q.stream,globStreamSync:ja,streamSync:q.streamSync,globIterate:bg,iterate:q.iterate,globIterateSync:$a,iterateSync:q.iterateSync,Glob:gs.Glob,hasMagic:sV.hasMagic,escape:Rv.escape,unescape:Rv.unescape});q.glob.glob=q.glob});var Og=d((Khe,cV)=>{cV.exports=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]});var Nv=d((Zhe,uV)=>{uV.exports=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]});var Pv=d((Yhe,lV)=>{lV.exports=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]});var xv=d((Xhe,Dv)=>{"use strict";var hV=[].concat(Og()).concat(Nv()),fV=Pv();Dv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(y){if(y instanceof RegExp){var g=i.slice(e),S=g.match(y);if(S)return e+=S[0].length,S[0]}else if(i.indexOf(y,e)===e)return e+=y.length,y}o(r,"read");function s(){r(/[ ]*/)}o(s,"skipWhitespace");function n(){for(var y,g=["WITH","AND","OR","(",")",":","+"],S=0;S<g.length&&(y=r(g[S]),!y);S++);if(y==="+"&&e>1&&i[e-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}o(n,"operator");function a(){return r(/[A-Za-z0-9-.]+/)}o(a,"idstring");function c(){var y=a();if(!y)throw new Error("Expected idstring at offset "+e);return y}o(c,"expectIdstring");function u(){if(r("DocumentRef-")){var y=c();return{type:"DOCUMENTREF",string:y}}}o(u,"documentRef");function l(){if(r("LicenseRef-")){var y=c();return{type:"LICENSEREF",string:y}}}o(l,"licenseRef");function h(){var y=e,g=a();if(hV.indexOf(g)!==-1)return{type:"LICENSE",string:g};if(fV.indexOf(g)!==-1)return{type:"EXCEPTION",string:g};e=y}o(h,"identifier");function f(){return n()||u()||l()||h()}o(f,"parseToken");for(var p=[];t()&&(s(),!!t());){var m=f();if(!m)throw new Error("Unexpected `"+i[e]+"` at offset "+e);p.push(m)}return p}});var Mv=d((efe,Lv)=>{"use strict";Lv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(){return t()?i[e]:null}o(r,"token");function s(){if(!t())throw new Error;e++}o(s,"next");function n(g){var S=r();if(S&&S.type==="OPERATOR"&&g===S.string)return s(),S.string}o(n,"parseOperator");function a(){if(n("WITH")){var g=r();if(g&&g.type==="EXCEPTION")return s(),g.string;throw new Error("Expected exception after `WITH`")}}o(a,"parseWith");function c(){var g=e,S="",E=r();if(E.type==="DOCUMENTREF"&&(s(),S+="DocumentRef-"+E.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(E=r(),E.type==="LICENSEREF")return s(),S+="LicenseRef-"+E.string,{license:S};e=g}o(c,"parseLicenseRef");function u(){var g=r();if(g&&g.type==="LICENSE"){s();var S={license:g.string};n("+")&&(S.plus=!0);var E=a();return E&&(S.exception=E),S}}o(u,"parseLicense");function l(){var g=n("(");if(g){var S=m();if(!n(")"))throw new Error("Expected `)`");return S}}o(l,"parseParenthesizedExpression");function h(){return l()||c()||u()}o(h,"parseAtom");function f(g,S){return o(function E(){var _=S();if(_){if(!n(g))return _;var b=E();if(!b)throw new Error("Expected expression");return{left:_,conjunction:g.toLowerCase(),right:b}}},"parseBinaryOp")}o(f,"makeBinaryOpParser");var p=f("AND",h),m=f("OR",p),y=m();if(!y||t())throw new Error("Syntax error");return y}});var vg=d((ife,Bv)=>{"use strict";var dV=xv(),pV=Mv();Bv.exports=function(i){return pV(dV(i))}});var Hv=d((rfe,zv)=>{var mV=vg(),gV=Og();function Ul(i){try{return mV(i),!0}catch{return!1}}o(Ul,"valid");function Vv(i,e){var t=e[0].length-i[0].length;return t!==0?t:i[0].toUpperCase().localeCompare(e[0].toUpperCase())}o(Vv,"sortTranspositions");var kv=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(Vv),yV=0,SV=1,Fv=[function(i){return i.toUpperCase()},function(i){return i.trim()},function(i){return i.replace(/\./g,"")},function(i){return i.replace(/\s+/g,"")},function(i){return i.replace(/\s+/g,"-")},function(i){return i.replace("v","-")},function(i){return i.replace(/,?\s*(\d)/,"-$1")},function(i){return i.replace(/,?\s*(\d)/,"-$1.0")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(i){return i[0].toUpperCase()+i.slice(1)},function(i){return i.replace("/","-")},function(i){return i.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(i){return i.indexOf("3.0")!==-1?i+"-or-later":i+"-only"},function(i){return i+"only"},function(i){return i.replace(/(\d)$/,"-$1.0")},function(i){return i.replace(/(-| )?(\d)$/,"-$2-Clause")},function(i){return i.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(i){return i.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(i){return i.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(i){return i.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(i){return i.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(i){return i.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(i){return"CC-"+i},function(i){return"CC-"+i+"-4.0"},function(i){return i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(i){return"CC-"+i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],Cg=gV.map(function(i){var e=/^(.*)-\d+\.\d+$/.exec(i);return e?[e[0],e[1]]:[i,null]}).reduce(function(i,e){var t=e[1];return i[t]=i[t]||[],i[t].push(e[0]),i},{}),EV=Object.keys(Cg).map(o(function(e){return[e,Cg[e]]},"makeEntries")).filter(o(function(e){return e[1].length===1&&e[0]!==null&&e[0]!=="APL"},"identifySoleVersions")).map(o(function(e){return[e[0],e[1][0]]},"createLastResorts"));Cg=void 0;var Uv=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(EV).sort(Vv),wV=0,_V=1,jv=o(function(i){for(var e=0;e<Fv.length;e++){var t=Fv[e](i).trim();if(t!==i&&Ul(t))return t}return null},"validTransformation"),$v=o(function(i){for(var e=i.toUpperCase(),t=0;t<Uv.length;t++){var r=Uv[t];if(e.indexOf(r[wV])>-1)return r[_V]}return null},"validLastResort"),qv=o(function(i,e){for(var t=0;t<kv.length;t++){var r=kv[t],s=r[yV];if(i.indexOf(s)>-1){var n=i.replace(s,r[SV]),a=e(n);if(a!==null)return a}}return null},"anyCorrection");zv.exports=function(i,e){e=e||{};var t=e.upgrade===void 0?!0:!!e.upgrade;function r(c){return t?bV(c):c}o(r,"postprocess");var s=typeof i=="string"&&i.trim().length!==0;if(!s)throw Error("Invalid argument. Expected non-empty string.");if(i=i.trim(),Ul(i))return r(i);var n=i.replace(/\+$/,"").trim();if(Ul(n))return r(n);var a=jv(i);return a!==null||(a=qv(i,function(c){return Ul(c)?c:jv(c)}),a!==null)||(a=$v(i),a!==null)||(a=qv(i,$v),a!==null)?r(a):null};function bV(i){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(i)!==-1?i+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(i)!==-1?i.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(i)!==-1?i+"-or-later":i}o(bV,"upgradeGPLs")});var Kv=d((nfe,Jv)=>{var IV=vg(),OV=Hv(),Gv='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',vV=/^SEE LICEN[CS]E IN (.+)$/;function Wv(i,e){return e.slice(0,i.length)===i}o(Wv,"startsWith");function Rg(i){if(i.hasOwnProperty("license")){var e=i.license;return Wv("LicenseRef",e)||Wv("DocumentRef",e)}else return Rg(i.left)||Rg(i.right)}o(Rg,"usesLicenseRef");Jv.exports=function(i){var e;try{e=IV(i)}catch{var t;if(i==="UNLICENSED"||i==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(t=vV.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:t[1]};var r={validForOldPackages:!1,validForNewPackages:!1,warnings:[Gv]};if(i.trim().length!==0){var s=OV(i);s&&r.warnings.push('license is similar to the valid expression "'+s+'"')}return r}return Rg(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Gv]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var tC=d((afe,eC)=>{var{URL:Ag}=require("node:url"),Zv=ol(),CV=Kv(),Yv={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},Xv=o(i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf("."),"isEmail");function RV(i){let e=i.trim().split(`
|
|
9
|
-
`),t=0;for(;e[t]?.trim().match(/^(#|$)/);)t++;let r=t+1;for(;r<e.length&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}o(RV,"extractDescription");function Qv(i){if(typeof i!="string"){let n=i.name||"",a=i.url||i.web,c=a?" ("+a+")":"",u=i.email||i.mail,l=u?" <"+u+">":"";i=n+l+c}let e=i.match(/^([^(<]+)/),t=i.match(/\(([^()]+)\)/),r=i.match(/<([^<>]+)>/),s={};return e?.[0].trim()&&(s.name=e[0].trim()),r&&(s.email=r[1]),t&&(s.url=t[1]),s}o(Qv,"stringifyPerson");function AV(i,e){i.description&&typeof i.description!="string"&&(e?.push("'description' field should be a string"),delete i.description),i.readme&&!i.description&&i.readme!=="ERROR: No README data found!"&&(i.description=RV(i.readme)),i.description===void 0&&delete i.description,i.description||e?.push("No description"),i.modules&&(e?.push("modules field is deprecated"),delete i.modules);let t=i.files;if(t&&!Array.isArray(t)?(e?.push("Invalid 'files' member"),delete i.files):i.files&&(i.files=i.files.filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid filename in 'files' list: ${a}`),!1):!0})),i.man&&typeof i.man=="string"&&(i.man=[i.man]),!i.bugs&&i.repository?.url){let a=Zv.fromUrl(i.repository.url);a&&a.bugs()&&(i.bugs={url:a.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")Xv(i.bugs)?i.bugs={email:i.bugs}:Ag.canParse(i.bugs)?i.bugs={url:i.bugs}:e?.push("Bug string field must be url, email, or {email,url}");else{for(let c in i.bugs)["web","name"].includes(c)&&(e?.push(`bugs['${c}'] should probably be bugs['url'].`),i.bugs.url=i.bugs[c],delete i.bugs[c]);let a=i.bugs;i.bugs={},a.url&&(Ag.canParse(a.url)?i.bugs.url=a.url:e?.push("bugs.url field must be a string url. Deleted.")),a.email&&(typeof a.email=="string"&&Xv(a.email)?i.bugs.email=a.email:e?.push("bugs.email field must be a string email. Deleted."))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,e?.push("Normalized value of bugs field is an empty object. Deleted."))}typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,e?.push("keywords should be an array of strings")):i.keywords&&(i.keywords=i.keywords.filter(function(a){return typeof a!="string"||!a?(e?.push("keywords should be an array of strings"),!1):!0}));let r="bundledDependencies",s="bundleDependencies";if(i[r]&&!i[s]&&(i[s]=i[r],delete i[r]),i[s]&&!Array.isArray(i[s])?(e?.push("Invalid 'bundleDependencies' list. Must be array of package names"),delete i[s]):i[s]&&(i[s]=i[s].filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid bundleDependencies member: ${a}`),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,a)||(e?.push(`Non-dependency in bundleDependencies: ${a}`),i.dependencies[a]="*"),!0)})),!i.homepage&&i.repository&&i.repository.url){let a=Zv.fromUrl(i.repository.url);a&&(i.homepage=a.docs())}i.homepage&&(typeof i.homepage!="string"?(e?.push("homepage field must be a string url. Deleted."),delete i.homepage):Ag.canParse(i.homepage)||(i.homepage="http://"+i.homepage)),i.readme||(e?.push("No README data"),i.readme="ERROR: No README data found!");let n=i.license||i.licence;n?typeof n!="string"||n.length<1||n.trim()===""?e?.push("license should be a valid SPDX license expression"):CV(n).validForNewPackages||e?.push("license should be a valid SPDX license expression"):e?.push("No license field."),i.author&&(i.author=Qv(i.author)),["maintainers","contributors"].forEach(function(a){Array.isArray(i[a])&&(i[a]=i[a].map(Qv))});for(let a in Yv)Object.prototype.hasOwnProperty.call(i,a)&&e?.push(`${a} should probably be ${Yv[a]}.`)}o(AV,"normalizeData");eC.exports={normalizeData:AV}});var rC=d(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.sync=En.isexe=void 0;var TV=require("fs"),NV=require("fs/promises"),PV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return iC(await(0,NV.stat)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");En.isexe=PV;var DV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return iC((0,TV.statSync)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");En.sync=DV;var iC=o((i,e)=>i.isFile()&&xV(i,e),"checkStat"),xV=o((i,e)=>{let t=e.uid??process.getuid?.(),r=e.groups??process.getgroups?.()??[],s=e.gid??process.getgid?.()??r[0];if(t===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...r]),a=i.mode,c=i.uid,u=i.gid,l=parseInt("100",8),h=parseInt("010",8),f=parseInt("001",8),p=l|h;return!!(a&f||a&h&&n.has(u)||a&l&&c===t||a&p&&t===0)},"checkMode")});var nC=d(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.sync=wn.isexe=void 0;var LV=require("fs"),MV=require("fs/promises"),BV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return sC(await(0,MV.stat)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");wn.isexe=BV;var kV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return sC((0,LV.statSync)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");wn.sync=kV;var FV=o((i,e)=>{let{pathExt:t=process.env.PATHEXT||""}=e,r=t.split(";");if(r.indexOf("")!==-1)return!0;for(let s=0;s<r.length;s++){let n=r[s].toLowerCase(),a=i.substring(i.length-n.length).toLowerCase();if(n&&a===n)return!0}return!1},"checkPathExt"),sC=o((i,e,t)=>i.isFile()&&FV(e,t),"checkStat")});var aC=d(oC=>{"use strict";Object.defineProperty(oC,"__esModule",{value:!0})});var dC=d(Oe=>{"use strict";var cC=Oe&&Oe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),UV=Oe&&Oe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uC=Oe&&Oe.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&cC(e,i,t);return UV(e,i),e},jV=Oe&&Oe.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cC(e,i,t)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.sync=Oe.isexe=Oe.posix=Oe.win32=void 0;var lC=uC(rC());Oe.posix=lC;var hC=uC(nC());Oe.win32=hC;jV(aC(),Oe);var $V=process.env._ISEXE_TEST_PLATFORM_||process.platform,fC=$V==="win32"?hC:lC;Oe.isexe=fC.isexe;Oe.sync=fC.sync});var Tg=d((gfe,bC)=>{var{isexe:qV,sync:VV}=dC(),{join:zV,delimiter:HV,sep:pC,posix:mC}=require("path"),gC=process.platform==="win32",yC=new RegExp(`[${mC.sep}${pC===mC.sep?"":pC}]`.replace(/(\\)/g,"\\$1")),GV=new RegExp(`^\\.${yC.source}`),SC=o(i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),"getNotFoundError"),EC=o((i,{path:e=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:r=HV})=>{let s=i.match(yC)?[""]:[...gC?[process.cwd()]:[],...(e||"").split(r)];if(gC){let n=t||[".EXE",".CMD",".BAT",".COM"].join(r),a=n.split(r).flatMap(c=>[c,c.toLowerCase()]);return i.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:s,pathExt:a,pathExtExe:n}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),wC=o((i,e)=>{let t=/^".*"$/.test(i)?i.slice(1,-1):i;return(!t&&GV.test(e)?e.slice(0,2):"")+zV(t,e)},"getPathPart"),_C=o(async(i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=EC(i,e),n=[];for(let a of t){let c=wC(a,i);for(let u of r){let l=c+u;if(await qV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw SC(i)},"which"),WV=o((i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=EC(i,e),n=[];for(let a of t){let c=wC(a,i);for(let u of r){let l=c+u;if(VV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw SC(i)},"whichSync");bC.exports=_C;_C.sync=WV});var OC=d((Sfe,IC)=>{"use strict";var JV=o((i,e)=>{if(!i.length)return'""';let t;if(!/[ \t\n\v"]/.test(i))t=i;else{t='"';for(let r=0;r<=i.length;++r){let s=0;for(;i[r]==="\\";)++r,++s;if(r===i.length){t+="\\".repeat(s*2);break}i[r]==='"'?(t+="\\".repeat(s*2+1),t+=i[r]):(t+="\\".repeat(s),t+=i[r])}t+='"'}return t=t.replace(/[ !%^&()<>|"]/g,"^$&"),e&&(t=t.replace(/[ !%^&()<>|"]/g,"^$&")),t},"cmd"),KV=o(i=>i.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(i)?`'${i.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):i:"''","sh");IC.exports={cmd:JV,sh:KV}});var jl=d((wfe,AC)=>{"use strict";var{spawn:ZV}=require("child_process"),YV=require("os"),XV=Tg(),vC=OC(),Pg=o((i,e,t={},r={})=>{if(t.shell)return RC(i,e,t,r);let s,n,a=new Promise((m,y)=>{s=m,n=y}),c=new Error("command failed"),u=[],l=[],h=o(m=>({cmd:i,args:e,...m,...ez(u,l,t),...r}),"getResult"),f=o((m,y)=>{let g=h(y);n(Object.assign(m,g))},"rejectWithOpts"),p=ZV(i,e,t);return a.stdin=p.stdin,a.process=p,p.on("error",f),p.stdout&&(p.stdout.on("data",m=>u.push(m)),p.stdout.on("error",f)),p.stderr&&(p.stderr.on("data",m=>l.push(m)),p.stderr.on("error",f)),p.on("close",(m,y)=>{m||y?f(c,{code:m,signal:y}):s(h({code:m,signal:y}))}),a},"promiseSpawn"),RC=o((i,e,t,r)=>{let s=t.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let n={...t,shell:!1},a=[],c=i;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let l=!1,h="",f=!1;for(let m=0;m<i.length;++m){let y=i.charAt(m);if(y===" "&&!f)break;h+=y,(y==='"'||y==="'")&&(f=!f)}let p;try{p=XV.sync(h,{path:n.env&&CC(n.env,"PATH")||process.env.PATH,pathext:n.env&&CC(n.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{p=h.toLowerCase()}l=p.endsWith(".cmd")||p.endsWith(".bat");for(let m of e)c+=` ${vC.cmd(m,l)}`;a.push("/d","/s","/c",c),n.windowsVerbatimArguments=!0}else{for(let l of e)c+=` ${vC.sh(l)}`;a.push("-c",c)}return Pg(s,a,n,r)},"spawnWithShell"),QV=o((i,e={},t={})=>{let r={...e,shell:!0},s=[].concat(i),n=process.platform;if(n==="linux"&&YV.release().toLowerCase().includes("microsoft")&&(n="wsl",!process.env.BROWSER))return Promise.reject(new Error("Set the BROWSER environment variable to your desired browser."));let a=r.command;return a||(n==="win32"?(r.shell=process.env.ComSpec,a='start ""'):n==="wsl"?a="sensible-browser":n==="darwin"?a="open":a="xdg-open"),RC(a,s,r,t)},"open");Pg.open=QV;var Ng=o((i="pipe",e)=>i==="pipe"||i===null?!0:Array.isArray(i)?Ng(i[e],e):!1,"isPipe"),ez=o((i,e,{stdioString:t=!0,stdio:r})=>{let s={stdout:null,stderr:null};return Ng(r,1)&&(s.stdout=Buffer.concat(i),t&&(s.stdout=s.stdout.toString().trim())),Ng(r,2)&&(s.stderr=Buffer.concat(e),t&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),CC=o((i,e)=>{e=e.toLowerCase();for(let t of Object.keys(i).sort())if(t.toLowerCase()===e)return i[t]},"findInObject");AC.exports=Pg});var PC=d((bfe,NC)=>{"use strict";function TC(i,e){for(let t in e)Object.defineProperty(i,t,{value:e[t],enumerable:!0,configurable:!0});return i}o(TC,"assign");function tz(i,e,t){if(!i||typeof i=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return TC(i,t)}catch{t.message=i.message,t.stack=i.stack;let s=o(function(){},"ErrClass");return s.prototype=Object.create(Object.getPrototypeOf(i)),TC(new s,t)}}o(tz,"createError");NC.exports=tz});var xC=d((Ofe,DC)=>{function vt(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(vt,"RetryOperation");DC.exports=vt;vt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};vt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};vt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,s=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&s.unref(),!0};vt.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};vt.prototype.try=function(i){this.attempt(i)};vt.prototype.start=function(i){this.attempt(i)};vt.prototype.start=vt.prototype.try;vt.prototype.errors=function(){return this._errors};vt.prototype.attempts=function(){return this._attempts};vt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var LC=d(ys=>{var iz=xC();ys.operation=function(i){var e=ys.timeouts(i);return new iz(e,{forever:i&&i.forever,unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};ys.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};ys.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};ys.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(u){var l=ys.operation(e),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(p){l.retry(p)||(p&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(i,h)})},"retryWrapper").bind(i,a),i[n].options=e}}});var BC=d((Afe,MC)=>{MC.exports=LC()});var qa=d((Tfe,FC)=>{"use strict";var rz=PC(),sz=BC(),nz=Object.prototype.hasOwnProperty;function kC(i){return i&&i.code==="EPROMISERETRY"&&nz.call(i,"retried")}o(kC,"isRetryError");function oz(i,e){var t,r;return typeof i=="object"&&typeof e=="function"&&(t=e,e=i,i=t),r=sz.operation(e),new Promise(function(s,n){r.attempt(function(a){Promise.resolve().then(function(){return i(function(c){throw kC(c)&&(c=c.retried),rz(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(s,function(c){kC(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(oz,"promiseRetry");FC.exports=oz});var Mg=d((Pfe,UC)=>{var Va=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},Dg=class extends Va{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},xg=class extends Va{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},Lg=class extends Va{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};UC.exports={GitConnectionError:Dg,GitPathspecError:xg,GitUnknownError:Lg}});var $C=d((xfe,jC)=>{var{GitConnectionError:az,GitPathspecError:cz,GitUnknownError:uz}=Mg(),lz=new RegExp(["remote error: Internal Server Error","The remote end hung up unexpectedly","Connection timed out","Operation timed out","Failed to connect to .* Timed out","Connection reset by peer","SSL_ERROR_SYSCALL","The requested URL returned error: 503"].join("|")),hz=/pathspec .* did not match any file\(s\) known to git/;function fz(i){let e=i.stderr,t;return lz.test(e)?t=new az(e):hz.test(e)?t=new cz(e):t=new uz(e),Object.assign(t,i)}o(fz,"makeError");jC.exports=fz});var GC=d((Mfe,HC)=>{var{hasOwnProperty:Bg}=Object.prototype,kg=o((i,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process<"u"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r
|
|
9
|
+
>>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,C.braceExpand)(this.pattern,this.options)}parse(e){(0,al.assertValidPattern)(e);let t=this.options;if(e==="**")return C.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(L2))?s=t.dot?B2:M2:(r=e.match(O2))?s=(t.nocase?t.dot?T2:A2:t.dot?R2:v2)(r[1]):(r=e.match(k2))?s=(t.nocase?t.dot?U2:F2:t.dot?j2:$2)(r):(r=e.match(C2))?s=t.dot?P2:N2:(r=e.match(D2))&&(s=x2);let n=MO.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?V2:t.dot?z2:H2,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Y2(h):h===C.GLOBSTAR?C.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==C.GLOBSTAR||m===C.GLOBSTAR||(m===void 0?p!==void 0&&p!==C.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==C.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=C.GLOBSTAR))}),l.filter(h=>h!==C.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return C.minimatch.defaults(e).Minimatch}};C.Minimatch=cs;var X2=$m();Object.defineProperty(C,"AST",{enumerable:!0,get:o(function(){return X2.AST},"get")});var Q2=qm();Object.defineProperty(C,"escape",{enumerable:!0,get:o(function(){return Q2.escape},"get")});var eq=il();Object.defineProperty(C,"unescape",{enumerable:!0,get:o(function(){return eq.unescape},"get")});C.minimatch.AST=MO.AST;C.minimatch.Minimatch=cs;C.minimatch.escape=_2.escape;C.minimatch.unescape=b2.unescape});var te=d(Ve=>{"use strict";var tq=Ve&&Ve.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.Minipass=Ve.isWritable=Ve.isReadable=Ve.isStream=void 0;var UO=typeof process=="object"&&process?process:{stdout:null,stderr:null},Km=require("node:events"),VO=tq(require("node:stream")),iq=require("node:string_decoder"),rq=o(i=>!!i&&typeof i=="object"&&(i instanceof pl||i instanceof VO.default||(0,Ve.isReadable)(i)||(0,Ve.isWritable)(i)),"isStream");Ve.isStream=rq;var sq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==VO.default.Writable.prototype.pipe,"isReadable");Ve.isReadable=sq;var nq=o(i=>!!i&&typeof i=="object"&&i instanceof Km.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function","isWritable");Ve.isWritable=nq;var Bi=Symbol("EOF"),ki=Symbol("maybeEmitEnd"),pr=Symbol("emittedEnd"),cl=Symbol("emittingEnd"),ma=Symbol("emittedError"),ul=Symbol("closed"),jO=Symbol("read"),ll=Symbol("flush"),$O=Symbol("flushChunk"),Vt=Symbol("encoding"),hn=Symbol("decoder"),ve=Symbol("flowing"),ga=Symbol("paused"),fn=Symbol("resume"),Re=Symbol("buffer"),qe=Symbol("pipes"),Ae=Symbol("bufferLength"),Vm=Symbol("bufferPush"),hl=Symbol("bufferShift"),xe=Symbol("objectMode"),pe=Symbol("destroyed"),zm=Symbol("error"),Hm=Symbol("emitData"),qO=Symbol("emitEnd"),Gm=Symbol("emitEnd2"),ri=Symbol("async"),Wm=Symbol("abort"),fl=Symbol("aborted"),ya=Symbol("signal"),us=Symbol("dataListeners"),ct=Symbol("discarded"),Sa=o(i=>Promise.resolve().then(i),"defer"),oq=o(i=>i(),"nodefer"),aq=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),cq=o(i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBufferLike"),uq=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),dl=class{static{o(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[fn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jm=class extends dl{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},lq=o(i=>!!i.objectMode,"isObjectModeOptions"),hq=o(i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer","isEncodingOptions"),pl=class extends Km.EventEmitter{static{o(this,"Minipass")}[ve]=!1;[ga]=!1;[qe]=[];[Re]=[];[xe];[Vt];[ri];[hn];[Bi]=!1;[pr]=!1;[cl]=!1;[ul]=!1;[ma]=null;[Ae]=0;[pe]=!1;[ya];[fl]=!1;[us]=0;[ct]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");lq(t)?(this[xe]=!0,this[Vt]=null):hq(t)?(this[Vt]=t.encoding,this[xe]=!1):(this[xe]=!1,this[Vt]=null),this[ri]=!!t.async,this[hn]=this[Vt]?new iq.StringDecoder(this[Vt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:o(()=>this[Re],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:o(()=>this[qe],"get")});let{signal:r}=t;r&&(this[ya]=r,r.aborted?this[Wm]():r.addEventListener("abort",()=>this[Wm]()))}get bufferLength(){return this[Ae]}get encoding(){return this[Vt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[xe]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ri]}set async(e){this[ri]=this[ri]||!!e}[Wm](){this[fl]=!0,this.emit("abort",this[ya]?.reason),this.destroy(this[ya]?.reason)}get aborted(){return this[fl]}set aborted(e){}write(e,t,r){if(this[fl])return!1;if(this[Bi])throw new Error("write after end");if(this[pe])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[ri]?Sa:oq;if(!this[xe]&&!Buffer.isBuffer(e)){if(uq(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(cq(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[xe]?(this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):e.length?(typeof e=="string"&&!(t===this[Vt]&&!this[hn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Vt]&&(e=this[hn].write(e)),this[ve]&&this[Ae]!==0&&this[ll](!0),this[ve]?this.emit("data",e):this[Vm](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve]):(this[Ae]!==0&&this.emit("readable"),r&&s(r),this[ve])}read(e){if(this[pe])return null;if(this[ct]=!1,this[Ae]===0||e===0||e&&e>this[Ae])return this[ki](),null;this[xe]&&(e=null),this[Re].length>1&&!this[xe]&&(this[Re]=[this[Vt]?this[Re].join(""):Buffer.concat(this[Re],this[Ae])]);let t=this[jO](e||null,this[Re][0]);return this[ki](),t}[jO](e,t){if(this[xe])this[hl]();else{let r=t;e===r.length||e===null?this[hl]():typeof r=="string"?(this[Re][0]=r.slice(e),t=r.slice(0,e),this[Ae]-=e):(this[Re][0]=r.subarray(e),t=r.subarray(0,e),this[Ae]-=e)}return this.emit("data",t),!this[Re].length&&!this[Bi]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[Bi]=!0,this.writable=!1,(this[ve]||!this[ga])&&this[ki](),this}[fn](){this[pe]||(!this[us]&&!this[qe].length&&(this[ct]=!0),this[ga]=!1,this[ve]=!0,this.emit("resume"),this[Re].length?this[ll]():this[Bi]?this[ki]():this.emit("drain"))}resume(){return this[fn]()}pause(){this[ve]=!1,this[ga]=!0,this[ct]=!1}get destroyed(){return this[pe]}get flowing(){return this[ve]}get paused(){return this[ga]}[Vm](e){this[xe]?this[Ae]+=1:this[Ae]+=e.length,this[Re].push(e)}[hl](){return this[xe]?this[Ae]-=1:this[Ae]-=this[Re][0].length,this[Re].shift()}[ll](e=!1){do;while(this[$O](this[hl]())&&this[Re].length);!e&&!this[Re].length&&!this[Bi]&&this.emit("drain")}[$O](e){return this.emit("data",e),this[ve]}pipe(e,t){if(this[pe])return e;this[ct]=!1;let r=this[pr];return t=t||{},e===UO.stdout||e===UO.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[qe].push(t.proxyErrors?new Jm(this,e,t):new dl(this,e,t)),this[ri]?Sa(()=>this[fn]()):this[fn]()),e}unpipe(e){let t=this[qe].find(r=>r.dest===e);t&&(this[qe].length===1?(this[ve]&&this[us]===0&&(this[ve]=!1),this[qe]=[]):this[qe].splice(this[qe].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[ct]=!1,this[us]++,!this[qe].length&&!this[ve]&&this[fn]();else if(e==="readable"&&this[Ae]!==0)super.emit("readable");else if(aq(e)&&this[pr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ma]){let s=t;this[ri]?Sa(()=>s.call(this,this[ma])):s.call(this,this[ma])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[us]=this.listeners("data").length,this[us]===0&&!this[ct]&&!this[qe].length&&(this[ve]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[us]=0,!this[ct]&&!this[qe].length&&(this[ve]=!1)),t}get emittedEnd(){return this[pr]}[ki](){!this[cl]&&!this[pr]&&!this[pe]&&this[Re].length===0&&this[Bi]&&(this[cl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ul]&&this.emit("close"),this[cl]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==pe&&this[pe])return!1;if(e==="data")return!this[xe]&&!r?!1:this[ri]?(Sa(()=>this[Hm](r)),!0):this[Hm](r);if(e==="end")return this[qO]();if(e==="close"){if(this[ul]=!0,!this[pr]&&!this[pe])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[ma]=r,super.emit(zm,r);let n=!this[ya]||this.listeners("error").length?super.emit("error",r):!1;return this[ki](),n}else if(e==="resume"){let n=super.emit("resume");return this[ki](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...t);return this[ki](),s}[Hm](e){for(let r of this[qe])r.dest.write(e)===!1&&this.pause();let t=this[ct]?!1:super.emit("data",e);return this[ki](),t}[qO](){return this[pr]?!1:(this[pr]=!0,this.readable=!1,this[ri]?(Sa(()=>this[Gm]()),!0):this[Gm]())}[Gm](){if(this[hn]){let t=this[hn].end();if(t){for(let r of this[qe])r.dest.write(t);this[ct]||super.emit("data",t)}}for(let t of this[qe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[xe]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[xe]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[xe])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Vt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(pe,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ct]=!1;let e=!1,t=o(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:o(()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Bi])return t();let n,a,c=o(f=>{this.off("data",u),this.off("end",l),this.off(pe,h),t(),a(f)},"onerr"),u=o(f=>{this.off("error",c),this.off("end",l),this.off(pe,h),this.pause(),n({value:f,done:!!this[Bi]})},"ondata"),l=o(()=>{this.off("error",c),this.off("data",u),this.off(pe,h),t(),n({done:!0,value:void 0})},"onend"),h=o(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,p)=>{a=p,n=f,this.once(pe,h),this.once("error",c),this.once("end",l),this.once("data",u)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ct]=!1;let e=!1,t=o(()=>(this.pause(),this.off(zm,t),this.off(pe,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=o(()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}},"next");return this.once("end",t),this.once(zm,t),this.once(pe,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[pe])return e?this.emit("error",e):this.emit(pe),this;this[pe]=!0,this[ct]=!0,this[Re].length=0,this[Ae]=0;let t=this;return typeof t.close=="function"&&!this[ul]&&t.close(),e?this.emit("error",e):this.emit(pe),this}static get isStream(){return Ve.isStream}};Ve.Minipass=pl});var sv=d(W=>{"use strict";var fq=W&&W.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),dq=W&&W.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),pq=W&&W.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fq(e,i,t);return dq(e,i),e};Object.defineProperty(W,"__esModule",{value:!0});W.PathScurry=W.Path=W.PathScurryDarwin=W.PathScurryPosix=W.PathScurryWin32=W.PathScurryBase=W.PathPosix=W.PathWin32=W.PathBase=W.ChildrenCache=W.ResolveCache=void 0;var KO=os(),El=require("node:path"),mq=require("node:url"),wa=require("fs"),gq=pq(require("node:fs")),yq=wa.realpathSync.native,ml=require("node:fs/promises"),zO=te(),_a={lstatSync:wa.lstatSync,readdir:wa.readdir,readdirSync:wa.readdirSync,readlinkSync:wa.readlinkSync,realpathSync:yq,promises:{lstat:ml.lstat,readdir:ml.readdir,readlink:ml.readlink,realpath:ml.realpath}},ZO=o(i=>!i||i===_a||i===gq?_a:{..._a,...i,promises:{..._a.promises,...i.promises||{}}},"fsFromOption"),YO=/^\\\\\?\\([a-z]:)\\?$/i,Sq=o(i=>i.replace(/\//g,"\\").replace(YO,"$1\\"),"uncToDrive"),Eq=/[\\\/]/,_t=0,XO=1,QO=2,si=4,ev=6,tv=8,ls=10,iv=12,wt=15,Ea=~wt,Zm=16,HO=32,ba=64,zt=128,gl=256,Sl=512,GO=ba|zt|Sl,wq=1023,Ym=o(i=>i.isFile()?tv:i.isDirectory()?si:i.isSymbolicLink()?ls:i.isCharacterDevice()?QO:i.isBlockDevice()?ev:i.isSocket()?iv:i.isFIFO()?XO:_t,"entToType"),WO=new Map,Ia=o(i=>{let e=WO.get(i);if(e)return e;let t=i.normalize("NFKD");return WO.set(i,t),t},"normalize"),JO=new Map,yl=o(i=>{let e=JO.get(i);if(e)return e;let t=Ia(i.toLowerCase());return JO.set(i,t),t},"normalizeNocase"),Oa=class extends KO.LRUCache{static{o(this,"ResolveCache")}constructor(){super({max:256})}};W.ResolveCache=Oa;var wl=class extends KO.LRUCache{static{o(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:o(t=>t.length+1,"sizeCalculation")})}};W.ChildrenCache=wl;var rv=Symbol("PathScurry setAsCwd"),Ne=class{static{o(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#i;get mode(){return this.#i}#r;get nlink(){return this.#r}#s;get uid(){return this.#s}#u;get gid(){return this.#u}#c;get rdev(){return this.#c}#f;get blksize(){return this.#f}#n;get ino(){return this.#n}#h;get size(){return this.#h}#o;get blocks(){return this.#o}#d;get atimeMs(){return this.#d}#a;get mtimeMs(){return this.#a}#p;get ctimeMs(){return this.#p}#y;get birthtimeMs(){return this.#y}#_;get atime(){return this.#_}#m;get mtime(){return this.#m}#A;get ctime(){return this.#A}#w;get birthtime(){return this.#w}#b;#v;#I;#E;#N;#O;#l;#B;#R;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=_t,r,s,n,a,c){this.name=e,this.#b=n?yl(e):Ia(e),this.#l=t&wq,this.nocase=n,this.roots=s,this.root=r||this,this.#B=a,this.#I=c.fullpath,this.#N=c.relative,this.#O=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=ZO(c.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(s):this.#k(s)}#k(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#B.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#B.set(this,t),this.#l&=~Zm,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),s=this.nocase?yl(e):Ia(e);for(let u of r)if(u.#b===s)return u;let n=this.parent?this.sep:"",a=this.#I?this.#I+n+e:void 0,c=this.newChild(e,_t,{...t,parent:this,fullpath:a});return this.canReaddir()||(c.#l|=zt),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let e=this.name,t=this.parent;if(!t)return this.#N=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let e=this.name,t=this.parent;if(!t)return this.#O=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#I=s}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#E=`//?/${s}`:this.#E=s}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#l&wt)===_t}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#l&wt)===tv}isDirectory(){return(this.#l&wt)===si}isCharacterDevice(){return(this.#l&wt)===QO}isBlockDevice(){return(this.#l&wt)===ev}isFIFO(){return(this.#l&wt)===XO}isSocket(){return(this.#l&wt)===iv}isSymbolicLink(){return(this.#l&ls)===ls}lstatCached(){return this.#l&HO?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#l&wt;return!(e!==_t&&e!==ls||this.#l&gl||this.#l&zt)}calledReaddir(){return!!(this.#l&Zm)}isENOENT(){return!!(this.#l&zt)}isNamed(e){return this.nocase?this.#b===yl(e):this.#b===Ia(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#R=r}catch(t){this.#S(t.code);return}}#T(e){this.#l|=Zm;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#$()}}#$(){this.#l&zt||(this.#l=(this.#l|zt)&Ea,this.#P())}#P(){let e=this.children();e.provisional=0;for(let t of e)t.#$()}#x(){this.#l|=Sl,this.#F()}#F(){if(this.#l&ba)return;let e=this.#l;(e&wt)===si&&(e&=Ea),this.#l=e|ba,this.#P()}#D(e=""){e==="ENOTDIR"||e==="EPERM"?this.#F():e==="ENOENT"?this.#$():this.children().provisional=0}#L(e=""){e==="ENOTDIR"?this.parent.#F():e==="ENOENT"&&this.#$()}#S(e=""){let t=this.#l;t|=gl,e==="ENOENT"&&(t|=zt),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ea),this.#l=t,e==="ENOTDIR"&&this.parent&&this.parent.#F()}#U(e,t){return this.#g(e,t)||this.#j(e,t)}#j(e,t){let r=Ym(e),s=this.newChild(e.name,r,{parent:this}),n=s.#l&wt;return n!==si&&n!==ls&&n!==_t&&(s.#l|=ba),t.unshift(s),t.provisional++,s}#g(e,t){for(let r=t.provisional;r<t.length;r++){let s=t[r];if((this.nocase?yl(e.name):Ia(e.name))===s.#b)return this.#q(e,s,r,t)}}#q(e,t,r,s){let n=t.name;return t.#l=t.#l&Ea|Ym(e),n!==e.name&&(t.name=e.name),r!==s.provisional&&(r===s.length-1?s.pop():s.splice(r,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#l&zt)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#L(e.code)}}lstatSync(){if((this.#l&zt)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#L(e.code)}}#V(e){let{atime:t,atimeMs:r,birthtime:s,birthtimeMs:n,blksize:a,blocks:c,ctime:u,ctimeMs:l,dev:h,gid:f,ino:p,mode:m,mtime:y,mtimeMs:g,nlink:S,rdev:E,size:_,uid:b}=e;this.#_=t,this.#d=r,this.#w=s,this.#y=n,this.#f=a,this.#o=c,this.#A=u,this.#p=l,this.#t=h,this.#u=f,this.#n=p,this.#i=m,this.#m=y,this.#a=g,this.#r=S,this.#c=E,this.#h=_,this.#s=b;let w=Ym(e);this.#l=this.#l&Ea|w|HO,w!==_t&&w!==si&&w!==ls&&(this.#l|=ba)}#M=[];#z=!1;#G(e){this.#z=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let n=r.slice(0,r.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#z)return;this.#z=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#D(n.code),r.provisional=0;else{for(let c of a)this.#U(c,r);this.#T(r)}this.#G(r.slice(0,r.provisional))})}#H;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#H)await this.#H;else{let r=o(()=>{},"resolve");this.#H=new Promise(s=>r=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#U(s,e);this.#T(e)}catch(s){this.#D(s.code),e.provisional=0}this.#H=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#U(r,e);this.#T(e)}catch(r){this.#D(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#l&GO)return!1;let e=wt&this.#l;return e===_t||e===si||e===ls}shouldWalk(e,t){return(this.#l&si)===si&&!(this.#l&GO)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#C)return this.#C;if(!((Sl|gl|zt)&this.#l))try{let e=this.#e.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#x()}}[rv](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],s=this;for(;s&&s.parent;)t.add(s),s.#N=r.join(this.sep),s.#O=r.join("/"),s=s.parent,r.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#N=void 0,s.#O=void 0,s=s.parent}};W.PathBase=Ne;var va=class i extends Ne{static{o(this,"PathWin32")}sep="\\";splitSep=Eq;constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return El.win32.parse(e).root}getRoot(e){if(e=Sq(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Ta(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(YO,"$1\\"),e===t}};W.PathWin32=va;var Ra=class i extends Ne{static{o(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=_t,r,s,n,a,c){super(e,t,r,s,n,a,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=_t,r={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}};W.PathPosix=Ra;var Aa=class{static{o(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#i;nocase;#r;constructor(e=process.cwd(),t,r,{nocase:s,childrenCacheSize:n=16*1024,fs:a=_a}={}){this.#r=ZO(a),(e instanceof URL||e.startsWith("file://"))&&(e=(0,mq.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Oa,this.#t=new Oa,this.#i=new wl(n);let u=c.substring(this.rootPath.length).split(r);if(u.length===1&&!u[0]&&u.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,h=u.length-1,f=t.sep,p=this.rootPath,m=!1;for(let y of u){let g=h--;l=l.child(y,{relative:new Array(g).fill("..").join(f),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(m?"":f)+y}),m=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#i}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#e.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(t=t?`${a}/${t}`:a,this.isAbsolute(a)))break}let r=this.#t.get(t);if(r!==void 0)return r;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let s=await e.readdir();return r?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set,l=o((f,p)=>{u.add(f),f.readdirCB((m,y)=>{if(m)return p(m);let g=y.length;if(!g)return p();let S=o(()=>{--g===0&&p()},"next");for(let E of y)(!n||n(E))&&c.push(r?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(u,a)?l(_,S):S()):E.shouldWalk(u,a)?l(E,S):S()},!0)},"walk"),h=e;return new Promise((f,p)=>{l(h,m=>{if(m)return p(m);f(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=[];(!n||n(e))&&c.push(r?e:e.fullpath());let u=new Set([e]);for(let l of u){let h=l.readdirSync();for(let f of h){(!n||n(f))&&c.push(r?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(s&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(u,a)&&u.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t;(!n||n(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let u of c){let l=u.readdirSync();for(let h of l){(!n||n(h))&&(yield r?h:h.fullpath());let f=h;if(h.isSymbolicLink()){if(!(s&&(f=h.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0});(!n||n(e))&&c.write(r?e:e.fullpath());let u=new Set,l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=o((S,E,_=!1)=>{if(S)return c.emit("error",S);if(s&&!_){let b=[];for(let w of E)w.isSymbolicLink()&&b.push(w.realpath().then(I=>I?.isUnknown()?I.lstat():I));if(b.length){Promise.all(b).then(()=>y(null,E,!0));return}}for(let b of E)b&&(!n||n(b))&&(c.write(r?b:b.fullpath())||(p=!0));h--;for(let b of E){let w=b.realpathCached()||b;w.shouldWalk(u,a)&&l.push(w)}p&&!c.flowing?c.once("drain",f):g||f()},"onReaddir"),g=!0;m.readdirCB(y,!0),g=!1}},"process");return f(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Ne||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:s=!1,filter:n,walkFilter:a}=t,c=new zO.Minipass({objectMode:!0}),u=new Set;(!n||n(e))&&c.write(r?e:e.fullpath());let l=[e],h=0,f=o(()=>{let p=!1;for(;!p;){let m=l.shift();if(!m){h===0&&c.end();return}h++,u.add(m);let y=m.readdirSync();for(let g of y)(!n||n(g))&&(c.write(r?g:g.fullpath())||(p=!0));h--;for(let g of y){let S=g;if(g.isSymbolicLink()){if(!(s&&(S=g.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(u,a)&&l.push(S)}}p&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[rv](t)}};W.PathScurryBase=Aa;var Ta=class extends Aa{static{o(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,El.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return El.win32.parse(e).root.toUpperCase()}newRoot(e){return new va(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}};W.PathScurryWin32=Ta;var Ca=class extends Aa{static{o(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,El.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ra(this.rootPath,si,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}};W.PathScurryPosix=Ca;var _l=class extends Ca{static{o(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}};W.PathScurryDarwin=_l;W.Path=process.platform==="win32"?va:Ra;W.PathScurry=process.platform==="win32"?Ta:process.platform==="darwin"?_l:Ca});var Qm=d(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.Pattern=void 0;var _q=Mi(),bq=o(i=>i.length>=1,"isPatternList"),Iq=o(i=>i.length>=1,"isGlobList"),Xm=class i{static{o(this,"Pattern")}#e;#t;#i;length;#r;#s;#u;#c;#f;#n;#h=!0;constructor(e,t,r,s){if(!bq(e))throw new TypeError("empty pattern list");if(!Iq(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#i=r,this.#r=s,this.#i===0){if(this.isUNC()){let[n,a,c,u,...l]=this.#e,[h,f,p,m,...y]=this.#t;l[0]===""&&(l.shift(),y.shift());let g=[n,a,c,u,""].join("/"),S=[h,f,p,m,""].join("/");this.#e=[g,...l],this.#t=[S,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#e,[c,...u]=this.#t;a[0]===""&&(a.shift(),u.shift());let l=n+"/",h=c+"/";this.#e=[l,...a],this.#t=[h,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#i]}isString(){return typeof this.#e[this.#i]=="string"}isGlobstar(){return this.#e[this.#i]===_q.GLOBSTAR}isRegExp(){return this.#e[this.#i]instanceof RegExp}globString(){return this.#u=this.#u||(this.#i===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#i).join("/"))}hasMore(){return this.length>this.#i+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new i(this.#e,this.#t,this.#i+1,this.#r),this.#s.#n=this.#n,this.#s.#f=this.#f,this.#s.#c=this.#c,this.#s):this.#s=null}isUNC(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#r==="win32"&&this.#i===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#i===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#n!==void 0?this.#n:this.#n=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#i===0?e:""}checkFollowGlobstar(){return!(this.#i===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#i===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};bl.Pattern=Xm});var tg=d(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.Ignore=void 0;var nv=Mi(),Oq=Qm(),vq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",eg=class{static{o(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:s,noglobstar:n,platform:a=vq}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new nv.Minimatch(e,this.mmopts);for(let r=0;r<t.set.length;r++){let s=t.set[r],n=t.globParts[r];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Oq.Pattern(s,n,0,this.platform),c=new nv.Minimatch(a.globString(),this.mmopts),u=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(c):this.relative.push(c),u&&(l?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(t)||a.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(r))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};Il.Ignore=eg});var av=d(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Processor=ni.SubWalks=ni.MatchRecord=ni.HasWalkedCache=void 0;var ov=Mi(),Ol=class i{static{o(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),s=this.store.get(r);s?s.add(t.globString()):this.store.set(r,new Set([t.globString()]))}};ni.HasWalkedCache=Ol;var vl=class{static{o(this,"MatchRecord")}store=new Map;add(e,t,r){let s=(t?2:0)|(r?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};ni.MatchRecord=vl;var Rl=class{static{o(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(s=>s.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};ni.SubWalks=Rl;var ig=class i{static{o(this,"Processor")}hasWalkedCache;matches=new vl;subwalks=new Rl;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Ol}processPatterns(e,t){this.patterns=t;let r=t.map(s=>[e,s]);for(let[s,n]of r){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),c=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let u,l,h=!1;for(;typeof(u=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(u),n=l,h=!0;if(u=n.pattern(),l=n.rest(),h){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(s.resolve(u),c,f);continue}else if(u===ov.GLOBSTAR){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let f=l?.pattern(),p=l?.rest();if(!l||(f===""||f===".")&&!p)this.matches.add(s,c,f===""||f===".");else if(f===".."){let m=s.parent||s;p?this.hasWalkedCache.hasWalked(m,p)||this.subwalks.add(m,p):this.matches.add(m,c,!0)}}else u instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),s=this.child();for(let n of t)for(let a of r){let c=a.isAbsolute(),u=a.pattern(),l=a.rest();u===ov.GLOBSTAR?s.testGlobstar(n,a,l,c):u instanceof RegExp?s.testRegExp(n,u,l,c):s.testString(n,u,l,c)}return s}testGlobstar(e,t,r,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let n=r.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,r.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,r)}else n instanceof RegExp&&this.testRegExp(e,n,r.rest(),s)}}testRegExp(e,t,r,s){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}testString(e,t,r,s){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,s,!1))}};ni.Processor=ig});var lv=d(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.GlobStream=mr.GlobWalker=mr.GlobUtil=void 0;var Rq=te(),cv=tg(),uv=av(),Aq=o((i,e)=>typeof i=="string"?new cv.Ignore([i],e):Array.isArray(i)?new cv.Ignore(i,e):i,"makeIgnore"),Na=class{static{o(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#i;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#i=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#t=Aq(r.ignore??[],r),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#r(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#s(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#i:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#i)?"."+this.#i:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,t,r){let s=await this.matchCheck(e,r);s&&this.matchFinish(s,t)}matchSync(e,t,r){let s=this.matchCheckSync(e,r);s&&this.matchFinish(s,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new uv.Processor(this.opts),r)}walkCB2(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirCached();c.calledReaddir()?this.walkCB3(c,u,r,a):c.readdirCB((l,h)=>this.walkCB3(c,h,r,a),!0)}a()}walkCB3(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||(n++,this.match(c,u,l).then(()=>a()));for(let[c,u]of r.subwalks.entries())n++,this.walkCB2(c,u,r.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new uv.Processor(this.opts),r)}walkCB2Sync(e,t,r,s){if(this.#s(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,s));return}r.processPatterns(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;n++;let u=c.readdirSync();this.walkCB3Sync(c,u,r,a)}a()}walkCB3Sync(e,t,r,s){r=r.filterEntries(e,t);let n=1,a=o(()=>{--n===0&&s()},"next");for(let[c,u,l]of r.matches.entries())this.#r(c)||this.matchSync(c,u,l);for(let[c,u]of r.subwalks.entries())n++,this.walkCB2Sync(c,u,r.child(),a);a()}};mr.GlobUtil=Na;var rg=class extends Na{static{o(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};mr.GlobWalker=rg;var sg=class extends Na{static{o(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new Rq.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};mr.GlobStream=sg});var og=d(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.Glob=void 0;var Tq=Mi(),Cq=require("node:url"),Al=sv(),Nq=Qm(),Tl=lv(),Pq=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ng=class{static{o(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,Cq.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=t.platform||Pq,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=t.platform==="win32"?Al.PathScurryWin32:t.platform==="darwin"?Al.PathScurryDarwin:t.platform?Al.PathScurryPosix:Al.PathScurry;this.scurry=new u(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(u=>new Tq.Minimatch(u,s)),[a,c]=n.reduce((u,l)=>(u[0].push(...l.set),u[1].push(...l.globParts),u),[[],[]]);this.patterns=a.map((u,l)=>{let h=c[l];if(!h)throw new Error("invalid pattern object");return new Nq.Pattern(u,h,0,this.platform)})}async walk(){return[...await new Tl.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Tl.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Tl.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Tl.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};Cl.Glob=ng});var ag=d(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.hasMagic=void 0;var Dq=Mi(),xq=o((i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Dq.Minimatch(t,e).hasMagic())return!0;return!1},"hasMagic");Nl.hasMagic=xq});var hg=d(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.glob=q.sync=q.iterate=q.iterateSync=q.stream=q.streamSync=q.Ignore=q.hasMagic=q.Glob=q.unescape=q.escape=void 0;q.globStreamSync=Pa;q.globStream=cg;q.globSync=ug;q.globIterateSync=Da;q.globIterate=lg;var hv=Mi(),hs=og(),Lq=ag(),dv=Mi();Object.defineProperty(q,"escape",{enumerable:!0,get:o(function(){return dv.escape},"get")});Object.defineProperty(q,"unescape",{enumerable:!0,get:o(function(){return dv.unescape},"get")});var Mq=og();Object.defineProperty(q,"Glob",{enumerable:!0,get:o(function(){return Mq.Glob},"get")});var Bq=ag();Object.defineProperty(q,"hasMagic",{enumerable:!0,get:o(function(){return Bq.hasMagic},"get")});var kq=tg();Object.defineProperty(q,"Ignore",{enumerable:!0,get:o(function(){return kq.Ignore},"get")});function Pa(i,e={}){return new hs.Glob(i,e).streamSync()}o(Pa,"globStreamSync");function cg(i,e={}){return new hs.Glob(i,e).stream()}o(cg,"globStream");function ug(i,e={}){return new hs.Glob(i,e).walkSync()}o(ug,"globSync");async function fv(i,e={}){return new hs.Glob(i,e).walk()}o(fv,"glob_");function Da(i,e={}){return new hs.Glob(i,e).iterateSync()}o(Da,"globIterateSync");function lg(i,e={}){return new hs.Glob(i,e).iterate()}o(lg,"globIterate");q.streamSync=Pa;q.stream=Object.assign(cg,{sync:Pa});q.iterateSync=Da;q.iterate=Object.assign(lg,{sync:Da});q.sync=Object.assign(ug,{stream:Pa,iterate:Da});q.glob=Object.assign(fv,{glob:fv,globSync:ug,sync:q.sync,globStream:cg,stream:q.stream,globStreamSync:Pa,streamSync:q.streamSync,globIterate:lg,iterate:q.iterate,globIterateSync:Da,iterateSync:q.iterateSync,Glob:hs.Glob,hasMagic:Lq.hasMagic,escape:hv.escape,unescape:hv.unescape});q.glob.glob=q.glob});var fg=d((rhe,Fq)=>{Fq.exports=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]});var pv=d((she,Uq)=>{Uq.exports=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]});var mv=d((nhe,jq)=>{jq.exports=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]});var yv=d((ohe,gv)=>{"use strict";var $q=[].concat(fg()).concat(pv()),qq=mv();gv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(y){if(y instanceof RegExp){var g=i.slice(e),S=g.match(y);if(S)return e+=S[0].length,S[0]}else if(i.indexOf(y,e)===e)return e+=y.length,y}o(r,"read");function s(){r(/[ ]*/)}o(s,"skipWhitespace");function n(){for(var y,g=["WITH","AND","OR","(",")",":","+"],S=0;S<g.length&&(y=r(g[S]),!y);S++);if(y==="+"&&e>1&&i[e-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}o(n,"operator");function a(){return r(/[A-Za-z0-9-.]+/)}o(a,"idstring");function c(){var y=a();if(!y)throw new Error("Expected idstring at offset "+e);return y}o(c,"expectIdstring");function u(){if(r("DocumentRef-")){var y=c();return{type:"DOCUMENTREF",string:y}}}o(u,"documentRef");function l(){if(r("LicenseRef-")){var y=c();return{type:"LICENSEREF",string:y}}}o(l,"licenseRef");function h(){var y=e,g=a();if($q.indexOf(g)!==-1)return{type:"LICENSE",string:g};if(qq.indexOf(g)!==-1)return{type:"EXCEPTION",string:g};e=y}o(h,"identifier");function f(){return n()||u()||l()||h()}o(f,"parseToken");for(var p=[];t()&&(s(),!!t());){var m=f();if(!m)throw new Error("Unexpected `"+i[e]+"` at offset "+e);p.push(m)}return p}});var Ev=d((che,Sv)=>{"use strict";Sv.exports=function(i){var e=0;function t(){return e<i.length}o(t,"hasMore");function r(){return t()?i[e]:null}o(r,"token");function s(){if(!t())throw new Error;e++}o(s,"next");function n(g){var S=r();if(S&&S.type==="OPERATOR"&&g===S.string)return s(),S.string}o(n,"parseOperator");function a(){if(n("WITH")){var g=r();if(g&&g.type==="EXCEPTION")return s(),g.string;throw new Error("Expected exception after `WITH`")}}o(a,"parseWith");function c(){var g=e,S="",E=r();if(E.type==="DOCUMENTREF"&&(s(),S+="DocumentRef-"+E.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(E=r(),E.type==="LICENSEREF")return s(),S+="LicenseRef-"+E.string,{license:S};e=g}o(c,"parseLicenseRef");function u(){var g=r();if(g&&g.type==="LICENSE"){s();var S={license:g.string};n("+")&&(S.plus=!0);var E=a();return E&&(S.exception=E),S}}o(u,"parseLicense");function l(){var g=n("(");if(g){var S=m();if(!n(")"))throw new Error("Expected `)`");return S}}o(l,"parseParenthesizedExpression");function h(){return l()||c()||u()}o(h,"parseAtom");function f(g,S){return o(function E(){var _=S();if(_){if(!n(g))return _;var b=E();if(!b)throw new Error("Expected expression");return{left:_,conjunction:g.toLowerCase(),right:b}}},"parseBinaryOp")}o(f,"makeBinaryOpParser");var p=f("AND",h),m=f("OR",p),y=m();if(!y||t())throw new Error("Syntax error");return y}});var dg=d((lhe,wv)=>{"use strict";var Vq=yv(),zq=Ev();wv.exports=function(i){return zq(Vq(i))}});var Cv=d((hhe,Tv)=>{var Hq=dg(),Gq=fg();function Pl(i){try{return Hq(i),!0}catch{return!1}}o(Pl,"valid");function Av(i,e){var t=e[0].length-i[0].length;return t!==0?t:i[0].toUpperCase().localeCompare(e[0].toUpperCase())}o(Av,"sortTranspositions");var _v=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(Av),Wq=0,Jq=1,bv=[function(i){return i.toUpperCase()},function(i){return i.trim()},function(i){return i.replace(/\./g,"")},function(i){return i.replace(/\s+/g,"")},function(i){return i.replace(/\s+/g,"-")},function(i){return i.replace("v","-")},function(i){return i.replace(/,?\s*(\d)/,"-$1")},function(i){return i.replace(/,?\s*(\d)/,"-$1.0")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(i){return i.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(i){return i[0].toUpperCase()+i.slice(1)},function(i){return i.replace("/","-")},function(i){return i.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(i){return i.indexOf("3.0")!==-1?i+"-or-later":i+"-only"},function(i){return i+"only"},function(i){return i.replace(/(\d)$/,"-$1.0")},function(i){return i.replace(/(-| )?(\d)$/,"-$2-Clause")},function(i){return i.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(i){return i.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(i){return i.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(i){return i.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(i){return i.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(i){return i.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(i){return"CC-"+i},function(i){return"CC-"+i+"-4.0"},function(i){return i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(i){return"CC-"+i.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],pg=Gq.map(function(i){var e=/^(.*)-\d+\.\d+$/.exec(i);return e?[e[0],e[1]]:[i,null]}).reduce(function(i,e){var t=e[1];return i[t]=i[t]||[],i[t].push(e[0]),i},{}),Kq=Object.keys(pg).map(o(function(e){return[e,pg[e]]},"makeEntries")).filter(o(function(e){return e[1].length===1&&e[0]!==null&&e[0]!=="APL"},"identifySoleVersions")).map(o(function(e){return[e[0],e[1][0]]},"createLastResorts"));pg=void 0;var Iv=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(Kq).sort(Av),Zq=0,Yq=1,Ov=o(function(i){for(var e=0;e<bv.length;e++){var t=bv[e](i).trim();if(t!==i&&Pl(t))return t}return null},"validTransformation"),vv=o(function(i){for(var e=i.toUpperCase(),t=0;t<Iv.length;t++){var r=Iv[t];if(e.indexOf(r[Zq])>-1)return r[Yq]}return null},"validLastResort"),Rv=o(function(i,e){for(var t=0;t<_v.length;t++){var r=_v[t],s=r[Wq];if(i.indexOf(s)>-1){var n=i.replace(s,r[Jq]),a=e(n);if(a!==null)return a}}return null},"anyCorrection");Tv.exports=function(i,e){e=e||{};var t=e.upgrade===void 0?!0:!!e.upgrade;function r(c){return t?Xq(c):c}o(r,"postprocess");var s=typeof i=="string"&&i.trim().length!==0;if(!s)throw Error("Invalid argument. Expected non-empty string.");if(i=i.trim(),Pl(i))return r(i);var n=i.replace(/\+$/,"").trim();if(Pl(n))return r(n);var a=Ov(i);return a!==null||(a=Rv(i,function(c){return Pl(c)?c:Ov(c)}),a!==null)||(a=vv(i),a!==null)||(a=Rv(i,vv),a!==null)?r(a):null};function Xq(i){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(i)!==-1?i+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(i)!==-1?i.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(i)!==-1?i+"-or-later":i}o(Xq,"upgradeGPLs")});var xv=d((dhe,Dv)=>{var Qq=dg(),eV=Cv(),Nv='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',tV=/^SEE LICEN[CS]E IN (.+)$/;function Pv(i,e){return e.slice(0,i.length)===i}o(Pv,"startsWith");function mg(i){if(i.hasOwnProperty("license")){var e=i.license;return Pv("LicenseRef",e)||Pv("DocumentRef",e)}else return mg(i.left)||mg(i.right)}o(mg,"usesLicenseRef");Dv.exports=function(i){var e;try{e=Qq(i)}catch{var t;if(i==="UNLICENSED"||i==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(t=tV.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:t[1]};var r={validForOldPackages:!1,validForNewPackages:!1,warnings:[Nv]};if(i.trim().length!==0){var s=eV(i);s&&r.warnings.push('license is similar to the valid expression "'+s+'"')}return r}return mg(e)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[Nv]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}});var Uv=d((mhe,Fv)=>{var{URL:gg}=require("node:url"),Lv=Xu(),iV=xv(),Mv={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},Bv=o(i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf("."),"isEmail");function rV(i){let e=i.trim().split(`
|
|
10
|
+
`),t=0;for(;e[t]?.trim().match(/^(#|$)/);)t++;let r=t+1;for(;r<e.length&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}o(rV,"extractDescription");function kv(i){if(typeof i!="string"){let n=i.name||"",a=i.url||i.web,c=a?" ("+a+")":"",u=i.email||i.mail,l=u?" <"+u+">":"";i=n+l+c}let e=i.match(/^([^(<]+)/),t=i.match(/\(([^()]+)\)/),r=i.match(/<([^<>]+)>/),s={};return e?.[0].trim()&&(s.name=e[0].trim()),r&&(s.email=r[1]),t&&(s.url=t[1]),s}o(kv,"stringifyPerson");function sV(i,e){i.description&&typeof i.description!="string"&&(e?.push("'description' field should be a string"),delete i.description),i.readme&&!i.description&&i.readme!=="ERROR: No README data found!"&&(i.description=rV(i.readme)),i.description===void 0&&delete i.description,i.description||e?.push("No description"),i.modules&&(e?.push("modules field is deprecated"),delete i.modules);let t=i.files;if(t&&!Array.isArray(t)?(e?.push("Invalid 'files' member"),delete i.files):i.files&&(i.files=i.files.filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid filename in 'files' list: ${a}`),!1):!0})),i.man&&typeof i.man=="string"&&(i.man=[i.man]),!i.bugs&&i.repository?.url){let a=Lv.fromUrl(i.repository.url);a&&a.bugs()&&(i.bugs={url:a.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")Bv(i.bugs)?i.bugs={email:i.bugs}:gg.canParse(i.bugs)?i.bugs={url:i.bugs}:e?.push("Bug string field must be url, email, or {email,url}");else{for(let c in i.bugs)["web","name"].includes(c)&&(e?.push(`bugs['${c}'] should probably be bugs['url'].`),i.bugs.url=i.bugs[c],delete i.bugs[c]);let a=i.bugs;i.bugs={},a.url&&(gg.canParse(a.url)?i.bugs.url=a.url:e?.push("bugs.url field must be a string url. Deleted.")),a.email&&(typeof a.email=="string"&&Bv(a.email)?i.bugs.email=a.email:e?.push("bugs.email field must be a string email. Deleted."))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,e?.push("Normalized value of bugs field is an empty object. Deleted."))}typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,e?.push("keywords should be an array of strings")):i.keywords&&(i.keywords=i.keywords.filter(function(a){return typeof a!="string"||!a?(e?.push("keywords should be an array of strings"),!1):!0}));let r="bundledDependencies",s="bundleDependencies";if(i[r]&&!i[s]&&(i[s]=i[r],delete i[r]),i[s]&&!Array.isArray(i[s])?(e?.push("Invalid 'bundleDependencies' list. Must be array of package names"),delete i[s]):i[s]&&(i[s]=i[s].filter(function(a){return!a||typeof a!="string"?(e?.push(`Invalid bundleDependencies member: ${a}`),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,a)||(e?.push(`Non-dependency in bundleDependencies: ${a}`),i.dependencies[a]="*"),!0)})),!i.homepage&&i.repository&&i.repository.url){let a=Lv.fromUrl(i.repository.url);a&&(i.homepage=a.docs())}i.homepage&&(typeof i.homepage!="string"?(e?.push("homepage field must be a string url. Deleted."),delete i.homepage):gg.canParse(i.homepage)||(i.homepage="http://"+i.homepage)),i.readme||(e?.push("No README data"),i.readme="ERROR: No README data found!");let n=i.license||i.licence;n?typeof n!="string"||n.length<1||n.trim()===""?e?.push("license should be a valid SPDX license expression"):iV(n).validForNewPackages||e?.push("license should be a valid SPDX license expression"):e?.push("No license field."),i.author&&(i.author=kv(i.author)),["maintainers","contributors"].forEach(function(a){Array.isArray(i[a])&&(i[a]=i[a].map(kv))});for(let a in Mv)Object.prototype.hasOwnProperty.call(i,a)&&e?.push(`${a} should probably be ${Mv[a]}.`)}o(sV,"normalizeData");Fv.exports={normalizeData:sV}});var $v=d(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.sync=dn.isexe=void 0;var nV=require("fs"),oV=require("fs/promises"),aV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv(await(0,oV.stat)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");dn.isexe=aV;var cV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return jv((0,nV.statSync)(i),e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");dn.sync=cV;var jv=o((i,e)=>i.isFile()&&uV(i,e),"checkStat"),uV=o((i,e)=>{let t=e.uid??process.getuid?.(),r=e.groups??process.getgroups?.()??[],s=e.gid??process.getgid?.()??r[0];if(t===void 0||s===void 0)throw new Error("cannot get uid or gid");let n=new Set([s,...r]),a=i.mode,c=i.uid,u=i.gid,l=parseInt("100",8),h=parseInt("010",8),f=parseInt("001",8),p=l|h;return!!(a&f||a&h&&n.has(u)||a&l&&c===t||a&p&&t===0)},"checkMode")});var Vv=d(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.sync=pn.isexe=void 0;var lV=require("fs"),hV=require("fs/promises"),fV=o(async(i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv(await(0,hV.stat)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"isexe");pn.isexe=fV;var dV=o((i,e={})=>{let{ignoreErrors:t=!1}=e;try{return qv((0,lV.statSync)(i),i,e)}catch(r){let s=r;if(t||s.code==="EACCES")return!1;throw s}},"sync");pn.sync=dV;var pV=o((i,e)=>{let{pathExt:t=process.env.PATHEXT||""}=e,r=t.split(";");if(r.indexOf("")!==-1)return!0;for(let s=0;s<r.length;s++){let n=r[s].toLowerCase(),a=i.substring(i.length-n.length).toLowerCase();if(n&&a===n)return!0}return!1},"checkPathExt"),qv=o((i,e,t)=>i.isFile()&&pV(e,t),"checkStat")});var Hv=d(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0})});var Yv=d(Oe=>{"use strict";var Gv=Oe&&Oe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),mV=Oe&&Oe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Wv=Oe&&Oe.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&Gv(e,i,t);return mV(e,i),e},gV=Oe&&Oe.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Gv(e,i,t)};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.sync=Oe.isexe=Oe.posix=Oe.win32=void 0;var Jv=Wv($v());Oe.posix=Jv;var Kv=Wv(Vv());Oe.win32=Kv;gV(Hv(),Oe);var yV=process.env._ISEXE_TEST_PLATFORM_||process.platform,Zv=yV==="win32"?Kv:Jv;Oe.isexe=Zv.isexe;Oe.sync=Zv.sync});var yg=d((Ohe,oR)=>{var{isexe:SV,sync:EV}=Yv(),{join:wV,delimiter:_V,sep:Xv,posix:Qv}=require("path"),eR=process.platform==="win32",tR=new RegExp(`[${Qv.sep}${Xv===Qv.sep?"":Xv}]`.replace(/(\\)/g,"\\$1")),bV=new RegExp(`^\\.${tR.source}`),iR=o(i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),"getNotFoundError"),rR=o((i,{path:e=process.env.PATH,pathExt:t=process.env.PATHEXT,delimiter:r=_V})=>{let s=i.match(tR)?[""]:[...eR?[process.cwd()]:[],...(e||"").split(r)];if(eR){let n=t||[".EXE",".CMD",".BAT",".COM"].join(r),a=n.split(r).flatMap(c=>[c,c.toLowerCase()]);return i.includes(".")&&a[0]!==""&&a.unshift(""),{pathEnv:s,pathExt:a,pathExtExe:n}}return{pathEnv:s,pathExt:[""]}},"getPathInfo"),sR=o((i,e)=>{let t=/^".*"$/.test(i)?i.slice(1,-1):i;return(!t&&bV.test(e)?e.slice(0,2):"")+wV(t,e)},"getPathPart"),nR=o(async(i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(await SV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"which"),IV=o((i,e={})=>{let{pathEnv:t,pathExt:r,pathExtExe:s}=rR(i,e),n=[];for(let a of t){let c=sR(a,i);for(let u of r){let l=c+u;if(EV(l,{pathExt:s,ignoreErrors:!0})){if(!e.all)return l;n.push(l)}}}if(e.all&&n.length)return n;if(e.nothrow)return null;throw iR(i)},"whichSync");oR.exports=nR;nR.sync=IV});var cR=d((Rhe,aR)=>{"use strict";var OV=o((i,e)=>{if(!i.length)return'""';let t;if(!/[ \t\n\v"]/.test(i))t=i;else{t='"';for(let r=0;r<=i.length;++r){let s=0;for(;i[r]==="\\";)++r,++s;if(r===i.length){t+="\\".repeat(s*2);break}i[r]==='"'?(t+="\\".repeat(s*2+1),t+=i[r]):(t+="\\".repeat(s),t+=i[r])}t+='"'}return t=t.replace(/[ !%^&()<>|"]/g,"^$&"),e&&(t=t.replace(/[ !%^&()<>|"]/g,"^$&")),t},"cmd"),vV=o(i=>i.length?/[\t\n\r "#$&'()*;<>?\\`|~]/.test(i)?`'${i.replace(/'/g,"'\\''")}'`.replace(/^(?:'')+(?!$)/,"").replace(/\\'''/g,"\\'"):i:"''","sh");aR.exports={cmd:OV,sh:vV}});var Dl=d((The,fR)=>{"use strict";var{spawn:RV}=require("child_process"),AV=require("os"),TV=yg(),uR=cR(),Eg=o((i,e,t={},r={})=>{if(t.shell)return hR(i,e,t,r);let s,n,a=new Promise((m,y)=>{s=m,n=y}),c=new Error("command failed"),u=[],l=[],h=o(m=>({cmd:i,args:e,...m,...NV(u,l,t),...r}),"getResult"),f=o((m,y)=>{let g=h(y);n(Object.assign(m,g))},"rejectWithOpts"),p=RV(i,e,t);return a.stdin=p.stdin,a.process=p,p.on("error",f),p.stdout&&(p.stdout.on("data",m=>u.push(m)),p.stdout.on("error",f)),p.stderr&&(p.stderr.on("data",m=>l.push(m)),p.stderr.on("error",f)),p.on("close",(m,y)=>{m||y?f(c,{code:m,signal:y}):s(h({code:m,signal:y}))}),a},"promiseSpawn"),hR=o((i,e,t,r)=>{let s=t.shell;s===!0&&(s=process.platform==="win32"?process.env.ComSpec||"cmd.exe":"sh");let n={...t,shell:!1},a=[],c=i;if(/(?:^|\\)cmd(?:\.exe)?$/i.test(s)){let l=!1,h="",f=!1;for(let m=0;m<i.length;++m){let y=i.charAt(m);if(y===" "&&!f)break;h+=y,(y==='"'||y==="'")&&(f=!f)}let p;try{p=TV.sync(h,{path:n.env&&lR(n.env,"PATH")||process.env.PATH,pathext:n.env&&lR(n.env,"PATHEXT")||process.env.PATHEXT}).toLowerCase()}catch{p=h.toLowerCase()}l=p.endsWith(".cmd")||p.endsWith(".bat");for(let m of e)c+=` ${uR.cmd(m,l)}`;a.push("/d","/s","/c",c),n.windowsVerbatimArguments=!0}else{for(let l of e)c+=` ${uR.sh(l)}`;a.push("-c",c)}return Eg(s,a,n,r)},"spawnWithShell"),CV=o((i,e={},t={})=>{let r={...e,shell:!0},s=[].concat(i),n=process.platform;if(n==="linux"&&AV.release().toLowerCase().includes("microsoft")&&(n="wsl",!process.env.BROWSER))return Promise.reject(new Error("Set the BROWSER environment variable to your desired browser."));let a=r.command;return a||(n==="win32"?(r.shell=process.env.ComSpec,a='start ""'):n==="wsl"?a="sensible-browser":n==="darwin"?a="open":a="xdg-open"),hR(a,s,r,t)},"open");Eg.open=CV;var Sg=o((i="pipe",e)=>i==="pipe"||i===null?!0:Array.isArray(i)?Sg(i[e],e):!1,"isPipe"),NV=o((i,e,{stdioString:t=!0,stdio:r})=>{let s={stdout:null,stderr:null};return Sg(r,1)&&(s.stdout=Buffer.concat(i),t&&(s.stdout=s.stdout.toString().trim())),Sg(r,2)&&(s.stderr=Buffer.concat(e),t&&(s.stderr=s.stderr.toString().trim())),s},"stdioResult"),lR=o((i,e)=>{e=e.toLowerCase();for(let t of Object.keys(i).sort())if(t.toLowerCase()===e)return i[t]},"findInObject");fR.exports=Eg});var mR=d((Nhe,pR)=>{"use strict";function dR(i,e){for(let t in e)Object.defineProperty(i,t,{value:e[t],enumerable:!0,configurable:!0});return i}o(dR,"assign");function PV(i,e,t){if(!i||typeof i=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=void 0),e!=null&&(t.code=e);try{return dR(i,t)}catch{t.message=i.message,t.stack=i.stack;let s=o(function(){},"ErrClass");return s.prototype=Object.create(Object.getPrototypeOf(i)),dR(new s,t)}}o(PV,"createError");pR.exports=PV});var yR=d((Dhe,gR)=>{function bt(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(bt,"RetryOperation");gR.exports=bt;bt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};bt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};bt.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift();else return!1;var r=this,s=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t);return this._options.unref&&s.unref(),!0};bt.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};bt.prototype.try=function(i){this.attempt(i)};bt.prototype.start=function(i){this.attempt(i)};bt.prototype.start=bt.prototype.try;bt.prototype.errors=function(){return this._errors};bt.prototype.attempts=function(){return this._attempts};bt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var SR=d(fs=>{var DV=yR();fs.operation=function(i){var e=fs.timeouts(i);return new DV(e,{forever:i&&i.forever,unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};fs.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};fs.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*e.minTimeout*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};fs.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(u){var l=fs.operation(e),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(p){l.retry(p)||(p&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){u.apply(i,h)})},"retryWrapper").bind(i,a),i[n].options=e}}});var wR=d((Bhe,ER)=>{ER.exports=SR()});var xa=d((khe,bR)=>{"use strict";var xV=mR(),LV=wR(),MV=Object.prototype.hasOwnProperty;function _R(i){return i&&i.code==="EPROMISERETRY"&&MV.call(i,"retried")}o(_R,"isRetryError");function BV(i,e){var t,r;return typeof i=="object"&&typeof e=="function"&&(t=e,e=i,i=t),r=LV.operation(e),new Promise(function(s,n){r.attempt(function(a){Promise.resolve().then(function(){return i(function(c){throw _R(c)&&(c=c.retried),xV(new Error("Retrying"),"EPROMISERETRY",{retried:c})},a)}).then(s,function(c){_R(c)&&(c=c.retried,r.retry(c||new Error))||n(c)})})})}o(BV,"promiseRetry");bR.exports=BV});var Ig=d((Uhe,IR)=>{var La=class extends Error{static{o(this,"GitError")}shouldRetry(){return!1}},wg=class extends La{static{o(this,"GitConnectionError")}constructor(){super("A git connection error occurred")}shouldRetry(e){return e<3}},_g=class extends La{static{o(this,"GitPathspecError")}constructor(){super("The git reference could not be found")}},bg=class extends La{static{o(this,"GitUnknownError")}constructor(){super("An unknown git error occurred")}};IR.exports={GitConnectionError:wg,GitPathspecError:_g,GitUnknownError:bg}});var vR=d(($he,OR)=>{var{GitConnectionError:kV,GitPathspecError:FV,GitUnknownError:UV}=Ig(),jV=new RegExp(["remote error: Internal Server Error","The remote end hung up unexpectedly","Connection timed out","Operation timed out","Failed to connect to .* Timed out","Connection reset by peer","SSL_ERROR_SYSCALL","The requested URL returned error: 503"].join("|")),$V=/pathspec .* did not match any file\(s\) known to git/;function qV(i){let e=i.stderr,t;return jV.test(e)?t=new kV(e):$V.test(e)?t=new FV(e):t=new UV(e),Object.assign(t,i)}o(qV,"makeError");OR.exports=qV});var NR=d((Vhe,CR)=>{var{hasOwnProperty:Og}=Object.prototype,vg=o((i,e={})=>{typeof e=="string"&&(e={section:e}),e.align=e.align===!0,e.newline=e.newline===!0,e.sort=e.sort===!0,e.whitespace=e.whitespace===!0||e.align===!0,e.platform=e.platform||typeof process<"u"&&process.platform,e.bracketedArray=e.bracketedArray!==!1;let t=e.platform==="win32"?`\r
|
|
10
11
|
`:`
|
|
11
|
-
`,r=e.whitespace?" = ":"=",s=[],n=e.sort?Object.keys(i).sort():Object.keys(i),a=0;e.align&&(a=qi(n.filter(l=>i[l]===null||Array.isArray(i[l])||typeof i[l]!="object").map(l=>Array.isArray(i[l])?`${l}[]`:l).concat([""]).reduce((l,h)=>qi(l).length>=qi(h).length?l:h)).length);let c="",u=e.bracketedArray?"[]":"";for(let l of n){let h=i[l];if(h&&Array.isArray(h))for(let f of h)c+=qi(`${l}${u}`).padEnd(a," ")+r+qi(f)+t;else h&&typeof h=="object"?s.push(l):c+=qi(l).padEnd(a," ")+r+qi(h)+t}e.section&&c.length&&(c="["+qi(e.section)+"]"+(e.newline?t+t:t)+c);for(let l of s){let h=VC(l,".").join("\\."),f=(e.section?e.section+".":"")+h,p=kg(i[l],{...e,section:f});c.length&&p.length&&(c+=t),c+=p}return c},"encode");function VC(i,e){var t=0,r=0,s=0,n=[];do if(s=i.indexOf(e,t),s!==-1){if(t=s+e.length,s>0&&i[s-1]==="\\")continue;n.push(i.slice(r,s)),r=s+e.length}while(s!==-1);return n.push(i.slice(r)),n}o(VC,"splitSections");var qC=o((i,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),r=t,s=null,n=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,a=i.split(/[\r\n]+/g),c={};for(let l of a){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;let h=l.match(n);if(!h)continue;if(h[1]!==void 0){if(s=$l(h[1]),s==="__proto__"){r=Object.create(null);continue}r=t[s]=t[s]||Object.create(null);continue}let f=$l(h[2]),p;e.bracketedArray?p=f.length>2&&f.slice(-2)==="[]":(c[f]=(c?.[f]||0)+1,p=c[f]>1);let m=p&&f.endsWith("[]")?f.slice(0,-2):f;if(m==="__proto__")continue;let y=h[3]?$l(h[4]):!0,g=y==="true"||y==="false"||y==="null"?JSON.parse(y):y;p&&(Bg.call(r,m)?Array.isArray(r[m])||(r[m]=[r[m]]):r[m]=[]),Array.isArray(r[m])?r[m].push(g):r[m]=g}let u=[];for(let l of Object.keys(t)){if(!Bg.call(t,l)||typeof t[l]!="object"||Array.isArray(t[l]))continue;let h=VC(l,".");r=t;let f=h.pop(),p=f.replace(/\\\./g,".");for(let m of h)m!=="__proto__"&&((!Bg.call(r,m)||typeof r[m]!="object")&&(r[m]=Object.create(null)),r=r[m]);r===t&&p===f||(r[p]=t[l],u.push(l))}for(let l of u)delete t[l];return t},"decode"),zC=o(i=>i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"),"isQuoted"),qi=o(i=>typeof i!="string"||i.match(/[=\r\n]/)||i.match(/^\[/)||i.length>1&&zC(i)||i!==i.trim()?JSON.stringify(i):i.split(";").join("\\;").split("#").join("\\#"),"safe"),$l=o(i=>{if(i=(i||"").trim(),zC(i)){i.charAt(0)==="'"&&(i=i.slice(1,-1));try{i=JSON.parse(i)}catch{}}else{let e=!1,t="";for(let r=0,s=i.length;r<s;r++){let n=i.charAt(r);if(e)"\\;#".indexOf(n)!==-1?t+=n:t+="\\"+n,e=!1;else{if(";#".indexOf(n)!==-1)break;n==="\\"?e=!0:t+=n}}return e&&(t+="\\"),t.trim()}return i},"unsafe");HC.exports={parse:qC,decode:qC,stringify:kg,encode:kg,safe:qi,unsafe:$l}});var ZC=d((kfe,Fg)=>{var WC=require("node:fs"),dz=require("node:os"),pz=require("node:path"),mz=GC(),JC=pz.join(dz.homedir(),".gitconfig"),za=null,KC=o(()=>{if(za===null)try{if(za={},WC.existsSync(JC)){let i=WC.readFileSync(JC,"utf-8");za=mz.parse(i)}}catch{za={}}return za},"loadGitConfig"),gz=o(()=>{let i=KC();return{sshCommandSetInConfig:i?.core?.sshCommand!==void 0,askPassSetInConfig:i?.core?.askpass!==void 0}},"checkGitConfigs"),yz=process.env.GIT_SSH_COMMAND!==void 0,Sz=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:Ez,askPassSetInConfig:wz}=gz(),_z={...Sz||wz?{}:{GIT_ASKPASS:"echo"},...yz||Ez?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};Fg.exports=(i={})=>({stdioString:!0,...i,shell:!1,env:i.env||{..._z,...process.env}});Fg.exports.loadGitConfig=KC});var XC=d((Ufe,YC)=>{var bz=Tg(),Ug;try{Ug=bz.sync("git")}catch{}YC.exports=(i={})=>i.git?i.git:!Ug||i.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):Ug});var Ha=d((jfe,QC)=>{var Iz=jl(),Oz=qa(),{log:vz}=_t(),Cz=$C(),Rz=ZC();QC.exports=(i,e={})=>{let r=XC()(e);if(r instanceof Error)return Promise.reject(r);let s=e.allowReplace||i[0]==="--no-replace-objects"?i:["--no-replace-objects",...i],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),Oz((a,c)=>(c!==1&&vz.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),Iz(r,s,Rz(e)).catch(u=>{let l=Cz(u);if(!l.shouldRetry(c))throw l;a(l)})),n)}});var Vg=d(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.LRUCache=void 0;var _n=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tR=new Set,jg=typeof process=="object"&&process?process:{},iR=o((i,e,t,r)=>{typeof jg.emitWarning=="function"&&jg.emitWarning(i,e,t,r)},"emitWarning"),ql=globalThis.AbortController,eR=globalThis.AbortSignal;if(typeof ql>"u"){eR=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},ql=class{static{o(this,"AbortController")}constructor(){e()}signal=new eR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=jg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,iR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var Az=o(i=>!tR.has(i),"shouldWarn"),Vfe=Symbol("type"),wr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),rR=o(i=>wr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?bn:null:null,"getUintArray"),bn=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},$g=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=rR(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},qg=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#f;#n;#h;#o;#d;#a;#p;#y;#_;#m;#R;#w;#b;#v;#I;#E;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#b,sizes:e.#R,keyMap:e.#n,keyList:e.#h,valList:e.#o,next:e.#d,prev:e.#a,get head(){return e.#p},get tail(){return e.#y},free:e.#_,isBackgroundFetch:o(t=>e.#S(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#L(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#j(t),"moveToTail"),indexes:o(t=>e.#P(t),"indexes"),rindexes:o(t=>e.#x(t),"rindexes"),isStale:o(t=>e.#C(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#u}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:I,ignoreFetchAbort:v}=e;if(t!==0&&!wr(t))throw new TypeError("max option must be a nonnegative integer");let N=t?rR(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=y||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#I=!!S,this.#n=new Map,this.#h=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#d=new N(t),this.#a=new N(t),this.#p=0,this.#y=0,this.#_=$g.create(t),this.#c=0,this.#f=0,typeof l=="function"&&(this.#i=l),typeof h=="function"?(this.#r=h,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#v=!!this.#i,this.#E=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#t!==0&&!wr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=wr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";Az(P)&&(tR.add(P),iR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,i))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new bn(this.#e),t=new bn(this.#e);this.#b=e,this.#w=t,this.#B=(n,a,c=_n.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#C(n)&&this.#g(this.#h[n],"expire")},a+1);u.unref&&u.unref()}},this.#O=n=>{t[n]=e[n]!==0?_n.now():0},this.#l=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=_n.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#n.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#C=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#O=o(()=>{},"#updateItemAge");#l=o(()=>{},"#statusTTL");#B=o(()=>{},"#setItemTTL");#C=o(()=>!1,"#isStale");#T(){let e=new bn(this.#e);this.#f=0,this.#R=e,this.#k=t=>{this.#f-=e[t],e[t]=0},this.#$=(t,r,s,n)=>{if(this.#S(r))return 0;if(!wr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!wr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#A=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#f>n;)this.#D(!0)}this.#f+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#f)}}#k=o(e=>{},"#removeItemSize");#A=o((e,t,r)=>{},"#addItemSize");#$=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#F(t)||((e||!this.#C(t))&&(yield t),t===this.#p));)t=this.#a[t]}*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#p;!(!this.#F(t)||((e||!this.#C(t))&&(yield t),t===this.#y));)t=this.#d[t]}#F(e){return e!==void 0&&this.#n.get(this.#h[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*rentries(){for(let e of this.#x())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#x())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#x()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#x({allowStale:!0}))this.#C(t)&&(this.#g(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let r=this.#o[t],s=this.#S(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#b&&this.#w){let a=this.#b[t],c=this.#w[t];if(a&&c){let u=a-(_n.now()-c);n.ttl=u,n.start=Date.now()}}return this.#R&&(n.size=this.#R[t]),n}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#h[t],s=this.#o[t],n=this.#S(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#b&&this.#w){a.ttl=this.#b[t];let c=_n.now()-this.#w[t];a.start=Math.floor(Date.now()-c)}this.#R&&(a.size=this.#R[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=_n.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#$(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#g(e,"set"),this;let f=this.#c===0?void 0:this.#n.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#_.length!==0?this.#_.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#o[f]=t,this.#n.set(e,f),this.#d[this.#y]=f,this.#a[f]=this.#y,this.#y=f,this.#c++,this.#A(f,h,u),u&&(u.set="add"),l=!1;else{this.#j(f);let p=this.#o[f];if(t!==p){if(this.#I&&this.#S(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#v&&this.#i?.(m,e,"set"),this.#E&&this.#m?.push([m,e,"set"]))}else a||(this.#v&&this.#i?.(p,e,"set"),this.#E&&this.#m?.push([p,e,"set"]));if(this.#k(f),this.#A(f,h,u),this.#o[f]=t,u){u.set="replace";let m=p&&this.#S(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update")}if(s!==0&&!this.#b&&this.#N(),this.#b&&(l||this.#B(f,s,n),u&&this.#l(u,f)),!a&&this.#E&&this.#m){let p=this.#m,m;for(;m=p?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#p];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#E&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#D(e){let t=this.#p,r=this.#h[t],s=this.#o[t];return this.#I&&this.#S(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(s,r,"evict"),this.#E&&this.#m?.push([s,r,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#o[t]=void 0,this.#_.push(t)),this.#c===1?(this.#p=this.#y=0,this.#_.length=0):this.#p=this.#d[t],this.#n.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#n.get(e);if(n!==void 0){let a=this.#o[n];if(this.#S(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#C(n))s&&(s.has="stale",this.#l(s,n));else return r&&this.#O(n),s&&(s.has="hit",this.#l(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#n.get(e);if(s===void 0||!r&&this.#C(s))return;let n=this.#o[s];return this.#S(n)?n.__staleWhileFetching:n}#L(e,t,r,s){let n=t===void 0?void 0:this.#o[t];if(this.#S(n))return n;let a=new ql,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m;return this.#o[t]===m&&(g===void 0?b.__staleWhileFetching?this.#o[t]=b.__staleWhileFetching:this.#g(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#o[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#g(e,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#s?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#n.get(e)):this.#o[t]=y,y}#S(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ql}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#I)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#n.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#L(e,w,b,g);return I.__returned=I}else{let I=this.#o[w];if(this.#S(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#C(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#j(w),s&&this.#O(w),E&&this.#l(E,w),I;let N=this.#L(e,w,b,g),U=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",U&&v&&(E.returnedStale=!0)),U?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#u;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#n.get(e);if(c!==void 0){let u=this.#o[c],l=this.#S(u);return a&&this.#l(a,c),this.#C(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#g(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#j(c),s&&this.#O(c),u))}else a&&(a.get="miss")}#U(e,t){this.#a[t]=e,this.#d[e]=t}#j(e){e!==this.#y&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#a[e],this.#d[e]),this.#U(this.#y,e),this.#y=e)}delete(e){return this.#g(e,"delete")}#g(e,t){let r=!1;if(this.#c!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#k(s);let n=this.#o[s];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(n,e,t),this.#E&&this.#m?.push([n,e,t])),this.#n.delete(e),this.#h[s]=void 0,this.#o[s]=void 0,s===this.#y)this.#y=this.#a[s];else if(s===this.#p)this.#p=this.#d[s];else{let a=this.#a[s];this.#d[a]=this.#d[s];let c=this.#d[s];this.#a[c]=this.#a[s]}this.#c--,this.#_.push(s)}}if(this.#E&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#r?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#x({allowStale:!0})){let r=this.#o[t];if(this.#S(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#h[t];this.#v&&this.#i?.(r,s,e),this.#E&&this.#m?.push([r,s,e])}}if(this.#n.clear(),this.#o.fill(void 0),this.#h.fill(void 0),this.#b&&this.#w&&(this.#b.fill(0),this.#w.fill(0)),this.#R&&this.#R.fill(0),this.#p=0,this.#y=0,this.#_.length=0,this.#f=0,this.#c=0,this.#E&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};Vl.LRUCache=qg});var oR=d((Gfe,nR)=>{"use strict";var sR=Le(),Tz=o((i,e,t,r,s)=>{typeof t=="string"&&(s=r,r=t,t=void 0);try{return new sR(i instanceof sR?i.version:i,t).inc(e,r,s).version}catch{return null}},"inc");nR.exports=Tz});var uR=d((Jfe,cR)=>{"use strict";var aR=ls(),Nz=o((i,e)=>{let t=aR(i,null,!0),r=aR(e,null,!0),s=t.compare(r);if(s===0)return null;let n=s>0,a=n?t:r,c=n?r:t,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==r.major?h+"major":t.minor!==r.minor?h+"minor":t.patch!==r.patch?h+"patch":"prerelease"},"diff");cR.exports=Nz});var hR=d((Zfe,lR)=>{"use strict";var Pz=Le(),Dz=o((i,e)=>new Pz(i,e).major,"major");lR.exports=Dz});var dR=d((Xfe,fR)=>{"use strict";var xz=Le(),Lz=o((i,e)=>new xz(i,e).minor,"minor");fR.exports=Lz});var mR=d((ede,pR)=>{"use strict";var Mz=Le(),Bz=o((i,e)=>new Mz(i,e).patch,"patch");pR.exports=Bz});var yR=d((ide,gR)=>{"use strict";var kz=ls(),Fz=o((i,e)=>{let t=kz(i,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");gR.exports=Fz});var Ct=d((sde,ER)=>{"use strict";var SR=Le(),Uz=o((i,e,t)=>new SR(i,t).compare(new SR(e,t)),"compare");ER.exports=Uz});var _R=d((ode,wR)=>{"use strict";var jz=Ct(),$z=o((i,e,t)=>jz(e,i,t),"rcompare");wR.exports=$z});var IR=d((cde,bR)=>{"use strict";var qz=Ct(),Vz=o((i,e)=>qz(i,e,!0),"compareLoose");bR.exports=Vz});var zl=d((lde,vR)=>{"use strict";var OR=Le(),zz=o((i,e,t)=>{let r=new OR(i,t),s=new OR(e,t);return r.compare(s)||r.compareBuild(s)},"compareBuild");vR.exports=zz});var RR=d((fde,CR)=>{"use strict";var Hz=zl(),Gz=o((i,e)=>i.sort((t,r)=>Hz(t,r,e)),"sort");CR.exports=Gz});var TR=d((pde,AR)=>{"use strict";var Wz=zl(),Jz=o((i,e)=>i.sort((t,r)=>Wz(r,t,e)),"rsort");AR.exports=Jz});var Ga=d((gde,NR)=>{"use strict";var Kz=Ct(),Zz=o((i,e,t)=>Kz(i,e,t)>0,"gt");NR.exports=Zz});var Hl=d((Sde,PR)=>{"use strict";var Yz=Ct(),Xz=o((i,e,t)=>Yz(i,e,t)<0,"lt");PR.exports=Xz});var zg=d((wde,DR)=>{"use strict";var Qz=Ct(),eH=o((i,e,t)=>Qz(i,e,t)===0,"eq");DR.exports=eH});var Hg=d((bde,xR)=>{"use strict";var tH=Ct(),iH=o((i,e,t)=>tH(i,e,t)!==0,"neq");xR.exports=iH});var Gl=d((Ode,LR)=>{"use strict";var rH=Ct(),sH=o((i,e,t)=>rH(i,e,t)>=0,"gte");LR.exports=sH});var Wl=d((Cde,MR)=>{"use strict";var nH=Ct(),oH=o((i,e,t)=>nH(i,e,t)<=0,"lte");MR.exports=oH});var Gg=d((Ade,BR)=>{"use strict";var aH=zg(),cH=Hg(),uH=Ga(),lH=Gl(),hH=Hl(),fH=Wl(),dH=o((i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return aH(i,t,r);case"!=":return cH(i,t,r);case">":return uH(i,t,r);case">=":return lH(i,t,r);case"<":return hH(i,t,r);case"<=":return fH(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");BR.exports=dH});var FR=d((Nde,kR)=>{"use strict";var pH=Le(),mH=ls(),{safeRe:Jl,t:Kl}=pn(),gH=o((i,e)=>{if(i instanceof pH)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?Jl[Kl.COERCEFULL]:Jl[Kl.COERCE]);else{let u=e.includePrerelease?Jl[Kl.COERCERTLFULL]:Jl[Kl.COERCERTL],l;for(;(l=u.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(t===null)return null;let r=t[2],s=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return mH(`${r}.${s}.${n}${a}${c}`,e)},"coerce");kR.exports=gH});var jR=d((Dde,UR)=>{"use strict";var Wg=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};UR.exports=Wg});var Rt=d((Lde,zR)=>{"use strict";var yH=/\s+/g,Jg=class i{static{o(this,"Range")}constructor(e,t){if(t=EH(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof Kg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(yH," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!qR(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&CH(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&OH)|(this.options.loose&&vH))+":"+e,s=$R.get(r);if(s)return s;let n=this.options.loose,a=n?Xe[Ge.HYPHENRANGELOOSE]:Xe[Ge.HYPHENRANGE];e=e.replace(a,BH(this.options.includePrerelease)),ne("hyphen replace",e),e=e.replace(Xe[Ge.COMPARATORTRIM],_H),ne("comparator trim",e),e=e.replace(Xe[Ge.TILDETRIM],bH),ne("tilde trim",e),e=e.replace(Xe[Ge.CARETTRIM],IH),ne("caret trim",e);let c=e.split(" ").map(f=>RH(f,this.options)).join(" ").split(/\s+/).map(f=>MH(f,this.options));n&&(c=c.filter(f=>(ne("loose invalid filter",f,this.options),!!f.match(Xe[Ge.COMPARATORLOOSE])))),ne("range list",c);let u=new Map,l=c.map(f=>new Kg(f,this.options));for(let f of l){if(qR(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return $R.set(r,h),h}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>VR(r,t)&&e.set.some(s=>VR(s,t)&&r.every(n=>s.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new wH(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(kH(this.set[t],e,this.options))return!0;return!1}};zR.exports=Jg;var SH=jR(),$R=new SH,EH=Xu(),Kg=Wa(),ne=wa(),wH=Le(),{safeRe:Xe,t:Ge,comparatorTrimReplace:_H,tildeTrimReplace:bH,caretTrimReplace:IH}=pn(),{FLAG_INCLUDE_PRERELEASE:OH,FLAG_LOOSE:vH}=_a(),qR=o(i=>i.value==="<0.0.0-0","isNullSet"),CH=o(i=>i.value==="","isAny"),VR=o((i,e)=>{let t=!0,r=i.slice(),s=r.pop();for(;t&&r.length;)t=r.every(n=>s.intersects(n,e)),s=r.pop();return t},"isSatisfiable"),RH=o((i,e)=>(ne("comp",i,e),i=NH(i,e),ne("caret",i),i=AH(i,e),ne("tildes",i),i=DH(i,e),ne("xrange",i),i=LH(i,e),ne("stars",i),i),"parseComparator"),We=o(i=>!i||i.toLowerCase()==="x"||i==="*","isX"),AH=o((i,e)=>i.trim().split(/\s+/).map(t=>TH(t,e)).join(" "),"replaceTildes"),TH=o((i,e)=>{let t=e.loose?Xe[Ge.TILDELOOSE]:Xe[Ge.TILDE];return i.replace(t,(r,s,n,a,c)=>{ne("tilde",i,r,s,n,a,c);let u;return We(s)?u="":We(n)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:We(a)?u=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:c?(ne("replaceTilde pr",c),u=`>=${s}.${n}.${a}-${c} <${s}.${+n+1}.0-0`):u=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,ne("tilde return",u),u})},"replaceTilde"),NH=o((i,e)=>i.trim().split(/\s+/).map(t=>PH(t,e)).join(" "),"replaceCarets"),PH=o((i,e)=>{ne("caret",i,e);let t=e.loose?Xe[Ge.CARETLOOSE]:Xe[Ge.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(s,n,a,c,u)=>{ne("caret",i,s,n,a,c,u);let l;return We(n)?l="":We(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:We(c)?n==="0"?l=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:u?(ne("replaceCaret pr",u),n==="0"?a==="0"?l=`>=${n}.${a}.${c}-${u} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}-${u} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c}-${u} <${+n+1}.0.0-0`):(ne("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),ne("caret return",l),l})},"replaceCaret"),DH=o((i,e)=>(ne("replaceXRanges",i,e),i.split(/\s+/).map(t=>xH(t,e)).join(" ")),"replaceXRanges"),xH=o((i,e)=>{i=i.trim();let t=e.loose?Xe[Ge.XRANGELOOSE]:Xe[Ge.XRANGE];return i.replace(t,(r,s,n,a,c,u)=>{ne("xRange",i,r,s,n,a,c,u);let l=We(n),h=l||We(a),f=h||We(c),p=f;return s==="="&&p&&(s=""),u=e.includePrerelease?"-0":"",l?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&p?(h&&(a=0),c=0,s===">"?(s=">=",h?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):s==="<="&&(s="<",h?n=+n+1:a=+a+1),s==="<"&&(u="-0"),r=`${s+n}.${a}.${c}${u}`):h?r=`>=${n}.0.0${u} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${u} <${n}.${+a+1}.0-0`),ne("xRange return",r),r})},"replaceXRange"),LH=o((i,e)=>(ne("replaceStars",i,e),i.trim().replace(Xe[Ge.STAR],"")),"replaceStars"),MH=o((i,e)=>(ne("replaceGTE0",i,e),i.trim().replace(Xe[e.includePrerelease?Ge.GTE0PRE:Ge.GTE0],"")),"replaceGTE0"),BH=o(i=>(e,t,r,s,n,a,c,u,l,h,f,p)=>(We(r)?t="":We(s)?t=`>=${r}.0.0${i?"-0":""}`:We(n)?t=`>=${r}.${s}.0${i?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,We(l)?u="":We(h)?u=`<${+l+1}.0.0-0`:We(f)?u=`<${l}.${+h+1}.0-0`:p?u=`<=${l}.${h}.${f}-${p}`:i?u=`<${l}.${h}.${+f+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),"hyphenReplace"),kH=o((i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(ne(i[r].semver),i[r].semver!==Kg.ANY&&i[r].semver.prerelease.length>0){let s=i[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Wa=d((Bde,ZR)=>{"use strict";var Ja=Symbol("SemVer ANY"),Xg=class i{static{o(this,"Comparator")}static get ANY(){return Ja}constructor(e,t){if(t=HR(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Yg("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ja?this.value="":this.value=this.operator+this.semver.version,Yg("comp",this)}parse(e){let t=this.options.loose?GR[WR.COMPARATORLOOSE]:GR[WR.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new JR(r[2],this.options.loose):this.semver=Ja}toString(){return this.value}test(e){if(Yg("Comparator.test",e,this.options.loose),this.semver===Ja||e===Ja)return!0;if(typeof e=="string")try{e=new JR(e,this.options)}catch{return!1}return Zg(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new KR(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new KR(this.value,t).test(e.semver):(t=HR(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Zg(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Zg(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ZR.exports=Xg;var HR=Xu(),{safeRe:GR,t:WR}=pn(),Zg=Gg(),Yg=wa(),JR=Le(),KR=Rt()});var In=d((Fde,YR)=>{"use strict";var FH=Rt(),UH=o((i,e,t)=>{try{e=new FH(e,t)}catch{return!1}return e.test(i)},"satisfies");YR.exports=UH});var QR=d((jde,XR)=>{"use strict";var jH=Rt(),$H=o((i,e)=>new jH(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");XR.exports=$H});var tA=d((qde,eA)=>{"use strict";var qH=Le(),VH=Rt(),zH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new VH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===-1)&&(r=a,s=new qH(r,t))}),r},"maxSatisfying");eA.exports=zH});var rA=d((zde,iA)=>{"use strict";var HH=Le(),GH=Rt(),WH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new GH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===1)&&(r=a,s=new HH(r,t))}),r},"minSatisfying");iA.exports=WH});var oA=d((Gde,nA)=>{"use strict";var Qg=Le(),JH=Rt(),sA=Ga(),KH=o((i,e)=>{i=new JH(i,e);let t=new Qg("0.0.0");if(i.test(t)||(t=new Qg("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let s=i.set[r],n=null;s.forEach(a=>{let c=new Qg(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||sA(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||sA(t,n))&&(t=n)}return t&&i.test(t)?t:null},"minVersion");nA.exports=KH});var ey=d((Jde,aA)=>{"use strict";var ZH=Rt(),YH=o((i,e)=>{try{return new ZH(i,e).range||"*"}catch{return null}},"validRange");aA.exports=YH});var Zl=d((Zde,hA)=>{"use strict";var XH=Le(),lA=Wa(),{ANY:QH}=lA,eG=Rt(),tG=In(),cA=Ga(),uA=Hl(),iG=Wl(),rG=Gl(),sG=o((i,e,t,r)=>{i=new XH(i,r),e=new eG(e,r);let s,n,a,c,u;switch(t){case">":s=cA,n=iG,a=uA,c=">",u=">=";break;case"<":s=uA,n=rG,a=cA,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(tG(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let h=e.set[l],f=null,p=null;if(h.forEach(m=>{m.semver===QH&&(m=new lA(">=0.0.0")),f=f||m,p=p||m,s(m.semver,f.semver,r)?f=m:a(m.semver,p.semver,r)&&(p=m)}),f.operator===c||f.operator===u||(!p.operator||p.operator===c)&&n(i,p.semver))return!1;if(p.operator===u&&a(i,p.semver))return!1}return!0},"outside");hA.exports=sG});var dA=d((Xde,fA)=>{"use strict";var nG=Zl(),oG=o((i,e,t)=>nG(i,e,">",t),"gtr");fA.exports=oG});var mA=d((epe,pA)=>{"use strict";var aG=Zl(),cG=o((i,e,t)=>aG(i,e,"<",t),"ltr");pA.exports=cG});var SA=d((ipe,yA)=>{"use strict";var gA=Rt(),uG=o((i,e,t)=>(i=new gA(i,t),e=new gA(e,t),i.intersects(e,t)),"intersects");yA.exports=uG});var wA=d((spe,EA)=>{"use strict";var lG=In(),hG=Ct();EA.exports=(i,e,t)=>{let r=[],s=null,n=null,a=i.sort((h,f)=>hG(h,f,t));for(let h of a)lG(h,e,t)?(n=h,s||(s=h)):(n&&r.push([s,n]),n=null,s=null);s&&r.push([s,null]);let c=[];for(let[h,f]of r)h===f?c.push(h):!f&&h===a[0]?c.push("*"):f?h===a[0]?c.push(`<=${f}`):c.push(`${h} - ${f}`):c.push(`>=${h}`);let u=c.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var CA=d((npe,vA)=>{"use strict";var _A=Rt(),iy=Wa(),{ANY:ty}=iy,Ka=In(),ry=Ct(),fG=o((i,e,t={})=>{if(i===e)return!0;i=new _A(i,t),e=new _A(e,t);let r=!1;e:for(let s of i.set){for(let n of e.set){let a=pG(s,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),dG=[new iy(">=0.0.0-0")],bA=[new iy(">=0.0.0")],pG=o((i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===ty){if(e.length===1&&e[0].semver===ty)return!0;t.includePrerelease?i=dG:i=bA}if(e.length===1&&e[0].semver===ty){if(t.includePrerelease)return!0;e=bA}let r=new Set,s,n;for(let m of i)m.operator===">"||m.operator===">="?s=IA(s,m,t):m.operator==="<"||m.operator==="<="?n=OA(n,m,t):r.add(m.semver);if(r.size>1)return null;let a;if(s&&n){if(a=ry(s.semver,n.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let m of r){if(s&&!Ka(m,String(s),t)||n&&!Ka(m,String(n),t))return null;for(let y of e)if(!Ka(m,String(y),t))return!1;return!0}let c,u,l,h,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,p=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let m of e){if(h=h||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",s){if(p&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===p.major&&m.semver.minor===p.minor&&m.semver.patch===p.patch&&(p=!1),m.operator===">"||m.operator===">="){if(c=IA(s,m,t),c===m&&c!==s)return!1}else if(s.operator===">="&&!Ka(s.semver,String(m),t))return!1}if(n){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(u=OA(n,m,t),u===m&&u!==n)return!1}else if(n.operator==="<="&&!Ka(n.semver,String(m),t))return!1}if(!m.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&h&&!s&&a!==0||p||f)},"simpleSubset"),IA=o((i,e,t)=>{if(!i)return e;let r=ry(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},"higherGT"),OA=o((i,e,t)=>{if(!i)return e;let r=ry(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i},"lowerLT");vA.exports=fG});var Ss=d((ape,TA)=>{"use strict";var sy=pn(),RA=_a(),mG=Le(),AA=Fm(),gG=ls(),yG=jm(),SG=$m(),EG=oR(),wG=uR(),_G=hR(),bG=dR(),IG=mR(),OG=yR(),vG=Ct(),CG=_R(),RG=IR(),AG=zl(),TG=RR(),NG=TR(),PG=Ga(),DG=Hl(),xG=zg(),LG=Hg(),MG=Gl(),BG=Wl(),kG=Gg(),FG=FR(),UG=Wa(),jG=Rt(),$G=In(),qG=QR(),VG=tA(),zG=rA(),HG=oA(),GG=ey(),WG=Zl(),JG=dA(),KG=mA(),ZG=SA(),YG=wA(),XG=CA();TA.exports={parse:gG,valid:yG,clean:SG,inc:EG,diff:wG,major:_G,minor:bG,patch:IG,prerelease:OG,compare:vG,rcompare:CG,compareLoose:RG,compareBuild:AG,sort:TG,rsort:NG,gt:PG,lt:DG,eq:xG,neq:LG,gte:MG,lte:BG,cmp:kG,coerce:FG,Comparator:UG,Range:jG,satisfies:$G,toComparators:qG,maxSatisfying:VG,minSatisfying:zG,minVersion:HG,validRange:GG,outside:WG,gtr:JG,ltr:KG,intersects:ZG,simplifyRange:YG,subset:XG,SemVer:mG,re:sy.re,src:sy.src,tokens:sy.t,SEMVER_SPEC_VERSION:RA.SEMVER_SPEC_VERSION,RELEASE_TYPES:RA.RELEASE_TYPES,compareIdentifiers:AA.compareIdentifiers,rcompareIdentifiers:AA.rcompareIdentifiers}});var DA=d((cpe,PA)=>{var NA=Ss();PA.exports=i=>QG(i.reduce(nW,{versions:{},"dist-tags":{},refs:{},shas:{}}));var QG=o(i=>iW(eW(tW(i))),"finish"),eW=o(i=>(Object.keys(i.refs).forEach(e=>{let t=i.refs[e];i.shas[t.sha]?i.shas[t.sha].push(e):i.shas[t.sha]=[e]}),i),"shaList"),tW=o(i=>(Object.keys(i.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=i.refs[e],r=i.refs[e.replace(/\^\{\}$/,"")];r&&(r.sha=t.sha,delete i.refs[e])}),i),"peelTags"),iW=o(i=>{let e=i.refs.HEAD||{};return Object.keys(i.versions).forEach(r=>{let s=i.versions[r];i.refs.latest&&s.sha===i.refs.latest.sha?i["dist-tags"].latest=r:s.sha===e.sha&&(i["dist-tags"].HEAD=r,i.refs.latest||(i["dist-tags"].latest=r))}),i},"distTags"),rW=o(i=>i.startsWith("refs/tags/")?"tag":i.startsWith("refs/heads/")?"branch":i.startsWith("refs/pull/")?"pull":i==="HEAD"?"head":"other","refType"),sW=o(i=>{let e=i.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),r=e[1].trim(),s=rW(r);if(s==="tag"){let n=r.slice(10);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="branch"){let n=r.slice(11);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="pull"){let n=r.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:r,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:r,type:s}:{sha:t,ref:r,rawRef:r,type:s}},"lineToRevDoc"),nW=o((i,e)=>{let t=sW(e);if(!t)return i;if(i.refs[t.ref]=t,i.refs[t.rawRef]=t,t.type==="tag"){let r=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);r&&NA.valid(r[1],!0)&&(i.versions[NA.clean(r[1],!0)]=t)}return i},"linesToRevsReducer")});var ny=d((lpe,LA)=>{var oW=Ha(),{LRUCache:aW}=Vg(),cW=DA(),xA=new aW({max:100,ttl:300*1e3});LA.exports=async(i,e={})=>{if(!e.noGitRevCache){let s=xA.get(i);if(s)return s}let{stdout:t}=await oW(["ls-remote",i],e),r=cW(t.trim().split(`
|
|
12
|
-
`));return xA.set(i,r),r}});var BA=d(MA=>{var uW=o(i=>(i.fakePlatform||process.platform)==="win32","isWindows");MA.isWindows=uW});var UA=d((dpe,FA)=>{"use strict";var z=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ye=o(i=>i?encodeURIComponent(i):"","maybeEncode"),kA=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),lW={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${z("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${z("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${z("/",r,"/",ye(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ye(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${z("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${z("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:kA},_r={};_r.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${z(i,"@")}raw.githubusercontent.com/${e}/${t}/${ye(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};_r.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ye(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};_r.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};_r.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${z("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${z("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${z("/",ye(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${z("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${z("/",ye(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${z("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${z("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${z("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ye(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+kA(i)},"hashformat")};_r.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ye(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${z("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ye(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(_r))_r[i]=Object.assign({},lW,e);FA.exports=_r});var ay=d((mpe,$A)=>{var hW=require("url"),oy=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),jA=o(i=>{try{return new hW.URL(i)}catch{}},"safeUrl"),fW=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r))return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:i.indexOf("//")===t+1?i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),dW=o(i=>{let e=oy(i,"@","#"),t=oy(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),oy(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");$A.exports=(i,e)=>{let t=e?fW(i,e):i;return jA(t)||jA(dW(t))}});var VA=d((ype,qA)=>{"use strict";var pW=ay(),mW=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");qA.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=mW(i)?`github:${i}`:i,n=pW(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var HA=d((Epe,zA)=>{"use strict";var{LRUCache:gW}=Vg(),yW=UA(),SW=VA(),EW=ay(),cy=new gW({max:1e3});function wW(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(wW,"unknownHostedUrl");var Yl=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!cy.has(r)){let s=SW(e,t,{gitHosts:i.#e,protocols:i.#t});cy.set(r,s?new i(...s):void 0)}return cy.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=wW(s);return i.fromUrl(a,t)||a}static parseUrl(e){return EW(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[i,e]of Object.entries(yW))Yl.addHost(i,e);zA.exports=Yl});var uy=d((_pe,GA)=>{"use strict";var{builtinModules:_W}=require("module"),bW=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),IW=["node_modules","favicon.ico"];function OW(i){var e=[],t=[];if(i===null)return t.push("name cannot be null"),Za(e,t);if(i===void 0)return t.push("name cannot be undefined"),Za(e,t);if(typeof i!="string")return t.push("name must be a string"),Za(e,t);if(i.length||t.push("name length must be greater than zero"),i.startsWith(".")&&t.push("name cannot start with a period"),i.match(/^_/)&&t.push("name cannot start with an underscore"),i.trim()!==i&&t.push("name cannot contain leading or trailing spaces"),IW.forEach(function(a){i.toLowerCase()===a&&t.push(a+" is not a valid package name")}),_W.includes(i.toLowerCase())&&e.push(i+" is a core module name"),i.length>214&&e.push("name can no longer contain more than 214 characters"),i.toLowerCase()!==i&&e.push("name can no longer contain capital letters"),/[~'!()*]/.test(i.split("/").slice(-1)[0])&&e.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(i)!==i){var r=i.match(bW);if(r){var s=r[1],n=r[2];if(n.startsWith(".")&&t.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(n)===n)return Za(e,t)}t.push("name can only contain URL-friendly characters")}return Za(e,t)}o(OW,"validate");var Za=o(function(i,e){var t={validForNewPackages:e.length===0&&i.length===0,validForOldPackages:e.length===0,warnings:i,errors:e};return t.warnings.length||delete t.warnings,t.errors.length||delete t.errors,t},"done");GA.exports=OW});var tT=d((Ipe,ec)=>{"use strict";var Qa=process.platform==="win32",{URL:ly}=require("node:url"),On=Qa?require("node:path/win32"):require("node:path"),{homedir:vW}=require("node:os"),CW=HA(),WA=Ss(),YA=uy(),{log:RW}=_t(),XA=Qa?/\\|[/]/:/[/]/,QA=/^(?:git[+])?[a-z]+:/i,AW=/^[^@]+@[^:.]+\.[^:]+:.+$/i,fy=/[.](?:tgz|tar.gz|tar)$/i,TW=/:[0-9]+(\/|$)/i,NW=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,PW=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,JA="https://registry.npmjs.org";function Ya(i,e){let t,r;if(typeof i=="object")return i instanceof Xa&&(!e||e===i.where)?i:i.name&&i.rawSpec?Ya.resolve(i.name,i.rawSpec,e||i.where):Ya(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return QA.test(i)?r=i:AW.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(XA.test(n)||fy.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):YA(i).validForOldPackages?(t=i,r="*"):r=i,eT(t,r,e,i)}o(Ya,"npa");function DW(i){return i?i.toLowerCase().startsWith("file:")?!0:Qa?NW.test(i):PW.test(i):!1}o(DW,"isFileSpec");function xW(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(xW,"isAliasSpec");function eT(i,e,t,r){let s=new Xa({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),DW(e))return ZA(s,t);if(xW(e))return qW(s,t);let n=CW.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?UW(s,n):e&&QA.test(e)?$W(s):e&&(XA.test(e)||fy.test(e))?ZA(s,t):VW(s)}o(eT,"resolve");function LW(i,e=JA){let t=Ya(i);if(t.type!=="version")throw kW(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==JA&&(r+="?repository_url="+e),r}o(LW,"toPurl");function MW(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(MW,"invalidPackageName");function BW(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(BW,"invalidTagName");function kW(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(kW,"invalidPurlType");var Xa=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=YA(e);if(!t.validForOldPackages)throw MW(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function hy(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}RW.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(hy,"setGitAttrs");var FW=new Map([["\0","%00"],[" ","%09"],[`
|
|
13
|
-
`,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Qa?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function KA(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${FW.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(KA,"pathToFileURL");function ZA(i,e){i.type=fy.test(i.rawSpec)?"file":"directory",i.where=e;let t=KA(i.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let r,s;try{r=new ly(t,`${KA(On.resolve(e))}/`),s=new ly(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return Qa&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=On.resolve(vW(),n.substr(3))):On.isAbsolute(t.slice(5))?i.saveSpec=`file:${On.resolve(a)}`:i.saveSpec=`file:${On.relative(e,a)}`,i.fetchSpec=On.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(ZA,"fromFile");function UW(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),hy(i,e.committish),i}o(UW,"fromHostedGit");function jW(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(jW,"unsupportedURLType");function $W(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(TW))return i.type="git",hy(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new ly(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",hy(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw jW(t.protocol,e)}return i}o($W,"fromURL");function qW(i,e){let t=Ya(i.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(qW,"fromAlias");function VW(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=WA.valid(e,!0),r=WA.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw BW(e,i.raw);i.type="tag"}return i}o(VW,"fromRegistry");ec.exports=Ya;ec.exports.resolve=eT;ec.exports.toPurl=LW;ec.exports.Result=Xa});var oT=d((vpe,nT)=>{var Es=require("node:process"),zW=require("node:os"),HW=require("node:fs");function GW(i){return i.includes("libc.musl-")||i.includes("ld-musl-")}o(GW,"isMusl");function iT(){return Es.platform}o(iT,"os");function rT(){return Es.arch}o(rT,"cpu");var WW="/usr/bin/ldd";function JW(){try{let i=HW.readFileSync(WW,"utf-8");return i.includes("musl")?"musl":i.includes("GNU C Library")?"glibc":null}catch{return}}o(JW,"getFamilyFromFilesystem");function KW(){let i=Es.report.excludeNetwork;Es.report.excludeNetwork=!0;let e=Es.report.getReport();return Es.report.excludeNetwork=i,e.header?.glibcVersionRuntime?Vi="glibc":Array.isArray(e.sharedObjects)&&e.sharedObjects.some(GW)?Vi="musl":Vi=null,Vi}o(KW,"getFamilyFromReport");var Vi;function sT(i){if(i==="linux")return Vi===void 0&&(Vi=JW(),Vi===void 0&&(Vi=KW())),Vi}o(sT,"libc");function ZW(i={}){let e=i.os||iT();return{cpu:{name:i.cpu||rT()},libc:{name:i.libc||sT(e)},os:{name:e,version:i.osVersion||zW.release()},packageManager:{name:"npm",version:i.npmVersion},runtime:{name:"node",version:i.nodeVersion||Es.version}}}o(ZW,"devEngines");nT.exports={cpu:rT,libc:sT,os:iT,devEngines:ZW}});var cT=d((Rpe,aT)=>{var YW=In(),XW=ey(),QW=["ignore","warn","error","download"],e3=["name","version","onFail"],t3=["packageManager","runtime","cpu","libc","os"];function i3(i,e,t){let{engine:r}=t;if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`Invalid non-object value for "${r}"`);let s=Object.keys(i);for(let n of s)if(!e3.includes(n))throw new Error(`Invalid property "${n}" for "${r}"`);if(!s.includes("name"))throw new Error(`Missing "name" property for "${r}"`);if(typeof i.name!="string")throw new Error(`Invalid non-string value for "name" within "${r}"`);if(typeof e.name!="string"||e.name==="")throw new Error(`Unable to determine "name" for "${r}"`);if(s.includes("onFail")){if(typeof i.onFail!="string")throw new Error(`Invalid non-string value for "onFail" within "${r}"`);if(!QW.includes(i.onFail))throw new Error(`Invalid onFail value "${i.onFail}" for "${r}"`)}if(i.name!==e.name)return new Error(`Invalid name "${i.name}" does not match "${e.name}" for "${r}"`);if(s.includes("version")){if(typeof i.version!="string")throw new Error(`Invalid non-string value for "version" within "${r}"`);if(typeof e.version!="string"||e.version==="")throw new Error(`Unable to determine "version" for "${r}" "${i.name}"`);if(XW(i.version)){if(!YW(e.version,i.version,t.semver))return new Error(`Invalid semver version "${i.version}" does not match "${e.version}" for "${r}"`)}else if(i.version!==e.version)return new Error(`Invalid version "${i.version}" does not match "${e.version}" for "${r}"`)}}o(i3,"checkDependency");function r3(i,e={},t={}){if(typeof i!="object"||i===null||Array.isArray(i))throw new Error('Invalid non-object value for "devEngines"');let r=[];for(let s of Object.keys(i)){if(!t3.includes(s))throw new Error(`Invalid property "devEngines.${s}"`);let n=i[s],a=[n].flat(),c=e[s]||{};if(a.length===0)continue;let u=[];for(let h of a){let f=i3(h,c,{...t,engine:s});f&&u.push(f)}if(u.length===a.length){let f=a[a.length-1].onFail||"error";f==="download"&&(f="error");let p=Object.assign(new Error(`Invalid devEngines.${s}`),{errors:u,engine:s,isWarn:f==="warn",isError:f==="error",current:c,required:n});r.push(p)}}return r}o(r3,"checkDevEngines");aT.exports={checkDevEngines:r3}});var hT=d((Tpe,lT)=>{var uT=Ss(),Xl=oT(),{checkDevEngines:s3}=cT(),n3=o((i,e,t,r=!1)=>{let s=r?null:t,n=i.engines,a={includePrerelease:!0};if(!n)return;let c=s&&n.node&&!uT.satisfies(s,n.node,a),u=e&&n.npm&&!uT.satisfies(e,n.npm,a);if(c||u)throw Object.assign(new Error("Unsupported engine"),{pkgid:i._id,current:{node:t,npm:e},required:n,code:"EBADENGINE"})},"checkEngine"),o3=o((i,e=!1,t={})=>{if(e)return;let r=t.os||Xl.os(),s=t.cpu||Xl.cpu(),n=t.libc||Xl.libc(r),a=i.os?dy(r,i.os):!0,c=i.cpu?dy(s,i.cpu):!0,u=i.libc?dy(n,i.libc):!0;if(i.libc&&!n&&(u=!1),!a||!c||!u)throw Object.assign(new Error("Unsupported platform"),{pkgid:i._id,current:{os:r,cpu:s,libc:n},required:{os:i.os,cpu:i.cpu,libc:i.libc},code:"EBADPLATFORM"})},"checkPlatform"),dy=o((i,e)=>{if(typeof e=="string"&&(e=[e]),e.length===1&&e[0]==="any")return!0;let t=0,r=!1;for(let s of e){let n=s.charAt(0)==="!",a=n?s.slice(1):s;if(n){if(t++,i===a)return!1}else r=r||i===a}return r||t===e.length},"checkList");lT.exports={checkEngine:n3,checkPlatform:o3,checkDevEngines:s3,currentEnv:Xl}});var Ql=d((Ppe,pT)=>{var{join:fT,basename:dT}=require("path"),a3=o(i=>i.bin?typeof i.bin=="string"?c3(i):Array.isArray(i.bin)?u3(i):typeof i.bin=="object"?my(i):py(i):py(i),"normalize"),c3=o(i=>i.name?(i.bin={[i.name]:i.bin},my(i)):py(i),"normalizeString"),u3=o(i=>(i.bin=i.bin.reduce((e,t)=>(e[dT(t)]=t,e),{}),my(i)),"normalizeArray"),py=o(i=>(delete i.bin,i),"removeBin"),my=o(i=>{let e=i.bin,t={},r=!1;return Object.keys(e).forEach(s=>{let n=fT("/",dT(s.replace(/\\|:/g,"/"))).slice(1);if(typeof e[s]!="string"||!n)return;let a=fT("/",e[s].replace(/\\/g,"/")).replace(/\\/g,"/").slice(1);a&&(t[n]=a,r=!0)}),r?i.bin=t:delete i.bin,i},"normalizeObject");pT.exports=a3});var ih=d((xpe,gT)=>{"use strict";var mT=tT(),tc=Ss(),{checkEngine:l3}=hT(),h3=Ql(),gy=o((i,e,t)=>{try{return l3(i,e,t),!0}catch{return!1}},"engineOk"),eh=o((i,e,t)=>!i||!i[e]||Date.parse(i[e])<=t,"isBefore"),f3={includePrerelease:!0,loose:!0},th=o((i,e)=>e&&tc.satisfies(i,e,f3),"shouldAvoid"),yy=o((i,e)=>i&&th(i.version,e)?{...i,_shouldAvoid:!0}:i,"decorateAvoid"),ic=o((i,e,t)=>{let{defaultTag:r="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:u=null,avoidStrict:l=!1}=t,{name:h,time:f}=i,p=i.versions||{};if(l){let P={...t,avoidStrict:!1},U=ic(i,e,P);if(!U||!U._shouldAvoid)return U;let ee=ic(i,`^${U.version}`,P);if(!ee||!ee._shouldAvoid)return{...ee,_outsideDependencyRange:!0,_isSemVerMajor:!1};let ni=ic(i,"*",P);if(!ni||!ni._shouldAvoid)return{...ni,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:u,before:s,versions:Object.keys(p)})}let m=c&&i.stagedVersions&&i.stagedVersions.versions||{},y=i.policyRestrictions&&i.policyRestrictions.versions||{},g=s&&f?+new Date(s):1/0,E=mT.resolve(h,e||r).type,_=i["dist-tags"]||{};if(E!=="tag"&&E!=="version"&&E!=="range")throw new Error("Only tag, version, and range are supported");if(e&&E==="tag"){let P=_[e];return eh(f,P,g)?yy(p[P]||m[P]||y[P],u):ic(i,`<=${P}`,t)}if(e&&E==="version"){let P=tc.clean(e,{loose:!0}),U=p[P]||m[P]||y[P];return eh(f,P,g)?yy(U,u):null}let b=E==="range"?e:"*",w=_[r];if(w&&(b==="*"||tc.satisfies(w,b,{loose:!0}))&&!y[w]&&!th(w,u)){let P=p[w];if(P&&eh(f,w,g)&&gy(P,a,n)&&!P.deprecated&&!m[w])return P}let I=Object.entries(p).concat(Object.entries(m)).concat(Object.entries(y)).filter(([P])=>eh(f,P,g));if(!I.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:E,wanted:e,before:s,versions:Object.keys(p)});let v={loose:!0},N=I.filter(([P])=>tc.satisfies(P,b,{loose:!0})).sort((P,U)=>{let[ee,ni]=P,[us,ma]=U,Vu=!th(ee,u),zu=!th(us,u),Hu=!y[ee],Gu=!y[us],Wu=!m[ee],Ju=!m[us],ga=!ni.deprecated,ya=!ma.deprecated,Sa=gy(ni,a,n),Ea=gy(ma,a,n);return zu-Vu||Gu-Hu||Ju-Wu||(ya&&Ea)-(ga&&Sa)||Ea-Sa||ya-ga||tc.rcompare(ee,us,v)});return yy(N[0]&&N[0][1],u)},"pickManifest");gT.exports=(i,e,t={})=>{let r=ic(i,e,t),s=r&&h3(r),n=i.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:u="latest"}=t,l=c?new Date(c).toLocaleString():"",{name:h}=i,f=`${h}@${e}`+(c?` with a date before ${l}`:""),p=s&&!!a[s.version],m=p?n.message:"",y=p?`Could not download ${f} due to policy violations:
|
|
14
|
-
${m}`:`No matching version found for ${f}.`,g=p?"E403":"ETARGET";throw Object.assign(new Error(y),{code:g,type:mT.resolve(i.name,e).type,wanted:e,versions:Object.keys(i.versions??{}),name:h,distTags:i["dist-tags"],defaultTag:u})}});var wT=d((Mpe,ET)=>{var d3=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:p3}=require("url"),yT=require("path"),m3=ny(),rc=Ha(),{isWindows:rh}=BA(),g3=ih(),Sy=require("fs/promises");ET.exports=(i,e="HEAD",t=null,r={})=>m3(i,r).then(s=>S3(i,s,e,E3(s,e,r),t||y3(i,r.cwd),r));var Ey=o((i,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:d3.has(p3(i).host),"maybeShallow"),y3=o((i,e=process.cwd())=>yT.resolve(e,yT.basename(i.replace(/[/\\]?\.git$/,""))),"defaultTarget"),S3=o((i,e,t,r,s,n)=>r?r.sha===e.refs.HEAD.sha?b3(i,r,s,n):r.type==="tag"||r.type==="branch"?_3(i,r,s,n):w3(i,r,s,n):I3(i,t,s,n),"clone"),E3=o((i,e,t)=>{let{spec:r={}}=t;return e=r.gitCommittish||e,i?r.gitRange?g3(i,r.gitRange,t):e?i.refs[e]?i.refs[e]:i.shas[e]?i.refs[i.shas[e][0]]:null:i.refs.HEAD:null},"resolveRef"),w3=o((i,e,t,r)=>{let s=Ey(i,r),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>rc(c,{...r,cwd:t}),"git");return Sy.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>rh(r)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",i])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>ST(t,r)).then(()=>e.sha)},"other"),_3=o((i,e,t,r)=>{let s=["clone","-b",e.ref,i,t,"--recurse-submodules"];return Ey(i,r)&&s.push("--depth=1"),rh(r)&&s.push("--config","core.longpaths=true"),rc(s,r).then(()=>e.sha)},"branch"),b3=o((i,e,t,r)=>{let s=["clone",i,t,"--recurse-submodules"];return Ey(i,r)&&s.push("--depth=1"),rh(r)&&s.push("--config","core.longpaths=true"),rc(s,r).then(()=>e.sha)},"plain"),ST=o(async(i,e)=>await Sy.stat(`${i}/.gitmodules`).then(()=>!0).catch(()=>!1)?rc(["submodule","update","-q","--init","--recursive"],{...e,cwd:i}):null,"updateSubmodules"),I3=o((i,e,t,r)=>{let s=rh(r)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",i,t+"/.git"],a=o(c=>rc(c,{...r,cwd:t}),"git");return Sy.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>ST(t,r)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var wy=d((kpe,_T)=>{var{stat:O3}=require("fs/promises");_T.exports=({cwd:i=process.cwd()}={})=>O3(i+"/.git").then(()=>!0,()=>!1)});var IT=d((Fpe,bT)=>{var v3=wy(),{dirname:C3}=require("path");bT.exports=async({cwd:i=process.cwd(),root:e}={})=>{for(;;){if(await v3({cwd:i}))return i;let t=C3(i);if(i===e||i===t)return null;i=t}}});var vT=d((Upe,OT)=>{var R3=Ha();OT.exports=(i={})=>R3(["status","--porcelain=v1","-uno"],i).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var _y=d((jpe,CT)=>{CT.exports={clone:wT(),revs:ny(),spawn:Ha(),is:wy(),find:IT(),isClean:vT(),errors:Mg()}});var DT=d(($pe,PT)=>{var A3=jm(),T3=$m(),br=require("node:fs/promises"),oe=require("node:path"),{log:TT}=_t(),N3=require("node:module"),by;function RT(){return by||(by=ol()),by}o(RT,"lazyHostedGitInfo");var Iy;function sh(){return Iy||(Iy=Ig().glob),Iy}o(sh,"lazyLoadGlob");function P3(i,e){if(i.bin&&(typeof i.bin=="string"&&i.name?(e?.push('"bin" was converted to an object'),i.bin={[i.name]:i.bin}):Array.isArray(i.bin)&&(e?.push('"bin" was converted to an object'),i.bin=i.bin.reduce((t,r)=>(t[oe.basename(r)]=r,t),{})),typeof i.bin=="object")){for(let t in i.bin){if(typeof i.bin[t]!="string"){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let r=oe.basename(vn(t));if(!r){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let s=vn(i.bin[t]);if(!s){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}r!==t&&(delete i.bin[t],e?.push(`"bin[${t}]" was renamed to "bin[${r}]"`)),s!==i.bin[t]&&e?.push(`"bin[${r}]" script name ${s} was invalid and removed`),i.bin[r]=s}return Object.keys(i.bin).length===0&&(e?.push('empty "bin" was removed'),delete i.bin),i}delete i.bin}o(P3,"normalizePackageBin");function D3(i,e){if(i.man){let t=[];for(let r of Array.isArray(i.man)?i.man:[i.man])typeof r!="string"?e?.push(`removed invalid "man [${r}]"`):t.push(vn(r));if(!t.length)e?.push('empty "man" was removed');else return i.man=t,i}delete i.man}o(D3,"normalizePackageMan");function x3(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}o(x3,"isCorrectlyEncodedName");function L3(i){if(i.charAt(0)!=="@")return!1;let e=i.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}o(L3,"isValidScopedPackageName");function AT(i){return i.replace(/\\|:/g,"/")}o(AT,"unixifyPath");function vn(i){let e=AT(oe.join(".",oe.join("/",AT(i))));return e.startsWith("./")?"":e}o(vn,"secureAndUnixifyPath");function NT(i,{strict:e,steps:t,changes:r,allowLegacyCase:s}){let n=i.content,a=`${n.name??""}@${n.version??""}`;if(t.includes("fixName")||t.includes("fixNameField")||t.includes("normalizeData"))if(!n.name&&!e)r?.push('Missing "name" field was set to an empty string'),n.name="";else{if(typeof n.name!="string")throw new Error("name field must be a string.");if(!e){let c=n.name.trim();n.name!==c&&(r?.push('Whitespace was trimmed from "name"'),n.name=c)}if(n.name.startsWith(".")||!(L3(n.name)||x3(n.name))||e&&!s&&n.name!==n.name.toLowerCase()||n.name.toLowerCase()==="node_modules"||n.name.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(n.name))}if(t.includes("fixName")&&N3.builtinModules.includes(n.name)&&TT.warn("package-json",a,`Package name "${n.name}" conflicts with a Node.js built-in module name`),t.includes("fixVersionField")||t.includes("normalizeData")){let c=!e;if(!n.version)n.version="";else{if(!A3(n.version,c))throw new Error(`Invalid version: "${n.version}"`);let u=T3(n.version,c);u!==n.version&&(r?.push(`"version" was cleaned and set to "${u}"`),n.version=u)}}if(t.includes("_attributes"))for(let c in n)c.startsWith("_")&&(r?.push(`"${c}" was removed`),delete i.content[c]);if(t.includes("_id")&&n.name&&n.version&&(r?.push(`"_id" was set to ${a}`),n._id=a),t.includes("bundledDependencies")&&(n.bundleDependencies===void 0&&n.bundledDependencies!==void 0&&(n.bundleDependencies=n.bundledDependencies,r?.push('Deleted incorrect "bundledDependencies"')),delete n.bundledDependencies),t.includes("bundleDependencies")){let c=n.bundleDependencies;c===!1&&!t.includes("bundleDependenciesDeleteFalse")?(r?.push('"bundleDependencies" was changed from "false" to "[]"'),n.bundleDependencies=[]):c===!0?(r?.push('"bundleDependencies" was auto-populated from "dependencies"'),n.bundleDependencies=Object.keys(n.dependencies||{})):c&&typeof c=="object"?Array.isArray(c)||(r?.push('"bundleDependencies" was changed from an object to an array'),n.bundleDependencies=Object.keys(c)):"bundleDependencies"in n&&(r?.push('"bundleDependencies" was removed'),delete n.bundleDependencies)}if(t.includes("optionalDedupe")&&n.dependencies&&n.optionalDependencies&&typeof n.optionalDependencies=="object"){for(let c in n.optionalDependencies)r?.push(`optionalDependencies."${c}" was removed`),delete n.dependencies[c];Object.keys(n.dependencies).length||(r?.push('Empty "optionalDependencies" was removed'),delete n.dependencies)}if((t.includes("scripts")||t.includes("scriptpath"))&&n.scripts!==void 0){let c=/^(\.[/\\])?node_modules[/\\].bin[\\/]/;if(typeof n.scripts=="object")for(let u in n.scripts)typeof n.scripts[u]!="string"?(delete n.scripts[u],r?.push(`Invalid scripts."${u}" was removed`)):t.includes("scriptpath")&&c.test(n.scripts[u])&&(n.scripts[u]=n.scripts[u].replace(c,""),r?.push(`scripts entry "${u}" was fixed to remove node_modules/.bin reference`));else r?.push('Removed invalid "scripts"'),delete n.scripts}if(t.includes("funding")&&n.funding&&typeof n.funding=="string"&&(n.funding={url:n.funding},r?.push('"funding" was changed to an object with a url attribute')),(t.includes("fixRepositoryField")||t.includes("normalizeData"))&&(n.repositories&&(r?.push(`"repository" was set to the first entry in "repositories" (${n.repository})`),n.repository=n.repositories[0]),n.repository&&(typeof n.repository=="string"&&(r?.push('"repository" was changed from a string to an object'),n.repository={type:"git",url:n.repository}),n.repository.url))){let c=RT().fromUrl(n.repository.url),u;c&&(c.getDefaultRepresentation()==="shortcut"?u=c.https():u=c.toString(),u!==n.repository.url&&(r?.push(`"repository.url" was normalized to "${u}"`),n.repository.url=u))}if(t.includes("fixDependencies")||t.includes("normalizeData")){for(let c of["dependencies","devDependencies","optionalDependencies"])if(n[c]){let u=!0;if(typeof n[c]=="string"&&(r?.push(`"${c}" was converted from a string into an object`),n[c]=n[c].trim().split(/[\n\r\s\t ,]+/),u=!1),Array.isArray(n[c])){u&&r?.push(`"${c}" was converted from an array into an object`);let l={};for(let h of n[c])if(typeof h=="string"){let f=h.trim().split(/(:?[@\s><=])/),p=f.shift(),m=f.join("").replace(/^@/,"").trim();l[p]=m}n[c]=l}}for(let c of["dependencies","devDependencies"])if(c in n)if(!n[c]||typeof n[c]!="object")r?.push(`Removed invalid "${c}"`),delete n[c];else for(let u in n[c]){typeof n[c][u]!="string"&&(r?.push(`Removed invalid "${c}.${u}"`),delete n[c][u]);let h=RT().fromUrl(n[c][u])?.toString();h&&h!==n[c][u]&&(r?.push(`Normalized git reference to "${c}.${u}"`),n[c][u]=h.toString())}}if(t.includes("normalizeData")){let{normalizeData:c}=tC();c(n,r)}}o(NT,"syncSteps");async function M3(i,{steps:e,root:t,changes:r}){let s=i.content,n=s.scripts||{},a=`${s.name??""}@${s.version??""}`;if(e.includes("gypfile")&&!n.install&&!n.preinstall&&s.gypfile!==!1&&(await sh()("*.gyp",{cwd:i.path})).length&&(n.install="node-gyp rebuild",s.scripts=n,s.gypfile=!0,r?.push('"scripts.install" was set to "node-gyp rebuild"'),r?.push('"gypfile" was set to "true"')),e.includes("serverjs")&&!n.start)try{await br.access(oe.join(i.path,"server.js")),n.start="node server.js",s.scripts=n,r?.push('"scripts.start" was set to "node server.js"')}catch{}if(e.includes("authors")&&!s.contributors)try{let u=(await br.readFile(oe.join(i.path,"AUTHORS"),"utf8")).split(/\r?\n/g).map(l=>l.replace(/^\s*#.*$/,"").trim()).filter(l=>l);s.contributors=u,r?.push('"contributors" was auto-populated with the contents of the "AUTHORS" file')}catch{}if(e.includes("readme")&&!s.readme){let c=/\.m?a?r?k?d?o?w?n?$/i,u=await sh()("{README,README.*}",{cwd:i.path,nocase:!0,mark:!0}),l;for(let h of u)if(!h.endsWith(oe.sep)){if(h.match(c)){l=h;break}h.endsWith("README")&&(l=h)}if(l){let h=await br.readFile(oe.join(i.path,l),"utf8");s.readme=h,s.readmeFilename=l,r?.push(`"readme" was set to the contents of ${l}`),r?.push(`"readmeFilename" was set to ${l}`)}s.readme||(s.readme="ERROR: No README data found!")}if(e.includes("mans")){if(s.directories?.man&&!s.man){let c=vn(s.directories.man),u=oe.resolve(i.path,c),l=await sh()("**/*.[0-9]",{cwd:u});s.man=l.map(h=>oe.relative(i.path,oe.join(u,h)).split(oe.sep).join("/"))}D3(s,r)}if(e.includes("binDir")&&s.directories?.bin&&!s.bin){let c=vn(s.directories.bin),u=await sh()("**",{cwd:oe.resolve(i.path,c)});s.bin=u.reduce((l,h)=>{if(h&&!h.startsWith(".")){let f=oe.basename(h);l[f]=`${c}/${vn(h)}`}return l},{})}else(e.includes("bin")||e.includes("binDir")||e.includes("binRefs"))&&P3(s,r);if(e.includes("gitHead")&&!s.gitHead){let u=await _y().find({cwd:i.path,root:t}),l;if(u)try{l=await br.readFile(oe.resolve(u,".git/HEAD"),"utf8")}catch{}let h;if(l)if(l.startsWith("ref: ")){let f=l.replace(/^ref: /,"").trim(),p=oe.resolve(u,".git",f);try{h=await br.readFile(p,"utf8"),h=h.replace(/^ref: /,"").trim()}catch{}if(!h){let m=oe.resolve(u,".git/packed-refs");try{let y=await br.readFile(m,"utf8");if(y){y=y.split(`
|
|
15
|
-
`);for(let g=0;g<y.length;g++){let S=y[g].match(/^([0-9a-f]{40}) (.+)$/);if(S&&S[2].trim()===f){h=S[1];break}}}}catch{}}}else h=l.trim();h&&(s.gitHead=h)}if(e.includes("fillTypes")){let c=s.main||"index.js";if(typeof c!="string")throw new TypeError('The "main" attribute must be of type string.');let l=`./${oe.join(oe.dirname(c),oe.basename(c,oe.extname(c)))}.d.ts`;if(!("types"in s||"typings"in s))try{await
|
|
16
|
-
`:r,c=e?
|
|
17
|
-
`.replace(/\n/g,a);if(u.trim()!==this.#i.trim()){let l=await V3(this.filename,u);return this.#i=u,l}}syncNormalize(e={}){return e.steps=this.constructor.normalizeSteps.filter(t=>t!=="_attributes"),W3(this,e),this}async normalize(e={}){return e.steps||(e.steps=this.constructor.normalizeSteps),await Oy(this,e),this}async prepare(e={}){return e.steps||(e.steps=this.constructor.prepareSteps),await Oy(this,e),this}async fix(e={}){return e.steps=this.constructor.fixSteps,await Oy(this,e),this}};$T.exports=vy});var Ty=d((Kpe,Ay)=>{var{Minipass:qT}=te(),Cn=Symbol("_data"),Rn=Symbol("_length"),Cy=class extends qT{static{o(this,"Collect")}constructor(e){super(e),this[Cn]=[],this[Rn]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[Cn].push(s),this[Rn]+=s.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[Cn],this[Rn]);return super.write(s),super.end(r)}};Ay.exports=Cy;var Ry=class extends qT{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[Cn]=[],this[Rn]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[Cn].push(s),this[Rn]+=s.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[Cn],this[Rn]);return this.emit("collect",s),super.end(r)}};Ay.exports.PassThrough=Ry});var hh=d((Ype,YT)=>{"use strict";var VT=typeof process=="object"&&process?process:{stdout:null,stderr:null},Q3=require("events"),zT=require("stream"),HT=require("string_decoder").StringDecoder,zi=Symbol("EOF"),Hi=Symbol("maybeEmitEnd"),Ir=Symbol("emittedEnd"),oh=Symbol("emittingEnd"),sc=Symbol("emittedError"),ah=Symbol("closed"),GT=Symbol("read"),ch=Symbol("flush"),WT=Symbol("flushChunk"),Qe=Symbol("encoding"),Gi=Symbol("decoder"),uh=Symbol("flowing"),nc=Symbol("paused"),An=Symbol("resume"),Ae=Symbol("bufferLength"),Ny=Symbol("bufferPush"),Py=Symbol("bufferShift"),Be=Symbol("objectMode"),ke=Symbol("destroyed"),Dy=Symbol("emitData"),JT=Symbol("emitEnd"),xy=Symbol("emitEnd2"),Wi=Symbol("async"),oc=o(i=>Promise.resolve().then(i),"defer"),KT=global._MP_NO_ITERATOR_SYMBOLS_!=="1",e5=KT&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),t5=KT&&Symbol.iterator||Symbol("iterator not implemented"),i5=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),r5=o(i=>i instanceof ArrayBuffer||typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBuffer"),s5=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),lh=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[An](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ly=class extends lh{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}};YT.exports=class ZT extends zT{static{o(this,"Minipass")}constructor(e){super(),this[uh]=!1,this[nc]=!1,this.pipes=[],this.buffer=[],this[Be]=e&&e.objectMode||!1,this[Be]?this[Qe]=null:this[Qe]=e&&e.encoding||null,this[Qe]==="buffer"&&(this[Qe]=null),this[Wi]=e&&!!e.async||!1,this[Gi]=this[Qe]?new HT(this[Qe]):null,this[zi]=!1,this[Ir]=!1,this[oh]=!1,this[ah]=!1,this[sc]=null,this.writable=!0,this.readable=!0,this[Ae]=0,this[ke]=!1}get bufferLength(){return this[Ae]}get encoding(){return this[Qe]}set encoding(e){if(this[Be])throw new Error("cannot set encoding in objectMode");if(this[Qe]&&e!==this[Qe]&&(this[Gi]&&this[Gi].lastNeed||this[Ae]))throw new Error("cannot change encoding");this[Qe]!==e&&(this[Gi]=e?new HT(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Gi].write(t)))),this[Qe]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Be]}set objectMode(e){this[Be]=this[Be]||!!e}get async(){return this[Wi]}set async(e){this[Wi]=this[Wi]||!!e}write(e,t,r){if(this[zi])throw new Error("write after end");if(this[ke])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Wi]?oc:n=>n();return!this[Be]&&!Buffer.isBuffer(e)&&(s5(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):r5(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Be]?(this.flowing&&this[Ae]!==0&&this[ch](!0),this.flowing?this.emit("data",e):this[Ny](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[Qe]&&!this[Gi].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Qe]&&(e=this[Gi].write(e)),this.flowing&&this[Ae]!==0&&this[ch](!0),this.flowing?this.emit("data",e):this[Ny](e),this[Ae]!==0&&this.emit("readable"),r&&s(r),this.flowing):(this[Ae]!==0&&this.emit("readable"),r&&s(r),this.flowing)}read(e){if(this[ke])return null;if(this[Ae]===0||e===0||e>this[Ae])return this[Hi](),null;this[Be]&&(e=null),this.buffer.length>1&&!this[Be]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Ae])]);let t=this[GT](e||null,this.buffer[0]);return this[Hi](),t}[GT](e,t){return e===t.length||e===null?this[Py]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Ae]-=e),this.emit("data",t),!this.buffer.length&&!this[zi]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[zi]=!0,this.writable=!1,(this.flowing||!this[nc])&&this[Hi](),this}[An](){this[ke]||(this[nc]=!1,this[uh]=!0,this.emit("resume"),this.buffer.length?this[ch]():this[zi]?this[Hi]():this.emit("drain"))}resume(){return this[An]()}pause(){this[uh]=!1,this[nc]=!0}get destroyed(){return this[ke]}get flowing(){return this[uh]}get paused(){return this[nc]}[Ny](e){this[Be]?this[Ae]+=1:this[Ae]+=e.length,this.buffer.push(e)}[Py](){return this.buffer.length&&(this[Be]?this[Ae]-=1:this[Ae]-=this.buffer[0].length),this.buffer.shift()}[ch](e){do;while(this[WT](this[Py]()));!e&&!this.buffer.length&&!this[zi]&&this.emit("drain")}[WT](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[ke])return;let r=this[Ir];return t=t||{},e===VT.stdout||e===VT.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Ly(this,e,t):new lh(this,e,t)),this[Wi]?oc(()=>this[An]()):this[An]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[An]():e==="readable"&&this[Ae]!==0?super.emit("readable"):i5(e)&&this[Ir]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[sc]&&(this[Wi]?oc(()=>t.call(this,this[sc])):t.call(this,this[sc])),r}get emittedEnd(){return this[Ir]}[Hi](){!this[oh]&&!this[Ir]&&!this[ke]&&this.buffer.length===0&&this[zi]&&(this[oh]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ah]&&this.emit("close"),this[oh]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==ke&&this[ke])return;if(e==="data")return t?this[Wi]?oc(()=>this[Dy](t)):this[Dy](t):!1;if(e==="end")return this[JT]();if(e==="close"){if(this[ah]=!0,!this[Ir]&&!this[ke])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[sc]=t;let n=super.emit("error",t);return this[Hi](),n}else if(e==="resume"){let n=super.emit("resume");return this[Hi](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,t,...r);return this[Hi](),s}[Dy](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Hi](),t}[JT](){this[Ir]||(this[Ir]=!0,this.readable=!1,this[Wi]?oc(()=>this[xy]()):this[xy]())}[xy](){if(this[Gi]){let t=this[Gi].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Be]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Be]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Be]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Be]?Promise.reject(new Error("cannot concat in objectMode")):this[Qe]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(ke,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[e5](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[zi])return Promise.resolve({done:!0});let r=null,s=null,n=o(l=>{this.removeListener("data",a),this.removeListener("end",c),s(l)},"onerr"),a=o(l=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:l,done:!!this[zi]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),u=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((l,h)=>{s=h,r=l,this.once(ke,u),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[t5](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[ke]?(e?this.emit("error",e):this.emit(ke),this):(this[ke]=!0,this.buffer.length=0,this[Ae]=0,typeof this.close=="function"&&!this[ah]&&this.close(),e?this.emit("error",e):this.emit(ke),this)}static isStream(e){return!!e&&(e instanceof ZT||e instanceof zT||e instanceof Q3&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Tn=d((Qpe,t1)=>{var n5=hh(),o5=require("events"),a5=o(i=>i&&i instanceof o5&&(typeof i.pipe=="function"||typeof i.write=="function"&&typeof i.end=="function"),"isStream"),ws=Symbol("_head"),ft=Symbol("_tail"),My=Symbol("_linkStreams"),By=Symbol("_setHead"),ky=Symbol("_setTail"),XT=Symbol("_onError"),QT=Symbol("_onData"),Fy=Symbol("_onEnd"),e1=Symbol("_onDrain"),fh=Symbol("_streams"),Uy=class extends n5{static{o(this,"Pipeline")}constructor(e,...t){a5(e)&&(t.unshift(e),e={}),super(e),this[fh]=[],t.length&&this.push(...t)}[My](e){return e.reduce((t,r)=>(t.on("error",s=>r.emit("error",s)),t.pipe(r),r))}push(...e){this[fh].push(...e),this[ft]&&e.unshift(this[ft]);let t=this[My](e);this[ky](t),this[ws]||this[By](e[0])}unshift(...e){this[fh].unshift(...e),this[ws]&&e.push(this[ws]);let t=this[My](e);this[By](e[0]),this[ft]||this[ky](t)}destroy(e){return this[fh].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[ky](e){this[ft]=e,e.on("error",t=>this[XT](e,t)),e.on("data",t=>this[QT](e,t)),e.on("end",()=>this[Fy](e)),e.on("finish",()=>this[Fy](e))}[XT](e,t){e===this[ft]&&this.emit("error",t)}[QT](e,t){e===this[ft]&&super.write(t)}[Fy](e){e===this[ft]&&super.end()}pause(){return super.pause(),this[ft]&&this[ft].pause&&this[ft].pause()}emit(e,...t){return e==="resume"&&this[ft]&&this[ft].resume&&this[ft].resume(),super.emit(e,...t)}[By](e){this[ws]=e,e.on("drain",()=>this[e1](e))}[e1](e){e===this[ws]&&this.emit("drain")}write(e,t,r){return this[ws].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[ws].end(e,t,r),this}};t1.exports=Uy});var hi=d((tme,li)=>{"use strict";var cc=require("crypto"),{Minipass:c5}=te(),$y=["sha512","sha384","sha256"],Vy=["sha512"],u5=/^[a-z0-9+/]+(?:=?=?)$/i,l5=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,h5=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,f5=/^[\x21-\x7E]+$/,uc=o(i=>i?.length?`?${i.join("?")}`:"","getOptString"),qy=class extends c5{static{o(this,"IntegrityStream")}#e;#t;#i;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Vy],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(cc.createHash)}#r(){this.sri=this.opts?.integrity?dt(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=uc(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#i?t(this.#i):super.on(e,t)}emit(e,t){return e==="end"&&this.#s(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#s(){this.goodSri||this.#r();let e=dt(this.hashes.map((r,s)=>`${this.algorithms[s]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
|
|
12
|
+
`,r=e.whitespace?" = ":"=",s=[],n=e.sort?Object.keys(i).sort():Object.keys(i),a=0;e.align&&(a=Fi(n.filter(l=>i[l]===null||Array.isArray(i[l])||typeof i[l]!="object").map(l=>Array.isArray(i[l])?`${l}[]`:l).concat([""]).reduce((l,h)=>Fi(l).length>=Fi(h).length?l:h)).length);let c="",u=e.bracketedArray?"[]":"";for(let l of n){let h=i[l];if(h&&Array.isArray(h))for(let f of h)c+=Fi(`${l}${u}`).padEnd(a," ")+r+Fi(f)+t;else h&&typeof h=="object"?s.push(l):c+=Fi(l).padEnd(a," ")+r+Fi(h)+t}e.section&&c.length&&(c="["+Fi(e.section)+"]"+(e.newline?t+t:t)+c);for(let l of s){let h=AR(l,".").join("\\."),f=(e.section?e.section+".":"")+h,p=vg(i[l],{...e,section:f});c.length&&p.length&&(c+=t),c+=p}return c},"encode");function AR(i,e){var t=0,r=0,s=0,n=[];do if(s=i.indexOf(e,t),s!==-1){if(t=s+e.length,s>0&&i[s-1]==="\\")continue;n.push(i.slice(r,s)),r=s+e.length}while(s!==-1);return n.push(i.slice(r)),n}o(AR,"splitSections");var RR=o((i,e={})=>{e.bracketedArray=e.bracketedArray!==!1;let t=Object.create(null),r=t,s=null,n=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,a=i.split(/[\r\n]+/g),c={};for(let l of a){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;let h=l.match(n);if(!h)continue;if(h[1]!==void 0){if(s=xl(h[1]),s==="__proto__"){r=Object.create(null);continue}r=t[s]=t[s]||Object.create(null);continue}let f=xl(h[2]),p;e.bracketedArray?p=f.length>2&&f.slice(-2)==="[]":(c[f]=(c?.[f]||0)+1,p=c[f]>1);let m=p&&f.endsWith("[]")?f.slice(0,-2):f;if(m==="__proto__")continue;let y=h[3]?xl(h[4]):!0,g=y==="true"||y==="false"||y==="null"?JSON.parse(y):y;p&&(Og.call(r,m)?Array.isArray(r[m])||(r[m]=[r[m]]):r[m]=[]),Array.isArray(r[m])?r[m].push(g):r[m]=g}let u=[];for(let l of Object.keys(t)){if(!Og.call(t,l)||typeof t[l]!="object"||Array.isArray(t[l]))continue;let h=AR(l,".");r=t;let f=h.pop(),p=f.replace(/\\\./g,".");for(let m of h)m!=="__proto__"&&((!Og.call(r,m)||typeof r[m]!="object")&&(r[m]=Object.create(null)),r=r[m]);r===t&&p===f||(r[p]=t[l],u.push(l))}for(let l of u)delete t[l];return t},"decode"),TR=o(i=>i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"),"isQuoted"),Fi=o(i=>typeof i!="string"||i.match(/[=\r\n]/)||i.match(/^\[/)||i.length>1&&TR(i)||i!==i.trim()?JSON.stringify(i):i.split(";").join("\\;").split("#").join("\\#"),"safe"),xl=o(i=>{if(i=(i||"").trim(),TR(i)){i.charAt(0)==="'"&&(i=i.slice(1,-1));try{i=JSON.parse(i)}catch{}}else{let e=!1,t="";for(let r=0,s=i.length;r<s;r++){let n=i.charAt(r);if(e)"\\;#".indexOf(n)!==-1?t+=n:t+="\\"+n,e=!1;else{if(";#".indexOf(n)!==-1)break;n==="\\"?e=!0:t+=n}}return e&&(t+="\\"),t.trim()}return i},"unsafe");CR.exports={parse:RR,decode:RR,stringify:vg,encode:vg,safe:Fi,unsafe:xl}});var LR=d((Hhe,Rg)=>{var PR=require("node:fs"),VV=require("node:os"),zV=require("node:path"),HV=NR(),DR=zV.join(VV.homedir(),".gitconfig"),Ma=null,xR=o(()=>{if(Ma===null)try{if(Ma={},PR.existsSync(DR)){let i=PR.readFileSync(DR,"utf-8");Ma=HV.parse(i)}}catch{Ma={}}return Ma},"loadGitConfig"),GV=o(()=>{let i=xR();return{sshCommandSetInConfig:i?.core?.sshCommand!==void 0,askPassSetInConfig:i?.core?.askpass!==void 0}},"checkGitConfigs"),WV=process.env.GIT_SSH_COMMAND!==void 0,JV=process.env.GIT_ASKPASS!==void 0,{sshCommandSetInConfig:KV,askPassSetInConfig:ZV}=GV(),YV={...JV||ZV?{}:{GIT_ASKPASS:"echo"},...WV||KV?{}:{GIT_SSH_COMMAND:"ssh -oStrictHostKeyChecking=accept-new"}};Rg.exports=(i={})=>({stdioString:!0,...i,shell:!1,env:i.env||{...YV,...process.env}});Rg.exports.loadGitConfig=xR});var BR=d((Whe,MR)=>{var XV=yg(),Ag;try{Ag=XV.sync("git")}catch{}MR.exports=(i={})=>i.git?i.git:!Ag||i.git===!1?Object.assign(new Error("No git binary found in $PATH"),{code:"ENOGIT"}):Ag});var Ba=d((Jhe,kR)=>{var QV=Dl(),ez=xa(),{log:tz}=St(),iz=vR(),rz=LR();kR.exports=(i,e={})=>{let r=BR()(e);if(r instanceof Error)return Promise.reject(r);let s=e.allowReplace||i[0]==="--no-replace-objects"?i:["--no-replace-objects",...i],n=e.retry;return n==null&&(n={retries:e.fetchRetries||2,factor:e.fetchRetryFactor||10,maxTimeout:e.fetchRetryMaxtimeout||6e4,minTimeout:e.fetchRetryMintimeout||1e3}),ez((a,c)=>(c!==1&&tz.silly("git",`Retrying git command: ${s.join(" ")} attempt # ${c}`),QV(r,s,rz(e)).catch(u=>{let l=iz(u);if(!l.shouldRetry(c))throw l;a(l)})),n)}});var Pg=d(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.LRUCache=void 0;var mn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,UR=new Set,Tg=typeof process=="object"&&process?process:{},jR=o((i,e,t,r)=>{typeof Tg.emitWarning=="function"&&Tg.emitWarning(i,e,t,r)},"emitWarning"),Ll=globalThis.AbortController,FR=globalThis.AbortSignal;if(typeof Ll>"u"){FR=class{static{o(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,s){this._onabort.push(s)}},Ll=class{static{o(this,"AbortController")}constructor(){e()}signal=new FR;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let s of this.signal._onabort)s(r);this.signal.onabort?.(r)}}};let i=Tg.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=o(()=>{i&&(i=!1,jR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var sz=o(i=>!UR.has(i),"shouldWarn"),Yhe=Symbol("type"),gr=o(i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),"isPosInt"),$R=o(i=>gr(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?gn:null:null,"getUintArray"),gn=class extends Array{static{o(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Cg=class i{static{o(this,"Stack")}heap;length;static#e=!1;static create(e){let t=$R(e);if(!t)return[];i.#e=!0;let r=new i(e,t);return i.#e=!1,r}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Ng=class i{static{o(this,"LRUCache")}#e;#t;#i;#r;#s;#u;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#f;#n;#h;#o;#d;#a;#p;#y;#_;#m;#A;#w;#b;#v;#I;#E;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#b,sizes:e.#A,keyMap:e.#n,keyList:e.#h,valList:e.#o,next:e.#d,prev:e.#a,get head(){return e.#p},get tail(){return e.#y},free:e.#_,isBackgroundFetch:o(t=>e.#S(t),"isBackgroundFetch"),backgroundFetch:o((t,r,s,n)=>e.#L(t,r,s,n),"backgroundFetch"),moveToTail:o(t=>e.#j(t),"moveToTail"),indexes:o(t=>e.#P(t),"indexes"),rindexes:o(t=>e.#x(t),"rindexes"),isStale:o(t=>e.#R(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#u}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){let{max:t=0,ttl:r,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:u,dispose:l,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:y=0,sizeCalculation:g,fetchMethod:S,memoMethod:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:I,ignoreFetchAbort:v}=e;if(t!==0&&!gr(t))throw new TypeError("max option must be a nonnegative integer");let N=t?$R(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=m,this.maxEntrySize=y||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#u=E,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#I=!!S,this.#n=new Map,this.#h=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#d=new N(t),this.#a=new N(t),this.#p=0,this.#y=0,this.#_=Cg.create(t),this.#c=0,this.#f=0,typeof l=="function"&&(this.#i=l),typeof h=="function"?(this.#r=h,this.#m=[]):(this.#r=void 0,this.#m=void 0),this.#v=!!this.#i,this.#E=!!this.#r,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#t!==0&&!gr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!gr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=gr(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=r||0,this.ttl){if(!gr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";sz(P)&&(UR.add(P),jR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,i))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#N(){let e=new gn(this.#e),t=new gn(this.#e);this.#b=e,this.#w=t,this.#B=(n,a,c=mn.now())=>{if(t[n]=a!==0?c:0,e[n]=a,a!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#R(n)&&this.#g(this.#h[n],"expire")},a+1);u.unref&&u.unref()}},this.#O=n=>{t[n]=e[n]!==0?mn.now():0},this.#l=(n,a)=>{if(e[a]){let c=e[a],u=t[a];if(!c||!u)return;n.ttl=c,n.start=u,n.now=r||s();let l=n.now-u;n.remainingTTL=c-l}};let r=0,s=o(()=>{let n=mn.now();if(this.ttlResolution>0){r=n;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref()}return n},"getNow");this.getRemainingTTL=n=>{let a=this.#n.get(n);if(a===void 0)return 0;let c=e[a],u=t[a];if(!c||!u)return 1/0;let l=(r||s())-u;return c-l},this.#R=n=>{let a=t[n],c=e[n];return!!c&&!!a&&(r||s())-a>c}}#O=o(()=>{},"#updateItemAge");#l=o(()=>{},"#statusTTL");#B=o(()=>{},"#setItemTTL");#R=o(()=>!1,"#isStale");#C(){let e=new gn(this.#e);this.#f=0,this.#A=e,this.#k=t=>{this.#f-=e[t],e[t]=0},this.#$=(t,r,s,n)=>{if(this.#S(r))return 0;if(!gr(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(r,t),!gr(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#T=(t,r,s)=>{if(e[t]=r,this.#t){let n=this.#t-e[t];for(;this.#f>n;)this.#D(!0)}this.#f+=e[t],s&&(s.entrySize=r,s.totalCalculatedSize=this.#f)}}#k=o(e=>{},"#removeItemSize");#T=o((e,t,r)=>{},"#addItemSize");#$=o((e,t,r,s)=>{if(r||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#y;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#p));)t=this.#a[t]}*#x({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#p;!(!this.#F(t)||((e||!this.#R(t))&&(yield t),t===this.#y));)t=this.#d[t]}#F(e){return e!==void 0&&this.#n.get(this.#h[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*rentries(){for(let e of this.#x())this.#o[e]!==void 0&&this.#h[e]!==void 0&&!this.#S(this.#o[e])&&(yield[this.#h[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#x()){let t=this.#h[e];t!==void 0&&!this.#S(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#x())this.#o[e]!==void 0&&!this.#S(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#h[r],this))return this.get(this.#h[r],t)}}forEach(e,t=this){for(let r of this.#P()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}rforEach(e,t=this){for(let r of this.#x()){let s=this.#o[r],n=this.#S(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#h[r],this)}}purgeStale(){let e=!1;for(let t of this.#x({allowStale:!0}))this.#R(t)&&(this.#g(this.#h[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let r=this.#o[t],s=this.#S(r)?r.__staleWhileFetching:r;if(s===void 0)return;let n={value:s};if(this.#b&&this.#w){let a=this.#b[t],c=this.#w[t];if(a&&c){let u=a-(mn.now()-c);n.ttl=u,n.start=Date.now()}}return this.#A&&(n.size=this.#A[t]),n}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let r=this.#h[t],s=this.#o[t],n=this.#S(s)?s.__staleWhileFetching:s;if(n===void 0||r===void 0)continue;let a={value:n};if(this.#b&&this.#w){a.ttl=this.#b[t];let c=mn.now()-this.#w[t];a.start=Math.floor(Date.now()-c)}this.#A&&(a.size=this.#A[t]),e.unshift([r,a])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let s=Date.now()-r.start;r.start=mn.now()-s}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,h=this.#$(e,t,r.size||0,c);if(this.maxEntrySize&&h>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#g(e,"set"),this;let f=this.#c===0?void 0:this.#n.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#_.length!==0?this.#_.pop():this.#c===this.#e?this.#D(!1):this.#c,this.#h[f]=e,this.#o[f]=t,this.#n.set(e,f),this.#d[this.#y]=f,this.#a[f]=this.#y,this.#y=f,this.#c++,this.#T(f,h,u),u&&(u.set="add"),l=!1;else{this.#j(f);let p=this.#o[f];if(t!==p){if(this.#I&&this.#S(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#v&&this.#i?.(m,e,"set"),this.#E&&this.#m?.push([m,e,"set"]))}else a||(this.#v&&this.#i?.(p,e,"set"),this.#E&&this.#m?.push([p,e,"set"]));if(this.#k(f),this.#T(f,h,u),this.#o[f]=t,u){u.set="replace";let m=p&&this.#S(p)?p.__staleWhileFetching:p;m!==void 0&&(u.oldValue=m)}}else u&&(u.set="update")}if(s!==0&&!this.#b&&this.#N(),this.#b&&(l||this.#B(f,s,n),u&&this.#l(u,f)),!a&&this.#E&&this.#m){let p=this.#m,m;for(;m=p?.shift();)this.#r?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#p];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#E&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#r?.(...t)}}}#D(e){let t=this.#p,r=this.#h[t],s=this.#o[t];return this.#I&&this.#S(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(s,r,"evict"),this.#E&&this.#m?.push([s,r,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#o[t]=void 0,this.#_.push(t)),this.#c===1?(this.#p=this.#y=0,this.#_.length=0):this.#p=this.#d[t],this.#n.delete(r),this.#c--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:s}=t,n=this.#n.get(e);if(n!==void 0){let a=this.#o[n];if(this.#S(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#l(s,n));else return r&&this.#O(n),s&&(s.has="hit",this.#l(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,s=this.#n.get(e);if(s===void 0||!r&&this.#R(s))return;let n=this.#o[s];return this.#S(n)?n.__staleWhileFetching:n}#L(e,t,r,s){let n=t===void 0?void 0:this.#o[t];if(this.#S(n))return n;let a=new Ll,{signal:c}=r;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let u={signal:a.signal,options:r,context:s},l=o((g,S=!1)=>{let{aborted:E}=a.signal,_=r.ignoreFetchAbort&&g!==void 0;if(r.status&&(E&&!S?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,_&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),E&&!_&&!S)return f(a.signal.reason);let b=m;return this.#o[t]===m&&(g===void 0?b.__staleWhileFetching?this.#o[t]=b.__staleWhileFetching:this.#g(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,g,u.options))),g},"cb"),h=o(g=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=g),f(g)),"eb"),f=o(g=>{let{aborted:S}=a.signal,E=S&&r.allowStaleOnFetchAbort,_=E||r.allowStaleOnFetchRejection,b=_||r.noDeleteOnFetchRejection,w=m;if(this.#o[t]===m&&(!b||w.__staleWhileFetching===void 0?this.#g(e,"fetch"):E||(this.#o[t]=w.__staleWhileFetching)),_)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw g},"fetchFail"),p=o((g,S)=>{let E=this.#s?.(e,n,u);E&&E instanceof Promise&&E.then(_=>g(_===void 0?void 0:_),S),a.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(g(void 0),r.allowStaleOnFetchAbort&&(g=o(_=>l(_,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let m=new Promise(p).then(l,h),y=Object.assign(m,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,y,{...u.options,status:void 0}),t=this.#n.get(e)):this.#o[t]=y,y}#S(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ll}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:g,forceRefresh:S=!1,status:E,signal:_}=t;if(!this.#I)return E&&(E.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:E});let b={allowStale:r,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:c,size:u,sizeCalculation:l,noUpdateTTL:h,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:m,status:E,signal:_},w=this.#n.get(e);if(w===void 0){E&&(E.fetch="miss");let I=this.#L(e,w,b,g);return I.__returned=I}else{let I=this.#o[w];if(this.#S(I)){let ee=r&&I.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",ee&&(E.returnedStale=!0)),ee?I.__staleWhileFetching:I.__returned=I}let v=this.#R(w);if(!S&&!v)return E&&(E.fetch="hit"),this.#j(w),s&&this.#O(w),E&&this.#l(E,w),I;let N=this.#L(e,w,b,g),$=N.__staleWhileFetching!==void 0&&r;return E&&(E.fetch=v?"stale":"refresh",$&&v&&(E.returnedStale=!0)),$?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#u;if(!r)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=t,c=this.get(e,a);if(!n&&c!==void 0)return c;let u=r(e,c,{options:a,context:s});return this.set(e,u,a),u}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=t,c=this.#n.get(e);if(c!==void 0){let u=this.#o[c],l=this.#S(u);return a&&this.#l(a,c),this.#R(c)?(a&&(a.get="stale"),l?(a&&r&&u.__staleWhileFetching!==void 0&&(a.returnedStale=!0),r?u.__staleWhileFetching:void 0):(n||this.#g(e,"expire"),a&&r&&(a.returnedStale=!0),r?u:void 0)):(a&&(a.get="hit"),l?u.__staleWhileFetching:(this.#j(c),s&&this.#O(c),u))}else a&&(a.get="miss")}#U(e,t){this.#a[t]=e,this.#d[e]=t}#j(e){e!==this.#y&&(e===this.#p?this.#p=this.#d[e]:this.#U(this.#a[e],this.#d[e]),this.#U(this.#y,e),this.#y=e)}delete(e){return this.#g(e,"delete")}#g(e,t){let r=!1;if(this.#c!==0){let s=this.#n.get(e);if(s!==void 0)if(r=!0,this.#c===1)this.#q(t);else{this.#k(s);let n=this.#o[s];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#i?.(n,e,t),this.#E&&this.#m?.push([n,e,t])),this.#n.delete(e),this.#h[s]=void 0,this.#o[s]=void 0,s===this.#y)this.#y=this.#a[s];else if(s===this.#p)this.#p=this.#d[s];else{let a=this.#a[s];this.#d[a]=this.#d[s];let c=this.#d[s];this.#a[c]=this.#a[s]}this.#c--,this.#_.push(s)}}if(this.#E&&this.#m?.length){let s=this.#m,n;for(;n=s?.shift();)this.#r?.(...n)}return r}clear(){return this.#q("delete")}#q(e){for(let t of this.#x({allowStale:!0})){let r=this.#o[t];if(this.#S(r))r.__abortController.abort(new Error("deleted"));else{let s=this.#h[t];this.#v&&this.#i?.(r,s,e),this.#E&&this.#m?.push([r,s,e])}}if(this.#n.clear(),this.#o.fill(void 0),this.#h.fill(void 0),this.#b&&this.#w&&(this.#b.fill(0),this.#w.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#y=0,this.#_.length=0,this.#f=0,this.#c=0,this.#E&&this.#m){let t=this.#m,r;for(;r=t?.shift();)this.#r?.(...r)}}};Ml.LRUCache=Ng});var zR=d((efe,VR)=>{"use strict";var qR=De(),nz=o((i,e,t,r,s)=>{typeof t=="string"&&(s=r,r=t,t=void 0);try{return new qR(i instanceof qR?i.version:i,t).inc(e,r,s).version}catch{return null}},"inc");VR.exports=nz});var WR=d((ife,GR)=>{"use strict";var HR=ns(),oz=o((i,e)=>{let t=HR(i,null,!0),r=HR(e,null,!0),s=t.compare(r);if(s===0)return null;let n=s>0,a=n?t:r,c=n?r:t,u=!!a.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(a)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==r.major?h+"major":t.minor!==r.minor?h+"minor":t.patch!==r.patch?h+"patch":"prerelease"},"diff");GR.exports=oz});var KR=d((sfe,JR)=>{"use strict";var az=De(),cz=o((i,e)=>new az(i,e).major,"major");JR.exports=cz});var YR=d((ofe,ZR)=>{"use strict";var uz=De(),lz=o((i,e)=>new uz(i,e).minor,"minor");ZR.exports=lz});var QR=d((cfe,XR)=>{"use strict";var hz=De(),fz=o((i,e)=>new hz(i,e).patch,"patch");XR.exports=fz});var tA=d((lfe,eA)=>{"use strict";var dz=ns(),pz=o((i,e)=>{let t=dz(i,e);return t&&t.prerelease.length?t.prerelease:null},"prerelease");eA.exports=pz});var It=d((ffe,rA)=>{"use strict";var iA=De(),mz=o((i,e,t)=>new iA(i,t).compare(new iA(e,t)),"compare");rA.exports=mz});var nA=d((pfe,sA)=>{"use strict";var gz=It(),yz=o((i,e,t)=>gz(e,i,t),"rcompare");sA.exports=yz});var aA=d((gfe,oA)=>{"use strict";var Sz=It(),Ez=o((i,e)=>Sz(i,e,!0),"compareLoose");oA.exports=Ez});var Bl=d((Sfe,uA)=>{"use strict";var cA=De(),wz=o((i,e,t)=>{let r=new cA(i,t),s=new cA(e,t);return r.compare(s)||r.compareBuild(s)},"compareBuild");uA.exports=wz});var hA=d((wfe,lA)=>{"use strict";var _z=Bl(),bz=o((i,e)=>i.sort((t,r)=>_z(t,r,e)),"sort");lA.exports=bz});var dA=d((bfe,fA)=>{"use strict";var Iz=Bl(),Oz=o((i,e)=>i.sort((t,r)=>Iz(r,t,e)),"rsort");fA.exports=Oz});var ka=d((Ofe,pA)=>{"use strict";var vz=It(),Rz=o((i,e,t)=>vz(i,e,t)>0,"gt");pA.exports=Rz});var kl=d((Rfe,mA)=>{"use strict";var Az=It(),Tz=o((i,e,t)=>Az(i,e,t)<0,"lt");mA.exports=Tz});var Dg=d((Tfe,gA)=>{"use strict";var Cz=It(),Nz=o((i,e,t)=>Cz(i,e,t)===0,"eq");gA.exports=Nz});var xg=d((Nfe,yA)=>{"use strict";var Pz=It(),Dz=o((i,e,t)=>Pz(i,e,t)!==0,"neq");yA.exports=Dz});var Fl=d((Dfe,SA)=>{"use strict";var xz=It(),Lz=o((i,e,t)=>xz(i,e,t)>=0,"gte");SA.exports=Lz});var Ul=d((Lfe,EA)=>{"use strict";var Mz=It(),Bz=o((i,e,t)=>Mz(i,e,t)<=0,"lte");EA.exports=Bz});var Lg=d((Bfe,wA)=>{"use strict";var kz=Dg(),Fz=xg(),Uz=ka(),jz=Fl(),$z=kl(),qz=Ul(),Vz=o((i,e,t,r)=>{switch(e){case"===":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i===t;case"!==":return typeof i=="object"&&(i=i.version),typeof t=="object"&&(t=t.version),i!==t;case"":case"=":case"==":return kz(i,t,r);case"!=":return Fz(i,t,r);case">":return Uz(i,t,r);case">=":return jz(i,t,r);case"<":return $z(i,t,r);case"<=":return qz(i,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");wA.exports=Vz});var bA=d((Ffe,_A)=>{"use strict";var zz=De(),Hz=ns(),{safeRe:jl,t:$l}=cn(),Gz=o((i,e)=>{if(i instanceof zz)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;e=e||{};let t=null;if(!e.rtl)t=i.match(e.includePrerelease?jl[$l.COERCEFULL]:jl[$l.COERCE]);else{let u=e.includePrerelease?jl[$l.COERCERTLFULL]:jl[$l.COERCERTL],l;for(;(l=u.exec(i))&&(!t||t.index+t[0].length!==i.length);)(!t||l.index+l[0].length!==t.index+t[0].length)&&(t=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(t===null)return null;let r=t[2],s=t[3]||"0",n=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Hz(`${r}.${s}.${n}${a}${c}`,e)},"coerce");_A.exports=Gz});var OA=d((jfe,IA)=>{"use strict";var Mg=class{static{o(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,t)}return this}};IA.exports=Mg});var Ot=d((qfe,TA)=>{"use strict";var Wz=/\s+/g,Bg=class i{static{o(this,"Range")}constructor(e,t){if(t=Kz(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof kg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Wz," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!RA(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&iH(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&eH)|(this.options.loose&&tH))+":"+e,s=vA.get(r);if(s)return s;let n=this.options.loose,a=n?Ze[ze.HYPHENRANGELOOSE]:Ze[ze.HYPHENRANGE];e=e.replace(a,fH(this.options.includePrerelease)),ne("hyphen replace",e),e=e.replace(Ze[ze.COMPARATORTRIM],Yz),ne("comparator trim",e),e=e.replace(Ze[ze.TILDETRIM],Xz),ne("tilde trim",e),e=e.replace(Ze[ze.CARETTRIM],Qz),ne("caret trim",e);let c=e.split(" ").map(f=>rH(f,this.options)).join(" ").split(/\s+/).map(f=>hH(f,this.options));n&&(c=c.filter(f=>(ne("loose invalid filter",f,this.options),!!f.match(Ze[ze.COMPARATORLOOSE])))),ne("range list",c);let u=new Map,l=c.map(f=>new kg(f,this.options));for(let f of l){if(RA(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return vA.set(r,h),h}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>AA(r,t)&&e.set.some(s=>AA(s,t)&&r.every(n=>s.every(a=>n.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Zz(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(dH(this.set[t],e,this.options))return!0;return!1}};TA.exports=Bg;var Jz=OA(),vA=new Jz,Kz=zu(),kg=Fa(),ne=ha(),Zz=De(),{safeRe:Ze,t:ze,comparatorTrimReplace:Yz,tildeTrimReplace:Xz,caretTrimReplace:Qz}=cn(),{FLAG_INCLUDE_PRERELEASE:eH,FLAG_LOOSE:tH}=fa(),RA=o(i=>i.value==="<0.0.0-0","isNullSet"),iH=o(i=>i.value==="","isAny"),AA=o((i,e)=>{let t=!0,r=i.slice(),s=r.pop();for(;t&&r.length;)t=r.every(n=>s.intersects(n,e)),s=r.pop();return t},"isSatisfiable"),rH=o((i,e)=>(ne("comp",i,e),i=oH(i,e),ne("caret",i),i=sH(i,e),ne("tildes",i),i=cH(i,e),ne("xrange",i),i=lH(i,e),ne("stars",i),i),"parseComparator"),He=o(i=>!i||i.toLowerCase()==="x"||i==="*","isX"),sH=o((i,e)=>i.trim().split(/\s+/).map(t=>nH(t,e)).join(" "),"replaceTildes"),nH=o((i,e)=>{let t=e.loose?Ze[ze.TILDELOOSE]:Ze[ze.TILDE];return i.replace(t,(r,s,n,a,c)=>{ne("tilde",i,r,s,n,a,c);let u;return He(s)?u="":He(n)?u=`>=${s}.0.0 <${+s+1}.0.0-0`:He(a)?u=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:c?(ne("replaceTilde pr",c),u=`>=${s}.${n}.${a}-${c} <${s}.${+n+1}.0-0`):u=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,ne("tilde return",u),u})},"replaceTilde"),oH=o((i,e)=>i.trim().split(/\s+/).map(t=>aH(t,e)).join(" "),"replaceCarets"),aH=o((i,e)=>{ne("caret",i,e);let t=e.loose?Ze[ze.CARETLOOSE]:Ze[ze.CARET],r=e.includePrerelease?"-0":"";return i.replace(t,(s,n,a,c,u)=>{ne("caret",i,s,n,a,c,u);let l;return He(n)?l="":He(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:He(c)?n==="0"?l=`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:u?(ne("replaceCaret pr",u),n==="0"?a==="0"?l=`>=${n}.${a}.${c}-${u} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}-${u} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c}-${u} <${+n+1}.0.0-0`):(ne("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${c}${r} <${n}.${a}.${+c+1}-0`:l=`>=${n}.${a}.${c}${r} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${c} <${+n+1}.0.0-0`),ne("caret return",l),l})},"replaceCaret"),cH=o((i,e)=>(ne("replaceXRanges",i,e),i.split(/\s+/).map(t=>uH(t,e)).join(" ")),"replaceXRanges"),uH=o((i,e)=>{i=i.trim();let t=e.loose?Ze[ze.XRANGELOOSE]:Ze[ze.XRANGE];return i.replace(t,(r,s,n,a,c,u)=>{ne("xRange",i,r,s,n,a,c,u);let l=He(n),h=l||He(a),f=h||He(c),p=f;return s==="="&&p&&(s=""),u=e.includePrerelease?"-0":"",l?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&p?(h&&(a=0),c=0,s===">"?(s=">=",h?(n=+n+1,a=0,c=0):(a=+a+1,c=0)):s==="<="&&(s="<",h?n=+n+1:a=+a+1),s==="<"&&(u="-0"),r=`${s+n}.${a}.${c}${u}`):h?r=`>=${n}.0.0${u} <${+n+1}.0.0-0`:f&&(r=`>=${n}.${a}.0${u} <${n}.${+a+1}.0-0`),ne("xRange return",r),r})},"replaceXRange"),lH=o((i,e)=>(ne("replaceStars",i,e),i.trim().replace(Ze[ze.STAR],"")),"replaceStars"),hH=o((i,e)=>(ne("replaceGTE0",i,e),i.trim().replace(Ze[e.includePrerelease?ze.GTE0PRE:ze.GTE0],"")),"replaceGTE0"),fH=o(i=>(e,t,r,s,n,a,c,u,l,h,f,p)=>(He(r)?t="":He(s)?t=`>=${r}.0.0${i?"-0":""}`:He(n)?t=`>=${r}.${s}.0${i?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${i?"-0":""}`,He(l)?u="":He(h)?u=`<${+l+1}.0.0-0`:He(f)?u=`<${l}.${+h+1}.0-0`:p?u=`<=${l}.${h}.${f}-${p}`:i?u=`<${l}.${h}.${+f+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),"hyphenReplace"),dH=o((i,e,t)=>{for(let r=0;r<i.length;r++)if(!i[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<i.length;r++)if(ne(i[r].semver),i[r].semver!==kg.ANY&&i[r].semver.prerelease.length>0){let s=i[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0},"testSet")});var Fa=d((zfe,LA)=>{"use strict";var Ua=Symbol("SemVer ANY"),jg=class i{static{o(this,"Comparator")}static get ANY(){return Ua}constructor(e,t){if(t=CA(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ug("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ua?this.value="":this.value=this.operator+this.semver.version,Ug("comp",this)}parse(e){let t=this.options.loose?NA[PA.COMPARATORLOOSE]:NA[PA.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new DA(r[2],this.options.loose):this.semver=Ua}toString(){return this.value}test(e){if(Ug("Comparator.test",e,this.options.loose),this.semver===Ua||e===Ua)return!0;if(typeof e=="string")try{e=new DA(e,this.options)}catch{return!1}return Fg(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new xA(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new xA(this.value,t).test(e.semver):(t=CA(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Fg(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Fg(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};LA.exports=jg;var CA=zu(),{safeRe:NA,t:PA}=cn(),Fg=Lg(),Ug=ha(),DA=De(),xA=Ot()});var yn=d((Gfe,MA)=>{"use strict";var pH=Ot(),mH=o((i,e,t)=>{try{e=new pH(e,t)}catch{return!1}return e.test(i)},"satisfies");MA.exports=mH});var kA=d((Jfe,BA)=>{"use strict";var gH=Ot(),yH=o((i,e)=>new gH(i,e).set.map(t=>t.map(r=>r.value).join(" ").trim().split(" ")),"toComparators");BA.exports=yH});var UA=d((Zfe,FA)=>{"use strict";var SH=De(),EH=Ot(),wH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new EH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===-1)&&(r=a,s=new SH(r,t))}),r},"maxSatisfying");FA.exports=wH});var $A=d((Xfe,jA)=>{"use strict";var _H=De(),bH=Ot(),IH=o((i,e,t)=>{let r=null,s=null,n=null;try{n=new bH(e,t)}catch{return null}return i.forEach(a=>{n.test(a)&&(!r||s.compare(a)===1)&&(r=a,s=new _H(r,t))}),r},"minSatisfying");jA.exports=IH});var zA=d((ede,VA)=>{"use strict";var $g=De(),OH=Ot(),qA=ka(),vH=o((i,e)=>{i=new OH(i,e);let t=new $g("0.0.0");if(i.test(t)||(t=new $g("0.0.0-0"),i.test(t)))return t;t=null;for(let r=0;r<i.set.length;++r){let s=i.set[r],n=null;s.forEach(a=>{let c=new $g(a.semver.version);switch(a.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!n||qA(c,n))&&(n=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!t||qA(t,n))&&(t=n)}return t&&i.test(t)?t:null},"minVersion");VA.exports=vH});var qg=d((ide,HA)=>{"use strict";var RH=Ot(),AH=o((i,e)=>{try{return new RH(i,e).range||"*"}catch{return null}},"validRange");HA.exports=AH});var ql=d((sde,KA)=>{"use strict";var TH=De(),JA=Fa(),{ANY:CH}=JA,NH=Ot(),PH=yn(),GA=ka(),WA=kl(),DH=Ul(),xH=Fl(),LH=o((i,e,t,r)=>{i=new TH(i,r),e=new NH(e,r);let s,n,a,c,u;switch(t){case">":s=GA,n=DH,a=WA,c=">",u=">=";break;case"<":s=WA,n=xH,a=GA,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(PH(i,e,r))return!1;for(let l=0;l<e.set.length;++l){let h=e.set[l],f=null,p=null;if(h.forEach(m=>{m.semver===CH&&(m=new JA(">=0.0.0")),f=f||m,p=p||m,s(m.semver,f.semver,r)?f=m:a(m.semver,p.semver,r)&&(p=m)}),f.operator===c||f.operator===u||(!p.operator||p.operator===c)&&n(i,p.semver))return!1;if(p.operator===u&&a(i,p.semver))return!1}return!0},"outside");KA.exports=LH});var YA=d((ode,ZA)=>{"use strict";var MH=ql(),BH=o((i,e,t)=>MH(i,e,">",t),"gtr");ZA.exports=BH});var QA=d((cde,XA)=>{"use strict";var kH=ql(),FH=o((i,e,t)=>kH(i,e,"<",t),"ltr");XA.exports=FH});var iT=d((lde,tT)=>{"use strict";var eT=Ot(),UH=o((i,e,t)=>(i=new eT(i,t),e=new eT(e,t),i.intersects(e,t)),"intersects");tT.exports=UH});var sT=d((fde,rT)=>{"use strict";var jH=yn(),$H=It();rT.exports=(i,e,t)=>{let r=[],s=null,n=null,a=i.sort((h,f)=>$H(h,f,t));for(let h of a)jH(h,e,t)?(n=h,s||(s=h)):(n&&r.push([s,n]),n=null,s=null);s&&r.push([s,null]);let c=[];for(let[h,f]of r)h===f?c.push(h):!f&&h===a[0]?c.push("*"):f?h===a[0]?c.push(`<=${f}`):c.push(`${h} - ${f}`):c.push(`>=${h}`);let u=c.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e}});var lT=d((dde,uT)=>{"use strict";var nT=Ot(),zg=Fa(),{ANY:Vg}=zg,ja=yn(),Hg=It(),qH=o((i,e,t={})=>{if(i===e)return!0;i=new nT(i,t),e=new nT(e,t);let r=!1;e:for(let s of i.set){for(let n of e.set){let a=zH(s,n,t);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},"subset"),VH=[new zg(">=0.0.0-0")],oT=[new zg(">=0.0.0")],zH=o((i,e,t)=>{if(i===e)return!0;if(i.length===1&&i[0].semver===Vg){if(e.length===1&&e[0].semver===Vg)return!0;t.includePrerelease?i=VH:i=oT}if(e.length===1&&e[0].semver===Vg){if(t.includePrerelease)return!0;e=oT}let r=new Set,s,n;for(let m of i)m.operator===">"||m.operator===">="?s=aT(s,m,t):m.operator==="<"||m.operator==="<="?n=cT(n,m,t):r.add(m.semver);if(r.size>1)return null;let a;if(s&&n){if(a=Hg(s.semver,n.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let m of r){if(s&&!ja(m,String(s),t)||n&&!ja(m,String(n),t))return null;for(let y of e)if(!ja(m,String(y),t))return!1;return!0}let c,u,l,h,f=n&&!t.includePrerelease&&n.semver.prerelease.length?n.semver:!1,p=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&n.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let m of e){if(h=h||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",s){if(p&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===p.major&&m.semver.minor===p.minor&&m.semver.patch===p.patch&&(p=!1),m.operator===">"||m.operator===">="){if(c=aT(s,m,t),c===m&&c!==s)return!1}else if(s.operator===">="&&!ja(s.semver,String(m),t))return!1}if(n){if(f&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===f.major&&m.semver.minor===f.minor&&m.semver.patch===f.patch&&(f=!1),m.operator==="<"||m.operator==="<="){if(u=cT(n,m,t),u===m&&u!==n)return!1}else if(n.operator==="<="&&!ja(n.semver,String(m),t))return!1}if(!m.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&h&&!s&&a!==0||p||f)},"simpleSubset"),aT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r>0?i:r<0||e.operator===">"&&i.operator===">="?e:i},"higherGT"),cT=o((i,e,t)=>{if(!i)return e;let r=Hg(i.semver,e.semver,t);return r<0?i:r>0||e.operator==="<"&&i.operator==="<="?e:i},"lowerLT");uT.exports=qH});var ds=d((mde,dT)=>{"use strict";var Gg=cn(),hT=fa(),HH=De(),fT=Rm(),GH=ns(),WH=Tm(),JH=Cm(),KH=zR(),ZH=WR(),YH=KR(),XH=YR(),QH=QR(),eG=tA(),tG=It(),iG=nA(),rG=aA(),sG=Bl(),nG=hA(),oG=dA(),aG=ka(),cG=kl(),uG=Dg(),lG=xg(),hG=Fl(),fG=Ul(),dG=Lg(),pG=bA(),mG=Fa(),gG=Ot(),yG=yn(),SG=kA(),EG=UA(),wG=$A(),_G=zA(),bG=qg(),IG=ql(),OG=YA(),vG=QA(),RG=iT(),AG=sT(),TG=lT();dT.exports={parse:GH,valid:WH,clean:JH,inc:KH,diff:ZH,major:YH,minor:XH,patch:QH,prerelease:eG,compare:tG,rcompare:iG,compareLoose:rG,compareBuild:sG,sort:nG,rsort:oG,gt:aG,lt:cG,eq:uG,neq:lG,gte:hG,lte:fG,cmp:dG,coerce:pG,Comparator:mG,Range:gG,satisfies:yG,toComparators:SG,maxSatisfying:EG,minSatisfying:wG,minVersion:_G,validRange:bG,outside:IG,gtr:OG,ltr:vG,intersects:RG,simplifyRange:AG,subset:TG,SemVer:HH,re:Gg.re,src:Gg.src,tokens:Gg.t,SEMVER_SPEC_VERSION:hT.SEMVER_SPEC_VERSION,RELEASE_TYPES:hT.RELEASE_TYPES,compareIdentifiers:fT.compareIdentifiers,rcompareIdentifiers:fT.rcompareIdentifiers}});var gT=d((gde,mT)=>{var pT=ds();mT.exports=i=>CG(i.reduce(MG,{versions:{},"dist-tags":{},refs:{},shas:{}}));var CG=o(i=>DG(NG(PG(i))),"finish"),NG=o(i=>(Object.keys(i.refs).forEach(e=>{let t=i.refs[e];i.shas[t.sha]?i.shas[t.sha].push(e):i.shas[t.sha]=[e]}),i),"shaList"),PG=o(i=>(Object.keys(i.refs).filter(e=>e.endsWith("^{}")).forEach(e=>{let t=i.refs[e],r=i.refs[e.replace(/\^\{\}$/,"")];r&&(r.sha=t.sha,delete i.refs[e])}),i),"peelTags"),DG=o(i=>{let e=i.refs.HEAD||{};return Object.keys(i.versions).forEach(r=>{let s=i.versions[r];i.refs.latest&&s.sha===i.refs.latest.sha?i["dist-tags"].latest=r:s.sha===e.sha&&(i["dist-tags"].HEAD=r,i.refs.latest||(i["dist-tags"].latest=r))}),i},"distTags"),xG=o(i=>i.startsWith("refs/tags/")?"tag":i.startsWith("refs/heads/")?"branch":i.startsWith("refs/pull/")?"pull":i==="HEAD"?"head":"other","refType"),LG=o(i=>{let e=i.trim().split(/\s+/,2);if(e.length<2)return null;let t=e[0].trim(),r=e[1].trim(),s=xG(r);if(s==="tag"){let n=r.slice(10);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="branch"){let n=r.slice(11);return{sha:t,ref:n,rawRef:r,type:s}}if(s==="pull"){let n=r.slice(5).replace(/\/head$/,"");return{sha:t,ref:n,rawRef:r,type:s}}return s==="head"?{sha:t,ref:"HEAD",rawRef:r,type:s}:{sha:t,ref:r,rawRef:r,type:s}},"lineToRevDoc"),MG=o((i,e)=>{let t=LG(e);if(!t)return i;if(i.refs[t.ref]=t,i.refs[t.rawRef]=t,t.type==="tag"){let r=!t.ref.endsWith("^{}")&&t.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/);r&&pT.valid(r[1],!0)&&(i.versions[pT.clean(r[1],!0)]=t)}return i},"linesToRevsReducer")});var Wg=d((Sde,ST)=>{var BG=Ba(),{LRUCache:kG}=Pg(),FG=gT(),yT=new kG({max:100,ttl:300*1e3});ST.exports=async(i,e={})=>{if(!e.noGitRevCache){let s=yT.get(i);if(s)return s}let{stdout:t}=await BG(["ls-remote",i],e),r=FG(t.trim().split(`
|
|
13
|
+
`));return yT.set(i,r),r}});var wT=d(ET=>{var UG=o(i=>(i.fakePlatform||process.platform)==="win32","isWindows");ET.isWindows=UG});var IT=d((_de,bT)=>{"use strict";var z=o((...i)=>i.every(e=>e)?i.join(""):"","maybeJoin"),ye=o(i=>i?encodeURIComponent(i):"","maybeEncode"),_T=o(i=>i.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),jG={sshtemplate:o(({domain:i,user:e,project:t,committish:r})=>`git@${i}:${e}/${t}.git${z("#",r)}`,"sshtemplate"),sshurltemplate:o(({domain:i,user:e,project:t,committish:r})=>`git+ssh://git@${i}/${e}/${t}.git${z("#",r)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s,path:n})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n)}`,"edittemplate"),browsetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,user:e,project:t,committish:r,blobpath:s,path:n,fragment:a,hashformat:c})=>`https://${i}/${e}/${t}/${s}/${ye(r||"HEAD")}/${n}${z("#",c(a||""))}`,"browseblobtemplate"),docstemplate:o(({domain:i,user:e,project:t,treepath:r,committish:s})=>`https://${i}/${e}/${t}${z("/",r,"/",ye(s))}#readme`,"docstemplate"),httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/raw/${ye(r||"HEAD")}/${s}`,"filetemplate"),shortcuttemplate:o(({type:i,user:e,project:t,committish:r})=>`${i}:${e}/${t}${z("#",r)}`,"shortcuttemplate"),pathtemplate:o(({user:i,project:e,committish:t})=>`${i}/${e}${z("#",t)}`,"pathtemplate"),bugstemplate:o(({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,"bugstemplate"),hashformat:_T},yr={};yr.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:o(({auth:i,user:e,project:t,committish:r,path:s})=>`https://${z(i,"@")}raw.githubusercontent.com/${e}/${t}/${ye(r||"HEAD")}/${s}`,"filetemplate"),gittemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"gittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://codeload.${i}/${e}/${t}/tar.gz/${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r,s]=i.pathname.split("/",5);if(!(r&&r!=="tree")&&(r||(s=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:s}},"extract")};yr.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:o(({domain:i,user:e,project:t,committish:r,treepath:s,path:n,editpath:a})=>`https://${i}/${e}/${t}${z("/",s,"/",ye(r||"HEAD"),"/",n,a)}`,"edittemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/get/${ye(r||"HEAD")}.tar.gz`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["get"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};yr.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:o(({auth:i,domain:e,user:t,project:r,committish:s})=>`git+https://${z(i,"@")}${e}/${t}/${r}.git${z("#",s)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${ye(r||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),r=t.pop();r.endsWith(".git")&&(r=r.slice(0,-4));let s=t.join("/");if(!(!s||!r))return{user:s,project:r,committish:i.hash.slice(1)}},"extract")};yr.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:o(({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${z("#",t)}`,"sshtemplate"),sshurltemplate:o(({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${z("#",t)}`,"sshurltemplate"),edittemplate:o(({domain:i,user:e,project:t,committish:r,editpath:s})=>`https://${i}/${e}/${t}${z("/",ye(r))}/${s}`,"edittemplate"),browsetemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"browsetemplate"),browsetreetemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browsetreetemplate"),browseblobtemplate:o(({domain:i,project:e,committish:t,path:r,hashformat:s})=>`https://${i}/${e}${z("/",ye(t))}${z("#",s(r))}`,"browseblobtemplate"),docstemplate:o(({domain:i,project:e,committish:t})=>`https://${i}/${e}${z("/",ye(t))}`,"docstemplate"),httpstemplate:o(({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${z("#",t)}`,"httpstemplate"),filetemplate:o(({user:i,project:e,committish:t,path:r})=>`https://gist.githubusercontent.com/${i}/${e}/raw${z("/",ye(t))}/${r}`,"filetemplate"),shortcuttemplate:o(({type:i,project:e,committish:t})=>`${i}:${e}${z("#",t)}`,"shortcuttemplate"),pathtemplate:o(({project:i,committish:e})=>`${i}${z("#",e)}`,"pathtemplate"),bugstemplate:o(({domain:i,project:e})=>`https://${i}/${e}`,"bugstemplate"),gittemplate:o(({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${z("#",t)}`,"gittemplate"),tarballtemplate:o(({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${ye(e||"HEAD")}`,"tarballtemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(r!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},"extract"),hashformat:o(function(i){return i&&"file-"+_T(i)},"hashformat")};yr.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:o(({domain:i,user:e,project:t,committish:r,path:s})=>`https://${i}/${e}/${t}/blob/${ye(r)||"HEAD"}/${s}`,"filetemplate"),httpstemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}.git${z("#",r)}`,"httpstemplate"),tarballtemplate:o(({domain:i,user:e,project:t,committish:r})=>`https://${i}/${e}/${t}/archive/${ye(r)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:o(()=>null,"bugstemplate"),extract:o(i=>{let[,e,t,r]=i.pathname.split("/",4);if(!["archive"].includes(r)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}},"extract")};for(let[i,e]of Object.entries(yr))yr[i]=Object.assign({},jG,e);bT.exports=yr});var Kg=d((Ide,vT)=>{var $G=require("url"),Jg=o((i,e,t)=>{let r=i.indexOf(t);return i.lastIndexOf(e,r>-1?r:1/0)},"lastIndexOfBefore"),OT=o(i=>{try{return new $G.URL(i)}catch{}},"safeUrl"),qG=o((i,e)=>{let t=i.indexOf(":"),r=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,r))return i;let s=i.indexOf("@");return s>-1?s>t?`git+ssh://${i}`:i:i.indexOf("//")===t+1?i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},"correctProtocol"),VG=o(i=>{let e=Jg(i,"@","#"),t=Jg(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),Jg(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i},"correctUrl");vT.exports=(i,e)=>{let t=e?qG(i,e):i;return OT(t)||OT(VG(t))}});var AT=d((vde,RT)=>{"use strict";var zG=Kg(),HG=o(i=>{let e=i.indexOf("#"),t=i.indexOf("/"),r=i.indexOf("/",t+1),s=i.indexOf(":"),n=/\s/.exec(i),a=i.indexOf("@"),c=!n||e>-1&&n.index>e,u=a===-1||e>-1&&a>e,l=s===-1||e>-1&&s>e,h=r===-1||e>-1&&r>e,f=t>0,p=e>-1?i[e-1]!=="/":!i.endsWith("/"),m=!i.startsWith(".");return c&&f&&p&&m&&u&&l&&h},"isGitHubShorthand");RT.exports=(i,e,{gitHosts:t,protocols:r})=>{if(!i)return;let s=HG(i)?`github:${i}`:i,n=zG(s,r);if(!n)return;let a=t.byShortcut[n.protocol],c=t.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],u=a||c;if(!u)return;let l=t[a||c],h=null;r[n.protocol]?.auth&&(n.username||n.password)&&(h=`${n.username}${n.password?":"+n.password:""}`);let f=null,p=null,m=null,y=null;try{if(a){let g=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname,S=g.indexOf("@");S>-1&&(g=g.slice(S+1));let E=g.lastIndexOf("/");E>-1?(p=decodeURIComponent(g.slice(0,E)),p||(p=null),m=decodeURIComponent(g.slice(E+1))):m=decodeURIComponent(g),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(f=decodeURIComponent(n.hash.slice(1))),y="shortcut"}else{if(!l.protocols.includes(n.protocol))return;let g=l.extract(n);if(!g)return;p=g.user&&decodeURIComponent(g.user),m=decodeURIComponent(g.project),f=decodeURIComponent(g.committish),y=r[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(g){if(g instanceof URIError)return;throw g}return[u,p,h,m,f,y,e]}});var CT=d((Ade,TT)=>{"use strict";var{LRUCache:GG}=Pg(),WG=IT(),JG=AT(),KG=Kg(),Zg=new GG({max:1e3});function ZG(i){try{let{protocol:e,hostname:t,pathname:r}=new URL(i);if(!t)return null;let s=/(?:git\+)http:$/.test(e)?"http:":"https:",n=r.replace(/\.git$/,"");return`${s}//${t}${n}`}catch{return null}}o(ZG,"unknownHostedUrl");var Vl=class i{static{o(this,"GitHost")}constructor(e,t,r,s,n,a,c={}){Object.assign(this,i.#e[e],{type:e,user:t,auth:r,project:s,committish:n,default:a,opts:c})}static#e={byShortcut:{},byDomain:{}};static#t={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){i.#e[e]=t,i.#e.byDomain[t.domain]=e,i.#e.byShortcut[`${e}:`]=e,i.#t[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let r=e+JSON.stringify(t||{});if(!Zg.has(r)){let s=JG(e,t,{gitHosts:i.#e,protocols:i.#t});Zg.set(r,s?new i(...s):void 0)}return Zg.get(r)}static fromManifest(e,t={}){if(!e||typeof e!="object")return;let r=e.repository,s=r&&(typeof r=="string"?r:typeof r=="object"&&typeof r.url=="string"?r.url:null);if(!s)throw new Error("no repository");let n=s&&i.fromUrl(s.replace(/^git\+/,""),t)||null;if(n)return n;let a=ZG(s);return i.fromUrl(a,t)||a}static parseUrl(e){return KG(e)}#i(e,t){if(typeof e!="function")return null;let r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);let s=e(r);return r.noGitPlus&&s.startsWith("git+")?s.slice(4):s}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#i(this.sshtemplate,e)}sshurl(e){return this.#i(this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?this.#i(this.browsetemplate,e):typeof t[0]!="string"?this.#i(this.browsetreetemplate,{...t[0],path:e}):this.#i(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?this.#i(this.browseblobtemplate,{...t[0],path:e}):this.#i(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#i(this.docstemplate,e)}bugs(e){return this.#i(this.bugstemplate,e)}https(e){return this.#i(this.httpstemplate,e)}git(e){return this.#i(this.gittemplate,e)}shortcut(e){return this.#i(this.shortcuttemplate,e)}path(e){return this.#i(this.pathtemplate,e)}tarball(e){return this.#i(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#i(this.filetemplate,{...t,path:e})}edit(e,t){return this.#i(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}};for(let[i,e]of Object.entries(WG))Vl.addHost(i,e);TT.exports=Vl});var Yg=d((Cde,NT)=>{"use strict";var{builtinModules:YG}=require("module"),XG=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),QG=["node_modules","favicon.ico"];function eW(i){var e=[],t=[];if(i===null)return t.push("name cannot be null"),$a(e,t);if(i===void 0)return t.push("name cannot be undefined"),$a(e,t);if(typeof i!="string")return t.push("name must be a string"),$a(e,t);if(i.length||t.push("name length must be greater than zero"),i.startsWith(".")&&t.push("name cannot start with a period"),i.match(/^_/)&&t.push("name cannot start with an underscore"),i.trim()!==i&&t.push("name cannot contain leading or trailing spaces"),QG.forEach(function(a){i.toLowerCase()===a&&t.push(a+" is not a valid package name")}),YG.includes(i.toLowerCase())&&e.push(i+" is a core module name"),i.length>214&&e.push("name can no longer contain more than 214 characters"),i.toLowerCase()!==i&&e.push("name can no longer contain capital letters"),/[~'!()*]/.test(i.split("/").slice(-1)[0])&&e.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(i)!==i){var r=i.match(XG);if(r){var s=r[1],n=r[2];if(n.startsWith(".")&&t.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(n)===n)return $a(e,t)}t.push("name can only contain URL-friendly characters")}return $a(e,t)}o(eW,"validate");var $a=o(function(i,e){var t={validForNewPackages:e.length===0&&i.length===0,validForOldPackages:e.length===0,warnings:i,errors:e};return t.warnings.length||delete t.warnings,t.errors.length||delete t.errors,t},"done");NT.exports=eW});var UT=d((Pde,Ha)=>{"use strict";var za=process.platform==="win32",{URL:Xg}=require("node:url"),Sn=za?require("node:path/win32"):require("node:path"),{homedir:tW}=require("node:os"),iW=CT(),PT=ds(),MT=Yg(),{log:rW}=St(),BT=za?/\\|[/]/:/[/]/,kT=/^(?:git[+])?[a-z]+:/i,sW=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ey=/[.](?:tgz|tar.gz|tar)$/i,nW=/:[0-9]+(\/|$)/i,oW=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,aW=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,DT="https://registry.npmjs.org";function qa(i,e){let t,r;if(typeof i=="object")return i instanceof Va&&(!e||e===i.where)?i:i.name&&i.rawSpec?qa.resolve(i.name,i.rawSpec,e||i.where):qa(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return kT.test(i)?r=i:sW.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(BT.test(n)||ey.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):MT(i).validForOldPackages?(t=i,r="*"):r=i,FT(t,r,e,i)}o(qa,"npa");function cW(i){return i?i.toLowerCase().startsWith("file:")?!0:za?oW.test(i):aW.test(i):!1}o(cW,"isFileSpec");function uW(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(uW,"isAliasSpec");function FT(i,e,t,r){let s=new Va({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),cW(e))return LT(s,t);if(uW(e))return SW(s,t);let n=iW.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?mW(s,n):e&&kT.test(e)?yW(s):e&&(BT.test(e)||ey.test(e))?LT(s,t):EW(s)}o(FT,"resolve");function lW(i,e=DT){let t=qa(i);if(t.type!=="version")throw dW(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==DT&&(r+="?repository_url="+e),r}o(lW,"toPurl");function hW(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(hW,"invalidPackageName");function fW(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(fW,"invalidTagName");function dW(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(dW,"invalidPurlType");var Va=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=MT(e);if(!t.validForOldPackages)throw hW(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function Qg(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}rW.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(Qg,"setGitAttrs");var pW=new Map([["\0","%00"],[" ","%09"],[`
|
|
14
|
+
`,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",za?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function xT(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${pW.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(xT,"pathToFileURL");function LT(i,e){i.type=ey.test(i.rawSpec)?"file":"directory",i.where=e;let t=xT(i.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let r,s;try{r=new Xg(t,`${xT(Sn.resolve(e))}/`),s=new Xg(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return za&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Sn.resolve(tW(),n.substr(3))):Sn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Sn.resolve(a)}`:i.saveSpec=`file:${Sn.relative(e,a)}`,i.fetchSpec=Sn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(LT,"fromFile");function mW(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),Qg(i,e.committish),i}o(mW,"fromHostedGit");function gW(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(gW,"unsupportedURLType");function yW(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(nW))return i.type="git",Qg(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new Xg(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",Qg(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw gW(t.protocol,e)}return i}o(yW,"fromURL");function SW(i,e){let t=qa(i.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(SW,"fromAlias");function EW(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=PT.valid(e,!0),r=PT.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw fW(e,i.raw);i.type="tag"}return i}o(EW,"fromRegistry");Ha.exports=qa;Ha.exports.resolve=FT;Ha.exports.toPurl=lW;Ha.exports.Result=Va});var zT=d((xde,VT)=>{var ps=require("node:process"),wW=require("node:os"),_W=require("node:fs");function bW(i){return i.includes("libc.musl-")||i.includes("ld-musl-")}o(bW,"isMusl");function jT(){return ps.platform}o(jT,"os");function $T(){return ps.arch}o($T,"cpu");var IW="/usr/bin/ldd";function OW(){try{let i=_W.readFileSync(IW,"utf-8");return i.includes("musl")?"musl":i.includes("GNU C Library")?"glibc":null}catch{return}}o(OW,"getFamilyFromFilesystem");function vW(){let i=ps.report.excludeNetwork;ps.report.excludeNetwork=!0;let e=ps.report.getReport();return ps.report.excludeNetwork=i,e.header?.glibcVersionRuntime?Ui="glibc":Array.isArray(e.sharedObjects)&&e.sharedObjects.some(bW)?Ui="musl":Ui=null,Ui}o(vW,"getFamilyFromReport");var Ui;function qT(i){if(i==="linux")return Ui===void 0&&(Ui=OW(),Ui===void 0&&(Ui=vW())),Ui}o(qT,"libc");function RW(i={}){let e=i.os||jT();return{cpu:{name:i.cpu||$T()},libc:{name:i.libc||qT(e)},os:{name:e,version:i.osVersion||wW.release()},packageManager:{name:"npm",version:i.npmVersion},runtime:{name:"node",version:i.nodeVersion||ps.version}}}o(RW,"devEngines");VT.exports={cpu:$T,libc:qT,os:jT,devEngines:RW}});var GT=d((Mde,HT)=>{var AW=yn(),TW=qg(),CW=["ignore","warn","error","download"],NW=["name","version","onFail"],PW=["packageManager","runtime","cpu","libc","os"];function DW(i,e,t){let{engine:r}=t;if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`Invalid non-object value for "${r}"`);let s=Object.keys(i);for(let n of s)if(!NW.includes(n))throw new Error(`Invalid property "${n}" for "${r}"`);if(!s.includes("name"))throw new Error(`Missing "name" property for "${r}"`);if(typeof i.name!="string")throw new Error(`Invalid non-string value for "name" within "${r}"`);if(typeof e.name!="string"||e.name==="")throw new Error(`Unable to determine "name" for "${r}"`);if(s.includes("onFail")){if(typeof i.onFail!="string")throw new Error(`Invalid non-string value for "onFail" within "${r}"`);if(!CW.includes(i.onFail))throw new Error(`Invalid onFail value "${i.onFail}" for "${r}"`)}if(i.name!==e.name)return new Error(`Invalid name "${i.name}" does not match "${e.name}" for "${r}"`);if(s.includes("version")){if(typeof i.version!="string")throw new Error(`Invalid non-string value for "version" within "${r}"`);if(typeof e.version!="string"||e.version==="")throw new Error(`Unable to determine "version" for "${r}" "${i.name}"`);if(TW(i.version)){if(!AW(e.version,i.version,t.semver))return new Error(`Invalid semver version "${i.version}" does not match "${e.version}" for "${r}"`)}else if(i.version!==e.version)return new Error(`Invalid version "${i.version}" does not match "${e.version}" for "${r}"`)}}o(DW,"checkDependency");function xW(i,e={},t={}){if(typeof i!="object"||i===null||Array.isArray(i))throw new Error('Invalid non-object value for "devEngines"');let r=[];for(let s of Object.keys(i)){if(!PW.includes(s))throw new Error(`Invalid property "devEngines.${s}"`);let n=i[s],a=[n].flat(),c=e[s]||{};if(a.length===0)continue;let u=[];for(let h of a){let f=DW(h,c,{...t,engine:s});f&&u.push(f)}if(u.length===a.length){let f=a[a.length-1].onFail||"error";f==="download"&&(f="error");let p=Object.assign(new Error(`Invalid devEngines.${s}`),{errors:u,engine:s,isWarn:f==="warn",isError:f==="error",current:c,required:n});r.push(p)}}return r}o(xW,"checkDevEngines");HT.exports={checkDevEngines:xW}});var KT=d((kde,JT)=>{var WT=ds(),zl=zT(),{checkDevEngines:LW}=GT(),MW=o((i,e,t,r=!1)=>{let s=r?null:t,n=i.engines,a={includePrerelease:!0};if(!n)return;let c=s&&n.node&&!WT.satisfies(s,n.node,a),u=e&&n.npm&&!WT.satisfies(e,n.npm,a);if(c||u)throw Object.assign(new Error("Unsupported engine"),{pkgid:i._id,current:{node:t,npm:e},required:n,code:"EBADENGINE"})},"checkEngine"),BW=o((i,e=!1,t={})=>{if(e)return;let r=t.os||zl.os(),s=t.cpu||zl.cpu(),n=t.libc||zl.libc(r),a=i.os?ty(r,i.os):!0,c=i.cpu?ty(s,i.cpu):!0,u=i.libc?ty(n,i.libc):!0;if(i.libc&&!n&&(u=!1),!a||!c||!u)throw Object.assign(new Error("Unsupported platform"),{pkgid:i._id,current:{os:r,cpu:s,libc:n},required:{os:i.os,cpu:i.cpu,libc:i.libc},code:"EBADPLATFORM"})},"checkPlatform"),ty=o((i,e)=>{if(typeof e=="string"&&(e=[e]),e.length===1&&e[0]==="any")return!0;let t=0,r=!1;for(let s of e){let n=s.charAt(0)==="!",a=n?s.slice(1):s;if(n){if(t++,i===a)return!1}else r=r||i===a}return r||t===e.length},"checkList");JT.exports={checkEngine:MW,checkPlatform:BW,checkDevEngines:LW,currentEnv:zl}});var Hl=d((Ude,XT)=>{var{join:ZT,basename:YT}=require("path"),kW=o(i=>i.bin?typeof i.bin=="string"?FW(i):Array.isArray(i.bin)?UW(i):typeof i.bin=="object"?ry(i):iy(i):iy(i),"normalize"),FW=o(i=>i.name?(i.bin={[i.name]:i.bin},ry(i)):iy(i),"normalizeString"),UW=o(i=>(i.bin=i.bin.reduce((e,t)=>(e[YT(t)]=t,e),{}),ry(i)),"normalizeArray"),iy=o(i=>(delete i.bin,i),"removeBin"),ry=o(i=>{let e=i.bin,t={},r=!1;return Object.keys(e).forEach(s=>{let n=ZT("/",YT(s.replace(/\\|:/g,"/"))).slice(1);if(typeof e[s]!="string"||!n)return;let a=ZT("/",e[s].replace(/\\/g,"/")).replace(/\\/g,"/").slice(1);a&&(t[n]=a,r=!0)}),r?i.bin=t:delete i.bin,i},"normalizeObject");XT.exports=kW});var Jl=d(($de,eC)=>{"use strict";var QT=UT(),Ga=ds(),{checkEngine:jW}=KT(),$W=Hl(),sy=o((i,e,t)=>{try{return jW(i,e,t),!0}catch{return!1}},"engineOk"),Gl=o((i,e,t)=>!i||!i[e]||Date.parse(i[e])<=t,"isBefore"),qW={includePrerelease:!0,loose:!0},Wl=o((i,e)=>e&&Ga.satisfies(i,e,qW),"shouldAvoid"),ny=o((i,e)=>i&&Wl(i.version,e)?{...i,_shouldAvoid:!0}:i,"decorateAvoid"),Wa=o((i,e,t)=>{let{defaultTag:r="latest",before:s=null,nodeVersion:n=process.version,npmVersion:a=null,includeStaged:c=!1,avoid:u=null,avoidStrict:l=!1}=t,{name:h,time:f}=i,p=i.versions||{};if(l){let P={...t,avoidStrict:!1},$=Wa(i,e,P);if(!$||!$._shouldAvoid)return $;let ee=Wa(i,`^${$.version}`,P);if(!ee||!ee._shouldAvoid)return{...ee,_outsideDependencyRange:!0,_isSemVerMajor:!1};let ti=Wa(i,"*",P);if(!ti||!ti._shouldAvoid)return{...ti,_outsideDependencyRange:!0,_isSemVerMajor:!0};throw Object.assign(new Error(`No avoidable versions for ${h}`),{code:"ETARGET",name:h,wanted:e,avoid:u,before:s,versions:Object.keys(p)})}let m=c&&i.stagedVersions&&i.stagedVersions.versions||{},y=i.policyRestrictions&&i.policyRestrictions.versions||{},g=s&&f?+new Date(s):1/0,E=QT.resolve(h,e||r).type,_=i["dist-tags"]||{};if(E!=="tag"&&E!=="version"&&E!=="range")throw new Error("Only tag, version, and range are supported");if(e&&E==="tag"){let P=_[e];return Gl(f,P,g)?ny(p[P]||m[P]||y[P],u):Wa(i,`<=${P}`,t)}if(e&&E==="version"){let P=Ga.clean(e,{loose:!0}),$=p[P]||m[P]||y[P];return Gl(f,P,g)?ny($,u):null}let b=E==="range"?e:"*",w=_[r];if(w&&(b==="*"||Ga.satisfies(w,b,{loose:!0}))&&!y[w]&&!Wl(w,u)){let P=p[w];if(P&&Gl(f,w,g)&&sy(P,a,n)&&!P.deprecated&&!m[w])return P}let I=Object.entries(p).concat(Object.entries(m)).concat(Object.entries(y)).filter(([P])=>Gl(f,P,g));if(!I.length)throw Object.assign(new Error(`No versions available for ${h}`),{code:"ENOVERSIONS",name:h,type:E,wanted:e,before:s,versions:Object.keys(p)});let v={loose:!0},N=I.filter(([P])=>Ga.satisfies(P,b,{loose:!0})).sort((P,$)=>{let[ee,ti]=P,[ss,oa]=$,Mu=!Wl(ee,u),Bu=!Wl(ss,u),ku=!y[ee],Fu=!y[ss],Uu=!m[ee],ju=!m[ss],aa=!ti.deprecated,ca=!oa.deprecated,ua=sy(ti,a,n),la=sy(oa,a,n);return Bu-Mu||Fu-ku||ju-Uu||(ca&&la)-(aa&&ua)||la-ua||ca-aa||Ga.rcompare(ee,ss,v)});return ny(N[0]&&N[0][1],u)},"pickManifest");eC.exports=(i,e,t={})=>{let r=Wa(i,e,t),s=r&&$W(r),n=i.policyRestrictions,a=n&&n.versions||{};if(s&&!a[s.version])return s;let{before:c=null,defaultTag:u="latest"}=t,l=c?new Date(c).toLocaleString():"",{name:h}=i,f=`${h}@${e}`+(c?` with a date before ${l}`:""),p=s&&!!a[s.version],m=p?n.message:"",y=p?`Could not download ${f} due to policy violations:
|
|
15
|
+
${m}`:`No matching version found for ${f}.`,g=p?"E403":"ETARGET";throw Object.assign(new Error(y),{code:g,type:QT.resolve(i.name,e).type,wanted:e,versions:Object.keys(i.versions??{}),name:h,distTags:i["dist-tags"],defaultTag:u})}});var sC=d((Vde,rC)=>{var VW=new Set(["github.com","gist.github.com","gitlab.com","bitbucket.com","bitbucket.org"]),{parse:zW}=require("url"),tC=require("path"),HW=Wg(),Ja=Ba(),{isWindows:Kl}=wT(),GW=Jl(),oy=require("fs/promises");rC.exports=(i,e="HEAD",t=null,r={})=>HW(i,r).then(s=>JW(i,s,e,KW(s,e,r),t||WW(i,r.cwd),r));var ay=o((i,e)=>e.gitShallow===!1||e.gitShallow?e.gitShallow:VW.has(zW(i).host),"maybeShallow"),WW=o((i,e=process.cwd())=>tC.resolve(e,tC.basename(i.replace(/[/\\]?\.git$/,""))),"defaultTarget"),JW=o((i,e,t,r,s,n)=>r?r.sha===e.refs.HEAD.sha?XW(i,r,s,n):r.type==="tag"||r.type==="branch"?YW(i,r,s,n):ZW(i,r,s,n):QW(i,t,s,n),"clone"),KW=o((i,e,t)=>{let{spec:r={}}=t;return e=r.gitCommittish||e,i?r.gitRange?GW(i,r.gitRange,t):e?i.refs[e]?i.refs[e]:i.shas[e]?i.refs[i.shas[e][0]]:null:i.refs.HEAD:null},"resolveRef"),ZW=o((i,e,t,r)=>{let s=ay(i,r),n=["fetch","origin",e.rawRef].concat(s?["--depth=1"]:[]),a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(["init"])).then(()=>Kl(r)?a(["config","--local","--add","core.longpaths","true"]):null).then(()=>a(["remote","add","origin",i])).then(()=>a(n)).then(()=>a(["checkout",e.sha])).then(()=>iC(t,r)).then(()=>e.sha)},"other"),YW=o((i,e,t,r)=>{let s=["clone","-b",e.ref,i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"branch"),XW=o((i,e,t,r)=>{let s=["clone",i,t,"--recurse-submodules"];return ay(i,r)&&s.push("--depth=1"),Kl(r)&&s.push("--config","core.longpaths=true"),Ja(s,r).then(()=>e.sha)},"plain"),iC=o(async(i,e)=>await oy.stat(`${i}/.gitmodules`).then(()=>!0).catch(()=>!1)?Ja(["submodule","update","-q","--init","--recursive"],{...e,cwd:i}):null,"updateSubmodules"),QW=o((i,e,t,r)=>{let s=Kl(r)?["--config","core.longpaths=true"]:[],n=["clone","--mirror","-q",i,t+"/.git"],a=o(c=>Ja(c,{...r,cwd:t}),"git");return oy.mkdir(t,{recursive:!0}).then(()=>a(n.concat(s))).then(()=>a(["init"])).then(()=>a(["checkout",e])).then(()=>iC(t,r)).then(()=>a(["rev-parse","--revs-only","HEAD"])).then(({stdout:c})=>c.trim())},"unresolved")});var cy=d((Hde,nC)=>{var{stat:e5}=require("fs/promises");nC.exports=({cwd:i=process.cwd()}={})=>e5(i+"/.git").then(()=>!0,()=>!1)});var aC=d((Gde,oC)=>{var t5=cy(),{dirname:i5}=require("path");oC.exports=async({cwd:i=process.cwd(),root:e}={})=>{for(;;){if(await t5({cwd:i}))return i;let t=i5(i);if(i===e||i===t)return null;i=t}}});var uC=d((Wde,cC)=>{var r5=Ba();cC.exports=(i={})=>r5(["status","--porcelain=v1","-uno"],i).then(e=>!e.stdout.trim().split(/\r?\n+/).map(t=>t.trim()).filter(t=>t).length)});var uy=d((Jde,lC)=>{lC.exports={clone:sC(),revs:Wg(),spawn:Ba(),is:cy(),find:aC(),isClean:uC(),errors:Ig()}});var gC=d((Kde,mC)=>{var s5=Tm(),n5=Cm(),Sr=require("node:fs/promises"),oe=require("node:path"),{log:dC}=St(),o5=require("node:module"),ly;function hC(){return ly||(ly=Xu()),ly}o(hC,"lazyHostedGitInfo");var hy;function Zl(){return hy||(hy=hg().glob),hy}o(Zl,"lazyLoadGlob");function a5(i,e){if(i.bin&&(typeof i.bin=="string"&&i.name?(e?.push('"bin" was converted to an object'),i.bin={[i.name]:i.bin}):Array.isArray(i.bin)&&(e?.push('"bin" was converted to an object'),i.bin=i.bin.reduce((t,r)=>(t[oe.basename(r)]=r,t),{})),typeof i.bin=="object")){for(let t in i.bin){if(typeof i.bin[t]!="string"){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let r=oe.basename(En(t));if(!r){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}let s=En(i.bin[t]);if(!s){delete i.bin[t],e?.push(`removed invalid "bin[${t}]"`);continue}r!==t&&(delete i.bin[t],e?.push(`"bin[${t}]" was renamed to "bin[${r}]"`)),s!==i.bin[t]&&e?.push(`"bin[${r}]" script name ${s} was invalid and removed`),i.bin[r]=s}return Object.keys(i.bin).length===0&&(e?.push('empty "bin" was removed'),delete i.bin),i}delete i.bin}o(a5,"normalizePackageBin");function c5(i,e){if(i.man){let t=[];for(let r of Array.isArray(i.man)?i.man:[i.man])typeof r!="string"?e?.push(`removed invalid "man [${r}]"`):t.push(En(r));if(!t.length)e?.push('empty "man" was removed');else return i.man=t,i}delete i.man}o(c5,"normalizePackageMan");function u5(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}o(u5,"isCorrectlyEncodedName");function l5(i){if(i.charAt(0)!=="@")return!1;let e=i.slice(1).split("/");return e.length!==2?!1:e[0]&&e[1]&&e[0]===encodeURIComponent(e[0])&&e[1]===encodeURIComponent(e[1])}o(l5,"isValidScopedPackageName");function fC(i){return i.replace(/\\|:/g,"/")}o(fC,"unixifyPath");function En(i){let e=fC(oe.join(".",oe.join("/",fC(i))));return e.startsWith("./")?"":e}o(En,"secureAndUnixifyPath");function pC(i,{strict:e,steps:t,changes:r,allowLegacyCase:s}){let n=i.content,a=`${n.name??""}@${n.version??""}`;if(t.includes("fixName")||t.includes("fixNameField")||t.includes("normalizeData"))if(!n.name&&!e)r?.push('Missing "name" field was set to an empty string'),n.name="";else{if(typeof n.name!="string")throw new Error("name field must be a string.");if(!e){let c=n.name.trim();n.name!==c&&(r?.push('Whitespace was trimmed from "name"'),n.name=c)}if(n.name.startsWith(".")||!(l5(n.name)||u5(n.name))||e&&!s&&n.name!==n.name.toLowerCase()||n.name.toLowerCase()==="node_modules"||n.name.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(n.name))}if(t.includes("fixName")&&o5.builtinModules.includes(n.name)&&dC.warn("package-json",a,`Package name "${n.name}" conflicts with a Node.js built-in module name`),t.includes("fixVersionField")||t.includes("normalizeData")){let c=!e;if(!n.version)n.version="";else{if(!s5(n.version,c))throw new Error(`Invalid version: "${n.version}"`);let u=n5(n.version,c);u!==n.version&&(r?.push(`"version" was cleaned and set to "${u}"`),n.version=u)}}if(t.includes("_attributes"))for(let c in n)c.startsWith("_")&&(r?.push(`"${c}" was removed`),delete i.content[c]);if(t.includes("_id")&&n.name&&n.version&&(r?.push(`"_id" was set to ${a}`),n._id=a),t.includes("bundledDependencies")&&(n.bundleDependencies===void 0&&n.bundledDependencies!==void 0&&(n.bundleDependencies=n.bundledDependencies,r?.push('Deleted incorrect "bundledDependencies"')),delete n.bundledDependencies),t.includes("bundleDependencies")){let c=n.bundleDependencies;c===!1&&!t.includes("bundleDependenciesDeleteFalse")?(r?.push('"bundleDependencies" was changed from "false" to "[]"'),n.bundleDependencies=[]):c===!0?(r?.push('"bundleDependencies" was auto-populated from "dependencies"'),n.bundleDependencies=Object.keys(n.dependencies||{})):c&&typeof c=="object"?Array.isArray(c)||(r?.push('"bundleDependencies" was changed from an object to an array'),n.bundleDependencies=Object.keys(c)):"bundleDependencies"in n&&(r?.push('"bundleDependencies" was removed'),delete n.bundleDependencies)}if(t.includes("optionalDedupe")&&n.dependencies&&n.optionalDependencies&&typeof n.optionalDependencies=="object"){for(let c in n.optionalDependencies)r?.push(`optionalDependencies."${c}" was removed`),delete n.dependencies[c];Object.keys(n.dependencies).length||(r?.push('Empty "optionalDependencies" was removed'),delete n.dependencies)}if((t.includes("scripts")||t.includes("scriptpath"))&&n.scripts!==void 0){let c=/^(\.[/\\])?node_modules[/\\].bin[\\/]/;if(typeof n.scripts=="object")for(let u in n.scripts)typeof n.scripts[u]!="string"?(delete n.scripts[u],r?.push(`Invalid scripts."${u}" was removed`)):t.includes("scriptpath")&&c.test(n.scripts[u])&&(n.scripts[u]=n.scripts[u].replace(c,""),r?.push(`scripts entry "${u}" was fixed to remove node_modules/.bin reference`));else r?.push('Removed invalid "scripts"'),delete n.scripts}if(t.includes("funding")&&n.funding&&typeof n.funding=="string"&&(n.funding={url:n.funding},r?.push('"funding" was changed to an object with a url attribute')),(t.includes("fixRepositoryField")||t.includes("normalizeData"))&&(n.repositories&&(r?.push(`"repository" was set to the first entry in "repositories" (${n.repository})`),n.repository=n.repositories[0]),n.repository&&(typeof n.repository=="string"&&(r?.push('"repository" was changed from a string to an object'),n.repository={type:"git",url:n.repository}),n.repository.url))){let c=hC().fromUrl(n.repository.url),u;c&&(c.getDefaultRepresentation()==="shortcut"?u=c.https():u=c.toString(),u!==n.repository.url&&(r?.push(`"repository.url" was normalized to "${u}"`),n.repository.url=u))}if(t.includes("fixDependencies")||t.includes("normalizeData")){for(let c of["dependencies","devDependencies","optionalDependencies"])if(n[c]){let u=!0;if(typeof n[c]=="string"&&(r?.push(`"${c}" was converted from a string into an object`),n[c]=n[c].trim().split(/[\n\r\s\t ,]+/),u=!1),Array.isArray(n[c])){u&&r?.push(`"${c}" was converted from an array into an object`);let l={};for(let h of n[c])if(typeof h=="string"){let f=h.trim().split(/(:?[@\s><=])/),p=f.shift(),m=f.join("").replace(/^@/,"").trim();l[p]=m}n[c]=l}}for(let c of["dependencies","devDependencies"])if(c in n)if(!n[c]||typeof n[c]!="object")r?.push(`Removed invalid "${c}"`),delete n[c];else for(let u in n[c]){typeof n[c][u]!="string"&&(r?.push(`Removed invalid "${c}.${u}"`),delete n[c][u]);let h=hC().fromUrl(n[c][u])?.toString();h&&h!==n[c][u]&&(r?.push(`Normalized git reference to "${c}.${u}"`),n[c][u]=h.toString())}}if(t.includes("normalizeData")){let{normalizeData:c}=Uv();c(n,r)}}o(pC,"syncSteps");async function h5(i,{steps:e,root:t,changes:r}){let s=i.content,n=s.scripts||{},a=`${s.name??""}@${s.version??""}`;if(e.includes("gypfile")&&!n.install&&!n.preinstall&&s.gypfile!==!1&&(await Zl()("*.gyp",{cwd:i.path})).length&&(n.install="node-gyp rebuild",s.scripts=n,s.gypfile=!0,r?.push('"scripts.install" was set to "node-gyp rebuild"'),r?.push('"gypfile" was set to "true"')),e.includes("serverjs")&&!n.start)try{await Sr.access(oe.join(i.path,"server.js")),n.start="node server.js",s.scripts=n,r?.push('"scripts.start" was set to "node server.js"')}catch{}if(e.includes("authors")&&!s.contributors)try{let u=(await Sr.readFile(oe.join(i.path,"AUTHORS"),"utf8")).split(/\r?\n/g).map(l=>l.replace(/^\s*#.*$/,"").trim()).filter(l=>l);s.contributors=u,r?.push('"contributors" was auto-populated with the contents of the "AUTHORS" file')}catch{}if(e.includes("readme")&&!s.readme){let c=/\.m?a?r?k?d?o?w?n?$/i,u=await Zl()("{README,README.*}",{cwd:i.path,nocase:!0,mark:!0}),l;for(let h of u)if(!h.endsWith(oe.sep)){if(h.match(c)){l=h;break}h.endsWith("README")&&(l=h)}if(l){let h=await Sr.readFile(oe.join(i.path,l),"utf8");s.readme=h,s.readmeFilename=l,r?.push(`"readme" was set to the contents of ${l}`),r?.push(`"readmeFilename" was set to ${l}`)}s.readme||(s.readme="ERROR: No README data found!")}if(e.includes("mans")){if(s.directories?.man&&!s.man){let c=En(s.directories.man),u=oe.resolve(i.path,c),l=await Zl()("**/*.[0-9]",{cwd:u});s.man=l.map(h=>oe.relative(i.path,oe.join(u,h)).split(oe.sep).join("/"))}c5(s,r)}if(e.includes("binDir")&&s.directories?.bin&&!s.bin){let c=En(s.directories.bin),u=await Zl()("**",{cwd:oe.resolve(i.path,c)});s.bin=u.reduce((l,h)=>{if(h&&!h.startsWith(".")){let f=oe.basename(h);l[f]=`${c}/${En(h)}`}return l},{})}else(e.includes("bin")||e.includes("binDir")||e.includes("binRefs"))&&a5(s,r);if(e.includes("gitHead")&&!s.gitHead){let u=await uy().find({cwd:i.path,root:t}),l;if(u)try{l=await Sr.readFile(oe.resolve(u,".git/HEAD"),"utf8")}catch{}let h;if(l)if(l.startsWith("ref: ")){let f=l.replace(/^ref: /,"").trim(),p=oe.resolve(u,".git",f);try{h=await Sr.readFile(p,"utf8"),h=h.replace(/^ref: /,"").trim()}catch{}if(!h){let m=oe.resolve(u,".git/packed-refs");try{let y=await Sr.readFile(m,"utf8");if(y){y=y.split(`
|
|
16
|
+
`);for(let g=0;g<y.length;g++){let S=y[g].match(/^([0-9a-f]{40}) (.+)$/);if(S&&S[2].trim()===f){h=S[1];break}}}}catch{}}}else h=l.trim();h&&(s.gitHead=h)}if(e.includes("fillTypes")){let c=s.main||"index.js";if(typeof c!="string")throw new TypeError('The "main" attribute must be of type string.');let l=`./${oe.join(oe.dirname(c),oe.basename(c,oe.extname(c)))}.d.ts`;if(!("types"in s||"typings"in s))try{await Sr.access(oe.join(i.path,l)),s.types=l.split(oe.sep).join("/")}catch{}}if(e.includes("binRefs")&&s.bin instanceof Object)for(let c in s.bin)try{await Sr.access(oe.resolve(i.path,s.bin[c]))}catch{dC.warn("package-json",a,`No bin file found at ${s.bin[c]}`)}}o(h5,"asyncSteps");async function f5(i,e){if(!i.content)throw new Error("Can not normalize without content");await h5(i,e),pC(i,e)}o(f5,"normalize");function d5(i,e){pC(i,e)}o(d5,"syncNormalize");mC.exports={normalize:f5,syncNormalize:d5}});var wC=d((Yde,EC)=>{var{readFile:p5}=require("fs/promises"),m5=bm();async function yC(i){try{return await p5(i,"utf8")}catch(e){throw e.message=`Could not read package.json: ${e}`,e}}o(yC,"read");function SC(i){try{return m5(i)}catch(e){throw e.message=`Invalid package.json: ${e}`,e}}o(SC,"parse");async function g5(i){let e=await yC(i);return SC(e)}o(g5,"readPackage");EC.exports={read:yC,parse:SC,readPackage:g5}});var bC=d((Qde,_C)=>{function y5(i){let{name:e,version:t,private:r,description:s,keywords:n,homepage:a,bugs:c,repository:u,funding:l,license:h,author:f,maintainers:p,contributors:m,type:y,imports:g,exports:S,main:E,browser:_,types:b,bin:w,man:I,directories:v,files:N,workspaces:P,scripts:$,config:ee,dependencies:ti,devDependencies:ss,peerDependencies:oa,peerDependenciesMeta:Mu,optionalDependencies:Bu,bundledDependencies:ku,bundleDependencies:Fu,engines:Uu,os:ju,cpu:aa,publishConfig:ca,devEngines:ua,licenses:la,overrides:LI,...Lj}=i;return{...typeof e<"u"?{name:e}:{},...typeof t<"u"?{version:t}:{},...typeof r<"u"?{private:r}:{},...typeof s<"u"?{description:s}:{},...typeof n<"u"?{keywords:n}:{},...typeof a<"u"?{homepage:a}:{},...typeof c<"u"?{bugs:c}:{},...typeof u<"u"?{repository:u}:{},...typeof l<"u"?{funding:l}:{},...typeof h<"u"?{license:h}:{},...typeof f<"u"?{author:f}:{},...typeof p<"u"?{maintainers:p}:{},...typeof m<"u"?{contributors:m}:{},...typeof y<"u"?{type:y}:{},...typeof g<"u"?{imports:g}:{},...typeof S<"u"?{exports:S}:{},...typeof E<"u"?{main:E}:{},...typeof _<"u"?{browser:_}:{},...typeof b<"u"?{types:b}:{},...typeof w<"u"?{bin:w}:{},...typeof I<"u"?{man:I}:{},...typeof v<"u"?{directories:v}:{},...typeof N<"u"?{files:N}:{},...typeof P<"u"?{workspaces:P}:{},...typeof $<"u"?{scripts:$}:{},...typeof ee<"u"?{config:ee}:{},...typeof ti<"u"?{dependencies:ti}:{},...typeof ss<"u"?{devDependencies:ss}:{},...typeof oa<"u"?{peerDependencies:oa}:{},...typeof Mu<"u"?{peerDependenciesMeta:Mu}:{},...typeof Bu<"u"?{optionalDependencies:Bu}:{},...typeof ku<"u"?{bundledDependencies:ku}:{},...typeof Fu<"u"?{bundleDependencies:Fu}:{},...typeof Uu<"u"?{engines:Uu}:{},...typeof ju<"u"?{os:ju}:{},...typeof aa<"u"?{cpu:aa}:{},...typeof ca<"u"?{publishConfig:ca}:{},...typeof ua<"u"?{devEngines:ua}:{},...typeof la<"u"?{licenses:la}:{},...typeof LI<"u"?{overrides:LI}:{},...Lj}}o(y5,"packageSort");_C.exports={packageSort:y5}});var Yl=d((tpe,vC)=>{var{readFile:S5,writeFile:E5}=require("node:fs/promises"),{resolve:IC}=require("node:path"),w5=bm(),OC=$I(),_5=VI(),b5=HI(),{normalize:fy,syncNormalize:I5}=gC(),{read:O5,parse:v5}=wC(),{packageSort:R5}=bC(),A5=new Set([OC,_5,b5]),T5=new Set([...OC.knownKeys,"scripts","workspaces"]),dy=class i{static{o(this,"PackageJson")}static fixSteps=Object.freeze(["binRefs","bundleDependencies","fixName","fixVersionField","fixRepositoryField","fixDependencies","devDependencies","scriptpath"]);static normalizeSteps=Object.freeze(["_id","_attributes","bundledDependencies","bundleDependencies","optionalDedupe","scripts","funding","bin","binDir"]);static prepareSteps=Object.freeze(["_id","_attributes","bundledDependencies","bundleDependencies","bundleDependenciesDeleteFalse","gypfile","serverjs","scriptpath","authors","readme","mans","binDir","gitHead","fillTypes","normalizeData","binRefs"]);static async create(e,t={}){let r=new i;return await r.create(e),t.data?r.update(t.data):r}static async load(e,t={}){let r=new i;if(!t.create)return r.load(e);try{return await r.load(e)}catch(s){if(!s.message.startsWith("Could not read package.json"))throw s;return await r.create(e)}}static async fix(e,t){let r=new i;return await r.load(e,!0),r.fix(t)}static async prepare(e,t){let r=new i;return await r.load(e,!0),r.prepare(t)}static async normalize(e,t){let r=new i;return await r.load(e),r.normalize(t)}#e;#t;#i="";#r=!0;async load(e,t){this.#e=e;let r;try{this.#i=await O5(this.filename)}catch(s){if(!t)throw s;r=s}if(r){let s=IC(this.path,"index.js"),n;try{n=await S5(s,"utf8")}catch{throw r}try{this.fromComment(n)}catch{throw r}return this.#r=!1,this}return this.fromJSON(this.#i)}fromJSON(e){return this.#t=v5(e),this}fromContent(e){if(!e||typeof e!="object")throw new Error("Content data must be an object");return this.#t=e,this.#r=!1,this}fromComment(e){if(e=e.split(/^\/\*\*package(?:\s|$)/m),e.length<2)throw new Error("File has no package in comments");if(e=e[1],e=e.split(/\*\*\/$/m),e.length<2)throw new Error("File has no package in comments");return e=e[0],e=e.replace(/^\s*\*/mg,""),this.#t=w5(e),this}get content(){return this.#t}get path(){return this.#e}get filename(){if(this.path)return IC(this.path,"package.json")}create(e){return this.#e=e,this.#t={},this}update(e){if(!this.content)throw new Error("Can not update without content. Please `load` or `create`");for(let t of A5)this.#t=t({content:e,originalContent:this.content});for(let[t,r]of Object.entries(e))T5.has(t)||(this.content[t]=r);return this}async save({sort:e}={}){if(!this.#r)throw new Error("No package.json to save to");let{[Symbol.for("indent")]:t,[Symbol.for("newline")]:r,...s}=this.content,n=t===void 0?" ":t,a=r===void 0?`
|
|
17
|
+
`:r,c=e?R5(s):s,u=`${JSON.stringify(c,null,n)}
|
|
18
|
+
`.replace(/\n/g,a);if(u.trim()!==this.#i.trim()){let l=await E5(this.filename,u);return this.#i=u,l}}syncNormalize(e={}){return e.steps=this.constructor.normalizeSteps.filter(t=>t!=="_attributes"),I5(this,e),this}async normalize(e={}){return e.steps||(e.steps=this.constructor.normalizeSteps),await fy(this,e),this}async prepare(e={}){return e.steps||(e.steps=this.constructor.prepareSteps),await fy(this,e),this}async fix(e={}){return e.steps=this.constructor.fixSteps,await fy(this,e),this}};vC.exports=dy});var yy=d((rpe,gy)=>{var{Minipass:RC}=te(),wn=Symbol("_data"),_n=Symbol("_length"),py=class extends RC{static{o(this,"Collect")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,r&&r(),!0}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return super.write(s),super.end(r)}};gy.exports=py;var my=class extends RC{static{o(this,"CollectPassThrough")}constructor(e){super(e),this[wn]=[],this[_n]=0}write(e,t,r){typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=Buffer.isBuffer(e)?e:Buffer.from(e,t);return this[wn].push(s),this[_n]+=s.length,super.write(e,t,r)}end(e,t,r){typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t);let s=Buffer.concat(this[wn],this[_n]);return this.emit("collect",s),super.end(r)}};gy.exports.PassThrough=my});var rh=d((npe,MC)=>{"use strict";var AC=typeof process=="object"&&process?process:{stdout:null,stderr:null},C5=require("events"),TC=require("stream"),CC=require("string_decoder").StringDecoder,ji=Symbol("EOF"),$i=Symbol("maybeEmitEnd"),Er=Symbol("emittedEnd"),Xl=Symbol("emittingEnd"),Ka=Symbol("emittedError"),Ql=Symbol("closed"),NC=Symbol("read"),eh=Symbol("flush"),PC=Symbol("flushChunk"),Ye=Symbol("encoding"),qi=Symbol("decoder"),th=Symbol("flowing"),Za=Symbol("paused"),bn=Symbol("resume"),Te=Symbol("bufferLength"),Sy=Symbol("bufferPush"),Ey=Symbol("bufferShift"),Le=Symbol("objectMode"),Me=Symbol("destroyed"),wy=Symbol("emitData"),DC=Symbol("emitEnd"),_y=Symbol("emitEnd2"),Vi=Symbol("async"),Ya=o(i=>Promise.resolve().then(i),"defer"),xC=global._MP_NO_ITERATOR_SYMBOLS_!=="1",N5=xC&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),P5=xC&&Symbol.iterator||Symbol("iterator not implemented"),D5=o(i=>i==="end"||i==="finish"||i==="prefinish","isEndish"),x5=o(i=>i instanceof ArrayBuffer||typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,"isArrayBuffer"),L5=o(i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),"isArrayBufferView"),ih=class{static{o(this,"Pipe")}constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[bn](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},by=class extends ih{static{o(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}};MC.exports=class LC extends TC{static{o(this,"Minipass")}constructor(e){super(),this[th]=!1,this[Za]=!1,this.pipes=[],this.buffer=[],this[Le]=e&&e.objectMode||!1,this[Le]?this[Ye]=null:this[Ye]=e&&e.encoding||null,this[Ye]==="buffer"&&(this[Ye]=null),this[Vi]=e&&!!e.async||!1,this[qi]=this[Ye]?new CC(this[Ye]):null,this[ji]=!1,this[Er]=!1,this[Xl]=!1,this[Ql]=!1,this[Ka]=null,this.writable=!0,this.readable=!0,this[Te]=0,this[Me]=!1}get bufferLength(){return this[Te]}get encoding(){return this[Ye]}set encoding(e){if(this[Le])throw new Error("cannot set encoding in objectMode");if(this[Ye]&&e!==this[Ye]&&(this[qi]&&this[qi].lastNeed||this[Te]))throw new Error("cannot change encoding");this[Ye]!==e&&(this[qi]=e?new CC(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[qi].write(t)))),this[Ye]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Le]}set objectMode(e){this[Le]=this[Le]||!!e}get async(){return this[Vi]}set async(e){this[Vi]=this[Vi]||!!e}write(e,t,r){if(this[ji])throw new Error("write after end");if(this[Me])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let s=this[Vi]?Ya:n=>n();return!this[Le]&&!Buffer.isBuffer(e)&&(L5(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):x5(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Le]?(this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):e.length?(typeof e=="string"&&!(t===this[Ye]&&!this[qi].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Ye]&&(e=this[qi].write(e)),this.flowing&&this[Te]!==0&&this[eh](!0),this.flowing?this.emit("data",e):this[Sy](e),this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing):(this[Te]!==0&&this.emit("readable"),r&&s(r),this.flowing)}read(e){if(this[Me])return null;if(this[Te]===0||e===0||e>this[Te])return this[$i](),null;this[Le]&&(e=null),this.buffer.length>1&&!this[Le]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[Te])]);let t=this[NC](e||null,this.buffer[0]);return this[$i](),t}[NC](e,t){return e===t.length||e===null?this[Ey]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[Te]-=e),this.emit("data",t),!this.buffer.length&&!this[ji]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=null),typeof t=="function"&&(r=t,t="utf8"),e&&this.write(e,t),r&&this.once("end",r),this[ji]=!0,this.writable=!1,(this.flowing||!this[Za])&&this[$i](),this}[bn](){this[Me]||(this[Za]=!1,this[th]=!0,this.emit("resume"),this.buffer.length?this[eh]():this[ji]?this[$i]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[th]=!1,this[Za]=!0}get destroyed(){return this[Me]}get flowing(){return this[th]}get paused(){return this[Za]}[Sy](e){this[Le]?this[Te]+=1:this[Te]+=e.length,this.buffer.push(e)}[Ey](){return this.buffer.length&&(this[Le]?this[Te]-=1:this[Te]-=this.buffer[0].length),this.buffer.shift()}[eh](e){do;while(this[PC](this[Ey]()));!e&&!this.buffer.length&&!this[ji]&&this.emit("drain")}[PC](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[Me])return;let r=this[Er];return t=t||{},e===AC.stdout||e===AC.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this.pipes.push(t.proxyErrors?new by(this,e,t):new ih(this,e,t)),this[Vi]?Ya(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this.pipes.find(r=>r.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[bn]():e==="readable"&&this[Te]!==0?super.emit("readable"):D5(e)&&this[Er]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Ka]&&(this[Vi]?Ya(()=>t.call(this,this[Ka])):t.call(this,this[Ka])),r}get emittedEnd(){return this[Er]}[$i](){!this[Xl]&&!this[Er]&&!this[Me]&&this.buffer.length===0&&this[ji]&&(this[Xl]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ql]&&this.emit("close"),this[Xl]=!1)}emit(e,t,...r){if(e!=="error"&&e!=="close"&&e!==Me&&this[Me])return;if(e==="data")return t?this[Vi]?Ya(()=>this[wy](t)):this[wy](t):!1;if(e==="end")return this[DC]();if(e==="close"){if(this[Ql]=!0,!this[Er]&&!this[Me])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ka]=t;let n=super.emit("error",t);return this[$i](),n}else if(e==="resume"){let n=super.emit("resume");return this[$i](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,t,...r);return this[$i](),s}[wy](e){for(let r of this.pipes)r.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[$i](),t}[DC](){this[Er]||(this[Er]=!0,this.readable=!1,this[Vi]?Ya(()=>this[_y]()):this[_y]())}[_y](){if(this[qi]){let t=this[qi].end();if(t){for(let r of this.pipes)r.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Le]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[Le]||(e.dataLength+=r.length)}),t.then(()=>e)}concat(){return this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Le]?Promise.reject(new Error("cannot concat in objectMode")):this[Ye]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(Me,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[N5](){return{next:o(()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ji])return Promise.resolve({done:!0});let r=null,s=null,n=o(l=>{this.removeListener("data",a),this.removeListener("end",c),s(l)},"onerr"),a=o(l=>{this.removeListener("error",n),this.removeListener("end",c),this.pause(),r({value:l,done:!!this[ji]})},"ondata"),c=o(()=>{this.removeListener("error",n),this.removeListener("data",a),r({done:!0})},"onend"),u=o(()=>n(new Error("stream destroyed")),"ondestroy");return new Promise((l,h)=>{s=h,r=l,this.once(Me,u),this.once("error",n),this.once("end",c),this.once("data",a)})},"next")}}[P5](){return{next:o(()=>{let t=this.read();return{value:t,done:t===null}},"next")}}destroy(e){return this[Me]?(e?this.emit("error",e):this.emit(Me),this):(this[Me]=!0,this.buffer.length=0,this[Te]=0,typeof this.close=="function"&&!this[Ql]&&this.close(),e?this.emit("error",e):this.emit(Me),this)}static isStream(e){return!!e&&(e instanceof LC||e instanceof TC||e instanceof C5&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var In=d((ape,UC)=>{var M5=rh(),B5=require("events"),k5=o(i=>i&&i instanceof B5&&(typeof i.pipe=="function"||typeof i.write=="function"&&typeof i.end=="function"),"isStream"),ms=Symbol("_head"),ut=Symbol("_tail"),Iy=Symbol("_linkStreams"),Oy=Symbol("_setHead"),vy=Symbol("_setTail"),BC=Symbol("_onError"),kC=Symbol("_onData"),Ry=Symbol("_onEnd"),FC=Symbol("_onDrain"),sh=Symbol("_streams"),Ay=class extends M5{static{o(this,"Pipeline")}constructor(e,...t){k5(e)&&(t.unshift(e),e={}),super(e),this[sh]=[],t.length&&this.push(...t)}[Iy](e){return e.reduce((t,r)=>(t.on("error",s=>r.emit("error",s)),t.pipe(r),r))}push(...e){this[sh].push(...e),this[ut]&&e.unshift(this[ut]);let t=this[Iy](e);this[vy](t),this[ms]||this[Oy](e[0])}unshift(...e){this[sh].unshift(...e),this[ms]&&e.push(this[ms]);let t=this[Iy](e);this[Oy](e[0]),this[ut]||this[vy](t)}destroy(e){return this[sh].forEach(t=>typeof t.destroy=="function"&&t.destroy()),super.destroy(e)}[vy](e){this[ut]=e,e.on("error",t=>this[BC](e,t)),e.on("data",t=>this[kC](e,t)),e.on("end",()=>this[Ry](e)),e.on("finish",()=>this[Ry](e))}[BC](e,t){e===this[ut]&&this.emit("error",t)}[kC](e,t){e===this[ut]&&super.write(t)}[Ry](e){e===this[ut]&&super.end()}pause(){return super.pause(),this[ut]&&this[ut].pause&&this[ut].pause()}emit(e,...t){return e==="resume"&&this[ut]&&this[ut].resume&&this[ut].resume(),super.emit(e,...t)}[Oy](e){this[ms]=e,e.on("drain",()=>this[FC](e))}[FC](e){e===this[ms]&&this.emit("drain")}write(e,t,r){return this[ms].write(e,t,r)&&(this.flowing||this.buffer.length===0)}end(e,t,r){return this[ms].end(e,t,r),this}};UC.exports=Ay});var ai=d((upe,oi)=>{"use strict";var Qa=require("crypto"),{Minipass:F5}=te(),Cy=["sha512","sha384","sha256"],Py=["sha512"],U5=/^[a-z0-9+/]+(?:=?=?)$/i,j5=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,$5=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,q5=/^[\x21-\x7E]+$/,ec=o(i=>i?.length?`?${i.join("?")}`:"","getOptString"),Ny=class extends F5{static{o(this,"IntegrityStream")}#e;#t;#i;constructor(e){super(),this.size=0,this.opts=e,this.#r(),e?.algorithms?this.algorithms=[...e.algorithms]:this.algorithms=[...Py],this.algorithm!==null&&!this.algorithms.includes(this.algorithm)&&this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(Qa.createHash)}#r(){this.sri=this.opts?.integrity?lt(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=ec(this.opts?.options)}on(e,t){return e==="size"&&this.#t?t(this.#t):e==="integrity"&&this.#e?t(this.#e):e==="verified"&&this.#i?t(this.#i):super.on(e,t)}emit(e,t){return e==="end"&&this.#s(),super.emit(e,t)}write(e){return this.size+=e.length,this.hashes.forEach(t=>t.update(e)),super.write(e)}#s(){this.goodSri||this.#r();let e=lt(this.hashes.map((r,s)=>`${this.algorithms[s]}-${r.digest("base64")}${this.optString}`).join(" "),this.opts),t=this.goodSri&&e.match(this.sri,this.opts);if(typeof this.expectedSize=="number"&&this.size!==this.expectedSize){let r=new Error(`stream size mismatch when checking ${this.sri}.
|
|
18
19
|
Wanted: ${this.expectedSize}
|
|
19
|
-
Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#i=t,this.emit("verified",t))}},
|
|
20
|
+
Found: ${this.size}`);r.code="EBADSIZE",r.found=this.size,r.expected=this.expectedSize,r.sri=this.sri,this.emit("error",r)}else if(this.sri&&!t){let r=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);r.code="EINTEGRITY",r.found=e,r.expected=this.digests,r.algorithm=this.algorithm,r.sri=this.sri,this.emit("error",r)}else this.#t=this.size,this.emit("size",this.size),this.#e=e,this.emit("integrity",e),t&&(this.#i=t,this.emit("verified",t))}},zi=class{static{o(this,"Hash")}get isHash(){return!0}constructor(e,t){let r=t?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let s=this.source.match(r?$5:j5);if(!s||r&&!Cy.includes(s[1]))return;this.algorithm=s[1],this.digest=s[2];let n=s[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(e,t){let r=lt(e,t);if(!r)return!1;if(r.isIntegrity){let s=r.pickAlgorithm(t,[this.algorithm]);if(!s)return!1;let n=r[s].find(a=>a.digest===this.digest);return n||!1}return r.digest===this.digest?r:!1}toString(e){return e?.strict&&!(Cy.includes(this.algorithm)&&this.digest.match(U5)&&this.options.every(t=>t.match(q5)))?"":`${this.algorithm}-${this.digest}${ec(this.options)}`}};function jC(i,e,t,r){let s=i!=="",n=!1,a="",c=r.length-1;for(let l=0;l<c;l++){let h=zi.prototype.toString.call(r[l],t);h&&(n=!0,a+=h,a+=e)}let u=zi.prototype.toString.call(r[c],t);return u&&(n=!0,a+=u),s&&n?i+e+a:i+a}o(jC,"integrityHashToString");var gs=class{static{o(this,"Integrity")}get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let t=e?.sep||" ",r="";if(e?.strict){t=t.replace(/\S+/g," ");for(let s of Cy)this[s]&&(r=jC(r,t,e,this[s]))}else for(let s of Object.keys(this))r=jC(r,t,e,this[s]);return r}concat(e,t){let r=typeof e=="string"?e:Xa(e,t);return lt(`${this.toString(t)} ${r}`,t)}hexDigest(){return lt(this,{single:!0}).hexDigest()}merge(e,t){let r=lt(e,t);for(let s in r)if(this[s]){if(!this[s].find(n=>r[s].find(a=>n.digest===a.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[s]=r[s]}match(e,t){let r=lt(e,t);if(!r)return!1;let s=r.pickAlgorithm(t,Object.keys(this));return!!s&&this[s]&&r[s]&&this[s].find(n=>r[s].find(a=>n.digest===a.digest))||!1}pickAlgorithm(e,t){let r=e?.pickAlgorithm||Z5,s=Object.keys(this).filter(n=>t?.length?t.includes(n):!0);return s.length?s.reduce((n,a)=>r(n,a)||n):null}};oi.exports.parse=lt;function lt(i,e){if(!i)return null;if(typeof i=="string")return Ty(i,e);if(i.algorithm&&i.digest){let t=new gs;return t[i.algorithm]=[i],Ty(Xa(t,e),e)}else return Ty(Xa(i,e),e)}o(lt,"parse");function Ty(i,e){if(e?.single)return new zi(i,e);let t=i.trim().split(/\s+/).reduce((r,s)=>{let n=new zi(s,e);if(n.algorithm&&n.digest){let a=n.algorithm;r[a]||(r[a]=[]),r[a].push(n)}return r},new gs);return t.isEmpty()?null:t}o(Ty,"_parse");oi.exports.stringify=Xa;function Xa(i,e){return i.algorithm&&i.digest?zi.prototype.toString.call(i,e):typeof i=="string"?Xa(lt(i,e),e):gs.prototype.toString.call(i,e)}o(Xa,"stringify");oi.exports.fromHex=V5;function V5(i,e,t){let r=ec(t?.options);return lt(`${e}-${Buffer.from(i,"hex").toString("base64")}${r}`,t)}o(V5,"fromHex");oi.exports.fromData=z5;function z5(i,e){let t=e?.algorithms||[...Py],r=ec(e?.options);return t.reduce((s,n)=>{let a=Qa.createHash(n).update(i).digest("base64"),c=new zi(`${n}-${a}${r}`,e);if(c.algorithm&&c.digest){let u=c.algorithm;s[u]||(s[u]=[]),s[u].push(c)}return s},new gs)}o(z5,"fromData");oi.exports.fromStream=H5;function H5(i,e){let t=Dy(e);return new Promise((r,s)=>{i.pipe(t),i.on("error",s),t.on("error",s);let n;t.on("integrity",a=>{n=a}),t.on("end",()=>r(n)),t.resume()})}o(H5,"fromStream");oi.exports.checkData=G5;function G5(i,e,t){if(e=lt(e,t),!e||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let r=e.pickAlgorithm(t),s=Qa.createHash(r).update(i).digest("base64"),n=lt({algorithm:r,digest:s}),a=n.match(e,t);if(t=t||{},a||!t.error)return a;if(typeof t.size=="number"&&i.length!==t.size){let c=new Error(`data size mismatch when checking ${e}.
|
|
20
21
|
Wanted: ${t.size}
|
|
21
|
-
Found: ${i.length}`);throw c.code="EBADSIZE",c.found=i.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${i.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(g5,"checkData");li.exports.checkStream=y5;function y5(i,e,t){if(t=t||Object.create(null),t.integrity=e,e=dt(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=zy(t);return new Promise((s,n)=>{i.pipe(r),i.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>s(a)),r.resume()})}o(y5,"checkStream");li.exports.integrityStream=zy;function zy(i=Object.create(null)){return new qy(i)}o(zy,"integrityStream");li.exports.create=S5;function S5(i){let e=i?.algorithms||[...Vy],t=uc(i?.options),r=e.map(cc.createHash);return{update:o(function(s,n){return r.forEach(a=>a.update(s,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),u=new Ji(`${a}-${c}${t}`,i);if(u.algorithm&&u.digest){let l=u.algorithm;n[l]||(n[l]=[]),n[l].push(u)}return n},new _s)},"digest")}}o(S5,"createIntegrity");var E5=cc.getHashes(),r1=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(i=>E5.includes(i));function w5(i,e){return r1.indexOf(i.toLowerCase())>=r1.indexOf(e.toLowerCase())?i:e}o(w5,"getPrioritizedHash")});var s1=d((rme,Hy)=>{(function(){var i;function e(t,r){var s=this instanceof e?this:i;if(s.reset(r),typeof t=="string"&&t.length>0&&s.hash(t),s!==this)return s}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,s,n,a,c;switch(c=t.length,this.len+=c,s=this.k1,n=0,this.rem){case 0:s^=c>n?t.charCodeAt(n++)&65535:0;case 1:s^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:s^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:s^=c>n?(t.charCodeAt(n)&255)<<24:0,s^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,r^=s,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)s=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),s^=(a&255)<<24^(a&65280)>>8;switch(s=0,this.rem){case 3:s^=(t.charCodeAt(n+2)&65535)<<16;case 2:s^=(t.charCodeAt(n+1)&65535)<<8;case 1:s^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=s,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},i=new e,typeof Hy<"u"?Hy.exports=e:this.MurmurHash3=e})()});var o1=d((nme,n1)=>{"use strict";var _5=s1();n1.exports=function(i){if(i){var e=new _5(i);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var Gy=d((ome,a1)=>{var b5=require("path"),I5=o1();a1.exports=function(i,e,t){return b5.join(i,(e?e+"-":"")+I5(t))}});var Wy=d((ame,O5)=>{O5.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var Jy=d((cme,c1)=>{"use strict";c1.exports=v5;function v5(i){return[i.slice(0,2),i.slice(2,4),i.slice(4)]}o(v5,"hashToSegments")});var Nn=d((lme,Ky)=>{"use strict";var C5=Wy()["cache-version"].content,R5=Jy(),u1=require("path"),A5=hi();Ky.exports=T5;function T5(i,e){let t=A5.parse(e,{single:!0});return u1.join(l1(i),t.algorithm,...R5(t.hexDigest()))}o(T5,"contentPath");Ky.exports.contentDir=l1;function l1(i){return u1.join(i,`content-v${C5}`)}o(l1,"contentDir")});var Zy=d((fme,h1)=>{var N5=o((i,{copy:e,wrap:t})=>{let r={};if(i&&typeof i=="object")for(let s of e)i[s]!==void 0&&(r[s]=i[s]);else r[t]=i;return r},"getOptions");h1.exports=N5});var d1=d((pme,f1)=>{var P5=Ss(),D5=o(i=>P5.satisfies(process.version,i,{includePrerelease:!0}),"satisfies");f1.exports={satisfies:D5}});var p1=d((Sme,Xy)=>{"use strict";var{inspect:x5}=require("util"),Yy=class{static{o(this,"SystemError")}constructor(e,t,r){let s=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(s+=` ${r.path}`),r.dest!==void 0&&(s+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:s,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return x5(this,{...t,getters:!0,customInspect:!1})}};function Ki(i,e){Xy.exports[i]=class extends Yy{static{o(this,"NodeError")}constructor(r){super(i,e,r)}}}o(Ki,"E");Ki("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");Ki("ERR_FS_CP_EEXIST","Target already exists");Ki("ERR_FS_CP_EINVAL","Invalid src or dest");Ki("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");Ki("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");Ki("ERR_FS_CP_SOCKET","Cannot copy a socket file");Ki("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");Ki("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");Ki("ERR_FS_EISDIR","Path is a directory");Xy.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var x1=d((wme,D1)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:L5,ERR_FS_CP_EEXIST:M5,ERR_FS_CP_EINVAL:dh,ERR_FS_CP_FIFO_PIPE:B5,ERR_FS_CP_NON_DIR_TO_DIR:k5,ERR_FS_CP_SOCKET:F5,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:U5,ERR_FS_CP_UNKNOWN:j5,ERR_FS_EISDIR:$5,ERR_INVALID_ARG_TYPE:q5}=p1(),{constants:{errno:{EEXIST:V5,EISDIR:z5,EINVAL:Zi,ENOTDIR:H5}}}=require("os"),{chmod:G5,copyFile:W5,lstat:I1,mkdir:O1,readdir:J5,readlink:m1,stat:Pn,symlink:Qy,unlink:v1,utimes:K5}=require("fs/promises"),{dirname:lc,isAbsolute:g1,join:y1,parse:Z5,resolve:hc,sep:Y5,toNamespacedPath:S1}=require("path"),{fileURLToPath:X5}=require("url"),Q5={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function e4(i,e,t){if(t!=null&&typeof t!="object")throw new q5("options",["Object"],t);return t4(S1(E1(i)),S1(E1(e)),{...Q5,...t})}o(e4,"cp");function E1(i){return i!=null&&i.href&&i.origin?X5(i):i}o(E1,"getValidatedPath");async function t4(i,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await C1(i,e,t),{srcStat:s,destStat:n}=r;return await A1(i,s,e),t.filter?T1(w1,n,i,e,t):w1(n,i,e,t)}o(t4,"cpFn");async function C1(i,e,t){let{0:r,1:s}=await i4(i,e,t);if(s){if(R1(r,s))throw new dh({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:Zi});if(r.isDirectory()&&!s.isDirectory())throw new L5({message:`cannot overwrite directory ${i} with non-directory ${e}`,path:e,syscall:"cp",errno:z5});if(!r.isDirectory()&&s.isDirectory())throw new k5({message:`cannot overwrite non-directory ${i} with directory ${e}`,path:e,syscall:"cp",errno:H5})}if(r.isDirectory()&&eS(i,e))throw new dh({message:`cannot copy ${i} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:Zi});return{srcStat:r,destStat:s}}o(C1,"checkPaths");function R1(i,e){return e.ino&&e.dev&&e.ino===i.ino&&e.dev===i.dev}o(R1,"areIdentical");function i4(i,e,t){let r=t.dereference?s=>Pn(s,{bigint:!0}):s=>I1(s,{bigint:!0});return Promise.all([r(i),r(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})])}o(i4,"getStats");async function w1(i,e,t,r){let s=lc(t);return await r4(s)||await O1(s,{recursive:!0}),ph(i,e,t,r)}o(w1,"checkParentDir");function r4(i){return Pn(i).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(r4,"pathExists");async function A1(i,e,t){let r=hc(lc(i)),s=hc(lc(t));if(s===r||s===Z5(s).root)return;let n;try{n=await Pn(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(R1(e,n))throw new dh({message:`cannot copy ${i} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:Zi});return A1(i,e,s)}o(A1,"checkParentPaths");var _1=o(i=>hc(i).split(Y5).filter(Boolean),"normalizePathToArray");function eS(i,e){let t=_1(i),r=_1(e);return t.every((s,n)=>r[n]===s)}o(eS,"isSrcSubdir");async function T1(i,e,t,r,s,n){if(await s.filter(t,r))return i(e,t,r,s,n)}o(T1,"handleFilter");function s4(i,e,t,r){return r.filter?T1(ph,i,e,t,r):ph(i,e,t,r)}o(s4,"startCopy");async function ph(i,e,t,r){let n=await(r.dereference?Pn:I1)(e);if(n.isDirectory()&&r.recursive)return h4(n,i,e,t,r);if(n.isDirectory())throw new $5({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:Zi});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return n4(n,i,e,t,r);if(n.isSymbolicLink())return d4(i,e,t);throw n.isSocket()?new F5({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:Zi}):n.isFIFO()?new B5({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:Zi}):new j5({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:Zi})}o(ph,"getStatsForCopy");function n4(i,e,t,r,s){return e?o4(i,t,r,s):N1(i,t,r,s)}o(n4,"onFile");async function o4(i,e,t,r){if(r.force)return await v1(t),N1(i,e,t,r);if(r.errorOnExist)throw new M5({message:`${t} already exists`,path:t,syscall:"cp",errno:V5})}o(o4,"mayCopyFile");async function N1(i,e,t,r){return await W5(e,t),r.preserveTimestamps?a4(i.mode,e,t):mh(t,i.mode)}o(N1,"_copyFile");async function a4(i,e,t){return c4(i)&&await u4(t,i),b1(i,e,t)}o(a4,"handleTimestampsAndMode");function c4(i){return(i&128)===0}o(c4,"fileIsNotWritable");function u4(i,e){return mh(i,e|128)}o(u4,"makeFileWritable");async function b1(i,e,t){return await l4(e,t),mh(t,i)}o(b1,"setDestTimestampsAndMode");function mh(i,e){return G5(i,e)}o(mh,"setDestMode");async function l4(i,e){let t=await Pn(i);return K5(e,t.atime,t.mtime)}o(l4,"setDestTimestamps");function h4(i,e,t,r,s){return e?P1(t,r,s):f4(i.mode,t,r,s)}o(h4,"onDir");async function f4(i,e,t,r){return await O1(t),await P1(e,t,r),mh(t,i)}o(f4,"mkDirAndCopy");async function P1(i,e,t){let r=await J5(i);for(let s=0;s<r.length;s++){let n=r[s],a=y1(i,n),c=y1(e,n),{destStat:u}=await C1(a,c,t);await s4(u,a,c,t)}}o(P1,"copyDir");async function d4(i,e,t){let r=await m1(e);if(g1(r)||(r=hc(lc(e),r)),!i)return Qy(r,t);let s;try{s=await m1(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return Qy(r,t);throw a}if(g1(s)||(s=hc(lc(t),s)),eS(r,s))throw new dh({message:`cannot copy ${r} to a subdirectory of self ${s}`,path:t,syscall:"cp",errno:Zi});if((await Pn(e)).isDirectory()&&eS(s,r))throw new U5({message:`cannot overwrite ${s} with ${r}`,path:t,syscall:"cp",errno:Zi});return p4(r,t)}o(d4,"onLink");async function p4(i,e){return await v1(e),Qy(i,e)}o(p4,"copyLink");D1.exports=e4});var M1=d((bme,L1)=>{var m4=require("fs/promises"),g4=Zy(),y4=d1(),S4=x1(),E4=y4.satisfies(">=16.7.0"),w4=o(async(i,e,t)=>{let r=g4(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return E4?m4.cp(i,e,r):S4(i,e,r)},"cp");L1.exports=w4});var k1=d((Ome,B1)=>{var{join:_4,sep:b4}=require("path"),I4=Zy(),{mkdir:O4,mkdtemp:v4,rm:C4}=require("fs/promises"),R4=o(async(i,e,t)=>{let r=I4(t,{copy:["tmpPrefix"]});await O4(i,{recursive:!0});let s=await v4(_4(`${i}${b4}`,r.tmpPrefix||"")),n,a;try{a=await e(s)}catch(c){n=c}try{await C4(s,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");B1.exports=R4});var $1=d((Cme,j1)=>{var{readdir:F1}=require("fs/promises"),{join:U1}=require("path"),A4=o(async i=>{let e=[];for(let t of await F1(i))if(t.startsWith("@"))for(let r of await F1(U1(i,t)))e.push(U1(t,r));else e.push(t);return e},"readdirScoped");j1.exports=A4});var W1=d((Ame,G1)=>{var{dirname:q1,join:V1,resolve:z1,relative:T4,isAbsolute:N4}=require("path"),fi=require("fs/promises"),P4=o(async i=>{try{return await fi.access(i),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),H1=o(async(i,e,t={},r=!0,s=[])=>{if(!i||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await P4(e))throw new Error(`The destination file exists: ${e}`);await fi.mkdir(q1(e),{recursive:!0});try{await fi.rename(i,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await fi.lstat(i);if(a.isDirectory()){let c=await fi.readdir(i);await Promise.all(c.map(u=>H1(V1(i,u),V1(e,u),t,!1,s)))}else a.isSymbolicLink()?s.push({source:i,destination:e}):await fi.copyFile(i,e)}else throw n}r&&(await Promise.all(s.map(async({source:n,destination:a})=>{let c=await fi.readlink(n);N4(c)&&(c=z1(a,T4(n,c)));let u="file";try{u=await fi.stat(z1(q1(n),c)),u.isDirectory()&&(u="junction")}catch{}await fi.symlink(c,a,u)})),await fi.rm(i,{recursive:!0,force:!0}))},"moveFile");G1.exports=H1});var gh=d((Nme,J1)=>{"use strict";var D4=M1(),x4=k1(),L4=$1(),M4=W1();J1.exports={cp:D4,withTempDir:x4,readdirScoped:L4,moveFile:M4}});var yh={};h2(yh,{default:()=>K1,pMapIterable:()=>B4,pMapSkip:()=>fc});async function K1(i,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:s}={}){return new Promise((n,a)=>{if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],u=[],l=new Map,h=!1,f=!1,p=!1,m=0,y=0,g=i[Symbol.iterator]===void 0?i[Symbol.asyncIterator]():i[Symbol.iterator](),S=o(()=>{b(s.reason)},"signalListener"),E=o(()=>{s?.removeEventListener("abort",S)},"cleanup"),_=o(I=>{n(I),E()},"resolve"),b=o(I=>{h=!0,f=!0,a(I),E()},"reject");s&&(s.aborted&&b(s.reason),s.addEventListener("abort",S,{once:!0}));let w=o(async()=>{if(f)return;let I=await g.next(),v=y;if(y++,I.done){if(p=!0,m===0&&!f){if(!r&&u.length>0){b(new AggregateError(u));return}if(f=!0,l.size===0){_(c);return}let N=[];for(let[P,U]of c.entries())l.get(P)!==fc&&N.push(U);_(N)}return}m++,(async()=>{try{let N=await I.value;if(f)return;let P=await e(N,v);P===fc&&l.set(v,P),c[v]=P,m--,await w()}catch(N){if(r)b(N);else{u.push(N),m--;try{await w()}catch(P){b(P)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await w()}catch(v){b(v);break}if(p||h)break}})()})}function B4(i,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let s=i[Symbol.asyncIterator]===void 0?i[Symbol.iterator]():i[Symbol.asyncIterator](),n=[],a=0,c=!1,u=0;function l(){if(c||!(a<t&&n.length<r))return;let h=(async()=>{let{done:f,value:p}=await s.next();if(f)return{done:!0};a++,l();try{let m=await e(await p,u++);if(a--,m===fc){let y=n.indexOf(h);y>0&&n.splice(y,1)}return l(),{done:!1,value:m}}catch(m){return c=!0,{error:m}}})();n.push(h)}for(o(l,"trySpawn"),l();n.length>0;){let{error:h,done:f,value:p}=await n[0];if(n.shift(),h)throw h;if(f)return;l(),p!==fc&&(yield p)}}}}var fc,Sh=l2(()=>{o(K1,"pMap");o(B4,"pMapIterable");fc=Symbol("skip")});var Dn=d((xme,pt)=>{"use strict";var k4=require("crypto"),{appendFile:F4,mkdir:rS,readFile:U4,readdir:j4,rm:Z1,writeFile:$4}=require("fs/promises"),{Minipass:q4}=te(),di=require("path"),V4=hi(),z4=Gy(),H4=Nn(),G4=Jy(),W4=Wy()["cache-version"].index,{moveFile:J4}=gh(),tS=5;pt.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};pt.exports.compact=K4;async function K4(i,e,t,r={}){let s=dc(i,e),n=await Eh(s),a=[];for(let p=n.length-1;p>=0;--p){let m=n[p];if(m.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(m)===!0)&&(a.length===0||!a.find(y=>t(y,m)))&&a.unshift(m)}let c=`
|
|
22
|
-
`+a.map(p=>{let m=JSON.stringify(p);return`${
|
|
23
|
-
`),u=o(async()=>{let p=
|
|
24
|
-
${
|
|
25
|
-
`).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||wh(r[1])!==r[0])return;let s;try{s=JSON.parse(r[1])}catch{}s&&e.push(s)}),e}o(Q4,"_bucketEntries");pt.exports.bucketDir=sS;function sS(i){return di.join(i,`index-v${W4}`)}o(sS,"bucketDir");pt.exports.bucketPath=dc;function dc(i,e){let t=Q1(e);return di.join.apply(di,[sS(i)].concat(G4(t)))}o(dc,"bucketPath");pt.exports.hashKey=Q1;function Q1(i){return eN(i,"sha256")}o(Q1,"hashKey");pt.exports.hashEntry=wh;function wh(i){return eN(i,"sha1")}o(wh,"hashEntry");function eN(i,e){return k4.createHash(e).update(i).digest("hex")}o(eN,"hash");function _h(i,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?H4(i,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(_h,"formatEntry");function iS(i){return j4(i).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(iS,"readdirOrEmpty")});var pc=d((Mme,xn)=>{"use strict";var{LRUCache:e6}=hs(),bh=new e6({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((i,e)=>e.startsWith("key:")?i.data.length:i.length,"sizeCalculation")});xn.exports.clearMemoized=t6;function t6(){let i={};return bh.forEach((e,t)=>{i[t]=e}),bh.clear(),i}o(t6,"clearMemoized");xn.exports.put=i6;function i6(i,e,t,r){Ih(r).set(`key:${i}:${e.key}`,{entry:e,data:t}),tN(i,e.integrity,t,r)}o(i6,"put");xn.exports.put.byDigest=tN;function tN(i,e,t,r){Ih(r).set(`digest:${i}:${e}`,t)}o(tN,"putDigest");xn.exports.get=r6;function r6(i,e,t){return Ih(t).get(`key:${i}:${e}`)}o(r6,"get");xn.exports.get.byDigest=s6;function s6(i,e,t){return Ih(t).get(`digest:${i}:${e}`)}o(s6,"getDigest");var nS=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function Ih(i){return!i||!i.memoize?bh:i.memoize.get&&i.memoize.set?i.memoize:typeof i.memoize=="object"?new nS(i.memoize):bh}o(Ih,"pickMem")});var jn=d(gc=>{"use strict";var{Minipass:n6}=te(),o6=require("events").EventEmitter,et=require("fs"),a6=et.writev,Fn=Symbol("_autoClose"),Kt=Symbol("_close"),mc=Symbol("_ended"),Z=Symbol("_fd"),iN=Symbol("_finished"),vr=Symbol("_flags"),oS=Symbol("_flush"),cS=Symbol("_handleChunk"),uS=Symbol("_makeBuf"),Ah=Symbol("_mode"),Oh=Symbol("_needDrain"),Bn=Symbol("_onerror"),Un=Symbol("_onopen"),aS=Symbol("_onread"),Ln=Symbol("_onwrite"),Cr=Symbol("_open"),Yi=Symbol("_path"),Is=Symbol("_pos"),pi=Symbol("_queue"),Mn=Symbol("_read"),rN=Symbol("_readSize"),Or=Symbol("_reading"),vh=Symbol("_remain"),sN=Symbol("_size"),Ch=Symbol("_write"),bs=Symbol("_writing"),Rh=Symbol("_defaultFlag"),kn=Symbol("_errored"),Th=class extends n6{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[kn]=!1,this[Z]=typeof t.fd=="number"?t.fd:null,this[Yi]=e,this[rN]=t.readSize||16*1024*1024,this[Or]=!1,this[sN]=typeof t.size=="number"?t.size:1/0,this[vh]=this[sN],this[Fn]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[Z]=="number"?this[Mn]():this[Cr]()}get fd(){return this[Z]}get path(){return this[Yi]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Cr](){et.open(this[Yi],"r",(e,t)=>this[Un](e,t))}[Un](e,t){e?this[Bn](e):(this[Z]=t,this.emit("open",t),this[Mn]())}[uS](){return Buffer.allocUnsafe(Math.min(this[rN],this[vh]))}[Mn](){if(!this[Or]){this[Or]=!0;let e=this[uS]();if(e.length===0)return process.nextTick(()=>this[aS](null,0,e));et.read(this[Z],e,0,e.length,null,(t,r,s)=>this[aS](t,r,s))}}[aS](e,t,r){this[Or]=!1,e?this[Bn](e):this[cS](t,r)&&this[Mn]()}[Kt](){if(this[Fn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,et.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Bn](e){this[Or]=!0,this[Kt](),this.emit("error",e)}[cS](e,t){let r=!1;return this[vh]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[vh]<=0)&&(r=!1,this[Kt](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Z]=="number"&&this[Mn]();break;case"error":return this[kn]?void 0:(this[kn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},lS=class extends Th{static{o(this,"ReadStreamSync")}[Cr](){let e=!0;try{this[Un](null,et.openSync(this[Yi],"r")),e=!1}finally{e&&this[Kt]()}}[Mn](){let e=!0;try{if(!this[Or]){this[Or]=!0;do{let t=this[uS](),r=t.length===0?0:et.readSync(this[Z],t,0,t.length,null);if(!this[cS](r,t))break}while(!0);this[Or]=!1}e=!1}finally{e&&this[Kt]()}}[Kt](){if(this[Fn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,et.closeSync(e),this.emit("close")}}},Nh=class extends o6{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[kn]=!1,this[bs]=!1,this[mc]=!1,this[Oh]=!1,this[pi]=[],this[Yi]=e,this[Z]=typeof t.fd=="number"?t.fd:null,this[Ah]=t.mode===void 0?438:t.mode,this[Is]=typeof t.start=="number"?t.start:null,this[Fn]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Is]!==null?"r+":"w";this[Rh]=t.flags===void 0,this[vr]=this[Rh]?r:t.flags,this[Z]===null&&this[Cr]()}emit(e,t){if(e==="error"){if(this[kn])return;this[kn]=!0}return super.emit(e,t)}get fd(){return this[Z]}get path(){return this[Yi]}[Bn](e){this[Kt](),this[bs]=!0,this.emit("error",e)}[Cr](){et.open(this[Yi],this[vr],this[Ah],(e,t)=>this[Un](e,t))}[Un](e,t){this[Rh]&&this[vr]==="r+"&&e&&e.code==="ENOENT"?(this[vr]="w",this[Cr]()):e?this[Bn](e):(this[Z]=t,this.emit("open",t),this[bs]||this[oS]())}end(e,t){return e&&this.write(e,t),this[mc]=!0,!this[bs]&&!this[pi].length&&typeof this[Z]=="number"&&this[Ln](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[mc]?(this.emit("error",new Error("write() after end()")),!1):this[Z]===null||this[bs]||this[pi].length?(this[pi].push(e),this[Oh]=!0,!1):(this[bs]=!0,this[Ch](e),!0)}[Ch](e){et.write(this[Z],e,0,e.length,this[Is],(t,r)=>this[Ln](t,r))}[Ln](e,t){e?this[Bn](e):(this[Is]!==null&&(this[Is]+=t),this[pi].length?this[oS]():(this[bs]=!1,this[mc]&&!this[iN]?(this[iN]=!0,this[Kt](),this.emit("finish")):this[Oh]&&(this[Oh]=!1,this.emit("drain"))))}[oS](){if(this[pi].length===0)this[mc]&&this[Ln](null,0);else if(this[pi].length===1)this[Ch](this[pi].pop());else{let e=this[pi];this[pi]=[],a6(this[Z],e,this[Is],(t,r)=>this[Ln](t,r))}}[Kt](){if(this[Fn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,et.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},hS=class extends Nh{static{o(this,"WriteStreamSync")}[Cr](){let e;if(this[Rh]&&this[vr]==="r+")try{e=et.openSync(this[Yi],this[vr],this[Ah])}catch(t){if(t.code==="ENOENT")return this[vr]="w",this[Cr]();throw t}else e=et.openSync(this[Yi],this[vr],this[Ah]);this[Un](null,e)}[Kt](){if(this[Fn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,et.closeSync(e),this.emit("close")}}[Ch](e){let t=!0;try{this[Ln](null,et.writeSync(this[Z],e,0,e.length,this[Is])),t=!1}finally{if(t)try{this[Kt]()}catch{}}}};gc.ReadStream=Th;gc.ReadStreamSync=lS;gc.WriteStream=Nh;gc.WriteStreamSync=hS});var dS=d((Ume,$n)=>{"use strict";var yc=require("fs/promises"),c6=jn(),fS=hi(),u6=Nn(),nN=Tn();$n.exports=l6;var oN=64*1024*1024;async function l6(i,e,t={}){let{size:r}=t,{stat:s,cpath:n,sri:a}=await Sc(i,e,async(u,l)=>({stat:r?{size:r}:await yc.stat(u),cpath:u,sri:l}));if(s.size>oN)return aN(n,s.size,a,new nN).concat();let c=await yc.readFile(n,{encoding:null});if(s.size!==c.length)throw d6(s.size,c.length);if(!fS.checkData(c,a))throw p6(a,n);return c}o(l6,"read");var aN=o((i,e,t,r)=>(r.push(new c6.ReadStream(i,{size:e,readSize:oN}),fS.integrityStream({integrity:t,size:e})),r),"readPipeline");$n.exports.stream=cN;$n.exports.readStream=cN;function cN(i,e,t={}){let{size:r}=t,s=new nN;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await Sc(i,e,async(u,l)=>({stat:r?{size:r}:await yc.stat(u),cpath:u,sri:l}));return aN(a,n.size,c,s)}).catch(n=>s.emit("error",n)),s}o(cN,"readStream");$n.exports.copy=h6;function h6(i,e,t){return Sc(i,e,r=>yc.copyFile(r,t))}o(h6,"copy");$n.exports.hasContent=f6;async function f6(i,e){if(!e)return!1;try{return await Sc(i,e,async(t,r)=>{let s=await yc.stat(t);return{size:s.size,sri:r,stat:s}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(f6,"hasContent");async function Sc(i,e,t){let r=fS.parse(e),s=r.pickAlgorithm(),n=r[s];if(n.length<=1){let a=u6(i,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async l=>{try{return await Sc(i,l,t)}catch(h){return h.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):h}})),c=a.find(l=>!(l instanceof Error));if(c)return c;let u=a.find(l=>l.code==="ENOENT");throw u||a.find(l=>l instanceof Error)}}o(Sc,"withContentSri");function d6(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(d6,"sizeError");function p6(i,e){let t=new Error(`Integrity verification failed for ${i} (${e})`);return t.code="EINTEGRITY",t.sri=i,t.path=e,t}o(p6,"integrityError")});var fN=d(($me,Qi)=>{"use strict";var uN=Ty(),{Minipass:lN}=te(),hN=Tn(),Os=Dn(),Xi=pc(),vs=dS();async function m6(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Xi.get(i,e,t);if(a&&s!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Os.find(i,e,t);if(!c)throw new Os.NotFoundError(i,e);let u=await vs(i,c.integrity,{integrity:r,size:n});return s&&Xi.put(i,c,u,t),{data:u,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(m6,"getData");Qi.exports=m6;async function g6(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Xi.get.byDigest(i,e,t);if(a&&s!==!1)return a;let c=await vs(i,e,{integrity:r,size:n});return s&&Xi.put.byDigest(i,e,c,t),c}o(g6,"getDataByDigest");Qi.exports.byDigest=g6;var y6=o(i=>{let e=new lN;return e.on("newListener",function(t,r){t==="metadata"&&r(i.entry.metadata),t==="integrity"&&r(i.entry.integrity),t==="size"&&r(i.entry.size)}),e.end(i.data),e},"getMemoizedStream");function S6(i,e,t={}){let{memoize:r,size:s}=t,n=Xi.get(i,e,t);if(n&&r!==!1)return y6(n);let a=new hN;return Promise.resolve().then(async()=>{let c=await Os.find(i,e);if(!c)throw new Os.NotFoundError(i,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(l,h){l==="metadata"&&h(c.metadata),l==="integrity"&&h(c.integrity),l==="size"&&h(c.size)});let u=vs.readStream(i,c.integrity,{...t,size:typeof s!="number"?c.size:s});if(r){let l=new uN.PassThrough;l.on("collect",h=>Xi.put(i,c,h,t)),a.unshift(l)}return a.unshift(u),a}).catch(c=>a.emit("error",c)),a}o(S6,"getStream");Qi.exports.stream=S6;function E6(i,e,t={}){let{memoize:r}=t,s=Xi.get.byDigest(i,e,t);if(s&&r!==!1){let n=new lN;return n.end(s),n}else{let n=vs.readStream(i,e,t);if(!r)return n;let a=new uN.PassThrough;return a.on("collect",c=>Xi.put.byDigest(i,e,c,t)),new hN(n,a)}}o(E6,"getStreamDigest");Qi.exports.stream.byDigest=E6;function w6(i,e,t={}){let{memoize:r}=t,s=Xi.get(i,e,t);return s&&r!==!1?Promise.resolve(s.entry):Os.find(i,e)}o(w6,"info");Qi.exports.info=w6;async function _6(i,e,t,r={}){let s=await Os.find(i,e,r);if(!s)throw new Os.NotFoundError(i,e);return await vs.copy(i,s.integrity,t,r),{metadata:s.metadata,size:s.size,integrity:s.integrity}}o(_6,"copy");Qi.exports.copy=_6;async function b6(i,e,t,r={}){return await vs.copy(i,e,t,r),e}o(b6,"copyByDigest");Qi.exports.copy.byDigest=b6;Qi.exports.hasContent=vs.hasContent});var Ph=d((Vme,gN)=>{var I6=hh(),dN=Symbol("_flush"),pN=Symbol("_flushed"),mN=Symbol("_flushing"),pS=class extends I6{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[dN]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[pN])return super.emit(e,...t);if(this[mN])return;this[mN]=!0;let r=o(n=>{this[pN]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),s=this[dN](r);s&&s.then&&s.then(()=>r(),n=>r(n))}};gN.exports=pS});var _N=d((Hme,SS)=>{"use strict";var yN=require("events"),O6=Nn(),wc=require("fs/promises"),{moveFile:v6}=gh(),{Minipass:C6}=te(),SN=Tn(),R6=Ph(),mS=require("path"),gS=hi(),A6=Gy(),T6=jn();SS.exports=N6;var Ec=new Map;async function N6(i,e,t={}){let{algorithms:r,size:s,integrity:n}=t;if(typeof s=="number"&&e.length!==s)throw L6(s,e.length);let a=gS.fromData(e,r?{algorithms:r}:{});if(n&&!gS.checkData(e,n,t))throw M6(n,a);for(let c in a){let u=await EN(i,t),l=a[c].toString();try{await wc.writeFile(u.target,e,{flag:"wx"}),await wN(u,i,l,t)}finally{u.moved||await wc.rm(u.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(N6,"write");SS.exports.stream=P6;var yS=class extends R6{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new C6,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=D6(this.inputStream,this.cache,this.opts),this.handleContentP.catch(s=>this.emit("error",s))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function P6(i,e={}){return new yS(i,e)}o(P6,"writeStream");async function D6(i,e,t){let r=await EN(e,t);try{let s=await x6(i,e,r.target,t);return await wN(r,e,s.integrity,t),s}finally{r.moved||await wc.rm(r.target,{recursive:!0,force:!0})}}o(D6,"handleContent");async function x6(i,e,t,r){let s=new T6.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[l,h]=await Promise.all([yN.once(r.integrityEmitter,"integrity").then(f=>f[0]),yN.once(r.integrityEmitter,"size").then(f=>f[0]),new SN(i,s).promise()]);return{integrity:l,size:h}}let n,a,c=gS.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",l=>{n=l}),c.on("size",l=>{a=l}),await new SN(i,c,s).promise(),{integrity:n,size:a}}o(x6,"pipeToTmp");async function EN(i,e){let t=A6(mS.join(i,"tmp"),e.tmpPrefix);return await wc.mkdir(mS.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(EN,"makeTmp");async function wN(i,e,t){let r=O6(e,t),s=mS.dirname(r);return Ec.has(r)||Ec.set(r,wc.mkdir(s,{recursive:!0}).then(async()=>(await v6(i.target,r,{overwrite:!1}),i.moved=!0,i.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{Ec.delete(r)})),Ec.get(r)}o(wN,"moveToDestination");function L6(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(L6,"sizeError");function M6(i,e){let t=new Error(`Integrity check failed:
|
|
22
|
+
Found: ${i.length}`);throw c.code="EBADSIZE",c.found=i.length,c.expected=t.size,c.sri=e,c}else{let c=new Error(`Integrity checksum failed when using ${r}: Wanted ${e}, but got ${n}. (${i.length} bytes)`);throw c.code="EINTEGRITY",c.found=n,c.expected=e,c.algorithm=r,c.sri=e,c}}o(G5,"checkData");oi.exports.checkStream=W5;function W5(i,e,t){if(t=t||Object.create(null),t.integrity=e,e=lt(e,t),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let r=Dy(t);return new Promise((s,n)=>{i.pipe(r),i.on("error",n),r.on("error",n);let a;r.on("verified",c=>{a=c}),r.on("end",()=>s(a)),r.resume()})}o(W5,"checkStream");oi.exports.integrityStream=Dy;function Dy(i=Object.create(null)){return new Ny(i)}o(Dy,"integrityStream");oi.exports.create=J5;function J5(i){let e=i?.algorithms||[...Py],t=ec(i?.options),r=e.map(Qa.createHash);return{update:o(function(s,n){return r.forEach(a=>a.update(s,n)),this},"update"),digest:o(function(){return e.reduce((n,a)=>{let c=r.shift().digest("base64"),u=new zi(`${a}-${c}${t}`,i);if(u.algorithm&&u.digest){let l=u.algorithm;n[l]||(n[l]=[]),n[l].push(u)}return n},new gs)},"digest")}}o(J5,"createIntegrity");var K5=Qa.getHashes(),$C=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(i=>K5.includes(i));function Z5(i,e){return $C.indexOf(i.toLowerCase())>=$C.indexOf(e.toLowerCase())?i:e}o(Z5,"getPrioritizedHash")});var qC=d((hpe,xy)=>{(function(){var i;function e(t,r){var s=this instanceof e?this:i;if(s.reset(r),typeof t=="string"&&t.length>0&&s.hash(t),s!==this)return s}o(e,"MurmurHash3"),e.prototype.hash=function(t){var r,s,n,a,c;switch(c=t.length,this.len+=c,s=this.k1,n=0,this.rem){case 0:s^=c>n?t.charCodeAt(n++)&65535:0;case 1:s^=c>n?(t.charCodeAt(n++)&65535)<<8:0;case 2:s^=c>n?(t.charCodeAt(n++)&65535)<<16:0;case 3:s^=c>n?(t.charCodeAt(n)&255)<<24:0,s^=c>n?(t.charCodeAt(n++)&65280)>>8:0}if(this.rem=c+this.rem&3,c-=this.rem,c>0){for(r=this.h1;s=s*11601+(s&65535)*3432906752&4294967295,s=s<<15|s>>>17,s=s*13715+(s&65535)*461832192&4294967295,r^=s,r=r<<13|r>>>19,r=r*5+3864292196&4294967295,!(n>=c);)s=t.charCodeAt(n++)&65535^(t.charCodeAt(n++)&65535)<<8^(t.charCodeAt(n++)&65535)<<16,a=t.charCodeAt(n++),s^=(a&255)<<24^(a&65280)>>8;switch(s=0,this.rem){case 3:s^=(t.charCodeAt(n+2)&65535)<<16;case 2:s^=(t.charCodeAt(n+1)&65535)<<8;case 1:s^=t.charCodeAt(n)&65535}this.h1=r}return this.k1=s,this},e.prototype.result=function(){var t,r;return t=this.k1,r=this.h1,t>0&&(t=t*11601+(t&65535)*3432906752&4294967295,t=t<<15|t>>>17,t=t*13715+(t&65535)*461832192&4294967295,r^=t),r^=this.len,r^=r>>>16,r=r*51819+(r&65535)*2246770688&4294967295,r^=r>>>13,r=r*44597+(r&65535)*3266445312&4294967295,r^=r>>>16,r>>>0},e.prototype.reset=function(t){return this.h1=typeof t=="number"?t:0,this.rem=this.k1=this.len=0,this},i=new e,typeof xy<"u"?xy.exports=e:this.MurmurHash3=e})()});var zC=d((dpe,VC)=>{"use strict";var Y5=qC();VC.exports=function(i){if(i){var e=new Y5(i);return("00000000"+e.result().toString(16)).slice(-8)}else return(Math.random().toString(16)+"0000000").slice(2,10)}});var Ly=d((ppe,HC)=>{var X5=require("path"),Q5=zC();HC.exports=function(i,e,t){return X5.join(i,(e?e+"-":"")+Q5(t))}});var My=d((mpe,e3)=>{e3.exports={name:"cacache",version:"20.0.1","cache-version":{content:"2",index:"5"},description:"Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",snap:"tap",coverage:"tap","test-docker":'docker run -it --rm --name pacotest -v "$PWD":/tmp -w /tmp node:latest npm test',lint:"npm run eslint",npmclilint:"npmcli-lint",lintfix:"npm run eslint -- --fix",postsnap:"npm run lintfix --",postlint:"template-oss-check",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},repository:{type:"git",url:"git+https://github.com/npm/cacache.git"},keywords:["cache","caching","content-addressable","sri","sri hash","subresource integrity","cache","storage","store","file store","filesystem","disk cache","disk storage"],license:"ISC",dependencies:{"@npmcli/fs":"^4.0.0","fs-minipass":"^3.0.0",glob:"^11.0.3","lru-cache":"^11.1.0",minipass:"^7.0.3","minipass-collect":"^2.0.1","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4","p-map":"^7.0.2",ssri:"^12.0.0","unique-filename":"^4.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",windowsCI:!1,version:"4.25.0",publish:"true"},author:"GitHub Inc.",tap:{"nyc-arg":["--exclude","tap-snapshots/**"]}}});var By=d((gpe,GC)=>{"use strict";GC.exports=t3;function t3(i){return[i.slice(0,2),i.slice(2,4),i.slice(4)]}o(t3,"hashToSegments")});var On=d((Spe,ky)=>{"use strict";var i3=My()["cache-version"].content,r3=By(),WC=require("path"),s3=ai();ky.exports=n3;function n3(i,e){let t=s3.parse(e,{single:!0});return WC.join(JC(i),t.algorithm,...r3(t.hexDigest()))}o(n3,"contentPath");ky.exports.contentDir=JC;function JC(i){return WC.join(i,`content-v${i3}`)}o(JC,"contentDir")});var Fy=d((wpe,KC)=>{var o3=o((i,{copy:e,wrap:t})=>{let r={};if(i&&typeof i=="object")for(let s of e)i[s]!==void 0&&(r[s]=i[s]);else r[t]=i;return r},"getOptions");KC.exports=o3});var YC=d((bpe,ZC)=>{var a3=ds(),c3=o(i=>a3.satisfies(process.version,i,{includePrerelease:!0}),"satisfies");ZC.exports={satisfies:c3}});var XC=d((Rpe,jy)=>{"use strict";var{inspect:u3}=require("util"),Uy=class{static{o(this,"SystemError")}constructor(e,t,r){let s=`${t}: ${r.syscall} returned ${r.code} (${r.message})`;r.path!==void 0&&(s+=` ${r.path}`),r.dest!==void 0&&(s+=` => ${r.dest}`),this.code=e,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:s,enumerable:!1,writable:!0,configurable:!0},info:{value:r,enumerable:!0,configurable:!0,writable:!1},errno:{get(){return r.errno},set(n){r.errno=n},enumerable:!0,configurable:!0},syscall:{get(){return r.syscall},set(n){r.syscall=n},enumerable:!0,configurable:!0}}),r.path!==void 0&&Object.defineProperty(this,"path",{get(){return r.path},set(n){r.path=n},enumerable:!0,configurable:!0}),r.dest!==void 0&&Object.defineProperty(this,"dest",{get(){return r.dest},set(n){r.dest=n},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return u3(this,{...t,getters:!0,customInspect:!1})}};function Hi(i,e){jy.exports[i]=class extends Uy{static{o(this,"NodeError")}constructor(r){super(i,e,r)}}}o(Hi,"E");Hi("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory");Hi("ERR_FS_CP_EEXIST","Target already exists");Hi("ERR_FS_CP_EINVAL","Invalid src or dest");Hi("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe");Hi("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory");Hi("ERR_FS_CP_SOCKET","Cannot copy a socket file");Hi("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self");Hi("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type");Hi("ERR_FS_EISDIR","Path is a directory");jy.exports.ERR_INVALID_ARG_TYPE=class extends Error{static{o(this,"ERR_INVALID_ARG_TYPE")}constructor(e,t,r){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${e} argument must be ${t}. Received ${typeof r}`}}});var y1=d((Tpe,g1)=>{"use strict";var{ERR_FS_CP_DIR_TO_NON_DIR:l3,ERR_FS_CP_EEXIST:h3,ERR_FS_CP_EINVAL:nh,ERR_FS_CP_FIFO_PIPE:f3,ERR_FS_CP_NON_DIR_TO_DIR:d3,ERR_FS_CP_SOCKET:p3,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:m3,ERR_FS_CP_UNKNOWN:g3,ERR_FS_EISDIR:y3,ERR_INVALID_ARG_TYPE:S3}=XC(),{constants:{errno:{EEXIST:E3,EISDIR:w3,EINVAL:Gi,ENOTDIR:_3}}}=require("os"),{chmod:b3,copyFile:I3,lstat:a1,mkdir:c1,readdir:O3,readlink:QC,stat:vn,symlink:$y,unlink:u1,utimes:v3}=require("fs/promises"),{dirname:tc,isAbsolute:e1,join:t1,parse:R3,resolve:ic,sep:A3,toNamespacedPath:i1}=require("path"),{fileURLToPath:T3}=require("url"),C3={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};async function N3(i,e,t){if(t!=null&&typeof t!="object")throw new S3("options",["Object"],t);return P3(i1(r1(i)),i1(r1(e)),{...C3,...t})}o(N3,"cp");function r1(i){return i!=null&&i.href&&i.origin?T3(i):i}o(r1,"getValidatedPath");async function P3(i,e,t){t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended","TimestampPrecisionWarning");let r=await l1(i,e,t),{srcStat:s,destStat:n}=r;return await f1(i,s,e),t.filter?d1(s1,n,i,e,t):s1(n,i,e,t)}o(P3,"cpFn");async function l1(i,e,t){let{0:r,1:s}=await D3(i,e,t);if(s){if(h1(r,s))throw new nh({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:Gi});if(r.isDirectory()&&!s.isDirectory())throw new l3({message:`cannot overwrite directory ${i} with non-directory ${e}`,path:e,syscall:"cp",errno:w3});if(!r.isDirectory()&&s.isDirectory())throw new d3({message:`cannot overwrite non-directory ${i} with directory ${e}`,path:e,syscall:"cp",errno:_3})}if(r.isDirectory()&&qy(i,e))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:Gi});return{srcStat:r,destStat:s}}o(l1,"checkPaths");function h1(i,e){return e.ino&&e.dev&&e.ino===i.ino&&e.dev===i.dev}o(h1,"areIdentical");function D3(i,e,t){let r=t.dereference?s=>vn(s,{bigint:!0}):s=>a1(s,{bigint:!0});return Promise.all([r(i),r(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})])}o(D3,"getStats");async function s1(i,e,t,r){let s=tc(t);return await x3(s)||await c1(s,{recursive:!0}),oh(i,e,t,r)}o(s1,"checkParentDir");function x3(i){return vn(i).then(()=>!0,e=>e.code==="ENOENT"?!1:Promise.reject(e))}o(x3,"pathExists");async function f1(i,e,t){let r=ic(tc(i)),s=ic(tc(t));if(s===r||s===R3(s).root)return;let n;try{n=await vn(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(h1(e,n))throw new nh({message:`cannot copy ${i} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:Gi});return f1(i,e,s)}o(f1,"checkParentPaths");var n1=o(i=>ic(i).split(A3).filter(Boolean),"normalizePathToArray");function qy(i,e){let t=n1(i),r=n1(e);return t.every((s,n)=>r[n]===s)}o(qy,"isSrcSubdir");async function d1(i,e,t,r,s,n){if(await s.filter(t,r))return i(e,t,r,s,n)}o(d1,"handleFilter");function L3(i,e,t,r){return r.filter?d1(oh,i,e,t,r):oh(i,e,t,r)}o(L3,"startCopy");async function oh(i,e,t,r){let n=await(r.dereference?vn:a1)(e);if(n.isDirectory()&&r.recursive)return $3(n,i,e,t,r);if(n.isDirectory())throw new y3({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:Gi});if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return M3(n,i,e,t,r);if(n.isSymbolicLink())return V3(i,e,t);throw n.isSocket()?new p3({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:Gi}):n.isFIFO()?new f3({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:Gi}):new g3({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:Gi})}o(oh,"getStatsForCopy");function M3(i,e,t,r,s){return e?B3(i,t,r,s):p1(i,t,r,s)}o(M3,"onFile");async function B3(i,e,t,r){if(r.force)return await u1(t),p1(i,e,t,r);if(r.errorOnExist)throw new h3({message:`${t} already exists`,path:t,syscall:"cp",errno:E3})}o(B3,"mayCopyFile");async function p1(i,e,t,r){return await I3(e,t),r.preserveTimestamps?k3(i.mode,e,t):ah(t,i.mode)}o(p1,"_copyFile");async function k3(i,e,t){return F3(i)&&await U3(t,i),o1(i,e,t)}o(k3,"handleTimestampsAndMode");function F3(i){return(i&128)===0}o(F3,"fileIsNotWritable");function U3(i,e){return ah(i,e|128)}o(U3,"makeFileWritable");async function o1(i,e,t){return await j3(e,t),ah(t,i)}o(o1,"setDestTimestampsAndMode");function ah(i,e){return b3(i,e)}o(ah,"setDestMode");async function j3(i,e){let t=await vn(i);return v3(e,t.atime,t.mtime)}o(j3,"setDestTimestamps");function $3(i,e,t,r,s){return e?m1(t,r,s):q3(i.mode,t,r,s)}o($3,"onDir");async function q3(i,e,t,r){return await c1(t),await m1(e,t,r),ah(t,i)}o(q3,"mkDirAndCopy");async function m1(i,e,t){let r=await O3(i);for(let s=0;s<r.length;s++){let n=r[s],a=t1(i,n),c=t1(e,n),{destStat:u}=await l1(a,c,t);await L3(u,a,c,t)}}o(m1,"copyDir");async function V3(i,e,t){let r=await QC(e);if(e1(r)||(r=ic(tc(e),r)),!i)return $y(r,t);let s;try{s=await QC(t)}catch(a){if(a.code==="EINVAL"||a.code==="UNKNOWN")return $y(r,t);throw a}if(e1(s)||(s=ic(tc(t),s)),qy(r,s))throw new nh({message:`cannot copy ${r} to a subdirectory of self ${s}`,path:t,syscall:"cp",errno:Gi});if((await vn(e)).isDirectory()&&qy(s,r))throw new m3({message:`cannot overwrite ${s} with ${r}`,path:t,syscall:"cp",errno:Gi});return z3(r,t)}o(V3,"onLink");async function z3(i,e){return await u1(e),$y(i,e)}o(z3,"copyLink");g1.exports=N3});var E1=d((Npe,S1)=>{var H3=require("fs/promises"),G3=Fy(),W3=YC(),J3=y1(),K3=W3.satisfies(">=16.7.0"),Z3=o(async(i,e,t)=>{let r=G3(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return K3?H3.cp(i,e,r):J3(i,e,r)},"cp");S1.exports=Z3});var _1=d((Dpe,w1)=>{var{join:Y3,sep:X3}=require("path"),Q3=Fy(),{mkdir:e4,mkdtemp:t4,rm:i4}=require("fs/promises"),r4=o(async(i,e,t)=>{let r=Q3(t,{copy:["tmpPrefix"]});await e4(i,{recursive:!0});let s=await t4(Y3(`${i}${X3}`,r.tmpPrefix||"")),n,a;try{a=await e(s)}catch(c){n=c}try{await i4(s,{force:!0,recursive:!0})}catch{}if(n)throw n;return a},"withTempDir");w1.exports=r4});var v1=d((Lpe,O1)=>{var{readdir:b1}=require("fs/promises"),{join:I1}=require("path"),s4=o(async i=>{let e=[];for(let t of await b1(i))if(t.startsWith("@"))for(let r of await b1(I1(i,t)))e.push(I1(t,r));else e.push(t);return e},"readdirScoped");O1.exports=s4});var P1=d((Bpe,N1)=>{var{dirname:R1,join:A1,resolve:T1,relative:n4,isAbsolute:o4}=require("path"),ci=require("fs/promises"),a4=o(async i=>{try{return await ci.access(i),!0}catch(e){return e.code!=="ENOENT"}},"pathExists"),C1=o(async(i,e,t={},r=!0,s=[])=>{if(!i||!e)throw new TypeError("`source` and `destination` file required");if(t={overwrite:!0,...t},!t.overwrite&&await a4(e))throw new Error(`The destination file exists: ${e}`);await ci.mkdir(R1(e),{recursive:!0});try{await ci.rename(i,e)}catch(n){if(n.code==="EXDEV"||n.code==="EPERM"){let a=await ci.lstat(i);if(a.isDirectory()){let c=await ci.readdir(i);await Promise.all(c.map(u=>C1(A1(i,u),A1(e,u),t,!1,s)))}else a.isSymbolicLink()?s.push({source:i,destination:e}):await ci.copyFile(i,e)}else throw n}r&&(await Promise.all(s.map(async({source:n,destination:a})=>{let c=await ci.readlink(n);o4(c)&&(c=T1(a,n4(n,c)));let u="file";try{u=await ci.stat(T1(R1(n),c)),u.isDirectory()&&(u="junction")}catch{}await ci.symlink(c,a,u)})),await ci.rm(i,{recursive:!0,force:!0}))},"moveFile");N1.exports=C1});var ch=d((Fpe,D1)=>{"use strict";var c4=E1(),u4=_1(),l4=v1(),h4=P1();D1.exports={cp:c4,withTempDir:u4,readdirScoped:l4,moveFile:h4}});var uh={};$j(uh,{default:()=>x1,pMapIterable:()=>f4,pMapSkip:()=>rc});async function x1(i,e,{concurrency:t=Number.POSITIVE_INFINITY,stopOnError:r=!0,signal:s}={}){return new Promise((n,a)=>{if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);let c=[],u=[],l=new Map,h=!1,f=!1,p=!1,m=0,y=0,g=i[Symbol.iterator]===void 0?i[Symbol.asyncIterator]():i[Symbol.iterator](),S=o(()=>{b(s.reason)},"signalListener"),E=o(()=>{s?.removeEventListener("abort",S)},"cleanup"),_=o(I=>{n(I),E()},"resolve"),b=o(I=>{h=!0,f=!0,a(I),E()},"reject");s&&(s.aborted&&b(s.reason),s.addEventListener("abort",S,{once:!0}));let w=o(async()=>{if(f)return;let I=await g.next(),v=y;if(y++,I.done){if(p=!0,m===0&&!f){if(!r&&u.length>0){b(new AggregateError(u));return}if(f=!0,l.size===0){_(c);return}let N=[];for(let[P,$]of c.entries())l.get(P)!==rc&&N.push($);_(N)}return}m++,(async()=>{try{let N=await I.value;if(f)return;let P=await e(N,v);P===rc&&l.set(v,P),c[v]=P,m--,await w()}catch(N){if(r)b(N);else{u.push(N),m--;try{await w()}catch(P){b(P)}}}})()},"next");(async()=>{for(let I=0;I<t;I++){try{await w()}catch(v){b(v);break}if(p||h)break}})()})}function f4(i,e,{concurrency:t=Number.POSITIVE_INFINITY,backpressure:r=t}={}){if(i[Symbol.iterator]===void 0&&i[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof i})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!(Number.isSafeInteger(t)&&t>=1||t===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);if(!(Number.isSafeInteger(r)&&r>=t||r===Number.POSITIVE_INFINITY))throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${t}) and up or \`Infinity\`, got \`${r}\` (${typeof r})`);return{async*[Symbol.asyncIterator](){let s=i[Symbol.asyncIterator]===void 0?i[Symbol.iterator]():i[Symbol.asyncIterator](),n=[],a=0,c=!1,u=0;function l(){if(c||!(a<t&&n.length<r))return;let h=(async()=>{let{done:f,value:p}=await s.next();if(f)return{done:!0};a++,l();try{let m=await e(await p,u++);if(a--,m===rc){let y=n.indexOf(h);y>0&&n.splice(y,1)}return l(),{done:!1,value:m}}catch(m){return c=!0,{error:m}}})();n.push(h)}for(o(l,"trySpawn"),l();n.length>0;){let{error:h,done:f,value:p}=await n[0];if(n.shift(),h)throw h;if(f)return;l(),p!==rc&&(yield p)}}}}var rc,lh=jj(()=>{o(x1,"pMap");o(f4,"pMapIterable");rc=Symbol("skip")});var Rn=d(($pe,ht)=>{"use strict";var d4=require("crypto"),{appendFile:p4,mkdir:Hy,readFile:m4,readdir:g4,rm:L1,writeFile:y4}=require("fs/promises"),{Minipass:S4}=te(),ui=require("path"),E4=ai(),w4=Ly(),_4=On(),b4=By(),I4=My()["cache-version"].index,{moveFile:O4}=ch(),Vy=5;ht.exports.NotFoundError=class extends Error{static{o(this,"NotFoundError")}constructor(e,t){super(`No cache entry for ${t} found in ${e}`),this.code="ENOENT",this.cache=e,this.key=t}};ht.exports.compact=v4;async function v4(i,e,t,r={}){let s=sc(i,e),n=await hh(s),a=[];for(let p=n.length-1;p>=0;--p){let m=n[p];if(m.integrity===null&&!r.validateEntry)break;(!r.validateEntry||r.validateEntry(m)===!0)&&(a.length===0||!a.find(y=>t(y,m)))&&a.unshift(m)}let c=`
|
|
23
|
+
`+a.map(p=>{let m=JSON.stringify(p);return`${fh(m)} ${m}`}).join(`
|
|
24
|
+
`),u=o(async()=>{let p=w4(ui.join(i,"tmp"),r.tmpPrefix);return await Hy(ui.dirname(p),{recursive:!0}),{target:p,moved:!1}},"setup"),l=o(async p=>{if(!p.moved)return L1(p.target,{recursive:!0,force:!0})},"teardown"),h=o(async p=>{await y4(p.target,c,{flag:"wx"}),await Hy(ui.dirname(s),{recursive:!0}),await O4(p.target,s),p.moved=!0},"write"),f=await u();try{await h(f)}finally{await l(f)}return a.reverse().map(p=>dh(i,p,!0))}o(v4,"compact");ht.exports.insert=M1;async function M1(i,e,t,r={}){let{metadata:s,size:n,time:a}=r,c=sc(i,e),u={key:e,integrity:t&&E4.stringify(t),time:a||Date.now(),size:n,metadata:s};try{await Hy(ui.dirname(c),{recursive:!0});let l=JSON.stringify(u);await p4(c,`
|
|
25
|
+
${fh(l)} ${l}`)}catch(l){if(l.code==="ENOENT")return;throw l}return dh(i,u)}o(M1,"insert");ht.exports.find=R4;async function R4(i,e){let t=sc(i,e);try{return(await hh(t)).reduce((s,n)=>n&&n.key===e?dh(i,n):s,null)}catch(r){if(r.code==="ENOENT")return null;throw r}}o(R4,"find");ht.exports.delete=A4;function A4(i,e,t={}){if(!t.removeFully)return M1(i,e,null,t);let r=sc(i,e);return L1(r,{recursive:!0,force:!0})}o(A4,"del");ht.exports.lsStream=B1;function B1(i){let e=Gy(i),t=new S4({objectMode:!0});return Promise.resolve().then(async()=>{let{default:r}=await Promise.resolve().then(()=>(lh(),uh)),s=await zy(e);return await r(s,async n=>{let a=ui.join(e,n),c=await zy(a);await r(c,async u=>{let l=ui.join(a,u),h=await zy(l);await r(h,async f=>{let p=ui.join(l,f);try{let y=(await hh(p)).reduce((g,S)=>(g.set(S.key,S),g),new Map);for(let g of y.values()){let S=dh(i,g);S&&t.write(S)}}catch(m){if(m.code==="ENOENT")return;throw m}},{concurrency:Vy})},{concurrency:Vy})},{concurrency:Vy}),t.end(),t}).catch(r=>t.emit("error",r)),t}o(B1,"lsStream");ht.exports.ls=T4;async function T4(i){return(await B1(i).collect()).reduce((t,r)=>(t[r.key]=r,t),{})}o(T4,"ls");ht.exports.bucketEntries=hh;async function hh(i,e){let t=await m4(i,"utf8");return C4(t,e)}o(hh,"bucketEntries");function C4(i){let e=[];return i.split(`
|
|
26
|
+
`).forEach(t=>{if(!t)return;let r=t.split(" ");if(!r[1]||fh(r[1])!==r[0])return;let s;try{s=JSON.parse(r[1])}catch{}s&&e.push(s)}),e}o(C4,"_bucketEntries");ht.exports.bucketDir=Gy;function Gy(i){return ui.join(i,`index-v${I4}`)}o(Gy,"bucketDir");ht.exports.bucketPath=sc;function sc(i,e){let t=k1(e);return ui.join.apply(ui,[Gy(i)].concat(b4(t)))}o(sc,"bucketPath");ht.exports.hashKey=k1;function k1(i){return F1(i,"sha256")}o(k1,"hashKey");ht.exports.hashEntry=fh;function fh(i){return F1(i,"sha1")}o(fh,"hashEntry");function F1(i,e){return d4.createHash(e).update(i).digest("hex")}o(F1,"hash");function dh(i,e,t){return!e.integrity&&!t?null:{key:e.key,integrity:e.integrity,path:e.integrity?_4(i,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}}o(dh,"formatEntry");function zy(i){return g4(i).catch(e=>{if(e.code==="ENOENT"||e.code==="ENOTDIR")return[];throw e})}o(zy,"readdirOrEmpty")});var nc=d((Vpe,An)=>{"use strict";var{LRUCache:N4}=os(),ph=new N4({max:500,maxSize:50*1024*1024,ttl:180*1e3,sizeCalculation:o((i,e)=>e.startsWith("key:")?i.data.length:i.length,"sizeCalculation")});An.exports.clearMemoized=P4;function P4(){let i={};return ph.forEach((e,t)=>{i[t]=e}),ph.clear(),i}o(P4,"clearMemoized");An.exports.put=D4;function D4(i,e,t,r){mh(r).set(`key:${i}:${e.key}`,{entry:e,data:t}),U1(i,e.integrity,t,r)}o(D4,"put");An.exports.put.byDigest=U1;function U1(i,e,t,r){mh(r).set(`digest:${i}:${e}`,t)}o(U1,"putDigest");An.exports.get=x4;function x4(i,e,t){return mh(t).get(`key:${i}:${e}`)}o(x4,"get");An.exports.get.byDigest=L4;function L4(i,e,t){return mh(t).get(`digest:${i}:${e}`)}o(L4,"getDigest");var Wy=class{static{o(this,"ObjProxy")}constructor(e){this.obj=e}get(e){return this.obj[e]}set(e,t){this.obj[e]=t}};function mh(i){return!i||!i.memoize?ph:i.memoize.get&&i.memoize.set?i.memoize:typeof i.memoize=="object"?new Wy(i.memoize):ph}o(mh,"pickMem")});var Ln=d(ac=>{"use strict";var{Minipass:M4}=te(),B4=require("events").EventEmitter,Xe=require("fs"),k4=Xe.writev,Dn=Symbol("_autoClose"),Ht=Symbol("_close"),oc=Symbol("_ended"),Z=Symbol("_fd"),j1=Symbol("_finished"),_r=Symbol("_flags"),Jy=Symbol("_flush"),Zy=Symbol("_handleChunk"),Yy=Symbol("_makeBuf"),wh=Symbol("_mode"),gh=Symbol("_needDrain"),Nn=Symbol("_onerror"),xn=Symbol("_onopen"),Ky=Symbol("_onread"),Tn=Symbol("_onwrite"),br=Symbol("_open"),Wi=Symbol("_path"),Ss=Symbol("_pos"),li=Symbol("_queue"),Cn=Symbol("_read"),$1=Symbol("_readSize"),wr=Symbol("_reading"),yh=Symbol("_remain"),q1=Symbol("_size"),Sh=Symbol("_write"),ys=Symbol("_writing"),Eh=Symbol("_defaultFlag"),Pn=Symbol("_errored"),_h=class extends M4{static{o(this,"ReadStream")}constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Pn]=!1,this[Z]=typeof t.fd=="number"?t.fd:null,this[Wi]=e,this[$1]=t.readSize||16*1024*1024,this[wr]=!1,this[q1]=typeof t.size=="number"?t.size:1/0,this[yh]=this[q1],this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[Z]=="number"?this[Cn]():this[br]()}get fd(){return this[Z]}get path(){return this[Wi]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[br](){Xe.open(this[Wi],"r",(e,t)=>this[xn](e,t))}[xn](e,t){e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[Cn]())}[Yy](){return Buffer.allocUnsafe(Math.min(this[$1],this[yh]))}[Cn](){if(!this[wr]){this[wr]=!0;let e=this[Yy]();if(e.length===0)return process.nextTick(()=>this[Ky](null,0,e));Xe.read(this[Z],e,0,e.length,null,(t,r,s)=>this[Ky](t,r,s))}}[Ky](e,t,r){this[wr]=!1,e?this[Nn](e):this[Zy](t,r)&&this[Cn]()}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Nn](e){this[wr]=!0,this[Ht](),this.emit("error",e)}[Zy](e,t){let r=!1;return this[yh]-=e,e>0&&(r=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[yh]<=0)&&(r=!1,this[Ht](),super.end()),r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[Z]=="number"&&this[Cn]();break;case"error":return this[Pn]?void 0:(this[Pn]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Xy=class extends _h{static{o(this,"ReadStreamSync")}[br](){let e=!0;try{this[xn](null,Xe.openSync(this[Wi],"r")),e=!1}finally{e&&this[Ht]()}}[Cn](){let e=!0;try{if(!this[wr]){this[wr]=!0;do{let t=this[Yy](),r=t.length===0?0:Xe.readSync(this[Z],t,0,t.length,null);if(!this[Zy](r,t))break}while(!0);this[wr]=!1}e=!1}finally{e&&this[Ht]()}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}},bh=class extends B4{static{o(this,"WriteStream")}constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Pn]=!1,this[ys]=!1,this[oc]=!1,this[gh]=!1,this[li]=[],this[Wi]=e,this[Z]=typeof t.fd=="number"?t.fd:null,this[wh]=t.mode===void 0?438:t.mode,this[Ss]=typeof t.start=="number"?t.start:null,this[Dn]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Ss]!==null?"r+":"w";this[Eh]=t.flags===void 0,this[_r]=this[Eh]?r:t.flags,this[Z]===null&&this[br]()}emit(e,t){if(e==="error"){if(this[Pn])return;this[Pn]=!0}return super.emit(e,t)}get fd(){return this[Z]}get path(){return this[Wi]}[Nn](e){this[Ht](),this[ys]=!0,this.emit("error",e)}[br](){Xe.open(this[Wi],this[_r],this[wh],(e,t)=>this[xn](e,t))}[xn](e,t){this[Eh]&&this[_r]==="r+"&&e&&e.code==="ENOENT"?(this[_r]="w",this[br]()):e?this[Nn](e):(this[Z]=t,this.emit("open",t),this[ys]||this[Jy]())}end(e,t){return e&&this.write(e,t),this[oc]=!0,!this[ys]&&!this[li].length&&typeof this[Z]=="number"&&this[Tn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[oc]?(this.emit("error",new Error("write() after end()")),!1):this[Z]===null||this[ys]||this[li].length?(this[li].push(e),this[gh]=!0,!1):(this[ys]=!0,this[Sh](e),!0)}[Sh](e){Xe.write(this[Z],e,0,e.length,this[Ss],(t,r)=>this[Tn](t,r))}[Tn](e,t){e?this[Nn](e):(this[Ss]!==null&&(this[Ss]+=t),this[li].length?this[Jy]():(this[ys]=!1,this[oc]&&!this[j1]?(this[j1]=!0,this[Ht](),this.emit("finish")):this[gh]&&(this[gh]=!1,this.emit("drain"))))}[Jy](){if(this[li].length===0)this[oc]&&this[Tn](null,0);else if(this[li].length===1)this[Sh](this[li].pop());else{let e=this[li];this[li]=[],k4(this[Z],e,this[Ss],(t,r)=>this[Tn](t,r))}}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Qy=class extends bh{static{o(this,"WriteStreamSync")}[br](){let e;if(this[Eh]&&this[_r]==="r+")try{e=Xe.openSync(this[Wi],this[_r],this[wh])}catch(t){if(t.code==="ENOENT")return this[_r]="w",this[br]();throw t}else e=Xe.openSync(this[Wi],this[_r],this[wh]);this[xn](null,e)}[Ht](){if(this[Dn]&&typeof this[Z]=="number"){let e=this[Z];this[Z]=null,Xe.closeSync(e),this.emit("close")}}[Sh](e){let t=!0;try{this[Tn](null,Xe.writeSync(this[Z],e,0,e.length,this[Ss])),t=!1}finally{if(t)try{this[Ht]()}catch{}}}};ac.ReadStream=_h;ac.ReadStreamSync=Xy;ac.WriteStream=bh;ac.WriteStreamSync=Qy});var tS=d((Wpe,Mn)=>{"use strict";var cc=require("fs/promises"),F4=Ln(),eS=ai(),U4=On(),V1=In();Mn.exports=j4;var z1=64*1024*1024;async function j4(i,e,t={}){let{size:r}=t,{stat:s,cpath:n,sri:a}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));if(s.size>z1)return H1(n,s.size,a,new V1).concat();let c=await cc.readFile(n,{encoding:null});if(s.size!==c.length)throw V4(s.size,c.length);if(!eS.checkData(c,a))throw z4(a,n);return c}o(j4,"read");var H1=o((i,e,t,r)=>(r.push(new F4.ReadStream(i,{size:e,readSize:z1}),eS.integrityStream({integrity:t,size:e})),r),"readPipeline");Mn.exports.stream=G1;Mn.exports.readStream=G1;function G1(i,e,t={}){let{size:r}=t,s=new V1;return Promise.resolve().then(async()=>{let{stat:n,cpath:a,sri:c}=await uc(i,e,async(u,l)=>({stat:r?{size:r}:await cc.stat(u),cpath:u,sri:l}));return H1(a,n.size,c,s)}).catch(n=>s.emit("error",n)),s}o(G1,"readStream");Mn.exports.copy=$4;function $4(i,e,t){return uc(i,e,r=>cc.copyFile(r,t))}o($4,"copy");Mn.exports.hasContent=q4;async function q4(i,e){if(!e)return!1;try{return await uc(i,e,async(t,r)=>{let s=await cc.stat(t);return{size:s.size,sri:r,stat:s}})}catch(t){if(t.code==="ENOENT")return!1;if(t.code==="EPERM"){if(process.platform!=="win32")throw t;return!1}}}o(q4,"hasContent");async function uc(i,e,t){let r=eS.parse(e),s=r.pickAlgorithm(),n=r[s];if(n.length<=1){let a=U4(i,n[0]);return t(a,n[0])}else{let a=await Promise.all(n.map(async l=>{try{return await uc(i,l,t)}catch(h){return h.code==="ENOENT"?Object.assign(new Error("No matching content found for "+r.toString()),{code:"ENOENT"}):h}})),c=a.find(l=>!(l instanceof Error));if(c)return c;let u=a.find(l=>l.code==="ENOENT");throw u||a.find(l=>l instanceof Error)}}o(uc,"withContentSri");function V4(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(V4,"sizeError");function z4(i,e){let t=new Error(`Integrity verification failed for ${i} (${e})`);return t.code="EINTEGRITY",t.sri=i,t.path=e,t}o(z4,"integrityError")});var Z1=d((Kpe,Ki)=>{"use strict";var W1=yy(),{Minipass:J1}=te(),K1=In(),Es=Rn(),Ji=nc(),ws=tS();async function H4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get(i,e,t);if(a&&s!==!1)return{metadata:a.entry.metadata,data:a.data,integrity:a.entry.integrity,size:a.entry.size};let c=await Es.find(i,e,t);if(!c)throw new Es.NotFoundError(i,e);let u=await ws(i,c.integrity,{integrity:r,size:n});return s&&Ji.put(i,c,u,t),{data:u,metadata:c.metadata,size:c.size,integrity:c.integrity}}o(H4,"getData");Ki.exports=H4;async function G4(i,e,t={}){let{integrity:r,memoize:s,size:n}=t,a=Ji.get.byDigest(i,e,t);if(a&&s!==!1)return a;let c=await ws(i,e,{integrity:r,size:n});return s&&Ji.put.byDigest(i,e,c,t),c}o(G4,"getDataByDigest");Ki.exports.byDigest=G4;var W4=o(i=>{let e=new J1;return e.on("newListener",function(t,r){t==="metadata"&&r(i.entry.metadata),t==="integrity"&&r(i.entry.integrity),t==="size"&&r(i.entry.size)}),e.end(i.data),e},"getMemoizedStream");function J4(i,e,t={}){let{memoize:r,size:s}=t,n=Ji.get(i,e,t);if(n&&r!==!1)return W4(n);let a=new K1;return Promise.resolve().then(async()=>{let c=await Es.find(i,e);if(!c)throw new Es.NotFoundError(i,e);a.emit("metadata",c.metadata),a.emit("integrity",c.integrity),a.emit("size",c.size),a.on("newListener",function(l,h){l==="metadata"&&h(c.metadata),l==="integrity"&&h(c.integrity),l==="size"&&h(c.size)});let u=ws.readStream(i,c.integrity,{...t,size:typeof s!="number"?c.size:s});if(r){let l=new W1.PassThrough;l.on("collect",h=>Ji.put(i,c,h,t)),a.unshift(l)}return a.unshift(u),a}).catch(c=>a.emit("error",c)),a}o(J4,"getStream");Ki.exports.stream=J4;function K4(i,e,t={}){let{memoize:r}=t,s=Ji.get.byDigest(i,e,t);if(s&&r!==!1){let n=new J1;return n.end(s),n}else{let n=ws.readStream(i,e,t);if(!r)return n;let a=new W1.PassThrough;return a.on("collect",c=>Ji.put.byDigest(i,e,c,t)),new K1(n,a)}}o(K4,"getStreamDigest");Ki.exports.stream.byDigest=K4;function Z4(i,e,t={}){let{memoize:r}=t,s=Ji.get(i,e,t);return s&&r!==!1?Promise.resolve(s.entry):Es.find(i,e)}o(Z4,"info");Ki.exports.info=Z4;async function Y4(i,e,t,r={}){let s=await Es.find(i,e,r);if(!s)throw new Es.NotFoundError(i,e);return await ws.copy(i,s.integrity,t,r),{metadata:s.metadata,size:s.size,integrity:s.integrity}}o(Y4,"copy");Ki.exports.copy=Y4;async function X4(i,e,t,r={}){return await ws.copy(i,e,t,r),e}o(X4,"copyByDigest");Ki.exports.copy.byDigest=X4;Ki.exports.hasContent=ws.hasContent});var Ih=d((Ype,eN)=>{var Q4=rh(),Y1=Symbol("_flush"),X1=Symbol("_flushed"),Q1=Symbol("_flushing"),iS=class extends Q4{static{o(this,"Flush")}constructor(e={}){if(typeof e=="function"&&(e={flush:e}),super(e),typeof e.flush!="function"&&typeof this.flush!="function")throw new TypeError("must provide flush function in options");this[Y1]=e.flush||this.flush}emit(e,...t){if(e!=="end"&&e!=="finish"||this[X1])return super.emit(e,...t);if(this[Q1])return;this[Q1]=!0;let r=o(n=>{this[X1]=!0,n?super.emit("error",n):super.emit("end")},"afterFlush"),s=this[Y1](r);s&&s.then&&s.then(()=>r(),n=>r(n))}};eN.exports=iS});var nN=d((Qpe,oS)=>{"use strict";var tN=require("events"),eJ=On(),hc=require("fs/promises"),{moveFile:tJ}=ch(),{Minipass:iJ}=te(),iN=In(),rJ=Ih(),rS=require("path"),sS=ai(),sJ=Ly(),nJ=Ln();oS.exports=oJ;var lc=new Map;async function oJ(i,e,t={}){let{algorithms:r,size:s,integrity:n}=t;if(typeof s=="number"&&e.length!==s)throw lJ(s,e.length);let a=sS.fromData(e,r?{algorithms:r}:{});if(n&&!sS.checkData(e,n,t))throw hJ(n,a);for(let c in a){let u=await rN(i,t),l=a[c].toString();try{await hc.writeFile(u.target,e,{flag:"wx"}),await sN(u,i,l,t)}finally{u.moved||await hc.rm(u.target,{recursive:!0,force:!0})}}return{integrity:a,size:e.length}}o(oJ,"write");oS.exports.stream=aJ;var nS=class extends rJ{static{o(this,"CacacheWriteStream")}constructor(e,t){super(),this.opts=t,this.cache=e,this.inputStream=new iJ,this.inputStream.on("error",r=>this.emit("error",r)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(e,t,r){return this.handleContentP||(this.handleContentP=cJ(this.inputStream,this.cache,this.opts),this.handleContentP.catch(s=>this.emit("error",s))),this.inputStream.write(e,t,r)}flush(e){this.inputStream.end(()=>{if(!this.handleContentP){let t=new Error("Cache input stream was empty");return t.code="ENODATA",Promise.reject(t).catch(e)}this.handleContentP.then(t=>{t.integrity&&this.emit("integrity",t.integrity),t.size!==null&&this.emit("size",t.size),e()},t=>e(t))})}};function aJ(i,e={}){return new nS(i,e)}o(aJ,"writeStream");async function cJ(i,e,t){let r=await rN(e,t);try{let s=await uJ(i,e,r.target,t);return await sN(r,e,s.integrity,t),s}finally{r.moved||await hc.rm(r.target,{recursive:!0,force:!0})}}o(cJ,"handleContent");async function uJ(i,e,t,r){let s=new nJ.WriteStream(t,{flags:"wx"});if(r.integrityEmitter){let[l,h]=await Promise.all([tN.once(r.integrityEmitter,"integrity").then(f=>f[0]),tN.once(r.integrityEmitter,"size").then(f=>f[0]),new iN(i,s).promise()]);return{integrity:l,size:h}}let n,a,c=sS.integrityStream({integrity:r.integrity,algorithms:r.algorithms,size:r.size});return c.on("integrity",l=>{n=l}),c.on("size",l=>{a=l}),await new iN(i,c,s).promise(),{integrity:n,size:a}}o(uJ,"pipeToTmp");async function rN(i,e){let t=sJ(rS.join(i,"tmp"),e.tmpPrefix);return await hc.mkdir(rS.dirname(t),{recursive:!0}),{target:t,moved:!1}}o(rN,"makeTmp");async function sN(i,e,t){let r=eJ(e,t),s=rS.dirname(r);return lc.has(r)||lc.set(r,hc.mkdir(s,{recursive:!0}).then(async()=>(await tJ(i.target,r,{overwrite:!1}),i.moved=!0,i.moved)).catch(n=>{if(!n.message.startsWith("The destination file exists"))throw Object.assign(n,{code:"EEXIST"})}).finally(()=>{lc.delete(r)})),lc.get(r)}o(sN,"moveToDestination");function lJ(i,e){let t=new Error(`Bad data size: expected inserted data to be ${i} bytes, but got ${e} instead`);return t.expected=i,t.found=e,t.code="EBADSIZE",t}o(lJ,"sizeError");function hJ(i,e){let t=new Error(`Integrity check failed:
|
|
26
27
|
Wanted: ${i}
|
|
27
|
-
Found: ${e}`);return t.code="EINTEGRITY",t.expected=i,t.found=e,t}o(M6,"checksumError")});var CN=d((Wme,ES)=>{"use strict";var bN=Dn(),IN=pc(),ON=_N(),B6=Ph(),{PassThrough:k6}=Ty(),F6=Tn(),vN=o(i=>({algorithms:["sha512"],...i}),"putOpts");ES.exports=U6;async function U6(i,e,t,r={}){let{memoize:s}=r;r=vN(r);let n=await ON(i,t,r),a=await bN.insert(i,e,n.integrity,{...r,size:n.size});return s&&IN.put(i,a,t,r),n.integrity}o(U6,"putData");ES.exports.stream=j6;function j6(i,e,t={}){let{memoize:r}=t;t=vN(t);let s,n,a,c,u=new F6;if(r){let h=new k6().on("collect",f=>{c=f});u.push(h)}let l=ON.stream(i,t).on("integrity",h=>{s=h}).on("size",h=>{n=h}).on("error",h=>{a=h});return u.push(l),u.push(new B6({async flush(){if(!a){let h=await bN.insert(i,e,s,{...t,size:n});r&&c&&IN.put(i,h,c,t),u.emit("integrity",s),u.emit("size",n)}}})),u}o(j6,"putStream")});var wS=d((Kme,AN)=>{"use strict";var{glob:$6}=Ig(),RN=require("path"),q6=o(i=>i.split(RN.win32.sep).join(RN.posix.sep),"globify");AN.exports=(i,e)=>$6(q6(i),e)});var NN=d((Yme,TN)=>{"use strict";var V6=require("fs/promises"),z6=Nn(),{hasContent:H6}=dS();TN.exports=G6;async function G6(i,e){let t=await H6(i,e);return t&&t.sri?(await V6.rm(z6(i,t.sri),{recursive:!0,force:!0}),!0):!1}o(G6,"rm")});var DN=d((Qme,_c)=>{"use strict";var{rm:W6}=require("fs/promises"),J6=wS(),K6=Dn(),_S=pc(),Z6=require("path"),Y6=NN();_c.exports=PN;_c.exports.entry=PN;function PN(i,e,t){return _S.clearMemoized(),K6.delete(i,e,t)}o(PN,"entry");_c.exports.content=X6;function X6(i,e){return _S.clearMemoized(),Y6(i,e)}o(X6,"content");_c.exports.all=Q6;async function Q6(i){_S.clearMemoized();let e=await J6(Z6.join(i,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>W6(t,{recursive:!0,force:!0})))}o(Q6,"all")});var LN=d((tge,vS)=>{"use strict";var{mkdir:eJ,readFile:tJ,rm:IS,stat:OS,truncate:iJ,writeFile:rJ}=require("fs/promises"),xN=Nn(),sJ=jn(),nJ=wS(),qn=Dn(),Dh=require("path"),bS=hi(),oJ=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),aJ=o(i=>({concurrency:20,log:{silly(){}},...i}),"verifyOpts");vS.exports=cJ;async function cJ(i,e){e=aJ(e),e.log.silly("verify","verifying cache at",i);let t=[uJ,hJ,fJ,pJ,gJ,yJ,lJ],r={};for(let s of t){let n=s.name,a=new Date,c=await s(i,e);c&&Object.keys(c).forEach(l=>{r[l]=c[l]});let u=new Date;r.runTime||(r.runTime={}),r.runTime[n]=u-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",i,"in",`${r.runTime.total}ms`),r}o(cJ,"verify");async function uJ(){return{startTime:new Date}}o(uJ,"markStartTime");async function lJ(){return{endTime:new Date}}o(lJ,"markEndTime");async function hJ(i,e){return e.log.silly("verify","fixing cache permissions"),await eJ(i,{recursive:!0}),null}o(hJ,"fixPerms");async function fJ(i,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(Sh(),yh)),r=qn.lsStream(i),s=new Set;r.on("data",u=>{if(e.filter&&!e.filter(u))return;let l=bS.parse(u.integrity);for(let h in l)s.add(l[h].toString())}),await new Promise((u,l)=>{r.on("end",u).on("error",l)});let n=xN.contentDir(i),a=await nJ(Dh.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async u=>{let l=u.split(/[/\\]/),h=l.slice(l.length-3).join(""),f=l[l.length-4],p=bS.fromHex(h,f);if(s.has(p.toString())){let m=await dJ(u,p);m.valid?(c.verifiedContent++,c.keptSize+=m.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=m.size)}else{c.reclaimedCount++;let m=await OS(u);await IS(u,{recursive:!0,force:!0}),c.reclaimedSize+=m.size}return c},{concurrency:e.concurrency}),c}o(fJ,"garbageCollect");async function dJ(i,e){let t={};try{let{size:r}=await OS(i);t.size=r,t.valid=!0,await bS.checkStream(new sJ.ReadStream(i),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await IS(i,{recursive:!0,force:!0}),t.valid=!1}return t}o(dJ,"verifyContent");async function pJ(i,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(Sh(),yh)),r=await qn.ls(i),s={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(oJ(r,a)){let c=qn.hashKey(a),u=r[a],l=e.filter&&!e.filter(u);l&&s.rejectedEntries++,n[c]&&!l?n[c].push(u):n[c]&&l||(l?(n[c]=[],n[c]._path=qn.bucketPath(i,a)):(n[c]=[u],n[c]._path=qn.bucketPath(i,a)))}return await t(Object.keys(n),a=>mJ(i,n[a],s,e),{concurrency:e.concurrency}),s}o(pJ,"rebuildIndex");async function mJ(i,e,t){await iJ(e._path);for(let r of e){let s=xN(i,r.integrity);try{await OS(s),await qn.insert(i,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(mJ,"rebuildBucket");function gJ(i,e){return e.log.silly("verify","cleaning tmp directory"),IS(Dh.join(i,"tmp"),{recursive:!0,force:!0})}o(gJ,"cleanTmp");async function yJ(i,e){let t=Dh.join(i,"_lastverified");return e.log.silly("verify","writing verifile to "+t),rJ(t,`${Date.now()}`)}o(yJ,"writeVerifile");vS.exports.lastRun=SJ;async function SJ(i){let e=await tJ(Dh.join(i,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(SJ,"lastRun")});var BN=d((rge,RS)=>{"use strict";var{withTempDir:EJ}=gh(),MN=require("fs/promises"),CS=require("path");RS.exports.mkdir=wJ;async function wJ(i,e={}){let{tmpPrefix:t}=e,r=CS.join(i,"tmp");await MN.mkdir(r,{recursive:!0,owner:"inherit"});let s=`${r}${CS.sep}${t||""}`;return MN.mkdtemp(s,{owner:"inherit"})}o(wJ,"mktmpdir");RS.exports.withTmp=_J;function _J(i,e,t){return t||(t=e,e={}),EJ(CS.join(i,"tmp"),t,e)}o(_J,"withTmp")});var bc=d((nge,X)=>{"use strict";var Rr=fN(),kN=CN(),AS=DN(),FN=LN(),{clearMemoized:bJ}=pc(),UN=BN(),xh=Dn();X.exports.index={};X.exports.index.compact=xh.compact;X.exports.index.insert=xh.insert;X.exports.ls=xh.ls;X.exports.ls.stream=xh.lsStream;X.exports.get=Rr;X.exports.get.byDigest=Rr.byDigest;X.exports.get.stream=Rr.stream;X.exports.get.stream.byDigest=Rr.stream.byDigest;X.exports.get.copy=Rr.copy;X.exports.get.copy.byDigest=Rr.copy.byDigest;X.exports.get.info=Rr.info;X.exports.get.hasContent=Rr.hasContent;X.exports.put=kN;X.exports.put.stream=kN.stream;X.exports.rm=AS.entry;X.exports.rm.all=AS.all;X.exports.rm.entry=X.exports.rm;X.exports.rm.content=AS.content;X.exports.clearMemoized=bJ;X.exports.tmp={};X.exports.tmp.mkdir=UN.mkdir;X.exports.tmp.withTmp=UN.withTmp;X.exports.verify=FN;X.exports.verify.lastRun=FN.lastRun});var $N=d((oge,jN)=>{"use strict";var Vn=require("fs"),Ic=require("path"),IJ=require("events").EventEmitter,OJ=Ql(),Oc=class i extends IJ{static{o(this,"BundleWalker")}constructor(e){if(e=e||{},super(e),this.path=Ic.resolve(e.path||process.cwd()),this.parent=e.parent||null,this.parent){if(this.result=this.parent.result,!this.parent.parent){let t=Ic.basename(this.path),r=Ic.basename(Ic.dirname(this.path));this.result.add(/^@/.test(r)?r+"/"+t:t)}this.root=this.parent.root,this.packageJsonCache=this.parent.packageJsonCache}else this.result=new Set,this.root=this.path,this.packageJsonCache=e.packageJsonCache||new Map;this.seen=new Set,this.didDone=!1,this.children=0,this.node_modules=[],this.package=null,this.bundle=null}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="done"&&this.didDone&&this.emit("done",this.result),r}done(){if(!this.didDone)if(this.didDone=!0,this.parent)this.emit("done");else{let e=Array.from(this.result);this.result=e,this.emit("done",e)}}start(){let e=Ic.resolve(this.path,"package.json");return this.packageJsonCache.has(e)?this.onPackage(this.packageJsonCache.get(e)):this.readPackageJson(e),this}readPackageJson(e){Vn.readFile(e,(t,r)=>t?this.done():this.onPackageJson(e,r))}onPackageJson(e,t){try{this.package=OJ(JSON.parse(t+""))}catch{return this.done()}this.packageJsonCache.set(e,this.package),this.onPackage(this.package)}allDepsBundled(e){return Object.keys(e.dependencies||{}).concat(Object.keys(e.optionalDependencies||{}))}onPackage(e){let t=this.parent?this.allDepsBundled(e):e.bundleDependencies||e.bundledDependencies||[],r=Array.from(new Set(Array.isArray(t)?t:t===!0?this.allDepsBundled(e):Object.keys(t)));if(!r.length)return this.done();this.bundle=r,this.readModules()}readModules(){vJ(this.path+"/node_modules",(e,t)=>e?this.onReaddir([]):this.onReaddir(t))}onReaddir(e){this.node_modules=e,this.bundle.forEach(t=>this.childDep(t)),this.children===0&&this.done()}childDep(e){this.node_modules.indexOf(e)!==-1?this.seen.has(e)||(this.seen.add(e),this.child(e)):this.parent&&this.parent.childDep(e)}child(e){let t=this.path+"/node_modules/"+e;this.children+=1;let r=new i({path:t,parent:this});r.on("done",()=>{--this.children===0&&this.done()}),r.start()}},Lh=class i extends Oc{static{o(this,"BundleWalkerSync")}start(){return super.start(),this.done(),this}readPackageJson(e){try{this.onPackageJson(e,Vn.readFileSync(e))}catch{}return this}readModules(){try{this.onReaddir(CJ(this.path+"/node_modules"))}catch{this.onReaddir([])}}child(e){new i({path:this.path+"/node_modules/"+e,parent:this}).start()}},vJ=o((i,e)=>{Vn.readdir(i,(t,r)=>{if(t)e(t);else{let s=r.filter(n=>/^@/.test(n));if(!s.length)e(null,r);else{let n=r.filter(c=>!/^@/.test(c)),a=s.length;s.forEach(c=>{Vn.readdir(i+"/"+c,(u,l)=>{u||!l.length?n.push(c):n.push.apply(n,l.map(h=>c+"/"+h)),--a===0&&e(null,n)})})}}})},"readdirNodeModules"),CJ=o(i=>{let e=Vn.readdirSync(i),t=e.filter(s=>!/^@/.test(s)),r=e.filter(s=>/^@/.test(s)).map(s=>{try{let n=Vn.readdirSync(i+"/"+s);return n.length?n.map(a=>s+"/"+a):[s]}catch{return[s]}}).reduce((s,n)=>s.concat(n),[]);return t.concat(r)},"readdirNodeModulesSync"),Mh=o((i,e)=>{let t=new Promise((r,s)=>{new Oc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),RJ=o(i=>new Lh(i).start().result,"walkSync");jN.exports=Mh;Mh.sync=RJ;Mh.BundleWalker=Oc;Mh.BundleWalkerSync=Lh});var HN=d((cge,zN)=>{var AJ=$N(),{readFile:TJ,readdir:NJ,stat:PJ}=require("fs/promises"),{resolve:Bh,basename:DJ,dirname:qN}=require("path"),xJ=Ql(),LJ=o(({path:i,packageJsonCache:e})=>e.has(i)?Promise.resolve(e.get(i)):TJ(i).then(t=>{let r=xJ(JSON.parse(t));return e.set(i,r),r}).catch(()=>null),"readPackage"),VN=Symbol("package data has been normalized"),MJ=o(({path:i,packageJsonCache:e})=>LJ({path:i,packageJsonCache:e}).then(t=>{if(!t||t[VN])return t;t.bundledDependencies&&!t.bundleDependencies&&(t.bundleDependencies=t.bundledDependencies,delete t.bundledDependencies);let r=t.bundleDependencies;return r===!0&&(t.bundleDependencies=[...Object.keys(t.dependencies||{}),...Object.keys(t.optionalDependencies||{})]),typeof r=="object"&&!Array.isArray(r)&&(t.bundleDependencies=Object.keys(r)),t[VN]=!0,t}),"rpj"),kh=o(async({path:i,depth:e=1,currentDepth:t=0,pkg:r=null,result:s=null,packageJsonCache:n=null})=>{if(s||(s=new Set),n||(n=new Map),r===!0)return MJ({path:i+"/package.json",packageJsonCache:n}).then(l=>kh({path:i,depth:e,currentDepth:t,pkg:l,result:s,packageJsonCache:n}));if(r&&r.bin){let l=qN(i),h=DJ(l),f=/^@.+/.test(h)?qN(l):l,p=[];Object.keys(r.bin).forEach(y=>{let g=Bh(f,".bin",y);p.push(g,g+".cmd",g+".ps1")}),(await Promise.all(p.map(y=>PJ(y).then(()=>y).catch(()=>null)))).filter(y=>y).forEach(y=>s.add(y))}if(t>=e)return s.add(i),s;let[a,c]=await Promise.all([NJ(i,{withFileTypes:!0}),t===0&&r&&r.bundleDependencies?AJ({path:i,packageJsonCache:n}):null]).catch(()=>[]);if(!a)return s;if(!a.length&&!c&&t!==0)return s.add(i),s;let u=[];for(let l of a){let h=Bh(i,l.name);if(l.isDirectory()===!1){s.add(h);continue}if(t!==0||l.name!=="node_modules"){t<e-1?u.push(kh({path:h,packageJsonCache:n,depth:e,currentDepth:t+1,result:s})):s.add(h);continue}}return c&&u.push(...c.map(l=>{let h=Bh(i,"node_modules",l);return kh({path:h,packageJsonCache:n,pkg:!0,depth:e,currentDepth:t+1,result:s})})),u.length&&await Promise.all(u),s},"pkgContents");zN.exports=({path:i,...e})=>kh({path:Bh(i),...e,pkg:!0}).then(t=>[...t])});var Hn=d((lge,Ac)=>{"use strict";var Rc=process.platform==="win32",{URL:TS}=require("node:url"),zn=Rc?require("node:path/win32"):require("node:path"),{homedir:BJ}=require("node:os"),kJ=ol(),GN=Ss(),ZN=uy(),{log:FJ}=_t(),YN=Rc?/\\|[/]/:/[/]/,XN=/^(?:git[+])?[a-z]+:/i,UJ=/^[^@]+@[^:.]+\.[^:]+:.+$/i,PS=/[.](?:tgz|tar.gz|tar)$/i,jJ=/:[0-9]+(\/|$)/i,$J=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,qJ=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,WN="https://registry.npmjs.org";function vc(i,e){let t,r;if(typeof i=="object")return i instanceof Cc&&(!e||e===i.where)?i:i.name&&i.rawSpec?vc.resolve(i.name,i.rawSpec,e||i.where):vc(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return XN.test(i)?r=i:UJ.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(YN.test(n)||PS.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):ZN(i).validForOldPackages?(t=i,r="*"):r=i,QN(t,r,e,i)}o(vc,"npa");function VJ(i){return i?i.toLowerCase().startsWith("file:")?!0:Rc?$J.test(i):qJ.test(i):!1}o(VJ,"isFileSpec");function zJ(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(zJ,"isAliasSpec");function QN(i,e,t,r){let s=new Cc({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),VJ(e))return KN(s,t);if(zJ(e))return QJ(s,t);let n=kJ.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?ZJ(s,n):e&&XN.test(e)?XJ(s):e&&(YN.test(e)||PS.test(e))?KN(s,t):eK(s)}o(QN,"resolve");function HJ(i,e=WN){let t=vc(i);if(t.type!=="version")throw JJ(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==WN&&(r+="?repository_url="+e),r}o(HJ,"toPurl");function GJ(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(GJ,"invalidPackageName");function WJ(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(WJ,"invalidTagName");function JJ(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(JJ,"invalidPurlType");var Cc=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=ZN(e);if(!t.validForOldPackages)throw GJ(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function NS(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}FJ.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(NS,"setGitAttrs");var KJ=new Map([["\0","%00"],[" ","%09"],[`
|
|
28
|
-
`,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Rc?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function JN(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${KJ.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(JN,"pathToFileURL");function KN(i,e){i.type=PS.test(i.rawSpec)?"file":"directory",i.where=e;let t=JN(i.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let r,s;try{r=new TS(t,`${JN(zn.resolve(e))}/`),s=new TS(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return Rc&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=zn.resolve(BJ(),n.substr(3))):zn.isAbsolute(t.slice(5))?i.saveSpec=`file:${zn.resolve(a)}`:i.saveSpec=`file:${zn.relative(e,a)}`,i.fetchSpec=zn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(KN,"fromFile");function ZJ(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),NS(i,e.committish),i}o(ZJ,"fromHostedGit");function YJ(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(YJ,"unsupportedURLType");function XJ(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(jJ))return i.type="git",NS(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new TS(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",NS(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw YJ(t.protocol,e)}return i}o(XJ,"fromURL");function QJ(i,e){let t=vc(i.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(QJ,"fromAlias");function eK(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=GN.valid(e,!0),r=GN.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw WJ(e,i.raw);i.type="tag"}return i}o(eK,"fromRegistry");Ac.exports=vc;Ac.exports.resolve=QN;Ac.exports.toPurl=HJ;Ac.exports.Result=Cc});var Zn=d(At=>{"use strict";var eP=At&&At.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(At,"__esModule",{value:!0});At.WriteStreamSync=At.WriteStream=At.ReadStreamSync=At.ReadStream=void 0;var tK=eP(require("events")),tt=eP(require("fs")),iK=te(),rK=tt.default.writev,Tr=Symbol("_autoClose"),Yt=Symbol("_close"),Tc=Symbol("_ended"),J=Symbol("_fd"),DS=Symbol("_finished"),tr=Symbol("_flags"),xS=Symbol("_flush"),kS=Symbol("_handleChunk"),FS=Symbol("_makeBuf"),Pc=Symbol("_mode"),Fh=Symbol("_needDrain"),Jn=Symbol("_onerror"),Kn=Symbol("_onopen"),LS=Symbol("_onread"),Gn=Symbol("_onwrite"),Nr=Symbol("_open"),Zt=Symbol("_path"),Ar=Symbol("_pos"),mi=Symbol("_queue"),Wn=Symbol("_read"),MS=Symbol("_readSize"),er=Symbol("_reading"),Nc=Symbol("_remain"),BS=Symbol("_size"),Uh=Symbol("_write"),Cs=Symbol("_writing"),jh=Symbol("_defaultFlag"),Rs=Symbol("_errored"),$h=class extends iK.Minipass{static{o(this,"ReadStream")}[Rs]=!1;[J];[Zt];[MS];[er]=!1;[BS];[Nc];[Tr];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Rs]=!1,this[J]=typeof t.fd=="number"?t.fd:void 0,this[Zt]=e,this[MS]=t.readSize||16*1024*1024,this[er]=!1,this[BS]=typeof t.size=="number"?t.size:1/0,this[Nc]=this[BS],this[Tr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[J]=="number"?this[Wn]():this[Nr]()}get fd(){return this[J]}get path(){return this[Zt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Nr](){tt.default.open(this[Zt],"r",(e,t)=>this[Kn](e,t))}[Kn](e,t){e?this[Jn](e):(this[J]=t,this.emit("open",t),this[Wn]())}[FS](){return Buffer.allocUnsafe(Math.min(this[MS],this[Nc]))}[Wn](){if(!this[er]){this[er]=!0;let e=this[FS]();if(e.length===0)return process.nextTick(()=>this[LS](null,0,e));tt.default.read(this[J],e,0,e.length,null,(t,r,s)=>this[LS](t,r,s))}}[LS](e,t,r){this[er]=!1,e?this[Jn](e):this[kS](t,r)&&this[Wn]()}[Yt](){if(this[Tr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,tt.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Jn](e){this[er]=!0,this[Yt](),this.emit("error",e)}[kS](e,t){let r=!1;return this[Nc]-=e,e>0&&(r=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[Nc]<=0)&&(r=!1,this[Yt](),super.end()),r}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[J]=="number"&&this[Wn](),!1;case"error":return this[Rs]?!1:(this[Rs]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};At.ReadStream=$h;var US=class extends $h{static{o(this,"ReadStreamSync")}[Nr](){let e=!0;try{this[Kn](null,tt.default.openSync(this[Zt],"r")),e=!1}finally{e&&this[Yt]()}}[Wn](){let e=!0;try{if(!this[er]){this[er]=!0;do{let t=this[FS](),r=t.length===0?0:tt.default.readSync(this[J],t,0,t.length,null);if(!this[kS](r,t))break}while(!0);this[er]=!1}e=!1}finally{e&&this[Yt]()}}[Yt](){if(this[Tr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,tt.default.closeSync(e),this.emit("close")}}};At.ReadStreamSync=US;var qh=class extends tK.default{static{o(this,"WriteStream")}readable=!1;writable=!0;[Rs]=!1;[Cs]=!1;[Tc]=!1;[mi]=[];[Fh]=!1;[Zt];[Pc];[Tr];[J];[jh];[tr];[DS]=!1;[Ar];constructor(e,t){t=t||{},super(t),this[Zt]=e,this[J]=typeof t.fd=="number"?t.fd:void 0,this[Pc]=t.mode===void 0?438:t.mode,this[Ar]=typeof t.start=="number"?t.start:void 0,this[Tr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Ar]!==void 0?"r+":"w";this[jh]=t.flags===void 0,this[tr]=t.flags===void 0?r:t.flags,this[J]===void 0&&this[Nr]()}emit(e,...t){if(e==="error"){if(this[Rs])return!1;this[Rs]=!0}return super.emit(e,...t)}get fd(){return this[J]}get path(){return this[Zt]}[Jn](e){this[Yt](),this[Cs]=!0,this.emit("error",e)}[Nr](){tt.default.open(this[Zt],this[tr],this[Pc],(e,t)=>this[Kn](e,t))}[Kn](e,t){this[jh]&&this[tr]==="r+"&&e&&e.code==="ENOENT"?(this[tr]="w",this[Nr]()):e?this[Jn](e):(this[J]=t,this.emit("open",t),this[Cs]||this[xS]())}end(e,t){return e&&this.write(e,t),this[Tc]=!0,!this[Cs]&&!this[mi].length&&typeof this[J]=="number"&&this[Gn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Tc]?(this.emit("error",new Error("write() after end()")),!1):this[J]===void 0||this[Cs]||this[mi].length?(this[mi].push(e),this[Fh]=!0,!1):(this[Cs]=!0,this[Uh](e),!0)}[Uh](e){tt.default.write(this[J],e,0,e.length,this[Ar],(t,r)=>this[Gn](t,r))}[Gn](e,t){e?this[Jn](e):(this[Ar]!==void 0&&typeof t=="number"&&(this[Ar]+=t),this[mi].length?this[xS]():(this[Cs]=!1,this[Tc]&&!this[DS]?(this[DS]=!0,this[Yt](),this.emit("finish")):this[Fh]&&(this[Fh]=!1,this.emit("drain"))))}[xS](){if(this[mi].length===0)this[Tc]&&this[Gn](null,0);else if(this[mi].length===1)this[Uh](this[mi].pop());else{let e=this[mi];this[mi]=[],rK(this[J],e,this[Ar],(t,r)=>this[Gn](t,r))}}[Yt](){if(this[Tr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,tt.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};At.WriteStream=qh;var jS=class extends qh{static{o(this,"WriteStreamSync")}[Nr](){let e;if(this[jh]&&this[tr]==="r+")try{e=tt.default.openSync(this[Zt],this[tr],this[Pc])}catch(t){if(t?.code==="ENOENT")return this[tr]="w",this[Nr]();throw t}else e=tt.default.openSync(this[Zt],this[tr],this[Pc]);this[Kn](null,e)}[Yt](){if(this[Tr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,tt.default.closeSync(e),this.emit("close")}}[Uh](e){let t=!0;try{this[Gn](null,tt.default.writeSync(this[J],e,0,e.length,this[Ar])),t=!1}finally{if(t)try{this[Yt]()}catch{}}}};At.WriteStreamSync=jS});var Vh=d(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.dealias=Se.isNoFile=Se.isFile=Se.isAsync=Se.isSync=Se.isAsyncNoFile=Se.isSyncNoFile=Se.isAsyncFile=Se.isSyncFile=void 0;var sK=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),nK=o(i=>!!i.sync&&!!i.file,"isSyncFile");Se.isSyncFile=nK;var oK=o(i=>!i.sync&&!!i.file,"isAsyncFile");Se.isAsyncFile=oK;var aK=o(i=>!!i.sync&&!i.file,"isSyncNoFile");Se.isSyncNoFile=aK;var cK=o(i=>!i.sync&&!i.file,"isAsyncNoFile");Se.isAsyncNoFile=cK;var uK=o(i=>!!i.sync,"isSync");Se.isSync=uK;var lK=o(i=>!i.sync,"isAsync");Se.isAsync=lK;var hK=o(i=>!!i.file,"isFile");Se.isFile=hK;var fK=o(i=>!i.file,"isNoFile");Se.isNoFile=fK;var dK=o(i=>{let e=sK.get(i);return e||i},"dealiasKey"),pK=o((i={})=>{if(!i)return{};let e={};for(let[t,r]of Object.entries(i)){let s=dK(t);e[s]=r}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e},"dealias");Se.dealias=pK});var Yn=d(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.makeCommand=void 0;var Dc=Vh(),mK=o((i,e,t,r,s)=>Object.assign((n=[],a,c)=>{Array.isArray(n)&&(a=n,n={}),typeof a=="function"&&(c=a,a=void 0),a?a=Array.from(a):a=[];let u=(0,Dc.dealias)(n);if(s?.(u,a),(0,Dc.isSyncFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return i(u,a)}else if((0,Dc.isAsyncFile)(u)){let l=e(u,a),h=c||void 0;return h?l.then(()=>h(),h):l}else if((0,Dc.isSyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,a)}else if((0,Dc.isAsyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback only supported with file option");return r(u,a)}else throw new Error("impossible options??")},{syncFile:i,asyncFile:e,syncNoFile:t,asyncNoFile:r,validate:s}),"makeCommand");zh.makeCommand=mK});var $S=d(Xn=>{"use strict";var gK=Xn&&Xn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.constants=void 0;var yK=gK(require("zlib")),SK=yK.default.constants||{ZLIB_VERNUM:4736};Xn.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},SK))});var Lc=d(j=>{"use strict";var EK=j&&j.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),wK=j&&j.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),_K=j&&j.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&EK(t,e,r[s]);return wK(t,e),t}})(),bK=j&&j.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(j,"__esModule",{value:!0});j.ZstdDecompress=j.ZstdCompress=j.BrotliDecompress=j.BrotliCompress=j.Unzip=j.InflateRaw=j.DeflateRaw=j.Gunzip=j.Gzip=j.Inflate=j.Deflate=j.Zlib=j.ZlibError=j.constants=void 0;var zS=bK(require("assert")),As=require("buffer"),IK=te(),tP=_K(require("zlib")),gi=$S(),OK=$S();Object.defineProperty(j,"constants",{enumerable:!0,get:o(function(){return OK.constants},"get")});var vK=As.Buffer.concat,iP=Object.getOwnPropertyDescriptor(As.Buffer,"concat"),CK=o(i=>i,"noop"),qS=iP?.writable===!0||iP?.set!==void 0?i=>{As.Buffer.concat=i?CK:vK}:i=>{},Ts=Symbol("_superWrite"),Ns=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};j.ZlibError=Ns;var VS=Symbol("flushFlag"),xc=class extends IK.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#i;#r;#s;#u;#c;get sawError(){return this.#e}get handle(){return this.#u}get flushFlag(){return this.#i}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#s=e.fullFlushFlag??0,typeof tP[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#u=new tP[t](e)}catch(r){throw new Ns(r,this.constructor)}this.#c=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#u?.on("error",r=>this.#c(new Ns(r))),this.once("end",()=>this.close)}close(){this.#u&&(this.#u.close(),this.#u=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,zS.default)(this.#u,"zlib binding closed"),this.#u.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#s),this.write(Object.assign(As.Buffer.alloc(0),{[VS]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Ts](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=As.Buffer.from(e,t)),this.#e)return;(0,zS.default)(this.#u,"zlib binding closed");let s=this.#u._handle,n=s.close;s.close=()=>{};let a=this.#u.close;this.#u.close=()=>{},qS(!0);let c;try{let l=typeof e[VS]=="number"?e[VS]:this.#i;c=this.#u._processChunk(e,l),qS(!1)}catch(l){qS(!1),this.#c(new Ns(l,this.write))}finally{this.#u&&(this.#u._handle=s,s.close=n,this.#u.close=a,this.#u.removeAllListeners("error"))}this.#u&&this.#u.on("error",l=>this.#c(new Ns(l,this.write)));let u;if(c)if(Array.isArray(c)&&c.length>0){let l=c[0];u=this[Ts](As.Buffer.from(l));for(let h=1;h<c.length;h++)u=this[Ts](c[h])}else u=this[Ts](As.Buffer.from(c));return r&&r(),u}},yi=class extends xc{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||gi.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||gi.constants.Z_FINISH,e.fullFlushFlag=gi.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(gi.constants.Z_SYNC_FLUSH),(0,zS.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(s,n)=>{typeof s=="function"&&(n=s,s=this.flushFlag),this.flush(s),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};j.Zlib=yi;var HS=class extends yi{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};j.Deflate=HS;var GS=class extends yi{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};j.Inflate=GS;var WS=class extends yi{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Ts](e){return this.#e?(this.#e=!1,e[9]=255,super[Ts](e)):super[Ts](e)}};j.Gzip=WS;var JS=class extends yi{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};j.Gunzip=JS;var KS=class extends yi{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};j.DeflateRaw=KS;var ZS=class extends yi{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};j.InflateRaw=ZS;var YS=class extends yi{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};j.Unzip=YS;var Hh=class extends xc{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||gi.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||gi.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=gi.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},XS=class extends Hh{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};j.BrotliCompress=XS;var QS=class extends Hh{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};j.BrotliDecompress=QS;var Gh=class extends xc{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||gi.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||gi.constants.ZSTD_e_end,e.fullFlushFlag=gi.constants.ZSTD_e_flush,super(e,t)}},eE=class extends Gh{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};j.ZstdCompress=eE;var tE=class extends Gh{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};j.ZstdDecompress=tE});var nP=d(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.parse=Qn.encode=void 0;var RK=o((i,e)=>{if(Number.isSafeInteger(i))i<0?TK(i,e):AK(i,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},"encode");Qn.encode=RK;var AK=o((i,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=i&255,i=Math.floor(i/256)},"encodePositive"),TK=o((i,e)=>{e[0]=255;var t=!1;i=i*-1;for(var r=e.length;r>1;r--){var s=i&255;i=Math.floor(i/256),t?e[r-1]=rP(s):s===0?e[r-1]=0:(t=!0,e[r-1]=sP(s))}},"encodeNegative"),NK=o(i=>{let e=i[0],t=e===128?DK(i.subarray(1,i.length)):e===255?PK(i):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},"parse");Qn.parse=NK;var PK=o(i=>{for(var e=i.length,t=0,r=!1,s=e-1;s>-1;s--){var n=Number(i[s]),a;r?a=rP(n):n===0?a=n:(r=!0,a=sP(n)),a!==0&&(t-=a*Math.pow(256,e-s-1))}return t},"twos"),DK=o(i=>{for(var e=i.length,t=0,r=e-1;r>-1;r--){var s=Number(i[r]);s!==0&&(t+=s*Math.pow(256,e-r-1))}return t},"pos"),rP=o(i=>(255^i)&255,"onesComp"),sP=o(i=>(255^i)+1&255,"twosComp")});var iE=d(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.code=mt.name=mt.isName=mt.isCode=void 0;var xK=o(i=>mt.name.has(i),"isCode");mt.isCode=xK;var LK=o(i=>mt.code.has(i),"isName");mt.isName=LK;mt.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);mt.code=new Map(Array.from(mt.name).map(i=>[i[1],i[0]]))});var to=d(Si=>{"use strict";var MK=Si&&Si.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),BK=Si&&Si.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),oP=Si&&Si.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&MK(e,i,t);return BK(e,i),e};Object.defineProperty(Si,"__esModule",{value:!0});Si.Header=void 0;var eo=require("node:path"),aP=oP(nP()),Mc=oP(iE()),nE=class{static{o(this,"Header")}cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,r,s){Buffer.isBuffer(e)?this.decode(e,t||0,r,s):e&&this.#t(e)}decode(e,t,r,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=Ps(e,t,100),this.mode=Pr(e,t+100,8),this.uid=Pr(e,t+108,8),this.gid=Pr(e,t+116,8),this.size=Pr(e,t+124,12),this.mtime=rE(e,t+136,12),this.cksum=Pr(e,t+148,12),s&&this.#t(s,!0),r&&this.#t(r);let n=Ps(e,t+156,1);if(Mc.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ps(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Ps(e,t+265,32),this.gname=Ps(e,t+297,32),this.devmaj=Pr(e,t+329,8)??0,this.devmin=Pr(e,t+337,8)??0,e[t+475]!==0){let c=Ps(e,t+345,155);this.path=c+"/"+this.path}else{let c=Ps(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=rE(e,t+476,12),this.ctime=rE(e,t+488,12)}let a=256;for(let c=t;c<t+148;c++)a+=e[c];for(let c=t+156;c<t+512;c++)a+=e[c];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#t(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t||r==="linkpath"&&t||r==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let r=this.ctime||this.atime?130:155,s=kK(this.path||"",r),n=s[0],a=s[1];this.needPax=!!s[2],this.needPax=Ds(e,t,100,n)||this.needPax,this.needPax=Dr(e,t+100,8,this.mode)||this.needPax,this.needPax=Dr(e,t+108,8,this.uid)||this.needPax,this.needPax=Dr(e,t+116,8,this.gid)||this.needPax,this.needPax=Dr(e,t+124,12,this.size)||this.needPax,this.needPax=sE(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=Ds(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Ds(e,t+265,32,this.uname)||this.needPax,this.needPax=Ds(e,t+297,32,this.gname)||this.needPax,this.needPax=Dr(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Dr(e,t+337,8,this.devmin)||this.needPax,this.needPax=Ds(e,t+345,r,a)||this.needPax,e[t+475]!==0?this.needPax=Ds(e,t+345,155,a)||this.needPax:(this.needPax=Ds(e,t+345,130,a)||this.needPax,this.needPax=sE(e,t+476,12,this.atime)||this.needPax,this.needPax=sE(e,t+488,12,this.ctime)||this.needPax);let c=256;for(let u=t;u<t+148;u++)c+=e[u];for(let u=t+156;u<t+512;u++)c+=e[u];return this.cksum=c,Dr(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Mc.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Mc.code.get(e));if(Mc.isCode(t)||t==="Unsupported")this.#e=t;else if(Mc.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};Si.Header=nE;var kK=o((i,e)=>{let r=i,s="",n,a=eo.posix.parse(i).root||".";if(Buffer.byteLength(r)<100)n=[r,s,!1];else{s=eo.posix.dirname(r),r=eo.posix.basename(r);do Buffer.byteLength(r)<=100&&Buffer.byteLength(s)<=e?n=[r,s,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(s)<=e?n=[r.slice(0,99),s,!0]:(r=eo.posix.join(eo.posix.basename(s),r),s=eo.posix.dirname(s));while(s!==a&&n===void 0);n||(n=[i.slice(0,99),"",!0])}return n},"splitPrefix"),Ps=o((i,e,t)=>i.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),"decString"),rE=o((i,e,t)=>FK(Pr(i,e,t)),"decDate"),FK=o(i=>i===void 0?void 0:new Date(i*1e3),"numToDate"),Pr=o((i,e,t)=>Number(i[e])&128?aP.parse(i.subarray(e,e+t)):jK(i,e,t),"decNumber"),UK=o(i=>isNaN(i)?void 0:i,"nanUndef"),jK=o((i,e,t)=>UK(parseInt(i.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),"decSmallNumber"),$K={12:8589934591,8:2097151},Dr=o((i,e,t,r)=>r===void 0?!1:r>$K[t]||r<0?(aP.encode(r,i.subarray(e,e+t)),!0):(qK(i,e,t,r),!1),"encNumber"),qK=o((i,e,t,r)=>i.write(VK(r,t),e,t,"ascii"),"encSmallNumber"),VK=o((i,e)=>zK(Math.floor(i).toString(8),e),"octalString"),zK=o((i,e)=>(i.length===e-1?i:new Array(e-i.length-1).join("0")+i+" ")+"\0","padOctal"),sE=o((i,e,t,r)=>r===void 0?!1:Dr(i,e,t,r.getTime()/1e3),"encDate"),HK=new Array(156).join("\0"),Ds=o((i,e,t,r)=>r===void 0?!1:(i.write(r+HK,e,t,"utf8"),r.length!==Buffer.byteLength(r)||r.length>t),"encString")});var Jh=d(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.Pax=void 0;var GK=require("node:path"),WK=to(),oE=class i{static{o(this,"Pax")}atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),r=512*Math.ceil(1+t/512),s=Buffer.allocUnsafe(r);for(let n=0;n<512;n++)s[n]=0;new WK.Header({path:("PaxHeader/"+(0,GK.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(s),s.write(e,512,t,"utf8");for(let n=t+512;n<s.length;n++)s[n]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],r=t instanceof Date?t.getTime()/1e3:t,s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
|
|
29
|
-
`,n=Buffer.byteLength(s),a=Math.floor(Math.log(n)/Math.log(10))+1;return n+a>=Math.pow(10,a)&&(a+=1),a+n+s}static parse(e,t,r=!1){return new i(
|
|
30
|
-
`).reduce(ZK,Object.create(null)),"parseKV"),ZK=o((i,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return i;e=e.slice((t+" ").length);let r=e.split("="),s=r.shift();if(!s)return i;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),a=r.join("=");return i[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(a)*1e3):/^[0-9]+$/.test(a)?+a:a,i},"parseKVLine")});var io=d(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.normalizeWindowsPath=void 0;var YK=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Kh.normalizeWindowsPath=YK!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")});var Xh=d(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.ReadEntry=void 0;var XK=te(),Zh=io(),aE=class extends XK.Minipass{static{o(this,"ReadEntry")}extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,Zh.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,Zh.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=(0,Zh.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,Zh.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}};Yh.ReadEntry=aE});var ef=d(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.warnMethod=void 0;var QK=o((i,e,t,r={})=>{i.file&&(r.file=i.file),i.cwd&&(r.cwd=i.cwd),r.code=t instanceof Error&&t.code||e,r.tarCode=e,!i.strict&&r.recoverable!==!1?(t instanceof Error&&(r=Object.assign(t,r),t=t.message),i.emit("warn",e,t,r)):t instanceof Error?i.emit("error",Object.assign(t,r)):i.emit("error",Object.assign(new Error(`${e}: ${t}`),r))},"warnMethod");Qh.warnMethod=QK});var uf=d(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.Parser=void 0;var eZ=require("events"),cE=Lc(),cP=to(),uP=Jh(),tZ=Xh(),iZ=ef(),rZ=1024*1024,dE=Buffer.from([31,139]),pE=Buffer.from([40,181,47,253]),sZ=Math.max(dE.length,pE.length),Tt=Symbol("state"),xs=Symbol("writeEntry"),ir=Symbol("readEntry"),uE=Symbol("nextEntry"),lP=Symbol("processEntry"),Ei=Symbol("extendedHeader"),Bc=Symbol("globalExtendedHeader"),xr=Symbol("meta"),hP=Symbol("emitMeta"),ie=Symbol("buffer"),rr=Symbol("queue"),Lr=Symbol("ended"),lE=Symbol("emittedEnd"),Ls=Symbol("emit"),Ee=Symbol("unzip"),tf=Symbol("consumeChunk"),rf=Symbol("consumeChunkSub"),hE=Symbol("consumeBody"),fP=Symbol("consumeMeta"),dP=Symbol("consumeHeader"),kc=Symbol("consuming"),fE=Symbol("bufferConcat"),sf=Symbol("maybeEnd"),ro=Symbol("writing"),Mr=Symbol("aborted"),nf=Symbol("onDone"),Ms=Symbol("sawValidEntry"),of=Symbol("sawNullBlock"),af=Symbol("sawEOF"),pP=Symbol("closeStream"),nZ=o(()=>!0,"noop"),mE=class extends eZ.EventEmitter{static{o(this,"Parser")}file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[rr]=[];[ie];[ir];[xs];[Tt]="begin";[xr]="";[Ei];[Bc];[Lr]=!1;[Ee];[Mr]=!1;[Ms];[of]=!1;[af]=!1;[ro]=!1;[kc]=!1;[lE]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(nf,()=>{(this[Tt]==="begin"||this[Ms]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(nf,e.ondone):this.on(nf,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||rZ,this.filter=typeof e.filter=="function"?e.filter:nZ;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[pP]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){(0,iZ.warnMethod)(this,e,t,r)}[dP](e,t){this[Ms]===void 0&&(this[Ms]=!1);let r;try{r=new cP.Header(e,t,this[Ei],this[Bc])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[of]?(this[af]=!0,this[Tt]==="begin"&&(this[Tt]="header"),this[Ls]("eof")):(this[of]=!0,this[Ls]("nullBlock"));else if(this[of]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{let n=this[xs]=new tZ.ReadEntry(r,this[Ei],this[Bc]);if(!this[Ms])if(n.remain){let a=o(()=>{n.invalid||(this[Ms]=!0)},"onend");n.on("end",a)}else this[Ms]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Ls]("ignoredEntry",n),this[Tt]="ignore",n.resume()):n.size>0&&(this[xr]="",n.on("data",a=>this[xr]+=a),this[Tt]="meta"):(this[Ei]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Ls]("ignoredEntry",n),this[Tt]=n.remain?"ignore":"header",n.resume()):(n.remain?this[Tt]="body":(this[Tt]="header",n.end()),this[ir]?this[rr].push(n):(this[rr].push(n),this[uE]())))}}}[pP](){queueMicrotask(()=>this.emit("close"))}[lP](e){let t=!0;if(!e)this[ir]=void 0,t=!1;else if(Array.isArray(e)){let[r,...s]=e;this.emit(r,...s)}else this[ir]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[uE]()),t=!1);return t}[uE](){do;while(this[lP](this[rr].shift()));if(!this[rr].length){let e=this[ir];!e||e.flowing||e.size===e.remain?this[ro]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[hE](e,t){let r=this[xs];if(!r)throw new Error("attempt to consume body without entry??");let s=r.blockRemain??0,n=s>=e.length&&t===0?e:e.subarray(t,t+s);return r.write(n),r.blockRemain||(this[Tt]="header",this[xs]=void 0,r.end()),n.length}[fP](e,t){let r=this[xs],s=this[hE](e,t);return!this[xs]&&r&&this[hP](r),s}[Ls](e,t,r){!this[rr].length&&!this[ir]?this.emit(e,t,r):this[rr].push([e,t,r])}[hP](e){switch(this[Ls]("meta",this[xr]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Ei]=uP.Pax.parse(this[xr],this[Ei],!1);break;case"GlobalExtendedHeader":this[Bc]=uP.Pax.parse(this[xr],this[Bc],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[Ei]??Object.create(null);this[Ei]=t,t.path=this[xr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[Ei]||Object.create(null);this[Ei]=t,t.linkpath=this[xr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Mr]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Mr])return r?.(),!1;if((this[Ee]===void 0||this.brotli===void 0&&this[Ee]===!1)&&e){if(this[ie]&&(e=Buffer.concat([this[ie],e]),this[ie]=void 0),e.length<sZ)return this[ie]=e,r?.(),!0;for(let u=0;this[Ee]===void 0&&u<dE.length;u++)e[u]!==dE[u]&&(this[Ee]=!1);let a=!1;if(this[Ee]===!1&&this.zstd!==!1){a=!0;for(let u=0;u<pE.length;u++)if(e[u]!==pE[u]){a=!1;break}}let c=this.brotli===void 0&&!a;if(this[Ee]===!1&&c)if(e.length<512)if(this[Lr])this.brotli=!0;else return this[ie]=e,r?.(),!0;else try{new cP.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[Ee]===void 0||this[Ee]===!1&&(this.brotli||a)){let u=this[Lr];this[Lr]=!1,this[Ee]=this[Ee]===void 0?new cE.Unzip({}):a?new cE.ZstdDecompress({}):new cE.BrotliDecompress({}),this[Ee].on("data",h=>this[tf](h)),this[Ee].on("error",h=>this.abort(h)),this[Ee].on("end",()=>{this[Lr]=!0,this[tf]()}),this[ro]=!0;let l=!!this[Ee][u?"end":"write"](e);return this[ro]=!1,r?.(),l}}this[ro]=!0,this[Ee]?this[Ee].write(e):this[tf](e),this[ro]=!1;let n=this[rr].length?!1:this[ir]?this[ir].flowing:!0;return!n&&!this[rr].length&&this[ir]?.once("drain",()=>this.emit("drain")),r?.(),n}[fE](e){e&&!this[Mr]&&(this[ie]=this[ie]?Buffer.concat([this[ie],e]):e)}[sf](){if(this[Lr]&&!this[lE]&&!this[Mr]&&!this[kc]){this[lE]=!0;let e=this[xs];if(e&&e.blockRemain){let t=this[ie]?this[ie].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[ie]&&e.write(this[ie]),e.end()}this[Ls](nf)}}[tf](e){if(this[kc]&&e)this[fE](e);else if(!e&&!this[ie])this[sf]();else if(e){if(this[kc]=!0,this[ie]){this[fE](e);let t=this[ie];this[ie]=void 0,this[rf](t)}else this[rf](e);for(;this[ie]&&this[ie]?.length>=512&&!this[Mr]&&!this[af];){let t=this[ie];this[ie]=void 0,this[rf](t)}this[kc]=!1}(!this[ie]||this[Lr])&&this[sf]()}[rf](e){let t=0,r=e.length;for(;t+512<=r&&!this[Mr]&&!this[af];)switch(this[Tt]){case"begin":case"header":this[dP](e,t),t+=512;break;case"ignore":case"body":t+=this[hE](e,t);break;case"meta":t+=this[fP](e,t);break;default:throw new Error("invalid state: "+this[Tt])}t<r&&(this[ie]?this[ie]=Buffer.concat([e.subarray(t),this[ie]]):this[ie]=e.subarray(t))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),r&&this.once("finish",r),this[Mr]||(this[Ee]?(e&&this[Ee].write(e),this[Ee].end()):(this[Lr]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[sf]())),this}};cf.Parser=mE});var hf=d(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.stripTrailingSlashes=void 0;var oZ=o(i=>{let e=i.length-1,t=-1;for(;e>-1&&i.charAt(e)==="/";)t=e,e--;return t===-1?i:i.slice(0,t)},"stripTrailingSlashes");lf.stripTrailingSlashes=oZ});var no=d(Je=>{"use strict";var aZ=Je&&Je.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),cZ=Je&&Je.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uZ=Je&&Je.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&aZ(e,i,t);return cZ(e,i),e},lZ=Je&&Je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Je,"__esModule",{value:!0});Je.list=Je.filesFilter=void 0;var hZ=uZ(Zn()),so=lZ(require("node:fs")),mP=require("path"),fZ=Yn(),ff=uf(),gE=hf(),dZ=o(i=>{let e=i.onReadEntry;i.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},"onReadEntryFunction"),pZ=o((i,e)=>{let t=new Map(e.map(n=>[(0,gE.stripTrailingSlashes)(n),!0])),r=i.filter,s=o((n,a="")=>{let c=a||(0,mP.parse)(n).root||".",u;if(n===c)u=!1;else{let l=t.get(n);l!==void 0?u=l:u=s((0,mP.dirname)(n),c)}return t.set(n,u),u},"mapHas");i.filter=r?(n,a)=>r(n,a)&&s((0,gE.stripTrailingSlashes)(n)):n=>s((0,gE.stripTrailingSlashes)(n))},"filesFilter");Je.filesFilter=pZ;var mZ=o(i=>{let e=new ff.Parser(i),t=i.file,r;try{r=so.default.openSync(t,"r");let s=so.default.fstatSync(r),n=i.maxReadSize||16*1024*1024;if(s.size<n){let a=Buffer.allocUnsafe(s.size);so.default.readSync(r,a,0,s.size,0),e.end(a)}else{let a=0,c=Buffer.allocUnsafe(n);for(;a<s.size;){let u=so.default.readSync(r,c,0,n,a);a+=u,e.write(c.subarray(0,u))}e.end()}}finally{if(typeof r=="number")try{so.default.closeSync(r)}catch{}}},"listFileSync"),gZ=o((i,e)=>{let t=new ff.Parser(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("end",a),so.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new hZ.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"listFile");Je.list=(0,fZ.makeCommand)(mZ,gZ,i=>new ff.Parser(i),i=>new ff.Parser(i),(i,e)=>{e?.length&&(0,Je.filesFilter)(i,e),i.noResume||dZ(i)})});var gP=d(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.modeFix=void 0;var yZ=o((i,e,t)=>(i&=4095,t&&(i=(i|384)&-19),e&&(i&256&&(i|=64),i&32&&(i|=8),i&4&&(i|=1)),i),"modeFix");df.modeFix=yZ});var yE=d(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.stripAbsolutePath=void 0;var SZ=require("node:path"),{isAbsolute:EZ,parse:yP}=SZ.win32,wZ=o(i=>{let e="",t=yP(i);for(;EZ(i)||t.root;){let r=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":t.root;i=i.slice(r.length),e+=r,t=yP(i)}return[e,i]},"stripAbsolutePath");pf.stripAbsolutePath=wZ});var EE=d(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.decode=oo.encode=void 0;var mf=["|","<",">","?",":"],SE=mf.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),_Z=new Map(mf.map((i,e)=>[i,SE[e]])),bZ=new Map(SE.map((i,e)=>[i,mf[e]])),IZ=o(i=>mf.reduce((e,t)=>e.split(t).join(_Z.get(t)),i),"encode");oo.encode=IZ;var OZ=o(i=>SE.reduce((e,t)=>e.split(t).join(bZ.get(t)),i),"decode");oo.decode=OZ});var NE=d(Fe=>{"use strict";var vZ=Fe&&Fe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),CZ=Fe&&Fe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),RZ=Fe&&Fe.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&vZ(e,i,t);return CZ(e,i),e},IP=Fe&&Fe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.WriteEntryTar=Fe.WriteEntrySync=Fe.WriteEntry=void 0;var _i=IP(require("fs")),OP=te(),SP=IP(require("path")),vP=to(),CP=gP(),wi=io(),RP=Vh(),AP=Jh(),TP=yE(),AZ=hf(),NP=ef(),TZ=RZ(EE()),PP=o((i,e)=>e?(i=(0,wi.normalizeWindowsPath)(i).replace(/^\.(\/|$)/,""),(0,AZ.stripTrailingSlashes)(e)+"/"+i):(0,wi.normalizeWindowsPath)(i),"prefixPath"),NZ=16*1024*1024,EP=Symbol("process"),wP=Symbol("file"),_P=Symbol("directory"),_E=Symbol("symlink"),bP=Symbol("hardlink"),Fc=Symbol("header"),gf=Symbol("read"),bE=Symbol("lstat"),yf=Symbol("onlstat"),IE=Symbol("onread"),OE=Symbol("onreadlink"),vE=Symbol("openfile"),CE=Symbol("onopenfile"),Br=Symbol("close"),Sf=Symbol("mode"),RE=Symbol("awaitDrain"),wE=Symbol("ondrain"),bi=Symbol("prefix"),Ef=class extends OP.Minipass{static{o(this,"WriteEntry")}path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let r=(0,RP.dealias)(t);super(),this.path=(0,wi.normalizeWindowsPath)(e),this.portable=!!r.portable,this.maxReadSize=r.maxReadSize||NZ,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=(0,wi.normalizeWindowsPath)(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime,this.prefix=r.prefix?(0,wi.normalizeWindowsPath)(r.prefix):void 0,this.onWriteEntry=r.onWriteEntry,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let s=!1;if(!this.preservePaths){let[a,c]=(0,TP.stripAbsolutePath)(this.path);a&&typeof c=="string"&&(this.path=c,s=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=TZ.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,wi.normalizeWindowsPath)(r.absolute||SP.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let n=this.statCache.get(this.absolute);n?this[yf](n):this[bE]()}warn(e,t,r={}){return(0,NP.warnMethod)(this,e,t,r)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[bE](){_i.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[yf](t)})}[yf](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=PZ(e),this.emit("stat",e),this[EP]()}[EP](){switch(this.type){case"File":return this[wP]();case"Directory":return this[_P]();case"SymbolicLink":return this[_E]();default:return this.end()}}[Sf](e){return(0,CP.modeFix)(e,this.type==="Directory",this.portable)}[bi](e){return PP(e,this.prefix)}[Fc](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new vP.Header({path:this[bi](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bi](this.linkpath):this.linkpath,mode:this[Sf](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new AP.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[bi](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bi](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[_P](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Fc](),this.end()}[_E](){_i.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[OE](t)})}[OE](e){this.linkpath=(0,wi.normalizeWindowsPath)(e),this[Fc](),this.end()}[bP](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,wi.normalizeWindowsPath)(SP.default.relative(this.cwd,e)),this.stat.size=0,this[Fc](),this.end()}[wP](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[bP](t);this.linkCache.set(e,this.absolute)}if(this[Fc](),this.stat.size===0)return this.end();this[vE]()}[vE](){_i.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[CE](t)})}[CE](e){if(this.fd=e,this.#e)return this[Br]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[gf]()}[gf](){let{fd:e,buf:t,offset:r,length:s,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");_i.default.read(e,t,r,s,n,(a,c)=>{if(a)return this[Br](()=>this.emit("error",a));this[IE](c)})}[Br](e=()=>{}){this.fd!==void 0&&_i.default.close(this.fd,e)}[IE](e){if(e<=0&&this.remain>0){let s=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Br](()=>this.emit("error",s))}if(e>this.remain){let s=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Br](()=>this.emit("error",s))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let s=e;s<this.length&&e<this.blockRemain;s++)this.buf[s+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[wE]():this[RE](()=>this[wE]())}[RE](e){this.once("drain",e)}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let s=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",s)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,r)}[wE](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Br](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[gf]()}};Fe.WriteEntry=Ef;var AE=class extends Ef{static{o(this,"WriteEntrySync")}sync=!0;[bE](){this[yf](_i.default.lstatSync(this.absolute))}[_E](){this[OE](_i.default.readlinkSync(this.absolute))}[vE](){this[CE](_i.default.openSync(this.absolute,"r"))}[gf](){let e=!0;try{let{fd:t,buf:r,offset:s,length:n,pos:a}=this;if(t===void 0||r===void 0)throw new Error("fd and buf must be set in READ method");let c=_i.default.readSync(t,r,s,n,a);this[IE](c),e=!1}finally{if(e)try{this[Br](()=>{})}catch{}}}[RE](e){e()}[Br](e=()=>{}){this.fd!==void 0&&_i.default.closeSync(this.fd),e()}};Fe.WriteEntrySync=AE;var TE=class extends OP.Minipass{static{o(this,"WriteEntryTar")}blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,r={}){return(0,NP.warnMethod)(this,e,t,r)}constructor(e,t={}){let r=(0,RP.dealias)(t);super(),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.onWriteEntry=r.onWriteEntry,this.readEntry=e;let{type:s}=e;if(s==="Unsupported")throw new Error("writing entry that should be ignored");this.type=s,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix,this.path=(0,wi.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[Sf](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:r.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,wi.normalizeWindowsPath)(e.linkpath):void 0,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[c,u]=(0,TP.stripAbsolutePath)(this.path);c&&typeof u=="string"&&(this.path=u,n=c)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new vP.Header({path:this[bi](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bi](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new AP.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[bi](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bi](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let a=this.header?.block;if(!a)throw new Error("failed to encode header");super.write(a),e.pipe(this)}[bi](e){return PP(e,this.prefix)}[Sf](e){return(0,CP.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,r){typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let s=e.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(e,r)}end(e,t,r){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),r&&this.once("finish",r),e?super.end(e,r):super.end(r),this}};Fe.WriteEntryTar=TE;var PZ=o(i=>i.isFile()?"File":i.isDirectory()?"Directory":i.isSymbolicLink()?"SymbolicLink":"Unsupported","getType")});var DP=d(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.Node=co.Yallist=void 0;var PE=class i{static{o(this,"Yallist")}tail;head;length=0;static create(e=[]){return new i(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,r=e.length;t<r;t++)xZ(this,e[t]);return this.length}unshift(...e){for(var t=0,r=e.length;t<r;t++)LZ(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let r=this.head,s=0;r;s++)e.call(t,r.value,s,this),r=r.next}forEachReverse(e,t){t=t||this;for(let r=this.tail,s=this.length-1;r;s--)e.call(t,r.value,s,this),r=r.prev}get(e){let t=0,r=this.head;for(;r&&t<e;t++)r=r.next;if(t===e&&r)return r.value}getReverse(e){let t=0,r=this.tail;for(;r&&t<e;t++)r=r.prev;if(t===e&&r)return r.value}map(e,t){t=t||this;let r=new i;for(let s=this.head;s;)r.push(e.call(t,s.value,this)),s=s.next;return r}mapReverse(e,t){t=t||this;var r=new i;for(let s=this.tail;s;)r.push(e.call(t,s.value,this)),s=s.prev;return r}reduce(e,t){let r,s=this.head;if(arguments.length>1)r=t;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s;n++)r=e(r,s.value,n),s=s.next;return r}reduceReverse(e,t){let r,s=this.tail;if(arguments.length>1)r=t;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;s;n--)r=e(r,s.value,n),s=s.prev;return r}toArray(){let e=new Array(this.length);for(let t=0,r=this.head;r;t++)e[t]=r.value,r=r.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,r=this.tail;r;t++)e[t]=r.value,r=r.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.head,n=0;for(n=0;s&&n<e;n++)s=s.next;for(;s&&n<t;n++,s=s.next)r.push(s.value);return r}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.length,n=this.tail;for(;n&&s>t;s--)n=n.prev;for(;n&&s>e;s--,n=n.prev)r.push(n.value);return r}splice(e,t=0,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let s=this.head;for(let a=0;s&&a<e;a++)s=s.next;let n=[];for(let a=0;s&&a<t;a++)n.push(s.value),s=this.removeNode(s);s?s!==this.tail&&(s=s.prev):s=this.tail;for(let a of r)s=DZ(this,s,a);return n}reverse(){let e=this.head,t=this.tail;for(let r=e;r;r=r.prev){let s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this}};co.Yallist=PE;function DZ(i,e,t){let r=e,s=e?e.next:i.head,n=new ao(t,r,s,i);return n.next===void 0&&(i.tail=n),n.prev===void 0&&(i.head=n),i.length++,n}o(DZ,"insertAfter");function xZ(i,e){i.tail=new ao(e,i.tail,void 0,i),i.head||(i.head=i.tail),i.length++}o(xZ,"push");function LZ(i,e){i.head=new ao(e,void 0,i.head,i),i.tail||(i.tail=i.head),i.length++}o(LZ,"unshift");var ao=class{static{o(this,"Node")}list;next;prev;value;constructor(e,t,r,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,r?(r.prev=this,this.next=r):this.next=void 0}};co.Node=ao});var Rf=d(Ue=>{"use strict";var MZ=Ue&&Ue.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),BZ=Ue&&Ue.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),kZ=Ue&&Ue.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&MZ(e,i,t);return BZ(e,i),e},FP=Ue&&Ue.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.PackSync=Ue.Pack=Ue.PackJob=void 0;var vf=FP(require("fs")),kE=NE(),$c=class{static{o(this,"PackJob")}path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};Ue.PackJob=$c;var FZ=te(),DE=kZ(Lc()),UZ=DP(),jZ=Xh(),$Z=ef(),xP=Buffer.alloc(1024),wf=Symbol("onStat"),Uc=Symbol("ended"),Xt=Symbol("queue"),uo=Symbol("current"),Bs=Symbol("process"),jc=Symbol("processing"),LP=Symbol("processJob"),Qt=Symbol("jobs"),xE=Symbol("jobDone"),_f=Symbol("addFSEntry"),MP=Symbol("addTarEntry"),FE=Symbol("stat"),UE=Symbol("readdir"),bf=Symbol("onreaddir"),If=Symbol("pipe"),BP=Symbol("entry"),LE=Symbol("entryOpt"),Of=Symbol("writeEntryClass"),UP=Symbol("write"),ME=Symbol("ondrain"),kP=FP(require("path")),BE=io(),Cf=class extends FZ.Minipass{static{o(this,"Pack")}opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Of];onWriteEntry;[Xt];[Qt]=0;[jc]=!1;[Uc]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,BE.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[Of]=kE.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new DE.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new DE.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new DE.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",r=>super.write(r)),t.on("end",()=>super.end()),t.on("drain",()=>this[ME]()),this.on("resume",()=>t.resume())}else this.on("drain",this[ME]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[Xt]=new UZ.Yallist,this[Qt]=0,this.jobs=Number(e.jobs)||4,this[jc]=!1,this[Uc]=!1}[UP](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&this.add(e),this[Uc]=!0,this[Bs](),r&&r(),this}write(e){if(this[Uc])throw new Error("write after end");return e instanceof jZ.ReadEntry?this[MP](e):this[_f](e),this.flowing}[MP](e){let t=(0,BE.normalizeWindowsPath)(kP.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let r=new $c(e.path,t);r.entry=new kE.WriteEntryTar(e,this[LE](r)),r.entry.on("end",()=>this[xE](r)),this[Qt]+=1,this[Xt].push(r)}this[Bs]()}[_f](e){let t=(0,BE.normalizeWindowsPath)(kP.default.resolve(this.cwd,e));this[Xt].push(new $c(e,t)),this[Bs]()}[FE](e){e.pending=!0,this[Qt]+=1;let t=this.follow?"stat":"lstat";vf.default[t](e.absolute,(r,s)=>{e.pending=!1,this[Qt]-=1,r?this.emit("error",r):this[wf](e,s)})}[wf](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Bs]()}[UE](e){e.pending=!0,this[Qt]+=1,vf.default.readdir(e.absolute,(t,r)=>{if(e.pending=!1,this[Qt]-=1,t)return this.emit("error",t);this[bf](e,r)})}[bf](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Bs]()}[Bs](){if(!this[jc]){this[jc]=!0;for(let e=this[Xt].head;e&&this[Qt]<this.jobs;e=e.next)if(this[LP](e.value),e.value.ignore){let t=e.next;this[Xt].removeNode(e),e.next=t}this[jc]=!1,this[Uc]&&!this[Xt].length&&this[Qt]===0&&(this.zip?this.zip.end(xP):(super.write(xP),super.end()))}}get[uo](){return this[Xt]&&this[Xt].head&&this[Xt].head.value}[xE](e){this[Xt].shift(),this[Qt]-=1,this[Bs]()}[LP](e){if(!e.pending){if(e.entry){e===this[uo]&&!e.piped&&this[If](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[wf](e,t):this[FE](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[bf](e,t):this[UE](e),!e.readdir)return}if(e.entry=this[BP](e),!e.entry){e.ignore=!0;return}e===this[uo]&&!e.piped&&this[If](e)}}}[LE](e){return{onwarn:o((t,r,s)=>this.warn(t,r,s),"onwarn"),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[BP](e){this[Qt]+=1;try{return new this[Of](e.path,this[LE](e)).on("end",()=>this[xE](e)).on("error",r=>this.emit("error",r))}catch(t){this.emit("error",t)}}[ME](){this[uo]&&this[uo].entry&&this[uo].entry.resume()}[If](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[_f](a+s)});let t=e.entry,r=this.zip;if(!t)throw new Error("cannot pipe without source");r?t.on("data",s=>{r.write(s)||t.pause()}):t.on("data",s=>{super.write(s)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,r={}){(0,$Z.warnMethod)(this,e,t,r)}};Ue.Pack=Cf;var jE=class extends Cf{static{o(this,"PackSync")}sync=!0;constructor(e){super(e),this[Of]=kE.WriteEntrySync}pause(){}resume(){}[FE](e){let t=this.follow?"statSync":"lstatSync";this[wf](e,vf.default[t](e.absolute))}[UE](e){this[bf](e,vf.default.readdirSync(e.absolute))}[If](e){let t=e.entry,r=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[_f](a+s)}),!t)throw new Error("Cannot pipe without source");r?t.on("data",s=>{r.write(s)}):t.on("data",s=>{super[UP](s)})}};Ue.PackSync=jE});var $E=d(lo=>{"use strict";var qZ=lo&&lo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(lo,"__esModule",{value:!0});lo.create=void 0;var jP=Zn(),$P=qZ(require("node:path")),qP=no(),VZ=Yn(),Af=Rf(),zZ=o((i,e)=>{let t=new Af.PackSync(i),r=new jP.WriteStreamSync(i.file,{mode:i.mode||438});t.pipe(r),VP(t,e)},"createFileSync"),HZ=o((i,e)=>{let t=new Af.Pack(i),r=new jP.WriteStream(i.file,{mode:i.mode||438});t.pipe(r);let s=new Promise((n,a)=>{r.on("error",a),r.on("close",n),t.on("error",a)});return zP(t,e),s},"createFile"),VP=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,qP.list)({file:$P.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),zP=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,qP.list)({file:$P.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>{i.add(s)},"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync"),GZ=o((i,e)=>{let t=new Af.PackSync(i);return VP(t,e),t},"createSync"),WZ=o((i,e)=>{let t=new Af.Pack(i);return zP(t,e),t},"createAsync");lo.create=(0,VZ.makeCommand)(zZ,HZ,GZ,WZ,(i,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var WP=d(ho=>{"use strict";var JZ=ho&&ho.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ho,"__esModule",{value:!0});ho.getWriteFlag=void 0;var HP=JZ(require("fs")),KZ=process.env.__FAKE_PLATFORM__||process.platform,ZZ=KZ==="win32",{O_CREAT:YZ,O_TRUNC:XZ,O_WRONLY:QZ}=HP.default.constants,GP=Number(process.env.__FAKE_FS_O_FILENAME__)||HP.default.constants.UV_FS_O_FILEMAP||0,eY=ZZ&&!!GP,tY=512*1024,iY=GP|XZ|YZ|QZ;ho.getWriteFlag=eY?i=>i<tY?iY:"w":()=>"w"});var KP=d(Ii=>{"use strict";var JP=Ii&&Ii.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.chownrSync=Ii.chownr=void 0;var Nf=JP(require("node:fs")),qc=JP(require("node:path")),qE=o((i,e,t)=>{try{return Nf.default.lchownSync(i,e,t)}catch(r){if(r?.code!=="ENOENT")throw r}},"lchownSync"),Tf=o((i,e,t,r)=>{Nf.default.lchown(i,e,t,s=>{r(s&&s?.code!=="ENOENT"?s:null)})},"chown"),rY=o((i,e,t,r,s)=>{if(e.isDirectory())(0,Ii.chownr)(qc.default.resolve(i,e.name),t,r,n=>{if(n)return s(n);let a=qc.default.resolve(i,e.name);Tf(a,t,r,s)});else{let n=qc.default.resolve(i,e.name);Tf(n,t,r,s)}},"chownrKid"),sY=o((i,e,t,r)=>{Nf.default.readdir(i,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return r();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return r(s)}if(s||!n.length)return Tf(i,e,t,r);let a=n.length,c=null,u=o(l=>{if(!c){if(l)return r(c=l);if(--a===0)return Tf(i,e,t,r)}},"then");for(let l of n)rY(i,l,e,t,u)})},"chownr");Ii.chownr=sY;var nY=o((i,e,t,r)=>{e.isDirectory()&&(0,Ii.chownrSync)(qc.default.resolve(i,e.name),t,r),qE(qc.default.resolve(i,e.name),t,r)},"chownrKidSync"),oY=o((i,e,t)=>{let r;try{r=Nf.default.readdirSync(i,{withFileTypes:!0})}catch(s){let n=s;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return qE(i,e,t);throw n}for(let s of r)nY(i,s,e,t);return qE(i,e,t)},"chownrSync");Ii.chownrSync=oY});var ZP=d(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.CwdError=void 0;var VE=class extends Error{static{o(this,"CwdError")}path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};Pf.CwdError=VE});var YP=d(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.SymlinkError=void 0;var zE=class extends Error{static{o(this,"SymlinkError")}path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};Df.SymlinkError=zE});var iD=d(kr=>{"use strict";var GE=kr&&kr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(kr,"__esModule",{value:!0});kr.mkdirSync=kr.mkdir=void 0;var XP=KP(),gt=GE(require("node:fs")),aY=GE(require("node:fs/promises")),xf=GE(require("node:path")),QP=ZP(),sr=io(),eD=YP(),cY=o((i,e)=>{gt.default.stat(i,(t,r)=>{(t||!r.isDirectory())&&(t=new QP.CwdError(i,t?.code||"ENOTDIR")),e(t)})},"checkCwd"),uY=o((i,e,t)=>{i=(0,sr.normalizeWindowsPath)(i);let r=e.umask??18,s=e.mode|448,n=(s&r)!==0,a=e.uid,c=e.gid,u=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),l=e.preserve,h=e.unlink,f=(0,sr.normalizeWindowsPath)(e.cwd),p=o((g,S)=>{g?t(g):S&&u?(0,XP.chownr)(S,a,c,E=>p(E)):n?gt.default.chmod(i,s,t):t()},"done");if(i===f)return cY(i,p);if(l)return aY.default.mkdir(i,{mode:s,recursive:!0}).then(g=>p(null,g??void 0),p);let y=(0,sr.normalizeWindowsPath)(xf.default.relative(f,i)).split("/");HE(f,y,s,h,f,void 0,p)},"mkdir");kr.mkdir=uY;var HE=o((i,e,t,r,s,n,a)=>{if(!e.length)return a(null,n);let c=e.shift(),u=(0,sr.normalizeWindowsPath)(xf.default.resolve(i+"/"+c));gt.default.mkdir(u,t,tD(u,e,t,r,s,n,a))},"mkdir_"),tD=o((i,e,t,r,s,n,a)=>c=>{c?gt.default.lstat(i,(u,l)=>{if(u)u.path=u.path&&(0,sr.normalizeWindowsPath)(u.path),a(u);else if(l.isDirectory())HE(i,e,t,r,s,n,a);else if(r)gt.default.unlink(i,h=>{if(h)return a(h);gt.default.mkdir(i,t,tD(i,e,t,r,s,n,a))});else{if(l.isSymbolicLink())return a(new eD.SymlinkError(i,i+"/"+e.join("/")));a(c)}}):(n=n||i,HE(i,e,t,r,s,n,a))},"onmkdir"),lY=o(i=>{let e=!1,t;try{e=gt.default.statSync(i).isDirectory()}catch(r){t=r?.code}finally{if(!e)throw new QP.CwdError(i,t??"ENOTDIR")}},"checkCwdSync"),hY=o((i,e)=>{i=(0,sr.normalizeWindowsPath)(i);let t=e.umask??18,r=e.mode|448,s=(r&t)!==0,n=e.uid,a=e.gid,c=typeof n=="number"&&typeof a=="number"&&(n!==e.processUid||a!==e.processGid),u=e.preserve,l=e.unlink,h=(0,sr.normalizeWindowsPath)(e.cwd),f=o(g=>{g&&c&&(0,XP.chownrSync)(g,n,a),s&>.default.chmodSync(i,r)},"done");if(i===h)return lY(h),f();if(u)return f(gt.default.mkdirSync(i,{mode:r,recursive:!0})??void 0);let m=(0,sr.normalizeWindowsPath)(xf.default.relative(h,i)).split("/"),y;for(let g=m.shift(),S=h;g&&(S+="/"+g);g=m.shift()){S=(0,sr.normalizeWindowsPath)(xf.default.resolve(S));try{gt.default.mkdirSync(S,r),y=y||S}catch{let _=gt.default.lstatSync(S);if(_.isDirectory())continue;if(l){gt.default.unlinkSync(S),gt.default.mkdirSync(S,r),y=y||S;continue}else if(_.isSymbolicLink())return new eD.SymlinkError(S,S+"/"+m.join("/"))}}return f(y)},"mkdirSync");kr.mkdirSync=hY});var sD=d(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.normalizeUnicode=void 0;var WE=Object.create(null),rD=1e4,fo=new Set,fY=o(i=>{fo.has(i)?fo.delete(i):WE[i]=i.normalize("NFD"),fo.add(i);let e=WE[i],t=fo.size-rD;if(t>rD/10){for(let r of fo)if(fo.delete(r),delete WE[r],--t<=0)break}return e},"normalizeUnicode");Lf.normalizeUnicode=fY});var oD=d(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.PathReservations=void 0;var nD=require("node:path"),dY=sD(),pY=hf(),mY=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,gY=mY==="win32",yY=o(i=>i.split("/").slice(0,-1).reduce((t,r)=>{let s=t[t.length-1];return s!==void 0&&(r=(0,nD.join)(s,r)),t.push(r||"/"),t},[]),"getDirs"),JE=class{static{o(this,"PathReservations")}#e=new Map;#t=new Map;#i=new Set;reserve(e,t){e=gY?["win32 parallelization disabled"]:e.map(s=>(0,pY.stripTrailingSlashes)((0,nD.join)((0,dY.normalizeUnicode)(s))).toLowerCase());let r=new Set(e.map(s=>yY(s)).reduce((s,n)=>s.concat(n)));this.#t.set(t,{dirs:r,paths:e});for(let s of e){let n=this.#e.get(s);n?n.push(t):this.#e.set(s,[t])}for(let s of r){let n=this.#e.get(s);if(!n)this.#e.set(s,[new Set([t])]);else{let a=n[n.length-1];a instanceof Set?a.add(t):n.push(new Set([t]))}}return this.#s(t)}#r(e){let t=this.#t.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(r=>this.#e.get(r)),dirs:[...t.dirs].map(r=>this.#e.get(r))}}check(e){let{paths:t,dirs:r}=this.#r(e);return t.every(s=>s&&s[0]===e)&&r.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#s(e){return this.#i.has(e)||!this.check(e)?!1:(this.#i.add(e),e(()=>this.#u(e)),!0)}#u(e){if(!this.#i.has(e))return!1;let t=this.#t.get(e);if(!t)throw new Error("invalid reservation");let{paths:r,dirs:s}=t,n=new Set;for(let a of r){let c=this.#e.get(a);if(!c||c?.[0]!==e)continue;let u=c[1];if(!u){this.#e.delete(a);continue}if(c.shift(),typeof u=="function")n.add(u);else for(let l of u)n.add(l)}for(let a of s){let c=this.#e.get(a),u=c?.[0];if(!(!c||!(u instanceof Set)))if(u.size===1&&c.length===1){this.#e.delete(a);continue}else if(u.size===1){c.shift();let l=c[0];typeof l=="function"&&n.add(l)}else u.delete(e)}return this.#i.delete(e),n.forEach(a=>this.#s(a)),!0}};Mf.PathReservations=JE});var sw=d(it=>{"use strict";var SY=it&&it.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),EY=it&&it.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gD=it&&it.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&SY(e,i,t);return EY(e,i),e},rw=it&&it.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(it,"__esModule",{value:!0});it.UnpackSync=it.Unpack=void 0;var wY=gD(Zn()),_Y=rw(require("node:assert")),yD=require("node:crypto"),H=rw(require("node:fs")),nr=rw(require("node:path")),SD=WP(),ED=iD(),ei=io(),bY=uf(),IY=yE(),aD=gD(EE()),OY=oD(),cD=Symbol("onEntry"),YE=Symbol("checkFs"),uD=Symbol("checkFs2"),XE=Symbol("isReusable"),Nt=Symbol("makeFs"),QE=Symbol("file"),ew=Symbol("directory"),Ff=Symbol("link"),lD=Symbol("symlink"),hD=Symbol("hardlink"),fD=Symbol("unsupported"),dD=Symbol("checkPath"),Fr=Symbol("mkdir"),je=Symbol("onError"),Bf=Symbol("pending"),pD=Symbol("pend"),po=Symbol("unpend"),KE=Symbol("ended"),ZE=Symbol("maybeClose"),tw=Symbol("skip"),Vc=Symbol("doChown"),zc=Symbol("uid"),Hc=Symbol("gid"),Gc=Symbol("checkedCwd"),vY=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Wc=vY==="win32",CY=1024,RY=o((i,e)=>{if(!Wc)return H.default.unlink(i,e);let t=i+".DELETE."+(0,yD.randomBytes)(16).toString("hex");H.default.rename(i,t,r=>{if(r)return e(r);H.default.unlink(t,e)})},"unlinkFile"),AY=o(i=>{if(!Wc)return H.default.unlinkSync(i);let e=i+".DELETE."+(0,yD.randomBytes)(16).toString("hex");H.default.renameSync(i,e),H.default.unlinkSync(e)},"unlinkFileSync"),mD=o((i,e,t)=>i!==void 0&&i===i>>>0?i:e!==void 0&&e===e>>>0?e:t,"uint32"),Uf=class extends bY.Parser{static{o(this,"Unpack")}[KE]=!1;[Gc]=!1;[Bf]=0;reservations=new OY.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[KE]=!0,this[ZE]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:CY,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Wc,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,ei.normalizeWindowsPath)(nr.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[cD](t))}warn(e,t,r={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(r.recoverable=!1),super.warn(e,t,r)}[ZE](){this[KE]&&this[Bf]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[dD](e){let t=(0,ei.normalizeWindowsPath)(e.path),r=t.split("/");if(this.strip){if(r.length<this.strip)return!1;if(e.type==="Link"){let s=(0,ei.normalizeWindowsPath)(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}r.splice(0,this.strip),e.path=r.join("/")}if(isFinite(this.maxDepth)&&r.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:r.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(r.includes("..")||Wc&&/^[a-z]:\.\.$/i.test(r[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[s,n]=(0,IY.stripAbsolutePath)(t);s&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:t}))}if(nr.default.isAbsolute(e.path)?e.absolute=(0,ei.normalizeWindowsPath)(nr.default.resolve(e.path)):e.absolute=(0,ei.normalizeWindowsPath)(nr.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,ei.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:s}=nr.default.win32.parse(String(e.absolute));e.absolute=s+aD.encode(String(e.absolute).slice(s.length));let{root:n}=nr.default.win32.parse(e.path);e.path=n+aD.encode(e.path.slice(n.length))}return!0}[cD](e){if(!this[dD](e))return e.resume();switch(_Y.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[YE](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[fD](e)}}[je](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[po](),t.resume())}[Fr](e,t,r){(0,ED.mkdir)((0,ei.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},r)}[Vc](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[zc](e){return mD(this.uid,e.uid,this.processUid)}[Hc](e){return mD(this.gid,e.gid,this.processGid)}[QE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new wY.WriteStream(String(e.absolute),{flags:(0,SD.getWriteFlag)(e.size),mode:r,autoClose:!1});s.on("error",u=>{s.fd&&H.default.close(s.fd,()=>{}),s.write=()=>!0,this[je](u,e),t()});let n=1,a=o(u=>{if(u){s.fd&&H.default.close(s.fd,()=>{}),this[je](u,e),t();return}--n===0&&s.fd!==void 0&&H.default.close(s.fd,l=>{l?this[je](l,e):this[po](),t()})},"done");s.on("finish",()=>{let u=String(e.absolute),l=s.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let h=e.atime||new Date,f=e.mtime;H.default.futimes(l,h,f,p=>p?H.default.utimes(u,h,f,m=>a(m&&p)):a())}if(typeof l=="number"&&this[Vc](e)){n++;let h=this[zc](e),f=this[Hc](e);typeof h=="number"&&typeof f=="number"&&H.default.fchown(l,h,f,p=>p?H.default.chown(u,h,f,m=>a(m&&p)):a())}a()});let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",u=>{this[je](u,e),t()}),e.pipe(c)),c.pipe(s)}[ew](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Fr](String(e.absolute),r,s=>{if(s){this[je](s,e),t();return}let n=1,a=o(()=>{--n===0&&(t(),this[po](),e.resume())},"done");e.mtime&&!this.noMtime&&(n++,H.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,a)),this[Vc](e)&&(n++,H.default.chown(String(e.absolute),Number(this[zc](e)),Number(this[Hc](e)),a)),a()})}[fD](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[lD](e,t){this[Ff](e,String(e.linkpath),"symlink",t)}[hD](e,t){let r=(0,ei.normalizeWindowsPath)(nr.default.resolve(this.cwd,String(e.linkpath)));this[Ff](e,r,"link",t)}[pD](){this[Bf]++}[po](){this[Bf]--,this[ZE]()}[tw](e){this[po](),e.resume()}[XE](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Wc}[YE](e){this[pD]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,r=>this[uD](e,r))}[uD](e,t){let r=o(c=>{t(c)},"done"),s=o(()=>{this[Fr](this.cwd,this.dmode,c=>{if(c){this[je](c,e),r();return}this[Gc]=!0,n()})},"checkCwd"),n=o(()=>{if(e.absolute!==this.cwd){let c=(0,ei.normalizeWindowsPath)(nr.default.dirname(String(e.absolute)));if(c!==this.cwd)return this[Fr](c,this.dmode,u=>{if(u){this[je](u,e),r();return}a()})}a()},"start"),a=o(()=>{H.default.lstat(String(e.absolute),(c,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[tw](e),r();return}if(c||this[XE](e,u))return this[Nt](null,e,r);if(u.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,h=o(f=>this[Nt](f??null,e,r),"afterChmod");return l?H.default.chmod(String(e.absolute),Number(e.mode),h):h()}if(e.absolute!==this.cwd)return H.default.rmdir(String(e.absolute),l=>this[Nt](l??null,e,r))}if(e.absolute===this.cwd)return this[Nt](null,e,r);RY(String(e.absolute),l=>this[Nt](l??null,e,r))})},"afterMakeParent");this[Gc]?n():s()}[Nt](e,t,r){if(e){this[je](e,t),r();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[QE](t,r);case"Link":return this[hD](t,r);case"SymbolicLink":return this[lD](t,r);case"Directory":case"GNUDumpDir":return this[ew](t,r)}}[Ff](e,t,r,s){H.default[r](t,String(e.absolute),n=>{n?this[je](n,e):(this[po](),e.resume()),s()})}};it.Unpack=Uf;var kf=o(i=>{try{return[null,i()]}catch(e){return[e,null]}},"callSync"),iw=class extends Uf{static{o(this,"UnpackSync")}sync=!0;[Nt](e,t){return super[Nt](e,t,()=>{})}[YE](e){if(!this[Gc]){let n=this[Fr](this.cwd,this.dmode);if(n)return this[je](n,e);this[Gc]=!0}if(e.absolute!==this.cwd){let n=(0,ei.normalizeWindowsPath)(nr.default.dirname(String(e.absolute)));if(n!==this.cwd){let a=this[Fr](n,this.dmode);if(a)return this[je](a,e)}}let[t,r]=kf(()=>H.default.lstatSync(String(e.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(e.mtime??r.mtime)))return this[tw](e);if(t||this[XE](e,r))return this[Nt](null,e);if(r.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(r.mode&4095)!==e.mode,[c]=a?kf(()=>{H.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[Nt](c,e)}let[n]=kf(()=>H.default.rmdirSync(String(e.absolute)));this[Nt](n,e)}let[s]=e.absolute===this.cwd?[]:kf(()=>AY(String(e.absolute)));this[Nt](s,e)}[QE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o(c=>{let u;try{H.default.closeSync(n)}catch(l){u=l}(c||u)&&this[je](c||u,e),t()},"oner"),n;try{n=H.default.openSync(String(e.absolute),(0,SD.getWriteFlag)(e.size),r)}catch(c){return s(c)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",c=>this[je](c,e)),e.pipe(a)),a.on("data",c=>{try{H.default.writeSync(n,c,0,c.length)}catch(u){s(u)}}),a.on("end",()=>{let c=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,l=e.mtime;try{H.default.futimesSync(n,u,l)}catch(h){try{H.default.utimesSync(String(e.absolute),u,l)}catch{c=h}}}if(this[Vc](e)){let u=this[zc](e),l=this[Hc](e);try{H.default.fchownSync(n,Number(u),Number(l))}catch(h){try{H.default.chownSync(String(e.absolute),Number(u),Number(l))}catch{c=c||h}}}s(c)})}[ew](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[Fr](String(e.absolute),r);if(s){this[je](s,e),t();return}if(e.mtime&&!this.noMtime)try{H.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Vc](e))try{H.default.chownSync(String(e.absolute),Number(this[zc](e)),Number(this[Hc](e)))}catch{}t(),e.resume()}[Fr](e,t){try{return(0,ED.mkdirSync)((0,ei.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(r){return r}}[Ff](e,t,r,s){let n=`${r}Sync`;try{H.default[n](t,String(e.absolute)),s(),e.resume()}catch(a){return this[je](a,e)}}};it.UnpackSync=iw});var nw=d(Pt=>{"use strict";var TY=Pt&&Pt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),NY=Pt&&Pt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),PY=Pt&&Pt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&TY(e,i,t);return NY(e,i),e},DY=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.extract=void 0;var wD=PY(Zn()),_D=DY(require("node:fs")),xY=no(),LY=Yn(),jf=sw(),MY=o(i=>{let e=new jf.UnpackSync(i),t=i.file,r=_D.default.statSync(t),s=i.maxReadSize||16*1024*1024;new wD.ReadStreamSync(t,{readSize:s,size:r.size}).pipe(e)},"extractFileSync"),BY=o((i,e)=>{let t=new jf.Unpack(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("close",a),_D.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new wD.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"extractFile");Pt.extract=(0,LY.makeCommand)(MY,BY,i=>new jf.UnpackSync(i),i=>new jf.Unpack(i),(i,e)=>{e?.length&&(0,xY.filesFilter)(i,e)})});var $f=d(mo=>{"use strict";var bD=mo&&mo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(mo,"__esModule",{value:!0});mo.replace=void 0;var ID=Zn(),yt=bD(require("node:fs")),OD=bD(require("node:path")),vD=to(),CD=no(),kY=Yn(),FY=Vh(),RD=Rf(),UY=o((i,e)=>{let t=new RD.PackSync(i),r=!0,s,n;try{try{s=yt.default.openSync(i.file,"r+")}catch(u){if(u?.code==="ENOENT")s=yt.default.openSync(i.file,"w+");else throw u}let a=yt.default.fstatSync(s),c=Buffer.alloc(512);e:for(n=0;n<a.size;n+=512){for(let h=0,f=0;h<512;h+=f){if(f=yt.default.readSync(s,c,h,c.length-h,n+h),n===0&&c[0]===31&&c[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let u=new vD.Header(c);if(!u.cksumValid)break;let l=512*Math.ceil((u.size||0)/512);if(n+l+512>a.size)break;n+=l,i.mtimeCache&&u.mtime&&i.mtimeCache.set(String(u.path),u.mtime)}r=!1,jY(i,t,n,s,e)}finally{if(r)try{yt.default.closeSync(s)}catch{}}},"replaceSync"),jY=o((i,e,t,r,s)=>{let n=new ID.WriteStreamSync(i.file,{fd:r,start:t});e.pipe(n),qY(e,s)},"streamSync"),$Y=o((i,e)=>{e=Array.from(e);let t=new RD.Pack(i),r=o((n,a,c)=>{let u=o((m,y)=>{m?yt.default.close(n,g=>c(m)):c(null,y)},"cb"),l=0;if(a===0)return u(null,0);let h=0,f=Buffer.alloc(512),p=o((m,y)=>{if(m||typeof y>"u")return u(m);if(h+=y,h<512&&y)return yt.default.read(n,f,h,f.length-h,l+h,p);if(l===0&&f[0]===31&&f[1]===139)return u(new Error("cannot append to compressed archives"));if(h<512)return u(null,l);let g=new vD.Header(f);if(!g.cksumValid)return u(null,l);let S=512*Math.ceil((g.size??0)/512);if(l+S+512>a||(l+=S+512,l>=a))return u(null,l);i.mtimeCache&&g.mtime&&i.mtimeCache.set(String(g.path),g.mtime),h=0,yt.default.read(n,f,0,512,l,p)},"onread");yt.default.read(n,f,0,512,l,p)},"getPos");return new Promise((n,a)=>{t.on("error",a);let c="r+",u=o((l,h)=>{if(l&&l.code==="ENOENT"&&c==="r+")return c="w+",yt.default.open(i.file,c,u);if(l||!h)return a(l);yt.default.fstat(h,(f,p)=>{if(f)return yt.default.close(h,()=>a(f));r(h,p.size,(m,y)=>{if(m)return a(m);let g=new ID.WriteStream(i.file,{fd:h,start:y});t.pipe(g),g.on("error",a),g.on("close",n),VY(t,e)})})},"onopen");yt.default.open(i.file,c,u)})},"replaceAsync"),qY=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,CD.list)({file:OD.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),VY=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,CD.list)({file:OD.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>i.add(s),"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync");mo.replace=(0,kY.makeCommand)(UY,$Y,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(i,e)=>{if(!(0,FY.isFile)(i))throw new TypeError("file is required");if(i.gzip||i.brotli||i.zstd||i.file.endsWith(".br")||i.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var ow=d(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.update=void 0;var zY=Yn(),Jc=$f();qf.update=(0,zY.makeCommand)(Jc.replace.syncFile,Jc.replace.asyncFile,Jc.replace.syncNoFile,Jc.replace.asyncNoFile,(i,e=[])=>{Jc.replace.validate?.(i,e),HY(i)});var HY=o(i=>{let e=i.filter;i.mtimeCache||(i.mtimeCache=new Map),i.filter=e?(t,r)=>e(t,r)&&!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0)):(t,r)=>!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0))},"mtimeFilter")});var aw=d(V=>{"use strict";var AD=V&&V.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),GY=V&&V.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Dt=V&&V.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AD(e,i,t)},WY=V&&V.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&AD(e,i,t);return GY(e,i),e};Object.defineProperty(V,"__esModule",{value:!0});V.u=V.types=V.r=V.t=V.x=V.c=void 0;Dt($E(),V);var JY=$E();Object.defineProperty(V,"c",{enumerable:!0,get:o(function(){return JY.create},"get")});Dt(nw(),V);var KY=nw();Object.defineProperty(V,"x",{enumerable:!0,get:o(function(){return KY.extract},"get")});Dt(to(),V);Dt(no(),V);var ZY=no();Object.defineProperty(V,"t",{enumerable:!0,get:o(function(){return ZY.list},"get")});Dt(Rf(),V);Dt(uf(),V);Dt(Jh(),V);Dt(Xh(),V);Dt($f(),V);var YY=$f();Object.defineProperty(V,"r",{enumerable:!0,get:o(function(){return YY.replace},"get")});V.types=WY(iE());Dt(sw(),V);Dt(ow(),V);var XY=ow();Object.defineProperty(V,"u",{enumerable:!0,get:o(function(){return XY.update},"get")});Dt(NE(),V)});var ks=d((Iye,TD)=>{TD.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var PD=d((Oye,ND)=>{var{resolve:cw}=require("node:path"),{tmpdir:QY,homedir:eX}=require("node:os");ND.exports=(i=!1)=>{let e=QY(),t=process.getuid?process.getuid():process.pid,r=eX()||cw(e,"npm-"+t),s=i||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||r;return{cacache:cw(a,n,"_cacache"),tufcache:cw(a,n,"_tuf")}}});var uw=d((vye,DD)=>{var tX=o((i,e)=>typeof e=="string"?{[i]:e}:e,"binObj"),iX=o((i,e)=>{let t=tX(i.name,i.bin),r=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===r)return!0;return!1},"hasBin");DD.exports=(i,e)=>i&&i.bin?iX(i,e):!1});var lw=d((Rye,xD)=>{var rX=o(i=>{let e=i;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");xD.exports=rX});var MD=d((Tye,LD)=>{"use strict";var Ur=require("fs"),hw=require("path"),sX=require("events").EventEmitter,nX=Ui().Minimatch,Kc=class i extends sX{static{o(this,"Walker")}constructor(e){e=e||{},super(e),this.isSymbolicLink=e.isSymbolicLink,this.path=e.path||process.cwd(),this.basename=hw.basename(this.path),this.ignoreFiles=e.ignoreFiles||[".ignore"],this.ignoreRules={},this.parent=e.parent||null,this.includeEmpty=!!e.includeEmpty,this.root=this.parent?this.parent.root:this.path,this.follow=!!e.follow,this.result=this.parent?this.parent.result:new Set,this.entries=null,this.sawError=!1,this.exact=e.exact}sort(e,t){return e.localeCompare(t,"en")}emit(e,t){let r=!1;return this.sawError&&e==="error"||(e==="error"?this.sawError=!0:e==="done"&&!this.parent&&(t=Array.from(t).map(s=>/^@/.test(s)?`./${s}`:s).sort(this.sort),this.result=t),e==="error"&&this.parent?r=this.parent.emit("error",t):r=super.emit(e,t)),r}start(){return Ur.readdir(this.path,(e,t)=>e?this.emit("error",e):this.onReaddir(t)),this}isIgnoreFile(e){return e!=="."&&e!==".."&&this.ignoreFiles.indexOf(e)!==-1}onReaddir(e){this.entries=e,e.length===0?(this.includeEmpty&&this.result.add(this.path.slice(this.root.length+1)),this.emit("done",this.result)):this.entries.some(r=>this.isIgnoreFile(r))?this.addIgnoreFiles():this.filterEntries()}addIgnoreFiles(){let e=this.entries.filter(s=>this.isIgnoreFile(s)),t=e.length,r=o(()=>{--t===0&&this.filterEntries()},"then");e.forEach(s=>this.addIgnoreFile(s,r))}addIgnoreFile(e,t){let r=hw.resolve(this.path,e);Ur.readFile(r,"utf8",(s,n)=>s?this.emit("error",s):this.onReadIgnoreFile(e,n,t))}onReadIgnoreFile(e,t,r){let s={matchBase:!0,dot:!0,flipNegate:!0,nocase:!0},n=t.split(/\r?\n/).filter(a=>!/^#|^$/.test(a.trim())).map(a=>new nX(a.trim(),s));this.ignoreRules[e]=n,r()}filterEntries(){let e=this.entries.map(r=>{let s=this.filterEntry(r),n=this.filterEntry(r,!0);return s||n?[r,s,n]:!1}).filter(r=>r),t=e.length;if(t===0)this.emit("done",this.result);else{let r=o(()=>{--t===0&&this.emit("done",this.result)},"then");e.forEach(s=>{let n=s[0],a=s[1],c=s[2];this.stat({entry:n,file:a,dir:c},r)})}}onstat({st:e,entry:t,file:r,dir:s,isSymbolicLink:n},a){let c=this.path+"/"+t;e.isDirectory()?s?this.walker(t,{isSymbolicLink:n,exact:r||this.filterEntry(t+"/")},a):a():(r&&this.result.add(c.slice(this.root.length+1)),a())}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e;Ur.lstat(n,(a,c)=>{if(a)this.emit("error",a);else{let u=c.isSymbolicLink();this.follow&&u?Ur.stat(n,(l,h)=>{l?this.emit("error",l):this.onstat({st:h,entry:e,file:t,dir:r,isSymbolicLink:u},s)}):this.onstat({st:c,entry:e,file:t,dir:r,isSymbolicLink:u},s)}})}walkerOpt(e,t){return{path:this.path+"/"+e,parent:this,ignoreFiles:this.ignoreFiles,follow:this.follow,includeEmpty:this.includeEmpty,...t}}walker(e,t,r){new i(this.walkerOpt(e,t)).on("done",r).start()}filterEntry(e,t,r){let s=!0;if(this.parent&&this.parent.filterEntry){let n=this.basename+"/"+e,a=r||e;if(s=this.parent.filterEntry(n,t,a),!s&&!this.exact)return!1}return this.ignoreFiles.forEach(n=>{this.ignoreRules[n]&&this.ignoreRules[n].forEach(a=>{if(a.negate!==s){let c=r&&a.globParts.some(l=>l.length<=(l.slice(-1)[0]?1:2));(a.match("/"+e)||a.match(e)||!!t&&(a.match("/"+e+"/")||a.match(e+"/")||a.negate&&(a.match("/"+e,!0)||a.match(e,!0))||c&&(a.match("/"+r+"/")||a.match(r+"/")||a.negate&&(a.match("/"+r,!0)||a.match(r,!0)))))&&(s=a.negate)}})}),s}},Vf=class i extends Kc{static{o(this,"WalkerSync")}start(){return this.onReaddir(Ur.readdirSync(this.path)),this}addIgnoreFile(e,t){let r=hw.resolve(this.path,e);this.onReadIgnoreFile(e,Ur.readFileSync(r,"utf8"),t)}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e,a=Ur.lstatSync(n),c=a.isSymbolicLink();this.follow&&c&&(a=Ur.statSync(n)),this.onstat({st:a,entry:e,file:t,dir:r,isSymbolicLink:c},s)}walker(e,t,r){new i(this.walkerOpt(e,t)).start(),r()}},zf=o((i,e)=>{let t=new Promise((r,s)=>{new Kc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),oX=o(i=>new Vf(i).start().result,"walkSync");LD.exports=zf;zf.sync=oX;zf.Walker=Kc;zf.WalkerSync=Vf});var qD=d((Pye,$D)=>{"use strict";var{Walker:aX}=MD(),{lstatSync:cX,readFileSync:uX}=require("fs"),{basename:BD,dirname:lX,extname:kD,join:So,relative:yo,resolve:hX,sep:fX}=require("path"),{log:dX}=_t(),Zc=Symbol("npm-packlist.rules.default"),go=Symbol("npm-packlist.rules.strict"),pX=o(i=>/\*/.test(i),"nameIsBadForWindows"),mX=[".npmignore",".gitignore","**/.git","**/.svn","**/.hg","**/CVS","**/.git/**","**/.svn/**","**/.hg/**","**/CVS/**","/.lock-wscript","/.wafpickle-*","/build/config.gypi","npm-debug.log","**/.npmrc",".*.swp",".DS_Store","**/.DS_Store/**","._*","**/._*/**","*.orig","/archived-packages/**"],FD=["/.git"],Hf=o(i=>i.split("\\").join("/"),"normalizePath"),UD=o((i,e,t=[])=>{for(let a of[".npmignore",".gitignore"])try{let c=uX(So(i,a),{encoding:"utf8"});t.push(c);break}catch(c){if(c.code!=="ENOENT")throw c}if(!e)return t;let r=e.split(fX,1)[0],s=So(i,r),n=yo(s,So(i,e));return UD(s,n,t)},"readOutOfTreeIgnoreFiles"),Gf=class i extends aX{static{o(this,"PackWalker")}constructor(e,t){let r={...t,includeEmpty:!1,follow:!1,path:hX(t?.path||e.path).replace(/\\/g,"/"),ignoreFiles:t?.ignoreFiles||[Zc,"package.json",".npmignore",".gitignore",go]};super(r),this.isPackage=r.isPackage,this.seen=r.seen||new Set,this.tree=e,this.requiredFiles=r.requiredFiles||[];let s=[];if(r.prefix&&r.workspaces){let n=Hf(r.path),a=Hf(r.prefix),c=r.workspaces.map(u=>Hf(u));if(n!==a&&c.includes(n)){let u=yo(r.prefix,lX(r.path));s.push(...UD(r.prefix,u))}else n===a&&s.push(...c.map(u=>Hf(yo(r.path,u))))}this.injectRules(Zc,[...mX,...s]),this.isPackage||this.injectRules(go,[...FD,...this.requiredFiles.map(n=>`!${n}`)])}addIgnoreFile(e,t){return e!=="package.json"||!this.isPackage?super.addIgnoreFile(e,t):this.processPackage(t)}emit(e,t){return e!=="done"||!this.isPackage?super.emit(e,t):(this.gatherBundles().then(()=>{super.emit("done",this.result)}),!0)}filterEntries(){return this.ignoreRules["package.json"]?(this.ignoreRules[".npmignore"]=null,this.ignoreRules[".gitignore"]=null):this.ignoreRules[".npmignore"]?this.ignoreRules[".gitignore"]=null:this.ignoreRules[".gitignore"]&&!this.ignoreRules[".npmignore"]&&dX.warn("gitignore-fallback","No .npmignore file found, using .gitignore for file exclusion. Consider creating a .npmignore file to explicitly control published files."),super.filterEntries()}onstat(e,t){return!e.st.isFile()&&!e.st.isDirectory()?t():super.onstat(e,t)}stat(e,t){return pX(e.entry)?t():super.stat(e,t)}walkerOpt(e,t){let r=null;if(this.tree.workspaces){let s=[...this.tree.workspaces.values()].map(a=>a.replace(/\\/g,"/")),n=So(this.path,e).replace(/\\/g,"/");s.includes(n)&&(r=[Zc,"package.json",".npmignore",".gitignore",go])}else r=[Zc,".npmignore",".gitignore",go];return{...super.walkerOpt(e,t),ignoreFiles:r,requiredFiles:this.requiredFiles.map(s=>yo(s,e)===".."?yo(e,s).replace(/\\/g,"/"):!1).filter(Boolean)}}walker(e,t,r){new i(this.tree,this.walkerOpt(e,t)).on("done",r).start()}sort(e,t){let r=kD(e).toLowerCase(),s=kD(t).toLowerCase(),n=BD(e).toLowerCase(),a=BD(t).toLowerCase();return r.localeCompare(s,"en")||n.localeCompare(a,"en")||e.localeCompare(t,"en")}injectRules(e,t,r=()=>{}){this.onReadIgnoreFile(e,`${t.join(`
|
|
28
|
+
Found: ${e}`);return t.code="EINTEGRITY",t.expected=i,t.found=e,t}o(hJ,"checksumError")});var lN=d((tme,aS)=>{"use strict";var oN=Rn(),aN=nc(),cN=nN(),fJ=Ih(),{PassThrough:dJ}=yy(),pJ=In(),uN=o(i=>({algorithms:["sha512"],...i}),"putOpts");aS.exports=mJ;async function mJ(i,e,t,r={}){let{memoize:s}=r;r=uN(r);let n=await cN(i,t,r),a=await oN.insert(i,e,n.integrity,{...r,size:n.size});return s&&aN.put(i,a,t,r),n.integrity}o(mJ,"putData");aS.exports.stream=gJ;function gJ(i,e,t={}){let{memoize:r}=t;t=uN(t);let s,n,a,c,u=new pJ;if(r){let h=new dJ().on("collect",f=>{c=f});u.push(h)}let l=cN.stream(i,t).on("integrity",h=>{s=h}).on("size",h=>{n=h}).on("error",h=>{a=h});return u.push(l),u.push(new fJ({async flush(){if(!a){let h=await oN.insert(i,e,s,{...t,size:n});r&&c&&aN.put(i,h,c,t),u.emit("integrity",s),u.emit("size",n)}}})),u}o(gJ,"putStream")});var cS=d((rme,fN)=>{"use strict";var{glob:yJ}=hg(),hN=require("path"),SJ=o(i=>i.split(hN.win32.sep).join(hN.posix.sep),"globify");fN.exports=(i,e)=>yJ(SJ(i),e)});var pN=d((nme,dN)=>{"use strict";var EJ=require("fs/promises"),wJ=On(),{hasContent:_J}=tS();dN.exports=bJ;async function bJ(i,e){let t=await _J(i,e);return t&&t.sri?(await EJ.rm(wJ(i,t.sri),{recursive:!0,force:!0}),!0):!1}o(bJ,"rm")});var gN=d((ame,fc)=>{"use strict";var{rm:IJ}=require("fs/promises"),OJ=cS(),vJ=Rn(),uS=nc(),RJ=require("path"),AJ=pN();fc.exports=mN;fc.exports.entry=mN;function mN(i,e,t){return uS.clearMemoized(),vJ.delete(i,e,t)}o(mN,"entry");fc.exports.content=TJ;function TJ(i,e){return uS.clearMemoized(),AJ(i,e)}o(TJ,"content");fc.exports.all=CJ;async function CJ(i){uS.clearMemoized();let e=await OJ(RJ.join(i,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(t=>IJ(t,{recursive:!0,force:!0})))}o(CJ,"all")});var SN=d((ume,dS)=>{"use strict";var{mkdir:NJ,readFile:PJ,rm:hS,stat:fS,truncate:DJ,writeFile:xJ}=require("fs/promises"),yN=On(),LJ=Ln(),MJ=cS(),Bn=Rn(),Oh=require("path"),lS=ai(),BJ=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),kJ=o(i=>({concurrency:20,log:{silly(){}},...i}),"verifyOpts");dS.exports=FJ;async function FJ(i,e){e=kJ(e),e.log.silly("verify","verifying cache at",i);let t=[UJ,$J,qJ,zJ,GJ,WJ,jJ],r={};for(let s of t){let n=s.name,a=new Date,c=await s(i,e);c&&Object.keys(c).forEach(l=>{r[l]=c[l]});let u=new Date;r.runTime||(r.runTime={}),r.runTime[n]=u-a}return r.runTime.total=r.endTime-r.startTime,e.log.silly("verify","verification finished for",i,"in",`${r.runTime.total}ms`),r}o(FJ,"verify");async function UJ(){return{startTime:new Date}}o(UJ,"markStartTime");async function jJ(){return{endTime:new Date}}o(jJ,"markEndTime");async function $J(i,e){return e.log.silly("verify","fixing cache permissions"),await NJ(i,{recursive:!0}),null}o($J,"fixPerms");async function qJ(i,e){e.log.silly("verify","garbage collecting content");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=Bn.lsStream(i),s=new Set;r.on("data",u=>{if(e.filter&&!e.filter(u))return;let l=lS.parse(u.integrity);for(let h in l)s.add(l[h].toString())}),await new Promise((u,l)=>{r.on("end",u).on("error",l)});let n=yN.contentDir(i),a=await MJ(Oh.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),c={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await t(a,async u=>{let l=u.split(/[/\\]/),h=l.slice(l.length-3).join(""),f=l[l.length-4],p=lS.fromHex(h,f);if(s.has(p.toString())){let m=await VJ(u,p);m.valid?(c.verifiedContent++,c.keptSize+=m.size):(c.reclaimedCount++,c.badContentCount++,c.reclaimedSize+=m.size)}else{c.reclaimedCount++;let m=await fS(u);await hS(u,{recursive:!0,force:!0}),c.reclaimedSize+=m.size}return c},{concurrency:e.concurrency}),c}o(qJ,"garbageCollect");async function VJ(i,e){let t={};try{let{size:r}=await fS(i);t.size=r,t.valid=!0,await lS.checkStream(new LJ.ReadStream(i),e)}catch(r){if(r.code==="ENOENT")return{size:0,valid:!1};if(r.code!=="EINTEGRITY")throw r;await hS(i,{recursive:!0,force:!0}),t.valid=!1}return t}o(VJ,"verifyContent");async function zJ(i,e){e.log.silly("verify","rebuilding index");let{default:t}=await Promise.resolve().then(()=>(lh(),uh)),r=await Bn.ls(i),s={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(let a in r)if(BJ(r,a)){let c=Bn.hashKey(a),u=r[a],l=e.filter&&!e.filter(u);l&&s.rejectedEntries++,n[c]&&!l?n[c].push(u):n[c]&&l||(l?(n[c]=[],n[c]._path=Bn.bucketPath(i,a)):(n[c]=[u],n[c]._path=Bn.bucketPath(i,a)))}return await t(Object.keys(n),a=>HJ(i,n[a],s,e),{concurrency:e.concurrency}),s}o(zJ,"rebuildIndex");async function HJ(i,e,t){await DJ(e._path);for(let r of e){let s=yN(i,r.integrity);try{await fS(s),await Bn.insert(i,r.key,r.integrity,{metadata:r.metadata,size:r.size,time:r.time}),t.totalEntries++}catch(n){if(n.code==="ENOENT")t.rejectedEntries++,t.missingContent++;else throw n}}}o(HJ,"rebuildBucket");function GJ(i,e){return e.log.silly("verify","cleaning tmp directory"),hS(Oh.join(i,"tmp"),{recursive:!0,force:!0})}o(GJ,"cleanTmp");async function WJ(i,e){let t=Oh.join(i,"_lastverified");return e.log.silly("verify","writing verifile to "+t),xJ(t,`${Date.now()}`)}o(WJ,"writeVerifile");dS.exports.lastRun=JJ;async function JJ(i){let e=await PJ(Oh.join(i,"_lastverified"),{encoding:"utf8"});return new Date(+e)}o(JJ,"lastRun")});var wN=d((hme,mS)=>{"use strict";var{withTempDir:KJ}=ch(),EN=require("fs/promises"),pS=require("path");mS.exports.mkdir=ZJ;async function ZJ(i,e={}){let{tmpPrefix:t}=e,r=pS.join(i,"tmp");await EN.mkdir(r,{recursive:!0,owner:"inherit"});let s=`${r}${pS.sep}${t||""}`;return EN.mkdtemp(s,{owner:"inherit"})}o(ZJ,"mktmpdir");mS.exports.withTmp=YJ;function YJ(i,e,t){return t||(t=e,e={}),KJ(pS.join(i,"tmp"),t,e)}o(YJ,"withTmp")});var dc=d((dme,X)=>{"use strict";var Ir=Z1(),_N=lN(),gS=gN(),bN=SN(),{clearMemoized:XJ}=nc(),IN=wN(),vh=Rn();X.exports.index={};X.exports.index.compact=vh.compact;X.exports.index.insert=vh.insert;X.exports.ls=vh.ls;X.exports.ls.stream=vh.lsStream;X.exports.get=Ir;X.exports.get.byDigest=Ir.byDigest;X.exports.get.stream=Ir.stream;X.exports.get.stream.byDigest=Ir.stream.byDigest;X.exports.get.copy=Ir.copy;X.exports.get.copy.byDigest=Ir.copy.byDigest;X.exports.get.info=Ir.info;X.exports.get.hasContent=Ir.hasContent;X.exports.put=_N;X.exports.put.stream=_N.stream;X.exports.rm=gS.entry;X.exports.rm.all=gS.all;X.exports.rm.entry=X.exports.rm;X.exports.rm.content=gS.content;X.exports.clearMemoized=XJ;X.exports.tmp={};X.exports.tmp.mkdir=IN.mkdir;X.exports.tmp.withTmp=IN.withTmp;X.exports.verify=bN;X.exports.verify.lastRun=bN.lastRun});var vN=d((pme,ON)=>{"use strict";var kn=require("fs"),pc=require("path"),QJ=require("events").EventEmitter,e6=Hl(),mc=class i extends QJ{static{o(this,"BundleWalker")}constructor(e){if(e=e||{},super(e),this.path=pc.resolve(e.path||process.cwd()),this.parent=e.parent||null,this.parent){if(this.result=this.parent.result,!this.parent.parent){let t=pc.basename(this.path),r=pc.basename(pc.dirname(this.path));this.result.add(/^@/.test(r)?r+"/"+t:t)}this.root=this.parent.root,this.packageJsonCache=this.parent.packageJsonCache}else this.result=new Set,this.root=this.path,this.packageJsonCache=e.packageJsonCache||new Map;this.seen=new Set,this.didDone=!1,this.children=0,this.node_modules=[],this.package=null,this.bundle=null}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);return e==="done"&&this.didDone&&this.emit("done",this.result),r}done(){if(!this.didDone)if(this.didDone=!0,this.parent)this.emit("done");else{let e=Array.from(this.result);this.result=e,this.emit("done",e)}}start(){let e=pc.resolve(this.path,"package.json");return this.packageJsonCache.has(e)?this.onPackage(this.packageJsonCache.get(e)):this.readPackageJson(e),this}readPackageJson(e){kn.readFile(e,(t,r)=>t?this.done():this.onPackageJson(e,r))}onPackageJson(e,t){try{this.package=e6(JSON.parse(t+""))}catch{return this.done()}this.packageJsonCache.set(e,this.package),this.onPackage(this.package)}allDepsBundled(e){return Object.keys(e.dependencies||{}).concat(Object.keys(e.optionalDependencies||{}))}onPackage(e){let t=this.parent?this.allDepsBundled(e):e.bundleDependencies||e.bundledDependencies||[],r=Array.from(new Set(Array.isArray(t)?t:t===!0?this.allDepsBundled(e):Object.keys(t)));if(!r.length)return this.done();this.bundle=r,this.readModules()}readModules(){t6(this.path+"/node_modules",(e,t)=>e?this.onReaddir([]):this.onReaddir(t))}onReaddir(e){this.node_modules=e,this.bundle.forEach(t=>this.childDep(t)),this.children===0&&this.done()}childDep(e){this.node_modules.indexOf(e)!==-1?this.seen.has(e)||(this.seen.add(e),this.child(e)):this.parent&&this.parent.childDep(e)}child(e){let t=this.path+"/node_modules/"+e;this.children+=1;let r=new i({path:t,parent:this});r.on("done",()=>{--this.children===0&&this.done()}),r.start()}},Rh=class i extends mc{static{o(this,"BundleWalkerSync")}start(){return super.start(),this.done(),this}readPackageJson(e){try{this.onPackageJson(e,kn.readFileSync(e))}catch{}return this}readModules(){try{this.onReaddir(i6(this.path+"/node_modules"))}catch{this.onReaddir([])}}child(e){new i({path:this.path+"/node_modules/"+e,parent:this}).start()}},t6=o((i,e)=>{kn.readdir(i,(t,r)=>{if(t)e(t);else{let s=r.filter(n=>/^@/.test(n));if(!s.length)e(null,r);else{let n=r.filter(c=>!/^@/.test(c)),a=s.length;s.forEach(c=>{kn.readdir(i+"/"+c,(u,l)=>{u||!l.length?n.push(c):n.push.apply(n,l.map(h=>c+"/"+h)),--a===0&&e(null,n)})})}}})},"readdirNodeModules"),i6=o(i=>{let e=kn.readdirSync(i),t=e.filter(s=>!/^@/.test(s)),r=e.filter(s=>/^@/.test(s)).map(s=>{try{let n=kn.readdirSync(i+"/"+s);return n.length?n.map(a=>s+"/"+a):[s]}catch{return[s]}}).reduce((s,n)=>s.concat(n),[]);return t.concat(r)},"readdirNodeModulesSync"),Ah=o((i,e)=>{let t=new Promise((r,s)=>{new mc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),r6=o(i=>new Rh(i).start().result,"walkSync");ON.exports=Ah;Ah.sync=r6;Ah.BundleWalker=mc;Ah.BundleWalkerSync=Rh});var CN=d((gme,TN)=>{var s6=vN(),{readFile:n6,readdir:o6,stat:a6}=require("fs/promises"),{resolve:Th,basename:c6,dirname:RN}=require("path"),u6=Hl(),l6=o(({path:i,packageJsonCache:e})=>e.has(i)?Promise.resolve(e.get(i)):n6(i).then(t=>{let r=u6(JSON.parse(t));return e.set(i,r),r}).catch(()=>null),"readPackage"),AN=Symbol("package data has been normalized"),h6=o(({path:i,packageJsonCache:e})=>l6({path:i,packageJsonCache:e}).then(t=>{if(!t||t[AN])return t;t.bundledDependencies&&!t.bundleDependencies&&(t.bundleDependencies=t.bundledDependencies,delete t.bundledDependencies);let r=t.bundleDependencies;return r===!0&&(t.bundleDependencies=[...Object.keys(t.dependencies||{}),...Object.keys(t.optionalDependencies||{})]),typeof r=="object"&&!Array.isArray(r)&&(t.bundleDependencies=Object.keys(r)),t[AN]=!0,t}),"rpj"),Ch=o(async({path:i,depth:e=1,currentDepth:t=0,pkg:r=null,result:s=null,packageJsonCache:n=null})=>{if(s||(s=new Set),n||(n=new Map),r===!0)return h6({path:i+"/package.json",packageJsonCache:n}).then(l=>Ch({path:i,depth:e,currentDepth:t,pkg:l,result:s,packageJsonCache:n}));if(r&&r.bin){let l=RN(i),h=c6(l),f=/^@.+/.test(h)?RN(l):l,p=[];Object.keys(r.bin).forEach(y=>{let g=Th(f,".bin",y);p.push(g,g+".cmd",g+".ps1")}),(await Promise.all(p.map(y=>a6(y).then(()=>y).catch(()=>null)))).filter(y=>y).forEach(y=>s.add(y))}if(t>=e)return s.add(i),s;let[a,c]=await Promise.all([o6(i,{withFileTypes:!0}),t===0&&r&&r.bundleDependencies?s6({path:i,packageJsonCache:n}):null]).catch(()=>[]);if(!a)return s;if(!a.length&&!c&&t!==0)return s.add(i),s;let u=[];for(let l of a){let h=Th(i,l.name);if(l.isDirectory()===!1){s.add(h);continue}if(t!==0||l.name!=="node_modules"){t<e-1?u.push(Ch({path:h,packageJsonCache:n,depth:e,currentDepth:t+1,result:s})):s.add(h);continue}}return c&&u.push(...c.map(l=>{let h=Th(i,"node_modules",l);return Ch({path:h,packageJsonCache:n,pkg:!0,depth:e,currentDepth:t+1,result:s})})),u.length&&await Promise.all(u),s},"pkgContents");TN.exports=({path:i,...e})=>Ch({path:Th(i),...e,pkg:!0}).then(t=>[...t])});var Un=d((Sme,Ec)=>{"use strict";var Sc=process.platform==="win32",{URL:yS}=require("node:url"),Fn=Sc?require("node:path/win32"):require("node:path"),{homedir:f6}=require("node:os"),d6=Xu(),NN=ds(),LN=Yg(),{log:p6}=St(),MN=Sc?/\\|[/]/:/[/]/,BN=/^(?:git[+])?[a-z]+:/i,m6=/^[^@]+@[^:.]+\.[^:]+:.+$/i,ES=/[.](?:tgz|tar.gz|tar)$/i,g6=/:[0-9]+(\/|$)/i,y6=/^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/,S6=/^(?:[.]|~[/]|[/]|[a-zA-Z]:)/,PN="https://registry.npmjs.org";function gc(i,e){let t,r;if(typeof i=="object")return i instanceof yc&&(!e||e===i.where)?i:i.name&&i.rawSpec?gc.resolve(i.name,i.rawSpec,e||i.where):gc(i.raw,e||i.where);let s=i.indexOf("@",1),n=s>0?i.slice(0,s):i;return BN.test(i)?r=i:m6.test(i)?r=`git+ssh://${i}`:!n.startsWith("@")&&(MN.test(n)||ES.test(n))?r=i:s>0?(t=n,r=i.slice(s+1)||"*"):LN(i).validForOldPackages?(t=i,r="*"):r=i,kN(t,r,e,i)}o(gc,"npa");function E6(i){return i?i.toLowerCase().startsWith("file:")?!0:Sc?y6.test(i):S6.test(i):!1}o(E6,"isFileSpec");function w6(i){return i?i.toLowerCase().startsWith("npm:"):!1}o(w6,"isAliasSpec");function kN(i,e,t,r){let s=new yc({raw:r,name:i,rawSpec:e,fromArgument:r!=null});if(i&&(s.name=i),t||(t=process.cwd()),E6(e))return xN(s,t);if(w6(e))return C6(s,t);let n=d6.fromUrl(e,{noGitPlus:!0,noCommittish:!0});return n?R6(s,n):e&&BN.test(e)?T6(s):e&&(MN.test(e)||ES.test(e))?xN(s,t):N6(s)}o(kN,"resolve");function _6(i,e=PN){let t=gc(i);if(t.type!=="version")throw O6(t.type,t.raw);let r="pkg:npm/"+t.name.replace(/^@/,"%40")+"@"+t.rawSpec;return e!==PN&&(r+="?repository_url="+e),r}o(_6,"toPurl");function b6(i,e,t){let r=new Error(`Invalid package name "${i}" of package "${t}": ${e.errors.join("; ")}.`);return r.code="EINVALIDPACKAGENAME",r}o(b6,"invalidPackageName");function I6(i,e){let t=new Error(`Invalid tag name "${i}" of package "${e}": Tags may not have any characters that encodeURIComponent encodes.`);return t.code="EINVALIDTAGNAME",t}o(I6,"invalidTagName");function O6(i,e){let t=new Error(`Invalid type "${i}" of package "${e}": Purl can only be generated for "version" types.`);return t.code="EINVALIDPURLTYPE",t}o(O6,"invalidPurlType");var yc=class{static{o(this,"Result")}constructor(e){this.type=e.type,this.registry=e.registry,this.where=e.where,e.raw==null?this.raw=e.name?`${e.name}@${e.rawSpec}`:e.rawSpec:this.raw=e.raw,this.name=void 0,this.escapedName=void 0,this.scope=void 0,this.rawSpec=e.rawSpec||"",this.saveSpec=e.saveSpec,this.fetchSpec=e.fetchSpec,e.name&&this.setName(e.name),this.gitRange=e.gitRange,this.gitCommittish=e.gitCommittish,this.gitSubdir=e.gitSubdir,this.hosted=e.hosted}setName(e){let t=LN(e);if(!t.validForOldPackages)throw b6(e,t,this.raw);return this.name=e,this.scope=e[0]==="@"?e.slice(0,e.indexOf("/")):void 0,this.escapedName=e.replace("/","%2f"),this}toString(){let e=[];this.name!=null&&this.name!==""&&e.push(this.name);let t=this.saveSpec||this.fetchSpec||this.rawSpec;return t!=null&&t!==""&&e.push(t),e.length?e.join("@"):this.raw}toJSON(){let e=Object.assign({},this);return delete e.hosted,e}};function SS(i,e){if(!e){i.gitCommittish=null;return}for(let t of e.split("::")){if(!t.includes(":")){if(i.gitRange)throw new Error("cannot override existing semver range with a committish");if(i.gitCommittish)throw new Error("cannot override existing committish with a second committish");i.gitCommittish=t;continue}let[r,s]=t.split(":");if(r==="semver"){if(i.gitCommittish)throw new Error("cannot override existing committish with a semver range");if(i.gitRange)throw new Error("cannot override existing semver range with a second semver range");i.gitRange=decodeURIComponent(s);continue}if(r==="path"){if(i.gitSubdir)throw new Error("cannot override existing path with a second path");i.gitSubdir=`/${s}`;continue}p6.warn("npm-package-arg",`ignoring unknown key "${r}"`)}}o(SS,"setGitAttrs");var v6=new Map([["\0","%00"],[" ","%09"],[`
|
|
29
|
+
`,"%0A"],["\r","%0D"],[" ","%20"],['"',"%22"],["#","%23"],["%","%25"],["?","%3F"],["[","%5B"],["\\",Sc?"/":"%5C"],["]","%5D"],["^","%5E"],["|","%7C"],["~","%7E"]]);function DN(i){let e="";for(let t=0;t<i.length;t++)e=`${e}${v6.get(i[t])??i[t]}`;return e.startsWith("file:")?e:`file:${e}`}o(DN,"pathToFileURL");function xN(i,e){i.type=ES.test(i.rawSpec)?"file":"directory",i.where=e;let t=DN(i.rawSpec);t.startsWith("file:/")&&(/^file:\/\/[^/]/.test(t)&&(t=`file:/${t.slice(5)}`),/^\/{1,3}\.\.?(\/|$)/.test(t.slice(5))&&(t=t.replace(/^file:\/{1,3}/,"file:")));let r,s;try{r=new yS(t,`${DN(Fn.resolve(e))}/`),s=new yS(t)}catch(c){let u=new Error("Invalid file: URL, must comply with RFC 8089");throw Object.assign(u,{raw:i.rawSpec,spec:i,where:e,originalError:c})}let n=decodeURIComponent(s.pathname),a=decodeURIComponent(r.pathname);return Sc&&(n=n.replace(/^\/+([a-z]:\/)/i,"$1"),a=a.replace(/^\/+([a-z]:\/)/i,"$1")),/^\/~(\/|$)/.test(n)?(i.saveSpec=`file:${n.substr(1)}`,a=Fn.resolve(f6(),n.substr(3))):Fn.isAbsolute(t.slice(5))?i.saveSpec=`file:${Fn.resolve(a)}`:i.saveSpec=`file:${Fn.relative(e,a)}`,i.fetchSpec=Fn.resolve(e,a),i.saveSpec=i.saveSpec.split("\\").join("/"),i.saveSpec.startsWith("file://")&&(i.saveSpec=`file:/${i.saveSpec.slice(7)}`),i}o(xN,"fromFile");function R6(i,e){return i.type="git",i.hosted=e,i.saveSpec=e.toString({noGitPlus:!1,noCommittish:!1}),i.fetchSpec=e.getDefaultRepresentation()==="shortcut"?null:e.toString(),SS(i,e.committish),i}o(R6,"fromHostedGit");function A6(i,e){let t=new Error(`Unsupported URL Type "${i}": ${e}`);return t.code="EUNSUPPORTEDPROTOCOL",t}o(A6,"unsupportedURLType");function T6(i){let e=i.rawSpec;if(i.saveSpec=e,e.startsWith("git+ssh:")){let r=e.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);if(r&&!r[1].match(g6))return i.type="git",SS(i,r[2]),i.fetchSpec=r[1],i}else e.startsWith("git+file://")&&(e=e.replace(/\\/g,"/"));let t=new yS(e);switch(t.protocol){case"git:":case"git+http:":case"git+https:":case"git+rsync:":case"git+ftp:":case"git+file:":case"git+ssh:":i.type="git",SS(i,t.hash.slice(1)),t.protocol==="git+file:"&&/^git\+file:\/\/[a-z]:/i.test(e)?i.fetchSpec=`git+file://${t.host.toLowerCase()}:${t.pathname}`:(t.hash="",i.fetchSpec=t.toString()),i.fetchSpec.startsWith("git+")&&(i.fetchSpec=i.fetchSpec.slice(4));break;case"http:":case"https:":i.type="remote",i.fetchSpec=i.saveSpec;break;default:throw A6(t.protocol,e)}return i}o(T6,"fromURL");function C6(i,e){let t=gc(i.rawSpec.substr(4),e);if(t.type==="alias")throw new Error("nested aliases not supported");if(!t.registry)throw new Error("aliases only work for registry deps");if(!t.name)throw new Error("aliases must have a name");return i.subSpec=t,i.registry=!0,i.type="alias",i.saveSpec=null,i.fetchSpec=null,i}o(C6,"fromAlias");function N6(i){i.registry=!0;let e=i.rawSpec.trim();i.saveSpec=null,i.fetchSpec=e;let t=NN.valid(e,!0),r=NN.validRange(e,!0);if(t)i.type="version";else if(r)i.type="range";else{if(encodeURIComponent(e)!==e)throw I6(e,i.raw);i.type="tag"}return i}o(N6,"fromRegistry");Ec.exports=gc;Ec.exports.resolve=kN;Ec.exports.toPurl=_6;Ec.exports.Result=yc});var zn=d(vt=>{"use strict";var FN=vt&&vt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(vt,"__esModule",{value:!0});vt.WriteStreamSync=vt.WriteStream=vt.ReadStreamSync=vt.ReadStream=void 0;var P6=FN(require("events")),Qe=FN(require("fs")),D6=te(),x6=Qe.default.writev,vr=Symbol("_autoClose"),Wt=Symbol("_close"),wc=Symbol("_ended"),J=Symbol("_fd"),wS=Symbol("_finished"),Yi=Symbol("_flags"),_S=Symbol("_flush"),vS=Symbol("_handleChunk"),RS=Symbol("_makeBuf"),bc=Symbol("_mode"),Nh=Symbol("_needDrain"),qn=Symbol("_onerror"),Vn=Symbol("_onopen"),bS=Symbol("_onread"),jn=Symbol("_onwrite"),Rr=Symbol("_open"),Gt=Symbol("_path"),Or=Symbol("_pos"),hi=Symbol("_queue"),$n=Symbol("_read"),IS=Symbol("_readSize"),Zi=Symbol("_reading"),_c=Symbol("_remain"),OS=Symbol("_size"),Ph=Symbol("_write"),_s=Symbol("_writing"),Dh=Symbol("_defaultFlag"),bs=Symbol("_errored"),xh=class extends D6.Minipass{static{o(this,"ReadStream")}[bs]=!1;[J];[Gt];[IS];[Zi]=!1;[OS];[_c];[vr];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[bs]=!1,this[J]=typeof t.fd=="number"?t.fd:void 0,this[Gt]=e,this[IS]=t.readSize||16*1024*1024,this[Zi]=!1,this[OS]=typeof t.size=="number"?t.size:1/0,this[_c]=this[OS],this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[J]=="number"?this[$n]():this[Rr]()}get fd(){return this[J]}get path(){return this[Gt]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Rr](){Qe.default.open(this[Gt],"r",(e,t)=>this[Vn](e,t))}[Vn](e,t){e?this[qn](e):(this[J]=t,this.emit("open",t),this[$n]())}[RS](){return Buffer.allocUnsafe(Math.min(this[IS],this[_c]))}[$n](){if(!this[Zi]){this[Zi]=!0;let e=this[RS]();if(e.length===0)return process.nextTick(()=>this[bS](null,0,e));Qe.default.read(this[J],e,0,e.length,null,(t,r,s)=>this[bS](t,r,s))}}[bS](e,t,r){this[Zi]=!1,e?this[qn](e):this[vS](t,r)&&this[$n]()}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[qn](e){this[Zi]=!0,this[Wt](),this.emit("error",e)}[vS](e,t){let r=!1;return this[_c]-=e,e>0&&(r=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[_c]<=0)&&(r=!1,this[Wt](),super.end()),r}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[J]=="number"&&this[$n](),!1;case"error":return this[bs]?!1:(this[bs]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}};vt.ReadStream=xh;var AS=class extends xh{static{o(this,"ReadStreamSync")}[Rr](){let e=!0;try{this[Vn](null,Qe.default.openSync(this[Gt],"r")),e=!1}finally{e&&this[Wt]()}}[$n](){let e=!0;try{if(!this[Zi]){this[Zi]=!0;do{let t=this[RS](),r=t.length===0?0:Qe.default.readSync(this[J],t,0,t.length,null);if(!this[vS](r,t))break}while(!0);this[Zi]=!1}e=!1}finally{e&&this[Wt]()}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}};vt.ReadStreamSync=AS;var Lh=class extends P6.default{static{o(this,"WriteStream")}readable=!1;writable=!0;[bs]=!1;[_s]=!1;[wc]=!1;[hi]=[];[Nh]=!1;[Gt];[bc];[vr];[J];[Dh];[Yi];[wS]=!1;[Or];constructor(e,t){t=t||{},super(t),this[Gt]=e,this[J]=typeof t.fd=="number"?t.fd:void 0,this[bc]=t.mode===void 0?438:t.mode,this[Or]=typeof t.start=="number"?t.start:void 0,this[vr]=typeof t.autoClose=="boolean"?t.autoClose:!0;let r=this[Or]!==void 0?"r+":"w";this[Dh]=t.flags===void 0,this[Yi]=t.flags===void 0?r:t.flags,this[J]===void 0&&this[Rr]()}emit(e,...t){if(e==="error"){if(this[bs])return!1;this[bs]=!0}return super.emit(e,...t)}get fd(){return this[J]}get path(){return this[Gt]}[qn](e){this[Wt](),this[_s]=!0,this.emit("error",e)}[Rr](){Qe.default.open(this[Gt],this[Yi],this[bc],(e,t)=>this[Vn](e,t))}[Vn](e,t){this[Dh]&&this[Yi]==="r+"&&e&&e.code==="ENOENT"?(this[Yi]="w",this[Rr]()):e?this[qn](e):(this[J]=t,this.emit("open",t),this[_s]||this[_S]())}end(e,t){return e&&this.write(e,t),this[wc]=!0,!this[_s]&&!this[hi].length&&typeof this[J]=="number"&&this[jn](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[wc]?(this.emit("error",new Error("write() after end()")),!1):this[J]===void 0||this[_s]||this[hi].length?(this[hi].push(e),this[Nh]=!0,!1):(this[_s]=!0,this[Ph](e),!0)}[Ph](e){Qe.default.write(this[J],e,0,e.length,this[Or],(t,r)=>this[jn](t,r))}[jn](e,t){e?this[qn](e):(this[Or]!==void 0&&typeof t=="number"&&(this[Or]+=t),this[hi].length?this[_S]():(this[_s]=!1,this[wc]&&!this[wS]?(this[wS]=!0,this[Wt](),this.emit("finish")):this[Nh]&&(this[Nh]=!1,this.emit("drain"))))}[_S](){if(this[hi].length===0)this[wc]&&this[jn](null,0);else if(this[hi].length===1)this[Ph](this[hi].pop());else{let e=this[hi];this[hi]=[],x6(this[J],e,this[Or],(t,r)=>this[jn](t,r))}}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}};vt.WriteStream=Lh;var TS=class extends Lh{static{o(this,"WriteStreamSync")}[Rr](){let e;if(this[Dh]&&this[Yi]==="r+")try{e=Qe.default.openSync(this[Gt],this[Yi],this[bc])}catch(t){if(t?.code==="ENOENT")return this[Yi]="w",this[Rr]();throw t}else e=Qe.default.openSync(this[Gt],this[Yi],this[bc]);this[Vn](null,e)}[Wt](){if(this[vr]&&typeof this[J]=="number"){let e=this[J];this[J]=void 0,Qe.default.closeSync(e),this.emit("close")}}[Ph](e){let t=!0;try{this[jn](null,Qe.default.writeSync(this[J],e,0,e.length,this[Or])),t=!1}finally{if(t)try{this[Wt]()}catch{}}}};vt.WriteStreamSync=TS});var Mh=d(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.dealias=Se.isNoFile=Se.isFile=Se.isAsync=Se.isSync=Se.isAsyncNoFile=Se.isSyncNoFile=Se.isAsyncFile=Se.isSyncFile=void 0;var L6=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),M6=o(i=>!!i.sync&&!!i.file,"isSyncFile");Se.isSyncFile=M6;var B6=o(i=>!i.sync&&!!i.file,"isAsyncFile");Se.isAsyncFile=B6;var k6=o(i=>!!i.sync&&!i.file,"isSyncNoFile");Se.isSyncNoFile=k6;var F6=o(i=>!i.sync&&!i.file,"isAsyncNoFile");Se.isAsyncNoFile=F6;var U6=o(i=>!!i.sync,"isSync");Se.isSync=U6;var j6=o(i=>!i.sync,"isAsync");Se.isAsync=j6;var $6=o(i=>!!i.file,"isFile");Se.isFile=$6;var q6=o(i=>!i.file,"isNoFile");Se.isNoFile=q6;var V6=o(i=>{let e=L6.get(i);return e||i},"dealiasKey"),z6=o((i={})=>{if(!i)return{};let e={};for(let[t,r]of Object.entries(i)){let s=V6(t);e[s]=r}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e},"dealias");Se.dealias=z6});var Hn=d(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.makeCommand=void 0;var Ic=Mh(),H6=o((i,e,t,r,s)=>Object.assign((n=[],a,c)=>{Array.isArray(n)&&(a=n,n={}),typeof a=="function"&&(c=a,a=void 0),a?a=Array.from(a):a=[];let u=(0,Ic.dealias)(n);if(s?.(u,a),(0,Ic.isSyncFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return i(u,a)}else if((0,Ic.isAsyncFile)(u)){let l=e(u,a),h=c||void 0;return h?l.then(()=>h(),h):l}else if((0,Ic.isSyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,a)}else if((0,Ic.isAsyncNoFile)(u)){if(typeof c=="function")throw new TypeError("callback only supported with file option");return r(u,a)}else throw new Error("impossible options??")},{syncFile:i,asyncFile:e,syncNoFile:t,asyncNoFile:r,validate:s}),"makeCommand");Bh.makeCommand=H6});var CS=d(Gn=>{"use strict";var G6=Gn&&Gn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.constants=void 0;var W6=G6(require("zlib")),J6=W6.default.constants||{ZLIB_VERNUM:4736};Gn.constants=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},J6))});var vc=d(U=>{"use strict";var K6=U&&U.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Z6=U&&U.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Y6=U&&U.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&K6(t,e,r[s]);return Z6(t,e),t}})(),X6=U&&U.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(U,"__esModule",{value:!0});U.ZstdDecompress=U.ZstdCompress=U.BrotliDecompress=U.BrotliCompress=U.Unzip=U.InflateRaw=U.DeflateRaw=U.Gunzip=U.Gzip=U.Inflate=U.Deflate=U.Zlib=U.ZlibError=U.constants=void 0;var DS=X6(require("assert")),Is=require("buffer"),Q6=te(),UN=Y6(require("zlib")),fi=CS(),eK=CS();Object.defineProperty(U,"constants",{enumerable:!0,get:o(function(){return eK.constants},"get")});var tK=Is.Buffer.concat,jN=Object.getOwnPropertyDescriptor(Is.Buffer,"concat"),iK=o(i=>i,"noop"),NS=jN?.writable===!0||jN?.set!==void 0?i=>{Is.Buffer.concat=i?iK:tK}:i=>{},Os=Symbol("_superWrite"),vs=class extends Error{static{o(this,"ZlibError")}code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}};U.ZlibError=vs;var PS=Symbol("flushFlag"),Oc=class extends Q6.Minipass{static{o(this,"ZlibBase")}#e=!1;#t=!1;#i;#r;#s;#u;#c;get sawError(){return this.#e}get handle(){return this.#u}get flushFlag(){return this.#i}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#i=e.flush??0,this.#r=e.finishFlush??0,this.#s=e.fullFlushFlag??0,typeof UN[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#u=new UN[t](e)}catch(r){throw new vs(r,this.constructor)}this.#c=r=>{this.#e||(this.#e=!0,this.close(),this.emit("error",r))},this.#u?.on("error",r=>this.#c(new vs(r))),this.once("end",()=>this.close)}close(){this.#u&&(this.#u.close(),this.#u=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,DS.default)(this.#u,"zlib binding closed"),this.#u.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#s),this.write(Object.assign(Is.Buffer.alloc(0),{[PS]:e})))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#r),this.#t=!0,super.end(r)}get ended(){return this.#t}[Os](e){return super.write(e)}write(e,t,r){if(typeof t=="function"&&(r=t,t="utf8"),typeof e=="string"&&(e=Is.Buffer.from(e,t)),this.#e)return;(0,DS.default)(this.#u,"zlib binding closed");let s=this.#u._handle,n=s.close;s.close=()=>{};let a=this.#u.close;this.#u.close=()=>{},NS(!0);let c;try{let l=typeof e[PS]=="number"?e[PS]:this.#i;c=this.#u._processChunk(e,l),NS(!1)}catch(l){NS(!1),this.#c(new vs(l,this.write))}finally{this.#u&&(this.#u._handle=s,s.close=n,this.#u.close=a,this.#u.removeAllListeners("error"))}this.#u&&this.#u.on("error",l=>this.#c(new vs(l,this.write)));let u;if(c)if(Array.isArray(c)&&c.length>0){let l=c[0];u=this[Os](Is.Buffer.from(l));for(let h=1;h<c.length;h++)u=this[Os](c[h])}else u=this[Os](Is.Buffer.from(c));return r&&r(),u}},di=class extends Oc{static{o(this,"Zlib")}#e;#t;constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.Z_NO_FLUSH,e.finishFlush=e.finishFlush||fi.constants.Z_FINISH,e.fullFlushFlag=fi.constants.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#t=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#t!==t){this.flush(fi.constants.Z_SYNC_FLUSH),(0,DS.default)(this.handle,"zlib binding closed");let r=this.handle.flush;this.handle.flush=(s,n)=>{typeof s=="function"&&(n=s,s=this.flushFlag),this.flush(s),n?.()};try{this.handle.params(e,t)}finally{this.handle.flush=r}this.handle&&(this.#e=e,this.#t=t)}}}};U.Zlib=di;var xS=class extends di{static{o(this,"Deflate")}constructor(e){super(e,"Deflate")}};U.Deflate=xS;var LS=class extends di{static{o(this,"Inflate")}constructor(e){super(e,"Inflate")}};U.Inflate=LS;var MS=class extends di{static{o(this,"Gzip")}#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Os](e){return this.#e?(this.#e=!1,e[9]=255,super[Os](e)):super[Os](e)}};U.Gzip=MS;var BS=class extends di{static{o(this,"Gunzip")}constructor(e){super(e,"Gunzip")}};U.Gunzip=BS;var kS=class extends di{static{o(this,"DeflateRaw")}constructor(e){super(e,"DeflateRaw")}};U.DeflateRaw=kS;var FS=class extends di{static{o(this,"InflateRaw")}constructor(e){super(e,"InflateRaw")}};U.InflateRaw=FS;var US=class extends di{static{o(this,"Unzip")}constructor(e){super(e,"Unzip")}};U.Unzip=US;var kh=class extends Oc{static{o(this,"Brotli")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||fi.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=fi.constants.BROTLI_OPERATION_FLUSH,super(e,t)}},jS=class extends kh{static{o(this,"BrotliCompress")}constructor(e){super(e,"BrotliCompress")}};U.BrotliCompress=jS;var $S=class extends kh{static{o(this,"BrotliDecompress")}constructor(e){super(e,"BrotliDecompress")}};U.BrotliDecompress=$S;var Fh=class extends Oc{static{o(this,"Zstd")}constructor(e,t){e=e||{},e.flush=e.flush||fi.constants.ZSTD_e_continue,e.finishFlush=e.finishFlush||fi.constants.ZSTD_e_end,e.fullFlushFlag=fi.constants.ZSTD_e_flush,super(e,t)}},qS=class extends Fh{static{o(this,"ZstdCompress")}constructor(e){super(e,"ZstdCompress")}};U.ZstdCompress=qS;var VS=class extends Fh{static{o(this,"ZstdDecompress")}constructor(e){super(e,"ZstdDecompress")}};U.ZstdDecompress=VS});var VN=d(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.parse=Wn.encode=void 0;var rK=o((i,e)=>{if(Number.isSafeInteger(i))i<0?nK(i,e):sK(i,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},"encode");Wn.encode=rK;var sK=o((i,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=i&255,i=Math.floor(i/256)},"encodePositive"),nK=o((i,e)=>{e[0]=255;var t=!1;i=i*-1;for(var r=e.length;r>1;r--){var s=i&255;i=Math.floor(i/256),t?e[r-1]=$N(s):s===0?e[r-1]=0:(t=!0,e[r-1]=qN(s))}},"encodeNegative"),oK=o(i=>{let e=i[0],t=e===128?cK(i.subarray(1,i.length)):e===255?aK(i):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},"parse");Wn.parse=oK;var aK=o(i=>{for(var e=i.length,t=0,r=!1,s=e-1;s>-1;s--){var n=Number(i[s]),a;r?a=$N(n):n===0?a=n:(r=!0,a=qN(n)),a!==0&&(t-=a*Math.pow(256,e-s-1))}return t},"twos"),cK=o(i=>{for(var e=i.length,t=0,r=e-1;r>-1;r--){var s=Number(i[r]);s!==0&&(t+=s*Math.pow(256,e-r-1))}return t},"pos"),$N=o(i=>(255^i)&255,"onesComp"),qN=o(i=>(255^i)+1&255,"twosComp")});var zS=d(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.code=ft.name=ft.isName=ft.isCode=void 0;var uK=o(i=>ft.name.has(i),"isCode");ft.isCode=uK;var lK=o(i=>ft.code.has(i),"isName");ft.isName=lK;ft.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);ft.code=new Map(Array.from(ft.name).map(i=>[i[1],i[0]]))});var Kn=d(pi=>{"use strict";var hK=pi&&pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),fK=pi&&pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zN=pi&&pi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&hK(e,i,t);return fK(e,i),e};Object.defineProperty(pi,"__esModule",{value:!0});pi.Header=void 0;var Jn=require("node:path"),HN=zN(VN()),Rc=zN(zS()),WS=class{static{o(this,"Header")}cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,r,s){Buffer.isBuffer(e)?this.decode(e,t||0,r,s):e&&this.#t(e)}decode(e,t,r,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=Rs(e,t,100),this.mode=Ar(e,t+100,8),this.uid=Ar(e,t+108,8),this.gid=Ar(e,t+116,8),this.size=Ar(e,t+124,12),this.mtime=HS(e,t+136,12),this.cksum=Ar(e,t+148,12),s&&this.#t(s,!0),r&&this.#t(r);let n=Rs(e,t+156,1);if(Rc.isCode(n)&&(this.#e=n||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Rs(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Rs(e,t+265,32),this.gname=Rs(e,t+297,32),this.devmaj=Ar(e,t+329,8)??0,this.devmin=Ar(e,t+337,8)??0,e[t+475]!==0){let c=Rs(e,t+345,155);this.path=c+"/"+this.path}else{let c=Rs(e,t+345,130);c&&(this.path=c+"/"+this.path),this.atime=HS(e,t+476,12),this.ctime=HS(e,t+488,12)}let a=256;for(let c=t;c<t+148;c++)a+=e[c];for(let c=t+156;c<t+512;c++)a+=e[c];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#t(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t||r==="linkpath"&&t||r==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let r=this.ctime||this.atime?130:155,s=dK(this.path||"",r),n=s[0],a=s[1];this.needPax=!!s[2],this.needPax=As(e,t,100,n)||this.needPax,this.needPax=Tr(e,t+100,8,this.mode)||this.needPax,this.needPax=Tr(e,t+108,8,this.uid)||this.needPax,this.needPax=Tr(e,t+116,8,this.gid)||this.needPax,this.needPax=Tr(e,t+124,12,this.size)||this.needPax,this.needPax=GS(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#e.charCodeAt(0),this.needPax=As(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=As(e,t+265,32,this.uname)||this.needPax,this.needPax=As(e,t+297,32,this.gname)||this.needPax,this.needPax=Tr(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Tr(e,t+337,8,this.devmin)||this.needPax,this.needPax=As(e,t+345,r,a)||this.needPax,e[t+475]!==0?this.needPax=As(e,t+345,155,a)||this.needPax:(this.needPax=As(e,t+345,130,a)||this.needPax,this.needPax=GS(e,t+476,12,this.atime)||this.needPax,this.needPax=GS(e,t+488,12,this.ctime)||this.needPax);let c=256;for(let u=t;u<t+148;u++)c+=e[u];for(let u=t+156;u<t+512;u++)c+=e[u];return this.cksum=c,Tr(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Rc.name.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(Rc.code.get(e));if(Rc.isCode(t)||t==="Unsupported")this.#e=t;else if(Rc.isCode(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}};pi.Header=WS;var dK=o((i,e)=>{let r=i,s="",n,a=Jn.posix.parse(i).root||".";if(Buffer.byteLength(r)<100)n=[r,s,!1];else{s=Jn.posix.dirname(r),r=Jn.posix.basename(r);do Buffer.byteLength(r)<=100&&Buffer.byteLength(s)<=e?n=[r,s,!1]:Buffer.byteLength(r)>100&&Buffer.byteLength(s)<=e?n=[r.slice(0,99),s,!0]:(r=Jn.posix.join(Jn.posix.basename(s),r),s=Jn.posix.dirname(s));while(s!==a&&n===void 0);n||(n=[i.slice(0,99),"",!0])}return n},"splitPrefix"),Rs=o((i,e,t)=>i.subarray(e,e+t).toString("utf8").replace(/\0.*/,""),"decString"),HS=o((i,e,t)=>pK(Ar(i,e,t)),"decDate"),pK=o(i=>i===void 0?void 0:new Date(i*1e3),"numToDate"),Ar=o((i,e,t)=>Number(i[e])&128?HN.parse(i.subarray(e,e+t)):gK(i,e,t),"decNumber"),mK=o(i=>isNaN(i)?void 0:i,"nanUndef"),gK=o((i,e,t)=>mK(parseInt(i.subarray(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),"decSmallNumber"),yK={12:8589934591,8:2097151},Tr=o((i,e,t,r)=>r===void 0?!1:r>yK[t]||r<0?(HN.encode(r,i.subarray(e,e+t)),!0):(SK(i,e,t,r),!1),"encNumber"),SK=o((i,e,t,r)=>i.write(EK(r,t),e,t,"ascii"),"encSmallNumber"),EK=o((i,e)=>wK(Math.floor(i).toString(8),e),"octalString"),wK=o((i,e)=>(i.length===e-1?i:new Array(e-i.length-1).join("0")+i+" ")+"\0","padOctal"),GS=o((i,e,t,r)=>r===void 0?!1:Tr(i,e,t,r.getTime()/1e3),"encDate"),_K=new Array(156).join("\0"),As=o((i,e,t,r)=>r===void 0?!1:(i.write(r+_K,e,t,"utf8"),r.length!==Buffer.byteLength(r)||r.length>t),"encString")});var jh=d(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.Pax=void 0;var bK=require("node:path"),IK=Kn(),JS=class i{static{o(this,"Pax")}atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),r=512*Math.ceil(1+t/512),s=Buffer.allocUnsafe(r);for(let n=0;n<512;n++)s[n]=0;new IK.Header({path:("PaxHeader/"+(0,bK.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(s),s.write(e,512,t,"utf8");for(let n=t+512;n<s.length;n++)s[n]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===void 0)return"";let t=this[e],r=t instanceof Date?t.getTime()/1e3:t,s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
|
|
30
|
+
`,n=Buffer.byteLength(s),a=Math.floor(Math.log(n)/Math.log(10))+1;return n+a>=Math.pow(10,a)&&(a+=1),a+n+s}static parse(e,t,r=!1){return new i(OK(vK(e),t),r)}};Uh.Pax=JS;var OK=o((i,e)=>e?Object.assign({},e,i):i,"merge"),vK=o(i=>i.replace(/\n$/,"").split(`
|
|
31
|
+
`).reduce(RK,Object.create(null)),"parseKV"),RK=o((i,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return i;e=e.slice((t+" ").length);let r=e.split("="),s=r.shift();if(!s)return i;let n=s.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),a=r.join("=");return i[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(a)*1e3):/^[0-9]+$/.test(a)?+a:a,i},"parseKVLine")});var Zn=d($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.normalizeWindowsPath=void 0;var AK=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;$h.normalizeWindowsPath=AK!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")});var zh=d(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.ReadEntry=void 0;var TK=te(),qh=Zn(),KS=class extends TK.Minipass{static{o(this,"ReadEntry")}extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,qh.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,qh.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=(0,qh.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,qh.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}};Vh.ReadEntry=KS});var Gh=d(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.warnMethod=void 0;var CK=o((i,e,t,r={})=>{i.file&&(r.file=i.file),i.cwd&&(r.cwd=i.cwd),r.code=t instanceof Error&&t.code||e,r.tarCode=e,!i.strict&&r.recoverable!==!1?(t instanceof Error&&(r=Object.assign(t,r),t=t.message),i.emit("warn",e,t,r)):t instanceof Error?i.emit("error",Object.assign(t,r)):i.emit("error",Object.assign(new Error(`${e}: ${t}`),r))},"warnMethod");Hh.warnMethod=CK});var ef=d(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.Parser=void 0;var NK=require("events"),ZS=vc(),GN=Kn(),WN=jh(),PK=zh(),DK=Gh(),xK=1024*1024,tE=Buffer.from([31,139]),iE=Buffer.from([40,181,47,253]),LK=Math.max(tE.length,iE.length),Rt=Symbol("state"),Ts=Symbol("writeEntry"),Xi=Symbol("readEntry"),YS=Symbol("nextEntry"),JN=Symbol("processEntry"),mi=Symbol("extendedHeader"),Ac=Symbol("globalExtendedHeader"),Cr=Symbol("meta"),KN=Symbol("emitMeta"),ie=Symbol("buffer"),Qi=Symbol("queue"),Nr=Symbol("ended"),XS=Symbol("emittedEnd"),Cs=Symbol("emit"),Ee=Symbol("unzip"),Wh=Symbol("consumeChunk"),Jh=Symbol("consumeChunkSub"),QS=Symbol("consumeBody"),ZN=Symbol("consumeMeta"),YN=Symbol("consumeHeader"),Tc=Symbol("consuming"),eE=Symbol("bufferConcat"),Kh=Symbol("maybeEnd"),Yn=Symbol("writing"),Pr=Symbol("aborted"),Zh=Symbol("onDone"),Ns=Symbol("sawValidEntry"),Yh=Symbol("sawNullBlock"),Xh=Symbol("sawEOF"),XN=Symbol("closeStream"),MK=o(()=>!0,"noop"),rE=class extends NK.EventEmitter{static{o(this,"Parser")}file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Qi]=[];[ie];[Xi];[Ts];[Rt]="begin";[Cr]="";[mi];[Ac];[Nr]=!1;[Ee];[Pr]=!1;[Ns];[Yh]=!1;[Xh]=!1;[Yn]=!1;[Tc]=!1;[XS]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(Zh,()=>{(this[Rt]==="begin"||this[Ns]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Zh,e.ondone):this.on(Zh,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||xK,this.filter=typeof e.filter=="function"?e.filter:MK;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[XN]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){(0,DK.warnMethod)(this,e,t,r)}[YN](e,t){this[Ns]===void 0&&(this[Ns]=!1);let r;try{r=new GN.Header(e,t,this[mi],this[Ac])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[Yh]?(this[Xh]=!0,this[Rt]==="begin"&&(this[Rt]="header"),this[Cs]("eof")):(this[Yh]=!0,this[Cs]("nullBlock"));else if(this[Yh]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{let n=this[Ts]=new PK.ReadEntry(r,this[mi],this[Ac]);if(!this[Ns])if(n.remain){let a=o(()=>{n.invalid||(this[Ns]=!0)},"onend");n.on("end",a)}else this[Ns]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Cs]("ignoredEntry",n),this[Rt]="ignore",n.resume()):n.size>0&&(this[Cr]="",n.on("data",a=>this[Cr]+=a),this[Rt]="meta"):(this[mi]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Cs]("ignoredEntry",n),this[Rt]=n.remain?"ignore":"header",n.resume()):(n.remain?this[Rt]="body":(this[Rt]="header",n.end()),this[Xi]?this[Qi].push(n):(this[Qi].push(n),this[YS]())))}}}[XN](){queueMicrotask(()=>this.emit("close"))}[JN](e){let t=!0;if(!e)this[Xi]=void 0,t=!1;else if(Array.isArray(e)){let[r,...s]=e;this.emit(r,...s)}else this[Xi]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[YS]()),t=!1);return t}[YS](){do;while(this[JN](this[Qi].shift()));if(!this[Qi].length){let e=this[Xi];!e||e.flowing||e.size===e.remain?this[Yn]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[QS](e,t){let r=this[Ts];if(!r)throw new Error("attempt to consume body without entry??");let s=r.blockRemain??0,n=s>=e.length&&t===0?e:e.subarray(t,t+s);return r.write(n),r.blockRemain||(this[Rt]="header",this[Ts]=void 0,r.end()),n.length}[ZN](e,t){let r=this[Ts],s=this[QS](e,t);return!this[Ts]&&r&&this[KN](r),s}[Cs](e,t,r){!this[Qi].length&&!this[Xi]?this.emit(e,t,r):this[Qi].push([e,t,r])}[KN](e){switch(this[Cs]("meta",this[Cr]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[mi]=WN.Pax.parse(this[Cr],this[mi],!1);break;case"GlobalExtendedHeader":this[Ac]=WN.Pax.parse(this[Cr],this[Ac],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[mi]??Object.create(null);this[mi]=t,t.path=this[Cr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[mi]||Object.create(null);this[mi]=t,t.linkpath=this[Cr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Pr]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Pr])return r?.(),!1;if((this[Ee]===void 0||this.brotli===void 0&&this[Ee]===!1)&&e){if(this[ie]&&(e=Buffer.concat([this[ie],e]),this[ie]=void 0),e.length<LK)return this[ie]=e,r?.(),!0;for(let u=0;this[Ee]===void 0&&u<tE.length;u++)e[u]!==tE[u]&&(this[Ee]=!1);let a=!1;if(this[Ee]===!1&&this.zstd!==!1){a=!0;for(let u=0;u<iE.length;u++)if(e[u]!==iE[u]){a=!1;break}}let c=this.brotli===void 0&&!a;if(this[Ee]===!1&&c)if(e.length<512)if(this[Nr])this.brotli=!0;else return this[ie]=e,r?.(),!0;else try{new GN.Header(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[Ee]===void 0||this[Ee]===!1&&(this.brotli||a)){let u=this[Nr];this[Nr]=!1,this[Ee]=this[Ee]===void 0?new ZS.Unzip({}):a?new ZS.ZstdDecompress({}):new ZS.BrotliDecompress({}),this[Ee].on("data",h=>this[Wh](h)),this[Ee].on("error",h=>this.abort(h)),this[Ee].on("end",()=>{this[Nr]=!0,this[Wh]()}),this[Yn]=!0;let l=!!this[Ee][u?"end":"write"](e);return this[Yn]=!1,r?.(),l}}this[Yn]=!0,this[Ee]?this[Ee].write(e):this[Wh](e),this[Yn]=!1;let n=this[Qi].length?!1:this[Xi]?this[Xi].flowing:!0;return!n&&!this[Qi].length&&this[Xi]?.once("drain",()=>this.emit("drain")),r?.(),n}[eE](e){e&&!this[Pr]&&(this[ie]=this[ie]?Buffer.concat([this[ie],e]):e)}[Kh](){if(this[Nr]&&!this[XS]&&!this[Pr]&&!this[Tc]){this[XS]=!0;let e=this[Ts];if(e&&e.blockRemain){let t=this[ie]?this[ie].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[ie]&&e.write(this[ie]),e.end()}this[Cs](Zh)}}[Wh](e){if(this[Tc]&&e)this[eE](e);else if(!e&&!this[ie])this[Kh]();else if(e){if(this[Tc]=!0,this[ie]){this[eE](e);let t=this[ie];this[ie]=void 0,this[Jh](t)}else this[Jh](e);for(;this[ie]&&this[ie]?.length>=512&&!this[Pr]&&!this[Xh];){let t=this[ie];this[ie]=void 0,this[Jh](t)}this[Tc]=!1}(!this[ie]||this[Nr])&&this[Kh]()}[Jh](e){let t=0,r=e.length;for(;t+512<=r&&!this[Pr]&&!this[Xh];)switch(this[Rt]){case"begin":case"header":this[YN](e,t),t+=512;break;case"ignore":case"body":t+=this[QS](e,t);break;case"meta":t+=this[ZN](e,t);break;default:throw new Error("invalid state: "+this[Rt])}t<r&&(this[ie]?this[ie]=Buffer.concat([e.subarray(t),this[ie]]):this[ie]=e.subarray(t))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),r&&this.once("finish",r),this[Pr]||(this[Ee]?(e&&this[Ee].write(e),this[Ee].end()):(this[Nr]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[Kh]())),this}};Qh.Parser=rE});var rf=d(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.stripTrailingSlashes=void 0;var BK=o(i=>{let e=i.length-1,t=-1;for(;e>-1&&i.charAt(e)==="/";)t=e,e--;return t===-1?i:i.slice(0,t)},"stripTrailingSlashes");tf.stripTrailingSlashes=BK});var Qn=d(Ge=>{"use strict";var kK=Ge&&Ge.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),FK=Ge&&Ge.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),UK=Ge&&Ge.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&kK(e,i,t);return FK(e,i),e},jK=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.list=Ge.filesFilter=void 0;var $K=UK(zn()),Xn=jK(require("node:fs")),QN=require("path"),qK=Hn(),sf=ef(),sE=rf(),VK=o(i=>{let e=i.onReadEntry;i.onReadEntry=e?t=>{e(t),t.resume()}:t=>t.resume()},"onReadEntryFunction"),zK=o((i,e)=>{let t=new Map(e.map(n=>[(0,sE.stripTrailingSlashes)(n),!0])),r=i.filter,s=o((n,a="")=>{let c=a||(0,QN.parse)(n).root||".",u;if(n===c)u=!1;else{let l=t.get(n);l!==void 0?u=l:u=s((0,QN.dirname)(n),c)}return t.set(n,u),u},"mapHas");i.filter=r?(n,a)=>r(n,a)&&s((0,sE.stripTrailingSlashes)(n)):n=>s((0,sE.stripTrailingSlashes)(n))},"filesFilter");Ge.filesFilter=zK;var HK=o(i=>{let e=new sf.Parser(i),t=i.file,r;try{r=Xn.default.openSync(t,"r");let s=Xn.default.fstatSync(r),n=i.maxReadSize||16*1024*1024;if(s.size<n){let a=Buffer.allocUnsafe(s.size);Xn.default.readSync(r,a,0,s.size,0),e.end(a)}else{let a=0,c=Buffer.allocUnsafe(n);for(;a<s.size;){let u=Xn.default.readSync(r,c,0,n,a);a+=u,e.write(c.subarray(0,u))}e.end()}}finally{if(typeof r=="number")try{Xn.default.closeSync(r)}catch{}}},"listFileSync"),GK=o((i,e)=>{let t=new sf.Parser(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("end",a),Xn.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new $K.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"listFile");Ge.list=(0,qK.makeCommand)(HK,GK,i=>new sf.Parser(i),i=>new sf.Parser(i),(i,e)=>{e?.length&&(0,Ge.filesFilter)(i,e),i.noResume||VK(i)})});var eP=d(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.modeFix=void 0;var WK=o((i,e,t)=>(i&=4095,t&&(i=(i|384)&-19),e&&(i&256&&(i|=64),i&32&&(i|=8),i&4&&(i|=1)),i),"modeFix");nf.modeFix=WK});var nE=d(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.stripAbsolutePath=void 0;var JK=require("node:path"),{isAbsolute:KK,parse:tP}=JK.win32,ZK=o(i=>{let e="",t=tP(i);for(;KK(i)||t.root;){let r=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":t.root;i=i.slice(r.length),e+=r,t=tP(i)}return[e,i]},"stripAbsolutePath");of.stripAbsolutePath=ZK});var aE=d(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.decode=eo.encode=void 0;var af=["|","<",">","?",":"],oE=af.map(i=>String.fromCharCode(61440+i.charCodeAt(0))),YK=new Map(af.map((i,e)=>[i,oE[e]])),XK=new Map(oE.map((i,e)=>[i,af[e]])),QK=o(i=>af.reduce((e,t)=>e.split(t).join(YK.get(t)),i),"encode");eo.encode=QK;var eZ=o(i=>oE.reduce((e,t)=>e.split(t).join(XK.get(t)),i),"decode");eo.decode=eZ});var SE=d(Be=>{"use strict";var tZ=Be&&Be.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),iZ=Be&&Be.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),rZ=Be&&Be.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&tZ(e,i,t);return iZ(e,i),e},aP=Be&&Be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Be,"__esModule",{value:!0});Be.WriteEntryTar=Be.WriteEntrySync=Be.WriteEntry=void 0;var yi=aP(require("fs")),cP=te(),iP=aP(require("path")),uP=Kn(),lP=eP(),gi=Zn(),hP=Mh(),fP=jh(),dP=nE(),sZ=rf(),pP=Gh(),nZ=rZ(aE()),mP=o((i,e)=>e?(i=(0,gi.normalizeWindowsPath)(i).replace(/^\.(\/|$)/,""),(0,sZ.stripTrailingSlashes)(e)+"/"+i):(0,gi.normalizeWindowsPath)(i),"prefixPath"),oZ=16*1024*1024,rP=Symbol("process"),sP=Symbol("file"),nP=Symbol("directory"),uE=Symbol("symlink"),oP=Symbol("hardlink"),Cc=Symbol("header"),cf=Symbol("read"),lE=Symbol("lstat"),uf=Symbol("onlstat"),hE=Symbol("onread"),fE=Symbol("onreadlink"),dE=Symbol("openfile"),pE=Symbol("onopenfile"),Dr=Symbol("close"),lf=Symbol("mode"),mE=Symbol("awaitDrain"),cE=Symbol("ondrain"),Si=Symbol("prefix"),hf=class extends cP.Minipass{static{o(this,"WriteEntry")}path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let r=(0,hP.dealias)(t);super(),this.path=(0,gi.normalizeWindowsPath)(e),this.portable=!!r.portable,this.maxReadSize=r.maxReadSize||oZ,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=(0,gi.normalizeWindowsPath)(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime,this.prefix=r.prefix?(0,gi.normalizeWindowsPath)(r.prefix):void 0,this.onWriteEntry=r.onWriteEntry,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let s=!1;if(!this.preservePaths){let[a,c]=(0,dP.stripAbsolutePath)(this.path);a&&typeof c=="string"&&(this.path=c,s=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=nZ.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,gi.normalizeWindowsPath)(r.absolute||iP.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let n=this.statCache.get(this.absolute);n?this[uf](n):this[lE]()}warn(e,t,r={}){return(0,pP.warnMethod)(this,e,t,r)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[lE](){yi.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[uf](t)})}[uf](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=aZ(e),this.emit("stat",e),this[rP]()}[rP](){switch(this.type){case"File":return this[sP]();case"Directory":return this[nP]();case"SymbolicLink":return this[uE]();default:return this.end()}}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}[Si](e){return mP(e,this.prefix)}[Cc](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,mode:this[lf](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new fP.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[nP](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Cc](),this.end()}[uE](){yi.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[fE](t)})}[fE](e){this.linkpath=(0,gi.normalizeWindowsPath)(e),this[Cc](),this.end()}[oP](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,gi.normalizeWindowsPath)(iP.default.relative(this.cwd,e)),this.stat.size=0,this[Cc](),this.end()}[sP](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[oP](t);this.linkCache.set(e,this.absolute)}if(this[Cc](),this.stat.size===0)return this.end();this[dE]()}[dE](){yi.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[pE](t)})}[pE](e){if(this.fd=e,this.#e)return this[Dr]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[cf]()}[cf](){let{fd:e,buf:t,offset:r,length:s,pos:n}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");yi.default.read(e,t,r,s,n,(a,c)=>{if(a)return this[Dr](()=>this.emit("error",a));this[hE](c)})}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.close(this.fd,e)}[hE](e){if(e<=0&&this.remain>0){let s=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Dr](()=>this.emit("error",s))}if(e>this.remain){let s=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[Dr](()=>this.emit("error",s))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let s=e;s<this.length&&e<this.blockRemain;s++)this.buf[s+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[cE]():this[mE](()=>this[cE]())}[mE](e){this.once("drain",e)}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let s=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",s)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,r)}[cE](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Dr](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[cf]()}};Be.WriteEntry=hf;var gE=class extends hf{static{o(this,"WriteEntrySync")}sync=!0;[lE](){this[uf](yi.default.lstatSync(this.absolute))}[uE](){this[fE](yi.default.readlinkSync(this.absolute))}[dE](){this[pE](yi.default.openSync(this.absolute,"r"))}[cf](){let e=!0;try{let{fd:t,buf:r,offset:s,length:n,pos:a}=this;if(t===void 0||r===void 0)throw new Error("fd and buf must be set in READ method");let c=yi.default.readSync(t,r,s,n,a);this[hE](c),e=!1}finally{if(e)try{this[Dr](()=>{})}catch{}}}[mE](e){e()}[Dr](e=()=>{}){this.fd!==void 0&&yi.default.closeSync(this.fd),e()}};Be.WriteEntrySync=gE;var yE=class extends cP.Minipass{static{o(this,"WriteEntryTar")}blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,r={}){return(0,pP.warnMethod)(this,e,t,r)}constructor(e,t={}){let r=(0,hP.dealias)(t);super(),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.onWriteEntry=r.onWriteEntry,this.readEntry=e;let{type:s}=e;if(s==="Unsupported")throw new Error("writing entry that should be ignored");this.type=s,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix,this.path=(0,gi.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[lf](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:r.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,gi.normalizeWindowsPath)(e.linkpath):void 0,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[c,u]=(0,dP.stripAbsolutePath)(this.path);c&&typeof u=="string"&&(this.path=u,n=c)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new uP.Header({path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new fP.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[Si](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Si](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let a=this.header?.block;if(!a)throw new Error("failed to encode header");super.write(a),e.pipe(this)}[Si](e){return mP(e,this.prefix)}[lf](e){return(0,lP.modeFix)(e,this.type==="Directory",this.portable)}write(e,t,r){typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let s=e.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(e,r)}end(e,t,r){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),r&&this.once("finish",r),e?super.end(e,r):super.end(r),this}};Be.WriteEntryTar=yE;var aZ=o(i=>i.isFile()?"File":i.isDirectory()?"Directory":i.isSymbolicLink()?"SymbolicLink":"Unsupported","getType")});var gP=d(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.Node=io.Yallist=void 0;var EE=class i{static{o(this,"Yallist")}tail;head;length=0;static create(e=[]){return new i(e)}constructor(e=[]){for(let t of e)this.push(t)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,t}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let t=0,r=e.length;t<r;t++)uZ(this,e[t]);return this.length}unshift(...e){for(var t=0,r=e.length;t<r;t++)lZ(this,e[t]);return this.length}pop(){if(!this.tail)return;let e=this.tail.value,t=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,t.list=void 0,this.length--,e}shift(){if(!this.head)return;let e=this.head.value,t=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,t.list=void 0,this.length--,e}forEach(e,t){t=t||this;for(let r=this.head,s=0;r;s++)e.call(t,r.value,s,this),r=r.next}forEachReverse(e,t){t=t||this;for(let r=this.tail,s=this.length-1;r;s--)e.call(t,r.value,s,this),r=r.prev}get(e){let t=0,r=this.head;for(;r&&t<e;t++)r=r.next;if(t===e&&r)return r.value}getReverse(e){let t=0,r=this.tail;for(;r&&t<e;t++)r=r.prev;if(t===e&&r)return r.value}map(e,t){t=t||this;let r=new i;for(let s=this.head;s;)r.push(e.call(t,s.value,this)),s=s.next;return r}mapReverse(e,t){t=t||this;var r=new i;for(let s=this.tail;s;)r.push(e.call(t,s.value,this)),s=s.prev;return r}reduce(e,t){let r,s=this.head;if(arguments.length>1)r=t;else if(this.head)s=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;s;n++)r=e(r,s.value,n),s=s.next;return r}reduceReverse(e,t){let r,s=this.tail;if(arguments.length>1)r=t;else if(this.tail)s=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;s;n--)r=e(r,s.value,n),s=s.prev;return r}toArray(){let e=new Array(this.length);for(let t=0,r=this.head;r;t++)e[t]=r.value,r=r.next;return e}toArrayReverse(){let e=new Array(this.length);for(let t=0,r=this.tail;r;t++)e[t]=r.value,r=r.prev;return e}slice(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.head,n=0;for(n=0;s&&n<e;n++)s=s.next;for(;s&&n<t;n++,s=s.next)r.push(s.value);return r}sliceReverse(e=0,t=this.length){t<0&&(t+=this.length),e<0&&(e+=this.length);let r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);let s=this.length,n=this.tail;for(;n&&s>t;s--)n=n.prev;for(;n&&s>e;s--,n=n.prev)r.push(n.value);return r}splice(e,t=0,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let s=this.head;for(let a=0;s&&a<e;a++)s=s.next;let n=[];for(let a=0;s&&a<t;a++)n.push(s.value),s=this.removeNode(s);s?s!==this.tail&&(s=s.prev):s=this.tail;for(let a of r)s=cZ(this,s,a);return n}reverse(){let e=this.head,t=this.tail;for(let r=e;r;r=r.prev){let s=r.prev;r.prev=r.next,r.next=s}return this.head=t,this.tail=e,this}};io.Yallist=EE;function cZ(i,e,t){let r=e,s=e?e.next:i.head,n=new to(t,r,s,i);return n.next===void 0&&(i.tail=n),n.prev===void 0&&(i.head=n),i.length++,n}o(cZ,"insertAfter");function uZ(i,e){i.tail=new to(e,i.tail,void 0,i),i.head||(i.head=i.tail),i.length++}o(uZ,"push");function lZ(i,e){i.head=new to(e,void 0,i.head,i),i.tail||(i.tail=i.head),i.length++}o(lZ,"unshift");var to=class{static{o(this,"Node")}list;next;prev;value;constructor(e,t,r,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,r?(r.prev=this,this.next=r):this.next=void 0}};io.Node=to});var Ef=d(ke=>{"use strict";var hZ=ke&&ke.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),fZ=ke&&ke.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),dZ=ke&&ke.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&hZ(e,i,t);return fZ(e,i),e},bP=ke&&ke.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ke,"__esModule",{value:!0});ke.PackSync=ke.Pack=ke.PackJob=void 0;var yf=bP(require("fs")),vE=SE(),Dc=class{static{o(this,"PackJob")}path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}};ke.PackJob=Dc;var pZ=te(),wE=dZ(vc()),mZ=gP(),gZ=zh(),yZ=Gh(),yP=Buffer.alloc(1024),ff=Symbol("onStat"),Nc=Symbol("ended"),Jt=Symbol("queue"),ro=Symbol("current"),Ps=Symbol("process"),Pc=Symbol("processing"),SP=Symbol("processJob"),Kt=Symbol("jobs"),_E=Symbol("jobDone"),df=Symbol("addFSEntry"),EP=Symbol("addTarEntry"),RE=Symbol("stat"),AE=Symbol("readdir"),pf=Symbol("onreaddir"),mf=Symbol("pipe"),wP=Symbol("entry"),bE=Symbol("entryOpt"),gf=Symbol("writeEntryClass"),IP=Symbol("write"),IE=Symbol("ondrain"),_P=bP(require("path")),OE=Zn(),Sf=class extends pZ.Minipass{static{o(this,"Pack")}opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[gf];onWriteEntry;[Jt];[Kt]=0;[Pc]=!1;[Nc]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,OE.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[gf]=vE.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new wE.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new wE.BrotliCompress(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new wE.ZstdCompress(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",r=>super.write(r)),t.on("end",()=>super.end()),t.on("drain",()=>this[IE]()),this.on("resume",()=>t.resume())}else this.on("drain",this[IE]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[Jt]=new mZ.Yallist,this[Kt]=0,this.jobs=Number(e.jobs)||4,this[Pc]=!1,this[Nc]=!1}[IP](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&this.add(e),this[Nc]=!0,this[Ps](),r&&r(),this}write(e){if(this[Nc])throw new Error("write after end");return e instanceof gZ.ReadEntry?this[EP](e):this[df](e),this.flowing}[EP](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let r=new Dc(e.path,t);r.entry=new vE.WriteEntryTar(e,this[bE](r)),r.entry.on("end",()=>this[_E](r)),this[Kt]+=1,this[Jt].push(r)}this[Ps]()}[df](e){let t=(0,OE.normalizeWindowsPath)(_P.default.resolve(this.cwd,e));this[Jt].push(new Dc(e,t)),this[Ps]()}[RE](e){e.pending=!0,this[Kt]+=1;let t=this.follow?"stat":"lstat";yf.default[t](e.absolute,(r,s)=>{e.pending=!1,this[Kt]-=1,r?this.emit("error",r):this[ff](e,s)})}[ff](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Ps]()}[AE](e){e.pending=!0,this[Kt]+=1,yf.default.readdir(e.absolute,(t,r)=>{if(e.pending=!1,this[Kt]-=1,t)return this.emit("error",t);this[pf](e,r)})}[pf](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Ps]()}[Ps](){if(!this[Pc]){this[Pc]=!0;for(let e=this[Jt].head;e&&this[Kt]<this.jobs;e=e.next)if(this[SP](e.value),e.value.ignore){let t=e.next;this[Jt].removeNode(e),e.next=t}this[Pc]=!1,this[Nc]&&!this[Jt].length&&this[Kt]===0&&(this.zip?this.zip.end(yP):(super.write(yP),super.end()))}}get[ro](){return this[Jt]&&this[Jt].head&&this[Jt].head.value}[_E](e){this[Jt].shift(),this[Kt]-=1,this[Ps]()}[SP](e){if(!e.pending){if(e.entry){e===this[ro]&&!e.piped&&this[mf](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[ff](e,t):this[RE](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[pf](e,t):this[AE](e),!e.readdir)return}if(e.entry=this[wP](e),!e.entry){e.ignore=!0;return}e===this[ro]&&!e.piped&&this[mf](e)}}}[bE](e){return{onwarn:o((t,r,s)=>this.warn(t,r,s),"onwarn"),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[wP](e){this[Kt]+=1;try{return new this[gf](e.path,this[bE](e)).on("end",()=>this[_E](e)).on("error",r=>this.emit("error",r))}catch(t){this.emit("error",t)}}[IE](){this[ro]&&this[ro].entry&&this[ro].entry.resume()}[mf](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)});let t=e.entry,r=this.zip;if(!t)throw new Error("cannot pipe without source");r?t.on("data",s=>{r.write(s)||t.pause()}):t.on("data",s=>{super.write(s)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,r={}){(0,yZ.warnMethod)(this,e,t,r)}};ke.Pack=Sf;var TE=class extends Sf{static{o(this,"PackSync")}sync=!0;constructor(e){super(e),this[gf]=vE.WriteEntrySync}pause(){}resume(){}[RE](e){let t=this.follow?"statSync":"lstatSync";this[ff](e,yf.default[t](e.absolute))}[AE](e){this[pf](e,yf.default.readdirSync(e.absolute))}[mf](e){let t=e.entry,r=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let n=e.path,a=n==="./"?"":n.replace(/\/*$/,"/");this[df](a+s)}),!t)throw new Error("Cannot pipe without source");r?t.on("data",s=>{r.write(s)}):t.on("data",s=>{super[IP](s)})}};ke.PackSync=TE});var CE=d(so=>{"use strict";var SZ=so&&so.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(so,"__esModule",{value:!0});so.create=void 0;var OP=zn(),vP=SZ(require("node:path")),RP=Qn(),EZ=Hn(),wf=Ef(),wZ=o((i,e)=>{let t=new wf.PackSync(i),r=new OP.WriteStreamSync(i.file,{mode:i.mode||438});t.pipe(r),AP(t,e)},"createFileSync"),_Z=o((i,e)=>{let t=new wf.Pack(i),r=new OP.WriteStream(i.file,{mode:i.mode||438});t.pipe(r);let s=new Promise((n,a)=>{r.on("error",a),r.on("close",n),t.on("error",a)});return TP(t,e),s},"createFile"),AP=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,RP.list)({file:vP.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),TP=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,RP.list)({file:vP.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>{i.add(s)},"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync"),bZ=o((i,e)=>{let t=new wf.PackSync(i);return AP(t,e),t},"createSync"),IZ=o((i,e)=>{let t=new wf.Pack(i);return TP(t,e),t},"createAsync");so.create=(0,EZ.makeCommand)(wZ,_Z,bZ,IZ,(i,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var PP=d(no=>{"use strict";var OZ=no&&no.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(no,"__esModule",{value:!0});no.getWriteFlag=void 0;var CP=OZ(require("fs")),vZ=process.env.__FAKE_PLATFORM__||process.platform,RZ=vZ==="win32",{O_CREAT:AZ,O_TRUNC:TZ,O_WRONLY:CZ}=CP.default.constants,NP=Number(process.env.__FAKE_FS_O_FILENAME__)||CP.default.constants.UV_FS_O_FILEMAP||0,NZ=RZ&&!!NP,PZ=512*1024,DZ=NP|TZ|AZ|CZ;no.getWriteFlag=NZ?i=>i<PZ?DZ:"w":()=>"w"});var xP=d(Ei=>{"use strict";var DP=Ei&&Ei.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.chownrSync=Ei.chownr=void 0;var bf=DP(require("node:fs")),xc=DP(require("node:path")),NE=o((i,e,t)=>{try{return bf.default.lchownSync(i,e,t)}catch(r){if(r?.code!=="ENOENT")throw r}},"lchownSync"),_f=o((i,e,t,r)=>{bf.default.lchown(i,e,t,s=>{r(s&&s?.code!=="ENOENT"?s:null)})},"chown"),xZ=o((i,e,t,r,s)=>{if(e.isDirectory())(0,Ei.chownr)(xc.default.resolve(i,e.name),t,r,n=>{if(n)return s(n);let a=xc.default.resolve(i,e.name);_f(a,t,r,s)});else{let n=xc.default.resolve(i,e.name);_f(n,t,r,s)}},"chownrKid"),LZ=o((i,e,t,r)=>{bf.default.readdir(i,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return r();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return r(s)}if(s||!n.length)return _f(i,e,t,r);let a=n.length,c=null,u=o(l=>{if(!c){if(l)return r(c=l);if(--a===0)return _f(i,e,t,r)}},"then");for(let l of n)xZ(i,l,e,t,u)})},"chownr");Ei.chownr=LZ;var MZ=o((i,e,t,r)=>{e.isDirectory()&&(0,Ei.chownrSync)(xc.default.resolve(i,e.name),t,r),NE(xc.default.resolve(i,e.name),t,r)},"chownrKidSync"),BZ=o((i,e,t)=>{let r;try{r=bf.default.readdirSync(i,{withFileTypes:!0})}catch(s){let n=s;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return NE(i,e,t);throw n}for(let s of r)MZ(i,s,e,t);return NE(i,e,t)},"chownrSync");Ei.chownrSync=BZ});var LP=d(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.CwdError=void 0;var PE=class extends Error{static{o(this,"CwdError")}path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}};If.CwdError=PE});var MP=d(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.SymlinkError=void 0;var DE=class extends Error{static{o(this,"SymlinkError")}path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}};Of.SymlinkError=DE});var jP=d(xr=>{"use strict";var LE=xr&&xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xr,"__esModule",{value:!0});xr.mkdirSync=xr.mkdir=void 0;var BP=xP(),dt=LE(require("node:fs")),kZ=LE(require("node:fs/promises")),vf=LE(require("node:path")),kP=LP(),er=Zn(),FP=MP(),FZ=o((i,e)=>{dt.default.stat(i,(t,r)=>{(t||!r.isDirectory())&&(t=new kP.CwdError(i,t?.code||"ENOTDIR")),e(t)})},"checkCwd"),UZ=o((i,e,t)=>{i=(0,er.normalizeWindowsPath)(i);let r=e.umask??18,s=e.mode|448,n=(s&r)!==0,a=e.uid,c=e.gid,u=typeof a=="number"&&typeof c=="number"&&(a!==e.processUid||c!==e.processGid),l=e.preserve,h=e.unlink,f=(0,er.normalizeWindowsPath)(e.cwd),p=o((g,S)=>{g?t(g):S&&u?(0,BP.chownr)(S,a,c,E=>p(E)):n?dt.default.chmod(i,s,t):t()},"done");if(i===f)return FZ(i,p);if(l)return kZ.default.mkdir(i,{mode:s,recursive:!0}).then(g=>p(null,g??void 0),p);let y=(0,er.normalizeWindowsPath)(vf.default.relative(f,i)).split("/");xE(f,y,s,h,f,void 0,p)},"mkdir");xr.mkdir=UZ;var xE=o((i,e,t,r,s,n,a)=>{if(!e.length)return a(null,n);let c=e.shift(),u=(0,er.normalizeWindowsPath)(vf.default.resolve(i+"/"+c));dt.default.mkdir(u,t,UP(u,e,t,r,s,n,a))},"mkdir_"),UP=o((i,e,t,r,s,n,a)=>c=>{c?dt.default.lstat(i,(u,l)=>{if(u)u.path=u.path&&(0,er.normalizeWindowsPath)(u.path),a(u);else if(l.isDirectory())xE(i,e,t,r,s,n,a);else if(r)dt.default.unlink(i,h=>{if(h)return a(h);dt.default.mkdir(i,t,UP(i,e,t,r,s,n,a))});else{if(l.isSymbolicLink())return a(new FP.SymlinkError(i,i+"/"+e.join("/")));a(c)}}):(n=n||i,xE(i,e,t,r,s,n,a))},"onmkdir"),jZ=o(i=>{let e=!1,t;try{e=dt.default.statSync(i).isDirectory()}catch(r){t=r?.code}finally{if(!e)throw new kP.CwdError(i,t??"ENOTDIR")}},"checkCwdSync"),$Z=o((i,e)=>{i=(0,er.normalizeWindowsPath)(i);let t=e.umask??18,r=e.mode|448,s=(r&t)!==0,n=e.uid,a=e.gid,c=typeof n=="number"&&typeof a=="number"&&(n!==e.processUid||a!==e.processGid),u=e.preserve,l=e.unlink,h=(0,er.normalizeWindowsPath)(e.cwd),f=o(g=>{g&&c&&(0,BP.chownrSync)(g,n,a),s&&dt.default.chmodSync(i,r)},"done");if(i===h)return jZ(h),f();if(u)return f(dt.default.mkdirSync(i,{mode:r,recursive:!0})??void 0);let m=(0,er.normalizeWindowsPath)(vf.default.relative(h,i)).split("/"),y;for(let g=m.shift(),S=h;g&&(S+="/"+g);g=m.shift()){S=(0,er.normalizeWindowsPath)(vf.default.resolve(S));try{dt.default.mkdirSync(S,r),y=y||S}catch{let _=dt.default.lstatSync(S);if(_.isDirectory())continue;if(l){dt.default.unlinkSync(S),dt.default.mkdirSync(S,r),y=y||S;continue}else if(_.isSymbolicLink())return new FP.SymlinkError(S,S+"/"+m.join("/"))}}return f(y)},"mkdirSync");xr.mkdirSync=$Z});var qP=d(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.normalizeUnicode=void 0;var ME=Object.create(null),$P=1e4,oo=new Set,qZ=o(i=>{oo.has(i)?oo.delete(i):ME[i]=i.normalize("NFD"),oo.add(i);let e=ME[i],t=oo.size-$P;if(t>$P/10){for(let r of oo)if(oo.delete(r),delete ME[r],--t<=0)break}return e},"normalizeUnicode");Rf.normalizeUnicode=qZ});var zP=d(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.PathReservations=void 0;var VP=require("node:path"),VZ=qP(),zZ=rf(),HZ=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,GZ=HZ==="win32",WZ=o(i=>i.split("/").slice(0,-1).reduce((t,r)=>{let s=t[t.length-1];return s!==void 0&&(r=(0,VP.join)(s,r)),t.push(r||"/"),t},[]),"getDirs"),BE=class{static{o(this,"PathReservations")}#e=new Map;#t=new Map;#i=new Set;reserve(e,t){e=GZ?["win32 parallelization disabled"]:e.map(s=>(0,zZ.stripTrailingSlashes)((0,VP.join)((0,VZ.normalizeUnicode)(s))).toLowerCase());let r=new Set(e.map(s=>WZ(s)).reduce((s,n)=>s.concat(n)));this.#t.set(t,{dirs:r,paths:e});for(let s of e){let n=this.#e.get(s);n?n.push(t):this.#e.set(s,[t])}for(let s of r){let n=this.#e.get(s);if(!n)this.#e.set(s,[new Set([t])]);else{let a=n[n.length-1];a instanceof Set?a.add(t):n.push(new Set([t]))}}return this.#s(t)}#r(e){let t=this.#t.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(r=>this.#e.get(r)),dirs:[...t.dirs].map(r=>this.#e.get(r))}}check(e){let{paths:t,dirs:r}=this.#r(e);return t.every(s=>s&&s[0]===e)&&r.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#s(e){return this.#i.has(e)||!this.check(e)?!1:(this.#i.add(e),e(()=>this.#u(e)),!0)}#u(e){if(!this.#i.has(e))return!1;let t=this.#t.get(e);if(!t)throw new Error("invalid reservation");let{paths:r,dirs:s}=t,n=new Set;for(let a of r){let c=this.#e.get(a);if(!c||c?.[0]!==e)continue;let u=c[1];if(!u){this.#e.delete(a);continue}if(c.shift(),typeof u=="function")n.add(u);else for(let l of u)n.add(l)}for(let a of s){let c=this.#e.get(a),u=c?.[0];if(!(!c||!(u instanceof Set)))if(u.size===1&&c.length===1){this.#e.delete(a);continue}else if(u.size===1){c.shift();let l=c[0];typeof l=="function"&&n.add(l)}else u.delete(e)}return this.#i.delete(e),n.forEach(a=>this.#s(a)),!0}};Af.PathReservations=BE});var GE=d(et=>{"use strict";var JZ=et&&et.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),KZ=et&&et.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),eD=et&&et.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&JZ(e,i,t);return KZ(e,i),e},HE=et&&et.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(et,"__esModule",{value:!0});et.UnpackSync=et.Unpack=void 0;var ZZ=eD(zn()),YZ=HE(require("node:assert")),tD=require("node:crypto"),H=HE(require("node:fs")),tr=HE(require("node:path")),iD=PP(),rD=jP(),Zt=Zn(),XZ=ef(),QZ=nE(),HP=eD(aE()),eY=zP(),GP=Symbol("onEntry"),UE=Symbol("checkFs"),WP=Symbol("checkFs2"),jE=Symbol("isReusable"),At=Symbol("makeFs"),$E=Symbol("file"),qE=Symbol("directory"),Nf=Symbol("link"),JP=Symbol("symlink"),KP=Symbol("hardlink"),ZP=Symbol("unsupported"),YP=Symbol("checkPath"),Lr=Symbol("mkdir"),Fe=Symbol("onError"),Tf=Symbol("pending"),XP=Symbol("pend"),ao=Symbol("unpend"),kE=Symbol("ended"),FE=Symbol("maybeClose"),VE=Symbol("skip"),Lc=Symbol("doChown"),Mc=Symbol("uid"),Bc=Symbol("gid"),kc=Symbol("checkedCwd"),tY=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fc=tY==="win32",iY=1024,rY=o((i,e)=>{if(!Fc)return H.default.unlink(i,e);let t=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.rename(i,t,r=>{if(r)return e(r);H.default.unlink(t,e)})},"unlinkFile"),sY=o(i=>{if(!Fc)return H.default.unlinkSync(i);let e=i+".DELETE."+(0,tD.randomBytes)(16).toString("hex");H.default.renameSync(i,e),H.default.unlinkSync(e)},"unlinkFileSync"),QP=o((i,e,t)=>i!==void 0&&i===i>>>0?i:e!==void 0&&e===e>>>0?e:t,"uint32"),Pf=class extends XZ.Parser{static{o(this,"Unpack")}[kE]=!1;[kc]=!1;[Tf]=0;reservations=new eY.PathReservations;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[kE]=!0,this[FE]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:iY,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Fc,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,Zt.normalizeWindowsPath)(tr.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[GP](t))}warn(e,t,r={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(r.recoverable=!1),super.warn(e,t,r)}[FE](){this[kE]&&this[Tf]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[YP](e){let t=(0,Zt.normalizeWindowsPath)(e.path),r=t.split("/");if(this.strip){if(r.length<this.strip)return!1;if(e.type==="Link"){let s=(0,Zt.normalizeWindowsPath)(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}r.splice(0,this.strip),e.path=r.join("/")}if(isFinite(this.maxDepth)&&r.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:r.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(r.includes("..")||Fc&&/^[a-z]:\.\.$/i.test(r[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[s,n]=(0,QZ.stripAbsolutePath)(t);s&&(e.path=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:t}))}if(tr.default.isAbsolute(e.path)?e.absolute=(0,Zt.normalizeWindowsPath)(tr.default.resolve(e.path)):e.absolute=(0,Zt.normalizeWindowsPath)(tr.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,Zt.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:s}=tr.default.win32.parse(String(e.absolute));e.absolute=s+HP.encode(String(e.absolute).slice(s.length));let{root:n}=tr.default.win32.parse(e.path);e.path=n+HP.encode(e.path.slice(n.length))}return!0}[GP](e){if(!this[YP](e))return e.resume();switch(YZ.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[UE](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[ZP](e)}}[Fe](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ao](),t.resume())}[Lr](e,t,r){(0,rD.mkdir)((0,Zt.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},r)}[Lc](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Mc](e){return QP(this.uid,e.uid,this.processUid)}[Bc](e){return QP(this.gid,e.gid,this.processGid)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new ZZ.WriteStream(String(e.absolute),{flags:(0,iD.getWriteFlag)(e.size),mode:r,autoClose:!1});s.on("error",u=>{s.fd&&H.default.close(s.fd,()=>{}),s.write=()=>!0,this[Fe](u,e),t()});let n=1,a=o(u=>{if(u){s.fd&&H.default.close(s.fd,()=>{}),this[Fe](u,e),t();return}--n===0&&s.fd!==void 0&&H.default.close(s.fd,l=>{l?this[Fe](l,e):this[ao](),t()})},"done");s.on("finish",()=>{let u=String(e.absolute),l=s.fd;if(typeof l=="number"&&e.mtime&&!this.noMtime){n++;let h=e.atime||new Date,f=e.mtime;H.default.futimes(l,h,f,p=>p?H.default.utimes(u,h,f,m=>a(m&&p)):a())}if(typeof l=="number"&&this[Lc](e)){n++;let h=this[Mc](e),f=this[Bc](e);typeof h=="number"&&typeof f=="number"&&H.default.fchown(l,h,f,p=>p?H.default.chown(u,h,f,m=>a(m&&p)):a())}a()});let c=this.transform&&this.transform(e)||e;c!==e&&(c.on("error",u=>{this[Fe](u,e),t()}),e.pipe(c)),c.pipe(s)}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Lr](String(e.absolute),r,s=>{if(s){this[Fe](s,e),t();return}let n=1,a=o(()=>{--n===0&&(t(),this[ao](),e.resume())},"done");e.mtime&&!this.noMtime&&(n++,H.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,a)),this[Lc](e)&&(n++,H.default.chown(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)),a)),a()})}[ZP](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[JP](e,t){this[Nf](e,String(e.linkpath),"symlink",t)}[KP](e,t){let r=(0,Zt.normalizeWindowsPath)(tr.default.resolve(this.cwd,String(e.linkpath)));this[Nf](e,r,"link",t)}[XP](){this[Tf]++}[ao](){this[Tf]--,this[FE]()}[VE](e){this[ao](),e.resume()}[jE](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Fc}[UE](e){this[XP]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,r=>this[WP](e,r))}[WP](e,t){let r=o(c=>{t(c)},"done"),s=o(()=>{this[Lr](this.cwd,this.dmode,c=>{if(c){this[Fe](c,e),r();return}this[kc]=!0,n()})},"checkCwd"),n=o(()=>{if(e.absolute!==this.cwd){let c=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(c!==this.cwd)return this[Lr](c,this.dmode,u=>{if(u){this[Fe](u,e),r();return}a()})}a()},"start"),a=o(()=>{H.default.lstat(String(e.absolute),(c,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[VE](e),r();return}if(c||this[jE](e,u))return this[At](null,e,r);if(u.isDirectory()){if(e.type==="Directory"){let l=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,h=o(f=>this[At](f??null,e,r),"afterChmod");return l?H.default.chmod(String(e.absolute),Number(e.mode),h):h()}if(e.absolute!==this.cwd)return H.default.rmdir(String(e.absolute),l=>this[At](l??null,e,r))}if(e.absolute===this.cwd)return this[At](null,e,r);rY(String(e.absolute),l=>this[At](l??null,e,r))})},"afterMakeParent");this[kc]?n():s()}[At](e,t,r){if(e){this[Fe](e,t),r();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[$E](t,r);case"Link":return this[KP](t,r);case"SymbolicLink":return this[JP](t,r);case"Directory":case"GNUDumpDir":return this[qE](t,r)}}[Nf](e,t,r,s){H.default[r](t,String(e.absolute),n=>{n?this[Fe](n,e):(this[ao](),e.resume()),s()})}};et.Unpack=Pf;var Cf=o(i=>{try{return[null,i()]}catch(e){return[e,null]}},"callSync"),zE=class extends Pf{static{o(this,"UnpackSync")}sync=!0;[At](e,t){return super[At](e,t,()=>{})}[UE](e){if(!this[kc]){let n=this[Lr](this.cwd,this.dmode);if(n)return this[Fe](n,e);this[kc]=!0}if(e.absolute!==this.cwd){let n=(0,Zt.normalizeWindowsPath)(tr.default.dirname(String(e.absolute)));if(n!==this.cwd){let a=this[Lr](n,this.dmode);if(a)return this[Fe](a,e)}}let[t,r]=Cf(()=>H.default.lstatSync(String(e.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(e.mtime??r.mtime)))return this[VE](e);if(t||this[jE](e,r))return this[At](null,e);if(r.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(r.mode&4095)!==e.mode,[c]=a?Cf(()=>{H.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[At](c,e)}let[n]=Cf(()=>H.default.rmdirSync(String(e.absolute)));this[At](n,e)}let[s]=e.absolute===this.cwd?[]:Cf(()=>sY(String(e.absolute)));this[At](s,e)}[$E](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o(c=>{let u;try{H.default.closeSync(n)}catch(l){u=l}(c||u)&&this[Fe](c||u,e),t()},"oner"),n;try{n=H.default.openSync(String(e.absolute),(0,iD.getWriteFlag)(e.size),r)}catch(c){return s(c)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",c=>this[Fe](c,e)),e.pipe(a)),a.on("data",c=>{try{H.default.writeSync(n,c,0,c.length)}catch(u){s(u)}}),a.on("end",()=>{let c=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,l=e.mtime;try{H.default.futimesSync(n,u,l)}catch(h){try{H.default.utimesSync(String(e.absolute),u,l)}catch{c=h}}}if(this[Lc](e)){let u=this[Mc](e),l=this[Bc](e);try{H.default.fchownSync(n,Number(u),Number(l))}catch(h){try{H.default.chownSync(String(e.absolute),Number(u),Number(l))}catch{c=c||h}}}s(c)})}[qE](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[Lr](String(e.absolute),r);if(s){this[Fe](s,e),t();return}if(e.mtime&&!this.noMtime)try{H.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Lc](e))try{H.default.chownSync(String(e.absolute),Number(this[Mc](e)),Number(this[Bc](e)))}catch{}t(),e.resume()}[Lr](e,t){try{return(0,rD.mkdirSync)((0,Zt.normalizeWindowsPath)(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(r){return r}}[Nf](e,t,r,s){let n=`${r}Sync`;try{H.default[n](t,String(e.absolute)),s(),e.resume()}catch(a){return this[Fe](a,e)}}};et.UnpackSync=zE});var WE=d(Tt=>{"use strict";var nY=Tt&&Tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),oY=Tt&&Tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),aY=Tt&&Tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&nY(e,i,t);return oY(e,i),e},cY=Tt&&Tt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.extract=void 0;var sD=aY(zn()),nD=cY(require("node:fs")),uY=Qn(),lY=Hn(),Df=GE(),hY=o(i=>{let e=new Df.UnpackSync(i),t=i.file,r=nD.default.statSync(t),s=i.maxReadSize||16*1024*1024;new sD.ReadStreamSync(t,{readSize:s,size:r.size}).pipe(e)},"extractFileSync"),fY=o((i,e)=>{let t=new Df.Unpack(i),r=i.maxReadSize||16*1024*1024,s=i.file;return new Promise((a,c)=>{t.on("error",c),t.on("close",a),nD.default.stat(s,(u,l)=>{if(u)c(u);else{let h=new sD.ReadStream(s,{readSize:r,size:l.size});h.on("error",c),h.pipe(t)}})})},"extractFile");Tt.extract=(0,lY.makeCommand)(hY,fY,i=>new Df.UnpackSync(i),i=>new Df.Unpack(i),(i,e)=>{e?.length&&(0,uY.filesFilter)(i,e)})});var xf=d(co=>{"use strict";var oD=co&&co.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(co,"__esModule",{value:!0});co.replace=void 0;var aD=zn(),pt=oD(require("node:fs")),cD=oD(require("node:path")),uD=Kn(),lD=Qn(),dY=Hn(),pY=Mh(),hD=Ef(),mY=o((i,e)=>{let t=new hD.PackSync(i),r=!0,s,n;try{try{s=pt.default.openSync(i.file,"r+")}catch(u){if(u?.code==="ENOENT")s=pt.default.openSync(i.file,"w+");else throw u}let a=pt.default.fstatSync(s),c=Buffer.alloc(512);e:for(n=0;n<a.size;n+=512){for(let h=0,f=0;h<512;h+=f){if(f=pt.default.readSync(s,c,h,c.length-h,n+h),n===0&&c[0]===31&&c[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let u=new uD.Header(c);if(!u.cksumValid)break;let l=512*Math.ceil((u.size||0)/512);if(n+l+512>a.size)break;n+=l,i.mtimeCache&&u.mtime&&i.mtimeCache.set(String(u.path),u.mtime)}r=!1,gY(i,t,n,s,e)}finally{if(r)try{pt.default.closeSync(s)}catch{}}},"replaceSync"),gY=o((i,e,t,r,s)=>{let n=new aD.WriteStreamSync(i.file,{fd:r,start:t});e.pipe(n),SY(e,s)},"streamSync"),yY=o((i,e)=>{e=Array.from(e);let t=new hD.Pack(i),r=o((n,a,c)=>{let u=o((m,y)=>{m?pt.default.close(n,g=>c(m)):c(null,y)},"cb"),l=0;if(a===0)return u(null,0);let h=0,f=Buffer.alloc(512),p=o((m,y)=>{if(m||typeof y>"u")return u(m);if(h+=y,h<512&&y)return pt.default.read(n,f,h,f.length-h,l+h,p);if(l===0&&f[0]===31&&f[1]===139)return u(new Error("cannot append to compressed archives"));if(h<512)return u(null,l);let g=new uD.Header(f);if(!g.cksumValid)return u(null,l);let S=512*Math.ceil((g.size??0)/512);if(l+S+512>a||(l+=S+512,l>=a))return u(null,l);i.mtimeCache&&g.mtime&&i.mtimeCache.set(String(g.path),g.mtime),h=0,pt.default.read(n,f,0,512,l,p)},"onread");pt.default.read(n,f,0,512,l,p)},"getPos");return new Promise((n,a)=>{t.on("error",a);let c="r+",u=o((l,h)=>{if(l&&l.code==="ENOENT"&&c==="r+")return c="w+",pt.default.open(i.file,c,u);if(l||!h)return a(l);pt.default.fstat(h,(f,p)=>{if(f)return pt.default.close(h,()=>a(f));r(h,p.size,(m,y)=>{if(m)return a(m);let g=new aD.WriteStream(i.file,{fd:h,start:y});t.pipe(g),g.on("error",a),g.on("close",n),EY(t,e)})})},"onopen");pt.default.open(i.file,c,u)})},"replaceAsync"),SY=o((i,e)=>{e.forEach(t=>{t.charAt(0)==="@"?(0,lD.list)({file:cD.default.resolve(i.cwd,t.slice(1)),sync:!0,noResume:!0,onReadEntry:o(r=>i.add(r),"onReadEntry")}):i.add(t)}),i.end()},"addFilesSync"),EY=o(async(i,e)=>{for(let t=0;t<e.length;t++){let r=String(e[t]);r.charAt(0)==="@"?await(0,lD.list)({file:cD.default.resolve(String(i.cwd),r.slice(1)),noResume:!0,onReadEntry:o(s=>i.add(s),"onReadEntry")}):i.add(r)}i.end()},"addFilesAsync");co.replace=(0,dY.makeCommand)(mY,yY,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(i,e)=>{if(!(0,pY.isFile)(i))throw new TypeError("file is required");if(i.gzip||i.brotli||i.zstd||i.file.endsWith(".br")||i.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var JE=d(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});Lf.update=void 0;var wY=Hn(),Uc=xf();Lf.update=(0,wY.makeCommand)(Uc.replace.syncFile,Uc.replace.asyncFile,Uc.replace.syncNoFile,Uc.replace.asyncNoFile,(i,e=[])=>{Uc.replace.validate?.(i,e),_Y(i)});var _Y=o(i=>{let e=i.filter;i.mtimeCache||(i.mtimeCache=new Map),i.filter=e?(t,r)=>e(t,r)&&!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0)):(t,r)=>!((i.mtimeCache?.get(t)??r.mtime??0)>(r.mtime??0))},"mtimeFilter")});var KE=d(V=>{"use strict";var fD=V&&V.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),bY=V&&V.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Ct=V&&V.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&fD(e,i,t)},IY=V&&V.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&fD(e,i,t);return bY(e,i),e};Object.defineProperty(V,"__esModule",{value:!0});V.u=V.types=V.r=V.t=V.x=V.c=void 0;Ct(CE(),V);var OY=CE();Object.defineProperty(V,"c",{enumerable:!0,get:o(function(){return OY.create},"get")});Ct(WE(),V);var vY=WE();Object.defineProperty(V,"x",{enumerable:!0,get:o(function(){return vY.extract},"get")});Ct(Kn(),V);Ct(Qn(),V);var RY=Qn();Object.defineProperty(V,"t",{enumerable:!0,get:o(function(){return RY.list},"get")});Ct(Ef(),V);Ct(ef(),V);Ct(jh(),V);Ct(zh(),V);Ct(xf(),V);var AY=xf();Object.defineProperty(V,"r",{enumerable:!0,get:o(function(){return AY.replace},"get")});V.types=IY(zS());Ct(GE(),V);Ct(JE(),V);var TY=JE();Object.defineProperty(V,"u",{enumerable:!0,get:o(function(){return TY.update},"get")});Ct(SE(),V)});var Ds=d((Pge,dD)=>{dD.exports={cacheFetches:Symbol.for("pacote.Fetcher._cacheFetches"),readPackageJson:Symbol.for("package.Fetcher._readPackageJson"),tarballFromResolved:Symbol.for("pacote.Fetcher._tarballFromResolved")}});var mD=d((Dge,pD)=>{var{resolve:ZE}=require("node:path"),{tmpdir:CY,homedir:NY}=require("node:os");pD.exports=(i=!1)=>{let e=CY(),t=process.getuid?process.getuid():process.pid,r=NY()||ZE(e,"npm-"+t),s=i||process.platform,n=s==="win32"?"npm-cache":".npm",a=s==="win32"&&process.env.LOCALAPPDATA||r;return{cacache:ZE(a,n,"_cacache"),tufcache:ZE(a,n,"_tuf")}}});var YE=d((xge,gD)=>{var PY=o((i,e)=>typeof e=="string"?{[i]:e}:e,"binObj"),DY=o((i,e)=>{let t=PY(i.name,i.bin),r=e.replace(/^[^\\/]*\//,"");for(let s of Object.entries(t))if(s[1]===r)return!0;return!1},"hasBin");gD.exports=(i,e)=>i&&i.bin?DY(i,e):!1});var XE=d((Mge,yD)=>{var xY=o(i=>{let e=i;for(;e.endsWith("/");)e=e.slice(0,-1);return e},"removeTrailingSlashes");yD.exports=xY});var ED=d((kge,SD)=>{"use strict";var Mr=require("fs"),QE=require("path"),LY=require("events").EventEmitter,MY=Mi().Minimatch,jc=class i extends LY{static{o(this,"Walker")}constructor(e){e=e||{},super(e),this.isSymbolicLink=e.isSymbolicLink,this.path=e.path||process.cwd(),this.basename=QE.basename(this.path),this.ignoreFiles=e.ignoreFiles||[".ignore"],this.ignoreRules={},this.parent=e.parent||null,this.includeEmpty=!!e.includeEmpty,this.root=this.parent?this.parent.root:this.path,this.follow=!!e.follow,this.result=this.parent?this.parent.result:new Set,this.entries=null,this.sawError=!1,this.exact=e.exact}sort(e,t){return e.localeCompare(t,"en")}emit(e,t){let r=!1;return this.sawError&&e==="error"||(e==="error"?this.sawError=!0:e==="done"&&!this.parent&&(t=Array.from(t).map(s=>/^@/.test(s)?`./${s}`:s).sort(this.sort),this.result=t),e==="error"&&this.parent?r=this.parent.emit("error",t):r=super.emit(e,t)),r}start(){return Mr.readdir(this.path,(e,t)=>e?this.emit("error",e):this.onReaddir(t)),this}isIgnoreFile(e){return e!=="."&&e!==".."&&this.ignoreFiles.indexOf(e)!==-1}onReaddir(e){this.entries=e,e.length===0?(this.includeEmpty&&this.result.add(this.path.slice(this.root.length+1)),this.emit("done",this.result)):this.entries.some(r=>this.isIgnoreFile(r))?this.addIgnoreFiles():this.filterEntries()}addIgnoreFiles(){let e=this.entries.filter(s=>this.isIgnoreFile(s)),t=e.length,r=o(()=>{--t===0&&this.filterEntries()},"then");e.forEach(s=>this.addIgnoreFile(s,r))}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);Mr.readFile(r,"utf8",(s,n)=>s?this.emit("error",s):this.onReadIgnoreFile(e,n,t))}onReadIgnoreFile(e,t,r){let s={matchBase:!0,dot:!0,flipNegate:!0,nocase:!0},n=t.split(/\r?\n/).filter(a=>!/^#|^$/.test(a.trim())).map(a=>new MY(a.trim(),s));this.ignoreRules[e]=n,r()}filterEntries(){let e=this.entries.map(r=>{let s=this.filterEntry(r),n=this.filterEntry(r,!0);return s||n?[r,s,n]:!1}).filter(r=>r),t=e.length;if(t===0)this.emit("done",this.result);else{let r=o(()=>{--t===0&&this.emit("done",this.result)},"then");e.forEach(s=>{let n=s[0],a=s[1],c=s[2];this.stat({entry:n,file:a,dir:c},r)})}}onstat({st:e,entry:t,file:r,dir:s,isSymbolicLink:n},a){let c=this.path+"/"+t;e.isDirectory()?s?this.walker(t,{isSymbolicLink:n,exact:r||this.filterEntry(t+"/")},a):a():(r&&this.result.add(c.slice(this.root.length+1)),a())}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e;Mr.lstat(n,(a,c)=>{if(a)this.emit("error",a);else{let u=c.isSymbolicLink();this.follow&&u?Mr.stat(n,(l,h)=>{l?this.emit("error",l):this.onstat({st:h,entry:e,file:t,dir:r,isSymbolicLink:u},s)}):this.onstat({st:c,entry:e,file:t,dir:r,isSymbolicLink:u},s)}})}walkerOpt(e,t){return{path:this.path+"/"+e,parent:this,ignoreFiles:this.ignoreFiles,follow:this.follow,includeEmpty:this.includeEmpty,...t}}walker(e,t,r){new i(this.walkerOpt(e,t)).on("done",r).start()}filterEntry(e,t,r){let s=!0;if(this.parent&&this.parent.filterEntry){let n=this.basename+"/"+e,a=r||e;if(s=this.parent.filterEntry(n,t,a),!s&&!this.exact)return!1}return this.ignoreFiles.forEach(n=>{this.ignoreRules[n]&&this.ignoreRules[n].forEach(a=>{if(a.negate!==s){let c=r&&a.globParts.some(l=>l.length<=(l.slice(-1)[0]?1:2));(a.match("/"+e)||a.match(e)||!!t&&(a.match("/"+e+"/")||a.match(e+"/")||a.negate&&(a.match("/"+e,!0)||a.match(e,!0))||c&&(a.match("/"+r+"/")||a.match(r+"/")||a.negate&&(a.match("/"+r,!0)||a.match(r,!0)))))&&(s=a.negate)}})}),s}},Mf=class i extends jc{static{o(this,"WalkerSync")}start(){return this.onReaddir(Mr.readdirSync(this.path)),this}addIgnoreFile(e,t){let r=QE.resolve(this.path,e);this.onReadIgnoreFile(e,Mr.readFileSync(r,"utf8"),t)}stat({entry:e,file:t,dir:r},s){let n=this.path+"/"+e,a=Mr.lstatSync(n),c=a.isSymbolicLink();this.follow&&c&&(a=Mr.statSync(n)),this.onstat({st:a,entry:e,file:t,dir:r,isSymbolicLink:c},s)}walker(e,t,r){new i(this.walkerOpt(e,t)).start(),r()}},Bf=o((i,e)=>{let t=new Promise((r,s)=>{new jc(i).on("done",r).on("error",s).start()});return e?t.then(r=>e(null,r),e):t},"walk"),BY=o(i=>new Mf(i).start().result,"walkSync");SD.exports=Bf;Bf.sync=BY;Bf.Walker=jc;Bf.WalkerSync=Mf});var RD=d((Uge,vD)=>{"use strict";var{Walker:kY}=ED(),{lstatSync:FY,readFileSync:UY}=require("fs"),{basename:wD,dirname:jY,extname:_D,join:ho,relative:lo,resolve:$Y,sep:qY}=require("path"),{log:VY}=St(),$c=Symbol("npm-packlist.rules.default"),uo=Symbol("npm-packlist.rules.strict"),zY=o(i=>/\*/.test(i),"nameIsBadForWindows"),HY=[".npmignore",".gitignore","**/.git","**/.svn","**/.hg","**/CVS","**/.git/**","**/.svn/**","**/.hg/**","**/CVS/**","/.lock-wscript","/.wafpickle-*","/build/config.gypi","npm-debug.log","**/.npmrc",".*.swp",".DS_Store","**/.DS_Store/**","._*","**/._*/**","*.orig","/archived-packages/**"],bD=["/.git"],kf=o(i=>i.split("\\").join("/"),"normalizePath"),ID=o((i,e,t=[])=>{for(let a of[".npmignore",".gitignore"])try{let c=UY(ho(i,a),{encoding:"utf8"});t.push(c);break}catch(c){if(c.code!=="ENOENT")throw c}if(!e)return t;let r=e.split(qY,1)[0],s=ho(i,r),n=lo(s,ho(i,e));return ID(s,n,t)},"readOutOfTreeIgnoreFiles"),Ff=class i extends kY{static{o(this,"PackWalker")}constructor(e,t){let r={...t,includeEmpty:!1,follow:!1,path:$Y(t?.path||e.path).replace(/\\/g,"/"),ignoreFiles:t?.ignoreFiles||[$c,"package.json",".npmignore",".gitignore",uo]};super(r),this.isPackage=r.isPackage,this.seen=r.seen||new Set,this.tree=e,this.requiredFiles=r.requiredFiles||[];let s=[];if(r.prefix&&r.workspaces){let n=kf(r.path),a=kf(r.prefix),c=r.workspaces.map(u=>kf(u));if(n!==a&&c.includes(n)){let u=lo(r.prefix,jY(r.path));s.push(...ID(r.prefix,u))}else n===a&&s.push(...c.map(u=>kf(lo(r.path,u))))}this.injectRules($c,[...HY,...s]),this.isPackage||this.injectRules(uo,[...bD,...this.requiredFiles.map(n=>`!${n}`)])}addIgnoreFile(e,t){return e!=="package.json"||!this.isPackage?super.addIgnoreFile(e,t):this.processPackage(t)}emit(e,t){return e!=="done"||!this.isPackage?super.emit(e,t):(this.gatherBundles().then(()=>{super.emit("done",this.result)}),!0)}filterEntries(){return this.ignoreRules["package.json"]?(this.ignoreRules[".npmignore"]=null,this.ignoreRules[".gitignore"]=null):this.ignoreRules[".npmignore"]?this.ignoreRules[".gitignore"]=null:this.ignoreRules[".gitignore"]&&!this.ignoreRules[".npmignore"]&&VY.warn("gitignore-fallback","No .npmignore file found, using .gitignore for file exclusion. Consider creating a .npmignore file to explicitly control published files."),super.filterEntries()}onstat(e,t){return!e.st.isFile()&&!e.st.isDirectory()?t():super.onstat(e,t)}stat(e,t){return zY(e.entry)?t():super.stat(e,t)}walkerOpt(e,t){let r=null;if(this.tree.workspaces){let s=[...this.tree.workspaces.values()].map(a=>a.replace(/\\/g,"/")),n=ho(this.path,e).replace(/\\/g,"/");s.includes(n)&&(r=[$c,"package.json",".npmignore",".gitignore",uo])}else r=[$c,".npmignore",".gitignore",uo];return{...super.walkerOpt(e,t),ignoreFiles:r,requiredFiles:this.requiredFiles.map(s=>lo(s,e)===".."?lo(e,s).replace(/\\/g,"/"):!1).filter(Boolean)}}walker(e,t,r){new i(this.tree,this.walkerOpt(e,t)).on("done",r).start()}sort(e,t){let r=_D(e).toLowerCase(),s=_D(t).toLowerCase(),n=wD(e).toLowerCase(),a=wD(t).toLowerCase();return r.localeCompare(s,"en")||n.localeCompare(a,"en")||e.localeCompare(t,"en")}injectRules(e,t,r=()=>{}){this.onReadIgnoreFile(e,`${t.join(`
|
|
31
32
|
`)}
|
|
32
|
-
`,r)}processPackage(e){let{bin:t,browser:r,files:s,main:n}=this.tree.package,a=[],c=[...
|
|
33
|
+
`,r)}processPackage(e){let{bin:t,browser:r,files:s,main:n}=this.tree.package,a=[],c=[...bD,"!/package.json","!/readme{,.*[^~$]}","!/copying{,.*[^~$]}","!/license{,.*[^~$]}","!/licence{,.*[^~$]}","/.git","/node_modules",".npmrc","/package-lock.json","/yarn.lock","/pnpm-lock.yaml","/bun.lockb"];if(s){for(let u of s){u.startsWith("./")&&(u=u.slice(1)),u.endsWith("/*")&&(u+="*");let l=`!${u}`;try{let h=FY(ho(this.path,u.replace(/^!+/,"")).replace(/\\/g,"/"));h.isFile()?(c.unshift(l),this.requiredFiles.push(u.startsWith("/")?u.slice(1):u)):h.isDirectory()&&(a.push(l),a.push(`${l}/**`))}catch{a.push(l)}}this.injectRules("package.json",["*",...a])}if(r&&c.push(`!/${r}`),n&&c.push(`!/${n}`),t)for(let u in t)c.push(`!/${t[u]}`);this.injectRules(uo,c,e)}async gatherBundles(){if(this.seen.has(this.tree))return;this.seen.add(this.tree);let e;if(this.tree.isProjectRoot){let{bundleDependencies:t}=this.tree.package;e=t||[]}else{let{dependencies:t,optionalDependencies:r}=this.tree.package;e=Object.keys(t||{}).concat(Object.keys(r||{}))}for(let t of e){let r=this.tree.edgesOut.get(t);if(!r||r.peer||r.dev)continue;let s=this.tree.edgesOut.get(t).to;if(!s)continue;let n=s.path,a=s.target,c={path:n,isPackage:!0,ignoreFiles:[],seen:this.seen};s.isLink&&c.ignoreFiles.push($c),c.ignoreFiles.push("package.json"),s.isLink&&(c.ignoreFiles.push(".npmignore"),c.ignoreFiles.push(".gitignore")),c.ignoreFiles.push(uo);let u=new i(a,c),l=await new Promise((f,p)=>{u.on("error",p),u.on("done",f),u.start()}),h=lo(this.root,u.path);for(let f of l)this.result.add(ho(h,f).replace(/\\/g,"/"))}}},OD=o((i,e,t)=>{typeof e=="function"&&(t=e,e={});let r=new Promise((s,n)=>{new Ff(i,{...e,isPackage:!0}).on("done",s).on("error",n).start()});return t?r.then(s=>t(null,s),t):r},"walk");vD.exports=OD;OD.Walker=Ff});var CD=d(($ge,TD)=>{var{resolve:AD,dirname:GY,delimiter:ew}=require("path"),WY=AD(__dirname,"../lib/node-gyp-bin"),JY=o((i,e,t)=>{let r=Object.keys(t).filter(u=>/^path$/i.test(u)&&t[u]).map(u=>t[u].split(ew)).reduce((u,l)=>u.concat(l.filter(h=>!u.includes(h))),[]).join(ew),s=[];e&&s.push(...e);let n=i,a;do s.push(AD(n,"node_modules",".bin")),a=n,n=GY(n);while(n!==a);s.push(WY,r);let c=s.join(ew);for(let u of Object.keys(t))/^path$/i.test(u)&&(t[u]=c);return t},"setPATH");TD.exports=JY});var PD=d((Vge,ND)=>{var KY=CD(),{resolve:ZY}=require("path"),Uf,YY=o(i=>{let{args:e,binPaths:t,cmd:r,env:s,event:n,nodeGyp:a,path:c,scriptShell:u=!0,stdio:l,stdioString:h}=i;a?Uf=a:s.npm_config_node_gyp?Uf=s.npm_config_node_gyp:Uf=require.resolve("node-gyp/bin/node-gyp.js");let p={env:KY(c,t,{...process.env,...s,npm_package_json:ZY(c,"package.json"),npm_lifecycle_event:n,npm_lifecycle_script:r,npm_config_node_gyp:Uf}),stdioString:h,stdio:l,cwd:c,shell:u};return[r,e,p]},"makeSpawnArgs");ND.exports=YY});var xD=d((Hge,DD)=>{var tw=o((i,e,t={})=>{for(let[r,s]of Object.entries(i))s!==void 0&&(s===null||s===!1?t[`${e}${r}`]="":Array.isArray(s)?s.forEach((n,a)=>{tw({[`${r}_${a}`]:n},`${e}`,t)}):typeof s=="object"?tw(s,`${e}${r}_`,t):t[`${e}${r}`]=String(s));return t},"packageEnvs");DD.exports=i=>tw({name:i.name,version:i.version,config:i.config,engines:i.engines,bin:i.bin},"npm_package_")});var BD=d((Wge,MD)=>{var XY=require("util"),LD=require("fs"),{stat:QY}=LD.promises||{stat:XY.promisify(LD.stat)};async function eX(i){return await QY(`${i}/binding.gyp`).then(e=>e.isFile()).catch(()=>!1)}o(eX,"isNodeGypPackage");MD.exports={isNodeGypPackage:eX,defaultGypInstallScript:"node-gyp rebuild"}});var FD=d((Kge,kD)=>{var jf=new Set,iw=!1,rw=["SIGINT","SIGTERM"],sw=o(i=>{for(let e of jf)e.kill(i)},"handleSignal"),tX=o(()=>{for(let i of rw)process.on(i,sw);iw=!0},"setupListeners"),iX=o(()=>{if(jf.size===0){for(let i of rw)process.removeListener(i,sw);iw=!1}},"cleanupListeners"),rX=o(i=>{jf.add(i),iw||tX(),i.once("exit",()=>{jf.delete(i),iX()})},"add");kD.exports={add:rX,handleSignal:sw,forwardedSignals:rw}});var nw=d((Yge,UD)=>{var{stat:sX}=require("node:fs/promises"),{resolve:nX}=require("node:path");UD.exports=async i=>{try{return(await sX(nX(i,"server.js"))).isFile()}catch{return!1}}});var $D=d((Xge,jD)=>{var oX=PD(),aX=Dl(),cX=xD(),{isNodeGypPackage:uX,defaultGypInstallScript:lX}=BD(),hX=FD(),fX=nw(),dX=o(async i=>{let{args:e=[],binPaths:t=!1,env:r={},event:s,nodeGyp:n,path:a,pkg:c,scriptShell:u,signalTimeout:l=500,stdio:h="pipe",stdioString:f}=i,{scripts:p={},gypfile:m}=c,y=null;if(i.cmd?y=i.cmd:c.scripts&&c.scripts[s]?y=c.scripts[s]:s==="install"&&!p.install&&!p.preinstall&&m!==!1&&await uX(a)?y=lX:s==="start"&&await fX(a)&&(y="node server.js"),!y)return{code:0,signal:null};let g=o(()=>{},"inputEnd");if(h==="inherit"){let w;c._id?w=`
|
|
33
34
|
> ${c._id} ${s}
|
|
34
35
|
`:w=`
|
|
35
36
|
> ${s}
|
|
36
37
|
`,w+=`> ${y.trim().replace(/\n/g,`
|
|
37
38
|
> `)}`,e.length&&(w+=` ${e.join(" ")}`),w+=`
|
|
38
|
-
`;let{output:I,input:v}=_t();I.standard(w),g=v.start()}let[S,E,_]=NX({args:e,binPaths:t,cmd:y,env:{...r,...DX(c)},event:s,nodeGyp:n,path:a,scriptShell:u,stdio:h,stdioString:f}),b=PX(S,E,_,{event:s,script:y,pkgid:c._id,path:a});return h==="inherit"&&MX.add(b.process),b.stdin&&b.stdin.end(),b.catch(w=>{let{signal:I}=w;if(h==="inherit"&&I)return process.kill(process.pid,I),new Promise((v,N)=>setTimeout(()=>N(w),l));throw w}).finally(g)},"runScriptPkg");ix.exports=kX});var nx=d((Gye,sx)=>{var FX=o(i=>{if(typeof i!="object"||!i)throw new TypeError("invalid options object provided to runScript");let{event:e,path:t,scriptShell:r,env:s={},stdio:n="pipe",args:a=[],cmd:c}=i;if(!e||typeof e!="string")throw new TypeError("valid event not provided to runScript");if(!t||typeof t!="string")throw new TypeError("valid path not provided to runScript");if(r!==void 0&&typeof r!="string")throw new TypeError("invalid scriptShell option provided to runScript");if(typeof s!="object"||!s)throw new TypeError("invalid env option provided to runScript");if(typeof n!="string"&&!Array.isArray(n))throw new TypeError("invalid stdio option provided to runScript");if(!Array.isArray(a)||a.some(u=>typeof u!="string"))throw new TypeError("invalid args option provided to runScript");if(c!==void 0&&typeof c!="string")throw new TypeError("invalid cmd option provided to runScript")},"validateOptions");sx.exports=FX});var cx=d((Jye,ax)=>{var UX=nh(),ox=rx(),jX=nx(),$X=yw(),qX=o(async i=>{if(jX(i),i.pkg)return ox(i);let{content:e}=await UX.normalize(i.path);return ox({...i,pkg:e})},"runScript");ax.exports=Object.assign(qX,{isServerPackage:$X})});var Eo=d((Zye,ux)=>{var{resolve:VX}=require("node:path"),{stat:zX,chmod:HX}=require("node:fs/promises"),GX=bc(),WX=jn(),JX=Fs(),Sw=ks(),Ew=class extends JX{static{o(this,"FileFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec}get types(){return["file"]}manifest(){return this.package?Promise.resolve(this.package):GX.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[Sw.readPackageJson](e)).then(t=>this.package={...t,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from}))}#e(e,t){return e.bin?Promise.all(Object.keys(e.bin).map(async r=>{let s=VX(t,e.bin[r]);try{let n=await zX(s),a=n.mode|73;if(a===n.mode)return;await HX(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[Sw.readPackageJson](e).then(r=>this.#e(r,e)).then(()=>t))}[Sw.tarballFromResolved](){return new WX.ReadStream(this.resolved)}packument(){return this.manifest().then(e=>({name:e.name,"dist-tags":{[this.defaultTag]:e.version},versions:{[e.version]:{...e,dist:{tarball:`file:${this.resolved}`,integrity:this.integrity&&String(this.integrity)}}}}))}};ux.exports=Ew});var hx=d((Xye,lx)=>{var KX=uw(),ZX=o(i=>({cwd:i._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(KX(i,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");lx.exports=ZX});var Kf=d((eSe,px)=>{var{resolve:YX}=require("node:path"),XX=qD(),QX=cx(),e9=aw(),{Minipass:t9}=te(),i9=Fs(),r9=Eo(),fx=ks(),dx=hx(),ww=class extends i9{static{o(this,"DirFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec,this.tree=t.tree||null,this.Arborist=t.Arborist||null}static tarCreateOptions(e){return dx(e)}get types(){return["directory"]}#e(){return this.manifest().then(e=>{if(!e.scripts||!e.scripts.prepare||this.opts.ignoreScripts)return;let t=this.opts.foregroundScripts?"inherit":"pipe";return QX({scriptShell:this.opts.scriptShell||void 0,pkg:e,event:"prepare",path:this.resolved,stdio:t,env:{npm_package_resolved:this.resolved,npm_package_integrity:this.integrity,npm_package_json:YX(this.resolved,"package.json")}})})}[fx.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new t9;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:r}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return XX(this.tree,{path:this.resolved,prefix:t,workspaces:r})}).then(s=>e9.c(dx(this.package),s).on("error",n=>e.emit("error",n)).pipe(e)).catch(s=>e.emit("error",s)),e}manifest(){return this.package?Promise.resolve(this.package):this[fx.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return r9.prototype.packument.apply(this)}};px.exports=ww});var vw=d((iSe,mx)=>{"use strict";var{URL:s9}=require("node:url");function n9(i){try{let t=new s9(i).pathname.slice(1);if(!t.match(/^-/)){t=t.split("/");var e=t.indexOf("_rewrite");return e===-1?e=t.length-1:e++,decodeURIComponent(t[e])}}catch{}}o(n9,"packageName");var Us=class extends Error{static{o(this,"HttpErrorBase")}constructor(e,t,r,s){super(),this.name=this.constructor.name,this.headers=typeof t.headers?.raw=="function"?t.headers.raw():t.headers,this.statusCode=t.status,this.code=`E${t.status}`,this.method=e,this.uri=t.url,this.body=r,this.pkgid=s?s.toString():n9(t.url),Error.captureStackTrace(this,this.constructor)}},_w=class extends Us{static{o(this,"HttpErrorGeneral")}constructor(e,t,r,s){super(e,t,r,s),this.message=`${t.status} ${t.statusText} - ${this.method.toUpperCase()} ${this.spec||this.uri}${r&&r.error?" - "+r.error:""}`}},bw=class extends Us{static{o(this,"HttpErrorAuthOTP")}constructor(e,t,r,s){super(e,t,r,s),this.message="OTP required for authentication",this.code="EOTP"}},Iw=class extends Us{static{o(this,"HttpErrorAuthIPAddress")}constructor(e,t,r,s){super(e,t,r,s),this.message="Login is not allowed from your IP address",this.code="EAUTHIP"}},Ow=class extends Us{static{o(this,"HttpErrorAuthUnknown")}constructor(e,t,r,s){super(e,t,r,s),this.message="Unable to authenticate, need: "+t.headers.get("www-authenticate")}};mx.exports={HttpErrorBase:Us,HttpErrorGeneral:_w,HttpErrorAuthOTP:bw,HttpErrorAuthIPAddress:Iw,HttpErrorAuthUnknown:Ow}});var yx=d((sSe,gx)=>{var o9=hh(),Yc=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},Zf=class extends o9{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let s=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(s)?(this.found+=s.length,this.found>this.expect&&this.emit("error",new Yc(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new Yc(this.found,this.expect)),super.emit(e,...t)}};Zf.SizeError=Yc;gx.exports=Zf});var Ex=d((oSe,Sx)=>{"use strict";var{Minipass:a9}=te(),Cw=Symbol("type"),or=Symbol("buffer"),Yf=class i{static{o(this,"Blob")}constructor(e,t){this[Cw]="";let r=[],s=0;if(e){let a=e,c=Number(a.length);for(let u=0;u<c;u++){let l=a[u],h=l instanceof Buffer?l:ArrayBuffer.isView(l)?Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof ArrayBuffer?Buffer.from(l):l instanceof i?l[or]:typeof l=="string"?Buffer.from(l):Buffer.from(String(l));s+=h.length,r.push(h)}}this[or]=Buffer.concat(r,s);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[Cw]=n)}get size(){return this[or].length}get type(){return this[Cw]}text(){return Promise.resolve(this[or].toString())}arrayBuffer(){let e=this[or],t=e.byteOffset,r=e.byteLength,s=e.buffer.slice(t,t+r);return Promise.resolve(s)}stream(){return new a9().end(this[or])}slice(e,t,r){let s=this.size,n=e===void 0?0:e<0?Math.max(s+e,0):Math.min(e,s),a=t===void 0?s:t<0?Math.max(s+t,0):Math.min(t,s),c=Math.max(a-n,0),l=this[or].slice(n,n+c),h=new i([],{type:r});return h[or]=l,h}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return or}};Object.defineProperties(Yf.prototype,{size:{enumerable:!0},type:{enumerable:!0}});Sx.exports=Yf});var Aw=d((cSe,wx)=>{"use strict";var Rw=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};wx.exports=Rw});var bx=d((lSe,_x)=>{_x.exports={}});var Qf=d((hSe,vx)=>{"use strict";var{Minipass:Oi}=te(),Tw=yx(),Ox=Ex(),{BUFFER:c9}=Ox,Xc=Aw(),Nw;try{Nw=bx().convert}catch{}var ar=Symbol("Body internals"),js=Symbol("consumeBody"),Xf=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:s=0}=t,n=e==null?null:Ix(e)?Buffer.from(e.toString()):Qc(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Oi.isStream(e)?e:Buffer.from(String(e));this[ar]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=s,Oi.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Xc(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[ar].error=c})}get body(){return this[ar].body}get bodyUsed(){return this[ar].disturbed}arrayBuffer(){return this[js]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[js]().then(t=>Object.assign(new Ox([],{type:e.toLowerCase()}),{[c9]:t}))}async json(){let e=await this[js]();try{return JSON.parse(e.toString())}catch(t){throw new Xc(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[js]().then(e=>e.toString())}buffer(){return this[js]()}textConverted(){return this[js]().then(e=>u9(e,this.headers))}[js](){if(this[ar].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[ar].disturbed=!0,this[ar].error)return Promise.reject(this[ar].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=Qc(this.body)?this.body.stream():this.body;if(!Oi.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof Tw||!this.size&&e instanceof Oi&&!(e instanceof Tw)?e:this.size?new Tw({size:this.size}):new Oi,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Xc(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(s=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),s()}).then(()=>t.concat()).then(s=>(clearTimeout(r),s)).catch(s=>{throw clearTimeout(r),s.name==="AbortError"||s.name==="FetchError"?s:s.name==="RangeError"?new Xc(`Could not create Buffer from response body for ${this.url}: ${s.message}`,"system",s):new Xc(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(Oi.isStream(t)&&typeof t.getBoundary!="function"){let r=new Oi,s=new Oi,n=new Oi;return r.on("error",a=>{s.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(s),r.pipe(n),t.pipe(r),e[ar].body=s,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":Ix(e)?"application/x-www-form-urlencoded;charset=UTF-8":Qc(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:Oi.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:Qc(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(Qc(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(Xf.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var Ix=o(i=>typeof i!="object"||typeof i.append!="function"||typeof i.delete!="function"||typeof i.get!="function"||typeof i.getAll!="function"||typeof i.has!="function"||typeof i.set!="function"?!1:i.constructor.name==="URLSearchParams"||Object.prototype.toString.call(i)==="[object URLSearchParams]"||typeof i.sort=="function","isURLSearchParams"),Qc=o(i=>typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&typeof i.constructor=="function"&&typeof i.constructor.name=="string"&&/^(Blob|File)$/.test(i.constructor.name)&&/^(Blob|File)$/.test(i[Symbol.toStringTag]),"isBlob"),u9=o((i,e)=>{if(typeof Nw!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",s;t&&(s=/charset=([^;]*)/i.exec(t));let n=i.slice(0,1024).toString();return!s&&n&&(s=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!s&&n&&(s=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),s||(s=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),s&&s.pop()),s&&(s=/charset=(.*)/i.exec(s.pop()))),!s&&n&&(s=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),s&&(r=s.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),Nw(i,"UTF-8",r).toString()},"convertBody");vx.exports=Xf});var td=d((dSe,Ax)=>{"use strict";var Rx=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,Dw=/[^\t\x20-\x7e\x80-\xff]/,eu=o(i=>{if(i=`${i}`,Rx.test(i)||i==="")throw new TypeError(`${i} is not a legal HTTP header name`)},"validateName"),Cx=o(i=>{if(i=`${i}`,Dw.test(i))throw new TypeError(`${i} is not a legal HTTP header value`)},"validateValue"),wo=o((i,e)=>{e=e.toLowerCase();for(let t in i)if(t.toLowerCase()===e)return t},"find"),me=Symbol("map"),ed=class i{static{o(this,"Headers")}constructor(e=void 0){if(this[me]=Object.create(null),e instanceof i){let t=e.raw(),r=Object.keys(t);for(let s of r)for(let n of t[s])this.append(s,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let s of e){if(typeof s!="object"||typeof s[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(s);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let s of r)this.append(s[0],s[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,eu(e);let t=wo(this[me],e);return t===void 0?null:this[me][t].join(", ")}forEach(e,t=void 0){let r=xw(this);for(let s=0;s<r.length;s++){let[n,a]=r[s];e.call(t,a,n,this),r=xw(this)}}set(e,t){e=`${e}`,t=`${t}`,eu(e),Cx(t);let r=wo(this[me],e);this[me][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,eu(e),Cx(t);let r=wo(this[me],e);r!==void 0?this[me][r].push(t):this[me][e]=[t]}has(e){return e=`${e}`,eu(e),wo(this[me],e)!==void 0}delete(e){e=`${e}`,eu(e);let t=wo(this[me],e);t!==void 0&&delete this[me][t]}raw(){return this[me]}keys(){return new $s(this,"key")}values(){return new $s(this,"value")}[Symbol.iterator](){return new $s(this,"key+value")}entries(){return new $s(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[me]),r=wo(e[me],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new i;for(let r of Object.keys(e))if(!Rx.test(r))if(Array.isArray(e[r]))for(let s of e[r])Dw.test(s)||(t[me][r]===void 0?t[me][r]=[s]:t[me][r].push(s));else Dw.test(e[r])||(t[me][r]=[e[r]]);return t}};Object.defineProperties(ed.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var xw=o((i,e="key+value")=>Object.keys(i[me]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>i[me][t].join(", "):t=>[t.toLowerCase(),i[me][t].join(", ")]),"getHeaders"),Pw=Symbol("internal"),$s=class i{static{o(this,"HeadersIterator")}constructor(e,t){this[Pw]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==i.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Pw],s=xw(e,t),n=s.length;return r>=n?{value:void 0,done:!0}:(this[Pw].index++,{value:s[r],done:!1})}};Object.setPrototypeOf($s.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));Ax.exports=ed});var Dx=d((mSe,Px)=>{"use strict";var l9=require("http"),{STATUS_CODES:h9}=l9,Tx=td(),Nx=Qf(),{clone:f9,extractContentType:d9}=Nx,cr=Symbol("Response internals"),id=class i extends Nx{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,s=new Tx(t.headers);if(e!=null&&!s.has("Content-Type")){let n=d9(e);n&&s.append("Content-Type",n)}this[cr]={url:t.url,status:r,statusText:t.statusText||h9[r],headers:s,counter:t.counter,trailer:Promise.resolve(t.trailer||new Tx)}}get trailer(){return this[cr].trailer}get url(){return this[cr].url||""}get status(){return this[cr].status}get ok(){return this[cr].status>=200&&this[cr].status<300}get redirected(){return this[cr].counter>0}get statusText(){return this[cr].statusText}get headers(){return this[cr].headers}clone(){return new i(f9(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};Px.exports=id;Object.defineProperties(id.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var xx=d((ySe,p9)=>{p9.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var Bx=d((SSe,Mx)=>{"use strict";var{URL:Lw}=require("url"),{Minipass:m9}=te(),Mw=td(),{exportNodeCompatibleHeaders:g9}=Mw,Lx=Qf(),{clone:y9,extractContentType:S9,getTotalBytes:E9}=Lx,w9=xx().version,_9=`minipass-fetch/${w9} (+https://github.com/isaacs/minipass-fetch)`,ti=Symbol("Request internals"),rd=o(i=>typeof i=="object"&&typeof i[ti]=="object","isRequest"),b9=o(i=>{let e=i&&typeof i=="object"&&Object.getPrototypeOf(i);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),sd=class i extends Lx{static{o(this,"Request")}constructor(e,t={}){let r=rd(e)?new Lw(e.url):e&&e.href?new Lw(e.href):new Lw(`${e}`);rd(e)?t={...e[ti],...t}:(!e||typeof e=="string")&&(e={});let s=(t.method||e.method||"GET").toUpperCase(),n=s==="GET"||s==="HEAD";if((t.body!==null&&t.body!==void 0||rd(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:rd(e)&&e.body!==null?y9(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Mw(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let ee=S9(a);ee&&c.append("Content-Type",ee)}let u="signal"in t?t.signal:null;if(u!=null&&!b9(u))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:U}=t;this[ti]={method:s,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:u,ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I,secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:U},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[ti].method}get url(){return this[ti].parsedURL.toString()}get headers(){return this[ti].headers}get redirect(){return this[ti].redirect}get signal(){return this[ti].signal}clone(){return new i(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[ti].parsedURL,r=new Mw(e[ti].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&m9.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let s=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?E9(e):null;s&&r.set("Content-Length",s+""),r.has("User-Agent")||r.set("User-Agent",_9),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v}=e[ti];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:g9(r),agent:n,ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v,timeout:e.timeout}}};Mx.exports=sd;Object.defineProperties(sd.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var Fx=d((wSe,kx)=>{"use strict";var Bw=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};kx.exports=Bw});var bo=d((bSe,$x)=>{"use strict";var{URL:tu}=require("url"),I9=require("http"),O9=require("https"),_o=Lc(),{Minipass:Ux}=te(),v9=Qf(),{writeToStream:C9,getTotalBytes:R9}=v9,qs=Dx(),Fw=td(),{createHeadersLenient:jx}=Fw,iu=Bx(),{getNodeRequestOptions:A9}=iu,jr=Aw(),kw=Fx(),ur=o(async(i,e)=>{if(/^data:/.test(i)){let t=new iu(i,e);return Promise.resolve().then(()=>new Promise((r,s)=>{let n,a;try{let{pathname:l,search:h}=new tu(i),f=l.split(",");if(f.length<2)throw new Error("invalid data: URI");let p=f.shift(),m=/;base64$/.test(p);n=m?p.slice(0,-7):p;let y=decodeURIComponent(f.join(",")+h);a=m?Buffer.from(y,"base64"):Buffer.from(y)}catch(l){return s(new jr(`[${t.method}] ${t.url} invalid URL, ${l.message}`,"system",l))}let{signal:c}=t;if(c&&c.aborted)return s(new kw("The user aborted a request."));let u={"Content-Length":a.length};return n&&(u["Content-Type"]=n),r(new qs(a,{headers:u}))}))}return new Promise((t,r)=>{let s=new iu(i,e),n;try{n=A9(s)}catch(y){return r(y)}let a=(n.protocol==="https:"?O9:I9).request,{signal:c}=s,u=null,l=o(()=>{let y=new kw("The user aborted a request.");r(y),Ux.isStream(s.body)&&typeof s.body.destroy=="function"&&s.body.destroy(y),u&&u.body&&u.body.emit("error",y)},"abort");if(c&&c.aborted)return l();let h=o(()=>{l(),f()},"abortAndFinalize"),f=o(()=>{p.abort(),c&&c.removeEventListener("abort",h),clearTimeout(m)},"finalize"),p=a(n);c&&c.addEventListener("abort",h);let m=null;s.timeout&&p.once("socket",()=>{m=setTimeout(()=>{r(new jr(`network timeout at: ${s.url}`,"request-timeout")),f()},s.timeout)}),p.on("error",y=>{p.res&&p.res.emit("error",y),r(new jr(`request to ${s.url} failed, reason: ${y.message}`,"system",y)),f()}),p.on("response",y=>{clearTimeout(m);let g=jx(y.headers);if(ur.isRedirect(y.statusCode)){let I=g.get("Location"),v=null;try{v=I===null?null:new tu(I,s.url).toString()}catch{if(s.redirect!=="manual"){r(new jr(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(s.redirect==="error"){r(new jr(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),f();return}else if(s.redirect==="manual"){if(v!==null)try{g.set("Location",v)}catch(N){r(N)}}else if(s.redirect==="follow"&&v!==null){if(s.counter>=s.follow){r(new jr(`maximum redirect reached at: ${s.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&s.body&&R9(s)===null){r(new jr("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}s.headers.set("host",new tu(v).host);let N={headers:new Fw(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout},P=new tu(s.url),U=new tu(v);P.hostname!==U.hostname&&(N.headers.delete("authorization"),N.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&s.method==="POST")&&(N.method="GET",N.body=void 0,N.headers.delete("content-length")),t(ur(new iu(v,N))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",h));let S=new Ux;S.on("error",f),y.on("error",I=>S.emit("error",I)),y.on("data",I=>S.write(I)),y.on("end",()=>S.end());let E={url:s.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:s.size,timeout:s.timeout,counter:s.counter,trailer:new Promise(I=>y.on("end",()=>I(jx(y.trailers))))},_=g.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||_===null||y.statusCode===204||y.statusCode===304){u=new qs(S,E),t(u);return}let b={flush:_o.constants.Z_SYNC_FLUSH,finishFlush:_o.constants.Z_SYNC_FLUSH};if(_==="gzip"||_==="x-gzip"){let I=new _o.Gunzip(b);u=new qs(S.on("error",v=>I.emit("error",v)).pipe(I),E),t(u);return}if(_==="deflate"||_==="x-deflate"){y.once("data",I=>{let v=(I[0]&15)===8?new _o.Inflate:new _o.InflateRaw;S.on("error",N=>v.emit("error",N)).pipe(v),u=new qs(v,E),t(u)});return}if(_==="br"){try{var w=new _o.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>w.emit("error",I)).pipe(w),u=new qs(w,E),t(u);return}u=new qs(S,E),t(u)}),C9(p,s)})},"fetch");$x.exports=ur;ur.isRedirect=i=>i===301||i===302||i===303||i===307||i===308;ur.Headers=Fw;ur.Request=iu;ur.Response=qs;ur.FetchError=jr;ur.AbortError=kw});var qx=d((OSe,T9)=>{T9.exports={name:"npm-registry-fetch",version:"19.0.0",description:"Fetch-based http client for use with npm registry APIs",main:"lib",files:["bin/","lib/"],scripts:{eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",test:"tap",posttest:"npm run lint",npmclilint:"npmcli-lint",postsnap:"npm run lintfix --",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/npm-registry-fetch.git"},keywords:["npm","registry","fetch"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/redact":"^3.0.0",jsonparse:"^1.3.1","make-fetch-happen":"^15.0.0",minipass:"^7.0.2","minipass-fetch":"^4.0.0",minizlib:"^3.0.1","npm-package-arg":"^13.0.0","proc-log":"^5.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",cacache:"^20.0.0",nock:"^13.2.4","require-inject":"^1.4.4",ssri:"^12.0.0",tap:"^16.0.1"},tap:{"check-coverage":!0,"test-ignore":"test[\\\\/](util|cache)[\\\\/]","nyc-arg":["--exclude","tap-snapshots/**"]},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Uw=d((vSe,zx)=>{var Vx=qx();zx.exports={maxSockets:12,method:"GET",registry:"https://registry.npmjs.org/",timeout:300*1e3,strictSSL:!0,noProxy:process.env.NOPROXY,userAgent:`${Vx.name}@${Vx.version}/node@${process.version}+${process.arch} (${process.platform})`}});var jw=d((CSe,Hx)=>{var Io="regex",Oo="path",N9={type:Io,pattern:/\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,replacement:"[REDACTED_NPM_SECRET]"},P9={type:Io,pattern:/\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,replacement:"[REDACTED_AUTH_HEADER]"},D9={type:Io,pattern:/\b[A-Za-z0-9-_]{10,}(?!\.\d+\.)\.[A-Za-z0-9-_]{3,}\.[A-Za-z0-9-_]{20,}\b/gi,replacement:"[REDACTED_JSON_WEB_TOKEN]"},x9={type:Io,pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,replacement:"[REDACTED_UUID]"},L9={type:Io,pattern:/(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,replacement:"[REDACTED_URL]"},M9={type:Oo,predicate:o(({path:i})=>i.endsWith(".headers.authorization"),"predicate"),replacement:"[REDACTED_HEADER_AUTHORIZATION]"},B9={type:Oo,predicate:o(({path:i})=>i.endsWith(".headers.set-cookie"),"predicate"),replacement:"[REDACTED_HEADER_SET_COOKIE]"},k9={type:Oo,predicate:o(({path:i})=>i.endsWith(".headers.cookie"),"predicate"),replacement:"[REDACTED_HEADER_COOKIE]"},F9={type:Oo,predicate:o(({path:i})=>i.endsWith(".request"),"predicate"),replacement:o(i=>({method:i?.method,path:i?.path,headers:i?.headers,url:i?.url}),"replacement")},U9={type:Oo,predicate:o(({path:i})=>i.endsWith(".response"),"predicate"),replacement:o(i=>({data:i?.data,status:i?.status,headers:i?.headers}),"replacement")};Hx.exports={TYPE_REGEX:Io,TYPE_URL:"url",TYPE_PATH:Oo,NPM_SECRET:N9,AUTH_HEADER:P9,JSON_WEB_TOKEN:D9,UUID:x9,URL_MATCHER:L9,DEEP_HEADER_AUTHORIZATION:M9,DEEP_HEADER_SET_COOKIE:B9,DEEP_HEADER_COOKIE:k9,REWRITE_REQUEST:F9,REWRITE_RESPONSE:U9}});var Yx=d((ASe,Zx)=>{var{URL_MATCHER:j9,TYPE_URL:nd,TYPE_REGEX:$9,TYPE_PATH:q9}=jw(),$r=o((i=0)=>(i=typeof i=="string"?i.length:i,i<8?"*".repeat(8):"*".repeat(i)),"asterisk"),Gx=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"escapeRegExp"),Wx=o(i=>{let e=decodeURIComponent(i),t=encodeURIComponent(i);return[...new Set([t,e,i])].map(Gx).join("|")},"urlEncodeRegexGroup"),od=o((i,...e)=>{let t="";for(let r=0;r<e.length;r++)t+=i[r]+`(${Wx(e[r])})`;return t+=i[i.length-1],new RegExp(t)},"urlEncodeRegexTag"),V9=o(({hostname:i,replacement:e}={})=>({type:nd,predicate:o(({url:t})=>t.hostname===i,"predicate"),pattern:o(({url:t})=>od`(^${t.protocol}//${t.username}:.+@)?${t.hostname}`,"pattern"),replacement:`$1${e||$r()}`}),"redactUrlHostnameMatcher"),z9=o(({param:i,replacement:e}={})=>({type:nd,predicate:o(({url:t})=>t.searchParams.has(i),"predicate"),pattern:o(({url:t})=>od`(${i}=)${t.searchParams.get(i)}`,"pattern"),replacement:`$1${e||$r()}`}),"redactUrlSearchParamsMatcher"),Jx=o(({replacement:i}={})=>({type:nd,predicate:o(({url:e})=>e.password,"predicate"),pattern:o(({url:e})=>od`(^${e.protocol}//${e.username}:)${e.password}`,"pattern"),replacement:`$1${i||$r()}`}),"redactUrlPasswordMatcher"),Kx=o((...i)=>e=>{try{let t=new URL(e);return $w(...i)(e,{url:t})}catch{return e}},"redactUrlReplacement"),H9=o((...i)=>({...j9,replacement:Kx(...i)}),"redactUrlMatcher"),G9={[$9]:i=>e=>(typeof e=="string"&&(e=e.replace(i.pattern,i.replacement)),e),[nd]:i=>(e,t)=>{if(typeof e=="string")try{let r=t?.url||new URL(e),{predicate:s,pattern:n}=i;s({url:r})&&(e=e.replace(n({url:r}),i.replacement))}catch{return e}return e},[q9]:i=>(e,t)=>{let r=t?.path,s=r.join(".").toLowerCase(),{predicate:n,replacement:a}=i,c=typeof a=="function"?a:()=>a;return n({rawPath:r,path:s})&&(e=c(e,{rawPath:r,path:s})),e}},W9=o(i=>G9[i.type](i),"redactMatcher"),$w=o((...i)=>(e,t)=>i.flat().reduce((s,n)=>(typeof n=="function"?n:W9(n))(s,t),e),"redactMatchers"),J9=o(()=>(i,e)=>typeof e=="number"?$r(i):e+$r(i.substring(e.length).length),"redactDynamicReplacement"),K9=o(i=>(e,t)=>typeof t=="number"?$r(i):t+$r(i),"redactFixedReplacement"),Z9=o((i,e)=>$w(Jx({replacement:e}))(i),"redactUrlPassword");Zx.exports={asterisk:$r,escapeRegExp:Gx,urlEncodeRegexGroup:Wx,urlEncodeRegexTag:od,redactUrlHostnameMatcher:V9,redactUrlSearchParamsMatcher:z9,redactUrlPasswordMatcher:Jx,redactUrlMatcher:H9,redactUrlReplacement:Kx,redactDynamicReplacement:J9,redactFixedReplacement:K9,redactMatchers:$w,redactUrlPassword:Z9}});var tL=d((NSe,eL)=>{var Xx=jw(),{redactUrlPassword:Y9}=Yx(),qw="***",Vw=o(i=>typeof i!="string"||!i?i:Y9(i,qw).replace(Xx.NPM_SECRET.pattern,`npm_${qw}`).replace(Xx.UUID.pattern,qw),"redact"),Qx=o(i=>{let e=/[\s=]/g,t=null,r="",s=0;for(;t=e.exec(i);)r+=Vw(i.slice(s,t.index))+t[0],s=e.lastIndex;return r+Vw(i.slice(s))},"splitAndRedact"),X9=o(i=>typeof i=="string"?Qx(i):Array.isArray(i)?i.map(e=>typeof e=="string"?Qx(e):e):i,"redactLog");eL.exports={redact:Vw,redactLog:X9}});var sL=d((DSe,rL)=>{"use strict";var ru=vw(),{Response:Q9}=bo(),e8=Uw(),{log:ad}=_t(),{redact:t8}=tL(),i8="https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry",r8=o(async({method:i,uri:e,res:t,startTime:r,auth:s,opts:n})=>(n={...e8,...n},t.headers.has("npm-notice")&&!t.headers.has("x-local-cache")&&ad.notice("",t.headers.get("npm-notice")),t.status>=400?(iL(i,t,r),s&&s.scopeAuthKey&&!s.token&&!s.auth&&ad.warn("registry",`No auth for URI, but auth present for scoped registry.
|
|
39
|
+
`;let{output:I,input:v}=St();I.standard(w),g=v.start()}let[S,E,_]=oX({args:e,binPaths:t,cmd:y,env:{...r,...cX(c)},event:s,nodeGyp:n,path:a,scriptShell:u,stdio:h,stdioString:f}),b=aX(S,E,_,{event:s,script:y,pkgid:c._id,path:a});return h==="inherit"&&hX.add(b.process),b.stdin&&b.stdin.end(),b.catch(w=>{let{signal:I}=w;if(h==="inherit"&&I)return process.kill(process.pid,I),new Promise((v,N)=>setTimeout(()=>N(w),l));throw w}).finally(g)},"runScriptPkg");jD.exports=dX});var VD=d((eye,qD)=>{var pX=o(i=>{if(typeof i!="object"||!i)throw new TypeError("invalid options object provided to runScript");let{event:e,path:t,scriptShell:r,env:s={},stdio:n="pipe",args:a=[],cmd:c}=i;if(!e||typeof e!="string")throw new TypeError("valid event not provided to runScript");if(!t||typeof t!="string")throw new TypeError("valid path not provided to runScript");if(r!==void 0&&typeof r!="string")throw new TypeError("invalid scriptShell option provided to runScript");if(typeof s!="object"||!s)throw new TypeError("invalid env option provided to runScript");if(typeof n!="string"&&!Array.isArray(n))throw new TypeError("invalid stdio option provided to runScript");if(!Array.isArray(a)||a.some(u=>typeof u!="string"))throw new TypeError("invalid args option provided to runScript");if(c!==void 0&&typeof c!="string")throw new TypeError("invalid cmd option provided to runScript")},"validateOptions");qD.exports=pX});var GD=d((iye,HD)=>{var mX=Yl(),zD=$D(),gX=VD(),yX=nw(),SX=o(async i=>{if(gX(i),i.pkg)return zD(i);let{content:e}=await mX.normalize(i.path);return zD({...i,pkg:e})},"runScript");HD.exports=Object.assign(SX,{isServerPackage:yX})});var fo=d((sye,WD)=>{var{resolve:EX}=require("node:path"),{stat:wX,chmod:_X}=require("node:fs/promises"),bX=dc(),IX=Ln(),OX=xs(),ow=Ds(),aw=class extends OX{static{o(this,"FileFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec}get types(){return["file"]}manifest(){return this.package?Promise.resolve(this.package):bX.tmp.withTmp(this.cache,this.opts,e=>this.extract(e).then(()=>this[ow.readPackageJson](e)).then(t=>this.package={...t,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from}))}#e(e,t){return e.bin?Promise.all(Object.keys(e.bin).map(async r=>{let s=EX(t,e.bin[r]);try{let n=await wX(s),a=n.mode|73;if(a===n.mode)return;await _X(s,a)}catch{}})):Promise.resolve()}extract(e){return super.extract(e).then(t=>this.package?t:this[ow.readPackageJson](e).then(r=>this.#e(r,e)).then(()=>t))}[ow.tarballFromResolved](){return new IX.ReadStream(this.resolved)}packument(){return this.manifest().then(e=>({name:e.name,"dist-tags":{[this.defaultTag]:e.version},versions:{[e.version]:{...e,dist:{tarball:`file:${this.resolved}`,integrity:this.integrity&&String(this.integrity)}}}}))}};WD.exports=aw});var KD=d((oye,JD)=>{var vX=YE(),RX=o(i=>({cwd:i._resolved,prefix:"package/",portable:!0,gzip:{level:9},filter:o((e,t)=>(vX(i,e)&&(t.mode|=73),!0),"filter"),mtime:new Date("1985-10-26T08:15:00.000Z")}),"tarCreateOptions");JD.exports=RX});var $f=d((cye,XD)=>{var{resolve:AX}=require("node:path"),TX=RD(),CX=GD(),NX=KE(),{Minipass:PX}=te(),DX=xs(),xX=fo(),ZD=Ds(),YD=KD(),cw=class extends DX{static{o(this,"DirFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec,this.tree=t.tree||null,this.Arborist=t.Arborist||null}static tarCreateOptions(e){return YD(e)}get types(){return["directory"]}#e(){return this.manifest().then(e=>{if(!e.scripts||!e.scripts.prepare||this.opts.ignoreScripts)return;let t=this.opts.foregroundScripts?"inherit":"pipe";return CX({scriptShell:this.opts.scriptShell||void 0,pkg:e,event:"prepare",path:this.resolved,stdio:t,env:{npm_package_resolved:this.resolved,npm_package_integrity:this.integrity,npm_package_json:AX(this.resolved,"package.json")}})})}[ZD.tarballFromResolved](){if(!this.tree&&!this.Arborist)throw new Error("DirFetcher requires either a tree or an Arborist constructor to pack");let e=new PX;e.resolved=this.resolved,e.integrity=this.integrity;let{prefix:t,workspaces:r}=this.opts;return this.#e().then(async()=>{if(!this.tree){let s=new this.Arborist({path:this.resolved});this.tree=await s.loadActual()}return TX(this.tree,{path:this.resolved,prefix:t,workspaces:r})}).then(s=>NX.c(YD(this.package),s).on("error",n=>e.emit("error",n)).pipe(e)).catch(s=>e.emit("error",s)),e}manifest(){return this.package?Promise.resolve(this.package):this[ZD.readPackageJson](this.resolved).then(e=>this.package={...e,_integrity:this.integrity&&String(this.integrity),_resolved:this.resolved,_from:this.from})}packument(){return xX.prototype.packument.apply(this)}};XD.exports=cw});var dw=d((lye,QD)=>{"use strict";var{URL:LX}=require("node:url");function MX(i){try{let t=new LX(i).pathname.slice(1);if(!t.match(/^-/)){t=t.split("/");var e=t.indexOf("_rewrite");return e===-1?e=t.length-1:e++,decodeURIComponent(t[e])}}catch{}}o(MX,"packageName");var Ls=class extends Error{static{o(this,"HttpErrorBase")}constructor(e,t,r,s){super(),this.name=this.constructor.name,this.headers=typeof t.headers?.raw=="function"?t.headers.raw():t.headers,this.statusCode=t.status,this.code=`E${t.status}`,this.method=e,this.uri=t.url,this.body=r,this.pkgid=s?s.toString():MX(t.url),Error.captureStackTrace(this,this.constructor)}},uw=class extends Ls{static{o(this,"HttpErrorGeneral")}constructor(e,t,r,s){super(e,t,r,s),this.message=`${t.status} ${t.statusText} - ${this.method.toUpperCase()} ${this.spec||this.uri}${r&&r.error?" - "+r.error:""}`}},lw=class extends Ls{static{o(this,"HttpErrorAuthOTP")}constructor(e,t,r,s){super(e,t,r,s),this.message="OTP required for authentication",this.code="EOTP"}},hw=class extends Ls{static{o(this,"HttpErrorAuthIPAddress")}constructor(e,t,r,s){super(e,t,r,s),this.message="Login is not allowed from your IP address",this.code="EAUTHIP"}},fw=class extends Ls{static{o(this,"HttpErrorAuthUnknown")}constructor(e,t,r,s){super(e,t,r,s),this.message="Unable to authenticate, need: "+t.headers.get("www-authenticate")}};QD.exports={HttpErrorBase:Ls,HttpErrorGeneral:uw,HttpErrorAuthOTP:lw,HttpErrorAuthIPAddress:hw,HttpErrorAuthUnknown:fw}});var tx=d((fye,ex)=>{var BX=rh(),qc=class extends Error{static{o(this,"SizeError")}constructor(e,t){super(`Bad data size: expected ${t} bytes, but got ${e}`),this.expect=t,this.found=e,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}},qf=class extends BX{static{o(this,"MinipassSized")}constructor(e={}){if(super(e),e.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=e.size,typeof this.expect!="number"||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(e,t,r){let s=Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,typeof t=="string"?t:"utf8"):e;return Buffer.isBuffer(s)?(this.found+=s.length,this.found>this.expect&&this.emit("error",new qc(this.found,this.expect)),super.write(e,t,r)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(e,...t){return e==="end"&&this.found!==this.expect&&this.emit("error",new qc(this.found,this.expect)),super.emit(e,...t)}};qf.SizeError=qc;ex.exports=qf});var rx=d((pye,ix)=>{"use strict";var{Minipass:kX}=te(),pw=Symbol("type"),ir=Symbol("buffer"),Vf=class i{static{o(this,"Blob")}constructor(e,t){this[pw]="";let r=[],s=0;if(e){let a=e,c=Number(a.length);for(let u=0;u<c;u++){let l=a[u],h=l instanceof Buffer?l:ArrayBuffer.isView(l)?Buffer.from(l.buffer,l.byteOffset,l.byteLength):l instanceof ArrayBuffer?Buffer.from(l):l instanceof i?l[ir]:typeof l=="string"?Buffer.from(l):Buffer.from(String(l));s+=h.length,r.push(h)}}this[ir]=Buffer.concat(r,s);let n=t&&t.type!==void 0&&String(t.type).toLowerCase();n&&!/[^\u0020-\u007E]/.test(n)&&(this[pw]=n)}get size(){return this[ir].length}get type(){return this[pw]}text(){return Promise.resolve(this[ir].toString())}arrayBuffer(){let e=this[ir],t=e.byteOffset,r=e.byteLength,s=e.buffer.slice(t,t+r);return Promise.resolve(s)}stream(){return new kX().end(this[ir])}slice(e,t,r){let s=this.size,n=e===void 0?0:e<0?Math.max(s+e,0):Math.min(e,s),a=t===void 0?s:t<0?Math.max(s+t,0):Math.min(t,s),c=Math.max(a-n,0),l=this[ir].slice(n,n+c),h=new i([],{type:r});return h[ir]=l,h}get[Symbol.toStringTag](){return"Blob"}static get BUFFER(){return ir}};Object.defineProperties(Vf.prototype,{size:{enumerable:!0},type:{enumerable:!0}});ix.exports=Vf});var gw=d((gye,sx)=>{"use strict";var mw=class extends Error{static{o(this,"FetchError")}constructor(e,t,r){super(e),this.code="FETCH_ERROR",r&&Object.assign(this,r),this.errno=this.code,this.type=this.code==="EBADSIZE"&&this.found>this.expect?"max-size":t,this.message=e,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(e){}get[Symbol.toStringTag](){return"FetchError"}};sx.exports=mw});var ox=d((Sye,nx)=>{"use strict";nx.exports={}});var Hf=d((Eye,ux)=>{"use strict";var{Minipass:wi}=te(),yw=tx(),cx=rx(),{BUFFER:FX}=cx,Vc=gw(),Sw;try{Sw=ox().convert}catch{}var rr=Symbol("Body internals"),Ms=Symbol("consumeBody"),zf=class{static{o(this,"Body")}constructor(e,t={}){let{size:r=0,timeout:s=0}=t,n=e==null?null:ax(e)?Buffer.from(e.toString()):zc(e)||Buffer.isBuffer(e)?e:Object.prototype.toString.call(e)==="[object ArrayBuffer]"?Buffer.from(e):ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength):wi.isStream(e)?e:Buffer.from(String(e));this[rr]={body:n,disturbed:!1,error:null},this.size=r,this.timeout=s,wi.isStream(n)&&n.on("error",a=>{let c=a.name==="AbortError"?a:new Vc(`Invalid response while trying to fetch ${this.url}: ${a.message}`,"system",a);this[rr].error=c})}get body(){return this[rr].body}get bodyUsed(){return this[rr].disturbed}arrayBuffer(){return this[Ms]().then(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}blob(){let e=this.headers&&this.headers.get("content-type")||"";return this[Ms]().then(t=>Object.assign(new cx([],{type:e.toLowerCase()}),{[FX]:t}))}async json(){let e=await this[Ms]();try{return JSON.parse(e.toString())}catch(t){throw new Vc(`invalid json response body at ${this.url} reason: ${t.message}`,"invalid-json")}}text(){return this[Ms]().then(e=>e.toString())}buffer(){return this[Ms]()}textConverted(){return this[Ms]().then(e=>UX(e,this.headers))}[Ms](){if(this[rr].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[rr].disturbed=!0,this[rr].error)return Promise.reject(this[rr].error);if(this.body===null)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);let e=zc(this.body)?this.body.stream():this.body;if(!wi.isStream(e))return Promise.resolve(Buffer.alloc(0));let t=this.size&&e instanceof yw||!this.size&&e instanceof wi&&!(e instanceof yw)?e:this.size?new yw({size:this.size}):new wi,r=this.timeout&&t.writable?setTimeout(()=>{t.emit("error",new Vc(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return r&&r.unref&&r.unref(),new Promise(s=>{t!==e&&(e.on("error",n=>t.emit("error",n)),e.pipe(t)),s()}).then(()=>t.concat()).then(s=>(clearTimeout(r),s)).catch(s=>{throw clearTimeout(r),s.name==="AbortError"||s.name==="FetchError"?s:s.name==="RangeError"?new Vc(`Could not create Buffer from response body for ${this.url}: ${s.message}`,"system",s):new Vc(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s)})}static clone(e){if(e.bodyUsed)throw new Error("cannot clone body after it is used");let t=e.body;if(wi.isStream(t)&&typeof t.getBoundary!="function"){let r=new wi,s=new wi,n=new wi;return r.on("error",a=>{s.emit("error",a),n.emit("error",a)}),t.on("error",a=>r.emit("error",a)),r.pipe(s),r.pipe(n),t.pipe(r),e[rr].body=s,n}else return e.body}static extractContentType(e){return e==null?null:typeof e=="string"?"text/plain;charset=UTF-8":ax(e)?"application/x-www-form-urlencoded;charset=UTF-8":zc(e)?e.type||null:Buffer.isBuffer(e)||Object.prototype.toString.call(e)==="[object ArrayBuffer]"||ArrayBuffer.isView(e)?null:typeof e.getBoundary=="function"?`multipart/form-data;boundary=${e.getBoundary()}`:wi.isStream(e)?null:"text/plain;charset=UTF-8"}static getTotalBytes(e){let{body:t}=e;return t==null?0:zc(t)?t.size:Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&(t._lengthRetrievers&&t._lengthRetrievers.length===0||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}static writeToStream(e,t){let{body:r}=t;return r==null?e.end():Buffer.isBuffer(r)||typeof r=="string"?e.end(r):(zc(r)?r.stream():r).on("error",n=>e.emit("error",n)).pipe(e),e}};Object.defineProperties(zf.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var ax=o(i=>typeof i!="object"||typeof i.append!="function"||typeof i.delete!="function"||typeof i.get!="function"||typeof i.getAll!="function"||typeof i.has!="function"||typeof i.set!="function"?!1:i.constructor.name==="URLSearchParams"||Object.prototype.toString.call(i)==="[object URLSearchParams]"||typeof i.sort=="function","isURLSearchParams"),zc=o(i=>typeof i=="object"&&typeof i.arrayBuffer=="function"&&typeof i.type=="string"&&typeof i.stream=="function"&&typeof i.constructor=="function"&&typeof i.constructor.name=="string"&&/^(Blob|File)$/.test(i.constructor.name)&&/^(Blob|File)$/.test(i[Symbol.toStringTag]),"isBlob"),UX=o((i,e)=>{if(typeof Sw!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let t=e&&e.get("content-type"),r="utf-8",s;t&&(s=/charset=([^;]*)/i.exec(t));let n=i.slice(0,1024).toString();return!s&&n&&(s=/<meta.+?charset=(['"])(.+?)\1/i.exec(n)),!s&&n&&(s=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(n),s||(s=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(n),s&&s.pop()),s&&(s=/charset=(.*)/i.exec(s.pop()))),!s&&n&&(s=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(n)),s&&(r=s.pop(),(r==="gb2312"||r==="gbk")&&(r="gb18030")),Sw(i,"UTF-8",r).toString()},"convertBody");ux.exports=zf});var Wf=d((_ye,fx)=>{"use strict";var hx=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,ww=/[^\t\x20-\x7e\x80-\xff]/,Hc=o(i=>{if(i=`${i}`,hx.test(i)||i==="")throw new TypeError(`${i} is not a legal HTTP header name`)},"validateName"),lx=o(i=>{if(i=`${i}`,ww.test(i))throw new TypeError(`${i} is not a legal HTTP header value`)},"validateValue"),po=o((i,e)=>{e=e.toLowerCase();for(let t in i)if(t.toLowerCase()===e)return t},"find"),me=Symbol("map"),Gf=class i{static{o(this,"Headers")}constructor(e=void 0){if(this[me]=Object.create(null),e instanceof i){let t=e.raw(),r=Object.keys(t);for(let s of r)for(let n of t[s])this.append(s,n);return}if(e!=null)if(typeof e=="object"){let t=e[Symbol.iterator];if(t!=null){if(typeof t!="function")throw new TypeError("Header pairs must be iterable");let r=[];for(let s of e){if(typeof s!="object"||typeof s[Symbol.iterator]!="function")throw new TypeError("Each header pair must be iterable");let n=Array.from(s);if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");r.push(n)}for(let s of r)this.append(s[0],s[1])}else for(let r of Object.keys(e))this.append(r,e[r])}else throw new TypeError("Provided initializer must be an object")}get(e){e=`${e}`,Hc(e);let t=po(this[me],e);return t===void 0?null:this[me][t].join(", ")}forEach(e,t=void 0){let r=_w(this);for(let s=0;s<r.length;s++){let[n,a]=r[s];e.call(t,a,n,this),r=_w(this)}}set(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);this[me][r!==void 0?r:e]=[t]}append(e,t){e=`${e}`,t=`${t}`,Hc(e),lx(t);let r=po(this[me],e);r!==void 0?this[me][r].push(t):this[me][e]=[t]}has(e){return e=`${e}`,Hc(e),po(this[me],e)!==void 0}delete(e){e=`${e}`,Hc(e);let t=po(this[me],e);t!==void 0&&delete this[me][t]}raw(){return this[me]}keys(){return new Bs(this,"key")}values(){return new Bs(this,"value")}[Symbol.iterator](){return new Bs(this,"key+value")}entries(){return new Bs(this,"key+value")}get[Symbol.toStringTag](){return"Headers"}static exportNodeCompatibleHeaders(e){let t=Object.assign(Object.create(null),e[me]),r=po(e[me],"Host");return r!==void 0&&(t[r]=t[r][0]),t}static createHeadersLenient(e){let t=new i;for(let r of Object.keys(e))if(!hx.test(r))if(Array.isArray(e[r]))for(let s of e[r])ww.test(s)||(t[me][r]===void 0?t[me][r]=[s]:t[me][r].push(s));else ww.test(e[r])||(t[me][r]=[e[r]]);return t}};Object.defineProperties(Gf.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});var _w=o((i,e="key+value")=>Object.keys(i[me]).sort().map(e==="key"?t=>t.toLowerCase():e==="value"?t=>i[me][t].join(", "):t=>[t.toLowerCase(),i[me][t].join(", ")]),"getHeaders"),Ew=Symbol("internal"),Bs=class i{static{o(this,"HeadersIterator")}constructor(e,t){this[Ew]={target:e,kind:t,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==i.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");let{target:e,kind:t,index:r}=this[Ew],s=_w(e,t),n=s.length;return r>=n?{value:void 0,done:!0}:(this[Ew].index++,{value:s[r],done:!1})}};Object.setPrototypeOf(Bs.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));fx.exports=Gf});var gx=d((Iye,mx)=>{"use strict";var jX=require("http"),{STATUS_CODES:$X}=jX,dx=Wf(),px=Hf(),{clone:qX,extractContentType:VX}=px,sr=Symbol("Response internals"),Jf=class i extends px{static{o(this,"Response")}constructor(e=null,t={}){super(e,t);let r=t.status||200,s=new dx(t.headers);if(e!=null&&!s.has("Content-Type")){let n=VX(e);n&&s.append("Content-Type",n)}this[sr]={url:t.url,status:r,statusText:t.statusText||$X[r],headers:s,counter:t.counter,trailer:Promise.resolve(t.trailer||new dx)}}get trailer(){return this[sr].trailer}get url(){return this[sr].url||""}get status(){return this[sr].status}get ok(){return this[sr].status>=200&&this[sr].status<300}get redirected(){return this[sr].counter>0}get statusText(){return this[sr].statusText}get headers(){return this[sr].headers}clone(){return new i(qX(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}};mx.exports=Jf;Object.defineProperties(Jf.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var yx=d((vye,zX)=>{zX.exports={name:"minipass-fetch",version:"4.0.1",description:"An implementation of window.fetch in Node.js using Minipass streams",license:"MIT",main:"lib/index.js",scripts:{"test:tls-fixtures":"./test/fixtures/tls/setup.sh",test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{"coverage-map":"map.js","check-coverage":!0,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.3","@ungap/url-search-params":"^0.2.2","abort-controller":"^3.0.0","abortcontroller-polyfill":"~1.7.3",encoding:"^0.1.13","form-data":"^4.0.0",nock:"^13.2.4",parted:"^0.1.1","string-to-arraybuffer":"^1.0.2",tap:"^16.0.0"},dependencies:{minipass:"^7.0.3","minipass-sized":"^1.0.3",minizlib:"^3.0.1"},optionalDependencies:{encoding:"^0.1.13"},repository:{type:"git",url:"git+https://github.com/npm/minipass-fetch.git"},keywords:["fetch","minipass","node-fetch","window.fetch"],files:["bin/","lib/"],engines:{node:"^18.17.0 || >=20.5.0"},author:"GitHub Inc.",templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.3",publish:"true"}}});var wx=d((Rye,Ex)=>{"use strict";var{URL:bw}=require("url"),{Minipass:HX}=te(),Iw=Wf(),{exportNodeCompatibleHeaders:GX}=Iw,Sx=Hf(),{clone:WX,extractContentType:JX,getTotalBytes:KX}=Sx,ZX=yx().version,YX=`minipass-fetch/${ZX} (+https://github.com/isaacs/minipass-fetch)`,Yt=Symbol("Request internals"),Kf=o(i=>typeof i=="object"&&typeof i[Yt]=="object","isRequest"),XX=o(i=>{let e=i&&typeof i=="object"&&Object.getPrototypeOf(i);return!!(e&&e.constructor.name==="AbortSignal")},"isAbortSignal"),Zf=class i extends Sx{static{o(this,"Request")}constructor(e,t={}){let r=Kf(e)?new bw(e.url):e&&e.href?new bw(e.href):new bw(`${e}`);Kf(e)?t={...e[Yt],...t}:(!e||typeof e=="string")&&(e={});let s=(t.method||e.method||"GET").toUpperCase(),n=s==="GET"||s==="HEAD";if((t.body!==null&&t.body!==void 0||Kf(e)&&e.body!==null)&&n)throw new TypeError("Request with GET/HEAD method cannot have body");let a=t.body!==null&&t.body!==void 0?t.body:Kf(e)&&e.body!==null?WX(e):null;super(a,{timeout:t.timeout||e.timeout||0,size:t.size||e.size||0});let c=new Iw(t.headers||e.headers||{});if(a!=null&&!c.has("Content-Type")){let ee=JX(a);ee&&c.append("Content-Type",ee)}let u="signal"in t?t.signal:null;if(u!=null&&!XX(u))throw new TypeError("Expected signal must be an instanceof AbortSignal");let{ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0",secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$}=t;this[Yt]={method:s,redirect:t.redirect||e.redirect||"follow",headers:c,parsedURL:r,signal:u,ca:l,cert:h,ciphers:f,clientCertEngine:p,crl:m,dhparam:y,ecdhCurve:g,family:S,honorCipherOrder:E,key:_,passphrase:b,pfx:w,rejectUnauthorized:I,secureOptions:v,secureProtocol:N,servername:P,sessionIdContext:$},this.follow=t.follow!==void 0?t.follow:e.follow!==void 0?e.follow:20,this.compress=t.compress!==void 0?t.compress:e.compress!==void 0?e.compress:!0,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent}get method(){return this[Yt].method}get url(){return this[Yt].parsedURL.toString()}get headers(){return this[Yt].headers}get redirect(){return this[Yt].redirect}get signal(){return this[Yt].signal}clone(){return new i(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(e){let t=e[Yt].parsedURL,r=new Iw(e[Yt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&HX.isStream(e.body)&&typeof e.body.destroy!="function")throw new Error("Cancellation of streamed requests with AbortSignal is not supported");let s=(e.body===null||e.body===void 0)&&/^(POST|PUT)$/i.test(e.method)?"0":e.body!==null&&e.body!==void 0?KX(e):null;s&&r.set("Content-Length",s+""),r.has("User-Agent")||r.set("User-Agent",YX),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=typeof e.agent=="function"?e.agent(t):e.agent;!r.has("Connection")&&!n&&r.set("Connection","close");let{ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v}=e[Yt];return{...{auth:t.username||t.password?`${t.username}:${t.password}`:"",host:t.host,hostname:t.hostname,path:`${t.pathname}${t.search}`,port:t.port,protocol:t.protocol},method:e.method,headers:GX(r),agent:n,ca:a,cert:c,ciphers:u,clientCertEngine:l,crl:h,dhparam:f,ecdhCurve:p,family:m,honorCipherOrder:y,key:g,passphrase:S,pfx:E,rejectUnauthorized:_,secureOptions:b,secureProtocol:w,servername:I,sessionIdContext:v,timeout:e.timeout}}};Ex.exports=Zf;Object.defineProperties(Zf.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})});var bx=d((Tye,_x)=>{"use strict";var Ow=class extends Error{static{o(this,"AbortError")}constructor(e){super(e),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(e){}};_x.exports=Ow});var go=d((Nye,vx)=>{"use strict";var{URL:Gc}=require("url"),QX=require("http"),e9=require("https"),mo=vc(),{Minipass:Ix}=te(),t9=Hf(),{writeToStream:i9,getTotalBytes:r9}=t9,ks=gx(),Rw=Wf(),{createHeadersLenient:Ox}=Rw,Wc=wx(),{getNodeRequestOptions:s9}=Wc,Br=gw(),vw=bx(),nr=o(async(i,e)=>{if(/^data:/.test(i)){let t=new Wc(i,e);return Promise.resolve().then(()=>new Promise((r,s)=>{let n,a;try{let{pathname:l,search:h}=new Gc(i),f=l.split(",");if(f.length<2)throw new Error("invalid data: URI");let p=f.shift(),m=/;base64$/.test(p);n=m?p.slice(0,-7):p;let y=decodeURIComponent(f.join(",")+h);a=m?Buffer.from(y,"base64"):Buffer.from(y)}catch(l){return s(new Br(`[${t.method}] ${t.url} invalid URL, ${l.message}`,"system",l))}let{signal:c}=t;if(c&&c.aborted)return s(new vw("The user aborted a request."));let u={"Content-Length":a.length};return n&&(u["Content-Type"]=n),r(new ks(a,{headers:u}))}))}return new Promise((t,r)=>{let s=new Wc(i,e),n;try{n=s9(s)}catch(y){return r(y)}let a=(n.protocol==="https:"?e9:QX).request,{signal:c}=s,u=null,l=o(()=>{let y=new vw("The user aborted a request.");r(y),Ix.isStream(s.body)&&typeof s.body.destroy=="function"&&s.body.destroy(y),u&&u.body&&u.body.emit("error",y)},"abort");if(c&&c.aborted)return l();let h=o(()=>{l(),f()},"abortAndFinalize"),f=o(()=>{p.abort(),c&&c.removeEventListener("abort",h),clearTimeout(m)},"finalize"),p=a(n);c&&c.addEventListener("abort",h);let m=null;s.timeout&&p.once("socket",()=>{m=setTimeout(()=>{r(new Br(`network timeout at: ${s.url}`,"request-timeout")),f()},s.timeout)}),p.on("error",y=>{p.res&&p.res.emit("error",y),r(new Br(`request to ${s.url} failed, reason: ${y.message}`,"system",y)),f()}),p.on("response",y=>{clearTimeout(m);let g=Ox(y.headers);if(nr.isRedirect(y.statusCode)){let I=g.get("Location"),v=null;try{v=I===null?null:new Gc(I,s.url).toString()}catch{if(s.redirect!=="manual"){r(new Br(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),f();return}}if(s.redirect==="error"){r(new Br(`uri requested responds with a redirect, redirect mode is set to error: ${s.url}`,"no-redirect")),f();return}else if(s.redirect==="manual"){if(v!==null)try{g.set("Location",v)}catch(N){r(N)}}else if(s.redirect==="follow"&&v!==null){if(s.counter>=s.follow){r(new Br(`maximum redirect reached at: ${s.url}`,"max-redirect")),f();return}if(y.statusCode!==303&&s.body&&r9(s)===null){r(new Br("Cannot follow redirect with body being a readable stream","unsupported-redirect")),f();return}s.headers.set("host",new Gc(v).host);let N={headers:new Rw(s.headers),follow:s.follow,counter:s.counter+1,agent:s.agent,compress:s.compress,method:s.method,body:s.body,signal:s.signal,timeout:s.timeout},P=new Gc(s.url),$=new Gc(v);P.hostname!==$.hostname&&(N.headers.delete("authorization"),N.headers.delete("cookie")),(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&s.method==="POST")&&(N.method="GET",N.body=void 0,N.headers.delete("content-length")),t(nr(new Wc(v,N))),f();return}}y.once("end",()=>c&&c.removeEventListener("abort",h));let S=new Ix;S.on("error",f),y.on("error",I=>S.emit("error",I)),y.on("data",I=>S.write(I)),y.on("end",()=>S.end());let E={url:s.url,status:y.statusCode,statusText:y.statusMessage,headers:g,size:s.size,timeout:s.timeout,counter:s.counter,trailer:new Promise(I=>y.on("end",()=>I(Ox(y.trailers))))},_=g.get("Content-Encoding");if(!s.compress||s.method==="HEAD"||_===null||y.statusCode===204||y.statusCode===304){u=new ks(S,E),t(u);return}let b={flush:mo.constants.Z_SYNC_FLUSH,finishFlush:mo.constants.Z_SYNC_FLUSH};if(_==="gzip"||_==="x-gzip"){let I=new mo.Gunzip(b);u=new ks(S.on("error",v=>I.emit("error",v)).pipe(I),E),t(u);return}if(_==="deflate"||_==="x-deflate"){y.once("data",I=>{let v=(I[0]&15)===8?new mo.Inflate:new mo.InflateRaw;S.on("error",N=>v.emit("error",N)).pipe(v),u=new ks(v,E),t(u)});return}if(_==="br"){try{var w=new mo.BrotliDecompress}catch(I){r(I),f();return}S.on("error",I=>w.emit("error",I)).pipe(w),u=new ks(w,E),t(u);return}u=new ks(S,E),t(u)}),i9(p,s)})},"fetch");vx.exports=nr;nr.isRedirect=i=>i===301||i===302||i===303||i===307||i===308;nr.Headers=Rw;nr.Request=Wc;nr.Response=ks;nr.FetchError=Br;nr.AbortError=vw});var Rx=d((Dye,n9)=>{n9.exports={name:"npm-registry-fetch",version:"19.0.0",description:"Fetch-based http client for use with npm registry APIs",main:"lib",files:["bin/","lib/"],scripts:{eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",test:"tap",posttest:"npm run lint",npmclilint:"npmcli-lint",postsnap:"npm run lintfix --",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/npm-registry-fetch.git"},keywords:["npm","registry","fetch"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/redact":"^3.0.0",jsonparse:"^1.3.1","make-fetch-happen":"^15.0.0",minipass:"^7.0.2","minipass-fetch":"^4.0.0",minizlib:"^3.0.1","npm-package-arg":"^13.0.0","proc-log":"^5.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",cacache:"^20.0.0",nock:"^13.2.4","require-inject":"^1.4.4",ssri:"^12.0.0",tap:"^16.0.1"},tap:{"check-coverage":!0,"test-ignore":"test[\\\\/](util|cache)[\\\\/]","nyc-arg":["--exclude","tap-snapshots/**"]},engines:{node:"^20.17.0 || >=22.9.0"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Aw=d((xye,Tx)=>{var Ax=Rx();Tx.exports={maxSockets:12,method:"GET",registry:"https://registry.npmjs.org/",timeout:300*1e3,strictSSL:!0,noProxy:process.env.NOPROXY,userAgent:`${Ax.name}@${Ax.version}/node@${process.version}+${process.arch} (${process.platform})`}});var Tw=d((Lye,Cx)=>{var yo="regex",So="path",o9={type:yo,pattern:/\b(npms?_)[a-zA-Z0-9]{36,48}\b/gi,replacement:"[REDACTED_NPM_SECRET]"},a9={type:yo,pattern:/\b(Basic\s+|Bearer\s+)[\w+=\-.]+\b/gi,replacement:"[REDACTED_AUTH_HEADER]"},c9={type:yo,pattern:/\b[A-Za-z0-9-_]{10,}(?!\.\d+\.)\.[A-Za-z0-9-_]{3,}\.[A-Za-z0-9-_]{20,}\b/gi,replacement:"[REDACTED_JSON_WEB_TOKEN]"},u9={type:yo,pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,replacement:"[REDACTED_UUID]"},l9={type:yo,pattern:/(?:https?|ftp):\/\/[^\s/"$.?#].[^\s"]*/gi,replacement:"[REDACTED_URL]"},h9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.authorization"),"predicate"),replacement:"[REDACTED_HEADER_AUTHORIZATION]"},f9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.set-cookie"),"predicate"),replacement:"[REDACTED_HEADER_SET_COOKIE]"},d9={type:So,predicate:o(({path:i})=>i.endsWith(".headers.cookie"),"predicate"),replacement:"[REDACTED_HEADER_COOKIE]"},p9={type:So,predicate:o(({path:i})=>i.endsWith(".request"),"predicate"),replacement:o(i=>({method:i?.method,path:i?.path,headers:i?.headers,url:i?.url}),"replacement")},m9={type:So,predicate:o(({path:i})=>i.endsWith(".response"),"predicate"),replacement:o(i=>({data:i?.data,status:i?.status,headers:i?.headers}),"replacement")};Cx.exports={TYPE_REGEX:yo,TYPE_URL:"url",TYPE_PATH:So,NPM_SECRET:o9,AUTH_HEADER:a9,JSON_WEB_TOKEN:c9,UUID:u9,URL_MATCHER:l9,DEEP_HEADER_AUTHORIZATION:h9,DEEP_HEADER_SET_COOKIE:f9,DEEP_HEADER_COOKIE:d9,REWRITE_REQUEST:p9,REWRITE_RESPONSE:m9}});var Mx=d((Bye,Lx)=>{var{URL_MATCHER:g9,TYPE_URL:Yf,TYPE_REGEX:y9,TYPE_PATH:S9}=Tw(),kr=o((i=0)=>(i=typeof i=="string"?i.length:i,i<8?"*".repeat(8):"*".repeat(i)),"asterisk"),Nx=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"escapeRegExp"),Px=o(i=>{let e=decodeURIComponent(i),t=encodeURIComponent(i);return[...new Set([t,e,i])].map(Nx).join("|")},"urlEncodeRegexGroup"),Xf=o((i,...e)=>{let t="";for(let r=0;r<e.length;r++)t+=i[r]+`(${Px(e[r])})`;return t+=i[i.length-1],new RegExp(t)},"urlEncodeRegexTag"),E9=o(({hostname:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.hostname===i,"predicate"),pattern:o(({url:t})=>Xf`(^${t.protocol}//${t.username}:.+@)?${t.hostname}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlHostnameMatcher"),w9=o(({param:i,replacement:e}={})=>({type:Yf,predicate:o(({url:t})=>t.searchParams.has(i),"predicate"),pattern:o(({url:t})=>Xf`(${i}=)${t.searchParams.get(i)}`,"pattern"),replacement:`$1${e||kr()}`}),"redactUrlSearchParamsMatcher"),Dx=o(({replacement:i}={})=>({type:Yf,predicate:o(({url:e})=>e.password,"predicate"),pattern:o(({url:e})=>Xf`(^${e.protocol}//${e.username}:)${e.password}`,"pattern"),replacement:`$1${i||kr()}`}),"redactUrlPasswordMatcher"),xx=o((...i)=>e=>{try{let t=new URL(e);return Cw(...i)(e,{url:t})}catch{return e}},"redactUrlReplacement"),_9=o((...i)=>({...g9,replacement:xx(...i)}),"redactUrlMatcher"),b9={[y9]:i=>e=>(typeof e=="string"&&(e=e.replace(i.pattern,i.replacement)),e),[Yf]:i=>(e,t)=>{if(typeof e=="string")try{let r=t?.url||new URL(e),{predicate:s,pattern:n}=i;s({url:r})&&(e=e.replace(n({url:r}),i.replacement))}catch{return e}return e},[S9]:i=>(e,t)=>{let r=t?.path,s=r.join(".").toLowerCase(),{predicate:n,replacement:a}=i,c=typeof a=="function"?a:()=>a;return n({rawPath:r,path:s})&&(e=c(e,{rawPath:r,path:s})),e}},I9=o(i=>b9[i.type](i),"redactMatcher"),Cw=o((...i)=>(e,t)=>i.flat().reduce((s,n)=>(typeof n=="function"?n:I9(n))(s,t),e),"redactMatchers"),O9=o(()=>(i,e)=>typeof e=="number"?kr(i):e+kr(i.substring(e.length).length),"redactDynamicReplacement"),v9=o(i=>(e,t)=>typeof t=="number"?kr(i):t+kr(i),"redactFixedReplacement"),R9=o((i,e)=>Cw(Dx({replacement:e}))(i),"redactUrlPassword");Lx.exports={asterisk:kr,escapeRegExp:Nx,urlEncodeRegexGroup:Px,urlEncodeRegexTag:Xf,redactUrlHostnameMatcher:E9,redactUrlSearchParamsMatcher:w9,redactUrlPasswordMatcher:Dx,redactUrlMatcher:_9,redactUrlReplacement:xx,redactDynamicReplacement:O9,redactFixedReplacement:v9,redactMatchers:Cw,redactUrlPassword:R9}});var Ux=d((Fye,Fx)=>{var Bx=Tw(),{redactUrlPassword:A9}=Mx(),Nw="***",Pw=o(i=>typeof i!="string"||!i?i:A9(i,Nw).replace(Bx.NPM_SECRET.pattern,`npm_${Nw}`).replace(Bx.UUID.pattern,Nw),"redact"),kx=o(i=>{let e=/[\s=]/g,t=null,r="",s=0;for(;t=e.exec(i);)r+=Pw(i.slice(s,t.index))+t[0],s=e.lastIndex;return r+Pw(i.slice(s))},"splitAndRedact"),T9=o(i=>typeof i=="string"?kx(i):Array.isArray(i)?i.map(e=>typeof e=="string"?kx(e):e):i,"redactLog");Fx.exports={redact:Pw,redactLog:T9}});var qx=d((jye,$x)=>{"use strict";var Jc=dw(),{Response:C9}=go(),N9=Aw(),{log:Qf}=St(),{redact:P9}=Ux(),D9="https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry",x9=o(async({method:i,uri:e,res:t,startTime:r,auth:s,opts:n})=>(n={...N9,...n},t.headers.has("npm-notice")&&!t.headers.has("x-local-cache")&&Qf.notice("",t.headers.get("npm-notice")),t.status>=400?(jx(i,t,r),s&&s.scopeAuthKey&&!s.token&&!s.auth&&Qf.warn("registry",`No auth for URI, but auth present for scoped registry.
|
|
39
40
|
|
|
40
41
|
URI: ${e}
|
|
41
42
|
Scoped Registry Key: ${s.scopeAuthKey}
|
|
42
43
|
|
|
43
|
-
More info here: ${i8}`),s8(i,t,r,n)):(t.body.on("end",()=>iL(i,t,r,n)),n.ignoreBody?(t.body.resume(),new Q9(null,t)):t)),"checkResponse");rL.exports=r8;function iL(i,e,t){let r=Date.now()-t,s=e.headers.get("x-fetch-attempts"),n=s&&s>1?` attempt #${s}`:"",a=e.headers.get("x-local-cache-status"),c=a?` (cache ${a})`:"",u=t8(e.url);a==="hit"?ad.http("cache",`${u} ${r}ms${n}${c}`):ad.http("fetch",`${i.toUpperCase()} ${e.status} ${u} ${r}ms${n}${c}`)}o(iL,"logRequest");function s8(i,e,t,r){return e.buffer().catch(()=>null).then(s=>{let n=s;try{n=JSON.parse(s.toString("utf8"))}catch{}if(e.status===401&&e.headers.get("www-authenticate")){let a=e.headers.get("www-authenticate").split(/,\s*/).map(c=>c.toLowerCase());throw a.indexOf("ipaddress")!==-1?new ru.HttpErrorAuthIPAddress(i,e,n,r.spec):a.indexOf("otp")!==-1?new ru.HttpErrorAuthOTP(i,e,n,r.spec):new ru.HttpErrorAuthUnknown(i,e,n,r.spec)}else throw e.status===401&&s!=null&&/one-time pass/.test(s.toString("utf8"))?new ru.HttpErrorAuthOTP(i,e,n,r.spec):new ru.HttpErrorGeneral(i,e,n,r.spec)})}o(s8,"checkErrors")});var uL=d((LSe,cL)=>{"use strict";var n8=require("fs"),o8=Hn(),{URL:zw}=require("url"),nL=o((i,e)=>{let t=new zw(i),r=`//${t.host}${t.pathname}`;for(;r.length>2;){let s=a8(r,e);if(s)return{regKey:r,authKey:s};r=r.replace(/([^/]+|\/)$/,"")}return{regKey:!1,authKey:null}},"regFromURI"),a8=o((i,e)=>e[`${i}:_authToken`]?"_authToken":e[`${i}:_auth`]?"_auth":e[`${i}:username`]&&e[`${i}:_password`]?"username":e[`${i}:certfile`]&&e[`${i}:keyfile`]?"certfile":!1,"hasAuth"),c8=o((i,e)=>{let t=new zw(i),r=new zw(e);return t.host===r.host},"sameHost"),u8=o(i=>{let{spec:e}=i,{scope:t,subSpec:r}=e?o8(e):{},s=r&&r.scope,n=r?s:t;return n&&i[`${n}:registry`]||i.registry},"getRegistry"),oL=o(i=>{try{return n8.readFileSync(i,"utf8")}catch(e){if(e.code!=="ENOENT")throw e;return null}},"maybeReadFile"),aL=o((i,e={})=>{let{forceAuth:t}=e;if(!i)throw new Error("URI is required");let{regKey:r,authKey:s}=nL(i,t||e);if(t&&!r)return new su({regKey:!1,authKey:null,scopeAuthKey:null,token:t._authToken||t.token,username:t.username,password:t._password||t.password,auth:t._auth||t.auth,certfile:t.certfile,keyfile:t.keyfile});if(!r){let f=u8(e);if(f&&i!==f&&c8(i,f))return aL(f,e);if(f!==e.registry){let{regKey:p,authKey:m}=nL(f,e);return new su({scopeAuthKey:p,regKey:p,authKey:m})}}let{[`${r}:_authToken`]:n,[`${r}:username`]:a,[`${r}:_password`]:c,[`${r}:_auth`]:u,[`${r}:certfile`]:l,[`${r}:keyfile`]:h}=e;return new su({scopeAuthKey:null,regKey:r,authKey:s,token:n,auth:u,username:a,password:c,certfile:l,keyfile:h})},"getAuth"),su=class{static{o(this,"Auth")}constructor({token:e,auth:t,username:r,password:s,scopeAuthKey:n,certfile:a,keyfile:c,regKey:u,authKey:l}){if(this.scopeAuthKey=n,this.regKey=u,this.authKey=l,this.token=null,this.auth=null,this.isBasicAuth=!1,this.cert=null,this.key=null,e)this.token=e;else if(t)this.auth=t;else if(r&&s){let h=Buffer.from(s,"base64").toString("utf8");this.auth=Buffer.from(`${r}:${h}`,"utf8").toString("base64"),this.isBasicAuth=!0}if(a&&c){let h=oL(a,"utf-8"),f=oL(c,"utf-8");h&&f&&(this.cert=h,this.key=f)}}};cL.exports=aL});var hL=d((BSe,lL)=>{var l8=require("dns"),h8=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],f8=o(i=>{let{strictSSL:e,...t}={...i};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:l8.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(s=>h8.includes(s.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");lL.exports=f8});var dL=d((USe,fL)=>{"use strict";var d8=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),p8=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),m8=new Set([500,502,503,504]),g8={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},y8={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function lr(i){let e=parseInt(i,10);return isFinite(e)?e:0}o(lr,"toNumberOrZero");function S8(i){return i?m8.has(i.status):!0}o(S8,"isErrorResponse");function Hw(i){let e={};if(!i)return e;let t=i.trim().split(/,/);for(let r of t){let[s,n]=r.split(/=/,2);e[s.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(Hw,"parseCacheControl");function E8(i){let e=[];for(let t in i){let r=i[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(E8,"formatCacheControl");fL.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:s,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=s!==void 0?s:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=Hw(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=Hw(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":E8(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&p8.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||d8.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=Hw(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>lr(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<lr(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)g8[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let s of r)delete t[s]}if(t.warning){let r=t.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return lr(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return lr(this._rescc["s-maxage"])}if(this._rescc["max-age"])return lr(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+lr(this._rescc["stale-if-error"]),r=e+lr(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+lr(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=lr(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let s=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));s.length?t["if-none-match"]=s.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&S8(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,s),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!y8[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,s),modified:!1,matches:!0}}}});var yL=d(($Se,Gw)=>{"use strict";Gw.exports=gL;Gw.exports.preferredCharsets=gL;var w8=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function _8(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=b8(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(_8,"parseAcceptCharset");function b8(i,e){var t=w8.exec(i);if(!t)return null;var r=t[1],s=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){s=parseFloat(c[1]);break}}return{charset:r,q:s,i:e}}o(b8,"parseCharset");function I8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=O8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(I8,"getCharsetPriority");function O8(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(O8,"specify");function gL(i,e){var t=_8(i===void 0?"*":i||"");if(!e)return t.filter(mL).sort(pL).map(v8);var r=e.map(o(function(n,a){return I8(n,t,a)},"getPriority"));return r.filter(mL).sort(pL).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(gL,"preferredCharsets");function pL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(pL,"compareSpecs");function v8(i){return i.charset}o(v8,"getFullCharset");function mL(i){return i.q>0}o(mL,"isQuality")});var _L=d((VSe,Ww)=>{"use strict";Ww.exports=wL;Ww.exports.preferredEncodings=wL;var C8=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function R8(i){for(var e=i.split(","),t=!1,r=1,s=0,n=0;s<e.length;s++){var a=A8(e[s].trim(),s);a&&(e[n++]=a,t=t||EL("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i:s}),e.length=n,e}o(R8,"parseAcceptEncoding");function A8(i,e){var t=C8.exec(i);if(!t)return null;var r=t[1],s=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){s=parseFloat(c[1]);break}}return{encoding:r,q:s,i:e}}o(A8,"parseEncoding");function T8(i,e,t){for(var r={encoding:i,o:-1,q:0,s:0},s=0;s<e.length;s++){var n=EL(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(T8,"getEncodingPriority");function EL(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:i,i:t,o:e.i,q:e.q,s:r}}o(EL,"specify");function wL(i,e,t){var r=R8(i||""),s=t?o(function(c,u){if(c.q!==u.q)return u.q-c.q;var l=t.indexOf(c.encoding),h=t.indexOf(u.encoding);return l===-1&&h===-1?u.s-c.s||c.o-u.o||c.i-u.i:l!==-1&&h!==-1?l-h:l===-1?1:-1},"comparator"):N8;if(!e)return r.filter(SL).sort(s).map(P8);var n=e.map(o(function(c,u){return T8(c,r,u)},"getPriority"));return n.filter(SL).sort(s).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(wL,"preferredEncodings");function N8(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i}o(N8,"compareSpecs");function P8(i){return i.encoding}o(P8,"getFullEncoding");function SL(i){return i.q>0}o(SL,"isQuality")});var CL=d((HSe,Jw)=>{"use strict";Jw.exports=vL;Jw.exports.preferredLanguages=vL;var D8=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function x8(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=OL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(x8,"parseAcceptLanguage");function OL(i,e){var t=D8.exec(i);if(!t)return null;var r=t[1],s=t[2],n=r;s&&(n+="-"+s);var a=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var l=c[u].split("=");l[0]==="q"&&(a=parseFloat(l[1]))}return{prefix:r,suffix:s,q:a,i:e,full:n}}o(OL,"parseLanguage");function L8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=M8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(L8,"getLanguagePriority");function M8(i,e,t){var r=OL(i);if(!r)return null;var s=0;if(e.full.toLowerCase()===r.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}o(M8,"specify");function vL(i,e){var t=x8(i===void 0?"*":i||"");if(!e)return t.filter(IL).sort(bL).map(B8);var r=e.map(o(function(n,a){return L8(n,t,a)},"getPriority"));return r.filter(IL).sort(bL).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(vL,"preferredLanguages");function bL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(bL,"compareSpecs");function B8(i){return i.full}o(B8,"getFullLanguage");function IL(i){return i.q>0}o(IL,"isQuality")});var DL=d((WSe,Kw)=>{"use strict";Kw.exports=NL;Kw.exports.preferredMediaTypes=NL;var k8=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function F8(i){for(var e=V8(i),t=0,r=0;t<e.length;t++){var s=TL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(F8,"parseAccept");function TL(i,e){var t=k8.exec(i);if(!t)return null;var r=Object.create(null),s=1,n=t[2],a=t[1];if(t[3])for(var c=z8(t[3]).map(q8),u=0;u<c.length;u++){var l=c[u],h=l[0].toLowerCase(),f=l[1],p=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(h==="q"){s=parseFloat(p);break}r[h]=p}return{type:a,subtype:n,params:r,q:s,i:e}}o(TL,"parseMediaType");function U8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=j8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(U8,"getMediaTypePriority");function j8(i,e,t){var r=TL(i),s=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())s|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}o(j8,"specify");function NL(i,e){var t=F8(i===void 0?"*/*":i||"");if(!e)return t.filter(AL).sort(RL).map($8);var r=e.map(o(function(n,a){return U8(n,t,a)},"getPriority"));return r.filter(AL).sort(RL).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(NL,"preferredMediaTypes");function RL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(RL,"compareSpecs");function $8(i){return i.type+"/"+i.subtype}o($8,"getFullType");function AL(i){return i.q>0}o(AL,"isQuality");function PL(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}o(PL,"quoteCount");function q8(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.slice(0,e),r=i.slice(e+1)),[t,r]}o(q8,"splitKeyValuePair");function V8(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)PL(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(V8,"splitMediaTypes");function z8(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)PL(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(z8,"splitParameters")});var xL=d((KSe,Zw)=>{"use strict";var H8=yL(),G8=_L(),W8=CL(),J8=DL();Zw.exports=Y;Zw.exports.Negotiator=Y;function Y(i){if(!(this instanceof Y))return new Y(i);this.request=i}o(Y,"Negotiator");Y.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");Y.prototype.charsets=o(function(e){return H8(this.request.headers["accept-charset"],e)},"charsets");Y.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");Y.prototype.encodings=o(function(e,t){var r=t||{};return G8(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");Y.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");Y.prototype.languages=o(function(e){return W8(this.request.headers["accept-language"],e)},"languages");Y.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");Y.prototype.mediaTypes=o(function(e){return J8(this.request.headers.accept,e)},"mediaTypes");Y.prototype.preferredCharset=Y.prototype.charset;Y.prototype.preferredCharsets=Y.prototype.charsets;Y.prototype.preferredEncoding=Y.prototype.encoding;Y.prototype.preferredEncodings=Y.prototype.encodings;Y.prototype.preferredLanguage=Y.prototype.language;Y.prototype.preferredLanguages=Y.prototype.languages;Y.prototype.preferredMediaType=Y.prototype.mediaType;Y.prototype.preferredMediaTypes=Y.prototype.mediaTypes});var Xw=d((YSe,FL)=>{var LL=dL(),ML=xL(),K8=hi(),BL={shared:!1,ignoreCargoCult:!0},Z8={status:200,headers:{}},vo=o(i=>{let e={method:i.method,url:i.url,headers:{},compress:i.compress};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),kL=o(i=>{let e={status:i.status,headers:{}};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Yw=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:s}){this.entry=e,this.request=vo(t),this.response=kL(r),this.options=s,this.policy=new LL(this.request,this.response,BL),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new LL(vo(e),Z8,BL).storable()}satisfies(e){let t=vo(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new ML(this.request),s=new ML(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(s.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(s.languages())||JSON.stringify(r.encodings())!==JSON.stringify(s.encodings())?!1:this.options.integrity?K8.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=vo(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=vo(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=vo(e),s=kL(t);return!this.policy.revalidatedPolicy(r,s).modified}};FL.exports=Yw});var jL=d((QSe,UL)=>{var Qw=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};UL.exports={NotCachedError:Qw}});var t_=d((tEe,$L)=>{"use strict";var Y8=Tn(),e_=class extends Y8{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};$L.exports=e_});var VL=d((rEe,qL)=>{var{URL:X8,format:Q8}=require("url"),eQ={auth:!1,fragment:!1,search:!0,unicode:!1},tQ=o(i=>{let e=new X8(i.url);return`make-fetch-happen:request-cache:${Q8(e,eQ)}`},"cacheKey");qL.exports=tQ});var i_=d((nEe,HL)=>{"use strict";var{LRUCache:iQ}=hs(),zL=require("dns"),cd=new iQ({max:50}),rQ=o(({family:i=0,hints:e=zL.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:s=300*1e3,lookup:n=zL.lookup})=>({hints:e,lookup:o((a,...c)=>{let u=c.pop(),l=c[0]??{},h={family:i,hints:e,all:t,verbatim:r,...typeof l=="number"?{family:l}:l},f=JSON.stringify({hostname:a,...h});if(cd.has(f)){let p=cd.get(f);return process.nextTick(u,null,...p)}n(a,h,(p,...m)=>p?u(p):(cd.set(f,m,{ttl:s}),u(null,...m)))},"lookup")}),"getOptions");HL.exports={cache:cd,getOptions:rQ}});var r_=d((aEe,WL)=>{"use strict";var sQ=i_(),nQ=o(i=>{let e=parseInt(i.family??"0",10),t=i.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:i.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...i,family:e,keepAlive:t,timeouts:{idle:i.timeout??0,connection:0,response:0,transfer:0,...i.timeouts},...sQ.getOptions({family:e,...i.dns})};return delete r.timeout,r},"normalizeOptions"),GL=o(i=>{let e="",t=Object.entries(i).sort((r,s)=>r[0]-s[0]);for(let[r,s]of t)s==null?s="null":s instanceof URL?s=s.toString():typeof s=="object"&&(s=GL(s)),e+=`${r}:${s}:`;return e},"createKey"),oQ=o(({secureEndpoint:i,...e})=>GL({secureEndpoint:!!i,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:i?!!e.rejectUnauthorized:!1,ca:i?e.ca:null,cert:i?e.cert:null,key:i?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");WL.exports={normalizeOptions:nQ,cacheOptions:oQ}});var KL=d((uEe,JL)=>{var Co=1e3,Ro=Co*60,Ao=Ro*60,Vs=Ao*24,aQ=Vs*7,cQ=Vs*365.25;JL.exports=function(i,e){e=e||{};var t=typeof i;if(t==="string"&&i.length>0)return uQ(i);if(t==="number"&&isFinite(i))return e.long?hQ(i):lQ(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function uQ(i){if(i=String(i),!(i.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*cQ;case"weeks":case"week":case"w":return t*aQ;case"days":case"day":case"d":return t*Vs;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ao;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ro;case"seconds":case"second":case"secs":case"sec":case"s":return t*Co;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}o(uQ,"parse");function lQ(i){var e=Math.abs(i);return e>=Vs?Math.round(i/Vs)+"d":e>=Ao?Math.round(i/Ao)+"h":e>=Ro?Math.round(i/Ro)+"m":e>=Co?Math.round(i/Co)+"s":i+"ms"}o(lQ,"fmtShort");function hQ(i){var e=Math.abs(i);return e>=Vs?ud(i,e,Vs,"day"):e>=Ao?ud(i,e,Ao,"hour"):e>=Ro?ud(i,e,Ro,"minute"):e>=Co?ud(i,e,Co,"second"):i+" ms"}o(hQ,"fmtLong");function ud(i,e,t,r){var s=e>=t*1.5;return Math.round(i/t)+" "+r+(s?"s":"")}o(ud,"plural")});var s_=d((hEe,ZL)=>{function fQ(i){t.debug=t,t.default=t,t.coerce=u,t.disable=a,t.enable=s,t.enabled=c,t.humanize=KL(),t.destroy=l,Object.keys(i).forEach(h=>{t[h]=i[h]}),t.names=[],t.skips=[],t.formatters={};function e(h){let f=0;for(let p=0;p<h.length;p++)f=(f<<5)-f+h.charCodeAt(p),f|=0;return t.colors[Math.abs(f)%t.colors.length]}o(e,"selectColor"),t.selectColor=e;function t(h){let f,p=null,m,y;function g(...S){if(!g.enabled)return;let E=g,_=Number(new Date),b=_-(f||_);E.diff=b,E.prev=f,E.curr=_,f=_,S[0]=t.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let w=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(v,N)=>{if(v==="%%")return"%";w++;let P=t.formatters[N];if(typeof P=="function"){let U=S[w];v=P.call(E,U),S.splice(w,1),w--}return v}),t.formatArgs.call(E,S),(E.log||t.log).apply(E,S)}return o(g,"debug"),g.namespace=h,g.useColors=t.useColors(),g.color=t.selectColor(h),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:o(()=>p!==null?p:(m!==t.namespaces&&(m=t.namespaces,y=t.enabled(h)),y),"get"),set:o(S=>{p=S},"set")}),typeof t.init=="function"&&t.init(g),g}o(t,"createDebug");function r(h,f){let p=t(this.namespace+(typeof f>"u"?":":f)+h);return p.log=this.log,p}o(r,"extend");function s(h){t.save(h),t.namespaces=h,t.names=[],t.skips=[];let f=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?t.skips.push(p.slice(1)):t.names.push(p)}o(s,"enable");function n(h,f){let p=0,m=0,y=-1,g=0;for(;p<h.length;)if(m<f.length&&(f[m]===h[p]||f[m]==="*"))f[m]==="*"?(y=m,g=p,m++):(p++,m++);else if(y!==-1)m=y+1,g++,p=g;else return!1;for(;m<f.length&&f[m]==="*";)m++;return m===f.length}o(n,"matchesTemplate");function a(){let h=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),h}o(a,"disable");function c(h){for(let f of t.skips)if(n(h,f))return!1;for(let f of t.names)if(n(h,f))return!0;return!1}o(c,"enabled");function u(h){return h instanceof Error?h.stack||h.message:h}o(u,"coerce");function l(){}return o(l,"destroy"),t.enable(t.load()),t}o(fQ,"setup");ZL.exports=fQ});var YL=d((rt,ld)=>{rt.formatArgs=pQ;rt.save=mQ;rt.load=gQ;rt.useColors=dQ;rt.storage=yQ();rt.destroy=(()=>{let i=!1;return()=>{i||(i=!0)}})();rt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function dQ(){let i;return!1}o(dQ,"useColors");function pQ(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+ld.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;i.splice(1,0,e,"color: inherit");let t=0,r=0;i[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(r=t))}),i.splice(r,0,e)}o(pQ,"formatArgs");rt.log=console.debug||console.log||(()=>{});function mQ(i){try{i?rt.storage.setItem("debug",i):rt.storage.removeItem("debug")}catch{}}o(mQ,"save");function gQ(){let i;try{i=rt.storage.getItem("debug")||rt.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=void 0),i}o(gQ,"load");function yQ(){try{return}catch{}}o(yQ,"localstorage");ld.exports=s_()(rt);var{formatters:SQ}=ld.exports;SQ.j=function(i){try{return JSON.stringify(i)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var QL=d((pEe,XL)=>{"use strict";XL.exports=(i,e=process.argv)=>{let t=i.startsWith("-")?"":i.length===1?"-":"--",r=e.indexOf(t+i),s=e.indexOf("--");return r!==-1&&(s===-1||r<s)}});var iM=d((mEe,tM)=>{"use strict";var EQ=require("os"),eM=require("tty"),xt=QL(),{env:Te}=process,qr;xt("no-color")||xt("no-colors")||xt("color=false")||xt("color=never")?qr=0:(xt("color")||xt("colors")||xt("color=true")||xt("color=always"))&&(qr=1);"FORCE_COLOR"in Te&&(Te.FORCE_COLOR==="true"?qr=1:Te.FORCE_COLOR==="false"?qr=0:qr=Te.FORCE_COLOR.length===0?1:Math.min(parseInt(Te.FORCE_COLOR,10),3));function n_(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}o(n_,"translateLevel");function o_(i,e){if(qr===0)return 0;if(xt("color=16m")||xt("color=full")||xt("color=truecolor"))return 3;if(xt("color=256"))return 2;if(i&&!e&&qr===void 0)return 0;let t=qr||0;if(Te.TERM==="dumb")return t;if(process.platform==="win32"){let r=EQ.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Te)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Te)||Te.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Te)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Te.TEAMCITY_VERSION)?1:0;if(Te.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Te){let r=parseInt((Te.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Te.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Te.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Te.TERM)||"COLORTERM"in Te?1:t}o(o_,"supportsColor");function wQ(i){let e=o_(i,i&&i.isTTY);return n_(e)}o(wQ,"getSupportLevel");tM.exports={supportsColor:wQ,stdout:n_(o_(!0,eM.isatty(1))),stderr:n_(o_(!0,eM.isatty(2)))}});var sM=d((Ne,fd)=>{var _Q=require("tty"),hd=require("util");Ne.init=AQ;Ne.log=vQ;Ne.formatArgs=IQ;Ne.save=CQ;Ne.load=RQ;Ne.useColors=bQ;Ne.destroy=hd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ne.colors=[6,2,3,4,5,1];try{let i=iM();i&&(i.stderr||i).level>=2&&(Ne.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Ne.inspectOpts=Object.keys(process.env).filter(i=>/^debug_/i.test(i)).reduce((i,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,n)=>n.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),i[t]=r,i},{});function bQ(){return"colors"in Ne.inspectOpts?!!Ne.inspectOpts.colors:_Q.isatty(process.stderr.fd)}o(bQ,"useColors");function IQ(i){let{namespace:e,useColors:t}=this;if(t){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),n=` ${s};1m${e} \x1B[0m`;i[0]=n+i[0].split(`
|
|
44
|
-
`).
|
|
45
|
-
`+n),i.push(s+"m+"+fd.exports.humanize(this.diff)+"\x1B[0m")}else i[0]=OQ()+e+" "+i[0]}o(IQ,"formatArgs");function OQ(){return Ne.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(OQ,"getDate");function vQ(...i){return process.stderr.write(hd.formatWithOptions(Ne.inspectOpts,...i)+`
|
|
46
|
-
`)}o(vQ,"log");function CQ(i){i?process.env.DEBUG=i:delete void 0}o(CQ,"save");function RQ(){}o(RQ,"load");function AQ(i){i.inspectOpts={};let e=Object.keys(Ne.inspectOpts);for(let t=0;t<e.length;t++)i.inspectOpts[e[t]]=Ne.inspectOpts[e[t]]}o(AQ,"init");fd.exports=s_()(Ne);var{formatters:rM}=fd.exports;rM.o=function(i){return this.inspectOpts.colors=this.useColors,hd.inspect(i,this.inspectOpts).split(`
|
|
47
|
-
`).map(e=>e.trim()).join(" ")};rM.O=function(i){return this.inspectOpts.colors=this.useColors,hd.inspect(i,this.inspectOpts)}});var zs=d((SEe,a_)=>{typeof process>"u"||process.type==="renderer"||process.__nwjs?a_.exports=YL():a_.exports=sM()});var aM=d(st=>{"use strict";var TQ=st&&st.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),NQ=st&&st.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),nM=st&&st.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&TQ(e,i,t);return NQ(e,i),e};Object.defineProperty(st,"__esModule",{value:!0});st.req=st.json=st.toBuffer=void 0;var PQ=nM(require("http")),DQ=nM(require("https"));async function oM(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(oM,"toBuffer");st.toBuffer=oM;async function xQ(i){let t=(await oM(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let s=r;throw s.message+=` (input: ${t})`,s}}o(xQ,"json");st.json=xQ;function LQ(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?DQ:PQ).request(i,e),s=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=s.then.bind(s),r}o(LQ,"req");st.req=LQ});var nu=d(St=>{"use strict";var uM=St&&St.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),MQ=St&&St.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lM=St&&St.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&uM(e,i,t);return MQ(e,i),e},BQ=St&&St.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uM(e,i,t)};Object.defineProperty(St,"__esModule",{value:!0});St.Agent=void 0;var kQ=lM(require("net")),cM=lM(require("http")),FQ=require("https");BQ(aM(),St);var vi=Symbol("AgentBaseInternalState"),c_=class extends cM.Agent{static{o(this,"Agent")}constructor(e){super(e),this[vi]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
48
|
-
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new kQ.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],s=r.indexOf(t);s!==-1&&(r.splice(s,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?FQ.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(s),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,s)).then(c=>{if(this.decrementSockets(n,a),c instanceof cM.Agent)try{return c.addRequest(e,s)}catch(u){return r(u)}this[vi].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[vi].currentSocket;if(this[vi].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[vi].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[vi]&&(this[vi].defaultPort=e)}get protocol(){return this[vi].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[vi]&&(this[vi].protocol=e)}};St.Agent=c_});var dM=d(Lt=>{"use strict";var UQ=Lt&&Lt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),jQ=Lt&&Lt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),fM=Lt&&Lt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&UQ(e,i,t);return jQ(e,i),e},$Q=Lt&&Lt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.HttpProxyAgent=void 0;var qQ=fM(require("net")),VQ=fM(require("tls")),zQ=$Q(zs()),HQ=require("events"),GQ=nu(),hM=require("url"),To=(0,zQ.default)("http-proxy-agent"),dd=class extends GQ.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new hM.URL(e):e,this.proxyHeaders=t?.headers??{},To("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?WQ(t,"headers"):null,host:r,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${s}//${n}`,c=new hM.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let l of Object.keys(u)){let h=u[l];h&&e.setHeader(l,h)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,s;To("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(To("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r
|
|
44
|
+
More info here: ${D9}`),L9(i,t,r,n)):(t.body.on("end",()=>jx(i,t,r,n)),n.ignoreBody?(t.body.resume(),new C9(null,t)):t)),"checkResponse");$x.exports=x9;function jx(i,e,t){let r=Date.now()-t,s=e.headers.get("x-fetch-attempts"),n=s&&s>1?` attempt #${s}`:"",a=e.headers.get("x-local-cache-status"),c=a?` (cache ${a})`:"",u=P9(e.url);a==="hit"?Qf.http("cache",`${u} ${r}ms${n}${c}`):Qf.http("fetch",`${i.toUpperCase()} ${e.status} ${u} ${r}ms${n}${c}`)}o(jx,"logRequest");function L9(i,e,t,r){return e.buffer().catch(()=>null).then(s=>{let n=s;try{n=JSON.parse(s.toString("utf8"))}catch{}if(e.status===401&&e.headers.get("www-authenticate")){let a=e.headers.get("www-authenticate").split(/,\s*/).map(c=>c.toLowerCase());throw a.indexOf("ipaddress")!==-1?new Jc.HttpErrorAuthIPAddress(i,e,n,r.spec):a.indexOf("otp")!==-1?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorAuthUnknown(i,e,n,r.spec)}else throw e.status===401&&s!=null&&/one-time pass/.test(s.toString("utf8"))?new Jc.HttpErrorAuthOTP(i,e,n,r.spec):new Jc.HttpErrorGeneral(i,e,n,r.spec)})}o(L9,"checkErrors")});var Wx=d((qye,Gx)=>{"use strict";var M9=require("fs"),B9=Un(),{URL:Dw}=require("url"),Vx=o((i,e)=>{let t=new Dw(i),r=`//${t.host}${t.pathname}`;for(;r.length>2;){let s=k9(r,e);if(s)return{regKey:r,authKey:s};r=r.replace(/([^/]+|\/)$/,"")}return{regKey:!1,authKey:null}},"regFromURI"),k9=o((i,e)=>e[`${i}:_authToken`]?"_authToken":e[`${i}:_auth`]?"_auth":e[`${i}:username`]&&e[`${i}:_password`]?"username":e[`${i}:certfile`]&&e[`${i}:keyfile`]?"certfile":!1,"hasAuth"),F9=o((i,e)=>{let t=new Dw(i),r=new Dw(e);return t.host===r.host},"sameHost"),U9=o(i=>{let{spec:e}=i,{scope:t,subSpec:r}=e?B9(e):{},s=r&&r.scope,n=r?s:t;return n&&i[`${n}:registry`]||i.registry},"getRegistry"),zx=o(i=>{try{return M9.readFileSync(i,"utf8")}catch(e){if(e.code!=="ENOENT")throw e;return null}},"maybeReadFile"),Hx=o((i,e={})=>{let{forceAuth:t}=e;if(!i)throw new Error("URI is required");let{regKey:r,authKey:s}=Vx(i,t||e);if(t&&!r)return new Kc({regKey:!1,authKey:null,scopeAuthKey:null,token:t._authToken||t.token,username:t.username,password:t._password||t.password,auth:t._auth||t.auth,certfile:t.certfile,keyfile:t.keyfile});if(!r){let f=U9(e);if(f&&i!==f&&F9(i,f))return Hx(f,e);if(f!==e.registry){let{regKey:p,authKey:m}=Vx(f,e);return new Kc({scopeAuthKey:p,regKey:p,authKey:m})}}let{[`${r}:_authToken`]:n,[`${r}:username`]:a,[`${r}:_password`]:c,[`${r}:_auth`]:u,[`${r}:certfile`]:l,[`${r}:keyfile`]:h}=e;return new Kc({scopeAuthKey:null,regKey:r,authKey:s,token:n,auth:u,username:a,password:c,certfile:l,keyfile:h})},"getAuth"),Kc=class{static{o(this,"Auth")}constructor({token:e,auth:t,username:r,password:s,scopeAuthKey:n,certfile:a,keyfile:c,regKey:u,authKey:l}){if(this.scopeAuthKey=n,this.regKey=u,this.authKey=l,this.token=null,this.auth=null,this.isBasicAuth=!1,this.cert=null,this.key=null,e)this.token=e;else if(t)this.auth=t;else if(r&&s){let h=Buffer.from(s,"base64").toString("utf8");this.auth=Buffer.from(`${r}:${h}`,"utf8").toString("base64"),this.isBasicAuth=!0}if(a&&c){let h=zx(a,"utf-8"),f=zx(c,"utf-8");h&&f&&(this.cert=h,this.key=f)}}};Gx.exports=Hx});var Kx=d((zye,Jx)=>{var j9=require("dns"),$9=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"],q9=o(i=>{let{strictSSL:e,...t}={...i};if(t.method=t.method?t.method.toUpperCase():"GET",e==null?t.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0":t.rejectUnauthorized=e!==!1,!t.retry)t.retry={retries:0};else if(typeof t.retry=="string"){let r=parseInt(t.retry,10);isFinite(r)?t.retry={retries:r}:t.retry={retries:0}}else typeof t.retry=="number"?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};return t.dns={ttl:300*1e3,lookup:j9.lookup,...t.dns},t.cache=t.cache||"default",t.cache==="default"&&Object.keys(t.headers||{}).some(s=>$9.includes(s.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t},"configureOptions");Jx.exports=q9});var Yx=d((Wye,Zx)=>{"use strict";var V9=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),z9=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),H9=new Set([500,502,503,504]),G9={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},W9={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function or(i){let e=parseInt(i,10);return isFinite(e)?e:0}o(or,"toNumberOrZero");function J9(i){return i?H9.has(i.status):!0}o(J9,"isErrorResponse");function xw(i){let e={};if(!i)return e;let t=i.trim().split(/,/);for(let r of t){let[s,n]=r.split(/=/,2);e[s.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}o(xw,"parseCacheControl");function K9(i){let e=[];for(let t in i){let r=i[t];e.push(r===!0?t:t+"="+r)}if(e.length)return e.join(", ")}o(K9,"formatCacheControl");Zx.exports=class{static{o(this,"CachePolicy")}constructor(e,t,{shared:r,cacheHeuristic:s,immutableMinTimeToLive:n,ignoreCargoCult:a,_fromObject:c}={}){if(c){this._fromObject(c);return}if(!t||!t.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=r!==!1,this._ignoreCargoCult=!!a,this._cacheHeuristic=s!==void 0?s:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in t?t.status:200,this._resHeaders=t.headers,this._rescc=xw(t.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=t.headers.vary?e.headers:null,this._reqcc=xw(e.headers["cache-control"]),this._ignoreCargoCult&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":K9(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&z9.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||V9.has(this._status)))}_hasExplicitExpiration(){return!!(this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires)}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){return!this.evaluateRequest(e).revalidation}_evaluateRequestHitResult(e){return{response:{headers:this.responseHeaders()},revalidation:e}}_evaluateRequestRevalidation(e,t){return{synchronous:t,headers:this.revalidationHeaders(e)}}_evaluateRequestMissResult(e){return{response:void 0,revalidation:this._evaluateRequestRevalidation(e,!0)}}evaluateRequest(e){if(this._assertRequestHasHeaders(e),this._rescc["must-revalidate"])return this._evaluateRequestMissResult(e);if(!this._requestMatches(e,!1))return this._evaluateRequestMissResult(e);let t=xw(e.headers["cache-control"]);return t["no-cache"]||/no-cache/.test(e.headers.pragma)?this._evaluateRequestMissResult(e):t["max-age"]&&this.age()>or(t["max-age"])?this._evaluateRequestMissResult(e):t["min-fresh"]&&this.maxAge()-this.age()<or(t["min-fresh"])?this._evaluateRequestMissResult(e):this.stale()?"max-stale"in t&&(t["max-stale"]===!0||t["max-stale"]>this.age()-this.maxAge())?this._evaluateRequestHitResult(void 0):this.useStaleWhileRevalidate()?this._evaluateRequestHitResult(this._evaluateRequestRevalidation(e,!1)):this._evaluateRequestMissResult(e):this._evaluateRequestHitResult(void 0)}_requestMatches(e,t){return!!((!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&e.method==="HEAD")&&this._varyMatches(e))}_allowsStoringAuthenticated(){return!!(this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"])}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let r of t)if(e.headers[r]!==this._reqHeaders[r])return!1;return!0}_copyWithoutHopByHopHeaders(e){let t={};for(let r in e)G9[r]||(t[r]=e[r]);if(e.connection){let r=e.connection.trim().split(/\s*,\s*/);for(let s of r)delete t[s]}if(t.warning){let r=t.warning.split(/,/).filter(s=>!/^\s*1[0-9][0-9]/.test(s));r.length?t.warning=r.join(",").trim():delete t.warning}return t}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),t=this.age();return t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(t)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return or(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return or(this._rescc["s-maxage"])}if(this._rescc["max-age"])return or(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,t=this.date();if(this._resHeaders.expires){let r=Date.parse(this._resHeaders.expires);return Number.isNaN(r)||r<t?0:Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){let r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r)return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),t=e+or(this._rescc["stale-if-error"]),r=e+or(this._rescc["stale-while-revalidate"]);return Math.round(Math.max(0,e,t,r)*1e3)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+or(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){let e=or(this._rescc["stale-while-revalidate"]);return e>0&&this.maxAge()+e>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._ignoreCargoCult=!!e.icc,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,icc:this._ignoreCargoCult,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let t=this._copyWithoutHopByHopHeaders(e.headers);if(delete t["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete t["if-none-match"],delete t["if-modified-since"],t;if(this._resHeaders.etag&&(t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete t["if-modified-since"],t["if-none-match"]){let s=t["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));s.length?t["if-none-match"]=s.join(",").trim():delete t["if-none-match"]}}else this._resHeaders["last-modified"]&&!t["if-modified-since"]&&(t["if-modified-since"]=this._resHeaders["last-modified"]);return t}revalidatedPolicy(e,t){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&J9(t))return{policy:this,modified:!1,matches:!0};if(!t||!t.headers)throw Error("Response headers missing");let r=!1;t.status!==void 0&&t.status!=304?r=!1:t.headers.etag&&!/^\s*W\//.test(t.headers.etag)?r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag:this._resHeaders.etag&&t.headers.etag?r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?r=this._resHeaders["last-modified"]===t.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]&&(r=!0);let s={shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl,ignoreCargoCult:this._ignoreCargoCult};if(!r)return{policy:new this.constructor(e,t,s),modified:t.status!=304,matches:!1};let n={};for(let c in this._resHeaders)n[c]=c in t.headers&&!W9[c]?t.headers[c]:this._resHeaders[c];let a=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,a,s),modified:!1,matches:!0}}}});var tL=d((Kye,Lw)=>{"use strict";Lw.exports=eL;Lw.exports.preferredCharsets=eL;var Z9=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function Y9(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=X9(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(Y9,"parseAcceptCharset");function X9(i,e){var t=Z9.exec(i);if(!t)return null;var r=t[1],s=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){s=parseFloat(c[1]);break}}return{charset:r,q:s,i:e}}o(X9,"parseCharset");function Q9(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=e8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(Q9,"getCharsetPriority");function e8(i,e,t){var r=0;if(e.charset.toLowerCase()===i.toLowerCase())r|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:r}}o(e8,"specify");function eL(i,e){var t=Y9(i===void 0?"*":i||"");if(!e)return t.filter(Qx).sort(Xx).map(t8);var r=e.map(o(function(n,a){return Q9(n,t,a)},"getPriority"));return r.filter(Qx).sort(Xx).map(o(function(n){return e[r.indexOf(n)]},"getCharset"))}o(eL,"preferredCharsets");function Xx(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(Xx,"compareSpecs");function t8(i){return i.charset}o(t8,"getFullCharset");function Qx(i){return i.q>0}o(Qx,"isQuality")});var nL=d((Yye,Mw)=>{"use strict";Mw.exports=sL;Mw.exports.preferredEncodings=sL;var i8=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r8(i){for(var e=i.split(","),t=!1,r=1,s=0,n=0;s<e.length;s++){var a=s8(e[s].trim(),s);a&&(e[n++]=a,t=t||rL("identity",a),r=Math.min(r,a.q||1))}return t||(e[n++]={encoding:"identity",q:r,i:s}),e.length=n,e}o(r8,"parseAcceptEncoding");function s8(i,e){var t=i8.exec(i);if(!t)return null;var r=t[1],s=1;if(t[2])for(var n=t[2].split(";"),a=0;a<n.length;a++){var c=n[a].trim().split("=");if(c[0]==="q"){s=parseFloat(c[1]);break}}return{encoding:r,q:s,i:e}}o(s8,"parseEncoding");function n8(i,e,t){for(var r={encoding:i,o:-1,q:0,s:0},s=0;s<e.length;s++){var n=rL(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(n8,"getEncodingPriority");function rL(i,e,t){var r=0;if(e.encoding.toLowerCase()===i.toLowerCase())r|=1;else if(e.encoding!=="*")return null;return{encoding:i,i:t,o:e.i,q:e.q,s:r}}o(rL,"specify");function sL(i,e,t){var r=r8(i||""),s=t?o(function(c,u){if(c.q!==u.q)return u.q-c.q;var l=t.indexOf(c.encoding),h=t.indexOf(u.encoding);return l===-1&&h===-1?u.s-c.s||c.o-u.o||c.i-u.i:l!==-1&&h!==-1?l-h:l===-1?1:-1},"comparator"):o8;if(!e)return r.filter(iL).sort(s).map(a8);var n=e.map(o(function(c,u){return n8(c,r,u)},"getPriority"));return n.filter(iL).sort(s).map(o(function(c){return e[n.indexOf(c)]},"getEncoding"))}o(sL,"preferredEncodings");function o8(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i}o(o8,"compareSpecs");function a8(i){return i.encoding}o(a8,"getFullEncoding");function iL(i){return i.q>0}o(iL,"isQuality")});var lL=d((Qye,Bw)=>{"use strict";Bw.exports=uL;Bw.exports.preferredLanguages=uL;var c8=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function u8(i){for(var e=i.split(","),t=0,r=0;t<e.length;t++){var s=cL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(u8,"parseAcceptLanguage");function cL(i,e){var t=c8.exec(i);if(!t)return null;var r=t[1],s=t[2],n=r;s&&(n+="-"+s);var a=1;if(t[3])for(var c=t[3].split(";"),u=0;u<c.length;u++){var l=c[u].split("=");l[0]==="q"&&(a=parseFloat(l[1]))}return{prefix:r,suffix:s,q:a,i:e,full:n}}o(cL,"parseLanguage");function l8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=h8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(l8,"getLanguagePriority");function h8(i,e,t){var r=cL(i);if(!r)return null;var s=0;if(e.full.toLowerCase()===r.full.toLowerCase())s|=4;else if(e.prefix.toLowerCase()===r.full.toLowerCase())s|=2;else if(e.full.toLowerCase()===r.prefix.toLowerCase())s|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s}}o(h8,"specify");function uL(i,e){var t=u8(i===void 0?"*":i||"");if(!e)return t.filter(aL).sort(oL).map(f8);var r=e.map(o(function(n,a){return l8(n,t,a)},"getPriority"));return r.filter(aL).sort(oL).map(o(function(n){return e[r.indexOf(n)]},"getLanguage"))}o(uL,"preferredLanguages");function oL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(oL,"compareSpecs");function f8(i){return i.full}o(f8,"getFullLanguage");function aL(i){return i.q>0}o(aL,"isQuality")});var gL=d((tSe,kw)=>{"use strict";kw.exports=pL;kw.exports.preferredMediaTypes=pL;var d8=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function p8(i){for(var e=E8(i),t=0,r=0;t<e.length;t++){var s=dL(e[t].trim(),t);s&&(e[r++]=s)}return e.length=r,e}o(p8,"parseAccept");function dL(i,e){var t=d8.exec(i);if(!t)return null;var r=Object.create(null),s=1,n=t[2],a=t[1];if(t[3])for(var c=w8(t[3]).map(S8),u=0;u<c.length;u++){var l=c[u],h=l[0].toLowerCase(),f=l[1],p=f&&f[0]==='"'&&f[f.length-1]==='"'?f.slice(1,-1):f;if(h==="q"){s=parseFloat(p);break}r[h]=p}return{type:a,subtype:n,params:r,q:s,i:e}}o(dL,"parseMediaType");function m8(i,e,t){for(var r={o:-1,q:0,s:0},s=0;s<e.length;s++){var n=g8(i,e[s],t);n&&(r.s-n.s||r.q-n.q||r.o-n.o)<0&&(r=n)}return r}o(m8,"getMediaTypePriority");function g8(i,e,t){var r=dL(i),s=0;if(!r)return null;if(e.type.toLowerCase()==r.type.toLowerCase())s|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==r.subtype.toLowerCase())s|=2;else if(e.subtype!="*")return null;var n=Object.keys(e.params);if(n.length>0)if(n.every(function(a){return e.params[a]=="*"||(e.params[a]||"").toLowerCase()==(r.params[a]||"").toLowerCase()}))s|=1;else return null;return{i:t,o:e.i,q:e.q,s}}o(g8,"specify");function pL(i,e){var t=p8(i===void 0?"*/*":i||"");if(!e)return t.filter(fL).sort(hL).map(y8);var r=e.map(o(function(n,a){return m8(n,t,a)},"getPriority"));return r.filter(fL).sort(hL).map(o(function(n){return e[r.indexOf(n)]},"getType"))}o(pL,"preferredMediaTypes");function hL(i,e){return e.q-i.q||e.s-i.s||i.o-e.o||i.i-e.i||0}o(hL,"compareSpecs");function y8(i){return i.type+"/"+i.subtype}o(y8,"getFullType");function fL(i){return i.q>0}o(fL,"isQuality");function mL(i){for(var e=0,t=0;(t=i.indexOf('"',t))!==-1;)e++,t++;return e}o(mL,"quoteCount");function S8(i){var e=i.indexOf("="),t,r;return e===-1?t=i:(t=i.slice(0,e),r=i.slice(e+1)),[t,r]}o(S8,"splitKeyValuePair");function E8(i){for(var e=i.split(","),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=","+e[t];return e.length=r+1,e}o(E8,"splitMediaTypes");function w8(i){for(var e=i.split(";"),t=1,r=0;t<e.length;t++)mL(e[r])%2==0?e[++r]=e[t]:e[r]+=";"+e[t];e.length=r+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}o(w8,"splitParameters")});var yL=d((rSe,Fw)=>{"use strict";var _8=tL(),b8=nL(),I8=lL(),O8=gL();Fw.exports=Y;Fw.exports.Negotiator=Y;function Y(i){if(!(this instanceof Y))return new Y(i);this.request=i}o(Y,"Negotiator");Y.prototype.charset=o(function(e){var t=this.charsets(e);return t&&t[0]},"charset");Y.prototype.charsets=o(function(e){return _8(this.request.headers["accept-charset"],e)},"charsets");Y.prototype.encoding=o(function(e,t){var r=this.encodings(e,t);return r&&r[0]},"encoding");Y.prototype.encodings=o(function(e,t){var r=t||{};return b8(this.request.headers["accept-encoding"],e,r.preferred)},"encodings");Y.prototype.language=o(function(e){var t=this.languages(e);return t&&t[0]},"language");Y.prototype.languages=o(function(e){return I8(this.request.headers["accept-language"],e)},"languages");Y.prototype.mediaType=o(function(e){var t=this.mediaTypes(e);return t&&t[0]},"mediaType");Y.prototype.mediaTypes=o(function(e){return O8(this.request.headers.accept,e)},"mediaTypes");Y.prototype.preferredCharset=Y.prototype.charset;Y.prototype.preferredCharsets=Y.prototype.charsets;Y.prototype.preferredEncoding=Y.prototype.encoding;Y.prototype.preferredEncodings=Y.prototype.encodings;Y.prototype.preferredLanguage=Y.prototype.language;Y.prototype.preferredLanguages=Y.prototype.languages;Y.prototype.preferredMediaType=Y.prototype.mediaType;Y.prototype.preferredMediaTypes=Y.prototype.mediaTypes});var jw=d((nSe,bL)=>{var SL=Yx(),EL=yL(),v8=ai(),wL={shared:!1,ignoreCargoCult:!0},R8={status:200,headers:{}},Eo=o(i=>{let e={method:i.method,url:i.url,headers:{},compress:i.compress};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"requestObject"),_L=o(i=>{let e={status:i.status,headers:{}};return i.headers.forEach((t,r)=>{e.headers[r]=t}),e},"responseObject"),Uw=class{static{o(this,"CachePolicy")}constructor({entry:e,request:t,response:r,options:s}){this.entry=e,this.request=Eo(t),this.response=_L(r),this.options=s,this.policy=new SL(this.request,this.response,wL),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(e,t){return!t.cachePath||t.cache==="no-store"||!["GET","HEAD"].includes(e.method)?!1:new SL(Eo(e),R8,wL).storable()}satisfies(e){let t=Eo(e);if(this.request.headers.host!==t.headers.host||this.request.compress!==t.compress)return!1;let r=new EL(this.request),s=new EL(t);return JSON.stringify(r.mediaTypes())!==JSON.stringify(s.mediaTypes())||JSON.stringify(r.languages())!==JSON.stringify(s.languages())||JSON.stringify(r.encodings())!==JSON.stringify(s.encodings())?!1:this.options.integrity?v8.parse(this.options.integrity).match(this.entry.integrity):!0}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(e){let t=Eo(e);return t.method="GET",!this.policy.satisfiesWithoutRevalidation(t)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(e){let t=Eo(e);return this.policy.revalidationHeaders(t)}revalidated(e,t){let r=Eo(e),s=_L(t);return!this.policy.revalidatedPolicy(r,s).modified}};bL.exports=Uw});var OL=d((aSe,IL)=>{var $w=class extends Error{static{o(this,"NotCachedError")}constructor(e){super(`request to ${e} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}};IL.exports={NotCachedError:$w}});var Vw=d((uSe,vL)=>{"use strict";var A8=In(),qw=class extends A8{static{o(this,"CachingMinipassPipeline")}#e=[];#t=new Map;constructor(e,...t){super(),this.#e=e.events,t.length&&this.push(...t)}on(e,t){return this.#e.includes(e)&&this.#t.has(e)?t(...this.#t.get(e)):super.on(e,t)}emit(e,...t){return this.#e.includes(e)&&this.#t.set(e,t),super.emit(e,...t)}};vL.exports=qw});var AL=d((hSe,RL)=>{var{URL:T8,format:C8}=require("url"),N8={auth:!1,fragment:!1,search:!0,unicode:!1},P8=o(i=>{let e=new T8(i.url);return`make-fetch-happen:request-cache:${C8(e,N8)}`},"cacheKey");RL.exports=P8});var zw=d((dSe,CL)=>{"use strict";var{LRUCache:D8}=os(),TL=require("dns"),ed=new D8({max:50}),x8=o(({family:i=0,hints:e=TL.ADDRCONFIG,all:t=!1,verbatim:r=void 0,ttl:s=300*1e3,lookup:n=TL.lookup})=>({hints:e,lookup:o((a,...c)=>{let u=c.pop(),l=c[0]??{},h={family:i,hints:e,all:t,verbatim:r,...typeof l=="number"?{family:l}:l},f=JSON.stringify({hostname:a,...h});if(ed.has(f)){let p=ed.get(f);return process.nextTick(u,null,...p)}n(a,h,(p,...m)=>p?u(p):(ed.set(f,m,{ttl:s}),u(null,...m)))},"lookup")}),"getOptions");CL.exports={cache:ed,getOptions:x8}});var Hw=d((mSe,PL)=>{"use strict";var L8=zw(),M8=o(i=>{let e=parseInt(i.family??"0",10),t=i.keepAlive??!0,r={keepAliveMsecs:t?1e3:void 0,maxSockets:i.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...i,family:e,keepAlive:t,timeouts:{idle:i.timeout??0,connection:0,response:0,transfer:0,...i.timeouts},...L8.getOptions({family:e,...i.dns})};return delete r.timeout,r},"normalizeOptions"),NL=o(i=>{let e="",t=Object.entries(i).sort((r,s)=>r[0]-s[0]);for(let[r,s]of t)s==null?s="null":s instanceof URL?s=s.toString():typeof s=="object"&&(s=NL(s)),e+=`${r}:${s}:`;return e},"createKey"),B8=o(({secureEndpoint:i,...e})=>NL({secureEndpoint:!!i,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:i?!!e.rejectUnauthorized:!1,ca:i?e.ca:null,cert:i?e.cert:null,key:i?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy}),"cacheOptions");PL.exports={normalizeOptions:M8,cacheOptions:B8}});var Fs=d((ySe,DL)=>{"use strict";function Zc(){return o(function(){},"noop")}o(Zc,"debug");Zc.enabled=!1;Zc.names=[];Zc.skips=[];Zc.formatters={};DL.exports=Zc});var ML=d(tt=>{"use strict";var k8=tt&&tt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),F8=tt&&tt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),xL=tt&&tt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&k8(e,i,t);return F8(e,i),e};Object.defineProperty(tt,"__esModule",{value:!0});tt.req=tt.json=tt.toBuffer=void 0;var U8=xL(require("http")),j8=xL(require("https"));async function LL(i){let e=0,t=[];for await(let r of i)e+=r.length,t.push(r);return Buffer.concat(t,e)}o(LL,"toBuffer");tt.toBuffer=LL;async function $8(i){let t=(await LL(i)).toString("utf8");try{return JSON.parse(t)}catch(r){let s=r;throw s.message+=` (input: ${t})`,s}}o($8,"json");tt.json=$8;function q8(i,e={}){let r=((typeof i=="string"?i:i.href).startsWith("https:")?j8:U8).request(i,e),s=new Promise((n,a)=>{r.once("response",n).once("error",a).end()});return r.then=s.then.bind(s),r}o(q8,"req");tt.req=q8});var Yc=d(mt=>{"use strict";var kL=mt&&mt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),V8=mt&&mt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),FL=mt&&mt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&kL(e,i,t);return V8(e,i),e},z8=mt&&mt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kL(e,i,t)};Object.defineProperty(mt,"__esModule",{value:!0});mt.Agent=void 0;var H8=FL(require("net")),BL=FL(require("http")),G8=require("https");z8(ML(),mt);var _i=Symbol("AgentBaseInternalState"),Gw=class extends BL.Agent{static{o(this,"Agent")}constructor(e){super(e),this[_i]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
45
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new H8.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let r=this.sockets[e],s=r.indexOf(t);s!==-1&&(r.splice(s,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?G8.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,r){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},n=this.getName(s),a=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(e,s)).then(c=>{if(this.decrementSockets(n,a),c instanceof BL.Agent)try{return c.addRequest(e,s)}catch(u){return r(u)}this[_i].currentSocket=c,super.createSocket(e,t,r)},c=>{this.decrementSockets(n,a),r(c)})}createConnection(){let e=this[_i].currentSocket;if(this[_i].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[_i].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[_i]&&(this[_i].defaultPort=e)}get protocol(){return this[_i].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[_i]&&(this[_i].protocol=e)}};mt.Agent=Gw});var $L=d(Nt=>{"use strict";var W8=Nt&&Nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),J8=Nt&&Nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jL=Nt&&Nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&W8(e,i,t);return J8(e,i),e},K8=Nt&&Nt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.HttpProxyAgent=void 0;var Z8=jL(require("net")),Y8=jL(require("tls")),X8=K8(Fs()),Q8=require("events"),eQ=Yc(),UL=require("url"),wo=(0,X8.default)("http-proxy-agent"),td=class extends eQ.Agent{static{o(this,"HttpProxyAgent")}constructor(e,t){super(t),this.proxy=typeof e=="string"?new UL.URL(e):e,this.proxyHeaders=t?.headers??{},wo("Creating new HttpProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...t?tQ(t,"headers"):null,host:r,port:s}}addRequest(e,t){e._header=null,this.setRequestProps(e,t),super.addRequest(e,t)}setRequestProps(e,t){let{proxy:r}=this,s=t.secureEndpoint?"https:":"http:",n=e.getHeader("host")||"localhost",a=`${s}//${n}`,c=new UL.URL(e.path,a);t.port!==80&&(c.port=String(t.port)),e.path=String(c);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let l of Object.keys(u)){let h=u[l];h&&e.setHeader(l,h)}}async connect(e,t){e._header=null,e.path.includes("://")||this.setRequestProps(e,t);let r,s;wo("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(wo("Patching connection write() output buffer with updated header"),r=e.outputData[0].data,s=r.indexOf(`\r
|
|
49
46
|
\r
|
|
50
|
-
`)+4,e.outputData[0].data=e._header+r.substring(s),
|
|
47
|
+
`)+4,e.outputData[0].data=e._header+r.substring(s),wo("Output buffer: %o",e.outputData[0].data));let n;return this.proxy.protocol==="https:"?(wo("Creating `tls.Socket`: %o",this.connectOpts),n=Y8.connect(this.connectOpts)):(wo("Creating `net.Socket`: %o",this.connectOpts),n=Z8.connect(this.connectOpts)),await(0,Q8.once)(n,"connect"),n}};td.protocols=["http","https"];Nt.HttpProxyAgent=td;function tQ(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(tQ,"omit")});var qL=d(_o=>{"use strict";var iQ=_o&&_o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(_o,"__esModule",{value:!0});_o.parseProxyResponse=void 0;var rQ=iQ(Fs()),id=(0,rQ.default)("https-proxy-agent:parse-proxy-response");function sQ(i){return new Promise((e,t)=>{let r=0,s=[];function n(){let h=i.read();h?l(h):i.once("readable",n)}o(n,"read");function a(){i.removeListener("end",c),i.removeListener("error",u),i.removeListener("readable",n)}o(a,"cleanup");function c(){a(),id("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}o(c,"onend");function u(h){a(),id("onerror %o",h),t(h)}o(u,"onerror");function l(h){s.push(h),r+=h.length;let f=Buffer.concat(s,r),p=f.indexOf(`\r
|
|
51
48
|
\r
|
|
52
|
-
`);if(p===-1){
|
|
53
|
-
`),y=m.shift();if(!y)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let g=y.split(" "),S=+g[1],E=g.slice(2).join(" "),_={};for(let b of m){if(!b)continue;let w=b.indexOf(":");if(w===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let I=b.slice(0,w).toLowerCase(),v=b.slice(w+1).trimStart(),N=_[I];typeof N=="string"?_[I]=[N,v]:Array.isArray(N)?N.push(v):_[I]=v}
|
|
49
|
+
`);if(p===-1){id("have not received end of HTTP headers yet..."),n();return}let m=f.slice(0,p).toString("ascii").split(`\r
|
|
50
|
+
`),y=m.shift();if(!y)return i.destroy(),t(new Error("No header received from proxy CONNECT response"));let g=y.split(" "),S=+g[1],E=g.slice(2).join(" "),_={};for(let b of m){if(!b)continue;let w=b.indexOf(":");if(w===-1)return i.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let I=b.slice(0,w).toLowerCase(),v=b.slice(w+1).trimStart(),N=_[I];typeof N=="string"?_[I]=[N,v]:Array.isArray(N)?N.push(v):_[I]=v}id("got proxy server response: %o %o",y,_),a(),e({connect:{statusCode:S,statusText:E,headers:_},buffered:f})}o(l,"ondata"),i.on("error",u),i.on("end",c),n()})}o(sQ,"parseProxyResponse");_o.parseProxyResponse=sQ});var JL=d(Pt=>{"use strict";var nQ=Pt&&Pt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),oQ=Pt&&Pt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),GL=Pt&&Pt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&nQ(e,i,t);return oQ(e,i),e},WL=Pt&&Pt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.HttpsProxyAgent=void 0;var rd=GL(require("net")),VL=GL(require("tls")),aQ=WL(require("assert")),cQ=WL(Fs()),uQ=Yc(),lQ=require("url"),hQ=qL(),Xc=(0,cQ.default)("https-proxy-agent"),zL=o(i=>i.servername===void 0&&i.host&&!rd.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost"),sd=class extends uQ.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new lQ.URL(e):e,this.proxyHeaders=t?.headers??{},Xc("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?HL(t,"headers"):null,host:r,port:s}}async connect(e,t){let{proxy:r}=this;if(!t.host)throw new TypeError('No "host" provided');let s;r.protocol==="https:"?(Xc("Creating `tls.Socket`: %o",this.connectOpts),s=VL.connect(zL(this.connectOpts))):(Xc("Creating `net.Socket`: %o",this.connectOpts),s=rd.connect(this.connectOpts));let n=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},a=rd.isIPv6(t.host)?`[${t.host}]`:t.host,c=`CONNECT ${a}:${t.port} HTTP/1.1\r
|
|
54
51
|
`;if(r.username||r.password){let p=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(p).toString("base64")}`}n.Host=`${a}:${t.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let p of Object.keys(n))c+=`${p}: ${n[p]}\r
|
|
55
|
-
`;let u=(0,
|
|
56
|
-
`);let{connect:l,buffered:h}=await u;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",s7),t.secureEndpoint?(ou("Upgrading socket connection to TLS"),mM.connect({...yM(gM(t),"host","path","port"),socket:s})):s;s.destroy();let f=new md.Socket({writable:!1});return f.readable=!0,e.once("socket",p=>{ou("Replaying proxy buffer for failed request"),(0,QQ.default)(p.listenerCount("data")>0),p.push(h),p.push(null)}),f}};gd.protocols=["http","https"];Mt.HttpsProxyAgent=gd;function s7(i){i.resume()}o(s7,"resume");function yM(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(yM,"omit")});var OM=d(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});var _M=require("buffer"),Hs={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};hr.ERRORS=Hs;function n7(i){if(!_M.Buffer.isEncoding(i))throw new Error(Hs.INVALID_ENCODING)}o(n7,"checkEncoding");hr.checkEncoding=n7;function bM(i){return typeof i=="number"&&isFinite(i)&&u7(i)}o(bM,"isFiniteInteger");hr.isFiniteInteger=bM;function IM(i,e){if(typeof i=="number"){if(!bM(i)||i<0)throw new Error(e?Hs.INVALID_OFFSET:Hs.INVALID_LENGTH)}else throw new Error(e?Hs.INVALID_OFFSET_NON_NUMBER:Hs.INVALID_LENGTH_NON_NUMBER)}o(IM,"checkOffsetOrLengthValue");function o7(i){IM(i,!1)}o(o7,"checkLengthValue");hr.checkLengthValue=o7;function a7(i){IM(i,!0)}o(a7,"checkOffsetValue");hr.checkOffsetValue=a7;function c7(i,e){if(i<0||i>e.length)throw new Error(Hs.INVALID_TARGET_OFFSET)}o(c7,"checkTargetOffset");hr.checkTargetOffset=c7;function u7(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}o(u7,"isInteger");function l7(i){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof _M.Buffer.prototype[i]>"u")throw new Error(`Platform does not support Buffer.prototype.${i}.`)}o(l7,"bigIntAndBufferInt64Check");hr.bigIntAndBufferInt64Check=l7});var CM=d(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var F=OM(),vM=4096,h7="utf8",u_=class i{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=h7,this._writeOffset=0,this._readOffset=0,i.isSmartBufferOptions(e))if(e.encoding&&(F.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(F.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(F.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(F.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(vM);else{if(typeof e<"u")throw new Error(F.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(vM)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return F.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return F.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return F.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return F.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(F.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&F.checkEncoding(t);let s=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,s}insertString(e,t,r){return F.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&F.checkEncoding(e);let t=this.length;for(let s=this._readOffset;s<this.length;s++)if(this._buff[s]===0){t=s;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return F.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&F.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),s=this._buff.slice(this._readOffset,r);return this._readOffset=r,s}insertBuffer(e,t){return F.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return F.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&F.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){F.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return F.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,s){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(F.checkEncoding(r),a=r),typeof s=="string"&&(F.checkEncoding(s),a=s);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let s=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,s):this._ensureWriteable(e.length,s),e.copy(this._buff,s),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,s+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(F.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(F.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){F.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,s=t*3/2+1;s<e&&(s=e),this._buff=Buffer.allocUnsafe(s),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let s=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),s}_insertNumberValue(e,t,r,s){return F.checkOffsetValue(s),this.ensureInsertable(t,s),e.call(this._buff,r,s),this._writeOffset+=t,this}_writeNumberValue(e,t,r,s){if(typeof s=="number"){if(s<0)throw new Error(F.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);F.checkOffsetValue(s)}let n=typeof s=="number"?s:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof s=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};l_.SmartBuffer=u_});var h_=d(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SOCKS5_NO_ACCEPTABLE_AUTH=re.SOCKS5_CUSTOM_AUTH_END=re.SOCKS5_CUSTOM_AUTH_START=re.SOCKS_INCOMING_PACKET_SIZES=re.SocksClientState=re.Socks5Response=re.Socks5HostType=re.Socks5Auth=re.Socks4Response=re.SocksCommand=re.ERRORS=re.DEFAULT_TIMEOUT=void 0;var f7=3e4;re.DEFAULT_TIMEOUT=f7;var d7={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};re.ERRORS=d7;var p7={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(i=>i+7,"Socks5ResponseHostname"),Socks4Response:8};re.SOCKS_INCOMING_PACKET_SIZES=p7;var RM;(function(i){i[i.connect=1]="connect",i[i.bind=2]="bind",i[i.associate=3]="associate"})(RM||(re.SocksCommand=RM={}));var AM;(function(i){i[i.Granted=90]="Granted",i[i.Failed=91]="Failed",i[i.Rejected=92]="Rejected",i[i.RejectedIdent=93]="RejectedIdent"})(AM||(re.Socks4Response=AM={}));var TM;(function(i){i[i.NoAuth=0]="NoAuth",i[i.GSSApi=1]="GSSApi",i[i.UserPass=2]="UserPass"})(TM||(re.Socks5Auth=TM={}));var m7=128;re.SOCKS5_CUSTOM_AUTH_START=m7;var g7=254;re.SOCKS5_CUSTOM_AUTH_END=g7;var y7=255;re.SOCKS5_NO_ACCEPTABLE_AUTH=y7;var NM;(function(i){i[i.Granted=0]="Granted",i[i.Failure=1]="Failure",i[i.NotAllowed=2]="NotAllowed",i[i.NetworkUnreachable=3]="NetworkUnreachable",i[i.HostUnreachable=4]="HostUnreachable",i[i.ConnectionRefused=5]="ConnectionRefused",i[i.TTLExpired=6]="TTLExpired",i[i.CommandNotSupported=7]="CommandNotSupported",i[i.AddressNotSupported=8]="AddressNotSupported"})(NM||(re.Socks5Response=NM={}));var PM;(function(i){i[i.IPv4=1]="IPv4",i[i.Hostname=3]="Hostname",i[i.IPv6=4]="IPv6"})(PM||(re.Socks5HostType=PM={}));var DM;(function(i){i[i.Created=0]="Created",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.SentInitialHandshake=3]="SentInitialHandshake",i[i.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",i[i.SentAuthentication=5]="SentAuthentication",i[i.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",i[i.SentFinalHandshake=7]="SentFinalHandshake",i[i.ReceivedFinalResponse=8]="ReceivedFinalResponse",i[i.BoundWaitingForConnection=9]="BoundWaitingForConnection",i[i.Established=10]="Established",i[i.Disconnected=11]="Disconnected",i[i.Error=99]="Error"})(DM||(re.SocksClientState=DM={}))});var d_=d(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.shuffleArray=Po.SocksClientError=void 0;var f_=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};Po.SocksClientError=f_;function S7(i){for(let e=i.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[i[e],i[t]]=[i[t],i[e]]}}o(S7,"shuffleArray");Po.shuffleArray=S7});var yd=d(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.isInSubnet=E7;Gs.isCorrect=w7;Gs.numberToPaddedHex=xM;Gs.stringToPaddedHex=_7;Gs.testBit=b7;function E7(i){return this.subnetMask<i.subnetMask?!1:this.mask(i.subnetMask)===i.mask()}o(E7,"isInSubnet");function w7(i){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===i&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(w7,"isCorrect");function xM(i){return i.toString(16).padStart(2,"0")}o(xM,"numberToPaddedHex");function _7(i){return xM(parseInt(i,10))}o(_7,"stringToPaddedHex");function b7(i,e){let{length:t}=i;if(e>t)return!1;let r=t-e;return i.substring(r,r+1)==="1"}o(b7,"testBit")});var p_=d(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.RE_SUBNET_STRING=Ci.RE_ADDRESS=Ci.GROUPS=Ci.BITS=void 0;Ci.BITS=32;Ci.GROUPS=4;Ci.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Ci.RE_SUBNET_STRING=/\/\d{1,2}$/});var Ed=d(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.AddressError=void 0;var m_=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};Sd.AddressError=m_});var y_=d(Ri=>{"use strict";var I7=Ri&&Ri.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),O7=Ri&&Ri.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),MM=Ri&&Ri.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&I7(e,i,t);return O7(e,i),e};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.Address4=void 0;var Do=MM(yd()),ii=MM(p_()),LM=Ed(),g_=class i{static{o(this,"Address4")}constructor(e){this.groups=ii.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Do.isCorrect(ii.BITS),this.isInSubnet=Do.isInSubnet,this.address=e;let t=ii.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>ii.BITS)throw new LM.AddressError("Invalid subnet mask.");e=e.replace(ii.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(ii.RE_ADDRESS))throw new LM.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],s;for(s=0;s<8;s+=2){let n=t.slice(s,s+2);r.push(parseInt(n,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>Do.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<ii.GROUPS;t+=2)e.push(`${Do.stringToPaddedHex(this.parsedAddress[t])}${Do.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Do.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(ii.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(ii.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return i.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(ii.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(ii.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Ri.Address4=g_});var S_=d(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.RE_URL_WITH_PORT=he.RE_URL=he.RE_ZONE_STRING=he.RE_SUBNET_STRING=he.RE_BAD_ADDRESS=he.RE_BAD_CHARACTERS=he.TYPES=he.SCOPES=he.GROUPS=he.BITS=void 0;he.BITS=128;he.GROUPS=8;he.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};he.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};he.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;he.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;he.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;he.RE_ZONE_STRING=/%.*$/;he.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;he.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var E_=d(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.spanAllZeroes=BM;xo.spanAll=v7;xo.spanLeadingZeroes=C7;xo.simpleGroup=R7;function BM(i){return i.replace(/(0+)/g,'<span class="zero">$1</span>')}o(BM,"spanAllZeroes");function v7(i,e=0){return i.split("").map((r,s)=>`<span class="digit value-${r} position-${s+e}">${BM(r)}</span>`).join("")}o(v7,"spanAll");function kM(i){return i.replace(/^(0+)/,'<span class="zero">$1</span>')}o(kM,"spanLeadingZeroesSimple");function C7(i){return i.split(":").map(t=>kM(t)).join(":")}o(C7,"spanLeadingZeroes");function R7(i,e=0){return i.split(":").map((r,s)=>/group-v4/.test(r)?r:`<span class="hover-group group-${s+e}">${kM(r)}</span>`)}o(R7,"simpleGroup")});var FM=d(nt=>{"use strict";var A7=nt&&nt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),T7=nt&&nt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),N7=nt&&nt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&A7(e,i,t);return T7(e,i),e};Object.defineProperty(nt,"__esModule",{value:!0});nt.ADDRESS_BOUNDARY=void 0;nt.groupPossibilities=_d;nt.padGroup=wd;nt.simpleRegularExpression=D7;nt.possibleElisions=x7;var P7=N7(S_());function _d(i){return`(${i.join("|")})`}o(_d,"groupPossibilities");function wd(i){return i.length<4?`0{0,${4-i.length}}${i}`:i}o(wd,"padGroup");nt.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function D7(i){let e=[];i.forEach((r,s)=>{parseInt(r,16)===0&&e.push(s)});let t=e.map(r=>i.map((s,n)=>{if(n===r){let a=n===0||n===P7.GROUPS-1?":":"";return _d([wd(s),a])}return wd(s)}).join(":"));return t.push(i.map(wd).join(":")),_d(t)}o(D7,"simpleRegularExpression");function x7(i,e,t){let r=e?"":":",s=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${i-1}}`),n.push(`(0{1,4}:){1,${i-1}}${s}`),n.push(`(0{1,4}:){${i-1}}0{1,4}`);for(let a=1;a<i-1;a++)for(let c=1;c<i-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${i-c-a-1}}0{1,4}`);return _d(n)}o(x7,"possibleElisions")});var qM=d(Ai=>{"use strict";var L7=Ai&&Ai.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),M7=Ai&&Ai.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Od=Ai&&Ai.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&L7(e,i,t);return M7(e,i),e};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.Address6=void 0;var UM=Od(yd()),w_=Od(p_()),se=Od(S_()),__=Od(E_()),Ws=y_(),Js=FM(),fr=Ed(),bd=yd();function Id(i){if(!i)throw new Error("Assertion failed.")}o(Id,"assert");function B7(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}o(B7,"addCommas");function k7(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),i=i.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),i}o(k7,"spanLeadingZeroes4");function F7(i,e){let t=[],r=[],s;for(s=0;s<i.length;s++)s<e[0]?t.push(i[s]):s>e[1]&&r.push(i[s]);return t.concat(["compact"]).concat(r)}o(F7,"compact");function jM(i){return parseInt(i,16).toString(16).padStart(4,"0")}o(jM,"paddedHex");function $M(i){return i&255}o($M,"unsignByte");var b_=class i{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=UM.isInSubnet,this.isCorrect=UM.isCorrect(se.BITS),t===void 0?this.groups=se.GROUPS:this.groups=t,this.address=e;let r=se.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>se.BITS)throw new fr.AddressError("Invalid subnet mask.");e=e.replace(se.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new fr.AddressError("Invalid subnet mask.");let s=se.RE_ZONE_STRING.exec(e);s&&(this.zone=s[0],e=e.replace(se.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],s;for(s=0;s<se.GROUPS;s++)r.push(t.slice(s*4,(s+1)*4));return new i(r.join(":"))}static fromURL(e){let t,r=null,s;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(s=se.RE_URL_WITH_PORT.exec(e),s===null)return{error:"failed to parse address with port",address:null,port:null};t=s[1],r=s[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),s=se.RE_URL.exec(e),s===null)return{error:"failed to parse address from URL",address:null,port:null};t=s[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new Ws.Address4(e),r=se.BITS-(w_.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new fr.AddressError("Invalid 'ip6.arpa' form.");let s=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;s.splice(a,0,":")}return t=s.join(""),new i(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=se.BITS-this.subnetMask,r=Math.abs(e-se.BITS),s=t-r;return s<0?"0":B7((BigInt("2")**BigInt(s)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(se.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(se.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}getScope(){let e=se.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(se.TYPES))if(this.isInSubnet(new i(e)))return se.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,se.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,s=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&s.push([e-r,e-1]),r=0)}r>1&&s.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=s.map(c=>c[1]-c[0]+1);if(s.length>0){let c=n.indexOf(Math.max(...n));t=F7(this.parsedAddress,s[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart(se.BITS,"0")}parse4in6(e){let t=e.split(":"),s=t.slice(-1)[0].match(w_.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new Ws.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new fr.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(w_.RE_ADDRESS,this.address4.parsedAddress.map(k7).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match(se.RE_BAD_CHARACTERS);if(t)throw new fr.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(se.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(se.RE_BAD_ADDRESS);if(r)throw new fr.AddressError(`Address failed regex: ${r.join("")}`,e.replace(se.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let s=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let u=this.groups-(a.length+c.length);if(!u)throw new fr.AddressError("Error parsing groups");this.elidedGroups=u,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,s=s.concat(a);for(let l=0;l<u;l++)s.push("0");s=s.concat(c)}else if(n.length===1)s=e.split(":"),this.elidedGroups=0;else throw new fr.AddressError("Too many :: groups found");if(s=s.map(a=>parseInt(a,16).toString(16)),s.length!==this.groups)throw new fr.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(jM).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(jM).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return Ws.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(r)||(s=":"),r+s+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),s=Ws.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=Ws.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),u=(0,bd.testBit)(c,15),l=(0,bd.testBit)(c,14),h=(0,bd.testBit)(c,8),f=(0,bd.testBit)(c,9),p=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:s.address,client4:a.address,flags:c,coneNat:u,microsoft:{reserved:l,universalLocal:f,groupIndividual:h,nonce:p},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=Ws.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new i(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,s=[];for(let n=0,a=r.length;n<a;n+=2)s.push(parseInt(r.substring(n,n+2),16));return s}toUnsignedByteArray(){return this.toByteArray().map($M)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map($M))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),s=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=s*BigInt(e[n].toString(10)),s*=t;return i.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return __.simpleGroup(this.address).join(":");Id(typeof this.elidedGroups=="number"),Id(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...__.simpleGroup(t)):e.push("");let s=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)s.push(`group-${n}`);return e.push(`<span class="${s.join(" ")}"></span>`),r.length?e.push(...__.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Id(this.address4 instanceof Ws.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,Js.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===se.GROUPS)t.push((0,Js.possibleElisions)(se.GROUPS));else{let s=r.address.split("::");s[0].length&&t.push((0,Js.simpleRegularExpression)(s[0].split(":"))),Id(typeof r.elidedGroups=="number"),t.push((0,Js.possibleElisions)(r.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&t.push((0,Js.simpleRegularExpression)(s[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",Js.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",Js.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Ai.Address6=b_});var I_=d($e=>{"use strict";var U7=$e&&$e.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),j7=$e&&$e.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),$7=$e&&$e.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&U7(e,i,t);return j7(e,i),e};Object.defineProperty($e,"__esModule",{value:!0});$e.v6=$e.AddressError=$e.Address6=$e.Address4=void 0;var q7=y_();Object.defineProperty($e,"Address4",{enumerable:!0,get:o(function(){return q7.Address4},"get")});var V7=qM();Object.defineProperty($e,"Address6",{enumerable:!0,get:o(function(){return V7.Address6},"get")});var z7=Ed();Object.defineProperty($e,"AddressError",{enumerable:!0,get:o(function(){return z7.AddressError},"get")});var H7=$7(E_());$e.v6={helpers:H7}});var JM=d(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ipToBuffer=Bt.int32ToIpv4=Bt.ipv4ToInt32=Bt.validateSocksClientChainOptions=Bt.validateSocksClientOptions=void 0;var Ke=d_(),Pe=h_(),G7=require("stream"),O_=I_(),VM=require("net");function W7(i,e=["connect","bind","associate"]){if(!Pe.SocksCommand[i.command])throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksCommandForOperation,i);if(!HM(i.destination))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsDestination,i);if(!GM(i.proxy))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxy,i);if(zM(i.proxy,i),i.timeout&&!WM(i.timeout))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof G7.Duplex))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}o(W7,"validateSocksClientOptions");Bt.validateSocksClientOptions=W7;function J7(i){if(i.command!=="connect")throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksCommandChain,i);if(!HM(i.destination))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!GM(e))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsProxy,i);zM(e,i)}),i.timeout&&!WM(i.timeout))throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsTimeout,i)}o(J7,"validateSocksClientChainOptions");Bt.validateSocksClientChainOptions=J7;function zM(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_method<Pe.SOCKS5_CUSTOM_AUTH_START||i.custom_auth_method>Pe.SOCKS5_CUSTOM_AUTH_END)throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new Ke.SocksClientError(Pe.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(zM,"validateCustomProxyAuth");function HM(i){return i&&typeof i.host=="string"&&Buffer.byteLength(i.host)<256&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}o(HM,"isValidSocksRemoteHost");function GM(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}o(GM,"isValidSocksProxy");function WM(i){return typeof i=="number"&&i>0}o(WM,"isValidTimeoutValue");function K7(i){return new O_.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(K7,"ipv4ToInt32");Bt.ipv4ToInt32=K7;function Z7(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,s=i&255;return[e,t,r,s].join(".")}o(Z7,"int32ToIpv4");Bt.int32ToIpv4=Z7;function Y7(i){if(VM.isIPv4(i)){let e=new O_.Address4(i);return Buffer.from(e.toArray())}else if(VM.isIPv6(i)){let e=new O_.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(Y7,"ipToBuffer");Bt.ipToBuffer=Y7});var KM=d(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.ReceiveBuffer=void 0;var v_=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};vd.ReceiveBuffer=v_});var ZM=d(Vr=>{"use strict";var Lo=Vr&&Vr.__awaiter||function(i,e,t,r){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return o(s,"adopt"),new(t||(t=Promise))(function(n,a){function c(h){try{l(r.next(h))}catch(f){a(f)}}o(c,"fulfilled");function u(h){try{l(r.throw(h))}catch(f){a(f)}}o(u,"rejected");function l(h){h.done?n(h.value):s(h.value).then(c,u)}o(l,"step"),l((r=r.apply(i,e||[])).next())})};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.SocksClientError=Vr.SocksClient=void 0;var X7=require("events"),Mo=require("net"),ot=CM(),O=h_(),Et=JM(),Q7=KM(),R_=d_();Object.defineProperty(Vr,"SocksClientError",{enumerable:!0,get:o(function(){return R_.SocksClientError},"get")});var C_=I_(),A_=class i extends X7.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,Et.validateSocksClientOptions)(e),this.setState(O.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,s)=>{try{(0,Et.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):s(a)}let n=new i(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):s(a)})})}static createConnectionChain(e,t){return new Promise((r,s)=>Lo(this,void 0,void 0,function*(){try{(0,Et.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):s(n)}e.randomizeChain&&(0,R_.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],u=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},l=yield i.createConnection({command:"connect",proxy:c,destination:u,existing_socket:n});n=n||l.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):s(n)}}))}static createUDPFrame(e){let t=new ot.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Mo.isIPv4(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv4),t.writeUInt32BE((0,Et.ipv4ToInt32)(e.remoteHost.host))):Mo.isIPv6(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv6),t.writeBuffer((0,Et.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(O.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=ot.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),s=t.readUInt8(),n;s===O.Socks5HostType.IPv4?n=(0,Et.int32ToIpv4)(t.readUInt32BE()):s===O.Socks5HostType.IPv6?n=C_.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==O.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||O.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Mo.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(O.SocksClientState.Connecting),this.receiveBuffer=new Q7.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let s=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",s)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.BoundWaitingForConnection&&this.closeSocket(O.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(O.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(O.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===O.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===O.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===O.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===O.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(O.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(O.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==O.SocksClientState.Error&&(this.setState(O.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new R_.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new ot.SmartBuffer;t.writeUInt8(4),t.writeUInt8(O.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Mo.isIPv4(this.options.destination.host)?(t.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedConnection} - (${O.Socks4Response[e[1]]})`);else if(O.SocksCommand[this.options.command]===O.SocksCommand.bind){let t=ot.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Et.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(O.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${O.Socks4Response[e[1]]})`);else{let t=ot.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,Et.int32ToIpv4)(t.readUInt32BE())};this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new ot.SmartBuffer,t=[O.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(O.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(O.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===O.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===O.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=O.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===O.Socks5Auth.UserPass?(this.socks5ChosenAuthType=O.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new ot.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(O.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Lo(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(O.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Lo(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Lo(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Lo(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Lo(this,void 0,void 0,function*(){this.setState(O.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===O.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===O.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(O.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new ot.SmartBuffer;e.writeUInt8(5),e.writeUInt8(O.SocksCommand[this.options.command]),e.writeUInt8(0),Mo.isIPv4(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv4),e.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host))):Mo.isIPv6(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv6),e.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(O.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Et.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:C_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.ReceivedFinalResponse),O.SocksCommand[this.options.command]===O.SocksCommand.connect?(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.bind?(this.setState(O.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.associate&&(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,Et.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=ot.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:C_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Vr.SocksClient=A_});var YM=d(Ks=>{"use strict";var eee=Ks&&Ks.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),tee=Ks&&Ks.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&eee(e,i,t)};Object.defineProperty(Ks,"__esModule",{value:!0});tee(ZM(),Ks)});var XM=d(kt=>{"use strict";var iee=kt&&kt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),ree=kt&&kt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),T_=kt&&kt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&iee(e,i,t);return ree(e,i),e},see=kt&&kt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(kt,"__esModule",{value:!0});kt.SocksProxyAgent=void 0;var nee=YM(),oee=nu(),aee=see(zs()),cee=T_(require("dns")),uee=T_(require("net")),lee=T_(require("tls")),hee=require("url"),Cd=(0,aee.default)("socks-proxy-agent"),fee=o(i=>i.servername===void 0&&i.host&&!uee.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost");function dee(i){let e=!1,t=5,r=i.hostname,s=parseInt(i.port,10)||1080;switch(i.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(i.protocol)}`)}let n={host:r,port:s,type:t};return i.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(i.username),enumerable:!1}),i.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(i.password),enumerable:!1}),{lookup:e,proxy:n}}o(dee,"parseSocksURL");var Rd=class extends oee.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new hee.URL(e):e,{proxy:s,lookup:n}=dee(r);this.shouldLookup=n,this.proxy=s,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:s,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:u=cee.lookup}=t;r&&(a=await new Promise((p,m)=>{u(a,{},(y,g)=>{y?m(y):p(g)})}));let l={proxy:s,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},h=o(p=>{e.destroy(),f.destroy(),p&&p.destroy()},"cleanup");Cd("Creating socks proxy connection: %o",l);let{socket:f}=await nee.SocksClient.createConnection(l);if(Cd("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>h())),t.secureEndpoint){Cd("Upgrading socket connection to TLS");let p=lee.connect({...pee(fee(t),"host","path","port"),socket:f});return p.once("error",m=>{Cd("Socket TLS error",m.message),h(p)}),p}return f}};Rd.protocols=["socks","socks4","socks4a","socks5","socks5h"];kt.SocksProxyAgent=Rd;function pee(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(pee,"omit")});var M_=d((uwe,QM)=>{"use strict";var N_=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},P_=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},D_=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},x_=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},L_=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};QM.exports={InvalidProxyProtocolError:N_,ConnectionTimeoutError:P_,IdleTimeoutError:D_,ResponseTimeoutError:x_,TransferTimeoutError:L_}});var B_=d((hwe,tB)=>{"use strict";var{HttpProxyAgent:mee}=dM(),{HttpsProxyAgent:gee}=wM(),{SocksProxyAgent:eB}=XM(),{LRUCache:yee}=hs(),{InvalidProxyProtocolError:See}=M_(),Eee=new yee({max:20}),wee=new Set(eB.protocols),_ee=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),au=Object.entries(process.env).reduce((i,[e,t])=>(e=e.toLowerCase(),_ee.has(e)&&(i[e]=t),i),{}),bee=o(i=>{i=new URL(i);let e=i.protocol.slice(0,-1);if(wee.has(e))return eB;if(e==="https"||e==="http")return[mee,gee];throw new See(i)},"getProxyAgent"),Iee=o((i,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=i.hostname.split(".").reverse();return e.some(r=>{let s=r.split(".").filter(Boolean).reverse();if(!s.length)return!1;for(let n=0;n<s.length;n++)if(t[n]!==s[n])return!1;return!0})},"isNoProxy"),Oee=o((i,{proxy:e,noProxy:t})=>(i=new URL(i),e||(e=i.protocol==="https:"?au.https_proxy:au.https_proxy||au.http_proxy||au.proxy),t||(t=au.no_proxy),!e||Iee(i,t)?null:new URL(e)),"getProxy");tB.exports={getProxyAgent:bee,getProxy:Oee,proxyCache:Eee}});var sB=d((pwe,rB)=>{"use strict";var vee=require("net"),Cee=require("tls"),{once:iB}=require("events"),Ree=require("timers/promises"),{normalizeOptions:Aee,cacheOptions:Tee}=r_(),{getProxy:Nee,getProxyAgent:Pee,proxyCache:k_}=B_(),Ad=M_(),{Agent:Dee}=nu();rB.exports=class extends Dee{static{o(this,"Agent")}#e;#t;#i;#r;#s;constructor(e={}){let{timeouts:t,proxy:r,noProxy:s,...n}=Aee(e);super(n),this.#e=n,this.#t=t,r&&(this.#i=new URL(r),this.#r=s,this.#s=Pee(r))}get proxy(){return this.#i?{url:this.#i}:{}}#u(e){if(!this.#i)return;let t=Nee(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#i,noProxy:this.#r});if(!t)return;let r=Tee({...e,...this.#e,timeouts:this.#t,proxy:t});if(k_.has(r))return k_.get(r);let s=this.#s;Array.isArray(s)&&(s=this.isSecureEndpoint(e)?s[1]:s[0]);let n=new s(t,{...this.#e,socketOptions:{family:this.#e.family}});return k_.set(r,n),n}async#c({promises:e,options:t,timeout:r},s=new AbortController){if(r){let a=Ree.setTimeout(r,null,{signal:s.signal}).then(()=>{throw new Ad.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),s.abort()}catch(a){throw s.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,s=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#u(t);if(a){let h=Date.now();r=await this.#c({options:t,timeout:s,promises:[a.connect(e,t)]}),s&&(s=s-(Date.now()-h))}else r=(n?Cee:vee).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:u}=c,l=r[n?"secureConnecting":"connecting"]?iB(r,n?"secureConnect":"connect",{signal:u}):Promise.resolve();return await this.#c({options:t,timeout:s,promises:[l,iB(r,"error",{signal:u}).then(h=>{throw h[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new Ad.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#u(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let s;e.once("finish",()=>{setTimeout(()=>{e.destroy(new Ad.ResponseTimeoutError(e,this.#i))},this.#t.response)}),e.once("response",()=>{clearTimeout(s)})}if(this.#t.transfer){let s;e.once("response",n=>{setTimeout(()=>{n.destroy(new Ad.TransferTimeoutError(e,this.#i))},this.#t.transfer),n.once("close",()=>{clearTimeout(s)})})}return super.addRequest(e,t)}}});var cB=d((gwe,aB)=>{"use strict";var{LRUCache:xee}=hs(),{normalizeOptions:Lee,cacheOptions:Mee}=r_(),{getProxy:Bee,proxyCache:nB}=B_(),oB=i_(),Td=sB(),cu=new xee({max:20}),kee=o((i,{agent:e,proxy:t,noProxy:r,...s}={})=>{if(e!=null)return e;i=new URL(i);let n=Bee(i,{proxy:t,noProxy:r}),a={...Lee(s),proxy:n},c=Mee({...a,secureEndpoint:i.protocol==="https:"});if(cu.has(c))return cu.get(c);let u=new Td(a);return cu.set(c,u),u},"getAgent");aB.exports={getAgent:kee,Agent:Td,HttpAgent:Td,HttpsAgent:Td,cache:{proxy:nB,agent:cu,dns:oB.cache,clear:o(()=>{nB.clear(),cu.clear(),oB.cache.clear()},"clear")}}});var uB=d((Swe,Fee)=>{Fee.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Pd=d((Ewe,hB)=>{var{Minipass:Uee}=te(),Nd=bo(),jee=qa(),$ee=hi(),{log:lB}=_t(),qee=t_(),{getAgent:Vee}=cB(),F_=uB(),zee=`${F_.name}/${F_.version} (+https://npm.im/${F_.name})`,Hee=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],Gee=["request-timeout"],Wee=o((i,e)=>{let t=Vee(i.url,{...e,signal:void 0});i.headers.has("connection")||i.headers.set("connection",t?"keep-alive":"close"),i.headers.has("user-agent")||i.headers.set("user-agent",zee);let r={...e,agent:t,redirect:"manual"};return jee(async(s,n)=>{let a=new Nd.Request(i,r);try{let c=await Nd(a,r);if(r.integrity&&c.status===200){let h=$ee.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new qee({events:["integrity","size"]},c.body,h);h.on("integrity",p=>f.emit("integrity",p)),h.on("size",p=>f.emit("size",p)),c=new Nd.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let u=Uee.isStream(a.body);return a.method!=="POST"&&!u&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),lB.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),s(c)):c}catch(c){let u=c.code==="EPROMISERETRY"?c.retried.code:c.code,l=c.retried instanceof Nd.Response||Hee.includes(u)&&Gee.includes(c.type);if(a.method==="POST"||l)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),lB.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),s(c)}},e.retry).catch(s=>{if(s.status>=400&&s.type!=="system")return s;throw s})},"remoteFetch");hB.exports=Wee});var yB=d((_we,gB)=>{var{Request:fB,Response:U_}=bo(),{Minipass:dB}=te(),Jee=Ph(),Zs=bc(),Kee=require("url"),Zee=t_(),Yee=Xw(),j_=VL(),Xee=Pd(),uu=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),Qee=["accept-charset","accept-encoding","accept-language","accept","cache-control"],mB=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],pB=o((i,e,t)=>{let r={time:Date.now(),url:i.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:i.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of Qee)i.headers.has(a)&&(r.reqHeaders[a]=i.headers.get(a));let s=i.headers.get("host"),n=new Kee.URL(i.url);if(s&&n.host!==s&&(r.reqHeaders.host=s),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let u of c)i.headers.has(u)&&(r.reqHeaders[u]=i.headers.get(u))}}for(let a of mB)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),Dd=Symbol("request"),xd=Symbol("response"),Ld=Symbol("policy"),$_=class i{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:s}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=j_(t),this.options=s,this[Dd]=t,this[xd]=r,this[Ld]=null}static async find(e,t){try{var r=await Zs.index.compact(t.cachePath,j_(e),(n,a)=>{let c=new i({entry:n,options:t}),u=new i({entry:a,options:t});return c.policy.satisfies(u.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let s;for(let n of r){let a=new i({entry:n,options:t});if(a.policy.satisfies(e)){s=a;break}}return s}static async invalidate(e,t){let r=j_(e);try{await Zs.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[Dd]||(this[Dd]=new fB(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[Dd]}get response(){return this[xd]||(this[xd]=new U_(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[xd]}get policy(){return this[Ld]||(this[Ld]=new Yee({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[Ld]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:pB(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},s=null;if(this.response.status===200){let a,c,u=new Promise((h,f)=>{a=h,c=f}).catch(h=>{s.emit("error",h)});s=new Zee({events:["integrity","size"]},new Jee({flush(){return u}})),s.hasIntegrityEmitter=!0;let l=o(()=>{let h=new dB,f=Zs.put.stream(this.options.cachePath,this.key,r);f.on("integrity",p=>s.emit("integrity",p)),f.on("size",p=>s.emit("size",p)),h.pipe(f),f.promise().then(a,c),s.unshift(h),s.unshift(this.response.body)},"onResume");s.once("resume",l),s.once("end",()=>s.removeListener("resume",l))}else await Zs.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new U_(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let s;if(e==="HEAD"||[301,308].includes(this.response.status))s=this.response;else{let n=new dB,a={...this.policy.responseHeaders()},c=o(()=>{let u=Zs.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});u.on("error",async l=>{u.pause(),l.code==="EINTEGRITY"&&await Zs.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(l.code==="ENOENT"||l.code==="EINTEGRITY")&&await i.invalidate(this.request,this.options),n.emit("error",l),u.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),u.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),s=new U_(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return s.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),s.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),s.headers.set("x-local-cache-key",encodeURIComponent(this.key)),s.headers.set("x-local-cache-mode","stream"),s.headers.set("x-local-cache-status",r),s.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(e,t){let r=new fB(e,{headers:this.policy.revalidationHeaders(e)});try{var s=await Xee(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,s)){let a=pB(e,s,t);for(let c of mB)!uu(a.resHeaders,c)&&uu(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let u=uu(a.resHeaders,c),l=uu(this.entry.metadata.resHeaders,c),h=uu(this.policy.response.headers,c);!u&&l&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!h&&u&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await Zs.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new i({request:e,response:s,options:t}).store("updated")}};gB.exports=$_});var wB=d((Iwe,EB)=>{var{NotCachedError:ete}=jL(),q_=yB(),tte=Pd(),SB=o(async(i,e)=>{let t=await q_.find(i,e);if(!t){if(e.cache==="only-if-cached")throw new ete(i.url);let s=await tte(i,e);return new q_({request:i,response:s,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(i,e);let r=t.policy.needsRevalidation(i);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(i.method,e,r?"stale":"hit"):t.revalidate(i,e)},"cacheFetch");SB.invalidate=async(i,e)=>{if(e.cachePath)return q_.invalidate(i,e)};EB.exports=SB});var OB=d((vwe,IB)=>{"use strict";var{FetchError:V_,Request:ite,isRedirect:rte}=bo(),z_=require("url"),ste=Xw(),_B=wB(),nte=Pd(),ote=o((i,e,t)=>{if(!rte(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new V_(`redirect mode is set to error: ${i.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new V_(`redirect location header missing for: ${i.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(i.counter>=i.follow)throw new V_(`maximum redirect reached at: ${i.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),ate=o((i,e,t)=>{let r={...t},s=e.headers.get("location"),n=new z_.URL(s,/^https?:/.test(s)?void 0:i.url);return new z_.URL(i.url).hostname!==n.hostname&&(i.headers.delete("authorization"),i.headers.delete("cookie")),(e.status===303||i.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,i.headers.delete("content-length")),r.headers={},i.headers.forEach((c,u)=>{r.headers[u]=c}),r.counter=++i.counter,{request:new ite(z_.format(n),r),options:r}},"getRedirect"),bB=o(async(i,e)=>{let t=ste.storable(i,e)?await _B(i,e):await nte(i,e);if(!["GET","HEAD"].includes(i.method)&&t.status>=200&&t.status<=399&&await _B.invalidate(i,e),!ote(i,t,e))return t;let r=ate(i,t,e);return bB(r.request,r.options)},"fetch");IB.exports=bB});var lu=d((Rwe,Bo)=>{var{FetchError:cte,Headers:ute,Request:vB,Response:lte}=bo(),hte=hL(),fte=OB(),Md=o((i,e)=>{let t=hte(e),r=new vB(i,t);return fte(r,t)},"makeFetchHappen");Md.defaults=(i,e={},t=Md)=>{typeof i=="object"&&(e=i,i=null);let r=o((s,n={})=>{let a=s||i,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(s,n={})=>Md.defaults(s,n,r),r};Bo.exports=Md;Bo.exports.FetchError=cte;Bo.exports.Headers=ute;Bo.exports.Request=vB;Bo.exports.Response=lte});var JB=d((Twe,WB)=>{var $={},jB=$.LEFT_BRACE=1,Fd=$.RIGHT_BRACE=2,$B=$.LEFT_BRACKET=3,W_=$.RIGHT_BRACKET=4,Ud=$.COLON=5,jd=$.COMMA=6,qB=$.TRUE=7,VB=$.FALSE=8,zB=$.NULL=9,$d=$.STRING=10,HB=$.NUMBER=11,Ys=$.START=17,GB=$.STOP=18,CB=$.TRUE1=33,RB=$.TRUE2=34,AB=$.TRUE3=35,TB=$.FALSE1=49,NB=$.FALSE2=50,PB=$.FALSE3=51,DB=$.FALSE4=52,xB=$.NULL1=65,LB=$.NULL2=66,MB=$.NULL3=67,BB=$.NUMBER1=81,H_=$.NUMBER3=83,ri=$.STRING1=97,kB=$.STRING2=98,FB=$.STRING3=99,dte=$.STRING4=100,pte=$.STRING5=101,UB=$.STRING6=102,ko=$.VALUE=113,G_=$.KEY=114,Bd=$.OBJECT=129,kd=$.ARRAY=130,mte=92,gte=47,yte=8,Ste=12,Ete=10,wte=13,_te=9,qd=64*1024;function zr(){this.tState=Ys,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(qd):new Buffer(qd),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=ko,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}o(zr,"Parser");zr.toknam=function(i){for(var e=Object.keys($),t=0,r=e.length;t<r;t++){var s=e[t];if($[s]===i)return s}return i&&"0x"+i.toString(16)};var Ft=zr.prototype;Ft.onError=function(i){throw i};Ft.charError=function(i,e){this.tState=GB,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(i[e]))+" at position "+e+" in state "+zr.toknam(this.tState)))};Ft.appendStringChar=function(i){this.stringBufferOffset>=qd&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=i};Ft.appendStringBuf=function(i,e,t){var r=i.length;typeof e=="number"&&(typeof t=="number"?t<0?r=i.length-e+t:r=t-e:r=i.length-e),r<0&&(r=0),this.stringBufferOffset+r>qd&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),i.copy(this.stringBuffer,this.stringBufferOffset,e,t),this.stringBufferOffset+=r};Ft.write=function(i){typeof i=="string"&&(i=new Buffer(i));for(var e,t=0,r=i.length;t<r;t++)if(this.tState===Ys){if(e=i[t],this.offset++,e===123)this.onToken(jB,"{");else if(e===125)this.onToken(Fd,"}");else if(e===91)this.onToken($B,"[");else if(e===93)this.onToken(W_,"]");else if(e===58)this.onToken(Ud,":");else if(e===44)this.onToken(jd,",");else if(e===116)this.tState=CB;else if(e===102)this.tState=TB;else if(e===110)this.tState=xB;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=ri;else if(e===45)this.string="-",this.tState=BB;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=H_;else if(!(e===32||e===9||e===10||e===13))return this.charError(i,t)}else if(this.tState===ri)if(e=i[t],this.bytes_remaining>0){for(var s=0;s<this.bytes_remaining;s++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+s]=i[s];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,t=t+s-1}else if(this.bytes_remaining===0&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+t+" in state "+zr.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>i.length){for(var n=0;n<=i.length-1-t;n++)this.temp_buffs[this.bytes_in_sequence][n]=i[t+n];this.bytes_remaining=t+this.bytes_in_sequence-i.length,t=i.length-1}else this.appendStringBuf(i,t,t+this.bytes_in_sequence),t=t+this.bytes_in_sequence-1}else if(e===34)this.tState=Ys,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken($d,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=kB;else if(e>=32)this.appendStringChar(e);else return this.charError(i,t);else if(this.tState===kB)if(e=i[t],e===34)this.appendStringChar(e),this.tState=ri;else if(e===92)this.appendStringChar(mte),this.tState=ri;else if(e===47)this.appendStringChar(gte),this.tState=ri;else if(e===98)this.appendStringChar(yte),this.tState=ri;else if(e===102)this.appendStringChar(Ste),this.tState=ri;else if(e===110)this.appendStringChar(Ete),this.tState=ri;else if(e===114)this.appendStringChar(wte),this.tState=ri;else if(e===116)this.appendStringChar(_te),this.tState=ri;else if(e===117)this.unicode="",this.tState=FB;else return this.charError(i,t);else if(this.tState===FB||this.tState===dte||this.tState===pte||this.tState===UB)if(e=i[t],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===UB){var a=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&a>=56320&&a<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,a))),this.highSurrogate=void 0):this.highSurrogate===void 0&&a>=55296&&a<56320?this.highSurrogate=a:(this.highSurrogate!==void 0&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(a)))),this.tState=ri}}else return this.charError(i,t);else if(this.tState===BB||this.tState===H_)switch(e=i[t],e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=H_;break;default:this.tState=Ys;var c=Number(this.string);if(isNaN(c))return this.charError(i,t);this.string.match(/[0-9]+/)==this.string&&c.toString()!=this.string?this.onToken($d,this.string):this.onToken(HB,c),this.offset+=this.string.length-1,this.string=void 0,t--;break}else if(this.tState===CB)if(i[t]===114)this.tState=RB;else return this.charError(i,t);else if(this.tState===RB)if(i[t]===117)this.tState=AB;else return this.charError(i,t);else if(this.tState===AB)if(i[t]===101)this.tState=Ys,this.onToken(qB,!0),this.offset+=3;else return this.charError(i,t);else if(this.tState===TB)if(i[t]===97)this.tState=NB;else return this.charError(i,t);else if(this.tState===NB)if(i[t]===108)this.tState=PB;else return this.charError(i,t);else if(this.tState===PB)if(i[t]===115)this.tState=DB;else return this.charError(i,t);else if(this.tState===DB)if(i[t]===101)this.tState=Ys,this.onToken(VB,!1),this.offset+=4;else return this.charError(i,t);else if(this.tState===xB)if(i[t]===117)this.tState=LB;else return this.charError(i,t);else if(this.tState===LB)if(i[t]===108)this.tState=MB;else return this.charError(i,t);else if(this.tState===MB)if(i[t]===108)this.tState=Ys,this.onToken(zB,null),this.offset+=3;else return this.charError(i,t)};Ft.onToken=function(i,e){};Ft.parseError=function(i,e){this.tState=GB,this.onError(new Error("Unexpected "+zr.toknam(i)+(e?"("+JSON.stringify(e)+")":"")+" in state "+zr.toknam(this.state)))};Ft.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};Ft.pop=function(){var i=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(i),this.mode||(this.state=ko)};Ft.emit=function(i){this.mode&&(this.state=jd),this.onValue(i)};Ft.onValue=function(i){};Ft.onToken=function(i,e){if(this.state===ko)if(i===$d||i===HB||i===qB||i===VB||i===zB)this.value&&(this.value[this.key]=e),this.emit(e);else if(i===jB)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=G_,this.mode=Bd;else if(i===$B)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=kd,this.state=ko;else if(i===Fd)if(this.mode===Bd)this.pop();else return this.parseError(i,e);else if(i===W_)if(this.mode===kd)this.pop();else return this.parseError(i,e);else return this.parseError(i,e);else if(this.state===G_)if(i===$d)this.key=e,this.state=Ud;else if(i===Fd)this.pop();else return this.parseError(i,e);else if(this.state===Ud)if(i===Ud)this.state=ko;else return this.parseError(i,e);else if(this.state===jd)if(i===jd)this.mode===kd?(this.key++,this.state=ko):this.mode===Bd&&(this.state=G_);else if(i===W_&&this.mode===kd||i===Fd&&this.mode===Bd)this.pop();else return this.parseError(i,e);else return this.parseError(i,e)};zr.C=$;WB.exports=zr});var YB=d((Pwe,ZB)=>{var bte=JB(),{Minipass:Ite}=te(),Vd=class extends Error{static{o(this,"JSONStreamError")}constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}},KB=o((i,e)=>typeof i=="string"?String(e)===i:i&&typeof i.test=="function"?i.test(e):typeof i=="boolean"||typeof i=="object"?i:typeof i=="function"?i(e):!1,"check"),J_=class i extends Ite{static{o(this,"JSONStream")}#e=0;#t=!1;#i=null;#r=null;#s=null;#u;#c;#f=null;#n=null;constructor(e){super({...e,objectMode:!0});let t=this.#c=new bte;t.onValue=r=>this.#a(r),this.#u=t.onToken,t.onToken=(r,s)=>this.#d(r,s),t.onError=r=>this.#o(r),this.#f=typeof e.path=="string"?e.path.split(".").map(r=>r==="$*"?{emitKey:!0}:r==="*"?!0:r===""?{recurse:!0}:r):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map=="function"&&(this.#s=e.map)}#h(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#i!==!1&&this.#r===!1&&(this.#i=this.#i||{},this.#i[e]=t)}#o(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit("error",new Vd(e,t))}#d(e,t){let r=this.#c;if(this.#u.call(this.#c,e,t),r.stack.length===0&&this.#n){let s=this.#n;this.#f||super.write(s),this.#n=null,this.#e=0}}#a(e){let t=this.#c;if(this.#n=e,!this.#f)return;let r=0,s=0,n=!1;for(;r<this.#f.length;){let c=this.#f[r];if(s++,c&&!c.recurse){let u=s===t.stack.length?t:t.stack[s];if(!u)return;if(!KB(c,u.key)){this.#h(u.key,e);return}n=!!c.emitKey,r++}else{if(r++,r>=this.#f.length)return;let u=this.#f[r];if(!u)return;for(;;){let l=s===t.stack.length?t:t.stack[s];if(!l)return;if(KB(u,l.key)){r++,Object.isFrozen(t.stack[s])||(t.stack[s].value=null);break}else this.#h(l.key,e);s++}}}if(this.#r){let c=this.#r;this.#r=!1,this.emit("header",c)}if(s!==t.stack.length)return;this.#e++;let a=t.stack.slice(1).map(c=>c.key).concat([t.key]);if(e!=null){let c=this.#s?this.#s(e,a):e;if(c!=null){let u=n?{value:c}:c;n&&(u.key=t.key),super.write(u)}}t.value&&delete t.value[t.key];for(let c of t.stack)c.value=null}write(e,t){if(typeof e=="string")e=Buffer.from(e,t);else if(!Buffer.isBuffer(e))return this.emit("error",new TypeError("Can only parse JSON from string or buffer input"));return this.#c.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let r=this.#r;this.#r=null;let s=this.#i;return this.#i=null,r&&this.emit("header",r),s&&this.emit("footer",s),super.end()}static get JSONStreamError(){return Vd}static parse(e,t){return new i({path:e,map:t})}};ZB.exports=J_});var K_=d((xwe,Fo)=>{"use strict";var{HttpErrorAuthOTP:Ote}=vw(),vte=sL(),QB=uL(),Cte=lu(),Rte=YB(),Ate=Hn(),Tte=require("querystring"),zd=require("url"),XB=Lc(),{Minipass:Nte}=te(),Hd=Uw(),Pte=o(i=>{try{return!!new zd.URL(i)}catch{return!1}},"urlIsValid");Fo.exports=Gd;function Gd(i,e={}){let t={...Hd,...e},r=Pte(i),s=t.registry||Hd.registry;r||(s=t.registry=t.spec&&ek(t.spec,t)||t.registry||s,i=`${s.trim().replace(/\/?$/g,"")}/${i.trim().replace(/^\//,"")}`,new zd.URL(i));let n=t.method||"GET",a=Date.now(),c=QB(i,t),u=Mte(i,c,t),l=t.body,h=Nte.isStream(l),f=l&&typeof l=="object"&&typeof l.then=="function";if(l&&!h&&!f&&typeof l!="string"&&!Buffer.isBuffer(l)?(u["content-type"]=u["content-type"]||"application/json",l=JSON.stringify(l)):l&&!u["content-type"]&&(u["content-type"]="application/octet-stream"),t.gzip)if(u["content-encoding"]="gzip",h){let y=new XB.Gzip;l.on("error",g=>y.emit("error",g)),l=l.pipe(y)}else f||(l=new XB.Gzip().end(l).concat());let p=new zd.URL(i);if(t.query){let y=typeof t.query=="string"?Tte.parse(t.query):t.query;Object.keys(y).forEach(g=>{y[g]!==void 0&&p.searchParams.set(g,y[g])}),i=zd.format(p)}p.searchParams.get("write")==="true"&&n==="GET"&&(t.offline=!1,t.preferOffline=!1,t.preferOnline=!0);let m=o(async y=>{let g=Cte(i,{agent:t.agent,algorithms:t.algorithms,body:y,cache:Lte(t),cachePath:t.cache,ca:t.ca,cert:c.cert||t.cert,headers:u,integrity:t.integrity,key:c.key||t.key,localAddress:t.localAddress,maxSockets:t.maxSockets,memoize:t.memoize,method:n,noProxy:t.noProxy,proxy:t.httpsProxy||t.proxy,retry:t.retry?t.retry:{retries:t.fetchRetries,factor:t.fetchRetryFactor,minTimeout:t.fetchRetryMintimeout,maxTimeout:t.fetchRetryMaxtimeout},strictSSL:t.strictSSL,timeout:t.timeout||3e4}).then(S=>vte({method:n,uri:i,res:S,registry:s,startTime:a,auth:c,opts:t}));return typeof t.otpPrompt=="function"?g.catch(async S=>{if(S instanceof Ote){let E;try{E=await t.otpPrompt()}catch{}if(!E)throw S;return Gd(i,{...t,otp:E})}throw S}):g},"doFetch");return Promise.resolve(l).then(m)}o(Gd,"regFetch");Fo.exports.getAuth=QB;Fo.exports.json=Dte;function Dte(i,e){return Gd(i,e).then(t=>t.json())}o(Dte,"fetchJSON");Fo.exports.json.stream=xte;function xte(i,e,t={}){let r={...Hd,...t},s=Rte.parse(e,r.mapJSON);return Gd(i,r).then(n=>n.body.on("error",a=>s.emit("error",a)).pipe(s)).catch(n=>s.emit("error",n)),s}o(xte,"fetchJSONStream");Fo.exports.pickRegistry=ek;function ek(i,e={}){i=Ate(i);let t=i.scope&&e[i.scope.replace(/^@?/,"@")+":registry"];return!t&&e.scope&&(t=e[e.scope.replace(/^@?/,"@")+":registry"]),t||(t=e.registry||Hd.registry),t}o(ek,"pickRegistry");function Lte(i){return i.offline?"only-if-cached":i.preferOffline?"force-cache":i.preferOnline?"no-cache":"default"}o(Lte,"getCacheMode");function Mte(i,e,t){let r=Object.assign({"user-agent":t.userAgent},t.headers||{});return t.authType&&(r["npm-auth-type"]=t.authType),t.scope&&(r["npm-scope"]=t.scope),t.npmSession&&(r["npm-session"]=t.npmSession),t.npmCommand&&(r["npm-command"]=t.npmCommand),e.token?r.authorization=`Bearer ${e.token}`:e.auth&&(r.authorization=`Basic ${e.auth}`),t.otp&&(r["npm-otp"]=t.otp),r}o(Mte,"getHeaders")});var Z_=d((Mwe,Bte)=>{Bte.exports={name:"pacote",version:"21.0.1",description:"JavaScript package downloader",author:"GitHub Inc.",bin:{pacote:"bin/index.js"},license:"ISC",main:"lib/index.js",scripts:{test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{timeout:300,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/arborist":"^9.0.2","@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","hosted-git-info":"^9.0.0","mutate-fs":"^2.1.1",nock:"^13.2.4","npm-registry-mock":"^1.3.2",rimraf:"^6.0.1",tap:"^16.0.1"},files:["bin/","lib/"],keywords:["packages","npm","git"],dependencies:{"@npmcli/git":"^6.0.0","@npmcli/installed-package-contents":"^3.0.0","@npmcli/package-json":"^7.0.0","@npmcli/promise-spawn":"^8.0.0","@npmcli/run-script":"^10.0.0",cacache:"^20.0.0","fs-minipass":"^3.0.0",minipass:"^7.0.2","npm-package-arg":"^13.0.0","npm-packlist":"^10.0.1","npm-pick-manifest":"^10.0.0","npm-registry-fetch":"^19.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",sigstore:"^4.0.0",ssri:"^12.0.0",tar:"^7.4.3"},engines:{node:"^20.17.0 || >=22.9.0"},repository:{type:"git",url:"git+https://github.com/npm/pacote.git"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.4",windowsCI:!1,publish:"true"}}});var hu=d((Bwe,sk)=>{var kte=K_(),{Minipass:Fte}=te(),Ute=Fs(),tk=Eo(),ik=ks(),rk=Z_().version,Y_=class extends Ute{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let r=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===r.host)&&(this.resolved=new URL(r.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[ik.cacheFetches](){return!1}[ik.tarballFromResolved](){let e=new Fte;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return kte(this.resolved,t).then(r=>{r.body.on("error",s=>e.emit("error",s)),r.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),r.body.pipe(e)}).catch(r=>e.emit("error",r)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${rk} node/${process.version}`,...this.opts.headers||{},"pacote-version":rk,"pacote-req-type":"tarball","pacote-pkg-id":this.pkgid,...this.integrity?{"pacote-integrity":String(this.integrity)}:{},...this.opts.headers||{}}}get types(){return["remote"]}packument(){return tk.prototype.packument.apply(this)}manifest(){return tk.prototype.manifest.apply(this)}};sk.exports=Y_});var ok=d((Fwe,nk)=>{var jte=o((i,e)=>{if(i.hosted){let t=i.hosted,r={noCommittish:!0};return`${t.https&&t.auth?t.https(r):t.shortcut(r)}#${e}`}else return i.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");nk.exports=jte});var ck=d((jwe,ak)=>{var $te=jl();ak.exports=(i,e,t,r,s)=>{let n=i.endsWith(".js"),a=n?process.execPath:i,c=(n?[i]:[]).concat(e);return $te(a,c,{cwd:t,env:r},s)}});var Q_=d(($we,fk)=>{var qte=bc(),Wd=_y(),Vte=Hn(),zte=ih(),{Minipass:Hte}=te(),{log:uk}=_t(),Gte=Kf(),Wte=Fs(),lk=Eo(),Jte=hu(),Jd=ks(),Kte=ok(),Zte=ck(),Yte=/^[a-f0-9]{40}$/,Kd=o((i,e)=>i.sshurl&&!(i.https&&i.auth)&&hk(i.sshurl(e))||i.https&&hk(i.https(e)),"repoUrl"),hk=o(i=>i&&`git+${i}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),X_=class extends Wte{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,uk.warn(`skipping integrity check for git dependency ${this.spec.fetchSpec}`)),this.resolvedRef=null,this.spec.hosted&&(this.from=this.spec.hosted.shortcut({noCommittish:!1})),this.spec.gitCommittish&&Yte.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?Kd(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return Kd(e,t)}get types(){return["git"]}resolve(){if(this.resolved)return super.resolve();let e=this.spec.hosted;return e?this.#e(e):this.#t(this.spec.fetchSpec)}#e(e){return this.#t(e.https&&e.https()).catch(t=>{if(t instanceof Wd.errors.GitPathspecError)throw t;let r=e.sshurl&&e.sshurl();if(!r||e.auth)throw t;return this.#t(r)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,r=this.spec.name;return Wd.revs(e,this.opts).then(s=>t?zte({versions:s.versions,"dist-tags":s["dist-tags"],name:r},t,this.opts):this.spec.gitCommittish?s.refs[this.spec.gitCommittish]||s.refs[s.shas[this.spec.gitCommittish]]:s.refs.HEAD).then(s=>!s||!s.sha?this.#s():(this.resolvedRef=s,this.resolvedSha=s.sha,this.#r(s.sha),this.resolved))}#i(e){this.resolved=this.spec.hosted?Kd(Vte(e).hosted,{noCommittish:!1}):e}#r(e){this.#i(Kte(this.spec,e))}#s(){return this.#c(()=>this.resolved)}#u(e){return this[Jd.readPackageJson](e).then(t=>{let r=t.scripts;if(!t.workspaces&&(!r||!(r.postinstall||r.build||r.preinstall||r.install||r.prepack||r.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
|
|
57
|
-
`):[];if(s.includes(this.resolved)){
|
|
58
|
-
`)},{message:"git dep preparation failed"})})}[Jd.tarballFromResolved](){let e=new Hte;return e.resolved=this.resolved,e.from=this.from,this.#c(t=>this.#u(t).then(()=>new Promise((r,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new Gte(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[Jd.tarballFromResolved]();a.on("error",s),a.on("end",r),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#c(e,t=!0){let r={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===Kd(n,{noCommittish:!1})&&n.tarball,qte.tmp.withTmp(this.cache,r,async c=>{if(t){let l=this.spec.name?`${this.spec.name}@`:"";return new Jte(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${l}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#c(e,!1);throw h})}let u=await(n?this.#f(s,c):this.#n(this.spec.fetchSpec,s,c));return this.resolvedSha=u,this.resolved||await this.#r(u),e(c)})}#f(e,t){let r=this.spec.hosted;return this.#n(r.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof Wd.errors.GitPathspecError)throw s;let n=r.sshurl&&r.sshurl({noCommittish:!0});if(!n||r.auth)throw s;return this.#n(n,e,t)})}#n(e,t,r){let{opts:s,spec:n}=this;return Wd.clone(e,t,r,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?lk.prototype.manifest.apply(this):this.#c(e=>this[Jd.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return lk.prototype.packument.apply(this)}};fk.exports=X_});var eb=d(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.Signature=Hr.Envelope=void 0;Hr.Envelope={fromJSON(i){return{payload:Zd(i.payload)?Buffer.from(dk(i.payload)):Buffer.alloc(0),payloadType:Zd(i.payloadType)?globalThis.String(i.payloadType):"",signatures:globalThis.Array.isArray(i?.signatures)?i.signatures.map(e=>Hr.Signature.fromJSON(e)):[]}},toJSON(i){let e={};return i.payload.length!==0&&(e.payload=pk(i.payload)),i.payloadType!==""&&(e.payloadType=i.payloadType),i.signatures?.length&&(e.signatures=i.signatures.map(t=>Hr.Signature.toJSON(t))),e}};Hr.Signature={fromJSON(i){return{sig:Zd(i.sig)?Buffer.from(dk(i.sig)):Buffer.alloc(0),keyid:Zd(i.keyid)?globalThis.String(i.keyid):""}},toJSON(i){let e={};return i.sig.length!==0&&(e.sig=pk(i.sig)),i.keyid!==""&&(e.keyid=i.keyid),e}};function dk(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(dk,"bytesFromBase64");function pk(i){return globalThis.Buffer.from(i).toString("base64")}o(pk,"base64FromBytes");function Zd(i){return i!=null}o(Zd,"isSet")});var gk=d(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.Timestamp=void 0;Yd.Timestamp={fromJSON(i){return{seconds:mk(i.seconds)?globalThis.String(i.seconds):"0",nanos:mk(i.nanos)?globalThis.Number(i.nanos):0}},toJSON(i){let e={};return i.seconds!=="0"&&(e.seconds=i.seconds),i.nanos!==0&&(e.nanos=Math.round(i.nanos)),e}};function mk(i){return i!=null}o(mk,"isSet")});var Uo=d(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.TimeRange=x.X509CertificateChain=x.SubjectAlternativeName=x.X509Certificate=x.DistinguishedName=x.ObjectIdentifierValuePair=x.ObjectIdentifier=x.PublicKeyIdentifier=x.PublicKey=x.RFC3161SignedTimestamp=x.LogId=x.MessageSignature=x.HashOutput=x.SubjectAlternativeNameType=x.PublicKeyDetails=x.HashAlgorithm=void 0;x.hashAlgorithmFromJSON=Sk;x.hashAlgorithmToJSON=Ek;x.publicKeyDetailsFromJSON=wk;x.publicKeyDetailsToJSON=_k;x.subjectAlternativeNameTypeFromJSON=bk;x.subjectAlternativeNameTypeToJSON=Ik;var Xte=gk(),at;(function(i){i[i.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",i[i.SHA2_256=1]="SHA2_256",i[i.SHA2_384=2]="SHA2_384",i[i.SHA2_512=3]="SHA2_512",i[i.SHA3_256=4]="SHA3_256",i[i.SHA3_384=5]="SHA3_384"})(at||(x.HashAlgorithm=at={}));function Sk(i){switch(i){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return at.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return at.SHA2_256;case 2:case"SHA2_384":return at.SHA2_384;case 3:case"SHA2_512":return at.SHA2_512;case 4:case"SHA3_256":return at.SHA3_256;case 5:case"SHA3_384":return at.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(Sk,"hashAlgorithmFromJSON");function Ek(i){switch(i){case at.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case at.SHA2_256:return"SHA2_256";case at.SHA2_384:return"SHA2_384";case at.SHA2_512:return"SHA2_512";case at.SHA3_256:return"SHA3_256";case at.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(Ek,"hashAlgorithmToJSON");var D;(function(i){i[i.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",i[i.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",i[i.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",i[i.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",i[i.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",i[i.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",i[i.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",i[i.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",i[i.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",i[i.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",i[i.PKIX_RSA_PSS_4096_SHA256=18]="PKIX_RSA_PSS_4096_SHA256",i[i.PKIX_ECDSA_P256_HMAC_SHA_256=6]="PKIX_ECDSA_P256_HMAC_SHA_256",i[i.PKIX_ECDSA_P256_SHA_256=5]="PKIX_ECDSA_P256_SHA_256",i[i.PKIX_ECDSA_P384_SHA_384=12]="PKIX_ECDSA_P384_SHA_384",i[i.PKIX_ECDSA_P521_SHA_512=13]="PKIX_ECDSA_P521_SHA_512",i[i.PKIX_ED25519=7]="PKIX_ED25519",i[i.PKIX_ED25519_PH=8]="PKIX_ED25519_PH",i[i.PKIX_ECDSA_P384_SHA_256=19]="PKIX_ECDSA_P384_SHA_256",i[i.PKIX_ECDSA_P521_SHA_256=20]="PKIX_ECDSA_P521_SHA_256",i[i.LMS_SHA256=14]="LMS_SHA256",i[i.LMOTS_SHA256=15]="LMOTS_SHA256",i[i.ML_DSA_65=21]="ML_DSA_65",i[i.ML_DSA_87=22]="ML_DSA_87"})(D||(x.PublicKeyDetails=D={}));function wk(i){switch(i){case 0:case"PUBLIC_KEY_DETAILS_UNSPECIFIED":return D.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case"PKCS1_RSA_PKCS1V5":return D.PKCS1_RSA_PKCS1V5;case 2:case"PKCS1_RSA_PSS":return D.PKCS1_RSA_PSS;case 3:case"PKIX_RSA_PKCS1V5":return D.PKIX_RSA_PKCS1V5;case 4:case"PKIX_RSA_PSS":return D.PKIX_RSA_PSS;case 9:case"PKIX_RSA_PKCS1V15_2048_SHA256":return D.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case"PKIX_RSA_PKCS1V15_3072_SHA256":return D.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case"PKIX_RSA_PKCS1V15_4096_SHA256":return D.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case"PKIX_RSA_PSS_2048_SHA256":return D.PKIX_RSA_PSS_2048_SHA256;case 17:case"PKIX_RSA_PSS_3072_SHA256":return D.PKIX_RSA_PSS_3072_SHA256;case 18:case"PKIX_RSA_PSS_4096_SHA256":return D.PKIX_RSA_PSS_4096_SHA256;case 6:case"PKIX_ECDSA_P256_HMAC_SHA_256":return D.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case"PKIX_ECDSA_P256_SHA_256":return D.PKIX_ECDSA_P256_SHA_256;case 12:case"PKIX_ECDSA_P384_SHA_384":return D.PKIX_ECDSA_P384_SHA_384;case 13:case"PKIX_ECDSA_P521_SHA_512":return D.PKIX_ECDSA_P521_SHA_512;case 7:case"PKIX_ED25519":return D.PKIX_ED25519;case 8:case"PKIX_ED25519_PH":return D.PKIX_ED25519_PH;case 19:case"PKIX_ECDSA_P384_SHA_256":return D.PKIX_ECDSA_P384_SHA_256;case 20:case"PKIX_ECDSA_P521_SHA_256":return D.PKIX_ECDSA_P521_SHA_256;case 14:case"LMS_SHA256":return D.LMS_SHA256;case 15:case"LMOTS_SHA256":return D.LMOTS_SHA256;case 21:case"ML_DSA_65":return D.ML_DSA_65;case 22:case"ML_DSA_87":return D.ML_DSA_87;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(wk,"publicKeyDetailsFromJSON");function _k(i){switch(i){case D.PUBLIC_KEY_DETAILS_UNSPECIFIED:return"PUBLIC_KEY_DETAILS_UNSPECIFIED";case D.PKCS1_RSA_PKCS1V5:return"PKCS1_RSA_PKCS1V5";case D.PKCS1_RSA_PSS:return"PKCS1_RSA_PSS";case D.PKIX_RSA_PKCS1V5:return"PKIX_RSA_PKCS1V5";case D.PKIX_RSA_PSS:return"PKIX_RSA_PSS";case D.PKIX_RSA_PKCS1V15_2048_SHA256:return"PKIX_RSA_PKCS1V15_2048_SHA256";case D.PKIX_RSA_PKCS1V15_3072_SHA256:return"PKIX_RSA_PKCS1V15_3072_SHA256";case D.PKIX_RSA_PKCS1V15_4096_SHA256:return"PKIX_RSA_PKCS1V15_4096_SHA256";case D.PKIX_RSA_PSS_2048_SHA256:return"PKIX_RSA_PSS_2048_SHA256";case D.PKIX_RSA_PSS_3072_SHA256:return"PKIX_RSA_PSS_3072_SHA256";case D.PKIX_RSA_PSS_4096_SHA256:return"PKIX_RSA_PSS_4096_SHA256";case D.PKIX_ECDSA_P256_HMAC_SHA_256:return"PKIX_ECDSA_P256_HMAC_SHA_256";case D.PKIX_ECDSA_P256_SHA_256:return"PKIX_ECDSA_P256_SHA_256";case D.PKIX_ECDSA_P384_SHA_384:return"PKIX_ECDSA_P384_SHA_384";case D.PKIX_ECDSA_P521_SHA_512:return"PKIX_ECDSA_P521_SHA_512";case D.PKIX_ED25519:return"PKIX_ED25519";case D.PKIX_ED25519_PH:return"PKIX_ED25519_PH";case D.PKIX_ECDSA_P384_SHA_256:return"PKIX_ECDSA_P384_SHA_256";case D.PKIX_ECDSA_P521_SHA_256:return"PKIX_ECDSA_P521_SHA_256";case D.LMS_SHA256:return"LMS_SHA256";case D.LMOTS_SHA256:return"LMOTS_SHA256";case D.ML_DSA_65:return"ML_DSA_65";case D.ML_DSA_87:return"ML_DSA_87";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(_k,"publicKeyDetailsToJSON");var Ti;(function(i){i[i.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]="SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED",i[i.EMAIL=1]="EMAIL",i[i.URI=2]="URI",i[i.OTHER_NAME=3]="OTHER_NAME"})(Ti||(x.SubjectAlternativeNameType=Ti={}));function bk(i){switch(i){case 0:case"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED":return Ti.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case"EMAIL":return Ti.EMAIL;case 2:case"URI":return Ti.URI;case 3:case"OTHER_NAME":return Ti.OTHER_NAME;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(bk,"subjectAlternativeNameTypeFromJSON");function Ik(i){switch(i){case Ti.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED";case Ti.EMAIL:return"EMAIL";case Ti.URI:return"URI";case Ti.OTHER_NAME:return"OTHER_NAME";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(Ik,"subjectAlternativeNameTypeToJSON");x.HashOutput={fromJSON(i){return{algorithm:we(i.algorithm)?Sk(i.algorithm):0,digest:we(i.digest)?Buffer.from(Xs(i.digest)):Buffer.alloc(0)}},toJSON(i){let e={};return i.algorithm!==0&&(e.algorithm=Ek(i.algorithm)),i.digest.length!==0&&(e.digest=Qs(i.digest)),e}};x.MessageSignature={fromJSON(i){return{messageDigest:we(i.messageDigest)?x.HashOutput.fromJSON(i.messageDigest):void 0,signature:we(i.signature)?Buffer.from(Xs(i.signature)):Buffer.alloc(0)}},toJSON(i){let e={};return i.messageDigest!==void 0&&(e.messageDigest=x.HashOutput.toJSON(i.messageDigest)),i.signature.length!==0&&(e.signature=Qs(i.signature)),e}};x.LogId={fromJSON(i){return{keyId:we(i.keyId)?Buffer.from(Xs(i.keyId)):Buffer.alloc(0)}},toJSON(i){let e={};return i.keyId.length!==0&&(e.keyId=Qs(i.keyId)),e}};x.RFC3161SignedTimestamp={fromJSON(i){return{signedTimestamp:we(i.signedTimestamp)?Buffer.from(Xs(i.signedTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedTimestamp.length!==0&&(e.signedTimestamp=Qs(i.signedTimestamp)),e}};x.PublicKey={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Xs(i.rawBytes)):void 0,keyDetails:we(i.keyDetails)?wk(i.keyDetails):0,validFor:we(i.validFor)?x.TimeRange.fromJSON(i.validFor):void 0}},toJSON(i){let e={};return i.rawBytes!==void 0&&(e.rawBytes=Qs(i.rawBytes)),i.keyDetails!==0&&(e.keyDetails=_k(i.keyDetails)),i.validFor!==void 0&&(e.validFor=x.TimeRange.toJSON(i.validFor)),e}};x.PublicKeyIdentifier={fromJSON(i){return{hint:we(i.hint)?globalThis.String(i.hint):""}},toJSON(i){let e={};return i.hint!==""&&(e.hint=i.hint),e}};x.ObjectIdentifier={fromJSON(i){return{id:globalThis.Array.isArray(i?.id)?i.id.map(e=>globalThis.Number(e)):[]}},toJSON(i){let e={};return i.id?.length&&(e.id=i.id.map(t=>Math.round(t))),e}};x.ObjectIdentifierValuePair={fromJSON(i){return{oid:we(i.oid)?x.ObjectIdentifier.fromJSON(i.oid):void 0,value:we(i.value)?Buffer.from(Xs(i.value)):Buffer.alloc(0)}},toJSON(i){let e={};return i.oid!==void 0&&(e.oid=x.ObjectIdentifier.toJSON(i.oid)),i.value.length!==0&&(e.value=Qs(i.value)),e}};x.DistinguishedName={fromJSON(i){return{organization:we(i.organization)?globalThis.String(i.organization):"",commonName:we(i.commonName)?globalThis.String(i.commonName):""}},toJSON(i){let e={};return i.organization!==""&&(e.organization=i.organization),i.commonName!==""&&(e.commonName=i.commonName),e}};x.X509Certificate={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Xs(i.rawBytes)):Buffer.alloc(0)}},toJSON(i){let e={};return i.rawBytes.length!==0&&(e.rawBytes=Qs(i.rawBytes)),e}};x.SubjectAlternativeName={fromJSON(i){return{type:we(i.type)?bk(i.type):0,identity:we(i.regexp)?{$case:"regexp",regexp:globalThis.String(i.regexp)}:we(i.value)?{$case:"value",value:globalThis.String(i.value)}:void 0}},toJSON(i){let e={};return i.type!==0&&(e.type=Ik(i.type)),i.identity?.$case==="regexp"?e.regexp=i.identity.regexp:i.identity?.$case==="value"&&(e.value=i.identity.value),e}};x.X509CertificateChain={fromJSON(i){return{certificates:globalThis.Array.isArray(i?.certificates)?i.certificates.map(e=>x.X509Certificate.fromJSON(e)):[]}},toJSON(i){let e={};return i.certificates?.length&&(e.certificates=i.certificates.map(t=>x.X509Certificate.toJSON(t))),e}};x.TimeRange={fromJSON(i){return{start:we(i.start)?yk(i.start):void 0,end:we(i.end)?yk(i.end):void 0}},toJSON(i){let e={};return i.start!==void 0&&(e.start=i.start.toISOString()),i.end!==void 0&&(e.end=i.end.toISOString()),e}};function Xs(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(Xs,"bytesFromBase64");function Qs(i){return globalThis.Buffer.from(i).toString("base64")}o(Qs,"base64FromBytes");function Qte(i){let e=(globalThis.Number(i.seconds)||0)*1e3;return e+=(i.nanos||0)/1e6,new globalThis.Date(e)}o(Qte,"fromTimestamp");function yk(i){return i instanceof globalThis.Date?i:typeof i=="string"?new globalThis.Date(i):Qte(Xte.Timestamp.fromJSON(i))}o(yk,"fromJsonTimestamp");function we(i){return i!=null}o(we,"isSet")});var tb=d(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.TransparencyLogEntry=_e.InclusionPromise=_e.InclusionProof=_e.Checkpoint=_e.KindVersion=void 0;var Ok=Uo();_e.KindVersion={fromJSON(i){return{kind:Ze(i.kind)?globalThis.String(i.kind):"",version:Ze(i.version)?globalThis.String(i.version):""}},toJSON(i){let e={};return i.kind!==""&&(e.kind=i.kind),i.version!==""&&(e.version=i.version),e}};_e.Checkpoint={fromJSON(i){return{envelope:Ze(i.envelope)?globalThis.String(i.envelope):""}},toJSON(i){let e={};return i.envelope!==""&&(e.envelope=i.envelope),e}};_e.InclusionProof={fromJSON(i){return{logIndex:Ze(i.logIndex)?globalThis.String(i.logIndex):"0",rootHash:Ze(i.rootHash)?Buffer.from(Xd(i.rootHash)):Buffer.alloc(0),treeSize:Ze(i.treeSize)?globalThis.String(i.treeSize):"0",hashes:globalThis.Array.isArray(i?.hashes)?i.hashes.map(e=>Buffer.from(Xd(e))):[],checkpoint:Ze(i.checkpoint)?_e.Checkpoint.fromJSON(i.checkpoint):void 0}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.rootHash.length!==0&&(e.rootHash=Qd(i.rootHash)),i.treeSize!=="0"&&(e.treeSize=i.treeSize),i.hashes?.length&&(e.hashes=i.hashes.map(t=>Qd(t))),i.checkpoint!==void 0&&(e.checkpoint=_e.Checkpoint.toJSON(i.checkpoint)),e}};_e.InclusionPromise={fromJSON(i){return{signedEntryTimestamp:Ze(i.signedEntryTimestamp)?Buffer.from(Xd(i.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=Qd(i.signedEntryTimestamp)),e}};_e.TransparencyLogEntry={fromJSON(i){return{logIndex:Ze(i.logIndex)?globalThis.String(i.logIndex):"0",logId:Ze(i.logId)?Ok.LogId.fromJSON(i.logId):void 0,kindVersion:Ze(i.kindVersion)?_e.KindVersion.fromJSON(i.kindVersion):void 0,integratedTime:Ze(i.integratedTime)?globalThis.String(i.integratedTime):"0",inclusionPromise:Ze(i.inclusionPromise)?_e.InclusionPromise.fromJSON(i.inclusionPromise):void 0,inclusionProof:Ze(i.inclusionProof)?_e.InclusionProof.fromJSON(i.inclusionProof):void 0,canonicalizedBody:Ze(i.canonicalizedBody)?Buffer.from(Xd(i.canonicalizedBody)):Buffer.alloc(0)}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.logId!==void 0&&(e.logId=Ok.LogId.toJSON(i.logId)),i.kindVersion!==void 0&&(e.kindVersion=_e.KindVersion.toJSON(i.kindVersion)),i.integratedTime!=="0"&&(e.integratedTime=i.integratedTime),i.inclusionPromise!==void 0&&(e.inclusionPromise=_e.InclusionPromise.toJSON(i.inclusionPromise)),i.inclusionProof!==void 0&&(e.inclusionProof=_e.InclusionProof.toJSON(i.inclusionProof)),i.canonicalizedBody.length!==0&&(e.canonicalizedBody=Qd(i.canonicalizedBody)),e}};function Xd(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(Xd,"bytesFromBase64");function Qd(i){return globalThis.Buffer.from(i).toString("base64")}o(Qd,"base64FromBytes");function Ze(i){return i!=null}o(Ze,"isSet")});var ib=d(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.Bundle=Ut.VerificationMaterial=Ut.TimestampVerificationData=void 0;var vk=eb(),Ni=Uo(),Ck=tb();Ut.TimestampVerificationData={fromJSON(i){return{rfc3161Timestamps:globalThis.Array.isArray(i?.rfc3161Timestamps)?i.rfc3161Timestamps.map(e=>Ni.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(i){let e={};return i.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=i.rfc3161Timestamps.map(t=>Ni.RFC3161SignedTimestamp.toJSON(t))),e}};Ut.VerificationMaterial={fromJSON(i){return{content:Gr(i.publicKey)?{$case:"publicKey",publicKey:Ni.PublicKeyIdentifier.fromJSON(i.publicKey)}:Gr(i.x509CertificateChain)?{$case:"x509CertificateChain",x509CertificateChain:Ni.X509CertificateChain.fromJSON(i.x509CertificateChain)}:Gr(i.certificate)?{$case:"certificate",certificate:Ni.X509Certificate.fromJSON(i.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(i?.tlogEntries)?i.tlogEntries.map(e=>Ck.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:Gr(i.timestampVerificationData)?Ut.TimestampVerificationData.fromJSON(i.timestampVerificationData):void 0}},toJSON(i){let e={};return i.content?.$case==="publicKey"?e.publicKey=Ni.PublicKeyIdentifier.toJSON(i.content.publicKey):i.content?.$case==="x509CertificateChain"?e.x509CertificateChain=Ni.X509CertificateChain.toJSON(i.content.x509CertificateChain):i.content?.$case==="certificate"&&(e.certificate=Ni.X509Certificate.toJSON(i.content.certificate)),i.tlogEntries?.length&&(e.tlogEntries=i.tlogEntries.map(t=>Ck.TransparencyLogEntry.toJSON(t))),i.timestampVerificationData!==void 0&&(e.timestampVerificationData=Ut.TimestampVerificationData.toJSON(i.timestampVerificationData)),e}};Ut.Bundle={fromJSON(i){return{mediaType:Gr(i.mediaType)?globalThis.String(i.mediaType):"",verificationMaterial:Gr(i.verificationMaterial)?Ut.VerificationMaterial.fromJSON(i.verificationMaterial):void 0,content:Gr(i.messageSignature)?{$case:"messageSignature",messageSignature:Ni.MessageSignature.fromJSON(i.messageSignature)}:Gr(i.dsseEnvelope)?{$case:"dsseEnvelope",dsseEnvelope:vk.Envelope.fromJSON(i.dsseEnvelope)}:void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.verificationMaterial!==void 0&&(e.verificationMaterial=Ut.VerificationMaterial.toJSON(i.verificationMaterial)),i.content?.$case==="messageSignature"?e.messageSignature=Ni.MessageSignature.toJSON(i.content.messageSignature):i.content?.$case==="dsseEnvelope"&&(e.dsseEnvelope=vk.Envelope.toJSON(i.content.dsseEnvelope)),e}};function Gr(i){return i!=null}o(Gr,"isSet")});var rb=d(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ClientTrustConfig=L.ServiceConfiguration=L.Service=L.SigningConfig=L.TrustedRoot=L.CertificateAuthority=L.TransparencyLogInstance=L.ServiceSelector=void 0;L.serviceSelectorFromJSON=Rk;L.serviceSelectorToJSON=Ak;var qe=Uo(),Pi;(function(i){i[i.SERVICE_SELECTOR_UNDEFINED=0]="SERVICE_SELECTOR_UNDEFINED",i[i.ALL=1]="ALL",i[i.ANY=2]="ANY",i[i.EXACT=3]="EXACT"})(Pi||(L.ServiceSelector=Pi={}));function Rk(i){switch(i){case 0:case"SERVICE_SELECTOR_UNDEFINED":return Pi.SERVICE_SELECTOR_UNDEFINED;case 1:case"ALL":return Pi.ALL;case 2:case"ANY":return Pi.ANY;case 3:case"EXACT":return Pi.EXACT;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(Rk,"serviceSelectorFromJSON");function Ak(i){switch(i){case Pi.SERVICE_SELECTOR_UNDEFINED:return"SERVICE_SELECTOR_UNDEFINED";case Pi.ALL:return"ALL";case Pi.ANY:return"ANY";case Pi.EXACT:return"EXACT";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(Ak,"serviceSelectorToJSON");L.TransparencyLogInstance={fromJSON(i){return{baseUrl:ae(i.baseUrl)?globalThis.String(i.baseUrl):"",hashAlgorithm:ae(i.hashAlgorithm)?(0,qe.hashAlgorithmFromJSON)(i.hashAlgorithm):0,publicKey:ae(i.publicKey)?qe.PublicKey.fromJSON(i.publicKey):void 0,logId:ae(i.logId)?qe.LogId.fromJSON(i.logId):void 0,checkpointKeyId:ae(i.checkpointKeyId)?qe.LogId.fromJSON(i.checkpointKeyId):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.baseUrl!==""&&(e.baseUrl=i.baseUrl),i.hashAlgorithm!==0&&(e.hashAlgorithm=(0,qe.hashAlgorithmToJSON)(i.hashAlgorithm)),i.publicKey!==void 0&&(e.publicKey=qe.PublicKey.toJSON(i.publicKey)),i.logId!==void 0&&(e.logId=qe.LogId.toJSON(i.logId)),i.checkpointKeyId!==void 0&&(e.checkpointKeyId=qe.LogId.toJSON(i.checkpointKeyId)),i.operator!==""&&(e.operator=i.operator),e}};L.CertificateAuthority={fromJSON(i){return{subject:ae(i.subject)?qe.DistinguishedName.fromJSON(i.subject):void 0,uri:ae(i.uri)?globalThis.String(i.uri):"",certChain:ae(i.certChain)?qe.X509CertificateChain.fromJSON(i.certChain):void 0,validFor:ae(i.validFor)?qe.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.subject!==void 0&&(e.subject=qe.DistinguishedName.toJSON(i.subject)),i.uri!==""&&(e.uri=i.uri),i.certChain!==void 0&&(e.certChain=qe.X509CertificateChain.toJSON(i.certChain)),i.validFor!==void 0&&(e.validFor=qe.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.TrustedRoot={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",tlogs:globalThis.Array.isArray(i?.tlogs)?i.tlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(i?.certificateAuthorities)?i.certificateAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(i?.ctlogs)?i.ctlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(i?.timestampAuthorities)?i.timestampAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[]}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.tlogs?.length&&(e.tlogs=i.tlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.certificateAuthorities?.length&&(e.certificateAuthorities=i.certificateAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),i.ctlogs?.length&&(e.ctlogs=i.ctlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.timestampAuthorities?.length&&(e.timestampAuthorities=i.timestampAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),e}};L.SigningConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",caUrls:globalThis.Array.isArray(i?.caUrls)?i.caUrls.map(e=>L.Service.fromJSON(e)):[],oidcUrls:globalThis.Array.isArray(i?.oidcUrls)?i.oidcUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogUrls:globalThis.Array.isArray(i?.rekorTlogUrls)?i.rekorTlogUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogConfig:ae(i.rekorTlogConfig)?L.ServiceConfiguration.fromJSON(i.rekorTlogConfig):void 0,tsaUrls:globalThis.Array.isArray(i?.tsaUrls)?i.tsaUrls.map(e=>L.Service.fromJSON(e)):[],tsaConfig:ae(i.tsaConfig)?L.ServiceConfiguration.fromJSON(i.tsaConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.caUrls?.length&&(e.caUrls=i.caUrls.map(t=>L.Service.toJSON(t))),i.oidcUrls?.length&&(e.oidcUrls=i.oidcUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogUrls?.length&&(e.rekorTlogUrls=i.rekorTlogUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogConfig!==void 0&&(e.rekorTlogConfig=L.ServiceConfiguration.toJSON(i.rekorTlogConfig)),i.tsaUrls?.length&&(e.tsaUrls=i.tsaUrls.map(t=>L.Service.toJSON(t))),i.tsaConfig!==void 0&&(e.tsaConfig=L.ServiceConfiguration.toJSON(i.tsaConfig)),e}};L.Service={fromJSON(i){return{url:ae(i.url)?globalThis.String(i.url):"",majorApiVersion:ae(i.majorApiVersion)?globalThis.Number(i.majorApiVersion):0,validFor:ae(i.validFor)?qe.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.url!==""&&(e.url=i.url),i.majorApiVersion!==0&&(e.majorApiVersion=Math.round(i.majorApiVersion)),i.validFor!==void 0&&(e.validFor=qe.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.ServiceConfiguration={fromJSON(i){return{selector:ae(i.selector)?Rk(i.selector):0,count:ae(i.count)?globalThis.Number(i.count):0}},toJSON(i){let e={};return i.selector!==0&&(e.selector=Ak(i.selector)),i.count!==0&&(e.count=Math.round(i.count)),e}};L.ClientTrustConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",trustedRoot:ae(i.trustedRoot)?L.TrustedRoot.fromJSON(i.trustedRoot):void 0,signingConfig:ae(i.signingConfig)?L.SigningConfig.fromJSON(i.signingConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.trustedRoot!==void 0&&(e.trustedRoot=L.TrustedRoot.toJSON(i.trustedRoot)),i.signingConfig!==void 0&&(e.signingConfig=L.SigningConfig.toJSON(i.signingConfig)),e}};function ae(i){return i!=null}o(ae,"isSet")});var Pk=d(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Input=M.Artifact=M.ArtifactVerificationOptions_ObserverTimestampOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions=M.ArtifactVerificationOptions_CtlogOptions=M.ArtifactVerificationOptions_TlogOptions=M.ArtifactVerificationOptions=M.PublicKeyIdentities=M.CertificateIdentities=M.CertificateIdentity=void 0;var Tk=ib(),Wr=Uo(),Nk=rb();M.CertificateIdentity={fromJSON(i){return{issuer:Q(i.issuer)?globalThis.String(i.issuer):"",san:Q(i.san)?Wr.SubjectAlternativeName.fromJSON(i.san):void 0,oids:globalThis.Array.isArray(i?.oids)?i.oids.map(e=>Wr.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(i){let e={};return i.issuer!==""&&(e.issuer=i.issuer),i.san!==void 0&&(e.san=Wr.SubjectAlternativeName.toJSON(i.san)),i.oids?.length&&(e.oids=i.oids.map(t=>Wr.ObjectIdentifierValuePair.toJSON(t))),e}};M.CertificateIdentities={fromJSON(i){return{identities:globalThis.Array.isArray(i?.identities)?i.identities.map(e=>M.CertificateIdentity.fromJSON(e)):[]}},toJSON(i){let e={};return i.identities?.length&&(e.identities=i.identities.map(t=>M.CertificateIdentity.toJSON(t))),e}};M.PublicKeyIdentities={fromJSON(i){return{publicKeys:globalThis.Array.isArray(i?.publicKeys)?i.publicKeys.map(e=>Wr.PublicKey.fromJSON(e)):[]}},toJSON(i){let e={};return i.publicKeys?.length&&(e.publicKeys=i.publicKeys.map(t=>Wr.PublicKey.toJSON(t))),e}};M.ArtifactVerificationOptions={fromJSON(i){return{signers:Q(i.certificateIdentities)?{$case:"certificateIdentities",certificateIdentities:M.CertificateIdentities.fromJSON(i.certificateIdentities)}:Q(i.publicKeys)?{$case:"publicKeys",publicKeys:M.PublicKeyIdentities.fromJSON(i.publicKeys)}:void 0,tlogOptions:Q(i.tlogOptions)?M.ArtifactVerificationOptions_TlogOptions.fromJSON(i.tlogOptions):void 0,ctlogOptions:Q(i.ctlogOptions)?M.ArtifactVerificationOptions_CtlogOptions.fromJSON(i.ctlogOptions):void 0,tsaOptions:Q(i.tsaOptions)?M.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(i.tsaOptions):void 0,integratedTsOptions:Q(i.integratedTsOptions)?M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(i.integratedTsOptions):void 0,observerOptions:Q(i.observerOptions)?M.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(i.observerOptions):void 0}},toJSON(i){let e={};return i.signers?.$case==="certificateIdentities"?e.certificateIdentities=M.CertificateIdentities.toJSON(i.signers.certificateIdentities):i.signers?.$case==="publicKeys"&&(e.publicKeys=M.PublicKeyIdentities.toJSON(i.signers.publicKeys)),i.tlogOptions!==void 0&&(e.tlogOptions=M.ArtifactVerificationOptions_TlogOptions.toJSON(i.tlogOptions)),i.ctlogOptions!==void 0&&(e.ctlogOptions=M.ArtifactVerificationOptions_CtlogOptions.toJSON(i.ctlogOptions)),i.tsaOptions!==void 0&&(e.tsaOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(i.tsaOptions)),i.integratedTsOptions!==void 0&&(e.integratedTsOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(i.integratedTsOptions)),i.observerOptions!==void 0&&(e.observerOptions=M.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(i.observerOptions)),e}};M.ArtifactVerificationOptions_TlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,performOnlineVerification:Q(i.performOnlineVerification)?globalThis.Boolean(i.performOnlineVerification):!1,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.performOnlineVerification!==!1&&(e.performOnlineVerification=i.performOnlineVerification),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_CtlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.Artifact={fromJSON(i){return{data:Q(i.artifactUri)?{$case:"artifactUri",artifactUri:globalThis.String(i.artifactUri)}:Q(i.artifact)?{$case:"artifact",artifact:Buffer.from(eie(i.artifact))}:Q(i.artifactDigest)?{$case:"artifactDigest",artifactDigest:Wr.HashOutput.fromJSON(i.artifactDigest)}:void 0}},toJSON(i){let e={};return i.data?.$case==="artifactUri"?e.artifactUri=i.data.artifactUri:i.data?.$case==="artifact"?e.artifact=tie(i.data.artifact):i.data?.$case==="artifactDigest"&&(e.artifactDigest=Wr.HashOutput.toJSON(i.data.artifactDigest)),e}};M.Input={fromJSON(i){return{artifactTrustRoot:Q(i.artifactTrustRoot)?Nk.TrustedRoot.fromJSON(i.artifactTrustRoot):void 0,artifactVerificationOptions:Q(i.artifactVerificationOptions)?M.ArtifactVerificationOptions.fromJSON(i.artifactVerificationOptions):void 0,bundle:Q(i.bundle)?Tk.Bundle.fromJSON(i.bundle):void 0,artifact:Q(i.artifact)?M.Artifact.fromJSON(i.artifact):void 0}},toJSON(i){let e={};return i.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=Nk.TrustedRoot.toJSON(i.artifactTrustRoot)),i.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=M.ArtifactVerificationOptions.toJSON(i.artifactVerificationOptions)),i.bundle!==void 0&&(e.bundle=Tk.Bundle.toJSON(i.bundle)),i.artifact!==void 0&&(e.artifact=M.Artifact.toJSON(i.artifact)),e}};function eie(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(eie,"bytesFromBase64");function tie(i){return globalThis.Buffer.from(i).toString("base64")}o(tie,"base64FromBytes");function Q(i){return i!=null}o(Q,"isSet")});var fu=d(jt=>{"use strict";var iie=jt&&jt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),jo=jt&&jt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&iie(e,i,t)};Object.defineProperty(jt,"__esModule",{value:!0});jo(eb(),jt);jo(ib(),jt);jo(Uo(),jt);jo(tb(),jt);jo(rb(),jt);jo(Pk(),jt)});var ep=d(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.BUNDLE_V03_MEDIA_TYPE=ct.BUNDLE_V03_LEGACY_MEDIA_TYPE=ct.BUNDLE_V02_MEDIA_TYPE=ct.BUNDLE_V01_MEDIA_TYPE=void 0;ct.isBundleWithCertificateChain=rie;ct.isBundleWithPublicKey=sie;ct.isBundleWithMessageSignature=nie;ct.isBundleWithDsseEnvelope=oie;ct.BUNDLE_V01_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.1";ct.BUNDLE_V02_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.2";ct.BUNDLE_V03_LEGACY_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.3";ct.BUNDLE_V03_MEDIA_TYPE="application/vnd.dev.sigstore.bundle.v0.3+json";function rie(i){return i.verificationMaterial.content.$case==="x509CertificateChain"}o(rie,"isBundleWithCertificateChain");function sie(i){return i.verificationMaterial.content.$case==="publicKey"}o(sie,"isBundleWithPublicKey");function nie(i){return i.content.$case==="messageSignature"}o(nie,"isBundleWithMessageSignature");function oie(i){return i.content.$case==="dsseEnvelope"}o(oie,"isBundleWithDsseEnvelope")});var xk=d(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.toMessageSignatureBundle=cie;ip.toDSSEBundle=uie;var aie=fu(),tp=ep();function cie(i){return{mediaType:i.certificateChain?tp.BUNDLE_V02_MEDIA_TYPE:tp.BUNDLE_V03_MEDIA_TYPE,content:{$case:"messageSignature",messageSignature:{messageDigest:{algorithm:aie.HashAlgorithm.SHA2_256,digest:i.digest},signature:i.signature}},verificationMaterial:Dk(i)}}o(cie,"toMessageSignatureBundle");function uie(i){return{mediaType:i.certificateChain?tp.BUNDLE_V02_MEDIA_TYPE:tp.BUNDLE_V03_MEDIA_TYPE,content:{$case:"dsseEnvelope",dsseEnvelope:lie(i)},verificationMaterial:Dk(i)}}o(uie,"toDSSEBundle");function lie(i){return{payloadType:i.artifactType,payload:i.artifact,signatures:[hie(i)]}}o(lie,"toEnvelope");function hie(i){return{keyid:i.keyHint||"",sig:i.signature}}o(hie,"toSignature");function Dk(i){return{content:fie(i),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}o(Dk,"toVerificationMaterial");function fie(i){return i.certificate?i.certificateChain?{$case:"x509CertificateChain",x509CertificateChain:{certificates:[{rawBytes:i.certificate}]}}:{$case:"certificate",certificate:{rawBytes:i.certificate}}:{$case:"publicKey",publicKey:{hint:i.keyHint||""}}}o(fie,"toKeyContent")});var nb=d(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.ValidationError=void 0;var sb=class extends Error{static{o(this,"ValidationError")}constructor(e,t){super(e),this.fields=t}};rp.ValidationError=sb});var ob=d(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.assertBundle=die;en.assertBundleV01=Lk;en.isBundleV01=pie;en.assertBundleV02=mie;en.assertBundleLatest=gie;var sp=nb();function die(i){let e=np(i);if(e.length>0)throw new sp.ValidationError("invalid bundle",e)}o(die,"assertBundle");function Lk(i){let e=[];if(e.push(...np(i)),e.push(...yie(i)),e.length>0)throw new sp.ValidationError("invalid v0.1 bundle",e)}o(Lk,"assertBundleV01");function pie(i){try{return Lk(i),!0}catch{return!1}}o(pie,"isBundleV01");function mie(i){let e=[];if(e.push(...np(i)),e.push(...Mk(i)),e.length>0)throw new sp.ValidationError("invalid v0.2 bundle",e)}o(mie,"assertBundleV02");function gie(i){let e=[];if(e.push(...np(i)),e.push(...Mk(i)),e.push(...Sie(i)),e.length>0)throw new sp.ValidationError("invalid bundle",e)}o(gie,"assertBundleLatest");function np(i){let e=[];if((i.mediaType===void 0||!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/)&&!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))&&e.push("mediaType"),i.content===void 0)e.push("content");else switch(i.content.$case){case"messageSignature":i.content.messageSignature.messageDigest===void 0?e.push("content.messageSignature.messageDigest"):i.content.messageSignature.messageDigest.digest.length===0&&e.push("content.messageSignature.messageDigest.digest"),i.content.messageSignature.signature.length===0&&e.push("content.messageSignature.signature");break;case"dsseEnvelope":i.content.dsseEnvelope.payload.length===0&&e.push("content.dsseEnvelope.payload"),i.content.dsseEnvelope.signatures.length!==1?e.push("content.dsseEnvelope.signatures"):i.content.dsseEnvelope.signatures[0].sig.length===0&&e.push("content.dsseEnvelope.signatures[0].sig");break}if(i.verificationMaterial===void 0)e.push("verificationMaterial");else{if(i.verificationMaterial.content===void 0)e.push("verificationMaterial.content");else switch(i.verificationMaterial.content.$case){case"x509CertificateChain":i.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push("verificationMaterial.content.x509CertificateChain.certificates"),i.verificationMaterial.content.x509CertificateChain.certificates.forEach((t,r)=>{t.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${r}].rawBytes`)});break;case"certificate":i.verificationMaterial.content.certificate.rawBytes.length===0&&e.push("verificationMaterial.content.certificate.rawBytes");break}i.verificationMaterial.tlogEntries===void 0?e.push("verificationMaterial.tlogEntries"):i.verificationMaterial.tlogEntries.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].logId`),t.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].kindVersion`)})}return e}o(np,"validateBundleBase");function yie(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionPromise`)}),e}o(yie,"validateInclusionPromise");function Mk(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof`):t.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof.checkpoint`)}),e}o(Mk,"validateInclusionProof");function Sie(i){let e=[];return i.verificationMaterial?.content?.$case==="x509CertificateChain"&&e.push("verificationMaterial.content.$case"),e}o(Sie,"validateNoCertificateChain")});var kk=d(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.envelopeToJSON=Di.envelopeFromJSON=Di.bundleToJSON=Di.bundleFromJSON=void 0;var op=fu(),Bk=ep(),ab=ob(),Eie=o(i=>{let e=op.Bundle.fromJSON(i);switch(e.mediaType){case Bk.BUNDLE_V01_MEDIA_TYPE:(0,ab.assertBundleV01)(e);break;case Bk.BUNDLE_V02_MEDIA_TYPE:(0,ab.assertBundleV02)(e);break;default:(0,ab.assertBundleLatest)(e);break}return e},"bundleFromJSON");Di.bundleFromJSON=Eie;var wie=o(i=>op.Bundle.toJSON(i),"bundleToJSON");Di.bundleToJSON=wie;var _ie=o(i=>op.Envelope.fromJSON(i),"envelopeFromJSON");Di.envelopeFromJSON=_ie;var bie=o(i=>op.Envelope.toJSON(i),"envelopeToJSON");Di.envelopeToJSON=bie});var pu=d(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.isBundleV01=k.assertBundleV02=k.assertBundleV01=k.assertBundleLatest=k.assertBundle=k.envelopeToJSON=k.envelopeFromJSON=k.bundleToJSON=k.bundleFromJSON=k.ValidationError=k.isBundleWithPublicKey=k.isBundleWithMessageSignature=k.isBundleWithDsseEnvelope=k.isBundleWithCertificateChain=k.BUNDLE_V03_MEDIA_TYPE=k.BUNDLE_V03_LEGACY_MEDIA_TYPE=k.BUNDLE_V02_MEDIA_TYPE=k.BUNDLE_V01_MEDIA_TYPE=k.toMessageSignatureBundle=k.toDSSEBundle=void 0;var Fk=xk();Object.defineProperty(k,"toDSSEBundle",{enumerable:!0,get:o(function(){return Fk.toDSSEBundle},"get")});Object.defineProperty(k,"toMessageSignatureBundle",{enumerable:!0,get:o(function(){return Fk.toMessageSignatureBundle},"get")});var Jr=ep();Object.defineProperty(k,"BUNDLE_V01_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Jr.BUNDLE_V01_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V02_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Jr.BUNDLE_V02_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_LEGACY_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Jr.BUNDLE_V03_LEGACY_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Jr.BUNDLE_V03_MEDIA_TYPE},"get")});Object.defineProperty(k,"isBundleWithCertificateChain",{enumerable:!0,get:o(function(){return Jr.isBundleWithCertificateChain},"get")});Object.defineProperty(k,"isBundleWithDsseEnvelope",{enumerable:!0,get:o(function(){return Jr.isBundleWithDsseEnvelope},"get")});Object.defineProperty(k,"isBundleWithMessageSignature",{enumerable:!0,get:o(function(){return Jr.isBundleWithMessageSignature},"get")});Object.defineProperty(k,"isBundleWithPublicKey",{enumerable:!0,get:o(function(){return Jr.isBundleWithPublicKey},"get")});var Iie=nb();Object.defineProperty(k,"ValidationError",{enumerable:!0,get:o(function(){return Iie.ValidationError},"get")});var ap=kk();Object.defineProperty(k,"bundleFromJSON",{enumerable:!0,get:o(function(){return ap.bundleFromJSON},"get")});Object.defineProperty(k,"bundleToJSON",{enumerable:!0,get:o(function(){return ap.bundleToJSON},"get")});Object.defineProperty(k,"envelopeFromJSON",{enumerable:!0,get:o(function(){return ap.envelopeFromJSON},"get")});Object.defineProperty(k,"envelopeToJSON",{enumerable:!0,get:o(function(){return ap.envelopeToJSON},"get")});var du=ob();Object.defineProperty(k,"assertBundle",{enumerable:!0,get:o(function(){return du.assertBundle},"get")});Object.defineProperty(k,"assertBundleLatest",{enumerable:!0,get:o(function(){return du.assertBundleLatest},"get")});Object.defineProperty(k,"assertBundleV01",{enumerable:!0,get:o(function(){return du.assertBundleV01},"get")});Object.defineProperty(k,"assertBundleV02",{enumerable:!0,get:o(function(){return du.assertBundleV02},"get")});Object.defineProperty(k,"isBundleV01",{enumerable:!0,get:o(function(){return du.isBundleV01},"get")})});var mu=d(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.ByteStream=void 0;var cb=class extends Error{static{o(this,"StreamError")}},cp=class i{static{o(this,"ByteStream")}constructor(e){this.start=0,e?(this.buf=e,this.view=Buffer.from(e)):(this.buf=new ArrayBuffer(0),this.view=Buffer.from(this.buf))}get buffer(){return this.view.subarray(0,this.start)}get length(){return this.view.byteLength}get position(){return this.start}seek(e){this.start=e}slice(e,t){let r=e+t;if(r>this.length)throw new cb("request past end of buffer");return this.view.subarray(e,r)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let t=new Uint16Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[1],this.view[this.start+1]=r[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let t=new Uint32Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[2],this.view[this.start+1]=r[1],this.view[this.start+2]=r[0],this.start+=3}appendView(e){this.ensureCapacity(e.length),this.view.set(e,this.start),this.start+=e.length}getBlock(e){if(e<=0)return Buffer.alloc(0);if(this.start+e>this.view.length)throw new Error("request past end of buffer");let t=this.view.subarray(this.start,this.start+e);return this.start+=e,t}getUint8(){return this.getBlock(1)[0]}getUint16(){let e=this.getBlock(2);return e[0]<<8|e[1]}ensureCapacity(e){if(this.start+e>this.view.byteLength){let t=i.BLOCK_SIZE+(e>i.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+t)}}realloc(e){let t=new ArrayBuffer(e),r=Buffer.from(t);r.set(this.view),this.buf=t,this.view=r}};up.ByteStream=cp;cp.BLOCK_SIZE=1024});var lp=d($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.ASN1TypeError=$o.ASN1ParseError=void 0;var ub=class extends Error{static{o(this,"ASN1ParseError")}};$o.ASN1ParseError=ub;var lb=class extends Error{static{o(this,"ASN1TypeError")}};$o.ASN1TypeError=lb});var jk=d(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.decodeLength=Oie;hp.encodeLength=vie;var Uk=lp();function Oie(i){let e=i.getUint8();if((e&128)===0)return e;let t=e&127;if(t>6)throw new Uk.ASN1ParseError("length exceeds 6 byte limit");let r=0;for(let s=0;s<t;s++)r=r*256+i.getUint8();if(r===0)throw new Uk.ASN1ParseError("indefinite length encoding not supported");return r}o(Oie,"decodeLength");function vie(i){if(i<128)return Buffer.from([i]);let e=BigInt(i),t=[];for(;e>0n;)t.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|t.length,...t])}o(vie,"encodeLength")});var qk=d(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.parseInteger=Aie;Kr.parseStringASCII=$k;Kr.parseTime=Tie;Kr.parseOID=Nie;Kr.parseBoolean=Pie;Kr.parseBitString=Die;var Cie=/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/,Rie=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;function Aie(i){let e=0,t=i.length,r=i[e],s=r>127,n=s?255:0;for(;r==n&&++e<t;)r=i[e];if(t-e===0)return BigInt(s?-1:0);r=s?r-256:r;let c=BigInt(r);for(let u=e+1;u<t;++u)c=c*BigInt(256)+BigInt(i[u]);return c}o(Aie,"parseInteger");function $k(i){return i.toString("ascii")}o($k,"parseStringASCII");function Tie(i,e){let t=$k(i),r=e?Cie.exec(t):Rie.exec(t);if(!r)throw new Error("invalid time");if(e){let s=Number(r[1]);s+=s>=50?1900:2e3,r[1]=s.toString()}return new Date(`${r[1]}-${r[2]}-${r[3]}T${r[4]}:${r[5]}:${r[6]}Z`)}o(Tie,"parseTime");function Nie(i){let e=0,t=i.length,r=i[e++],s=Math.floor(r/40),n=r%40,a=`${s}.${n}`,c=0;for(;e<t;++e)r=i[e],c=(c<<7)+(r&127),(r&128)===0&&(a+=`.${c}`,c=0);return a}o(Nie,"parseOID");function Pie(i){return i[0]!==0}o(Pie,"parseBoolean");function Die(i){let e=i[0],t=1,r=i.length,s=[];for(let n=t;n<r;++n){let a=i[n],c=n===r-1?e:0;for(let u=7;u>=c;--u)s.push(a>>u&1)}return s}o(Die,"parseBitString")});var zk=d(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ASN1Tag=void 0;var Vk=lp(),tn={BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,OBJECT_IDENTIFIER:6,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,UTC_TIME:23,GENERALIZED_TIME:24},hb={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},fb=class{static{o(this,"ASN1Tag")}constructor(e){if(this.number=e&31,this.constructed=(e&32)===32,this.class=e>>6,this.number===31)throw new Vk.ASN1ParseError("long form tags not supported");if(this.class===hb.UNIVERSAL&&this.number===0)throw new Vk.ASN1ParseError("unsupported tag 0x00")}isUniversal(){return this.class===hb.UNIVERSAL}isContextSpecific(e){let t=this.class===hb.CONTEXT_SPECIFIC;return e!==void 0?t&&this.number===e:t}isBoolean(){return this.isUniversal()&&this.number===tn.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===tn.INTEGER}isBitString(){return this.isUniversal()&&this.number===tn.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===tn.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===tn.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===tn.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===tn.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};fp.ASN1Tag=fb});var Jk=d(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.ASN1Obj=void 0;var db=mu(),rn=lp(),Gk=jk(),qo=qk(),xie=zk(),dp=class{static{o(this,"ASN1Obj")}constructor(e,t,r){this.tag=e,this.value=t,this.subs=r}static parseBuffer(e){return Wk(new db.ByteStream(e))}toDER(){let e=new db.ByteStream;if(this.subs.length>0)for(let s of this.subs)e.appendView(s.toDER());else e.appendView(this.value);let t=e.buffer,r=new db.ByteStream;return r.appendChar(this.tag.toDER()),r.appendView((0,Gk.encodeLength)(t.length)),r.appendView(t),r.buffer}toBoolean(){if(!this.tag.isBoolean())throw new rn.ASN1TypeError("not a boolean");return(0,qo.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new rn.ASN1TypeError("not an integer");return(0,qo.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new rn.ASN1TypeError("not an OID");return(0,qo.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,qo.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,qo.parseTime)(this.value,!1);default:throw new rn.ASN1TypeError("not a date")}}toBitString(){if(!this.tag.isBitString())throw new rn.ASN1TypeError("not a bit string");return(0,qo.parseBitString)(this.value)}};pp.ASN1Obj=dp;function Wk(i){let e=new xie.ASN1Tag(i.getUint8()),t=(0,Gk.decodeLength)(i),r=i.slice(i.position,t),s=i.position,n=[];if(e.constructed)n=Hk(i,t);else if(e.isOctetString())try{n=Hk(i,t)}catch{}return n.length===0&&i.seek(s+t),new dp(e,r,n)}o(Wk,"parseStream");function Hk(i,e){let t=i.position+e;if(t>i.length)throw new rn.ASN1ParseError("invalid length");let r=[];for(;i.position<t;)r.push(Wk(i));if(i.position!==t)throw new rn.ASN1ParseError("invalid length");return r}o(Hk,"collectSubs")});var gp=d(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.ASN1Obj=void 0;var Lie=Jk();Object.defineProperty(mp,"ASN1Obj",{enumerable:!0,get:o(function(){return Lie.ASN1Obj},"get")})});var Vo=d(Zr=>{"use strict";var Mie=Zr&&Zr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.createPublicKey=Bie;Zr.digest=kie;Zr.verify=Fie;Zr.bufferEqual=Uie;var gu=Mie(require("crypto"));function Bie(i,e="spki"){return typeof i=="string"?gu.default.createPublicKey(i):gu.default.createPublicKey({key:i,format:"der",type:e})}o(Bie,"createPublicKey");function kie(i,...e){let t=gu.default.createHash(i);for(let r of e)t.update(r);return t.digest()}o(kie,"digest");function Fie(i,e,t,r){try{return gu.default.verify(r,i,e,t)}catch{return!1}}o(Fie,"verify");function Uie(i,e){try{return gu.default.timingSafeEqual(i,e)}catch{return!1}}o(Uie,"bufferEqual")});var Kk=d(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});pb.preAuthEncoding=$ie;var jie="DSSEv1";function $ie(i,e){let t=[jie,i.length,i,e.length,""].join(" ");return Buffer.concat([Buffer.from(t,"ascii"),e])}o($ie,"preAuthEncoding")});var Xk=d(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.base64Encode=qie;yp.base64Decode=Vie;var Zk="base64",Yk="utf-8";function qie(i){return Buffer.from(i,Yk).toString(Zk)}o(qie,"base64Encode");function Vie(i){return Buffer.from(i,Zk).toString(Yk)}o(Vie,"base64Decode")});var Qk=d(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.canonicalize=mb;function mb(i){let e="";if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";let t=!0;i.forEach(r=>{t||(e+=","),t=!1,e+=mb(r)}),e+="]"}else{e+="{";let t=!0;Object.keys(i).sort().forEach(r=>{t||(e+=","),t=!1,e+=JSON.stringify(r),e+=":",e+=mb(i[r])}),e+="}"}return e}o(mb,"canonicalize")});var yb=d(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.toDER=Gie;Sp.fromDER=Wie;var zie=/-----BEGIN (.*)-----/,Hie=/-----END (.*)-----/;function Gie(i){let e="";return i.split(`
|
|
59
|
-
`).forEach(t=>{t.match(
|
|
52
|
+
`;let u=(0,hQ.parseProxyResponse)(s);s.write(`${c}\r
|
|
53
|
+
`);let{connect:l,buffered:h}=await u;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",fQ),t.secureEndpoint?(Xc("Upgrading socket connection to TLS"),VL.connect({...HL(zL(t),"host","path","port"),socket:s})):s;s.destroy();let f=new rd.Socket({writable:!1});return f.readable=!0,e.once("socket",p=>{Xc("Replaying proxy buffer for failed request"),(0,aQ.default)(p.listenerCount("data")>0),p.push(h),p.push(null)}),f}};sd.protocols=["http","https"];Pt.HttpsProxyAgent=sd;function fQ(i){i.resume()}o(fQ,"resume");function HL(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(HL,"omit")});var XL=d(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});var KL=require("buffer"),Us={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};ar.ERRORS=Us;function dQ(i){if(!KL.Buffer.isEncoding(i))throw new Error(Us.INVALID_ENCODING)}o(dQ,"checkEncoding");ar.checkEncoding=dQ;function ZL(i){return typeof i=="number"&&isFinite(i)&&yQ(i)}o(ZL,"isFiniteInteger");ar.isFiniteInteger=ZL;function YL(i,e){if(typeof i=="number"){if(!ZL(i)||i<0)throw new Error(e?Us.INVALID_OFFSET:Us.INVALID_LENGTH)}else throw new Error(e?Us.INVALID_OFFSET_NON_NUMBER:Us.INVALID_LENGTH_NON_NUMBER)}o(YL,"checkOffsetOrLengthValue");function pQ(i){YL(i,!1)}o(pQ,"checkLengthValue");ar.checkLengthValue=pQ;function mQ(i){YL(i,!0)}o(mQ,"checkOffsetValue");ar.checkOffsetValue=mQ;function gQ(i,e){if(i<0||i>e.length)throw new Error(Us.INVALID_TARGET_OFFSET)}o(gQ,"checkTargetOffset");ar.checkTargetOffset=gQ;function yQ(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}o(yQ,"isInteger");function SQ(i){if(typeof BigInt>"u")throw new Error("Platform does not support JS BigInt type.");if(typeof KL.Buffer.prototype[i]>"u")throw new Error(`Platform does not support Buffer.prototype.${i}.`)}o(SQ,"bigIntAndBufferInt64Check");ar.bigIntAndBufferInt64Check=SQ});var eM=d(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var F=XL(),QL=4096,EQ="utf8",Ww=class i{static{o(this,"SmartBuffer")}constructor(e){if(this.length=0,this._encoding=EQ,this._writeOffset=0,this._readOffset=0,i.isSmartBufferOptions(e))if(e.encoding&&(F.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(F.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(F.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(F.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(QL);else{if(typeof e<"u")throw new Error(F.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(QL)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let t=e;return t&&(t.encoding!==void 0||t.size!==void 0||t.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return F.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return F.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t),this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return F.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return F.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}writeUInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}insertUInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,t)}writeUInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}insertUInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,t)}writeUInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}insertUInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,t)}writeBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}insertBigUInt64BE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,t)}writeBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}insertBigUInt64LE(e,t){return F.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,t)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}insertFloatBE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,t)}writeFloatLE(e,t){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}insertFloatLE(e,t){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,t)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}insertDoubleBE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,t)}writeDoubleLE(e,t){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}insertDoubleLE(e,t){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,t)}readString(e,t){let r;typeof e=="number"?(F.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(t=e,r=this.length-this._readOffset),typeof t<"u"&&F.checkEncoding(t);let s=this._buff.slice(this._readOffset,this._readOffset+r).toString(t||this._encoding);return this._readOffset+=r,s}insertString(e,t,r){return F.checkOffsetValue(t),this._handleString(e,!0,t,r)}writeString(e,t,r){return this._handleString(e,!1,t,r)}readStringNT(e){typeof e<"u"&&F.checkEncoding(e);let t=this.length;for(let s=this._readOffset;s<this.length;s++)if(this._buff[s]===0){t=s;break}let r=this._buff.slice(this._readOffset,t);return this._readOffset=t+1,r.toString(e||this._encoding)}insertStringNT(e,t,r){return F.checkOffsetValue(t),this.insertString(e,t,r),this.insertUInt8(0,t+e.length),this}writeStringNT(e,t,r){return this.writeString(e,t,r),this.writeUInt8(0,typeof t=="number"?t+e.length:this.writeOffset),this}readBuffer(e){typeof e<"u"&&F.checkLengthValue(e);let t=typeof e=="number"?e:this.length,r=Math.min(this.length,this._readOffset+t),s=this._buff.slice(this._readOffset,r);return this._readOffset=r,s}insertBuffer(e,t){return F.checkOffsetValue(t),this._handleBuffer(e,!0,t)}writeBuffer(e,t){return this._handleBuffer(e,!1,t)}readBufferNT(){let e=this.length;for(let r=this._readOffset;r<this.length;r++)if(this._buff[r]===0){e=r;break}let t=this._buff.slice(this._readOffset,e);return this._readOffset=e+1,t}insertBufferNT(e,t){return F.checkOffsetValue(t),this.insertBuffer(e,t),this.insertUInt8(0,t+e.length),this}writeBufferNT(e,t){return typeof t<"u"&&F.checkOffsetValue(t),this.writeBuffer(e,t),this.writeUInt8(0,typeof t=="number"?t+e.length:this._writeOffset),this}clear(){return this._writeOffset=0,this._readOffset=0,this.length=0,this}remaining(){return this.length-this._readOffset}get readOffset(){return this._readOffset}set readOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._readOffset=e}get writeOffset(){return this._writeOffset}set writeOffset(e){F.checkOffsetValue(e),F.checkTargetOffset(e,this),this._writeOffset=e}get encoding(){return this._encoding}set encoding(e){F.checkEncoding(e),this._encoding=e}get internalBuffer(){return this._buff}toBuffer(){return this._buff.slice(0,this.length)}toString(e){let t=typeof e=="string"?e:this._encoding;return F.checkEncoding(t),this._buff.toString(t,0,this.length)}destroy(){return this.clear(),this}_handleString(e,t,r,s){let n=this._writeOffset,a=this._encoding;typeof r=="number"?n=r:typeof r=="string"&&(F.checkEncoding(r),a=r),typeof s=="string"&&(F.checkEncoding(s),a=s);let c=Buffer.byteLength(e,a);return t?this.ensureInsertable(c,n):this._ensureWriteable(c,n),this._buff.write(e,n,c,a),t?this._writeOffset+=c:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,n+c):this._writeOffset+=c,this}_handleBuffer(e,t,r){let s=typeof r=="number"?r:this._writeOffset;return t?this.ensureInsertable(e.length,s):this._ensureWriteable(e.length,s),e.copy(this._buff,s),t?this._writeOffset+=e.length:typeof r=="number"?this._writeOffset=Math.max(this._writeOffset,s+e.length):this._writeOffset+=e.length,this}ensureReadable(e,t){let r=this._readOffset;if(typeof t<"u"&&(F.checkOffsetValue(t),r=t),r<0||r+e>this.length)throw new Error(F.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,t){F.checkOffsetValue(t),this._ensureCapacity(this.length+e),t<this.length&&this._buff.copy(this._buff,t+e,t,this._buff.length),t+e>this.length?this.length=t+e:this.length+=e}_ensureWriteable(e,t){let r=typeof t=="number"?t:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let t=this._buff.length;if(e>t){let r=this._buff,s=t*3/2+1;s<e&&(s=e),this._buff=Buffer.allocUnsafe(s),r.copy(this._buff,0,0,t)}}_readNumberValue(e,t,r){this.ensureReadable(t,r);let s=e.call(this._buff,typeof r=="number"?r:this._readOffset);return typeof r>"u"&&(this._readOffset+=t),s}_insertNumberValue(e,t,r,s){return F.checkOffsetValue(s),this.ensureInsertable(t,s),e.call(this._buff,r,s),this._writeOffset+=t,this}_writeNumberValue(e,t,r,s){if(typeof s=="number"){if(s<0)throw new Error(F.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);F.checkOffsetValue(s)}let n=typeof s=="number"?s:this._writeOffset;return this._ensureWriteable(t,n),e.call(this._buff,r,n),typeof s=="number"?this._writeOffset=Math.max(this._writeOffset,n+t):this._writeOffset+=t,this}};Jw.SmartBuffer=Ww});var Kw=d(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.SOCKS5_NO_ACCEPTABLE_AUTH=re.SOCKS5_CUSTOM_AUTH_END=re.SOCKS5_CUSTOM_AUTH_START=re.SOCKS_INCOMING_PACKET_SIZES=re.SocksClientState=re.Socks5Response=re.Socks5HostType=re.Socks5Auth=re.Socks4Response=re.SocksCommand=re.ERRORS=re.DEFAULT_TIMEOUT=void 0;var wQ=3e4;re.DEFAULT_TIMEOUT=wQ;var _Q={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};re.ERRORS=_Q;var bQ={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:o(i=>i+7,"Socks5ResponseHostname"),Socks4Response:8};re.SOCKS_INCOMING_PACKET_SIZES=bQ;var tM;(function(i){i[i.connect=1]="connect",i[i.bind=2]="bind",i[i.associate=3]="associate"})(tM||(re.SocksCommand=tM={}));var iM;(function(i){i[i.Granted=90]="Granted",i[i.Failed=91]="Failed",i[i.Rejected=92]="Rejected",i[i.RejectedIdent=93]="RejectedIdent"})(iM||(re.Socks4Response=iM={}));var rM;(function(i){i[i.NoAuth=0]="NoAuth",i[i.GSSApi=1]="GSSApi",i[i.UserPass=2]="UserPass"})(rM||(re.Socks5Auth=rM={}));var IQ=128;re.SOCKS5_CUSTOM_AUTH_START=IQ;var OQ=254;re.SOCKS5_CUSTOM_AUTH_END=OQ;var vQ=255;re.SOCKS5_NO_ACCEPTABLE_AUTH=vQ;var sM;(function(i){i[i.Granted=0]="Granted",i[i.Failure=1]="Failure",i[i.NotAllowed=2]="NotAllowed",i[i.NetworkUnreachable=3]="NetworkUnreachable",i[i.HostUnreachable=4]="HostUnreachable",i[i.ConnectionRefused=5]="ConnectionRefused",i[i.TTLExpired=6]="TTLExpired",i[i.CommandNotSupported=7]="CommandNotSupported",i[i.AddressNotSupported=8]="AddressNotSupported"})(sM||(re.Socks5Response=sM={}));var nM;(function(i){i[i.IPv4=1]="IPv4",i[i.Hostname=3]="Hostname",i[i.IPv6=4]="IPv6"})(nM||(re.Socks5HostType=nM={}));var oM;(function(i){i[i.Created=0]="Created",i[i.Connecting=1]="Connecting",i[i.Connected=2]="Connected",i[i.SentInitialHandshake=3]="SentInitialHandshake",i[i.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",i[i.SentAuthentication=5]="SentAuthentication",i[i.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",i[i.SentFinalHandshake=7]="SentFinalHandshake",i[i.ReceivedFinalResponse=8]="ReceivedFinalResponse",i[i.BoundWaitingForConnection=9]="BoundWaitingForConnection",i[i.Established=10]="Established",i[i.Disconnected=11]="Disconnected",i[i.Error=99]="Error"})(oM||(re.SocksClientState=oM={}))});var Yw=d(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.shuffleArray=bo.SocksClientError=void 0;var Zw=class extends Error{static{o(this,"SocksClientError")}constructor(e,t){super(e),this.options=t}};bo.SocksClientError=Zw;function RQ(i){for(let e=i.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[i[e],i[t]]=[i[t],i[e]]}}o(RQ,"shuffleArray");bo.shuffleArray=RQ});var nd=d(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.isInSubnet=AQ;js.isCorrect=TQ;js.numberToPaddedHex=aM;js.stringToPaddedHex=CQ;js.testBit=NQ;function AQ(i){return this.subnetMask<i.subnetMask?!1:this.mask(i.subnetMask)===i.mask()}o(AQ,"isInSubnet");function TQ(i){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===i&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}o(TQ,"isCorrect");function aM(i){return i.toString(16).padStart(2,"0")}o(aM,"numberToPaddedHex");function CQ(i){return aM(parseInt(i,10))}o(CQ,"stringToPaddedHex");function NQ(i,e){let{length:t}=i;if(e>t)return!1;let r=t-e;return i.substring(r,r+1)==="1"}o(NQ,"testBit")});var Xw=d(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.RE_SUBNET_STRING=bi.RE_ADDRESS=bi.GROUPS=bi.BITS=void 0;bi.BITS=32;bi.GROUPS=4;bi.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;bi.RE_SUBNET_STRING=/\/\d{1,2}$/});var ad=d(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.AddressError=void 0;var Qw=class extends Error{static{o(this,"AddressError")}constructor(e,t){super(e),this.name="AddressError",this.parseMessage=t}};od.AddressError=Qw});var t_=d(Ii=>{"use strict";var PQ=Ii&&Ii.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),DQ=Ii&&Ii.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uM=Ii&&Ii.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&PQ(e,i,t);return DQ(e,i),e};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.Address4=void 0;var Io=uM(nd()),Xt=uM(Xw()),cM=ad(),e_=class i{static{o(this,"Address4")}constructor(e){this.groups=Xt.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Io.isCorrect(Xt.BITS),this.isInSubnet=Io.isInSubnet,this.address=e;let t=Xt.RE_SUBNET_STRING.exec(e);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>Xt.BITS)throw new cM.AddressError("Invalid subnet mask.");e=e.replace(Xt.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new i(e),!0}catch{return!1}}parse(e){let t=e.split(".");if(!e.match(Xt.RE_ADDRESS))throw new cM.AddressError("Invalid IPv4 address.");return t}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let t=e.replace(/:/g,"").padStart(8,"0"),r=[],s;for(s=0;s<8;s+=2){let n=t.slice(s,s+2);r.push(parseInt(n,16))}return new i(r.join("."))}static fromInteger(e){return i.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new i(r)}toHex(){return this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],t;for(t=0;t<Xt.GROUPS;t+=2)e.push(`${Io.stringToPaddedHex(this.parsedAddress[t])}${Io.stringToPaddedHex(this.parsedAddress[t+1])}`);return e.join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(e=>Io.stringToPaddedHex(e)).join("")}`)}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(Xt.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(Xt.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}static fromBigInt(e){return i.fromHex(e.toString(16))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}reverseForm(e){e||(e={});let t=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?t:`${t}.in-addr.arpa.`}isMulticast(){return this.isInSubnet(new i("224.0.0.0/4"))}binaryZeroPad(){return this.bigInt().toString(2).padStart(Xt.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Xt.RE_ADDRESS,`<span class="hover-group group-v4 group-6">${e.slice(0,2).join(".")}</span>.<span class="hover-group group-v4 group-7">${e.slice(2,4).join(".")}</span>`)}};Ii.Address4=e_});var i_=d(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.RE_URL_WITH_PORT=he.RE_URL=he.RE_ZONE_STRING=he.RE_SUBNET_STRING=he.RE_BAD_ADDRESS=he.RE_BAD_CHARACTERS=he.TYPES=he.SCOPES=he.GROUPS=he.BITS=void 0;he.BITS=128;he.GROUPS=8;he.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};he.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};he.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;he.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;he.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;he.RE_ZONE_STRING=/%.*$/;he.RE_URL=/^\[{0,1}([0-9a-f:]+)\]{0,1}/;he.RE_URL_WITH_PORT=/\[([0-9a-f:]+)\]:([0-9]{1,5})/});var r_=d(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.spanAllZeroes=lM;Oo.spanAll=xQ;Oo.spanLeadingZeroes=LQ;Oo.simpleGroup=MQ;function lM(i){return i.replace(/(0+)/g,'<span class="zero">$1</span>')}o(lM,"spanAllZeroes");function xQ(i,e=0){return i.split("").map((r,s)=>`<span class="digit value-${r} position-${s+e}">${lM(r)}</span>`).join("")}o(xQ,"spanAll");function hM(i){return i.replace(/^(0+)/,'<span class="zero">$1</span>')}o(hM,"spanLeadingZeroesSimple");function LQ(i){return i.split(":").map(t=>hM(t)).join(":")}o(LQ,"spanLeadingZeroes");function MQ(i,e=0){return i.split(":").map((r,s)=>/group-v4/.test(r)?r:`<span class="hover-group group-${s+e}">${hM(r)}</span>`)}o(MQ,"simpleGroup")});var fM=d(it=>{"use strict";var BQ=it&&it.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),kQ=it&&it.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),FQ=it&&it.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&BQ(e,i,t);return kQ(e,i),e};Object.defineProperty(it,"__esModule",{value:!0});it.ADDRESS_BOUNDARY=void 0;it.groupPossibilities=ud;it.padGroup=cd;it.simpleRegularExpression=jQ;it.possibleElisions=$Q;var UQ=FQ(i_());function ud(i){return`(${i.join("|")})`}o(ud,"groupPossibilities");function cd(i){return i.length<4?`0{0,${4-i.length}}${i}`:i}o(cd,"padGroup");it.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function jQ(i){let e=[];i.forEach((r,s)=>{parseInt(r,16)===0&&e.push(s)});let t=e.map(r=>i.map((s,n)=>{if(n===r){let a=n===0||n===UQ.GROUPS-1?":":"";return ud([cd(s),a])}return cd(s)}).join(":"));return t.push(i.map(cd).join(":")),ud(t)}o(jQ,"simpleRegularExpression");function $Q(i,e,t){let r=e?"":":",s=t?"":":",n=[];!e&&!t&&n.push("::"),e&&t&&n.push(""),(t&&!e||!t&&e)&&n.push(":"),n.push(`${r}(:0{1,4}){1,${i-1}}`),n.push(`(0{1,4}:){1,${i-1}}${s}`),n.push(`(0{1,4}:){${i-1}}0{1,4}`);for(let a=1;a<i-1;a++)for(let c=1;c<i-a;c++)n.push(`(0{1,4}:){${c}}:(0{1,4}:){${i-c-a-1}}0{1,4}`);return ud(n)}o($Q,"possibleElisions")});var gM=d(Oi=>{"use strict";var qQ=Oi&&Oi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),VQ=Oi&&Oi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),fd=Oi&&Oi.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&qQ(e,i,t);return VQ(e,i),e};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.Address6=void 0;var dM=fd(nd()),s_=fd(Xw()),se=fd(i_()),n_=fd(r_()),$s=t_(),qs=fM(),cr=ad(),ld=nd();function hd(i){if(!i)throw new Error("Assertion failed.")}o(hd,"assert");function zQ(i){let e=/(\d+)(\d{3})/;for(;e.test(i);)i=i.replace(e,"$1,$2");return i}o(zQ,"addCommas");function HQ(i){return i=i.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),i=i.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),i}o(HQ,"spanLeadingZeroes4");function GQ(i,e){let t=[],r=[],s;for(s=0;s<i.length;s++)s<e[0]?t.push(i[s]):s>e[1]&&r.push(i[s]);return t.concat(["compact"]).concat(r)}o(GQ,"compact");function pM(i){return parseInt(i,16).toString(16).padStart(4,"0")}o(pM,"paddedHex");function mM(i){return i&255}o(mM,"unsignByte");var o_=class i{static{o(this,"Address6")}constructor(e,t){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=dM.isInSubnet,this.isCorrect=dM.isCorrect(se.BITS),t===void 0?this.groups=se.GROUPS:this.groups=t,this.address=e;let r=se.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>se.BITS)throw new cr.AddressError("Invalid subnet mask.");e=e.replace(se.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new cr.AddressError("Invalid subnet mask.");let s=se.RE_ZONE_STRING.exec(e);s&&(this.zone=s[0],e=e.replace(se.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new i(e),!0}catch{return!1}}static fromBigInt(e){let t=e.toString(16).padStart(32,"0"),r=[],s;for(s=0;s<se.GROUPS;s++)r.push(t.slice(s*4,(s+1)*4));return new i(r.join(":"))}static fromURL(e){let t,r=null,s;if(e.indexOf("[")!==-1&&e.indexOf("]:")!==-1){if(s=se.RE_URL_WITH_PORT.exec(e),s===null)return{error:"failed to parse address with port",address:null,port:null};t=s[1],r=s[2]}else if(e.indexOf("/")!==-1){if(e=e.replace(/^[a-z0-9]+:\/\//,""),s=se.RE_URL.exec(e),s===null)return{error:"failed to parse address from URL",address:null,port:null};t=s[1]}else t=e;return r?(r=parseInt(r,10),(r<0||r>65536)&&(r=null)):r=null,{address:new i(t),port:r}}static fromAddress4(e){let t=new $s.Address4(e),r=se.BITS-(s_.BITS-t.subnetMask);return new i(`::ffff:${t.correctForm()}/${r}`)}static fromArpa(e){let t=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(t.length!==63)throw new cr.AddressError("Invalid 'ip6.arpa' form.");let s=t.split(".").reverse();for(let n=r;n>0;n--){let a=n*4;s.splice(a,0,":")}return t=s.join(""),new i(t)}microsoftTranscription(){return`${this.correctForm().replace(/:/g,"-")}.ipv6-literal.net`}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let t=se.BITS-this.subnetMask,r=Math.abs(e-se.BITS),s=t-r;return s<0?"0":zQ((BigInt("2")**BigInt(s)).toString(10))}_startAddress(){return BigInt(`0b${this.mask()+"0".repeat(se.BITS-this.subnetMask)}`)}startAddress(){return i.fromBigInt(this._startAddress())}startAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._startAddress()+e)}_endAddress(){return BigInt(`0b${this.mask()+"1".repeat(se.BITS-this.subnetMask)}`)}endAddress(){return i.fromBigInt(this._endAddress())}endAddressExclusive(){let e=BigInt("1");return i.fromBigInt(this._endAddress()-e)}getScope(){let e=se.SCOPES[parseInt(this.getBits(12,16).toString(10),10)];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(se.TYPES))if(this.isInSubnet(new i(e)))return se.TYPES[e];return"Global unicast"}getBits(e,t){return BigInt(`0b${this.getBitsBase2(e,t)}`)}getBitsBase2(e,t){return this.binaryZeroPad().slice(e,t)}getBitsBase16(e,t){let r=t-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,t).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,se.BITS)}reverseForm(e){e||(e={});let t=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,t).reverse().join(".");return t>0?e.omitSuffix?r:`${r}.ip6.arpa.`:e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,t=[],r=0,s=[];for(e=0;e<this.parsedAddress.length;e++){let c=parseInt(this.parsedAddress[e],16);c===0&&r++,c!==0&&r>0&&(r>1&&s.push([e-r,e-1]),r=0)}r>1&&s.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let n=s.map(c=>c[1]-c[0]+1);if(s.length>0){let c=n.indexOf(Math.max(...n));t=GQ(this.parsedAddress,s[c])}else t=this.parsedAddress;for(e=0;e<t.length;e++)t[e]!=="compact"&&(t[e]=parseInt(t[e],16).toString(16));let a=t.join(":");return a=a.replace(/^compact$/,"::"),a=a.replace(/(^compact)|(compact$)/,":"),a=a.replace(/compact/,""),a}binaryZeroPad(){return this.bigInt().toString(2).padStart(se.BITS,"0")}parse4in6(e){let t=e.split(":"),s=t.slice(-1)[0].match(s_.RE_ADDRESS);if(s){this.parsedAddress4=s[0],this.address4=new $s.Address4(this.parsedAddress4);for(let n=0;n<this.address4.groups;n++)if(/^0[0-9]+/.test(this.address4.parsedAddress[n]))throw new cr.AddressError("IPv4 addresses can't have leading zeroes.",e.replace(s_.RE_ADDRESS,this.address4.parsedAddress.map(HQ).join(".")));this.v4=!0,t[t.length-1]=this.address4.toGroup6(),e=t.join(":")}return e}parse(e){e=this.parse4in6(e);let t=e.match(se.RE_BAD_CHARACTERS);if(t)throw new cr.AddressError(`Bad character${t.length>1?"s":""} detected in address: ${t.join("")}`,e.replace(se.RE_BAD_CHARACTERS,'<span class="parse-error">$1</span>'));let r=e.match(se.RE_BAD_ADDRESS);if(r)throw new cr.AddressError(`Address failed regex: ${r.join("")}`,e.replace(se.RE_BAD_ADDRESS,'<span class="parse-error">$1</span>'));let s=[],n=e.split("::");if(n.length===2){let a=n[0].split(":"),c=n[1].split(":");a.length===1&&a[0]===""&&(a=[]),c.length===1&&c[0]===""&&(c=[]);let u=this.groups-(a.length+c.length);if(!u)throw new cr.AddressError("Error parsing groups");this.elidedGroups=u,this.elisionBegin=a.length,this.elisionEnd=a.length+this.elidedGroups,s=s.concat(a);for(let l=0;l<u;l++)s.push("0");s=s.concat(c)}else if(n.length===1)s=e.split(":"),this.elidedGroups=0;else throw new cr.AddressError("Too many :: groups found");if(s=s.map(a=>parseInt(a,16).toString(16)),s.length!==this.groups)throw new cr.AddressError("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(pM).join(":")}decimal(){return this.parsedAddress.map(e=>parseInt(e,16).toString(10).padStart(5,"0")).join(":")}bigInt(){return BigInt(`0x${this.parsedAddress.map(pM).join("")}`)}to4(){let e=this.binaryZeroPad().split("");return $s.Address4.fromHex(BigInt(`0b${e.slice(96,128).join("")}`).toString(16))}to4in6(){let e=this.to4(),r=new i(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(r)||(s=":"),r+s+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),r=(this.getBits(80,96)^BigInt("0xffff")).toString(),s=$s.Address4.fromHex(this.getBitsBase16(32,64)),n=this.getBits(96,128),a=$s.Address4.fromHex((n^BigInt("0xffffffff")).toString(16)),c=this.getBitsBase2(64,80),u=(0,ld.testBit)(c,15),l=(0,ld.testBit)(c,14),h=(0,ld.testBit)(c,8),f=(0,ld.testBit)(c,9),p=BigInt(`0b${c.slice(2,6)+c.slice(8,16)}`).toString(10);return{prefix:`${e.slice(0,4)}:${e.slice(4,8)}`,server4:s.address,client4:a.address,flags:c,coneNat:u,microsoft:{reserved:l,universalLocal:f,groupIndividual:h,nonce:p},udpPort:r}}inspect6to4(){let e=this.getBitsBase16(0,16),t=$s.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:e.slice(0,4),gateway:t.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new i(e)}toByteArray(){let e=this.bigInt().toString(16),r=`${"0".repeat(e.length%2)}${e}`,s=[];for(let n=0,a=r.length;n<a;n+=2)s.push(parseInt(r.substring(n,n+2),16));return s}toUnsignedByteArray(){return this.toByteArray().map(mM)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(mM))}static fromUnsignedByteArray(e){let t=BigInt("256"),r=BigInt("0"),s=BigInt("1");for(let n=e.length-1;n>=0;n--)r+=s*BigInt(e[n].toString(10)),s*=t;return i.fromBigInt(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new i("2001::/32"))}is6to4(){return this.isInSubnet(new i("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=`:${e}`,`http://[${this.correctForm()}]${e}/`}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let t=this.correctForm;e.v4&&(t=this.to4in6);let r=t.call(this);return e.className?`<a href="${e.prefix}${r}" class="${e.className}">${r}</a>`:`<a href="${e.prefix}${r}">${r}</a>`}group(){if(this.elidedGroups===0)return n_.simpleGroup(this.address).join(":");hd(typeof this.elidedGroups=="number"),hd(typeof this.elisionBegin=="number");let e=[],[t,r]=this.address.split("::");t.length?e.push(...n_.simpleGroup(t)):e.push("");let s=["hover-group"];for(let n=this.elisionBegin;n<this.elisionBegin+this.elidedGroups;n++)s.push(`group-${n}`);return e.push(`<span class="${s.join(" ")}"></span>`),r.length?e.push(...n_.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(hd(this.address4 instanceof $s.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let t=[],r=new i(this.correctForm());if(r.elidedGroups===0)t.push((0,qs.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===se.GROUPS)t.push((0,qs.possibleElisions)(se.GROUPS));else{let s=r.address.split("::");s[0].length&&t.push((0,qs.simpleRegularExpression)(s[0].split(":"))),hd(typeof r.elidedGroups=="number"),t.push((0,qs.possibleElisions)(r.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&t.push((0,qs.simpleRegularExpression)(s[1].split(":"))),t=[t.join(":")]}return e||(t=["(?=^|",qs.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...t,")(?=[^\\w\\:]|",qs.ADDRESS_BOUNDARY,"|$)"]),t.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Oi.Address6=o_});var a_=d(Ue=>{"use strict";var WQ=Ue&&Ue.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),JQ=Ue&&Ue.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),KQ=Ue&&Ue.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&WQ(e,i,t);return JQ(e,i),e};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.v6=Ue.AddressError=Ue.Address6=Ue.Address4=void 0;var ZQ=t_();Object.defineProperty(Ue,"Address4",{enumerable:!0,get:o(function(){return ZQ.Address4},"get")});var YQ=gM();Object.defineProperty(Ue,"Address6",{enumerable:!0,get:o(function(){return YQ.Address6},"get")});var XQ=ad();Object.defineProperty(Ue,"AddressError",{enumerable:!0,get:o(function(){return XQ.AddressError},"get")});var QQ=KQ(r_());Ue.v6={helpers:QQ}});var bM=d(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.ipToBuffer=Dt.int32ToIpv4=Dt.ipv4ToInt32=Dt.validateSocksClientChainOptions=Dt.validateSocksClientOptions=void 0;var We=Yw(),Ce=Kw(),e7=require("stream"),c_=a_(),yM=require("net");function t7(i,e=["connect","bind","associate"]){if(!Ce.SocksCommand[i.command])throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommand,i);if(e.indexOf(i.command)===-1)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandForOperation,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!wM(i.proxy))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);if(SM(i.proxy,i),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i);if(i.existing_socket&&!(i.existing_socket instanceof e7.Duplex))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsExistingSocket,i)}o(t7,"validateSocksClientOptions");Dt.validateSocksClientOptions=t7;function i7(i){if(i.command!=="connect")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksCommandChain,i);if(!EM(i.destination))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsDestination,i);if(!(i.proxies&&Array.isArray(i.proxies)&&i.proxies.length>=2))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxiesLength,i);if(i.proxies.forEach(e=>{if(!wM(e))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsProxy,i);SM(e,i)}),i.timeout&&!_M(i.timeout))throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsTimeout,i)}o(i7,"validateSocksClientChainOptions");Dt.validateSocksClientChainOptions=i7;function SM(i,e){if(i.custom_auth_method!==void 0){if(i.custom_auth_method<Ce.SOCKS5_CUSTOM_AUTH_START||i.custom_auth_method>Ce.SOCKS5_CUSTOM_AUTH_END)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(i.custom_auth_request_handler===void 0||typeof i.custom_auth_request_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_size===void 0)throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(i.custom_auth_response_handler===void 0||typeof i.custom_auth_response_handler!="function")throw new We.SocksClientError(Ce.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}o(SM,"validateCustomProxyAuth");function EM(i){return i&&typeof i.host=="string"&&Buffer.byteLength(i.host)<256&&typeof i.port=="number"&&i.port>=0&&i.port<=65535}o(EM,"isValidSocksRemoteHost");function wM(i){return i&&(typeof i.host=="string"||typeof i.ipaddress=="string")&&typeof i.port=="number"&&i.port>=0&&i.port<=65535&&(i.type===4||i.type===5)}o(wM,"isValidSocksProxy");function _M(i){return typeof i=="number"&&i>0}o(_M,"isValidTimeoutValue");function r7(i){return new c_.Address4(i).toArray().reduce((t,r)=>(t<<8)+r,0)>>>0}o(r7,"ipv4ToInt32");Dt.ipv4ToInt32=r7;function s7(i){let e=i>>>24&255,t=i>>>16&255,r=i>>>8&255,s=i&255;return[e,t,r,s].join(".")}o(s7,"int32ToIpv4");Dt.int32ToIpv4=s7;function n7(i){if(yM.isIPv4(i)){let e=new c_.Address4(i);return Buffer.from(e.toArray())}else if(yM.isIPv6(i)){let e=new c_.Address6(i);return Buffer.from(e.canonicalForm().split(":").map(t=>t.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}o(n7,"ipToBuffer");Dt.ipToBuffer=n7});var IM=d(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ReceiveBuffer=void 0;var u_=class{static{o(this,"ReceiveBuffer")}constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let t=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),t.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let t=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(t),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,t}};dd.ReceiveBuffer=u_});var OM=d(Fr=>{"use strict";var vo=Fr&&Fr.__awaiter||function(i,e,t,r){function s(n){return n instanceof t?n:new t(function(a){a(n)})}return o(s,"adopt"),new(t||(t=Promise))(function(n,a){function c(h){try{l(r.next(h))}catch(f){a(f)}}o(c,"fulfilled");function u(h){try{l(r.throw(h))}catch(f){a(f)}}o(u,"rejected");function l(h){h.done?n(h.value):s(h.value).then(c,u)}o(l,"step"),l((r=r.apply(i,e||[])).next())})};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.SocksClientError=Fr.SocksClient=void 0;var o7=require("events"),Ro=require("net"),rt=eM(),O=Kw(),gt=bM(),a7=IM(),h_=Yw();Object.defineProperty(Fr,"SocksClientError",{enumerable:!0,get:o(function(){return h_.SocksClientError},"get")});var l_=a_(),f_=class i extends o7.EventEmitter{static{o(this,"SocksClient")}constructor(e){super(),this.options=Object.assign({},e),(0,gt.validateSocksClientOptions)(e),this.setState(O.SocksClientState.Created)}static createConnection(e,t){return new Promise((r,s)=>{try{(0,gt.validateSocksClientOptions)(e,["connect"])}catch(a){return typeof t=="function"?(t(a),r(a)):s(a)}let n=new i(e);n.connect(e.existing_socket),n.once("established",a=>{n.removeAllListeners(),typeof t=="function"&&t(null,a),r(a)}),n.once("error",a=>{n.removeAllListeners(),typeof t=="function"?(t(a),r(a)):s(a)})})}static createConnectionChain(e,t){return new Promise((r,s)=>vo(this,void 0,void 0,function*(){try{(0,gt.validateSocksClientChainOptions)(e)}catch(n){return typeof t=="function"?(t(n),r(n)):s(n)}e.randomizeChain&&(0,h_.shuffleArray)(e.proxies);try{let n;for(let a=0;a<e.proxies.length;a++){let c=e.proxies[a],u=a===e.proxies.length-1?e.destination:{host:e.proxies[a+1].host||e.proxies[a+1].ipaddress,port:e.proxies[a+1].port},l=yield i.createConnection({command:"connect",proxy:c,destination:u,existing_socket:n});n=n||l.socket}typeof t=="function"?(t(null,{socket:n}),r({socket:n})):r({socket:n})}catch(n){typeof t=="function"?(t(n),r(n)):s(n)}}))}static createUDPFrame(e){let t=new rt.SmartBuffer;return t.writeUInt16BE(0),t.writeUInt8(e.frameNumber||0),Ro.isIPv4(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv4),t.writeUInt32BE((0,gt.ipv4ToInt32)(e.remoteHost.host))):Ro.isIPv6(e.remoteHost.host)?(t.writeUInt8(O.Socks5HostType.IPv6),t.writeBuffer((0,gt.ipToBuffer)(e.remoteHost.host))):(t.writeUInt8(O.Socks5HostType.Hostname),t.writeUInt8(Buffer.byteLength(e.remoteHost.host)),t.writeString(e.remoteHost.host)),t.writeUInt16BE(e.remoteHost.port),t.writeBuffer(e.data),t.toBuffer()}static parseUDPFrame(e){let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r=t.readUInt8(),s=t.readUInt8(),n;s===O.Socks5HostType.IPv4?n=(0,gt.int32ToIpv4)(t.readUInt32BE()):s===O.Socks5HostType.IPv6?n=l_.Address6.fromByteArray(Array.from(t.readBuffer(16))).canonicalForm():n=t.readString(t.readUInt8());let a=t.readUInt16BE();return{frameNumber:r,remoteHost:{host:n,port:a},data:t.readBuffer()}}setState(e){this.state!==O.SocksClientState.Error&&(this.state=e)}connect(e){this.onDataReceived=r=>this.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let t=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||O.DEFAULT_TIMEOUT);t.unref&&typeof t.unref=="function"&&t.unref(),e?this.socket=e:this.socket=new Ro.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(O.SocksClientState.Connecting),this.receiveBuffer=new a7.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let s=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",s)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.BoundWaitingForConnection&&this.closeSocket(O.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(O.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(O.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==O.SocksClientState.Established&&this.state!==O.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===O.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===O.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===O.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===O.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(O.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(O.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==O.SocksClientState.Error&&(this.setState(O.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new h_.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",t=new rt.SmartBuffer;t.writeUInt8(4),t.writeUInt8(O.SocksCommand[this.options.command]),t.writeUInt16BE(this.options.destination.port),Ro.isIPv4(this.options.destination.host)?(t.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host)),t.writeStringNT(e)):(t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(0),t.writeUInt8(1),t.writeStringNT(e),t.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(t.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedConnection} - (${O.Socks4Response[e[1]]})`);else if(O.SocksCommand[this.options.command]===O.SocksCommand.bind){let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(O.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==O.Socks4Response.Granted)this.closeSocket(`${O.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${O.Socks4Response[e[1]]})`);else{let t=rt.SmartBuffer.fromBuffer(e);t.readOffset=2;let r={port:t.readUInt16BE(),host:(0,gt.int32ToIpv4)(t.readUInt32BE())};this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new rt.SmartBuffer,t=[O.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&t.push(O.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&t.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(t.length);for(let r of t)e.writeUInt8(r);this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(O.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===O.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===O.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=O.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===O.Socks5Auth.UserPass?(this.socks5ChosenAuthType=O.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(O.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",t=this.options.proxy.password||"",r=new rt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(t)),r.writeString(t),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(O.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return vo(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(O.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return vo(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return vo(this,void 0,void 0,function*(){this.setState(O.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===O.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===O.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(O.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new rt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(O.SocksCommand[this.options.command]),e.writeUInt8(0),Ro.isIPv4(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv4),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):Ro.isIPv6(this.options.destination.host)?(e.writeUInt8(O.Socks5HostType.IPv6),e.writeBuffer((0,gt.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(O.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(O.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.ReceivedFinalResponse),O.SocksCommand[this.options.command]===O.SocksCommand.connect?(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.bind?(this.setState(O.SocksClientState.BoundWaitingForConnection),this.nextRequiredPacketBufferSize=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.emit("bound",{remoteHost:r,socket:this.socket})):O.SocksCommand[this.options.command]===O.SocksCommand.associate&&(this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket}))}}handleSocks5IncomingConnectionResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==O.Socks5Response.Granted)this.closeSocket(`${O.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${O.Socks5Response[e[1]]}`);else{let t=e[3],r,s;if(t===O.Socks5HostType.IPv4){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:(0,gt.int32ToIpv4)(s.readUInt32BE()),port:s.readUInt16BE()},r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress)}else if(t===O.Socks5HostType.Hostname){let n=e[4],a=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(n);if(this.receiveBuffer.length<a){this.nextRequiredPacketBufferSize=a;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(a).slice(5)),r={host:s.readString(n),port:s.readUInt16BE()}}else if(t===O.Socks5HostType.IPv6){let n=O.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6;if(this.receiveBuffer.length<n){this.nextRequiredPacketBufferSize=n;return}s=rt.SmartBuffer.fromBuffer(this.receiveBuffer.get(n).slice(4)),r={host:l_.Address6.fromByteArray(Array.from(s.readBuffer(16))).canonicalForm(),port:s.readUInt16BE()}}this.setState(O.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}get socksClientOptions(){return Object.assign({},this.options)}};Fr.SocksClient=f_});var vM=d(Vs=>{"use strict";var c7=Vs&&Vs.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),u7=Vs&&Vs.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&c7(e,i,t)};Object.defineProperty(Vs,"__esModule",{value:!0});u7(OM(),Vs)});var RM=d(xt=>{"use strict";var l7=xt&&xt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),h7=xt&&xt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),d_=xt&&xt.__importStar||function(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&l7(e,i,t);return h7(e,i),e},f7=xt&&xt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(xt,"__esModule",{value:!0});xt.SocksProxyAgent=void 0;var d7=vM(),p7=Yc(),m7=f7(Fs()),g7=d_(require("dns")),y7=d_(require("net")),S7=d_(require("tls")),E7=require("url"),pd=(0,m7.default)("socks-proxy-agent"),w7=o(i=>i.servername===void 0&&i.host&&!y7.isIP(i.host)?{...i,servername:i.host}:i,"setServernameFromNonIpHost");function _7(i){let e=!1,t=5,r=i.hostname,s=parseInt(i.port,10)||1080;switch(i.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":t=5;break;case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(i.protocol)}`)}let n={host:r,port:s,type:t};return i.username&&Object.defineProperty(n,"userId",{value:decodeURIComponent(i.username),enumerable:!1}),i.password!=null&&Object.defineProperty(n,"password",{value:decodeURIComponent(i.password),enumerable:!1}),{lookup:e,proxy:n}}o(_7,"parseSocksURL");var md=class extends p7.Agent{static{o(this,"SocksProxyAgent")}constructor(e,t){super(t);let r=typeof e=="string"?new E7.URL(e):e,{proxy:s,lookup:n}=_7(r);this.shouldLookup=n,this.proxy=s,this.timeout=t?.timeout??null,this.socketOptions=t?.socketOptions??null}async connect(e,t){let{shouldLookup:r,proxy:s,timeout:n}=this;if(!t.host)throw new Error("No `host` defined!");let{host:a}=t,{port:c,lookup:u=g7.lookup}=t;r&&(a=await new Promise((p,m)=>{u(a,{},(y,g)=>{y?m(y):p(g)})}));let l={proxy:s,destination:{host:a,port:typeof c=="number"?c:parseInt(c,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},h=o(p=>{e.destroy(),f.destroy(),p&&p.destroy()},"cleanup");pd("Creating socks proxy connection: %o",l);let{socket:f}=await d7.SocksClient.createConnection(l);if(pd("Successfully created socks proxy connection"),n!==null&&(f.setTimeout(n),f.on("timeout",()=>h())),t.secureEndpoint){pd("Upgrading socket connection to TLS");let p=S7.connect({...b7(w7(t),"host","path","port"),socket:f});return p.once("error",m=>{pd("Socket TLS error",m.message),h(p)}),p}return f}};md.protocols=["socks","socks4","socks4a","socks5","socks5h"];xt.SocksProxyAgent=md;function b7(i,...e){let t={},r;for(r in i)e.includes(r)||(t[r]=i[r]);return t}o(b7,"omit")});var E_=d((uEe,AM)=>{"use strict";var p_=class extends Error{static{o(this,"InvalidProxyProtocolError")}constructor(e){super(`Invalid protocol \`${e.protocol}\` connecting to proxy \`${e.host}\``),this.code="EINVALIDPROXY",this.proxy=e}},m_=class extends Error{static{o(this,"ConnectionTimeoutError")}constructor(e){super(`Timeout connecting to host \`${e}\``),this.code="ECONNECTIONTIMEOUT",this.host=e}},g_=class extends Error{static{o(this,"IdleTimeoutError")}constructor(e){super(`Idle timeout reached for host \`${e}\``),this.code="EIDLETIMEOUT",this.host=e}},y_=class extends Error{static{o(this,"ResponseTimeoutError")}constructor(e,t){let r="Response timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`connecting to host \`${e.host}\``,super(r),this.code="ERESPONSETIMEOUT",this.proxy=t,this.request=e}},S_=class extends Error{static{o(this,"TransferTimeoutError")}constructor(e,t){let r="Transfer timeout ";t&&(r+=`from proxy \`${t.host}\` `),r+=`for \`${e.host}\``,super(r),this.code="ETRANSFERTIMEOUT",this.proxy=t,this.request=e}};AM.exports={InvalidProxyProtocolError:p_,ConnectionTimeoutError:m_,IdleTimeoutError:g_,ResponseTimeoutError:y_,TransferTimeoutError:S_}});var w_=d((hEe,CM)=>{"use strict";var{HttpProxyAgent:I7}=$L(),{HttpsProxyAgent:O7}=JL(),{SocksProxyAgent:TM}=RM(),{LRUCache:v7}=os(),{InvalidProxyProtocolError:R7}=E_(),A7=new v7({max:20}),T7=new Set(TM.protocols),C7=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),Qc=Object.entries(process.env).reduce((i,[e,t])=>(e=e.toLowerCase(),C7.has(e)&&(i[e]=t),i),{}),N7=o(i=>{i=new URL(i);let e=i.protocol.slice(0,-1);if(T7.has(e))return TM;if(e==="https"||e==="http")return[I7,O7];throw new R7(i)},"getProxyAgent"),P7=o((i,e)=>{if(typeof e=="string"&&(e=e.split(",").map(r=>r.trim()).filter(Boolean)),!e||!e.length)return!1;let t=i.hostname.split(".").reverse();return e.some(r=>{let s=r.split(".").filter(Boolean).reverse();if(!s.length)return!1;for(let n=0;n<s.length;n++)if(t[n]!==s[n])return!1;return!0})},"isNoProxy"),D7=o((i,{proxy:e,noProxy:t})=>(i=new URL(i),e||(e=i.protocol==="https:"?Qc.https_proxy:Qc.https_proxy||Qc.http_proxy||Qc.proxy),t||(t=Qc.no_proxy),!e||P7(i,t)?null:new URL(e)),"getProxy");CM.exports={getProxyAgent:N7,getProxy:D7,proxyCache:A7}});var DM=d((pEe,PM)=>{"use strict";var x7=require("net"),L7=require("tls"),{once:NM}=require("events"),M7=require("timers/promises"),{normalizeOptions:B7,cacheOptions:k7}=Hw(),{getProxy:F7,getProxyAgent:U7,proxyCache:__}=w_(),gd=E_(),{Agent:j7}=Yc();PM.exports=class extends j7{static{o(this,"Agent")}#e;#t;#i;#r;#s;constructor(e={}){let{timeouts:t,proxy:r,noProxy:s,...n}=B7(e);super(n),this.#e=n,this.#t=t,r&&(this.#i=new URL(r),this.#r=s,this.#s=U7(r))}get proxy(){return this.#i?{url:this.#i}:{}}#u(e){if(!this.#i)return;let t=F7(`${e.protocol}//${e.host}:${e.port}`,{proxy:this.#i,noProxy:this.#r});if(!t)return;let r=k7({...e,...this.#e,timeouts:this.#t,proxy:t});if(__.has(r))return __.get(r);let s=this.#s;Array.isArray(s)&&(s=this.isSecureEndpoint(e)?s[1]:s[0]);let n=new s(t,{...this.#e,socketOptions:{family:this.#e.family}});return __.set(r,n),n}async#c({promises:e,options:t,timeout:r},s=new AbortController){if(r){let a=M7.setTimeout(r,null,{signal:s.signal}).then(()=>{throw new gd.ConnectionTimeoutError(`${t.host}:${t.port}`)}).catch(c=>{if(c.name!=="AbortError")throw c});e.push(a)}let n;try{n=await Promise.race(e),s.abort()}catch(a){throw s.abort(),a}return n}async connect(e,t){t.lookup??=this.#e.lookup;let r,s=this.#t.connection,n=this.isSecureEndpoint(t),a=this.#u(t);if(a){let h=Date.now();r=await this.#c({options:t,timeout:s,promises:[a.connect(e,t)]}),s&&(s=s-(Date.now()-h))}else r=(n?L7:x7).connect(t);r.setKeepAlive(this.keepAlive,this.keepAliveMsecs),r.setNoDelay(this.keepAlive);let c=new AbortController,{signal:u}=c,l=r[n?"secureConnecting":"connecting"]?NM(r,n?"secureConnect":"connect",{signal:u}):Promise.resolve();return await this.#c({options:t,timeout:s,promises:[l,NM(r,"error",{signal:u}).then(h=>{throw h[0]})]},c),this.#t.idle&&r.setTimeout(this.#t.idle,()=>{r.destroy(new gd.IdleTimeoutError(`${t.host}:${t.port}`))}),r}addRequest(e,t){let r=this.#u(t);if(r?.setRequestProps&&r.setRequestProps(e,t),e.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#t.response){let s;e.once("finish",()=>{setTimeout(()=>{e.destroy(new gd.ResponseTimeoutError(e,this.#i))},this.#t.response)}),e.once("response",()=>{clearTimeout(s)})}if(this.#t.transfer){let s;e.once("response",n=>{setTimeout(()=>{n.destroy(new gd.TransferTimeoutError(e,this.#i))},this.#t.transfer),n.once("close",()=>{clearTimeout(s)})})}return super.addRequest(e,t)}}});var BM=d((gEe,MM)=>{"use strict";var{LRUCache:$7}=os(),{normalizeOptions:q7,cacheOptions:V7}=Hw(),{getProxy:z7,proxyCache:xM}=w_(),LM=zw(),yd=DM(),eu=new $7({max:20}),H7=o((i,{agent:e,proxy:t,noProxy:r,...s}={})=>{if(e!=null)return e;i=new URL(i);let n=z7(i,{proxy:t,noProxy:r}),a={...q7(s),proxy:n},c=V7({...a,secureEndpoint:i.protocol==="https:"});if(eu.has(c))return eu.get(c);let u=new yd(a);return eu.set(c,u),u},"getAgent");MM.exports={getAgent:H7,Agent:yd,HttpAgent:yd,HttpsAgent:yd,cache:{proxy:xM,agent:eu,dns:LM.cache,clear:o(()=>{xM.clear(),eu.clear(),LM.cache.clear()},"clear")}}});var kM=d((SEe,G7)=>{G7.exports={name:"make-fetch-happen",version:"15.0.2",description:"Opinionated, caching, retrying fetch client",main:"lib/index.js",files:["bin/","lib/"],scripts:{test:"tap",posttest:"npm run lint",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"',lint:"npm run eslint",lintfix:"npm run eslint -- --fix",postlint:"template-oss-check",snap:"tap","template-oss-apply":"template-oss-apply --force"},repository:{type:"git",url:"git+https://github.com/npm/make-fetch-happen.git"},keywords:["http","request","fetch","mean girls","caching","cache","subresource integrity"],author:"GitHub Inc.",license:"ISC",dependencies:{"@npmcli/agent":"^4.0.0",cacache:"^20.0.1","http-cache-semantics":"^4.1.1",minipass:"^7.0.2","minipass-fetch":"^4.0.0","minipass-flush":"^1.0.5","minipass-pipeline":"^1.2.4",negotiator:"^1.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",ssri:"^12.0.0"},devDependencies:{"@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.25.0",nock:"^13.2.4","safe-buffer":"^5.2.1","standard-version":"^9.3.2",tap:"^16.0.0"},engines:{node:"^20.17.0 || >=22.9.0"},tap:{color:1,files:"test/*.js","check-coverage":!0,timeout:60,"nyc-arg":["--exclude","tap-snapshots/**"]},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.25.0",publish:"true"}}});var Ed=d((EEe,UM)=>{var{Minipass:W7}=te(),Sd=go(),J7=xa(),K7=ai(),{log:FM}=St(),Z7=Vw(),{getAgent:Y7}=BM(),b_=kM(),X7=`${b_.name}/${b_.version} (+https://npm.im/${b_.name})`,Q7=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],eee=["request-timeout"],tee=o((i,e)=>{let t=Y7(i.url,{...e,signal:void 0});i.headers.has("connection")||i.headers.set("connection",t?"keep-alive":"close"),i.headers.has("user-agent")||i.headers.set("user-agent",X7);let r={...e,agent:t,redirect:"manual"};return J7(async(s,n)=>{let a=new Sd.Request(i,r);try{let c=await Sd(a,r);if(r.integrity&&c.status===200){let h=K7.integrityStream({algorithms:r.algorithms,integrity:r.integrity,size:r.size}),f=new Z7({events:["integrity","size"]},c.body,h);h.on("integrity",p=>f.emit("integrity",p)),h.on("size",p=>f.emit("size",p)),c=new Sd.Response(f,c),c.body.hasIntegrityEmitter=!0}c.headers.set("x-fetch-attempts",n);let u=W7.isStream(a.body);return a.method!=="POST"&&!u&&([408,420,429].includes(c.status)||c.status>=500)?(typeof e.onRetry=="function"&&e.onRetry(c),FM.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.status}`),s(c)):c}catch(c){let u=c.code==="EPROMISERETRY"?c.retried.code:c.code,l=c.retried instanceof Sd.Response||Q7.includes(u)&&eee.includes(c.type);if(a.method==="POST"||l)throw c;return typeof e.onRetry=="function"&&e.onRetry(c),FM.http("fetch",`${a.method} ${a.url} attempt ${n} failed with ${c.code}`),s(c)}},e.retry).catch(s=>{if(s.status>=400&&s.type!=="system")return s;throw s})},"remoteFetch");UM.exports=tee});var HM=d((_Ee,zM)=>{var{Request:jM,Response:I_}=go(),{Minipass:$M}=te(),iee=Ih(),zs=dc(),ree=require("url"),see=Vw(),nee=jw(),O_=AL(),oee=Ed(),tu=o((i,e)=>Object.prototype.hasOwnProperty.call(i,e),"hasOwnProperty"),aee=["accept-charset","accept-encoding","accept-language","accept","cache-control"],VM=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],qM=o((i,e,t)=>{let r={time:Date.now(),url:i.url,reqHeaders:{},resHeaders:{},options:{compress:t.compress!=null?t.compress:i.compress}};e.status!==200&&e.status!==304&&(r.status=e.status);for(let a of aee)i.headers.has(a)&&(r.reqHeaders[a]=i.headers.get(a));let s=i.headers.get("host"),n=new ree.URL(i.url);if(s&&n.host!==s&&(r.reqHeaders.host=s),e.headers.has("vary")){let a=e.headers.get("vary");if(a!=="*"){let c=a.trim().toLowerCase().split(/\s*,\s*/);for(let u of c)i.headers.has(u)&&(r.reqHeaders[u]=i.headers.get(u))}}for(let a of VM)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));for(let a of t.cacheAdditionalHeaders)e.headers.has(a)&&(r.resHeaders[a]=e.headers.get(a));return r},"getMetadata"),wd=Symbol("request"),_d=Symbol("response"),bd=Symbol("policy"),v_=class i{static{o(this,"CacheEntry")}constructor({entry:e,request:t,response:r,options:s}){e?(this.key=e.key,this.entry=e,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=O_(t),this.options=s,this[wd]=t,this[_d]=r,this[bd]=null}static async find(e,t){try{var r=await zs.index.compact(t.cachePath,O_(e),(n,a)=>{let c=new i({entry:n,options:t}),u=new i({entry:a,options:t});return c.policy.satisfies(u.request)},{validateEntry:o(n=>n.metadata&&n.metadata.resHeaders&&n.metadata.resHeaders["content-encoding"]===null?!1:n.integrity===null?!!(n.metadata&&n.metadata.status):!0,"validateEntry")})}catch{return}if(t.cache==="reload")return;let s;for(let n of r){let a=new i({entry:n,options:t});if(a.policy.satisfies(e)){s=a;break}}return s}static async invalidate(e,t){let r=O_(e);try{await zs.rm.entry(t.cachePath,r,{removeFully:!0})}catch{}}get request(){return this[wd]||(this[wd]=new jM(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[wd]}get response(){return this[_d]||(this[_d]=new I_(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[_d]}get policy(){return this[bd]||(this[bd]=new nee({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[bd]}async store(e){if(this.request.method!=="GET"||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;let t=this.response.headers.get("content-length"),r={algorithms:this.options.algorithms,metadata:qM(this.request,this.response,this.options),size:t,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body},s=null;if(this.response.status===200){let a,c,u=new Promise((h,f)=>{a=h,c=f}).catch(h=>{s.emit("error",h)});s=new see({events:["integrity","size"]},new iee({flush(){return u}})),s.hasIntegrityEmitter=!0;let l=o(()=>{let h=new $M,f=zs.put.stream(this.options.cachePath,this.key,r);f.on("integrity",p=>s.emit("integrity",p)),f.on("size",p=>s.emit("size",p)),h.pipe(f),f.promise().then(a,c),s.unshift(h),s.unshift(this.response.body)},"onResume");s.once("resume",l),s.once("end",()=>s.removeListener("resume",l))}else await zs.index.insert(this.options.cachePath,this.key,null,r);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",e),this.response.headers.set("x-local-cache-time",new Date().toISOString()),new I_(s,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(e,t,r){let s;if(e==="HEAD"||[301,308].includes(this.response.status))s=this.response;else{let n=new $M,a={...this.policy.responseHeaders()},c=o(()=>{let u=zs.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});u.on("error",async l=>{u.pause(),l.code==="EINTEGRITY"&&await zs.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),(l.code==="ENOENT"||l.code==="EINTEGRITY")&&await i.invalidate(this.request,this.options),n.emit("error",l),u.resume()}),n.emit("integrity",this.entry.integrity),n.emit("size",Number(a["content-length"])),u.pipe(n)},"onResume");n.once("resume",c),n.once("end",()=>n.removeListener("resume",c)),s=new I_(n,{url:this.entry.metadata.url,counter:t.counter,status:200,headers:a})}return s.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),s.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),s.headers.set("x-local-cache-key",encodeURIComponent(this.key)),s.headers.set("x-local-cache-mode","stream"),s.headers.set("x-local-cache-status",r),s.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),s}async revalidate(e,t){let r=new jM(e,{headers:this.policy.revalidationHeaders(e)});try{var s=await oee(r,{...t,headers:void 0})}catch(a){if(!this.policy.mustRevalidate)return this.respond(e.method,t,"stale");throw a}if(this.policy.revalidated(r,s)){let a=qM(e,s,t);for(let c of VM)!tu(a.resHeaders,c)&&tu(this.entry.metadata.resHeaders,c)&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]);for(let c of t.cacheAdditionalHeaders){let u=tu(a.resHeaders,c),l=tu(this.entry.metadata.resHeaders,c),h=tu(this.policy.response.headers,c);!u&&l&&(a.resHeaders[c]=this.entry.metadata.resHeaders[c]),!h&&u&&(this.policy.response.headers[c]=a.resHeaders[c])}try{await zs.index.insert(t.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:a})}catch{}return this.respond(e.method,t,"revalidated")}return new i({request:e,response:s,options:t}).store("updated")}};zM.exports=v_});var JM=d((IEe,WM)=>{var{NotCachedError:cee}=OL(),R_=HM(),uee=Ed(),GM=o(async(i,e)=>{let t=await R_.find(i,e);if(!t){if(e.cache==="only-if-cached")throw new cee(i.url);let s=await uee(i,e);return new R_({request:i,response:s,options:e}).store("miss")}if(e.cache==="no-cache")return t.revalidate(i,e);let r=t.policy.needsRevalidation(i);return e.cache==="force-cache"||e.cache==="only-if-cached"||!r?t.respond(i.method,e,r?"stale":"hit"):t.revalidate(i,e)},"cacheFetch");GM.invalidate=async(i,e)=>{if(e.cachePath)return R_.invalidate(i,e)};WM.exports=GM});var XM=d((vEe,YM)=>{"use strict";var{FetchError:A_,Request:lee,isRedirect:hee}=go(),T_=require("url"),fee=jw(),KM=JM(),dee=Ed(),pee=o((i,e,t)=>{if(!hee(e.status)||t.redirect==="manual")return!1;if(t.redirect==="error")throw new A_(`redirect mode is set to error: ${i.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new A_(`redirect location header missing for: ${i.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(i.counter>=i.follow)throw new A_(`maximum redirect reached at: ${i.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0},"canFollowRedirect"),mee=o((i,e,t)=>{let r={...t},s=e.headers.get("location"),n=new T_.URL(s,/^https?:/.test(s)?void 0:i.url);return new T_.URL(i.url).hostname!==n.hostname&&(i.headers.delete("authorization"),i.headers.delete("cookie")),(e.status===303||i.method==="POST"&&[301,302].includes(e.status))&&(r.method="GET",r.body=null,i.headers.delete("content-length")),r.headers={},i.headers.forEach((c,u)=>{r.headers[u]=c}),r.counter=++i.counter,{request:new lee(T_.format(n),r),options:r}},"getRedirect"),ZM=o(async(i,e)=>{let t=fee.storable(i,e)?await KM(i,e):await dee(i,e);if(!["GET","HEAD"].includes(i.method)&&t.status>=200&&t.status<=399&&await KM.invalidate(i,e),!pee(i,t,e))return t;let r=mee(i,t,e);return ZM(r.request,r.options)},"fetch");YM.exports=ZM});var iu=d((AEe,Ao)=>{var{FetchError:gee,Headers:yee,Request:QM,Response:See}=go(),Eee=Kx(),wee=XM(),Id=o((i,e)=>{let t=Eee(e),r=new QM(i,t);return wee(r,t)},"makeFetchHappen");Id.defaults=(i,e={},t=Id)=>{typeof i=="object"&&(e=i,i=null);let r=o((s,n={})=>{let a=s||i,c={...e,...n,headers:{...e.headers,...n.headers}};return t(a,c)},"defaultedFetch");return r.defaults=(s,n={})=>Id.defaults(s,n,r),r};Ao.exports=Id;Ao.exports.FetchError=gee;Ao.exports.Headers=yee;Ao.exports.Request=QM;Ao.exports.Response=See});var bB=d((CEe,_B)=>{var j={},pB=j.LEFT_BRACE=1,Rd=j.RIGHT_BRACE=2,mB=j.LEFT_BRACKET=3,P_=j.RIGHT_BRACKET=4,Ad=j.COLON=5,Td=j.COMMA=6,gB=j.TRUE=7,yB=j.FALSE=8,SB=j.NULL=9,Cd=j.STRING=10,EB=j.NUMBER=11,Hs=j.START=17,wB=j.STOP=18,eB=j.TRUE1=33,tB=j.TRUE2=34,iB=j.TRUE3=35,rB=j.FALSE1=49,sB=j.FALSE2=50,nB=j.FALSE3=51,oB=j.FALSE4=52,aB=j.NULL1=65,cB=j.NULL2=66,uB=j.NULL3=67,lB=j.NUMBER1=81,C_=j.NUMBER3=83,Qt=j.STRING1=97,hB=j.STRING2=98,fB=j.STRING3=99,_ee=j.STRING4=100,bee=j.STRING5=101,dB=j.STRING6=102,To=j.VALUE=113,N_=j.KEY=114,Od=j.OBJECT=129,vd=j.ARRAY=130,Iee=92,Oee=47,vee=8,Ree=12,Aee=10,Tee=13,Cee=9,Nd=64*1024;function Ur(){this.tState=Hs,this.value=void 0,this.string=void 0,this.stringBuffer=Buffer.alloc?Buffer.alloc(Nd):new Buffer(Nd),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=To,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.offset=-1}o(Ur,"Parser");Ur.toknam=function(i){for(var e=Object.keys(j),t=0,r=e.length;t<r;t++){var s=e[t];if(j[s]===i)return s}return i&&"0x"+i.toString(16)};var Lt=Ur.prototype;Lt.onError=function(i){throw i};Lt.charError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(i[e]))+" at position "+e+" in state "+Ur.toknam(this.tState)))};Lt.appendStringChar=function(i){this.stringBufferOffset>=Nd&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=i};Lt.appendStringBuf=function(i,e,t){var r=i.length;typeof e=="number"&&(typeof t=="number"?t<0?r=i.length-e+t:r=t-e:r=i.length-e),r<0&&(r=0),this.stringBufferOffset+r>Nd&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),i.copy(this.stringBuffer,this.stringBufferOffset,e,t),this.stringBufferOffset+=r};Lt.write=function(i){typeof i=="string"&&(i=new Buffer(i));for(var e,t=0,r=i.length;t<r;t++)if(this.tState===Hs){if(e=i[t],this.offset++,e===123)this.onToken(pB,"{");else if(e===125)this.onToken(Rd,"}");else if(e===91)this.onToken(mB,"[");else if(e===93)this.onToken(P_,"]");else if(e===58)this.onToken(Ad,":");else if(e===44)this.onToken(Td,",");else if(e===116)this.tState=eB;else if(e===102)this.tState=rB;else if(e===110)this.tState=aB;else if(e===34)this.string="",this.stringBufferOffset=0,this.tState=Qt;else if(e===45)this.string="-",this.tState=lB;else if(e>=48&&e<64)this.string=String.fromCharCode(e),this.tState=C_;else if(!(e===32||e===9||e===10||e===13))return this.charError(i,t)}else if(this.tState===Qt)if(e=i[t],this.bytes_remaining>0){for(var s=0;s<this.bytes_remaining;s++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+s]=i[s];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,t=t+s-1}else if(this.bytes_remaining===0&&e>=128){if(e<=193||e>244)return this.onError(new Error("Invalid UTF-8 character at position "+t+" in state "+Ur.toknam(this.tState)));if(e>=194&&e<=223&&(this.bytes_in_sequence=2),e>=224&&e<=239&&(this.bytes_in_sequence=3),e>=240&&e<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>i.length){for(var n=0;n<=i.length-1-t;n++)this.temp_buffs[this.bytes_in_sequence][n]=i[t+n];this.bytes_remaining=t+this.bytes_in_sequence-i.length,t=i.length-1}else this.appendStringBuf(i,t,t+this.bytes_in_sequence),t=t+this.bytes_in_sequence-1}else if(e===34)this.tState=Hs,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(Cd,this.string),this.offset+=Buffer.byteLength(this.string,"utf8")+1,this.string=void 0;else if(e===92)this.tState=hB;else if(e>=32)this.appendStringChar(e);else return this.charError(i,t);else if(this.tState===hB)if(e=i[t],e===34)this.appendStringChar(e),this.tState=Qt;else if(e===92)this.appendStringChar(Iee),this.tState=Qt;else if(e===47)this.appendStringChar(Oee),this.tState=Qt;else if(e===98)this.appendStringChar(vee),this.tState=Qt;else if(e===102)this.appendStringChar(Ree),this.tState=Qt;else if(e===110)this.appendStringChar(Aee),this.tState=Qt;else if(e===114)this.appendStringChar(Tee),this.tState=Qt;else if(e===116)this.appendStringChar(Cee),this.tState=Qt;else if(e===117)this.unicode="",this.tState=fB;else return this.charError(i,t);else if(this.tState===fB||this.tState===_ee||this.tState===bee||this.tState===dB)if(e=i[t],e>=48&&e<64||e>64&&e<=70||e>96&&e<=102){if(this.unicode+=String.fromCharCode(e),this.tState++===dB){var a=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&a>=56320&&a<57344?(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,a))),this.highSurrogate=void 0):this.highSurrogate===void 0&&a>=55296&&a<56320?this.highSurrogate=a:(this.highSurrogate!==void 0&&(this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new Buffer(String.fromCharCode(a)))),this.tState=Qt}}else return this.charError(i,t);else if(this.tState===lB||this.tState===C_)switch(e=i[t],e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(e),this.tState=C_;break;default:this.tState=Hs;var c=Number(this.string);if(isNaN(c))return this.charError(i,t);this.string.match(/[0-9]+/)==this.string&&c.toString()!=this.string?this.onToken(Cd,this.string):this.onToken(EB,c),this.offset+=this.string.length-1,this.string=void 0,t--;break}else if(this.tState===eB)if(i[t]===114)this.tState=tB;else return this.charError(i,t);else if(this.tState===tB)if(i[t]===117)this.tState=iB;else return this.charError(i,t);else if(this.tState===iB)if(i[t]===101)this.tState=Hs,this.onToken(gB,!0),this.offset+=3;else return this.charError(i,t);else if(this.tState===rB)if(i[t]===97)this.tState=sB;else return this.charError(i,t);else if(this.tState===sB)if(i[t]===108)this.tState=nB;else return this.charError(i,t);else if(this.tState===nB)if(i[t]===115)this.tState=oB;else return this.charError(i,t);else if(this.tState===oB)if(i[t]===101)this.tState=Hs,this.onToken(yB,!1),this.offset+=4;else return this.charError(i,t);else if(this.tState===aB)if(i[t]===117)this.tState=cB;else return this.charError(i,t);else if(this.tState===cB)if(i[t]===108)this.tState=uB;else return this.charError(i,t);else if(this.tState===uB)if(i[t]===108)this.tState=Hs,this.onToken(SB,null),this.offset+=3;else return this.charError(i,t)};Lt.onToken=function(i,e){};Lt.parseError=function(i,e){this.tState=wB,this.onError(new Error("Unexpected "+Ur.toknam(i)+(e?"("+JSON.stringify(e)+")":"")+" in state "+Ur.toknam(this.state)))};Lt.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})};Lt.pop=function(){var i=this.value,e=this.stack.pop();this.value=e.value,this.key=e.key,this.mode=e.mode,this.emit(i),this.mode||(this.state=To)};Lt.emit=function(i){this.mode&&(this.state=Td),this.onValue(i)};Lt.onValue=function(i){};Lt.onToken=function(i,e){if(this.state===To)if(i===Cd||i===EB||i===gB||i===yB||i===SB)this.value&&(this.value[this.key]=e),this.emit(e);else if(i===pB)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=N_,this.mode=Od;else if(i===mB)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=vd,this.state=To;else if(i===Rd)if(this.mode===Od)this.pop();else return this.parseError(i,e);else if(i===P_)if(this.mode===vd)this.pop();else return this.parseError(i,e);else return this.parseError(i,e);else if(this.state===N_)if(i===Cd)this.key=e,this.state=Ad;else if(i===Rd)this.pop();else return this.parseError(i,e);else if(this.state===Ad)if(i===Ad)this.state=To;else return this.parseError(i,e);else if(this.state===Td)if(i===Td)this.mode===vd?(this.key++,this.state=To):this.mode===Od&&(this.state=N_);else if(i===P_&&this.mode===vd||i===Rd&&this.mode===Od)this.pop();else return this.parseError(i,e);else return this.parseError(i,e)};Ur.C=j;_B.exports=Ur});var vB=d((PEe,OB)=>{var Nee=bB(),{Minipass:Pee}=te(),Pd=class extends Error{static{o(this,"JSONStreamError")}constructor(e,t){super(e.message),Error.captureStackTrace(this,t||this.constructor)}get name(){return"JSONStreamError"}},IB=o((i,e)=>typeof i=="string"?String(e)===i:i&&typeof i.test=="function"?i.test(e):typeof i=="boolean"||typeof i=="object"?i:typeof i=="function"?i(e):!1,"check"),D_=class i extends Pee{static{o(this,"JSONStream")}#e=0;#t=!1;#i=null;#r=null;#s=null;#u;#c;#f=null;#n=null;constructor(e){super({...e,objectMode:!0});let t=this.#c=new Nee;t.onValue=r=>this.#a(r),this.#u=t.onToken,t.onToken=(r,s)=>this.#d(r,s),t.onError=r=>this.#o(r),this.#f=typeof e.path=="string"?e.path.split(".").map(r=>r==="$*"?{emitKey:!0}:r==="*"?!0:r===""?{recurse:!0}:r):Array.isArray(e.path)&&e.path.length?e.path:null,typeof e.map=="function"&&(this.#s=e.map)}#h(e,t){this.#r!==!1&&(this.#r=this.#r||{},this.#r[e]=t),this.#i!==!1&&this.#r===!1&&(this.#i=this.#i||{},this.#i[e]=t)}#o(e){let t=this.#t?this.end:this.write;return this.#t=!1,this.emit("error",new Pd(e,t))}#d(e,t){let r=this.#c;if(this.#u.call(this.#c,e,t),r.stack.length===0&&this.#n){let s=this.#n;this.#f||super.write(s),this.#n=null,this.#e=0}}#a(e){let t=this.#c;if(this.#n=e,!this.#f)return;let r=0,s=0,n=!1;for(;r<this.#f.length;){let c=this.#f[r];if(s++,c&&!c.recurse){let u=s===t.stack.length?t:t.stack[s];if(!u)return;if(!IB(c,u.key)){this.#h(u.key,e);return}n=!!c.emitKey,r++}else{if(r++,r>=this.#f.length)return;let u=this.#f[r];if(!u)return;for(;;){let l=s===t.stack.length?t:t.stack[s];if(!l)return;if(IB(u,l.key)){r++,Object.isFrozen(t.stack[s])||(t.stack[s].value=null);break}else this.#h(l.key,e);s++}}}if(this.#r){let c=this.#r;this.#r=!1,this.emit("header",c)}if(s!==t.stack.length)return;this.#e++;let a=t.stack.slice(1).map(c=>c.key).concat([t.key]);if(e!=null){let c=this.#s?this.#s(e,a):e;if(c!=null){let u=n?{value:c}:c;n&&(u.key=t.key),super.write(u)}}t.value&&delete t.value[t.key];for(let c of t.stack)c.value=null}write(e,t){if(typeof e=="string")e=Buffer.from(e,t);else if(!Buffer.isBuffer(e))return this.emit("error",new TypeError("Can only parse JSON from string or buffer input"));return this.#c.write(e),this.flowing}end(e,t){this.#t=!0,e&&this.write(e,t);let r=this.#r;this.#r=null;let s=this.#i;return this.#i=null,r&&this.emit("header",r),s&&this.emit("footer",s),super.end()}static get JSONStreamError(){return Pd}static parse(e,t){return new i({path:e,map:t})}};OB.exports=D_});var x_=d((xEe,Co)=>{"use strict";var{HttpErrorAuthOTP:Dee}=dw(),xee=qx(),AB=Wx(),Lee=iu(),Mee=vB(),Bee=Un(),kee=require("querystring"),Dd=require("url"),RB=vc(),{Minipass:Fee}=te(),xd=Aw(),Uee=o(i=>{try{return!!new Dd.URL(i)}catch{return!1}},"urlIsValid");Co.exports=Ld;function Ld(i,e={}){let t={...xd,...e},r=Uee(i),s=t.registry||xd.registry;r||(s=t.registry=t.spec&&TB(t.spec,t)||t.registry||s,i=`${s.trim().replace(/\/?$/g,"")}/${i.trim().replace(/^\//,"")}`,new Dd.URL(i));let n=t.method||"GET",a=Date.now(),c=AB(i,t),u=Vee(i,c,t),l=t.body,h=Fee.isStream(l),f=l&&typeof l=="object"&&typeof l.then=="function";if(l&&!h&&!f&&typeof l!="string"&&!Buffer.isBuffer(l)?(u["content-type"]=u["content-type"]||"application/json",l=JSON.stringify(l)):l&&!u["content-type"]&&(u["content-type"]="application/octet-stream"),t.gzip)if(u["content-encoding"]="gzip",h){let y=new RB.Gzip;l.on("error",g=>y.emit("error",g)),l=l.pipe(y)}else f||(l=new RB.Gzip().end(l).concat());let p=new Dd.URL(i);if(t.query){let y=typeof t.query=="string"?kee.parse(t.query):t.query;Object.keys(y).forEach(g=>{y[g]!==void 0&&p.searchParams.set(g,y[g])}),i=Dd.format(p)}p.searchParams.get("write")==="true"&&n==="GET"&&(t.offline=!1,t.preferOffline=!1,t.preferOnline=!0);let m=o(async y=>{let g=Lee(i,{agent:t.agent,algorithms:t.algorithms,body:y,cache:qee(t),cachePath:t.cache,ca:t.ca,cert:c.cert||t.cert,headers:u,integrity:t.integrity,key:c.key||t.key,localAddress:t.localAddress,maxSockets:t.maxSockets,memoize:t.memoize,method:n,noProxy:t.noProxy,proxy:t.httpsProxy||t.proxy,retry:t.retry?t.retry:{retries:t.fetchRetries,factor:t.fetchRetryFactor,minTimeout:t.fetchRetryMintimeout,maxTimeout:t.fetchRetryMaxtimeout},strictSSL:t.strictSSL,timeout:t.timeout||3e4}).then(S=>xee({method:n,uri:i,res:S,registry:s,startTime:a,auth:c,opts:t}));return typeof t.otpPrompt=="function"?g.catch(async S=>{if(S instanceof Dee){let E;try{E=await t.otpPrompt()}catch{}if(!E)throw S;return Ld(i,{...t,otp:E})}throw S}):g},"doFetch");return Promise.resolve(l).then(m)}o(Ld,"regFetch");Co.exports.getAuth=AB;Co.exports.json=jee;function jee(i,e){return Ld(i,e).then(t=>t.json())}o(jee,"fetchJSON");Co.exports.json.stream=$ee;function $ee(i,e,t={}){let r={...xd,...t},s=Mee.parse(e,r.mapJSON);return Ld(i,r).then(n=>n.body.on("error",a=>s.emit("error",a)).pipe(s)).catch(n=>s.emit("error",n)),s}o($ee,"fetchJSONStream");Co.exports.pickRegistry=TB;function TB(i,e={}){i=Bee(i);let t=i.scope&&e[i.scope.replace(/^@?/,"@")+":registry"];return!t&&e.scope&&(t=e[e.scope.replace(/^@?/,"@")+":registry"]),t||(t=e.registry||xd.registry),t}o(TB,"pickRegistry");function qee(i){return i.offline?"only-if-cached":i.preferOffline?"force-cache":i.preferOnline?"no-cache":"default"}o(qee,"getCacheMode");function Vee(i,e,t){let r=Object.assign({"user-agent":t.userAgent},t.headers||{});return t.authType&&(r["npm-auth-type"]=t.authType),t.scope&&(r["npm-scope"]=t.scope),t.npmSession&&(r["npm-session"]=t.npmSession),t.npmCommand&&(r["npm-command"]=t.npmCommand),e.token?r.authorization=`Bearer ${e.token}`:e.auth&&(r.authorization=`Basic ${e.auth}`),t.otp&&(r["npm-otp"]=t.otp),r}o(Vee,"getHeaders")});var L_=d((MEe,zee)=>{zee.exports={name:"pacote",version:"21.0.1",description:"JavaScript package downloader",author:"GitHub Inc.",bin:{pacote:"bin/index.js"},license:"ISC",main:"lib/index.js",scripts:{test:"tap",snap:"tap",lint:"npm run eslint",postlint:"template-oss-check",lintfix:"npm run eslint -- --fix",posttest:"npm run lint","template-oss-apply":"template-oss-apply --force",eslint:'eslint "**/*.{js,cjs,ts,mjs,jsx,tsx}"'},tap:{timeout:300,"nyc-arg":["--exclude","tap-snapshots/**"]},devDependencies:{"@npmcli/arborist":"^9.0.2","@npmcli/eslint-config":"^5.0.0","@npmcli/template-oss":"4.23.4","hosted-git-info":"^9.0.0","mutate-fs":"^2.1.1",nock:"^13.2.4","npm-registry-mock":"^1.3.2",rimraf:"^6.0.1",tap:"^16.0.1"},files:["bin/","lib/"],keywords:["packages","npm","git"],dependencies:{"@npmcli/git":"^6.0.0","@npmcli/installed-package-contents":"^3.0.0","@npmcli/package-json":"^7.0.0","@npmcli/promise-spawn":"^8.0.0","@npmcli/run-script":"^10.0.0",cacache:"^20.0.0","fs-minipass":"^3.0.0",minipass:"^7.0.2","npm-package-arg":"^13.0.0","npm-packlist":"^10.0.1","npm-pick-manifest":"^10.0.0","npm-registry-fetch":"^19.0.0","proc-log":"^5.0.0","promise-retry":"^2.0.1",sigstore:"^4.0.0",ssri:"^12.0.0",tar:"^7.4.3"},engines:{node:"^20.17.0 || >=22.9.0"},repository:{type:"git",url:"git+https://github.com/npm/pacote.git"},templateOSS:{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",version:"4.23.4",windowsCI:!1,publish:"true"}}});var ru=d((BEe,DB)=>{var Hee=x_(),{Minipass:Gee}=te(),Wee=xs(),CB=fo(),NB=Ds(),PB=L_().version,M_=class extends Wee{static{o(this,"RemoteFetcher")}constructor(e,t){super(e,t),this.resolved=this.spec.fetchSpec;let r=new URL(this.resolved);this.replaceRegistryHost!=="never"&&(this.replaceRegistryHost==="always"||this.replaceRegistryHost===r.host)&&(this.resolved=new URL(r.pathname,this.registry).href);let s=this.spec.name?`${this.spec.name}@`:"";this.pkgid=t.pkgid?t.pkgid:`remote:${s}${this.resolved}`}get[NB.cacheFetches](){return!1}[NB.tarballFromResolved](){let e=new Gee;e.hasIntegrityEmitter=!0;let t={...this.opts,headers:this.#e(),spec:this.spec,integrity:this.integrity,algorithms:[this.pickIntegrityAlgorithm()]};return Hee(this.resolved,t).then(r=>{r.body.on("error",s=>e.emit("error",s)),r.body.on("integrity",s=>{this.integrity=s,e.emit("integrity",s)}),r.body.pipe(e)}).catch(r=>e.emit("error",r)),e}#e(){return{"user-agent":this.opts.userAgent||`pacote/${PB} node/${process.version}`,...this.opts.headers||{},"pacote-version":PB,"pacote-req-type":"tarball","pacote-pkg-id":this.pkgid,...this.integrity?{"pacote-integrity":String(this.integrity)}:{},...this.opts.headers||{}}}get types(){return["remote"]}packument(){return CB.prototype.packument.apply(this)}manifest(){return CB.prototype.manifest.apply(this)}};DB.exports=M_});var LB=d((FEe,xB)=>{var Jee=o((i,e)=>{if(i.hosted){let t=i.hosted,r={noCommittish:!0};return`${t.https&&t.auth?t.https(r):t.shortcut(r)}#${e}`}else return i.rawSpec.replace(/#.*$/,"")+`#${e}`},"addGitSha");xB.exports=Jee});var BB=d((jEe,MB)=>{var Kee=Dl();MB.exports=(i,e,t,r,s)=>{let n=i.endsWith(".js"),a=n?process.execPath:i,c=(n?[i]:[]).concat(e);return Kee(a,c,{cwd:t,env:r},s)}});var k_=d(($Ee,jB)=>{var Zee=dc(),Md=uy(),Yee=Un(),Xee=Jl(),{Minipass:Qee}=te(),{log:kB}=St(),ete=$f(),tte=xs(),FB=fo(),ite=ru(),Bd=Ds(),rte=LB(),ste=BB(),nte=/^[a-f0-9]{40}$/,kd=o((i,e)=>i.sshurl&&!(i.https&&i.auth)&&UB(i.sshurl(e))||i.https&&UB(i.https(e)),"repoUrl"),UB=o(i=>i&&`git+${i}`.replace(/^(git\+)+/,"git+"),"addGitPlus"),B_=class extends tte{static{o(this,"GitFetcher")}constructor(e,t){super(e,t),this.opts.integrity&&(delete this.opts.integrity,kB.warn(`skipping integrity check for git dependency ${this.spec.fetchSpec}`)),this.resolvedRef=null,this.spec.hosted&&(this.from=this.spec.hosted.shortcut({noCommittish:!1})),this.spec.gitCommittish&&nte.test(this.spec.gitCommittish)?(this.resolvedSha=this.spec.gitCommittish,this.resolved=this.spec.hosted?kd(this.spec.hosted,{noCommittish:!1}):this.spec.rawSpec):this.resolvedSha="",this.Arborist=t.Arborist||null}static repoUrl(e,t){return kd(e,t)}get types(){return["git"]}resolve(){if(this.resolved)return super.resolve();let e=this.spec.hosted;return e?this.#e(e):this.#t(this.spec.fetchSpec)}#e(e){return this.#t(e.https&&e.https()).catch(t=>{if(t instanceof Md.errors.GitPathspecError)throw t;let r=e.sshurl&&e.sshurl();if(!r||e.auth)throw t;return this.#t(r)})}#t(e){if(!e)return Promise.reject(new Error(`No git url for ${this.spec}`));let t=this.spec.gitRange,r=this.spec.name;return Md.revs(e,this.opts).then(s=>t?Xee({versions:s.versions,"dist-tags":s["dist-tags"],name:r},t,this.opts):this.spec.gitCommittish?s.refs[this.spec.gitCommittish]||s.refs[s.shas[this.spec.gitCommittish]]:s.refs.HEAD).then(s=>!s||!s.sha?this.#s():(this.resolvedRef=s,this.resolvedSha=s.sha,this.#r(s.sha),this.resolved))}#i(e){this.resolved=this.spec.hosted?kd(Yee(e).hosted,{noCommittish:!1}):e}#r(e){this.#i(rte(this.spec,e))}#s(){return this.#c(()=>this.resolved)}#u(e){return this[Bd.readPackageJson](e).then(t=>{let r=t.scripts;if(!t.workspaces&&(!r||!(r.postinstall||r.build||r.preinstall||r.install||r.prepack||r.prepare)))return;let s=process.env._PACOTE_NO_PREPARE_?process.env._PACOTE_NO_PREPARE_.split(`
|
|
54
|
+
`):[];if(s.includes(this.resolved)){kB.info("prepare","skip prepare, already seen",this.resolved);return}return s.push(this.resolved),ste(this.npmBin,[].concat(this.npmInstallCmd).concat(this.npmCliConfig),e,{...process.env,_PACOTE_NO_PREPARE_:s.join(`
|
|
55
|
+
`)},{message:"git dep preparation failed"})})}[Bd.tarballFromResolved](){let e=new Qee;return e.resolved=this.resolved,e.from=this.from,this.#c(t=>this.#u(t).then(()=>new Promise((r,s)=>{if(!this.Arborist)throw new Error("GitFetcher requires an Arborist constructor to pack a tarball");let a=new ete(`file:${t}`,{...this.opts,Arborist:this.Arborist,resolved:null,integrity:null})[Bd.tarballFromResolved]();a.on("error",s),a.on("end",r),a.pipe(e)}))).catch(t=>e.emit("error",t)),e}#c(e,t=!0){let r={tmpPrefix:"git-clone"},s=this.resolvedSha||this.spec.gitCommittish,n=this.spec.hosted,a=this.resolved;return t=t&&n&&a===kd(n,{noCommittish:!1})&&n.tarball,Zee.tmp.withTmp(this.cache,r,async c=>{if(t){let l=this.spec.name?`${this.spec.name}@`:"";return new ite(n.tarball({noCommittish:!1}),{...this.opts,allowGitIgnore:!0,pkgid:`git:${l}${this.resolved}`,resolved:this.resolved,integrity:null}).extract(c).then(()=>e(c),h=>{if(h.constructor.name.match(/^Http/))return this.#c(e,!1);throw h})}let u=await(n?this.#f(s,c):this.#n(this.spec.fetchSpec,s,c));return this.resolvedSha=u,this.resolved||await this.#r(u),e(c)})}#f(e,t){let r=this.spec.hosted;return this.#n(r.https({noCommittish:!0}),e,t).catch(s=>{if(s instanceof Md.errors.GitPathspecError)throw s;let n=r.sshurl&&r.sshurl({noCommittish:!0});if(!n||r.auth)throw s;return this.#n(n,e,t)})}#n(e,t,r){let{opts:s,spec:n}=this;return Md.clone(e,t,r,{...s,spec:n})}manifest(){return this.package?Promise.resolve(this.package):this.spec.hosted&&this.resolved?FB.prototype.manifest.apply(this):this.#c(e=>this[Bd.readPackageJson](e).then(t=>this.package={...t,_resolved:this.resolved,_from:this.from}))}packument(){return FB.prototype.packument.apply(this)}};jB.exports=B_});var F_=d(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.Signature=jr.Envelope=void 0;jr.Envelope={fromJSON(i){return{payload:Fd(i.payload)?Buffer.from($B(i.payload)):Buffer.alloc(0),payloadType:Fd(i.payloadType)?globalThis.String(i.payloadType):"",signatures:globalThis.Array.isArray(i?.signatures)?i.signatures.map(e=>jr.Signature.fromJSON(e)):[]}},toJSON(i){let e={};return i.payload.length!==0&&(e.payload=qB(i.payload)),i.payloadType!==""&&(e.payloadType=i.payloadType),i.signatures?.length&&(e.signatures=i.signatures.map(t=>jr.Signature.toJSON(t))),e}};jr.Signature={fromJSON(i){return{sig:Fd(i.sig)?Buffer.from($B(i.sig)):Buffer.alloc(0),keyid:Fd(i.keyid)?globalThis.String(i.keyid):""}},toJSON(i){let e={};return i.sig.length!==0&&(e.sig=qB(i.sig)),i.keyid!==""&&(e.keyid=i.keyid),e}};function $B(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o($B,"bytesFromBase64");function qB(i){return globalThis.Buffer.from(i).toString("base64")}o(qB,"base64FromBytes");function Fd(i){return i!=null}o(Fd,"isSet")});var zB=d(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.Timestamp=void 0;Ud.Timestamp={fromJSON(i){return{seconds:VB(i.seconds)?globalThis.String(i.seconds):"0",nanos:VB(i.nanos)?globalThis.Number(i.nanos):0}},toJSON(i){let e={};return i.seconds!=="0"&&(e.seconds=i.seconds),i.nanos!==0&&(e.nanos=Math.round(i.nanos)),e}};function VB(i){return i!=null}o(VB,"isSet")});var No=d(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.TimeRange=x.X509CertificateChain=x.SubjectAlternativeName=x.X509Certificate=x.DistinguishedName=x.ObjectIdentifierValuePair=x.ObjectIdentifier=x.PublicKeyIdentifier=x.PublicKey=x.RFC3161SignedTimestamp=x.LogId=x.MessageSignature=x.HashOutput=x.SubjectAlternativeNameType=x.PublicKeyDetails=x.HashAlgorithm=void 0;x.hashAlgorithmFromJSON=GB;x.hashAlgorithmToJSON=WB;x.publicKeyDetailsFromJSON=JB;x.publicKeyDetailsToJSON=KB;x.subjectAlternativeNameTypeFromJSON=ZB;x.subjectAlternativeNameTypeToJSON=YB;var ote=zB(),st;(function(i){i[i.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",i[i.SHA2_256=1]="SHA2_256",i[i.SHA2_384=2]="SHA2_384",i[i.SHA2_512=3]="SHA2_512",i[i.SHA3_256=4]="SHA3_256",i[i.SHA3_384=5]="SHA3_384"})(st||(x.HashAlgorithm=st={}));function GB(i){switch(i){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return st.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return st.SHA2_256;case 2:case"SHA2_384":return st.SHA2_384;case 3:case"SHA2_512":return st.SHA2_512;case 4:case"SHA3_256":return st.SHA3_256;case 5:case"SHA3_384":return st.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(GB,"hashAlgorithmFromJSON");function WB(i){switch(i){case st.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case st.SHA2_256:return"SHA2_256";case st.SHA2_384:return"SHA2_384";case st.SHA2_512:return"SHA2_512";case st.SHA3_256:return"SHA3_256";case st.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum HashAlgorithm")}}o(WB,"hashAlgorithmToJSON");var D;(function(i){i[i.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",i[i.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",i[i.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",i[i.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",i[i.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",i[i.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",i[i.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",i[i.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",i[i.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",i[i.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",i[i.PKIX_RSA_PSS_4096_SHA256=18]="PKIX_RSA_PSS_4096_SHA256",i[i.PKIX_ECDSA_P256_HMAC_SHA_256=6]="PKIX_ECDSA_P256_HMAC_SHA_256",i[i.PKIX_ECDSA_P256_SHA_256=5]="PKIX_ECDSA_P256_SHA_256",i[i.PKIX_ECDSA_P384_SHA_384=12]="PKIX_ECDSA_P384_SHA_384",i[i.PKIX_ECDSA_P521_SHA_512=13]="PKIX_ECDSA_P521_SHA_512",i[i.PKIX_ED25519=7]="PKIX_ED25519",i[i.PKIX_ED25519_PH=8]="PKIX_ED25519_PH",i[i.PKIX_ECDSA_P384_SHA_256=19]="PKIX_ECDSA_P384_SHA_256",i[i.PKIX_ECDSA_P521_SHA_256=20]="PKIX_ECDSA_P521_SHA_256",i[i.LMS_SHA256=14]="LMS_SHA256",i[i.LMOTS_SHA256=15]="LMOTS_SHA256",i[i.ML_DSA_65=21]="ML_DSA_65",i[i.ML_DSA_87=22]="ML_DSA_87"})(D||(x.PublicKeyDetails=D={}));function JB(i){switch(i){case 0:case"PUBLIC_KEY_DETAILS_UNSPECIFIED":return D.PUBLIC_KEY_DETAILS_UNSPECIFIED;case 1:case"PKCS1_RSA_PKCS1V5":return D.PKCS1_RSA_PKCS1V5;case 2:case"PKCS1_RSA_PSS":return D.PKCS1_RSA_PSS;case 3:case"PKIX_RSA_PKCS1V5":return D.PKIX_RSA_PKCS1V5;case 4:case"PKIX_RSA_PSS":return D.PKIX_RSA_PSS;case 9:case"PKIX_RSA_PKCS1V15_2048_SHA256":return D.PKIX_RSA_PKCS1V15_2048_SHA256;case 10:case"PKIX_RSA_PKCS1V15_3072_SHA256":return D.PKIX_RSA_PKCS1V15_3072_SHA256;case 11:case"PKIX_RSA_PKCS1V15_4096_SHA256":return D.PKIX_RSA_PKCS1V15_4096_SHA256;case 16:case"PKIX_RSA_PSS_2048_SHA256":return D.PKIX_RSA_PSS_2048_SHA256;case 17:case"PKIX_RSA_PSS_3072_SHA256":return D.PKIX_RSA_PSS_3072_SHA256;case 18:case"PKIX_RSA_PSS_4096_SHA256":return D.PKIX_RSA_PSS_4096_SHA256;case 6:case"PKIX_ECDSA_P256_HMAC_SHA_256":return D.PKIX_ECDSA_P256_HMAC_SHA_256;case 5:case"PKIX_ECDSA_P256_SHA_256":return D.PKIX_ECDSA_P256_SHA_256;case 12:case"PKIX_ECDSA_P384_SHA_384":return D.PKIX_ECDSA_P384_SHA_384;case 13:case"PKIX_ECDSA_P521_SHA_512":return D.PKIX_ECDSA_P521_SHA_512;case 7:case"PKIX_ED25519":return D.PKIX_ED25519;case 8:case"PKIX_ED25519_PH":return D.PKIX_ED25519_PH;case 19:case"PKIX_ECDSA_P384_SHA_256":return D.PKIX_ECDSA_P384_SHA_256;case 20:case"PKIX_ECDSA_P521_SHA_256":return D.PKIX_ECDSA_P521_SHA_256;case 14:case"LMS_SHA256":return D.LMS_SHA256;case 15:case"LMOTS_SHA256":return D.LMOTS_SHA256;case 21:case"ML_DSA_65":return D.ML_DSA_65;case 22:case"ML_DSA_87":return D.ML_DSA_87;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(JB,"publicKeyDetailsFromJSON");function KB(i){switch(i){case D.PUBLIC_KEY_DETAILS_UNSPECIFIED:return"PUBLIC_KEY_DETAILS_UNSPECIFIED";case D.PKCS1_RSA_PKCS1V5:return"PKCS1_RSA_PKCS1V5";case D.PKCS1_RSA_PSS:return"PKCS1_RSA_PSS";case D.PKIX_RSA_PKCS1V5:return"PKIX_RSA_PKCS1V5";case D.PKIX_RSA_PSS:return"PKIX_RSA_PSS";case D.PKIX_RSA_PKCS1V15_2048_SHA256:return"PKIX_RSA_PKCS1V15_2048_SHA256";case D.PKIX_RSA_PKCS1V15_3072_SHA256:return"PKIX_RSA_PKCS1V15_3072_SHA256";case D.PKIX_RSA_PKCS1V15_4096_SHA256:return"PKIX_RSA_PKCS1V15_4096_SHA256";case D.PKIX_RSA_PSS_2048_SHA256:return"PKIX_RSA_PSS_2048_SHA256";case D.PKIX_RSA_PSS_3072_SHA256:return"PKIX_RSA_PSS_3072_SHA256";case D.PKIX_RSA_PSS_4096_SHA256:return"PKIX_RSA_PSS_4096_SHA256";case D.PKIX_ECDSA_P256_HMAC_SHA_256:return"PKIX_ECDSA_P256_HMAC_SHA_256";case D.PKIX_ECDSA_P256_SHA_256:return"PKIX_ECDSA_P256_SHA_256";case D.PKIX_ECDSA_P384_SHA_384:return"PKIX_ECDSA_P384_SHA_384";case D.PKIX_ECDSA_P521_SHA_512:return"PKIX_ECDSA_P521_SHA_512";case D.PKIX_ED25519:return"PKIX_ED25519";case D.PKIX_ED25519_PH:return"PKIX_ED25519_PH";case D.PKIX_ECDSA_P384_SHA_256:return"PKIX_ECDSA_P384_SHA_256";case D.PKIX_ECDSA_P521_SHA_256:return"PKIX_ECDSA_P521_SHA_256";case D.LMS_SHA256:return"LMS_SHA256";case D.LMOTS_SHA256:return"LMOTS_SHA256";case D.ML_DSA_65:return"ML_DSA_65";case D.ML_DSA_87:return"ML_DSA_87";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum PublicKeyDetails")}}o(KB,"publicKeyDetailsToJSON");var vi;(function(i){i[i.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED=0]="SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED",i[i.EMAIL=1]="EMAIL",i[i.URI=2]="URI",i[i.OTHER_NAME=3]="OTHER_NAME"})(vi||(x.SubjectAlternativeNameType=vi={}));function ZB(i){switch(i){case 0:case"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED":return vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED;case 1:case"EMAIL":return vi.EMAIL;case 2:case"URI":return vi.URI;case 3:case"OTHER_NAME":return vi.OTHER_NAME;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(ZB,"subjectAlternativeNameTypeFromJSON");function YB(i){switch(i){case vi.SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED:return"SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED";case vi.EMAIL:return"EMAIL";case vi.URI:return"URI";case vi.OTHER_NAME:return"OTHER_NAME";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum SubjectAlternativeNameType")}}o(YB,"subjectAlternativeNameTypeToJSON");x.HashOutput={fromJSON(i){return{algorithm:we(i.algorithm)?GB(i.algorithm):0,digest:we(i.digest)?Buffer.from(Gs(i.digest)):Buffer.alloc(0)}},toJSON(i){let e={};return i.algorithm!==0&&(e.algorithm=WB(i.algorithm)),i.digest.length!==0&&(e.digest=Ws(i.digest)),e}};x.MessageSignature={fromJSON(i){return{messageDigest:we(i.messageDigest)?x.HashOutput.fromJSON(i.messageDigest):void 0,signature:we(i.signature)?Buffer.from(Gs(i.signature)):Buffer.alloc(0)}},toJSON(i){let e={};return i.messageDigest!==void 0&&(e.messageDigest=x.HashOutput.toJSON(i.messageDigest)),i.signature.length!==0&&(e.signature=Ws(i.signature)),e}};x.LogId={fromJSON(i){return{keyId:we(i.keyId)?Buffer.from(Gs(i.keyId)):Buffer.alloc(0)}},toJSON(i){let e={};return i.keyId.length!==0&&(e.keyId=Ws(i.keyId)),e}};x.RFC3161SignedTimestamp={fromJSON(i){return{signedTimestamp:we(i.signedTimestamp)?Buffer.from(Gs(i.signedTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedTimestamp.length!==0&&(e.signedTimestamp=Ws(i.signedTimestamp)),e}};x.PublicKey={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):void 0,keyDetails:we(i.keyDetails)?JB(i.keyDetails):0,validFor:we(i.validFor)?x.TimeRange.fromJSON(i.validFor):void 0}},toJSON(i){let e={};return i.rawBytes!==void 0&&(e.rawBytes=Ws(i.rawBytes)),i.keyDetails!==0&&(e.keyDetails=KB(i.keyDetails)),i.validFor!==void 0&&(e.validFor=x.TimeRange.toJSON(i.validFor)),e}};x.PublicKeyIdentifier={fromJSON(i){return{hint:we(i.hint)?globalThis.String(i.hint):""}},toJSON(i){let e={};return i.hint!==""&&(e.hint=i.hint),e}};x.ObjectIdentifier={fromJSON(i){return{id:globalThis.Array.isArray(i?.id)?i.id.map(e=>globalThis.Number(e)):[]}},toJSON(i){let e={};return i.id?.length&&(e.id=i.id.map(t=>Math.round(t))),e}};x.ObjectIdentifierValuePair={fromJSON(i){return{oid:we(i.oid)?x.ObjectIdentifier.fromJSON(i.oid):void 0,value:we(i.value)?Buffer.from(Gs(i.value)):Buffer.alloc(0)}},toJSON(i){let e={};return i.oid!==void 0&&(e.oid=x.ObjectIdentifier.toJSON(i.oid)),i.value.length!==0&&(e.value=Ws(i.value)),e}};x.DistinguishedName={fromJSON(i){return{organization:we(i.organization)?globalThis.String(i.organization):"",commonName:we(i.commonName)?globalThis.String(i.commonName):""}},toJSON(i){let e={};return i.organization!==""&&(e.organization=i.organization),i.commonName!==""&&(e.commonName=i.commonName),e}};x.X509Certificate={fromJSON(i){return{rawBytes:we(i.rawBytes)?Buffer.from(Gs(i.rawBytes)):Buffer.alloc(0)}},toJSON(i){let e={};return i.rawBytes.length!==0&&(e.rawBytes=Ws(i.rawBytes)),e}};x.SubjectAlternativeName={fromJSON(i){return{type:we(i.type)?ZB(i.type):0,identity:we(i.regexp)?{$case:"regexp",regexp:globalThis.String(i.regexp)}:we(i.value)?{$case:"value",value:globalThis.String(i.value)}:void 0}},toJSON(i){let e={};return i.type!==0&&(e.type=YB(i.type)),i.identity?.$case==="regexp"?e.regexp=i.identity.regexp:i.identity?.$case==="value"&&(e.value=i.identity.value),e}};x.X509CertificateChain={fromJSON(i){return{certificates:globalThis.Array.isArray(i?.certificates)?i.certificates.map(e=>x.X509Certificate.fromJSON(e)):[]}},toJSON(i){let e={};return i.certificates?.length&&(e.certificates=i.certificates.map(t=>x.X509Certificate.toJSON(t))),e}};x.TimeRange={fromJSON(i){return{start:we(i.start)?HB(i.start):void 0,end:we(i.end)?HB(i.end):void 0}},toJSON(i){let e={};return i.start!==void 0&&(e.start=i.start.toISOString()),i.end!==void 0&&(e.end=i.end.toISOString()),e}};function Gs(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(Gs,"bytesFromBase64");function Ws(i){return globalThis.Buffer.from(i).toString("base64")}o(Ws,"base64FromBytes");function ate(i){let e=(globalThis.Number(i.seconds)||0)*1e3;return e+=(i.nanos||0)/1e6,new globalThis.Date(e)}o(ate,"fromTimestamp");function HB(i){return i instanceof globalThis.Date?i:typeof i=="string"?new globalThis.Date(i):ate(ote.Timestamp.fromJSON(i))}o(HB,"fromJsonTimestamp");function we(i){return i!=null}o(we,"isSet")});var U_=d(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.TransparencyLogEntry=_e.InclusionPromise=_e.InclusionProof=_e.Checkpoint=_e.KindVersion=void 0;var XB=No();_e.KindVersion={fromJSON(i){return{kind:Je(i.kind)?globalThis.String(i.kind):"",version:Je(i.version)?globalThis.String(i.version):""}},toJSON(i){let e={};return i.kind!==""&&(e.kind=i.kind),i.version!==""&&(e.version=i.version),e}};_e.Checkpoint={fromJSON(i){return{envelope:Je(i.envelope)?globalThis.String(i.envelope):""}},toJSON(i){let e={};return i.envelope!==""&&(e.envelope=i.envelope),e}};_e.InclusionProof={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",rootHash:Je(i.rootHash)?Buffer.from(jd(i.rootHash)):Buffer.alloc(0),treeSize:Je(i.treeSize)?globalThis.String(i.treeSize):"0",hashes:globalThis.Array.isArray(i?.hashes)?i.hashes.map(e=>Buffer.from(jd(e))):[],checkpoint:Je(i.checkpoint)?_e.Checkpoint.fromJSON(i.checkpoint):void 0}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.rootHash.length!==0&&(e.rootHash=$d(i.rootHash)),i.treeSize!=="0"&&(e.treeSize=i.treeSize),i.hashes?.length&&(e.hashes=i.hashes.map(t=>$d(t))),i.checkpoint!==void 0&&(e.checkpoint=_e.Checkpoint.toJSON(i.checkpoint)),e}};_e.InclusionPromise={fromJSON(i){return{signedEntryTimestamp:Je(i.signedEntryTimestamp)?Buffer.from(jd(i.signedEntryTimestamp)):Buffer.alloc(0)}},toJSON(i){let e={};return i.signedEntryTimestamp.length!==0&&(e.signedEntryTimestamp=$d(i.signedEntryTimestamp)),e}};_e.TransparencyLogEntry={fromJSON(i){return{logIndex:Je(i.logIndex)?globalThis.String(i.logIndex):"0",logId:Je(i.logId)?XB.LogId.fromJSON(i.logId):void 0,kindVersion:Je(i.kindVersion)?_e.KindVersion.fromJSON(i.kindVersion):void 0,integratedTime:Je(i.integratedTime)?globalThis.String(i.integratedTime):"0",inclusionPromise:Je(i.inclusionPromise)?_e.InclusionPromise.fromJSON(i.inclusionPromise):void 0,inclusionProof:Je(i.inclusionProof)?_e.InclusionProof.fromJSON(i.inclusionProof):void 0,canonicalizedBody:Je(i.canonicalizedBody)?Buffer.from(jd(i.canonicalizedBody)):Buffer.alloc(0)}},toJSON(i){let e={};return i.logIndex!=="0"&&(e.logIndex=i.logIndex),i.logId!==void 0&&(e.logId=XB.LogId.toJSON(i.logId)),i.kindVersion!==void 0&&(e.kindVersion=_e.KindVersion.toJSON(i.kindVersion)),i.integratedTime!=="0"&&(e.integratedTime=i.integratedTime),i.inclusionPromise!==void 0&&(e.inclusionPromise=_e.InclusionPromise.toJSON(i.inclusionPromise)),i.inclusionProof!==void 0&&(e.inclusionProof=_e.InclusionProof.toJSON(i.inclusionProof)),i.canonicalizedBody.length!==0&&(e.canonicalizedBody=$d(i.canonicalizedBody)),e}};function jd(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(jd,"bytesFromBase64");function $d(i){return globalThis.Buffer.from(i).toString("base64")}o($d,"base64FromBytes");function Je(i){return i!=null}o(Je,"isSet")});var j_=d(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Bundle=Mt.VerificationMaterial=Mt.TimestampVerificationData=void 0;var QB=F_(),Ri=No(),ek=U_();Mt.TimestampVerificationData={fromJSON(i){return{rfc3161Timestamps:globalThis.Array.isArray(i?.rfc3161Timestamps)?i.rfc3161Timestamps.map(e=>Ri.RFC3161SignedTimestamp.fromJSON(e)):[]}},toJSON(i){let e={};return i.rfc3161Timestamps?.length&&(e.rfc3161Timestamps=i.rfc3161Timestamps.map(t=>Ri.RFC3161SignedTimestamp.toJSON(t))),e}};Mt.VerificationMaterial={fromJSON(i){return{content:$r(i.publicKey)?{$case:"publicKey",publicKey:Ri.PublicKeyIdentifier.fromJSON(i.publicKey)}:$r(i.x509CertificateChain)?{$case:"x509CertificateChain",x509CertificateChain:Ri.X509CertificateChain.fromJSON(i.x509CertificateChain)}:$r(i.certificate)?{$case:"certificate",certificate:Ri.X509Certificate.fromJSON(i.certificate)}:void 0,tlogEntries:globalThis.Array.isArray(i?.tlogEntries)?i.tlogEntries.map(e=>ek.TransparencyLogEntry.fromJSON(e)):[],timestampVerificationData:$r(i.timestampVerificationData)?Mt.TimestampVerificationData.fromJSON(i.timestampVerificationData):void 0}},toJSON(i){let e={};return i.content?.$case==="publicKey"?e.publicKey=Ri.PublicKeyIdentifier.toJSON(i.content.publicKey):i.content?.$case==="x509CertificateChain"?e.x509CertificateChain=Ri.X509CertificateChain.toJSON(i.content.x509CertificateChain):i.content?.$case==="certificate"&&(e.certificate=Ri.X509Certificate.toJSON(i.content.certificate)),i.tlogEntries?.length&&(e.tlogEntries=i.tlogEntries.map(t=>ek.TransparencyLogEntry.toJSON(t))),i.timestampVerificationData!==void 0&&(e.timestampVerificationData=Mt.TimestampVerificationData.toJSON(i.timestampVerificationData)),e}};Mt.Bundle={fromJSON(i){return{mediaType:$r(i.mediaType)?globalThis.String(i.mediaType):"",verificationMaterial:$r(i.verificationMaterial)?Mt.VerificationMaterial.fromJSON(i.verificationMaterial):void 0,content:$r(i.messageSignature)?{$case:"messageSignature",messageSignature:Ri.MessageSignature.fromJSON(i.messageSignature)}:$r(i.dsseEnvelope)?{$case:"dsseEnvelope",dsseEnvelope:QB.Envelope.fromJSON(i.dsseEnvelope)}:void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.verificationMaterial!==void 0&&(e.verificationMaterial=Mt.VerificationMaterial.toJSON(i.verificationMaterial)),i.content?.$case==="messageSignature"?e.messageSignature=Ri.MessageSignature.toJSON(i.content.messageSignature):i.content?.$case==="dsseEnvelope"&&(e.dsseEnvelope=QB.Envelope.toJSON(i.content.dsseEnvelope)),e}};function $r(i){return i!=null}o($r,"isSet")});var $_=d(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.ClientTrustConfig=L.ServiceConfiguration=L.Service=L.SigningConfig=L.TrustedRoot=L.CertificateAuthority=L.TransparencyLogInstance=L.ServiceSelector=void 0;L.serviceSelectorFromJSON=tk;L.serviceSelectorToJSON=ik;var je=No(),Ai;(function(i){i[i.SERVICE_SELECTOR_UNDEFINED=0]="SERVICE_SELECTOR_UNDEFINED",i[i.ALL=1]="ALL",i[i.ANY=2]="ANY",i[i.EXACT=3]="EXACT"})(Ai||(L.ServiceSelector=Ai={}));function tk(i){switch(i){case 0:case"SERVICE_SELECTOR_UNDEFINED":return Ai.SERVICE_SELECTOR_UNDEFINED;case 1:case"ALL":return Ai.ALL;case 2:case"ANY":return Ai.ANY;case 3:case"EXACT":return Ai.EXACT;default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(tk,"serviceSelectorFromJSON");function ik(i){switch(i){case Ai.SERVICE_SELECTOR_UNDEFINED:return"SERVICE_SELECTOR_UNDEFINED";case Ai.ALL:return"ALL";case Ai.ANY:return"ANY";case Ai.EXACT:return"EXACT";default:throw new globalThis.Error("Unrecognized enum value "+i+" for enum ServiceSelector")}}o(ik,"serviceSelectorToJSON");L.TransparencyLogInstance={fromJSON(i){return{baseUrl:ae(i.baseUrl)?globalThis.String(i.baseUrl):"",hashAlgorithm:ae(i.hashAlgorithm)?(0,je.hashAlgorithmFromJSON)(i.hashAlgorithm):0,publicKey:ae(i.publicKey)?je.PublicKey.fromJSON(i.publicKey):void 0,logId:ae(i.logId)?je.LogId.fromJSON(i.logId):void 0,checkpointKeyId:ae(i.checkpointKeyId)?je.LogId.fromJSON(i.checkpointKeyId):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.baseUrl!==""&&(e.baseUrl=i.baseUrl),i.hashAlgorithm!==0&&(e.hashAlgorithm=(0,je.hashAlgorithmToJSON)(i.hashAlgorithm)),i.publicKey!==void 0&&(e.publicKey=je.PublicKey.toJSON(i.publicKey)),i.logId!==void 0&&(e.logId=je.LogId.toJSON(i.logId)),i.checkpointKeyId!==void 0&&(e.checkpointKeyId=je.LogId.toJSON(i.checkpointKeyId)),i.operator!==""&&(e.operator=i.operator),e}};L.CertificateAuthority={fromJSON(i){return{subject:ae(i.subject)?je.DistinguishedName.fromJSON(i.subject):void 0,uri:ae(i.uri)?globalThis.String(i.uri):"",certChain:ae(i.certChain)?je.X509CertificateChain.fromJSON(i.certChain):void 0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.subject!==void 0&&(e.subject=je.DistinguishedName.toJSON(i.subject)),i.uri!==""&&(e.uri=i.uri),i.certChain!==void 0&&(e.certChain=je.X509CertificateChain.toJSON(i.certChain)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.TrustedRoot={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",tlogs:globalThis.Array.isArray(i?.tlogs)?i.tlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],certificateAuthorities:globalThis.Array.isArray(i?.certificateAuthorities)?i.certificateAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[],ctlogs:globalThis.Array.isArray(i?.ctlogs)?i.ctlogs.map(e=>L.TransparencyLogInstance.fromJSON(e)):[],timestampAuthorities:globalThis.Array.isArray(i?.timestampAuthorities)?i.timestampAuthorities.map(e=>L.CertificateAuthority.fromJSON(e)):[]}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.tlogs?.length&&(e.tlogs=i.tlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.certificateAuthorities?.length&&(e.certificateAuthorities=i.certificateAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),i.ctlogs?.length&&(e.ctlogs=i.ctlogs.map(t=>L.TransparencyLogInstance.toJSON(t))),i.timestampAuthorities?.length&&(e.timestampAuthorities=i.timestampAuthorities.map(t=>L.CertificateAuthority.toJSON(t))),e}};L.SigningConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",caUrls:globalThis.Array.isArray(i?.caUrls)?i.caUrls.map(e=>L.Service.fromJSON(e)):[],oidcUrls:globalThis.Array.isArray(i?.oidcUrls)?i.oidcUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogUrls:globalThis.Array.isArray(i?.rekorTlogUrls)?i.rekorTlogUrls.map(e=>L.Service.fromJSON(e)):[],rekorTlogConfig:ae(i.rekorTlogConfig)?L.ServiceConfiguration.fromJSON(i.rekorTlogConfig):void 0,tsaUrls:globalThis.Array.isArray(i?.tsaUrls)?i.tsaUrls.map(e=>L.Service.fromJSON(e)):[],tsaConfig:ae(i.tsaConfig)?L.ServiceConfiguration.fromJSON(i.tsaConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.caUrls?.length&&(e.caUrls=i.caUrls.map(t=>L.Service.toJSON(t))),i.oidcUrls?.length&&(e.oidcUrls=i.oidcUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogUrls?.length&&(e.rekorTlogUrls=i.rekorTlogUrls.map(t=>L.Service.toJSON(t))),i.rekorTlogConfig!==void 0&&(e.rekorTlogConfig=L.ServiceConfiguration.toJSON(i.rekorTlogConfig)),i.tsaUrls?.length&&(e.tsaUrls=i.tsaUrls.map(t=>L.Service.toJSON(t))),i.tsaConfig!==void 0&&(e.tsaConfig=L.ServiceConfiguration.toJSON(i.tsaConfig)),e}};L.Service={fromJSON(i){return{url:ae(i.url)?globalThis.String(i.url):"",majorApiVersion:ae(i.majorApiVersion)?globalThis.Number(i.majorApiVersion):0,validFor:ae(i.validFor)?je.TimeRange.fromJSON(i.validFor):void 0,operator:ae(i.operator)?globalThis.String(i.operator):""}},toJSON(i){let e={};return i.url!==""&&(e.url=i.url),i.majorApiVersion!==0&&(e.majorApiVersion=Math.round(i.majorApiVersion)),i.validFor!==void 0&&(e.validFor=je.TimeRange.toJSON(i.validFor)),i.operator!==""&&(e.operator=i.operator),e}};L.ServiceConfiguration={fromJSON(i){return{selector:ae(i.selector)?tk(i.selector):0,count:ae(i.count)?globalThis.Number(i.count):0}},toJSON(i){let e={};return i.selector!==0&&(e.selector=ik(i.selector)),i.count!==0&&(e.count=Math.round(i.count)),e}};L.ClientTrustConfig={fromJSON(i){return{mediaType:ae(i.mediaType)?globalThis.String(i.mediaType):"",trustedRoot:ae(i.trustedRoot)?L.TrustedRoot.fromJSON(i.trustedRoot):void 0,signingConfig:ae(i.signingConfig)?L.SigningConfig.fromJSON(i.signingConfig):void 0}},toJSON(i){let e={};return i.mediaType!==""&&(e.mediaType=i.mediaType),i.trustedRoot!==void 0&&(e.trustedRoot=L.TrustedRoot.toJSON(i.trustedRoot)),i.signingConfig!==void 0&&(e.signingConfig=L.SigningConfig.toJSON(i.signingConfig)),e}};function ae(i){return i!=null}o(ae,"isSet")});var nk=d(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.Input=M.Artifact=M.ArtifactVerificationOptions_ObserverTimestampOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions=M.ArtifactVerificationOptions_CtlogOptions=M.ArtifactVerificationOptions_TlogOptions=M.ArtifactVerificationOptions=M.PublicKeyIdentities=M.CertificateIdentities=M.CertificateIdentity=void 0;var rk=j_(),qr=No(),sk=$_();M.CertificateIdentity={fromJSON(i){return{issuer:Q(i.issuer)?globalThis.String(i.issuer):"",san:Q(i.san)?qr.SubjectAlternativeName.fromJSON(i.san):void 0,oids:globalThis.Array.isArray(i?.oids)?i.oids.map(e=>qr.ObjectIdentifierValuePair.fromJSON(e)):[]}},toJSON(i){let e={};return i.issuer!==""&&(e.issuer=i.issuer),i.san!==void 0&&(e.san=qr.SubjectAlternativeName.toJSON(i.san)),i.oids?.length&&(e.oids=i.oids.map(t=>qr.ObjectIdentifierValuePair.toJSON(t))),e}};M.CertificateIdentities={fromJSON(i){return{identities:globalThis.Array.isArray(i?.identities)?i.identities.map(e=>M.CertificateIdentity.fromJSON(e)):[]}},toJSON(i){let e={};return i.identities?.length&&(e.identities=i.identities.map(t=>M.CertificateIdentity.toJSON(t))),e}};M.PublicKeyIdentities={fromJSON(i){return{publicKeys:globalThis.Array.isArray(i?.publicKeys)?i.publicKeys.map(e=>qr.PublicKey.fromJSON(e)):[]}},toJSON(i){let e={};return i.publicKeys?.length&&(e.publicKeys=i.publicKeys.map(t=>qr.PublicKey.toJSON(t))),e}};M.ArtifactVerificationOptions={fromJSON(i){return{signers:Q(i.certificateIdentities)?{$case:"certificateIdentities",certificateIdentities:M.CertificateIdentities.fromJSON(i.certificateIdentities)}:Q(i.publicKeys)?{$case:"publicKeys",publicKeys:M.PublicKeyIdentities.fromJSON(i.publicKeys)}:void 0,tlogOptions:Q(i.tlogOptions)?M.ArtifactVerificationOptions_TlogOptions.fromJSON(i.tlogOptions):void 0,ctlogOptions:Q(i.ctlogOptions)?M.ArtifactVerificationOptions_CtlogOptions.fromJSON(i.ctlogOptions):void 0,tsaOptions:Q(i.tsaOptions)?M.ArtifactVerificationOptions_TimestampAuthorityOptions.fromJSON(i.tsaOptions):void 0,integratedTsOptions:Q(i.integratedTsOptions)?M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.fromJSON(i.integratedTsOptions):void 0,observerOptions:Q(i.observerOptions)?M.ArtifactVerificationOptions_ObserverTimestampOptions.fromJSON(i.observerOptions):void 0}},toJSON(i){let e={};return i.signers?.$case==="certificateIdentities"?e.certificateIdentities=M.CertificateIdentities.toJSON(i.signers.certificateIdentities):i.signers?.$case==="publicKeys"&&(e.publicKeys=M.PublicKeyIdentities.toJSON(i.signers.publicKeys)),i.tlogOptions!==void 0&&(e.tlogOptions=M.ArtifactVerificationOptions_TlogOptions.toJSON(i.tlogOptions)),i.ctlogOptions!==void 0&&(e.ctlogOptions=M.ArtifactVerificationOptions_CtlogOptions.toJSON(i.ctlogOptions)),i.tsaOptions!==void 0&&(e.tsaOptions=M.ArtifactVerificationOptions_TimestampAuthorityOptions.toJSON(i.tsaOptions)),i.integratedTsOptions!==void 0&&(e.integratedTsOptions=M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions.toJSON(i.integratedTsOptions)),i.observerOptions!==void 0&&(e.observerOptions=M.ArtifactVerificationOptions_ObserverTimestampOptions.toJSON(i.observerOptions)),e}};M.ArtifactVerificationOptions_TlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,performOnlineVerification:Q(i.performOnlineVerification)?globalThis.Boolean(i.performOnlineVerification):!1,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.performOnlineVerification!==!1&&(e.performOnlineVerification=i.performOnlineVerification),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_CtlogOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TimestampAuthorityOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_TlogIntegratedTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.ArtifactVerificationOptions_ObserverTimestampOptions={fromJSON(i){return{threshold:Q(i.threshold)?globalThis.Number(i.threshold):0,disable:Q(i.disable)?globalThis.Boolean(i.disable):!1}},toJSON(i){let e={};return i.threshold!==0&&(e.threshold=Math.round(i.threshold)),i.disable!==!1&&(e.disable=i.disable),e}};M.Artifact={fromJSON(i){return{data:Q(i.artifactUri)?{$case:"artifactUri",artifactUri:globalThis.String(i.artifactUri)}:Q(i.artifact)?{$case:"artifact",artifact:Buffer.from(cte(i.artifact))}:Q(i.artifactDigest)?{$case:"artifactDigest",artifactDigest:qr.HashOutput.fromJSON(i.artifactDigest)}:void 0}},toJSON(i){let e={};return i.data?.$case==="artifactUri"?e.artifactUri=i.data.artifactUri:i.data?.$case==="artifact"?e.artifact=ute(i.data.artifact):i.data?.$case==="artifactDigest"&&(e.artifactDigest=qr.HashOutput.toJSON(i.data.artifactDigest)),e}};M.Input={fromJSON(i){return{artifactTrustRoot:Q(i.artifactTrustRoot)?sk.TrustedRoot.fromJSON(i.artifactTrustRoot):void 0,artifactVerificationOptions:Q(i.artifactVerificationOptions)?M.ArtifactVerificationOptions.fromJSON(i.artifactVerificationOptions):void 0,bundle:Q(i.bundle)?rk.Bundle.fromJSON(i.bundle):void 0,artifact:Q(i.artifact)?M.Artifact.fromJSON(i.artifact):void 0}},toJSON(i){let e={};return i.artifactTrustRoot!==void 0&&(e.artifactTrustRoot=sk.TrustedRoot.toJSON(i.artifactTrustRoot)),i.artifactVerificationOptions!==void 0&&(e.artifactVerificationOptions=M.ArtifactVerificationOptions.toJSON(i.artifactVerificationOptions)),i.bundle!==void 0&&(e.bundle=rk.Bundle.toJSON(i.bundle)),i.artifact!==void 0&&(e.artifact=M.Artifact.toJSON(i.artifact)),e}};function cte(i){return Uint8Array.from(globalThis.Buffer.from(i,"base64"))}o(cte,"bytesFromBase64");function ute(i){return globalThis.Buffer.from(i).toString("base64")}o(ute,"base64FromBytes");function Q(i){return i!=null}o(Q,"isSet")});var su=d(Bt=>{"use strict";var lte=Bt&&Bt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Po=Bt&&Bt.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&<e(e,i,t)};Object.defineProperty(Bt,"__esModule",{value:!0});Po(F_(),Bt);Po(j_(),Bt);Po(No(),Bt);Po(U_(),Bt);Po($_(),Bt);Po(nk(),Bt)});var qd=d(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.BUNDLE_V03_MEDIA_TYPE=nt.BUNDLE_V03_LEGACY_MEDIA_TYPE=nt.BUNDLE_V02_MEDIA_TYPE=nt.BUNDLE_V01_MEDIA_TYPE=void 0;nt.isBundleWithCertificateChain=hte;nt.isBundleWithPublicKey=fte;nt.isBundleWithMessageSignature=dte;nt.isBundleWithDsseEnvelope=pte;nt.BUNDLE_V01_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.1";nt.BUNDLE_V02_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.2";nt.BUNDLE_V03_LEGACY_MEDIA_TYPE="application/vnd.dev.sigstore.bundle+json;version=0.3";nt.BUNDLE_V03_MEDIA_TYPE="application/vnd.dev.sigstore.bundle.v0.3+json";function hte(i){return i.verificationMaterial.content.$case==="x509CertificateChain"}o(hte,"isBundleWithCertificateChain");function fte(i){return i.verificationMaterial.content.$case==="publicKey"}o(fte,"isBundleWithPublicKey");function dte(i){return i.content.$case==="messageSignature"}o(dte,"isBundleWithMessageSignature");function pte(i){return i.content.$case==="dsseEnvelope"}o(pte,"isBundleWithDsseEnvelope")});var ak=d(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.toMessageSignatureBundle=gte;zd.toDSSEBundle=yte;var mte=su(),Vd=qd();function gte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"messageSignature",messageSignature:{messageDigest:{algorithm:mte.HashAlgorithm.SHA2_256,digest:i.digest},signature:i.signature}},verificationMaterial:ok(i)}}o(gte,"toMessageSignatureBundle");function yte(i){return{mediaType:i.certificateChain?Vd.BUNDLE_V02_MEDIA_TYPE:Vd.BUNDLE_V03_MEDIA_TYPE,content:{$case:"dsseEnvelope",dsseEnvelope:Ste(i)},verificationMaterial:ok(i)}}o(yte,"toDSSEBundle");function Ste(i){return{payloadType:i.artifactType,payload:i.artifact,signatures:[Ete(i)]}}o(Ste,"toEnvelope");function Ete(i){return{keyid:i.keyHint||"",sig:i.signature}}o(Ete,"toSignature");function ok(i){return{content:wte(i),tlogEntries:[],timestampVerificationData:{rfc3161Timestamps:[]}}}o(ok,"toVerificationMaterial");function wte(i){return i.certificate?i.certificateChain?{$case:"x509CertificateChain",x509CertificateChain:{certificates:[{rawBytes:i.certificate}]}}:{$case:"certificate",certificate:{rawBytes:i.certificate}}:{$case:"publicKey",publicKey:{hint:i.keyHint||""}}}o(wte,"toKeyContent")});var V_=d(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.ValidationError=void 0;var q_=class extends Error{static{o(this,"ValidationError")}constructor(e,t){super(e),this.fields=t}};Hd.ValidationError=q_});var z_=d(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.assertBundle=_te;Js.assertBundleV01=ck;Js.isBundleV01=bte;Js.assertBundleV02=Ite;Js.assertBundleLatest=Ote;var Gd=V_();function _te(i){let e=Wd(i);if(e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(_te,"assertBundle");function ck(i){let e=[];if(e.push(...Wd(i)),e.push(...vte(i)),e.length>0)throw new Gd.ValidationError("invalid v0.1 bundle",e)}o(ck,"assertBundleV01");function bte(i){try{return ck(i),!0}catch{return!1}}o(bte,"isBundleV01");function Ite(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.length>0)throw new Gd.ValidationError("invalid v0.2 bundle",e)}o(Ite,"assertBundleV02");function Ote(i){let e=[];if(e.push(...Wd(i)),e.push(...uk(i)),e.push(...Rte(i)),e.length>0)throw new Gd.ValidationError("invalid bundle",e)}o(Ote,"assertBundleLatest");function Wd(i){let e=[];if((i.mediaType===void 0||!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/)&&!i.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))&&e.push("mediaType"),i.content===void 0)e.push("content");else switch(i.content.$case){case"messageSignature":i.content.messageSignature.messageDigest===void 0?e.push("content.messageSignature.messageDigest"):i.content.messageSignature.messageDigest.digest.length===0&&e.push("content.messageSignature.messageDigest.digest"),i.content.messageSignature.signature.length===0&&e.push("content.messageSignature.signature");break;case"dsseEnvelope":i.content.dsseEnvelope.payload.length===0&&e.push("content.dsseEnvelope.payload"),i.content.dsseEnvelope.signatures.length!==1?e.push("content.dsseEnvelope.signatures"):i.content.dsseEnvelope.signatures[0].sig.length===0&&e.push("content.dsseEnvelope.signatures[0].sig");break}if(i.verificationMaterial===void 0)e.push("verificationMaterial");else{if(i.verificationMaterial.content===void 0)e.push("verificationMaterial.content");else switch(i.verificationMaterial.content.$case){case"x509CertificateChain":i.verificationMaterial.content.x509CertificateChain.certificates.length===0&&e.push("verificationMaterial.content.x509CertificateChain.certificates"),i.verificationMaterial.content.x509CertificateChain.certificates.forEach((t,r)=>{t.rawBytes.length===0&&e.push(`verificationMaterial.content.x509CertificateChain.certificates[${r}].rawBytes`)});break;case"certificate":i.verificationMaterial.content.certificate.rawBytes.length===0&&e.push("verificationMaterial.content.certificate.rawBytes");break}i.verificationMaterial.tlogEntries===void 0?e.push("verificationMaterial.tlogEntries"):i.verificationMaterial.tlogEntries.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.logId===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].logId`),t.kindVersion===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].kindVersion`)})}return e}o(Wd,"validateBundleBase");function vte(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionPromise===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionPromise`)}),e}o(vte,"validateInclusionPromise");function uk(i){let e=[];return i.verificationMaterial&&i.verificationMaterial.tlogEntries?.length>0&&i.verificationMaterial.tlogEntries.forEach((t,r)=>{t.inclusionProof===void 0?e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof`):t.inclusionProof.checkpoint===void 0&&e.push(`verificationMaterial.tlogEntries[${r}].inclusionProof.checkpoint`)}),e}o(uk,"validateInclusionProof");function Rte(i){let e=[];return i.verificationMaterial?.content?.$case==="x509CertificateChain"&&e.push("verificationMaterial.content.$case"),e}o(Rte,"validateNoCertificateChain")});var hk=d(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.envelopeToJSON=Ti.envelopeFromJSON=Ti.bundleToJSON=Ti.bundleFromJSON=void 0;var Jd=su(),lk=qd(),H_=z_(),Ate=o(i=>{let e=Jd.Bundle.fromJSON(i);switch(e.mediaType){case lk.BUNDLE_V01_MEDIA_TYPE:(0,H_.assertBundleV01)(e);break;case lk.BUNDLE_V02_MEDIA_TYPE:(0,H_.assertBundleV02)(e);break;default:(0,H_.assertBundleLatest)(e);break}return e},"bundleFromJSON");Ti.bundleFromJSON=Ate;var Tte=o(i=>Jd.Bundle.toJSON(i),"bundleToJSON");Ti.bundleToJSON=Tte;var Cte=o(i=>Jd.Envelope.fromJSON(i),"envelopeFromJSON");Ti.envelopeFromJSON=Cte;var Nte=o(i=>Jd.Envelope.toJSON(i),"envelopeToJSON");Ti.envelopeToJSON=Nte});var ou=d(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.isBundleV01=k.assertBundleV02=k.assertBundleV01=k.assertBundleLatest=k.assertBundle=k.envelopeToJSON=k.envelopeFromJSON=k.bundleToJSON=k.bundleFromJSON=k.ValidationError=k.isBundleWithPublicKey=k.isBundleWithMessageSignature=k.isBundleWithDsseEnvelope=k.isBundleWithCertificateChain=k.BUNDLE_V03_MEDIA_TYPE=k.BUNDLE_V03_LEGACY_MEDIA_TYPE=k.BUNDLE_V02_MEDIA_TYPE=k.BUNDLE_V01_MEDIA_TYPE=k.toMessageSignatureBundle=k.toDSSEBundle=void 0;var fk=ak();Object.defineProperty(k,"toDSSEBundle",{enumerable:!0,get:o(function(){return fk.toDSSEBundle},"get")});Object.defineProperty(k,"toMessageSignatureBundle",{enumerable:!0,get:o(function(){return fk.toMessageSignatureBundle},"get")});var Vr=qd();Object.defineProperty(k,"BUNDLE_V01_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V01_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V02_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V02_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_LEGACY_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_LEGACY_MEDIA_TYPE},"get")});Object.defineProperty(k,"BUNDLE_V03_MEDIA_TYPE",{enumerable:!0,get:o(function(){return Vr.BUNDLE_V03_MEDIA_TYPE},"get")});Object.defineProperty(k,"isBundleWithCertificateChain",{enumerable:!0,get:o(function(){return Vr.isBundleWithCertificateChain},"get")});Object.defineProperty(k,"isBundleWithDsseEnvelope",{enumerable:!0,get:o(function(){return Vr.isBundleWithDsseEnvelope},"get")});Object.defineProperty(k,"isBundleWithMessageSignature",{enumerable:!0,get:o(function(){return Vr.isBundleWithMessageSignature},"get")});Object.defineProperty(k,"isBundleWithPublicKey",{enumerable:!0,get:o(function(){return Vr.isBundleWithPublicKey},"get")});var Pte=V_();Object.defineProperty(k,"ValidationError",{enumerable:!0,get:o(function(){return Pte.ValidationError},"get")});var Kd=hk();Object.defineProperty(k,"bundleFromJSON",{enumerable:!0,get:o(function(){return Kd.bundleFromJSON},"get")});Object.defineProperty(k,"bundleToJSON",{enumerable:!0,get:o(function(){return Kd.bundleToJSON},"get")});Object.defineProperty(k,"envelopeFromJSON",{enumerable:!0,get:o(function(){return Kd.envelopeFromJSON},"get")});Object.defineProperty(k,"envelopeToJSON",{enumerable:!0,get:o(function(){return Kd.envelopeToJSON},"get")});var nu=z_();Object.defineProperty(k,"assertBundle",{enumerable:!0,get:o(function(){return nu.assertBundle},"get")});Object.defineProperty(k,"assertBundleLatest",{enumerable:!0,get:o(function(){return nu.assertBundleLatest},"get")});Object.defineProperty(k,"assertBundleV01",{enumerable:!0,get:o(function(){return nu.assertBundleV01},"get")});Object.defineProperty(k,"assertBundleV02",{enumerable:!0,get:o(function(){return nu.assertBundleV02},"get")});Object.defineProperty(k,"isBundleV01",{enumerable:!0,get:o(function(){return nu.isBundleV01},"get")})});var au=d(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ByteStream=void 0;var G_=class extends Error{static{o(this,"StreamError")}},Zd=class i{static{o(this,"ByteStream")}constructor(e){this.start=0,e?(this.buf=e,this.view=Buffer.from(e)):(this.buf=new ArrayBuffer(0),this.view=Buffer.from(this.buf))}get buffer(){return this.view.subarray(0,this.start)}get length(){return this.view.byteLength}get position(){return this.start}seek(e){this.start=e}slice(e,t){let r=e+t;if(r>this.length)throw new G_("request past end of buffer");return this.view.subarray(e,r)}appendChar(e){this.ensureCapacity(1),this.view[this.start]=e,this.start+=1}appendUint16(e){this.ensureCapacity(2);let t=new Uint16Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[1],this.view[this.start+1]=r[0],this.start+=2}appendUint24(e){this.ensureCapacity(3);let t=new Uint32Array([e]),r=new Uint8Array(t.buffer);this.view[this.start]=r[2],this.view[this.start+1]=r[1],this.view[this.start+2]=r[0],this.start+=3}appendView(e){this.ensureCapacity(e.length),this.view.set(e,this.start),this.start+=e.length}getBlock(e){if(e<=0)return Buffer.alloc(0);if(this.start+e>this.view.length)throw new Error("request past end of buffer");let t=this.view.subarray(this.start,this.start+e);return this.start+=e,t}getUint8(){return this.getBlock(1)[0]}getUint16(){let e=this.getBlock(2);return e[0]<<8|e[1]}ensureCapacity(e){if(this.start+e>this.view.byteLength){let t=i.BLOCK_SIZE+(e>i.BLOCK_SIZE?e:0);this.realloc(this.view.byteLength+t)}}realloc(e){let t=new ArrayBuffer(e),r=Buffer.from(t);r.set(this.view),this.buf=t,this.view=r}};Yd.ByteStream=Zd;Zd.BLOCK_SIZE=1024});var Xd=d(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ASN1TypeError=Do.ASN1ParseError=void 0;var W_=class extends Error{static{o(this,"ASN1ParseError")}};Do.ASN1ParseError=W_;var J_=class extends Error{static{o(this,"ASN1TypeError")}};Do.ASN1TypeError=J_});var pk=d(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.decodeLength=Dte;Qd.encodeLength=xte;var dk=Xd();function Dte(i){let e=i.getUint8();if((e&128)===0)return e;let t=e&127;if(t>6)throw new dk.ASN1ParseError("length exceeds 6 byte limit");let r=0;for(let s=0;s<t;s++)r=r*256+i.getUint8();if(r===0)throw new dk.ASN1ParseError("indefinite length encoding not supported");return r}o(Dte,"decodeLength");function xte(i){if(i<128)return Buffer.from([i]);let e=BigInt(i),t=[];for(;e>0n;)t.unshift(Number(e&255n)),e=e>>8n;return Buffer.from([128|t.length,...t])}o(xte,"encodeLength")});var gk=d(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.parseInteger=Bte;zr.parseStringASCII=mk;zr.parseTime=kte;zr.parseOID=Fte;zr.parseBoolean=Ute;zr.parseBitString=jte;var Lte=/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/,Mte=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;function Bte(i){let e=0,t=i.length,r=i[e],s=r>127,n=s?255:0;for(;r==n&&++e<t;)r=i[e];if(t-e===0)return BigInt(s?-1:0);r=s?r-256:r;let c=BigInt(r);for(let u=e+1;u<t;++u)c=c*BigInt(256)+BigInt(i[u]);return c}o(Bte,"parseInteger");function mk(i){return i.toString("ascii")}o(mk,"parseStringASCII");function kte(i,e){let t=mk(i),r=e?Lte.exec(t):Mte.exec(t);if(!r)throw new Error("invalid time");if(e){let s=Number(r[1]);s+=s>=50?1900:2e3,r[1]=s.toString()}return new Date(`${r[1]}-${r[2]}-${r[3]}T${r[4]}:${r[5]}:${r[6]}Z`)}o(kte,"parseTime");function Fte(i){let e=0,t=i.length,r=i[e++],s=Math.floor(r/40),n=r%40,a=`${s}.${n}`,c=0;for(;e<t;++e)r=i[e],c=(c<<7)+(r&127),(r&128)===0&&(a+=`.${c}`,c=0);return a}o(Fte,"parseOID");function Ute(i){return i[0]!==0}o(Ute,"parseBoolean");function jte(i){let e=i[0],t=1,r=i.length,s=[];for(let n=t;n<r;++n){let a=i[n],c=n===r-1?e:0;for(let u=7;u>=c;--u)s.push(a>>u&1)}return s}o(jte,"parseBitString")});var Sk=d(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.ASN1Tag=void 0;var yk=Xd(),Ks={BOOLEAN:1,INTEGER:2,BIT_STRING:3,OCTET_STRING:4,OBJECT_IDENTIFIER:6,SEQUENCE:16,SET:17,PRINTABLE_STRING:19,UTC_TIME:23,GENERALIZED_TIME:24},K_={UNIVERSAL:0,APPLICATION:1,CONTEXT_SPECIFIC:2,PRIVATE:3},Z_=class{static{o(this,"ASN1Tag")}constructor(e){if(this.number=e&31,this.constructed=(e&32)===32,this.class=e>>6,this.number===31)throw new yk.ASN1ParseError("long form tags not supported");if(this.class===K_.UNIVERSAL&&this.number===0)throw new yk.ASN1ParseError("unsupported tag 0x00")}isUniversal(){return this.class===K_.UNIVERSAL}isContextSpecific(e){let t=this.class===K_.CONTEXT_SPECIFIC;return e!==void 0?t&&this.number===e:t}isBoolean(){return this.isUniversal()&&this.number===Ks.BOOLEAN}isInteger(){return this.isUniversal()&&this.number===Ks.INTEGER}isBitString(){return this.isUniversal()&&this.number===Ks.BIT_STRING}isOctetString(){return this.isUniversal()&&this.number===Ks.OCTET_STRING}isOID(){return this.isUniversal()&&this.number===Ks.OBJECT_IDENTIFIER}isUTCTime(){return this.isUniversal()&&this.number===Ks.UTC_TIME}isGeneralizedTime(){return this.isUniversal()&&this.number===Ks.GENERALIZED_TIME}toDER(){return this.number|(this.constructed?32:0)|this.class<<6}};ep.ASN1Tag=Z_});var bk=d(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.ASN1Obj=void 0;var Y_=au(),Zs=Xd(),wk=pk(),xo=gk(),$te=Sk(),tp=class{static{o(this,"ASN1Obj")}constructor(e,t,r){this.tag=e,this.value=t,this.subs=r}static parseBuffer(e){return _k(new Y_.ByteStream(e))}toDER(){let e=new Y_.ByteStream;if(this.subs.length>0)for(let s of this.subs)e.appendView(s.toDER());else e.appendView(this.value);let t=e.buffer,r=new Y_.ByteStream;return r.appendChar(this.tag.toDER()),r.appendView((0,wk.encodeLength)(t.length)),r.appendView(t),r.buffer}toBoolean(){if(!this.tag.isBoolean())throw new Zs.ASN1TypeError("not a boolean");return(0,xo.parseBoolean)(this.value)}toInteger(){if(!this.tag.isInteger())throw new Zs.ASN1TypeError("not an integer");return(0,xo.parseInteger)(this.value)}toOID(){if(!this.tag.isOID())throw new Zs.ASN1TypeError("not an OID");return(0,xo.parseOID)(this.value)}toDate(){switch(!0){case this.tag.isUTCTime():return(0,xo.parseTime)(this.value,!0);case this.tag.isGeneralizedTime():return(0,xo.parseTime)(this.value,!1);default:throw new Zs.ASN1TypeError("not a date")}}toBitString(){if(!this.tag.isBitString())throw new Zs.ASN1TypeError("not a bit string");return(0,xo.parseBitString)(this.value)}};ip.ASN1Obj=tp;function _k(i){let e=new $te.ASN1Tag(i.getUint8()),t=(0,wk.decodeLength)(i),r=i.slice(i.position,t),s=i.position,n=[];if(e.constructed)n=Ek(i,t);else if(e.isOctetString())try{n=Ek(i,t)}catch{}return n.length===0&&i.seek(s+t),new tp(e,r,n)}o(_k,"parseStream");function Ek(i,e){let t=i.position+e;if(t>i.length)throw new Zs.ASN1ParseError("invalid length");let r=[];for(;i.position<t;)r.push(_k(i));if(i.position!==t)throw new Zs.ASN1ParseError("invalid length");return r}o(Ek,"collectSubs")});var sp=d(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.ASN1Obj=void 0;var qte=bk();Object.defineProperty(rp,"ASN1Obj",{enumerable:!0,get:o(function(){return qte.ASN1Obj},"get")})});var Lo=d(Hr=>{"use strict";var Vte=Hr&&Hr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.createPublicKey=zte;Hr.digest=Hte;Hr.verify=Gte;Hr.bufferEqual=Wte;var cu=Vte(require("crypto"));function zte(i,e="spki"){return typeof i=="string"?cu.default.createPublicKey(i):cu.default.createPublicKey({key:i,format:"der",type:e})}o(zte,"createPublicKey");function Hte(i,...e){let t=cu.default.createHash(i);for(let r of e)t.update(r);return t.digest()}o(Hte,"digest");function Gte(i,e,t,r){try{return cu.default.verify(r,i,e,t)}catch{return!1}}o(Gte,"verify");function Wte(i,e){try{return cu.default.timingSafeEqual(i,e)}catch{return!1}}o(Wte,"bufferEqual")});var Ik=d(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.preAuthEncoding=Kte;var Jte="DSSEv1";function Kte(i,e){let t=[Jte,i.length,i,e.length,""].join(" ");return Buffer.concat([Buffer.from(t,"ascii"),e])}o(Kte,"preAuthEncoding")});var Rk=d(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.base64Encode=Zte;np.base64Decode=Yte;var Ok="base64",vk="utf-8";function Zte(i){return Buffer.from(i,vk).toString(Ok)}o(Zte,"base64Encode");function Yte(i){return Buffer.from(i,Ok).toString(vk)}o(Yte,"base64Decode")});var Ak=d(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.canonicalize=Q_;function Q_(i){let e="";if(i===null||typeof i!="object"||i.toJSON!=null)e+=JSON.stringify(i);else if(Array.isArray(i)){e+="[";let t=!0;i.forEach(r=>{t||(e+=","),t=!1,e+=Q_(r)}),e+="]"}else{e+="{";let t=!0;Object.keys(i).sort().forEach(r=>{t||(e+=","),t=!1,e+=JSON.stringify(r),e+=":",e+=Q_(i[r])}),e+="}"}return e}o(Q_,"canonicalize")});var tb=d(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.toDER=eie;op.fromDER=tie;var Xte=/-----BEGIN (.*)-----/,Qte=/-----END (.*)-----/;function eie(i){let e="";return i.split(`
|
|
56
|
+
`).forEach(t=>{t.match(Xte)||t.match(Qte)||(e+=t)}),Buffer.from(e,"base64")}o(eie,"toDER");function tie(i,e="CERTIFICATE"){let r=i.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...r,`-----END ${e}-----`].join(`
|
|
60
57
|
`).concat(`
|
|
61
|
-
`)}o(Wie,"fromDER")});var Ep=d(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.SHA2_HASH_ALGOS=zo.ECDSA_SIGNATURE_ALGOS=void 0;zo.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};zo.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var Eb=d(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.RFC3161TimestampVerificationError=void 0;var Sb=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};wp.RFC3161TimestampVerificationError=Sb});var tF=d(xi=>{"use strict";var Jie=xi&&xi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Kie=xi&&xi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Zie=xi&&xi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Jie(t,e,r[s]);return Kie(t,e),t}})();Object.defineProperty(xi,"__esModule",{value:!0});xi.TSTInfo=void 0;var eF=Zie(Vo()),Yie=Ep(),Xie=Eb(),wb=class{static{o(this,"TSTInfo")}constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return Yie.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let t=eF.digest(this.messageImprintHashAlgorithm,e);if(!eF.bufferEqual(t,this.messageImprintHashedMessage))throw new Xie.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};xi.TSTInfo=wb});var rF=d(Li=>{"use strict";var Qie=Li&&Li.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),ere=Li&&Li.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),tre=Li&&Li.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Qie(t,e,r[s]);return ere(t,e),t}})();Object.defineProperty(Li,"__esModule",{value:!0});Li.RFC3161Timestamp=void 0;var ire=gp(),_b=tre(Vo()),iF=Ep(),yu=Eb(),rre=tF(),sre="1.2.840.113549.1.7.2",nre="1.2.840.113549.1.9.16.1.4",ore="1.2.840.113549.1.9.4",bb=class i{static{o(this,"RFC3161Timestamp")}constructor(e){this.root=e}static parse(e){let t=ire.ASN1Obj.parseBuffer(e);return new i(t)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return iF.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return iF.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new rre.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,t){if(!this.timeStampTokenObj)throw new yu.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==sre)throw new yu.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==nre)throw new yu.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(t)}verifyMessageDigest(){let e=_b.digest(this.signerDigestAlgorithm,this.tstInfo.raw),t=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!_b.bufferEqual(e,t))throw new yu.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(e){let t=this.signedAttrsObj.toDER();if(t[0]=49,!_b.verify(t,e,this.signatureValue,this.signatureAlgorithm))throw new yu.RFC3161TimestampVerificationError("signature verification failed")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(t=>t.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let e=this.signedDataObj;return e.subs[e.subs.length-1]}get signerInfoObj(){return this.signerInfosObj.subs[0]}get eContentTypeObj(){return this.encapContentInfoObj.subs[0]}get eContentObj(){return this.encapContentInfoObj.subs[1]}get signedAttrsObj(){return this.signerInfoObj.subs.find(t=>t.tag.isContextSpecific(0))}get messageDigestAttributeObj(){return this.signedAttrsObj.subs.find(t=>t.subs[0].tag.isOID()&&t.subs[0].toOID()===ore)}get signerSidObj(){return this.signerInfoObj.subs[1]}get signerDigestAlgorithmObj(){return this.signerInfoObj.subs[2]}get signatureAlgorithmObj(){return this.signerInfoObj.subs[4]}get signatureValueObj(){return this.signerInfoObj.subs[5]}};Li.RFC3161Timestamp=bb});var sF=d(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.RFC3161Timestamp=void 0;var are=rF();Object.defineProperty(_p,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return are.RFC3161Timestamp},"get")})});var oF=d(Mi=>{"use strict";var cre=Mi&&Mi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),ure=Mi&&Mi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lre=Mi&&Mi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&cre(t,e,r[s]);return ure(t,e),t}})();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.SignedCertificateTimestamp=void 0;var hre=lre(Vo()),nF=mu(),Ib=class i{static{o(this,"SignedCertificateTimestamp")}constructor(e){this.version=e.version,this.logID=e.logID,this.timestamp=e.timestamp,this.extensions=e.extensions,this.hashAlgorithm=e.hashAlgorithm,this.signatureAlgorithm=e.signatureAlgorithm,this.signature=e.signature}get datetime(){return new Date(Number(this.timestamp.readBigInt64BE()))}get algorithm(){switch(this.hashAlgorithm){case 0:return"none";case 1:return"md5";case 2:return"sha1";case 3:return"sha224";case 4:return"sha256";case 5:return"sha384";case 6:return"sha512";default:return"unknown"}}verify(e,t){let r=new nF.ByteStream;return r.appendChar(this.version),r.appendChar(0),r.appendView(this.timestamp),r.appendUint16(1),r.appendView(e),r.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&r.appendView(this.extensions),hre.verify(r.buffer,t,this.signature,this.algorithm)}static parse(e){let t=new nF.ByteStream(e),r=t.getUint8(),s=t.getBlock(32),n=t.getBlock(8),a=t.getUint16(),c=t.getBlock(a),u=t.getUint8(),l=t.getUint8(),h=t.getUint16(),f=t.getBlock(h);if(t.position!==e.length)throw new Error("SCT buffer length mismatch");return new i({version:r,logID:s,timestamp:n,extensions:c,hashAlgorithm:u,signatureAlgorithm:l,signature:f})}};Mi.SignedCertificateTimestamp=Ib});var Nb=d(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.X509SCTExtension=Ve.X509SubjectKeyIDExtension=Ve.X509AuthorityKeyIDExtension=Ve.X509SubjectAlternativeNameExtension=Ve.X509KeyUsageExtension=Ve.X509BasicConstraintsExtension=Ve.X509Extension=void 0;var fre=mu(),dre=oF(),dr=class{static{o(this,"X509Extension")}constructor(e){this.root=e}get oid(){return this.root.subs[0].toOID()}get critical(){return this.root.subs.length===3?this.root.subs[1].toBoolean():!1}get value(){return this.extnValueObj.value}get valueObj(){return this.extnValueObj}get extnValueObj(){return this.root.subs[this.root.subs.length-1]}};Ve.X509Extension=dr;var Ob=class extends dr{static{o(this,"X509BasicConstraintsExtension")}get isCA(){return this.sequence.subs[0]?.toBoolean()??!1}get pathLenConstraint(){return this.sequence.subs.length>1?this.sequence.subs[1].toInteger():void 0}get sequence(){return this.extnValueObj.subs[0]}};Ve.X509BasicConstraintsExtension=Ob;var vb=class extends dr{static{o(this,"X509KeyUsageExtension")}get digitalSignature(){return this.bitString[0]===1}get keyCertSign(){return this.bitString[5]===1}get crlSign(){return this.bitString[6]===1}get bitString(){return this.extnValueObj.subs[0].toBitString()}};Ve.X509KeyUsageExtension=vb;var Cb=class extends dr{static{o(this,"X509SubjectAlternativeNameExtension")}get rfc822Name(){return this.findGeneralName(1)?.value.toString("ascii")}get uri(){return this.findGeneralName(6)?.value.toString("ascii")}otherName(e){let t=this.findGeneralName(0);return t===void 0||t.subs[0].toOID()!==e?void 0:t.subs[1].subs[0].value.toString("ascii")}findGeneralName(e){return this.generalNames.find(t=>t.tag.isContextSpecific(e))}get generalNames(){return this.extnValueObj.subs[0].subs}};Ve.X509SubjectAlternativeNameExtension=Cb;var Rb=class extends dr{static{o(this,"X509AuthorityKeyIDExtension")}get keyIdentifier(){return this.findSequenceMember(0)?.value}findSequenceMember(e){return this.sequence.subs.find(t=>t.tag.isContextSpecific(e))}get sequence(){return this.extnValueObj.subs[0]}};Ve.X509AuthorityKeyIDExtension=Rb;var Ab=class extends dr{static{o(this,"X509SubjectKeyIDExtension")}get keyIdentifier(){return this.extnValueObj.subs[0].value}};Ve.X509SubjectKeyIDExtension=Ab;var Tb=class extends dr{static{o(this,"X509SCTExtension")}constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,t=new fre.ByteStream(e),r=t.getUint16()+2,s=[];for(;t.position<r;){let n=t.getUint16(),a=t.getBlock(n);s.push(dre.SignedCertificateTimestamp.parse(a))}if(t.position!==r)throw new Error("SCT list length does not match actual length");return s}};Ve.X509SCTExtension=Tb});var uF=d(wt=>{"use strict";var pre=wt&&wt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),mre=wt&&wt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),cF=wt&&wt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&pre(t,e,r[s]);return mre(t,e),t}})();Object.defineProperty(wt,"__esModule",{value:!0});wt.X509Certificate=wt.EXTENSION_OID_SCT=void 0;var gre=gp(),aF=cF(Vo()),yre=Ep(),Sre=cF(yb()),sn=Nb(),Ere="2.5.29.14",wre="2.5.29.15",_re="2.5.29.17",bre="2.5.29.19",Ire="2.5.29.35";wt.EXTENSION_OID_SCT="1.3.6.1.4.1.11129.2.4.2";var Pb=class i{static{o(this,"X509Certificate")}constructor(e){this.root=e}static parse(e){let t=typeof e=="string"?Sre.toDER(e):e,r=gre.ASN1Obj.parseBuffer(t);return new i(r)}get tbsCertificate(){return this.tbsCertificateObj}get version(){return`v${(this.versionObj.subs[0].toInteger()+BigInt(1)).toString()}`}get serialNumber(){return this.serialNumberObj.value}get notBefore(){return this.validityObj.subs[0].toDate()}get notAfter(){return this.validityObj.subs[1].toDate()}get issuer(){return this.issuerObj.value}get subject(){return this.subjectObj.value}get publicKey(){return this.subjectPublicKeyInfoObj.toDER()}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return yre.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value.subarray(1)}get subjectAltName(){let e=this.extSubjectAltName;return e?.uri||e?.rfc822Name}get extensions(){return this.extensionsObj?.subs[0]?.subs||[]}get extKeyUsage(){let e=this.findExtension(wre);return e?new sn.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(bre);return e?new sn.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(_re);return e?new sn.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(Ire);return e?new sn.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(Ere);return e?new sn.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(wt.EXTENSION_OID_SCT);return e?new sn.X509SCTExtension(e):void 0}get isCA(){let e=this.extBasicConstraints?.isCA||!1;return this.extKeyUsage?e&&this.extKeyUsage.keyCertSign:e}extension(e){let t=this.findExtension(e);return t?new sn.X509Extension(t):void 0}verify(e){let t=e?.publicKey||this.publicKey,r=aF.createPublicKey(t);return aF.verify(this.tbsCertificate.toDER(),r,this.signatureValue,this.signatureAlgorithm)}validForDate(e){return this.notBefore<=e&&e<=this.notAfter}equals(e){return this.root.toDER().equals(e.root.toDER())}clone(){let e=this.root.toDER(),t=Buffer.alloc(e.length);return e.copy(t),i.parse(t)}findExtension(e){return this.extensions.find(t=>t.subs[0].toOID()===e)}get tbsCertificateObj(){return this.root.subs[0]}get signatureAlgorithmObj(){return this.root.subs[1]}get signatureValueObj(){return this.root.subs[2]}get versionObj(){return this.tbsCertificateObj.subs[0]}get serialNumberObj(){return this.tbsCertificateObj.subs[1]}get issuerObj(){return this.tbsCertificateObj.subs[3]}get validityObj(){return this.tbsCertificateObj.subs[4]}get subjectObj(){return this.tbsCertificateObj.subs[5]}get subjectPublicKeyInfoObj(){return this.tbsCertificateObj.subs[6]}get extensionsObj(){return this.tbsCertificateObj.subs.find(e=>e.tag.isContextSpecific(3))}};wt.X509Certificate=Pb});var hF=d(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.X509SCTExtension=Yr.X509Certificate=Yr.EXTENSION_OID_SCT=void 0;var lF=uF();Object.defineProperty(Yr,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return lF.EXTENSION_OID_SCT},"get")});Object.defineProperty(Yr,"X509Certificate",{enumerable:!0,get:o(function(){return lF.X509Certificate},"get")});var Ore=Nb();Object.defineProperty(Yr,"X509SCTExtension",{enumerable:!0,get:o(function(){return Ore.X509SCTExtension},"get")})});var ut=d(K=>{"use strict";var vre=K&&K.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Cre=K&&K.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Su=K&&K.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&vre(t,e,r[s]);return Cre(t,e),t}})();Object.defineProperty(K,"__esModule",{value:!0});K.X509SCTExtension=K.X509Certificate=K.EXTENSION_OID_SCT=K.ByteStream=K.RFC3161Timestamp=K.pem=K.json=K.encoding=K.dsse=K.crypto=K.ASN1Obj=void 0;var Rre=gp();Object.defineProperty(K,"ASN1Obj",{enumerable:!0,get:o(function(){return Rre.ASN1Obj},"get")});K.crypto=Su(Vo());K.dsse=Su(Kk());K.encoding=Su(Xk());K.json=Su(Qk());K.pem=Su(yb());var Are=sF();Object.defineProperty(K,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return Are.RFC3161Timestamp},"get")});var Tre=mu();Object.defineProperty(K,"ByteStream",{enumerable:!0,get:o(function(){return Tre.ByteStream},"get")});var Db=hF();Object.defineProperty(K,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return Db.EXTENSION_OID_SCT},"get")});Object.defineProperty(K,"X509Certificate",{enumerable:!0,get:o(function(){return Db.X509Certificate},"get")});Object.defineProperty(K,"X509SCTExtension",{enumerable:!0,get:o(function(){return Db.X509SCTExtension},"get")})});var fF=d(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.extractJWTSubject=Pre;var Nre=ut();function Pre(i){let e=i.split(".",3),t=JSON.parse(Nre.encoding.base64Decode(e[1]));if(t.email){if(!t.email_verified)throw new Error("JWT email not verified by issuer");return t.email}if(t.sub)return t.sub;throw new Error("JWT subject not found")}o(Pre,"extractJWTSubject")});var dF=d((cbe,Dre)=>{Dre.exports={name:"@sigstore/sign",version:"4.0.1",description:"Sigstore signing library",main:"dist/index.js",types:"dist/index.d.ts",scripts:{clean:"shx rm -rf dist *.tsbuildinfo",build:"tsc --build",test:"jest"},files:["dist"],author:"bdehamer@github.com",license:"Apache-2.0",repository:{type:"git",url:"git+https://github.com/sigstore/sigstore-js.git"},bugs:{url:"https://github.com/sigstore/sigstore-js/issues"},homepage:"https://github.com/sigstore/sigstore-js/tree/main/packages/sign#readme",publishConfig:{provenance:!0},devDependencies:{"@sigstore/jest":"^0.0.0","@sigstore/mock":"^0.11.0","@sigstore/rekor-types":"^4.0.0","@types/make-fetch-happen":"^10.0.4","@types/promise-retry":"^1.1.6"},dependencies:{"@sigstore/bundle":"^4.0.0","@sigstore/core":"^3.0.0","@sigstore/protobuf-specs":"^0.5.0","make-fetch-happen":"^15.0.2","proc-log":"^5.0.0","promise-retry":"^2.0.1"},engines:{node:"^20.17.0 || >=22.9.0"}}});var mF=d(Ho=>{"use strict";var xre=Ho&&Ho.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.getUserAgent=void 0;var pF=xre(require("os")),Lre=o(()=>{let i=dF().version,e=process.version,t=pF.default.platform(),r=pF.default.arch();return`sigstore-js/${i} (Node ${e}) (${t}/${r})`},"getUserAgent");Ho.getUserAgent=Lre});var Xr=d(fe=>{"use strict";var Mre=fe&&fe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Bre=fe&&fe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gF=fe&&fe.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Mre(t,e,r[s]);return Bre(t,e),t}})();Object.defineProperty(fe,"__esModule",{value:!0});fe.ua=fe.oidc=fe.pem=fe.json=fe.encoding=fe.dsse=fe.crypto=void 0;var Eu=ut();Object.defineProperty(fe,"crypto",{enumerable:!0,get:o(function(){return Eu.crypto},"get")});Object.defineProperty(fe,"dsse",{enumerable:!0,get:o(function(){return Eu.dsse},"get")});Object.defineProperty(fe,"encoding",{enumerable:!0,get:o(function(){return Eu.encoding},"get")});Object.defineProperty(fe,"json",{enumerable:!0,get:o(function(){return Eu.json},"get")});Object.defineProperty(fe,"pem",{enumerable:!0,get:o(function(){return Eu.pem},"get")});fe.oidc=gF(fF());fe.ua=gF(mF())});var Mb=d(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.BaseBundleBuilder=void 0;var Lb=class{static{o(this,"BaseBundleBuilder")}constructor(e){this.signer=e.signer,this.witnesses=e.witnesses}async create(e){let t=await this.prepare(e).then(c=>this.signer.sign(c)),r=await this.package(e,t),s=await Promise.all(this.witnesses.map(c=>c.testify(r.content,kre(t.key)))),n=[],a=[];return s.forEach(({tlogEntries:c,rfc3161Timestamps:u})=>{n.push(...c??[]),a.push(...u??[])}),r.verificationMaterial.tlogEntries=n,r.verificationMaterial.timestampVerificationData={rfc3161Timestamps:a},r}async prepare(e){return e.data}};bp.BaseBundleBuilder=Lb;function kre(i){switch(i.$case){case"publicKey":return i.publicKey;case"x509Certificate":return i.certificate}}o(kre,"publicKey")});var kb=d(Bi=>{"use strict";var Fre=Bi&&Bi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Ure=Bi&&Bi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),jre=Bi&&Bi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Fre(t,e,r[s]);return Ure(t,e),t}})();Object.defineProperty(Bi,"__esModule",{value:!0});Bi.toMessageSignatureBundle=$re;Bi.toDSSEBundle=qre;var yF=jre(pu()),Bb=Xr();function $re(i,e){let t=Bb.crypto.digest("sha256",i.data);return yF.toMessageSignatureBundle({digest:t,signature:e.signature,certificate:e.key.$case==="x509Certificate"?Bb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:!0})}o($re,"toMessageSignatureBundle");function qre(i,e,t){return yF.toDSSEBundle({artifact:i.data,artifactType:i.type,signature:e.signature,certificate:e.key.$case==="x509Certificate"?Bb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:t})}o(qre,"toDSSEBundle")});var EF=d(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.DSSEBundleBuilder=void 0;var Vre=Xr(),zre=Mb(),Hre=kb(),Fb=class extends zre.BaseBundleBuilder{static{o(this,"DSSEBundleBuilder")}constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let t=SF(e);return Vre.dsse.preAuthEncoding(t.type,t.data)}async package(e,t){return(0,Hre.toDSSEBundle)(SF(e),t,this.certificateChain)}};Ip.DSSEBundleBuilder=Fb;function SF(i){return{...i,type:i.type??""}}o(SF,"artifactDefaults")});var wF=d(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.MessageSignatureBundleBuilder=void 0;var Gre=Mb(),Wre=kb(),Ub=class extends Gre.BaseBundleBuilder{static{o(this,"MessageSignatureBundleBuilder")}constructor(e){super(e)}async package(e,t){return(0,Wre.toMessageSignatureBundle)(e,t)}};Op.MessageSignatureBundleBuilder=Ub});var _F=d(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.MessageSignatureBundleBuilder=Go.DSSEBundleBuilder=void 0;var Jre=EF();Object.defineProperty(Go,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return Jre.DSSEBundleBuilder},"get")});var Kre=wF();Object.defineProperty(Go,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return Kre.MessageSignatureBundleBuilder},"get")})});var Cp=d(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.HTTPError=void 0;var jb=class extends Error{static{o(this,"HTTPError")}constructor({status:e,message:t,location:r}){super(`(${e}) ${t}`),this.statusCode=e,this.location=r}};vp.HTTPError=jb});var Wo=d(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.InternalError=void 0;wu.internalError=Yre;var Zre=Cp(),Rp=class extends Error{static{o(this,"InternalError")}constructor({code:e,message:t,cause:r}){super(t),this.name=this.constructor.name,this.cause=r,this.code=e}};wu.InternalError=Rp;function Yre(i,e,t){throw i instanceof Zre.HTTPError&&(t+=` - ${i.message}`),new Rp({code:e,message:t,cause:i})}o(Yre,"internalError")});var bF=d(Jo=>{"use strict";var Xre=Jo&&Jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.CIContextProvider=void 0;var Qre=Xre(lu()),ese=[tse,ise],$b=class{static{o(this,"CIContextProvider")}constructor(e="sigstore"){this.audience=e}async getToken(){return Promise.any(ese.map(e=>e(this.audience))).catch(()=>Promise.reject("CI: no tokens available"))}};Jo.CIContextProvider=$b;async function tse(i){if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL||!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN)return Promise.reject("no token available");let e=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);return e.searchParams.append("audience",i),(await(0,Qre.default)(e.href,{retry:2,headers:{Accept:"application/json",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(r=>r.value)}o(tse,"getGHAToken");async function ise(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject("no token available")}o(ise,"getEnv")});var IF=d(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.CIContextProvider=void 0;var rse=bF();Object.defineProperty(Ap,"CIContextProvider",{enumerable:!0,get:o(function(){return rse.CIContextProvider},"get")})});var Tp=d(_u=>{"use strict";var vF=_u&&_u.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(_u,"__esModule",{value:!0});_u.fetchWithRetry=mse;var sse=require("http2"),nse=vF(lu()),OF=_t(),ose=vF(qa()),ase=Xr(),cse=Cp(),{HTTP2_HEADER_LOCATION:use,HTTP2_HEADER_CONTENT_TYPE:lse,HTTP2_HEADER_USER_AGENT:hse,HTTP_STATUS_INTERNAL_SERVER_ERROR:fse,HTTP_STATUS_TOO_MANY_REQUESTS:dse,HTTP_STATUS_REQUEST_TIMEOUT:pse}=sse.constants;async function mse(i,e){return(0,ose.default)(async(t,r)=>{let s=e.method||"POST",n={[hse]:ase.ua.getUserAgent(),...e.headers},a=await(0,nse.default)(i,{method:s,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(c=>(OF.log.http("fetch",`${s} ${i} attempt ${r} failed with ${c}`),t(c)));if(a.ok)return a;{let c=await gse(a);if(OF.log.http("fetch",`${s} ${i} attempt ${r} failed with ${a.status}`),yse(a.status))return t(c);throw c}},Sse(e.retry))}o(mse,"fetchWithRetry");var gse=o(async i=>{let e=i.statusText,t=i.headers.get(use)||void 0;if(i.headers.get(lse)?.includes("application/json"))try{e=(await i.json()).message||e}catch{}return new cse.HTTPError({status:i.status,message:e,location:t})},"errorFromResponse"),yse=o(i=>[pse,dse].includes(i)||i>=fse,"retryable"),Sse=o(i=>typeof i=="boolean"?{retries:i?1:0}:typeof i=="number"?{retries:i}:{retries:0,...i},"retryOpts")});var CF=d(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.Fulcio=void 0;var Ese=Tp(),qb=class{static{o(this,"Fulcio")}constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:t,retry:r,timeout:s}=this.options,n=`${t}/api/v2/signingCert`;return(await(0,Ese.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:s,retry:r})).json()}};Np.Fulcio=qb});var RF=d(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.CAClient=void 0;var wse=Wo(),_se=CF(),Vb=class{static{o(this,"CAClient")}constructor(e){this.fulcio=new _se.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,t,r){let s=bse(e,t,r);try{let n=await this.fulcio.createSigningCertificate(s);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,wse.internalError)(n,"CA_CREATE_SIGNING_CERTIFICATE_ERROR","error creating signing certificate")}}};Pp.CAClient=Vb;function bse(i,e,t){return{credentials:{oidcIdentityToken:i},publicKeyRequest:{publicKey:{algorithm:"ECDSA",content:e},proofOfPossession:t.toString("base64")}}}o(bse,"toCertificateRequest")});var TF=d(Ko=>{"use strict";var Ise=Ko&&Ko.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.EphemeralSigner=void 0;var AF=Ise(require("crypto")),Ose="ec",vse="P-256",zb=class{static{o(this,"EphemeralSigner")}constructor(){this.keypair=AF.default.generateKeyPairSync(Ose,{namedCurve:vse})}async sign(e){let t=AF.default.sign(null,e,this.keypair.privateKey),r=this.keypair.publicKey.export({format:"pem",type:"spki"}).toString("ascii");return{signature:t,key:{$case:"publicKey",publicKey:r}}}};Ko.EphemeralSigner=zb});var NF=d(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.FulcioSigner=nn.DEFAULT_FULCIO_URL=void 0;var Hb=Wo(),Cse=Xr(),Rse=RF(),Ase=TF();nn.DEFAULT_FULCIO_URL="https://fulcio.sigstore.dev";var Gb=class{static{o(this,"FulcioSigner")}constructor(e){this.ca=new Rse.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||nn.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Ase.EphemeralSigner}async sign(e){let t=await this.getIdentityToken(),r;try{r=Cse.oidc.extractJWTSubject(t)}catch(c){throw new Hb.InternalError({code:"IDENTITY_TOKEN_PARSE_ERROR",message:`invalid identity token: ${t}`,cause:c})}let s=await this.keyHolder.sign(Buffer.from(r));if(s.key.$case!=="publicKey")throw new Hb.InternalError({code:"CA_CREATE_SIGNING_CERTIFICATE_ERROR",message:"unexpected format for signing key"});let n=await this.ca.createSigningCertificate(t,s.key.publicKey,s.signature);return{signature:(await this.keyHolder.sign(e)).signature,key:{$case:"x509Certificate",certificate:n[0]}}}async getIdentityToken(){try{return await this.identityProvider.getToken()}catch(e){throw new Hb.InternalError({code:"IDENTITY_TOKEN_READ_ERROR",message:"error retrieving identity token",cause:e})}}};nn.FulcioSigner=Gb});var DF=d(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.FulcioSigner=Zo.DEFAULT_FULCIO_URL=void 0;var PF=NF();Object.defineProperty(Zo,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return PF.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(Zo,"FulcioSigner",{enumerable:!0,get:o(function(){return PF.FulcioSigner},"get")})});var MF=d(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.Rekor=void 0;var xF=Tp(),Wb=class{static{o(this,"Rekor")}constructor(e){this.options=e}async createEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries`,c=await(await(0,xF.fetchWithRetry)(n,{headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).json();return LF(c)}async getEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries/${e}`,c=await(await(0,xF.fetchWithRetry)(n,{method:"GET",headers:{Accept:"application/json"},timeout:r,retry:s})).json();return LF(c)}};Dp.Rekor=Wb;function LF(i){let e=Object.entries(i);if(e.length!=1)throw new Error("Received multiple entries in Rekor response");let[t,r]=e[0];return{...r,uuid:t}}o(LF,"entryFromResponse")});var kF=d(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.TLogClient=void 0;var BF=Wo(),Tse=Cp(),Nse=MF(),Jb=class{static{o(this,"TLogClient")}constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Nse.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let t;try{t=await this.rekor.createEntry(e)}catch(r){if(Pse(r)&&this.fetchOnConflict){let s=r.location.split("/").pop()||"";try{t=await this.rekor.getEntry(s)}catch(n){(0,BF.internalError)(n,"TLOG_FETCH_ENTRY_ERROR","error fetching tlog entry")}}else(0,BF.internalError)(r,"TLOG_CREATE_ENTRY_ERROR","error creating tlog entry")}return t}};xp.TLogClient=Jb;function Pse(i){return i instanceof Tse.HTTPError&&i.statusCode===409&&i.location!==void 0}o(Pse,"entryExistsError")});var FF=d(Kb=>{"use strict";Object.defineProperty(Kb,"__esModule",{value:!0});Kb.toProposedEntry=xse;var Dse=pu(),Qr=Xr(),bu="sha256";function xse(i,e,t="dsse"){switch(i.$case){case"dsseEnvelope":return t==="intoto"?Bse(i.dsseEnvelope,e):Mse(i.dsseEnvelope,e);case"messageSignature":return Lse(i.messageSignature,e)}}o(xse,"toProposedEntry");function Lse(i,e){let t=i.messageDigest.digest.toString("hex"),r=i.signature.toString("base64"),s=Qr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"hashedrekord",spec:{data:{hash:{algorithm:bu,value:t}},signature:{content:r,publicKey:{content:s}}}}}o(Lse,"toProposedHashedRekordEntry");function Mse(i,e){let t=JSON.stringify((0,Dse.envelopeToJSON)(i)),r=Qr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"dsse",spec:{proposedContent:{envelope:t,verifiers:[r]}}}}o(Mse,"toProposedDSSEEntry");function Bse(i,e){let t=Qr.crypto.digest(bu,i.payload).toString("hex"),r=kse(i,e),s=Qr.encoding.base64Encode(i.payload.toString("base64")),n=Qr.encoding.base64Encode(i.signatures[0].sig.toString("base64")),a=i.signatures[0].keyid,c=Qr.encoding.base64Encode(e),u={payloadType:i.payloadType,payload:s,signatures:[{sig:n,publicKey:c}]};return a.length>0&&(u.signatures[0].keyid=a),{apiVersion:"0.0.2",kind:"intoto",spec:{content:{envelope:u,hash:{algorithm:bu,value:r},payloadHash:{algorithm:bu,value:t}}}}}o(Bse,"toProposedIntotoEntry");function kse(i,e){let t={payloadType:i.payloadType,payload:i.payload.toString("base64"),signatures:[{sig:i.signatures[0].sig.toString("base64"),publicKey:e}]};return i.signatures[0].keyid.length>0&&(t.signatures[0].keyid=i.signatures[0].keyid),Qr.crypto.digest(bu,Qr.json.canonicalize(t)).toString("hex")}o(kse,"calculateDSSEHash")});var UF=d(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.RekorWitness=on.DEFAULT_REKOR_URL=void 0;var Fse=Xr(),Use=kF(),jse=FF();on.DEFAULT_REKOR_URL="https://rekor.sigstore.dev";var Zb=class{static{o(this,"RekorWitness")}constructor(e){this.entryType=e.entryType,this.tlog=new Use.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||on.DEFAULT_REKOR_URL})}async testify(e,t){let r=(0,jse.toProposedEntry)(e,t,this.entryType),s=await this.tlog.createEntry(r);return $se(s)}};on.RekorWitness=Zb;function $se(i){let e=Buffer.from(i.logID,"hex"),t=Fse.encoding.base64Decode(i.body),r=JSON.parse(t),s=i?.verification?.signedEntryTimestamp?qse(i.verification.signedEntryTimestamp):void 0,n=i?.verification?.inclusionProof?Vse(i.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:i.logIndex.toString(),logId:{keyId:e},integratedTime:i.integratedTime.toString(),kindVersion:{kind:r.kind,version:r.apiVersion},inclusionPromise:s,inclusionProof:n,canonicalizedBody:Buffer.from(i.body,"base64")}]}}o($se,"toTransparencyLogEntry");function qse(i){return{signedEntryTimestamp:Buffer.from(i,"base64")}}o(qse,"inclusionPromise");function Vse(i){return{logIndex:i.logIndex.toString(),treeSize:i.treeSize.toString(),rootHash:Buffer.from(i.rootHash,"hex"),hashes:i.hashes.map(e=>Buffer.from(e,"hex")),checkpoint:{envelope:i.checkpoint}}}o(Vse,"inclusionProof")});var jF=d(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.TimestampAuthority=void 0;var zse=Tp(),Yb=class{static{o(this,"TimestampAuthority")}constructor(e){this.options=e}async createTimestamp(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/timestamp`;return(await(0,zse.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).buffer()}};Lp.TimestampAuthority=Yb});var qF=d(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.TSAClient=void 0;var Hse=Wo(),Gse=jF(),Wse=Xr(),$F="sha256",Xb=class{static{o(this,"TSAClient")}constructor(e){this.tsa=new Gse.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let t={artifactHash:Wse.crypto.digest($F,e).toString("base64"),hashAlgorithm:$F};try{return await this.tsa.createTimestamp(t)}catch(r){(0,Hse.internalError)(r,"TSA_CREATE_TIMESTAMP_ERROR","error creating timestamp")}}};Mp.TSAClient=Xb});var VF=d(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.TSAWitness=void 0;var Jse=qF(),Qb=class{static{o(this,"TSAWitness")}constructor(e){this.tsa=new Jse.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let t=Kse(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(t)}]}}};Bp.TSAWitness=Qb;function Kse(i){switch(i.$case){case"dsseEnvelope":return i.dsseEnvelope.signatures[0].sig;case"messageSignature":return i.messageSignature.signature}}o(Kse,"extractSignature")});var HF=d(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.TSAWitness=es.RekorWitness=es.DEFAULT_REKOR_URL=void 0;var zF=UF();Object.defineProperty(es,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return zF.DEFAULT_REKOR_URL},"get")});Object.defineProperty(es,"RekorWitness",{enumerable:!0,get:o(function(){return zF.RekorWitness},"get")});var Zse=VF();Object.defineProperty(es,"TSAWitness",{enumerable:!0,get:o(function(){return Zse.TSAWitness},"get")})});var t0=d(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.TSAWitness=be.RekorWitness=be.DEFAULT_REKOR_URL=be.FulcioSigner=be.DEFAULT_FULCIO_URL=be.CIContextProvider=be.InternalError=be.MessageSignatureBundleBuilder=be.DSSEBundleBuilder=void 0;var GF=_F();Object.defineProperty(be,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return GF.DSSEBundleBuilder},"get")});Object.defineProperty(be,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return GF.MessageSignatureBundleBuilder},"get")});var Yse=Wo();Object.defineProperty(be,"InternalError",{enumerable:!0,get:o(function(){return Yse.InternalError},"get")});var Xse=IF();Object.defineProperty(be,"CIContextProvider",{enumerable:!0,get:o(function(){return Xse.CIContextProvider},"get")});var WF=DF();Object.defineProperty(be,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return WF.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(be,"FulcioSigner",{enumerable:!0,get:o(function(){return WF.FulcioSigner},"get")});var e0=HF();Object.defineProperty(be,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return e0.DEFAULT_REKOR_URL},"get")});Object.defineProperty(be,"RekorWitness",{enumerable:!0,get:o(function(){return e0.RekorWitness},"get")});Object.defineProperty(be,"TSAWitness",{enumerable:!0,get:o(function(){return e0.TSAWitness},"get")})});var KF=d(Iu=>{"use strict";var JF=Iu&&Iu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Iu,"__esModule",{value:!0});Iu.appDataPath=ene;var Qse=JF(require("os")),Yo=JF(require("path"));function ene(i){let e=Qse.default.homedir();switch(process.platform){case"darwin":{let t=Yo.default.join(e,"Library","Application Support");return Yo.default.join(t,i)}case"win32":{let t=process.env.LOCALAPPDATA||Yo.default.join(e,"AppData","Local");return Yo.default.join(t,i,"Data")}default:{let t=process.env.XDG_DATA_HOME||Yo.default.join(e,".local","share");return Yo.default.join(t,i)}}}o(ene,"appDataPath")});var ki=d(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.UnsupportedAlgorithmError=lt.CryptoError=lt.LengthOrHashMismatchError=lt.UnsignedMetadataError=lt.RepositoryError=lt.ValueError=void 0;var i0=class extends Error{static{o(this,"ValueError")}};lt.ValueError=i0;var Ou=class extends Error{static{o(this,"RepositoryError")}};lt.RepositoryError=Ou;var r0=class extends Ou{static{o(this,"UnsignedMetadataError")}};lt.UnsignedMetadataError=r0;var s0=class extends Ou{static{o(this,"LengthOrHashMismatchError")}};lt.LengthOrHashMismatchError=s0;var kp=class extends Error{static{o(this,"CryptoError")}};lt.CryptoError=kp;var n0=class extends kp{static{o(this,"UnsupportedAlgorithmError")}};lt.UnsupportedAlgorithmError=n0});var YF=d(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.isDefined=tne;ts.isObject=ZF;ts.isStringArray=ine;ts.isObjectArray=rne;ts.isStringRecord=sne;ts.isObjectRecord=nne;function tne(i){return i!==void 0}o(tne,"isDefined");function ZF(i){return typeof i=="object"&&i!==null}o(ZF,"isObject");function ine(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}o(ine,"isStringArray");function rne(i){return Array.isArray(i)&&i.every(ZF)}o(rne,"isObjectArray");function sne(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="string")}o(sne,"isStringRecord");function nne(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="object"&&e!==null)}o(nne,"isObjectRecord")});var a0=d((d0e,QF)=>{function o0(i){let e=[];if(typeof i=="string")e.push(XF(i));else if(typeof i=="boolean")e.push(JSON.stringify(i));else if(Number.isInteger(i))e.push(JSON.stringify(i));else if(i===null)e.push(JSON.stringify(i));else if(Array.isArray(i)){e.push("[");let t=!0;i.forEach(r=>{t||e.push(","),t=!1,e.push(o0(r))}),e.push("]")}else if(typeof i=="object"){e.push("{");let t=!0;Object.keys(i).sort().forEach(r=>{t||e.push(","),t=!1,e.push(XF(r)),e.push(":"),e.push(o0(i[r]))}),e.push("}")}else throw new TypeError("cannot encode "+i.toString());return e.join("")}o(o0,"canonicalize");function XF(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}o(XF,"canonicalizeString");QF.exports={canonicalize:o0}});var eU=d(Xo=>{"use strict";var one=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.verifySignature=void 0;var ane=a0(),cne=one(require("crypto")),une=o((i,e,t)=>{let r=Buffer.from((0,ane.canonicalize)(i));return cne.default.verify(void 0,r,e,Buffer.from(t,"hex"))},"verifySignature");Xo.verifySignature=une});var si=d($t=>{"use strict";var lne=$t&&$t.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),hne=$t&&$t.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),tU=$t&&$t.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&lne(t,e,r[s]);return hne(t,e),t}})();Object.defineProperty($t,"__esModule",{value:!0});$t.crypto=$t.guard=void 0;$t.guard=tU(YF());$t.crypto=tU(eU())});var an=d(pr=>{"use strict";var fne=pr&&pr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(pr,"__esModule",{value:!0});pr.Signed=pr.MetadataKind=void 0;pr.isMetadataKind=pne;var dne=fne(require("util")),vu=ki(),c0=si(),iU=["1","0","31"],u0;(function(i){i.Root="root",i.Timestamp="timestamp",i.Snapshot="snapshot",i.Targets="targets"})(u0||(pr.MetadataKind=u0={}));function pne(i){return typeof i=="string"&&Object.values(u0).includes(i)}o(pne,"isMetadataKind");var l0=class i{static{o(this,"Signed")}specVersion;expires;version;unrecognizedFields;constructor(e){this.specVersion=e.specVersion||iU.join(".");let t=this.specVersion.split(".");if(!(t.length===2||t.length===3)||!t.every(r=>mne(r)))throw new vu.ValueError("Failed to parse specVersion");if(t[0]!=iU[0])throw new vu.ValueError("Unsupported specVersion");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&dne.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}isExpired(e){return e||(e=new Date),e>=new Date(this.expires)}static commonFieldsFromJSON(e){let{spec_version:t,expires:r,version:s,...n}=e;if(c0.guard.isDefined(t)){if(typeof t!="string")throw new TypeError("spec_version must be a string")}else throw new vu.ValueError("spec_version is not defined");if(c0.guard.isDefined(r)){if(typeof r!="string")throw new TypeError("expires must be a string")}else throw new vu.ValueError("expires is not defined");if(c0.guard.isDefined(s)){if(typeof s!="number")throw new TypeError("version must be a number")}else throw new vu.ValueError("version is not defined");return{specVersion:t,expires:r,version:s,unrecognizedFields:n}}};pr.Signed=l0;function mne(i){return!isNaN(Number(i))}o(mne,"isNumeric")});var Cu=d(rs=>{"use strict";var rU=rs&&rs.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(rs,"__esModule",{value:!0});rs.TargetFile=rs.MetaFile=void 0;var sU=rU(require("crypto")),Up=rU(require("util")),is=ki(),Fp=si(),h0=class i{static{o(this,"MetaFile")}version;length;hashes;unrecognizedFields;constructor(e){if(e.version<=0)throw new is.ValueError("Metafile version must be at least 1");e.length!==void 0&&nU(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.version===e.version&&this.length===e.length&&Up.default.isDeepStrictEqual(this.hashes,e.hashes)&&Up.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new is.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([t,r])=>{let s;try{s=sU.default.createHash(t)}catch{throw new is.LengthOrHashMismatchError(`Hash algorithm ${t} not supported`)}let n=s.update(e).digest("hex");if(n!==r)throw new is.LengthOrHashMismatchError(`Expected hash ${r} but got ${n}`)})}toJSON(){let e={version:this.version,...this.unrecognizedFields};return this.length!==void 0&&(e.length=this.length),this.hashes&&(e.hashes=this.hashes),e}static fromJSON(e){let{version:t,length:r,hashes:s,...n}=e;if(typeof t!="number")throw new TypeError("version must be a number");if(Fp.guard.isDefined(r)&&typeof r!="number")throw new TypeError("length must be a number");if(Fp.guard.isDefined(s)&&!Fp.guard.isStringRecord(s))throw new TypeError("hashes must be string keys and values");return new i({version:t,length:r,hashes:s,unrecognizedFields:n})}};rs.MetaFile=h0;var f0=class i{static{o(this,"TargetFile")}length;path;hashes;unrecognizedFields;constructor(e){nU(e.length),this.length=e.length,this.path=e.path,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}get custom(){let e=this.unrecognizedFields.custom;return!e||Array.isArray(e)||typeof e!="object"?{}:e}equals(e){return e instanceof i?this.length===e.length&&this.path===e.path&&Up.default.isDeepStrictEqual(this.hashes,e.hashes)&&Up.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let t=0,r=Object.keys(this.hashes).reduce((s,n)=>{try{s[n]=sU.default.createHash(n)}catch{throw new is.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return s},{});for await(let s of e)t+=s.length,Object.values(r).forEach(n=>{n.update(s)});if(t!==this.length)throw new is.LengthOrHashMismatchError(`Expected length ${this.length} but got ${t}`);Object.entries(r).forEach(([s,n])=>{let a=this.hashes[s],c=n.digest("hex");if(c!==a)throw new is.LengthOrHashMismatchError(`Expected hash ${a} but got ${c}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,t){let{length:r,hashes:s,...n}=t;if(typeof r!="number")throw new TypeError("length must be a number");if(!Fp.guard.isStringRecord(s))throw new TypeError("hashes must have string keys and values");return new i({length:r,path:e,hashes:s,unrecognizedFields:n})}};rs.TargetFile=f0;function nU(i){if(i<0)throw new is.ValueError("Length must be at least 0")}o(nU,"validateLength")});var oU=d(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.encodeOIDString=yne;var gne=6;function yne(i){let e=i.split("."),t=parseInt(e[0],10)*40+parseInt(e[1],10),r=[];e.slice(2).forEach(n=>{let a=Sne(parseInt(n,10));r.push(...a)});let s=Buffer.from([t,...r]);return Buffer.from([gne,s.length,...s])}o(yne,"encodeOIDString");function Sne(i){let e=[],t=0;for(;i>0;)e.unshift(i&127|t),i>>=7,t=128;return e}o(Sne,"encodeVariableLengthInteger")});var lU=d(Au=>{"use strict";var Ene=Au&&Au.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Au,"__esModule",{value:!0});Au.getPublicKey=Ine;var Qo=Ene(require("crypto")),Ru=ki(),p0=oU(),jp=48,aU=3,cU=0,wne="1.3.101.112",_ne="1.2.840.10045.2.1",bne="1.2.840.10045.3.1.7",m0="-----BEGIN PUBLIC KEY-----";function Ine(i){switch(i.keyType){case"rsa":return One(i);case"ed25519":return vne(i);case"ecdsa":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":return Cne(i);default:throw new Ru.UnsupportedAlgorithmError(`Unsupported key type: ${i.keyType}`)}}o(Ine,"getPublicKey");function One(i){if(!i.keyVal.startsWith(m0))throw new Ru.CryptoError("Invalid key format");let e=Qo.default.createPublicKey(i.keyVal);switch(i.scheme){case"rsassa-pss-sha256":return{key:e,padding:Qo.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Ru.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${i.scheme}`)}}o(One,"getRSAPublicKey");function vne(i){let e;if(i.keyVal.startsWith(m0))e=Qo.default.createPublicKey(i.keyVal);else{if(!uU(i.keyVal))throw new Ru.CryptoError("Invalid key format");e=Qo.default.createPublicKey({key:Rne.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(vne,"getED25519PublicKey");function Cne(i){let e;if(i.keyVal.startsWith(m0))e=Qo.default.createPublicKey(i.keyVal);else{if(!uU(i.keyVal))throw new Ru.CryptoError("Invalid key format");e=Qo.default.createPublicKey({key:Ane.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(Cne,"getECDCSAPublicKey");var Rne={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=(0,p0.encodeOIDString)(wne),r=Buffer.concat([Buffer.concat([Buffer.from([jp]),Buffer.from([t.length]),t]),Buffer.concat([Buffer.from([aU]),Buffer.from([e.length+1]),Buffer.from([cU]),e])]);return Buffer.concat([Buffer.from([jp]),Buffer.from([r.length]),r])},"hexToDER")},Ane={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=Buffer.concat([Buffer.from([aU]),Buffer.from([e.length+1]),Buffer.from([cU]),e]),r=Buffer.concat([(0,p0.encodeOIDString)(_ne),(0,p0.encodeOIDString)(bne)]),s=Buffer.concat([Buffer.from([jp]),Buffer.from([r.length]),r]);return Buffer.concat([Buffer.from([jp]),Buffer.from([s.length+t.length]),s,t])},"hexToDER")},uU=o(i=>/^[0-9a-fA-F]+$/.test(i),"isHex")});var $p=d(ea=>{"use strict";var Tne=ea&&ea.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ea,"__esModule",{value:!0});ea.Key=void 0;var hU=Tne(require("util")),Tu=ki(),fU=si(),Nne=lU(),g0=class i{static{o(this,"Key")}keyID;keyType;scheme;keyVal;unrecognizedFields;constructor(e){let{keyID:t,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a}=e;this.keyID=t,this.keyType=r,this.scheme=s,this.keyVal=n,this.unrecognizedFields=a||{}}verifySignature(e){let t=e.signatures[this.keyID];if(!t)throw new Tu.UnsignedMetadataError("no signature for key found in metadata");if(!this.keyVal.public)throw new Tu.UnsignedMetadataError("no public key found");let r=(0,Nne.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),s=e.signed.toJSON();try{if(!fU.crypto.verifySignature(s,r,t.sig))throw new Tu.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof Tu.UnsignedMetadataError?n:new Tu.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof i?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&hU.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&hU.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keytype:this.keyType,scheme:this.scheme,keyval:this.keyVal,...this.unrecognizedFields}}static fromJSON(e,t){let{keytype:r,scheme:s,keyval:n,...a}=t;if(typeof r!="string")throw new TypeError("keytype must be a string");if(typeof s!="string")throw new TypeError("scheme must be a string");if(!fU.guard.isStringRecord(n))throw new TypeError("keyval must be a string record");return new i({keyID:e,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a})}};ea.Key=g0});var yU=d((T0e,gU)=>{"use strict";gU.exports=pU;function pU(i,e,t){i instanceof RegExp&&(i=dU(i,t)),e instanceof RegExp&&(e=dU(e,t));var r=mU(i,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+e.length)}}o(pU,"balanced");function dU(i,e){var t=e.match(i);return t?t[0]:null}o(dU,"maybeMatch");pU.range=mU;function mU(i,e,t){var r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;)h==u?(r.push(h),u=t.indexOf(i,h+1)):r.length==1?c=[r.pop(),l]:(s=r.pop(),s<n&&(n=s,a=l),l=t.indexOf(e,h+1)),h=u<l&&u>=0?u:l;r.length&&(c=[n,a])}return c}o(mU,"range")});var vU=d((P0e,OU)=>{var SU=yU();OU.exports=xne;var EU="\0SLASH"+Math.random()+"\0",wU="\0OPEN"+Math.random()+"\0",S0="\0CLOSE"+Math.random()+"\0",_U="\0COMMA"+Math.random()+"\0",bU="\0PERIOD"+Math.random()+"\0";function y0(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}o(y0,"numeric");function Pne(i){return i.split("\\\\").join(EU).split("\\{").join(wU).split("\\}").join(S0).split("\\,").join(_U).split("\\.").join(bU)}o(Pne,"escapeBraces");function Dne(i){return i.split(EU).join("\\").split(wU).join("{").split(S0).join("}").split(_U).join(",").split(bU).join(".")}o(Dne,"unescapeBraces");function IU(i){if(!i)return[""];var e=[],t=SU("{","}",i);if(!t)return i.split(",");var r=t.pre,s=t.body,n=t.post,a=r.split(",");a[a.length-1]+="{"+s+"}";var c=IU(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(IU,"parseCommaParts");function xne(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),Nu(Pne(i),!0).map(Dne)):[]}o(xne,"expandTop");function Lne(i){return"{"+i+"}"}o(Lne,"embrace");function Mne(i){return/^-?0\d/.test(i)}o(Mne,"isPadded");function Bne(i,e){return i<=e}o(Bne,"lte");function kne(i,e){return i>=e}o(kne,"gte");function Nu(i,e){var t=[],r=SU("{","}",i);if(!r)return[i];var s=r.pre,n=r.post.length?Nu(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<n.length;a++){var c=s+"{"+r.body+"}"+n[a];t.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=u||l,f=r.body.indexOf(",")>=0;if(!h&&!f)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+S0+r.post,Nu(i)):[i];var p;if(h)p=r.body.split(/\.\./);else if(p=IU(r.body),p.length===1&&(p=Nu(p[0],!1).map(Lne),p.length===1))return n.map(function(ee){return r.pre+p[0]+ee});var m;if(h){var y=y0(p[0]),g=y0(p[1]),S=Math.max(p[0].length,p[1].length),E=p.length==3?Math.abs(y0(p[2])):1,_=Bne,b=g<y;b&&(E*=-1,_=kne);var w=p.some(Mne);m=[];for(var I=y;_(I,g);I+=E){var v;if(l)v=String.fromCharCode(I),v==="\\"&&(v="");else if(v=String(I),w){var N=S-v.length;if(N>0){var P=new Array(N+1).join("0");I<0?v="-"+P+v.slice(1):v=P+v}}m.push(v)}}else{m=[];for(var U=0;U<p.length;U++)m.push.apply(m,Nu(p[U],!1))}for(var U=0;U<m.length;U++)for(var a=0;a<n.length;a++){var c=s+m[U]+n[a];(!e||h||c)&&t.push(c)}}return t}o(Nu,"expand")});var CU=d(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.assertValidPattern=void 0;var Fne=1024*64,Une=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>Fne)throw new TypeError("pattern is too long")},"assertValidPattern");qp.assertValidPattern=Une});var AU=d(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.parseClass=void 0;var jne={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Pu=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$ne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),RU=o(i=>i.join(""),"rangesToString"),qne=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(jne))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(Pu(f)+"-"+Pu(g)):g===f&&r.push(Pu(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(Pu(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(Pu(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[$ne(g),!1,h-t,!1]}let p="["+(l?"^":"")+RU(r)+"]",m="["+(l?"":"^")+RU(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");Vp.parseClass=qne});var Hp=d(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.unescape=void 0;var Vne=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");zp.unescape=Vne});var _0=d(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.AST=void 0;var zne=AU(),Gp=Hp(),Hne=new Set(["!","?","+","*","@"]),TU=o(i=>Hne.has(i),"isExtglobType"),Gne="(?!(?:^|/)\\.\\.?(?:$|/))",Wp="(?!\\.)",Wne=new Set(["[","."]),Jne=new Set(["..","."]),Kne=new Set("().*{}+?[]^$\\!"),Zne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),w0="[^/]",NU=w0+"*?",PU=w0+"+?",E0=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&TU(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(TU(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Jne.has(this.#r[0]))){let y=Wne,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?Gne:S?Wp:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,Gp.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Gp.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Wp?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Wp:"")+PU;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Wp:"")+NU+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,Gp.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(Kne.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,zne.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=PU:n+=NU,t=!0;continue}if(u==="?"){n+=w0,t=!0;continue}n+=Zne(u)}return[n,(0,Gp.unescape)(e),!!t,a]}};Jp.AST=E0});var b0=d(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.escape=void 0;var Yne=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");Kp.escape=Yne});var FU=d(A=>{"use strict";var Xne=A&&A.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(A,"__esModule",{value:!0});A.unescape=A.escape=A.AST=A.Minimatch=A.match=A.makeRe=A.braceExpand=A.defaults=A.filter=A.GLOBSTAR=A.sep=A.minimatch=void 0;var Qne=Xne(vU()),Zp=CU(),LU=_0(),eoe=b0(),toe=Hp(),ioe=o((i,e,t={})=>((0,Zp.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new cn(e,t).match(i)),"minimatch");A.minimatch=ioe;var roe=/^\*+([^+@!?\*\[\(]*)$/,soe=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),noe=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),ooe=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),aoe=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),coe=/^\*+\.\*+$/,uoe=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),loe=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),hoe=/^\.\*+$/,foe=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),doe=/^\*+$/,poe=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),moe=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),goe=/^\?+([^+@!?\*\[\(]*)?$/,yoe=o(([i,e=""])=>{let t=MU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Soe=o(([i,e=""])=>{let t=BU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Eoe=o(([i,e=""])=>{let t=BU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),woe=o(([i,e=""])=>{let t=MU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),MU=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),BU=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),kU=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",DU={win32:{sep:"\\"},posix:{sep:"/"}};A.sep=kU==="win32"?DU.win32.sep:DU.posix.sep;A.minimatch.sep=A.sep;A.GLOBSTAR=Symbol("globstar **");A.minimatch.GLOBSTAR=A.GLOBSTAR;var _oe="[^/]",boe=_oe+"*?",Ioe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ooe="(?:(?!(?:\\/|^)\\.).)*?",voe=o((i,e={})=>t=>(0,A.minimatch)(t,i,e),"filter");A.filter=voe;A.minimatch.filter=A.filter;var qt=o((i,e={})=>Object.assign({},i,e),"ext"),Coe=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return A.minimatch;let e=A.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,qt(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,qt(i,n))}static defaults(s){return e.defaults(qt(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,qt(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,qt(i,n))}},unescape:o((r,s={})=>e.unescape(r,qt(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,qt(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,qt(i,s)),"filter"),defaults:o(r=>e.defaults(qt(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,qt(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,qt(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,qt(i,n)),"match"),sep:e.sep,GLOBSTAR:A.GLOBSTAR})},"defaults");A.defaults=Coe;A.minimatch.defaults=A.defaults;var Roe=o((i,e={})=>((0,Zp.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,Qne.default)(i)),"braceExpand");A.braceExpand=Roe;A.minimatch.braceExpand=A.braceExpand;var Aoe=o((i,e={})=>new cn(i,e).makeRe(),"makeRe");A.makeRe=Aoe;A.minimatch.makeRe=A.makeRe;var Toe=o((i,e,t={})=>{let r=new cn(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");A.match=Toe;A.minimatch.match=A.match;var xU=/[?*]|[+@!]\(.*?\)|\[|\]/,Noe=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),cn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,Zp.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||kU,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!xU.test(n[2]))&&!xU.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===A.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
|
|
58
|
+
`)}o(tie,"fromDER")});var ap=d(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SHA2_HASH_ALGOS=Mo.ECDSA_SIGNATURE_ALGOS=void 0;Mo.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};Mo.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var rb=d(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.RFC3161TimestampVerificationError=void 0;var ib=class extends Error{static{o(this,"RFC3161TimestampVerificationError")}};cp.RFC3161TimestampVerificationError=ib});var Ck=d(Ci=>{"use strict";var iie=Ci&&Ci.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),rie=Ci&&Ci.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),sie=Ci&&Ci.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&iie(t,e,r[s]);return rie(t,e),t}})();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.TSTInfo=void 0;var Tk=sie(Lo()),nie=ap(),oie=rb(),sb=class{static{o(this,"TSTInfo")}constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return nie.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let t=Tk.digest(this.messageImprintHashAlgorithm,e);if(!Tk.bufferEqual(t,this.messageImprintHashedMessage))throw new oie.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};Ci.TSTInfo=sb});var Pk=d(Ni=>{"use strict";var aie=Ni&&Ni.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),cie=Ni&&Ni.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),uie=Ni&&Ni.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&aie(t,e,r[s]);return cie(t,e),t}})();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.RFC3161Timestamp=void 0;var lie=sp(),nb=uie(Lo()),Nk=ap(),uu=rb(),hie=Ck(),fie="1.2.840.113549.1.7.2",die="1.2.840.113549.1.9.16.1.4",pie="1.2.840.113549.1.9.4",ob=class i{static{o(this,"RFC3161Timestamp")}constructor(e){this.root=e}static parse(e){let t=lie.ASN1Obj.parseBuffer(e);return new i(t)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return Nk.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return Nk.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new hie.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,t){if(!this.timeStampTokenObj)throw new uu.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==fie)throw new uu.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==die)throw new uu.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(e),this.verifyMessageDigest(),this.verifySignature(t)}verifyMessageDigest(){let e=nb.digest(this.signerDigestAlgorithm,this.tstInfo.raw),t=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!nb.bufferEqual(e,t))throw new uu.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(e){let t=this.signedAttrsObj.toDER();if(t[0]=49,!nb.verify(t,e,this.signatureValue,this.signatureAlgorithm))throw new uu.RFC3161TimestampVerificationError("signature verification failed")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(t=>t.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let e=this.signedDataObj;return e.subs[e.subs.length-1]}get signerInfoObj(){return this.signerInfosObj.subs[0]}get eContentTypeObj(){return this.encapContentInfoObj.subs[0]}get eContentObj(){return this.encapContentInfoObj.subs[1]}get signedAttrsObj(){return this.signerInfoObj.subs.find(t=>t.tag.isContextSpecific(0))}get messageDigestAttributeObj(){return this.signedAttrsObj.subs.find(t=>t.subs[0].tag.isOID()&&t.subs[0].toOID()===pie)}get signerSidObj(){return this.signerInfoObj.subs[1]}get signerDigestAlgorithmObj(){return this.signerInfoObj.subs[2]}get signatureAlgorithmObj(){return this.signerInfoObj.subs[4]}get signatureValueObj(){return this.signerInfoObj.subs[5]}};Ni.RFC3161Timestamp=ob});var Dk=d(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.RFC3161Timestamp=void 0;var mie=Pk();Object.defineProperty(up,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return mie.RFC3161Timestamp},"get")})});var Lk=d(Pi=>{"use strict";var gie=Pi&&Pi.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),yie=Pi&&Pi.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Sie=Pi&&Pi.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&gie(t,e,r[s]);return yie(t,e),t}})();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.SignedCertificateTimestamp=void 0;var Eie=Sie(Lo()),xk=au(),ab=class i{static{o(this,"SignedCertificateTimestamp")}constructor(e){this.version=e.version,this.logID=e.logID,this.timestamp=e.timestamp,this.extensions=e.extensions,this.hashAlgorithm=e.hashAlgorithm,this.signatureAlgorithm=e.signatureAlgorithm,this.signature=e.signature}get datetime(){return new Date(Number(this.timestamp.readBigInt64BE()))}get algorithm(){switch(this.hashAlgorithm){case 0:return"none";case 1:return"md5";case 2:return"sha1";case 3:return"sha224";case 4:return"sha256";case 5:return"sha384";case 6:return"sha512";default:return"unknown"}}verify(e,t){let r=new xk.ByteStream;return r.appendChar(this.version),r.appendChar(0),r.appendView(this.timestamp),r.appendUint16(1),r.appendView(e),r.appendUint16(this.extensions.byteLength),this.extensions.byteLength>0&&r.appendView(this.extensions),Eie.verify(r.buffer,t,this.signature,this.algorithm)}static parse(e){let t=new xk.ByteStream(e),r=t.getUint8(),s=t.getBlock(32),n=t.getBlock(8),a=t.getUint16(),c=t.getBlock(a),u=t.getUint8(),l=t.getUint8(),h=t.getUint16(),f=t.getBlock(h);if(t.position!==e.length)throw new Error("SCT buffer length mismatch");return new i({version:r,logID:s,timestamp:n,extensions:c,hashAlgorithm:u,signatureAlgorithm:l,signature:f})}};Pi.SignedCertificateTimestamp=ab});var pb=d($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.X509SCTExtension=$e.X509SubjectKeyIDExtension=$e.X509AuthorityKeyIDExtension=$e.X509SubjectAlternativeNameExtension=$e.X509KeyUsageExtension=$e.X509BasicConstraintsExtension=$e.X509Extension=void 0;var wie=au(),_ie=Lk(),ur=class{static{o(this,"X509Extension")}constructor(e){this.root=e}get oid(){return this.root.subs[0].toOID()}get critical(){return this.root.subs.length===3?this.root.subs[1].toBoolean():!1}get value(){return this.extnValueObj.value}get valueObj(){return this.extnValueObj}get extnValueObj(){return this.root.subs[this.root.subs.length-1]}};$e.X509Extension=ur;var cb=class extends ur{static{o(this,"X509BasicConstraintsExtension")}get isCA(){return this.sequence.subs[0]?.toBoolean()??!1}get pathLenConstraint(){return this.sequence.subs.length>1?this.sequence.subs[1].toInteger():void 0}get sequence(){return this.extnValueObj.subs[0]}};$e.X509BasicConstraintsExtension=cb;var ub=class extends ur{static{o(this,"X509KeyUsageExtension")}get digitalSignature(){return this.bitString[0]===1}get keyCertSign(){return this.bitString[5]===1}get crlSign(){return this.bitString[6]===1}get bitString(){return this.extnValueObj.subs[0].toBitString()}};$e.X509KeyUsageExtension=ub;var lb=class extends ur{static{o(this,"X509SubjectAlternativeNameExtension")}get rfc822Name(){return this.findGeneralName(1)?.value.toString("ascii")}get uri(){return this.findGeneralName(6)?.value.toString("ascii")}otherName(e){let t=this.findGeneralName(0);return t===void 0||t.subs[0].toOID()!==e?void 0:t.subs[1].subs[0].value.toString("ascii")}findGeneralName(e){return this.generalNames.find(t=>t.tag.isContextSpecific(e))}get generalNames(){return this.extnValueObj.subs[0].subs}};$e.X509SubjectAlternativeNameExtension=lb;var hb=class extends ur{static{o(this,"X509AuthorityKeyIDExtension")}get keyIdentifier(){return this.findSequenceMember(0)?.value}findSequenceMember(e){return this.sequence.subs.find(t=>t.tag.isContextSpecific(e))}get sequence(){return this.extnValueObj.subs[0]}};$e.X509AuthorityKeyIDExtension=hb;var fb=class extends ur{static{o(this,"X509SubjectKeyIDExtension")}get keyIdentifier(){return this.extnValueObj.subs[0].value}};$e.X509SubjectKeyIDExtension=fb;var db=class extends ur{static{o(this,"X509SCTExtension")}constructor(e){super(e)}get signedCertificateTimestamps(){let e=this.extnValueObj.subs[0].value,t=new wie.ByteStream(e),r=t.getUint16()+2,s=[];for(;t.position<r;){let n=t.getUint16(),a=t.getBlock(n);s.push(_ie.SignedCertificateTimestamp.parse(a))}if(t.position!==r)throw new Error("SCT list length does not match actual length");return s}};$e.X509SCTExtension=db});var kk=d(yt=>{"use strict";var bie=yt&&yt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Iie=yt&&yt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Bk=yt&&yt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&bie(t,e,r[s]);return Iie(t,e),t}})();Object.defineProperty(yt,"__esModule",{value:!0});yt.X509Certificate=yt.EXTENSION_OID_SCT=void 0;var Oie=sp(),Mk=Bk(Lo()),vie=ap(),Rie=Bk(tb()),Ys=pb(),Aie="2.5.29.14",Tie="2.5.29.15",Cie="2.5.29.17",Nie="2.5.29.19",Pie="2.5.29.35";yt.EXTENSION_OID_SCT="1.3.6.1.4.1.11129.2.4.2";var mb=class i{static{o(this,"X509Certificate")}constructor(e){this.root=e}static parse(e){let t=typeof e=="string"?Rie.toDER(e):e,r=Oie.ASN1Obj.parseBuffer(t);return new i(r)}get tbsCertificate(){return this.tbsCertificateObj}get version(){return`v${(this.versionObj.subs[0].toInteger()+BigInt(1)).toString()}`}get serialNumber(){return this.serialNumberObj.value}get notBefore(){return this.validityObj.subs[0].toDate()}get notAfter(){return this.validityObj.subs[1].toDate()}get issuer(){return this.issuerObj.value}get subject(){return this.subjectObj.value}get publicKey(){return this.subjectPublicKeyInfoObj.toDER()}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return vie.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value.subarray(1)}get subjectAltName(){let e=this.extSubjectAltName;return e?.uri||e?.rfc822Name}get extensions(){return this.extensionsObj?.subs[0]?.subs||[]}get extKeyUsage(){let e=this.findExtension(Tie);return e?new Ys.X509KeyUsageExtension(e):void 0}get extBasicConstraints(){let e=this.findExtension(Nie);return e?new Ys.X509BasicConstraintsExtension(e):void 0}get extSubjectAltName(){let e=this.findExtension(Cie);return e?new Ys.X509SubjectAlternativeNameExtension(e):void 0}get extAuthorityKeyID(){let e=this.findExtension(Pie);return e?new Ys.X509AuthorityKeyIDExtension(e):void 0}get extSubjectKeyID(){let e=this.findExtension(Aie);return e?new Ys.X509SubjectKeyIDExtension(e):void 0}get extSCT(){let e=this.findExtension(yt.EXTENSION_OID_SCT);return e?new Ys.X509SCTExtension(e):void 0}get isCA(){let e=this.extBasicConstraints?.isCA||!1;return this.extKeyUsage?e&&this.extKeyUsage.keyCertSign:e}extension(e){let t=this.findExtension(e);return t?new Ys.X509Extension(t):void 0}verify(e){let t=e?.publicKey||this.publicKey,r=Mk.createPublicKey(t);return Mk.verify(this.tbsCertificate.toDER(),r,this.signatureValue,this.signatureAlgorithm)}validForDate(e){return this.notBefore<=e&&e<=this.notAfter}equals(e){return this.root.toDER().equals(e.root.toDER())}clone(){let e=this.root.toDER(),t=Buffer.alloc(e.length);return e.copy(t),i.parse(t)}findExtension(e){return this.extensions.find(t=>t.subs[0].toOID()===e)}get tbsCertificateObj(){return this.root.subs[0]}get signatureAlgorithmObj(){return this.root.subs[1]}get signatureValueObj(){return this.root.subs[2]}get versionObj(){return this.tbsCertificateObj.subs[0]}get serialNumberObj(){return this.tbsCertificateObj.subs[1]}get issuerObj(){return this.tbsCertificateObj.subs[3]}get validityObj(){return this.tbsCertificateObj.subs[4]}get subjectObj(){return this.tbsCertificateObj.subs[5]}get subjectPublicKeyInfoObj(){return this.tbsCertificateObj.subs[6]}get extensionsObj(){return this.tbsCertificateObj.subs.find(e=>e.tag.isContextSpecific(3))}};yt.X509Certificate=mb});var Uk=d(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.X509SCTExtension=Gr.X509Certificate=Gr.EXTENSION_OID_SCT=void 0;var Fk=kk();Object.defineProperty(Gr,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return Fk.EXTENSION_OID_SCT},"get")});Object.defineProperty(Gr,"X509Certificate",{enumerable:!0,get:o(function(){return Fk.X509Certificate},"get")});var Die=pb();Object.defineProperty(Gr,"X509SCTExtension",{enumerable:!0,get:o(function(){return Die.X509SCTExtension},"get")})});var ot=d(K=>{"use strict";var xie=K&&K.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Lie=K&&K.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),lu=K&&K.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&xie(t,e,r[s]);return Lie(t,e),t}})();Object.defineProperty(K,"__esModule",{value:!0});K.X509SCTExtension=K.X509Certificate=K.EXTENSION_OID_SCT=K.ByteStream=K.RFC3161Timestamp=K.pem=K.json=K.encoding=K.dsse=K.crypto=K.ASN1Obj=void 0;var Mie=sp();Object.defineProperty(K,"ASN1Obj",{enumerable:!0,get:o(function(){return Mie.ASN1Obj},"get")});K.crypto=lu(Lo());K.dsse=lu(Ik());K.encoding=lu(Rk());K.json=lu(Ak());K.pem=lu(tb());var Bie=Dk();Object.defineProperty(K,"RFC3161Timestamp",{enumerable:!0,get:o(function(){return Bie.RFC3161Timestamp},"get")});var kie=au();Object.defineProperty(K,"ByteStream",{enumerable:!0,get:o(function(){return kie.ByteStream},"get")});var gb=Uk();Object.defineProperty(K,"EXTENSION_OID_SCT",{enumerable:!0,get:o(function(){return gb.EXTENSION_OID_SCT},"get")});Object.defineProperty(K,"X509Certificate",{enumerable:!0,get:o(function(){return gb.X509Certificate},"get")});Object.defineProperty(K,"X509SCTExtension",{enumerable:!0,get:o(function(){return gb.X509SCTExtension},"get")})});var jk=d(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.extractJWTSubject=Uie;var Fie=ot();function Uie(i){let e=i.split(".",3),t=JSON.parse(Fie.encoding.base64Decode(e[1]));if(t.email){if(!t.email_verified)throw new Error("JWT email not verified by issuer");return t.email}if(t.sub)return t.sub;throw new Error("JWT subject not found")}o(Uie,"extractJWTSubject")});var $k=d((c_e,jie)=>{jie.exports={name:"@sigstore/sign",version:"4.0.1",description:"Sigstore signing library",main:"dist/index.js",types:"dist/index.d.ts",scripts:{clean:"shx rm -rf dist *.tsbuildinfo",build:"tsc --build",test:"jest"},files:["dist"],author:"bdehamer@github.com",license:"Apache-2.0",repository:{type:"git",url:"git+https://github.com/sigstore/sigstore-js.git"},bugs:{url:"https://github.com/sigstore/sigstore-js/issues"},homepage:"https://github.com/sigstore/sigstore-js/tree/main/packages/sign#readme",publishConfig:{provenance:!0},devDependencies:{"@sigstore/jest":"^0.0.0","@sigstore/mock":"^0.11.0","@sigstore/rekor-types":"^4.0.0","@types/make-fetch-happen":"^10.0.4","@types/promise-retry":"^1.1.6"},dependencies:{"@sigstore/bundle":"^4.0.0","@sigstore/core":"^3.0.0","@sigstore/protobuf-specs":"^0.5.0","make-fetch-happen":"^15.0.2","proc-log":"^5.0.0","promise-retry":"^2.0.1"},engines:{node:"^20.17.0 || >=22.9.0"}}});var Vk=d(Bo=>{"use strict";var $ie=Bo&&Bo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.getUserAgent=void 0;var qk=$ie(require("os")),qie=o(()=>{let i=$k().version,e=process.version,t=qk.default.platform(),r=qk.default.arch();return`sigstore-js/${i} (Node ${e}) (${t}/${r})`},"getUserAgent");Bo.getUserAgent=qie});var Wr=d(fe=>{"use strict";var Vie=fe&&fe.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),zie=fe&&fe.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),zk=fe&&fe.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Vie(t,e,r[s]);return zie(t,e),t}})();Object.defineProperty(fe,"__esModule",{value:!0});fe.ua=fe.oidc=fe.pem=fe.json=fe.encoding=fe.dsse=fe.crypto=void 0;var hu=ot();Object.defineProperty(fe,"crypto",{enumerable:!0,get:o(function(){return hu.crypto},"get")});Object.defineProperty(fe,"dsse",{enumerable:!0,get:o(function(){return hu.dsse},"get")});Object.defineProperty(fe,"encoding",{enumerable:!0,get:o(function(){return hu.encoding},"get")});Object.defineProperty(fe,"json",{enumerable:!0,get:o(function(){return hu.json},"get")});Object.defineProperty(fe,"pem",{enumerable:!0,get:o(function(){return hu.pem},"get")});fe.oidc=zk(jk());fe.ua=zk(Vk())});var Eb=d(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.BaseBundleBuilder=void 0;var Sb=class{static{o(this,"BaseBundleBuilder")}constructor(e){this.signer=e.signer,this.witnesses=e.witnesses}async create(e){let t=await this.prepare(e).then(c=>this.signer.sign(c)),r=await this.package(e,t),s=await Promise.all(this.witnesses.map(c=>c.testify(r.content,Hie(t.key)))),n=[],a=[];return s.forEach(({tlogEntries:c,rfc3161Timestamps:u})=>{n.push(...c??[]),a.push(...u??[])}),r.verificationMaterial.tlogEntries=n,r.verificationMaterial.timestampVerificationData={rfc3161Timestamps:a},r}async prepare(e){return e.data}};lp.BaseBundleBuilder=Sb;function Hie(i){switch(i.$case){case"publicKey":return i.publicKey;case"x509Certificate":return i.certificate}}o(Hie,"publicKey")});var _b=d(Di=>{"use strict";var Gie=Di&&Di.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Wie=Di&&Di.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),Jie=Di&&Di.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Gie(t,e,r[s]);return Wie(t,e),t}})();Object.defineProperty(Di,"__esModule",{value:!0});Di.toMessageSignatureBundle=Kie;Di.toDSSEBundle=Zie;var Hk=Jie(ou()),wb=Wr();function Kie(i,e){let t=wb.crypto.digest("sha256",i.data);return Hk.toMessageSignatureBundle({digest:t,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:!0})}o(Kie,"toMessageSignatureBundle");function Zie(i,e,t){return Hk.toDSSEBundle({artifact:i.data,artifactType:i.type,signature:e.signature,certificate:e.key.$case==="x509Certificate"?wb.pem.toDER(e.key.certificate):void 0,keyHint:e.key.$case==="publicKey"?e.key.hint:void 0,certificateChain:t})}o(Zie,"toDSSEBundle")});var Wk=d(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.DSSEBundleBuilder=void 0;var Yie=Wr(),Xie=Eb(),Qie=_b(),bb=class extends Xie.BaseBundleBuilder{static{o(this,"DSSEBundleBuilder")}constructor(e){super(e),this.certificateChain=e.certificateChain??!1}async prepare(e){let t=Gk(e);return Yie.dsse.preAuthEncoding(t.type,t.data)}async package(e,t){return(0,Qie.toDSSEBundle)(Gk(e),t,this.certificateChain)}};hp.DSSEBundleBuilder=bb;function Gk(i){return{...i,type:i.type??""}}o(Gk,"artifactDefaults")});var Jk=d(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.MessageSignatureBundleBuilder=void 0;var ere=Eb(),tre=_b(),Ib=class extends ere.BaseBundleBuilder{static{o(this,"MessageSignatureBundleBuilder")}constructor(e){super(e)}async package(e,t){return(0,tre.toMessageSignatureBundle)(e,t)}};fp.MessageSignatureBundleBuilder=Ib});var Kk=d(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.MessageSignatureBundleBuilder=ko.DSSEBundleBuilder=void 0;var ire=Wk();Object.defineProperty(ko,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return ire.DSSEBundleBuilder},"get")});var rre=Jk();Object.defineProperty(ko,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return rre.MessageSignatureBundleBuilder},"get")})});var pp=d(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.HTTPError=void 0;var Ob=class extends Error{static{o(this,"HTTPError")}constructor({status:e,message:t,location:r}){super(`(${e}) ${t}`),this.statusCode=e,this.location=r}};dp.HTTPError=Ob});var Fo=d(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.InternalError=void 0;fu.internalError=nre;var sre=pp(),mp=class extends Error{static{o(this,"InternalError")}constructor({code:e,message:t,cause:r}){super(t),this.name=this.constructor.name,this.cause=r,this.code=e}};fu.InternalError=mp;function nre(i,e,t){throw i instanceof sre.HTTPError&&(t+=` - ${i.message}`),new mp({code:e,message:t,cause:i})}o(nre,"internalError")});var Zk=d(Uo=>{"use strict";var ore=Uo&&Uo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.CIContextProvider=void 0;var are=ore(iu()),cre=[ure,lre],vb=class{static{o(this,"CIContextProvider")}constructor(e="sigstore"){this.audience=e}async getToken(){return Promise.any(cre.map(e=>e(this.audience))).catch(()=>Promise.reject("CI: no tokens available"))}};Uo.CIContextProvider=vb;async function ure(i){if(!process.env.ACTIONS_ID_TOKEN_REQUEST_URL||!process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN)return Promise.reject("no token available");let e=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);return e.searchParams.append("audience",i),(await(0,are.default)(e.href,{retry:2,headers:{Accept:"application/json",Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).json().then(r=>r.value)}o(ure,"getGHAToken");async function lre(){return process.env.SIGSTORE_ID_TOKEN?process.env.SIGSTORE_ID_TOKEN:Promise.reject("no token available")}o(lre,"getEnv")});var Yk=d(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.CIContextProvider=void 0;var hre=Zk();Object.defineProperty(gp,"CIContextProvider",{enumerable:!0,get:o(function(){return hre.CIContextProvider},"get")})});var yp=d(du=>{"use strict";var Qk=du&&du.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(du,"__esModule",{value:!0});du.fetchWithRetry=Ire;var fre=require("http2"),dre=Qk(iu()),Xk=St(),pre=Qk(xa()),mre=Wr(),gre=pp(),{HTTP2_HEADER_LOCATION:yre,HTTP2_HEADER_CONTENT_TYPE:Sre,HTTP2_HEADER_USER_AGENT:Ere,HTTP_STATUS_INTERNAL_SERVER_ERROR:wre,HTTP_STATUS_TOO_MANY_REQUESTS:_re,HTTP_STATUS_REQUEST_TIMEOUT:bre}=fre.constants;async function Ire(i,e){return(0,pre.default)(async(t,r)=>{let s=e.method||"POST",n={[Ere]:mre.ua.getUserAgent(),...e.headers},a=await(0,dre.default)(i,{method:s,headers:n,body:e.body,timeout:e.timeout,retry:!1}).catch(c=>(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${c}`),t(c)));if(a.ok)return a;{let c=await Ore(a);if(Xk.log.http("fetch",`${s} ${i} attempt ${r} failed with ${a.status}`),vre(a.status))return t(c);throw c}},Rre(e.retry))}o(Ire,"fetchWithRetry");var Ore=o(async i=>{let e=i.statusText,t=i.headers.get(yre)||void 0;if(i.headers.get(Sre)?.includes("application/json"))try{e=(await i.json()).message||e}catch{}return new gre.HTTPError({status:i.status,message:e,location:t})},"errorFromResponse"),vre=o(i=>[bre,_re].includes(i)||i>=wre,"retryable"),Rre=o(i=>typeof i=="boolean"?{retries:i?1:0}:typeof i=="number"?{retries:i}:{retries:0,...i},"retryOpts")});var eF=d(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Fulcio=void 0;var Are=yp(),Rb=class{static{o(this,"Fulcio")}constructor(e){this.options=e}async createSigningCertificate(e){let{baseURL:t,retry:r,timeout:s}=this.options,n=`${t}/api/v2/signingCert`;return(await(0,Are.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:s,retry:r})).json()}};Sp.Fulcio=Rb});var tF=d(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.CAClient=void 0;var Tre=Fo(),Cre=eF(),Ab=class{static{o(this,"CAClient")}constructor(e){this.fulcio=new Cre.Fulcio({baseURL:e.fulcioBaseURL,retry:e.retry,timeout:e.timeout})}async createSigningCertificate(e,t,r){let s=Nre(e,t,r);try{let n=await this.fulcio.createSigningCertificate(s);return(n.signedCertificateEmbeddedSct?n.signedCertificateEmbeddedSct:n.signedCertificateDetachedSct).chain.certificates}catch(n){(0,Tre.internalError)(n,"CA_CREATE_SIGNING_CERTIFICATE_ERROR","error creating signing certificate")}}};Ep.CAClient=Ab;function Nre(i,e,t){return{credentials:{oidcIdentityToken:i},publicKeyRequest:{publicKey:{algorithm:"ECDSA",content:e},proofOfPossession:t.toString("base64")}}}o(Nre,"toCertificateRequest")});var rF=d(jo=>{"use strict";var Pre=jo&&jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jo,"__esModule",{value:!0});jo.EphemeralSigner=void 0;var iF=Pre(require("crypto")),Dre="ec",xre="P-256",Tb=class{static{o(this,"EphemeralSigner")}constructor(){this.keypair=iF.default.generateKeyPairSync(Dre,{namedCurve:xre})}async sign(e){let t=iF.default.sign(null,e,this.keypair.privateKey),r=this.keypair.publicKey.export({format:"pem",type:"spki"}).toString("ascii");return{signature:t,key:{$case:"publicKey",publicKey:r}}}};jo.EphemeralSigner=Tb});var sF=d(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.FulcioSigner=Xs.DEFAULT_FULCIO_URL=void 0;var Cb=Fo(),Lre=Wr(),Mre=tF(),Bre=rF();Xs.DEFAULT_FULCIO_URL="https://fulcio.sigstore.dev";var Nb=class{static{o(this,"FulcioSigner")}constructor(e){this.ca=new Mre.CAClient({...e,fulcioBaseURL:e.fulcioBaseURL||Xs.DEFAULT_FULCIO_URL}),this.identityProvider=e.identityProvider,this.keyHolder=e.keyHolder||new Bre.EphemeralSigner}async sign(e){let t=await this.getIdentityToken(),r;try{r=Lre.oidc.extractJWTSubject(t)}catch(c){throw new Cb.InternalError({code:"IDENTITY_TOKEN_PARSE_ERROR",message:`invalid identity token: ${t}`,cause:c})}let s=await this.keyHolder.sign(Buffer.from(r));if(s.key.$case!=="publicKey")throw new Cb.InternalError({code:"CA_CREATE_SIGNING_CERTIFICATE_ERROR",message:"unexpected format for signing key"});let n=await this.ca.createSigningCertificate(t,s.key.publicKey,s.signature);return{signature:(await this.keyHolder.sign(e)).signature,key:{$case:"x509Certificate",certificate:n[0]}}}async getIdentityToken(){try{return await this.identityProvider.getToken()}catch(e){throw new Cb.InternalError({code:"IDENTITY_TOKEN_READ_ERROR",message:"error retrieving identity token",cause:e})}}};Xs.FulcioSigner=Nb});var oF=d($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.FulcioSigner=$o.DEFAULT_FULCIO_URL=void 0;var nF=sF();Object.defineProperty($o,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return nF.DEFAULT_FULCIO_URL},"get")});Object.defineProperty($o,"FulcioSigner",{enumerable:!0,get:o(function(){return nF.FulcioSigner},"get")})});var uF=d(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.Rekor=void 0;var aF=yp(),Pb=class{static{o(this,"Rekor")}constructor(e){this.options=e}async createEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries`,c=await(await(0,aF.fetchWithRetry)(n,{headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).json();return cF(c)}async getEntry(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/log/entries/${e}`,c=await(await(0,aF.fetchWithRetry)(n,{method:"GET",headers:{Accept:"application/json"},timeout:r,retry:s})).json();return cF(c)}};wp.Rekor=Pb;function cF(i){let e=Object.entries(i);if(e.length!=1)throw new Error("Received multiple entries in Rekor response");let[t,r]=e[0];return{...r,uuid:t}}o(cF,"entryFromResponse")});var hF=d(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.TLogClient=void 0;var lF=Fo(),kre=pp(),Fre=uF(),Db=class{static{o(this,"TLogClient")}constructor(e){this.fetchOnConflict=e.fetchOnConflict??!1,this.rekor=new Fre.Rekor({baseURL:e.rekorBaseURL,retry:e.retry,timeout:e.timeout})}async createEntry(e){let t;try{t=await this.rekor.createEntry(e)}catch(r){if(Ure(r)&&this.fetchOnConflict){let s=r.location.split("/").pop()||"";try{t=await this.rekor.getEntry(s)}catch(n){(0,lF.internalError)(n,"TLOG_FETCH_ENTRY_ERROR","error fetching tlog entry")}}else(0,lF.internalError)(r,"TLOG_CREATE_ENTRY_ERROR","error creating tlog entry")}return t}};_p.TLogClient=Db;function Ure(i){return i instanceof kre.HTTPError&&i.statusCode===409&&i.location!==void 0}o(Ure,"entryExistsError")});var fF=d(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});xb.toProposedEntry=$re;var jre=ou(),Jr=Wr(),pu="sha256";function $re(i,e,t="dsse"){switch(i.$case){case"dsseEnvelope":return t==="intoto"?zre(i.dsseEnvelope,e):Vre(i.dsseEnvelope,e);case"messageSignature":return qre(i.messageSignature,e)}}o($re,"toProposedEntry");function qre(i,e){let t=i.messageDigest.digest.toString("hex"),r=i.signature.toString("base64"),s=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"hashedrekord",spec:{data:{hash:{algorithm:pu,value:t}},signature:{content:r,publicKey:{content:s}}}}}o(qre,"toProposedHashedRekordEntry");function Vre(i,e){let t=JSON.stringify((0,jre.envelopeToJSON)(i)),r=Jr.encoding.base64Encode(e);return{apiVersion:"0.0.1",kind:"dsse",spec:{proposedContent:{envelope:t,verifiers:[r]}}}}o(Vre,"toProposedDSSEEntry");function zre(i,e){let t=Jr.crypto.digest(pu,i.payload).toString("hex"),r=Hre(i,e),s=Jr.encoding.base64Encode(i.payload.toString("base64")),n=Jr.encoding.base64Encode(i.signatures[0].sig.toString("base64")),a=i.signatures[0].keyid,c=Jr.encoding.base64Encode(e),u={payloadType:i.payloadType,payload:s,signatures:[{sig:n,publicKey:c}]};return a.length>0&&(u.signatures[0].keyid=a),{apiVersion:"0.0.2",kind:"intoto",spec:{content:{envelope:u,hash:{algorithm:pu,value:r},payloadHash:{algorithm:pu,value:t}}}}}o(zre,"toProposedIntotoEntry");function Hre(i,e){let t={payloadType:i.payloadType,payload:i.payload.toString("base64"),signatures:[{sig:i.signatures[0].sig.toString("base64"),publicKey:e}]};return i.signatures[0].keyid.length>0&&(t.signatures[0].keyid=i.signatures[0].keyid),Jr.crypto.digest(pu,Jr.json.canonicalize(t)).toString("hex")}o(Hre,"calculateDSSEHash")});var dF=d(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.RekorWitness=Qs.DEFAULT_REKOR_URL=void 0;var Gre=Wr(),Wre=hF(),Jre=fF();Qs.DEFAULT_REKOR_URL="https://rekor.sigstore.dev";var Lb=class{static{o(this,"RekorWitness")}constructor(e){this.entryType=e.entryType,this.tlog=new Wre.TLogClient({...e,rekorBaseURL:e.rekorBaseURL||Qs.DEFAULT_REKOR_URL})}async testify(e,t){let r=(0,Jre.toProposedEntry)(e,t,this.entryType),s=await this.tlog.createEntry(r);return Kre(s)}};Qs.RekorWitness=Lb;function Kre(i){let e=Buffer.from(i.logID,"hex"),t=Gre.encoding.base64Decode(i.body),r=JSON.parse(t),s=i?.verification?.signedEntryTimestamp?Zre(i.verification.signedEntryTimestamp):void 0,n=i?.verification?.inclusionProof?Yre(i.verification.inclusionProof):void 0;return{tlogEntries:[{logIndex:i.logIndex.toString(),logId:{keyId:e},integratedTime:i.integratedTime.toString(),kindVersion:{kind:r.kind,version:r.apiVersion},inclusionPromise:s,inclusionProof:n,canonicalizedBody:Buffer.from(i.body,"base64")}]}}o(Kre,"toTransparencyLogEntry");function Zre(i){return{signedEntryTimestamp:Buffer.from(i,"base64")}}o(Zre,"inclusionPromise");function Yre(i){return{logIndex:i.logIndex.toString(),treeSize:i.treeSize.toString(),rootHash:Buffer.from(i.rootHash,"hex"),hashes:i.hashes.map(e=>Buffer.from(e,"hex")),checkpoint:{envelope:i.checkpoint}}}o(Yre,"inclusionProof")});var pF=d(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.TimestampAuthority=void 0;var Xre=yp(),Mb=class{static{o(this,"TimestampAuthority")}constructor(e){this.options=e}async createTimestamp(e){let{baseURL:t,timeout:r,retry:s}=this.options,n=`${t}/api/v1/timestamp`;return(await(0,Xre.fetchWithRetry)(n,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),timeout:r,retry:s})).buffer()}};bp.TimestampAuthority=Mb});var gF=d(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.TSAClient=void 0;var Qre=Fo(),ese=pF(),tse=Wr(),mF="sha256",Bb=class{static{o(this,"TSAClient")}constructor(e){this.tsa=new ese.TimestampAuthority({baseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async createTimestamp(e){let t={artifactHash:tse.crypto.digest(mF,e).toString("base64"),hashAlgorithm:mF};try{return await this.tsa.createTimestamp(t)}catch(r){(0,Qre.internalError)(r,"TSA_CREATE_TIMESTAMP_ERROR","error creating timestamp")}}};Ip.TSAClient=Bb});var yF=d(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.TSAWitness=void 0;var ise=gF(),kb=class{static{o(this,"TSAWitness")}constructor(e){this.tsa=new ise.TSAClient({tsaBaseURL:e.tsaBaseURL,retry:e.retry,timeout:e.timeout})}async testify(e){let t=rse(e);return{rfc3161Timestamps:[{signedTimestamp:await this.tsa.createTimestamp(t)}]}}};Op.TSAWitness=kb;function rse(i){switch(i.$case){case"dsseEnvelope":return i.dsseEnvelope.signatures[0].sig;case"messageSignature":return i.messageSignature.signature}}o(rse,"extractSignature")});var EF=d(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.TSAWitness=Kr.RekorWitness=Kr.DEFAULT_REKOR_URL=void 0;var SF=dF();Object.defineProperty(Kr,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return SF.DEFAULT_REKOR_URL},"get")});Object.defineProperty(Kr,"RekorWitness",{enumerable:!0,get:o(function(){return SF.RekorWitness},"get")});var sse=yF();Object.defineProperty(Kr,"TSAWitness",{enumerable:!0,get:o(function(){return sse.TSAWitness},"get")})});var Ub=d(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.TSAWitness=be.RekorWitness=be.DEFAULT_REKOR_URL=be.FulcioSigner=be.DEFAULT_FULCIO_URL=be.CIContextProvider=be.InternalError=be.MessageSignatureBundleBuilder=be.DSSEBundleBuilder=void 0;var wF=Kk();Object.defineProperty(be,"DSSEBundleBuilder",{enumerable:!0,get:o(function(){return wF.DSSEBundleBuilder},"get")});Object.defineProperty(be,"MessageSignatureBundleBuilder",{enumerable:!0,get:o(function(){return wF.MessageSignatureBundleBuilder},"get")});var nse=Fo();Object.defineProperty(be,"InternalError",{enumerable:!0,get:o(function(){return nse.InternalError},"get")});var ose=Yk();Object.defineProperty(be,"CIContextProvider",{enumerable:!0,get:o(function(){return ose.CIContextProvider},"get")});var _F=oF();Object.defineProperty(be,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return _F.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(be,"FulcioSigner",{enumerable:!0,get:o(function(){return _F.FulcioSigner},"get")});var Fb=EF();Object.defineProperty(be,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return Fb.DEFAULT_REKOR_URL},"get")});Object.defineProperty(be,"RekorWitness",{enumerable:!0,get:o(function(){return Fb.RekorWitness},"get")});Object.defineProperty(be,"TSAWitness",{enumerable:!0,get:o(function(){return Fb.TSAWitness},"get")})});var IF=d(mu=>{"use strict";var bF=mu&&mu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(mu,"__esModule",{value:!0});mu.appDataPath=cse;var ase=bF(require("os")),qo=bF(require("path"));function cse(i){let e=ase.default.homedir();switch(process.platform){case"darwin":{let t=qo.default.join(e,"Library","Application Support");return qo.default.join(t,i)}case"win32":{let t=process.env.LOCALAPPDATA||qo.default.join(e,"AppData","Local");return qo.default.join(t,i,"Data")}default:{let t=process.env.XDG_DATA_HOME||qo.default.join(e,".local","share");return qo.default.join(t,i)}}}o(cse,"appDataPath")});var xi=d(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.UnsupportedAlgorithmError=at.CryptoError=at.LengthOrHashMismatchError=at.UnsignedMetadataError=at.RepositoryError=at.ValueError=void 0;var jb=class extends Error{static{o(this,"ValueError")}};at.ValueError=jb;var gu=class extends Error{static{o(this,"RepositoryError")}};at.RepositoryError=gu;var $b=class extends gu{static{o(this,"UnsignedMetadataError")}};at.UnsignedMetadataError=$b;var qb=class extends gu{static{o(this,"LengthOrHashMismatchError")}};at.LengthOrHashMismatchError=qb;var vp=class extends Error{static{o(this,"CryptoError")}};at.CryptoError=vp;var Vb=class extends vp{static{o(this,"UnsupportedAlgorithmError")}};at.UnsupportedAlgorithmError=Vb});var vF=d(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isDefined=use;Zr.isObject=OF;Zr.isStringArray=lse;Zr.isObjectArray=hse;Zr.isStringRecord=fse;Zr.isObjectRecord=dse;function use(i){return i!==void 0}o(use,"isDefined");function OF(i){return typeof i=="object"&&i!==null}o(OF,"isObject");function lse(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}o(lse,"isStringArray");function hse(i){return Array.isArray(i)&&i.every(OF)}o(hse,"isObjectArray");function fse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="string")}o(fse,"isStringRecord");function dse(i){return typeof i=="object"&&i!==null&&Object.keys(i).every(e=>typeof e=="string")&&Object.values(i).every(e=>typeof e=="object"&&e!==null)}o(dse,"isObjectRecord")});var Hb=d((dbe,AF)=>{function zb(i){let e=[];if(typeof i=="string")e.push(RF(i));else if(typeof i=="boolean")e.push(JSON.stringify(i));else if(Number.isInteger(i))e.push(JSON.stringify(i));else if(i===null)e.push(JSON.stringify(i));else if(Array.isArray(i)){e.push("[");let t=!0;i.forEach(r=>{t||e.push(","),t=!1,e.push(zb(r))}),e.push("]")}else if(typeof i=="object"){e.push("{");let t=!0;Object.keys(i).sort().forEach(r=>{t||e.push(","),t=!1,e.push(RF(r)),e.push(":"),e.push(zb(i[r]))}),e.push("}")}else throw new TypeError("cannot encode "+i.toString());return e.join("")}o(zb,"canonicalize");function RF(i){return'"'+i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}o(RF,"canonicalizeString");AF.exports={canonicalize:zb}});var TF=d(Vo=>{"use strict";var pse=Vo&&Vo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.verifySignature=void 0;var mse=Hb(),gse=pse(require("crypto")),yse=o((i,e,t)=>{let r=Buffer.from((0,mse.canonicalize)(i));return gse.default.verify(void 0,r,e,Buffer.from(t,"hex"))},"verifySignature");Vo.verifySignature=yse});var ei=d(kt=>{"use strict";var Sse=kt&&kt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Ese=kt&&kt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),CF=kt&&kt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Sse(t,e,r[s]);return Ese(t,e),t}})();Object.defineProperty(kt,"__esModule",{value:!0});kt.crypto=kt.guard=void 0;kt.guard=CF(vF());kt.crypto=CF(TF())});var en=d(lr=>{"use strict";var wse=lr&&lr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(lr,"__esModule",{value:!0});lr.Signed=lr.MetadataKind=void 0;lr.isMetadataKind=bse;var _se=wse(require("util")),yu=xi(),Gb=ei(),NF=["1","0","31"],Wb;(function(i){i.Root="root",i.Timestamp="timestamp",i.Snapshot="snapshot",i.Targets="targets"})(Wb||(lr.MetadataKind=Wb={}));function bse(i){return typeof i=="string"&&Object.values(Wb).includes(i)}o(bse,"isMetadataKind");var Jb=class i{static{o(this,"Signed")}specVersion;expires;version;unrecognizedFields;constructor(e){this.specVersion=e.specVersion||NF.join(".");let t=this.specVersion.split(".");if(!(t.length===2||t.length===3)||!t.every(r=>Ise(r)))throw new yu.ValueError("Failed to parse specVersion");if(t[0]!=NF[0])throw new yu.ValueError("Unsupported specVersion");this.expires=e.expires,this.version=e.version,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.specVersion===e.specVersion&&this.expires===e.expires&&this.version===e.version&&_se.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}isExpired(e){return e||(e=new Date),e>=new Date(this.expires)}static commonFieldsFromJSON(e){let{spec_version:t,expires:r,version:s,...n}=e;if(Gb.guard.isDefined(t)){if(typeof t!="string")throw new TypeError("spec_version must be a string")}else throw new yu.ValueError("spec_version is not defined");if(Gb.guard.isDefined(r)){if(typeof r!="string")throw new TypeError("expires must be a string")}else throw new yu.ValueError("expires is not defined");if(Gb.guard.isDefined(s)){if(typeof s!="number")throw new TypeError("version must be a number")}else throw new yu.ValueError("version is not defined");return{specVersion:t,expires:r,version:s,unrecognizedFields:n}}};lr.Signed=Jb;function Ise(i){return!isNaN(Number(i))}o(Ise,"isNumeric")});var Su=d(Xr=>{"use strict";var PF=Xr&&Xr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.TargetFile=Xr.MetaFile=void 0;var DF=PF(require("crypto")),Ap=PF(require("util")),Yr=xi(),Rp=ei(),Kb=class i{static{o(this,"MetaFile")}version;length;hashes;unrecognizedFields;constructor(e){if(e.version<=0)throw new Yr.ValueError("Metafile version must be at least 1");e.length!==void 0&&xF(e.length),this.version=e.version,this.length=e.length,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}equals(e){return e instanceof i?this.version===e.version&&this.length===e.length&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}verify(e){if(this.length!==void 0&&e.length!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${e.length}`);this.hashes&&Object.entries(this.hashes).forEach(([t,r])=>{let s;try{s=DF.default.createHash(t)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${t} not supported`)}let n=s.update(e).digest("hex");if(n!==r)throw new Yr.LengthOrHashMismatchError(`Expected hash ${r} but got ${n}`)})}toJSON(){let e={version:this.version,...this.unrecognizedFields};return this.length!==void 0&&(e.length=this.length),this.hashes&&(e.hashes=this.hashes),e}static fromJSON(e){let{version:t,length:r,hashes:s,...n}=e;if(typeof t!="number")throw new TypeError("version must be a number");if(Rp.guard.isDefined(r)&&typeof r!="number")throw new TypeError("length must be a number");if(Rp.guard.isDefined(s)&&!Rp.guard.isStringRecord(s))throw new TypeError("hashes must be string keys and values");return new i({version:t,length:r,hashes:s,unrecognizedFields:n})}};Xr.MetaFile=Kb;var Zb=class i{static{o(this,"TargetFile")}length;path;hashes;unrecognizedFields;constructor(e){xF(e.length),this.length=e.length,this.path=e.path,this.hashes=e.hashes,this.unrecognizedFields=e.unrecognizedFields||{}}get custom(){let e=this.unrecognizedFields.custom;return!e||Array.isArray(e)||typeof e!="object"?{}:e}equals(e){return e instanceof i?this.length===e.length&&this.path===e.path&&Ap.default.isDeepStrictEqual(this.hashes,e.hashes)&&Ap.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}async verify(e){let t=0,r=Object.keys(this.hashes).reduce((s,n)=>{try{s[n]=DF.default.createHash(n)}catch{throw new Yr.LengthOrHashMismatchError(`Hash algorithm ${n} not supported`)}return s},{});for await(let s of e)t+=s.length,Object.values(r).forEach(n=>{n.update(s)});if(t!==this.length)throw new Yr.LengthOrHashMismatchError(`Expected length ${this.length} but got ${t}`);Object.entries(r).forEach(([s,n])=>{let a=this.hashes[s],c=n.digest("hex");if(c!==a)throw new Yr.LengthOrHashMismatchError(`Expected hash ${a} but got ${c}`)})}toJSON(){return{length:this.length,hashes:this.hashes,...this.unrecognizedFields}}static fromJSON(e,t){let{length:r,hashes:s,...n}=t;if(typeof r!="number")throw new TypeError("length must be a number");if(!Rp.guard.isStringRecord(s))throw new TypeError("hashes must have string keys and values");return new i({length:r,path:e,hashes:s,unrecognizedFields:n})}};Xr.TargetFile=Zb;function xF(i){if(i<0)throw new Yr.ValueError("Length must be at least 0")}o(xF,"validateLength")});var LF=d(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});Yb.encodeOIDString=vse;var Ose=6;function vse(i){let e=i.split("."),t=parseInt(e[0],10)*40+parseInt(e[1],10),r=[];e.slice(2).forEach(n=>{let a=Rse(parseInt(n,10));r.push(...a)});let s=Buffer.from([t,...r]);return Buffer.from([Ose,s.length,...s])}o(vse,"encodeOIDString");function Rse(i){let e=[],t=0;for(;i>0;)e.unshift(i&127|t),i>>=7,t=128;return e}o(Rse,"encodeVariableLengthInteger")});var FF=d(wu=>{"use strict";var Ase=wu&&wu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(wu,"__esModule",{value:!0});wu.getPublicKey=Pse;var zo=Ase(require("crypto")),Eu=xi(),Xb=LF(),Tp=48,MF=3,BF=0,Tse="1.3.101.112",Cse="1.2.840.10045.2.1",Nse="1.2.840.10045.3.1.7",Qb="-----BEGIN PUBLIC KEY-----";function Pse(i){switch(i.keyType){case"rsa":return Dse(i);case"ed25519":return xse(i);case"ecdsa":case"ecdsa-sha2-nistp256":case"ecdsa-sha2-nistp384":return Lse(i);default:throw new Eu.UnsupportedAlgorithmError(`Unsupported key type: ${i.keyType}`)}}o(Pse,"getPublicKey");function Dse(i){if(!i.keyVal.startsWith(Qb))throw new Eu.CryptoError("Invalid key format");let e=zo.default.createPublicKey(i.keyVal);switch(i.scheme){case"rsassa-pss-sha256":return{key:e,padding:zo.default.constants.RSA_PKCS1_PSS_PADDING};default:throw new Eu.UnsupportedAlgorithmError(`Unsupported RSA scheme: ${i.scheme}`)}}o(Dse,"getRSAPublicKey");function xse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:Mse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(xse,"getED25519PublicKey");function Lse(i){let e;if(i.keyVal.startsWith(Qb))e=zo.default.createPublicKey(i.keyVal);else{if(!kF(i.keyVal))throw new Eu.CryptoError("Invalid key format");e=zo.default.createPublicKey({key:Bse.hexToDER(i.keyVal),format:"der",type:"spki"})}return{key:e}}o(Lse,"getECDCSAPublicKey");var Mse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=(0,Xb.encodeOIDString)(Tse),r=Buffer.concat([Buffer.concat([Buffer.from([Tp]),Buffer.from([t.length]),t]),Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e])]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r])},"hexToDER")},Bse={hexToDER:o(i=>{let e=Buffer.from(i,"hex"),t=Buffer.concat([Buffer.from([MF]),Buffer.from([e.length+1]),Buffer.from([BF]),e]),r=Buffer.concat([(0,Xb.encodeOIDString)(Cse),(0,Xb.encodeOIDString)(Nse)]),s=Buffer.concat([Buffer.from([Tp]),Buffer.from([r.length]),r]);return Buffer.concat([Buffer.from([Tp]),Buffer.from([s.length+t.length]),s,t])},"hexToDER")},kF=o(i=>/^[0-9a-fA-F]+$/.test(i),"isHex")});var Cp=d(Ho=>{"use strict";var kse=Ho&&Ho.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.Key=void 0;var UF=kse(require("util")),_u=xi(),jF=ei(),Fse=FF(),e0=class i{static{o(this,"Key")}keyID;keyType;scheme;keyVal;unrecognizedFields;constructor(e){let{keyID:t,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a}=e;this.keyID=t,this.keyType=r,this.scheme=s,this.keyVal=n,this.unrecognizedFields=a||{}}verifySignature(e){let t=e.signatures[this.keyID];if(!t)throw new _u.UnsignedMetadataError("no signature for key found in metadata");if(!this.keyVal.public)throw new _u.UnsignedMetadataError("no public key found");let r=(0,Fse.getPublicKey)({keyType:this.keyType,scheme:this.scheme,keyVal:this.keyVal.public}),s=e.signed.toJSON();try{if(!jF.crypto.verifySignature(s,r,t.sig))throw new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}catch(n){throw n instanceof _u.UnsignedMetadataError?n:new _u.UnsignedMetadataError(`failed to verify ${this.keyID} signature`)}}equals(e){return e instanceof i?this.keyID===e.keyID&&this.keyType===e.keyType&&this.scheme===e.scheme&&UF.default.isDeepStrictEqual(this.keyVal,e.keyVal)&&UF.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keytype:this.keyType,scheme:this.scheme,keyval:this.keyVal,...this.unrecognizedFields}}static fromJSON(e,t){let{keytype:r,scheme:s,keyval:n,...a}=t;if(typeof r!="string")throw new TypeError("keytype must be a string");if(typeof s!="string")throw new TypeError("scheme must be a string");if(!jF.guard.isStringRecord(n))throw new TypeError("keyval must be a string record");return new i({keyID:e,keyType:r,scheme:s,keyVal:n,unrecognizedFields:a})}};Ho.Key=e0});var HF=d((Cbe,zF)=>{"use strict";zF.exports=qF;function qF(i,e,t){i instanceof RegExp&&(i=$F(i,t)),e instanceof RegExp&&(e=$F(e,t));var r=VF(i,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+i.length,r[1]),post:t.slice(r[1]+e.length)}}o(qF,"balanced");function $F(i,e){var t=e.match(i);return t?t[0]:null}o($F,"maybeMatch");qF.range=VF;function VF(i,e,t){var r,s,n,a,c,u=t.indexOf(i),l=t.indexOf(e,u+1),h=u;if(u>=0&&l>0){if(i===e)return[u,l];for(r=[],n=t.length;h>=0&&!c;)h==u?(r.push(h),u=t.indexOf(i,h+1)):r.length==1?c=[r.pop(),l]:(s=r.pop(),s<n&&(n=s,a=l),l=t.indexOf(e,h+1)),h=u<l&&u>=0?u:l;r.length&&(c=[n,a])}return c}o(VF,"range")});var QF=d((Pbe,XF)=>{var GF=HF();XF.exports=$se;var WF="\0SLASH"+Math.random()+"\0",JF="\0OPEN"+Math.random()+"\0",i0="\0CLOSE"+Math.random()+"\0",KF="\0COMMA"+Math.random()+"\0",ZF="\0PERIOD"+Math.random()+"\0";function t0(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}o(t0,"numeric");function Use(i){return i.split("\\\\").join(WF).split("\\{").join(JF).split("\\}").join(i0).split("\\,").join(KF).split("\\.").join(ZF)}o(Use,"escapeBraces");function jse(i){return i.split(WF).join("\\").split(JF).join("{").split(i0).join("}").split(KF).join(",").split(ZF).join(".")}o(jse,"unescapeBraces");function YF(i){if(!i)return[""];var e=[],t=GF("{","}",i);if(!t)return i.split(",");var r=t.pre,s=t.body,n=t.post,a=r.split(",");a[a.length-1]+="{"+s+"}";var c=YF(n);return n.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),e.push.apply(e,a),e}o(YF,"parseCommaParts");function $se(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),bu(Use(i),!0).map(jse)):[]}o($se,"expandTop");function qse(i){return"{"+i+"}"}o(qse,"embrace");function Vse(i){return/^-?0\d/.test(i)}o(Vse,"isPadded");function zse(i,e){return i<=e}o(zse,"lte");function Hse(i,e){return i>=e}o(Hse,"gte");function bu(i,e){var t=[],r=GF("{","}",i);if(!r)return[i];var s=r.pre,n=r.post.length?bu(r.post,!1):[""];if(/\$$/.test(r.pre))for(var a=0;a<n.length;a++){var c=s+"{"+r.body+"}"+n[a];t.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=u||l,f=r.body.indexOf(",")>=0;if(!h&&!f)return r.post.match(/,(?!,).*\}/)?(i=r.pre+"{"+r.body+i0+r.post,bu(i)):[i];var p;if(h)p=r.body.split(/\.\./);else if(p=YF(r.body),p.length===1&&(p=bu(p[0],!1).map(qse),p.length===1))return n.map(function(ee){return r.pre+p[0]+ee});var m;if(h){var y=t0(p[0]),g=t0(p[1]),S=Math.max(p[0].length,p[1].length),E=p.length==3?Math.abs(t0(p[2])):1,_=zse,b=g<y;b&&(E*=-1,_=Hse);var w=p.some(Vse);m=[];for(var I=y;_(I,g);I+=E){var v;if(l)v=String.fromCharCode(I),v==="\\"&&(v="");else if(v=String(I),w){var N=S-v.length;if(N>0){var P=new Array(N+1).join("0");I<0?v="-"+P+v.slice(1):v=P+v}}m.push(v)}}else{m=[];for(var $=0;$<p.length;$++)m.push.apply(m,bu(p[$],!1))}for(var $=0;$<m.length;$++)for(var a=0;a<n.length;a++){var c=s+m[$]+n[a];(!e||h||c)&&t.push(c)}}return t}o(bu,"expand")});var eU=d(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.assertValidPattern=void 0;var Gse=1024*64,Wse=o(i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>Gse)throw new TypeError("pattern is too long")},"assertValidPattern");Np.assertValidPattern=Wse});var iU=d(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.parseClass=void 0;var Jse={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Iu=o(i=>i.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Kse=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),tU=o(i=>i.join(""),"rangesToString"),Zse=o((i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],s=[],n=t+1,a=!1,c=!1,u=!1,l=!1,h=t,f="";e:for(;n<i.length;){let g=i.charAt(n);if((g==="!"||g==="^")&&n===t+1){l=!0,n++;continue}if(g==="]"&&a&&!u){h=n+1;break}if(a=!0,g==="\\"&&!u){u=!0,n++;continue}if(g==="["&&!u){for(let[S,[E,_,b]]of Object.entries(Jse))if(i.startsWith(S,n)){if(f)return["$.",!1,i.length-t,!0];n+=S.length,b?s.push(E):r.push(E),c=c||_;continue e}}if(u=!1,f){g>f?r.push(Iu(f)+"-"+Iu(g)):g===f&&r.push(Iu(g)),f="",n++;continue}if(i.startsWith("-]",n+1)){r.push(Iu(g+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=g,n+=2;continue}r.push(Iu(g)),n++}if(h<n)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let g=r[0].length===2?r[0].slice(-1):r[0];return[Kse(g),!1,h-t,!1]}let p="["+(l?"^":"")+tU(r)+"]",m="["+(l?"":"^")+tU(s)+"]";return[r.length&&s.length?"("+p+"|"+m+")":r.length?p:m,c,h-t,!0]},"parseClass");Pp.parseClass=Zse});var xp=d(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.unescape=void 0;var Yse=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");Dp.unescape=Yse});var n0=d(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.AST=void 0;var Xse=iU(),Lp=xp(),Qse=new Set(["!","?","+","*","@"]),rU=o(i=>Qse.has(i),"isExtglobType"),ene="(?!(?:^|/)\\.\\.?(?:$|/))",Mp="(?!\\.)",tne=new Set(["[","."]),ine=new Set(["..","."]),rne=new Set("().*{}+?[]^$\\!"),sne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),s0="[^/]",sU=s0+"*?",nU=s0+"+?",r0=class i{static{o(this,"AST")}type;#e;#t;#i=!1;#r=[];#s;#u;#c;#f=!1;#n;#h;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#t=!0),this.#s=t,this.#e=this.#s?this.#s.#e:this,this.#n=this.#e===this?r:this.#e.#n,this.#c=this.#e===this?[]:this.#e.#c,e==="!"&&!this.#e.#f&&this.#c.push(this),this.#u=this.#s?this.#s.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#h=this.#r.map(e=>String(e)).join("")}#d(){if(this!==this.#e)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let e;for(;e=this.#c.pop();){if(e.type!=="!")continue;let t=e,r=t.#s;for(;r;){for(let s=t.#u+1;!r.type&&s<r.#r.length;s++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(r.#r[s])}t=r,r=t.#s}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#s===this))throw new Error("invalid part: "+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#f&&this.#s?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#s?.isStart())return!1;if(this.#u===0)return!0;let e=this.#s;for(let t=0;t<this.#u;t++){let r=e.#r[t];if(!(r instanceof i&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#s?.type==="!")return!0;if(!this.#s?.isEnd())return!1;if(!this.type)return this.#s?.isEnd();let e=this.#s?this.#s.#r.length:0;return this.#u===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let r of this.#r)t.copyIn(r);return t}static#a(e,t,r,s){let n=!1,a=!1,c=-1,u=!1;if(t.type===null){let m=r,y="";for(;m<e.length;){let g=e.charAt(m++);if(n||g==="\\"){n=!n,y+=g;continue}if(a){m===c+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(m===c+2&&u)&&(a=!1),y+=g;continue}else if(g==="["){a=!0,c=m,u=!1,y+=g;continue}if(!s.noext&&rU(g)&&e.charAt(m)==="("){t.push(y),y="";let S=new i(g,t);m=i.#a(e,S,m,s),t.push(S);continue}y+=g}return t.push(y),m}let l=r+1,h=new i(null,t),f=[],p="";for(;l<e.length;){let m=e.charAt(l++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){l===c+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(l===c+2&&u)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,c=l,u=!1,p+=m;continue}if(rU(m)&&e.charAt(l)==="("){h.push(p),p="";let y=new i(m,h);h.push(y),l=i.#a(e,y,l,s);continue}if(m==="|"){h.push(p),p="",f.push(h),h=new i(null,t);continue}if(m===")")return p===""&&t.#r.length===0&&(t.#o=!0),h.push(p),p="",t.push(...f,h),l;p+=m}return t.type=null,t.#t=void 0,t.#r=[e.substring(r-1)],l}static fromGlob(e,t={}){let r=new i(null,void 0,t);return i.#a(e,r,0,t),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,s,n]=this.toRegExpSource();if(!(s||this.#t||this.#n.nocase&&!this.#n.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#n.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#n}toRegExpSource(e){let t=e??!!this.#n.dot;if(this.#e===this&&this.#d(),!this.type){let u=this.isStart()&&this.isEnd(),l=this.#r.map(m=>{let[y,g,S,E]=typeof m=="string"?i.#y(m,this.#t,u):m.toRegExpSource(e);return this.#t=this.#t||S,this.#i=this.#i||E,y}).join(""),h="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&ine.has(this.#r[0]))){let y=tne,g=t&&y.has(l.charAt(0))||l.startsWith("\\.")&&y.has(l.charAt(2))||l.startsWith("\\.\\.")&&y.has(l.charAt(4)),S=!t&&!e&&y.has(l.charAt(0));h=g?ene:S?Mp:""}let f="";return this.isEnd()&&this.#e.#f&&this.#s?.type==="!"&&(f="(?:$|\\/)"),[h+l+f,(0,Lp.unescape)(l),this.#t=!!this.#t,this.#i]}let r=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let u=this.toString();return this.#r=[u],this.type=null,this.#t=void 0,[u,(0,Lp.unescape)(this.toString()),!1,!1]}let a=!r||e||t||!Mp?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Mp:"")+nU;else{let u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Mp:"")+sU+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+n+u}return[c,(0,Lp.unescape)(n),this.#t=!!this.#t,this.#i]}#p(e){return this.#r.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,s,n,a]=t.toRegExpSource(e);return this.#i=this.#i||a,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#y(e,t,r=!1){let s=!1,n="",a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(s){s=!1,n+=(rne.has(u)?"\\":"")+u;continue}if(u==="\\"){c===e.length-1?n+="\\\\":s=!0;continue}if(u==="["){let[l,h,f,p]=(0,Xse.parseClass)(e,c);if(f){n+=l,a=a||h,c+=f-1,t=t||p;continue}}if(u==="*"){r&&e==="*"?n+=nU:n+=sU,t=!0;continue}if(u==="?"){n+=s0,t=!0;continue}n+=sne(u)}return[n,(0,Lp.unescape)(e),!!t,a]}};Bp.AST=r0});var o0=d(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.escape=void 0;var nne=o((i,{windowsPathsNoEscape:e=!1}={})=>e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&"),"escape");kp.escape=nne});var fU=d(T=>{"use strict";var one=T&&T.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(T,"__esModule",{value:!0});T.unescape=T.escape=T.AST=T.Minimatch=T.match=T.makeRe=T.braceExpand=T.defaults=T.filter=T.GLOBSTAR=T.sep=T.minimatch=void 0;var ane=one(QF()),Fp=eU(),cU=n0(),cne=o0(),une=xp(),lne=o((i,e,t={})=>((0,Fp.assertValidPattern)(e),!t.nocomment&&e.charAt(0)==="#"?!1:new tn(e,t).match(i)),"minimatch");T.minimatch=lne;var hne=/^\*+([^+@!?\*\[\(]*)$/,fne=o(i=>e=>!e.startsWith(".")&&e.endsWith(i),"starDotExtTest"),dne=o(i=>e=>e.endsWith(i),"starDotExtTestDot"),pne=o(i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),"starDotExtTestNocase"),mne=o(i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),"starDotExtTestNocaseDot"),gne=/^\*+\.\*+$/,yne=o(i=>!i.startsWith(".")&&i.includes("."),"starDotStarTest"),Sne=o(i=>i!=="."&&i!==".."&&i.includes("."),"starDotStarTestDot"),Ene=/^\.\*+$/,wne=o(i=>i!=="."&&i!==".."&&i.startsWith("."),"dotStarTest"),_ne=/^\*+$/,bne=o(i=>i.length!==0&&!i.startsWith("."),"starTest"),Ine=o(i=>i.length!==0&&i!=="."&&i!=="..","starTestDot"),One=/^\?+([^+@!?\*\[\(]*)?$/,vne=o(([i,e=""])=>{let t=uU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Rne=o(([i,e=""])=>{let t=lU([i]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Ane=o(([i,e=""])=>{let t=lU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),Tne=o(([i,e=""])=>{let t=uU([i]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),uU=o(([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),lU=o(([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),hU=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",oU={win32:{sep:"\\"},posix:{sep:"/"}};T.sep=hU==="win32"?oU.win32.sep:oU.posix.sep;T.minimatch.sep=T.sep;T.GLOBSTAR=Symbol("globstar **");T.minimatch.GLOBSTAR=T.GLOBSTAR;var Cne="[^/]",Nne=Cne+"*?",Pne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Dne="(?:(?!(?:\\/|^)\\.).)*?",xne=o((i,e={})=>t=>(0,T.minimatch)(t,i,e),"filter");T.filter=xne;T.minimatch.filter=T.filter;var Ft=o((i,e={})=>Object.assign({},i,e),"ext"),Lne=o(i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return T.minimatch;let e=T.minimatch;return Object.assign(o((r,s,n={})=>e(r,s,Ft(i,n)),"m"),{Minimatch:class extends e.Minimatch{static{o(this,"Minimatch")}constructor(s,n={}){super(s,Ft(i,n))}static defaults(s){return e.defaults(Ft(i,s)).Minimatch}},AST:class extends e.AST{static{o(this,"AST")}constructor(s,n,a={}){super(s,n,Ft(i,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,Ft(i,n))}},unescape:o((r,s={})=>e.unescape(r,Ft(i,s)),"unescape"),escape:o((r,s={})=>e.escape(r,Ft(i,s)),"escape"),filter:o((r,s={})=>e.filter(r,Ft(i,s)),"filter"),defaults:o(r=>e.defaults(Ft(i,r)),"defaults"),makeRe:o((r,s={})=>e.makeRe(r,Ft(i,s)),"makeRe"),braceExpand:o((r,s={})=>e.braceExpand(r,Ft(i,s)),"braceExpand"),match:o((r,s,n={})=>e.match(r,s,Ft(i,n)),"match"),sep:e.sep,GLOBSTAR:T.GLOBSTAR})},"defaults");T.defaults=Lne;T.minimatch.defaults=T.defaults;var Mne=o((i,e={})=>((0,Fp.assertValidPattern)(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,ane.default)(i)),"braceExpand");T.braceExpand=Mne;T.minimatch.braceExpand=T.braceExpand;var Bne=o((i,e={})=>new tn(i,e).makeRe(),"makeRe");T.makeRe=Bne;T.minimatch.makeRe=T.makeRe;var kne=o((i,e,t={})=>{let r=new tn(e,t);return i=i.filter(s=>r.match(s)),r.options.nonull&&!i.length&&i.push(e),i},"match");T.match=kne;T.minimatch.match=T.match;var aU=/[?*]|[+@!]\(.*?\)|\[|\]/,Fne=o(i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),tn=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,Fp.assertValidPattern)(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||hU,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...n)=>{}),this.debug(this.pattern,this.globSet);let r=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=n[0]===""&&n[1]===""&&(n[2]==="?"||!aU.test(n[2]))&&!aU.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(u)return[...n.slice(0,4),...n.slice(4).map(h=>this.parse(h))];if(l)return[n[0],...n.slice(1).map(h=>this.parse(h))]}return n.map(u=>this.parse(u))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)e[r][s]==="**"&&(e[r][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let s=r;for(;t[s+1]==="**";)s++;s!==r&&t.splice(r,s-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,s)=>{let n=r[r.length-1];return s==="**"&&n==="**"?r:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(r.pop(),r):(r.push(s),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let s=e[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let a=s;for(;r[a+1]==="**";)a++;a>s&&r.splice(s+1,a-s);let c=r[s+1],u=r[s+2],l=r[s+3];if(c!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(s,1);let h=r.slice(0);h[s]="**",e.push(h),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let n=0;for(;(n=r.indexOf("..",n+1))!==-1;){let a=r[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){t=!0;let u=n===1&&r[n+1]==="**"?["."]:[];r.splice(n-1,2,...u),r.length===0&&r.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let s=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(s){e[t]=[],e[r]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let s=0,n=0,a=[],c="";for(;s<e.length&&n<t.length;)if(e[s]===t[n])a.push(c==="b"?t[n]:e[s]),s++,n++;else if(r&&e[s]==="**"&&t[n]===e[s+1])a.push(e[s]),s++;else if(r&&t[n]==="**"&&e[s]===t[n+1])a.push(t[n]),n++;else if(e[s]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(c==="b")return!1;c="a",a.push(e[s]),s++,n++}else if(t[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(c==="a")return!1;c="b",a.push(t[n]),s++,n++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),_=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=S?3:g?0:void 0,w=_?3:E?0:void 0;if(typeof b=="number"&&typeof w=="number"){let[I,v]=[e[b],t[w]];I.toLowerCase()===v.toLowerCase()&&(t[w]=I,w>b?t=t.slice(w):b>w&&(e=e.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var a=0,c=0,u=e.length,l=t.length;a<u&&c<l;a++,c++){this.debug("matchOne loop");var h=t[c],f=e[a];if(this.debug(t,h,f),h===!1)return!1;if(h===T.GLOBSTAR){this.debug("GLOBSTAR",[t,h,f]);var p=a,m=c+1;if(m===l){for(this.debug("** at the end");a<u;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;p<u;){var y=e[p];if(this.debug(`
|
|
62
59
|
globstar while`,e,p,t,m,y),this.matchOne(e.slice(p),t.slice(m),r))return this.debug("globstar found match!",p,u,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",e,p,t,m);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(r&&(this.debug(`
|
|
63
|
-
>>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,A.braceExpand)(this.pattern,this.options)}parse(e){(0,Zp.assertValidPattern)(e);let t=this.options;if(e==="**")return A.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(doe))?s=t.dot?moe:poe:(r=e.match(roe))?s=(t.nocase?t.dot?aoe:ooe:t.dot?noe:soe)(r[1]):(r=e.match(goe))?s=(t.nocase?t.dot?Soe:yoe:t.dot?Eoe:woe)(r):(r=e.match(coe))?s=t.dot?loe:uoe:(r=e.match(hoe))&&(s=foe);let n=LU.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?boe:t.dot?Ioe:Ooe,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Noe(h):h===A.GLOBSTAR?A.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==A.GLOBSTAR||m===A.GLOBSTAR||(m===void 0?p!==void 0&&p!==A.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==A.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=A.GLOBSTAR))}),l.filter(h=>h!==A.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return A.minimatch.defaults(e).Minimatch}};A.Minimatch=cn;var Poe=_0();Object.defineProperty(A,"AST",{enumerable:!0,get:o(function(){return Poe.AST},"get")});var Doe=b0();Object.defineProperty(A,"escape",{enumerable:!0,get:o(function(){return Doe.escape},"get")});var xoe=Hp();Object.defineProperty(A,"unescape",{enumerable:!0,get:o(function(){return xoe.unescape},"get")});A.minimatch.AST=LU.AST;A.minimatch.Minimatch=cn;A.minimatch.escape=eoe.escape;A.minimatch.unescape=toe.unescape});var v0=d(Vt=>{"use strict";var UU=Vt&&Vt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.SuccinctRoles=Vt.DelegatedRole=Vt.Role=Vt.TOP_LEVEL_ROLE_NAMES=void 0;var jU=UU(require("crypto")),Loe=FU(),Yp=UU(require("util")),Xp=ki(),un=si();Vt.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var Du=class i{static{o(this,"Role")}keyIDs;threshold;unrecognizedFields;constructor(e){let{keyIDs:t,threshold:r,unrecognizedFields:s}=e;if(Moe(t))throw new Xp.ValueError("duplicate key IDs found");if(r<1)throw new Xp.ValueError("threshold must be at least 1");this.keyIDs=t,this.threshold=r,this.unrecognizedFields=s||{}}equals(e){return e instanceof i?this.threshold===e.threshold&&Yp.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&Yp.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:t,threshold:r,...s}=e;if(!un.guard.isStringArray(t))throw new TypeError("keyids must be an array");if(typeof r!="number")throw new TypeError("threshold must be a number");return new i({keyIDs:t,threshold:r,unrecognizedFields:s})}};Vt.Role=Du;function Moe(i){return new Set(i).size!==i.length}o(Moe,"hasDuplicates");var I0=class i extends Du{static{o(this,"DelegatedRole")}name;terminating;paths;pathHashPrefixes;constructor(e){super(e);let{name:t,terminating:r,paths:s,pathHashPrefixes:n}=e;if(this.name=t,this.terminating=r,e.paths&&e.pathHashPrefixes)throw new Xp.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=s,this.pathHashPrefixes=n}equals(e){return e instanceof i?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&Yp.default.isDeepStrictEqual(this.paths,e.paths)&&Yp.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(t=>koe(e,t));if(this.pathHashPrefixes){let r=jU.default.createHash("sha256").update(e).digest("hex");return this.pathHashPrefixes.some(s=>r.startsWith(s))}return!1}toJSON(){let e={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(e.paths=this.paths),this.pathHashPrefixes&&(e.path_hash_prefixes=this.pathHashPrefixes),e}static fromJSON(e){let{keyids:t,threshold:r,name:s,terminating:n,paths:a,path_hash_prefixes:c,...u}=e;if(!un.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="number")throw new TypeError("threshold must be a number");if(typeof s!="string")throw new TypeError("name must be a string");if(typeof n!="boolean")throw new TypeError("terminating must be a boolean");if(un.guard.isDefined(a)&&!un.guard.isStringArray(a))throw new TypeError("paths must be an array of strings");if(un.guard.isDefined(c)&&!un.guard.isStringArray(c))throw new TypeError("path_hash_prefixes must be an array of strings");return new i({keyIDs:t,threshold:r,name:s,terminating:n,paths:a,pathHashPrefixes:c,unrecognizedFields:u})}};Vt.DelegatedRole=I0;var Boe=o((i,e)=>i.map((t,r)=>[t,e[r]]),"zip");function koe(i,e){let t=i.split("/"),r=e.split("/");return r.length!=t.length?!1:Boe(t,r).every(([s,n])=>(0,Loe.minimatch)(s,n))}o(koe,"isTargetInPathPattern");var O0=class i extends Du{static{o(this,"SuccinctRoles")}bitLength;namePrefix;numberOfBins;suffixLen;constructor(e){super(e);let{bitLength:t,namePrefix:r}=e;if(t<=0||t>32)throw new Xp.ValueError("bitLength must be between 1 and 32");this.bitLength=t,this.namePrefix=r,this.numberOfBins=Math.pow(2,t),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof i?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let s=jU.default.createHash("sha256").update(e).digest().subarray(0,4),n=32-this.bitLength,c=(s.readUInt32BE()>>>n).toString(16).padStart(this.suffixLen,"0");return`${this.namePrefix}-${c}`}*getRoles(){for(let e=0;e<this.numberOfBins;e++){let t=e.toString(16).padStart(this.suffixLen,"0");yield`${this.namePrefix}-${t}`}}isDelegatedRole(e){let t=this.namePrefix+"-";if(!e.startsWith(t))return!1;let r=e.slice(t.length,e.length);if(r.length!=this.suffixLen||!r.match(/^[0-9a-fA-F]+$/))return!1;let s=parseInt(r,16);return 0<=s&&s<this.numberOfBins}toJSON(){return{...super.toJSON(),bit_length:this.bitLength,name_prefix:this.namePrefix}}static fromJSON(e){let{keyids:t,threshold:r,bit_length:s,name_prefix:n,...a}=e;if(!un.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="number")throw new TypeError("threshold must be a number");if(typeof s!="number")throw new TypeError("bit_length must be a number");if(typeof n!="string")throw new TypeError("name_prefix must be a string");return new i({keyIDs:t,threshold:r,bitLength:s,namePrefix:n,unrecognizedFields:a})}};Vt.SuccinctRoles=O0});var A0=d(ta=>{"use strict";var Foe=ta&&ta.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ta,"__esModule",{value:!0});ta.Root=void 0;var $U=Foe(require("util")),C0=an(),qU=ki(),Uoe=$p(),Qp=v0(),em=si(),R0=class i extends C0.Signed{static{o(this,"Root")}type=C0.MetadataKind.Root;keys;roles;consistentSnapshot;constructor(e){if(super(e),this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=Qp.TOP_LEVEL_ROLE_NAMES.reduce((t,r)=>({...t,[r]:new Qp.Role({keyIDs:[],threshold:1})}),{});else{let t=new Set(Object.keys(e.roles));if(!Qp.TOP_LEVEL_ROLE_NAMES.every(r=>t.has(r)))throw new qU.ValueError("missing top-level role");this.roles=e.roles}}addKey(e,t){if(!this.roles[t])throw new qU.ValueError(`role ${t} does not exist`);this.roles[t].keyIDs.includes(e.keyID)||this.roles[t].keyIDs.push(e.keyID),this.keys[e.keyID]=e}equals(e){return e instanceof i?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&$U.default.isDeepStrictEqual(this.keys,e.keys)&&$U.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:joe(this.keys),roles:$oe(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=C0.Signed.commonFieldsFromJSON(e),{keys:s,roles:n,consistent_snapshot:a,...c}=t;if(typeof a!="boolean")throw new TypeError("consistent_snapshot must be a boolean");return new i({...r,keys:qoe(s),roles:Voe(n),consistentSnapshot:a,unrecognizedFields:c})}};ta.Root=R0;function joe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(joe,"keysToJSON");function $oe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o($oe,"rolesToJSON");function qoe(i){let e;if(em.guard.isDefined(i)){if(!em.guard.isObjectRecord(i))throw new TypeError("keys must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:Uoe.Key.fromJSON(r,s)}),{})}return e}o(qoe,"keysFromJSON");function Voe(i){let e;if(em.guard.isDefined(i)){if(!em.guard.isObjectRecord(i))throw new TypeError("roles must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:Qp.Role.fromJSON(s)}),{})}return e}o(Voe,"rolesFromJSON")});var N0=d(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.Signature=void 0;var T0=class i{static{o(this,"Signature")}keyID;sig;constructor(e){let{keyID:t,sig:r}=e;this.keyID=t,this.sig=r}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:t,sig:r}=e;if(typeof t!="string")throw new TypeError("keyid must be a string");if(typeof r!="string")throw new TypeError("sig must be a string");return new i({keyID:t,sig:r})}};tm.Signature=T0});var x0=d(ia=>{"use strict";var zoe=ia&&ia.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ia,"__esModule",{value:!0});ia.Snapshot=void 0;var Hoe=zoe(require("util")),P0=an(),zU=Cu(),VU=si(),D0=class i extends P0.Signed{static{o(this,"Snapshot")}type=P0.MetadataKind.Snapshot;meta;constructor(e){super(e),this.meta=e.meta||{"targets.json":new zU.MetaFile({version:1})}}equals(e){return e instanceof i?super.equals(e)&&Hoe.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:Goe(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=P0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,meta:Woe(s),unrecognizedFields:n})}};ia.Snapshot=D0;function Goe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Goe,"metaToJSON");function Woe(i){let e;if(VU.guard.isDefined(i))if(VU.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:zU.MetaFile.fromJSON(s)}),{});else throw new TypeError("meta field is malformed");return e}o(Woe,"metaFromJSON")});var HU=d(ra=>{"use strict";var Joe=ra&&ra.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ra,"__esModule",{value:!0});ra.Delegations=void 0;var im=Joe(require("util")),Koe=ki(),Zoe=$p(),L0=v0(),rm=si(),M0=class i{static{o(this,"Delegations")}keys;roles;unrecognizedFields;succinctRoles;constructor(e){if(this.keys=e.keys,this.unrecognizedFields=e.unrecognizedFields||{},e.roles&&Object.keys(e.roles).some(t=>L0.TOP_LEVEL_ROLE_NAMES.includes(t)))throw new Koe.ValueError("Delegated role name conflicts with top-level role name");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof i?im.default.isDeepStrictEqual(this.keys,e.keys)&&im.default.isDeepStrictEqual(this.roles,e.roles)&&im.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&im.default.isDeepStrictEqual(this.succinctRoles,e.succinctRoles):!1}*rolesForTarget(e){if(this.roles)for(let t of Object.values(this.roles))t.isDelegatedPath(e)&&(yield{role:t.name,terminating:t.terminating});else this.succinctRoles&&(yield{role:this.succinctRoles.getRoleForTarget(e),terminating:!0})}toJSON(){let e={keys:Yoe(this.keys),...this.unrecognizedFields};return this.roles?e.roles=Xoe(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:t,roles:r,succinct_roles:s,...n}=e,a;return rm.guard.isObject(s)&&(a=L0.SuccinctRoles.fromJSON(s)),new i({keys:Qoe(t),roles:eae(r),unrecognizedFields:n,succinctRoles:a})}};ra.Delegations=M0;function Yoe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Yoe,"keysToJSON");function Xoe(i){return Object.values(i).map(e=>e.toJSON())}o(Xoe,"rolesToJSON");function Qoe(i){if(!rm.guard.isObjectRecord(i))throw new TypeError("keys is malformed");return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:Zoe.Key.fromJSON(t,r)}),{})}o(Qoe,"keysFromJSON");function eae(i){let e;if(rm.guard.isDefined(i)){if(!rm.guard.isObjectArray(i))throw new TypeError("roles is malformed");e=i.reduce((t,r)=>{let s=L0.DelegatedRole.fromJSON(r);return{...t,[s.name]:s}},{})}return e}o(eae,"rolesFromJSON")});var F0=d(sa=>{"use strict";var tae=sa&&sa.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(sa,"__esModule",{value:!0});sa.Targets=void 0;var GU=tae(require("util")),B0=an(),iae=HU(),rae=Cu(),sm=si(),k0=class i extends B0.Signed{static{o(this,"Targets")}type=B0.MetadataKind.Targets;targets;delegations;constructor(e){super(e),this.targets=e.targets||{},this.delegations=e.delegations}addTarget(e){this.targets[e.path]=e}equals(e){return e instanceof i?super.equals(e)&&GU.default.isDeepStrictEqual(this.targets,e.targets)&&GU.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:sae(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:t,...r}=B0.Signed.commonFieldsFromJSON(e),{targets:s,delegations:n,...a}=t;return new i({...r,targets:nae(s),delegations:oae(n),unrecognizedFields:a})}};sa.Targets=k0;function sae(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(sae,"targetsToJSON");function nae(i){let e;if(sm.guard.isDefined(i))if(sm.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:rae.TargetFile.fromJSON(r,s)}),{});else throw new TypeError("targets must be an object");return e}o(nae,"targetsFromJSON");function oae(i){let e;if(sm.guard.isDefined(i))if(sm.guard.isObject(i))e=iae.Delegations.fromJSON(i);else throw new TypeError("delegations must be an object");return e}o(oae,"delegationsFromJSON")});var q0=d(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.Timestamp=void 0;var U0=an(),WU=Cu(),j0=si(),$0=class i extends U0.Signed{static{o(this,"Timestamp")}type=U0.MetadataKind.Timestamp;snapshotMeta;constructor(e){super(e),this.snapshotMeta=e.snapshotMeta||new WU.MetaFile({version:1})}equals(e){return e instanceof i?super.equals(e)&&this.snapshotMeta.equals(e.snapshotMeta):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,meta:{"snapshot.json":this.snapshotMeta.toJSON()},...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=U0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,snapshotMeta:aae(s),unrecognizedFields:n})}};nm.Timestamp=$0;function aae(i){let e;if(j0.guard.isDefined(i)){let t=i["snapshot.json"];if(!j0.guard.isDefined(t)||!j0.guard.isObject(t))throw new TypeError("missing snapshot.json in meta");e=WU.MetaFile.fromJSON(t)}return e}o(aae,"snapshotMetaFromJSON")});var KU=d(oa=>{"use strict";var cae=oa&&oa.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(oa,"__esModule",{value:!0});oa.Metadata=void 0;var uae=a0(),JU=cae(require("util")),na=an(),xu=ki(),lae=A0(),hae=N0(),fae=x0(),dae=F0(),pae=q0(),V0=si(),z0=class i{static{o(this,"Metadata")}signed;signatures;unrecognizedFields;constructor(e,t,r){this.signed=e,this.signatures=t||{},this.unrecognizedFields=r||{}}sign(e,t=!0){let r=Buffer.from((0,uae.canonicalize)(this.signed.toJSON())),s=e(r);t||(this.signatures={}),this.signatures[s.keyID]=s}verifyDelegate(e,t){let r,s={};switch(this.signed.type){case na.MetadataKind.Root:s=this.signed.keys,r=this.signed.roles[e];break;case na.MetadataKind.Targets:if(!this.signed.delegations)throw new xu.ValueError(`No delegations found for ${e}`);s=this.signed.delegations.keys,this.signed.delegations.roles?r=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(r=this.signed.delegations.succinctRoles);break;default:throw new TypeError("invalid metadata type")}if(!r)throw new xu.ValueError(`no delegation found for ${e}`);let n=new Set;if(r.keyIDs.forEach(a=>{let c=s[a];if(c)try{c.verifySignature(t),n.add(c.keyID)}catch{}}),n.size<r.threshold)throw new xu.UnsignedMetadataError(`${e} was signed by ${n.size}/${r.threshold} keys`)}equals(e){return e instanceof i?this.signed.equals(e.signed)&&JU.default.isDeepStrictEqual(this.signatures,e.signatures)&&JU.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{signatures:Object.values(this.signatures).map(t=>t.toJSON()),signed:this.signed.toJSON(),...this.unrecognizedFields}}static fromJSON(e,t){let{signed:r,signatures:s,...n}=t;if(!V0.guard.isDefined(r)||!V0.guard.isObject(r))throw new TypeError("signed is not defined");if(e!==r._type)throw new xu.ValueError(`expected '${e}', got ${r._type}`);if(!V0.guard.isObjectArray(s))throw new TypeError("signatures is not an array");let a;switch(e){case na.MetadataKind.Root:a=lae.Root.fromJSON(r);break;case na.MetadataKind.Timestamp:a=pae.Timestamp.fromJSON(r);break;case na.MetadataKind.Snapshot:a=fae.Snapshot.fromJSON(r);break;case na.MetadataKind.Targets:a=dae.Targets.fromJSON(r);break;default:throw new TypeError("invalid metadata type")}let c={};return s.forEach(u=>{let l=hae.Signature.fromJSON(u);if(c[l.keyID])throw new xu.ValueError(`multiple signatures found for keyid: ${l.keyID}`);c[l.keyID]=l}),new i(a,c,n)}};oa.Metadata=z0});var om=d(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Timestamp=ce.Targets=ce.Snapshot=ce.Signature=ce.Root=ce.Metadata=ce.Key=ce.TargetFile=ce.MetaFile=ce.ValueError=ce.MetadataKind=void 0;var mae=an();Object.defineProperty(ce,"MetadataKind",{enumerable:!0,get:o(function(){return mae.MetadataKind},"get")});var gae=ki();Object.defineProperty(ce,"ValueError",{enumerable:!0,get:o(function(){return gae.ValueError},"get")});var ZU=Cu();Object.defineProperty(ce,"MetaFile",{enumerable:!0,get:o(function(){return ZU.MetaFile},"get")});Object.defineProperty(ce,"TargetFile",{enumerable:!0,get:o(function(){return ZU.TargetFile},"get")});var yae=$p();Object.defineProperty(ce,"Key",{enumerable:!0,get:o(function(){return yae.Key},"get")});var Sae=KU();Object.defineProperty(ce,"Metadata",{enumerable:!0,get:o(function(){return Sae.Metadata},"get")});var Eae=A0();Object.defineProperty(ce,"Root",{enumerable:!0,get:o(function(){return Eae.Root},"get")});var wae=N0();Object.defineProperty(ce,"Signature",{enumerable:!0,get:o(function(){return wae.Signature},"get")});var _ae=x0();Object.defineProperty(ce,"Snapshot",{enumerable:!0,get:o(function(){return _ae.Snapshot},"get")});var bae=F0();Object.defineProperty(ce,"Targets",{enumerable:!0,get:o(function(){return bae.Targets},"get")});var Iae=q0();Object.defineProperty(ce,"Timestamp",{enumerable:!0,get:o(function(){return Iae.Timestamp},"get")})});var cm=d(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.DownloadHTTPError=de.DownloadLengthMismatchError=de.DownloadError=de.ExpiredMetadataError=de.EqualVersionError=de.BadVersionError=de.RepositoryError=de.PersistError=de.RuntimeError=de.ValueError=void 0;var H0=class extends Error{static{o(this,"ValueError")}};de.ValueError=H0;var G0=class extends Error{static{o(this,"RuntimeError")}};de.RuntimeError=G0;var W0=class extends Error{static{o(this,"PersistError")}};de.PersistError=W0;var Lu=class extends Error{static{o(this,"RepositoryError")}};de.RepositoryError=Lu;var am=class extends Lu{static{o(this,"BadVersionError")}};de.BadVersionError=am;var J0=class extends am{static{o(this,"EqualVersionError")}};de.EqualVersionError=J0;var K0=class extends Lu{static{o(this,"ExpiredMetadataError")}};de.ExpiredMetadataError=K0;var Mu=class extends Error{static{o(this,"DownloadError")}};de.DownloadError=Mu;var Z0=class extends Mu{static{o(this,"DownloadLengthMismatchError")}};de.DownloadLengthMismatchError=Z0;var Y0=class extends Mu{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,t){super(e),this.statusCode=t}};de.DownloadHTTPError=Y0});var XU=d(aa=>{"use strict";var Q0=aa&&aa.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(aa,"__esModule",{value:!0});aa.withTempFile=void 0;var X0=Q0(require("fs/promises")),Oae=Q0(require("os")),YU=Q0(require("path")),vae=o(async i=>Cae(async e=>i(YU.default.join(e,"tempfile"))),"withTempFile");aa.withTempFile=vae;var Cae=o(async i=>{let e=await X0.default.realpath(Oae.default.tmpdir()),t=await X0.default.mkdtemp(e+YU.default.sep);try{return await i(t)}finally{await X0.default.rm(t,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var tI=d(ss=>{"use strict";var lm=ss&&ss.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ss,"__esModule",{value:!0});ss.DefaultFetcher=ss.BaseFetcher=void 0;var Rae=lm(zs()),QU=lm(require("fs")),Aae=lm(lu()),Tae=lm(require("util")),ej=cm(),Nae=XU(),Pae=(0,Rae.default)("tuf:fetch"),um=class{static{o(this,"BaseFetcher")}async downloadFile(e,t,r){return(0,Nae.withTempFile)(async s=>{let n=await this.fetch(e),a=0,c=QU.default.createWriteStream(s);try{for await(let u of n){if(a+=u.length,a>t)throw new ej.DownloadLengthMismatchError("Max length reached");await Dae(c,u)}}finally{await Tae.default.promisify(c.close).bind(c)()}return r(s)})}async downloadBytes(e,t){return this.downloadFile(e,t,async r=>{let s=QU.default.createReadStream(r),n=[];for await(let a of s)n.push(a);return Buffer.concat(n)})}};ss.BaseFetcher=um;var eI=class extends um{static{o(this,"DefaultFetcher")}timeout;retry;constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Pae("GET %s",e);let t=await(0,Aae.default)(e,{timeout:this.timeout,retry:this.retry});if(!t.ok||!t?.body)throw new ej.DownloadHTTPError("Failed to download",t.status);return t.body}};ss.DefaultFetcher=eI;var Dae=o(async(i,e)=>new Promise((t,r)=>{i.write(e,s=>{s&&r(s),t(!0)})}),"writeBufferToStream")});var tj=d(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.defaultConfig=void 0;hm.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var ij=d(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.TrustedMetadataStore=void 0;var Ie=om(),le=cm(),iI=class{static{o(this,"TrustedMetadataStore")}trustedSet={};referenceTime;constructor(e){this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Root,r),r.signed.version!=this.root.signed.version+1)throw new le.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${r.signed.version}`);return r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r,r}updateTimestamp(e){if(this.snapshot)throw new le.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final root.json is expired");let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Timestamp,t);if(r.signed.type!=Ie.MetadataKind.Timestamp)throw new le.RepositoryError(`Expected 'timestamp', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Timestamp,r),this.timestamp){if(r.signed.version<this.timestamp.signed.version)throw new le.BadVersionError(`New timestamp version ${r.signed.version} is less than current version ${this.timestamp.signed.version}`);if(r.signed.version===this.timestamp.signed.version)throw new le.EqualVersionError(`New timestamp version ${r.signed.version} is equal to current version ${this.timestamp.signed.version}`);let s=this.timestamp.signed.snapshotMeta,n=r.signed.snapshotMeta;if(n.version<s.version)throw new le.BadVersionError(`New snapshot version ${n.version} is less than current version ${s.version}`)}return this.trustedSet.timestamp=r,this.checkFinalTimestamp(),r}updateSnapshot(e,t=!1){if(!this.timestamp)throw new le.RuntimeError("Cannot update snapshot before timestamp");if(this.targets)throw new le.RuntimeError("Cannot update snapshot after targets");this.checkFinalTimestamp();let r=this.timestamp.signed.snapshotMeta;t||r.verify(e);let s=JSON.parse(e.toString("utf8")),n=Ie.Metadata.fromJSON(Ie.MetadataKind.Snapshot,s);if(n.signed.type!=Ie.MetadataKind.Snapshot)throw new le.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Ie.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([a,c])=>{let u=n.signed.meta[a];if(!u)throw new le.RepositoryError(`Missing file ${a} in new snapshot`);if(u.version<c.version)throw new le.BadVersionError(`New version ${u.version} of ${a} is less than current version ${c.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,t,r){if(!this.snapshot)throw new le.RuntimeError("Cannot update delegated targets before snapshot");this.checkFinalSnapsnot();let s=this.trustedSet[r];if(!s)throw new le.RuntimeError(`No trusted ${r} metadata`);let n=this.snapshot.signed.meta?.[`${t}.json`];if(!n)throw new le.RepositoryError(`Missing ${t}.json in snapshot`);n.verify(e);let a=JSON.parse(e.toString("utf8")),c=Ie.Metadata.fromJSON(Ie.MetadataKind.Targets,a);if(c.signed.type!=Ie.MetadataKind.Targets)throw new le.RepositoryError(`Expected 'targets', got ${c.signed.type}`);s.verifyDelegate(t,c);let u=c.signed.version;if(u!=n.version)throw new le.BadVersionError(`Version ${u} of ${t} does not match snapshot version ${n.version}`);if(c.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError(`${t}.json is expired`);this.trustedSet[t]=c}loadTrustedRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.timestamp.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final timestamp.json is expired")}checkFinalSnapsnot(){if(!this.snapshot)throw new ReferenceError("No trusted snapshot metadata");if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.snapshot.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("snapshot.json is expired");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new le.BadVersionError("Snapshot version doesn't match timestamp")}};fm.TrustedMetadataStore=iI});var rj=d(rI=>{"use strict";Object.defineProperty(rI,"__esModule",{value:!0});rI.join=Lae;var xae=require("url");function Lae(i,e){return new xae.URL(Mae(i)+Bae(e)).toString()}o(Lae,"join");function Mae(i){return i.endsWith("/")?i:i+"/"}o(Mae,"ensureTrailingSlash");function Bae(i){return i.startsWith("/")?i.slice(1):i}o(Bae,"removeLeadingSlash")});var sj=d(zt=>{"use strict";var kae=zt&&zt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Fae=zt&&zt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),oI=zt&&zt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&kae(t,e,r[s]);return Fae(t,e),t}})(),Uae=zt&&zt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(zt,"__esModule",{value:!0});zt.Updater=void 0;var Fi=om(),jae=Uae(zs()),ca=oI(require("fs")),dm=oI(require("path")),$ae=tj(),ln=cm(),qae=tI(),Vae=ij(),Bu=oI(rj()),sI=(0,jae.default)("tuf:cache"),nI=class{static{o(this,"Updater")}dir;metadataBaseUrl;targetDir;targetBaseUrl;forceCache;trustedSet;config;fetcher;constructor(e){let{metadataDir:t,metadataBaseUrl:r,targetDir:s,targetBaseUrl:n,fetcher:a,config:c}=e;this.dir=t,this.metadataBaseUrl=r,this.targetDir=s,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let u=this.loadLocalMetadata(Fi.MetadataKind.Root);this.trustedSet=new Vae.TrustedMetadataStore(u),this.config={...$ae.defaultConfig,...c},this.fetcher=a||new qae.DefaultFetcher({timeout:this.config.fetchTimeout,retry:this.config.fetchRetries??this.config.fetchRetry})}async refresh(){if(this.forceCache)try{await this.loadTimestamp({checkRemote:!1})}catch{await this.loadRoot(),await this.loadTimestamp()}else await this.loadRoot(),await this.loadTimestamp();await this.loadSnapshot(),await this.loadTargets(Fi.MetadataKind.Targets,Fi.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,t,r){let s=t||this.generateTargetPath(e);if(!r){if(!this.targetBaseUrl)throw new ln.ValueError("Target base URL not set");r=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let u=Object.values(e.hashes),{dir:l,base:h}=dm.parse(n),f=`${u[0]}.${h}`;n=l?`${l}/${f}`:f}let c=Bu.join(r,n);return await this.fetcher.downloadFile(c,e.length,async u=>{await e.verify(ca.createReadStream(u)),sI("WRITE %s",s),ca.copyFileSync(u,s)}),s}async findCachedTarget(e,t){t||(t=this.generateTargetPath(e));try{if(ca.existsSync(t))return await e.verify(ca.createReadStream(t)),t}catch{return}}loadLocalMetadata(e){let t=dm.join(this.dir,`${e}.json`);return sI("READ %s",t),ca.readFileSync(t)}async loadRoot(){let t=this.trustedSet.root.signed.version+1,r=t+this.config.maxRootRotations;for(let s=t;s<r;s++){let n=Bu.join(this.metadataBaseUrl,`${s}.root.json`);try{let a=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(a),this.persistMetadata(Fi.MetadataKind.Root,a)}catch(a){if(a instanceof ln.DownloadHTTPError&&[403,404].includes(a.statusCode))break;throw a}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let s=this.loadLocalMetadata(Fi.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(s),!e)return}catch{}let t=Bu.join(this.metadataBaseUrl,"timestamp.json"),r=await this.fetcher.downloadBytes(t,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(r)}catch(s){if(s instanceof ln.EqualVersionError)return;throw s}this.persistMetadata(Fi.MetadataKind.Timestamp,r)}async loadSnapshot(){try{let e=this.loadLocalMetadata(Fi.MetadataKind.Snapshot);this.trustedSet.updateSnapshot(e,!0)}catch{if(!this.trustedSet.timestamp)throw new ReferenceError("No timestamp metadata");let t=this.trustedSet.timestamp.signed.snapshotMeta,r=t.length||this.config.snapshotMaxLength,s=this.trustedSet.root.signed.consistentSnapshot?t.version:void 0,n=Bu.join(this.metadataBaseUrl,s?`${s}.snapshot.json`:"snapshot.json");try{let a=await this.fetcher.downloadBytes(n,r);this.trustedSet.updateSnapshot(a),this.persistMetadata(Fi.MetadataKind.Snapshot,a)}catch(a){throw new ln.RuntimeError(`Unable to load snapshot metadata error ${a}`)}}}async loadTargets(e,t){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let r=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(r,e,t)}catch{if(!this.trustedSet.snapshot)throw new ReferenceError("No snapshot metadata");let s=this.trustedSet.snapshot.signed.meta[`${e}.json`],n=s.length||this.config.targetsMaxLength,a=this.trustedSet.root.signed.consistentSnapshot?s.version:void 0,c=encodeURIComponent(e),u=Bu.join(this.metadataBaseUrl,a?`${a}.${c}.json`:`${c}.json`);try{let l=await this.fetcher.downloadBytes(u,n);this.trustedSet.updateDelegatedTargets(l,e,t),this.persistMetadata(e,l)}catch(l){throw new ln.RuntimeError(`Unable to load targets error ${l}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let t=[{roleName:Fi.MetadataKind.Targets,parentRoleName:Fi.MetadataKind.Root}],r=new Set;for(;r.size<=this.config.maxDelegations&&t.length>0;){let{roleName:s,parentRoleName:n}=t.pop();if(r.has(s))continue;let a=(await this.loadTargets(s,n))?.signed;if(!a)continue;let c=a.targets?.[e];if(c)return c;if(r.add(s),a.delegations){let u=[],l=a.delegations.rolesForTarget(e);for(let{role:h,terminating:f}of l)if(u.push({roleName:h,parentRoleName:s}),f){t.splice(0);break}u.reverse(),t.push(...u)}}}generateTargetPath(e){if(!this.targetDir)throw new ln.ValueError("Target directory not set");let t=encodeURIComponent(e.path);return dm.join(this.targetDir,t)}persistMetadata(e,t){let r=encodeURIComponent(e);try{let s=dm.join(this.dir,`${r}.json`);sI("WRITE %s",s),ca.writeFileSync(s,t.toString("utf8"))}catch(s){throw new ln.PersistError(`Failed to persist metadata ${r} error: ${s}`)}}};zt.Updater=nI});var nj=d(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.Updater=ns.BaseFetcher=ns.TargetFile=void 0;var zae=om();Object.defineProperty(ns,"TargetFile",{enumerable:!0,get:o(function(){return zae.TargetFile},"get")});var Hae=tI();Object.defineProperty(ns,"BaseFetcher",{enumerable:!0,get:o(function(){return Hae.BaseFetcher},"get")});var Gae=sj();Object.defineProperty(ns,"Updater",{enumerable:!0,get:o(function(){return Gae.Updater},"get")})});var cI=d(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.TUFError=void 0;var aI=class extends Error{static{o(this,"TUFError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}};pm.TUFError=aI});var oj=d(ku=>{"use strict";var Wae=ku&&ku.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ku,"__esModule",{value:!0});ku.readTarget=Kae;var Jae=Wae(require("fs")),mm=cI();async function Kae(i,e){let t=await Zae(i,e);return new Promise((r,s)=>{Jae.default.readFile(t,"utf-8",(n,a)=>{n?s(new mm.TUFError({code:"TUF_READ_TARGET_ERROR",message:`error reading target ${t}`,cause:n})):r(a)})})}o(Kae,"readTarget");async function Zae(i,e){let t;try{t=await i.getTargetInfo(e)}catch(s){throw new mm.TUFError({code:"TUF_REFRESH_METADATA_ERROR",message:"error refreshing TUF metadata",cause:s})}if(!t)throw new mm.TUFError({code:"TUF_FIND_TARGET_ERROR",message:`target ${e} not found`});let r=await i.findCachedTarget(t);if(!r)try{r=await i.downloadTarget(t)}catch(s){throw new mm.TUFError({code:"TUF_DOWNLOAD_TARGET_ERROR",message:`error downloading target ${r}`,cause:s})}return r}o(Zae,"getTargetPath")});var aj=d((NIe,Yae)=>{Yae.exports={"https://tuf-repo-cdn.sigstore.dev":{"root.json":"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiIgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGJiZGRkNDY0ZjgwNjZjZWI4OGJhNzg3Mzc1YzEyY2Q2MzMwNjgwZTA4YzI5MTA3MDNlNjUzOGM3MWNjNzlhZDIwMjIwNTE5MGIwNmU0NTM3ZmU5NjFiM2VmODFmZTY4ZWRjZDAwODljMTlmOTE5YWZlZDQyM2I5YWFmZDcwMDY0MTE1MyIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAic2lnIjogIjMwNDQwMjIwNjkzMDZjZDUyNTdmNzMyYTc0MGMxYWZlNjBhOGU0MzNjNWRlNThlYWZlYWRiZTk5YzMzNmM5YzcxZDE5OGNmODAyMjAwZDc3Mzk1M2FlN2RiYzQ4ZDNlNWJhZDlhNmY2NGJhZmZmMTk2YjdlMmFkNGE1MmExOTUxOTM2N2Q0N2RjMDQyIgogIH0sCiAgewogICAia2V5aWQiOiAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICJzaWciOiAiMzA0NDAyMjA0ZDIxYTJlYzgwZGY2NmU2MWY2ZmUyOTEyOTUxZGM0N2RmODM2MDM2ZjhjMGFiMTA4MTZkMzc1ZTcxZGJmNzllMDIyMDU0N2FkY2UxYWZkZjA0ZTY3OTRlZmEyMDNkZDUyNjRjNmY3ZTBlZjc4ZTU3ZmU5MzRiMGQyNmNiOTk0ZWVjNzYiCiAgfSwKICB7CiAgICJrZXlpZCI6ICJhNjg3ZTViZjRmYWI4MmIwZWU1OGQ0NmUwNWM5NTM1MTQ1YTJjOWFmYjQ1OGY0M2Q0MmI0NWNhMGZkY2UyYTcwIiwKICAgInNpZyI6ICIzMDQ1MDIyMDYwODI2NDk2NTU3MTQ0ZWIxNjQ5ODkzZWQ1ZjZmNGVhNTQ1MzZmZWIwY2E4MmY4Yjg5YWU2NDFiZTM5NzQzZTUwMjIxMDBhZDcxMThiNWU5ZDQ4MzczMjYyMDZlNDEyZmM2ZGEyOTk5OTI1ZDExMDMyOGE3YzE2NmIwNmM2MjQzMzZjOTNmIgogIH0sCiAgewogICAia2V5aWQiOiAiMTgzZTY0ZjM3NjcwZGMxM2NhMGQyODk5NWEzMDUzZjM3NDA5NTRkZGNlNDQzMjFhNDFlNDY1MzRjZjQ0ZTYzMiIsCiAgICJzaWciOiAiMzA0NjAyMjEwMGQ4MTc5NDM5YzJlNzNlYjBjMTczM2FiZWU3ZmFmODMyZGNhZWE3MjYzZWRjYjQ5MTk4OTFjM2EyNDdmMDU5MjMwMjIxMDBlMWE0MzdlMDc5N2U4MDNmOWI3MmRjOWQyZDkyMTU1YjBhMjI3MGMyNGVmZGQ1ZjRiM2E1ZDhmMGIwZjQzMWE3IgogIH0KIF0sCiAic2lnbmVkIjogewogICJfdHlwZSI6ICJyb290IiwKICAiY29uc2lzdGVudF9zbmFwc2hvdCI6IHRydWUsCiAgImV4cGlyZXMiOiAiMjAyNi0wMS0yMlQxMzowNTo1OVoiLAogICJrZXlzIjogewogICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVdSaUdyNStqKzNKNVNzSCtadHI1bkUySDJ3TzdcbkJWK25PM3M5M2dMY2ExOHFUT3pIWTFvV3lBR0R5a01Tc0dUVUJTdDlEK0FuMEtmS3NEMm1mU000MlE9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1vbmxpbmUtdXJpIjogImdjcGttczpwcm9qZWN0cy9zaWdzdG9yZS1yb290LXNpZ25pbmcvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9yb290L2NyeXB0b0tleXMvdGltZXN0YW1wL2NyeXB0b0tleVZlcnNpb25zLzEiCiAgIH0sCiAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIjogewogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVNeHBQT0pDSVo1b3RHNDEwNmZHSnNlRVFpM1Y5XG5wa01ZUTR1eVY5VGoxTTdXSFhJeUxHK2prZnZ1RzBnbFExSlpiUlpaQlYzZ0FSNHNvamRHSElTZW93PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGxhbmNlIgogICB9LAogICAiMjJmNGNhZWM2ZDhlNmY5NTU1YWY2NmIzZDRjM2NiMDZhM2JiMjNmZGM3ZTM5YzkxNmM2MWY0NjJlNmY1MmIwNiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXpCelZPbUhDUG9qTVZMU0kzNjRXaWlWOE5QckRcbjZJZ1J4Vmxpc2t6L3YreTNKRVI1bWNWR2NPTmxpRGNXTUM1SjJsZkhtalBOUGhiNEg3eG04THpmU0E9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAc2FudGlhZ290b3JyZXMiCiAgIH0sCiAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIjogewogICAgImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6IFsKICAgICAic2hhMjU2IiwKICAgICAic2hhNTEyIgogICAgXSwKICAgICJrZXl0eXBlIjogImVjZHNhIiwKICAgICJrZXl2YWwiOiB7CiAgICAgInB1YmxpYyI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFaW5pa1NzQVFtWWtOZUg1ZVlxL0NuSXpMYWFjT1xueGxTYWF3UURPd3FLeS90Q3F4cTV4eFBTSmMyMUs0V0loczlHeU9rS2Z6dWVZM0dJTHpjTUpaNGNXdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS1cbiIKICAgIH0sCiAgICAic2NoZW1lIjogImVjZHNhLXNoYTItbmlzdHAyNTYiLAogICAgIngtdHVmLW9uLWNpLWtleW93bmVyIjogIkBib2JjYWxsYXdheSIKICAgfSwKICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiOiB7CiAgICAia2V5aWRfaGFzaF9hbGdvcml0aG1zIjogWwogICAgICJzaGEyNTYiLAogICAgICJzaGE1MTIiCiAgICBdLAogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUwZ2hyaDkyTHcxWXIzaWRHVjVXcUN0TURCOEN4XG4rRDhoZEM0dzJaTE5JcGxWUm9WR0xza1lhM2doZU15T2ppSjhrUGkxNWFRMi8vN1Arb2o3VXZKUEd3PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGpvc2h1YWdsIgogICB9LAogICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUVYc3ozU1pYRmI4ak1WNDJqNnBKbHlqYmpSOEtcbk4zQndvY2V4cTZMTUliNXFzV0tPUXZMTjE2TlVlZkxjNEhzd09vdW1Sc1ZWYWFqU3BRUzZmb2JrUnc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAbW5tNjc4IgogICB9CiAgfSwKICAicm9sZXMiOiB7CiAgICJyb290IjogewogICAgImtleWlkcyI6IFsKICAgICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICAgIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIiwKICAgICAiYTY4N2U1YmY0ZmFiODJiMGVlNThkNDZlMDVjOTUzNTE0NWEyYzlhZmI0NThmNDNkNDJiNDVjYTBmZGNlMmE3MCIsCiAgICAgIjE4M2U2NGYzNzY3MGRjMTNjYTBkMjg5OTVhMzA1M2YzNzQwOTU0ZGRjZTQ0MzIxYTQxZTQ2NTM0Y2Y0NGU2MzIiCiAgICBdLAogICAgInRocmVzaG9sZCI6IDMKICAgfSwKICAgInNuYXBzaG90IjogewogICAgImtleWlkcyI6IFsKICAgICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSIKICAgIF0sCiAgICAidGhyZXNob2xkIjogMSwKICAgICJ4LXR1Zi1vbi1jaS1leHBpcnktcGVyaW9kIjogMzY1MCwKICAgICJ4LXR1Zi1vbi1jaS1zaWduaW5nLXBlcmlvZCI6IDM2NQogICB9LAogICAidGFyZ2V0cyI6IHsKICAgICJrZXlpZHMiOiBbCiAgICAgImU3MWE1NGQ1NDM4MzViYTg2YWRhZDk0NjAzNzljNzY0MWZiODcyNmQxNjRlYTc2NjgwMWExYzUyMmFiYTdlYTIiLAogICAgICIyMmY0Y2FlYzZkOGU2Zjk1NTVhZjY2YjNkNGMzY2IwNmEzYmIyM2ZkYzdlMzljOTE2YzYxZjQ2MmU2ZjUyYjA2IiwKICAgICAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiLAogICAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAzCiAgIH0sCiAgICJ0aW1lc3RhbXAiOiB7CiAgICAia2V5aWRzIjogWwogICAgICIwYzg3NDMyYzNiZjA5ZmQ5OTE4OWZkYzMyZmE1ZWFlZGY0ZTRhNWZhYzdiYWI3M2ZhMDRhMmUwZmM2NGFmNmY1IgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAxLAogICAgIngtdHVmLW9uLWNpLWV4cGlyeS1wZXJpb2QiOiA3LAogICAgIngtdHVmLW9uLWNpLXNpZ25pbmctcGVyaW9kIjogNgogICB9CiAgfSwKICAic3BlY192ZXJzaW9uIjogIjEuMCIsCiAgInZlcnNpb24iOiAxMywKICAieC10dWYtb24tY2ktZXhwaXJ5LXBlcmlvZCI6IDE5NywKICAieC10dWYtb24tY2ktc2lnbmluZy1wZXJpb2QiOiA0NgogfQp9",targets:{"trusted_root.json":"ewogICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRldi5zaWdzdG9yZS50cnVzdGVkcm9vdCtqc29uO3ZlcnNpb249MC4xIiwKICAidGxvZ3MiOiBbCiAgICB7CiAgICAgICJiYXNlVXJsIjogImh0dHBzOi8vcmVrb3Iuc2lnc3RvcmUuZGV2IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUyRzJZKzJ0YWJkVFY1QmNHaUJJeDBhOWZBRndya0JibUxTR3RrczRMM3FYNnlZWTB6dWZCbmhDOFVyL2l5NTVHaFdQLzlBL2JZMkxoQzMwTTkrUll0dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDEtMTJUMTE6NTM6MjdaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJ3Tkk5YXRRR2x6K1ZXZk82TFJ5Z0g0UVVmWS84VzRSRndpVDVpNVdSZ0IwPSIKICAgICAgfQogICAgfQogIF0sCiAgImNlcnRpZmljYXRlQXV0aG9yaXRpZXMiOiBbCiAgICB7CiAgICAgICJzdWJqZWN0IjogewogICAgICAgICJvcmdhbml6YXRpb24iOiAic2lnc3RvcmUuZGV2IiwKICAgICAgICAiY29tbW9uTmFtZSI6ICJzaWdzdG9yZSIKICAgICAgfSwKICAgICAgInVyaSI6ICJodHRwczovL2Z1bGNpby5zaWdzdG9yZS5kZXYiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCK0RDQ0FYNmdBd0lCQWdJVE5Wa0Rab0Npb2ZQRHN5N2RmbTZnZUxidWh6QUtCZ2dxaGtqT1BRUURBekFxTVJVd0V3WURWUVFLRXd4emFXZHpkRzl5WlM1a1pYWXhFVEFQQmdOVkJBTVRDSE5wWjNOMGIzSmxNQjRYRFRJeE1ETXdOekF6TWpBeU9Wb1hEVE14TURJeU16QXpNakF5T1Zvd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRCMk1CQUdCeXFHU000OUFnRUdCU3VCQkFBaUEySUFCTFN5QTdJaTVrK3BOTzhaRVdZMHlsZW1XRG93T2tOYTNrTCtHWkU1WjVHV2VoTDkvQTliUk5BM1JicnNaNWkwSmNhc3RhUkw3U3A1ZnAvakQ1ZHhxYy9VZFRWbmx2UzE2YW4rMllmc3dlL1F1TG9sUlVDcmNPRTIrMmlBNSt0emQ2Tm1NR1F3RGdZRFZSMFBBUUgvQkFRREFnRUdNQklHQTFVZEV3RUIvd1FJTUFZQkFmOENBUUV3SFFZRFZSME9CQllFRk1qRkhRQkJtaVFwTWxFazZ3MnVTdTFLQnRQc01COEdBMVVkSXdRWU1CYUFGTWpGSFFCQm1pUXBNbEVrNncydVN1MUtCdFBzTUFvR0NDcUdTTTQ5QkFNREEyZ0FNR1VDTUg4bGlXSmZNdWk2dlhYQmhqRGdZNE13c2xtTi9USnhWZS84M1dyRm9td21OZjA1NnkxWDQ4RjljNG0zYTNvelhBSXhBS2pSYXk1L2FqL2pzS0tHSWttUWF0akk4dXVwSHIvK0N4RnZhSldtcFlxTmtMREdSVSs5b3J6aDVoSTJScmN1YVE9PSIKICAgICAgICAgIH0KICAgICAgICBdCiAgICAgIH0sCiAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAic3RhcnQiOiAiMjAyMS0wMy0wN1QwMzoyMDoyOVoiLAogICAgICAgICJlbmQiOiAiMjAyMi0xMi0zMVQyMzo1OTo1OS45OTlaIgogICAgICB9CiAgICB9LAogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly9mdWxjaW8uc2lnc3RvcmUuZGV2IiwKICAgICAgImNlcnRDaGFpbiI6IHsKICAgICAgICAiY2VydGlmaWNhdGVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAicmF3Qnl0ZXMiOiAiTUlJQ0dqQ0NBYUdnQXdJQkFnSVVBTG5WaVZmblUwYnJKYXNtUmtIcm4vVW5mYVF3Q2dZSUtvWkl6ajBFQXdNd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRBZUZ3MHlNakEwTVRNeU1EQTJNVFZhRncwek1URXdNRFV4TXpVMk5UaGFNRGN4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWVNQndHQTFVRUF4TVZjMmxuYzNSdmNtVXRhVzUwWlhKdFpXUnBZWFJsTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU4UlZTL3lzSCtOT3Z1RFp5UEladGlsZ1VGOU5sYXJZcEFkOUhQMXZCQkgxVTVDVjc3TFNTN3MwWmlING5FN0h2N3B0UzZMdnZSL1NUazc5OExWZ016TGxKNEhlSWZGM3RIU2FleExjWXBTQVNyMWtTME4vUmdCSnovOWpXQ2lYbm8zc3dlVEFPQmdOVkhROEJBZjhFQkFNQ0FRWXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd013RWdZRFZSMFRBUUgvQkFnd0JnRUIvd0lCQURBZEJnTlZIUTRFRmdRVTM5UHB6MVlrRVpiNXFOanBLRldpeGk0WVpEOHdId1lEVlIwakJCZ3dGb0FVV01BZVg1RkZwV2FwZXN5UW9aTWkwQ3JGeGZvd0NnWUlLb1pJemowRUF3TURad0F3WkFJd1BDc1FLNERZaVpZRFBJYURpNUhGS25meFh4NkFTU1ZtRVJmc3luWUJpWDJYNlNKUm5aVTg0LzlEWmRuRnZ2eG1BakJPdDZRcEJsYzRKLzBEeHZrVENxcGNsdnppTDZCQ0NQbmpkbElCM1B1M0J4c1BteWdVWTdJaTJ6YmRDZGxpaW93PSIKICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCOXpDQ0FYeWdBd0lCQWdJVUFMWk5BUEZkeEhQd2plRGxvRHd5WUNoQU8vNHdDZ1lJS29aSXpqMEVBd013S2pFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUkV3RHdZRFZRUURFd2h6YVdkemRHOXlaVEFlRncweU1URXdNRGN4TXpVMk5UbGFGdzB6TVRFd01EVXhNelUyTlRoYU1Db3hGVEFUQmdOVkJBb1RESE5wWjNOMGIzSmxMbVJsZGpFUk1BOEdBMVVFQXhNSWMybG5jM1J2Y21Vd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVQ3WGVGVDRyYjNQUUd3UzRJYWp0TGszL09sbnBnYW5nYUJjbFlwc1lCcjVpKzR5bkIwN2NlYjNMUDBPSU9aZHhleFg2OWM1aVZ1eUpSUStIejA1eWkrVUYzdUJXQWxIcGlTNXNoMCtIMkdIRTdTWHJrMUVDNW0xVHIxOUw5Z2c5MmpZekJoTUE0R0ExVWREd0VCL3dRRUF3SUJCakFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlJZd0I1ZmtVV2xacWw2ekpDaGt5TFFLc1hGK2pBZkJnTlZIU01FR0RBV2dCUll3QjVma1VXbFpxbDZ6SkNoa3lMUUtzWEYrakFLQmdncWhrak9QUVFEQXdOcEFEQm1BakVBajFuSGVYWnArMTNOV0JOYStFRHNEUDhHMVdXZzF0Q01XUC9XSFBxcGFWbzBqaHN3ZU5GWmdTczBlRTd3WUk0cUFqRUEyV0I5b3Q5OHNJa29GM3ZaWWRkMy9WdFdCNWI5VE5NZWE3SXgvc3RKNVRmY0xMZUFCTEU0Qk5KT3NRNHZuQkhKIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIyLTA0LTEzVDIwOjA2OjE1WiIKICAgICAgfQogICAgfQogIF0sCiAgImN0bG9ncyI6IFsKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi90ZXN0IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUViZndSK1JKdWRYc2NnUkJScEtYMVhGRHkzUHl1ZER4ei9TZm5SaTFmVDhla3BmQmQyTzF1b3o3anIzWjhuS3p4QTY5RVVRK2VGQ0ZJM3pldWJQV1U3dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDMtMTRUMDA6MDA6MDBaIiwKICAgICAgICAgICJlbmQiOiAiMjAyMi0xMC0zMVQyMzo1OTo1OS45OTlaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJDR0NTOENoUy8yaEYwZEZySjRTY1JXY1lyQlk5d3pqU2JlYThJZ1kyYjNJPSIKICAgICAgfQogICAgfSwKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi8yMDIyIiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVpUFNsRmkwQ21GVGZFakNVcUY5SHVDRWNZWE5LQWFZYWxJSm1CWjh5eWV6UGpUcWh4cktCcE1uYW9jVnRMSkJJMWVNM3VYblF6UUdBSmRKNGdzOUZ5dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjItMTAtMjBUMDA6MDA6MDBaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICIzVDB3YXNiSEVUSmpHUjRjbVdjM0FxSktYcmplUEszL2g0cHlnQzhwN280PSIKICAgICAgfQogICAgfQogIF0sCiAgInRpbWVzdGFtcEF1dGhvcml0aWVzIjogWwogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUtdHNhLXNlbGZzaWduZWQiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly90aW1lc3RhbXAuc2lnc3RvcmUuZGV2L2FwaS92MS90aW1lc3RhbXAiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlDRURDQ0FaYWdBd0lCQWdJVU9oTlVMd3lRWWU2OHdVTXZ5NHFPaXlvaml3d3dDZ1lJS29aSXpqMEVBd013T1RFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNU0F3SGdZRFZRUURFeGR6YVdkemRHOXlaUzEwYzJFdGMyVnNabk5wWjI1bFpEQWVGdzB5TlRBME1EZ3dOalU1TkROYUZ3MHpOVEEwTURZd05qVTVORE5hTUM0eEZUQVRCZ05WQkFvVERITnBaM04wYjNKbExtUmxkakVWTUJNR0ExVUVBeE1NYzJsbmMzUnZjbVV0ZEhOaE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFNHJhMlo4aEtOaWcyVDlrRmpDQVRvR0czMGpreStXUXYzQnpMK21LdmgxU0tOUi9Vd3V3c2ZOQ2c0c3J5b1lBZDhFNmlzb3ZWQTNNNGFvTmRtOVFEaTUwWjhuVEV5dnFnZkRQdFRJd1hJdGZpVy9BRmYxVjd1d2tia0FvajB4eGNvMm93YURBT0JnTlZIUThCQWY4RUJBTUNCNEF3SFFZRFZSME9CQllFRkluOWVVT0h6OUJsUnNNQ1JzY3NjMXQ5dE9zRE1COEdBMVVkSXdRWU1CYUFGSmpzQWU5L3UxSC8xSlVlYjRxSW1GTUhpYzYvTUJZR0ExVWRKUUVCL3dRTU1Bb0dDQ3NHQVFVRkJ3TUlNQW9HQ0NxR1NNNDlCQU1EQTJnQU1HVUNNRHRwc1YvNkthTzBxeUYvVU1zWDJhU1VYS1FGZG9HVHB0UUdjMGZ0cTFjc3VsSFBHRzZkc215TU5kM0pCK0czRVFJeEFPYWp2QmNqcEptS2I0TnYrMlRhb2o4VWM1K2I2aWg2RlhDQ0tyYVNxdXBlMDd6cXN3TWNYSlRlMWNFeHZIdnZsdz09IgogICAgICAgICAgfSwKICAgICAgICAgIHsKICAgICAgICAgICAgInJhd0J5dGVzIjogIk1JSUI5ekNDQVh5Z0F3SUJBZ0lVVjdmMEdMRE9vRXpJaDhMWFNXODBPSmlVcDE0d0NnWUlLb1pJemowRUF3TXdPVEVWTUJNR0ExVUVDaE1NYzJsbmMzUnZjbVV1WkdWMk1TQXdIZ1lEVlFRREV4ZHphV2R6ZEc5eVpTMTBjMkV0YzJWc1puTnBaMjVsWkRBZUZ3MHlOVEEwTURnd05qVTVORE5hRncwek5UQTBNRFl3TmpVNU5ETmFNRGt4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWdNQjRHQTFVRUF4TVhjMmxuYzNSdmNtVXRkSE5oTFhObGJHWnphV2R1WldRd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVFVUU50ZlJUL291M1lBVGE2d0Iva0tUZTcwY2ZKd3lSSUJvdk1udDhSY0pwaC9DT0U4MnV5UzZGbXBwTExMMVZCUEdjUGZwUVBZSk5Yeld3aThpY3doS1E2Vy9RZTJoM29lYkJiMkZIcHdOSkRxbytUTWFDL3RkZmt2L0VsSkI3MmpSVEJETUE0R0ExVWREd0VCL3dRRUF3SUJCakFTQmdOVkhSTUJBZjhFQ0RBR0FRSC9BZ0VBTUIwR0ExVWREZ1FXQkJTWTdBSHZmN3RSLzlTVkhtK0tpSmhUQjRuT3Z6QUtCZ2dxaGtqT1BRUURBd05wQURCbUFqRUF3R0VHcmZHWlIxY2VuMVI4L0RUVk1JOTQzTHNzWm1KUnREcC9pN1NmR0htR1JQNmdSYnVqOXZPSzNiNjdaMFFRQWpFQXVUMkg2NzNMUUVhSFRjeVFTWnJrcDRtWDdXd2ttRitzVmJrWVk1bVhOK1JNSDEzS1VFSEhPcUFTYWVtWVdLL0UiCiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9LAogICAgICAidmFsaWRGb3IiOiB7CiAgICAgICAgInN0YXJ0IjogIjIwMjUtMDctMDRUMDA6MDA6MDBaIgogICAgICB9CiAgICB9CiAgXQp9Cg==","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}});var uj=d(ua=>{"use strict";var cj=ua&&ua.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ua,"__esModule",{value:!0});ua.TUFClient=void 0;var os=cj(require("fs")),Fu=cj(require("path")),Xae=nj(),Qae=gm(),ece=oj(),lI="targets",uI=class{static{o(this,"TUFClient")}constructor(e){let t=new URL(e.mirrorURL),r=encodeURIComponent(t.host+t.pathname.replace(/\/$/,"")),s=Fu.default.join(e.cachePath,r);tce(s),ice({cachePath:s,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=rce({mirrorURL:e.mirrorURL,cachePath:s,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,ece.readTarget)(this.updater,e)}};ua.TUFClient=uI;function tce(i){let e=Fu.default.join(i,lI);os.default.existsSync(i)||os.default.mkdirSync(i,{recursive:!0}),os.default.existsSync(e)||os.default.mkdirSync(e)}o(tce,"initTufCache");function ice({cachePath:i,mirrorURL:e,tufRootPath:t,forceInit:r}){let s=Fu.default.join(i,"root.json");if(!os.default.existsSync(s)||r)if(t)os.default.copyFileSync(t,s);else{let a=aj()[e];if(!a)throw new Qae.TUFError({code:"TUF_INIT_CACHE_ERROR",message:`No root.json found for mirror: ${e}`});os.default.writeFileSync(s,Buffer.from(a["root.json"],"base64")),Object.entries(a.targets).forEach(([c,u])=>{os.default.writeFileSync(Fu.default.join(i,lI,c),Buffer.from(u,"base64"))})}}o(ice,"seedCache");function rce(i){let e={fetchTimeout:i.timeout,fetchRetry:i.retry};return new Xae.Updater({metadataBaseUrl:i.mirrorURL,targetBaseUrl:`${i.mirrorURL}/targets`,metadataDir:i.cachePath,targetDir:Fu.default.join(i.cachePath,lI),forceCache:i.forceCache,config:e})}o(rce,"initClient")});var gm=d(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.TUFError=mr.DEFAULT_MIRROR_URL=void 0;mr.getTrustedRoot=hce;mr.initTUF=fce;var sce=fu(),nce=KF(),oce=uj();mr.DEFAULT_MIRROR_URL="https://tuf-repo-cdn.sigstore.dev";var ace="sigstore-js",cce={retries:2},uce=5e3,lce="trusted_root.json";async function hce(i={}){let t=await lj(i).getTarget(lce);return sce.TrustedRoot.fromJSON(JSON.parse(t))}o(hce,"getTrustedRoot");async function fce(i={}){let e=lj(i);return e.refresh().then(()=>e)}o(fce,"initTUF");function lj(i){return new oce.TUFClient({cachePath:i.cachePath||(0,nce.appDataPath)(ace),rootPath:i.rootPath,mirrorURL:i.mirrorURL||mr.DEFAULT_MIRROR_URL,retry:i.retry??cce,timeout:i.timeout??uce,forceCache:i.forceCache??!1,forceInit:i.forceInit??i.force??!1})}o(lj,"createClient");var dce=cI();Object.defineProperty(mr,"TUFError",{enumerable:!0,get:o(function(){return dce.TUFError},"get")})});var hj=d(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.DSSESignatureContent=void 0;var Uu=ut(),hI=class{static{o(this,"DSSESignatureContent")}constructor(e){this.env=e}compareDigest(e){return Uu.crypto.bufferEqual(e,Uu.crypto.digest("sha256",this.env.payload))}compareSignature(e){return Uu.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Uu.crypto.verify(this.preAuthEncoding,e,this.signature)}get signature(){return this.env.signatures.length>0?this.env.signatures[0].sig:Buffer.from("")}get preAuthEncoding(){return Uu.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};ym.DSSESignatureContent=hI});var fj=d(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.MessageSignatureContent=void 0;var fI=ut(),dI=class{static{o(this,"MessageSignatureContent")}constructor(e,t){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=t}compareSignature(e){return fI.crypto.bufferEqual(e,this.signature)}compareDigest(e){return fI.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return fI.crypto.verify(this.artifact,e,this.signature)}};Sm.MessageSignatureContent=dI});var pj=d(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.toSignedEntity=gce;Em.signatureContent=dj;var pI=ut(),pce=hj(),mce=fj();function gce(i,e){let{tlogEntries:t,timestampVerificationData:r}=i.verificationMaterial,s=[];for(let n of t)s.push({$case:"transparency-log",tlogEntry:n});for(let n of r?.rfc3161Timestamps??[])s.push({$case:"timestamp-authority",timestamp:pI.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:dj(i,e),key:yce(i),tlogEntries:t,timestamps:s}}o(gce,"toSignedEntity");function dj(i,e){switch(i.content.$case){case"dsseEnvelope":return new pce.DSSESignatureContent(i.content.dsseEnvelope);case"messageSignature":return new mce.MessageSignatureContent(i.content.messageSignature,e)}}o(dj,"signatureContent");function yce(i){switch(i.verificationMaterial.content.$case){case"publicKey":return{$case:"public-key",hint:i.verificationMaterial.content.publicKey.hint};case"x509CertificateChain":return{$case:"certificate",certificate:pI.X509Certificate.parse(i.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case"certificate":return{$case:"certificate",certificate:pI.X509Certificate.parse(i.verificationMaterial.content.certificate.rawBytes)}}}o(yce,"key")});var xe=d(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.PolicyError=la.VerificationError=void 0;var wm=class extends Error{static{o(this,"BaseError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}},mI=class extends wm{static{o(this,"VerificationError")}};la.VerificationError=mI;var gI=class extends wm{static{o(this,"PolicyError")}};la.PolicyError=gI});var mj=d(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.filterCertAuthorities=Sce;_m.filterTLogAuthorities=Ece;function Sce(i,e){return i.filter(t=>t.validFor.start<=e&&t.validFor.end>=e)}o(Sce,"filterCertAuthorities");function Ece(i,e){return i.filter(t=>e.logID&&!t.logID.equals(e.logID)?!1:t.validFor.start<=e.targetDate&&e.targetDate<=t.validFor.end)}o(Ece,"filterTLogAuthorities")});var fn=d(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.filterTLogAuthorities=hn.filterCertAuthorities=void 0;hn.toTrustMaterial=_ce;var yI=ut(),ju=fu(),wce=xe(),SI=new Date(0),EI=new Date(864e13),Sj=mj();Object.defineProperty(hn,"filterCertAuthorities",{enumerable:!0,get:o(function(){return Sj.filterCertAuthorities},"get")});Object.defineProperty(hn,"filterTLogAuthorities",{enumerable:!0,get:o(function(){return Sj.filterTLogAuthorities},"get")});function _ce(i,e){let t=typeof e=="function"?e:bce(e);return{certificateAuthorities:i.certificateAuthorities.map(yj),timestampAuthorities:i.timestampAuthorities.map(yj),tlogs:i.tlogs.map(gj),ctlogs:i.ctlogs.map(gj),publicKey:t}}o(_ce,"toTrustMaterial");function gj(i){let e=i.publicKey.keyDetails,t=e===ju.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===ju.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===ju.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===ju.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===ju.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?"pkcs1":"spki";return{logID:i.logId.keyId,publicKey:yI.crypto.createPublicKey(i.publicKey.rawBytes,t),validFor:{start:i.publicKey.validFor?.start||SI,end:i.publicKey.validFor?.end||EI}}}o(gj,"createTLogAuthority");function yj(i){return{certChain:i.certChain.certificates.map(e=>yI.X509Certificate.parse(e.rawBytes)),validFor:{start:i.validFor?.start||SI,end:i.validFor?.end||EI}}}o(yj,"createCertAuthority");function bce(i){return e=>{let t=(i||{})[e];if(!t)throw new wce.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:yI.crypto.createPublicKey(t.rawBytes),validFor:o(r=>(t.validFor?.start||SI)<=r&&(t.validFor?.end||EI)>=r,"validFor")}}}o(bce,"keyLocator")});var wI=d($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.CertificateChainVerifier=void 0;$u.verifyCertificateChain=Oce;var as=xe(),Ice=fn();function Oce(i,e,t){let r=(0,Ice.filterCertAuthorities)(t,i),s;for(let n of r)try{return new bm({trustedCerts:n.certChain,untrustedCert:e,timestamp:i}).verify()}catch(a){s=a}throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"Failed to verify certificate chain",cause:s})}o(Oce,"verifyCertificateChain");var bm=class{static{o(this,"CertificateChainVerifier")}constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=vce([...e.trustedCerts,e.untrustedCert]),this.timestamp=e.timestamp}verify(){let e=this.sort();if(this.checkPath(e),!e.every(r=>r.validForDate(this.timestamp)))throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate is not valid or expired at the specified date"});return e}sort(){let e=this.untrustedCert,t=this.buildPaths(e);if(t=t.filter(s=>s.some(n=>this.trustedCerts.includes(n))),t.length===0)throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"no trusted certificate path found"});let r=t.reduce((s,n)=>s.length<n.length?s:n);return[e,...r].slice(0,-1)}buildPaths(e){let t=[],r=this.findIssuer(e);if(r.length===0)throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"no valid certificate path found"});for(let s=0;s<r.length;s++){let n=r[s];if(n.equals(e)){t.push([e]);continue}let a=this.buildPaths(n);for(let c=0;c<a.length;c++)t.push([n,...a[c]])}return t}findIssuer(e){let t=[],r;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(r=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(s=>{if(r&&s.extSubjectKeyID){s.extSubjectKeyID.keyIdentifier.equals(r)&&t.push(s);return}s.subject.equals(e.issuer)&&t.push(s)}),t=t.filter(s=>{try{return e.verify(s)}catch{return!1}}),t)}checkPath(e){if(e.length<1)throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate chain must contain at least one certificate"});if(!e.slice(1).every(r=>r.isCA))throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"intermediate certificate is not a CA"});for(let r=e.length-2;r>=0;r--)if(!e[r].issuer.equals(e[r+1].subject))throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"incorrect certificate name chaining"});for(let r=0;r<e.length;r++){let s=e[r];if(s.extBasicConstraints?.isCA){let n=s.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<r-1)throw new as.VerificationError({code:"CERTIFICATE_ERROR",message:"path length constraint exceeded"})}}}};$u.CertificateChainVerifier=bm;function vce(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)i[e].equals(i[t])&&(i.splice(t,1),t--);return i}o(vce,"dedupeCertificates")});var Ej=d(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});_I.verifySCTs=Ace;var Im=ut(),Cce=xe(),Rce=fn();function Ace(i,e,t){let r,s=i.clone();for(let u=0;u<s.extensions.length;u++){let l=s.extensions[u];if(l.subs[0].toOID()===Im.EXTENSION_OID_SCT){r=new Im.X509SCTExtension(l),s.extensions.splice(u,1);break}}if(!r)return[];if(r.signedCertificateTimestamps.length===0)return[];let n=new Im.ByteStream,a=Im.crypto.digest("sha256",e.publicKey);n.appendView(a);let c=s.tbsCertificate.toDER();return n.appendUint24(c.length),n.appendView(c),r.signedCertificateTimestamps.map(u=>{if(!(0,Rce.filterTLogAuthorities)(t,{logID:u.logID,targetDate:u.datetime}).some(f=>u.verify(n.buffer,f.publicKey)))throw new Cce.VerificationError({code:"CERTIFICATE_ERROR",message:"SCT verification failed"});return u.logID})}o(Ace,"verifySCTs")});var wj=d(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.verifyPublicKey=Mce;Om.verifyCertificate=Bce;var Tce=ut(),Nce=xe(),Pce=wI(),Dce=Ej(),xce="1.3.6.1.4.1.57264.1.1",Lce="1.3.6.1.4.1.57264.1.8";function Mce(i,e,t){let r=t.publicKey(i);return e.forEach(s=>{if(!r.validFor(s))throw new Nce.VerificationError({code:"PUBLIC_KEY_ERROR",message:`Public key is not valid for timestamp: ${s.toISOString()}`})}),{key:r.publicKey}}o(Mce,"verifyPublicKey");function Bce(i,e,t){let r=[];return e.forEach(s=>{r=(0,Pce.verifyCertificateChain)(s,i,t.certificateAuthorities)}),{scts:(0,Dce.verifySCTs)(r[0],r[1],t.ctlogs),signer:kce(r[0])}}o(Bce,"verifyCertificate");function kce(i){let e,t=i.extension(Lce);t?e=t.valueObj.subs?.[0]?.value.toString("ascii"):e=i.extension(xce)?.value.toString("ascii");let r={extensions:{issuer:e},subjectAlternativeName:i.subjectAltName};return{key:Tce.crypto.createPublicKey(i.publicKey),identity:r}}o(kce,"getSigner")});var bj=d(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.verifySubjectAlternativeName=Fce;vm.verifyExtensions=Uce;var _j=xe();function Fce(i,e){if(e===void 0||!e.match(i))throw new _j.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`certificate identity error - expected ${i}, got ${e}`})}o(Fce,"verifySubjectAlternativeName");function Uce(i,e={}){let t;for(t in i)if(e[t]!==i[t])throw new _j.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`invalid certificate extension - expected ${t}=${i[t]}, got ${t}=${e[t]}`})}o(Uce,"verifyExtensions")});var Ij=d(CI=>{"use strict";Object.defineProperty(CI,"__esModule",{value:!0});CI.verifyCheckpoint=qce;var II=ut(),ha=xe(),jce=fn(),bI=`
|
|
60
|
+
>>> no match, partial?`,e,p,t,m),p===u))}let g;if(typeof h=="string"?(g=f===h,this.debug("string match",h,f,g)):(g=h.test(f),this.debug("pattern match",h,f,g)),!g)return!1}if(a===u&&c===l)return!0;if(a===u)return r;if(c===l)return a===u-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return(0,T.braceExpand)(this.pattern,this.options)}parse(e){(0,Fp.assertValidPattern)(e);let t=this.options;if(e==="**")return T.GLOBSTAR;if(e==="")return"";let r,s=null;(r=e.match(_ne))?s=t.dot?Ine:bne:(r=e.match(hne))?s=(t.nocase?t.dot?mne:pne:t.dot?dne:fne)(r[1]):(r=e.match(One))?s=(t.nocase?t.dot?Rne:vne:t.dot?Ane:Tne)(r):(r=e.match(gne))?s=t.dot?Sne:yne:(r=e.match(Ene))&&(s=wne);let n=cU.AST.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?Nne:t.dot?Pne:Dne,s=new Set(t.nocase?["i"]:[]),n=e.map(u=>{let l=u.map(h=>{if(h instanceof RegExp)for(let f of h.flags.split(""))s.add(f);return typeof h=="string"?Fne(h):h===T.GLOBSTAR?T.GLOBSTAR:h._src});return l.forEach((h,f)=>{let p=l[f+1],m=l[f-1];h!==T.GLOBSTAR||m===T.GLOBSTAR||(m===void 0?p!==void 0&&p!==T.GLOBSTAR?l[f+1]="(?:\\/|"+r+"\\/)?"+p:l[f]=r:p===void 0?l[f-1]=m+"(?:\\/|"+r+")?":p!==T.GLOBSTAR&&(l[f-1]=m+"(?:\\/|\\/"+r+"\\/)"+p,l[f+1]=T.GLOBSTAR))}),l.filter(h=>h!==T.GLOBSTAR).join("/")}).join("|"),[a,c]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+c+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<n.length;c++){let u=n[c],l=s;if(r.matchBase&&u.length===1&&(l=[a]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return T.minimatch.defaults(e).Minimatch}};T.Minimatch=tn;var Une=n0();Object.defineProperty(T,"AST",{enumerable:!0,get:o(function(){return Une.AST},"get")});var jne=o0();Object.defineProperty(T,"escape",{enumerable:!0,get:o(function(){return jne.escape},"get")});var $ne=xp();Object.defineProperty(T,"unescape",{enumerable:!0,get:o(function(){return $ne.unescape},"get")});T.minimatch.AST=cU.AST;T.minimatch.Minimatch=tn;T.minimatch.escape=cne.escape;T.minimatch.unescape=une.unescape});var u0=d(Ut=>{"use strict";var dU=Ut&&Ut.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.SuccinctRoles=Ut.DelegatedRole=Ut.Role=Ut.TOP_LEVEL_ROLE_NAMES=void 0;var pU=dU(require("crypto")),qne=fU(),Up=dU(require("util")),jp=xi(),rn=ei();Ut.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var Ou=class i{static{o(this,"Role")}keyIDs;threshold;unrecognizedFields;constructor(e){let{keyIDs:t,threshold:r,unrecognizedFields:s}=e;if(Vne(t))throw new jp.ValueError("duplicate key IDs found");if(r<1)throw new jp.ValueError("threshold must be at least 1");this.keyIDs=t,this.threshold=r,this.unrecognizedFields=s||{}}equals(e){return e instanceof i?this.threshold===e.threshold&&Up.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&Up.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:t,threshold:r,...s}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array");if(typeof r!="number")throw new TypeError("threshold must be a number");return new i({keyIDs:t,threshold:r,unrecognizedFields:s})}};Ut.Role=Ou;function Vne(i){return new Set(i).size!==i.length}o(Vne,"hasDuplicates");var a0=class i extends Ou{static{o(this,"DelegatedRole")}name;terminating;paths;pathHashPrefixes;constructor(e){super(e);let{name:t,terminating:r,paths:s,pathHashPrefixes:n}=e;if(this.name=t,this.terminating=r,e.paths&&e.pathHashPrefixes)throw new jp.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=s,this.pathHashPrefixes=n}equals(e){return e instanceof i?super.equals(e)&&this.name===e.name&&this.terminating===e.terminating&&Up.default.isDeepStrictEqual(this.paths,e.paths)&&Up.default.isDeepStrictEqual(this.pathHashPrefixes,e.pathHashPrefixes):!1}isDelegatedPath(e){if(this.paths)return this.paths.some(t=>Hne(e,t));if(this.pathHashPrefixes){let r=pU.default.createHash("sha256").update(e).digest("hex");return this.pathHashPrefixes.some(s=>r.startsWith(s))}return!1}toJSON(){let e={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(e.paths=this.paths),this.pathHashPrefixes&&(e.path_hash_prefixes=this.pathHashPrefixes),e}static fromJSON(e){let{keyids:t,threshold:r,name:s,terminating:n,paths:a,path_hash_prefixes:c,...u}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="number")throw new TypeError("threshold must be a number");if(typeof s!="string")throw new TypeError("name must be a string");if(typeof n!="boolean")throw new TypeError("terminating must be a boolean");if(rn.guard.isDefined(a)&&!rn.guard.isStringArray(a))throw new TypeError("paths must be an array of strings");if(rn.guard.isDefined(c)&&!rn.guard.isStringArray(c))throw new TypeError("path_hash_prefixes must be an array of strings");return new i({keyIDs:t,threshold:r,name:s,terminating:n,paths:a,pathHashPrefixes:c,unrecognizedFields:u})}};Ut.DelegatedRole=a0;var zne=o((i,e)=>i.map((t,r)=>[t,e[r]]),"zip");function Hne(i,e){let t=i.split("/"),r=e.split("/");return r.length!=t.length?!1:zne(t,r).every(([s,n])=>(0,qne.minimatch)(s,n))}o(Hne,"isTargetInPathPattern");var c0=class i extends Ou{static{o(this,"SuccinctRoles")}bitLength;namePrefix;numberOfBins;suffixLen;constructor(e){super(e);let{bitLength:t,namePrefix:r}=e;if(t<=0||t>32)throw new jp.ValueError("bitLength must be between 1 and 32");this.bitLength=t,this.namePrefix=r,this.numberOfBins=Math.pow(2,t),this.suffixLen=(this.numberOfBins-1).toString(16).length}equals(e){return e instanceof i?super.equals(e)&&this.bitLength===e.bitLength&&this.namePrefix===e.namePrefix:!1}getRoleForTarget(e){let s=pU.default.createHash("sha256").update(e).digest().subarray(0,4),n=32-this.bitLength,c=(s.readUInt32BE()>>>n).toString(16).padStart(this.suffixLen,"0");return`${this.namePrefix}-${c}`}*getRoles(){for(let e=0;e<this.numberOfBins;e++){let t=e.toString(16).padStart(this.suffixLen,"0");yield`${this.namePrefix}-${t}`}}isDelegatedRole(e){let t=this.namePrefix+"-";if(!e.startsWith(t))return!1;let r=e.slice(t.length,e.length);if(r.length!=this.suffixLen||!r.match(/^[0-9a-fA-F]+$/))return!1;let s=parseInt(r,16);return 0<=s&&s<this.numberOfBins}toJSON(){return{...super.toJSON(),bit_length:this.bitLength,name_prefix:this.namePrefix}}static fromJSON(e){let{keyids:t,threshold:r,bit_length:s,name_prefix:n,...a}=e;if(!rn.guard.isStringArray(t))throw new TypeError("keyids must be an array of strings");if(typeof r!="number")throw new TypeError("threshold must be a number");if(typeof s!="number")throw new TypeError("bit_length must be a number");if(typeof n!="string")throw new TypeError("name_prefix must be a string");return new i({keyIDs:t,threshold:r,bitLength:s,namePrefix:n,unrecognizedFields:a})}};Ut.SuccinctRoles=c0});var f0=d(Go=>{"use strict";var Gne=Go&&Go.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Go,"__esModule",{value:!0});Go.Root=void 0;var mU=Gne(require("util")),l0=en(),gU=xi(),Wne=Cp(),$p=u0(),qp=ei(),h0=class i extends l0.Signed{static{o(this,"Root")}type=l0.MetadataKind.Root;keys;roles;consistentSnapshot;constructor(e){if(super(e),this.keys=e.keys||{},this.consistentSnapshot=e.consistentSnapshot??!0,!e.roles)this.roles=$p.TOP_LEVEL_ROLE_NAMES.reduce((t,r)=>({...t,[r]:new $p.Role({keyIDs:[],threshold:1})}),{});else{let t=new Set(Object.keys(e.roles));if(!$p.TOP_LEVEL_ROLE_NAMES.every(r=>t.has(r)))throw new gU.ValueError("missing top-level role");this.roles=e.roles}}addKey(e,t){if(!this.roles[t])throw new gU.ValueError(`role ${t} does not exist`);this.roles[t].keyIDs.includes(e.keyID)||this.roles[t].keyIDs.push(e.keyID),this.keys[e.keyID]=e}equals(e){return e instanceof i?super.equals(e)&&this.consistentSnapshot===e.consistentSnapshot&&mU.default.isDeepStrictEqual(this.keys,e.keys)&&mU.default.isDeepStrictEqual(this.roles,e.roles):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,keys:Jne(this.keys),roles:Kne(this.roles),consistent_snapshot:this.consistentSnapshot,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=l0.Signed.commonFieldsFromJSON(e),{keys:s,roles:n,consistent_snapshot:a,...c}=t;if(typeof a!="boolean")throw new TypeError("consistent_snapshot must be a boolean");return new i({...r,keys:Zne(s),roles:Yne(n),consistentSnapshot:a,unrecognizedFields:c})}};Go.Root=h0;function Jne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Jne,"keysToJSON");function Kne(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(Kne,"rolesToJSON");function Zne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("keys must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:Wne.Key.fromJSON(r,s)}),{})}return e}o(Zne,"keysFromJSON");function Yne(i){let e;if(qp.guard.isDefined(i)){if(!qp.guard.isObjectRecord(i))throw new TypeError("roles must be an object");e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:$p.Role.fromJSON(s)}),{})}return e}o(Yne,"rolesFromJSON")});var p0=d(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.Signature=void 0;var d0=class i{static{o(this,"Signature")}keyID;sig;constructor(e){let{keyID:t,sig:r}=e;this.keyID=t,this.sig=r}toJSON(){return{keyid:this.keyID,sig:this.sig}}static fromJSON(e){let{keyid:t,sig:r}=e;if(typeof t!="string")throw new TypeError("keyid must be a string");if(typeof r!="string")throw new TypeError("sig must be a string");return new i({keyID:t,sig:r})}};Vp.Signature=d0});var y0=d(Wo=>{"use strict";var Xne=Wo&&Wo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Snapshot=void 0;var Qne=Xne(require("util")),m0=en(),SU=Su(),yU=ei(),g0=class i extends m0.Signed{static{o(this,"Snapshot")}type=m0.MetadataKind.Snapshot;meta;constructor(e){super(e),this.meta=e.meta||{"targets.json":new SU.MetaFile({version:1})}}equals(e){return e instanceof i?super.equals(e)&&Qne.default.isDeepStrictEqual(this.meta,e.meta):!1}toJSON(){return{_type:this.type,meta:eoe(this.meta),spec_version:this.specVersion,version:this.version,expires:this.expires,...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=m0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,meta:toe(s),unrecognizedFields:n})}};Wo.Snapshot=g0;function eoe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(eoe,"metaToJSON");function toe(i){let e;if(yU.guard.isDefined(i))if(yU.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:SU.MetaFile.fromJSON(s)}),{});else throw new TypeError("meta field is malformed");return e}o(toe,"metaFromJSON")});var EU=d(Jo=>{"use strict";var ioe=Jo&&Jo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.Delegations=void 0;var zp=ioe(require("util")),roe=xi(),soe=Cp(),S0=u0(),Hp=ei(),E0=class i{static{o(this,"Delegations")}keys;roles;unrecognizedFields;succinctRoles;constructor(e){if(this.keys=e.keys,this.unrecognizedFields=e.unrecognizedFields||{},e.roles&&Object.keys(e.roles).some(t=>S0.TOP_LEVEL_ROLE_NAMES.includes(t)))throw new roe.ValueError("Delegated role name conflicts with top-level role name");this.succinctRoles=e.succinctRoles,this.roles=e.roles}equals(e){return e instanceof i?zp.default.isDeepStrictEqual(this.keys,e.keys)&&zp.default.isDeepStrictEqual(this.roles,e.roles)&&zp.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields)&&zp.default.isDeepStrictEqual(this.succinctRoles,e.succinctRoles):!1}*rolesForTarget(e){if(this.roles)for(let t of Object.values(this.roles))t.isDelegatedPath(e)&&(yield{role:t.name,terminating:t.terminating});else this.succinctRoles&&(yield{role:this.succinctRoles.getRoleForTarget(e),terminating:!0})}toJSON(){let e={keys:noe(this.keys),...this.unrecognizedFields};return this.roles?e.roles=ooe(this.roles):this.succinctRoles&&(e.succinct_roles=this.succinctRoles.toJSON()),e}static fromJSON(e){let{keys:t,roles:r,succinct_roles:s,...n}=e,a;return Hp.guard.isObject(s)&&(a=S0.SuccinctRoles.fromJSON(s)),new i({keys:aoe(t),roles:coe(r),unrecognizedFields:n,succinctRoles:a})}};Jo.Delegations=E0;function noe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(noe,"keysToJSON");function ooe(i){return Object.values(i).map(e=>e.toJSON())}o(ooe,"rolesToJSON");function aoe(i){if(!Hp.guard.isObjectRecord(i))throw new TypeError("keys is malformed");return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:soe.Key.fromJSON(t,r)}),{})}o(aoe,"keysFromJSON");function coe(i){let e;if(Hp.guard.isDefined(i)){if(!Hp.guard.isObjectArray(i))throw new TypeError("roles is malformed");e=i.reduce((t,r)=>{let s=S0.DelegatedRole.fromJSON(r);return{...t,[s.name]:s}},{})}return e}o(coe,"rolesFromJSON")});var b0=d(Ko=>{"use strict";var uoe=Ko&&Ko.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Targets=void 0;var wU=uoe(require("util")),w0=en(),loe=EU(),hoe=Su(),Gp=ei(),_0=class i extends w0.Signed{static{o(this,"Targets")}type=w0.MetadataKind.Targets;targets;delegations;constructor(e){super(e),this.targets=e.targets||{},this.delegations=e.delegations}addTarget(e){this.targets[e.path]=e}equals(e){return e instanceof i?super.equals(e)&&wU.default.isDeepStrictEqual(this.targets,e.targets)&&wU.default.isDeepStrictEqual(this.delegations,e.delegations):!1}toJSON(){let e={_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,targets:foe(this.targets),...this.unrecognizedFields};return this.delegations&&(e.delegations=this.delegations.toJSON()),e}static fromJSON(e){let{unrecognizedFields:t,...r}=w0.Signed.commonFieldsFromJSON(e),{targets:s,delegations:n,...a}=t;return new i({...r,targets:doe(s),delegations:poe(n),unrecognizedFields:a})}};Ko.Targets=_0;function foe(i){return Object.entries(i).reduce((e,[t,r])=>({...e,[t]:r.toJSON()}),{})}o(foe,"targetsToJSON");function doe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObjectRecord(i))e=Object.entries(i).reduce((t,[r,s])=>({...t,[r]:hoe.TargetFile.fromJSON(r,s)}),{});else throw new TypeError("targets must be an object");return e}o(doe,"targetsFromJSON");function poe(i){let e;if(Gp.guard.isDefined(i))if(Gp.guard.isObject(i))e=loe.Delegations.fromJSON(i);else throw new TypeError("delegations must be an object");return e}o(poe,"delegationsFromJSON")});var R0=d(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.Timestamp=void 0;var I0=en(),_U=Su(),O0=ei(),v0=class i extends I0.Signed{static{o(this,"Timestamp")}type=I0.MetadataKind.Timestamp;snapshotMeta;constructor(e){super(e),this.snapshotMeta=e.snapshotMeta||new _U.MetaFile({version:1})}equals(e){return e instanceof i?super.equals(e)&&this.snapshotMeta.equals(e.snapshotMeta):!1}toJSON(){return{_type:this.type,spec_version:this.specVersion,version:this.version,expires:this.expires,meta:{"snapshot.json":this.snapshotMeta.toJSON()},...this.unrecognizedFields}}static fromJSON(e){let{unrecognizedFields:t,...r}=I0.Signed.commonFieldsFromJSON(e),{meta:s,...n}=t;return new i({...r,snapshotMeta:moe(s),unrecognizedFields:n})}};Wp.Timestamp=v0;function moe(i){let e;if(O0.guard.isDefined(i)){let t=i["snapshot.json"];if(!O0.guard.isDefined(t)||!O0.guard.isObject(t))throw new TypeError("missing snapshot.json in meta");e=_U.MetaFile.fromJSON(t)}return e}o(moe,"snapshotMetaFromJSON")});var IU=d(Yo=>{"use strict";var goe=Yo&&Yo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Metadata=void 0;var yoe=Hb(),bU=goe(require("util")),Zo=en(),vu=xi(),Soe=f0(),Eoe=p0(),woe=y0(),_oe=b0(),boe=R0(),A0=ei(),T0=class i{static{o(this,"Metadata")}signed;signatures;unrecognizedFields;constructor(e,t,r){this.signed=e,this.signatures=t||{},this.unrecognizedFields=r||{}}sign(e,t=!0){let r=Buffer.from((0,yoe.canonicalize)(this.signed.toJSON())),s=e(r);t||(this.signatures={}),this.signatures[s.keyID]=s}verifyDelegate(e,t){let r,s={};switch(this.signed.type){case Zo.MetadataKind.Root:s=this.signed.keys,r=this.signed.roles[e];break;case Zo.MetadataKind.Targets:if(!this.signed.delegations)throw new vu.ValueError(`No delegations found for ${e}`);s=this.signed.delegations.keys,this.signed.delegations.roles?r=this.signed.delegations.roles[e]:this.signed.delegations.succinctRoles&&this.signed.delegations.succinctRoles.isDelegatedRole(e)&&(r=this.signed.delegations.succinctRoles);break;default:throw new TypeError("invalid metadata type")}if(!r)throw new vu.ValueError(`no delegation found for ${e}`);let n=new Set;if(r.keyIDs.forEach(a=>{let c=s[a];if(c)try{c.verifySignature(t),n.add(c.keyID)}catch{}}),n.size<r.threshold)throw new vu.UnsignedMetadataError(`${e} was signed by ${n.size}/${r.threshold} keys`)}equals(e){return e instanceof i?this.signed.equals(e.signed)&&bU.default.isDeepStrictEqual(this.signatures,e.signatures)&&bU.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{signatures:Object.values(this.signatures).map(t=>t.toJSON()),signed:this.signed.toJSON(),...this.unrecognizedFields}}static fromJSON(e,t){let{signed:r,signatures:s,...n}=t;if(!A0.guard.isDefined(r)||!A0.guard.isObject(r))throw new TypeError("signed is not defined");if(e!==r._type)throw new vu.ValueError(`expected '${e}', got ${r._type}`);if(!A0.guard.isObjectArray(s))throw new TypeError("signatures is not an array");let a;switch(e){case Zo.MetadataKind.Root:a=Soe.Root.fromJSON(r);break;case Zo.MetadataKind.Timestamp:a=boe.Timestamp.fromJSON(r);break;case Zo.MetadataKind.Snapshot:a=woe.Snapshot.fromJSON(r);break;case Zo.MetadataKind.Targets:a=_oe.Targets.fromJSON(r);break;default:throw new TypeError("invalid metadata type")}let c={};return s.forEach(u=>{let l=Eoe.Signature.fromJSON(u);if(c[l.keyID])throw new vu.ValueError(`multiple signatures found for keyid: ${l.keyID}`);c[l.keyID]=l}),new i(a,c,n)}};Yo.Metadata=T0});var Jp=d(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.Timestamp=ce.Targets=ce.Snapshot=ce.Signature=ce.Root=ce.Metadata=ce.Key=ce.TargetFile=ce.MetaFile=ce.ValueError=ce.MetadataKind=void 0;var Ioe=en();Object.defineProperty(ce,"MetadataKind",{enumerable:!0,get:o(function(){return Ioe.MetadataKind},"get")});var Ooe=xi();Object.defineProperty(ce,"ValueError",{enumerable:!0,get:o(function(){return Ooe.ValueError},"get")});var OU=Su();Object.defineProperty(ce,"MetaFile",{enumerable:!0,get:o(function(){return OU.MetaFile},"get")});Object.defineProperty(ce,"TargetFile",{enumerable:!0,get:o(function(){return OU.TargetFile},"get")});var voe=Cp();Object.defineProperty(ce,"Key",{enumerable:!0,get:o(function(){return voe.Key},"get")});var Roe=IU();Object.defineProperty(ce,"Metadata",{enumerable:!0,get:o(function(){return Roe.Metadata},"get")});var Aoe=f0();Object.defineProperty(ce,"Root",{enumerable:!0,get:o(function(){return Aoe.Root},"get")});var Toe=p0();Object.defineProperty(ce,"Signature",{enumerable:!0,get:o(function(){return Toe.Signature},"get")});var Coe=y0();Object.defineProperty(ce,"Snapshot",{enumerable:!0,get:o(function(){return Coe.Snapshot},"get")});var Noe=b0();Object.defineProperty(ce,"Targets",{enumerable:!0,get:o(function(){return Noe.Targets},"get")});var Poe=R0();Object.defineProperty(ce,"Timestamp",{enumerable:!0,get:o(function(){return Poe.Timestamp},"get")})});var Zp=d(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.DownloadHTTPError=de.DownloadLengthMismatchError=de.DownloadError=de.ExpiredMetadataError=de.EqualVersionError=de.BadVersionError=de.RepositoryError=de.PersistError=de.RuntimeError=de.ValueError=void 0;var C0=class extends Error{static{o(this,"ValueError")}};de.ValueError=C0;var N0=class extends Error{static{o(this,"RuntimeError")}};de.RuntimeError=N0;var P0=class extends Error{static{o(this,"PersistError")}};de.PersistError=P0;var Ru=class extends Error{static{o(this,"RepositoryError")}};de.RepositoryError=Ru;var Kp=class extends Ru{static{o(this,"BadVersionError")}};de.BadVersionError=Kp;var D0=class extends Kp{static{o(this,"EqualVersionError")}};de.EqualVersionError=D0;var x0=class extends Ru{static{o(this,"ExpiredMetadataError")}};de.ExpiredMetadataError=x0;var Au=class extends Error{static{o(this,"DownloadError")}};de.DownloadError=Au;var L0=class extends Au{static{o(this,"DownloadLengthMismatchError")}};de.DownloadLengthMismatchError=L0;var M0=class extends Au{static{o(this,"DownloadHTTPError")}statusCode;constructor(e,t){super(e),this.statusCode=t}};de.DownloadHTTPError=M0});var RU=d(Xo=>{"use strict";var k0=Xo&&Xo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.withTempFile=void 0;var B0=k0(require("fs/promises")),Doe=k0(require("os")),vU=k0(require("path")),xoe=o(async i=>Loe(async e=>i(vU.default.join(e,"tempfile"))),"withTempFile");Xo.withTempFile=xoe;var Loe=o(async i=>{let e=await B0.default.realpath(Doe.default.tmpdir()),t=await B0.default.mkdtemp(e+vU.default.sep);try{return await i(t)}finally{await B0.default.rm(t,{force:!0,recursive:!0,maxRetries:3})}},"withTempDir")});var U0=d(Qr=>{"use strict";var Xp=Qr&&Qr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.DefaultFetcher=Qr.BaseFetcher=void 0;var Moe=Xp(Fs()),AU=Xp(require("fs")),Boe=Xp(iu()),koe=Xp(require("util")),TU=Zp(),Foe=RU(),Uoe=(0,Moe.default)("tuf:fetch"),Yp=class{static{o(this,"BaseFetcher")}async downloadFile(e,t,r){return(0,Foe.withTempFile)(async s=>{let n=await this.fetch(e),a=0,c=AU.default.createWriteStream(s);try{for await(let u of n){if(a+=u.length,a>t)throw new TU.DownloadLengthMismatchError("Max length reached");await joe(c,u)}}finally{await koe.default.promisify(c.close).bind(c)()}return r(s)})}async downloadBytes(e,t){return this.downloadFile(e,t,async r=>{let s=AU.default.createReadStream(r),n=[];for await(let a of s)n.push(a);return Buffer.concat(n)})}};Qr.BaseFetcher=Yp;var F0=class extends Yp{static{o(this,"DefaultFetcher")}timeout;retry;constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){Uoe("GET %s",e);let t=await(0,Boe.default)(e,{timeout:this.timeout,retry:this.retry});if(!t.ok||!t?.body)throw new TU.DownloadHTTPError("Failed to download",t.status);return t.body}};Qr.DefaultFetcher=F0;var joe=o(async(i,e)=>new Promise((t,r)=>{i.write(e,s=>{s&&r(s),t(!0)})}),"writeBufferToStream")});var CU=d(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.defaultConfig=void 0;Qp.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var NU=d(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.TrustedMetadataStore=void 0;var Ie=Jp(),le=Zp(),j0=class{static{o(this,"TrustedMetadataStore")}trustedSet={};referenceTime;constructor(e){this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Root,r),r.signed.version!=this.root.signed.version+1)throw new le.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${r.signed.version}`);return r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r,r}updateTimestamp(e){if(this.snapshot)throw new le.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final root.json is expired");let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Timestamp,t);if(r.signed.type!=Ie.MetadataKind.Timestamp)throw new le.RepositoryError(`Expected 'timestamp', got ${r.signed.type}`);if(this.root.verifyDelegate(Ie.MetadataKind.Timestamp,r),this.timestamp){if(r.signed.version<this.timestamp.signed.version)throw new le.BadVersionError(`New timestamp version ${r.signed.version} is less than current version ${this.timestamp.signed.version}`);if(r.signed.version===this.timestamp.signed.version)throw new le.EqualVersionError(`New timestamp version ${r.signed.version} is equal to current version ${this.timestamp.signed.version}`);let s=this.timestamp.signed.snapshotMeta,n=r.signed.snapshotMeta;if(n.version<s.version)throw new le.BadVersionError(`New snapshot version ${n.version} is less than current version ${s.version}`)}return this.trustedSet.timestamp=r,this.checkFinalTimestamp(),r}updateSnapshot(e,t=!1){if(!this.timestamp)throw new le.RuntimeError("Cannot update snapshot before timestamp");if(this.targets)throw new le.RuntimeError("Cannot update snapshot after targets");this.checkFinalTimestamp();let r=this.timestamp.signed.snapshotMeta;t||r.verify(e);let s=JSON.parse(e.toString("utf8")),n=Ie.Metadata.fromJSON(Ie.MetadataKind.Snapshot,s);if(n.signed.type!=Ie.MetadataKind.Snapshot)throw new le.RepositoryError(`Expected 'snapshot', got ${n.signed.type}`);return this.root.verifyDelegate(Ie.MetadataKind.Snapshot,n),this.snapshot&&Object.entries(this.snapshot.signed.meta).forEach(([a,c])=>{let u=n.signed.meta[a];if(!u)throw new le.RepositoryError(`Missing file ${a} in new snapshot`);if(u.version<c.version)throw new le.BadVersionError(`New version ${u.version} of ${a} is less than current version ${c.version}`)}),this.trustedSet.snapshot=n,this.checkFinalSnapsnot(),n}updateDelegatedTargets(e,t,r){if(!this.snapshot)throw new le.RuntimeError("Cannot update delegated targets before snapshot");this.checkFinalSnapsnot();let s=this.trustedSet[r];if(!s)throw new le.RuntimeError(`No trusted ${r} metadata`);let n=this.snapshot.signed.meta?.[`${t}.json`];if(!n)throw new le.RepositoryError(`Missing ${t}.json in snapshot`);n.verify(e);let a=JSON.parse(e.toString("utf8")),c=Ie.Metadata.fromJSON(Ie.MetadataKind.Targets,a);if(c.signed.type!=Ie.MetadataKind.Targets)throw new le.RepositoryError(`Expected 'targets', got ${c.signed.type}`);s.verifyDelegate(t,c);let u=c.signed.version;if(u!=n.version)throw new le.BadVersionError(`Version ${u} of ${t} does not match snapshot version ${n.version}`);if(c.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError(`${t}.json is expired`);this.trustedSet[t]=c}loadTrustedRoot(e){let t=JSON.parse(e.toString("utf8")),r=Ie.Metadata.fromJSON(Ie.MetadataKind.Root,t);if(r.signed.type!=Ie.MetadataKind.Root)throw new le.RepositoryError(`Expected 'root', got ${r.signed.type}`);r.verifyDelegate(Ie.MetadataKind.Root,r),this.trustedSet.root=r}checkFinalTimestamp(){if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.timestamp.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("Final timestamp.json is expired")}checkFinalSnapsnot(){if(!this.snapshot)throw new ReferenceError("No trusted snapshot metadata");if(!this.timestamp)throw new ReferenceError("No trusted timestamp metadata");if(this.snapshot.signed.isExpired(this.referenceTime))throw new le.ExpiredMetadataError("snapshot.json is expired");let e=this.timestamp.signed.snapshotMeta;if(this.snapshot.signed.version!==e.version)throw new le.BadVersionError("Snapshot version doesn't match timestamp")}};em.TrustedMetadataStore=j0});var PU=d($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.join=qoe;var $oe=require("url");function qoe(i,e){return new $oe.URL(Voe(i)+zoe(e)).toString()}o(qoe,"join");function Voe(i){return i.endsWith("/")?i:i+"/"}o(Voe,"ensureTrailingSlash");function zoe(i){return i.startsWith("/")?i.slice(1):i}o(zoe,"removeLeadingSlash")});var DU=d(jt=>{"use strict";var Hoe=jt&&jt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Goe=jt&&jt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),z0=jt&&jt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Hoe(t,e,r[s]);return Goe(t,e),t}})(),Woe=jt&&jt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(jt,"__esModule",{value:!0});jt.Updater=void 0;var Li=Jp(),Joe=Woe(Fs()),Qo=z0(require("fs")),tm=z0(require("path")),Koe=CU(),sn=Zp(),Zoe=U0(),Yoe=NU(),Tu=z0(PU()),q0=(0,Joe.default)("tuf:cache"),V0=class{static{o(this,"Updater")}dir;metadataBaseUrl;targetDir;targetBaseUrl;forceCache;trustedSet;config;fetcher;constructor(e){let{metadataDir:t,metadataBaseUrl:r,targetDir:s,targetBaseUrl:n,fetcher:a,config:c}=e;this.dir=t,this.metadataBaseUrl=r,this.targetDir=s,this.targetBaseUrl=n,this.forceCache=e.forceCache??!1;let u=this.loadLocalMetadata(Li.MetadataKind.Root);this.trustedSet=new Yoe.TrustedMetadataStore(u),this.config={...Koe.defaultConfig,...c},this.fetcher=a||new Zoe.DefaultFetcher({timeout:this.config.fetchTimeout,retry:this.config.fetchRetries??this.config.fetchRetry})}async refresh(){if(this.forceCache)try{await this.loadTimestamp({checkRemote:!1})}catch{await this.loadRoot(),await this.loadTimestamp()}else await this.loadRoot(),await this.loadTimestamp();await this.loadSnapshot(),await this.loadTargets(Li.MetadataKind.Targets,Li.MetadataKind.Root)}async getTargetInfo(e){return this.trustedSet.targets||await this.refresh(),this.preorderDepthFirstWalk(e)}async downloadTarget(e,t,r){let s=t||this.generateTargetPath(e);if(!r){if(!this.targetBaseUrl)throw new sn.ValueError("Target base URL not set");r=this.targetBaseUrl}let n=e.path;if(this.trustedSet.root.signed.consistentSnapshot&&this.config.prefixTargetsWithHash){let u=Object.values(e.hashes),{dir:l,base:h}=tm.parse(n),f=`${u[0]}.${h}`;n=l?`${l}/${f}`:f}let c=Tu.join(r,n);return await this.fetcher.downloadFile(c,e.length,async u=>{await e.verify(Qo.createReadStream(u)),q0("WRITE %s",s),Qo.copyFileSync(u,s)}),s}async findCachedTarget(e,t){t||(t=this.generateTargetPath(e));try{if(Qo.existsSync(t))return await e.verify(Qo.createReadStream(t)),t}catch{return}}loadLocalMetadata(e){let t=tm.join(this.dir,`${e}.json`);return q0("READ %s",t),Qo.readFileSync(t)}async loadRoot(){let t=this.trustedSet.root.signed.version+1,r=t+this.config.maxRootRotations;for(let s=t;s<r;s++){let n=Tu.join(this.metadataBaseUrl,`${s}.root.json`);try{let a=await this.fetcher.downloadBytes(n,this.config.rootMaxLength);this.trustedSet.updateRoot(a),this.persistMetadata(Li.MetadataKind.Root,a)}catch(a){if(a instanceof sn.DownloadHTTPError&&[403,404].includes(a.statusCode))break;throw a}}}async loadTimestamp({checkRemote:e}={checkRemote:!0}){try{let s=this.loadLocalMetadata(Li.MetadataKind.Timestamp);if(this.trustedSet.updateTimestamp(s),!e)return}catch{}let t=Tu.join(this.metadataBaseUrl,"timestamp.json"),r=await this.fetcher.downloadBytes(t,this.config.timestampMaxLength);try{this.trustedSet.updateTimestamp(r)}catch(s){if(s instanceof sn.EqualVersionError)return;throw s}this.persistMetadata(Li.MetadataKind.Timestamp,r)}async loadSnapshot(){try{let e=this.loadLocalMetadata(Li.MetadataKind.Snapshot);this.trustedSet.updateSnapshot(e,!0)}catch{if(!this.trustedSet.timestamp)throw new ReferenceError("No timestamp metadata");let t=this.trustedSet.timestamp.signed.snapshotMeta,r=t.length||this.config.snapshotMaxLength,s=this.trustedSet.root.signed.consistentSnapshot?t.version:void 0,n=Tu.join(this.metadataBaseUrl,s?`${s}.snapshot.json`:"snapshot.json");try{let a=await this.fetcher.downloadBytes(n,r);this.trustedSet.updateSnapshot(a),this.persistMetadata(Li.MetadataKind.Snapshot,a)}catch(a){throw new sn.RuntimeError(`Unable to load snapshot metadata error ${a}`)}}}async loadTargets(e,t){if(this.trustedSet.getRole(e))return this.trustedSet.getRole(e);try{let r=this.loadLocalMetadata(e);this.trustedSet.updateDelegatedTargets(r,e,t)}catch{if(!this.trustedSet.snapshot)throw new ReferenceError("No snapshot metadata");let s=this.trustedSet.snapshot.signed.meta[`${e}.json`],n=s.length||this.config.targetsMaxLength,a=this.trustedSet.root.signed.consistentSnapshot?s.version:void 0,c=encodeURIComponent(e),u=Tu.join(this.metadataBaseUrl,a?`${a}.${c}.json`:`${c}.json`);try{let l=await this.fetcher.downloadBytes(u,n);this.trustedSet.updateDelegatedTargets(l,e,t),this.persistMetadata(e,l)}catch(l){throw new sn.RuntimeError(`Unable to load targets error ${l}`)}}return this.trustedSet.getRole(e)}async preorderDepthFirstWalk(e){let t=[{roleName:Li.MetadataKind.Targets,parentRoleName:Li.MetadataKind.Root}],r=new Set;for(;r.size<=this.config.maxDelegations&&t.length>0;){let{roleName:s,parentRoleName:n}=t.pop();if(r.has(s))continue;let a=(await this.loadTargets(s,n))?.signed;if(!a)continue;let c=a.targets?.[e];if(c)return c;if(r.add(s),a.delegations){let u=[],l=a.delegations.rolesForTarget(e);for(let{role:h,terminating:f}of l)if(u.push({roleName:h,parentRoleName:s}),f){t.splice(0);break}u.reverse(),t.push(...u)}}}generateTargetPath(e){if(!this.targetDir)throw new sn.ValueError("Target directory not set");let t=encodeURIComponent(e.path);return tm.join(this.targetDir,t)}persistMetadata(e,t){let r=encodeURIComponent(e);try{let s=tm.join(this.dir,`${r}.json`);q0("WRITE %s",s),Qo.writeFileSync(s,t.toString("utf8"))}catch(s){throw new sn.PersistError(`Failed to persist metadata ${r} error: ${s}`)}}};jt.Updater=V0});var xU=d(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.Updater=es.BaseFetcher=es.TargetFile=void 0;var Xoe=Jp();Object.defineProperty(es,"TargetFile",{enumerable:!0,get:o(function(){return Xoe.TargetFile},"get")});var Qoe=U0();Object.defineProperty(es,"BaseFetcher",{enumerable:!0,get:o(function(){return Qoe.BaseFetcher},"get")});var eae=DU();Object.defineProperty(es,"Updater",{enumerable:!0,get:o(function(){return eae.Updater},"get")})});var G0=d(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.TUFError=void 0;var H0=class extends Error{static{o(this,"TUFError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}};im.TUFError=H0});var LU=d(Cu=>{"use strict";var tae=Cu&&Cu.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Cu,"__esModule",{value:!0});Cu.readTarget=rae;var iae=tae(require("fs")),rm=G0();async function rae(i,e){let t=await sae(i,e);return new Promise((r,s)=>{iae.default.readFile(t,"utf-8",(n,a)=>{n?s(new rm.TUFError({code:"TUF_READ_TARGET_ERROR",message:`error reading target ${t}`,cause:n})):r(a)})})}o(rae,"readTarget");async function sae(i,e){let t;try{t=await i.getTargetInfo(e)}catch(s){throw new rm.TUFError({code:"TUF_REFRESH_METADATA_ERROR",message:"error refreshing TUF metadata",cause:s})}if(!t)throw new rm.TUFError({code:"TUF_FIND_TARGET_ERROR",message:`target ${e} not found`});let r=await i.findCachedTarget(t);if(!r)try{r=await i.downloadTarget(t)}catch(s){throw new rm.TUFError({code:"TUF_DOWNLOAD_TARGET_ERROR",message:`error downloading target ${r}`,cause:s})}return r}o(sae,"getTargetPath")});var MU=d((N0e,nae)=>{nae.exports={"https://tuf-repo-cdn.sigstore.dev":{"root.json":"ewogInNpZ25hdHVyZXMiOiBbCiAgewogICAia2V5aWQiOiAiNmYyNjAwODlkNTkyM2RhZjIwMTY2Y2E2NTdjNTQzYWY2MTgzNDZhYjk3MTg4NGE5OTk2MmIwMTk4OGJiZTBjMyIsCiAgICJzaWciOiAiIgogIH0sCiAgewogICAia2V5aWQiOiAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICJzaWciOiAiMzA0NTAyMjEwMGJiZGRkNDY0ZjgwNjZjZWI4OGJhNzg3Mzc1YzEyY2Q2MzMwNjgwZTA4YzI5MTA3MDNlNjUzOGM3MWNjNzlhZDIwMjIwNTE5MGIwNmU0NTM3ZmU5NjFiM2VmODFmZTY4ZWRjZDAwODljMTlmOTE5YWZlZDQyM2I5YWFmZDcwMDY0MTE1MyIKICB9LAogIHsKICAgImtleWlkIjogIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAic2lnIjogIjMwNDQwMjIwNjkzMDZjZDUyNTdmNzMyYTc0MGMxYWZlNjBhOGU0MzNjNWRlNThlYWZlYWRiZTk5YzMzNmM5YzcxZDE5OGNmODAyMjAwZDc3Mzk1M2FlN2RiYzQ4ZDNlNWJhZDlhNmY2NGJhZmZmMTk2YjdlMmFkNGE1MmExOTUxOTM2N2Q0N2RjMDQyIgogIH0sCiAgewogICAia2V5aWQiOiAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICJzaWciOiAiMzA0NDAyMjA0ZDIxYTJlYzgwZGY2NmU2MWY2ZmUyOTEyOTUxZGM0N2RmODM2MDM2ZjhjMGFiMTA4MTZkMzc1ZTcxZGJmNzllMDIyMDU0N2FkY2UxYWZkZjA0ZTY3OTRlZmEyMDNkZDUyNjRjNmY3ZTBlZjc4ZTU3ZmU5MzRiMGQyNmNiOTk0ZWVjNzYiCiAgfSwKICB7CiAgICJrZXlpZCI6ICJhNjg3ZTViZjRmYWI4MmIwZWU1OGQ0NmUwNWM5NTM1MTQ1YTJjOWFmYjQ1OGY0M2Q0MmI0NWNhMGZkY2UyYTcwIiwKICAgInNpZyI6ICIzMDQ1MDIyMDYwODI2NDk2NTU3MTQ0ZWIxNjQ5ODkzZWQ1ZjZmNGVhNTQ1MzZmZWIwY2E4MmY4Yjg5YWU2NDFiZTM5NzQzZTUwMjIxMDBhZDcxMThiNWU5ZDQ4MzczMjYyMDZlNDEyZmM2ZGEyOTk5OTI1ZDExMDMyOGE3YzE2NmIwNmM2MjQzMzZjOTNmIgogIH0sCiAgewogICAia2V5aWQiOiAiMTgzZTY0ZjM3NjcwZGMxM2NhMGQyODk5NWEzMDUzZjM3NDA5NTRkZGNlNDQzMjFhNDFlNDY1MzRjZjQ0ZTYzMiIsCiAgICJzaWciOiAiMzA0NjAyMjEwMGQ4MTc5NDM5YzJlNzNlYjBjMTczM2FiZWU3ZmFmODMyZGNhZWE3MjYzZWRjYjQ5MTk4OTFjM2EyNDdmMDU5MjMwMjIxMDBlMWE0MzdlMDc5N2U4MDNmOWI3MmRjOWQyZDkyMTU1YjBhMjI3MGMyNGVmZGQ1ZjRiM2E1ZDhmMGIwZjQzMWE3IgogIH0KIF0sCiAic2lnbmVkIjogewogICJfdHlwZSI6ICJyb290IiwKICAiY29uc2lzdGVudF9zbmFwc2hvdCI6IHRydWUsCiAgImV4cGlyZXMiOiAiMjAyNi0wMS0yMlQxMzowNTo1OVoiLAogICJrZXlzIjogewogICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVdSaUdyNStqKzNKNVNzSCtadHI1bkUySDJ3TzdcbkJWK25PM3M5M2dMY2ExOHFUT3pIWTFvV3lBR0R5a01Tc0dUVUJTdDlEK0FuMEtmS3NEMm1mU000MlE9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1vbmxpbmUtdXJpIjogImdjcGttczpwcm9qZWN0cy9zaWdzdG9yZS1yb290LXNpZ25pbmcvbG9jYXRpb25zL2dsb2JhbC9rZXlSaW5ncy9yb290L2NyeXB0b0tleXMvdGltZXN0YW1wL2NyeXB0b0tleVZlcnNpb25zLzEiCiAgIH0sCiAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIjogewogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVNeHBQT0pDSVo1b3RHNDEwNmZHSnNlRVFpM1Y5XG5wa01ZUTR1eVY5VGoxTTdXSFhJeUxHK2prZnZ1RzBnbFExSlpiUlpaQlYzZ0FSNHNvamRHSElTZW93PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGxhbmNlIgogICB9LAogICAiMjJmNGNhZWM2ZDhlNmY5NTU1YWY2NmIzZDRjM2NiMDZhM2JiMjNmZGM3ZTM5YzkxNmM2MWY0NjJlNmY1MmIwNiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXpCelZPbUhDUG9qTVZMU0kzNjRXaWlWOE5QckRcbjZJZ1J4Vmxpc2t6L3YreTNKRVI1bWNWR2NPTmxpRGNXTUM1SjJsZkhtalBOUGhiNEg3eG04THpmU0E9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAc2FudGlhZ290b3JyZXMiCiAgIH0sCiAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIjogewogICAgImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6IFsKICAgICAic2hhMjU2IiwKICAgICAic2hhNTEyIgogICAgXSwKICAgICJrZXl0eXBlIjogImVjZHNhIiwKICAgICJrZXl2YWwiOiB7CiAgICAgInB1YmxpYyI6ICItLS0tLUJFR0lOIFBVQkxJQyBLRVktLS0tLVxuTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFaW5pa1NzQVFtWWtOZUg1ZVlxL0NuSXpMYWFjT1xueGxTYWF3UURPd3FLeS90Q3F4cTV4eFBTSmMyMUs0V0loczlHeU9rS2Z6dWVZM0dJTHpjTUpaNGNXdz09XG4tLS0tLUVORCBQVUJMSUMgS0VZLS0tLS1cbiIKICAgIH0sCiAgICAic2NoZW1lIjogImVjZHNhLXNoYTItbmlzdHAyNTYiLAogICAgIngtdHVmLW9uLWNpLWtleW93bmVyIjogIkBib2JjYWxsYXdheSIKICAgfSwKICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiOiB7CiAgICAia2V5aWRfaGFzaF9hbGdvcml0aG1zIjogWwogICAgICJzaGEyNTYiLAogICAgICJzaGE1MTIiCiAgICBdLAogICAgImtleXR5cGUiOiAiZWNkc2EiLAogICAgImtleXZhbCI6IHsKICAgICAicHVibGljIjogIi0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUwZ2hyaDkyTHcxWXIzaWRHVjVXcUN0TURCOEN4XG4rRDhoZEM0dzJaTE5JcGxWUm9WR0xza1lhM2doZU15T2ppSjhrUGkxNWFRMi8vN1Arb2o3VXZKUEd3PT1cbi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLVxuIgogICAgfSwKICAgICJzY2hlbWUiOiAiZWNkc2Etc2hhMi1uaXN0cDI1NiIsCiAgICAieC10dWYtb24tY2kta2V5b3duZXIiOiAiQGpvc2h1YWdsIgogICB9LAogICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiI6IHsKICAgICJrZXlpZF9oYXNoX2FsZ29yaXRobXMiOiBbCiAgICAgInNoYTI1NiIsCiAgICAgInNoYTUxMiIKICAgIF0sCiAgICAia2V5dHlwZSI6ICJlY2RzYSIsCiAgICAia2V5dmFsIjogewogICAgICJwdWJsaWMiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRUVYc3ozU1pYRmI4ak1WNDJqNnBKbHlqYmpSOEtcbk4zQndvY2V4cTZMTUliNXFzV0tPUXZMTjE2TlVlZkxjNEhzd09vdW1Sc1ZWYWFqU3BRUzZmb2JrUnc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tXG4iCiAgICB9LAogICAgInNjaGVtZSI6ICJlY2RzYS1zaGEyLW5pc3RwMjU2IiwKICAgICJ4LXR1Zi1vbi1jaS1rZXlvd25lciI6ICJAbW5tNjc4IgogICB9CiAgfSwKICAicm9sZXMiOiB7CiAgICJyb290IjogewogICAgImtleWlkcyI6IFsKICAgICAiZTcxYTU0ZDU0MzgzNWJhODZhZGFkOTQ2MDM3OWM3NjQxZmI4NzI2ZDE2NGVhNzY2ODAxYTFjNTIyYWJhN2VhMiIsCiAgICAgIjIyZjRjYWVjNmQ4ZTZmOTU1NWFmNjZiM2Q0YzNjYjA2YTNiYjIzZmRjN2UzOWM5MTZjNjFmNDYyZTZmNTJiMDYiLAogICAgICI2MTY0MzgzODEyNWI0NDBiNDBkYjY5NDJmNWNiNWEzMWMwZGMwNDM2ODMxNmViMmFhYTU4Yjk1OTA0YTU4MjIyIiwKICAgICAiYTY4N2U1YmY0ZmFiODJiMGVlNThkNDZlMDVjOTUzNTE0NWEyYzlhZmI0NThmNDNkNDJiNDVjYTBmZGNlMmE3MCIsCiAgICAgIjE4M2U2NGYzNzY3MGRjMTNjYTBkMjg5OTVhMzA1M2YzNzQwOTU0ZGRjZTQ0MzIxYTQxZTQ2NTM0Y2Y0NGU2MzIiCiAgICBdLAogICAgInRocmVzaG9sZCI6IDMKICAgfSwKICAgInNuYXBzaG90IjogewogICAgImtleWlkcyI6IFsKICAgICAiMGM4NzQzMmMzYmYwOWZkOTkxODlmZGMzMmZhNWVhZWRmNGU0YTVmYWM3YmFiNzNmYTA0YTJlMGZjNjRhZjZmNSIKICAgIF0sCiAgICAidGhyZXNob2xkIjogMSwKICAgICJ4LXR1Zi1vbi1jaS1leHBpcnktcGVyaW9kIjogMzY1MCwKICAgICJ4LXR1Zi1vbi1jaS1zaWduaW5nLXBlcmlvZCI6IDM2NQogICB9LAogICAidGFyZ2V0cyI6IHsKICAgICJrZXlpZHMiOiBbCiAgICAgImU3MWE1NGQ1NDM4MzViYTg2YWRhZDk0NjAzNzljNzY0MWZiODcyNmQxNjRlYTc2NjgwMWExYzUyMmFiYTdlYTIiLAogICAgICIyMmY0Y2FlYzZkOGU2Zjk1NTVhZjY2YjNkNGMzY2IwNmEzYmIyM2ZkYzdlMzljOTE2YzYxZjQ2MmU2ZjUyYjA2IiwKICAgICAiNjE2NDM4MzgxMjViNDQwYjQwZGI2OTQyZjVjYjVhMzFjMGRjMDQzNjgzMTZlYjJhYWE1OGI5NTkwNGE1ODIyMiIsCiAgICAgImE2ODdlNWJmNGZhYjgyYjBlZTU4ZDQ2ZTA1Yzk1MzUxNDVhMmM5YWZiNDU4ZjQzZDQyYjQ1Y2EwZmRjZTJhNzAiLAogICAgICIxODNlNjRmMzc2NzBkYzEzY2EwZDI4OTk1YTMwNTNmMzc0MDk1NGRkY2U0NDMyMWE0MWU0NjUzNGNmNDRlNjMyIgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAzCiAgIH0sCiAgICJ0aW1lc3RhbXAiOiB7CiAgICAia2V5aWRzIjogWwogICAgICIwYzg3NDMyYzNiZjA5ZmQ5OTE4OWZkYzMyZmE1ZWFlZGY0ZTRhNWZhYzdiYWI3M2ZhMDRhMmUwZmM2NGFmNmY1IgogICAgXSwKICAgICJ0aHJlc2hvbGQiOiAxLAogICAgIngtdHVmLW9uLWNpLWV4cGlyeS1wZXJpb2QiOiA3LAogICAgIngtdHVmLW9uLWNpLXNpZ25pbmctcGVyaW9kIjogNgogICB9CiAgfSwKICAic3BlY192ZXJzaW9uIjogIjEuMCIsCiAgInZlcnNpb24iOiAxMywKICAieC10dWYtb24tY2ktZXhwaXJ5LXBlcmlvZCI6IDE5NywKICAieC10dWYtb24tY2ktc2lnbmluZy1wZXJpb2QiOiA0NgogfQp9",targets:{"trusted_root.json":"ewogICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRldi5zaWdzdG9yZS50cnVzdGVkcm9vdCtqc29uO3ZlcnNpb249MC4xIiwKICAidGxvZ3MiOiBbCiAgICB7CiAgICAgICJiYXNlVXJsIjogImh0dHBzOi8vcmVrb3Iuc2lnc3RvcmUuZGV2IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUyRzJZKzJ0YWJkVFY1QmNHaUJJeDBhOWZBRndya0JibUxTR3RrczRMM3FYNnlZWTB6dWZCbmhDOFVyL2l5NTVHaFdQLzlBL2JZMkxoQzMwTTkrUll0dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDEtMTJUMTE6NTM6MjdaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJ3Tkk5YXRRR2x6K1ZXZk82TFJ5Z0g0UVVmWS84VzRSRndpVDVpNVdSZ0IwPSIKICAgICAgfQogICAgfQogIF0sCiAgImNlcnRpZmljYXRlQXV0aG9yaXRpZXMiOiBbCiAgICB7CiAgICAgICJzdWJqZWN0IjogewogICAgICAgICJvcmdhbml6YXRpb24iOiAic2lnc3RvcmUuZGV2IiwKICAgICAgICAiY29tbW9uTmFtZSI6ICJzaWdzdG9yZSIKICAgICAgfSwKICAgICAgInVyaSI6ICJodHRwczovL2Z1bGNpby5zaWdzdG9yZS5kZXYiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCK0RDQ0FYNmdBd0lCQWdJVE5Wa0Rab0Npb2ZQRHN5N2RmbTZnZUxidWh6QUtCZ2dxaGtqT1BRUURBekFxTVJVd0V3WURWUVFLRXd4emFXZHpkRzl5WlM1a1pYWXhFVEFQQmdOVkJBTVRDSE5wWjNOMGIzSmxNQjRYRFRJeE1ETXdOekF6TWpBeU9Wb1hEVE14TURJeU16QXpNakF5T1Zvd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRCMk1CQUdCeXFHU000OUFnRUdCU3VCQkFBaUEySUFCTFN5QTdJaTVrK3BOTzhaRVdZMHlsZW1XRG93T2tOYTNrTCtHWkU1WjVHV2VoTDkvQTliUk5BM1JicnNaNWkwSmNhc3RhUkw3U3A1ZnAvakQ1ZHhxYy9VZFRWbmx2UzE2YW4rMllmc3dlL1F1TG9sUlVDcmNPRTIrMmlBNSt0emQ2Tm1NR1F3RGdZRFZSMFBBUUgvQkFRREFnRUdNQklHQTFVZEV3RUIvd1FJTUFZQkFmOENBUUV3SFFZRFZSME9CQllFRk1qRkhRQkJtaVFwTWxFazZ3MnVTdTFLQnRQc01COEdBMVVkSXdRWU1CYUFGTWpGSFFCQm1pUXBNbEVrNncydVN1MUtCdFBzTUFvR0NDcUdTTTQ5QkFNREEyZ0FNR1VDTUg4bGlXSmZNdWk2dlhYQmhqRGdZNE13c2xtTi9USnhWZS84M1dyRm9td21OZjA1NnkxWDQ4RjljNG0zYTNvelhBSXhBS2pSYXk1L2FqL2pzS0tHSWttUWF0akk4dXVwSHIvK0N4RnZhSldtcFlxTmtMREdSVSs5b3J6aDVoSTJScmN1YVE9PSIKICAgICAgICAgIH0KICAgICAgICBdCiAgICAgIH0sCiAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAic3RhcnQiOiAiMjAyMS0wMy0wN1QwMzoyMDoyOVoiLAogICAgICAgICJlbmQiOiAiMjAyMi0xMi0zMVQyMzo1OTo1OS45OTlaIgogICAgICB9CiAgICB9LAogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly9mdWxjaW8uc2lnc3RvcmUuZGV2IiwKICAgICAgImNlcnRDaGFpbiI6IHsKICAgICAgICAiY2VydGlmaWNhdGVzIjogWwogICAgICAgICAgewogICAgICAgICAgICAicmF3Qnl0ZXMiOiAiTUlJQ0dqQ0NBYUdnQXdJQkFnSVVBTG5WaVZmblUwYnJKYXNtUmtIcm4vVW5mYVF3Q2dZSUtvWkl6ajBFQXdNd0tqRVZNQk1HQTFVRUNoTU1jMmxuYzNSdmNtVXVaR1YyTVJFd0R3WURWUVFERXdoemFXZHpkRzl5WlRBZUZ3MHlNakEwTVRNeU1EQTJNVFZhRncwek1URXdNRFV4TXpVMk5UaGFNRGN4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWVNQndHQTFVRUF4TVZjMmxuYzNSdmNtVXRhVzUwWlhKdFpXUnBZWFJsTUhZd0VBWUhLb1pJemowQ0FRWUZLNEVFQUNJRFlnQUU4UlZTL3lzSCtOT3Z1RFp5UEladGlsZ1VGOU5sYXJZcEFkOUhQMXZCQkgxVTVDVjc3TFNTN3MwWmlING5FN0h2N3B0UzZMdnZSL1NUazc5OExWZ016TGxKNEhlSWZGM3RIU2FleExjWXBTQVNyMWtTME4vUmdCSnovOWpXQ2lYbm8zc3dlVEFPQmdOVkhROEJBZjhFQkFNQ0FRWXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUhBd013RWdZRFZSMFRBUUgvQkFnd0JnRUIvd0lCQURBZEJnTlZIUTRFRmdRVTM5UHB6MVlrRVpiNXFOanBLRldpeGk0WVpEOHdId1lEVlIwakJCZ3dGb0FVV01BZVg1RkZwV2FwZXN5UW9aTWkwQ3JGeGZvd0NnWUlLb1pJemowRUF3TURad0F3WkFJd1BDc1FLNERZaVpZRFBJYURpNUhGS25meFh4NkFTU1ZtRVJmc3luWUJpWDJYNlNKUm5aVTg0LzlEWmRuRnZ2eG1BakJPdDZRcEJsYzRKLzBEeHZrVENxcGNsdnppTDZCQ0NQbmpkbElCM1B1M0J4c1BteWdVWTdJaTJ6YmRDZGxpaW93PSIKICAgICAgICAgIH0sCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlCOXpDQ0FYeWdBd0lCQWdJVUFMWk5BUEZkeEhQd2plRGxvRHd5WUNoQU8vNHdDZ1lJS29aSXpqMEVBd013S2pFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUkV3RHdZRFZRUURFd2h6YVdkemRHOXlaVEFlRncweU1URXdNRGN4TXpVMk5UbGFGdzB6TVRFd01EVXhNelUyTlRoYU1Db3hGVEFUQmdOVkJBb1RESE5wWjNOMGIzSmxMbVJsZGpFUk1BOEdBMVVFQXhNSWMybG5jM1J2Y21Vd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVQ3WGVGVDRyYjNQUUd3UzRJYWp0TGszL09sbnBnYW5nYUJjbFlwc1lCcjVpKzR5bkIwN2NlYjNMUDBPSU9aZHhleFg2OWM1aVZ1eUpSUStIejA1eWkrVUYzdUJXQWxIcGlTNXNoMCtIMkdIRTdTWHJrMUVDNW0xVHIxOUw5Z2c5MmpZekJoTUE0R0ExVWREd0VCL3dRRUF3SUJCakFQQmdOVkhSTUJBZjhFQlRBREFRSC9NQjBHQTFVZERnUVdCQlJZd0I1ZmtVV2xacWw2ekpDaGt5TFFLc1hGK2pBZkJnTlZIU01FR0RBV2dCUll3QjVma1VXbFpxbDZ6SkNoa3lMUUtzWEYrakFLQmdncWhrak9QUVFEQXdOcEFEQm1BakVBajFuSGVYWnArMTNOV0JOYStFRHNEUDhHMVdXZzF0Q01XUC9XSFBxcGFWbzBqaHN3ZU5GWmdTczBlRTd3WUk0cUFqRUEyV0I5b3Q5OHNJa29GM3ZaWWRkMy9WdFdCNWI5VE5NZWE3SXgvc3RKNVRmY0xMZUFCTEU0Qk5KT3NRNHZuQkhKIgogICAgICAgICAgfQogICAgICAgIF0KICAgICAgfSwKICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIyLTA0LTEzVDIwOjA2OjE1WiIKICAgICAgfQogICAgfQogIF0sCiAgImN0bG9ncyI6IFsKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi90ZXN0IiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUViZndSK1JKdWRYc2NnUkJScEtYMVhGRHkzUHl1ZER4ei9TZm5SaTFmVDhla3BmQmQyTzF1b3o3anIzWjhuS3p4QTY5RVVRK2VGQ0ZJM3pldWJQV1U3dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjEtMDMtMTRUMDA6MDA6MDBaIiwKICAgICAgICAgICJlbmQiOiAiMjAyMi0xMC0zMVQyMzo1OTo1OS45OTlaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICJDR0NTOENoUy8yaEYwZEZySjRTY1JXY1lyQlk5d3pqU2JlYThJZ1kyYjNJPSIKICAgICAgfQogICAgfSwKICAgIHsKICAgICAgImJhc2VVcmwiOiAiaHR0cHM6Ly9jdGZlLnNpZ3N0b3JlLmRldi8yMDIyIiwKICAgICAgImhhc2hBbGdvcml0aG0iOiAiU0hBMl8yNTYiLAogICAgICAicHVibGljS2V5IjogewogICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVpUFNsRmkwQ21GVGZFakNVcUY5SHVDRWNZWE5LQWFZYWxJSm1CWjh5eWV6UGpUcWh4cktCcE1uYW9jVnRMSkJJMWVNM3VYblF6UUdBSmRKNGdzOUZ5dz09IiwKICAgICAgICAia2V5RGV0YWlscyI6ICJQS0lYX0VDRFNBX1AyNTZfU0hBXzI1NiIsCiAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgInN0YXJ0IjogIjIwMjItMTAtMjBUMDA6MDA6MDBaIgogICAgICAgIH0KICAgICAgfSwKICAgICAgImxvZ0lkIjogewogICAgICAgICJrZXlJZCI6ICIzVDB3YXNiSEVUSmpHUjRjbVdjM0FxSktYcmplUEszL2g0cHlnQzhwN280PSIKICAgICAgfQogICAgfQogIF0sCiAgInRpbWVzdGFtcEF1dGhvcml0aWVzIjogWwogICAgewogICAgICAic3ViamVjdCI6IHsKICAgICAgICAib3JnYW5pemF0aW9uIjogInNpZ3N0b3JlLmRldiIsCiAgICAgICAgImNvbW1vbk5hbWUiOiAic2lnc3RvcmUtdHNhLXNlbGZzaWduZWQiCiAgICAgIH0sCiAgICAgICJ1cmkiOiAiaHR0cHM6Ly90aW1lc3RhbXAuc2lnc3RvcmUuZGV2L2FwaS92MS90aW1lc3RhbXAiLAogICAgICAiY2VydENoYWluIjogewogICAgICAgICJjZXJ0aWZpY2F0ZXMiOiBbCiAgICAgICAgICB7CiAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNSUlDRURDQ0FaYWdBd0lCQWdJVU9oTlVMd3lRWWU2OHdVTXZ5NHFPaXlvaml3d3dDZ1lJS29aSXpqMEVBd013T1RFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNU0F3SGdZRFZRUURFeGR6YVdkemRHOXlaUzEwYzJFdGMyVnNabk5wWjI1bFpEQWVGdzB5TlRBME1EZ3dOalU1TkROYUZ3MHpOVEEwTURZd05qVTVORE5hTUM0eEZUQVRCZ05WQkFvVERITnBaM04wYjNKbExtUmxkakVWTUJNR0ExVUVBeE1NYzJsbmMzUnZjbVV0ZEhOaE1IWXdFQVlIS29aSXpqMENBUVlGSzRFRUFDSURZZ0FFNHJhMlo4aEtOaWcyVDlrRmpDQVRvR0czMGpreStXUXYzQnpMK21LdmgxU0tOUi9Vd3V3c2ZOQ2c0c3J5b1lBZDhFNmlzb3ZWQTNNNGFvTmRtOVFEaTUwWjhuVEV5dnFnZkRQdFRJd1hJdGZpVy9BRmYxVjd1d2tia0FvajB4eGNvMm93YURBT0JnTlZIUThCQWY4RUJBTUNCNEF3SFFZRFZSME9CQllFRkluOWVVT0h6OUJsUnNNQ1JzY3NjMXQ5dE9zRE1COEdBMVVkSXdRWU1CYUFGSmpzQWU5L3UxSC8xSlVlYjRxSW1GTUhpYzYvTUJZR0ExVWRKUUVCL3dRTU1Bb0dDQ3NHQVFVRkJ3TUlNQW9HQ0NxR1NNNDlCQU1EQTJnQU1HVUNNRHRwc1YvNkthTzBxeUYvVU1zWDJhU1VYS1FGZG9HVHB0UUdjMGZ0cTFjc3VsSFBHRzZkc215TU5kM0pCK0czRVFJeEFPYWp2QmNqcEptS2I0TnYrMlRhb2o4VWM1K2I2aWg2RlhDQ0tyYVNxdXBlMDd6cXN3TWNYSlRlMWNFeHZIdnZsdz09IgogICAgICAgICAgfSwKICAgICAgICAgIHsKICAgICAgICAgICAgInJhd0J5dGVzIjogIk1JSUI5ekNDQVh5Z0F3SUJBZ0lVVjdmMEdMRE9vRXpJaDhMWFNXODBPSmlVcDE0d0NnWUlLb1pJemowRUF3TXdPVEVWTUJNR0ExVUVDaE1NYzJsbmMzUnZjbVV1WkdWMk1TQXdIZ1lEVlFRREV4ZHphV2R6ZEc5eVpTMTBjMkV0YzJWc1puTnBaMjVsWkRBZUZ3MHlOVEEwTURnd05qVTVORE5hRncwek5UQTBNRFl3TmpVNU5ETmFNRGt4RlRBVEJnTlZCQW9UREhOcFozTjBiM0psTG1SbGRqRWdNQjRHQTFVRUF4TVhjMmxuYzNSdmNtVXRkSE5oTFhObGJHWnphV2R1WldRd2RqQVFCZ2NxaGtqT1BRSUJCZ1VyZ1FRQUlnTmlBQVFVUU50ZlJUL291M1lBVGE2d0Iva0tUZTcwY2ZKd3lSSUJvdk1udDhSY0pwaC9DT0U4MnV5UzZGbXBwTExMMVZCUEdjUGZwUVBZSk5Yeld3aThpY3doS1E2Vy9RZTJoM29lYkJiMkZIcHdOSkRxbytUTWFDL3RkZmt2L0VsSkI3MmpSVEJETUE0R0ExVWREd0VCL3dRRUF3SUJCakFTQmdOVkhSTUJBZjhFQ0RBR0FRSC9BZ0VBTUIwR0ExVWREZ1FXQkJTWTdBSHZmN3RSLzlTVkhtK0tpSmhUQjRuT3Z6QUtCZ2dxaGtqT1BRUURBd05wQURCbUFqRUF3R0VHcmZHWlIxY2VuMVI4L0RUVk1JOTQzTHNzWm1KUnREcC9pN1NmR0htR1JQNmdSYnVqOXZPSzNiNjdaMFFRQWpFQXVUMkg2NzNMUUVhSFRjeVFTWnJrcDRtWDdXd2ttRitzVmJrWVk1bVhOK1JNSDEzS1VFSEhPcUFTYWVtWVdLL0UiCiAgICAgICAgICB9CiAgICAgICAgXQogICAgICB9LAogICAgICAidmFsaWRGb3IiOiB7CiAgICAgICAgInN0YXJ0IjogIjIwMjUtMDctMDRUMDA6MDA6MDBaIgogICAgICB9CiAgICB9CiAgXQp9Cg==","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiLAogICAgICAgICAgICAgICAgICAgICJlbmQiOiAiMjAyNS0wMS0yOVQwMDowMDowMC4wMDBaIgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICB7CiAgICAgICAgICAgICJrZXlJZCI6ICJTSEEyNTY6amwzYndzd3U4MFBqam9rQ2doMG8ydzVjMlU0TGhRQUU1N2dqOWN6MWt6QSIsCiAgICAgICAgICAgICJrZXlVc2FnZSI6ICJucG06YXR0ZXN0YXRpb25zIiwKICAgICAgICAgICAgInB1YmxpY0tleSI6IHsKICAgICAgICAgICAgICAgICJyYXdCeXRlcyI6ICJNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUxT2xiM3pNQUZGeFhLSGlJa1FPNWNKM1lobDVpNlVQcCtJaHV0ZUJKYnVIY0E1VW9nS28wRVd0bFd3VzZLU2FLb1RORVlMN0psQ1FpVm5raEJrdFVnZz09IiwKICAgICAgICAgICAgICAgICJrZXlEZXRhaWxzIjogIlBLSVhfRUNEU0FfUDI1Nl9TSEFfMjU2IiwKICAgICAgICAgICAgICAgICJ2YWxpZEZvciI6IHsKICAgICAgICAgICAgICAgICAgICAic3RhcnQiOiAiMjAyMi0xMi0wMVQwMDowMDowMC4wMDBaIiwKICAgICAgICAgICAgICAgICAgICAiZW5kIjogIjIwMjUtMDEtMjlUMDA6MDA6MDAuMDAwWiIKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OkRoUTh3UjVBUEJ2RkhMRi8rVGMrQVl2UE9kVHBjSURxT2h4c0JIUndDN1UiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpEaFE4d1I1QVBCdkZITEYvK1RjK0FZdlBPZFRwY0lEcU9oeHNCSFJ3QzdVIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRVk2WWE3VysrN2FVUHp2TVRyZXpINlljeDNjK0hPS1lDY05HeWJKWlNDSnEvZmQ3UWE4dXVBS3RkSWtVUXRRaUVLRVJoQW1FNWxNTUpoUDhPa0RPYTJnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDI1LTAxLTEzVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}});var kU=d(ea=>{"use strict";var BU=ea&&ea.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ea,"__esModule",{value:!0});ea.TUFClient=void 0;var ts=BU(require("fs")),Nu=BU(require("path")),oae=xU(),aae=sm(),cae=LU(),J0="targets",W0=class{static{o(this,"TUFClient")}constructor(e){let t=new URL(e.mirrorURL),r=encodeURIComponent(t.host+t.pathname.replace(/\/$/,"")),s=Nu.default.join(e.cachePath,r);uae(s),lae({cachePath:s,mirrorURL:e.mirrorURL,tufRootPath:e.rootPath,forceInit:e.forceInit}),this.updater=hae({mirrorURL:e.mirrorURL,cachePath:s,forceCache:e.forceCache,retry:e.retry,timeout:e.timeout})}async refresh(){return this.updater.refresh()}getTarget(e){return(0,cae.readTarget)(this.updater,e)}};ea.TUFClient=W0;function uae(i){let e=Nu.default.join(i,J0);ts.default.existsSync(i)||ts.default.mkdirSync(i,{recursive:!0}),ts.default.existsSync(e)||ts.default.mkdirSync(e)}o(uae,"initTufCache");function lae({cachePath:i,mirrorURL:e,tufRootPath:t,forceInit:r}){let s=Nu.default.join(i,"root.json");if(!ts.default.existsSync(s)||r)if(t)ts.default.copyFileSync(t,s);else{let a=MU()[e];if(!a)throw new aae.TUFError({code:"TUF_INIT_CACHE_ERROR",message:`No root.json found for mirror: ${e}`});ts.default.writeFileSync(s,Buffer.from(a["root.json"],"base64")),Object.entries(a.targets).forEach(([c,u])=>{ts.default.writeFileSync(Nu.default.join(i,J0,c),Buffer.from(u,"base64"))})}}o(lae,"seedCache");function hae(i){let e={fetchTimeout:i.timeout,fetchRetry:i.retry};return new oae.Updater({metadataBaseUrl:i.mirrorURL,targetBaseUrl:`${i.mirrorURL}/targets`,metadataDir:i.cachePath,targetDir:Nu.default.join(i.cachePath,J0),forceCache:i.forceCache,config:e})}o(hae,"initClient")});var sm=d(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.TUFError=hr.DEFAULT_MIRROR_URL=void 0;hr.getTrustedRoot=Eae;hr.initTUF=wae;var fae=su(),dae=IF(),pae=kU();hr.DEFAULT_MIRROR_URL="https://tuf-repo-cdn.sigstore.dev";var mae="sigstore-js",gae={retries:2},yae=5e3,Sae="trusted_root.json";async function Eae(i={}){let t=await FU(i).getTarget(Sae);return fae.TrustedRoot.fromJSON(JSON.parse(t))}o(Eae,"getTrustedRoot");async function wae(i={}){let e=FU(i);return e.refresh().then(()=>e)}o(wae,"initTUF");function FU(i){return new pae.TUFClient({cachePath:i.cachePath||(0,dae.appDataPath)(mae),rootPath:i.rootPath,mirrorURL:i.mirrorURL||hr.DEFAULT_MIRROR_URL,retry:i.retry??gae,timeout:i.timeout??yae,forceCache:i.forceCache??!1,forceInit:i.forceInit??i.force??!1})}o(FU,"createClient");var _ae=G0();Object.defineProperty(hr,"TUFError",{enumerable:!0,get:o(function(){return _ae.TUFError},"get")})});var UU=d(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.DSSESignatureContent=void 0;var Pu=ot(),K0=class{static{o(this,"DSSESignatureContent")}constructor(e){this.env=e}compareDigest(e){return Pu.crypto.bufferEqual(e,Pu.crypto.digest("sha256",this.env.payload))}compareSignature(e){return Pu.crypto.bufferEqual(e,this.signature)}verifySignature(e){return Pu.crypto.verify(this.preAuthEncoding,e,this.signature)}get signature(){return this.env.signatures.length>0?this.env.signatures[0].sig:Buffer.from("")}get preAuthEncoding(){return Pu.dsse.preAuthEncoding(this.env.payloadType,this.env.payload)}};nm.DSSESignatureContent=K0});var jU=d(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.MessageSignatureContent=void 0;var Z0=ot(),Y0=class{static{o(this,"MessageSignatureContent")}constructor(e,t){this.signature=e.signature,this.messageDigest=e.messageDigest.digest,this.artifact=t}compareSignature(e){return Z0.crypto.bufferEqual(e,this.signature)}compareDigest(e){return Z0.crypto.bufferEqual(e,this.messageDigest)}verifySignature(e){return Z0.crypto.verify(this.artifact,e,this.signature)}};om.MessageSignatureContent=Y0});var qU=d(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.toSignedEntity=Oae;am.signatureContent=$U;var X0=ot(),bae=UU(),Iae=jU();function Oae(i,e){let{tlogEntries:t,timestampVerificationData:r}=i.verificationMaterial,s=[];for(let n of t)s.push({$case:"transparency-log",tlogEntry:n});for(let n of r?.rfc3161Timestamps??[])s.push({$case:"timestamp-authority",timestamp:X0.RFC3161Timestamp.parse(n.signedTimestamp)});return{signature:$U(i,e),key:vae(i),tlogEntries:t,timestamps:s}}o(Oae,"toSignedEntity");function $U(i,e){switch(i.content.$case){case"dsseEnvelope":return new bae.DSSESignatureContent(i.content.dsseEnvelope);case"messageSignature":return new Iae.MessageSignatureContent(i.content.messageSignature,e)}}o($U,"signatureContent");function vae(i){switch(i.verificationMaterial.content.$case){case"publicKey":return{$case:"public-key",hint:i.verificationMaterial.content.publicKey.hint};case"x509CertificateChain":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.x509CertificateChain.certificates[0].rawBytes)};case"certificate":return{$case:"certificate",certificate:X0.X509Certificate.parse(i.verificationMaterial.content.certificate.rawBytes)}}}o(vae,"key")});var Pe=d(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.PolicyError=ta.VerificationError=void 0;var cm=class extends Error{static{o(this,"BaseError")}constructor({code:e,message:t,cause:r}){super(t),this.code=e,this.cause=r,this.name=this.constructor.name}},Q0=class extends cm{static{o(this,"VerificationError")}};ta.VerificationError=Q0;var eI=class extends cm{static{o(this,"PolicyError")}};ta.PolicyError=eI});var VU=d(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.filterCertAuthorities=Rae;um.filterTLogAuthorities=Aae;function Rae(i,e){return i.filter(t=>t.validFor.start<=e&&t.validFor.end>=e)}o(Rae,"filterCertAuthorities");function Aae(i,e){return i.filter(t=>e.logID&&!t.logID.equals(e.logID)?!1:t.validFor.start<=e.targetDate&&e.targetDate<=t.validFor.end)}o(Aae,"filterTLogAuthorities")});var on=d(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.filterTLogAuthorities=nn.filterCertAuthorities=void 0;nn.toTrustMaterial=Cae;var tI=ot(),Du=su(),Tae=Pe(),iI=new Date(0),rI=new Date(864e13),GU=VU();Object.defineProperty(nn,"filterCertAuthorities",{enumerable:!0,get:o(function(){return GU.filterCertAuthorities},"get")});Object.defineProperty(nn,"filterTLogAuthorities",{enumerable:!0,get:o(function(){return GU.filterTLogAuthorities},"get")});function Cae(i,e){let t=typeof e=="function"?e:Nae(e);return{certificateAuthorities:i.certificateAuthorities.map(HU),timestampAuthorities:i.timestampAuthorities.map(HU),tlogs:i.tlogs.map(zU),ctlogs:i.ctlogs.map(zU),publicKey:t}}o(Cae,"toTrustMaterial");function zU(i){let e=i.publicKey.keyDetails,t=e===Du.PublicKeyDetails.PKCS1_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V5||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_2048_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_3072_SHA256||e===Du.PublicKeyDetails.PKIX_RSA_PKCS1V15_4096_SHA256?"pkcs1":"spki";return{logID:i.logId.keyId,publicKey:tI.crypto.createPublicKey(i.publicKey.rawBytes,t),validFor:{start:i.publicKey.validFor?.start||iI,end:i.publicKey.validFor?.end||rI}}}o(zU,"createTLogAuthority");function HU(i){return{certChain:i.certChain.certificates.map(e=>tI.X509Certificate.parse(e.rawBytes)),validFor:{start:i.validFor?.start||iI,end:i.validFor?.end||rI}}}o(HU,"createCertAuthority");function Nae(i){return e=>{let t=(i||{})[e];if(!t)throw new Tae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:tI.crypto.createPublicKey(t.rawBytes),validFor:o(r=>(t.validFor?.start||iI)<=r&&(t.validFor?.end||rI)>=r,"validFor")}}}o(Nae,"keyLocator")});var sI=d(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.CertificateChainVerifier=void 0;xu.verifyCertificateChain=Dae;var is=Pe(),Pae=on();function Dae(i,e,t){let r=(0,Pae.filterCertAuthorities)(t,i),s;for(let n of r)try{return new lm({trustedCerts:n.certChain,untrustedCert:e,timestamp:i}).verify()}catch(a){s=a}throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"Failed to verify certificate chain",cause:s})}o(Dae,"verifyCertificateChain");var lm=class{static{o(this,"CertificateChainVerifier")}constructor(e){this.untrustedCert=e.untrustedCert,this.trustedCerts=e.trustedCerts,this.localCerts=xae([...e.trustedCerts,e.untrustedCert]),this.timestamp=e.timestamp}verify(){let e=this.sort();if(this.checkPath(e),!e.every(r=>r.validForDate(this.timestamp)))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate is not valid or expired at the specified date"});return e}sort(){let e=this.untrustedCert,t=this.buildPaths(e);if(t=t.filter(s=>s.some(n=>this.trustedCerts.includes(n))),t.length===0)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"no trusted certificate path found"});let r=t.reduce((s,n)=>s.length<n.length?s:n);return[e,...r].slice(0,-1)}buildPaths(e){let t=[],r=this.findIssuer(e);if(r.length===0)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"no valid certificate path found"});for(let s=0;s<r.length;s++){let n=r[s];if(n.equals(e)){t.push([e]);continue}let a=this.buildPaths(n);for(let c=0;c<a.length;c++)t.push([n,...a[c]])}return t}findIssuer(e){let t=[],r;return e.subject.equals(e.issuer)&&e.verify()?[e]:(e.extAuthorityKeyID&&(r=e.extAuthorityKeyID.keyIdentifier),this.localCerts.forEach(s=>{if(r&&s.extSubjectKeyID){s.extSubjectKeyID.keyIdentifier.equals(r)&&t.push(s);return}s.subject.equals(e.issuer)&&t.push(s)}),t=t.filter(s=>{try{return e.verify(s)}catch{return!1}}),t)}checkPath(e){if(e.length<1)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"certificate chain must contain at least one certificate"});if(!e.slice(1).every(r=>r.isCA))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"intermediate certificate is not a CA"});for(let r=e.length-2;r>=0;r--)if(!e[r].issuer.equals(e[r+1].subject))throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"incorrect certificate name chaining"});for(let r=0;r<e.length;r++){let s=e[r];if(s.extBasicConstraints?.isCA){let n=s.extBasicConstraints.pathLenConstraint;if(n!==void 0&&n<r-1)throw new is.VerificationError({code:"CERTIFICATE_ERROR",message:"path length constraint exceeded"})}}}};xu.CertificateChainVerifier=lm;function xae(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)i[e].equals(i[t])&&(i.splice(t,1),t--);return i}o(xae,"dedupeCertificates")});var WU=d(nI=>{"use strict";Object.defineProperty(nI,"__esModule",{value:!0});nI.verifySCTs=Bae;var hm=ot(),Lae=Pe(),Mae=on();function Bae(i,e,t){let r,s=i.clone();for(let u=0;u<s.extensions.length;u++){let l=s.extensions[u];if(l.subs[0].toOID()===hm.EXTENSION_OID_SCT){r=new hm.X509SCTExtension(l),s.extensions.splice(u,1);break}}if(!r)return[];if(r.signedCertificateTimestamps.length===0)return[];let n=new hm.ByteStream,a=hm.crypto.digest("sha256",e.publicKey);n.appendView(a);let c=s.tbsCertificate.toDER();return n.appendUint24(c.length),n.appendView(c),r.signedCertificateTimestamps.map(u=>{if(!(0,Mae.filterTLogAuthorities)(t,{logID:u.logID,targetDate:u.datetime}).some(f=>u.verify(n.buffer,f.publicKey)))throw new Lae.VerificationError({code:"CERTIFICATE_ERROR",message:"SCT verification failed"});return u.logID})}o(Bae,"verifySCTs")});var JU=d(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.verifyPublicKey=Vae;fm.verifyCertificate=zae;var kae=ot(),Fae=Pe(),Uae=sI(),jae=WU(),$ae="1.3.6.1.4.1.57264.1.1",qae="1.3.6.1.4.1.57264.1.8";function Vae(i,e,t){let r=t.publicKey(i);return e.forEach(s=>{if(!r.validFor(s))throw new Fae.VerificationError({code:"PUBLIC_KEY_ERROR",message:`Public key is not valid for timestamp: ${s.toISOString()}`})}),{key:r.publicKey}}o(Vae,"verifyPublicKey");function zae(i,e,t){let r=[];return e.forEach(s=>{r=(0,Uae.verifyCertificateChain)(s,i,t.certificateAuthorities)}),{scts:(0,jae.verifySCTs)(r[0],r[1],t.ctlogs),signer:Hae(r[0])}}o(zae,"verifyCertificate");function Hae(i){let e,t=i.extension(qae);t?e=t.valueObj.subs?.[0]?.value.toString("ascii"):e=i.extension($ae)?.value.toString("ascii");let r={extensions:{issuer:e},subjectAlternativeName:i.subjectAltName};return{key:kae.crypto.createPublicKey(i.publicKey),identity:r}}o(Hae,"getSigner")});var ZU=d(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.verifySubjectAlternativeName=Gae;dm.verifyExtensions=Wae;var KU=Pe();function Gae(i,e){if(e===void 0||!e.match(i))throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`certificate identity error - expected ${i}, got ${e}`})}o(Gae,"verifySubjectAlternativeName");function Wae(i,e={}){let t;for(t in i)if(e[t]!==i[t])throw new KU.PolicyError({code:"UNTRUSTED_SIGNER_ERROR",message:`invalid certificate extension - expected ${t}=${i[t]}, got ${t}=${e[t]}`})}o(Wae,"verifyExtensions")});var YU=d(lI=>{"use strict";Object.defineProperty(lI,"__esModule",{value:!0});lI.verifyCheckpoint=Zae;var aI=ot(),ia=Pe(),Jae=on(),oI=`
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
`);if(t.length<3)throw new ha.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let r=t[0],s=BigInt(t[1]),n=Buffer.from(t[2],"base64"),a=t.slice(3);return new i(r,s,n,a)}}});var Oj=d(NI=>{"use strict";Object.defineProperty(NI,"__esModule",{value:!0});NI.verifyMerkleInclusion=Gce;var TI=ut(),RI=xe(),zce=Buffer.from([0]),Hce=Buffer.from([1]);function Gce(i){let e=i.inclusionProof,t=BigInt(e.logIndex),r=BigInt(e.treeSize);if(t<0n||t>=r)throw new RI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${t}`});let{inner:s,border:n}=Wce(t,r);if(e.hashes.length!==s+n)throw new RI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let a=e.hashes.slice(0,s),c=e.hashes.slice(s),u=Qce(i.canonicalizedBody),l=Kce(Jce(u,a,t),c);if(!TI.crypto.bufferEqual(l,e.rootHash))throw new RI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(Gce,"verifyMerkleInclusion");function Wce(i,e){let t=Zce(i,e),r=Yce(i>>BigInt(t));return{inner:t,border:r}}o(Wce,"decompInclProof");function Jce(i,e,t){return e.reduce((r,s,n)=>t>>BigInt(n)&BigInt(1)?AI(s,r):AI(r,s),i)}o(Jce,"chainInner");function Kce(i,e){return e.reduce((t,r)=>AI(r,t),i)}o(Kce,"chainBorderRight");function Zce(i,e){return Xce(i^e-BigInt(1))}o(Zce,"innerProofSize");function Yce(i){return i.toString(2).split("1").length-1}o(Yce,"onesCount");function Xce(i){return i===0n?0:i.toString(2).length}o(Xce,"bitLength");function AI(i,e){return TI.crypto.digest("sha256",Hce,i,e)}o(AI,"hashChildren");function Qce(i){return TI.crypto.digest("sha256",zce,i)}o(Qce,"hashLeaf")});var Cj=d(PI=>{"use strict";Object.defineProperty(PI,"__esModule",{value:!0});PI.verifyTLogSET=iue;var vj=ut(),eue=xe(),tue=fn();function iue(i,e){if(!(0,tue.filterTLogAuthorities)(e,{logID:i.logId.keyId,targetDate:new Date(Number(i.integratedTime)*1e3)}).some(s=>{let n=rue(i),a=Buffer.from(vj.json.canonicalize(n),"utf8"),c=i.inclusionPromise.signedEntryTimestamp;return vj.crypto.verify(a,s.publicKey,c)}))throw new eue.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(iue,"verifyTLogSET");function rue(i){let{integratedTime:e,logIndex:t,logId:r,canonicalizedBody:s}=i;return{body:s.toString("base64"),integratedTime:Number(e),logIndex:Number(t),logID:r.keyId.toString("hex")}}o(rue,"toVerificationPayload")});var Aj=d(xI=>{"use strict";Object.defineProperty(xI,"__esModule",{value:!0});xI.verifyRFC3161Timestamp=oue;var DI=ut(),Rj=xe(),sue=wI(),nue=fn();function oue(i,e,t){let r=i.signingTime;if(t=(0,nue.filterCertAuthorities)(t,r),t=cue(t,{serialNumber:i.signerSerialNumber,issuer:i.signerIssuer}),!t.some(n=>{try{return aue(i,e,n),!0}catch{return!1}}))throw new Rj.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}o(oue,"verifyRFC3161Timestamp");function aue(i,e,t){let[r,...s]=t.certChain,n=DI.crypto.createPublicKey(r.publicKey),a=i.signingTime;try{new sue.CertificateChainVerifier({untrustedCert:r,trustedCerts:s,timestamp:a}).verify()}catch{throw new Rj.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}i.verify(e,n)}o(aue,"verifyTimestampForCA");function cue(i,e){return i.filter(t=>t.certChain.length>0&&DI.crypto.bufferEqual(t.certChain[0].serialNumber,e.serialNumber)&&DI.crypto.bufferEqual(t.certChain[0].issuer,e.issuer))}o(cue,"filterCAsBySerialAndIssuer")});var Tj=d(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.verifyTSATimestamp=pue;Cm.verifyTLogTimestamp=mue;var uue=xe(),lue=Ij(),hue=Oj(),fue=Cj(),due=Aj();function pue(i,e,t){return(0,due.verifyRFC3161Timestamp)(i,e,t),{type:"timestamp-authority",logID:i.signerSerialNumber,timestamp:i.signingTime}}o(pue,"verifyTSATimestamp");function mue(i,e){let t=!1;if(gue(i)&&((0,fue.verifyTLogSET)(i,e),t=!0),yue(i)&&((0,hue.verifyMerkleInclusion)(i),(0,lue.verifyCheckpoint)(i,e),t=!0),!t)throw new uue.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:i.logId.keyId,timestamp:new Date(Number(i.integratedTime)*1e3)}}o(mue,"verifyTLogTimestamp");function gue(i){return i.inclusionPromise!==void 0}o(gue,"isTLogEntryWithInclusionPromise");function yue(i){return i.inclusionProof!==void 0}o(yue,"isTLogEntryWithInclusionProof")});var Nj=d(LI=>{"use strict";Object.defineProperty(LI,"__esModule",{value:!0});LI.verifyDSSETLogBody=Sue;var Rm=xe();function Sue(i,e){switch(i.apiVersion){case"0.0.1":return Eue(i,e);default:throw new Rm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${i.apiVersion}`})}}o(Sue,"verifyDSSETLogBody");function Eue(i,e){if(i.spec.signatures?.length!==1)throw new Rm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=i.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(t,"base64")))throw new Rm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new Rm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Eue,"verifyDSSE001TLogBody")});var Pj=d(BI=>{"use strict";Object.defineProperty(BI,"__esModule",{value:!0});BI.verifyHashedRekordTLogBody=wue;var MI=xe();function wue(i,e){switch(i.apiVersion){case"0.0.1":return _ue(i,e);default:throw new MI.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported hashedrekord version: ${i.apiVersion}`})}}o(wue,"verifyHashedRekordTLogBody");function _ue(i,e){let t=i.spec.signature.content||"";if(!e.compareSignature(Buffer.from(t,"base64")))throw new MI.VerificationError({code:"TLOG_BODY_ERROR",message:"signature mismatch"});let r=i.spec.data.hash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new MI.VerificationError({code:"TLOG_BODY_ERROR",message:"digest mismatch"})}o(_ue,"verifyHashedrekord001TLogBody")});var Dj=d(kI=>{"use strict";Object.defineProperty(kI,"__esModule",{value:!0});kI.verifyIntotoTLogBody=bue;var Am=xe();function bue(i,e){switch(i.apiVersion){case"0.0.2":return Iue(i,e);default:throw new Am.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported intoto version: ${i.apiVersion}`})}}o(bue,"verifyIntotoTLogBody");function Iue(i,e){if(i.spec.content.envelope.signatures?.length!==1)throw new Am.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=Oue(i.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(t,"base64")))throw new Am.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.content.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new Am.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Iue,"verifyIntoto002TLogBody");function Oue(i){return Buffer.from(i,"base64").toString("utf-8")}o(Oue,"base64Decode")});var Lj=d(FI=>{"use strict";Object.defineProperty(FI,"__esModule",{value:!0});FI.verifyTLogBody=Aue;var xj=xe(),vue=Nj(),Cue=Pj(),Rue=Dj();function Aue(i,e){let{kind:t,version:r}=i.kindVersion,s=JSON.parse(i.canonicalizedBody.toString("utf8"));if(t!==s.kind||r!==s.apiVersion)throw new xj.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${t}/${r}, received: ${s.kind}/${s.apiVersion}`});switch(s.kind){case"dsse":return(0,vue.verifyDSSETLogBody)(s,e);case"intoto":return(0,Rue.verifyIntotoTLogBody)(s,e);case"hashedrekord":return(0,Cue.verifyHashedRekordTLogBody)(s,e);default:throw new xj.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${t}`})}}o(Aue,"verifyTLogBody")});var Uj=d(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Verifier=void 0;var Tue=require("util"),fa=xe(),Mj=wj(),Bj=bj(),kj=Tj(),Nue=Lj(),UI=class{static{o(this,"Verifier")}constructor(e,t={}){this.trustMaterial=e,this.options={ctlogThreshold:t.ctlogThreshold??1,tlogThreshold:t.tlogThreshold??1,tsaThreshold:t.tsaThreshold??0}}verify(e,t){let r=this.verifyTimestamps(e),s=this.verifySigningKey(e,r);return this.verifyTLogs(e),this.verifySignature(e,s),t&&this.verifyPolicy(t,s.identity||{}),s}verifyTimestamps(e){let t=0,r=0,s=e.timestamps.map(n=>{switch(n.$case){case"timestamp-authority":return r++,(0,kj.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case"transparency-log":return t++,(0,kj.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(Fj(s))throw new fa.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(t<this.options.tlogThreshold)throw new fa.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${t}`});if(r<this.options.tsaThreshold)throw new fa.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${r}`});return s.map(n=>n.timestamp)}verifySigningKey({key:e},t){switch(e.$case){case"public-key":return(0,Mj.verifyPublicKey)(e.hint,t,this.trustMaterial);case"certificate":{let r=(0,Mj.verifyCertificate)(e.certificate,t,this.trustMaterial);if(Fj(r.scts))throw new fa.VerificationError({code:"CERTIFICATE_ERROR",message:"duplicate SCT"});if(r.scts.length<this.options.ctlogThreshold)throw new fa.VerificationError({code:"CERTIFICATE_ERROR",message:`expected ${this.options.ctlogThreshold} SCTs, got ${r.scts.length}`});return r.signer}}}verifyTLogs({signature:e,tlogEntries:t}){t.forEach(r=>(0,Nue.verifyTLogBody)(r,e))}verifySignature(e,t){if(!e.signature.verifySignature(t.key))throw new fa.VerificationError({code:"SIGNATURE_ERROR",message:"signature verification failed"})}verifyPolicy(e,t){e.subjectAlternativeName&&(0,Bj.verifySubjectAlternativeName)(e.subjectAlternativeName,t.subjectAlternativeName),e.extensions&&(0,Bj.verifyExtensions)(e.extensions,t.extensions)}};Tm.Verifier=UI;function Fj(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if((0,Tue.isDeepStrictEqual)(i[e],i[t]))return!0;return!1}o(Fj,"containsDupes")});var Nm=d(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.Verifier=Ht.toTrustMaterial=Ht.VerificationError=Ht.PolicyError=Ht.toSignedEntity=void 0;var Pue=pj();Object.defineProperty(Ht,"toSignedEntity",{enumerable:!0,get:o(function(){return Pue.toSignedEntity},"get")});var jj=xe();Object.defineProperty(Ht,"PolicyError",{enumerable:!0,get:o(function(){return jj.PolicyError},"get")});Object.defineProperty(Ht,"VerificationError",{enumerable:!0,get:o(function(){return jj.VerificationError},"get")});var Due=fn();Object.defineProperty(Ht,"toTrustMaterial",{enumerable:!0,get:o(function(){return Due.toTrustMaterial},"get")});var xue=Uj();Object.defineProperty(Ht,"Verifier",{enumerable:!0,get:o(function(){return xue.Verifier},"get")})});var $j=d(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.DEFAULT_TIMEOUT=Ye.DEFAULT_RETRY=void 0;Ye.createBundleBuilder=Bue;Ye.createKeyFinder=kue;Ye.createVerificationPolicy=Fue;var Lue=ut(),da=t0(),Mue=Nm();Ye.DEFAULT_RETRY={retries:2};Ye.DEFAULT_TIMEOUT=5e3;function Bue(i,e){let t={signer:Uue(e),witnesses:$ue(e)};switch(i){case"messageSignature":return new da.MessageSignatureBundleBuilder(t);case"dsseEnvelope":return new da.DSSEBundleBuilder({...t,certificateChain:e.legacyCompatibility})}}o(Bue,"createBundleBuilder");function kue(i){return e=>{let t=i(e);if(!t)throw new Mue.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:Lue.crypto.createPublicKey(t),validFor:o(()=>!0,"validFor")}}}o(kue,"createKeyFinder");function Fue(i){let e={},t=i.certificateIdentityEmail||i.certificateIdentityURI;return t&&(e.subjectAlternativeName=t),i.certificateIssuer&&(e.extensions={issuer:i.certificateIssuer}),e}o(Fue,"createVerificationPolicy");function Uue(i){return new da.FulcioSigner({fulcioBaseURL:i.fulcioURL,identityProvider:i.identityProvider||jue(i),retry:i.retry??Ye.DEFAULT_RETRY,timeout:i.timeout??Ye.DEFAULT_TIMEOUT})}o(Uue,"initSigner");function jue(i){let e=i.identityToken;return e?{getToken:o(()=>Promise.resolve(e),"getToken")}:new da.CIContextProvider("sigstore")}o(jue,"initIdentityProvider");function $ue(i){let e=[];return que(i)&&e.push(new da.RekorWitness({rekorBaseURL:i.rekorURL,entryType:i.legacyCompatibility?"intoto":"dsse",fetchOnConflict:!1,retry:i.retry??Ye.DEFAULT_RETRY,timeout:i.timeout??Ye.DEFAULT_TIMEOUT})),Vue(i)&&e.push(new da.TSAWitness({tsaBaseURL:i.tsaServerURL,retry:i.retry??Ye.DEFAULT_RETRY,timeout:i.timeout??Ye.DEFAULT_TIMEOUT})),e}o($ue,"initWitnesses");function que(i){return i.tlogUpload!==!1}o(que,"isRekorEnabled");function Vue(i){return i.tsaServerURL!==void 0}o(Vue,"isTSAEnabled")});var zj=d(Gt=>{"use strict";var zue=Gt&&Gt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Hue=Gt&&Gt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),qj=Gt&&Gt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&zue(t,e,r[s]);return Hue(t,e),t}})();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.sign=Wue;Gt.attest=Jue;Gt.verify=Kue;Gt.createVerifier=Vj;var $I=pu(),Gue=qj(gm()),jI=Nm(),pa=qj($j());async function Wue(i,e={}){let r=await pa.createBundleBuilder("messageSignature",e).create({data:i});return(0,$I.bundleToJSON)(r)}o(Wue,"sign");async function Jue(i,e,t={}){let s=await pa.createBundleBuilder("dsseEnvelope",t).create({data:i,type:e});return(0,$I.bundleToJSON)(s)}o(Jue,"attest");async function Kue(i,e,t){let r;return Buffer.isBuffer(e)?r=e:t=e,Vj(t).then(s=>s.verify(i,r))}o(Kue,"verify");async function Vj(i={}){let e=await Gue.getTrustedRoot({mirrorURL:i.tufMirrorURL,rootPath:i.tufRootPath,cachePath:i.tufCachePath,forceCache:i.tufForceCache,retry:i.retry??pa.DEFAULT_RETRY,timeout:i.timeout??pa.DEFAULT_TIMEOUT}),t=i.keySelector?pa.createKeyFinder(i.keySelector):void 0,r=(0,jI.toTrustMaterial)(e,t),s={ctlogThreshold:i.ctLogThreshold,tlogThreshold:i.tlogThreshold},n=new jI.Verifier(r,s),a=pa.createVerificationPolicy(i);return{verify:o((c,u)=>{let l=(0,$I.bundleFromJSON)(c),h=(0,jI.toSignedEntity)(l,u);n.verify(h,a)},"verify")}}o(Vj,"createVerifier")});var Gj=d(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.verify=ue.sign=ue.createVerifier=ue.attest=ue.VerificationError=ue.PolicyError=ue.TUFError=ue.InternalError=ue.DEFAULT_REKOR_URL=ue.DEFAULT_FULCIO_URL=ue.ValidationError=void 0;var Zue=pu();Object.defineProperty(ue,"ValidationError",{enumerable:!0,get:o(function(){return Zue.ValidationError},"get")});var qI=t0();Object.defineProperty(ue,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return qI.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(ue,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return qI.DEFAULT_REKOR_URL},"get")});Object.defineProperty(ue,"InternalError",{enumerable:!0,get:o(function(){return qI.InternalError},"get")});var Yue=gm();Object.defineProperty(ue,"TUFError",{enumerable:!0,get:o(function(){return Yue.TUFError},"get")});var Hj=Nm();Object.defineProperty(ue,"PolicyError",{enumerable:!0,get:o(function(){return Hj.PolicyError},"get")});Object.defineProperty(ue,"VerificationError",{enumerable:!0,get:o(function(){return Hj.VerificationError},"get")});var Pm=zj();Object.defineProperty(ue,"attest",{enumerable:!0,get:o(function(){return Pm.attest},"get")});Object.defineProperty(ue,"createVerifier",{enumerable:!0,get:o(function(){return Pm.createVerifier},"get")});Object.defineProperty(ue,"sign",{enumerable:!0,get:o(function(){return Pm.sign},"get")});Object.defineProperty(ue,"verify",{enumerable:!0,get:o(function(){return Pm.verify},"get")})});var GI=d((TOe,Yj)=>{var Xue=require("node:crypto"),Wj=nh(),Que=ih(),VI=hi(),ele=Hn(),tle=Gj(),zI=K_(),ile=Fs(),rle=hu(),Jj=Z_().version,Kj=lw(),Zj=ks(),sle="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",nle="application/json",ole="2015-01-01T00:00:00.000Z",HI=class extends ile{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=zI.pickRegistry(e,t),this.packumentUrl=`${Kj(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let r=new URL(this.registry),s=`//${r.host}${r.pathname}`;this.opts[`${s}:_keys`]&&(this.registryKeys=this.opts[`${s}:_keys`])}async resolve(){if(await this.manifest(),!this.resolved)throw Object.assign(new Error("Invalid package manifest: no `dist.tarball` field"),{package:this.spec.toString()});return this.resolved}#t(){return{"user-agent":this.opts.userAgent||`pacote/${Jj} node/${process.version}`,...this.opts.headers||{},"pacote-version":Jj,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?nle:sle}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await zI(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),r=e.headers.get("content-length");return r&&(t._contentLength=Number(r)),this.packumentCache?.set(this.#e,t),t}catch(e){if(this.packumentCache?.delete(this.#e),e.code!=="E404"||this.fullMetadata)throw e;return this.fullMetadata=!0,this.packument()}}async manifest(){if(this.package)return this.package;this.opts.verifySignatures&&(this.fullMetadata=!0);let e=await this.packument(),t=Wj.normalizeSteps.filter(a=>a!=="_attributes"),r=await new Wj().fromContent(Que(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[r.version];s&&(r._time=s);let{dist:n}=r;if(n){this.resolved=r._resolved=n.tarball,r._from=this.from;let a=n.integrity?VI.parse(n.integrity):n.shasum?VI.fromHex(n.shasum,"sha1",{...this.opts}):null;if(a){if(this.integrity&&!this.integrity.match(a)){for(let c of Object.keys(this.integrity))if(a[c])throw Object.assign(new Error(`Integrity checksum failed when using ${c}: wanted ${this.integrity} but got ${a}.`),{code:"EINTEGRITY"})}this.integrity=a}}if(this.integrity){if(r._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${r._id}:${r._integrity}`;for(let c of n.signatures){let u=this.registryKeys&&this.registryKeys.filter(m=>m.keyid===c.keyid)[0];if(!u)throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let l=Date.parse(r._time||ole);if(!(!u.expires||l<Date.parse(u.expires)))throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${u.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=Xue.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(u.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${r._id} has an invalid registry signature with keyid: ${u.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:u.keyid,signature:c.sig,resolved:r._resolved,integrity:r._integrity})}r._signatures=n.signatures}else r._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=Kj(this.registry)+a,u=await zI(c,{...this.opts,integrity:null}),{attestations:l}=await u.json(),h=l.map(({predicateType:m,bundle:y})=>{let g=JSON.parse(Buffer.from(y.dsseEnvelope.payload,"base64").toString("utf8")),S=y.dsseEnvelope.signatures[0].keyid,E=y.dsseEnvelope.signatures[0].sig;return{predicateType:m,bundle:y,statement:g,keyid:S,signature:E}}),f=h.map(m=>m.keyid).filter(m=>!!m),p=(this.registryKeys||[]).filter(m=>f.includes(m.keyid));if(!p.length)throw Object.assign(new Error(`${r._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:m,bundle:y,keyid:g,signature:S,statement:E}of h){let _=p.find(v=>v.keyid===g);if(g){if(!_)throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let v=new Date(Number(y.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!_.expires||v<Date.parse(_.expires)))throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but the corresponding public key has expired ${_.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let b={name:E.subject[0].name,sha512:E.subject[0].digest.sha512},w=this.spec.type==="version"?ele.toPurl(this.spec):this.spec;if(b.name!==w)throw Object.assign(new Error(`${r._id} package name and version (PURL): ${w} doesn't match what was signed: ${b.name}`),{code:"EATTESTATIONSUBJECT"});let I=VI.parse(this.integrity).hexDigest();if(b.sha512!==I)throw Object.assign(new Error(`${r._id} package integrity (hex digest): ${I} doesn't match what was signed: ${b.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let v={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:_?()=>_.pemkey:void 0};await tle.verify(y,v)}catch(v){throw Object.assign(new Error(`${r._id} failed to verify attestation: ${v.message}`),{code:"EATTESTATIONVERIFY",predicateType:m,keyid:g,signature:S,resolved:r._resolved,integrity:r._integrity})}}r._attestations=n.attestations}else r._attestations=n.attestations}return this.package=r,this.package}[Zj.tarballFromResolved](){return new rle(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[Zj.tarballFromResolved]()}get types(){return["tag","version","range"]}};Yj.exports=HI});var Fs=d((POe,r2)=>{var{basename:ale,dirname:Xj}=require("node:path"),{rm:cle,mkdir:Qj}=require("node:fs/promises"),t2=nh(),WI=bc(),ule=jn(),lle=HN(),i2=Hn(),hle=qa(),JI=hi(),fle=aw(),{Minipass:dle}=te(),{log:cs}=_t(),qu=ks(),e2=PD(),ple=uw(),mle=lw(),gle=o(i=>t2.prepare(i).then(e=>e.content),"packageJsonPrepare"),yle=o(i=>t2.normalize(i).then(e=>e.content),"packageJsonNormalize"),Dm=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=i2(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#i(),this.opts={...t},this.cache=t.cache||e2().cacache,this.tufCache=t.tufCache||e2().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=JI.parse(t.integrity)),this.package=null,this.type=this.constructor.name,this.fmode=t.fmode||438,this.dmode=t.dmode||511,this.umask=t.umask||0,this.preferOnline=!!t.preferOnline,this.preferOffline=!!t.preferOffline,this.offline=!!t.offline,this.before=t.before,this.fullMetadata=this.before?!0:!!t.fullMetadata,this.fullReadJson=!!t.fullReadJson,this[qu.readPackageJson]=this.fullReadJson?gle:yle,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=mle(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${Xj(this.cache)}`,`--prefer-offline=${!!this.preferOffline}`,`--prefer-online=${!!this.preferOnline}`,`--offline=${!!this.offline}`,...this.before?[`--before=${this.before.toISOString()}`]:[],"--no-progress","--no-save","--no-audit","--include=dev","--include=peer","--include=optional","--no-package-lock-only","--no-dry-run"]}get integrity(){return this.opts.integrity||null}set integrity(e){if(!e)return;e=JI.parse(e);let t=this.opts.integrity;t?t.merge(e):this.opts.integrity=e}get notImplementedError(){return new Error("not implemented in this fetcher type: "+this.type)}resolve(){return this.resolved?Promise.resolve(this.resolved):Promise.reject(this.notImplementedError)}packument(){return Promise.reject(this.notImplementedError)}manifest(){return Promise.reject(this.notImplementedError)}[qu.tarballFromResolved](){throw this.notImplementedError}tarball(){return this.tarballStream(e=>e.concat().then(t=>(t.integrity=this.integrity&&String(this.integrity),t.resolved=this.resolved,t.from=this.from,t)))}#e(){let e=Date.now(),t=WI.get.stream.byDigest(this.cache,this.integrity,this.opts),r=Date.now()-e;return cs.http("cache",`${this.spec} ${r}ms (cache hit)`),t}get[qu.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[qu.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=JI.integrityStream(this.opts);return s.on("integrity",n=>this.integrity=n),e.on("error",n=>s.emit("error",n)),e.pipe(s)}let t=new dle;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let r=WI.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return r.on("integrity",s=>this.integrity=s),r.on("error",s=>e.emit("error",s)),e.pipe(r),r.promise().catch(()=>{}).then(()=>t.end()),t}pickIntegrityAlgorithm(){return this.integrity?this.integrity.pickAlgorithm(this.opts):this.defaultIntegrityAlgorithm}isDataCorruptionError(e){return e.code==="EINTEGRITY"||e.code==="Z_DATA_ERROR"}get types(){return!1}#i(){if(this.types&&!this.types.includes(this.spec.type))throw new TypeError(`Wrong spec type (${this.spec.type}) for ${this.constructor.name}. Supported types: ${this.types.join(", ")}`)}isRetriableError(e){return this.isDataCorruptionError(e)||e.code==="ENOENT"||e.code==="EISDIR"}tarballStream(e){let t=!this.preferOnline&&this.integrity&&this.resolved?e(this.#e()).catch(s=>{if(this.isDataCorruptionError(s))return cs.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,r=o(s=>{if(s){if(!this.isRetriableError(s))throw s;cs.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>hle(n=>e(this.#t(this[qu.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return cs.warn("tarball",`tarball data for ${this.spec} (${this.integrity}) seems to be corrupted. Trying again.`),this.cleanupCached().then(()=>n(a));throw a}),{retries:1,minTimeout:0,maxTimeout:0}))},"fromResolved");return t?t.catch(r):r()}cleanupCached(){return WI.rm.content(this.cache,this.integrity,this.opts)}#r(e){return lle({path:e,depth:1}).then(t=>Promise.all(t.map(r=>cle(r,{recursive:!0,force:!0}))))}async#s(e){return await this.#r(e),await Qj(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#c(e,t))}#u(e){return this.tarballStream(t=>new Promise((r,s)=>{let n=new ule.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>r({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=Xj(e);return await Qj(t,{recursive:!0}),this.#u(e)}#c(e,t){let r=fle.x(this.#n({cwd:e})),s=new Promise((n,a)=>{r.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),r.on("error",c=>{cs.warn("tar",c.message),cs.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(r),s}#f(e,t,r){let s=/Directory|GNUDumpDir/.test(r)?this.dmode:/File$/.test(r)?this.fmode:0,n=ple(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#n({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((r,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#f(s.path,s.mode,s.type),/File$/.test(s.type)){let n=ale(s.path);if(n===".npmignore")t.add(s.path);else if(n===".gitignore"&&!this.allowGitIgnore){let a=s.path.replace(/\.gitignore$/,".npmignore");if(t.has(a))return!1;s.path=a}return!0}},"filter"),strip:1,onwarn:o((r,s,n)=>{cs.warn("tar",r,s),cs.silly("tar",r,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};r2.exports=Dm;var Sle=Q_(),Ele=GI(),wle=Eo(),_le=Kf(),ble=hu();Dm.get=(i,e={})=>{let t=i2(i,e.where);switch(t.type){case"git":return new Sle(t,e);case"remote":return new ble(t,e);case"version":case"range":case"tag":case"alias":return new Ele(t.subSpec||t,e);case"file":return new wle(t,e);case"directory":return new _le(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var{get:dn}=Fs(),Ile=Q_(),Ole=GI(),vle=Eo(),Cle=Kf(),Rle=hu(),KI=o((i,e)=>dn(i,e).tarball(),"tarball");KI.stream=(i,e,t)=>dn(i,t).tarballStream(e);KI.file=(i,e,t)=>dn(i,t).tarballFile(e);module.exports={GitFetcher:Ile,RegistryFetcher:Ole,FileFetcher:vle,DirFetcher:Cle,RemoteFetcher:Rle,resolve:o((i,e)=>dn(i,e).resolve(),"resolve"),extract:o((i,e,t)=>dn(i,t).extract(e),"extract"),manifest:o((i,e)=>dn(i,e).manifest(),"manifest"),packument:o((i,e)=>dn(i,e).packument(),"packument"),tarball:KI};
|
|
62
|
+
`,Kae=/\u2014 (\S+) (\S+)\n/g;function Zae(i,e){let t=(0,Jae.filterTLogAuthorities)(e,{targetDate:new Date(Number(i.integratedTime)*1e3)}),r=i.inclusionProof,s=cI.fromString(r.checkpoint.envelope),n=uI.fromString(s.note);if(!Yae(s,t))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!aI.crypto.bufferEqual(n.logHash,r.rootHash))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}o(Zae,"verifyCheckpoint");function Yae(i,e){let t=Buffer.from(i.note,"utf-8");return i.signatures.every(r=>{let s=e.find(n=>aI.crypto.bufferEqual(n.logID.subarray(0,4),r.keyHint));return s?aI.crypto.verify(t,s.publicKey,r.signature):!1})}o(Yae,"verifySignedNote");var cI=class i{static{o(this,"SignedNote")}constructor(e,t){this.note=e,this.signatures=t}static fromString(e){if(!e.includes(oI))throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let t=e.indexOf(oI),r=e.slice(0,t+1),n=e.slice(t+oI.length).matchAll(Kae),a=Array.from(n,c=>{let[,u,l]=c,h=Buffer.from(l,"base64");if(h.length<5)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:u,keyHint:h.subarray(0,4),signature:h.subarray(4)}});if(a.length===0)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new i(r,a)}},uI=class i{static{o(this,"LogCheckpoint")}constructor(e,t,r,s){this.origin=e,this.logSize=t,this.logHash=r,this.rest=s}static fromString(e){let t=e.trimEnd().split(`
|
|
63
|
+
`);if(t.length<3)throw new ia.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let r=t[0],s=BigInt(t[1]),n=Buffer.from(t[2],"base64"),a=t.slice(3);return new i(r,s,n,a)}}});var XU=d(pI=>{"use strict";Object.defineProperty(pI,"__esModule",{value:!0});pI.verifyMerkleInclusion=ece;var dI=ot(),hI=Pe(),Xae=Buffer.from([0]),Qae=Buffer.from([1]);function ece(i){let e=i.inclusionProof,t=BigInt(e.logIndex),r=BigInt(e.treeSize);if(t<0n||t>=r)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${t}`});let{inner:s,border:n}=tce(t,r);if(e.hashes.length!==s+n)throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let a=e.hashes.slice(0,s),c=e.hashes.slice(s),u=ace(i.canonicalizedBody),l=rce(ice(u,a,t),c);if(!dI.crypto.bufferEqual(l,e.rootHash))throw new hI.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}o(ece,"verifyMerkleInclusion");function tce(i,e){let t=sce(i,e),r=nce(i>>BigInt(t));return{inner:t,border:r}}o(tce,"decompInclProof");function ice(i,e,t){return e.reduce((r,s,n)=>t>>BigInt(n)&BigInt(1)?fI(s,r):fI(r,s),i)}o(ice,"chainInner");function rce(i,e){return e.reduce((t,r)=>fI(r,t),i)}o(rce,"chainBorderRight");function sce(i,e){return oce(i^e-BigInt(1))}o(sce,"innerProofSize");function nce(i){return i.toString(2).split("1").length-1}o(nce,"onesCount");function oce(i){return i===0n?0:i.toString(2).length}o(oce,"bitLength");function fI(i,e){return dI.crypto.digest("sha256",Qae,i,e)}o(fI,"hashChildren");function ace(i){return dI.crypto.digest("sha256",Xae,i)}o(ace,"hashLeaf")});var ej=d(mI=>{"use strict";Object.defineProperty(mI,"__esModule",{value:!0});mI.verifyTLogSET=lce;var QU=ot(),cce=Pe(),uce=on();function lce(i,e){if(!(0,uce.filterTLogAuthorities)(e,{logID:i.logId.keyId,targetDate:new Date(Number(i.integratedTime)*1e3)}).some(s=>{let n=hce(i),a=Buffer.from(QU.json.canonicalize(n),"utf8"),c=i.inclusionPromise.signedEntryTimestamp;return QU.crypto.verify(a,s.publicKey,c)}))throw new cce.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}o(lce,"verifyTLogSET");function hce(i){let{integratedTime:e,logIndex:t,logId:r,canonicalizedBody:s}=i;return{body:s.toString("base64"),integratedTime:Number(e),logIndex:Number(t),logID:r.keyId.toString("hex")}}o(hce,"toVerificationPayload")});var ij=d(yI=>{"use strict";Object.defineProperty(yI,"__esModule",{value:!0});yI.verifyRFC3161Timestamp=pce;var gI=ot(),tj=Pe(),fce=sI(),dce=on();function pce(i,e,t){let r=i.signingTime;if(t=(0,dce.filterCertAuthorities)(t,r),t=gce(t,{serialNumber:i.signerSerialNumber,issuer:i.signerIssuer}),!t.some(n=>{try{return mce(i,e,n),!0}catch{return!1}}))throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}o(pce,"verifyRFC3161Timestamp");function mce(i,e,t){let[r,...s]=t.certChain,n=gI.crypto.createPublicKey(r.publicKey),a=i.signingTime;try{new fce.CertificateChainVerifier({untrustedCert:r,trustedCerts:s,timestamp:a}).verify()}catch{throw new tj.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}i.verify(e,n)}o(mce,"verifyTimestampForCA");function gce(i,e){return i.filter(t=>t.certChain.length>0&&gI.crypto.bufferEqual(t.certChain[0].serialNumber,e.serialNumber)&&gI.crypto.bufferEqual(t.certChain[0].issuer,e.issuer))}o(gce,"filterCAsBySerialAndIssuer")});var rj=d(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.verifyTSATimestamp=bce;pm.verifyTLogTimestamp=Ice;var yce=Pe(),Sce=YU(),Ece=XU(),wce=ej(),_ce=ij();function bce(i,e,t){return(0,_ce.verifyRFC3161Timestamp)(i,e,t),{type:"timestamp-authority",logID:i.signerSerialNumber,timestamp:i.signingTime}}o(bce,"verifyTSATimestamp");function Ice(i,e){let t=!1;if(Oce(i)&&((0,wce.verifyTLogSET)(i,e),t=!0),vce(i)&&((0,Ece.verifyMerkleInclusion)(i),(0,Sce.verifyCheckpoint)(i,e),t=!0),!t)throw new yce.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:i.logId.keyId,timestamp:new Date(Number(i.integratedTime)*1e3)}}o(Ice,"verifyTLogTimestamp");function Oce(i){return i.inclusionPromise!==void 0}o(Oce,"isTLogEntryWithInclusionPromise");function vce(i){return i.inclusionProof!==void 0}o(vce,"isTLogEntryWithInclusionProof")});var sj=d(SI=>{"use strict";Object.defineProperty(SI,"__esModule",{value:!0});SI.verifyDSSETLogBody=Rce;var mm=Pe();function Rce(i,e){switch(i.apiVersion){case"0.0.1":return Ace(i,e);default:throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${i.apiVersion}`})}}o(Rce,"verifyDSSETLogBody");function Ace(i,e){if(i.spec.signatures?.length!==1)throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=i.spec.signatures[0].signature;if(!e.compareSignature(Buffer.from(t,"base64")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new mm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Ace,"verifyDSSE001TLogBody")});var nj=d(wI=>{"use strict";Object.defineProperty(wI,"__esModule",{value:!0});wI.verifyHashedRekordTLogBody=Tce;var EI=Pe();function Tce(i,e){switch(i.apiVersion){case"0.0.1":return Cce(i,e);default:throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported hashedrekord version: ${i.apiVersion}`})}}o(Tce,"verifyHashedRekordTLogBody");function Cce(i,e){let t=i.spec.signature.content||"";if(!e.compareSignature(Buffer.from(t,"base64")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"signature mismatch"});let r=i.spec.data.hash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new EI.VerificationError({code:"TLOG_BODY_ERROR",message:"digest mismatch"})}o(Cce,"verifyHashedrekord001TLogBody")});var oj=d(_I=>{"use strict";Object.defineProperty(_I,"__esModule",{value:!0});_I.verifyIntotoTLogBody=Nce;var gm=Pe();function Nce(i,e){switch(i.apiVersion){case"0.0.2":return Pce(i,e);default:throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported intoto version: ${i.apiVersion}`})}}o(Nce,"verifyIntotoTLogBody");function Pce(i,e){if(i.spec.content.envelope.signatures?.length!==1)throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let t=Dce(i.spec.content.envelope.signatures[0].sig);if(!e.compareSignature(Buffer.from(t,"base64")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let r=i.spec.content.payloadHash?.value||"";if(!e.compareDigest(Buffer.from(r,"hex")))throw new gm.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}o(Pce,"verifyIntoto002TLogBody");function Dce(i){return Buffer.from(i,"base64").toString("utf-8")}o(Dce,"base64Decode")});var cj=d(bI=>{"use strict";Object.defineProperty(bI,"__esModule",{value:!0});bI.verifyTLogBody=Bce;var aj=Pe(),xce=sj(),Lce=nj(),Mce=oj();function Bce(i,e){let{kind:t,version:r}=i.kindVersion,s=JSON.parse(i.canonicalizedBody.toString("utf8"));if(t!==s.kind||r!==s.apiVersion)throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`kind/version mismatch - expected: ${t}/${r}, received: ${s.kind}/${s.apiVersion}`});switch(s.kind){case"dsse":return(0,xce.verifyDSSETLogBody)(s,e);case"intoto":return(0,Mce.verifyIntotoTLogBody)(s,e);case"hashedrekord":return(0,Lce.verifyHashedRekordTLogBody)(s,e);default:throw new aj.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported kind: ${t}`})}}o(Bce,"verifyTLogBody")});var dj=d(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.Verifier=void 0;var kce=require("util"),ra=Pe(),uj=JU(),lj=ZU(),hj=rj(),Fce=cj(),II=class{static{o(this,"Verifier")}constructor(e,t={}){this.trustMaterial=e,this.options={ctlogThreshold:t.ctlogThreshold??1,tlogThreshold:t.tlogThreshold??1,tsaThreshold:t.tsaThreshold??0}}verify(e,t){let r=this.verifyTimestamps(e),s=this.verifySigningKey(e,r);return this.verifyTLogs(e),this.verifySignature(e,s),t&&this.verifyPolicy(t,s.identity||{}),s}verifyTimestamps(e){let t=0,r=0,s=e.timestamps.map(n=>{switch(n.$case){case"timestamp-authority":return r++,(0,hj.verifyTSATimestamp)(n.timestamp,e.signature.signature,this.trustMaterial.timestampAuthorities);case"transparency-log":return t++,(0,hj.verifyTLogTimestamp)(n.tlogEntry,this.trustMaterial.tlogs)}});if(fj(s))throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:"duplicate timestamp"});if(t<this.options.tlogThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tlogThreshold} tlog timestamps, got ${t}`});if(r<this.options.tsaThreshold)throw new ra.VerificationError({code:"TIMESTAMP_ERROR",message:`expected ${this.options.tsaThreshold} tsa timestamps, got ${r}`});return s.map(n=>n.timestamp)}verifySigningKey({key:e},t){switch(e.$case){case"public-key":return(0,uj.verifyPublicKey)(e.hint,t,this.trustMaterial);case"certificate":{let r=(0,uj.verifyCertificate)(e.certificate,t,this.trustMaterial);if(fj(r.scts))throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:"duplicate SCT"});if(r.scts.length<this.options.ctlogThreshold)throw new ra.VerificationError({code:"CERTIFICATE_ERROR",message:`expected ${this.options.ctlogThreshold} SCTs, got ${r.scts.length}`});return r.signer}}}verifyTLogs({signature:e,tlogEntries:t}){t.forEach(r=>(0,Fce.verifyTLogBody)(r,e))}verifySignature(e,t){if(!e.signature.verifySignature(t.key))throw new ra.VerificationError({code:"SIGNATURE_ERROR",message:"signature verification failed"})}verifyPolicy(e,t){e.subjectAlternativeName&&(0,lj.verifySubjectAlternativeName)(e.subjectAlternativeName,t.subjectAlternativeName),e.extensions&&(0,lj.verifyExtensions)(e.extensions,t.extensions)}};ym.Verifier=II;function fj(i){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if((0,kce.isDeepStrictEqual)(i[e],i[t]))return!0;return!1}o(fj,"containsDupes")});var Sm=d($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.Verifier=$t.toTrustMaterial=$t.VerificationError=$t.PolicyError=$t.toSignedEntity=void 0;var Uce=qU();Object.defineProperty($t,"toSignedEntity",{enumerable:!0,get:o(function(){return Uce.toSignedEntity},"get")});var pj=Pe();Object.defineProperty($t,"PolicyError",{enumerable:!0,get:o(function(){return pj.PolicyError},"get")});Object.defineProperty($t,"VerificationError",{enumerable:!0,get:o(function(){return pj.VerificationError},"get")});var jce=on();Object.defineProperty($t,"toTrustMaterial",{enumerable:!0,get:o(function(){return jce.toTrustMaterial},"get")});var $ce=dj();Object.defineProperty($t,"Verifier",{enumerable:!0,get:o(function(){return $ce.Verifier},"get")})});var mj=d(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.DEFAULT_TIMEOUT=Ke.DEFAULT_RETRY=void 0;Ke.createBundleBuilder=zce;Ke.createKeyFinder=Hce;Ke.createVerificationPolicy=Gce;var qce=ot(),sa=Ub(),Vce=Sm();Ke.DEFAULT_RETRY={retries:2};Ke.DEFAULT_TIMEOUT=5e3;function zce(i,e){let t={signer:Wce(e),witnesses:Kce(e)};switch(i){case"messageSignature":return new sa.MessageSignatureBundleBuilder(t);case"dsseEnvelope":return new sa.DSSEBundleBuilder({...t,certificateChain:e.legacyCompatibility})}}o(zce,"createBundleBuilder");function Hce(i){return e=>{let t=i(e);if(!t)throw new Vce.VerificationError({code:"PUBLIC_KEY_ERROR",message:`key not found: ${e}`});return{publicKey:qce.crypto.createPublicKey(t),validFor:o(()=>!0,"validFor")}}}o(Hce,"createKeyFinder");function Gce(i){let e={},t=i.certificateIdentityEmail||i.certificateIdentityURI;return t&&(e.subjectAlternativeName=t),i.certificateIssuer&&(e.extensions={issuer:i.certificateIssuer}),e}o(Gce,"createVerificationPolicy");function Wce(i){return new sa.FulcioSigner({fulcioBaseURL:i.fulcioURL,identityProvider:i.identityProvider||Jce(i),retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})}o(Wce,"initSigner");function Jce(i){let e=i.identityToken;return e?{getToken:o(()=>Promise.resolve(e),"getToken")}:new sa.CIContextProvider("sigstore")}o(Jce,"initIdentityProvider");function Kce(i){let e=[];return Zce(i)&&e.push(new sa.RekorWitness({rekorBaseURL:i.rekorURL,entryType:i.legacyCompatibility?"intoto":"dsse",fetchOnConflict:!1,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),Yce(i)&&e.push(new sa.TSAWitness({tsaBaseURL:i.tsaServerURL,retry:i.retry??Ke.DEFAULT_RETRY,timeout:i.timeout??Ke.DEFAULT_TIMEOUT})),e}o(Kce,"initWitnesses");function Zce(i){return i.tlogUpload!==!1}o(Zce,"isRekorEnabled");function Yce(i){return i.tsaServerURL!==void 0}o(Yce,"isTSAEnabled")});var Sj=d(qt=>{"use strict";var Xce=qt&&qt.__createBinding||(Object.create?(function(i,e,t,r){r===void 0&&(r=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(i,r,s)}):(function(i,e,t,r){r===void 0&&(r=t),i[r]=e[t]})),Qce=qt&&qt.__setModuleDefault||(Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e}),gj=qt&&qt.__importStar||(function(){var i=o(function(e){return i=Object.getOwnPropertyNames||function(t){var r=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[r.length]=s);return r},i(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=i(e),s=0;s<r.length;s++)r[s]!=="default"&&Xce(t,e,r[s]);return Qce(t,e),t}})();Object.defineProperty(qt,"__esModule",{value:!0});qt.sign=tue;qt.attest=iue;qt.verify=rue;qt.createVerifier=yj;var vI=ou(),eue=gj(sm()),OI=Sm(),na=gj(mj());async function tue(i,e={}){let r=await na.createBundleBuilder("messageSignature",e).create({data:i});return(0,vI.bundleToJSON)(r)}o(tue,"sign");async function iue(i,e,t={}){let s=await na.createBundleBuilder("dsseEnvelope",t).create({data:i,type:e});return(0,vI.bundleToJSON)(s)}o(iue,"attest");async function rue(i,e,t){let r;return Buffer.isBuffer(e)?r=e:t=e,yj(t).then(s=>s.verify(i,r))}o(rue,"verify");async function yj(i={}){let e=await eue.getTrustedRoot({mirrorURL:i.tufMirrorURL,rootPath:i.tufRootPath,cachePath:i.tufCachePath,forceCache:i.tufForceCache,retry:i.retry??na.DEFAULT_RETRY,timeout:i.timeout??na.DEFAULT_TIMEOUT}),t=i.keySelector?na.createKeyFinder(i.keySelector):void 0,r=(0,OI.toTrustMaterial)(e,t),s={ctlogThreshold:i.ctLogThreshold,tlogThreshold:i.tlogThreshold},n=new OI.Verifier(r,s),a=na.createVerificationPolicy(i);return{verify:o((c,u)=>{let l=(0,vI.bundleFromJSON)(c),h=(0,OI.toSignedEntity)(l,u);n.verify(h,a)},"verify")}}o(yj,"createVerifier")});var wj=d(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.verify=ue.sign=ue.createVerifier=ue.attest=ue.VerificationError=ue.PolicyError=ue.TUFError=ue.InternalError=ue.DEFAULT_REKOR_URL=ue.DEFAULT_FULCIO_URL=ue.ValidationError=void 0;var sue=ou();Object.defineProperty(ue,"ValidationError",{enumerable:!0,get:o(function(){return sue.ValidationError},"get")});var RI=Ub();Object.defineProperty(ue,"DEFAULT_FULCIO_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_FULCIO_URL},"get")});Object.defineProperty(ue,"DEFAULT_REKOR_URL",{enumerable:!0,get:o(function(){return RI.DEFAULT_REKOR_URL},"get")});Object.defineProperty(ue,"InternalError",{enumerable:!0,get:o(function(){return RI.InternalError},"get")});var nue=sm();Object.defineProperty(ue,"TUFError",{enumerable:!0,get:o(function(){return nue.TUFError},"get")});var Ej=Sm();Object.defineProperty(ue,"PolicyError",{enumerable:!0,get:o(function(){return Ej.PolicyError},"get")});Object.defineProperty(ue,"VerificationError",{enumerable:!0,get:o(function(){return Ej.VerificationError},"get")});var Em=Sj();Object.defineProperty(ue,"attest",{enumerable:!0,get:o(function(){return Em.attest},"get")});Object.defineProperty(ue,"createVerifier",{enumerable:!0,get:o(function(){return Em.createVerifier},"get")});Object.defineProperty(ue,"sign",{enumerable:!0,get:o(function(){return Em.sign},"get")});Object.defineProperty(ue,"verify",{enumerable:!0,get:o(function(){return Em.verify},"get")})});var NI=d((CIe,vj)=>{var oue=require("node:crypto"),_j=Yl(),aue=Jl(),AI=ai(),cue=Un(),uue=wj(),TI=x_(),lue=xs(),hue=ru(),bj=L_().version,Ij=XE(),Oj=Ds(),fue="application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*",due="application/json",pue="2015-01-01T00:00:00.000Z",CI=class extends lue{static{o(this,"RegistryFetcher")}#e;constructor(e,t){super(e,t),this.packumentCache=this.opts.packumentCache||null,this.registry=TI.pickRegistry(e,t),this.packumentUrl=`${Ij(this.registry)}/${this.spec.escapedName}`,this.#e=`${this.fullMetadata?"full":"corgi"}:${this.packumentUrl}`;let r=new URL(this.registry),s=`//${r.host}${r.pathname}`;this.opts[`${s}:_keys`]&&(this.registryKeys=this.opts[`${s}:_keys`])}async resolve(){if(await this.manifest(),!this.resolved)throw Object.assign(new Error("Invalid package manifest: no `dist.tarball` field"),{package:this.spec.toString()});return this.resolved}#t(){return{"user-agent":this.opts.userAgent||`pacote/${bj} node/${process.version}`,...this.opts.headers||{},"pacote-version":bj,"pacote-req-type":"packument","pacote-pkg-id":`registry:${this.spec.name}`,accept:this.fullMetadata?due:fue}}async packument(){if(this.packumentCache?.has(this.#e))return this.packumentCache.get(this.#e);try{let e=await TI(this.packumentUrl,{...this.opts,headers:this.#t(),spec:this.spec,integrity:null}),t=await e.json(),r=e.headers.get("content-length");return r&&(t._contentLength=Number(r)),this.packumentCache?.set(this.#e,t),t}catch(e){if(this.packumentCache?.delete(this.#e),e.code!=="E404"||this.fullMetadata)throw e;return this.fullMetadata=!0,this.packument()}}async manifest(){if(this.package)return this.package;this.opts.verifySignatures&&(this.fullMetadata=!0);let e=await this.packument(),t=_j.normalizeSteps.filter(a=>a!=="_attributes"),r=await new _j().fromContent(aue(e,this.spec.fetchSpec,{...this.opts,defaultTag:this.defaultTag,before:this.before})).normalize({steps:t}).then(a=>a.content),s=e.time?.[r.version];s&&(r._time=s);let{dist:n}=r;if(n){this.resolved=r._resolved=n.tarball,r._from=this.from;let a=n.integrity?AI.parse(n.integrity):n.shasum?AI.fromHex(n.shasum,"sha1",{...this.opts}):null;if(a){if(this.integrity&&!this.integrity.match(a)){for(let c of Object.keys(this.integrity))if(a[c])throw Object.assign(new Error(`Integrity checksum failed when using ${c}: wanted ${this.integrity} but got ${a}.`),{code:"EINTEGRITY"})}this.integrity=a}}if(this.integrity){if(r._integrity=String(this.integrity),n.signatures)if(this.opts.verifySignatures){let a=`${r._id}:${r._integrity}`;for(let c of n.signatures){let u=this.registryKeys&&this.registryKeys.filter(m=>m.keyid===c.keyid)[0];if(!u)throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let l=Date.parse(r._time||pue);if(!(!u.expires||l<Date.parse(u.expires)))throw Object.assign(new Error(`${r._id} has a registry signature with keyid: ${c.keyid} but the corresponding public key has expired ${u.expires}`),{code:"EEXPIREDSIGNATUREKEY"});let f=oue.createVerify("SHA256");if(f.write(a),f.end(),!f.verify(u.pemkey,c.sig,"base64"))throw Object.assign(new Error(`${r._id} has an invalid registry signature with keyid: ${u.keyid} and signature: ${c.sig}`),{code:"EINTEGRITYSIGNATURE",keyid:u.keyid,signature:c.sig,resolved:r._resolved,integrity:r._integrity})}r._signatures=n.signatures}else r._signatures=n.signatures;if(n.attestations)if(this.opts.verifyAttestations){let a=new URL(n.attestations.url).pathname,c=Ij(this.registry)+a,u=await TI(c,{...this.opts,integrity:null}),{attestations:l}=await u.json(),h=l.map(({predicateType:m,bundle:y})=>{let g=JSON.parse(Buffer.from(y.dsseEnvelope.payload,"base64").toString("utf8")),S=y.dsseEnvelope.signatures[0].keyid,E=y.dsseEnvelope.signatures[0].sig;return{predicateType:m,bundle:y,statement:g,keyid:S,signature:E}}),f=h.map(m=>m.keyid).filter(m=>!!m),p=(this.registryKeys||[]).filter(m=>f.includes(m.keyid));if(!p.length)throw Object.assign(new Error(`${r._id} has attestations but no corresponding public key(s) can be found`),{code:"EMISSINGSIGNATUREKEY"});for(let{predicateType:m,bundle:y,keyid:g,signature:S,statement:E}of h){let _=p.find(v=>v.keyid===g);if(g){if(!_)throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but no corresponding public key can be found`),{code:"EMISSINGSIGNATUREKEY"});let v=new Date(Number(y.verificationMaterial.tlogEntries[0].integratedTime)*1e3);if(!(!_.expires||v<Date.parse(_.expires)))throw Object.assign(new Error(`${r._id} has attestations with keyid: ${g} but the corresponding public key has expired ${_.expires}`),{code:"EEXPIREDSIGNATUREKEY"})}let b={name:E.subject[0].name,sha512:E.subject[0].digest.sha512},w=this.spec.type==="version"?cue.toPurl(this.spec):this.spec;if(b.name!==w)throw Object.assign(new Error(`${r._id} package name and version (PURL): ${w} doesn't match what was signed: ${b.name}`),{code:"EATTESTATIONSUBJECT"});let I=AI.parse(this.integrity).hexDigest();if(b.sha512!==I)throw Object.assign(new Error(`${r._id} package integrity (hex digest): ${I} doesn't match what was signed: ${b.sha512}`),{code:"EATTESTATIONSUBJECT"});try{let v={tufCachePath:this.tufCache,tufForceCache:!0,keySelector:_?()=>_.pemkey:void 0};await uue.verify(y,v)}catch(v){throw Object.assign(new Error(`${r._id} failed to verify attestation: ${v.message}`),{code:"EATTESTATIONVERIFY",predicateType:m,keyid:g,signature:S,resolved:r._resolved,integrity:r._integrity})}}r._attestations=n.attestations}else r._attestations=n.attestations}return this.package=r,this.package}[Oj.tarballFromResolved](){return new hue(this.resolved,{...this.opts,resolved:this.resolved,pkgid:`registry:${this.spec.name}@${this.resolved}`})[Oj.tarballFromResolved]()}get types(){return["tag","version","range"]}};vj.exports=CI});var xs=d((PIe,Pj)=>{var{basename:mue,dirname:Rj}=require("node:path"),{rm:gue,mkdir:Aj}=require("node:fs/promises"),Cj=Yl(),PI=dc(),yue=Ln(),Sue=CN(),Nj=Un(),Eue=xa(),DI=ai(),wue=KE(),{Minipass:_ue}=te(),{log:rs}=St(),Lu=Ds(),Tj=mD(),bue=YE(),Iue=XE(),Oue=o(i=>Cj.prepare(i).then(e=>e.content),"packageJsonPrepare"),vue=o(i=>Cj.normalize(i).then(e=>e.content),"packageJsonNormalize"),wm=class{static{o(this,"FetcherBase")}constructor(e,t){if(!t||typeof t!="object")throw new TypeError("options object is required");this.spec=Nj(e,t.where),this.allowGitIgnore=!!t.allowGitIgnore,this.from=this.spec.registry?`${this.spec.name}@${this.spec.rawSpec}`:this.spec.saveSpec,this.#i(),this.opts={...t},this.cache=t.cache||Tj().cacache,this.tufCache=t.tufCache||Tj().tufcache,this.resolved=t.resolved||null,this.defaultIntegrityAlgorithm=t.defaultIntegrityAlgorithm||"sha512",typeof t.integrity=="string"&&(this.opts.integrity=DI.parse(t.integrity)),this.package=null,this.type=this.constructor.name,this.fmode=t.fmode||438,this.dmode=t.dmode||511,this.umask=t.umask||0,this.preferOnline=!!t.preferOnline,this.preferOffline=!!t.preferOffline,this.offline=!!t.offline,this.before=t.before,this.fullMetadata=this.before?!0:!!t.fullMetadata,this.fullReadJson=!!t.fullReadJson,this[Lu.readPackageJson]=this.fullReadJson?Oue:vue,this.replaceRegistryHost=!t.replaceRegistryHost||t.replaceRegistryHost==="npmjs"?"registry.npmjs.org":t.replaceRegistryHost,this.defaultTag=t.defaultTag||"latest",this.registry=Iue(t.registry||"https://registry.npmjs.org"),this.npmBin=t.npmBin||"npm",this.npmInstallCmd=t.npmInstallCmd||["install","--force"],this.npmCliConfig=t.npmCliConfig||[`--cache=${Rj(this.cache)}`,`--prefer-offline=${!!this.preferOffline}`,`--prefer-online=${!!this.preferOnline}`,`--offline=${!!this.offline}`,...this.before?[`--before=${this.before.toISOString()}`]:[],"--no-progress","--no-save","--no-audit","--include=dev","--include=peer","--include=optional","--no-package-lock-only","--no-dry-run"]}get integrity(){return this.opts.integrity||null}set integrity(e){if(!e)return;e=DI.parse(e);let t=this.opts.integrity;t?t.merge(e):this.opts.integrity=e}get notImplementedError(){return new Error("not implemented in this fetcher type: "+this.type)}resolve(){return this.resolved?Promise.resolve(this.resolved):Promise.reject(this.notImplementedError)}packument(){return Promise.reject(this.notImplementedError)}manifest(){return Promise.reject(this.notImplementedError)}[Lu.tarballFromResolved](){throw this.notImplementedError}tarball(){return this.tarballStream(e=>e.concat().then(t=>(t.integrity=this.integrity&&String(this.integrity),t.resolved=this.resolved,t.from=this.from,t)))}#e(){let e=Date.now(),t=PI.get.stream.byDigest(this.cache,this.integrity,this.opts),r=Date.now()-e;return rs.http("cache",`${this.spec} ${r}ms (cache hit)`),t}get[Lu.cacheFetches](){return!0}#t(e){if(!this.opts.cache||!this[Lu.cacheFetches]){if(e.hasIntegrityEmitter)return e.on("integrity",n=>this.integrity=n),e;let s=DI.integrityStream(this.opts);return s.on("integrity",n=>this.integrity=n),e.on("error",n=>s.emit("error",n)),e.pipe(s)}let t=new _ue;e.on("error",s=>t.emit("error",s)),e.pipe(t,{end:!1});let r=PI.put.stream(this.opts.cache,`pacote:tarball:${this.from}`,this.opts);return r.on("integrity",s=>this.integrity=s),r.on("error",s=>e.emit("error",s)),e.pipe(r),r.promise().catch(()=>{}).then(()=>t.end()),t}pickIntegrityAlgorithm(){return this.integrity?this.integrity.pickAlgorithm(this.opts):this.defaultIntegrityAlgorithm}isDataCorruptionError(e){return e.code==="EINTEGRITY"||e.code==="Z_DATA_ERROR"}get types(){return!1}#i(){if(this.types&&!this.types.includes(this.spec.type))throw new TypeError(`Wrong spec type (${this.spec.type}) for ${this.constructor.name}. Supported types: ${this.types.join(", ")}`)}isRetriableError(e){return this.isDataCorruptionError(e)||e.code==="ENOENT"||e.code==="EISDIR"}tarballStream(e){let t=!this.preferOnline&&this.integrity&&this.resolved?e(this.#e()).catch(s=>{if(this.isDataCorruptionError(s))return rs.warn("tarball",`cached data for ${this.spec} (${this.integrity}) seems to be corrupted. Refreshing cache.`),this.cleanupCached().then(()=>{throw s});throw s}):null,r=o(s=>{if(s){if(!this.isRetriableError(s))throw s;rs.silly("tarball",`no local data for ${this.spec}. Extracting by manifest.`)}return this.resolve().then(()=>Eue(n=>e(this.#t(this[Lu.tarballFromResolved]())).catch(a=>{if(this.isRetriableError(a))return rs.warn("tarball",`tarball data for ${this.spec} (${this.integrity}) seems to be corrupted. Trying again.`),this.cleanupCached().then(()=>n(a));throw a}),{retries:1,minTimeout:0,maxTimeout:0}))},"fromResolved");return t?t.catch(r):r()}cleanupCached(){return PI.rm.content(this.cache,this.integrity,this.opts)}#r(e){return Sue({path:e,depth:1}).then(t=>Promise.all(t.map(r=>gue(r,{recursive:!0,force:!0}))))}async#s(e){return await this.#r(e),await Aj(e,{recursive:!0})}async extract(e){return await this.#s(e),this.tarballStream(t=>this.#c(e,t))}#u(e){return this.tarballStream(t=>new Promise((r,s)=>{let n=new yue.WriteStream(e);t.on("error",a=>n.emit("error",a)),n.on("error",a=>s(a)),n.on("close",()=>r({integrity:this.integrity&&String(this.integrity),resolved:this.resolved,from:this.from})),t.pipe(n)}))}async tarballFile(e){let t=Rj(e);return await Aj(t,{recursive:!0}),this.#u(e)}#c(e,t){let r=wue.x(this.#n({cwd:e})),s=new Promise((n,a)=>{r.on("end",()=>{n({resolved:this.resolved,integrity:this.integrity&&String(this.integrity),from:this.from})}),r.on("error",c=>{rs.warn("tar",c.message),rs.silly("tar",c),a(c)}),t.on("error",c=>a(c))});return t.pipe(r),s}#f(e,t,r){let s=/Directory|GNUDumpDir/.test(r)?this.dmode:/File$/.test(r)?this.fmode:0,n=bue(this.package,e)?73:0;return(t|s)&~this.umask|n|384}#n({cwd:e}){let t=new Set;return{cwd:e,noChmod:!0,noMtime:!0,filter:o((r,s)=>{if(/Link$/.test(s.type))return!1;if(s.mode=this.#f(s.path,s.mode,s.type),/File$/.test(s.type)){let n=mue(s.path);if(n===".npmignore")t.add(s.path);else if(n===".gitignore"&&!this.allowGitIgnore){let a=s.path.replace(/\.gitignore$/,".npmignore");if(t.has(a))return!1;s.path=a}return!0}},"filter"),strip:1,onwarn:o((r,s,n)=>{rs.warn("tar",r,s),rs.silly("tar",r,s,n)},"onwarn"),umask:this.umask,preserveOwner:!1}}};Pj.exports=wm;var Rue=k_(),Aue=NI(),Tue=fo(),Cue=$f(),Nue=ru();wm.get=(i,e={})=>{let t=Nj(i,e.where);switch(t.type){case"git":return new Rue(t,e);case"remote":return new Nue(t,e);case"version":case"range":case"tag":case"alias":return new Aue(t.subSpec||t,e);case"file":return new Tue(t,e);case"directory":return new Cue(t,e);default:throw new TypeError("Unknown spec type: "+t.type)}}});var xj=d((xIe,Dj)=>{var{get:an}=xs(),Pue=k_(),Due=NI(),xue=fo(),Lue=$f(),Mue=ru(),xI=o((i,e)=>an(i,e).tarball(),"tarball");xI.stream=(i,e,t)=>an(i,t).tarballStream(e);xI.file=(i,e,t)=>an(i,t).tarballFile(e);Dj.exports={GitFetcher:Pue,RegistryFetcher:Due,FileFetcher:xue,DirFetcher:Lue,RemoteFetcher:Mue,resolve:o((i,e)=>an(i,e).resolve(),"resolve"),extract:o((i,e,t)=>an(i,t).extract(e),"extract"),manifest:o((i,e)=>an(i,e).manifest(),"manifest"),packument:o((i,e)=>an(i,e).packument(),"packument"),tarball:xI}});module.exports=xj();
|
|
67
64
|
/*! Bundled license information:
|
|
68
65
|
|
|
69
66
|
imurmurhash/imurmurhash.js:
|