updates 15.0.1 → 15.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/updates.js +1 -1
  2. package/package.json +1 -1
package/bin/updates.js CHANGED
@@ -25,7 +25,7 @@ Content-Type: ${a.type||"application/octet-stream"}\r
25
25
  `}}return t.message=r+`
26
26
  `,t}});var lh=I((rE,ah)=>{"use strict";ah.exports=a_;var i_=sh(),o_=oh();function a_(t){global.Buffer&&global.Buffer.isBuffer(t)&&(t=t.toString("utf8"));let e=new i_;try{return e.parse(t),e.finish()}catch(r){throw o_(r,t)}}});function ni({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var li=Fe(Ha(),1);var Da=li.default.HttpProxyAgent,Ba=li.default.HttpsProxyAgent;var Dr=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,n]of e)this.onEviction(r,n.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let n=r.get(e);return this._getItemValue(e,n)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,n]=e;this.cache.has(r)||this._deleteIfExpired(r,n)===!1&&(yield e)}for(let e of this.cache){let[r,n]=e;this._deleteIfExpired(r,n)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:n=this.maxAge}={}){let i=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;this.cache.has(e)?this.cache.set(e,{value:r,expiry:i}):this._set(e,{value:r,expiry:i})}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],n=r.length-e;n<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(n>0&&this._emitEvictions(r.slice(0,n)),this.oldCache=new Map(r.slice(n)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,n]=e;this._deleteIfExpired(r,n)===!1&&(yield[r,n.value])}for(let e of this.oldCache){let[r,n]=e;this.cache.has(r)||this._deleteIfExpired(r,n)===!1&&(yield[r,n.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let n=e[r],[i,a]=n;this._deleteIfExpired(i,a)===!1&&(yield[i,a.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let n=e[r],[i,a]=n;this.cache.has(i)||this._deleteIfExpired(i,a)===!1&&(yield[i,a.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[n,i]of this.entriesAscending())e.call(r,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}};var Ma=Fe(qa(),1);import{Agent as dp}from"node:http";import{Agent as pp}from"node:https";var mp={agentCacheSize:512},Ua={maxSockets:64,keepAlive:!1},ui=class t extends Error{constructor(e){super(e),this.name="TimeoutError",Error.captureStackTrace(this,t)}};function ci(t,e={}){if(!("undici"in e))throw new Error("The 'undici' option is required");let r={...mp,...e},n=new Dr({maxSize:r.agentCacheSize});async function i(l,f={}){let{origin:c,protocol:h}=new URL(l),b=f?.noProxy?null:(0,Ma.getProxyForUrl)(l),g=JSON.stringify({proxyUrl:b,origin:c,...f});if(n.has(g))return n.get(g);let m;if("noProxy"in f&&delete f.noProxy,e.undici){let{ProxyAgent:d,Agent:_}=await import("undici"),R={...f};"keepAlive"in R&&!("pipelining"in R)&&(R.pipelining=R.keepAlive?1:0),"keepAlive"in R&&delete R.keepAlive,"maxSockets"in R&&(R.connections=R.maxSockets,delete R.maxSockets),b?m=new d({...R,uri:b}):m=new _(R)}else{let d=h==="https:";b?m=new(d?Ba:Da)({...f,proxy:b}):m=new(d?pp:dp)(f)}return n.set(g,m),m}let a=(l,{timeout:f=0,agentOpts:c={},...h}={})=>new Promise(async(b,g)=>{if(!e.undici&&!("agent"in h)){let _=await i(l,{...Ua,...c});_&&(h.agent=_)}else if(e.undici&&!("dispatcher"in h)){let _=await i(l,{...Ua,...c});_&&(h.dispatcher=_)}let m,d;f&&(!("signal"in h)&&globalThis.AbortController&&(d=new AbortController,h.signal=d.signal),m=setTimeout(()=>{d?.abort?.();let _=new ui(`${h.method||"GET"} ${l} timed out after ${f}ms`);g(_)},f),m?.unref?.()),t(l,h).then(_=>{m&&clearTimeout(m),b(_)}).catch(_=>{if(m&&clearTimeout(m),_.name==="AbortError")return b(null);g(_)})});return a.clearCache=()=>{for(let l of n.values())"destroy"in l&&l.destroy();n.clear()},a}var Ah=Fe(fi(),1);import kp from"node:http";import zp from"node:https";import sr from"node:zlib";import Al,{PassThrough as Tl,pipeline as ir}from"node:stream";import{Buffer as Kn}from"node:buffer";function bp(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,a=r[0]||"text/plain",l=a;for(let b=1;b<r.length;b++)r[b]==="base64"?i=!0:r[b]&&(l+=`;${r[b]}`,r[b].indexOf("charset=")===0&&(n=r[b].substring(8)));!r[0]&&!n.length&&(l+=";charset=US-ASCII",n="US-ASCII");let f=i?"base64":"ascii",c=unescape(t.substring(e+1)),h=Buffer.from(c,f);return h.type=a,h.typeFull=l,h.charset=n,h}var ja=bp;Br();Mn();import _t,{PassThrough as cl}from"node:stream";import{types as fl,deprecate as Ri,promisify as Np}from"node:util";import{Buffer as qe}from"node:buffer";var it=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var $e=class extends it{constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}};var Wn=Symbol.toStringTag,gi=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Wn]==="URLSearchParams",qr=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Wn]),el=t=>typeof t=="object"&&(t[Wn]==="AbortSignal"||t[Wn]==="EventTarget"),tl=(t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},rl=(t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n};var Hp=Np(_t.pipeline),Ie=Symbol("Body internals"),Ze=class{constructor(e,{size:r=0}={}){let n=null;e===null?e=null:gi(e)?e=qe.from(e.toString()):qr(e)||qe.isBuffer(e)||(fl.isAnyArrayBuffer(e)?e=qe.from(e):ArrayBuffer.isView(e)?e=qe.from(e.buffer,e.byteOffset,e.byteLength):e instanceof _t||(e instanceof It?(e=Ja(e),n=e.type.split("=")[1]):e=qe.from(String(e))));let i=e;qe.isBuffer(e)?i=_t.Readable.from(e):qr(e)&&(i=_t.Readable.from(e.stream())),this[Ie]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof _t&&e.on("error",a=>{let l=a instanceof it?a:new $e(`Invalid response body while trying to fetch ${this.url}: ${a.message}`,"system",a);this[Ie].error=l})}get body(){return this[Ie].stream}get bodyUsed(){return this[Ie].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await _i(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new It,i=new URLSearchParams(await this.text());for(let[a,l]of i)n.append(a,l);return n}let{toFormData:r}=await Promise.resolve().then(()=>(ul(),ll));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Ie].body&&this[Ie].body.type||"",r=await this.arrayBuffer();return new st([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await _i(this);return new TextDecoder().decode(e)}buffer(){return _i(this)}};Ze.prototype.buffer=Ri(Ze.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Ze.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:Ri(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function _i(t){if(t[Ie].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Ie].disturbed=!0,t[Ie].error)throw t[Ie].error;let{body:e}=t;if(e===null)return qe.alloc(0);if(!(e instanceof _t))return qe.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let a=new $e(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(a),a}n+=i.length,r.push(i)}}catch(i){throw i instanceof it?i:new $e(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?qe.from(r.join("")):qe.concat(r,n)}catch(i){throw new $e(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new $e(`Premature close of server response while trying to fetch ${t.url}`)}var rr=(t,e)=>{let r,n,{body:i}=t[Ie];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof _t&&typeof i.getBoundary!="function"&&(r=new cl({highWaterMark:e}),n=new cl({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Ie].stream=r,i=n),i},Dp=Ri(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),jn=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":gi(t)?"application/x-www-form-urlencoded;charset=UTF-8":qr(t)?t.type||null:qe.isBuffer(t)||fl.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof It?`multipart/form-data; boundary=${e[Ie].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Dp(t)}`:t instanceof _t?null:"text/plain;charset=UTF-8",hl=t=>{let{body:e}=t[Ie];return e===null?0:qr(e)?e.size:qe.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},dl=async(t,{body:e})=>{e===null?t.end():await Hp(e,t)};import{types as pl}from"node:util";import Vn from"node:http";var Gn=typeof Vn.validateHeaderName=="function"?Vn.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},Si=typeof Vn.validateHeaderValue=="function"?Vn.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},He=class t extends URLSearchParams{constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,a]of Object.entries(n))r.push(...a.map(l=>[i,l]))}else if(e!=null)if(typeof e=="object"&&!pl.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||pl.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(Gn(n),Si(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,a){switch(i){case"append":case"set":return(l,f)=>(Gn(l),Si(l,String(f)),URLSearchParams.prototype[i].call(n,String(l).toLowerCase(),String(f)));case"delete":case"has":case"getAll":return l=>(Gn(l),URLSearchParams.prototype[i].call(n,String(l).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,a)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(He.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function ml(t=[]){return new He(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Gn(e),Si(e,String(r)),!0}catch{return!1}}))}var Bp=new Set([301,302,303,307,308]),Yn=t=>Bp.has(t);var Ye=Symbol("Response internals"),Ue=class t extends Ze{constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new He(r.headers);if(e!==null&&!i.has("Content-Type")){let a=jn(e,this);a&&i.append("Content-Type",a)}this[Ye]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ye].type}get url(){return this[Ye].url||""}get status(){return this[Ye].status}get ok(){return this[Ye].status>=200&&this[Ye].status<300}get redirected(){return this[Ye].counter>0}get statusText(){return this[Ye].statusText}get headers(){return this[Ye].headers}get highWaterMark(){return this[Ye].highWaterMark}clone(){return new t(rr(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!Yn(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[Ye].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new He(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ue.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});import{format as Up}from"node:url";import{deprecate as Mp}from"node:util";var gl=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};import{isIP as Fp}from"node:net";function bl(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var yl=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),_l="strict-origin-when-cross-origin";function Rl(t){if(!yl.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function qp(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=Fp(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function nr(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:qp(t)}function Sl(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,a=bl(i),l=bl(i,!0);a.toString().length>4096&&(a=l),e&&(a=e(a)),r&&(l=r(l));let f=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return l;case"unsafe-url":return a;case"strict-origin":return nr(a)&&!nr(f)?"no-referrer":l.toString();case"strict-origin-when-cross-origin":return a.origin===f.origin?a:nr(a)&&!nr(f)?"no-referrer":l;case"same-origin":return a.origin===f.origin?a:"no-referrer";case"origin-when-cross-origin":return a.origin===f.origin?a:l;case"no-referrer-when-downgrade":return nr(a)&&!nr(f)?"no-referrer":a;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function wl(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&yl.has(n)&&(r=n);return r}var ye=Symbol("Request internals"),Mr=t=>typeof t=="object"&&typeof t[ye]=="object",Wp=Mp(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Pt=class t extends Ze{constructor(e,r={}){let n;if(Mr(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!Mr(r)&&"data"in r&&Wp(),(r.body!=null||Mr(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let a=r.body?r.body:Mr(e)&&e.body!==null?rr(e):null;super(a,{size:r.size||e.size||0});let l=new He(r.headers||e.headers||{});if(a!==null&&!l.has("Content-Type")){let h=jn(a,this);h&&l.set("Content-Type",h)}let f=Mr(e)?e.signal:null;if("signal"in r&&(f=r.signal),f!=null&&!el(f))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let c=r.referrer==null?e.referrer:r.referrer;if(c==="")c="no-referrer";else if(c){let h=new URL(c);c=/^about:(\/\/)?client$/.test(h)?"client":h}else c=void 0;this[ye]={method:i,redirect:r.redirect||e.redirect||"follow",headers:l,parsedURL:n,signal:f,referrer:c},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[ye].method}get url(){return Up(this[ye].parsedURL)}get headers(){return this[ye].headers}get redirect(){return this[ye].redirect}get signal(){return this[ye].signal}get referrer(){if(this[ye].referrer==="no-referrer")return"";if(this[ye].referrer==="client")return"about:client";if(this[ye].referrer)return this[ye].referrer.toString()}get referrerPolicy(){return this[ye].referrerPolicy}set referrerPolicy(e){this[ye].referrerPolicy=Rl(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Pt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var El=t=>{let{parsedURL:e}=t[ye],r=new He(t[ye].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let f=hl(t);typeof f=="number"&&!Number.isNaN(f)&&(n=String(f))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=_l),t.referrer&&t.referrer!=="no-referrer"?t[ye].referrer=Sl(t):t[ye].referrer="no-referrer",t[ye].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let a=gl(e),l={path:e.pathname+a,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:l}};var Qn=class extends it{constructor(e,r="aborted"){super(e,r)}};Mn();bi();var jp=new Set(["data:","http:","https:"]);async function Xn(t,e){return new Promise((r,n)=>{let i=new Pt(t,e),{parsedURL:a,options:l}=El(i);if(!jp.has(a.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${a.protocol.replace(/:$/,"")}" is not supported.`);if(a.protocol==="data:"){let _=ja(i.url),R=new Ue(_,{headers:{"Content-Type":_.typeFull}});r(R);return}let f=(a.protocol==="https:"?zp:kp).request,{signal:c}=i,h=null,b=()=>{let _=new Qn("The operation was aborted.");n(_),i.body&&i.body instanceof Al.Readable&&i.body.destroy(_),!(!h||!h.body)&&h.body.emit("error",_)};if(c&&c.aborted){b();return}let g=()=>{b(),d()},m=f(a.toString(),l);c&&c.addEventListener("abort",g);let d=()=>{m.abort(),c&&c.removeEventListener("abort",g)};m.on("error",_=>{n(new $e(`request to ${i.url} failed, reason: ${_.message}`,"system",_)),d()}),Gp(m,_=>{h&&h.body&&h.body.destroy(_)}),process.version<"v14"&&m.on("socket",_=>{let R;_.prependListener("end",()=>{R=_._eventsCount}),_.prependListener("close",O=>{if(h&&R<_._eventsCount&&!O){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",h.body.emit("error",x)}})}),m.on("response",_=>{m.setTimeout(0);let R=ml(_.rawHeaders);if(Yn(_.statusCode)){let T=R.get("Location"),v=null;try{v=T===null?null:new URL(T,i.url)}catch{if(i.redirect!=="manual"){n(new $e(`uri requested responds with an invalid redirect URL: ${T}`,"invalid-redirect")),d();return}}switch(i.redirect){case"error":n(new $e(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),d();return;case"manual":break;case"follow":{if(v===null)break;if(i.counter>=i.follow){n(new $e(`maximum redirect reached at: ${i.url}`,"max-redirect")),d();return}let F={headers:new He(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:rr(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!tl(i.url,v)||!rl(i.url,v))for(let H of["authorization","www-authenticate","cookie","cookie2"])F.headers.delete(H);if(_.statusCode!==303&&i.body&&e.body instanceof Al.Readable){n(new $e("Cannot follow redirect with body being a readable stream","unsupported-redirect")),d();return}(_.statusCode===303||(_.statusCode===301||_.statusCode===302)&&i.method==="POST")&&(F.method="GET",F.body=void 0,F.headers.delete("content-length"));let B=wl(R);B&&(F.referrerPolicy=B),r(Xn(new Pt(v,F))),d();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}c&&_.once("end",()=>{c.removeEventListener("abort",g)});let O=ir(_,new Tl,T=>{T&&n(T)});process.version<"v12.10"&&_.on("aborted",g);let x={url:i.url,status:_.statusCode,statusText:_.statusMessage,headers:R,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},D=R.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||D===null||_.statusCode===204||_.statusCode===304){h=new Ue(O,x),r(h);return}let L={flush:sr.Z_SYNC_FLUSH,finishFlush:sr.Z_SYNC_FLUSH};if(D==="gzip"||D==="x-gzip"){O=ir(O,sr.createGunzip(L),T=>{T&&n(T)}),h=new Ue(O,x),r(h);return}if(D==="deflate"||D==="x-deflate"){let T=ir(_,new Tl,v=>{v&&n(v)});T.once("data",v=>{(v[0]&15)===8?O=ir(O,sr.createInflate(),F=>{F&&n(F)}):O=ir(O,sr.createInflateRaw(),F=>{F&&n(F)}),h=new Ue(O,x),r(h)}),T.once("end",()=>{h||(h=new Ue(O,x),r(h))});return}if(D==="br"){O=ir(O,sr.createBrotliDecompress(),T=>{T&&n(T)}),h=new Ue(O,x),r(h);return}h=new Ue(O,x),r(h)}),dl(m,i).catch(n)})}function Gp(t,e){let r=Kn.from(`0\r
27
27
  \r
28
- `),n=!1,i=!1,a;t.on("response",l=>{let{headers:f}=l;n=f["transfer-encoding"]==="chunked"&&!f["content-length"]}),t.on("socket",l=>{let f=()=>{if(n&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},c=h=>{i=Kn.compare(h.slice(-5),r)===0,!i&&a&&(i=Kn.compare(a.slice(-3),r.slice(0,3))===0&&Kn.compare(h.slice(-2),r.slice(3))===0),a=h};l.prependListener("close",f),l.on("data",c),t.on("close",()=>{l.removeListener("close",f),l.removeListener("data",c)})})}var Th=Fe(Jl(),1),Ch=Fe(Ti(),1),ie=Fe(Kc(),1),xh=Fe(tf(),1),vh=Fe(gf(),1);import{cwd as l_,stdout as u_,argv as c_,env as Cs,exit as uh,versions as f_}from"node:process";import{join as vs,dirname as Oh,basename as yo,resolve as xs}from"node:path";import{lstatSync as ch,readFileSync as fh,truncateSync as h_,writeFileSync as d_,accessSync as p_}from"node:fs";var dy=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],py={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"};function gs(t,{now:e,noAffix:r=!1,times:n=dy,nowThreshold:i=2e3,nowString:a="now",aliases:l=!1,aliasesMap:f=py}={}){if(t=typeof t=="number"?t:Date.parse(t),e=e?typeof e=="number"?e:Date.parse(e):new Date,Number.isNaN(t))return"unknown";let c=!1,h=e-t;if(h<0&&(c=!0,h=Math.abs(h)),h<i)return a;let b,g;for(let d=0,_=n.length;d<_;d++){let R=n[d];if(!(h>=R[1])){b=Math.floor(h/R[0]),g=R[2]+(b>1?"s":"");break}}let m=`${c&&!r?"in ":""}${b} ${g}${!c&&!r?" ago":""}`;return l?f[m]??m:m}import Xi from"node:process";import my from"node:os";import bf from"node:tty";function ke(t,e=globalThis.Deno?globalThis.Deno.args:Xi.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:fe}=Xi,bs;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?bs=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(bs=1);function gy(){if("FORCE_COLOR"in fe)return fe.FORCE_COLOR==="true"?1:fe.FORCE_COLOR==="false"?0:fe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(fe.FORCE_COLOR,10),3)}function by(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function yy(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=gy();n!==void 0&&(bs=n);let i=r?bs:n;if(i===0)return 0;if(r){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if("TF_BUILD"in fe&&"AGENT_NAME"in fe)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(fe.TERM==="dumb")return a;if(Xi.platform==="win32"){let l=my.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in fe)return"GITHUB_ACTIONS"in fe||"GITEA_ACTIONS"in fe?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(l=>l in fe)||fe.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(fe.TEAMCITY_VERSION)?1:0;if(fe.COLORTERM==="truecolor"||fe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in fe){let l=Number.parseInt((fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(fe.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(fe.TERM)||"COLORTERM"in fe?1:a}function yf(t,e={}){let r=yy(t,{streamIsTTY:t&&t.isTTY,...e});return by(r)}var _y={stdout:yf({isTTY:bf.isatty(1)}),stderr:yf({isTTY:bf.isatty(2)})},_f=_y;var Rf=!0;function Sf(){Rf=!1}function Zi(t,e,r){return Rf?`\x1B[${e}m${t.join(" ")}\x1B[${r}m`:t.join(" ")}var Ji=(...t)=>Zi(t,31,39),dr=(...t)=>Zi(t,32,39);var ys=(...t)=>Zi(t,35,39);var Ry=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var eo=new Set(["__proto__","prototype","constructor"]),Sy=new Set("0123456789");function wy(t){let e=[],r="",n="start",i=!1;for(let a of t)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=a;break}if(eo.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=a;break}if(n==="property"){if(eo.has(r))return[];e.push(r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Sy.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),n){case"property":{if(eo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Ey(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function wf(t,e,r){if(!Ry(t)||typeof e!="string")return r===void 0?t:r;let n=wy(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){let a=n[i];if(Ey(t,a)?t=i===n.length-1?void 0:null:t=t[a],t==null){if(i!==n.length-1)return r;break}}return t===void 0?r:t}var to=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ef=t=>globalThis.DOMException===void 0?new to(t):new DOMException(t),Af=t=>{let e=t.reason===void 0?Ef("This operation was aborted."):t.reason;return e instanceof Error?e:Ef(e)};async function ro(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:i}={}){return new Promise((a,l)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let f=[],c=[],h=new Map,b=!1,g=!1,m=!1,d=0,_=0,R=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),O=D=>{b=!0,g=!0,l(D)};i&&(i.aborted&&O(Af(i)),i.addEventListener("abort",()=>{O(Af(i))}));let x=async()=>{if(g)return;let D=await R.next(),L=_;if(_++,D.done){if(m=!0,d===0&&!g){if(!n&&c.length>0){O(new AggregateError(c));return}if(g=!0,h.size===0){a(f);return}let T=[];for(let[v,F]of f.entries())h.get(v)!==Tf&&T.push(F);a(T)}return}d++,(async()=>{try{let T=await D.value;if(g)return;let v=await e(T,L);v===Tf&&h.set(L,v),f[L]=v,d--,await x()}catch(T){if(n)O(T);else{c.push(T),d--;try{await x()}catch(v){O(v)}}}})()};(async()=>{for(let D=0;D<r;D++){try{await x()}catch(L){O(L);break}if(m||b)break}})()})}var Tf=Symbol("skip");async function no(t,e){return ro(t,r=>r(),e)}function pr(t,e){var r=0,n,i;e=e||{};function a(){var l=n,f=arguments.length,c,h;e:for(;l;){if(l.args.length!==arguments.length){l=l.next;continue}for(h=0;h<f;h++)if(l.args[h]!==arguments[h]){l=l.next;continue e}return l!==n&&(l===i&&(i=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}for(c=new Array(f),h=0;h<f;h++)c[h]=arguments[h];return l={args:c,val:t.apply(null,c)},n?(n.prev=l,l.next=n):i=l,r===e.maxSize?(i=i.prev,i.next=null):r++,n=l,l.val}return a.clear=function(){n=null,i=null,r=0},a}var Ao=Fe(jf(),1),_r;globalThis.fetch&&!f_?.node?_r=globalThis.fetch:_r=ci(Xn,{undici:!1});var $h=96,ut="\0",m_=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,g_=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,To=/^[0-9a-f]{7,}$/i,hh=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Os=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),b_=pr(vh.default.fromUrl),_o=pr(Th.default),$s=pr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),y_=new Set(["patch"]),__=new Set(["patch","minor"]),R_=new Set(["patch","minor","major"]),Ih="15.0.1",Z=(0,Ah.default)(c_.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(Z["no-color"]||!_f.stdout)&&Sf();var br=on(Wt(Z.greatest)),Ro=on(Wt(Z.prerelease)),So=on(Wt(Z.release)),dh=on(Wt(Z.patch)),ph=on(Wt(Z.minor)),mh=Wt(Z["allow-downgrade"]),et=(0,Ch.default)("npm",{registry:"https://registry.npmjs.org"}),wo={npmrc:et,recursive:!0},gh=Z.githubapi?$s(Z.githubapi):"https://api.github.com",S_=Z.pypiapi?$s(Z.pypiapi):"https://pypi.org",Lh=typeof Z.sockets=="number"?parseInt(Z.sockets):$h;function Mt(t,e){for(let r of e instanceof Set?e:[])if(r.test(t))return!0;return!1}var w_=pr((t,e)=>{let r=e[`${t}:registry`]||e.registry;return r.endsWith("/")?r:`${r}/`});function Ph(t,e,r){let n=vs(e,t);try{return p_(n),n}catch{}let i=Oh(e);return r&&n===r||i===e?null:Ph(t,i,r)}function E_(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],n=$s(w_(r,et));if(n!==e)try{let i=_o(n,wo);if(i?.token)return[i,n]}catch{}return[_o(e,wo),e]}else return[_o(e,wo),e]}var Nh=pr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${Ih}`,...r&&{Authorization:`${e} ${r}`}}}));async function A_(t,e,r,n){let[i,a]=E_(t,r),f=(e==="resolutions"?D_(t):t).replace(/\//g,"%2f"),c=`${a}/${f}`;Z.verbose&&console.error(`${ys("fetch")} ${c}`);let h=await _r(c,Nh(n,i?.type,i?.token));if(h?.ok)return Z.verbose&&console.error(`${dr("done")} ${c}`),[await h.json(),e,a,t];throw h?.status&&h?.statusText?new Error(`Received ${h.status} ${h.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function T_(t,e,r){let n=`${S_}/pypi/${t}/json`;Z.verbose&&console.error(`${ys("fetch")} ${n}`);let i=await _r(n,Nh(r));if(i?.ok)return Z.verbose&&console.error(`${dr("done")} ${n}`),[await i.json(),e,null,t];throw i?.status&&i?.statusText?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function bh({repository:t,homepage:e,info:r},n,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(n==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let f=typeof t=="string"?t:t.url,c=b_(f),h=c?.browse?.();h&&(a=h),a&&t.directory&&c.treepath&&(a=`${a}/${c.treepath}/HEAD/${t.directory}`),!a&&t?.url&&/^https?:/.test(t.url)&&(a=t.url),!a&&f&&(a=f)}let l=a||e||"";if(l){let f=new URL(l);f.protocol==="http:"&&f.hostname==="github.com"&&(f.protocol="https:",l=String(f))}return l}function yh(t){Z.json?console.info(JSON.stringify({message:t})):console.info(t),yr()}function yr(t){if(t){let e=t.stack||t.message;Z.json?console.info(JSON.stringify({error:e})):console.info(Ji(e))}process.exit(t?1:0)}function C_(t={}){for(let r of Object.keys(t))for(let n of Object.values(t[r]))"oldPrint"in n&&(n.old=n.oldPrint,delete n.oldPrint),"newPrint"in n&&(n.new=n.newPrint,delete n.newPrint),"oldOriginal"in n&&(n.old=n.oldOriginal,delete n.oldOriginal);let e=0;for(let r of Object.keys(t))e+=Object.keys(t[r]).length;if(Z.json){let r={results:{}};for(let n of Object.keys(t))for(let[i,a]of Object.entries(t[n])){let[l,f]=i.split(ut);r.results[n]||(r.results[n]={}),r.results[n][l]||(r.results[n][l]={}),r.results[n][l][f]=a}console.info(JSON.stringify(r))}else e&&console.info(v_(t));return Z["error-on-outdated"]?e?2:0:Z["error-on-unchanged"]?e?0:2:0}async function x_(t,e){let{platform:r}=await import("node:os"),n=r()==="win32";n&&h_(t,0),d_(t,e,n?{flag:"r+"}:void 0)}function _h(t,e,r){if(t===e)return t;let n=t.split(/\./),i=e.split(/\./),a=/^[0-9a-zA-Z-.]+$/,l="";for(let f=0;f<n.length;f++)if(n[f]!==i[f]){a.test(n[f])?l+=r(n.slice(f).join(".")):l+=n[f].split("").map(c=>a.test(c)?r(c):c).join("")+r(`.${n.slice(f+1).join(".")}`);break}else l+=`${n[f]}.`;return l}function v_(t){let e=[["NAME","OLD","NEW","AGE","INFO"]],r=new Set;for(let n of Object.keys(t))for(let[i,a]of Object.entries(t[n])){let l=i.split(ut)[1],f=`${n}|${l}`;r.has(f)||(r.add(f),e.push([l,_h(a.old,a.new,Ji),_h(a.new,a.old,dr),a.age||"",a.info]))}return(0,xh.default)(e,{hsep:" ",stringLength:n=>n.replace(ni(),"").length})}function O_(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ut)[1],a=e[n].oldOriginal||e[n].old,l=new RegExp(`"${Os(i)}": *"${Os(a)}"`,"g");r=r.replace(l,`"${i}": "${e[n].new}"`)}return r}function $_(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ut)[1],a=e[n].oldOriginal||e[n].old,l=new RegExp(`${Os(i)} *= *"${Os(a)}"`,"g");r=r.replace(l,`${i} = "${e[n].new}"`)}return r}function I_(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Eo(t){let e=(0,ie.parse)(t);return e?!!e.prerelease.length:!1}function Hh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function L_(t){try{return(0,ie.coerce)(t).version}catch{return null}}function P_(t,e,{range:r,semvers:n,usePre:i,useRel:a,useGreatest:l}={}){let f=L_(r),c=0;n=new Set(n),i=Hh(r)||i,i&&(n.add("prerelease"),n.has("patch")&&n.add("prepatch"),n.has("minor")&&n.add("preminor"),n.has("major")&&n.add("premajor"));for(let h of e){let b=(0,ie.parse)(h);if(b.prerelease.length&&(!i||a))continue;let g=(0,ie.diff)(f,b.version);if(!(!g||!n.has(g)))if(l||!("time"in t))(0,ie.gte)((0,ie.coerce)(b.version).version,f)&&(f=b.version);else{let m=new Date(t.time[h]).getTime();m>=0&&m>c&&(f=b.version,c=m)}}return f||null}function N_(t,{mode:e,range:r,useGreatest:n,useRel:i,usePre:a,semvers:l}={}){if(r==="*"||r.includes("||"))return null;let f=Object.keys(e==="pypi"?t.releases:t.versions).filter(h=>(0,ie.valid)(h)),c=P_(t,f,{range:r,semvers:l,usePre:a,useRel:i,useGreatest:n});if(n)return c;{let h,b;e==="pypi"?(b=t.info.version,h=(0,ie.coerce)(t.info.version).version):h=t["dist-tags"].latest;let g=(0,ie.coerce)(r).version,m=Hh(r),d=Eo(c),_=Eo(h),R=(0,ie.gt)(c,g);if(!i&&a||m&&d||i&&!R&&m&&!d||m&&!d&&R)return c;if(m&&!d&&!R)return null;let O=(0,ie.diff)(g,h);return O&&O!=="prerelease"&&!l.has(O.replace(/^pre/,""))||i&&Eo(h)?c:(0,ie.lt)(h,g)&&!_?mh===!0||Mt(t.name,mh)?h:null:b??h}}async function H_([t,e],{useGreatest:r}={}){let n=e.old.replace(m_,""),[i,a,l,f]=g_.exec(n)||[];if(!(!a||!l||!f))if(To.test(f)){let c={maxSockets:Lh},h=Cs.UPDATES_GITHUB_API_TOKEN||Cs.GITHUB_API_TOKEN||Cs.GH_TOKEN||Cs.HOMEBREW_GITHUB_API_TOKEN;h&&(c.headers={Authorization:`Bearer ${h}`});let b=`${gh}/repos/${a}/${l}/commits`;Z.verbose&&console.error(`${ys("fetch")} ${b}`);let g=await _r(b,c);if(Z.verbose&&g?.ok&&console.error(`${dr("done")} ${b}`),!g||!g.ok)return;let m=await g.json(),{sha:d,commit:_}=m[0];if(!d||!d.length)return;let R=_?.committer?.date??_?.author?.date;if(d=d.substring(0,f.length),f!==d){let O=e.old.replace(f,d);return{key:t,newRange:O,user:a,repo:l,oldRef:f,newRef:d,newDate:R}}}else{let c=await _r(`${gh}/repos/${a}/${l}/git/refs/tags`);if(!c||!c.ok)return;let b=(await c.json()).map(m=>m.ref.replace(/^refs\/tags\//,"")),g=f.replace(/^v/,"");if(!(0,ie.valid)(g))return;if(r){let m=f,d=f.replace(/^v/,"");for(let _ of b){let R=_.replace(/^v/,"");(0,ie.valid)(R)&&(!m||(0,ie.gt)(R,d))&&(m=_,d=R)}if((0,ie.neq)(g,d))return{key:t,newRange:m,user:a,repo:l,oldRef:f,newRef:m}}else{let m=b[b.length-1],d=m.replace(/^v/,"");if(!(0,ie.valid)(d))return;if((0,ie.neq)(g,d))return{key:t,newRange:m,user:a,repo:l,oldRef:f,newRef:m}}}}function D_(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function B_(t){let e=t.match(hh);return e?.length!==1?t:t.replace(hh,(0,ie.coerce)(e[0]))}function Wt(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}function Rh(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}async function Sh(t=[]){return[...(await import("node:tls")).rootCertificates,...t]}function Co(t,e){return e?/\/.+\//.test(t)?new RegExp(t.slice(1,-1)):Ao.default.makeRe(t):t instanceof RegExp?t:Ao.default.makeRe(t)}function on(t){if(t instanceof Set){let e=new Set;for(let r of t)e.add(Co(r,!0));return e}return t}function wh(t,e){let r=new Set;for(let n of t||[])r.add(Co(n,!0));for(let n of e||[])r.add(Co(n,!1));return r}function Eh(t,e,{include:r,exclude:n}){if(e==="pypi"&&t==="python")return!1;if(!r.size&&!n.size)return!0;for(let i of n)if(i.test(t))return!1;for(let i of r)if(i.test(t))return!0;return!1}function F_(t){let e=new Set;if(t)for(let r of t){let n;try{n=ch(r)}catch(i){throw new Error(`Unable to open ${r}: ${i.message}`)}if(n?.isFile())e.add(xs(r));else if(n?.isDirectory())for(let i of["package.json","pyproject.toml"]){let a=vs(r,i),l;try{l=ch(a)}catch{}l?.isFile()&&e.add(xs(a))}else throw new Error(`${r} is neither a file nor directory`)}else for(let r of["package.json","pyproject.toml"]){let n=l_(),i=Ph(r,n);i&&e.add(xs(i))}return e}async function q_(){for(let m of[process.stdout,process.stderr])m?._handle?.setBlocking?.(!0);let{help:t,version:e,file:r,types:n,update:i}=Z;t&&(u_.write(`usage: updates [options]
28
+ `),n=!1,i=!1,a;t.on("response",l=>{let{headers:f}=l;n=f["transfer-encoding"]==="chunked"&&!f["content-length"]}),t.on("socket",l=>{let f=()=>{if(n&&!i){let h=new Error("Premature close");h.code="ERR_STREAM_PREMATURE_CLOSE",e(h)}},c=h=>{i=Kn.compare(h.slice(-5),r)===0,!i&&a&&(i=Kn.compare(a.slice(-3),r.slice(0,3))===0&&Kn.compare(h.slice(-2),r.slice(3))===0),a=h};l.prependListener("close",f),l.on("data",c),t.on("close",()=>{l.removeListener("close",f),l.removeListener("data",c)})})}var Th=Fe(Jl(),1),Ch=Fe(Ti(),1),ie=Fe(Kc(),1),xh=Fe(tf(),1),vh=Fe(gf(),1);import{cwd as l_,stdout as u_,argv as c_,env as Cs,exit as uh,versions as f_}from"node:process";import{join as vs,dirname as Oh,basename as yo,resolve as xs}from"node:path";import{lstatSync as ch,readFileSync as fh,truncateSync as h_,writeFileSync as d_,accessSync as p_}from"node:fs";var dy=[[1e3,6e4,"sec"],[6e4,36e5,"min"],[36e5,864e5,"hour"],[864e5,6048e5,"day"],[6048e5,2628e6,"week"],[2628e6,31536e6,"month"],[31536e6,1/0,"year"]],py={"1 day ago":"yesterday","1 week ago":"last week","1 month ago":"last month","1 year ago":"last year","in 1 day":"tomorrow","in 1 week":"next week","in 1 month":"next month","in 1 year":"next year"};function gs(t,{now:e,noAffix:r=!1,times:n=dy,nowThreshold:i=2e3,nowString:a="now",aliases:l=!1,aliasesMap:f=py}={}){if(t=typeof t=="number"?t:Date.parse(t),e=e?typeof e=="number"?e:Date.parse(e):new Date,Number.isNaN(t))return"unknown";let c=!1,h=e-t;if(h<0&&(c=!0,h=Math.abs(h)),h<i)return a;let b,g;for(let d=0,_=n.length;d<_;d++){let R=n[d];if(!(h>=R[1])){b=Math.floor(h/R[0]),g=R[2]+(b>1?"s":"");break}}let m=`${c&&!r?"in ":""}${b} ${g}${!c&&!r?" ago":""}`;return l?f[m]??m:m}import Xi from"node:process";import my from"node:os";import bf from"node:tty";function ke(t,e=globalThis.Deno?globalThis.Deno.args:Xi.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:fe}=Xi,bs;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?bs=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(bs=1);function gy(){if("FORCE_COLOR"in fe)return fe.FORCE_COLOR==="true"?1:fe.FORCE_COLOR==="false"?0:fe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(fe.FORCE_COLOR,10),3)}function by(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function yy(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=gy();n!==void 0&&(bs=n);let i=r?bs:n;if(i===0)return 0;if(r){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if("TF_BUILD"in fe&&"AGENT_NAME"in fe)return 1;if(t&&!e&&i===void 0)return 0;let a=i||0;if(fe.TERM==="dumb")return a;if(Xi.platform==="win32"){let l=my.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in fe)return"GITHUB_ACTIONS"in fe||"GITEA_ACTIONS"in fe?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(l=>l in fe)||fe.CI_NAME==="codeship"?1:a;if("TEAMCITY_VERSION"in fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(fe.TEAMCITY_VERSION)?1:0;if(fe.COLORTERM==="truecolor"||fe.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in fe){let l=Number.parseInt((fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(fe.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(fe.TERM)||"COLORTERM"in fe?1:a}function yf(t,e={}){let r=yy(t,{streamIsTTY:t&&t.isTTY,...e});return by(r)}var _y={stdout:yf({isTTY:bf.isatty(1)}),stderr:yf({isTTY:bf.isatty(2)})},_f=_y;var Rf=!0;function Sf(){Rf=!1}function Zi(t,e,r){return Rf?`\x1B[${e}m${t.join(" ")}\x1B[${r}m`:t.join(" ")}var Ji=(...t)=>Zi(t,31,39),dr=(...t)=>Zi(t,32,39);var ys=(...t)=>Zi(t,35,39);var Ry=t=>{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var eo=new Set(["__proto__","prototype","constructor"]),Sy=new Set("0123456789");function wy(t){let e=[],r="",n="start",i=!1;for(let a of t)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=a;break}if(eo.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=a;break}if(n==="property"){if(eo.has(r))return[];e.push(r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Sy.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),n){case"property":{if(eo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Ey(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function wf(t,e,r){if(!Ry(t)||typeof e!="string")return r===void 0?t:r;let n=wy(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){let a=n[i];if(Ey(t,a)?t=i===n.length-1?void 0:null:t=t[a],t==null){if(i!==n.length-1)return r;break}}return t===void 0?r:t}var to=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ef=t=>globalThis.DOMException===void 0?new to(t):new DOMException(t),Af=t=>{let e=t.reason===void 0?Ef("This operation was aborted."):t.reason;return e instanceof Error?e:Ef(e)};async function ro(t,e,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:i}={}){return new Promise((a,l)=>{if(t[Symbol.iterator]===void 0&&t[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof t})`);if(typeof e!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let f=[],c=[],h=new Map,b=!1,g=!1,m=!1,d=0,_=0,R=t[Symbol.iterator]===void 0?t[Symbol.asyncIterator]():t[Symbol.iterator](),O=D=>{b=!0,g=!0,l(D)};i&&(i.aborted&&O(Af(i)),i.addEventListener("abort",()=>{O(Af(i))}));let x=async()=>{if(g)return;let D=await R.next(),L=_;if(_++,D.done){if(m=!0,d===0&&!g){if(!n&&c.length>0){O(new AggregateError(c));return}if(g=!0,h.size===0){a(f);return}let T=[];for(let[v,F]of f.entries())h.get(v)!==Tf&&T.push(F);a(T)}return}d++,(async()=>{try{let T=await D.value;if(g)return;let v=await e(T,L);v===Tf&&h.set(L,v),f[L]=v,d--,await x()}catch(T){if(n)O(T);else{c.push(T),d--;try{await x()}catch(v){O(v)}}}})()};(async()=>{for(let D=0;D<r;D++){try{await x()}catch(L){O(L);break}if(m||b)break}})()})}var Tf=Symbol("skip");async function no(t,e){return ro(t,r=>r(),e)}function pr(t,e){var r=0,n,i;e=e||{};function a(){var l=n,f=arguments.length,c,h;e:for(;l;){if(l.args.length!==arguments.length){l=l.next;continue}for(h=0;h<f;h++)if(l.args[h]!==arguments[h]){l=l.next;continue e}return l!==n&&(l===i&&(i=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}for(c=new Array(f),h=0;h<f;h++)c[h]=arguments[h];return l={args:c,val:t.apply(null,c)},n?(n.prev=l,l.next=n):i=l,r===e.maxSize?(i=i.prev,i.next=null):r++,n=l,l.val}return a.clear=function(){n=null,i=null,r=0},a}var Ao=Fe(jf(),1),_r;globalThis.fetch&&!f_?.node?_r=globalThis.fetch:_r=ci(Xn,{undici:!1});var $h=96,ut="\0",m_=/^.*?:\/\/(.*?@)?(github\.com[:/])/i,g_=/^([^/]+)\/([^/#]+)?.*?\/([0-9a-f]+|v?[0-9]+\.[0-9]+\.[0-9]+)$/i,To=/^[0-9a-f]{7,}$/i,hh=/[0-9]+(\.[0-9]+)?(\.[0-9]+)?/g,Os=t=>t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"),b_=pr(vh.default.fromUrl),_o=pr(Th.default),$s=pr(t=>t.endsWith("/")?t.substring(0,t.length-1):t),y_=new Set(["patch"]),__=new Set(["patch","minor"]),R_=new Set(["patch","minor","major"]),Ih="15.0.2",Z=(0,Ah.default)(c_.slice(2),{boolean:["E","error-on-outdated","U","error-on-unchanged","h","help","j","json","n","no-color","u","update","v","version","V","verbose"],string:["d","allow-downgrade","f","file","g","greatest","m","minor","P","patch","p","prerelease","R","release","r","registry","t","types","githubapi","pypiapi"],alias:{d:"allow-downgrade",E:"error-on-outdated",U:"error-on-unchanged",e:"exclude",f:"file",g:"greatest",h:"help",i:"include",j:"json",m:"minor",n:"no-color",P:"patch",p:"prerelease",r:"registry",R:"release",s:"semver",S:"sockets",t:"types",u:"update",v:"version",V:"verbose"}});(Z["no-color"]||!_f.stdout)&&Sf();var br=on(Wt(Z.greatest)),Ro=on(Wt(Z.prerelease)),So=on(Wt(Z.release)),dh=on(Wt(Z.patch)),ph=on(Wt(Z.minor)),mh=Wt(Z["allow-downgrade"]),et=(0,Ch.default)("npm",{registry:"https://registry.npmjs.org"}),wo={npmrc:et,recursive:!0},gh=Z.githubapi?$s(Z.githubapi):"https://api.github.com",S_=Z.pypiapi?$s(Z.pypiapi):"https://pypi.org",Lh=typeof Z.sockets=="number"?parseInt(Z.sockets):$h;function Mt(t,e){for(let r of e instanceof Set?e:[])if(r.test(t))return!0;return!1}var w_=pr((t,e)=>{let r=e[`${t}:registry`]||e.registry;return r.endsWith("/")?r:`${r}/`});function Ph(t,e,r){let n=vs(e,t);try{return p_(n),n}catch{}let i=Oh(e);return r&&n===r||i===e?null:Ph(t,i,r)}function E_(t,e){if(t.startsWith("@")){let r=(/@[a-z0-9][\w-.]+/.exec(t)||[])[0],n=$s(w_(r,et));if(n!==e)try{let i=_o(n,wo);if(i?.token)return[i,n]}catch{}return[_o(e,wo),e]}else return[_o(e,wo),e]}var Nh=pr((t,e,r)=>({...Object.keys(t).length&&{agentOpts:t},headers:{"user-agent":`updates/${Ih}`,...r&&{Authorization:`${e} ${r}`}}}));async function A_(t,e,r,n){let[i,a]=E_(t,r),f=(e==="resolutions"?D_(t):t).replace(/\//g,"%2f"),c=`${a}/${f}`;Z.verbose&&console.error(`${ys("fetch")} ${c}`);let h=await _r(c,Nh(n,i?.type,i?.token));if(h?.ok)return Z.verbose&&console.error(`${dr("done")} ${c}`),[await h.json(),e,a,t];throw h?.status&&h?.statusText?new Error(`Received ${h.status} ${h.statusText} for ${t} from ${a}`):new Error(`Unable to fetch ${t} from ${a}`)}async function T_(t,e,r){let n=`${S_}/pypi/${t}/json`;Z.verbose&&console.error(`${ys("fetch")} ${n}`);let i=await _r(n,Nh(r));if(i?.ok)return Z.verbose&&console.error(`${dr("done")} ${n}`),[await i.json(),e,null,t];throw i?.status&&i?.statusText?new Error(`Received ${i.status} ${i.statusText} for ${t} from PyPi`):new Error(`Unable to fetch ${t} from PyPi`)}function bh({repository:t,homepage:e,info:r},n,i){r&&(t=r.project_urls.repository||r.project_urls.Repository||r.project_urls.repo||r.project_urls.Repo||r.project_urls.source||r.project_urls.Source||r.project_urls["source code"]||r.project_urls["Source Code"]||r.project_urls.homepage||r.project_urls.Homepage||`https://pypi.org/project/${i}/`);let a;if(n==="https://npm.pkg.github.com")return`https://github.com/${i.replace(/^@/,"")}`;if(t){let f=typeof t=="string"?t:t.url,c=b_(f),h=c?.browse?.();h&&(a=h),a&&t.directory&&c.treepath&&(a=`${a}/${c.treepath}/HEAD/${t.directory}`),!a&&t?.url&&/^https?:/.test(t.url)&&(a=t.url),!a&&f&&(a=f)}let l=a||e||"";if(l){let f=new URL(l);f.protocol==="http:"&&f.hostname==="github.com"&&(f.protocol="https:",l=String(f))}return l}function yh(t){Z.json?console.info(JSON.stringify({message:t})):console.info(t),yr()}function yr(t){if(t){let e=t.stack||t.message;Z.json?console.info(JSON.stringify({error:e})):console.info(Ji(e))}process.exit(t?1:0)}function C_(t={}){for(let r of Object.keys(t))for(let n of Object.values(t[r]))"oldPrint"in n&&(n.old=n.oldPrint,delete n.oldPrint),"newPrint"in n&&(n.new=n.newPrint,delete n.newPrint),"oldOriginal"in n&&(n.old=n.oldOriginal,delete n.oldOriginal);let e=0;for(let r of Object.keys(t))e+=Object.keys(t[r]).length;if(Z.json){let r={results:{}};for(let n of Object.keys(t))for(let[i,a]of Object.entries(t[n])){let[l,f]=i.split(ut);r.results[n]||(r.results[n]={}),r.results[n][l]||(r.results[n][l]={}),r.results[n][l][f]=a}console.info(JSON.stringify(r))}else e&&console.info(v_(t));return Z["error-on-outdated"]?e?2:0:Z["error-on-unchanged"]?e?0:2:0}async function x_(t,e){let{platform:r}=await import("node:os"),n=r()==="win32";n&&h_(t,0),d_(t,e,n?{flag:"r+"}:void 0)}function _h(t,e,r){if(t===e)return t;let n=t.split(/\./),i=e.split(/\./),a=/^[0-9a-zA-Z-.]+$/,l="";for(let f=0;f<n.length;f++)if(n[f]!==i[f]){a.test(n[f])?l+=r(n.slice(f).join(".")):l+=n[f].split("").map(c=>a.test(c)?r(c):c).join("")+r(`.${n.slice(f+1).join(".")}`);break}else l+=`${n[f]}.`;return l}function v_(t){let e=[["NAME","OLD","NEW","AGE","INFO"]],r=new Set;for(let n of Object.keys(t))for(let[i,a]of Object.entries(t[n])){let l=i.split(ut)[1],f=`${n}|${l}`;r.has(f)||(r.add(f),e.push([l,_h(a.old,a.new,Ji),_h(a.new,a.old,dr),a.age||"",a.info]))}return(0,xh.default)(e,{hsep:" ",stringLength:n=>n.replace(ni(),"").length})}function O_(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ut)[1],a=e[n].oldOriginal||e[n].old,l=new RegExp(`"${Os(i)}": *"${Os(a)}"`,"g");r=r.replace(l,`"${i}": "${e[n].new}"`)}return r}function $_(t,e){let r=t;for(let n of Object.keys(e)){let i=n.split(ut)[1],a=e[n].oldOriginal||e[n].old,l=new RegExp(`${Os(i)} *= *"${Os(a)}"`,"g");r=r.replace(l,`${i} = "${e[n].new}"`)}return r}function I_(t,e){return t.replace(/[0-9]+\.[0-9]+\.[0-9]+(-.+)?/g,e)}function Eo(t){let e=(0,ie.parse)(t);return e?!!e.prerelease.length:!1}function Hh(t){return/[0-9]+\.[0-9]+\.[0-9]+-.+/.test(t)}function L_(t){try{return(0,ie.coerce)(t).version}catch{return null}}function P_(t,e,{range:r,semvers:n,usePre:i,useRel:a,useGreatest:l}={}){let f=L_(r),c=0;n=new Set(n),i=Hh(r)||i,i&&(n.add("prerelease"),n.has("patch")&&n.add("prepatch"),n.has("minor")&&n.add("preminor"),n.has("major")&&n.add("premajor"));for(let h of e){let b=(0,ie.parse)(h);if(b.prerelease.length&&(!i||a))continue;let g=(0,ie.diff)(f,b.version);if(!(!g||!n.has(g)))if(l||!("time"in t))(0,ie.gte)((0,ie.coerce)(b.version).version,f)&&(f=b.version);else{let m=new Date(t.time[h]).getTime();m>=0&&m>c&&(f=b.version,c=m)}}return f||null}function N_(t,{mode:e,range:r,useGreatest:n,useRel:i,usePre:a,semvers:l}={}){if(r==="*"||r.includes("||"))return null;let f=Object.keys(e==="pypi"?t.releases:t.versions).filter(h=>(0,ie.valid)(h)),c=P_(t,f,{range:r,semvers:l,usePre:a,useRel:i,useGreatest:n});if(n)return c;{let h,b;e==="pypi"?(b=t.info.version,h=(0,ie.coerce)(t.info.version).version):h=t["dist-tags"].latest;let g=(0,ie.coerce)(r).version,m=Hh(r),d=Eo(c),_=Eo(h),R=(0,ie.gt)(c,g);if(!i&&a||m&&d||i&&!R&&m&&!d||m&&!d&&R)return c;if(m&&!d&&!R)return null;let O=(0,ie.diff)(g,h);return O&&O!=="prerelease"&&!l.has(O.replace(/^pre/,""))||i&&Eo(h)?c:(0,ie.lt)(h,g)&&!_?mh===!0||Mt(t.name,mh)?h:null:b??h}}async function H_([t,e],{useGreatest:r}={}){let n=e.old.replace(m_,""),[i,a,l,f]=g_.exec(n)||[];if(!(!a||!l||!f))if(To.test(f)){let c={maxSockets:Lh},h=Cs.UPDATES_GITHUB_API_TOKEN||Cs.GITHUB_API_TOKEN||Cs.GH_TOKEN||Cs.HOMEBREW_GITHUB_API_TOKEN;h&&(c.headers={Authorization:`Bearer ${h}`});let b=`${gh}/repos/${a}/${l}/commits`;Z.verbose&&console.error(`${ys("fetch")} ${b}`);let g=await _r(b,c);if(Z.verbose&&g?.ok&&console.error(`${dr("done")} ${b}`),!g||!g.ok)return;let m=await g.json(),{sha:d,commit:_}=m[0];if(!d||!d.length)return;let R=_?.committer?.date??_?.author?.date;if(d=d.substring(0,f.length),f!==d){let O=e.old.replace(f,d);return{key:t,newRange:O,user:a,repo:l,oldRef:f,newRef:d,newDate:R}}}else{let c=await _r(`${gh}/repos/${a}/${l}/git/refs/tags`);if(!c||!c.ok)return;let b=(await c.json()).map(m=>m.ref.replace(/^refs\/tags\//,"")),g=f.replace(/^v/,"");if(!(0,ie.valid)(g))return;if(r){let m=f,d=f.replace(/^v/,"");for(let _ of b){let R=_.replace(/^v/,"");(0,ie.valid)(R)&&(!m||(0,ie.gt)(R,d))&&(m=_,d=R)}if((0,ie.neq)(g,d))return{key:t,newRange:m,user:a,repo:l,oldRef:f,newRef:m}}else{let m=b[b.length-1],d=m.replace(/^v/,"");if(!(0,ie.valid)(d))return;if((0,ie.neq)(g,d))return{key:t,newRange:m,user:a,repo:l,oldRef:f,newRef:m}}}}function D_(t){let e=t.match(/(@[^/]+\/)?([^/]+)/g)||[];return e[e.length-1]}function B_(t){let e=t.match(hh);return e?.length!==1?t:t.replace(hh,(0,ie.coerce)(e[0]))}function Wt(t){return t===void 0?!1:t===""?!0:typeof t=="string"?t.includes(",")?new Set(t.split(",")):new Set([t]):Array.isArray(t)?new Set(t):!1}function Rh(t){return Array.from(t.matchAll(/(----BEGIN CERT[^]+?IFICATE----)/g),e=>e[0])}async function Sh(t=[]){return[...(await import("node:tls")).rootCertificates,...t]}function Co(t,e){return e?/\/.+\//.test(t)?new RegExp(t.slice(1,-1)):Ao.default.makeRe(t):t instanceof RegExp?t:Ao.default.makeRe(t)}function on(t){if(t instanceof Set){let e=new Set;for(let r of t)e.add(Co(r,!0));return e}return t}function wh(t,e){let r=new Set;for(let n of t||[])r.add(Co(n,!0));for(let n of e||[])r.add(Co(n,!1));return r}function Eh(t,e,{include:r,exclude:n}){if(e==="pypi"&&t==="python")return!1;if(!r.size&&!n.size)return!0;for(let i of n)if(i.test(t))return!1;for(let i of r)if(i.test(t))return!0;return!r.size}function F_(t){let e=new Set;if(t)for(let r of t){let n;try{n=ch(r)}catch(i){throw new Error(`Unable to open ${r}: ${i.message}`)}if(n?.isFile())e.add(xs(r));else if(n?.isDirectory())for(let i of["package.json","pyproject.toml"]){let a=vs(r,i),l;try{l=ch(a)}catch{}l?.isFile()&&e.add(xs(a))}else throw new Error(`${r} is neither a file nor directory`)}else for(let r of["package.json","pyproject.toml"]){let n=l_(),i=Ph(r,n);i&&e.add(xs(i))}return e}async function q_(){for(let m of[process.stdout,process.stderr])m?._handle?.setBlocking?.(!0);let{help:t,version:e,file:r,types:n,update:i}=Z;t&&(u_.write(`usage: updates [options]
29
29
 
30
30
  Options:
31
31
  -u, --update Update versions and write package file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "updates",
3
- "version": "15.0.1",
3
+ "version": "15.0.2",
4
4
  "description": "Flexible npm and poetry dependency update tool",
5
5
  "author": "silverwind",
6
6
  "repository": "silverwind/updates",