@visulima/vis 1.0.0-alpha.43 → 1.0.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/LICENSE.md +256 -0
- package/bin/resolve-binary.mjs +85 -0
- package/bin/vis.mjs +76 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -2
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +142 -141
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- 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 +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +13 -4
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +2 -2
- package/dist/packem_chunks/handler51.js +1 -1
- 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 +4 -4
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +2 -2
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +18 -18
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +3 -3
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler65.js +1 -1
- package/dist/packem_chunks/handler66.js +12 -12
- package/dist/packem_chunks/handler67.js +1 -1
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +4 -4
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +16 -17
- package/dist/packem_chunks/handler71.js +2 -2
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +3 -3
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +63 -63
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +22 -2
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{affected-shas-C1XuRlvo.js → affected-shas-CwRY5aoc.js} +1 -1
- package/dist/packem_shared/{ai-analysis-Co-b15d_.js → ai-analysis-CO6S0afy.js} +4 -4
- package/dist/packem_shared/{ai-fix-DnJDgPN-.js → ai-fix-CI0Vvqld.js} +1 -1
- package/dist/packem_shared/augment-DaSS2Lgs.js +4 -0
- package/dist/packem_shared/{bin-DDq2oszw.js → bin-P6Q5tKrP.js} +1 -1
- package/dist/packem_shared/{build-scripts-Doxce2VM.js → build-scripts-MTSK6TNr.js} +1 -1
- package/dist/packem_shared/{command-runtime-RiCMa2C8.js → command-runtime-BE-vKsGH.js} +1 -1
- package/dist/packem_shared/{cyclonedx-BTBzGCBW.js → cyclonedx-BeUmPgfO.js} +1 -1
- package/dist/packem_shared/{dependency-scan-DEv-scN6.js → dependency-scan-DpOFiZuI.js} +1 -1
- package/dist/packem_shared/{docker-DKlF-gk3.js → docker-CViFYtmM.js} +1 -1
- package/dist/packem_shared/{env-XJzocuUP.js → env-C2ZCnfP_.js} +1 -1
- package/dist/packem_shared/{failure-log-Sp1j-5qo.js → failure-log-jFfZRJK9.js} +1 -1
- package/dist/packem_shared/glob-fqg4KepW-1S3z30c8.js +1 -0
- package/dist/packem_shared/index-CE6MsgcV.js +22 -0
- package/dist/packem_shared/{index-CkZnT2Fe.js → index-CQjzW7m8.js} +1 -1
- package/dist/packem_shared/{index-DJAnbLEh.js → index-D7EZ612R.js} +1 -1
- package/dist/packem_shared/{lifecycle-C4nRsXxc.js → lifecycle-Dyb47wbD.js} +1 -1
- package/dist/packem_shared/{lockfile-DIGyLfmF.js → lockfile-C1qCKGH6.js} +1 -1
- package/dist/packem_shared/{manifests-pLwnVmCN.js → manifests-WBnsV_Eb.js} +1 -1
- package/dist/packem_shared/{min-release-age-B23Mr7NO.js → min-release-age-C71MO72F.js} +1 -1
- package/dist/packem_shared/{missing-package-json-DdMNbe_j.js → missing-package-json-CTF71tE5.js} +1 -1
- package/dist/packem_shared/{native-config-sync-4K9wWTj5.js → native-config-sync-BFDVK9LH.js} +4 -4
- package/dist/packem_shared/{packument-QjOLAMSk.js → packument-DquNPIq9.js} +1 -1
- package/dist/packem_shared/{pm-runner-CIH0wPh-.js → pm-runner-D4jM58Oz.js} +1 -1
- package/dist/packem_shared/{provenance-CilBg0Ee.js → provenance-DIq8KyBV.js} +1 -1
- package/dist/packem_shared/readJsonSync-CvkZyKmL-ihoybKvs.js +1 -0
- package/dist/packem_shared/{registry-keys-BEavOCPz.js → registry-keys-C8K11ets.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-C4o8_-SE.js → resolve-explicit-Dr4kIybR.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-CJSWV-K8.js → resolve-runtime-Tx0bvg0h.js} +1 -1
- package/dist/packem_shared/run-file-DD7Ne23Z.js +1 -0
- package/dist/packem_shared/{runtime-check-0lUJvgKt.js → runtime-check-BXehSP06.js} +1 -1
- package/dist/packem_shared/{s1ngularity-DuG-LLaX.js → s1ngularity-CtMmtXJo.js} +1 -1
- package/dist/packem_shared/{scan-progress-RTMsE3Z4.js → scan-progress-D4yywI6P.js} +1 -1
- package/dist/packem_shared/{selectors-UmnAuc26.js → selectors-D4iCvITE.js} +1 -1
- package/dist/packem_shared/{signatures-CYheSqd3.js → signatures-CE8OAK-i.js} +1 -1
- package/dist/packem_shared/target-options-CR0OuYJr.js +1 -0
- package/dist/packem_shared/toolchain-C44mPKPu.js +5 -0
- package/dist/packem_shared/{typosquats-hCtH-23t.js → typosquats-CQz-1Y6K.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BKUjhm_3.js → use-measured-height-XK9YSwtv.js} +1 -1
- package/dist/packem_shared/utils-CRueU43T.js +1 -0
- package/dist/packem_shared/verify-DStfg3nb.js +1 -0
- package/dist/packem_shared/{vis-update-app-K-qATSeh.js → vis-update-app-Cpme_3Du.js} +1 -1
- package/dist/packem_shared/{watch-Bkp_AAbc.js → watch-BXNI7dC6.js} +1 -1
- package/dist/packem_shared/{watch-loop-WE7nWIEt.js → watch-loop-JfGKIgKB.js} +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +16 -12
- package/dist/packem_shared/augment-8fIWWGSc.js +0 -3
- package/dist/packem_shared/glob-fqg4KepW-7Bs2kZuM.js +0 -1
- package/dist/packem_shared/index-OQZQyN5R.js +0 -19
- package/dist/packem_shared/readJsonSync-CvkZyKmL-CY7PZob_.js +0 -4
- package/dist/packem_shared/run-file-B4TqKa0X.js +0 -1
- package/dist/packem_shared/target-options-ChWcK60i.js +0 -1
- package/dist/packem_shared/toolchain-DyCKnGch.js +0 -5
- package/dist/packem_shared/utils-Cxree603.js +0 -1
- package/dist/packem_shared/verify-CVPYlUrF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as nt}from"node:module";import{m as ii,a as tt,f as mu}from"./index-
|
|
1
|
+
import{createRequire as nt}from"node:module";import{m as ii,a as tt,f as mu}from"./index-CE6MsgcV.js";import{a as lt}from"./readJsonSync-CvkZyKmL-ihoybKvs.js";const at=nt(import.meta.url),vo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zo=i=>{if(typeof vo<"u"&&vo.versions&&vo.versions.node){const[o,e]=vo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return vo.getBuiltinModule(i)}return at(i)},{existsSync:ut,rmSync:wu,writeFileSync:gt,readdirSync:ju,statSync:dt}=Zo("node:fs"),{spawn:$n}=Zo("node:child_process"),{createHash:st}=Zo("node:crypto"),{homedir:ht,platform:rt}=Zo("node:os"),{createRequire:fu}=Zo("node:module"),qe=()=>ii(ht(),".vis"),vt=()=>ii(qe(),"cache"),yX=()=>ii(qe(),"state"),yt=i=>st("sha256").update(i).digest("hex").slice(0,12),cX=i=>ii(qe(),"workspaces",yt(i)),Yu=".vis",Ie=i=>ii(i,Yu),bX=`${Yu}/cache`,pX=i=>ii(Ie(i),"runs"),wX=i=>ii(Ie(i),"last-summary.json"),jX=i=>ii(Ie(i),"last-failures"),mX=i=>{const o=rt()==="win32";for(const e of[".task-runner",".task-runner-cache"]){const n=ii(i,e);if(ut(n))try{const a=o?$n("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):$n("rm",["-rf",n],{detached:!0,stdio:"ignore"});a.on("error",()=>{}),a.unref()}catch{}}},ct={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},bt=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],qn=new Map,In=(i,o)=>{const e=`${i}\0${JSON.stringify(o)}`;let n=qn.get(e);return n===void 0&&(n=new Intl.NumberFormat(i,o),qn.set(e,n)),n},pt=i=>{switch(i){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},wt=(i,o,e)=>({maximumFractionDigits:i,minimumFractionDigits:i,...o,...e}),fX=(i,o)=>{if(typeof i!="number"||!Number.isFinite(i))throw new TypeError("Bytesize is not a number.");const{base:e,bits:n,decimals:a,locale:u,long:g,signed:d,unit:h,units:s,...l}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...o},v=pt(e),r=n?i*8:i,c=Math.abs(r),y=o?.space??!0?" ":"",b=n?bt:ct[s],p=b.findIndex(B=>B.short===h),w=a<0?void 0:a,j=d?{signDisplay:"exceptZero"}:{};if(r===0){const B=p===-1?0:Math.min(p,b.length-1),K=b[B][g?"long":"short"];return In(u,{...j,...l}).format(0)+y+K}const Z=Math.max(0,Math.min(Math.floor(Math.log(c)/Math.log(v)),b.length-1)),X=p===-1?Z:p,A=b[X][g?"long":"short"],M=r/v**X;return In(u,wt(w,j,l)).format(M)+y+A},jt=(i,o,e,n,a,u,g,d,h,s,l,v,r,c)=>{const y={d:n,h:a,m:u,mo:o,ms:d,s:g,w:e,y:i};return y.future=h,y.past=s,y.decimal=l,v!==void 0&&(y.unitMap=v),y.groupSeparator=r,y.placeholderSeparator=c,y},mt={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},YX=jt(i=>`year${i===1?"":"s"}`,i=>`month${i===1?"":"s"}`,i=>`week${i===1?"":"s"}`,i=>`day${i===1?"":"s"}`,i=>`hour${i===1?"":"s"}`,i=>`minute${i===1?"":"s"}`,i=>`second${i===1?"":"s"}`,i=>`millisecond${i===1?"":"s"}`,"in %s","%s ago",".",mt,",","_"),ft="https://api.socket.dev/v0/purl?alerts=true",So=()=>ii(vt(),"socket-security"),Yt=3600*1e3,ku=.4,Un=100,kt=i=>typeof i=="object"&&i!==null&&"id"in i&&"type"in i&&"name"in i&&"version"in i&&"alerts"in i&&"score"in i&&i.type==="npm",Lt=()=>{tt(So())},Lu=(i,o)=>`${encodeURIComponent(i)}@${encodeURIComponent(o)}`,Zt=(i,o)=>{const e=Lu(i,o),n=ii(So(),`${e}.json`);try{const a=lt(n);if(Date.now()-a.createdAt>a.ttlMs){wu(n,{force:!0});return}return a.report}catch{return}},St=(i,o,e,n)=>{const a=Lu(i,o),u={createdAt:Date.now(),report:e,ttlMs:n};gt(ii(So(),`${a}.json`),JSON.stringify(u),"utf8")},Jt=i=>{const o=[i.license,i.maintenance,i.quality,i.supplyChain,i.vulnerability];return Number((o.reduce((e,n)=>e+n,0)/o.length).toFixed(2))},Ct=async(i,o={})=>{const{apiToken:e,cacheTtlMs:n=Yt,timeoutMs:a=15e3}=o,u=new Map;if(i.length===0||!e)return u;const g=[];for(const s of i){const l=Zt(s.name,s.version);l?u.set(`${s.name}@${s.version}`,l):g.push(s)}if(g.length===0)return u;const d=`Basic ${Buffer.from(`${e}:`).toString("base64")}`;Lt();const h=[];for(let s=0;s<g.length;s+=Un)h.push(g.slice(s,s+Un));for(const s of h){const l=s.map(c=>({purl:`pkg:npm/${c.name}@${c.version}`})),v=new AbortController,r=setTimeout(()=>{v.abort()},a);try{const c=await fetch(ft,{body:JSON.stringify({components:l}),headers:{Authorization:d,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:v.signal});if(!c.ok)continue;const y=await c.text();Xt(y,s,u,n)}catch{}finally{clearTimeout(r)}}return u},Xt=(i,o,e,n)=>{const a=new Map;for(const g of o)a.set(`${g.name}@${g.version}`,g);const u=i.split(`}
|
|
2
2
|
`);for(const g of u){const d=g.trim();if(d)try{const h=JSON.parse(d.endsWith("}")?d:`${d}}`),s=`${h.namespace?`${h.namespace}/`:""}${h.name}`,l=`${s}@${h.version}`;if(!a.has(l))continue;const v=h.score.overall??Jt(h.score),r={alerts:h.alerts,author:h.author,id:h.id,license:h.license,name:h.name,score:{...h.score,overall:v},size:h.size,type:"npm",version:h.version};h.namespace&&(r.namespace=h.namespace),kt(r)&&(e.set(l,r),St(s,h.version,r,n))}catch{}}},Ht=i=>i.namespace?`${i.namespace}/${i.name}`:i.name,kX=i=>i>=.8?"excellent":i>=.6?"good":i>=.4?"fair":i>=.2?"poor":"critical",LX=i=>i>=.6?"green":i>=.4?"yellow":"red",ZX=i=>{const o=Ht(i),e=`score: ${String(Math.round(i.score.overall*100))}%`,n=i.alerts.length,a=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${o}@${i.version} (${e}, ${a})`},SX=(i,o=ku)=>{if(i.size===0)return"";let e=0,n=0,a=0,u=0,g=0,d=0;for(const s of i.values()){for(const l of s.alerts)switch(e++,l.severity){case"critical":{n++;break}case"high":{a++;break}case"medium":{u++;break}default:g++}s.score.overall<o&&d++}const h=[`Socket.dev: scanned ${String(i.size)} package${i.size===1?"":"s"}`];if(e>0){const s=[];n>0&&s.push(`${String(n)} critical`),a>0&&s.push(`${String(a)} high`),u>0&&s.push(`${String(u)} medium`),g>0&&s.push(`${String(g)} low`),h.push(` Alerts: ${String(e)} total (${s.join(", ")})`)}else h.push(" No security alerts found.");if(d>0){const s=Math.round(o*100);h.push(` ${String(d)} package${d===1?"":"s"} with low security score (<${String(s)}%)`)}return h.join(`
|
|
3
3
|
`)},Dt=()=>{const i=So();if(!mu(i))return 0;const o=ju(i).filter(e=>e.endsWith(".json"));for(const e of o)wu(ii(i,e),{force:!0});return o.length},Tt=()=>{const i=So();if(!mu(i))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const o=ju(i).filter(u=>u.endsWith(".json"));let e=0,n,a;for(const u of o){const g=dt(ii(i,u));e+=g.size;const{mtimeMs:d}=g;(n===void 0||d<n)&&(n=d),(a===void 0||d>a)&&(a=d)}return{entries:o.length,newestEntry:a,oldestEntry:n,totalSizeBytes:e}},Bt=(i,o)=>i?.enabled?{apiToken:i.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:i.cacheTtlMs,minimumScore:o??ku,timeoutMs:i.timeoutMs}:void 0,JX=(i,o,e,n)=>{if(!e)return;const a=Date.now(),u=d=>{if(d.expiresAt){const h=Date.parse(d.expiresAt);if(!Number.isNaN(h)&&h<a)return!1}return!(n&&d.policies&&!d.policies.includes(n))},g=`${i}@${o}`;if(e[g]&&u(e[g]))return e[g];if(e[i]&&u(e[i]))return e[i];for(const[d,h]of Object.entries(e))if(d.endsWith("*")&&i.startsWith(d.slice(0,-1))&&u(h))return h},CX=(i,o,e,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${i}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(e)},`,' policies: ["score"],'," },"].join(`
|
|
4
4
|
`),XX=(i,o={})=>{const e=Bt(i,o.minimumScore);if(e)return{clearCache:Dt,displayName:"Socket.dev",fetchReports:n=>Ct(n,e),getCacheStats:Tt,id:"socket"}},Mt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Qt=12288,Gt=65510,xt=[12288,12288,65281,65376,65504,65510],Nt=8361,Wt=65518,Pt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ft=32,Kt=10630,Rt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],At=4352,Ot=262141,Zu=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Jo=(i,o)=>{let e=0,n=Math.floor(i.length/2)-1;for(;e<=n;){const a=Math.floor((e+n)/2),u=a*2;if(o<i[u])n=a-1;else if(o>i[u+1])e=a+1;else return!0}return!1},Vn=19968,[_t,zt]=Et(Zu);function Et(i){let o=i[0],e=i[1];for(let n=0;n<i.length;n+=2){const a=i[n],u=i[n+1];if(Vn>=a&&Vn<=u)return[a,u];u-a>e-o&&(o=a,e=u)}return[o,e]}const $t=i=>i<161||i>1114109?!1:Jo(Mt,i),qt=i=>i<Qt||i>Gt?!1:Jo(xt,i),It=i=>i<Nt||i>Wt?!1:Jo(Pt,i),Ut=i=>i<Ft||i>Kt?!1:Jo(Rt,i),Vt=i=>i>=_t&&i<=zt?!0:i<At||i>Ot?!1:Jo(Zu,i);function is(i){return $t(i)?"ambiguous":qt(i)?"fullwidth":It(i)?"halfwidth":Ut(i)?"narrow":Vt(i)?"wide":"neutral"}function os(i){if(!Number.isSafeInteger(i))throw new TypeError(`Expected a code point, got \`${typeof i}\`.`)}function Su(i){return os(i),is(i)}const Ju=String.raw,ia=Ju`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,es=()=>new RegExp(Ju`\p{RI}{2}|(?)${ia}(?:\u200D${ia})*`,"gu"),HX=new Set(["\x1B",""]),ns="\x07",as="[",DX="m",us="]8;;",TX=39,BX=/[\u200B\uFEFF\u2060-\u2064]/g,MX=new RegExp(`(?:\\${as}(?<code>\\d+)m|\\${us}(?<uri>.*)${ns})`),QX=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),gs=/^[ \t]*(?:\r\n|\r|\n)/,ds=/(?:\r\n|\r|\n)[ \t]*$/,ts=/^(?:[\r\n]|$)/,ss=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,hs=/^[ \t]*[\r\n][ \t\r\n]*$/,rs=/\r\n|\n|\r/g,yo=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,GX=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,xX=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Qo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ci=es(),ls=/[-_./\s]+/g,we=/(\u001B\[[0-9;]*[a-z])/i,oa=new RegExp("\\p{Script=Arabic}","u"),vs=new RegExp("\\p{Script=Bengali}","u"),qi=new RegExp("\\p{Script=Cyrillic}","u"),ys=new RegExp("\\p{Script=Devanagari}","u"),cs=new RegExp("\\p{Script=Ethiopic}","u"),je=new RegExp("\\p{Script=Greek}","u"),ea=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),bs=new RegExp("\\p{Script=Gujarati}","u"),ps=new RegExp("\\p{Script=Gurmukhi}","u"),na=new RegExp("\\p{Script=Hangul}","u"),aa=new RegExp("\\p{Script=Hebrew}","u"),ws=new RegExp("\\p{Script=Hiragana}","u"),ua=new RegExp("\\p{Script=Han}","u"),js=new RegExp("\\p{Script=Kannada}","u"),ms=new RegExp("\\p{Script=Katakana}","u"),fs=new RegExp("\\p{Script=Khmer}","u"),Ys=new RegExp("\\p{Script=Lao}","u"),U=new RegExp("\\p{Script=Latin}","u"),ks=new RegExp("\\p{Script=Malayalam}","u"),Ls=new RegExp("\\p{Script=Myanmar}","u"),Zs=new RegExp("\\p{Script=Oriya}","u"),Ss=new RegExp("\\p{Script=Sinhala}","u"),Js=new RegExp("\\p{Script=Tamil}","u"),Cs=new RegExp("\\p{Script=Telugu}","u"),Xs=new RegExp("\\p{Script=Thai}","u"),Hs=new RegExp("\\p{Script=Tibetan}","u"),ga=/[\u02BB\u02BC\u0027]/u,Ds=i=>i.replace(ci,""),da=new Map,Ts=i=>[i.ambiguousIsNarrow?1:0,i.control,i.fullWidth,i.regular,i.wide].join("|"),Bs=i=>{const o=Ts(i.width);let e=da.get(o);return e||(e=new Map,da.set(o,e)),e},Go=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Cu=i=>i>=32&&i<=126?"latin":i===8203||i===8204||i===8205||i===8288?"zero":i<=31||i>=127&&i<=159?"control":i>=160&&i<=255||i>=9472&&i<=9599?"latin":i>=4352&&i<=4607||i>=11904&&i<=40959||i>=44032&&i<=55215||i>=63744&&i<=64255||i>=65280&&i<=65519&&!(i>=65377&&i<=65439)||i>=12352&&i<=12543?"wide":i===8230?"latin":"other",Ms=(i,o)=>{const e=Bs(o),n=Math.floor(i/65536),a=i%65536;let u=e.get(n);if(u||(u=new Map,e.set(n,u)),u.has(a))return u.get(a);let g;switch(Cu(i)){case"control":{g=o.width.control;break}case"latin":{g=o.width.regular;break}case"wide":{g=o.width.wide;break}case"zero":{g=0;break}default:switch(Su(i)){case"ambiguous":{g=o.width.ambiguousIsNarrow?o.width.regular:o.width.wide;break}case"fullwidth":{g=o.width.fullWidth;break}case"wide":{g=o.width.wide;break}default:g=o.width.regular}}return u.set(a,g),g},Qs=i=>i>=768&&i<=879||i>=6832&&i<=6911||i>=7616&&i<=7679||i>=8400&&i<=8447||i>=65056&&i<=65071||i>=917760&&i<=917999||i>=65024&&i<=65039||i>=3633&&i<=3642||i>=3655&&i<=3662||i>=3761&&i<=3769||i>=3771&&i<=3772||i>=3784&&i<=3789||i>=2304&&i<=2307||i>=2362&&i<=2383||i>=2385&&i<=2391||i>=2402&&i<=2403||i>=2433&&i<=2435||i>=2492&&i<=2500||i>=2509&&i<=2509||i>=2561&&i<=2563||i>=2620&&i<=2637||i>=1611&&i<=1631||i>=1648&&i<=1648||i>=1750&&i<=1773||i>=2276&&i<=2302||i>=1425&&i<=1469||i>=1471&&i<=1471||i>=1473&&i<=1474||i>=1476&&i<=1477||i>=1479&&i<=1479||i>=3893&&i<=3893||i>=3895&&i<=3895||i>=3897&&i<=3897||i>=3953&&i<=3966||i>=3968&&i<=3972||i>=3974&&i<=3975?!0:i>=768&&i<=777||i>=803&&i<=803,Qe=(i,o={})=>{if(!i||i.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const e={truncation:{countAnsiEscapeCodes:o.countAnsiEscapeCodes??!1,ellipsis:o.ellipsis??"",ellipsisWidth:o.ellipsisWidth??(o.ellipsis?Qe(o.ellipsis,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:o.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:o.ambiguousIsNarrow??!1,ansi:o.ansiWidth??0,control:o.controlWidth??0,emoji:o.emojiWidth??2,fullWidth:o.fullWidth??2,halfWidth:o.halfWidth??1,regular:o.regularWidth??1,tab:o.tabWidth??8,wide:o.wideWidth??2}},n=Math.max(0,e.truncation.limit-e.truncation.ellipsisWidth),{length:a}=i,u=a>1e4;let g=0,d=0,h=a,s=!1;const l=i.includes("\x1B")||i.includes("");for(;g<a;){if(l&&(i[g]==="\x1B"||i[g]==="")){if(i.startsWith("\x1B]8;;",g)){const p="\x1B]8;;\x07",w=p.length,j=i.indexOf("\x07",g+5);if(j!==-1){const Z=i.indexOf(p,j+1);if(Z!==-1){const X=Z+w,A=i.slice(j+1,Z).replace(yo,""),M=Qe(A,{ambiguousIsNarrow:e.width.ambiguousIsNarrow,ansiWidth:e.width.ansi,controlWidth:e.width.control,countAnsiEscapeCodes:!1,ellipsis:e.truncation.ellipsis,ellipsisWidth:e.truncation.ellipsisWidth,emojiWidth:e.width.emoji,fullWidth:e.width.fullWidth,halfWidth:e.width.halfWidth,limit:Math.max(0,n-d),regularWidth:e.width.regular,tabWidth:e.width.tab,wideWidth:e.width.wide}),B=M.width;if(M.truncated)s=!0,h=Math.min(h,g);else if(d+B>n&&(h=Math.min(h,g),s=!0,d+B>e.truncation.limit))break;if(d+=B,g=X,s&&d>=e.truncation.limit)break;continue}}}if(yo.lastIndex=g,yo.test(i)){const p=yo.lastIndex-g,w=e.truncation.countAnsiEscapeCodes?p:e.width.ansi;if(d+w>n&&(h=Math.min(h,g),d+w>e.truncation.limit)){s=!0;break}d+=w,g=yo.lastIndex;continue}}const c=i.codePointAt(g);if(c===8203||c===65279||c>=8288&&c<=8292){g+=1;continue}if(c===9){if(d+e.width.tab>n&&(h=Math.min(h,g),d+e.width.tab>e.truncation.limit)){s=!0;break}d+=e.width.tab,g+=1;continue}if(Go.lastIndex=g,Go.test(i)){const p=(Go.lastIndex-g)*e.width.regular;if(d+p>n){const w=Math.floor((n-d)/e.width.regular);if(h=Math.min(h,g+w),d+p>e.truncation.limit){s=!0;break}}d+=p,g=Go.lastIndex;continue}if((c<=31||c>=127&&c<=159)&&(Qo.lastIndex=g,Qo.test(i))){const p=(Qo.lastIndex-g)*e.width.control;if(d+p>n&&(h=Math.min(h,g+Math.floor((n-d)/e.width.control)),d+p>e.truncation.limit)){s=!0;break}d+=p,g=Qo.lastIndex;continue}if(ci.lastIndex=g,ci.test(i)){if(d+e.width.emoji>n&&(h=Math.min(h,g),d+e.width.emoji>e.truncation.limit)){s=!0;break}d+=e.width.emoji,g=ci.lastIndex;continue}const y=i.codePointAt(g)??0;if(Qs(y)){g+=y>65535?2:1;continue}let b;if(u)b=Ms(y,e);else switch(Cu(y)){case"control":{b=e.width.control;break}case"latin":{b=e.width.regular;break}case"wide":{b=e.width.wide;break}case"zero":{b=0;break}default:switch(Su(y)){case"ambiguous":{b=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{b=e.width.fullWidth;break}case"wide":{b=e.width.wide;break}default:b=e.width.regular}}if(d+b>n&&(h=Math.min(h,g),d+b>e.truncation.limit)){s=!0;break}d+=b,g+=y>65535?2:1}let v=d,r=!1;return s&&e.truncation.limit>=e.truncation.ellipsisWidth&&(v=e.truncation.limit,r=!0),{ellipsed:r,index:s?h:a,truncated:s,width:v}},NX=(i,o={})=>Qe(i,{...o,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;class Gs{capacity;cache;constructor(o){this.capacity=o,this.cache=new Map}get(o){if(!this.cache.has(o))return;const e=this.cache.get(o);return this.cache.delete(o),this.cache.set(o,e),e}has(o){return this.cache.has(o)}set(o,e){if(this.cache.has(o))this.cache.delete(o);else if(this.cache.size>=this.capacity){const n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}this.cache.set(o,e)}delete(o){this.cache.delete(o)}clear(){this.cache.clear()}size(){return this.cache.size}}const xs=fu(import.meta.url),co=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ns=i=>{if(typeof co<"u"&&co.versions&&co.versions.node){const[o,e]=co.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return co.getBuiltinModule(i)}return xs(i)},{stripVTControlCharacters:Ws}=Ns("node:util"),me=new Gs(1e3),Ps=/[.*+?^${}()|[\]\\]/g,Fs=i=>{const o=i.join("");if(me.has(o)){const a=me.get(o);return a.lastIndex=0,a}const e=i.map(a=>a.replaceAll(Ps,String.raw`\$&`)).join("|"),n=new RegExp(e,"g");return me.set(o,n),n},Ks=i=>{const o=[];let e=0,n;for(ci.lastIndex=0;(n=ci.exec(i))!==null;)n.index>e&&o.push(i.slice(e,n.index)),o.push(n[0]),e=ci.lastIndex;return e<i.length&&o.push(i.slice(e)),o.filter(Boolean)},Rs=/[ČŠŽĐ]/i,Xu=new Uint8Array(128),Hu=new Uint8Array(128),Du=new Uint8Array(128);for(let i=0;i<128;i++)Xu[i]=i>=65&&i<=90?1:0,Hu[i]=i>=97&&i<=122?1:0,Du[i]=i>=48&&i<=57?1:0;const fe=i=>Xu[i],ta=i=>Hu[i],Ye=i=>Du[i],Bi=(i,o,e,n,a)=>{if(i.length===0)return[];let u=!1;const g=Object.values(o);for(const c of g)if(c(i[0])){u=!0;break}if(!u&&!e)return[i];const d=[...i],h=[];let s=d[0],l="other";const v=Object.entries(o);for(const c of v){const[y,b]=c;if(b(d[0])){l=y;break}}let r=e&&n?d[0]===d[0].toLocaleUpperCase(n):!1;for(let c=1;c<d.length;c++){const y=d[c];let b="other";for(const j of v){const[Z,X]=j;if(X(y)){b=Z;break}}const p=e&&n?y===y.toLocaleUpperCase(n):!1;let w=!1;a?w=a(l,b,r,p,y,c,d):(l!==b&&l!=="other"&&b!=="other"&&(w=!0),e&&b!=="other"&&!r&&p&&(w=!0)),w?(h.push(s),s=y):s+=y,l=b,e&&(r=p)}return s&&s.length>0&&h.push(s),h.length>0?h:[i]},As=(i,o,e,n)=>{if(e.size===0)return o;for(const a of e)if(i.startsWith(a,o))return n.push(a),o+a.length;return o},Tu=(i,o=new Set)=>{if(i.length===0)return[];if(i.toUpperCase()===i)return[i];let e=0;const n=[],a=i.length;for(let u=1;u<a;u++){const g=As(i,e,o,n);if(g!==e){e=g,u=e-1;continue}const d=i.codePointAt(u-1),h=i.codePointAt(u),s=d&&d<128&&fe(d),l=h&&h<128&&fe(h),v=d&&d<128&&ta(d),r=d&&d<128&&Ye(d),c=h&&h<128&&Ye(h);if(v&&l){n.push(i.slice(e,u)),e=u;continue}if(r&&!c||!r&&c){n.push(i.slice(e,u)),e=u;continue}if(c&&!r){let y=!1,b=!1;if(u+1<a){const p=i.codePointAt(u+1);y=p&&p<128&&fe(p),b=p&&p<128&&Ye(p)}if(!b&&y){n.push(i.slice(e,u),i.slice(u,u+1)),e=u+1;continue}}if(u+1<a){const y=i.codePointAt(u+1),b=y&&y<128&&ta(y);if(s&&l&&b){const p=i.slice(e,u+1);o.has(p)||(n.push(i.slice(e,u)),e=u)}}}return e<a&&n.push(i.slice(e)),n.filter(u=>u!=="")},Bu=(i,o,e)=>{if(i.length===0)return[];const n=i===i.toLocaleUpperCase(o);if(o.startsWith("de")){if(!n&&i.replaceAll("ß","SS")===i.toLocaleUpperCase(o))return[i];const s=[...i],l=s.length,v=[];let r=s[0],c=s[0]===s[0].toLocaleUpperCase(o),y=c,b=c?0:-1;for(let p=1;p<l;p++){const w=s[p],j=w===w.toLocaleUpperCase(o);if(j===c)r+=w;else if(j)r&&r.length>0&&(v.push(r),r=w),y=!0,b=p;else{if(y&&p-b>1){const Z=s[p-1],X=r.slice(0,-1);X&&X.length>0&&v.push(X),r=Z+w}else r+=w;y=!1,b=-1}c=j}return r&&r.length>0&&v.push(r),v}if(o.startsWith("uk")||o.startsWith("ru")||o.startsWith("bg")||o.startsWith("sr")||o.startsWith("mk")||o.startsWith("be")){if(!qi.test(i)&&!U.test(i))return[i];const s=[...i],l=s.length,v=[];let r=s[0];const c=s[0];let y;qi.test(c)?y=1:U.test(c)?y=2:y=0;let b=c===c.toLocaleUpperCase(o);for(let w=1;w<l;w++){const j=s[w];let Z;qi.test(j)?Z=1:U.test(j)?Z=2:Z=0;const X=j===j.toLocaleUpperCase(o);y!==Z&&(y===1||y===2)&&(Z===1||Z===2)||Z===y&&!b&&X?(v.push(r),r=j):r+=j,y=Z,b=X}r&&r.length>0&&v.push(r);const p=[];for(let w=0;w<v.length;w++)w<v.length-1&&v[w].length===1&&U.test(v[w])&&qi.test(v[w+1][0])?(p.push(v[w]+v[w+1]),w+=1):p.push(v[w]);return p}if(o.startsWith("el")){if(!je.test(i)&&!U.test(i))return[i];const s=[];ea.lastIndex=0;let l;for(;(l=ea.exec(i))!==null;)s.push(l[0]);s.length===0&&s.push(i);const v=[];if(s.length===1){const r=s[0];if(!r||!je.test(r[0])||r.length===1)return[r??i]}for(const r of s){if(!r)continue;if(!je.test(r[0])||r.length===1){v.push(r);continue}const c=r.length;let y=r[0],b=r[0]===r[0].toLocaleUpperCase(o);for(let p=1;p<c;p++){const w=r[p],j=w===w.toLocaleUpperCase(o);!b&&j?(v.push(y),y=w):y+=w,b=j}y&&v.push(y)}return v}if(o.startsWith("ja")||o.startsWith("ko")){const s=o.startsWith("ja"),l=s?{hiragana:r=>ws.test(r),kanji:r=>ua.test(r),katakana:r=>ms.test(r),latin:r=>U.test(r)}:{hangul:r=>na.test(r),latin:r=>U.test(r)},v=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const r=Bi(i,l,!1,o,(y,b)=>y==="hiragana"&&b==="katakana"||y==="katakana"&&b==="hiragana"||y==="hiragana"&&b==="latin"||y==="katakana"&&b==="latin"||y==="kanji"&&b==="latin"||y==="latin"&&(b==="hiragana"||b==="katakana"||b==="kanji")),c=[];for(const y of r){const b=y;b.length===1&&v.has(b)&&c.length>0?c[c.length-1]=c.at(-1)+b:c.push(b)}return c.length>0?c:[i]}return Bi(i,l,!1,o,(r,c)=>r==="hangul"&&c==="latin"||r==="latin"&&c==="hangul")}if(o.startsWith("sl")){const s=[...i],l=s.length,v=[];let r=s[0],c=s[0]===s[0].toLocaleUpperCase(o);for(let y=1;y<l;y++){const b=s[y],p=b===b.toLocaleUpperCase(o),w=Rs.test(b),j=y<l-1&&s[y+1]===s[y+1].toLocaleUpperCase(o);!c&&p||w&&j?(v.push(r),r=b,w&&j&&(v.push(r),r="")):r+=b,c=p}return r&&r.length>0&&v.push(r),v}if(o.startsWith("zh"))return Bi(i,{han:s=>ua.test(s),latin:s=>U.test(s)},!1,o);if(["ar","fa","he","ur"].includes(o.split("-")[0])){const s=l=>aa.test(l)||oa.test(l);return Bi(i,{latin:l=>U.test(l),rtl:l=>s(l)},!1,o)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(o.split("-")[0])){const s=l=>ys.test(l)||vs.test(l)||bs.test(l)||ps.test(l)||js.test(l)||Js.test(l)||Cs.test(l)||ks.test(l)||Ss.test(l)||Xs.test(l)||Ys.test(l)||Hs.test(l)||Ls.test(l)||cs.test(l)||fs.test(l)||Zs.test(l);return Bi(i,{indic:l=>s(l),latin:l=>U.test(l)},!1,o)}if(["be","bg","ru","sr","uk"].includes(o))return Bi(i,{cyrillic:s=>qi.test(s),latin:s=>U.test(s)},!0,o);if(["ar","fa","he"].includes(o))return Bi(i,{latin:s=>U.test(s),rtl:s=>aa.test(s)||oa.test(s)},!1,o);if(o.startsWith("ko"))return Bi(i,{hangul:s=>na.test(s),latin:s=>U.test(s)},!1,o);if(o.startsWith("uz")){if(!qi.test(i)&&!U.test(i))return[i];const s=[...i],l=s.length,v=[];let r=s[0],c=s[0]===s[0].toLocaleUpperCase(o);for(let y=1;y<l;y++){const b=s[y],p=b===b.toLocaleUpperCase(o);if(ga.test(b)||ga.test(s[y-1])){r+=b;continue}!c&&p?(v.push(r),r=b):r+=b,c=p}return r&&r.length>0&&v.push(r),v}const a=[...i],u=a.length,g=[];let d=a[0],h=a[0]===a[0].toLocaleUpperCase(o);for(const s of e)if(i.startsWith(s)){g.push(s),d=a[s.length],h=d===d.toLocaleUpperCase(o);break}for(let s=1;s<u;s++){const l=a[s],v=l===l.toLocaleUpperCase(o);let r=0;for(const c of e)if(i.startsWith(c,s)){g.push(d,c),r=c.length,d="";const y=c.at(-1);y&&(h=y===y.toLocaleUpperCase(o));break}if(r>0){s+=r-1;continue}!h&&v?(g.push(d),d=l):d+=l,h=v}return d&&g.push(d),g},Os=(i,o,e)=>{const n=[],a=we.test(i)?i.split(we).filter(Boolean):[i];for(const u of a){const g=u;if(we.test(g))n.push(g);else{ci.lastIndex=0;const d=ci.test(g)?Ks(g).filter(Boolean):[g];for(const h of d)if(ci.lastIndex=0,ci.test(h))n.push(h);else if(o){const s=o.toLowerCase().split("-")[0];n.push(...Bu(h,s,e))}else n.push(...Tu(h,e))}}return n},WX=(i,o={})=>{if(!i||typeof i!="string")return[];const{handleAnsi:e=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:u,normalize:g=!1,separators:d,stripAnsi:h=!1,stripEmoji:s=!1}=o,l=new Set([...a].toSorted((w,j)=>j.length-w.length));let v=i;h&&(v=Ws(v)),s&&(v=Ds(v));let r;Array.isArray(d)?r=Fs(d):d instanceof RegExp?r=d:r=ls;const c=[];let y=v;const b=r.flags.includes("g")?r:new RegExp(r.source,`${r.flags}g`);for(;y.length>0;){const w=b.exec(y);if(!w){y===".."?c.push(".."):y==="."?c.push("."):y.length>0&&c.push(y);break}const j=w.index,Z=w[0],X=Z.length,A=y.slice(0,j),M=y.slice(j+X);if(Z.startsWith("../"))c.push(".."),y=y.slice(j+3);else if(Z.startsWith("./"))c.push("."),y=y.slice(j+2);else if(j===0&&Z==="..")c.push(".."),y=y.slice(2);else if(j===0&&Z===".")c.push("."),y=y.slice(1);else{A.length>0&&c.push(A);let B=0;for(;(B=Z.indexOf("../",B))!==-1;)c.push(".."),B+=3;for(B=0;(B=Z.indexOf("./",B))!==-1;)(B===0||Z[B-1]!==".")&&c.push("."),B+=2;let K=M;for(;K.startsWith("../");)c.push(".."),K=K.slice(3);for(;K.startsWith("./");)c.push("."),K=K.slice(2);if(K===".."){c.push("..");break}else if(K==="."){c.push(".");break}else y=K}b.lastIndex=0}if(c.length===0){const w=v.split(r).filter(Boolean);c.push(...w)}let p=[];for(const w of c)e||n?p.push(...Os(w,u,l)):u?p.push(...Bu(w,u,l)):p.push(...Tu(w,l));return g&&(p=p.map(w=>l.has(w)?w:u&&w===w.toLocaleUpperCase(u)?w[0]+w.slice(1).toLocaleLowerCase(u):w.toUpperCase()===w&&!l.has(w)?w.slice(0,1)+w.slice(1).toLowerCase():w)),p},_s=fu(import.meta.url),bo=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zs=i=>{if(typeof bo<"u"&&bo.versions&&bo.versions.node){const[o,e]=bo.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return bo.getBuiltinModule(i)}return _s(i)};zs("node:util");function Es(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ke,sa;function $s(){if(sa)return ke;sa=1,ke=o;function i(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function o(n){if(n=n||{},n.circles)return e(n);const a=new Map;if(a.set(Date,s=>new Date(s)),a.set(Map,(s,l)=>new Map(g(Array.from(s),l))),a.set(Set,(s,l)=>new Set(g(Array.from(s),l))),n.constructorHandlers)for(const s of n.constructorHandlers)a.set(s[0],s[1]);let u=null;return n.proto?h:d;function g(s,l){const v=Object.keys(s),r=new Array(v.length);for(let c=0;c<v.length;c++){const y=v[c],b=s[y];typeof b!="object"||b===null?r[y]=b:b.constructor!==Object&&(u=a.get(b.constructor))?r[y]=u(b,l):ArrayBuffer.isView(b)?r[y]=i(b):r[y]=l(b)}return r}function d(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,d);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,d);const l={};for(const v in s){if(Object.hasOwnProperty.call(s,v)===!1)continue;const r=s[v];typeof r!="object"||r===null?l[v]=r:r.constructor!==Object&&(u=a.get(r.constructor))?l[v]=u(r,d):ArrayBuffer.isView(r)?l[v]=i(r):l[v]=d(r)}return l}function h(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return g(s,h);if(s.constructor!==Object&&(u=a.get(s.constructor)))return u(s,h);const l={};for(const v in s){const r=s[v];typeof r!="object"||r===null?l[v]=r:r.constructor!==Object&&(u=a.get(r.constructor))?l[v]=u(r,h):ArrayBuffer.isView(r)?l[v]=i(r):l[v]=h(r)}return l}}function e(n){const a=[],u=[],g=new Map;if(g.set(Date,v=>new Date(v)),g.set(Map,(v,r)=>new Map(h(Array.from(v),r))),g.set(Set,(v,r)=>new Set(h(Array.from(v),r))),n.constructorHandlers)for(const v of n.constructorHandlers)g.set(v[0],v[1]);let d=null;return n.proto?l:s;function h(v,r){const c=Object.keys(v),y=new Array(c.length);for(let b=0;b<c.length;b++){const p=c[b],w=v[p];if(typeof w!="object"||w===null)y[p]=w;else if(w.constructor!==Object&&(d=g.get(w.constructor)))y[p]=d(w,r);else if(ArrayBuffer.isView(w))y[p]=i(w);else{const j=a.indexOf(w);j!==-1?y[p]=u[j]:y[p]=r(w)}}return y}function s(v){if(typeof v!="object"||v===null)return v;if(Array.isArray(v))return h(v,s);if(v.constructor!==Object&&(d=g.get(v.constructor)))return d(v,s);const r={};a.push(v),u.push(r);for(const c in v){if(Object.hasOwnProperty.call(v,c)===!1)continue;const y=v[c];if(typeof y!="object"||y===null)r[c]=y;else if(y.constructor!==Object&&(d=g.get(y.constructor)))r[c]=d(y,s);else if(ArrayBuffer.isView(y))r[c]=i(y);else{const b=a.indexOf(y);b!==-1?r[c]=u[b]:r[c]=s(y)}}return a.pop(),u.pop(),r}function l(v){if(typeof v!="object"||v===null)return v;if(Array.isArray(v))return h(v,l);if(v.constructor!==Object&&(d=g.get(v.constructor)))return d(v,l);const r={};a.push(v),u.push(r);for(const c in v){const y=v[c];if(typeof y!="object"||y===null)r[c]=y;else if(y.constructor!==Object&&(d=g.get(y.constructor)))r[c]=d(y,l);else if(ArrayBuffer.isView(y))r[c]=i(y);else{const b=a.indexOf(y);b!==-1?r[c]=u[b]:r[c]=l(y)}}return a.pop(),u.pop(),r}}return ke}var qs=$s();const Mu=Es(qs);Mu();var Qu=typeof global=="object"&&global&&global.Object===Object&&global,Is=typeof self=="object"&&self&&self.Object===Object&&self,O=Qu||Is||Function("return this")(),E=O.Symbol,Gu=Object.prototype,Us=Gu.hasOwnProperty,Vs=Gu.toString,po=E?E.toStringTag:void 0;function ih(i){var o=Us.call(i,po),e=i[po];try{i[po]=void 0;var n=!0}catch{}var a=Vs.call(i);return n&&(o?i[po]=e:delete i[po]),a}var oh=Object.prototype,eh=oh.toString;function nh(i){return eh.call(i)}var ah="[object Null]",uh="[object Undefined]",ha=E?E.toStringTag:void 0;function q(i){return i==null?i===void 0?uh:ah:ha&&ha in Object(i)?ih(i):nh(i)}function P(i){return i!=null&&typeof i=="object"}var gh="[object Symbol]";function ai(i){return typeof i=="symbol"||P(i)&&q(i)==gh}var dh=NaN;function ra(i){return typeof i=="number"?i:ai(i)?dh:+i}function N(i,o){for(var e=-1,n=i==null?0:i.length,a=Array(n);++e<n;)a[e]=o(i[e],e,i);return a}var L=Array.isArray,la=E?E.prototype:void 0,va=la?la.toString:void 0;function ui(i){if(typeof i=="string")return i;if(L(i))return N(i,ui)+"";if(ai(i))return va?va.call(i):"";var o=i+"";return o=="0"&&1/i==-1/0?"-0":o}function zo(i,o){return function(e,n){var a;if(e===void 0&&n===void 0)return o;if(e!==void 0&&(a=e),n!==void 0){if(a===void 0)return n;typeof e=="string"||typeof n=="string"?(e=ui(e),n=ui(n)):(e=ra(e),n=ra(n)),a=i(e,n)}return a}}var th=zo(function(i,o){return i+o},0),sh=/\s/;function xu(i){for(var o=i.length;o--&&sh.test(i.charAt(o)););return o}var hh=/^\s+/;function Nu(i){return i&&i.slice(0,xu(i)+1).replace(hh,"")}function W(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")}var ya=NaN,rh=/^[-+]0x[0-9a-f]+$/i,lh=/^0b[01]+$/i,vh=/^0o[0-7]+$/i,yh=parseInt;function si(i){if(typeof i=="number")return i;if(ai(i))return ya;if(W(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=W(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=Nu(i);var e=lh.test(i);return e||vh.test(i)?yh(i.slice(2),e?2:8):rh.test(i)?ya:+i}var ca=1/0,ch=17976931348623157e292;function Si(i){if(!i)return i===0?i:0;if(i=si(i),i===ca||i===-ca){var o=i<0?-1:1;return o*ch}return i===i?i:0}function S(i){var o=Si(i),e=o%1;return o===o?e?o-e:o:0}var bh="Expected a function";function ph(i,o){if(typeof o!="function")throw new TypeError(bh);return i=S(i),function(){if(--i<1)return o.apply(this,arguments)}}function oi(i){return i}var wh="[object AsyncFunction]",jh="[object Function]",mh="[object GeneratorFunction]",fh="[object Proxy]";function Ji(i){if(!W(i))return!1;var o=q(i);return o==jh||o==mh||o==wh||o==fh}var Wo=O["__core-js_shared__"],ba=(function(){var i=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function Yh(i){return!!ba&&ba in i}var kh=Function.prototype,Lh=kh.toString;function _i(i){if(i!=null){try{return Lh.call(i)}catch{}try{return i+""}catch{}}return""}var Zh=/[\\^$.*+?()[\]{}|]/g,Sh=/^\[object .+?Constructor\]$/,Jh=Function.prototype,Ch=Object.prototype,Xh=Jh.toString,Hh=Ch.hasOwnProperty,Dh=RegExp("^"+Xh.call(Hh).replace(Zh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wu(i){if(!W(i)||Yh(i))return!1;var o=Ji(i)?Dh:Sh;return o.test(_i(i))}function Th(i,o){return i?.[o]}function zi(i,o){var e=Th(i,o);return Wu(e)?e:void 0}var mo=zi(O,"WeakMap"),Ro=mo&&new mo,Pu=Ro?function(i,o){return Ro.set(i,o),i}:oi,pa=Object.create,no=(function(){function i(){}return function(o){if(!W(o))return{};if(pa)return pa(o);i.prototype=o;var e=new i;return i.prototype=void 0,e}})();function fo(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var e=no(i.prototype),n=i.apply(e,o);return W(n)?n:e}}var Bh=1;function Mh(i,o,e){var n=o&Bh,a=fo(i);function u(){var g=this&&this!==O&&this instanceof u?a:i;return g.apply(n?e:this,arguments)}return u}function gi(i,o,e){switch(e.length){case 0:return i.call(o);case 1:return i.call(o,e[0]);case 2:return i.call(o,e[0],e[1]);case 3:return i.call(o,e[0],e[1],e[2])}return i.apply(o,e)}var Qh=Math.max;function Fu(i,o,e,n){for(var a=-1,u=i.length,g=e.length,d=-1,h=o.length,s=Qh(u-g,0),l=Array(h+s),v=!n;++d<h;)l[d]=o[d];for(;++a<g;)(v||a<u)&&(l[e[a]]=i[a]);for(;s--;)l[d++]=i[a++];return l}var Gh=Math.max;function Ku(i,o,e,n){for(var a=-1,u=i.length,g=-1,d=e.length,h=-1,s=o.length,l=Gh(u-d,0),v=Array(l+s),r=!n;++a<l;)v[a]=i[a];for(var c=a;++h<s;)v[c+h]=o[h];for(;++g<d;)(r||a<u)&&(v[c+e[g]]=i[a++]);return v}function xh(i,o){for(var e=i.length,n=0;e--;)i[e]===o&&++n;return n}function Eo(){}var Nh=4294967295;function C(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Nh,this.__views__=[]}C.prototype=no(Eo.prototype);C.prototype.constructor=C;function Ue(){}var Ve=Ro?function(i){return Ro.get(i)}:Ue,Vi={},Wh=Object.prototype,Ph=Wh.hasOwnProperty;function Po(i){for(var o=i.name+"",e=Vi[o],n=Ph.call(Vi,o)?e.length:0;n--;){var a=e[n],u=a.func;if(u==null||u==i)return a.name}return o}function ri(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=void 0}ri.prototype=no(Eo.prototype);ri.prototype.constructor=ri;function V(i,o){var e=-1,n=i.length;for(o||(o=Array(n));++e<n;)o[e]=i[e];return o}function Ru(i){if(i instanceof C)return i.clone();var o=new ri(i.__wrapped__,i.__chain__);return o.__actions__=V(i.__actions__),o.__index__=i.__index__,o.__values__=i.__values__,o}var Fh=Object.prototype,Kh=Fh.hasOwnProperty;function t(i){if(P(i)&&!L(i)&&!(i instanceof C)){if(i instanceof ri)return i;if(Kh.call(i,"__wrapped__"))return Ru(i)}return new ri(i)}t.prototype=Eo.prototype;t.prototype.constructor=t;function Ge(i){var o=Po(i),e=t[o];if(typeof e!="function"||!(o in C.prototype))return!1;if(i===e)return!0;var n=Ve(e);return!!n&&i===n[0]}var Rh=800,Ah=16,Oh=Date.now;function Au(i){var o=0,e=0;return function(){var n=Oh(),a=Ah-(n-e);if(e=n,a>0){if(++o>=Rh)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}var Ou=Au(Pu),_h=/\{\n\/\* \[wrapped with (.+)\] \*/,zh=/,? & /;function Eh(i){var o=i.match(_h);return o?o[1].split(zh):[]}var $h=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function qh(i,o){var e=o.length;if(!e)return i;var n=e-1;return o[n]=(e>1?"& ":"")+o[n],o=o.join(e>2?", ":" "),i.replace($h,`{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{m as _}from"./index-
|
|
1
|
+
import{createRequire as m}from"node:module";import{m as _}from"./index-CE6MsgcV.js";import{a as F}from"./env-C2ZCnfP_.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
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as o}from"./index-CE6MsgcV.js";const r=async(s,a)=>await o(s,a);export{r as s};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{createRequire as Dr}from"node:module";const Ir=Dr(import.meta.url),Et=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pr=t=>{if(typeof Et<"u"&&Et.versions&&Et.versions.node){const[e,r]=Et.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Et.getBuiltinModule(t)}return Ir(t)},{createRequire:B}=Pr("node:module"),_e=0,Fr=4,Gr=Symbol("findUpStop"),tu=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g,Ur=/^[A-Z]:\//i,$t=(t="")=>t&&t.replaceAll("\\","/").replace(Ur,e=>e.toUpperCase()),jr=/^[/\\]{2}/,zr=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,cr=/^[A-Z]:$/i,Le=/^\/([A-Z]:)?$/i,Wr=/.(\.[^./]+)$/,qr=/^[/\\]|^[a-z]:[/\\]/i,Kr=/\/$/,Xr=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",eu="/",pr=(t,e)=>{let r="",o=0,n=-1,s=0,i;for(let u=0;u<=t.length;++u){if(u<t.length)i=t[u];else{if(i==="/")break;i="/"}if(i==="/"){if(!(n===u-1||s===1))if(s===2){if(r.length<2||o!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const a=r.lastIndexOf("/");a===-1?(r="",o=0):(r=r.slice(0,a),o=r.length-1-r.lastIndexOf("/")),n=u,s=0;continue}else if(r.length>0){r="",o=0,n=u,s=0;continue}}e&&(r+=r.length>0?"/..":"..",o=2)}else r.length>0?r+=`/${t.slice(n+1,u)}`:r=t.slice(n+1,u),o=u-n-1;n=u,s=0}else i==="."&&s!==-1?++s:s=-1}return r},bt=t=>zr.test(t),ae=function(t){if(t.length===0)return".";t=$t(t);const e=jr.exec(t),r=bt(t),o=t.at(-1)==="/";return t=pr(t,!r),t.length===0?r?"/":o?"./":".":(o&&(t+="/"),cr.test(t)&&(t+="/"),e?r?`//${t}`:`//./${t}`:r&&!bt(t)?`/${t}`:t)},Qr=(...t)=>{let e="";for(const r of t)if(r)if(e.length>0){const o=e.at(-1)==="/",n=r[0]==="/";o&&n?e+=r.slice(1):e+=o||n?r:`/${r}`}else e+=r;return ae(e)},vt=function(...t){t=t.map(o=>$t(o));let e="",r=!1;for(let o=t.length-1;o>=-1&&!r;o--){const n=o>=0?t[o]:Xr();!n||n.length===0||(e=`${n}/${e}`,r=bt(n))}return e=pr(e,!r),r&&!bt(e)?`/${e}`:e.length>0?e:"."},ru=function(t){return $t(t)},Zr=function(t){return Wr.exec($t(t))?.[1]??""},su=function(t,e){const r=vt(t).replace(Le,"$1").split("/"),o=vt(e).replace(Le,"$1").split("/");if(o[0][1]===":"&&r[0][1]===":"&&r[0]!==o[0])return o.join("/");const n=Math.min(r.length,o.length);let s=0;for(;s<n&&r[s]===o[s];)s+=1;const i=r.length-s;return[...Array.from({length:i}).fill(".."),...o.slice(s)].join("/")},ke=t=>{const e=$t(t).replace(Kr,""),r=e.lastIndexOf("/");if(r===-1)return bt(t)?"/":".";const o=e.slice(0,r);return cr.test(o)?`${o}/`:o||(bt(t)?"/":".")},fr=(t,e)=>{const r=$t(t),o=r.slice(r.lastIndexOf("/")+1);if(e&&o.endsWith(e)){if(e===r)return"";const n=o.slice(0,-e.length);if(n.length>0)return n}return o},Yr=function(t){const e=qr.exec(t)?.[0]?.replaceAll("\\","/")??"",r=fr(t),o=Zr(r);return{base:r,dir:ke(t),ext:o,name:r.slice(0,r.length-o.length),root:e}},Vr=B(import.meta.url),xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jr=t=>{if(typeof xt<"u"&&xt.versions&&xt.versions.node){const[e,r]=xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return xt.getBuiltinModule(t)}return Vr(t)},{fileURLToPath:ts}=Jr("node:url");function es(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var He,Be;function rs(){return Be||(Be=1,He=["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"]),He}var ss=rs();const os=es(ss);new Set(os);const ns=/^(?:\.?\.[/\\]|\.\.\B)/,ou=t=>ns.test(t)||t==="..",ct=t=>$t(t instanceof URL?ts(t):t);let is=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 pt=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")},us=B(import.meta.url),At=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ls=t=>{if(typeof At<"u"&&At.versions&&At.versions.node){const[e,r]=At.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return At.getBuiltinModule(t)}return us(t)};ls("node:fs/promises");const as=B(import.meta.url),St=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cs=t=>{if(typeof St<"u"&&St.versions&&St.versions.node){const[e,r]=St.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return St.getBuiltinModule(t)}return as(t)};cs("node:fs");const ce=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"},ps=B(import.meta.url),wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fs=t=>{if(typeof wt<"u"&&wt.versions&&wt.versions.node){const[e,r]=wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return wt.getBuiltinModule(t)}return ps(t)},{lstat:Me,mkdir:hs}=fs("node:fs/promises"),iu=async t=>{pt(t);try{const e=await Me(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(ce(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await hs(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await Me(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(ce(r))}'`,{cause:e})}},gs=B(import.meta.url),Rt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ds=t=>{if(typeof Rt<"u"&&Rt.versions&&Rt.versions.node){const[e,r]=Rt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Rt.getBuiltinModule(t)}return gs(t)},{lstatSync:De,mkdirSync:ys}=ds("node:fs"),uu=t=>{pt(t);try{const e=De(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(ce(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{ys(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=De(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(ce(r))}'`,{cause:e})}},ms=B(import.meta.url),Tt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bs=t=>{if(typeof Tt<"u"&&Tt.versions&&Tt.versions.node){const[e,r]=Tt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Tt.getBuiltinModule(t)}return ms(t)};bs("node:fs/promises");const $s=B(import.meta.url),_t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vs=t=>{if(typeof _t<"u"&&_t.versions&&_t.versions.node){const[e,r]=_t.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return _t.getBuiltinModule(t)}return $s(t)};vs("node:fs");const Es=B(import.meta.url),kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xs=t=>{if(typeof kt<"u"&&kt.versions&&kt.versions.node){const[e,r]=kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return kt.getBuiltinModule(t)}return Es(t)};xs("node:fs/promises");const As=B(import.meta.url),Ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ss=t=>{if(typeof Ct<"u"&&Ct.versions&&Ct.versions.node){const[e,r]=Ct.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ct.getBuiltinModule(t)}return As(t)};Ss("node:fs");const ws=B(import.meta.url),Ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rs=t=>{if(typeof Ot<"u"&&Ot.versions&&Ot.versions.node){const[e,r]=Ot.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ot.getBuiltinModule(t)}return ws(t)};Rs("node:fs/promises");const Ts=B(import.meta.url),Nt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_s=t=>{if(typeof Nt<"u"&&Nt.versions&&Nt.versions.node){const[e,r]=Nt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Nt.getBuiltinModule(t)}return Ts(t)};_s("node:fs");B(import.meta.url);let Ie=class extends Error{root;constructor(e,r){super(`${e instanceof Error?e.message:String(e)} for path "${r}"`),this.cause=e,this.root=r}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const Pe=t=>{const e=t.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(r){throw new Error(`Invalid glob pattern: ${t}`,{cause:r})}};let ks=class{name;path;#t;constructor(e,r,o){this.#t=e,this.name=r,this.path=o}isDirectory(){return this.#t.isDirectory()}isFile(){return this.#t.isFile()}isSymbolicLink(){return this.#t.isSymbolicLink()}};const we=(t,e,r)=>new ks(t,e,r),le=(t,e,r,o)=>{if(Array.isArray(e)&&e.length>0&&!e.some(s=>t.endsWith(s)))return!1;const n=t.includes("\\")?t.replaceAll("\\","/"):t;return r&&!r.some(s=>s.test(n))?!1:!o?.some(s=>s.test(n))},Cs=B(import.meta.url),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Os=t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,r]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Lt.getBuiltinModule(t)}return Cs(t)};Os("node:fs/promises");const Ns=B(import.meta.url),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ls=t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,r]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ht.getBuiltinModule(t)}return Ns(t)},{readdirSync:Hs,realpathSync:Bs,statSync:hr}=Ls("node:fs"),Ms=t=>{const e=ae(t),r=hr(e);return we(r,fr(e),e)};function*Ds(t,e={}){const{extensions:r,followSymlinks:o=!1,includeDirs:n=!0,includeFiles:s=!0,includeSymlinks:i=!0,match:u,maxDepth:a=Number.POSITIVE_INFINITY,skip:b}=e;if(pt(t),a<0)return;const h=e.visited??new Set,y=u?u.map(g=>typeof g=="string"?Pe(g):g):void 0,x=b?b.map(g=>typeof g=="string"?Pe(g):g):void 0;if(t=vt(ct(t)),n&&le(t,r,y,x)&&(yield Ms(t)),!(a<1||!le(t,void 0,void 0,x)))try{const g=Hs(t,{withFileTypes:!0});for(const $ of g){let _=Qr(t,$.name),R=$.isDirectory(),O=$.isFile();if($.isSymbolicLink())if(o){const d=Bs(_);if(h.has(d))continue;_=d;const E=hr(d);R=E.isDirectory(),O=E.isFile()}else if(i&&le(_,r,y,x)){yield we($,$.name,ae(_));continue}else continue;R?(o&&h.add(_),yield*Ds(_,{extensions:r,followSymlinks:o,includeDirs:n,includeFiles:s,includeSymlinks:i,match:y,maxDepth:a-1,skip:x,visited:h})):O&&s&&le(_,r,y,x)&&(yield we($,$.name,ae(_)))}}catch(g){throw g instanceof Ie?g:new Ie(g,t)}}const Is=B(import.meta.url),Bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=t=>{if(typeof Bt<"u"&&Bt.versions&&Bt.versions.node){const[e,r]=Bt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Bt.getBuiltinModule(t)}return Is(t)};Ps("node:fs/promises");const Fs=B(import.meta.url),Mt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gs=t=>{if(typeof Mt<"u"&&Mt.versions&&Mt.versions.node){const[e,r]=Mt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Mt.getBuiltinModule(t)}return Fs(t)},{statSync:Us,lstatSync:js}=Gs("node:fs"),cu=(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=e.cwd?ct(e.cwd):process.cwd();let o=vt(r);const{root:n}=Yr(o),s=ct(e.stopAt??n),i=vt(o,s),u=e.type??"file",a=function(h){return typeof t=="function"?[t(h)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const b=e.allowSymlinks?Us:js;for(;o&&o!==i&&o!==n;){for(let h of a(o)){if(h===Gr)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=ct(h));const y=bt(h)?h:vt(o,h);try{const x=b(y);if(u==="file"&&x.isFile()||u==="directory"&&x.isDirectory())return y}catch{}}o=ke(o)}};function Ce(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fe={},ge,Ge;function pe(){if(Ge)return ge;Ge=1;const t="[^\\\\/]",e=Symbol("unignore"),r="\\.",o="\\+",n="\\?",s="\\/",i="(?=.)",u="[^/]",a=`(?:${s}|$)`,b=`(?:^|${s})`,h=`${r}{1,2}${a}`,y=`(?!${r})`,x=`(?!${b}${h})`,g=`(?!${r}{0,1}${a})`,$=`(?!${h})`,_=`[^.${s}]`,R=`${u}*?`,O="/",d={DOT_LITERAL:r,PLUS_LITERAL:o,QMARK_LITERAL:n,SLASH_LITERAL:s,ONE_CHAR:i,QMARK:u,END_ANCHOR:a,DOTS_SLASH:h,NO_DOT:y,NO_DOTS:x,NO_DOT_SLASH:g,NO_DOTS_SLASH:$,QMARK_NO_DOT:_,STAR:R,START_ANCHOR:b,SEP:O},E={...d,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},l={__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 ge={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:l,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?E:d}},ge}var Ue;function fe(){return Ue||(Ue=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:n}=pe();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>o.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(n,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(r,i=>i==="\\"?"":i),t.escapeLast=(s,i,u)=>{const a=s.lastIndexOf(i,u);return a===-1?s:s[a-1]==="\\"?t.escapeLast(s,i,a-1):`${s.slice(0,a)}\\${s.slice(a)}`},t.removePrefix=(s,i={})=>{let u=s;return u.startsWith("./")&&(u=u.slice(2),i.prefix="./"),u},t.wrapOutput=(s,i={},u={})=>{const a=u.contains?"":"^",b=u.contains?"":"$";let h=`${a}(?:${s})${b}`;return i.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},t.basename=(s,{windows:i}={})=>{const u=s.split(i?/[\\/]/:"/"),a=u[u.length-1];return a===""?u[u.length-2]:a}})(Fe)),Fe}var de,je;function zs(){if(je)return de;je=1;const t=fe(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:n,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:a,CHAR_LEFT_PARENTHESES:b,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:y,CHAR_QUESTION_MARK:x,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:$,CHAR_RIGHT_SQUARE_BRACKET:_}=pe(),R=d=>d===u||d===o,O=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return de=(d,E)=>{const l=E||{},A=d.length-1,w=l.parts===!0||l.scanToEnd===!0,T=[],S=[],k=[];let F=d,D=-1,U=0,rt=0,Z=!1,st=!1,j=!1,lt=!1,gt=!1,ot=!1,P=!1,nt=!1,dt=!1,Y=!1,Q=0,J,C,H={value:"",depth:0,isGlob:!1};const f=()=>D>=A,V=()=>F.charCodeAt(D+1),K=()=>(J=C,F.charCodeAt(++D));for(;D<A;){C=K();let M;if(C===o){P=H.backslashes=!0,C=K(),C===a&&(ot=!0);continue}if(ot===!0||C===a){for(Q++;f()!==!0&&(C=K());){if(C===o){P=H.backslashes=!0,K();continue}if(C===a){Q++;continue}if(ot!==!0&&C===s&&(C=K())===s){if(Z=H.isBrace=!0,j=H.isGlob=!0,Y=!0,w===!0)continue;break}if(ot!==!0&&C===n){if(Z=H.isBrace=!0,j=H.isGlob=!0,Y=!0,w===!0)continue;break}if(C===g&&(Q--,Q===0)){ot=!1,Z=H.isBrace=!0,Y=!0;break}}if(w===!0)continue;break}if(C===u){if(T.push(D),S.push(H),H={value:"",depth:0,isGlob:!1},Y===!0)continue;if(J===s&&D===U+1){U+=2;continue}rt=D+1;continue}if(l.noext!==!0&&(C===y||C===r||C===e||C===x||C===i)&&V()===b){if(j=H.isGlob=!0,lt=H.isExtglob=!0,Y=!0,C===i&&D===U&&(dt=!0),w===!0){for(;f()!==!0&&(C=K());){if(C===o){P=H.backslashes=!0,C=K();continue}if(C===$){j=H.isGlob=!0,Y=!0;break}}continue}break}if(C===e){if(J===e&&(gt=H.isGlobstar=!0),j=H.isGlob=!0,Y=!0,w===!0)continue;break}if(C===x){if(j=H.isGlob=!0,Y=!0,w===!0)continue;break}if(C===h){for(;f()!==!0&&(M=K());){if(M===o){P=H.backslashes=!0,K();continue}if(M===_){st=H.isBracket=!0,j=H.isGlob=!0,Y=!0;break}}if(w===!0)continue;break}if(l.nonegate!==!0&&C===i&&D===U){nt=H.negated=!0,U++;continue}if(l.noparen!==!0&&C===b){if(j=H.isGlob=!0,w===!0){for(;f()!==!0&&(C=K());){if(C===b){P=H.backslashes=!0,C=K();continue}if(C===$){Y=!0;break}}continue}break}if(j===!0){if(Y=!0,w===!0)continue;break}}l.noext===!0&&(lt=!1,j=!1);let q=F,c="",p="";U>0&&(c=F.slice(0,U),F=F.slice(U),rt-=U),q&&j===!0&&rt>0?(q=F.slice(0,rt),p=F.slice(rt)):j===!0?(q="",p=F):q=F,q&&q!==""&&q!=="/"&&q!==F&&R(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),l.unescape===!0&&(p&&(p=t.removeBackslashes(p)),q&&P===!0&&(q=t.removeBackslashes(q)));const et={prefix:c,input:d,start:U,base:q,glob:p,isBrace:Z,isBracket:st,isGlob:j,isExtglob:lt,isGlobstar:gt,negated:nt,negatedExtglob:dt};if(l.tokens===!0&&(et.maxDepth=0,R(C)||S.push(H),et.tokens=S),l.parts===!0||l.tokens===!0){let M;for(let z=0;z<T.length;z++){const at=M?M+1:U,tt=T[z],ft=d.slice(at,tt);l.tokens&&(z===0&&U!==0?(S[z].isPrefix=!0,S[z].value=c):S[z].value=ft,O(S[z]),et.maxDepth+=S[z].depth),(z!==0||ft!=="")&&k.push(ft),M=tt}if(M&&M+1<d.length){const z=d.slice(M+1);k.push(z),l.tokens&&(S[S.length-1].value=z,O(S[S.length-1]),et.maxDepth+=S[S.length-1].depth)}et.slashes=T,et.parts=k}return et},de}var ye,ze;function Ws(){if(ze)return ye;ze=1;const t=pe(),e=fe(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:i}=t,u=(d,E)=>typeof E.expandRange=="function"?E.expandRange(...d,E):(d.sort(),`[${d.join("-")}]`),a=(d,E)=>`Missing ${d}: "${E}" - use "\\\\${E}" to match literal characters`,b=d=>{const E=[];let l=0,A=0,w=0,T="",S=!1;for(const k of d){if(S===!0){T+=k,S=!1;continue}if(k==="\\"){T+=k,S=!0;continue}if(k==='"'){w=w===1?0:1,T+=k;continue}if(w===0){if(k==="[")l++;else if(k==="]"&&l>0)l--;else if(l===0){if(k==="(")A++;else if(k===")"&&A>0)A--;else if(k==="|"&&A===0){E.push(T),T="";continue}}}T+=k}return E.push(T),E},h=d=>{let E=!1;for(const l of d){if(E===!0){E=!1;continue}if(l==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(l))return!1}return!0},y=d=>{let E=d.trim(),l=!0;for(;l===!0;)l=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),l=!0);if(h(E))return E.replace(/\\(.)/g,"$1")},x=d=>{const E=d.map(y).filter(Boolean);for(let l=0;l<E.length;l++)for(let A=l+1;A<E.length;A++){const w=E[l],T=E[A],S=w[0];if(!(!S||w!==S.repeat(w.length)||T!==S.repeat(T.length))&&(w===T||w.startsWith(T)||T.startsWith(w)))return!0}return!1},g=(d,E=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let l=0,A=0,w=0,T=!1;for(let S=1;S<d.length;S++){const k=d[S];if(T===!0){T=!1;continue}if(k==="\\"){T=!0;continue}if(k==='"'){w=w===1?0:1;continue}if(w!==1){if(k==="["){l++;continue}if(k==="]"&&l>0){l--;continue}if(!(l>0)){if(k==="("){A++;continue}if(k===")"&&(A--,A===0))return E===!0&&S!==d.length-1?void 0:{type:d[0],body:d.slice(2,S),end:S}}}}},$=d=>{let E=0;const l=[];for(;E<d.length;){const A=g(d.slice(E),!1);if(!A||A.type!=="*")return;const w=b(A.body).map(S=>S.trim());if(w.length!==1)return;const T=y(w[0]);if(!T||T.length!==1)return;l.push(T),E+=A.end+1}return l.length<1?void 0:`${l.length===1?e.escapeRegex(l[0]):`[${l.map(A=>e.escapeRegex(A)).join("")}]`}*`},_=d=>{let E=0,l=d.trim(),A=g(l);for(;A;)E++,l=A.body.trim(),A=g(l);return E},R=(d,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const l=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,A=b(d).map(w=>w.trim());if(A.length>1&&(A.some(w=>w==="")||A.some(w=>/^[*?]+$/.test(w))||x(A)))return{risky:!0};for(const w of A){const T=$(w);if(T)return{risky:!0,safeOutput:T};if(_(w)>l)return{risky:!0}}return{risky:!1}},O=(d,E)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=i[d]||d;const l={...E},A=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r;let w=d.length;if(w>A)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${A}`);const T={type:"bos",value:"",output:l.prepend||""},S=[T],k=l.capture?"":"?:",F=t.globChars(l.windows),D=t.extglobChars(F),{DOT_LITERAL:U,PLUS_LITERAL:rt,SLASH_LITERAL:Z,ONE_CHAR:st,DOTS_SLASH:j,NO_DOT:lt,NO_DOT_SLASH:gt,NO_DOTS_SLASH:ot,QMARK:P,QMARK_NO_DOT:nt,STAR:dt,START_ANCHOR:Y}=F,Q=v=>`(${k}(?:(?!${Y}${v.dot?j:U}).)*?)`,J=l.dot?"":lt,C=l.dot?P:nt;let H=l.bash===!0?Q(l):dt;l.capture&&(H=`(${H})`),typeof l.noext=="boolean"&&(l.noextglob=l.noext);const f={input:d,index:-1,start:0,dot:l.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:S};d=e.removePrefix(d,f),w=d.length;const V=[],K=[],q=[];let c=T,p;const et=()=>f.index===w-1,M=f.peek=(v=1)=>d[f.index+v],z=f.advance=()=>d[++f.index]||"",at=()=>d.slice(f.index+1),tt=(v="",G=0)=>{f.consumed+=v,f.index+=G},ft=v=>{f.output+=v.output!=null?v.output:v.value,tt(v.value)},Br=()=>{let v=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)z(),f.start++,v++;return v%2===0?!1:(f.negated=!0,f.start++,!0)},ie=v=>{f[v]++,q.push(v)},ht=v=>{f[v]--,q.pop()},N=v=>{if(c.type==="globstar"){const G=f.braces>0&&(v.type==="comma"||v.type==="brace"),m=v.extglob===!0||V.length&&(v.type==="pipe"||v.type==="paren");v.type!=="slash"&&v.type!=="paren"&&!G&&!m&&(f.output=f.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=H,f.output+=c.output)}if(V.length&&v.type!=="paren"&&(V[V.length-1].inner+=v.value),(v.value||v.output)&&ft(v),c&&c.type==="text"&&v.type==="text"){c.output=(c.output||c.value)+v.value,c.value+=v.value;return}v.prev=c,S.push(v),c=v},ue=(v,G)=>{const m={...D[G],conditions:1,inner:""};m.prev=c,m.parens=f.parens,m.output=f.output,m.startIndex=f.index,m.tokensIndex=S.length;const L=(l.capture?"(":"")+m.open;ie("parens"),N({type:v,value:G,output:f.output?"":st}),N({type:"paren",extglob:!0,value:z(),output:L}),V.push(m)},Mr=v=>{const G=d.slice(v.startIndex,f.index+1),m=d.slice(v.startIndex+2,f.index),L=R(m,l);if((v.type==="plus"||v.type==="star")&&L.risky){const I=L.safeOutput?(v.output?"":st)+(l.capture?`(${L.safeOutput})`:L.safeOutput):void 0,it=S[v.tokensIndex];it.type="text",it.value=G,it.output=I||e.escapeRegex(G);for(let ut=v.tokensIndex+1;ut<S.length;ut++)S[ut].value="",S[ut].output="",delete S[ut].suffix;f.output=v.output+it.output,f.backtrack=!0,N({type:"paren",extglob:!0,value:p,output:""}),ht("parens");return}let W=v.close+(l.capture?")":""),X;if(v.type==="negate"){let I=H;if(v.inner&&v.inner.length>1&&v.inner.includes("/")&&(I=Q(l)),(I!==H||et()||/^\)+$/.test(at()))&&(W=v.close=`)$))${I}`),v.inner.includes("*")&&(X=at())&&/^\.[^\\/.]+$/.test(X)){const it=O(X,{...E,fastpaths:!1}).output;W=v.close=`)${it})${I})`}v.prev.type==="bos"&&(f.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:p,output:W}),ht("parens")};if(l.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let v=!1,G=d.replace(s,(m,L,W,X,I,it)=>X==="\\"?(v=!0,m):X==="?"?L?L+X+(I?P.repeat(I.length):""):it===0?C+(I?P.repeat(I.length):""):P.repeat(W.length):X==="."?U.repeat(W.length):X==="*"?L?L+X+(I?H:""):H:L?m:`\\${m}`);return v===!0&&(l.unescape===!0?G=G.replace(/\\/g,""):G=G.replace(/\\+/g,m=>m.length%2===0?"\\\\":m?"\\":"")),G===d&&l.contains===!0?(f.output=d,f):(f.output=e.wrapOutput(G,f,E),f)}for(;!et();){if(p=z(),p==="\0")continue;if(p==="\\"){const m=M();if(m==="/"&&l.bash!==!0||m==="."||m===";")continue;if(!m){p+="\\",N({type:"text",value:p});continue}const L=/^\\+/.exec(at());let W=0;if(L&&L[0].length>2&&(W=L[0].length,f.index+=W,W%2!==0&&(p+="\\")),l.unescape===!0?p=z():p+=z(),f.brackets===0){N({type:"text",value:p});continue}}if(f.brackets>0&&(p!=="]"||c.value==="["||c.value==="[^")){if(l.posix!==!1&&p===":"){const m=c.value.slice(1);if(m.includes("[")&&(c.posix=!0,m.includes(":"))){const L=c.value.lastIndexOf("["),W=c.value.slice(0,L),X=c.value.slice(L+2),I=o[X];if(I){c.value=W+I,f.backtrack=!0,z(),!T.output&&S.indexOf(c)===1&&(T.output=st);continue}}}(p==="["&&M()!==":"||p==="-"&&M()==="]")&&(p=`\\${p}`),p==="]"&&(c.value==="["||c.value==="[^")&&(p=`\\${p}`),l.posix===!0&&p==="!"&&c.value==="["&&(p="^"),c.value+=p,ft({value:p});continue}if(f.quotes===1&&p!=='"'){p=e.escapeRegex(p),c.value+=p,ft({value:p});continue}if(p==='"'){f.quotes=f.quotes===1?0:1,l.keepQuotes===!0&&N({type:"text",value:p});continue}if(p==="("){ie("parens"),N({type:"paren",value:p});continue}if(p===")"){if(f.parens===0&&l.strictBrackets===!0)throw new SyntaxError(a("opening","("));const m=V[V.length-1];if(m&&f.parens===m.parens+1){Mr(V.pop());continue}N({type:"paren",value:p,output:f.parens?")":"\\)"}),ht("parens");continue}if(p==="["){if(l.nobracket===!0||!at().includes("]")){if(l.nobracket!==!0&&l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));p=`\\${p}`}else ie("brackets");N({type:"bracket",value:p});continue}if(p==="]"){if(l.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){N({type:"text",value:p,output:`\\${p}`});continue}if(f.brackets===0){if(l.strictBrackets===!0)throw new SyntaxError(a("opening","["));N({type:"text",value:p,output:`\\${p}`});continue}ht("brackets");const m=c.value.slice(1);if(c.posix!==!0&&m[0]==="^"&&!m.includes("/")&&(p=`/${p}`),c.value+=p,ft({value:p}),l.literalBrackets===!1||e.hasRegexChars(m))continue;const L=e.escapeRegex(c.value);if(f.output=f.output.slice(0,-c.value.length),l.literalBrackets===!0){f.output+=L,c.value=L;continue}c.value=`(${k}${L}|${c.value})`,f.output+=c.value;continue}if(p==="{"&&l.nobrace!==!0){ie("braces");const m={type:"brace",value:p,output:"(",outputIndex:f.output.length,tokensIndex:f.tokens.length};K.push(m),N(m);continue}if(p==="}"){const m=K[K.length-1];if(l.nobrace===!0||!m){N({type:"text",value:p,output:p});continue}let L=")";if(m.dots===!0){const W=S.slice(),X=[];for(let I=W.length-1;I>=0&&(S.pop(),W[I].type!=="brace");I--)W[I].type!=="dots"&&X.unshift(W[I].value);L=u(X,l),f.backtrack=!0}if(m.comma!==!0&&m.dots!==!0){const W=f.output.slice(0,m.outputIndex),X=f.tokens.slice(m.tokensIndex);m.value=m.output="\\{",p=L="\\}",f.output=W;for(const I of X)f.output+=I.output||I.value}N({type:"brace",value:p,output:L}),ht("braces"),K.pop();continue}if(p==="|"){V.length>0&&V[V.length-1].conditions++,N({type:"text",value:p});continue}if(p===","){let m=p;const L=K[K.length-1];L&&q[q.length-1]==="braces"&&(L.comma=!0,m="|"),N({type:"comma",value:p,output:m});continue}if(p==="/"){if(c.type==="dot"&&f.index===f.start+1){f.start=f.index+1,f.consumed="",f.output="",S.pop(),c=T;continue}N({type:"slash",value:p,output:Z});continue}if(p==="."){if(f.braces>0&&c.type==="dot"){c.value==="."&&(c.output=U);const m=K[K.length-1];c.type="dots",c.output+=p,c.value+=p,m.dots=!0;continue}if(f.braces+f.parens===0&&c.type!=="bos"&&c.type!=="slash"){N({type:"text",value:p,output:U});continue}N({type:"dot",value:p,output:U});continue}if(p==="?"){if(!(c&&c.value==="(")&&l.noextglob!==!0&&M()==="("&&M(2)!=="?"){ue("qmark",p);continue}if(c&&c.type==="paren"){const m=M();let L=p;(c.value==="("&&!/[!=<:]/.test(m)||m==="<"&&!/<([!=]|\w+>)/.test(at()))&&(L=`\\${p}`),N({type:"text",value:p,output:L});continue}if(l.dot!==!0&&(c.type==="slash"||c.type==="bos")){N({type:"qmark",value:p,output:nt});continue}N({type:"qmark",value:p,output:P});continue}if(p==="!"){if(l.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){ue("negate",p);continue}if(l.nonegate!==!0&&f.index===0){Br();continue}}if(p==="+"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){ue("plus",p);continue}if(c&&c.value==="("||l.regex===!1){N({type:"plus",value:p,output:rt});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||f.parens>0){N({type:"plus",value:p});continue}N({type:"plus",value:rt});continue}if(p==="@"){if(l.noextglob!==!0&&M()==="("&&M(2)!=="?"){N({type:"at",extglob:!0,value:p,output:""});continue}N({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);const m=n.exec(at());m&&(p+=m[0],f.index+=m[0].length),N({type:"text",value:p});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=p,c.output=H,f.backtrack=!0,f.globstar=!0,tt(p);continue}let v=at();if(l.noextglob!==!0&&/^\([^?]/.test(v)){ue("star",p);continue}if(c.type==="star"){if(l.noglobstar===!0){tt(p);continue}const m=c.prev,L=m.prev,W=m.type==="slash"||m.type==="bos",X=L&&(L.type==="star"||L.type==="globstar");if(l.bash===!0&&(!W||v[0]&&v[0]!=="/")){N({type:"star",value:p,output:""});continue}const I=f.braces>0&&(m.type==="comma"||m.type==="brace"),it=V.length&&(m.type==="pipe"||m.type==="paren");if(!W&&m.type!=="paren"&&!I&&!it){N({type:"star",value:p,output:""});continue}for(;v.slice(0,3)==="/**";){const ut=d[f.index+4];if(ut&&ut!=="/")break;v=v.slice(3),tt("/**",3)}if(m.type==="bos"&&et()){c.type="globstar",c.value+=p,c.output=Q(l),f.output=c.output,f.globstar=!0,tt(p);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&!X&&et()){f.output=f.output.slice(0,-(m.output+c.output).length),m.output=`(?:${m.output}`,c.type="globstar",c.output=Q(l)+(l.strictSlashes?")":"|$)"),c.value+=p,f.globstar=!0,f.output+=m.output+c.output,tt(p);continue}if(m.type==="slash"&&m.prev.type!=="bos"&&v[0]==="/"){const ut=v[1]!==void 0?"|$":"";f.output=f.output.slice(0,-(m.output+c.output).length),m.output=`(?:${m.output}`,c.type="globstar",c.output=`${Q(l)}${Z}|${Z}${ut})`,c.value+=p,f.output+=m.output+c.output,f.globstar=!0,tt(p+z()),N({type:"slash",value:"/",output:""});continue}if(m.type==="bos"&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${Z}|${Q(l)}${Z})`,f.output=c.output,f.globstar=!0,tt(p+z()),N({type:"slash",value:"/",output:""});continue}if(I&&v[0]==="/"){c.type="globstar",c.value+=p,c.output=`(?:^|${Z}|${Q(l)}${Z})`,f.output+=c.output,f.globstar=!0,tt(p+z()),N({type:"slash",value:"/",output:""});continue}f.output=f.output.slice(0,-c.output.length),c.type="globstar",c.output=Q(l),c.value+=p,f.output+=c.output,f.globstar=!0,tt(p);continue}const G={type:"star",value:p,output:H};if(l.bash===!0){G.output=".*?",(c.type==="bos"||c.type==="slash")&&(G.output=J+G.output),N(G);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&l.regex===!0){G.output=p,N(G);continue}(f.index===f.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(f.output+=gt,c.output+=gt):l.dot===!0?(f.output+=ot,c.output+=ot):(f.output+=J,c.output+=J),M()!=="*"&&(f.output+=st,c.output+=st)),N(G)}for(;f.brackets>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","]"));f.output=e.escapeLast(f.output,"["),ht("brackets")}for(;f.parens>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing",")"));f.output=e.escapeLast(f.output,"("),ht("parens")}for(;f.braces>0;){if(l.strictBrackets===!0)throw new SyntaxError(a("closing","}"));f.output=e.escapeLast(f.output,"{"),ht("braces")}if(l.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${Z}?`}),f.backtrack===!0){f.output="";for(const v of f.tokens)f.output+=v.output!=null?v.output:v.value,v.suffix&&(f.output+=v.suffix)}return f};return O.fastpaths=(d,E)=>{const l={...E},A=typeof l.maxLength=="number"?Math.min(r,l.maxLength):r,w=d.length;if(w>A)throw new SyntaxError(`Input length: ${w}, exceeds maximum allowed length: ${A}`);d=i[d]||d;const{DOT_LITERAL:T,SLASH_LITERAL:S,ONE_CHAR:k,DOTS_SLASH:F,NO_DOT:D,NO_DOTS:U,NO_DOTS_SLASH:rt,STAR:Z,START_ANCHOR:st}=t.globChars(l.windows),j=l.dot?U:D,lt=l.dot?rt:D,gt=l.capture?"":"?:",ot={negated:!1,prefix:""};let P=l.bash===!0?".*?":Z;l.capture&&(P=`(${P})`);const nt=J=>J.noglobstar===!0?P:`(${gt}(?:(?!${st}${J.dot?F:T}).)*?)`,dt=J=>{switch(J){case"*":return`${j}${k}${P}`;case".*":return`${T}${k}${P}`;case"*.*":return`${j}${P}${T}${k}${P}`;case"*/*":return`${j}${P}${S}${k}${lt}${P}`;case"**":return j+nt(l);case"**/*":return`(?:${j}${nt(l)}${S})?${lt}${k}${P}`;case"**/*.*":return`(?:${j}${nt(l)}${S})?${lt}${P}${T}${k}${P}`;case"**/.*":return`(?:${j}${nt(l)}${S})?${T}${k}${P}`;default:{const C=/^(.*?)\.(\w+)$/.exec(J);if(!C)return;const H=dt(C[1]);return H?H+T+C[2]:void 0}}},Y=e.removePrefix(d,ot);let Q=dt(Y);return Q&&l.strictSlashes!==!0&&(Q+=`${S}?`),Q},ye=O,ye}var me,We;function qs(){if(We)return me;We=1;const t=zs(),e=Ws(),r=fe(),o=pe(),n=i=>i&&typeof i=="object"&&!Array.isArray(i),s=(i,u,a=!1)=>{if(Array.isArray(i)){const R=i.map(O=>s(O,u,a));return O=>{for(const d of R){const E=d(O);if(E)return E}return!1}}const b=n(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!b)throw new TypeError("Expected pattern to be a non-empty string");const h=u||{},y=h.windows,x=b?s.compileRe(i,u):s.makeRe(i,u,!1,!0),g=x.state;delete x.state;let $=()=>!1;if(h.ignore){const R={...u,ignore:null,onMatch:null,onResult:null};$=s(h.ignore,R,a)}const _=(R,O=!1)=>{const{isMatch:d,match:E,output:l}=s.test(R,x,u,{glob:i,posix:y}),A={glob:i,state:g,regex:x,posix:y,input:R,output:l,match:E,isMatch:d};if(typeof h.onResult=="function"&&h.onResult(A),d===!1)return A.isMatch=!1,O?A:!1;t:if($(R)){if(typeof h.onIgnore=="function"&&h.onIgnore(A)===o.UNIGNORE){A.isMatch=!0;break t}return A.isMatch=!1,O?A:!1}return typeof h.onMatch=="function"&&h.onMatch(A),O?A:!0};return a&&(_.state=g),_};return s.test=(i,u,a,{glob:b,posix:h}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const y=a||{},x=y.format||(h?r.toPosixSlashes:null);let g=i===b,$=g&&x?x(i):i;return g===!1&&($=x?x(i):i,g=$===b),(g===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?g=s.matchBase(i,u,a,h):g=u.exec($)),{isMatch:!!g,match:g,output:$}},s.matchBase=(i,u,a)=>(u instanceof RegExp?u:s.makeRe(u,a)).test(r.basename(i)),s.isMatch=(i,u,a)=>s(u,a)(i),s.parse=(i,u)=>Array.isArray(i)?i.map(a=>s.parse(a,u)):e(i,{...u,fastpaths:!1}),s.scan=(i,u)=>t(i,u),s.compileRe=(i,u,a=!1,b=!1)=>{if(a===!0)return i.output;const h=u||{},y=h.contains?"":"^",x=h.contains?"":"$";let g=`${y}(?:${i.output})${x}`;i&&i.negated===!0&&(g=`^(?!${g}).*$`);const $=s.toRegex(g,u);return b===!0&&($.state=i),$},s.makeRe=(i,u={},a=!1,b=!1)=>{if(!i||typeof i!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(h.output=e.fastpaths(i,u)),h.output||(h=e(i,u)),s.compileRe(h,u,a,b)},s.toRegex=(i,u)=>{try{const a=u||{};return new RegExp(i,a.flags||(a.nocase?"i":""))}catch(a){if(u&&u.debug===!0)throw a;return/$^/}},s.constants=o,me=s,me}var be,qe;function Ks(){if(qe)return be;qe=1;const t=qs(),e=fe();function r(o,n,s=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:e.isWindows()}),t(o,n,s)}return Object.assign(r,t),be=r,be}var Xs=Ks();const yt=Ce(Xs),Qs=B(import.meta.url),Dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oe=t=>{if(typeof Dt<"u"&&Dt.versions&&Dt.versions.node){const[e,r]=Dt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Dt.getBuiltinModule(t)}return Qs(t)},Ke=oe("fs"),Zs={...Ke,default:Ke},{statSync:Ys,stat:Vs,realpathSync:Js,realpath:to,readdirSync:eo,readdir:ro}=oe("fs"),{sep:gr,basename:so,dirname:Re,resolve:dr,normalize:oo,relative:no,posix:mt,isAbsolute:io}=oe("path"),{fileURLToPath:uo}=oe("url"),{createRequire:lo}=oe("module");var Xe=lo(import.meta.url);function ao(t){let e=oo(t);return e.length>1&&e[e.length-1]===gr&&(e=e.substring(0,e.length-1)),e}const co=/[\\/]/g;function yr(t,e){return t.replace(co,e)}const po=/^[a-z]:[\\/]$/i;function fo(t){return t==="/"||po.test(t)}function $e(t,e){const{resolvePaths:r,normalizePath:o,pathSeparator:n}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=dr(t)),(o||s)&&(t=ao(t)),t===".")return"";const i=t[t.length-1]!==n;return yr(i?t+n:t,n)}function mr(t,e){return e+t}function ho(t,e){return function(r,o){return o.startsWith(t)?o.slice(t.length)+r:yr(no(t,o),e.pathSeparator)+e.pathSeparator+r}}function go(t){return t}function yo(t,e,r){return e+t+r}function mo(t,e){const{relativePaths:r,includeBasePath:o}=e;return r&&t?ho(t,e):o?mr:go}function bo(t){return function(e,r){r.push(e.substring(t.length)||".")}}function $o(t){return function(e,r,o){const n=e.substring(t.length)||".";o.every(s=>s(n,!0))&&r.push(n)}}const vo=(t,e)=>{e.push(t||".")},Eo=(t,e,r)=>{const o=t||".";r.every(n=>n(o,!0))&&e.push(o)},xo=()=>{};function Ao(t,e){const{includeDirs:r,filters:o,relativePaths:n}=e;return r?n?o&&o.length?$o(t):bo(t):o&&o.length?Eo:vo:xo}const So=(t,e,r,o)=>{o.every(n=>n(t,!1))&&r.files++},wo=(t,e,r,o)=>{o.every(n=>n(t,!1))&&e.push(t)},Ro=(t,e,r,o)=>{r.files++},To=(t,e)=>{e.push(t)},_o=()=>{};function ko(t){const{excludeFiles:e,filters:r,onlyCounts:o}=t;return e?_o:r&&r.length?o?So:wo:o?Ro:To}const Co=t=>t,Oo=()=>[""].slice(0,0);function No(t){return t.group?Oo:Co}const Lo=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Ho=()=>{};function Bo(t){return t.group?Lo:Ho}const Mo=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue(),n.realpath(t,(i,u)=>{if(i)return o.dequeue(s?null:i,e);n.stat(u,(a,b)=>{if(a)return o.dequeue(s?null:a,e);if(b.isDirectory()&&br(t,u,e))return o.dequeue(null,e);r(b,u),o.dequeue(null,e)})})},Do=function(t,e,r){const{queue:o,fs:n,options:{suppressErrors:s}}=e;o.enqueue();try{const i=n.realpathSync(t),u=n.statSync(i);if(u.isDirectory()&&br(t,i,e))return;r(u,i)}catch(i){if(!s)throw i}};function Io(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Do:Mo}function br(t,e,r){if(r.options.useRealPaths)return Po(e,r);let o=Re(t),n=1;for(;o!==r.root&&n<2;){const s=r.symlinks.get(o);s&&(s===e||s.startsWith(e)||e.startsWith(s))?n++:o=Re(o)}return r.symlinks.set(t,e),n>1}function Po(t,e){return e.visited.includes(t+e.options.pathSeparator)}const Fo=t=>t.counts,Go=t=>t.groups,Uo=t=>t.paths,jo=t=>t.paths.slice(0,t.options.maxFiles),zo=(t,e,r)=>(he(e,r,t.counts,t.options.suppressErrors),null),Wo=(t,e,r)=>(he(e,r,t.paths,t.options.suppressErrors),null),qo=(t,e,r)=>(he(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Ko=(t,e,r)=>(he(e,r,t.groups,t.options.suppressErrors),null);function he(t,e,r,o){e(t&&!o?t:null,r)}function Xo(t,e){const{onlyCounts:r,group:o,maxFiles:n}=t;return r?e?Fo:zo:o?e?Go:Ko:n?e?jo:qo:e?Uo:Wo}const $r={withFileTypes:!0},Qo=(t,e,r,o,n)=>{if(t.queue.enqueue(),o<0)return t.queue.dequeue(null,t);const{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",$r,(i,u=[])=>{n(u,r,o),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Zo=(t,e,r,o,n)=>{const{fs:s}=t;if(o<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",$r)}catch(u){if(!t.options.suppressErrors)throw u}n(i,r,o)};function Yo(t){return t?Zo:Qo}var Vo=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},Jo=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},tn=class{aborted=!1;abort(){this.aborted=!0}},vr=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,r,o){this.isSynchronous=!o,this.callbackInvoker=Xo(r,this.isSynchronous),this.root=$e(e,r),this.state={root:fo(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Jo,options:r,queue:new Vo((n,s)=>this.callbackInvoker(s,n,o)),symlinks:new Map,visited:[""].slice(0,0),controller:new tn,fs:r.fs||Zs},this.joinPath=mo(this.root,r),this.pushDirectory=Ao(this.root,r),this.pushFile=ko(r),this.getArray=No(r),this.groupFiles=Bo(r),this.resolveSymlink=Io(r,this.isSynchronous),this.walkDirectory=Yo(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,r,o)=>{const{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:u,exclude:a,maxFiles:b,signal:h,useRealPaths:y,pathSeparator:x},controller:g}=this.state;if(g.aborted||h&&h.aborted||b&&n.length>b)return;const $=this.getArray(this.state.paths);for(let _=0;_<e.length;++_){const R=e[_];if(R.isFile()||R.isSymbolicLink()&&!i&&!u){const O=this.joinPath(R.name,r);this.pushFile(O,$,this.state.counts,s)}else if(R.isDirectory()){let O=yo(R.name,r,this.state.options.pathSeparator);if(a&&a(R.name,O))continue;this.pushDirectory(O,n,s),this.walkDirectory(this.state,O,O,o-1,this.walk)}else if(this.resolveSymlink&&R.isSymbolicLink()){let O=mr(R.name,r);this.resolveSymlink(O,this.state,(d,E)=>{if(d.isDirectory()){if(E=$e(E,this.state.options),a&&a(R.name,y?E:O+x))return;this.walkDirectory(this.state,E,y?E:O+x,o-1,this.walk)}else{E=y?E:O;const l=so(E),A=$e(Re(E),this.state.options);E=this.joinPath(l,A),this.pushFile(E,$,this.state.counts,s)}})}}this.groupFiles(this.state.groups,r,$)}};function en(t,e){return new Promise((r,o)=>{Er(t,e,(n,s)=>{if(n)return o(n);r(s)})})}function Er(t,e,r){new vr(t,e,r).start()}function rn(t,e){return new vr(t,e).start()}var Qe=class{constructor(e,r){this.root=e,this.options=r}withPromise(){return en(this.root,this.options)}withCallback(e){Er(this.root,this.options,e)}sync(){return rn(this.root,this.options)}};let xr=null;try{Xe.resolve("picomatch"),xr=Xe("picomatch")}catch{}var sn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:gr,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Qe(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Qe(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const r=this.globFunction||xr;if(!r)throw new Error("Please specify a glob function to use glob matching.");var o=this.globCache[t.join("\0")];return o||(o=r(t,...e),this.globCache[t.join("\0")]=o),this.options.filters.push(n=>o(n)),this}};const on=Array.isArray,Ar=/\\/g,nn=/^[A-Za-z]:$/,Sr=process.platform==="win32",un=/^(\/?\.\.)+$/;function Ze(t,e={}){const r=t.length,o=Array(r),n=Array(r);let s,i;for(s=0;s<r;s++){const u=wr(t[s]);o[s]=u;const a=u.length,b=Array(a);for(i=0;i<a;i++)b[i]=yt(u[i],e);n[s]=b}return u=>{const a=u.split("/");if(a[0]===".."&&un.test(u))return!0;for(s=0;s<r;s++){const b=o[s],h=n[s],y=a.length,x=Math.min(y,b.length);for(i=0;i<x;){const g=b[i];if(g.includes("/"))return!0;if(!h[i](a[i]))break;if(!e.noglobstar&&g==="**")return!0;i++}if(i===y)return!0}return!1}}const ln=/^[A-Z]:\/$/i,an=Sr?t=>ln.test(t):t=>t==="/";function Ye(t,e,r){if(t===e||e.startsWith(`${t}/`)){if(r){const n=t.length+ +!an(t);return(s,i)=>s.slice(n,i?-1:void 0)||"."}const o=e.slice(t.length+1);return o?(n,s)=>{if(n===".")return o;const i=`${o}/${n}`;return s?i.slice(0,-1):i}:(n,s)=>s&&n!=="."?n.slice(0,-1):n}return r?o=>mt.relative(t,o)||".":o=>mt.relative(t,`${e}/${o}`)||"."}function cn(t,e){if(e.startsWith(`${t}/`)){const r=e.slice(t.length+1);return o=>`${r}/${o}`}return r=>{const o=mt.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&o!==""?`${o}/`:o||"."}}function Ve(t){return t.replace(nn,e=>`${e}/`)}const pn={parts:!0};function wr(t){var e;const r=yt.scan(t,pn);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}const fn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,hn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,gn=t=>t.replace(fn,"\\$&"),dn=t=>t.replace(hn,"\\$&"),yn=Sr?dn:gn;function mn(t,e){const r=yt.scan(t);return r.isGlob||r.negated}function se(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function Rr(t){return typeof t=="string"?[t]:t??[]}const bn=/^(\/?\.\.)+/,$n=/\\(?=[()[\]{}!*+?@|])/g;function ve(t,e,r,o){var n;const s=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const u=i.lastIndexOf("/"),a=(u===-1?i:i.slice(u+1)).startsWith("!(");i[i.length-1]!=="*"&&!a&&e.expandDirectories&&(i+="/**");const b=yn(s);i=io(i.replace($n,""))?mt.relative(b,i):mt.normalize(i);const h=(n=bn.exec(i))===null||n===void 0?void 0:n[0],y=wr(i);if(h){const g=(h.length+1)/3;let $=0;const _=b.split("/");for(;$<g&&y[$+g]===_[_.length+$-g];)i=i.slice(0,(g-$-1)*3)+i.slice((g-$)*3+y[$+g].length+1)||".",$++;const R=mt.join(s,h.slice($*3));R[0]!=="."&&r.root.length>R.length&&(r.root=Ve(R),r.depthOffset=-g+$)}if(!o&&r.depthOffset>=0){var x;(x=r.commonPath)!==null&&x!==void 0||(r.commonPath=y);const g=[],$=Math.min(r.commonPath.length,y.length);for(let _=0;_<$;_++){const R=y[_];if(R==="**"&&!y[_+1]){g.pop();break}if(_===y.length-1||R!==r.commonPath[_]||mn(R))break;g.push(R)}r.depthOffset=g.length,r.commonPath=g,r.root=Ve(g.length>0?mt.join(s,...g):s)}return i}function vn(t,e,r){const o=[],n=[],s=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?n.push(ve(i,t,r,!0)):s.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?o.push(ve(i,t,r,!1)):(i[1]!=="!"||i[2]==="(")&&n.push(ve(i.slice(1),t,r,!0)));return{match:o,ignore:n,unignore:s}}function En(t,e){const r=t.cwd,o={root:r,depthOffset:0},n=vn(t,e,o);t.debug&&se("internal processing patterns:",n);const{absolute:s,caseSensitiveMatch:i,debug:u,dot:a,followSymbolicLinks:b,onlyDirectories:h}=t,y=o.root.replace(Ar,""),x={dot:a,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},g=n.unignore.length>0,$=g?yt(n.unignore,x):void 0,_=g?Ze(n.unignore,x):void 0,R=yt(n.match,{...x,ignore:n.ignore,onIgnore:$?k=>$(k.output)&&yt.constants.UNIGNORE:void 0}),O=yt(n.ignore,x),d=Ze(n.match,x),E=Ye(r,y,s),l=s?E:Ye(r,y,!0),A=n.match.length>0&&n.match.every(k=>k==="**"||k==="**/*"),w=n.ignore.length>0||g||!A?(k,F)=>{const D=l(F,!0);return D==="."||_&&_(D)?!1:!d(D)||O(D)}:void 0;let T;t.deep!==void 0&&(T=Math.round(t.deep-o.depthOffset));const S=new sn({filters:[u?(k,F)=>{const D=E(k,F),U=R(D);return U&&se(`matched ${D}`),U}:(k,F)=>{const D=E(k,F);return R(D)}],exclude:u&&w?(k,F)=>{const D=w(k,F);return se(`${D?"skipped":"crawling"} ${F}`),D}:w,fs:t.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:b,excludeSymlinks:!b,excludeFiles:h,includeDirs:h||!t.onlyFiles,maxDepth:T,signal:t.signal}).crawl(y);return t.debug&&se("internal properties:",{...o,root:y}),[S,r!==y&&!s&&cn(r,y)]}function xn(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}const Je={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function An(t){const e=Object.assign({},t);for(const r in Je)e[r]===void 0&&Object.assign(e,{[r]:Je[r]});return e.cwd=(e.cwd instanceof URL?uo(e.cwd):dr(e.cwd||process.cwd())).replace(Ar,"/"),e.ignore=Rr(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||ro,readdirSync:e.fs.readdirSync||eo,realpath:e.fs.realpath||to,realpathSync:e.fs.realpathSync||Js,stat:e.fs.stat||Vs,statSync:e.fs.statSync||Ys}),e.debug&&se("globbing with options:",e),e}function Sn(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const o=on(t)||typeof t=="string",n=Rr((r=o?t:t.patterns)!==null&&r!==void 0?r:"**/*"),s=An(o?e:t);return n.length>0?En(s,n):[]}async function hu(t,e){const[r,o]=Sn(t,e);return r?xn(await r.withPromise(),o):[]}var Ee,tr;function wn(){if(tr)return Ee;tr=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 Ee=function(t){if(typeof t!="string"||t==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},Ee}var xe,er;function Tr(){if(er)return xe;er=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 t=wn(),e={"{":"}","(":")","[":"]"},r=function(n){if(n[0]==="!")return!0;for(var s=0,i=-2,u=-2,a=-2,b=-2,h=-2;s<n.length;){if(n[s]==="*"||n[s+1]==="?"&&/[\].+)]/.test(n[s])||u!==-1&&n[s]==="["&&n[s+1]!=="]"&&(u<s&&(u=n.indexOf("]",s)),u>s&&(h===-1||h>u||(h=n.indexOf("\\",s),h===-1||h>u)))||a!==-1&&n[s]==="{"&&n[s+1]!=="}"&&(a=n.indexOf("}",s),a>s&&(h=n.indexOf("\\",s),h===-1||h>a))||b!==-1&&n[s]==="("&&n[s+1]==="?"&&/[:!=]/.test(n[s+2])&&n[s+3]!==")"&&(b=n.indexOf(")",s),b>s&&(h=n.indexOf("\\",s),h===-1||h>b))||i!==-1&&n[s]==="("&&n[s+1]!=="|"&&(i<s&&(i=n.indexOf("|",s)),i!==-1&&n[i+1]!==")"&&(b=n.indexOf(")",i),b>i&&(h=n.indexOf("\\",i),h===-1||h>b))))return!0;if(n[s]==="\\"){var y=n[s+1];s+=2;var x=e[y];if(x){var g=n.indexOf(x,s);g!==-1&&(s=g+1)}if(n[s]==="!")return!0}else s++}return!1},o=function(n){if(n[0]==="!")return!0;for(var s=0;s<n.length;){if(/[*?{}()[\]]/.test(n[s]))return!0;if(n[s]==="\\"){var i=n[s+1];s+=2;var u=e[i];if(u){var a=n.indexOf(u,s);a!==-1&&(s=a+1)}if(n[s]==="!")return!0}else s++}return!1};return xe=function(n,s){if(typeof n!="string"||n==="")return!1;if(t(n))return!0;var i=r;return s&&s.strict===!1&&(i=o),i(n)},xe}const Rn=B(import.meta.url),It=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_r=t=>{if(typeof It<"u"&&It.versions&&It.versions.node){const[e,r]=It.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return It.getBuiltinModule(t)}return Rn(t)},Tn=_r("path"),_n=_r("os");var Ae,rr;function kn(){if(rr)return Ae;rr=1;var t=Tr(),e=Tn.posix.dirname,r=_n.platform()==="win32",o="/",n=/\\/g,s=/\\([!*?|[\](){}])/g;Ae=function(a,b){var h=Object.assign({flipBackslashes:!0},b);h.flipBackslashes&&r&&a.indexOf(o)<0&&(a=a.replace(n,o)),i(a)&&(a+=o),a+="a";do a=e(a);while(u(a));return a.replace(s,"$1")};function i(a){var b=a.slice(-1),h;switch(b){case"}":h="{";break;case"]":h="[";break;default:return!1}var y=a.indexOf(h);return y<0?!1:a.slice(y+1,-1).includes(o)}function u(a){return/\([^()]+$/.test(a)||a[0]==="{"||a[0]==="["||/[^\\][{[]/.test(a)?!0:t(a)}return Ae}var Cn=kn();Ce(Cn);const On=B(import.meta.url),Pt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nn=t=>{if(typeof Pt<"u"&&Pt.versions&&Pt.versions.node){const[e,r]=Pt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Pt.getBuiltinModule(t)}return On(t)},{access:Ln}=Nn("node:fs/promises");async function gu(t,e=_e){pt(t),t=ct(t);try{return await Ln(t,e),!0}catch{return!1}}const Hn=B(import.meta.url),Ft=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bn=t=>{if(typeof Ft<"u"&&Ft.versions&&Ft.versions.node){const[e,r]=Ft.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ft.getBuiltinModule(t)}return Hn(t)},{accessSync:Mn}=Bn("node:fs");function Te(t,e=_e){pt(t),t=ct(t);try{return Mn(t,e),!0}catch{return!1}}var Dn=Tr();Ce(Dn);const In=B(import.meta.url),Gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof Gt<"u"&&Gt.versions&&Gt.versions.node){const[e,r]=Gt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Gt.getBuiltinModule(t)}return In(t)};kr("node:fs/promises");kr("node:fs");let Pn=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")}},Fn=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 Cr=(t,e)=>{const r=t?.code;return r==="ENOENT"?new Pn(`no such file or directory, open '${e}'`):r==="EACCES"||r==="EPERM"?new Fn(`unable to read the non-readable file: ${e}`):t},Gn=B(import.meta.url),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Or=t=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[e,r]=Ut.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Ut.getBuiltinModule(t)}return Gn(t)},{readFile:Un}=Or("node:fs/promises"),{unzip:jn,brotliDecompress:zn}=Or("node:zlib"),Wn={brotli:zn,gzip:jn,none:(t,e)=>{e(null,t)}},mu=async(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=await Un(t,s?{flag:s}:{})}catch(u){throw Cr(u,t)}return await new Promise((u,a)=>{Wn[o??"none"](i,(b,h)=>{b?a(b):u(r?h:h.toString(n??"utf8"))})})},qn=B(import.meta.url),jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=t=>{if(typeof jt<"u"&&jt.versions&&jt.versions.node){const[e,r]=jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return jt.getBuiltinModule(t)}return qn(t)},{readFileSync:Kn}=Nr("node:fs"),{unzipSync:Xn,brotliDecompressSync:Qn}=Nr("node:zlib"),Zn={brotli:Qn,gzip:Xn,none:t=>t},bu=(t,e)=>{pt(t),t=ct(t);const{buffer:r,compression:o,encoding:n,flag:s}=e??{};let i;try{i=Kn(t,s?{flag:s}:{})}catch(b){throw Cr(b,t)}const u=Zn[o??"none"],a=u(i);return r?a:a.toString(n??"utf8")},Yn=B(import.meta.url),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vn=t=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[e,r]=zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return zt.getBuiltinModule(t)}return Yn(t)},{createRequire:Lr}=Vn("node:module"),Jn=globalThis.process??Object.create(null),sr={versions:{}},or=new Proxy(Jn,{get(t,e){if(e in t)return t[e];if(e in sr)return sr[e]}}),ti=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
12
|
+
`),ei=(t,e,r,o)=>{const n={column:0,line:-1,...t.start},s={...n,...t.end},i=n.line,u=n.column,a=s.line,b=s.column;let h=Math.max(i-(r+1),0),y=Math.min(e.length,a+o);i===-1&&(h=0),a===-1&&(y=e.length);const x=a-i,g={};if(x)for(let $=0;$<=x;$++){const _=$+i;if(!u)g[_]=!0;else if($===0){const R=e[_-1]?.length;g[_]=[u,(R??0)-u+1]}else if($===x)g[_]=[0,b];else{const R=e[_-$]?.length;g[_]=[0,R]}}else u===b?g[i]=u?[u,0]:!0:g[i]=[u,(b??0)-(u??0)];return{end:y,markerLines:g,start:h}},ri=or.platform==="win32"&&!or.env?.WT_SESSION?">":"❯",$u=(t,e,r)=>{const o={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:$=>$,marker:$=>$,message:$=>$,...r?.color}},n=typeof e.start.column=="number";let s=(t.includes("\r")?ti(t):t).split(`
|
|
13
|
+
`);typeof o.tabWidth=="number"&&t.includes(" ")&&(s=s.map($=>$.replaceAll(" "," ".repeat(o.tabWidth))));const{end:i,markerLines:u,start:a}=ei(e,s,o.linesAbove,o.linesBelow),b=String(i).length,{gutter:h,marker:y,message:x}=o.color;let g=s.slice(a,i).map(($,_)=>{const R=a+1+_,O=u[R],d=String(R).padStart(b),E=!u[R+1],l=` ${d}${o.showGutter?" |":""}`;if(O){let A="";if(Array.isArray(O)){const w=$.replaceAll(/[^\t]/g," ").slice(0,Math.max(O[0]-1,0)),T=O[1]||1;A=[`
|
|
14
|
+
`,o.prefix+h(l.replaceAll(/\d/g," "))," ",w,y("^").repeat(T)].join(""),E&&o.message&&(A+=` ${x(o.message)}`)}return[o.prefix+y(ri),h(l),$.length>0?` ${$}`:"",A].join("")}return`${o.prefix} ${h(l)}${$.length>0?` ${$}`:""}`}).join(`
|
|
15
|
+
`);return o.message&&!n&&(g=`${o.prefix+" ".repeat(b+1)+o.message}
|
|
16
|
+
${g}`),g},nr=(t,e)=>{let r=0,o=e.length-2;for(;r<o;){const n=r+(o-r>>1);if(t<e[n])o=n-1;else if(t>=e[n+1])r=n+1;else{r=n;break}}return r},si=/\n|\r(?!\n)/,oi=t=>t.split(si).reduce((e,r)=>(e.push(e.at(-1)+r.length+1),e),[0]),vu=(t,e,r)=>{if(!Array.isArray(t)&&typeof t!="string"||(typeof t=="string"||Array.isArray(t))&&t.length===0)return{column:0,line:0};if(typeof e!="number"||typeof t=="string"&&e>=t.length||Array.isArray(t)&&e+1>=t.at(-1))return{column:0,line:0};if(typeof t=="string"){const n=oi(t),s=nr(e,n);return{column:e-n[s]+1,line:s+1}}const o=nr(e,t);return{column:e-t[o]+1,line:o+1}},ni=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&ni.set("AggregateError",AggregateError);const ii=Lr(import.meta.url),Wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ui=t=>{if(typeof Wt<"u"&&Wt.versions&&Wt.versions.node){const[e,r]=Wt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Wt.getBuiltinModule(t)}return ii(t)};ui("node:util");const li=Lr(import.meta.url),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Oe=t=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[e,r]=qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return qt.getBuiltinModule(t)}return li(t)};Oe("node:fs");Oe("node:path");Oe("node:url");let Eu=class extends Error{fileName;codeFrame;name="JSONError";#t;constructor(e){super(),this.#t=e}get message(){return`${this.#t}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
17
|
+
|
|
18
|
+
${this.codeFrame}
|
|
19
|
+
`:""}`}set message(e){this.#t=e}};const ai=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e},ci=B(import.meta.url),Kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hr=t=>{if(typeof Kt<"u"&&Kt.versions&&Kt.versions.node){const[e,r]=Kt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Kt.getBuiltinModule(t)}return ci(t)};Hr("node:fs");Hr("node:fs/promises");const pi=B(import.meta.url),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fi=t=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[e,r]=Xt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Xt.getBuiltinModule(t)}return pi(t)};fi("node:fs");const hi=B(import.meta.url),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gi=t=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[e,r]=Qt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Qt.getBuiltinModule(t)}return hi(t)};gi("node:fs/promises");const di=B(import.meta.url),Zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yi=t=>{if(typeof Zt<"u"&&Zt.versions&&Zt.versions.node){const[e,r]=Zt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Zt.getBuiltinModule(t)}return di(t)},{rmSync:mi}=yi("node:fs"),Au=(t,e={})=>{pt(t),mi(t,ai(e))};B(import.meta.url);const bi=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},$i=B(import.meta.url),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vi=t=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[e,r]=Yt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Yt.getBuiltinModule(t)}return $i(t)},{randomBytes:Ei}=vi("node:crypto"),xi=t=>`${t}.${process.pid.toString(36)}.${Ei(6).toString("hex")}.tmp`,Ai=new TextEncoder,Si=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return Ai.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},wi=B(import.meta.url),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ri=t=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[e,r]=Vt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Vt.getBuiltinModule(t)}return wi(t)};Ri("node:fs/promises");const Ti=B(import.meta.url),Jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_i=t=>{if(typeof Jt<"u"&&Jt.versions&&Jt.versions.node){const[e,r]=Jt.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return Jt.getBuiltinModule(t)}return Ti(t)},{mkdirSync:ki,writeFileSync:Ci,statSync:Oi,renameSync:ir,chownSync:Ni,chmodSync:Li,unlinkSync:Hi}=_i("node:fs"),Bi=(t,e,r)=>{r={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},pt(t),bi(e),t=ct(t);const o=Te(t,_e);if(o&&!r.overwrite)throw new is(`file already exists, open '${t}'`);const n=xi(t);try{!o&&r.recursive&&ki(ke(t),{recursive:!0});let s;if(Ci(n,typeof e=="string"?Buffer.from(e,r.encoding??"utf8"):Si(e),{flag:"wx"}),o&&r.backup&&(s=Oi(t),r.chown??={gid:s.gid,uid:s.uid},ir(t,`${t}.bak`)),r.chown)try{Ni(n,r.chown.uid,r.chown.gid)}catch{}Li(n,s&&!r.mode?s.mode:r.mode??438),ir(n,t)}catch(s){throw new Error(`Failed to write file at: ${t} - ${s.message}`,{cause:s})}finally{Te(n)&&Hi(n)}},Mi=/^(?:( )+|\t+)/,ne="space";function ur(t,e,r){return t&&e===ne&&r===1}function lr(t,e){const r=new Map;let o=0,n,s;for(const i of t.split(/\n/g)){if(!i)continue;const u=i.match(Mi);if(u===null)o=0,n="";else{const a=u[0].length,b=u[1]?ne:"tab";if(ur(e,b,a))continue;b!==n&&(o=0),n=b;let h=1,y=0;const x=a-o;if(o=a,x===0)h=0,y=1;else{const $=Math.abs(x);if(ur(e,b,$))continue;s=Di(b,$)}const g=r.get(s);r.set(s,g===void 0?[1,0]:[g[0]+h,g[1]+y])}}return r}function Di(t,e){return(t===ne?"s":"t")+String(e)}function Ii(t){const e=t[0]==="s"?ne:"tab",r=Number(t.slice(1));return{type:e,amount:r}}function Pi(t){let e,r=0,o=0;for(const[n,[s,i]]of t)(s>r||s===r&&i>o)&&(r=s,o=i,e=n);return e}function Fi(t,e){return(t===ne?" ":" ").repeat(e)}function Gi(t){if(typeof t!="string")throw new TypeError("Expected a string");let e=lr(t,!0);e.size===0&&(e=lr(t,!1));const r=Pi(e);let o,n=0,s="";return r!==void 0&&({type:o,amount:n}=Ii(r),s=Fi(o,n)),{amount:n,type:o,indent:s}}const Ui=B(import.meta.url),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ji=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,r]=te.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return te.getBuiltinModule(t)}return Ui(t)};ji("node:fs/promises");const zi=B(import.meta.url),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wi=t=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,r]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return ee.getBuiltinModule(t)}return zi(t)},{readFileSync:qi}=Wi("node:fs"),Su=(t,e,r={})=>{const{detectIndent:o,indent:n,replacer:s,stringify:i=JSON.stringify,...u}={indent:" ",...r};let a=n,b=`
|
|
20
|
+
`;if(Te(t,Fr))try{const y=qi(t,"utf8");if(o){const{indent:x}=Gi(y);a=x}b=y.endsWith(`
|
|
21
|
+
`)?`
|
|
22
|
+
`:""}catch(y){if(y.code!=="ENOENT")throw y}const h=i(e,s,a);Bi(t,`${h}${b}`,u)},Ki=B(import.meta.url),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,r]=re.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return re.getBuiltinModule(t)}return Ki(t)},Xi=Ne("fs"),Qi=Ne("os"),Zi=Ne("path");var Se={},ar;function Yi(){if(ar)return Se;ar=1;var t=Object.defineProperty,e=(h,y)=>t(h,"name",{value:y,configurable:!0}),r=Xi,o=Qi,n=Zi;const s=e(h=>{let y="";for(let x=0;x<h.length;x+=1){const g=h[x],$=g.toUpperCase();y+=g===$?g.toLowerCase():$}return y},"invertCase"),i=new Map,u=e((h,y)=>{const x=n.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return y.writeFileSync(x,""),!y.existsSync(s(x))}finally{try{y.unlinkSync(x)}catch{}}},"checkDirectoryCaseWithWrite"),a=e((h,y,x)=>{try{return u(h,x)}catch(g){if(y===void 0)return u(o.tmpdir(),x);throw g}},"checkDirectoryCaseWithFallback"),b=e((h,y=r,x=!0)=>{const g=h??process.cwd();if(x&&i.has(g))return i.get(g);let $;const _=s(g);return _!==g&&y.existsSync(g)?$=!y.existsSync(_):$=a(g,h,y),x&&i.set(g,$),$},"isFsCaseSensitive");return Se.isFsCaseSensitive=b,Se}var Vi=Yi();const wu=Vi.isFsCaseSensitive;export{bt as A,vt as B,cu as F,ke as H,Ds as I,fr as J,ct as L,Su as O,Bi as T,$u as U,hu as W,uu as a,gu as b,mu as c,iu as d,Pn as e,Te as f,ae as g,ou as h,tu as i,Yr as j,wu as k,Au as l,Qr as m,eu as o,Eu as s,bu as v,ru as w,su as y,vu as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as h,D as k,f as S}from"./provenance-
|
|
1
|
+
import{m as h,D as k,f as S}from"./provenance-DIq8KyBV.js";import{g as $}from"./packument-DquNPIq9.js";import{H as d}from"./env-C2ZCnfP_.js";import{W as N}from"./build-scripts-MTSK6TNr.js";import{n as v}from"./license-t5KnNX6v.js";import{A as R,B as L,v as D}from"./index-CE6MsgcV.js";import{D as A}from"../packem_chunks/cli-main.js";import"./public-api-WqUCiyIe.js";import{L as w}from"./dependency-scan-DpOFiZuI.js";const m={CRITICAL:0,HIGH:1,LOW:3,MODERATE:2,UNKNOWN:4},oe=(t,e)=>{const n=m[(t.vulnerability.severity??"UNKNOWN").toUpperCase()]??4,s=m[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??4;return n-s||t.packageName.localeCompare(e.packageName)||t.packageVersion.localeCompare(e.packageVersion)},P=(t,e)=>{const n=m[e.toUpperCase()]??2;return(m[t.toUpperCase()]??4)<=n},b=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],g=6e4,W=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},x=async(t,e)=>{const n=e.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:s}=n,a=n.exclude??[],r=e.security?.acceptedRisks,c=s*g,i=Date.now();return(await h(t.packages,k,async o=>{if(W(o.name,o.version,a))return;const l=await $(o.name,{workspaceRoot:t.workspaceRoot});if(l===void 0)return;const p=l.time?.[o.version];if(p===void 0)return;const u=Date.parse(p);if(Number.isNaN(u))return;const f=i-u;if(f>=c)return;const y=Math.max(0,Math.floor(f/g));return{acceptedRisk:d(o.name,o.version,r,"firstSeen"),data:{ageMinutes:y,minimumMinutes:s,publishedAt:p},packageName:o.name,policy:"firstSeen",reason:`${o.name}@${o.version} was published ${String(y)} min ago — below the ${String(s)} min firstSeen cooldown.`,severity:"block",version:o.version}})).filter(o=>o!==void 0)},O=(t,e)=>{const n=e.security?.policies?.installScripts;if(!n)return[];const s=n.allow??{},a=n.strict===!0;if(!a&&Object.keys(s).length===0)return[];const r=N(t.workspaceRoot,s,{pinVersions:e.security?.pinVersions===!0});if(r.unapproved.length===0)return[];const c=e.security?.acceptedRisks,i=a?"block":"warn";return r.unapproved.map(o=>({acceptedRisk:d(o.name,o.version??"*",c,"installScripts"),data:{hooks:o.hooks},packageName:o.name,policy:"installScripts",reason:`${o.name}${o.version?`@${o.version}`:""} declares unapproved build script(s): ${o.hooks.join(", ")}`,severity:i,version:o.version??"*"}))},U=new Set(["AND","OR"]),E=t=>{const e=t.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(a=>a.trim()).filter(a=>a.length>0),n=[];let s=!1;for(const a of e){const r=a.toUpperCase();if(s){s=!1;continue}if(r==="WITH"){s=!0;continue}if(U.has(r))continue;const c=a.endsWith("+"),i=c?a.slice(0,-1):a,o=v(i)??i;n.push(o),c&&n.push(`${o}-or-later`)}return n},F=t=>{if(typeof t.license=="string"){const e=t.license.trim();return e.length>0?e:void 0}if(t.license&&typeof t.license=="object"&&typeof t.license.type=="string"){const e=t.license.type.trim();if(e.length>0)return e}if(Array.isArray(t.licenses)&&t.licenses.length>0){const e=t.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(e.length>0)return e.length===1?e[0]:`(${e.join(" OR ")})`}},I=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(n.has(s.toLowerCase()))return s},M=(t,e)=>{if(e.length===0)return;const n=new Set(e.map(s=>v(s)??s).map(s=>s.toLowerCase()));for(const s of t)if(!n.has(s.toLowerCase()))return s},V=(t,e)=>{const n=e.security?.policies?.license;if(!n)return[];const s=n.allow??[],a=n.deny??[];if(s.length===0&&a.length===0)return[];const r=e.security?.acceptedRisks,c=[];for(const i of t.packages){const o=t.manifestData?.get(`${i.name}@${i.version}`),l=o?F(o):void 0;if(!l){s.length>0&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:null},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} declares no license; allow-list mode requires one of: ${s.join(", ")}`,severity:"block",version:i.version});continue}const p=E(l),u=I(p,a);if(u){c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:i.version});continue}const f=M(p,s);f&&c.push({acceptedRisk:d(i.name,i.version,r,"license"),data:{allowList:s,declaredLicense:l,unallowedLicense:f},packageName:i.name,policy:"license",reason:`${i.name}@${i.version} uses license '${f}' which is not on the allow-list (declared: ${l})`,severity:"block",version:i.version})}return c},j=6e4,_=(t,e,n)=>{for(const s of n)if(s===t||s===`${t}@${e}`||s.endsWith("*")&&t.startsWith(s.slice(0,-1)))return!0;return!1},H=async(t,e)=>{const n=e.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const s=n.exclude??[],a=typeof n.ignoreAfter=="number"?n.ignoreAfter*j:void 0,r=e.security?.acceptedRisks,c=Date.now();return(await h(t.packages,k,async i=>{if(_(i.name,i.version,s))return;const o=await $(i.name,{workspaceRoot:t.workspaceRoot});if(o===void 0)return;if(a!==void 0){const p=o.time?.[i.version],u=p===void 0?Number.NaN:Date.parse(p);if(!Number.isNaN(u)&&c-u>a)return}if(o.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const l=S(o,i.version);if(l!==void 0)return{acceptedRisk:d(i.name,i.version,r,"publisherChange"),data:{priorVersionWithProvenance:l},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${l} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},T=t=>{for(const e of Object.values(w))for(const n of[e.file,...e.aliases??[]])if(t===n||t.endsWith(`/${n}`)||t.endsWith(`.${n}`))return e.type},K=(t,e,n)=>{const s=R(e)?e:L(t,e);let a;try{a=D(s)}catch{return}const r=T(s)??w[n]?.type;if(!r)return;const c=A(a,r);if(c.length===0)return;const i=new Set;for(const o of c)i.add(`${o.name}@${o.version}`);return i},z=(t,e)=>{for(const n of e)if(n===t||n.endsWith("*")&&t.startsWith(n.slice(0,-1)))return!0;return!1},Y=(t,e)=>{const n=e.security?.policies?.unexpectedDeps;if(!n)return[];const s=n.allow??[],a=n.baselineLockfile;if(s.length===0&&!a)return[];const r=a?K(t.workspaceRoot,a,t.packageManager):void 0,c=e.security?.acceptedRisks,i=[];for(const o of t.packages){const l=s.length===0||z(o.name,s),p=r?r.has(`${o.name}@${o.version}`):!0;if(l&&p)continue;const u=[],f={};l||(u.push(`not on allow-list (${s.length} entr${s.length===1?"y":"ies"})`),f.allowList=s),!p&&r&&(u.push(`not present in baseline lockfile (${a})`),f.baselineLockfile=a),i.push({acceptedRisk:d(o.name,o.version,c,"unexpectedDeps"),data:f,packageName:o.name,policy:"unexpectedDeps",reason:`${o.name}@${o.version} is unexpected: ${u.join("; ")}`,severity:"block",version:o.version})}return i},q=(t,e)=>{if(!t.osvFindings||t.osvFindings.size===0)return[];const n=e.security?.policies?.vulnerability?.failOn,s=e.security?.acceptedRisks,a=[];for(const r of t.packages){const c=t.osvFindings.get(r.name);if(!(!c||c.length===0))for(const i of c){const o=n?P(i.severity,n)?"block":"warn":"info";a.push({acceptedRisk:d(r.name,r.version,s,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:r.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${r.name}@${r.version}: ${i.summary}`,severity:o,version:r.version})}}return a},C=[{evaluate:q,isConfigured:t=>t.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:V,isConfigured:t=>{const e=t.security?.policies?.license;return!!(e&&(e.allow&&e.allow.length>0||e.deny&&e.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:O,isConfigured:t=>{const e=t.security?.policies?.installScripts;return!!(e&&(e.allow&&Object.keys(e.allow).length>0||e.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:t=>{const e=t.security?.policies?.unexpectedDeps;return!!(e&&(e.allow&&e.allow.length>0||typeof e.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:x,isConfigured:t=>{const e=t.security?.policies?.firstSeen?.minutes;return typeof e=="number"&&e>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:H,isConfigured:t=>t.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],B=(t,e,n)=>C.filter(s=>s.surfaces.includes(t)?n!==void 0?n.has(s.name):s.isConfigured(e):!1),re=async(t,e,n)=>{const s=B(e,n.visConfig,n.enabledPolicies),a=[];for(const r of s){if(t.offline&&!r.offlineSupported){a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const c=await r.evaluate(t,n.visConfig);a.push(...c)}catch(c){const i=c instanceof Error?c.message:String(c);a.push({packageName:"*",policy:r.name,reason:`policy.${r.name} failed: ${i}`,severity:"info",version:"*"})}}return a},G=(()=>{const t=new Map;for(const e of b)t.set(e.toLowerCase(),e);return t})(),ae=()=>C.map(t=>t.name),ce=(t,e)=>{if(t===void 0)return;const n=t.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(b);const s=new Set;for(const a of t.split(",").map(r=>r.trim()).filter(r=>r.length>0)){const r=a.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(i,o)=>o.toUpperCase()),c=G.get(r.toLowerCase());c===void 0?e?.(a):s.add(c)}return s};export{oe as c,re as e,ae as g,ce as p,P as s};
|