@visulima/vis 1.0.8 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/LICENSE.md +210 -2733
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +70 -68
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +166 -163
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +8 -8
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +3 -3
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +6 -6
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +3 -3
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +16 -16
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +25 -25
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +42 -42
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +21 -21
- package/dist/packem_chunks/handler75.js +3 -27
- package/dist/packem_chunks/handler76.js +27 -3
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +25 -23
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +56 -23
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +2 -2
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +8 -8
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-BGeuHJQg.js +1 -0
- package/dist/packem_shared/affected-selection-B85ND6JV.js +1 -0
- package/dist/packem_shared/affected-shas-BWRRAB47.js +1 -0
- package/dist/packem_shared/ai-analysis-oNMAj1wd.js +68 -0
- package/dist/packem_shared/{ai-fix-BocGeQu4.js → ai-fix-BgBU0TOz.js} +9 -9
- package/dist/packem_shared/{augment-BIUGEy1Q.js → augment-HVeX6LpU.js} +4 -4
- package/dist/packem_shared/bin-DKod8Iqo.js +1 -0
- package/dist/packem_shared/build-scripts-CM8M1xcG.js +1 -0
- package/dist/packem_shared/{command-runtime-Buz4F5LM.js → command-runtime-BVi4lL8k.js} +1 -1
- package/dist/packem_shared/cyclonedx-y7VLI-1d.js +4 -0
- package/dist/packem_shared/{dependency-scan-7szXDRxn.js → dependency-scan-BAzKpXdW.js} +1 -1
- package/dist/packem_shared/{docker-B2h5KRZH.js → docker-D1LStSlH.js} +36 -36
- package/dist/packem_shared/{en-BRcjb70R.js → en-BxrK-n-J.js} +10 -10
- package/dist/packem_shared/failure-log-ChuFC-8f.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-BSrdzgma.js +1 -0
- package/dist/packem_shared/{index-BQSyPcXq.js → index-BJw7gKD1.js} +1 -1
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-DND6ptxQ.js +35 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-Db0qh6vR.js +2 -0
- package/dist/packem_shared/lockfile-CDQ0n4P5.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-Da_no4ZH.js +1 -0
- package/dist/packem_shared/{min-release-age-Cdh1dLz1.js → min-release-age-V6L6dpiP.js} +2 -2
- package/dist/packem_shared/missing-package-json-Jw8IEHct.js +1 -0
- package/dist/packem_shared/{native-config-sync-DW8549FX.js → native-config-sync-C0pUePad.js} +6 -6
- package/dist/packem_shared/osv-bloom-DNFpvSSO.js +2 -0
- package/dist/packem_shared/package-version-DjHDww_5.js +4 -0
- package/dist/packem_shared/packument-N3EWbZpL.js +1 -0
- package/dist/packem_shared/pm-runner-Bssje5qH.js +1 -0
- package/dist/packem_shared/project-name-filter-u2Q7YpQH.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-ByHgofYo.js → provenance-9OT8sTqn.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-wlhgSHes.js → readJsonSync-BnWiH5-R-BpnwAB0Z.js} +1 -1
- package/dist/packem_shared/registry-keys-CYHd7qU2.js +1 -0
- package/dist/packem_shared/{resolve-explicit-CnEsy-zC.js → resolve-explicit-DC3XssJa.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-Z2n59SEd.js → resolve-runtime-f5l4ODsH.js} +1 -1
- package/dist/packem_shared/run-file-zB4ACnUy.js +1 -0
- package/dist/packem_shared/{runtime-check-B1OF152E.js → runtime-check-CWvAfu5u.js} +1 -1
- package/dist/packem_shared/s1ngularity-DsmC71xt.js +1 -0
- package/dist/packem_shared/scan-progress-Ch8s3Uwl.js +2 -0
- package/dist/packem_shared/selectors-CtxnIT4X.js +3 -0
- package/dist/packem_shared/signatures-Dwx5fD4g.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-b7bE1AEx.js +11 -0
- package/dist/packem_shared/target-options-BO4Uxt0k.js +1 -0
- package/dist/packem_shared/toolchain-BY8lJaSN.js +5 -0
- package/dist/packem_shared/typosquats-BUGgotNu.js +1 -0
- package/dist/packem_shared/use-measured-height-BLZt9dW2.js +1 -0
- package/dist/packem_shared/verify-B0ztxKMa.js +1 -0
- package/dist/packem_shared/vis-update-app-D1gLJB1O.js +1 -0
- package/dist/packem_shared/vis-user-error-DjFv8uxy.js +28 -0
- package/dist/packem_shared/watch-CGrUW_JD.js +1 -0
- package/dist/packem_shared/watch-loop-DIwSMjlA.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +12 -11
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +0 -3
- package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +0 -34
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-DkrQVQla.js +0 -1
- package/dist/packem_shared/ai-analysis-DWBi9tSU.js +0 -68
- package/dist/packem_shared/bin-BaVRMS0Q.js +0 -1
- package/dist/packem_shared/build-scripts-CpTeQE1L.js +0 -1
- package/dist/packem_shared/cyclonedx-C_qjUvdD.js +0 -4
- package/dist/packem_shared/failure-log-C3c5AVfc.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-DFkUYBco.js +0 -1
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-D75r1yKp.js +0 -35
- package/dist/packem_shared/index-D_6ru_ek.js +0 -28
- package/dist/packem_shared/lifecycle-CG0Ccu4h.js +0 -2
- package/dist/packem_shared/lockfile-D_JiWcwS.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-mFrrpzXW.js +0 -1
- package/dist/packem_shared/missing-package-json-sYPP3cm-.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-mvGIa7gN.js +0 -4
- package/dist/packem_shared/packument-BFekEvwn.js +0 -1
- package/dist/packem_shared/pm-runner-D5NWL8yv.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-BCD7Ir8g.js +0 -1
- package/dist/packem_shared/run-file-u9hMNu8K.js +0 -1
- package/dist/packem_shared/s1ngularity-DkNDQiKU.js +0 -1
- package/dist/packem_shared/scan-progress-CHdHWhVw.js +0 -2
- package/dist/packem_shared/selectors-DiZWa7R4.js +0 -3
- package/dist/packem_shared/signatures-kvrwi3Un.js +0 -2
- package/dist/packem_shared/spinner-DuJJvFTl.js +0 -1
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/tabs-CgxCvjCY.js +0 -1
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-BJIDkfDf.js +0 -1
- package/dist/packem_shared/toolchain-CAbopPwK.js +0 -5
- package/dist/packem_shared/typosquats-DWB80Gyv.js +0 -1
- package/dist/packem_shared/use-measured-height-C4jA0yNy.js +0 -1
- package/dist/packem_shared/verify-BajubByH.js +0 -1
- package/dist/packem_shared/vis-update-app-M3dw6XRC.js +0 -1
- package/dist/packem_shared/watch-B8WT65yN.js +0 -1
- package/dist/packem_shared/watch-loop-CZazUnGB.js +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as D}from"node:module";import{w as L}from"./target-merge-Dg25Izl5.js";import{advisoriesQuery as M,advisoriesIngest as W,advisoriesStatus as A,NATIVE_BINDING_VERSION as w}from"#native";const R=D(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(s)}return R(s)},{randomUUID:I}=c("node:crypto"),{existsSync:$,createWriteStream:T}=c("node:fs"),{mkdir:O,unlink:P,stat:U}=c("node:fs/promises"),{join:g,dirname:k}=c("node:path"),{Readable:x}=c("node:stream"),{pipeline:C}=c("node:stream/promises"),f=6;if(w!==f)throw new Error(`vis native binding ABI mismatch in advisories: expected ${f}, got ${w}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const Q="https://osv-vulnerabilities.storage.googleapis.com",j=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class q extends Error{cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class E extends Error{cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const y=s=>{const e=L("vis",{create:!0,cwd:s})??g(s,"node_modules",".cache","vis");return g(e,"advisories","db.sqlite")},B=(s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...j,...e??[]]).has(t.host))throw new p(t.host);return t},J=async s=>{const e=s.dbPath??y(s.workspaceRoot);await O(k(e),{recursive:!0});const t=B(s.source,s.allowedHosts),d=new URL(`${s.ecosystem}/all.zip`,z(t.toString())),u=await V(e,s.ecosystem);let r=null;if(!s.force){const i=await b(d,{method:"HEAD"});if(i.ok&&(r=i.headers.get("etag"),r&&u&&r===u))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const n=`${e}.${s.ecosystem}.${process.pid}.${I()}.zip.tmp`,o=await b(d,{method:"GET"});if(!o.ok||!o.body)throw new E(d.toString(),o.status);r||(r=o.headers.get("etag"));const v=o.headers.get("content-length"),a=v?Number.parseInt(v,10):null;let m=0;const _=T(n),h=x.fromWeb(o.body);s.onProgress&&a&&h.on("data",i=>{m+=i.byteLength,s.onProgress?.(m,a,"download")}),await C(h,_);try{const i=await W({dbPath:e,ecosystem:s.ecosystem,manifestEtag:r??void 0,zipPath:n},(S,N)=>s.onProgress?.(S,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:e,durationMs:i.durationMs,upToDate:!1}}finally{await P(n).catch(()=>{})}},X=(s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??y(e.workspaceRoot),d=e.ecosystem??"npm";if(!$(t))throw new q(t);const u=s.map(o=>({ecosystem:d,name:o.name,version:o.version})),r=M(t,u),n=new Map;for(const[o,v]of s.entries()){const a=r[o];!a||a.vulnerabilities.length===0||n.set(v.name,a.vulnerabilities.map(m=>H(m)))}return n},Z=async(s,e)=>{const t=e??y(s);return A(t)},V=async(s,e)=>{try{await U(s)}catch{return null}return A(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},H=s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:F(s.severity),summary:s.summary}),F=s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},z=s=>s.endsWith("/")?s:`${s}/`,b=async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new E(s.toString(),t instanceof Error?t.message:String(t))}};export{q as A,Q as D,Z as g,X as q,y as r,J as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{f as g,v as h}from"./index-D75r1yKp.js";const E=l(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,r]=_.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return _.getBuiltinModule(e)}return E(e)},{spawnSync:p}=d("node:child_process"),b="0000000000000000000000000000000000000000",A=e=>{if(g(e))try{const s=h(e);return JSON.parse(s)}catch{return}},f=(e,s)=>{const r=p("git",e,{cwd:s,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==b,I=(e,s,r)=>{const i=[],o=e.GITHUB_BASE_REF,t=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return i.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:t,notes:i,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?r(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return i.push(`push: event.before=${u}`),{base:u,head:t,notes:i,provider:"github"}}return i.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:t,notes:i,provider:"github"}},R=(e,s)=>{const r=[],i=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:i,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:i,notes:r,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:i,notes:r,provider:"gitlab"};const t=e.CI_DEFAULT_BRANCH??s;return r.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:i,notes:r,provider:"gitlab"}},C=(e,s)=>{const r=[],i=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"buildkite"})},v=(e,s)=>{const r=[],i=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:i,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:i,notes:r,provider:"circleci"})},T=(e,s,r)=>{const i=[],o=s(["merge-base","HEAD",`origin/${e}`],r);return o&&o.length>0?(i.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:i,provider:"local"}):(i.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:i,provider:"local"})},H=e=>{const s=e?.env??process.env,r=e?.defaultBase??"main",i=e?.readEventPayload??A,o=e?.runGit??f,t=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?I(s,r,i):s.GITLAB_CI==="true"?R(s,r):s.BUILDKITE==="true"?C(s,r):s.CIRCLECI==="true"?v(s,r):T(r,o,t)};export{H as r};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{createRequire as X}from"node:module";import{h as te,d as h,n as ae,i as E,E as ne}from"../packem_chunks/catalog.js";import"./en-BRcjb70R.js";import{U as ie,V as re,W as se,X as oe}from"../packem_chunks/cli-main.js";const Q=X(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[t,a]=k.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return k.getBuiltinModule(e)}return Q(e)},{execFile:x,spawn:Z,execFileSync:G}=R("node:child_process"),{existsSync:N}=R("node:fs"),{platform:ee,homedir:j}=R("node:os"),{join:g}=R("node:path"),{promisify:H}=R("node:util"),ce=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,de=5e3,le=1e4,ue=3e5,pe=4096,C=ee()==="win32",V=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"],me={alternateCommands:[],buildArgs:(e,{dangerous:t})=>{const a=["-x",e];return t&&a.push("--dangerously-allow-all"),a},command:"amp",defaultModel:"",displayName:"Amp",envVariable:"AMP_PATH",sessionMarkers:[{confidence:"definite",variable:"AMP_CURRENT_THREAD_ID"},{confidence:"definite",equals:"amp",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!1},fe={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=[];return t&&n.push("--dangerously-skip-permissions"),a&&n.push("--model",a),n.push("--output-format","text","-p",e),n},command:"claude",defaultModel:"",displayName:"Claude Code",envVariable:"CLAUDE_PATH",sessionMarkers:[{confidence:"definite",variable:"CLAUDECODE"},{confidence:"definite",variable:"CLAUDE_CODE"}],supportsMaxTokens:!1,supportsModel:!0},ge={alternateCommands:["openai-codex"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["exec"];return a&&n.push("--model",a),t&&n.push("--dangerously-bypass-approvals-and-sandbox"),n.push(e),n},command:"codex",defaultModel:"",displayName:"Codex",envVariable:"CODEX_PATH",sessionMarkers:[{confidence:"definite",variable:"CODEX_SANDBOX"},{confidence:"definite",variable:"CODEX_THREAD_ID"},{confidence:"definite",variable:"CODEX_CI"}],supportsMaxTokens:!1,supportsModel:!0},he={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p",e];return t&&n.push("--allow-all-tools"),a&&n.push("--model",a),n},command:"copilot",defaultModel:"",displayName:"GitHub Copilot CLI",envVariable:"COPILOT_PATH",sessionMarkers:[{confidence:"definite",variable:"COPILOT_MODEL"},{confidence:"definite",variable:"COPILOT_ALLOW_ALL"},{confidence:"definite",variable:"COPILOT_GITHUB_TOKEN"},{agent:"GitHub Copilot in VS Code",confidence:"definite",label:"TERM_PROGRAM+GIT_PAGER",match:{all:[["TERM_PROGRAM","vscode"],["GIT_PAGER","cat"]],none:["CURSOR_TRACE_ID"]}}],supportsMaxTokens:!1,supportsModel:!0},be={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=["run"];return t&&n.push("--yolo"),a&&n.push("-m",a),n.push(e),n},command:"crush",defaultModel:"",displayName:"Crush",envVariable:"CRUSH_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"CRUSH"},{confidence:"definite",equals:"crush",variable:"AGENT"}],supportsMaxTokens:!1,supportsModel:!0},ve={alternateCommands:["cursor"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p"];return t&&n.push("--force"),n.push("--output-format","text"),a&&n.push("--model",a),n.push(e),n},command:"agent",defaultModel:"",displayName:"Cursor Agent",envVariable:"CURSOR_PATH",sessionMarkers:[{confidence:"definite",variable:"CURSOR_AGENT"},{confidence:"definite",label:"CURSOR_TRACE_ID+PAGER",match:{all:["CURSOR_TRACE_ID",["PAGER","head -n 10000 | cat"]]}},{agent:"Cursor editor",confidence:"ambient",variable:"CURSOR_TRACE_ID"}],supportsMaxTokens:!1,supportsModel:!0},ye={alternateCommands:[],buildArgs:(e,{dangerous:t,model:a})=>{const n=[e];return t&&n.push("--skip-permissions-unsafe"),n.push("-o","text"),a&&n.push("-m",a),n},command:"droid",defaultModel:"",displayName:"Droid",envVariable:"DROID_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},Ee={alternateCommands:["gemini-cli"],buildArgs:(e,{dangerous:t,maxTokens:a,model:n})=>{const i=[];return t||i.push("--sandbox"),n&&i.push("--model",n),i.push("--max-output-tokens",String(a),"-p",e),i},command:"gemini",defaultModel:"gemini-2.5-pro",displayName:"Gemini CLI",envVariable:"GEMINI_PATH",sessionMarkers:[{confidence:"definite",label:"GEMINI_CLI",match:{all:["GEMINI_CLI"],none:["QWEN_CODE"]}}],supportsMaxTokens:!0,supportsModel:!0},Ae={alternateCommands:[],buildArgs:(e,{model:t})=>{const a=["--quiet","-p",e];return t&&a.push("-m",t),a},command:"kimi",defaultModel:"",displayName:"Kimi CLI",envVariable:"KIMI_PATH",sessionMarkers:[],supportsMaxTokens:!1,supportsModel:!0},ke={alternateCommands:[],buildArgs:(e,{model:t})=>{const a=["run",e];return t&&a.push("-m",t),a},command:"opencode",defaultModel:"",displayName:"opencode",envVariable:"OPENCODE_PATH",sessionMarkers:[{confidence:"definite",label:"OPENCODE",match:{any:["OPENCODE","OPENCODE_BIN_PATH","OPENCODE_SERVER","OPENCODE_APP_INFO","OPENCODE_MODES","OPENCODE_CLIENT"]}}],supportsMaxTokens:!1,supportsModel:!0},Re={alternateCommands:["qwen-code"],buildArgs:(e,{dangerous:t,model:a})=>{const n=["-p",e];return t&&n.push("--yolo"),n.push("-o","text"),a&&n.push("-m",a),n},command:"qwen",defaultModel:"",displayName:"Qwen Code",envVariable:"QWEN_PATH",sessionMarkers:[{confidence:"definite",equals:"1",variable:"QWEN_CODE"}],supportsMaxTokens:!1,supportsModel:!0},w={amp:me,claude:fe,codex:ge,copilot:he,crush:be,cursor:ve,droid:ye,gemini:Ee,kimi:Ae,opencode:ke,qwen:Re};class A extends Error{exitCode;durationMs;provider;stderr;stdout;timedOut;aborted;constructor(t,a){super(t),this.name="AiRunError",this.provider=a.provider,this.exitCode=a.exitCode??null,this.durationMs=a.durationMs,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.timedOut=a.timedOut??!1,this.aborted=a.aborted??!1}}H(x);const Me=[{agent:"Cline",confidence:"definite",variable:"CLINE_ACTIVE"},{agent:"Aider",confidence:"definite",label:"OR_APP_NAME|AIDER_API_KEY",match:{any:[["OR_APP_NAME","Aider"],"AIDER_API_KEY"]}},{agent:"Antigravity",confidence:"definite",label:"ANTIGRAVITY_AGENT",match:{any:["ANTIGRAVITY_AGENT","ANTIGRAVITY_PROJECT_ID"]}},{agent:"Augment",confidence:"definite",variable:"AUGMENT_AGENT"},{agent:"Windsurf",confidence:"definite",variable:"CODEIUM_EDITOR_APP_ROOT"},{agent:"Warp",confidence:"definite",variable:"OZ_RUN_ID"},{agent:"Pi",confidence:"definite",equals:"true",variable:"PI_CODING_AGENT"},{agent:"Jules",confidence:"definite",label:"HOME+USER",match:{all:[["HOME","/home/jules"],["USER","swebot"]]}},{agent:"Replit Agent",confidence:"definite",variable:"REPLIT_CLI"},{agent:"Replit Assistant",confidence:"definite",label:"REPL_ID+REPLIT_MODE",match:{all:["REPL_ID",["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new",confidence:"definite",label:"SHELL+npm_config_yes",match:{all:[["SHELL","/bin/jsh"],"npm_config_yes"]}},{agent:"Zed",confidence:"definite",label:"TERM_PROGRAM+PAGER",match:{all:[["TERM_PROGRAM","zed"],["PAGER","cat"]]}},{agent:"Replit workspace",confidence:"ambient",label:"REPL_ID",match:{all:["REPL_ID"],none:[["REPLIT_MODE","assistant"]]}},{agent:"Bolt.new editor",confidence:"ambient",label:"SHELL",match:{all:[["SHELL","/bin/jsh"]],none:["npm_config_yes"]}},{agent:"Zed editor",confidence:"ambient",label:"TERM_PROGRAM",match:{all:[["TERM_PROGRAM","zed"]],none:[["PAGER","cat"]]}}],_e={ambient:"interactive",definite:"agent"},q=(e,t,a)=>{const n={agent:e.agent??t,confidence:e.confidence,provider:a,type:e.type??_e[e.confidence]};return"match"in e?{...n,label:e.label,match:e.match}:{...n,label:e.variable,match:e.equals===void 0?e.variable:[e.variable,e.equals]}},we=(e,t)=>t.sessionMarkers.map(a=>q(a,t.displayName,e));[...Object.keys(w).flatMap(e=>we(e,w[e])),...Me.map(e=>q(e,e.agent,e.provider))].toSorted((e,t)=>e.confidence===t.confidence?0:e.confidence==="definite"?-1:1);H(x);const Ce=/\.(?:bat|cmd)$/i,U=e=>C&&Ce.test(e),$=e=>`"${e.replaceAll('"','""')}"`,L=e=>e==="~"||e.startsWith("~/")||C&&e.startsWith("~\\")?g(j(),e.slice(2)):e,Te=e=>{try{const t=G(C?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:de}).trim().split(`
|
|
2
|
-
`)[0]?.trim();return t&&t.length>0?t:void 0}catch{return}},Ie=e=>{const t=j();if(C){const a=process.env.APPDATA??"",n=process.env.LOCALAPPDATA??"",i=process.env.ProgramFiles??"";return[g(a,"npm",`${e}.cmd`),g(a,"npm",e),g(n,"Programs",e,`${e}.exe`),g(i,e,`${e}.exe`),g(t,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,g(t,".npm-global","bin",e),g(t,".local","bin",e),g(t,".cargo","bin",e)]},Oe=e=>{try{const t=G(e,["--version"],{encoding:"utf8",shell:U(e),stdio:["pipe","pipe","pipe"],timeout:le}),a=ce.exec(t);return a?a[1]:void 0}catch{return}},F=(e,t={})=>{const a=w[e],n={available:!1,name:e},i=t.version!==!1,r=o=>{if(i)return Oe(o)},s=process.env[a.envVariable];if(s&&N(L(s))){const o=L(s);return{...n,available:!0,detectionMethod:"envvar",path:o,version:r(o)}}const d=[a.command,...a.alternateCommands];for(const o of d){const c=Te(o);if(c)return{...n,available:!0,detectionMethod:"which",path:c,version:r(c)}}for(const o of d)for(const c of Ie(o))if(N(c))return{...n,available:!0,detectionMethod:"known-path",path:c,version:r(c)};return n},Se=(e={})=>V.map(t=>F(t,e)),Pe=(e={})=>Se(e).filter(t=>t.available),Ne=(e,t,a={})=>{const n=w[e],i=a.model??n.defaultModel,r=a.maxTokens!==void 0&&Number.isFinite(a.maxTokens)?a.maxTokens:pe;return n.buildArgs(t,{dangerous:a.dangerous===!0,maxTokens:r,model:i})},$e=async(e,t,a={})=>{if(!e.available||!e.path)throw new A(`AI provider "${e.name}" is not available.`,{durationMs:0,provider:e.name});const n=Ne(e.name,t,a),i=a.timeoutMs!==void 0&&Number.isFinite(a.timeoutMs)?a.timeoutMs:ue,r=e.path,s=U(r),d=Date.now();if(a.signal?.aborted)throw new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:0,provider:e.name});return new Promise((o,c)=>{const m={cwd:a.cwd,env:{...process.env,...a.env,FORCE_COLOR:"0",NO_COLOR:"1"},shell:s,stdio:["pipe","pipe","pipe"]},u=s?n.map(l=>$(l)):n,f=Z(s?$(r):r,u,m);f.stdin?.end();let b="",v="",y=!1,O,S,M;const T=()=>{clearTimeout(S),clearTimeout(O),M&&a.signal?.removeEventListener("abort",M)},Y=()=>{f.kill("SIGKILL")},P=l=>{if(y)return;y=!0,f.kill("SIGTERM"),O=setTimeout(Y,5e3),T();const p=Date.now()-d,z=l?new A(`${e.name} CLI run was aborted.`,{aborted:!0,durationMs:p,provider:e.name,stderr:v,stdout:b}):new A(`${e.name} CLI timed out after ${String(i)}ms`,{durationMs:p,provider:e.name,stderr:v,stdout:b,timedOut:!0});c(z)};S=setTimeout(P,i,!1),M=()=>{P(!0)},a.signal?.addEventListener("abort",M,{once:!0}),f.stdout?.on("data",l=>{const p=l.toString("utf8");b+=p,a.onStdout?.(p)}),f.stderr?.on("data",l=>{const p=l.toString("utf8");v+=p,a.onStderr?.(p)}),f.on("close",l=>{if(y)return;y=!0,T();const p=Date.now()-d;l===0?o({durationMs:p,exitCode:l,provider:e.name,stderr:v,stdout:b}):c(new A(`${e.name} CLI exited with code ${String(l)}: ${v||b}`,{durationMs:p,exitCode:l,provider:e.name,stderr:v,stdout:b}))}),f.on("error",l=>{y||(y=!0,T(),c(new A(`Failed to spawn ${e.name} CLI: ${l.message}`,{durationMs:Date.now()-d,provider:e.name,stderr:v,stdout:b})))})})},Le=12e4,De=2,xe=1e3,Ge=e=>new Promise(t=>{setTimeout(t,e)}),B=async(e,t,a=De)=>{let n;for(let i=0;i<=a;i+=1)try{return(await $e(e,t,{timeoutMs:Le})).stdout}catch(r){if(n=r instanceof Error?r:new Error(String(r)),n.message.includes("timed out"))throw n;if(i<a){const s=xe*2**i;await Ge(s)}}throw n??new Error("AI request failed after retries")},je={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},He=e=>{if(e?.provider){if(!V.includes(e.provider))return;const n=F(e.provider);return n.available?n:void 0}const t=Pe();if(t.length===0)return;const a={...je,...e?.priority};return t.toSorted((n,i)=>(a[i.name]??0)-(a[n.name]??0))[0]},Ve=new Set(["defer","review","skip","update"]),qe=new Set(["critical","high","low","medium"]),Ue=new Set(["high","low","medium"]),Fe=50,I=30,Be=e=>e.map(t=>{const a=t.vulnerabilities&&t.vulnerabilities.length>0?` [VULNERABILITIES: ${t.vulnerabilities.map(i=>`${i.severity} ${i.id}`).join(", ")}]`:"";let n="";if(t.socketReport){const i=Math.round(t.socketReport.score.overall*100),r=[`score:${String(i)}%`];if(t.socketReport.alerts.length>0){const s={};for(const o of t.socketReport.alerts)s[o.severity]=(s[o.severity]??0)+1;const d=Object.entries(s).map(([o,c])=>`${String(c)} ${o}`).join(", ");r.push(`alerts: ${d}`)}r.push(`supply-chain:${String(Math.round(t.socketReport.score.supplyChain*100))}%`),r.push(`quality:${String(Math.round(t.socketReport.score.quality*100))}%`),n=` [SOCKET.DEV: ${r.join(", ")}]`}return`- ${t.packageName}: ${t.currentRange} → ${t.newRange} (${t.updateType})${a}${n}`}).join(`
|
|
3
|
-
`),_=`Respond ONLY with valid JSON in this exact structure:
|
|
4
|
-
{
|
|
5
|
-
"summary": "Brief overall summary",
|
|
6
|
-
"recommendations": [
|
|
7
|
-
{
|
|
8
|
-
"package": "package-name",
|
|
9
|
-
"action": "update|skip|review|defer",
|
|
10
|
-
"reason": "explanation",
|
|
11
|
-
"riskLevel": "low|medium|high|critical",
|
|
12
|
-
"breakingChanges": ["change1"],
|
|
13
|
-
"effort": "low|medium|high"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"warnings": ["warning1"]
|
|
17
|
-
}`,We={compatibility:e=>`Analyze the compatibility of these package updates:
|
|
18
|
-
|
|
19
|
-
${e}
|
|
20
|
-
|
|
21
|
-
For each package:
|
|
22
|
-
1. Check peer dependency compatibility
|
|
23
|
-
2. Identify potential conflicts with other packages in the list
|
|
24
|
-
3. Assess API compatibility between current and target versions
|
|
25
|
-
4. Check for deprecated features being removed
|
|
26
|
-
5. Evaluate Node.js version requirements
|
|
27
|
-
|
|
28
|
-
${_}`,impact:e=>`Analyze the impact of updating these npm packages:
|
|
29
|
-
|
|
30
|
-
${e}
|
|
31
|
-
|
|
32
|
-
For each package, provide:
|
|
33
|
-
1. Risk level (low/medium/high/critical)
|
|
34
|
-
2. Recommended action (update/skip/review/defer)
|
|
35
|
-
3. Reason for recommendation
|
|
36
|
-
4. Known breaking changes (if any)
|
|
37
|
-
5. Estimated migration effort (low/medium/high)
|
|
38
|
-
|
|
39
|
-
${_}`,recommend:e=>`Provide smart recommendations for updating these packages:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
|
|
43
|
-
Consider:
|
|
44
|
-
1. Update priority based on security, features, and stability
|
|
45
|
-
2. Grouping related packages for atomic updates
|
|
46
|
-
3. Best practices for the specific package ecosystem
|
|
47
|
-
4. Risk vs. benefit analysis
|
|
48
|
-
5. Suggested update order
|
|
49
|
-
6. If Socket.dev scores are provided, prioritize packages with low supply chain or quality scores
|
|
50
|
-
|
|
51
|
-
${_}`,security:e=>`Analyze the security implications of these package updates:
|
|
52
|
-
|
|
53
|
-
${e}
|
|
54
|
-
|
|
55
|
-
For each package:
|
|
56
|
-
1. Check if the update fixes known vulnerabilities (use the vulnerability data above)
|
|
57
|
-
2. Assess if the new version introduces security risks
|
|
58
|
-
3. Evaluate if this is a security-sensitive package (auth, crypto, session, etc.)
|
|
59
|
-
4. Recommend urgency of the update based on vulnerability severity
|
|
60
|
-
5. Flag any packages where skipping the update poses security risk
|
|
61
|
-
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
|
-
|
|
63
|
-
${_}`},Ke=new Set(["compatibility","impact","recommend","security"]),st=e=>Ke.has(e)?e:"impact",W=(e,t="impact")=>{const a=Be(e);return We[t](a)},Je=/```(?:json)?\s*([\s\S]*?)```/,Ye=/\{[\s\S]*\}/,ze=e=>{try{return JSON.parse(e)}catch{}const t=Je.exec(e);if(t?.[1])try{return JSON.parse(t[1])}catch{}const a=Ye.exec(e);if(a?.[0])try{return JSON.parse(a[0])}catch{}},Xe=e=>({action:Ve.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:Ue.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:qe.has(e.riskLevel)?e.riskLevel:"medium"}),K=(e,t,a)=>{const n=ze(e);if(!n||typeof n!="object")return{analysisType:a,provider:t,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const i=n,r=Array.isArray(i.recommendations)?i.recommendations:[];return{analysisType:a,provider:t,recommendations:r.map(s=>Xe(s)),summary:typeof i.summary=="string"?i.summary:"",warnings:Array.isArray(i.warnings)?i.warnings:[]}},Qe={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},Ze=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),D=(e,t)=>{const a=e.map(n=>{const i=n.vulnerabilities&&n.vulnerabilities.length>0,r=Ze.has(n.packageName),s=Qe[n.packageName]??[];let d="low",o="update",c="low",m="Patch/minor update, safe to apply.";return n.updateType==="major"?(d="high",o=s.length>0?"review":"update",c="medium",m=s.length>0?`Major update with known breaking changes: ${s[0]}`:"Major version update, review changelog before applying."):n.updateType==="minor"&&(d="medium",m="Minor update, generally safe."),i&&(d="high",o="update",m="Security update — current version has known vulnerabilities."),r&&n.updateType==="major"&&(o="review",m="Security-sensitive package with major update, careful review needed.",c="high"),{action:o,breakingChanges:s,effort:c,package:n.packageName,reason:m,riskLevel:d}});return{analysisType:t,provider:"rule-engine",recommendations:a,summary:`Rule-based ${t} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},et=async(e,t,a)=>{const n=W(t,a),i=await B(e,n);return K(i,e.name,a)},tt=(e,t,a)=>{const n=[],i=[],r=[];for(const s of e)n.push(...s.recommendations),i.push(...s.warnings),s.summary&&r.push(s.summary);return{analysisType:a,provider:t,recommendations:n,summary:r.length===1?r[0]??"":`Analyzed ${String(n.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(i)]}},J={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},ot=e=>{const t=`${J[e.analysisType]??e.analysisType} Analysis (${e.provider})`,a=e.recommendations.flatMap(i=>{const r=[{action:i.action,effort:i.effort,package:i.package,reason:i.reason,risk:i.riskLevel}];return i.breakingChanges.length>0&&r.push({action:"",effort:"",package:"",reason:`Breaking: ${i.breakingChanges.join("; ")}`,risk:""}),r}),n=process.stdout.columns||80;return te(h.createElement(ae,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},h.createElement(E,{bold:!0},t),h.createElement(E,null,""),h.createElement(E,null,e.summary),h.createElement(E,null,""),h.createElement(ne,{borderStyle:"none",data:a}),...e.warnings.length>0?[h.createElement(E,null,""),...e.warnings.map((i,r)=>h.createElement(E,{dimColor:!0,key:String(r)},` ${i}`))]:[]),{columns:n})},ct=async(e,t,a,n="impact")=>{const i=He(a);if(!i)return t.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
|
-
`),D(e,n);const r=ie(i.name,n,e),s=re(r);if(s)return t.info(`Using cached ${n} analysis from ${s.provider}.
|
|
65
|
-
`),s;const d=J[n]??n;t.info(`Running ${d.toLowerCase()} analysis with ${i.name}...
|
|
66
|
-
`);try{let o;if(e.length>Fe){t.info(`Splitting ${String(e.length)} packages into batches of ${String(I)}...
|
|
67
|
-
`);const c=[];for(let u=0;u<e.length;u+=I)c.push(e.slice(u,u+I));const m=[];for(let u=0;u<c.length;u+=1){t.info(` Batch ${String(u+1)}/${String(c.length)}...`);const f=c[u];f&&m.push(await et(i,f,n))}o=tt(m,i.name,n)}else{const c=await B(i,W(e,n));o=K(c,i.name,n)}return se(r,o,oe(n,a?.cacheTtl)),o}catch(o){const c=o instanceof Error?o.message:String(o);return t.warn(`AI analysis failed (${c}), falling back to rule engine.
|
|
68
|
-
`),D(e,n)}};export{Se as F,st as K,He as R,je as S,ot as W,ct as Z,ze as b,$e as p,B as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as g}from"node:module";import{c as b}from"./compile-cache-B_Vf_WxT.js";import{i as y,h as w,t as $,p as m,c as M,m as R}from"./package-version-mvGIa7gN.js";import{I as S}from"./index-B0EsgdzO.js";const _=g(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,o]=r.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return r.getBuiltinModule(e)}return _(e)},{createRequire:T}=x("node:module"),O=T(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=e=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[s,o]=t.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return t.getBuiltinModule(e)}return O(e)},{execFileSync:j}=f("node:child_process"),{totalmem:q}=f("node:os"),N=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,C=e=>Math.floor(q()/1024/1024*e),B=e=>e<=512?4:e<=1024?8:e<=2048?16:e<=4096?32:e<=8192?64:Math.floor(Math.log2(e))*8,d=(e,s)=>{for(const o of s){const n=e.exec(o);if(n)return Number.parseInt(n[1],10)}},E=e=>{const o=[...M()],n=[...y()],a=d(N,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??C(.75),h=p??B(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(h)}`),c.length!==0)try{j(w(),[...c,...o,...n.slice(1)],{env:$(),stdio:"inherit"}),m(0)}catch(v){const u=v.status;m(typeof u=="number"?u:1)}},I=()=>{process.env.VIS_VERSION=R()},Y=e=>{!process.stdout.isTTY||S||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},L=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!L.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&E();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");I();b();(async()=>{if(i==="__pm-shim"){const{dispatchShim:s}=await import("../packem_chunks/dispatch.js");s(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:s}=await import("../packem_chunks/lean.js");await s(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:s}=await import("../packem_chunks/cli-exec.js");await s();return}const{runCli:e}=await import("../packem_chunks/cli-main.js").then(s=>s.aq);await e()})();export{Y as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{m as h,f as y}from"./index-D75r1yKp.js";import{a as q}from"./readJsonSync-DuMMeB3s-wlhgSHes.js";const $=j(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,n]=g.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return g.getBuiltinModule(e)}return $(e)},{readdirSync:_,statSync:M}=k("node:fs"),w=["preinstall","install","postinstall","prepare"],x=e=>{const s=h(e,"node_modules");if(!y(s))return[];const n=new Map,o=(l,p="")=>{let u;try{u=_(l)}catch{return}for(const r of u){const i=h(l,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&p===""){let f;try{f=_(i)}catch{continue}for(const a of f){const c=h(i,a,"node_modules");y(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=p+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!y(t))continue;const f=q(t),a=f.scripts??{},c=w.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&y(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof f.version=="string"?f.version:void 0});const d=h(i,"node_modules");y(d)&&o(d)}catch{}}};return o(s),[...n.values()]},W=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},B=(e,s,n)=>{for(const[o,l]of Object.entries(s)){if(!l)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:p,version:u}=W(o);if(p===e.name&&(!n||u===void 0||e.version===u))return!0}return!1},O=(e,s,n={})=>{const o=n.pinVersions===!0,l=x(e),p=[],u=[],r=new Map(l.map(t=>[t.name,t]));for(const t of l)B(t,s,o)?u.push(t):p.push(t);const i=[],m=[];for(const[t,f]of Object.entries(s)){if(!f)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(b=>b.startsWith(v))||i.push(t);continue}const{name:a,version:c}=W(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:p,versionDrift:m}},S=(e,s)=>O(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{O as W,S as w};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{createRequire as ie}from"node:module";import{m as E,v as ue}from"./index-D75r1yKp.js";import{r as le}from"./docker-B2h5KRZH.js";import{a as oe}from"./readJsonSync-DuMMeB3s-wlhgSHes.js";import{e as fe}from"./license-t5KnNX6v.js";import{D as de}from"./package-version-mvGIa7gN.js";import"./public-api-WqUCiyIe.js";import{u as he}from"./index-BAe6e0XE.js";const ae=ie(import.meta.url),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,se=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[n,t]=P.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return P.getBuiltinModule(e)}return ae(e)},{randomUUID:pe}=se("node:crypto"),{readdirSync:me}=se("node:fs"),X=e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),C=(e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const s=t.indexOf("/");if(s>0){const r=t.slice(0,s),p=t.slice(s+1);return`pkg:npm/${X(r)}/${X(p)}@${X(n)}`}}return`pkg:npm/${X(t)}@${X(n)}`},m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},_e=[m.STRING,m.NUMBER,m.BOOLEAN],ge='<?xml version="1.0" encoding="UTF-8"?>',ee=["_selfCloseTag","_attrs"],ye=(e="",n=0)=>e.repeat(n),Y=e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,re=e=>e.startsWith("<![CDATA["),ce=(e="",n={},t)=>{let s=e;if(typeof e===m.STRING){if(re(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(r,(p,h)=>n[h]||"")}return typeof t=="function"?t(s):s},be=(e={},n,t,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const h=Object.keys(p)[0],_=p[h];if(typeof t===m.FUNCTION&&t(h,_))return r;const y=n?ce(_,n):_,$=!s&&y===!0?"":`="${y}"`;return r.push(`${h}${$}`),r},[]),$e=(e={},n,t,s)=>{const r=be(e,n,t,s);return r.length===0?"":` ${r.join(" ")}`},Oe=(e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),ve=e=>_e.includes(Y(e)),je=e=>!e.match("<"),ke=({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?ge:e:"",ne={"<":"<",">":">","&":"&",'"':"""},U=(e={},n={})=>{const{depth:t=0,indent:s,_isFirstItem:r,_isOutputStart:p=!0,header:h,attributeReplacements:_={},attributeFilter:y,attributeExplicitTrue:$=!1,contentReplacements:F={},contentMap:M,selfCloseTags:B=!0}=n,J=typeof _=="boolean"&&!_?{}:{...ne,..._},G=typeof F=="boolean"&&!F?{}:{...ne,...F},D=typeof s=="string",k=ye(s,t),W=Y(e),L=ke({header:h,isOutputStart:p}),N=p&&!L&&r&&t===0,R=D&&!N?`
|
|
2
|
-
`:"";let b="";switch(W){case m.JSTOXML_OBJECT:{const{_name:f,_content:u}=e;if(u===null&&typeof M!="function"){b=`${R}${k}${f}`;break}if(Array.isArray(u)&&u.every(ve))return u.map(j=>U({_name:f,_content:j},{...n,depth:t,_isOutputStart:!1})).join("");if(ee.includes(f))break;const g=U(u,{...n,depth:t+1,_isOutputStart:N}),w=Y(g),O=je(g),v=re(g),x=`${R}${k}`;if(f==="_comment"){b+=`${x}<!-- ${u} -->`;break}const H=w==="undefined"||g==="",c=B,o=e._selfCloseTag,a=typeof o===m.BOOLEAN?H&&o:H&&c,i=a?"/":"",l=$e(e._attrs,J,y,$),d=`<${f}${l}${i}>`,T=D&&!O&&!v?`
|
|
3
|
-
${k}`:"",S=a?"":`${g}${T}</${f}>`;b+=`${x}${d}${S}`;break}case m.OBJECT:{const f=Object.keys(e);b=f.map((u,g)=>{const w={...n,_isFirstItem:g===0,_isLastItem:g+1===f.length,_isOutputStart:N},O={_name:u};if(Y(e[u])===m.OBJECT&&(ee.forEach(v=>{const x=e[u][v];typeof x<"u"&&(O[v]=x,delete e[u][v])}),typeof e[u]._content<"u"&&Object.keys(e[u]).length>1)){const v=Object.assign({},e[u]);delete v._content,O._content=[...Oe(v),e[u]._content]}return typeof O._content>"u"&&(O._content=e[u]),U(O,w)},n).join("");break}case m.FUNCTION:{const f=e(n);b=U(f,n);break}case m.ARRAY:{b=e.map((f,u)=>{const g={...n,_isFirstItem:u===0,_isLastItem:u+1===e.length,_isOutputStart:N};return U(f,g)}).join("");break}default:{b=ce(e,G,M);break}}return`${L}${b}`},Q=e=>{try{return oe(e)}catch{return}},Te=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},Se=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),Ae=(e,n,t)=>{const s=`${n.replaceAll("/","+")}@${t}`,r=E(e,"node_modules",".pnpm"),p=Q(E(r,s,"node_modules",n,"package.json"));if(p)return p;let h;try{h=me(r)}catch{return}const _=`${s}_`;for(const y of h){if(!y.startsWith(_))continue;const $=Q(E(r,y,"node_modules",n,"package.json"));if($)return $}},we=(e,n,t)=>{const s=Q(E(e,"node_modules",n,"package.json"));return s?.version===t?s:void 0},xe=(e,n,t)=>{if(!(!Te(n)||!Se(t)))return Ae(e,n,t)??we(e,n,t)},De={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Ne={sha256:64,sha384:96,sha512:128},Re=e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Ne[t.algorithm]&&(n.hash={alg:De[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},Ce=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ee=e=>{for(const{file:n,type:t}of Ce){let s;try{s=ue(E(e,n))}catch{continue}const r=new Map;for(const p of de(s,t))r.set(`${p.name}@${p.version}`,Re(p));return{packages:r,type:t}}},Me=e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},V=(e,n,t)=>{const s=t.get(e);if(!s||s.size===0)return;if(s.has(n))return n;const r=Me(n);if(r!==n&&s.has(r))return r;const p=[...s];return he.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},Be="1.7",Le="CycloneDX",Ie="http://cyclonedx.org/schema/bom-1.7.schema.json",Ue="@visulima/vis",te=e=>{try{return oe(e)}catch{return}},Fe=e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},Je=e=>{if(e)return typeof e=="string"?e:e.url},qe=e=>{if(e)return typeof e=="string"?e:e.url},Pe=e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=Je(e.repository);t&&n.push({type:"vcs",url:t});const s=qe(e.bugs);return s&&n.push({type:"issue-tracker",url:s}),n.length>0?n:void 0},Xe=e=>e==="application"||e==="service"||e==="tool"?"application":"library",K=(e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=Fe(n.author);t&&(e.author=t);const s=fe(n);s&&(e.licenses=s);const r=Pe(n);r&&(e.externalReferences=r)},tn=e=>{const{focus:n,generatorVersion:t,includeDev:s=!1,now:r=new Date,projectGraph:p,serialNumber:h,workspace:_,workspaceRoot:y}=e,$=n&&n.length>0?[...le(n,p)].sort():Object.keys(_.projects).sort(),F=new Set($),M=new Map;for(const c of $){const o=_.projects[c];o&&M.set(c,te(E(y,o.root,"package.json")))}const B=[],J=new Map;for(const c of $){const o=_.projects[c];if(!o)continue;const a=M.get(c),i=a?.version??"0.0.0",l=C(c,i);J.set(c,l);const d={"bom-ref":l,name:c,purl:l,type:Xe(o.projectType),version:i};K(d,a),B.push(d)}const G=Ee(y),D=new Map,k=new Map;if(G)for(const c of G.packages.values()){D.set(`${c.name}@${c.version}`,c);let o=k.get(c.name);o||(o=new Set,k.set(c.name,o)),o.add(c.version)}const W=[],L=[],N=new Map;for(const c of $){const o=M.get(c);if(!o)continue;const a=[o.dependencies,o.peerDependencies];s&&a.push(o.devDependencies);const i=new Set,l=(d,T)=>{if(T)for(const[S,j]of Object.entries(T)){if(F.has(S)){const I=J.get(S);I&&i.add(I);continue}const A=V(S,j,k);A&&(i.add(C(S,A)),d.push(`${S}@${A}`))}};for(const d of a)l(W,d);l(L,o.optionalDependencies),N.set(c,i)}const R=new Map,b=new Map,f=(c,o)=>{const a=[...c];for(;a.length>0;){const i=a.pop(),l=R.get(i);if(l==="required"||l==="optional"&&o==="optional")continue;R.set(i,o);const d=D.get(i);if(!d)continue;const T=b.get(i)??new Set,S=[d.dependencies,d.peerDependencies];for(const j of S)if(j)for(const[A,I]of Object.entries(j))for(const q of I){const z=V(A,q,k);z&&(T.add(C(A,z)),a.push(`${A}@${z}`))}if(d.optionalDependencies)for(const[j,A]of Object.entries(d.optionalDependencies))for(const I of A){const q=V(j,I,k);q&&(T.add(C(j,q)),L.push(`${j}@${q}`))}T.size>0&&b.set(i,T)}};f(W,"required"),f(L,"optional");const u=[],g=[...R.keys()].sort();for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i={"bom-ref":a,name:o.name,purl:a,scope:R.get(c)??"required",type:"library",version:o.version};o.hash&&(i.hashes=[o.hash]),K(i,xe(y,o.name,o.version)),u.push(i)}const w=[];for(const[c,o]of N){const a=J.get(c);if(!a)continue;const i=[...o].sort();w.push(i.length>0?{dependsOn:i,ref:a}:{ref:a})}for(const c of g){const o=D.get(c);if(!o)continue;const a=C(o.name,o.version),i=b.get(c),l=i?[...i].sort():[];w.push(l.length>0?{dependsOn:l,ref:a}:{ref:a})}w.sort((c,o)=>c.ref.localeCompare(o.ref));const O=te(E(y,"package.json")),v=(()=>{if(n?.length===1){const l=B.find(d=>d.name===n[0]);if(l)return{"bom-ref":l["bom-ref"],name:l.name,purl:l.purl,type:l.type,version:l.version}}const c=O?.name??"workspace",o=O?.version??"0.0.0",a=C(c,o),i={"bom-ref":a,name:c,purl:a,type:"application",version:o};return K(i,O),i})(),x=v["bom-ref"],H=x?B.filter(c=>c["bom-ref"]!==x):B;return{$schema:Ie,bomFormat:Le,components:[...H,...u],dependencies:w,metadata:{component:v,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ue,type:"application",...t?{version:t}:{}}]}},serialNumber:h??`urn:uuid:${pe()}`,specVersion:Be,version:1}},sn=e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(Ge(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(s=>Z(s)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(s=>He(s)),_name:"dependencies"}),`${U({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
|
-
`},Ge=e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const s=[];return t.phase&&s.push({phase:t.phase}),t.name&&s.push({name:t.name}),t.description&&s.push({description:t.description}),{_content:s,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>Z(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(Z(e.component)),{_content:n,_name:"metadata"}},Z=e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const s=We(e.licenses);return s&&t.push(s),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},We=e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const s=[];"id"in t.license&&t.license.id?s.push({id:t.license.id}):"name"in t.license&&t.license.name&&s.push({name:t.license.name}),n.push({_content:s,_name:"license"})}return{_content:n,_name:"licenses"}},He=e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"};export{tn as b,sn as s,C as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{m as _}from"./index-D75r1yKp.js";import{a as F}from"./en-BRcjb70R.js";const p=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=r=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,e]=o.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return o.getBuiltinModule(r)}return p(r)},{mkdirSync:f,writeFileSync:h,readdirSync:g}=c("node:fs"),{readFile:y}=c("node:fs/promises"),n=r=>F(r),a=(r,t)=>_(n(r),`${encodeURIComponent(t)}.json`);class S{#t;#e;constructor(t,e){this.#t=t,this.#e=e}printTaskTerminalOutput(t,e,s){if(e!=="failure")return;const i=n(this.#t);try{f(i,{recursive:!0})}catch{return}const u=t.overrides.command,d=t.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:t.hash,runId:this.#e,status:e,taskId:t.id,terminalOutput:s,timestamp:new Date().toISOString()};try{h(a(this.#t,t.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
-
`,"utf8")}catch{}}}const I=async(r,t)=>{const e=a(r,t);try{const s=await y(e,"utf8");return JSON.parse(s)}catch{return}},O=r=>{const t=n(r);let e;try{e=g(t)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{s.push(decodeURIComponent(i.slice(0,-5)))}catch{}return s};export{S as F,I as a,O as l};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as ce}from"node:module";const le=ce(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=r=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[e,t]=y.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return y.getBuiltinModule(r)}return le(r)},{existsSync:m,openSync:ue,readSync:de,closeSync:pe,statSync:he,createWriteStream:X,readdirSync:fe,renameSync:me}=w("node:fs"),{readFile:q,mkdir:S,rm:x,writeFile:ge,mkdtemp:we}=w("node:fs/promises"),{PassThrough:V,Readable:z,pipeline:$e}=w("node:stream"),{pipeline:J}=w("node:stream/promises"),{spawn:Y}=w("node:child_process"),{basename:ve,normalize:be,delimiter:C,resolve:Z,dirname:F,join:I}=w("node:path"),{cwd:K}=y,_e=w("node:readline"),{homedir:ye,tmpdir:Q}=w("node:os"),{promisify:ke}=w("node:util");var G=Object.defineProperty,Ee=(r,e)=>{let t={};for(var n in r)G(t,n,{get:r[n],enumerable:!0});return G(t,Symbol.toStringTag,{value:"Module"}),t};const xe=/^[A-Za-z]:\//;function T(r=""){return r&&r.replace(/\\/g,"/").replace(xe,e=>e.toUpperCase())}const Ce=/^[/\\]{2}/,Te=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,ee=/^[A-Za-z]:$/,te=function(r){if(r.length===0)return".";r=T(r);let e=r.match(Ce),t=k(r),n=r[r.length-1]==="/";return r=re(r,!t),r.length===0?t?"/":n?"./":".":(n&&(r+="/"),ee.test(r)&&(r+="/"),e?t?`//${r}`:`//./${r}`:t&&!k(r)?`/${r}`:r)},M=function(...r){let e="";for(let t of r)if(t)if(e.length>0){let n=e[e.length-1]==="/",o=t[0]==="/";n&&o?e+=t.slice(1):e+=n||o?t:`/${t}`}else e+=t;return te(e)};function Oe(){return typeof process.cwd=="function"?process.cwd().replace(/\\/g,"/"):"/"}const f=function(...r){r=r.map(n=>T(n));let e="",t=!1;for(let n=r.length-1;n>=-1&&!t;n--){let o=n>=0?r[n]:Oe();!o||o.length===0||(e=`${o}/${e}`,t=k(o))}return e=re(e,!t),t&&!k(e)?`/${e}`:e.length>0?e:"."};function re(r,e){let t="",n=0,o=-1,s=0,i=null;for(let a=0;a<=r.length;++a){if(a<r.length)i=r[a];else{if(i==="/")break;i="/"}if(i==="/"){if(!(o===a-1||s===1))if(s===2){if(t.length<2||n!==2||t[t.length-1]!=="."||t[t.length-2]!=="."){if(t.length>2){let c=t.lastIndexOf("/");c===-1?(t="",n=0):(t=t.slice(0,c),n=t.length-1-t.lastIndexOf("/")),o=a,s=0;continue}else if(t.length>0){t="",n=0,o=a,s=0;continue}}e&&(t+=t.length>0?"/..":"..",n=2)}else t.length>0?t+=`/${r.slice(o+1,a)}`:t=r.slice(o+1,a),n=a-o-1;o=a,s=0}else i==="."&&s!==-1?++s:s=-1}return t}const k=function(r){return Te.test(r)},ne=function(r){let e=T(r).replace(/\/$/,"").split("/").slice(0,-1);return e.length===1&&ee.test(e[0])&&(e[0]+="/"),e.join("/")||(k(r)?"/":".")},oe=function(r,e){let t=T(r).split("/"),n="";for(let o=t.length-1;o>=0;o--){let s=t[o];if(s){n=s;break}}return n},Ae=/^path$/i,D={key:"PATH",value:""};function se(r){for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e)||!Ae.test(e))continue;let t=r[e];return t?{key:e,value:t}:D}return D}function Se(r,e){let t=e.value.split(C),n=[],o=r,s;do n.push(Z(o,"node_modules",".bin")),s=o,o=F(o);while(o!==s);n.push(F(process.execPath));let i=n.concat(t).join(C);return{key:e.key,value:i}}function je(r,e,t=!0){let n={...process.env,...e};if(!t)return n;let o=Se(r,se(n));return n[o.key]=o.value,n}const ze=r=>{let e=r.length,t=new V,n=()=>{--e===0&&t.end()};for(let o of r)J(o,t,{end:!1}).then(n).catch(n);return t},A=/([()\][%!^"`<>&|;, *?])/g,Fe=/^#!\s*(.+)/,Ie=/\.(?:com|exe)$/i,Ge=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,Me=process.platform==="win32",De=[".EXE",".CMD",".BAT",".COM"];function Pe(r,e=[],t={}){if(t.shell===!0||!Me)return{command:r,args:e,options:t};let n=P(r,t),o=null;if(n!==null){let s=Buffer.alloc(150),i=null;try{i=ue(n,"r"),de(i,s,0,150,0)}catch{}finally{i!==null&&pe(i)}let a=s.toString().match(Fe);if(a!==null){let c=a[1].trim(),d=c.indexOf(" "),l=d===-1?c:c.slice(0,d),h=d===-1?"":c.slice(d+1),p=ve(l);o=p==="env"?h||null:p}}if(o!==null&&n!==null&&(e=[n,...e],r=o,n=P(r,t)),n===null||!Ie.test(n)){let s=n!==null&&Ge.test(n);r=be(r),r=r.replace(A,"^$1"),e=e.map(i=>(i=i.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),i=i.replace(/(?=(\\+?)?)\1$/,"$1$1"),i=`"${i}"`,i=i.replace(A,"^$1"),s&&(i=i.replace(A,"^$1")),i)),e=["/d","/s","/c",`"${[r,...e].join(" ")}"`],r=t.env?.comspec??"cmd.exe",t={...t,windowsVerbatimArguments:!0}}return{command:r,args:e,options:t}}function P(r,e){let t=(e.cwd??K()).toString(),n=e.env??process.env,o=se(n).value,s=r.includes("/")||r.includes("\\")?[""]:[t,...o.split(C)],i=n.PATHEXT?n.PATHEXT.split(C):De;r.includes(".")&&i[0]!==""&&i.unshift("");for(let a of s){let c=Z(t,a.startsWith('"')&&a.endsWith('"')&&a.length>1?a.slice(1,-1):a,r);for(let d of i){let l=c+d;try{if(he(l).isFile())return l}catch{}}}return null}var B=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const Be={timeout:void 0,persist:!1},He={windowsHide:!0};function Ne(r){let e=new AbortController;for(let t of r){if(t.aborted)return e.abort(),t;t.addEventListener("abort",()=>{e.abort(t.reason)},{signal:e.signal})}return e.signal}async function H(r){let e="";try{for await(let t of r)e+=t.toString()}catch{}return e}var Re=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...Be,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(o=>{this._resolveClose=o})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Ue(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ze(t),o=_e.createInterface({input:n});for await(let s of o)yield s.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new B(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error("No process was started");let[t,n]=await Promise.all([this._streamOut?H(this._streamOut):"",this._streamErr?H(this._streamErr):""]);await this._processClosed;let{stdin:o}=this._options;if(o&&typeof o!="string"&&await o,e.removeAllListeners(),this._thrownError)throw this._thrownError;let s={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new B(this,s);return s}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=K(),t=this._options,n={...He,...t.nodeOptions},o=[];this._resetState(),t.timeout!==void 0&&o.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&o.push(t.signal),t.persist===!0&&(n.detached=!0),o.length>0&&(n.signal=Ne(o)),n.env=je(e,n.env,t.nodePath);let s=Pe(this._command,this._args,n),i=Y(s.command,s.args,s.options);if(i.stderr&&(this._streamErr=i.stderr),i.stdout&&(this._streamOut=i.stdout),this._process=i,i.once("error",this._onError),i.once("close",this._onClose),i.stdin){let{stdin:a}=t;typeof a=="string"?i.stdin.end(a):a?.process?.stdout?.pipe(i.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name==="AbortError"&&(!(e.cause instanceof Error)||e.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const j=(r,e,t)=>{let n=new Re(r,e,t);return n.spawn(),n},Ue=j;var Le=Ee({detectPackageManager:()=>ie,installDependencies:()=>Ze,packageManagers:()=>v});async function We(r,e,t={}){let n=te(r).split("/");for(;n.length>0;){let o=await e(n.join("/")||"/");if(o||!t.includeParentDirs)return o;n.pop()}}function Xe(r){let e;return()=>(e===void 0&&(e=r().then(t=>(e=t,e))),e)}const qe=Xe(async()=>{if(globalThis.process?.versions?.webcontainer)return!1;try{let{exitCode:r}=await j("corepack",["--version"]);return r===0}catch{return!1}});async function Ve(r,e,t={}){let n=r!=="npm"&&r!=="bun"&&r!=="deno"&&t.corepack!==!1&&await qe()?["corepack",[r,...e]]:[r,e],{exitCode:o,stdout:s,stderr:i}=await j(n[0],n[1],{nodeOptions:{cwd:f(t.cwd||process.cwd()),env:t.env,stdio:t.silent?"pipe":"inherit"}});if(o!==0)throw Error(`\`${n.flat().join(" ")}\` failed.${t.silent?["",s,i].join(`
|
|
2
|
-
`):""}`)}async function Je(r={}){let e=r.cwd||process.cwd(),t={...process.env,...r.env},n=(typeof r.packageManager=="string"?v.find(o=>o.name===r.packageManager):r.packageManager)||await ie(r.cwd||process.cwd());if(!n)throw Error("No package manager auto-detected.");return{cwd:e,env:t,silent:r.silent??!1,packageManager:n,dev:r.dev??!1,workspace:r.workspace,global:r.global??!1,dry:r.dry??!1,corepack:r.corepack??!0}}function Ye(r){let[e,t]=(r||"").split("@"),[n,o]=t?.split("+")||[];if(e&&e!=="-"&&/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(e))return{name:e,version:n,buildMeta:o};let s=(e||"").replace(/\W+/g,"");return{name:s,version:n,buildMeta:o,warnings:[`Abnormal characters found in \`packageManager\` field, sanitizing from \`${e}\` to \`${s}\``]}}const v=[{name:"npm",command:"npm",lockFile:"package-lock.json"},{name:"pnpm",command:"pnpm",lockFile:"pnpm-lock.yaml",files:["pnpm-workspace.yaml"]},{name:"bun",command:"bun",lockFile:["bun.lockb","bun.lock"]},{name:"yarn",command:"yarn",lockFile:"yarn.lock",files:[".yarnrc.yml"]},{name:"deno",command:"deno",lockFile:"deno.lock",files:["deno.json"]}];async function ie(r,e={}){let t=await We(f(r||"."),async n=>{if(!e.ignorePackageJSON){let o=M(n,"package.json");if(m(o)){let s=JSON.parse(await q(o,"utf8"));if(s?.packageManager){let{name:i,version:a="0.0.0",buildMeta:c,warnings:d}=Ye(s.packageManager);if(i){let l=a.split(".")[0],h=v.find(p=>p.name===i&&p.majorVersion===l)||v.find(p=>p.name===i);return{name:i,command:i,version:a,majorVersion:l,buildMeta:c,warnings:d,files:h?.files,lockFile:h?.lockFile}}}}if(m(M(n,"deno.json")))return v.find(s=>s.name==="deno")}if(!e.ignoreLockFile){for(let o of v)if([o.lockFile,o.files].flat().filter(Boolean).some(s=>m(f(n,s))))return{...o}}},{includeParentDirs:e.includeParentDirs??!0});if(!t&&!e.ignoreArgv){let n=process.argv[1];if(n){for(let o of v)if(RegExp(`[/\\\\]\\.?${o.command}`).test(n))return o}}return t}async function Ze(r={}){let e=await Je(r),t=r.frozenLockFile?{npm:["ci"],yarn:["install","--immutable"],bun:["install","--frozen-lockfile"],pnpm:["install","--frozen-lockfile"],deno:["install","--frozen"]}[e.packageManager.name]:["install"];return r.ignoreWorkspace&&e.packageManager.name==="pnpm"&&t.push("--ignore-workspace"),e.dry||await Ve(e.packageManager.command,t,{cwd:e.cwd,silent:e.silent,corepack:e.corepack}),{exec:{command:e.packageManager.command,args:t}}}const Ke=Object.defineProperty({__proto__:null,basename:oe,dirname:ne,dist_exports:Le,resolve:f},Symbol.toStringTag,{value:"Module"});async function Qe(r,e,t={}){const n=e+".json",o=JSON.parse(await q(n,"utf8").catch(()=>"{}")),s=(await E(r,{method:"HEAD",headers:t.headers}).catch(()=>{}))?.headers.get("etag");if(o.etag===s&&m(e))return;typeof s=="string"&&(o.etag=s);const i=await E(r,{headers:t.headers});if(i.status>=400)throw new Error(`Failed to download ${r}: ${i.status} ${i.statusText}`);const a=X(e);await ke($e)(i.body,a),await ge(n,JSON.stringify(o),"utf8")}const et=/^(?<repo>[-\w.]+\/[-\w.]+)(?<subdir>[^#]+)?(?<ref>#[-\w./@]+)?/,tt=/^(?<repo>[-\w.]+(?:\/[-\w.]+)+?)(?:::(?<subdir>[^#]*))?(?<ref>#[-\w./@]+)?$/;function O(r,e){const t=e?.expandRepo||r.includes("::"),n=r.match(t?tt:et)?.groups||{},o=t?n.subdir?"/"+n.subdir:"/":n.subdir||"/";return{repo:n.repo||"",subdir:o,ref:n.ref?n.ref.slice(1):"main"}}function $(...r){process.env.DEBUG&&console.debug("[giget]",...r)}async function E(r,e={}){e.headers?.["sec-fetch-mode"]&&(e.mode=e.headers["sec-fetch-mode"]);const t=await fetch(r,{...e,headers:ae(e.headers)}).catch(n=>{throw new Error(`Failed to download ${r}: ${n}`,{cause:n})});if(e.validateStatus&&t.status>=400)throw new Error(`Failed to fetch ${r}: ${t.status} ${t.statusText}`);return t}function rt(){const r=process.env.XDG_CACHE_HOME?f(process.env.XDG_CACHE_HOME,"giget"):f(ye(),".cache/giget");if(process.platform==="win32"){const e=f(Q(),"giget");if(!m(e)&&m(r))try{me(r,e)}catch{}return e}return r}function ae(r={}){const e={};for(const[t,n]of Object.entries(r))n&&(e[t.toLowerCase()]=n);return e}const nt=(r,e)=>{const t=ot(r);return{name:t.name,version:t.subdir?`${t.version||"default"}-${t.subdir.replaceAll("/","-")}`:t.version,tar:({auth:n}={})=>st(t,n??e.auth)}};function ot(r,e={}){const t=e.cwd??process.cwd();let n=r.replace(/#.*$/,""),o;if(/^[./]/.test(r))n=f(t,n);else if(/^https?:\/\//.test(n)){const l=/^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(l){const[,h,p,g]=l;n=`${h}/${p}`,g&&(o=g)}}else if(n.includes("@")){const l=/^(.*?:[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(l){const[,h,p]=l;n=h,p&&(o=p)}}else{const l={"github:":"https://github.com/","gh:":"https://github.com/","gitlab:":"https://gitlab.com/","bitbucket:":"https://bitbucket.org/","sourcehut:":"https://git.sr.ht/~"},h=/^(.+?:)/.exec(n)?.at(1);h&&l[h]?n=n.replace(h,l[h]):h||(n=`${(process.env.GIGET_GIT_HOST||"https://github.com/").replace(/\/$/,"")}/${n}`);const p=/^(https?:\/\/[^/]+\/~?[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(n);if(p){const[,g,u]=p;n=g,u&&(o=u)}}const s=n.replace(/^https?:\/\//,"").replace(/^.+@/,"").replace(/(\.git)?(#.*)?$/,"").replace(/^\W+/,"").replaceAll(/[:/]/g,"-"),[i,a]=/#(.+)$/.exec(r)?.at(1)?.split(":")??[],c=i||void 0,d=a||o;return{uri:n,name:s,...c&&{version:c},...d&&{subdir:d}}}async function st(r,e){const t=await we(I(Q(),"giget-git-"));if(e&&/[\r\n]/.test(e))throw new Error("Auth token must not contain newline characters");const n={...process.env,GIT_TERMINAL_PROMPT:"0"};e&&(n.GIT_CONFIG_COUNT="1",n.GIT_CONFIG_KEY_0="http.extraHeader",n.GIT_CONFIG_VALUE_0=`Authorization: Bearer ${e}`);const o={env:n,timeout:6e4},s=it(),i=c=>R(c,o,s),a=c=>R(c,{...o,cwd:t},s);try{const c=["clone","--progress","--depth","1"];r.subdir&&c.push("--filter=blob:none","--sparse","--no-checkout"),r.version&&c.push("--branch",r.version),c.push("--",r.uri,t);try{s.update("Cloning..."),await i(c),s.update("Cloned.")}catch(u){if(!r.version)throw u;$("Shallow clone failed, falling back to full clone:",u),s.update("Shallow clone failed, cloning..."),await x(t,{recursive:!0,force:!0}),await S(t,{recursive:!0}),await a(["init"]),await a(["remote","add","origin",r.uri]),await a(["fetch","origin"]),await a(["checkout",r.version]),s.update("Fetched.")}r.subdir&&(s.update(`Sparse checkout ${r.subdir}...`),await a(["sparse-checkout","set",r.subdir]),await a(["checkout"])),s.update("Packing...");const d=r.subdir?I(t,r.subdir):t,{create:l}=await import("../packem_chunks/tar.js").then(u=>u.index_min_exports);s.done();const h=l({gzip:!0,cwd:d,filter:u=>!u.startsWith(".git/")&&u!==".git"&&!u.startsWith("./.git/")&&u!=="./.git"},["."]).pipe(new V);let p=!1;const g=()=>{p||(p=!0,x(t,{recursive:!0,force:!0}))};return h.on("end",g),h.on("error",g),h.on("close",g),h}catch(c){throw s.done(),await x(t,{recursive:!0,force:!0}),c}}const N=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];function R(r,e,t){return new Promise((n,o)=>{const s=Y("git",r,{...e,stdio:["ignore","pipe","pipe"]});s.stdout.resume();let i="";s.stderr?.on("data",a=>{const c=a.toString();for(const d of c.split(/[\r\n]/)){const l=d.trim();l&&(i=l)}t&&t.update(i)}),s.on("close",a=>{a===0?n(i):o(new Error(`git ${r[0]} exited with code ${a}. Is git installed?`))}),s.on("error",a=>{a.code==="ENOENT"?o(new Error("git is not installed or not found in PATH")):o(a)})})}function it(){if(!process.stderr.isTTY)return{update(o){},done(){}};let r="",e=0;const t=()=>{const o=N[e%N.length];e++,process.stderr.write(`\x1B[2K\r\x1B[2m${o} ${r}\x1B[0m`)},n=setInterval(t,80);return{update(o){r=o,t()},done(){clearInterval(n),process.stderr.write("\x1B[2K\r")}}}const U=async(r,e)=>{if(r.endsWith(".json"))return await L(r,e);const t=new URL(r);let n=oe(t.pathname);try{const o=await E(t.href,{method:"HEAD",validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if((o.headers.get("content-type")||"").includes("application/json"))return await L(r,e);const s=o.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];s&&(n=s.split(".")[0])}catch(o){$(`Failed to fetch HEAD for ${t.href}:`,o)}return{name:`${n}-${t.href.slice(0,8)}`,version:"",subdir:"",tar:t.href,defaultDir:n,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0}}},L=async(r,e)=>{const t=await(await E(r,{validateStatus:!0,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}})).json();if(!t.tar||!t.name)throw new Error(`Invalid template info from ${r}. name or tar fields are missing!`);return t},W=(r,e)=>{const t=O(r),n=process.env.GIGET_GITHUB_URL||"https://api.github.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`${n.replace("api.github.com","github.com")}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/repos/${t.repo}/tarball/${t.ref}`}},at=(r,e)=>{const t=O(r,{expandRepo:!0}),n=process.env.GIGET_GITLAB_URL||"https://gitlab.com";return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0,"sec-fetch-mode":"same-origin"},url:`${n}/${t.repo}/tree/${t.ref}${t.subdir}`,tar:`${n}/${t.repo}/-/archive/${t.ref}.tar.gz`}},ct=(r,e)=>{const t=O(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://bitbucket.com/${t.repo}/src/${t.ref}${t.subdir}`,tar:`https://bitbucket.org/${t.repo}/get/${t.ref}.tar.gz`}},lt=(r,e)=>{const t=O(r);return{name:t.repo.replace("/","-"),version:t.ref,subdir:t.subdir,headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0},url:`https://git.sr.ht/~${t.repo}/tree/${t.ref}/item${t.subdir}`,tar:`https://git.sr.ht/~${t.repo}/archive/${t.ref}.tar.gz`}},ut={http:U,https:U,git:nt,github:W,gh:W,gitlab:at,bitbucket:ct,sourcehut:lt},dt="https://raw.githubusercontent.com/unjs/giget/main/templates",pt=(r=dt,e={})=>(async t=>{const n=Date.now(),o=`${r}/${t}.json`,s=await E(o,{headers:{authorization:e.auth?`Bearer ${e.auth}`:void 0}});if(s.status>=400)throw new Error(`Failed to download ${t} template info from ${o}: ${s.status} ${s.statusText}`);const i=await s.json();if(!i.tar||!i.name)throw new Error(`Invalid template info from ${o}. name or tar fields are missing!`);return $(`Fetched ${t} template info from ${o} in ${Date.now()-n}ms`),i}),ht=/^([\w+-.]+):/;function ft(r){if(!r)return;if(typeof r=="function")return r;const e=globalThis.process.getBuiltinModule?.("node:path")?.matchesGlob;if(typeof e!="function")throw new TypeError("Ignore patterns require `path.matchesGlob` which is supported in Node.js v22.5.0, v20.17.0 or later.");return t=>r.some(n=>e(t,n))}async function $t(r,e={}){const t=ft(e.ignore);e.registry=process.env.GIGET_REGISTRY??e.registry,e.auth=process.env.GIGET_AUTH??e.auth;const n=e.registry===!1?void 0:pt(e.registry,{auth:e.auth});let o=e.provider||(n?"registry":"github"),s=r;const i=r.match(ht);i&&(o=i[1],s=r.slice(i[0].length),(o==="http"||o==="https")&&(s=r)),o.endsWith("+git")&&(s=`${o.slice(0,-4)}:${s}`,o="git");const a=e.providers?.[o]||ut[o]||n;if(!a)throw new Error(`Unsupported provider: ${o}`);const c=await Promise.resolve().then(()=>a(s,{auth:e.auth})).catch(u=>{throw new Error(`Failed to download template from ${o}: ${u.message}`)});if(!c)throw new Error(`Failed to resolve template from ${o}`);c.name=(c.name||"template").replace(/[^\da-z-]/gi,"-"),c.defaultDir=(c.defaultDir||c.name).replace(/[^\da-z-]/gi,"-");const d=f(f(rt(),o,c.name),(c.version||c.name)+".tar.gz");if(e.preferOffline&&m(d)&&(e.offline=!0),!e.offline){await S(ne(d),{recursive:!0});const u=Date.now();if(typeof c.tar=="function"){const b=c.tar;await(async()=>{const _=await b({auth:e.auth});await J(_ instanceof z?_:z.fromWeb(_),X(d))})().catch(_=>{if(!m(d))throw _;$("Download error. Using cached version:",_),e.offline=!0})}else await Qe(c.tar,d,{headers:{Authorization:e.auth?`Bearer ${e.auth}`:void 0,...ae(c.headers)}}).catch(b=>{if(!m(d))throw b;$("Download error. Using cached version:",b),e.offline=!0});$(`Downloaded to ${d} in ${Date.now()-u}ms`)}if(!m(d))throw new Error(`Tarball not found: ${d} (offline: ${e.offline})`);const l=f(f(e.cwd||"."),e.dir||c.defaultDir);if(e.forceClean&&await x(l,{recursive:!0,force:!0}),!e.force&&m(l)&&fe(l).length>0)throw new Error(`Destination ${l} already exists.`);await S(l,{recursive:!0});const h=Date.now(),p=c.subdir?.replace(/^\//,"")||"",{extract:g}=await import("../packem_chunks/tar.js").then(u=>u.index_min_exports);if(await g({file:d,cwd:l,onReadEntry(u){u.path=u.path.split("/").splice(1).join("/"),p&&(u.path.startsWith(p+"/")?u.path=u.path.slice(p.length):u.path=""),t&&u.path&&t(u.path.replace(/^\//,""))&&(u.path="")}}),$(`Extracted to ${l} in ${Date.now()-h}ms`),e.install){$("Installing dependencies...");const{installDependencies:u}=await Promise.resolve().then(()=>Ke).then(b=>b.dist_exports);await u({cwd:l,silent:e.silent,...typeof e.install=="object"?e.install:{}})}return{...c,source:s,dir:l}}export{$t as f,Ee as l};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as o}from"./index-D75r1yKp.js";const r=async(s,a)=>await o(s,a);export{r as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as r}from"node:module";const i=r(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{env:s}=t,o=e=>e in s&&s[e]!=="0"&&s[e]!=="false",_=o("CI")||o("CONTINUOUS_INTEGRATION");export{_ as I};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{createRequire as hr}from"node:module";import{E as it}from"./public-api-WqUCiyIe.js";const Er=hr(import.meta.url),Pu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cr=u=>{if(typeof Pu<"u"&&Pu.versions&&Pu.versions.node){const[e,t]=Pu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Pu.getBuiltinModule(u)}return Er(u)},{createRequire:I}=Cr("node:module"),ut=0,Fr=4,gr=Symbol("findUpStop"),Wi=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g,dr=/^[A-Z]:\//i,Ou=(u="")=>u&&u.replaceAll("\\","/").replace(dr,e=>e.toUpperCase()),mr=/^[/\\]{2}/,yr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Mt=/^[A-Z]:$/i,at=/^\/([A-Z]:)?$/i,Br=/.(\.[^./]+)$/,br=/^[/\\]|^[a-z]:[/\\]/i,$r=/\/$/,vr=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",qi="/",jt=(u,e)=>{let t="",s=0,n=-1,r=0,o;for(let i=0;i<=u.length;++i){if(i<u.length)o=u[i];else{if(o==="/")break;o="/"}if(o==="/"){if(!(n===i-1||r===1))if(r===2){if(t.length<2||s!==2||!t.endsWith(".")||t.at(-2)!=="."){if(t.length>2){const l=t.lastIndexOf("/");l===-1?(t="",s=0):(t=t.slice(0,l),s=t.length-1-t.lastIndexOf("/")),n=i,r=0;continue}else if(t.length>0){t="",s=0,n=i,r=0;continue}}e&&(t+=t.length>0?"/..":"..",s=2)}else t.length>0?t+=`/${u.slice(n+1,i)}`:t=u.slice(n+1,i),s=i-n-1;n=i,r=0}else o==="."&&r!==-1?++r:r=-1}return t},Nu=u=>yr.test(u),Se=function(u){if(u.length===0)return".";u=Ou(u);const e=mr.exec(u),t=Nu(u),s=u.at(-1)==="/";return u=jt(u,!t),u.length===0?t?"/":s?"./":".":(s&&(u+="/"),Mt.test(u)&&(u+="/"),e?t?`//${u}`:`//./${u}`:t&&!Nu(u)?`/${u}`:u)},wr=(...u)=>{let e="";for(const t of u)if(t)if(e.length>0){const s=e.at(-1)==="/",n=t[0]==="/";s&&n?e+=t.slice(1):e+=s||n?t:`/${t}`}else e+=t;return Se(e)},Lu=function(...u){u=u.map(s=>Ou(s));let e="",t=!1;for(let s=u.length-1;s>=-1&&!t;s--){const n=s>=0?u[s]:vr();!n||n.length===0||(e=`${n}/${e}`,t=Nu(n))}return e=jt(e,!t),t&&!Nu(e)?`/${e}`:e.length>0?e:"."},Xi=function(u){return Ou(u)},xr=function(u){return Br.exec(Ou(u))?.[1]??""},Ki=function(u,e){const t=Lu(u).replace(at,"$1").split("/"),s=Lu(e).replace(at,"$1").split("/");if(s[0][1]===":"&&t[0][1]===":"&&t[0]!==s[0])return s.join("/");const n=Math.min(t.length,s.length);let r=0;for(;r<n&&t[r]===s[r];)r+=1;const o=t.length-r;return[...Array.from({length:o}).fill(".."),...s.slice(r)].join("/")},et=u=>{const e=Ou(u).replace($r,""),t=e.lastIndexOf("/");if(t===-1)return Nu(u)?"/":".";const s=e.slice(0,t);return Mt.test(s)?`${s}/`:s||(Nu(u)?"/":".")},Gt=(u,e)=>{const t=Ou(u),s=t.slice(t.lastIndexOf("/")+1);if(e&&s.endsWith(e)){if(e===t)return"";const n=s.slice(0,-e.length);if(n.length>0)return n}return s},Sr=function(u){const e=br.exec(u)?.[0]?.replaceAll("\\","/")??"",t=Gt(u),s=xr(t);return{base:t,dir:et(u),ext:s,name:t.slice(0,t.length-s.length),root:e}},_r=I(import.meta.url),Hu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=u=>{if(typeof Hu<"u"&&Hu.versions&&Hu.versions.node){const[e,t]=Hu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Hu.getBuiltinModule(u)}return _r(u)},{fileURLToPath:Rr}=Tr("node:url");function kr(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var lt,ct;function Nr(){return ct||(ct=1,lt=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),lt}var Or=Nr();const Lr=kr(Or);new Set(Lr);const Pr=/^(?:\.?\.[/\\]|\.\.\B)/,Vi=u=>Pr.test(u)||u==="..",yu=u=>Ou(u instanceof URL?Rr(u):u);let Hr=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const bu=u=>{if(!u||!(u instanceof URL)&&typeof u!="string")throw new TypeError("Path must be a non-empty string or URL.")},Ir=I(import.meta.url),Iu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mr=u=>{if(typeof Iu<"u"&&Iu.versions&&Iu.versions.node){const[e,t]=Iu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Iu.getBuiltinModule(u)}return Ir(u)};Mr("node:fs/promises");const jr=I(import.meta.url),Mu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gr=u=>{if(typeof Mu<"u"&&Mu.versions&&Mu.versions.node){const[e,t]=Mu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Mu.getBuiltinModule(u)}return jr(u)};Gr("node:fs");const _e=u=>{if(u.isFile())return"file";if(u.isDirectory())return"dir";if(u.isSymbolicLink())return"symlink"},Ur=I(import.meta.url),ju=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zr=u=>{if(typeof ju<"u"&&ju.versions&&ju.versions.node){const[e,t]=ju.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ju.getBuiltinModule(u)}return Ur(u)},{lstat:Dt,mkdir:Wr}=zr("node:fs/promises"),Ji=async u=>{bu(u);try{const e=await Dt(u);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(_e(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await Wr(u,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=await Dt(u);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(_e(t))}'`,{cause:e})}},qr=I(import.meta.url),Gu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xr=u=>{if(typeof Gu<"u"&&Gu.versions&&Gu.versions.node){const[e,t]=Gu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Gu.getBuiltinModule(u)}return qr(u)},{lstatSync:pt,mkdirSync:Kr}=Xr("node:fs"),Zi=u=>{bu(u);try{const e=pt(u);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(_e(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{Kr(u,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const t=pt(u);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(_e(t))}'`,{cause:e})}},Vr=I(import.meta.url),Uu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qr=u=>{if(typeof Uu<"u"&&Uu.versions&&Uu.versions.node){const[e,t]=Uu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Uu.getBuiltinModule(u)}return Vr(u)};Qr("node:fs/promises");const Jr=I(import.meta.url),zu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zr=u=>{if(typeof zu<"u"&&zu.versions&&zu.versions.node){const[e,t]=zu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return zu.getBuiltinModule(u)}return Jr(u)};Zr("node:fs");const Yr=I(import.meta.url),Wu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,us=u=>{if(typeof Wu<"u"&&Wu.versions&&Wu.versions.node){const[e,t]=Wu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Wu.getBuiltinModule(u)}return Yr(u)};us("node:fs/promises");const es=I(import.meta.url),qu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ts=u=>{if(typeof qu<"u"&&qu.versions&&qu.versions.node){const[e,t]=qu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return qu.getBuiltinModule(u)}return es(u)};ts("node:fs");const rs=I(import.meta.url),Xu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ss=u=>{if(typeof Xu<"u"&&Xu.versions&&Xu.versions.node){const[e,t]=Xu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Xu.getBuiltinModule(u)}return rs(u)};ss("node:fs/promises");const ns=I(import.meta.url),Ku=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,os=u=>{if(typeof Ku<"u"&&Ku.versions&&Ku.versions.node){const[e,t]=Ku.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ku.getBuiltinModule(u)}return ns(u)};os("node:fs");I(import.meta.url);let ft=class extends Error{root;constructor(e,t){super(`${e instanceof Error?e.message:String(e)} for path "${t}"`),this.cause=e,this.root=t}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const At=u=>{const e=u.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${e}$`)}catch(t){throw new Error(`Invalid glob pattern: ${u}`,{cause:t})}};let is=class{name;path;#u;constructor(e,t,s){this.#u=e,this.name=t,this.path=s}isDirectory(){return this.#u.isDirectory()}isFile(){return this.#u.isFile()}isSymbolicLink(){return this.#u.isSymbolicLink()}};const Ke=(u,e,t)=>new is(u,e,t),we=(u,e,t,s)=>{if(Array.isArray(e)&&e.length>0&&!e.some(r=>u.endsWith(r)))return!1;const n=u.includes("\\")?u.replaceAll("\\","/"):u;return t&&!t.some(r=>r.test(n))?!1:!s?.some(r=>r.test(n))},as=I(import.meta.url),Vu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ls=u=>{if(typeof Vu<"u"&&Vu.versions&&Vu.versions.node){const[e,t]=Vu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Vu.getBuiltinModule(u)}return as(u)};ls("node:fs/promises");const cs=I(import.meta.url),Qu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ds=u=>{if(typeof Qu<"u"&&Qu.versions&&Qu.versions.node){const[e,t]=Qu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Qu.getBuiltinModule(u)}return cs(u)},{readdirSync:ps,realpathSync:fs,statSync:Ut}=Ds("node:fs"),As=u=>{const e=Se(u),t=Ut(e);return Ke(t,Gt(e),e)};function*hs(u,e={}){const{extensions:t,followSymlinks:s=!1,includeDirs:n=!0,includeFiles:r=!0,includeSymlinks:o=!0,match:i,maxDepth:l=Number.POSITIVE_INFINITY,skip:d}=e;if(bu(u),l<0)return;const p=e.visited??new Set,m=i?i.map(C=>typeof C=="string"?At(C):C):void 0,b=d?d.map(C=>typeof C=="string"?At(C):C):void 0;if(u=Lu(yu(u)),n&&we(u,t,m,b)&&(yield As(u)),!(l<1||!we(u,void 0,void 0,b)))try{const C=ps(u,{withFileTypes:!0});for(const f of C){let $=wr(u,f.name),F=f.isDirectory(),w=f.isFile();if(f.isSymbolicLink())if(s){const _=fs($);if(p.has(_))continue;$=_;const h=Ut(_);F=h.isDirectory(),w=h.isFile()}else if(o&&we($,t,m,b)){yield Ke(f,f.name,Se($));continue}else continue;F?(s&&p.add($),yield*hs($,{extensions:t,followSymlinks:s,includeDirs:n,includeFiles:r,includeSymlinks:o,match:m,maxDepth:l-1,skip:b,visited:p})):w&&r&&we($,t,m,b)&&(yield Ke(f,f.name,Se($)))}}catch(C){throw C instanceof ft?C:new ft(C,u)}}const Es=I(import.meta.url),Ju=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cs=u=>{if(typeof Ju<"u"&&Ju.versions&&Ju.versions.node){const[e,t]=Ju.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ju.getBuiltinModule(u)}return Es(u)};Cs("node:fs/promises");const Fs=I(import.meta.url),Zu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gs=u=>{if(typeof Zu<"u"&&Zu.versions&&Zu.versions.node){const[e,t]=Zu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Zu.getBuiltinModule(u)}return Fs(u)},{statSync:ds,lstatSync:ms}=gs("node:fs"),ea=(u,e={})=>{if(typeof u!="string"&&!Array.isArray(u)&&typeof u!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const t=e.cwd?yu(e.cwd):process.cwd();let s=Lu(t);const{root:n}=Sr(s),r=yu(e.stopAt??n),o=Lu(s,r),i=e.type??"file",l=function(p){return typeof u=="function"?[u(p)]:typeof u=="string"?[u]:Array.isArray(u)?u:[u]};e.allowSymlinks??=!0;const d=e.allowSymlinks?ds:ms;for(;s&&s!==o&&s!==n;){for(let p of l(s)){if(p===gr)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=yu(p));const m=Nu(p)?p:Lu(s,p);try{const b=d(m);if(i==="file"&&b.isFile()||i==="directory"&&b.isDirectory())return m}catch{}}s=et(s)}};function tt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var ht={},Oe,Et;function Re(){if(Et)return Oe;Et=1;const u="[^\\\\/]",e=Symbol("unignore"),t="\\.",s="\\+",n="\\?",r="\\/",o="(?=.)",i="[^/]",l=`(?:${r}|$)`,d=`(?:^|${r})`,p=`${t}{1,2}${l}`,m=`(?!${t})`,b=`(?!${d}${p})`,C=`(?!${t}{0,1}${l})`,f=`(?!${p})`,$=`[^.${r}]`,F=`${i}*?`,w="/",_={DOT_LITERAL:t,PLUS_LITERAL:s,QMARK_LITERAL:n,SLASH_LITERAL:r,ONE_CHAR:o,QMARK:i,END_ANCHOR:l,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:b,NO_DOT_SLASH:C,NO_DOTS_SLASH:f,QMARK_NO_DOT:$,STAR:F,START_ANCHOR:d,SEP:w},h={..._,SLASH_LITERAL:"[\\\\/]",QMARK:u,STAR:`${u}*?`,DOTS_SLASH:`${t}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${t})`,NO_DOTS:`(?!(?:^|[\\\\/])${t}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${t}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${t}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},g={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Oe={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:g,UNIGNORE:e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(a){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${a.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(a){return a===!0?h:_}},Oe}var Ct;function ke(){return Ct||(Ct=1,(function(u){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:t,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:n}=Re();u.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),u.hasRegexChars=r=>s.test(r),u.isRegexChar=r=>r.length===1&&u.hasRegexChars(r),u.escapeRegex=r=>r.replace(n,"\\$1"),u.toPosixSlashes=r=>r.replace(e,"/"),u.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},u.removeBackslashes=r=>r.replace(t,o=>o==="\\"?"":o),u.escapeLast=(r,o,i)=>{const l=r.lastIndexOf(o,i);return l===-1?r:r[l-1]==="\\"?u.escapeLast(r,o,l-1):`${r.slice(0,l)}\\${r.slice(l)}`},u.removePrefix=(r,o={})=>{let i=r;return i.startsWith("./")&&(i=i.slice(2),o.prefix="./"),i},u.wrapOutput=(r,o={},i={})=>{const l=i.contains?"":"^",d=i.contains?"":"$";let p=`${l}(?:${r})${d}`;return o.negated===!0&&(p=`(?:^(?!${p}).*$)`),p},u.basename=(r,{windows:o}={})=>{const i=r.split(o?/[\\/]/:"/"),l=i[i.length-1];return l===""?i[i.length-2]:l}})(ht)),ht}var Le,Ft;function ys(){if(Ft)return Le;Ft=1;const u=ke(),{CHAR_ASTERISK:e,CHAR_AT:t,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:n,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:i,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:p,CHAR_PLUS:m,CHAR_QUESTION_MARK:b,CHAR_RIGHT_CURLY_BRACE:C,CHAR_RIGHT_PARENTHESES:f,CHAR_RIGHT_SQUARE_BRACKET:$}=Re(),F=_=>_===i||_===s,w=_=>{_.isPrefix!==!0&&(_.depth=_.isGlobstar?1/0:1)};return Le=(_,h)=>{const g=h||{},a=_.length-1,T=g.parts===!0||g.scanToEnd===!0,O=[],x=[],S=[];let v=_,j=-1,q=0,au=0,gu=!1,lu=!1,Z=!1,cu=!1,$u=!1,Au=!1,Du=!1,Q=!1,hu=!1,ru=!1,vu=0,su,R,G={value:"",depth:0,isGlob:!1};const tu=()=>j>=a,A=()=>v.charCodeAt(j+1),X=()=>(su=R,v.charCodeAt(++j));for(;j<a;){R=X();let nu;if(R===s){Du=G.backslashes=!0,R=X(),R===l&&(Au=!0);continue}if(Au===!0||R===l){for(vu++;tu()!==!0&&(R=X());){if(R===s){Du=G.backslashes=!0,X();continue}if(R===l){vu++;continue}if(Au!==!0&&R===r&&(R=X())===r){if(gu=G.isBrace=!0,Z=G.isGlob=!0,ru=!0,T===!0)continue;break}if(Au!==!0&&R===n){if(gu=G.isBrace=!0,Z=G.isGlob=!0,ru=!0,T===!0)continue;break}if(R===C&&(vu--,vu===0)){Au=!1,gu=G.isBrace=!0,ru=!0;break}}if(T===!0)continue;break}if(R===i){if(O.push(j),x.push(G),G={value:"",depth:0,isGlob:!1},ru===!0)continue;if(su===r&&j===q+1){q+=2;continue}au=j+1;continue}if(g.noext!==!0&&(R===m||R===t||R===e||R===b||R===o)&&A()===d){if(Z=G.isGlob=!0,cu=G.isExtglob=!0,ru=!0,R===o&&j===q&&(hu=!0),T===!0){for(;tu()!==!0&&(R=X());){if(R===s){Du=G.backslashes=!0,R=X();continue}if(R===f){Z=G.isGlob=!0,ru=!0;break}}continue}break}if(R===e){if(su===e&&($u=G.isGlobstar=!0),Z=G.isGlob=!0,ru=!0,T===!0)continue;break}if(R===b){if(Z=G.isGlob=!0,ru=!0,T===!0)continue;break}if(R===p){for(;tu()!==!0&&(nu=X());){if(nu===s){Du=G.backslashes=!0,X();continue}if(nu===$){lu=G.isBracket=!0,Z=G.isGlob=!0,ru=!0;break}}if(T===!0)continue;break}if(g.nonegate!==!0&&R===o&&j===q){Q=G.negated=!0,q++;continue}if(g.noparen!==!0&&R===d){if(Z=G.isGlob=!0,T===!0){for(;tu()!==!0&&(R=X());){if(R===d){Du=G.backslashes=!0,R=X();continue}if(R===f){ru=!0;break}}continue}break}if(Z===!0){if(ru=!0,T===!0)continue;break}}g.noext===!0&&(cu=!1,Z=!1);let z=v,wu="",c="";q>0&&(wu=v.slice(0,q),v=v.slice(q),au-=q),z&&Z===!0&&au>0?(z=v.slice(0,au),c=v.slice(au)):Z===!0?(z="",c=v):z=v,z&&z!==""&&z!=="/"&&z!==v&&F(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),g.unescape===!0&&(c&&(c=u.removeBackslashes(c)),z&&Du===!0&&(z=u.removeBackslashes(z)));const D={prefix:wu,input:_,start:q,base:z,glob:c,isBrace:gu,isBracket:lu,isGlob:Z,isExtglob:cu,isGlobstar:$u,negated:Q,negatedExtglob:hu};if(g.tokens===!0&&(D.maxDepth=0,F(R)||x.push(G),D.tokens=x),g.parts===!0||g.tokens===!0){let nu;for(let M=0;M<O.length;M++){const pu=nu?nu+1:q,Eu=O[M],iu=_.slice(pu,Eu);g.tokens&&(M===0&&q!==0?(x[M].isPrefix=!0,x[M].value=wu):x[M].value=iu,w(x[M]),D.maxDepth+=x[M].depth),(M!==0||iu!=="")&&S.push(iu),nu=Eu}if(nu&&nu+1<_.length){const M=_.slice(nu+1);S.push(M),g.tokens&&(x[x.length-1].value=M,w(x[x.length-1]),D.maxDepth+=x[x.length-1].depth)}D.slashes=O,D.parts=S}return D},Le}var Pe,gt;function Bs(){if(gt)return Pe;gt=1;const u=Re(),e=ke(),{MAX_LENGTH:t,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:o}=u,i=(h,g)=>typeof g.expandRange=="function"?g.expandRange(...h,g):(h.sort(),`[${h.join("-")}]`),l=(h,g)=>`Missing ${h}: "${g}" - use "\\\\${g}" to match literal characters`,d=h=>{const g=[];let a=0,T=0,O=0,x="",S=!1;for(const v of h){if(S===!0){x+=v,S=!1;continue}if(v==="\\"){x+=v,S=!0;continue}if(v==='"'){O=O===1?0:1,x+=v;continue}if(O===0){if(v==="[")a++;else if(v==="]"&&a>0)a--;else if(a===0){if(v==="(")T++;else if(v===")"&&T>0)T--;else if(v==="|"&&T===0){g.push(x),x="";continue}}}x+=v}return g.push(x),g},p=h=>{let g=!1;for(const a of h){if(g===!0){g=!1;continue}if(a==="\\"){g=!0;continue}if(/[?*+@!()[\]{}]/.test(a))return!1}return!0},m=h=>{let g=h.trim(),a=!0;for(;a===!0;)a=!1,/^@\([^\\()[\]{}|]+\)$/.test(g)&&(g=g.slice(2,-1),a=!0);if(p(g))return g.replace(/\\(.)/g,"$1")},b=h=>{const g=h.map(m).filter(Boolean);for(let a=0;a<g.length;a++)for(let T=a+1;T<g.length;T++){const O=g[a],x=g[T],S=O[0];if(!(!S||O!==S.repeat(O.length)||x!==S.repeat(x.length))&&(O===x||O.startsWith(x)||x.startsWith(O)))return!0}return!1},C=(h,g=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let a=0,T=0,O=0,x=!1;for(let S=1;S<h.length;S++){const v=h[S];if(x===!0){x=!1;continue}if(v==="\\"){x=!0;continue}if(v==='"'){O=O===1?0:1;continue}if(O!==1){if(v==="["){a++;continue}if(v==="]"&&a>0){a--;continue}if(!(a>0)){if(v==="("){T++;continue}if(v===")"&&(T--,T===0))return g===!0&&S!==h.length-1?void 0:{type:h[0],body:h.slice(2,S),end:S}}}}},f=h=>`${h.length===1?e.escapeRegex(h[0]):`[${h.map(g=>e.escapeRegex(g)).join("")}]`}*`,$=h=>{let g=0;const a=[];for(;g<h.length;){const T=C(h.slice(g),!1);if(!T||T.type!=="*")return;const O=d(T.body).map(S=>S.trim());if(O.length!==1)return;const x=m(O[0]);if(!x||x.length!==1)return;a.push(x),g+=T.end+1}if(!(a.length<1))return a},F=h=>{let g=0,a=h.trim(),T=C(a);for(;T;)g++,a=T.body.trim(),T=C(a);return g},w=(h,g)=>{if(g.maxExtglobRecursion===!1)return{risky:!1};const a=typeof g.maxExtglobRecursion=="number"?g.maxExtglobRecursion:u.DEFAULT_MAX_EXTGLOB_RECURSION,T=d(h).map(v=>v.trim());if(T.length>1&&(T.some(v=>v==="")||T.some(v=>/^[*?]+$/.test(v))||b(T)))return{risky:!0};const O=[];let x=!1,S=!0;for(const v of T){const j=$(v);if(j){x=!0,O.push(...j);continue}const q=m(v);if(q&&q.length===1){O.push(q);continue}if(S=!1,F(v)>a)return{risky:!0}}return x?S?{risky:!0,safeOutput:f([...new Set(O)])}:{risky:!0}:{risky:!1}},_=(h,g)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=o[h]||h;const a={...g},T=typeof a.maxLength=="number"?Math.min(t,a.maxLength):t;let O=h.length;if(O>T)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${T}`);const x={type:"bos",value:"",output:a.prepend||""},S=[x],v=a.capture?"":"?:",j=u.globChars(a.windows),q=u.extglobChars(j),{DOT_LITERAL:au,PLUS_LITERAL:gu,SLASH_LITERAL:lu,ONE_CHAR:Z,DOTS_SLASH:cu,NO_DOT:$u,NO_DOT_SLASH:Au,NO_DOTS_SLASH:Du,QMARK:Q,QMARK_NO_DOT:hu,STAR:ru,START_ANCHOR:vu}=j,su=B=>`(${v}(?:(?!${vu}${B.dot?cu:au}).)*?)`,R=a.dot?"":$u,G=a.dot?Q:hu;let tu=a.bash===!0?su(a):ru;a.capture&&(tu=`(${tu})`),typeof a.noext=="boolean"&&(a.noextglob=a.noext);const A={input:h,index:-1,start:0,dot:a.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:S};h=e.removePrefix(h,A),O=h.length;const X=[],z=[],wu=[];let c=x,D;const nu=()=>A.index===O-1,M=A.peek=(B=1)=>h[A.index+B],pu=A.advance=()=>h[++A.index]||"",Eu=()=>h.slice(A.index+1),iu=(B="",K=0)=>{A.consumed+=B,A.index+=K},be=B=>{A.output+=B.output!=null?B.output:B.value,iu(B.value)},fr=()=>{let B=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)pu(),A.start++,B++;return B%2===0?!1:(A.negated=!0,A.start++,!0)},$e=B=>{A[B]++,wu.push(B)},xu=B=>{A[B]--,wu.pop()},L=B=>{if(c.type==="globstar"){const K=A.braces>0&&(B.type==="comma"||B.type==="brace"),y=B.extglob===!0||X.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!K&&!y&&(A.output=A.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=tu,A.output+=c.output)}if(X.length&&B.type!=="paren"&&(X[X.length-1].inner+=B.value),(B.value||B.output)&&be(B),c&&c.type==="text"&&B.type==="text"){c.output=(c.output||c.value)+B.value,c.value+=B.value;return}B.prev=c,S.push(B),c=B},ve=(B,K)=>{const y={...q[K],conditions:1,inner:""};y.prev=c,y.parens=A.parens,y.output=A.output,y.startIndex=A.index,y.tokensIndex=S.length;const P=(a.capture?"(":"")+y.open;$e("parens"),L({type:B,value:K,output:A.output?"":Z}),L({type:"paren",extglob:!0,value:pu(),output:P}),X.push(y)},Ar=B=>{const K=h.slice(B.startIndex,A.index+1),y=h.slice(B.startIndex+2,A.index),P=w(y,a);if((B.type==="plus"||B.type==="star")&&P.risky){const U=P.safeOutput?(B.output?"":Z)+(a.capture?`(${P.safeOutput})`:P.safeOutput):void 0,Cu=S[B.tokensIndex];Cu.type="text",Cu.value=K,Cu.output=U||e.escapeRegex(K);for(let Fu=B.tokensIndex+1;Fu<S.length;Fu++)S[Fu].value="",S[Fu].output="",delete S[Fu].suffix;A.output=B.output+Cu.output,A.backtrack=!0,L({type:"paren",extglob:!0,value:D,output:""}),xu("parens");return}let J=B.close+(a.capture?")":""),uu;if(B.type==="negate"){let U=tu;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(U=su(a)),(U!==tu||nu()||/^\)+$/.test(Eu()))&&(J=B.close=`)$))${U}`),B.inner.includes("*")&&(uu=Eu())&&/^\.[^\\/.]+$/.test(uu)){const Cu=_(uu,{...g,fastpaths:!1}).output;J=B.close=`)${Cu})${U})`}B.prev.type==="bos"&&(A.negatedExtglob=!0)}L({type:"paren",extglob:!0,value:D,output:J}),xu("parens")};if(a.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let B=!1,K=h.replace(r,(y,P,J,uu,U,Cu)=>uu==="\\"?(B=!0,y):uu==="?"?P?P+uu+(U?Q.repeat(U.length):""):Cu===0?G+(U?Q.repeat(U.length):""):Q.repeat(J.length):uu==="."?au.repeat(J.length):uu==="*"?P?P+uu+(U?tu:""):tu:P?y:`\\${y}`);return B===!0&&(a.unescape===!0?K=K.replace(/\\/g,""):K=K.replace(/\\+/g,y=>y.length%2===0?"\\\\":y?"\\":"")),K===h&&a.contains===!0?(A.output=h,A):(A.output=e.wrapOutput(K,A,g),A)}for(;!nu();){if(D=pu(),D==="\0")continue;if(D==="\\"){const y=M();if(y==="/"&&a.bash!==!0||y==="."||y===";")continue;if(!y){D+="\\",L({type:"text",value:D});continue}const P=/^\\+/.exec(Eu());let J=0;if(P&&P[0].length>2&&(J=P[0].length,A.index+=J,J%2!==0&&(D+="\\")),a.unescape===!0?D=pu():D+=pu(),A.brackets===0){L({type:"text",value:D});continue}}if(A.brackets>0&&(D!=="]"||c.value==="["||c.value==="[^")){if(a.posix!==!1&&D===":"){const y=c.value.slice(1);if(y.includes("[")&&(c.posix=!0,y.includes(":"))){const P=c.value.lastIndexOf("["),J=c.value.slice(0,P),uu=c.value.slice(P+2),U=s[uu];if(U){c.value=J+U,A.backtrack=!0,pu(),!x.output&&S.indexOf(c)===1&&(x.output=Z);continue}}}(D==="["&&M()!==":"||D==="-"&&M()==="]")&&(D=`\\${D}`),D==="]"&&(c.value==="["||c.value==="[^")&&(D=`\\${D}`),a.posix===!0&&D==="!"&&c.value==="["&&(D="^"),c.value+=D,be({value:D});continue}if(A.quotes===1&&D!=='"'){D=e.escapeRegex(D),c.value+=D,be({value:D});continue}if(D==='"'){A.quotes=A.quotes===1?0:1,a.keepQuotes===!0&&L({type:"text",value:D});continue}if(D==="("){$e("parens"),L({type:"paren",value:D});continue}if(D===")"){if(A.parens===0&&a.strictBrackets===!0)throw new SyntaxError(l("opening","("));const y=X[X.length-1];if(y&&A.parens===y.parens+1){Ar(X.pop());continue}L({type:"paren",value:D,output:A.parens?")":"\\)"}),xu("parens");continue}if(D==="["){if(a.nobracket===!0||!Eu().includes("]")){if(a.nobracket!==!0&&a.strictBrackets===!0)throw new SyntaxError(l("closing","]"));D=`\\${D}`}else $e("brackets");L({type:"bracket",value:D});continue}if(D==="]"){if(a.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){L({type:"text",value:D,output:`\\${D}`});continue}if(A.brackets===0){if(a.strictBrackets===!0)throw new SyntaxError(l("opening","["));L({type:"text",value:D,output:`\\${D}`});continue}xu("brackets");const y=c.value.slice(1);if(c.posix!==!0&&y[0]==="^"&&!y.includes("/")&&(D=`/${D}`),c.value+=D,be({value:D}),a.literalBrackets===!1||e.hasRegexChars(y))continue;const P=e.escapeRegex(c.value);if(A.output=A.output.slice(0,-c.value.length),a.literalBrackets===!0){A.output+=P,c.value=P;continue}c.value=`(${v}${P}|${c.value})`,A.output+=c.value;continue}if(D==="{"&&a.nobrace!==!0){$e("braces");const y={type:"brace",value:D,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};z.push(y),L(y);continue}if(D==="}"){const y=z[z.length-1];if(a.nobrace===!0||!y){L({type:"text",value:D,output:D});continue}let P=")";if(y.dots===!0){const J=S.slice(),uu=[];for(let U=J.length-1;U>=0&&(S.pop(),J[U].type!=="brace");U--)J[U].type!=="dots"&&uu.unshift(J[U].value);P=i(uu,a),A.backtrack=!0}if(y.comma!==!0&&y.dots!==!0){const J=A.output.slice(0,y.outputIndex),uu=A.tokens.slice(y.tokensIndex);y.value=y.output="\\{",D=P="\\}",A.output=J;for(const U of uu)A.output+=U.output||U.value}L({type:"brace",value:D,output:P}),xu("braces"),z.pop();continue}if(D==="|"){X.length>0&&X[X.length-1].conditions++,L({type:"text",value:D});continue}if(D===","){let y=D;const P=z[z.length-1];P&&wu[wu.length-1]==="braces"&&(P.comma=!0,y="|"),L({type:"comma",value:D,output:y});continue}if(D==="/"){if(c.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",S.pop(),c=x;continue}L({type:"slash",value:D,output:lu});continue}if(D==="."){if(A.braces>0&&c.type==="dot"){c.value==="."&&(c.output=au);const y=z[z.length-1];c.type="dots",c.output+=D,c.value+=D,y.dots=!0;continue}if(A.braces+A.parens===0&&c.type!=="bos"&&c.type!=="slash"){L({type:"text",value:D,output:au});continue}L({type:"dot",value:D,output:au});continue}if(D==="?"){if(!(c&&c.value==="(")&&a.noextglob!==!0&&M()==="("&&M(2)!=="?"){ve("qmark",D);continue}if(c&&c.type==="paren"){const y=M();let P=D;(c.value==="("&&!/[!=<:]/.test(y)||y==="<"&&!/<([!=]|\w+>)/.test(Eu()))&&(P=`\\${D}`),L({type:"text",value:D,output:P});continue}if(a.dot!==!0&&(c.type==="slash"||c.type==="bos")){L({type:"qmark",value:D,output:hu});continue}L({type:"qmark",value:D,output:Q});continue}if(D==="!"){if(a.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){ve("negate",D);continue}if(a.nonegate!==!0&&A.index===0){fr();continue}}if(D==="+"){if(a.noextglob!==!0&&M()==="("&&M(2)!=="?"){ve("plus",D);continue}if(c&&c.value==="("||a.regex===!1){L({type:"plus",value:D,output:gu});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||A.parens>0){L({type:"plus",value:D});continue}L({type:"plus",value:gu});continue}if(D==="@"){if(a.noextglob!==!0&&M()==="("&&M(2)!=="?"){L({type:"at",extglob:!0,value:D,output:""});continue}L({type:"text",value:D});continue}if(D!=="*"){(D==="$"||D==="^")&&(D=`\\${D}`);const y=n.exec(Eu());y&&(D+=y[0],A.index+=y[0].length),L({type:"text",value:D});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=D,c.output=tu,A.backtrack=!0,A.globstar=!0,iu(D);continue}let B=Eu();if(a.noextglob!==!0&&/^\([^?]/.test(B)){ve("star",D);continue}if(c.type==="star"){if(a.noglobstar===!0){iu(D);continue}const y=c.prev,P=y.prev,J=y.type==="slash"||y.type==="bos",uu=P&&(P.type==="star"||P.type==="globstar");if(a.bash===!0&&(!J||B[0]&&B[0]!=="/")){L({type:"star",value:D,output:""});continue}const U=A.braces>0&&(y.type==="comma"||y.type==="brace"),Cu=X.length&&(y.type==="pipe"||y.type==="paren");if(!J&&y.type!=="paren"&&!U&&!Cu){L({type:"star",value:D,output:""});continue}for(;B.slice(0,3)==="/**";){const Fu=h[A.index+4];if(Fu&&Fu!=="/")break;B=B.slice(3),iu("/**",3)}if(y.type==="bos"&&nu()){c.type="globstar",c.value+=D,c.output=su(a),A.output=c.output,A.globstar=!0,iu(D);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&!uu&&nu()){A.output=A.output.slice(0,-(y.output+c.output).length),y.output=`(?:${y.output}`,c.type="globstar",c.output=su(a)+(a.strictSlashes?")":"|$)"),c.value+=D,A.globstar=!0,A.output+=y.output+c.output,iu(D);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&B[0]==="/"){const Fu=B[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(y.output+c.output).length),y.output=`(?:${y.output}`,c.type="globstar",c.output=`${su(a)}${lu}|${lu}${Fu})`,c.value+=D,A.output+=y.output+c.output,A.globstar=!0,iu(D+pu()),L({type:"slash",value:"/",output:""});continue}if(y.type==="bos"&&B[0]==="/"){c.type="globstar",c.value+=D,c.output=`(?:^|${lu}|${su(a)}${lu})`,A.output=c.output,A.globstar=!0,iu(D+pu()),L({type:"slash",value:"/",output:""});continue}if(U&&B[0]==="/"){c.type="globstar",c.value+=D,c.output=`(?:^|${lu}|${su(a)}${lu})`,A.output+=c.output,A.globstar=!0,iu(D+pu()),L({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-c.output.length),c.type="globstar",c.output=su(a),c.value+=D,A.output+=c.output,A.globstar=!0,iu(D);continue}const K={type:"star",value:D,output:tu};if(a.bash===!0){K.output=".*?",(c.type==="bos"||c.type==="slash")&&(K.output=R+K.output),L(K);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&a.regex===!0){K.output=D,L(K);continue}(A.index===A.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(A.output+=Au,c.output+=Au):a.dot===!0?(A.output+=Du,c.output+=Du):(A.output+=R,c.output+=R),M()!=="*"&&(A.output+=Z,c.output+=Z)),L(K)}for(;A.brackets>0;){if(a.strictBrackets===!0)throw new SyntaxError(l("closing","]"));A.output=e.escapeLast(A.output,"["),xu("brackets")}for(;A.parens>0;){if(a.strictBrackets===!0)throw new SyntaxError(l("closing",")"));A.output=e.escapeLast(A.output,"("),xu("parens")}for(;A.braces>0;){if(a.strictBrackets===!0)throw new SyntaxError(l("closing","}"));A.output=e.escapeLast(A.output,"{"),xu("braces")}if(a.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&L({type:"maybe_slash",value:"",output:`${lu}?`}),A.backtrack===!0){A.output="";for(const B of A.tokens)A.output+=B.output!=null?B.output:B.value,B.suffix&&(A.output+=B.suffix)}return A};return _.fastpaths=(h,g)=>{const a={...g},T=typeof a.maxLength=="number"?Math.min(t,a.maxLength):t,O=h.length;if(O>T)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${T}`);h=o[h]||h;const{DOT_LITERAL:x,SLASH_LITERAL:S,ONE_CHAR:v,DOTS_SLASH:j,NO_DOT:q,NO_DOTS:au,NO_DOTS_SLASH:gu,STAR:lu,START_ANCHOR:Z}=u.globChars(a.windows),cu=a.dot?au:q,$u=a.dot?gu:q,Au=a.capture?"":"?:",Du={negated:!1,prefix:""};let Q=a.bash===!0?".*?":lu;a.capture&&(Q=`(${Q})`);const hu=R=>R.noglobstar===!0?Q:`(${Au}(?:(?!${Z}${R.dot?j:x}).)*?)`,ru=R=>{switch(R){case"*":return`${cu}${v}${Q}`;case".*":return`${x}${v}${Q}`;case"*.*":return`${cu}${Q}${x}${v}${Q}`;case"*/*":return`${cu}${Q}${S}${v}${$u}${Q}`;case"**":return cu+hu(a);case"**/*":return`(?:${cu}${hu(a)}${S})?${$u}${v}${Q}`;case"**/*.*":return`(?:${cu}${hu(a)}${S})?${$u}${Q}${x}${v}${Q}`;case"**/.*":return`(?:${cu}${hu(a)}${S})?${x}${v}${Q}`;default:{const G=/^(.*?)\.(\w+)$/.exec(R);if(!G)return;const tu=ru(G[1]);return tu?tu+x+G[2]:void 0}}},vu=e.removePrefix(h,Du);let su=ru(vu);return su&&a.strictSlashes!==!0&&(su+=`${S}?`),su},Pe=_,Pe}var He,dt;function bs(){if(dt)return He;dt=1;const u=ys(),e=Bs(),t=ke(),s=Re(),n=o=>o&&typeof o=="object"&&!Array.isArray(o),r=(o,i,l=!1)=>{if(Array.isArray(o)){const F=o.map(w=>r(w,i,l));return w=>{for(const _ of F){const h=_(w);if(h)return h}return!1}}const d=n(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!d)throw new TypeError("Expected pattern to be a non-empty string");const p=i||{},m=p.windows,b=d?r.compileRe(o,i):r.makeRe(o,i,!1,!0),C=b.state;delete b.state;let f=()=>!1;if(p.ignore){const F={...i,ignore:null,onMatch:null,onResult:null};f=r(p.ignore,F,l)}const $=(F,w=!1)=>{const{isMatch:_,match:h,output:g}=r.test(F,b,i,{glob:o,posix:m}),a={glob:o,state:C,regex:b,posix:m,input:F,output:g,match:h,isMatch:_};if(typeof p.onResult=="function"&&p.onResult(a),_===!1)return a.isMatch=!1,w?a:!1;u:if(f(F)){if(typeof p.onIgnore=="function"&&p.onIgnore(a)===s.UNIGNORE){a.isMatch=!0;break u}return a.isMatch=!1,w?a:!1}return typeof p.onMatch=="function"&&p.onMatch(a),w?a:!0};return l&&($.state=C),$};return r.test=(o,i,l,{glob:d,posix:p}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const m=l||{},b=m.format||(p?t.toPosixSlashes:null);let C=o===d,f=C&&b?b(o):o;return C===!1&&(f=b?b(o):o,C=f===d),(C===!1||m.capture===!0)&&(m.matchBase===!0||m.basename===!0?C=r.matchBase(o,i,l,p):C=i.exec(f)),{isMatch:!!C,match:C,output:f}},r.matchBase=(o,i,l,d=l&&l.windows)=>(i instanceof RegExp?i:r.makeRe(i,l)).test(t.basename(o,{windows:d})),r.isMatch=(o,i,l)=>r(i,l)(o),r.parse=(o,i)=>Array.isArray(o)?o.map(l=>r.parse(l,i)):e(o,{...i,fastpaths:!1}),r.scan=(o,i)=>u(o,i),r.compileRe=(o,i,l=!1,d=!1)=>{if(l===!0)return o.output;const p=i||{},m=p.contains?"":"^",b=p.contains?"":"$";let C=`${m}(?:${o.output})${b}`;o&&o.negated===!0&&(C=`^(?!${C}).*$`);const f=r.toRegex(C,i);return d===!0&&(f.state=o),f},r.makeRe=(o,i={},l=!1,d=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let p={negated:!1,fastpaths:!0};return i.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(p.output=e.fastpaths(o,i)),p.output||(p=e(o,i)),r.compileRe(p,i,l,d)},r.toRegex=(o,i)=>{try{const l=i||{};return new RegExp(o,l.flags||(l.nocase?"i":""))}catch(l){if(i&&i.debug===!0)throw l;return/$^/}},r.constants=s,He=r,He}var Ie,mt;function $s(){if(mt)return Ie;mt=1;const u=bs(),e=ke();function t(s,n,r=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:e.isWindows()}),u(s,n,r)}return Object.assign(t,u),Ie=t,Ie}var vs=$s();const Ru=tt(vs),ws=I(import.meta.url),Yu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ye=u=>{if(typeof Yu<"u"&&Yu.versions&&Yu.versions.node){const[e,t]=Yu.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Yu.getBuiltinModule(u)}return ws(u)},yt=ye("fs"),xs={...yt,default:yt},{statSync:Ss,stat:_s,realpathSync:Ts,realpath:Rs,readdirSync:ks,readdir:Ns}=ye("fs"),{sep:zt,basename:Os,dirname:Ve,resolve:Wt,normalize:Ls,relative:Ps,posix:ku,isAbsolute:Hs}=ye("path"),{fileURLToPath:Is}=ye("url"),{createRequire:Ms}=ye("module");var Bt=Ms(import.meta.url);function js(u){let e=Ls(u);return e.length>1&&e[e.length-1]===zt&&(e=e.substring(0,e.length-1)),e}const Gs=/[\\/]/g;function qt(u,e){return u.replace(Gs,e)}const Us=/^[a-z]:[\\/]$/i;function zs(u){return u==="/"||Us.test(u)}function Me(u,e){const{resolvePaths:t,normalizePath:s,pathSeparator:n}=e,r=process.platform==="win32"&&u.includes("/")||u.startsWith(".");if(t&&(u=Wt(u)),(s||r)&&(u=js(u)),u===".")return"";const o=u[u.length-1]!==n;return qt(o?u+n:u,n)}function Xt(u,e){return e+u}function Ws(u,e){return function(t,s){return s.startsWith(u)?s.slice(u.length)+t:qt(Ps(u,s),e.pathSeparator)+e.pathSeparator+t}}function qs(u){return u}function Xs(u,e,t){return e+u+t}function Ks(u,e){const{relativePaths:t,includeBasePath:s}=e;return t&&u?Ws(u,e):s?Xt:qs}function Vs(u){return function(e,t){t.push(e.substring(u.length)||".")}}function Qs(u){return function(e,t,s){const n=e.substring(u.length)||".";s.every(r=>r(n,!0))&&t.push(n)}}const Js=(u,e)=>{e.push(u||".")},Zs=(u,e,t)=>{const s=u||".";t.every(n=>n(s,!0))&&e.push(s)},Ys=()=>{};function un(u,e){const{includeDirs:t,filters:s,relativePaths:n}=e;return t?n?s&&s.length?Qs(u):Vs(u):s&&s.length?Zs:Js:Ys}const en=(u,e,t,s)=>{s.every(n=>n(u,!1))&&t.files++},tn=(u,e,t,s)=>{s.every(n=>n(u,!1))&&e.push(u)},rn=(u,e,t,s)=>{t.files++},sn=(u,e)=>{e.push(u)},nn=()=>{};function on(u){const{excludeFiles:e,filters:t,onlyCounts:s}=u;return e?nn:t&&t.length?s?en:tn:s?rn:sn}const an=u=>u,ln=()=>[""].slice(0,0);function cn(u){return u.group?ln:an}const Dn=(u,e,t)=>{u.push({directory:e,files:t,dir:e})},pn=()=>{};function fn(u){return u.group?Dn:pn}const An=function(u,e,t){const{queue:s,fs:n,options:{suppressErrors:r}}=e;s.enqueue(),n.realpath(u,(o,i)=>{if(o)return s.dequeue(r?null:o,e);n.stat(i,(l,d)=>{if(l)return s.dequeue(r?null:l,e);if(d.isDirectory()&&Kt(u,i,e))return s.dequeue(null,e);t(d,i),s.dequeue(null,e)})})},hn=function(u,e,t){const{queue:s,fs:n,options:{suppressErrors:r}}=e;s.enqueue();try{const o=n.realpathSync(u),i=n.statSync(o);if(i.isDirectory()&&Kt(u,o,e))return;t(i,o)}catch(o){if(!r)throw o}};function En(u,e){return!u.resolveSymlinks||u.excludeSymlinks?null:e?hn:An}function Kt(u,e,t){if(t.options.useRealPaths)return Cn(e,t);let s=Ve(u),n=1;for(;s!==t.root&&n<2;){const r=t.symlinks.get(s);r&&(r===e||r.startsWith(e)||e.startsWith(r))?n++:s=Ve(s)}return t.symlinks.set(u,e),n>1}function Cn(u,e){return e.visited.includes(u+e.options.pathSeparator)}const Fn=u=>u.counts,gn=u=>u.groups,dn=u=>u.paths,mn=u=>u.paths.slice(0,u.options.maxFiles),yn=(u,e,t)=>(Ne(e,t,u.counts,u.options.suppressErrors),null),Bn=(u,e,t)=>(Ne(e,t,u.paths,u.options.suppressErrors),null),bn=(u,e,t)=>(Ne(e,t,u.paths.slice(0,u.options.maxFiles),u.options.suppressErrors),null),$n=(u,e,t)=>(Ne(e,t,u.groups,u.options.suppressErrors),null);function Ne(u,e,t,s){e(u&&!s?u:null,t)}function vn(u,e){const{onlyCounts:t,group:s,maxFiles:n}=u;return t?e?Fn:yn:s?e?gn:$n:n?e?mn:bn:e?dn:Bn}const Vt={withFileTypes:!0},wn=(u,e,t,s,n)=>{if(u.queue.enqueue(),s<0)return u.queue.dequeue(null,u);const{fs:r}=u;u.visited.push(e),u.counts.directories++,r.readdir(e||".",Vt,(o,i=[])=>{n(i,t,s),u.queue.dequeue(u.options.suppressErrors?null:o,u)})},xn=(u,e,t,s,n)=>{const{fs:r}=u;if(s<0)return;u.visited.push(e),u.counts.directories++;let o=[];try{o=r.readdirSync(e||".",Vt)}catch(i){if(!u.options.suppressErrors)throw i}n(o,t,s)};function Sn(u){return u?xn:wn}var _n=class{count=0;constructor(u){this.onQueueEmpty=u}enqueue(){return this.count++,this.count}dequeue(u,e){this.onQueueEmpty&&(--this.count<=0||u)&&(this.onQueueEmpty(u,e),u&&(e.controller.abort(),this.onQueueEmpty=void 0))}},Tn=class{_files=0;_directories=0;set files(u){this._files=u}get files(){return this._files}set directories(u){this._directories=u}get directories(){return this._directories}get dirs(){return this._directories}},Rn=class{aborted=!1;abort(){this.aborted=!0}},Qt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,s){this.isSynchronous=!s,this.callbackInvoker=vn(t,this.isSynchronous),this.root=Me(e,t),this.state={root:zs(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Tn,options:t,queue:new _n((n,r)=>this.callbackInvoker(r,n,s)),symlinks:new Map,visited:[""].slice(0,0),controller:new Rn,fs:t.fs||xs},this.joinPath=Ks(this.root,t),this.pushDirectory=un(this.root,t),this.pushFile=on(t),this.getArray=cn(t),this.groupFiles=fn(t),this.resolveSymlink=En(t,this.isSynchronous),this.walkDirectory=Sn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,s)=>{const{paths:n,options:{filters:r,resolveSymlinks:o,excludeSymlinks:i,exclude:l,maxFiles:d,signal:p,useRealPaths:m,pathSeparator:b},controller:C}=this.state;if(C.aborted||p&&p.aborted||d&&n.length>d)return;const f=this.getArray(this.state.paths);for(let $=0;$<e.length;++$){const F=e[$];if(F.isFile()||F.isSymbolicLink()&&!o&&!i){const w=this.joinPath(F.name,t);this.pushFile(w,f,this.state.counts,r)}else if(F.isDirectory()){let w=Xs(F.name,t,this.state.options.pathSeparator);if(l&&l(F.name,w))continue;this.pushDirectory(w,n,r),this.walkDirectory(this.state,w,w,s-1,this.walk)}else if(this.resolveSymlink&&F.isSymbolicLink()){let w=Xt(F.name,t);this.resolveSymlink(w,this.state,(_,h)=>{if(_.isDirectory()){if(h=Me(h,this.state.options),l&&l(F.name,m?h:w+b))return;this.walkDirectory(this.state,h,m?h:w+b,s-1,this.walk)}else{h=m?h:w;const g=Os(h),a=Me(Ve(h),this.state.options);h=this.joinPath(g,a),this.pushFile(h,f,this.state.counts,r)}})}}this.groupFiles(this.state.groups,t,f)}};function kn(u,e){return new Promise((t,s)=>{Jt(u,e,(n,r)=>{if(n)return s(n);t(r)})})}function Jt(u,e,t){new Qt(u,e,t).start()}function Nn(u,e){return new Qt(u,e).start()}var bt=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return kn(this.root,this.options)}withCallback(e){Jt(this.root,this.options,e)}sync(){return Nn(this.root,this.options)}};let Zt=null;try{Bt.resolve("picomatch"),Zt=Bt("picomatch")}catch{}var On=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:zt,filters:[]};globFunction;constructor(u){this.options={...this.options,...u},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(u){return this.options.pathSeparator=u,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(u){return this.options.maxDepth=u,this}withMaxFiles(u){return this.options.maxFiles=u,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:u=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=u,this.withFullPaths()}withAbortSignal(u){return this.options.signal=u,this}normalize(){return this.options.normalizePath=!0,this}filter(u){return this.options.filters.push(u),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(u){return this.options.exclude=u,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(u){return new bt(u||".",this.options)}withGlobFunction(u){return this.globFunction=u,this}crawlWithOptions(u,e){return this.options={...this.options,...e},new bt(u||".",this.options)}glob(...u){return this.globFunction?this.globWithOptions(u):this.globWithOptions(u,{dot:!0})}globWithOptions(u,...e){const t=this.globFunction||Zt;if(!t)throw new Error("Please specify a glob function to use glob matching.");var s=this.globCache[u.join("\0")];return s||(s=t(u,...e),this.globCache[u.join("\0")]=s),this.options.filters.push(n=>s(n)),this}};const Ln=Array.isArray,Yt=/\\/g,Pn=/^[A-Za-z]:$/,ur=process.platform==="win32",Hn=/^(\/?\.\.)+$/;function $t(u,e={}){const t=u.length,s=Array(t),n=Array(t);let r,o;for(r=0;r<t;r++){const i=er(u[r]);s[r]=i;const l=i.length,d=Array(l);for(o=0;o<l;o++)d[o]=Ru(i[o],e);n[r]=d}return i=>{const l=i.split("/");if(l[0]===".."&&Hn.test(i))return!0;for(r=0;r<t;r++){const d=s[r],p=n[r],m=l.length,b=Math.min(m,d.length);for(o=0;o<b;){const C=d[o];if(C.includes("/"))return!0;if(!p[o](l[o]))break;if(!e.noglobstar&&C==="**")return!0;o++}if(o===m)return!0}return!1}}const In=/^[A-Z]:\/$/i,Mn=ur?u=>In.test(u):u=>u==="/";function vt(u,e,t){if(u===e||e.startsWith(`${u}/`)){if(t){const n=u.length+ +!Mn(u);return(r,o)=>r.slice(n,o?-1:void 0)||"."}const s=e.slice(u.length+1);return s?(n,r)=>{if(n===".")return s;const o=`${s}/${n}`;return r?o.slice(0,-1):o}:(n,r)=>r&&n!=="."?n.slice(0,-1):n}return t?s=>ku.relative(u,s)||".":s=>ku.relative(u,`${e}/${s}`)||"."}function jn(u,e){if(e.startsWith(`${u}/`)){const t=e.slice(u.length+1);return s=>`${t}/${s}`}return t=>{const s=ku.relative(u,`${e}/${t}`);return t[t.length-1]==="/"&&s!==""?`${s}/`:s||"."}}function wt(u){return u.replace(Pn,e=>`${e}/`)}const Gn={parts:!0};function er(u){var e;const t=Ru.scan(u,Gn);return!((e=t.parts)===null||e===void 0)&&e.length?t.parts:[u]}const Un=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,zn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Wn=u=>u.replace(Un,"\\$&"),qn=u=>u.replace(zn,"\\$&"),Xn=ur?qn:Wn;function Kn(u,e){const t=Ru.scan(u);return t.isGlob||t.negated}function ge(...u){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...u)}function tr(u){return typeof u=="string"?[u]:u??[]}const Vn=/^(\/?\.\.)+/,Qn=/\\(?=[()[\]{}!*+?@|])/g;function je(u,e,t,s){var n;const r=e.cwd;let o=u;u[u.length-1]==="/"&&(o=u.slice(0,-1));const i=o.lastIndexOf("/"),l=(i===-1?o:o.slice(i+1)).startsWith("!(");o[o.length-1]!=="*"&&!l&&e.expandDirectories&&(o+="/**");const d=Xn(r);o=Hs(o.replace(Qn,""))?ku.relative(d,o):ku.normalize(o);const p=(n=Vn.exec(o))===null||n===void 0?void 0:n[0],m=er(o);if(p){const C=(p.length+1)/3;let f=0;const $=d.split("/");for(;f<C&&m[f+C]===$[$.length+f-C];)o=o.slice(0,(C-f-1)*3)+o.slice((C-f)*3+m[f+C].length+1)||".",f++;const F=ku.join(r,p.slice(f*3));F[0]!=="."&&t.root.length>F.length&&(t.root=wt(F),t.depthOffset=-C+f)}if(!s&&t.depthOffset>=0){var b;(b=t.commonPath)!==null&&b!==void 0||(t.commonPath=m);const C=[],f=Math.min(t.commonPath.length,m.length);for(let $=0;$<f;$++){const F=m[$];if(F==="**"&&!m[$+1]){C.pop();break}if($===m.length-1||F!==t.commonPath[$]||Kn(F))break;C.push(F)}t.depthOffset=C.length,t.commonPath=C,t.root=wt(C.length>0?ku.join(r,...C):r)}return o}function Jn(u,e,t){const s=[],n=[],r=[];for(const o of u.ignore)o&&(o[0]!=="!"||o[1]==="("?n.push(je(o,u,t,!0)):r.push(o.slice(1)));for(const o of e)o&&(o[0]!=="!"||o[1]==="("?s.push(je(o,u,t,!1)):(o[1]!=="!"||o[2]==="(")&&n.push(je(o.slice(1),u,t,!0)));return{match:s,ignore:n,unignore:r}}function Zn(u,e){const t=u.cwd,s={root:t,depthOffset:0},n=Jn(u,e,s);u.debug&&ge("internal processing patterns:",n);const{absolute:r,caseSensitiveMatch:o,debug:i,dot:l,followSymbolicLinks:d,onlyDirectories:p}=u,m=s.root.replace(Yt,""),b={dot:l,nobrace:u.braceExpansion===!1,nocase:!o,noextglob:u.extglob===!1,noglobstar:u.globstar===!1,posix:!0},C=n.unignore.length>0,f=C?Ru(n.unignore,b):void 0,$=C?$t(n.unignore,b):void 0,F=Ru(n.match,{...b,ignore:n.ignore,onIgnore:f?S=>f(S.output)&&Ru.constants.UNIGNORE:void 0}),w=Ru(n.ignore,b),_=$t(n.match,b),h=vt(t,m,r),g=r?h:vt(t,m,!0),a=n.match.length>0&&n.match.every(S=>S==="**"||S==="**/*"),T=n.ignore.length>0||C||!a?(S,v)=>{const j=g(v,!0);return j==="."||$&&$(j)?!1:!_(j)||w(j)}:void 0;let O;u.deep!==void 0&&(O=Math.round(u.deep-s.depthOffset));const x=new On({filters:[i?(S,v)=>{const j=h(S,v),q=F(j);return q&&ge(`matched ${j}`),q}:(S,v)=>{const j=h(S,v);return F(j)}],exclude:i&&T?(S,v)=>{const j=T(S,v);return ge(`${j?"skipped":"crawling"} ${v}`),j}:T,fs:u.fs,pathSeparator:"/",relativePaths:!r,resolvePaths:r,includeBasePath:r,resolveSymlinks:d,excludeSymlinks:!d,excludeFiles:p,includeDirs:p||!u.onlyFiles,maxDepth:O,signal:u.signal}).crawl(m);return u.debug&&ge("internal properties:",{...s,root:m}),[x,t!==m&&!r&&jn(t,m)]}function Yn(u,e){if(e)for(let t=u.length-1;t>=0;t--)u[t]=e(u[t]);return u}const xt={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function uo(u){const e=Object.assign({},u);for(const t in xt)e[t]===void 0&&Object.assign(e,{[t]:xt[t]});return e.cwd=(e.cwd instanceof URL?Is(e.cwd):Wt(e.cwd||process.cwd())).replace(Yt,"/"),e.ignore=tr(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Ns,readdirSync:e.fs.readdirSync||ks,realpath:e.fs.realpath||Rs,realpathSync:e.fs.realpathSync||Ts,stat:e.fs.stat||_s,statSync:e.fs.statSync||Ss}),e.debug&&ge("globbing with options:",e),e}function eo(u,e={}){var t;if(u&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const s=Ln(u)||typeof u=="string",n=tr((t=s?u:u.patterns)!==null&&t!==void 0?t:"**/*"),r=uo(s?e:u);return n.length>0?Zn(r,n):[]}async function sa(u,e){const[t,s]=eo(u,e);return t?Yn(await t.withPromise(),s):[]}var Ge,St;function to(){if(St)return Ge;St=1;/*!
|
|
2
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
5
|
-
* Licensed under the MIT License.
|
|
6
|
-
*/return Ge=function(u){if(typeof u!="string"||u==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(u);){if(e[2])return!0;u=u.slice(e.index+e[0].length)}return!1},Ge}var Ue,_t;function rr(){if(_t)return Ue;_t=1;/*!
|
|
7
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
-
* Released under the MIT License.
|
|
11
|
-
*/var u=to(),e={"{":"}","(":")","[":"]"},t=function(n){if(n[0]==="!")return!0;for(var r=0,o=-2,i=-2,l=-2,d=-2,p=-2;r<n.length;){if(n[r]==="*"||n[r+1]==="?"&&/[\].+)]/.test(n[r])||i!==-1&&n[r]==="["&&n[r+1]!=="]"&&(i<r&&(i=n.indexOf("]",r)),i>r&&(p===-1||p>i||(p=n.indexOf("\\",r),p===-1||p>i)))||l!==-1&&n[r]==="{"&&n[r+1]!=="}"&&(l=n.indexOf("}",r),l>r&&(p=n.indexOf("\\",r),p===-1||p>l))||d!==-1&&n[r]==="("&&n[r+1]==="?"&&/[:!=]/.test(n[r+2])&&n[r+3]!==")"&&(d=n.indexOf(")",r),d>r&&(p=n.indexOf("\\",r),p===-1||p>d))||o!==-1&&n[r]==="("&&n[r+1]!=="|"&&(o<r&&(o=n.indexOf("|",r)),o!==-1&&n[o+1]!==")"&&(d=n.indexOf(")",o),d>o&&(p=n.indexOf("\\",o),p===-1||p>d))))return!0;if(n[r]==="\\"){var m=n[r+1];r+=2;var b=e[m];if(b){var C=n.indexOf(b,r);C!==-1&&(r=C+1)}if(n[r]==="!")return!0}else r++}return!1},s=function(n){if(n[0]==="!")return!0;for(var r=0;r<n.length;){if(/[*?{}()[\]]/.test(n[r]))return!0;if(n[r]==="\\"){var o=n[r+1];r+=2;var i=e[o];if(i){var l=n.indexOf(i,r);l!==-1&&(r=l+1)}if(n[r]==="!")return!0}else r++}return!1};return Ue=function(n,r){if(typeof n!="string"||n==="")return!1;if(u(n))return!0;var o=t;return r&&r.strict===!1&&(o=s),o(n)},Ue}const ro=I(import.meta.url),ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,sr=u=>{if(typeof ue<"u"&&ue.versions&&ue.versions.node){const[e,t]=ue.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ue.getBuiltinModule(u)}return ro(u)},so=sr("path"),no=sr("os");var ze,Tt;function oo(){if(Tt)return ze;Tt=1;var u=rr(),e=so.posix.dirname,t=no.platform()==="win32",s="/",n=/\\/g,r=/\\([!*?|[\](){}])/g;ze=function(l,d){var p=Object.assign({flipBackslashes:!0},d);p.flipBackslashes&&t&&l.indexOf(s)<0&&(l=l.replace(n,s)),o(l)&&(l+=s),l+="a";do l=e(l);while(i(l));return l.replace(r,"$1")};function o(l){var d=l.slice(-1),p;switch(d){case"}":p="{";break;case"]":p="[";break;default:return!1}var m=l.indexOf(p);return m<0?!1:l.slice(m+1,-1).includes(s)}function i(l){return/\([^()]+$/.test(l)||l[0]==="{"||l[0]==="["||/[^\\][{[]/.test(l)?!0:u(l)}return ze}var io=oo();tt(io);const ao=I(import.meta.url),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lo=u=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,t]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ee.getBuiltinModule(u)}return ao(u)},{access:co}=lo("node:fs/promises");async function na(u,e=ut){bu(u),u=yu(u);try{return await co(u,e),!0}catch{return!1}}const Do=I(import.meta.url),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,po=u=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,t]=te.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return te.getBuiltinModule(u)}return Do(u)},{accessSync:fo}=po("node:fs");function Qe(u,e=ut){bu(u),u=yu(u);try{return fo(u,e),!0}catch{return!1}}var Ao=rr();tt(Ao);const ho=I(import.meta.url),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nr=u=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,t]=re.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return re.getBuiltinModule(u)}return ho(u)};nr("node:fs/promises");nr("node:fs");let Eo=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},Co=class extends Error{constructor(e){super(`EPERM: Operation not permitted, ${e}`)}get code(){return"EPERM"}set code(e){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(e){throw new Error("Cannot overwrite name of PermissionError")}};const or=(u,e)=>{const t=u?.code;return t==="ENOENT"?new Eo(`no such file or directory, open '${e}'`):t==="EACCES"||t==="EPERM"?new Co(`unable to read the non-readable file: ${e}`):u},Fo=I(import.meta.url),se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ir=u=>{if(typeof se<"u"&&se.versions&&se.versions.node){const[e,t]=se.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return se.getBuiltinModule(u)}return Fo(u)},{readFile:go}=ir("node:fs/promises"),{unzip:mo,brotliDecompress:yo}=ir("node:zlib"),Bo={brotli:yo,gzip:mo,none:(u,e)=>{e(null,u)}},aa=async(u,e)=>{bu(u),u=yu(u);const{buffer:t,compression:s,encoding:n,flag:r}=e??{};let o;try{o=await go(u,r?{flag:r}:{})}catch(i){throw or(i,u)}return await new Promise((i,l)=>{Bo[s??"none"](o,(d,p)=>{d?l(d):i(t?p:p.toString(n??"utf8"))})})},bo=I(import.meta.url),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ar=u=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,t]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ne.getBuiltinModule(u)}return bo(u)},{readFileSync:$o}=ar("node:fs"),{unzipSync:vo,brotliDecompressSync:wo}=ar("node:zlib"),xo={brotli:wo,gzip:vo,none:u=>u},So=(u,e)=>{bu(u),u=yu(u);const{buffer:t,compression:s,encoding:n,flag:r}=e??{};let o;try{o=$o(u,r?{flag:r}:{})}catch(d){throw or(d,u)}const i=xo[s??"none"],l=i(o);return t?l:l.toString(n??"utf8")},_o=I(import.meta.url),oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,To=u=>{if(typeof oe<"u"&&oe.versions&&oe.versions.node){const[e,t]=oe.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return oe.getBuiltinModule(u)}return _o(u)},{createRequire:lr}=To("node:module"),Ro=globalThis.process??Object.create(null),Rt={versions:{}},kt=new Proxy(Ro,{get(u,e){if(e in u)return u[e];if(e in Rt)return Rt[e]}}),ko=u=>u.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
12
|
-
`),No=(u,e,t,s)=>{const n={column:0,line:-1,...u.start},r={...n,...u.end},o=n.line,i=n.column,l=r.line,d=r.column;let p=Math.max(o-(t+1),0),m=Math.min(e.length,l+s);o===-1&&(p=0),l===-1&&(m=e.length);const b=l-o,C={};if(b)for(let f=0;f<=b;f++){const $=f+o;if(!i)C[$]=!0;else if(f===0){const F=e[$-1]?.length;C[$]=[i,(F??0)-i+1]}else if(f===b)C[$]=[0,d];else{const F=e[$-f]?.length;C[$]=[0,F]}}else i===d?C[o]=i?[i,0]:!0:C[o]=[i,(d??0)-(i??0)];return{end:m,markerLines:C,start:p}},Oo=kt.platform==="win32"&&!kt.env?.WT_SESSION?">":"❯",la=(u,e,t)=>{const s={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...t,color:{gutter:f=>f,marker:f=>f,message:f=>f,...t?.color}},n=typeof e.start.column=="number";let r=(u.includes("\r")?ko(u):u).split(`
|
|
13
|
-
`);typeof s.tabWidth=="number"&&u.includes(" ")&&(r=r.map(f=>f.replaceAll(" "," ".repeat(s.tabWidth))));const{end:o,markerLines:i,start:l}=No(e,r,s.linesAbove,s.linesBelow),d=String(o).length,{gutter:p,marker:m,message:b}=s.color;let C=r.slice(l,o).map((f,$)=>{const F=l+1+$,w=i[F],_=String(F).padStart(d),h=!i[F+1],g=` ${_}${s.showGutter?" |":""}`;if(w){let a="";if(Array.isArray(w)){const T=f.replaceAll(/[^\t]/g," ").slice(0,Math.max(w[0]-1,0)),O=w[1]||1;a=[`
|
|
14
|
-
`,s.prefix+p(g.replaceAll(/\d/g," "))," ",T,m("^").repeat(O)].join(""),h&&s.message&&(a+=` ${b(s.message)}`)}return[s.prefix+m(Oo),p(g),f.length>0?` ${f}`:"",a].join("")}return`${s.prefix} ${p(g)}${f.length>0?` ${f}`:""}`}).join(`
|
|
15
|
-
`);return s.message&&!n&&(C=`${s.prefix+" ".repeat(d+1)+s.message}
|
|
16
|
-
${C}`),C},Nt=(u,e)=>{let t=0,s=e.length-2;for(;t<s;){const n=t+(s-t>>1);if(u<e[n])s=n-1;else if(u>=e[n+1])t=n+1;else{t=n;break}}return t},Lo=/\n|\r(?!\n)/,Po=u=>u.split(Lo).reduce((e,t)=>(e.push(e.at(-1)+t.length+1),e),[0]),ca=(u,e,t)=>{if(!Array.isArray(u)&&typeof u!="string"||(typeof u=="string"||Array.isArray(u))&&u.length===0)return{column:0,line:0};if(typeof e!="number"||typeof u=="string"&&e>=u.length||Array.isArray(u)&&e+1>=u.at(-1))return{column:0,line:0};if(typeof u=="string"){const n=Po(u),r=Nt(e,n);return{column:e-n[r]+1,line:r+1}}const s=Nt(e,u);return{column:e-u[s]+1,line:s+1}},Ho=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&Ho.set("AggregateError",AggregateError);const Io=lr(import.meta.url),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mo=u=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,t]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ie.getBuiltinModule(u)}return Io(u)};Mo("node:util");const jo=lr(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rt=u=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,t]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ae.getBuiltinModule(u)}return jo(u)};rt("node:fs");rt("node:path");rt("node:url");let Da=class extends Error{fileName;codeFrame;name="JSONError";#u;constructor(e){super(),this.#u=e}get message(){return`${this.#u}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
17
|
-
|
|
18
|
-
${this.codeFrame}
|
|
19
|
-
`:""}`}set message(e){this.#u=e}};const Go=u=>{const e={force:!0,recursive:!0};return u?.maxRetries!==void 0&&(e.maxRetries=u.maxRetries),u?.retryDelay!==void 0&&(e.retryDelay=u.retryDelay),e},Uo=I(import.meta.url),le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cr=u=>{if(typeof le<"u"&&le.versions&&le.versions.node){const[e,t]=le.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return le.getBuiltinModule(u)}return Uo(u)};cr("node:fs");cr("node:fs/promises");const zo=I(import.meta.url),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wo=u=>{if(typeof ce<"u"&&ce.versions&&ce.versions.node){const[e,t]=ce.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return ce.getBuiltinModule(u)}return zo(u)};Wo("node:fs");const qo=I(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xo=u=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[e,t]=De.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return De.getBuiltinModule(u)}return qo(u)};Xo("node:fs/promises");const Ko=I(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vo=u=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[e,t]=pe.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return pe.getBuiltinModule(u)}return Ko(u)},{rmSync:Qo}=Vo("node:fs"),fa=(u,e={})=>{bu(u),Qo(u,Go(e))};I(import.meta.url);const Jo=u=>{if(typeof u!="string"&&!(u instanceof ArrayBuffer)&&!ArrayBuffer.isView(u))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},Zo=I(import.meta.url),fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yo=u=>{if(typeof fe<"u"&&fe.versions&&fe.versions.node){const[e,t]=fe.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return fe.getBuiltinModule(u)}return Zo(u)},{randomBytes:ui}=Yo("node:crypto"),ei=u=>`${u}.${process.pid.toString(36)}.${ui(6).toString("hex")}.tmp`,ti=new TextEncoder,ri=u=>{if(u instanceof Uint8Array)return u;if(typeof u=="string")return ti.encode(u);if(u instanceof ArrayBuffer)return new Uint8Array(u);if(ArrayBuffer.isView(u)){const e=u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},si=I(import.meta.url),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ni=u=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[e,t]=Ae.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ae.getBuiltinModule(u)}return si(u)};ni("node:fs/promises");const oi=I(import.meta.url),he=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ii=u=>{if(typeof he<"u"&&he.versions&&he.versions.node){const[e,t]=he.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return he.getBuiltinModule(u)}return oi(u)},{mkdirSync:ai,writeFileSync:li,statSync:ci,renameSync:Ot,chownSync:Di,chmodSync:pi,unlinkSync:fi}=ii("node:fs"),Ai=(u,e,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},bu(u),Jo(e),u=yu(u);const s=Qe(u,ut);if(s&&!t.overwrite)throw new Hr(`file already exists, open '${u}'`);const n=ei(u);try{!s&&t.recursive&&ai(et(u),{recursive:!0});let r;if(li(n,typeof e=="string"?Buffer.from(e,t.encoding??"utf8"):ri(e),{flag:"wx"}),s&&t.backup&&(r=ci(u),t.chown??={gid:r.gid,uid:r.uid},Ot(u,`${u}.bak`)),t.chown)try{Di(n,t.chown.uid,t.chown.gid)}catch{}pi(n,r&&!t.mode?r.mode:t.mode??438),Ot(n,u)}catch(r){throw new Error(`Failed to write file at: ${u} - ${r.message}`,{cause:r})}finally{Qe(n)&&fi(n)}},hi=/^(?:( )+|\t+)/,Be="space";function Lt(u,e,t){return u&&e===Be&&t===1}function Pt(u,e){const t=new Map;let s=0,n,r;for(const o of u.split(/\n/g)){if(!o)continue;const i=o.match(hi);if(i===null)s=0,n="";else{const l=i[0].length,d=i[1]?Be:"tab";if(Lt(e,d,l))continue;d!==n&&(s=0),n=d;let p=1,m=0;const b=l-s;if(s=l,b===0)p=0,m=1;else{const f=Math.abs(b);if(Lt(e,d,f))continue;r=Ei(d,f)}const C=t.get(r);t.set(r,C===void 0?[1,0]:[C[0]+p,C[1]+m])}}return t}function Ei(u,e){return(u===Be?"s":"t")+String(e)}function Ci(u){const e=u[0]==="s"?Be:"tab",t=Number(u.slice(1));return{type:e,amount:t}}function Fi(u){let e,t=0,s=0;for(const[n,[r,o]]of u)(r>t||r===t&&o>s)&&(t=r,s=o,e=n);return e}function gi(u,e){return(u===Be?" ":" ").repeat(e)}function di(u){if(typeof u!="string")throw new TypeError("Expected a string");let e=Pt(u,!0);e.size===0&&(e=Pt(u,!1));const t=Fi(e);let s,n=0,r="";return t!==void 0&&({type:s,amount:n}=Ci(t),r=gi(s,n)),{amount:n,type:s,indent:r}}const mi=I(import.meta.url),Ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yi=u=>{if(typeof Ee<"u"&&Ee.versions&&Ee.versions.node){const[e,t]=Ee.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ee.getBuiltinModule(u)}return mi(u)};yi("node:fs/promises");const Bi=I(import.meta.url),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bi=u=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[e,t]=Ce.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ce.getBuiltinModule(u)}return Bi(u)},{readFileSync:$i}=bi("node:fs"),Aa=(u,e,t={})=>{const{detectIndent:s,indent:n,replacer:r,stringify:o=JSON.stringify,...i}={indent:" ",...t};let l=n,d=`
|
|
20
|
-
`;if(Qe(u,Fr))try{const m=$i(u,"utf8");if(s){const{indent:b}=di(m);l=b}d=m.endsWith(`
|
|
21
|
-
`)?`
|
|
22
|
-
`:""}catch(m){if(m.code!=="ENOENT")throw m}const p=o(e,r,l);Ai(u,`${p}${d}`,i)},vi=I(import.meta.url),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=u=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[e,t]=Fe.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Fe.getBuiltinModule(u)}return vi(u)},wi=st("fs"),xi=st("os"),Si=st("path");var We={},Ht;function _i(){if(Ht)return We;Ht=1;var u=Object.defineProperty,e=(p,m)=>u(p,"name",{value:m,configurable:!0}),t=wi,s=xi,n=Si;const r=e(p=>{let m="";for(let b=0;b<p.length;b+=1){const C=p[b],f=C.toUpperCase();m+=C===f?C.toLowerCase():f}return m},"invertCase"),o=new Map,i=e((p,m)=>{const b=n.join(p,`.is-fs-case-sensitive-test-${process.pid}`);try{return m.writeFileSync(b,""),!m.existsSync(r(b))}finally{try{m.unlinkSync(b)}catch{}}},"checkDirectoryCaseWithWrite"),l=e((p,m,b)=>{try{return i(p,b)}catch(C){if(m===void 0)return i(s.tmpdir(),b);throw C}},"checkDirectoryCaseWithFallback"),d=e((p,m=t,b=!0)=>{const C=p??process.cwd();if(b&&o.has(C))return o.get(C);let f;const $=r(C);return $!==C&&m.existsSync(C)?f=!m.existsSync($):f=l(C,p,m),b&&o.set(C,f),f},"isFsCaseSensitive");return We.isFsCaseSensitive=d,We}var Ti=_i();const ha=Ti.isFsCaseSensitive;function Ea(u,e,t){const{buffer:s,compression:n,encoding:r="utf8",flag:o,...i}={},l=So(u,{buffer:s,compression:n,encoding:r,flag:o});return typeof e=="function"?it(l,e,i):it(l,i)}var Ri=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ki=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Ni=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,qe={Space_Separator:Ri,ID_Start:ki,ID_Continue:Ni},Y={isSpaceSeparator(u){return typeof u=="string"&&qe.Space_Separator.test(u)},isIdStartChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u==="$"||u==="_"||qe.ID_Start.test(u))},isIdContinueChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||u==="$"||u==="_"||u===""||u===""||qe.ID_Continue.test(u))},isDigit(u){return typeof u=="string"&&/[0-9]/.test(u)},isHexDigit(u){return typeof u=="string"&&/[0-9A-Fa-f]/.test(u)}};let Je,ou,mu,Te,Su,fu,eu,nt,me;var Oi=function(u,e){Je=String(u),ou="start",mu=[],Te=0,Su=1,fu=0,eu=void 0,nt=void 0,me=void 0;do eu=Li(),Ii[ou]();while(eu.type!=="eof");return typeof e=="function"?Ze({"":me},"",e):me};function Ze(u,e,t){const s=u[e];if(s!=null&&typeof s=="object")if(Array.isArray(s))for(let n=0;n<s.length;n++){const r=String(n),o=Ze(s,r,t);o===void 0?delete s[r]:Object.defineProperty(s,r,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const n in s){const r=Ze(s,n,t);r===void 0?delete s[n]:Object.defineProperty(s,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}return t.call(u,e,s)}let N,k,de,du,H;function Li(){for(N="default",k="",de=!1,du=1;;){H=Bu();const u=Dr[N]();if(u)return u}}function Bu(){if(Je[Te])return String.fromCodePoint(Je.codePointAt(Te))}function E(){const u=Bu();return u===`
|
|
23
|
-
`?(Su++,fu=0):u?fu+=u.length:fu++,u&&(Te+=u.length),u}const Dr={default(){switch(H){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
24
|
-
`:case"\r":case"\u2028":case"\u2029":E();return;case"/":E(),N="comment";return;case void 0:return E(),W("eof")}if(Y.isSpaceSeparator(H)){E();return}return Dr[ou]()},comment(){switch(H){case"*":E(),N="multiLineComment";return;case"/":E(),N="singleLineComment";return}throw V(E())},multiLineComment(){switch(H){case"*":E(),N="multiLineCommentAsterisk";return;case void 0:throw V(E())}E()},multiLineCommentAsterisk(){switch(H){case"*":E();return;case"/":E(),N="default";return;case void 0:throw V(E())}E(),N="multiLineComment"},singleLineComment(){switch(H){case`
|
|
25
|
-
`:case"\r":case"\u2028":case"\u2029":E(),N="default";return;case void 0:return E(),W("eof")}E()},value(){switch(H){case"{":case"[":return W("punctuator",E());case"n":return E(),_u("ull"),W("null",null);case"t":return E(),_u("rue"),W("boolean",!0);case"f":return E(),_u("alse"),W("boolean",!1);case"-":case"+":E()==="-"&&(du=-1),N="sign";return;case".":k=E(),N="decimalPointLeading";return;case"0":k=E(),N="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":k=E(),N="decimalInteger";return;case"I":return E(),_u("nfinity"),W("numeric",1/0);case"N":return E(),_u("aN"),W("numeric",NaN);case'"':case"'":de=E()==='"',k="",N="string";return}throw V(E())},identifierNameStartEscape(){if(H!=="u")throw V(E());E();const u=Ye();switch(u){case"$":case"_":break;default:if(!Y.isIdStartChar(u))throw It();break}k+=u,N="identifierName"},identifierName(){switch(H){case"$":case"_":case"":case"":k+=E();return;case"\\":E(),N="identifierNameEscape";return}if(Y.isIdContinueChar(H)){k+=E();return}return W("identifier",k)},identifierNameEscape(){if(H!=="u")throw V(E());E();const u=Ye();switch(u){case"$":case"_":case"":case"":break;default:if(!Y.isIdContinueChar(u))throw It();break}k+=u,N="identifierName"},sign(){switch(H){case".":k=E(),N="decimalPointLeading";return;case"0":k=E(),N="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":k=E(),N="decimalInteger";return;case"I":return E(),_u("nfinity"),W("numeric",du*(1/0));case"N":return E(),_u("aN"),W("numeric",NaN)}throw V(E())},zero(){switch(H){case".":k+=E(),N="decimalPoint";return;case"e":case"E":k+=E(),N="decimalExponent";return;case"x":case"X":k+=E(),N="hexadecimal";return}return W("numeric",du*0)},decimalInteger(){switch(H){case".":k+=E(),N="decimalPoint";return;case"e":case"E":k+=E(),N="decimalExponent";return}if(Y.isDigit(H)){k+=E();return}return W("numeric",du*Number(k))},decimalPointLeading(){if(Y.isDigit(H)){k+=E(),N="decimalFraction";return}throw V(E())},decimalPoint(){switch(H){case"e":case"E":k+=E(),N="decimalExponent";return}if(Y.isDigit(H)){k+=E(),N="decimalFraction";return}return W("numeric",du*Number(k))},decimalFraction(){switch(H){case"e":case"E":k+=E(),N="decimalExponent";return}if(Y.isDigit(H)){k+=E();return}return W("numeric",du*Number(k))},decimalExponent(){switch(H){case"+":case"-":k+=E(),N="decimalExponentSign";return}if(Y.isDigit(H)){k+=E(),N="decimalExponentInteger";return}throw V(E())},decimalExponentSign(){if(Y.isDigit(H)){k+=E(),N="decimalExponentInteger";return}throw V(E())},decimalExponentInteger(){if(Y.isDigit(H)){k+=E();return}return W("numeric",du*Number(k))},hexadecimal(){if(Y.isHexDigit(H)){k+=E(),N="hexadecimalInteger";return}throw V(E())},hexadecimalInteger(){if(Y.isHexDigit(H)){k+=E();return}return W("numeric",du*Number(k))},string(){switch(H){case"\\":E(),k+=Pi();return;case'"':if(de)return E(),W("string",k);k+=E();return;case"'":if(!de)return E(),W("string",k);k+=E();return;case`
|
|
26
|
-
`:case"\r":throw V(E());case"\u2028":case"\u2029":Mi(H);break;case void 0:throw V(E())}k+=E()},start(){switch(H){case"{":case"[":return W("punctuator",E())}N="value"},beforePropertyName(){switch(H){case"$":case"_":k=E(),N="identifierName";return;case"\\":E(),N="identifierNameStartEscape";return;case"}":return W("punctuator",E());case'"':case"'":de=E()==='"',N="string";return}if(Y.isIdStartChar(H)){k+=E(),N="identifierName";return}throw V(E())},afterPropertyName(){if(H===":")return W("punctuator",E());throw V(E())},beforePropertyValue(){N="value"},afterPropertyValue(){switch(H){case",":case"}":return W("punctuator",E())}throw V(E())},beforeArrayValue(){if(H==="]")return W("punctuator",E());N="value"},afterArrayValue(){switch(H){case",":case"]":return W("punctuator",E())}throw V(E())},end(){throw V(E())}};function W(u,e){return{type:u,value:e,line:Su,column:fu}}function _u(u){for(const e of u){if(Bu()!==e)throw V(E());E()}}function Pi(){switch(Bu()){case"b":return E(),"\b";case"f":return E(),"\f";case"n":return E(),`
|
|
27
|
-
`;case"r":return E(),"\r";case"t":return E()," ";case"v":return E(),"\v";case"0":if(E(),Y.isDigit(Bu()))throw V(E());return"\0";case"x":return E(),Hi();case"u":return E(),Ye();case`
|
|
28
|
-
`:case"\u2028":case"\u2029":return E(),"";case"\r":return E(),Bu()===`
|
|
29
|
-
`&&E(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw V(E());case void 0:throw V(E())}return E()}function Hi(){let u="",e=Bu();if(!Y.isHexDigit(e)||(u+=E(),e=Bu(),!Y.isHexDigit(e)))throw V(E());return u+=E(),String.fromCodePoint(parseInt(u,16))}function Ye(){let u="",e=4;for(;e-- >0;){const t=Bu();if(!Y.isHexDigit(t))throw V(E());u+=E()}return String.fromCodePoint(parseInt(u,16))}const Ii={start(){if(eu.type==="eof")throw Tu();Xe()},beforePropertyName(){switch(eu.type){case"identifier":case"string":nt=eu.value,ou="afterPropertyName";return;case"punctuator":xe();return;case"eof":throw Tu()}},afterPropertyName(){if(eu.type==="eof")throw Tu();ou="beforePropertyValue"},beforePropertyValue(){if(eu.type==="eof")throw Tu();Xe()},beforeArrayValue(){if(eu.type==="eof")throw Tu();if(eu.type==="punctuator"&&eu.value==="]"){xe();return}Xe()},afterPropertyValue(){if(eu.type==="eof")throw Tu();switch(eu.value){case",":ou="beforePropertyName";return;case"}":xe()}},afterArrayValue(){if(eu.type==="eof")throw Tu();switch(eu.value){case",":ou="beforeArrayValue";return;case"]":xe()}},end(){}};function Xe(){let u;switch(eu.type){case"punctuator":switch(eu.value){case"{":u={};break;case"[":u=[];break}break;case"null":case"boolean":case"numeric":case"string":u=eu.value;break}if(me===void 0)me=u;else{const e=mu[mu.length-1];Array.isArray(e)?e.push(u):Object.defineProperty(e,nt,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(u!==null&&typeof u=="object")mu.push(u),Array.isArray(u)?ou="beforeArrayValue":ou="beforePropertyName";else{const e=mu[mu.length-1];e==null?ou="end":Array.isArray(e)?ou="afterArrayValue":ou="afterPropertyValue"}}function xe(){mu.pop();const u=mu[mu.length-1];u==null?ou="end":Array.isArray(u)?ou="afterArrayValue":ou="afterPropertyValue"}function V(u){return ot(u===void 0?`JSON5: invalid end of input at ${Su}:${fu}`:`JSON5: invalid character '${pr(u)}' at ${Su}:${fu}`)}function Tu(){return ot(`JSON5: invalid end of input at ${Su}:${fu}`)}function It(){return fu-=5,ot(`JSON5: invalid identifier character at ${Su}:${fu}`)}function Mi(u){console.warn(`JSON5: '${pr(u)}' in strings is not valid ECMAScript; consider escaping`)}function pr(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const t=u.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return u}function ot(u){const e=new SyntaxError(u);return e.lineNumber=Su,e.columnNumber=fu,e}var ji=function(u,e,t){const s=[];let n="",r,o,i="",l;if(e!=null&&typeof e=="object"&&!Array.isArray(e)&&(t=e.space,l=e.quote,e=e.replacer),typeof e=="function")o=e;else if(Array.isArray(e)){r=[];for(const f of e){let $;typeof f=="string"?$=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&($=String(f)),$!==void 0&&r.indexOf($)<0&&r.push($)}}return t instanceof Number?t=Number(t):t instanceof String&&(t=String(t)),typeof t=="number"?t>0&&(t=Math.min(10,Math.floor(t)),i=" ".substr(0,t)):typeof t=="string"&&(i=t.substr(0,10)),d("",{"":u});function d(f,$){let F=$[f];switch(F!=null&&(typeof F.toJSON5=="function"?F=F.toJSON5(f):typeof F.toJSON=="function"&&(F=F.toJSON(f))),o&&(F=o.call($,f,F)),F instanceof Number?F=Number(F):F instanceof String?F=String(F):F instanceof Boolean&&(F=F.valueOf()),F){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof F=="string")return p(F);if(typeof F=="number")return String(F);if(typeof F=="object")return Array.isArray(F)?C(F):m(F)}function p(f){const $={"'":.1,'"':.2},F={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let h=0;h<f.length;h++){const g=f[h];switch(g){case"'":case'"':$[g]++,w+=g;continue;case"\0":if(Y.isDigit(f[h+1])){w+="\\x00";continue}}if(F[g]){w+=F[g];continue}if(g<" "){let a=g.charCodeAt(0).toString(16);w+="\\x"+("00"+a).substring(a.length);continue}w+=g}const _=l||Object.keys($).reduce((h,g)=>$[h]<$[g]?h:g);return w=w.replace(new RegExp(_,"g"),F[_]),_+w+_}function m(f){if(s.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");s.push(f);let $=n;n=n+i;let F=r||Object.keys(f),w=[];for(const h of F){const g=d(h,f);if(g!==void 0){let a=b(h)+":";i!==""&&(a+=" "),a+=g,w.push(a)}}let _;if(w.length===0)_="{}";else{let h;if(i==="")h=w.join(","),_="{"+h+"}";else{let g=`,
|
|
30
|
-
`+n;h=w.join(g),_=`{
|
|
31
|
-
`+n+h+`,
|
|
32
|
-
`+$+"}"}}return s.pop(),n=$,_}function b(f){if(f.length===0)return p(f);const $=String.fromCodePoint(f.codePointAt(0));if(!Y.isIdStartChar($))return p(f);for(let F=$.length;F<f.length;F++)if(!Y.isIdContinueChar(String.fromCodePoint(f.codePointAt(F))))return p(f);return f}function C(f){if(s.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");s.push(f);let $=n;n=n+i;let F=[];for(let _=0;_<f.length;_++){const h=d(String(_),f);F.push(h!==void 0?h:"null")}let w;if(F.length===0)w="[]";else if(i==="")w="["+F.join(",")+"]";else{let _=`,
|
|
33
|
-
`+n,h=F.join(_);w=`[
|
|
34
|
-
`+n+h+`,
|
|
35
|
-
`+$+"]"}return s.pop(),n=$,w}};const Gi={parse:Oi,stringify:ji};var Ca=Gi;export{Nu as A,Lu as B,ea as F,et as H,hs as I,Gt as J,yu as L,Aa as O,Ai as T,la as U,sa as W,Zi as a,na as b,aa as c,Ji as d,Eo as e,Qe as f,Se as g,Vi as h,Ca as i,Sr as j,ha as k,Wi as l,wr as m,fa as n,qi as o,Da as s,Ea as u,So as v,Xi as w,Ki as y,ca as z};
|