dts-linter 0.3.10-beta1 → 0.3.11-beta1
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/dist/THIRD_PARTY_LICENSES.txt +6 -168
- package/dist/dts-linter.js +34 -34
- package/package.json +3 -3
package/dist/dts-linter.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Hl=Object.create;var ls=Object.defineProperty;var Jl=Object.getOwnPropertyDescriptor;var Xl=Object.getOwnPropertyNames;var Yl=Object.getPrototypeOf,Ql=Object.prototype.hasOwnProperty;var le=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Kl=(i,e)=>{for(var t in e)ls(i,t,{get:e[t],enumerable:!0})},eu=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Xl(e))!Ql.call(i,s)&&s!==t&&ls(i,s,{get:()=>e[s],enumerable:!(n=Jl(e,s))||n.enumerable});return i};var ut=(i,e,t)=>(t=i!=null?Hl(Yl(i)):{},eu(e||!i||!i.__esModule?ls(t,"default",{value:i,enumerable:!0}):t,i));var Qt=le(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.stringArray=me.array=me.func=me.error=me.number=me.string=me.boolean=void 0;function tu(i){return i===!0||i===!1}me.boolean=tu;function Po(i){return typeof i=="string"||i instanceof String}me.string=Po;function nu(i){return typeof i=="number"||i instanceof Number}me.number=nu;function iu(i){return i instanceof Error}me.error=iu;function su(i){return typeof i=="function"}me.func=su;function jo(i){return Array.isArray(i)}me.array=jo;function ru(i){return jo(i)&&i.every(e=>Po(e))}me.stringArray=ru});var Ms=le(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.Message=P.NotificationType9=P.NotificationType8=P.NotificationType7=P.NotificationType6=P.NotificationType5=P.NotificationType4=P.NotificationType3=P.NotificationType2=P.NotificationType1=P.NotificationType0=P.NotificationType=P.RequestType9=P.RequestType8=P.RequestType7=P.RequestType6=P.RequestType5=P.RequestType4=P.RequestType3=P.RequestType2=P.RequestType1=P.RequestType=P.RequestType0=P.AbstractMessageSignature=P.ParameterStructures=P.ResponseError=P.ErrorCodes=void 0;var Ct=Qt(),us;(function(i){i.ParseError=-32700,i.InvalidRequest=-32600,i.MethodNotFound=-32601,i.InvalidParams=-32602,i.InternalError=-32603,i.jsonrpcReservedErrorRangeStart=-32099,i.serverErrorStart=-32099,i.MessageWriteError=-32099,i.MessageReadError=-32098,i.PendingResponseRejected=-32097,i.ConnectionInactive=-32096,i.ServerNotInitialized=-32002,i.UnknownErrorCode=-32001,i.jsonrpcReservedErrorRangeEnd=-32e3,i.serverErrorEnd=-32e3})(us||(P.ErrorCodes=us={}));var hs=class i extends Error{constructor(e,t,n){super(t),this.code=Ct.number(e)?e:us.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,i.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};P.ResponseError=hs;var Se=class i{constructor(e){this.kind=e}static is(e){return e===i.auto||e===i.byName||e===i.byPosition}toString(){return this.kind}};P.ParameterStructures=Se;Se.auto=new Se("auto");Se.byPosition=new Se("byPosition");Se.byName=new Se("byName");var H=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Se.auto}};P.AbstractMessageSignature=H;var ds=class extends H{constructor(e){super(e,0)}};P.RequestType0=ds;var fs=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.RequestType=fs;var ps=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.RequestType1=ps;var ms=class extends H{constructor(e){super(e,2)}};P.RequestType2=ms;var gs=class extends H{constructor(e){super(e,3)}};P.RequestType3=gs;var ys=class extends H{constructor(e){super(e,4)}};P.RequestType4=ys;var ws=class extends H{constructor(e){super(e,5)}};P.RequestType5=ws;var vs=class extends H{constructor(e){super(e,6)}};P.RequestType6=vs;var bs=class extends H{constructor(e){super(e,7)}};P.RequestType7=bs;var _s=class extends H{constructor(e){super(e,8)}};P.RequestType8=_s;var xs=class extends H{constructor(e){super(e,9)}};P.RequestType9=xs;var Ss=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.NotificationType=Ss;var ks=class extends H{constructor(e){super(e,0)}};P.NotificationType0=ks;var Es=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.NotificationType1=Es;var Cs=class extends H{constructor(e){super(e,2)}};P.NotificationType2=Cs;var Ts=class extends H{constructor(e){super(e,3)}};P.NotificationType3=Ts;var Rs=class extends H{constructor(e){super(e,4)}};P.NotificationType4=Rs;var Os=class extends H{constructor(e){super(e,5)}};P.NotificationType5=Os;var As=class extends H{constructor(e){super(e,6)}};P.NotificationType6=As;var Ns=class extends H{constructor(e){super(e,7)}};P.NotificationType7=Ns;var Ps=class extends H{constructor(e){super(e,8)}};P.NotificationType8=Ps;var js=class extends H{constructor(e){super(e,9)}};P.NotificationType9=js;var Mo;(function(i){function e(s){let r=s;return r&&Ct.string(r.method)&&(Ct.string(r.id)||Ct.number(r.id))}i.isRequest=e;function t(s){let r=s;return r&&Ct.string(r.method)&&s.id===void 0}i.isNotification=t;function n(s){let r=s;return r&&(r.result!==void 0||!!r.error)&&(Ct.string(r.id)||Ct.number(r.id)||r.id===null)}i.isResponse=n})(Mo||(P.Message=Mo={}))});var Is=le(ht=>{"use strict";var Lo;Object.defineProperty(ht,"__esModule",{value:!0});ht.LRUCache=ht.LinkedMap=ht.Touch=void 0;var ge;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(ge||(ht.Touch=ge={}));var ci=class{constructor(){this[Lo]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=ge.None){let n=this._map.get(e);if(n)return t!==ge.None&&this.touch(n,t),n.value}set(e,t,n=ge.None){let s=this._map.get(e);if(s)s.value=t,n!==ge.None&&this.touch(s,n);else{switch(s={key:e,value:t,next:void 0,previous:void 0},n){case ge.None:this.addItemLast(s);break;case ge.First:this.addItemFirst(s);break;case ge.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}[(Lo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==ge.First&&t!==ge.Last)){if(t===ge.First){if(e===this._head)return;let n=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(n.previous=s,s.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===ge.Last){if(e===this._tail)return;let n=e.next,s=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=s,s.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};ht.LinkedMap=ci;var Ls=class extends ci{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=ge.AsNew){return super.get(e,t)}peek(e){return super.get(e,ge.None)}set(e,t){return super.set(e,t,ge.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};ht.LRUCache=Ls});var Do=le(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.Disposable=void 0;var Io;(function(i){function e(t){return{dispose:t}}i.create=e})(Io||(li.Disposable=Io={}))});var dt=le(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var Ds;function $s(){if(Ds===void 0)throw new Error("No runtime abstraction layer installed");return Ds}(function(i){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Ds=t}i.install=e})($s||($s={}));Fs.default=$s});var en=le(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Emitter=Kt.Event=void 0;var ou=dt(),$o;(function(i){let e={dispose(){}};i.None=function(){return e}})($o||(Kt.Event=$o={}));var Ws=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let s=0,r=this._callbacks.length;s<r;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],n=this._callbacks.slice(0),s=this._contexts.slice(0);for(let r=0,o=n.length;r<o;r++)try{t.push(n[r].apply(s[r],e))}catch(a){(0,ou.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ui=class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new Ws),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Kt.Emitter=ui;ui._noop=function(){}});var fi=le(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.CancellationTokenSource=tn.CancellationToken=void 0;var au=dt(),cu=Qt(),zs=en(),hi;(function(i){i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zs.Event.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zs.Event.None});function e(t){let n=t;return n&&(n===i.None||n===i.Cancelled||cu.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}i.is=e})(hi||(tn.CancellationToken=hi={}));var lu=Object.freeze(function(i,e){let t=(0,au.default)().timer.setTimeout(i.bind(e),0);return{dispose(){t.dispose()}}}),di=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?lu:(this._emitter||(this._emitter=new zs.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},qs=class{get token(){return this._token||(this._token=new di),this._token}cancel(){this._token?this._token.cancel():this._token=hi.Cancelled}dispose(){this._token?this._token instanceof di&&this._token.dispose():this._token=hi.None}};tn.CancellationTokenSource=qs});var Fo=le(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.SharedArrayReceiverStrategy=nn.SharedArraySenderStrategy=void 0;var uu=fi(),Pn;(function(i){i.Continue=0,i.Cancelled=1})(Pn||(Pn={}));var Bs=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),n=new Int32Array(t,0,1);n[0]=Pn.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let n=this.buffers.get(t);if(n===void 0)return;let s=new Int32Array(n,0,1);Atomics.store(s,0,Pn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};nn.SharedArraySenderStrategy=Bs;var Us=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Pn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Vs=class{constructor(e){this.token=new Us(e)}cancel(){}dispose(){}},Zs=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new uu.CancellationTokenSource:new Vs(t)}};nn.SharedArrayReceiverStrategy=Zs});var Hs=le(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.Semaphore=void 0;var hu=dt(),Gs=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,hu.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};pi.Semaphore=Gs});var zo=le(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.ReadableStreamMessageReader=ft.AbstractMessageReader=ft.MessageReader=void 0;var Xs=dt(),sn=Qt(),Js=en(),du=Hs(),Wo;(function(i){function e(t){let n=t;return n&&sn.func(n.listen)&&sn.func(n.dispose)&&sn.func(n.onError)&&sn.func(n.onClose)&&sn.func(n.onPartialMessage)}i.is=e})(Wo||(ft.MessageReader=Wo={}));var mi=class{constructor(){this.errorEmitter=new Js.Emitter,this.closeEmitter=new Js.Emitter,this.partialMessageEmitter=new Js.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${sn.string(e.message)?e.message:"unknown"}`)}};ft.AbstractMessageReader=mi;var Ys;(function(i){function e(t){let n,s,r,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")n=t??"utf-8";else{if(n=t.charset??"utf-8",t.contentDecoder!==void 0&&(r=t.contentDecoder,o.set(r.name,r)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Xs.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}i.fromOptions=e})(Ys||(Ys={}));var Qs=class extends mi{constructor(e,t){super(),this.readable=e,this.options=Ys.fromOptions(t),this.buffer=(0,Xs.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new du.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let s=n.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
-
${JSON.stringify(Object.fromEntries(n))}`));return}let r=parseInt(s);if(isNaN(r)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=r}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(s)}).catch(n=>{this.fireError(n)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Xs.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};
|
|
4
|
-
`,
|
|
5
|
-
`,tr=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,s=0,r=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(s=0;s<l.length;){switch(l[s]){case
|
|
6
|
-
${u}`);let p=u.substr(0,d),f=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,f)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let r=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(r)}if(this._chunks[0].byteLength>e){let r=this._chunks[0],o=this.asNative(r,e);return this._chunks[0]=r.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),n=0,s=0;for(;e>0;){let r=this._chunks[s];if(r.byteLength>e){let o=r.slice(0,e);t.set(o,n),n+=e,this._chunks[s]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}};
|
|
7
|
-
${JSON.stringify(h.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let v=h.id,C=k.get(v);if(
|
|
8
|
-
${JSON.stringify(h,null,4)}`);let v=h;if(X.string(v.id)||X.number(v.id)){let C=v.id,N=k.get(C);N&&N.reject(new Error("The received response has neither a result nor an error property."))}}function
|
|
2
|
+
"use strict";var Gl=Object.create;var ls=Object.defineProperty;var Hl=Object.getOwnPropertyDescriptor;var Jl=Object.getOwnPropertyNames;var Xl=Object.getPrototypeOf,Yl=Object.prototype.hasOwnProperty;var le=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ql=(i,e)=>{for(var t in e)ls(i,t,{get:e[t],enumerable:!0})},Kl=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Jl(e))!Yl.call(i,s)&&s!==t&&ls(i,s,{get:()=>e[s],enumerable:!(n=Hl(e,s))||n.enumerable});return i};var ht=(i,e,t)=>(t=i!=null?Gl(Xl(i)):{},Kl(e||!i||!i.__esModule?ls(t,"default",{value:i,enumerable:!0}):t,i));var Kt=le(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.stringArray=me.array=me.func=me.error=me.number=me.string=me.boolean=void 0;function eu(i){return i===!0||i===!1}me.boolean=eu;function No(i){return typeof i=="string"||i instanceof String}me.string=No;function tu(i){return typeof i=="number"||i instanceof Number}me.number=tu;function nu(i){return i instanceof Error}me.error=nu;function iu(i){return typeof i=="function"}me.func=iu;function Po(i){return Array.isArray(i)}me.array=Po;function su(i){return Po(i)&&i.every(e=>No(e))}me.stringArray=su});var Ms=le(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.Message=P.NotificationType9=P.NotificationType8=P.NotificationType7=P.NotificationType6=P.NotificationType5=P.NotificationType4=P.NotificationType3=P.NotificationType2=P.NotificationType1=P.NotificationType0=P.NotificationType=P.RequestType9=P.RequestType8=P.RequestType7=P.RequestType6=P.RequestType5=P.RequestType4=P.RequestType3=P.RequestType2=P.RequestType1=P.RequestType=P.RequestType0=P.AbstractMessageSignature=P.ParameterStructures=P.ResponseError=P.ErrorCodes=void 0;var Tt=Kt(),us;(function(i){i.ParseError=-32700,i.InvalidRequest=-32600,i.MethodNotFound=-32601,i.InvalidParams=-32602,i.InternalError=-32603,i.jsonrpcReservedErrorRangeStart=-32099,i.serverErrorStart=-32099,i.MessageWriteError=-32099,i.MessageReadError=-32098,i.PendingResponseRejected=-32097,i.ConnectionInactive=-32096,i.ServerNotInitialized=-32002,i.UnknownErrorCode=-32001,i.jsonrpcReservedErrorRangeEnd=-32e3,i.serverErrorEnd=-32e3})(us||(P.ErrorCodes=us={}));var hs=class i extends Error{constructor(e,t,n){super(t),this.code=Tt.number(e)?e:us.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,i.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};P.ResponseError=hs;var Se=class i{constructor(e){this.kind=e}static is(e){return e===i.auto||e===i.byName||e===i.byPosition}toString(){return this.kind}};P.ParameterStructures=Se;Se.auto=new Se("auto");Se.byPosition=new Se("byPosition");Se.byName=new Se("byName");var H=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Se.auto}};P.AbstractMessageSignature=H;var ds=class extends H{constructor(e){super(e,0)}};P.RequestType0=ds;var fs=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.RequestType=fs;var ps=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.RequestType1=ps;var ms=class extends H{constructor(e){super(e,2)}};P.RequestType2=ms;var gs=class extends H{constructor(e){super(e,3)}};P.RequestType3=gs;var ys=class extends H{constructor(e){super(e,4)}};P.RequestType4=ys;var ws=class extends H{constructor(e){super(e,5)}};P.RequestType5=ws;var vs=class extends H{constructor(e){super(e,6)}};P.RequestType6=vs;var bs=class extends H{constructor(e){super(e,7)}};P.RequestType7=bs;var _s=class extends H{constructor(e){super(e,8)}};P.RequestType8=_s;var xs=class extends H{constructor(e){super(e,9)}};P.RequestType9=xs;var Ss=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.NotificationType=Ss;var ks=class extends H{constructor(e){super(e,0)}};P.NotificationType0=ks;var Es=class extends H{constructor(e,t=Se.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};P.NotificationType1=Es;var Cs=class extends H{constructor(e){super(e,2)}};P.NotificationType2=Cs;var Ts=class extends H{constructor(e){super(e,3)}};P.NotificationType3=Ts;var Rs=class extends H{constructor(e){super(e,4)}};P.NotificationType4=Rs;var Os=class extends H{constructor(e){super(e,5)}};P.NotificationType5=Os;var As=class extends H{constructor(e){super(e,6)}};P.NotificationType6=As;var Ns=class extends H{constructor(e){super(e,7)}};P.NotificationType7=Ns;var Ps=class extends H{constructor(e){super(e,8)}};P.NotificationType8=Ps;var js=class extends H{constructor(e){super(e,9)}};P.NotificationType9=js;var jo;(function(i){function e(s){let r=s;return r&&Tt.string(r.method)&&(Tt.string(r.id)||Tt.number(r.id))}i.isRequest=e;function t(s){let r=s;return r&&Tt.string(r.method)&&s.id===void 0}i.isNotification=t;function n(s){let r=s;return r&&(r.result!==void 0||!!r.error)&&(Tt.string(r.id)||Tt.number(r.id)||r.id===null)}i.isResponse=n})(jo||(P.Message=jo={}))});var Is=le(dt=>{"use strict";var Mo;Object.defineProperty(dt,"__esModule",{value:!0});dt.LRUCache=dt.LinkedMap=dt.Touch=void 0;var ge;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(ge||(dt.Touch=ge={}));var ai=class{constructor(){this[Mo]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=ge.None){let n=this._map.get(e);if(n)return t!==ge.None&&this.touch(n,t),n.value}set(e,t,n=ge.None){let s=this._map.get(e);if(s)s.value=t,n!==ge.None&&this.touch(s,n);else{switch(s={key:e,value:t,next:void 0,previous:void 0},n){case ge.None:this.addItemLast(s);break;case ge.First:this.addItemFirst(s);break;case ge.Last:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.key,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:t.value,done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let s={value:[t.key,t.value],done:!1};return t=t.next,s}else return{value:void 0,done:!0}}};return n}[(Mo=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==ge.First&&t!==ge.Last)){if(t===ge.First){if(e===this._head)return;let n=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(n.previous=s,s.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===ge.Last){if(e===this._tail)return;let n=e.next,s=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=s,s.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};dt.LinkedMap=ai;var Ls=class extends ai{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=ge.AsNew){return super.get(e,t)}peek(e){return super.get(e,ge.None)}set(e,t){return super.set(e,t,ge.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};dt.LRUCache=Ls});var Io=le(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.Disposable=void 0;var Lo;(function(i){function e(t){return{dispose:t}}i.create=e})(Lo||(ci.Disposable=Lo={}))});var ft=le(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var Ds;function $s(){if(Ds===void 0)throw new Error("No runtime abstraction layer installed");return Ds}(function(i){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");Ds=t}i.install=e})($s||($s={}));Fs.default=$s});var tn=le(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.Emitter=en.Event=void 0;var ru=ft(),Do;(function(i){let e={dispose(){}};i.None=function(){return e}})(Do||(en.Event=Do={}));var Ws=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let s=0,r=this._callbacks.length;s<r;s++)if(this._callbacks[s]===e)if(this._contexts[s]===t){this._callbacks.splice(s,1),this._contexts.splice(s,1);return}else n=!0;if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],n=this._callbacks.slice(0),s=this._contexts.slice(0);for(let r=0,o=n.length;r<o;r++)try{t.push(n[r].apply(s[r],e))}catch(a){(0,ru.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},li=class i{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,n)=>{this._callbacks||(this._callbacks=new Ws),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let s={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),s.dispose=i._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};en.Emitter=li;li._noop=function(){}});var di=le(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.CancellationTokenSource=nn.CancellationToken=void 0;var ou=ft(),au=Kt(),zs=tn(),ui;(function(i){i.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:zs.Event.None}),i.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zs.Event.None});function e(t){let n=t;return n&&(n===i.None||n===i.Cancelled||au.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}i.is=e})(ui||(nn.CancellationToken=ui={}));var cu=Object.freeze(function(i,e){let t=(0,ou.default)().timer.setTimeout(i.bind(e),0);return{dispose(){t.dispose()}}}),hi=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?cu:(this._emitter||(this._emitter=new zs.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},qs=class{get token(){return this._token||(this._token=new hi),this._token}cancel(){this._token?this._token.cancel():this._token=ui.Cancelled}dispose(){this._token?this._token instanceof hi&&this._token.dispose():this._token=ui.None}};nn.CancellationTokenSource=qs});var $o=le(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.SharedArrayReceiverStrategy=sn.SharedArraySenderStrategy=void 0;var lu=di(),Pn;(function(i){i.Continue=0,i.Cancelled=1})(Pn||(Pn={}));var Bs=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),n=new Int32Array(t,0,1);n[0]=Pn.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let n=this.buffers.get(t);if(n===void 0)return;let s=new Int32Array(n,0,1);Atomics.store(s,0,Pn.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};sn.SharedArraySenderStrategy=Bs;var Us=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===Pn.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Vs=class{constructor(e){this.token=new Us(e)}cancel(){}dispose(){}},Zs=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new lu.CancellationTokenSource:new Vs(t)}};sn.SharedArrayReceiverStrategy=Zs});var Hs=le(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.Semaphore=void 0;var uu=ft(),Gs=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,uu.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};fi.Semaphore=Gs});var Wo=le(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.ReadableStreamMessageReader=pt.AbstractMessageReader=pt.MessageReader=void 0;var Xs=ft(),rn=Kt(),Js=tn(),hu=Hs(),Fo;(function(i){function e(t){let n=t;return n&&rn.func(n.listen)&&rn.func(n.dispose)&&rn.func(n.onError)&&rn.func(n.onClose)&&rn.func(n.onPartialMessage)}i.is=e})(Fo||(pt.MessageReader=Fo={}));var pi=class{constructor(){this.errorEmitter=new Js.Emitter,this.closeEmitter=new Js.Emitter,this.partialMessageEmitter=new Js.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${rn.string(e.message)?e.message:"unknown"}`)}};pt.AbstractMessageReader=pi;var Ys;(function(i){function e(t){let n,s,r,o=new Map,a,c=new Map;if(t===void 0||typeof t=="string")n=t??"utf-8";else{if(n=t.charset??"utf-8",t.contentDecoder!==void 0&&(r=t.contentDecoder,o.set(r.name,r)),t.contentDecoders!==void 0)for(let l of t.contentDecoders)o.set(l.name,l);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,c.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let l of t.contentTypeDecoders)c.set(l.name,l)}return a===void 0&&(a=(0,Xs.default)().applicationJson.decoder,c.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:c}}i.fromOptions=e})(Ys||(Ys={}));var Qs=class extends pi{constructor(e,t){super(),this.readable=e,this.options=Ys.fromOptions(t),this.buffer=(0,Xs.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new hu.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let s=n.get("content-length");if(!s){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
3
|
+
${JSON.stringify(Object.fromEntries(n))}`));return}let r=parseInt(s);if(isNaN(r)){this.fireError(new Error(`Content-Length value must be a number. Got ${s}`));return}this.nextMessageLength=r}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,s=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(s)}).catch(n=>{this.fireError(n)})}}catch(t){this.fireError(t)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Xs.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};pt.ReadableStreamMessageReader=Qs});var Vo=le(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.WriteableStreamMessageWriter=mt.AbstractMessageWriter=mt.MessageWriter=void 0;var zo=ft(),jn=Kt(),du=Hs(),qo=tn(),fu="Content-Length: ",Bo=`\r
|
|
4
|
+
`,Uo;(function(i){function e(t){let n=t;return n&&jn.func(n.dispose)&&jn.func(n.onClose)&&jn.func(n.onError)&&jn.func(n.write)}i.is=e})(Uo||(mt.MessageWriter=Uo={}));var mi=class{constructor(){this.errorEmitter=new qo.Emitter,this.closeEmitter=new qo.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${jn.string(e.message)?e.message:"unknown"}`)}};mt.AbstractMessageWriter=mi;var Ks;(function(i){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,zo.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,zo.default)().applicationJson.encoder}}i.fromOptions=e})(Ks||(Ks={}));var er=class extends mi{constructor(e,t){super(),this.writable=e,this.options=Ks.fromOptions(t),this.errorCount=0,this.writeSemaphore=new du.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let s=[];return s.push(fu,n.byteLength.toString(),Bo),s.push(Bo),this.doWrite(e,s,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(s){return this.handleError(s,e),Promise.reject(s)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};mt.WriteableStreamMessageWriter=er});var Zo=le(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.AbstractMessageBuffer=void 0;var pu=13,mu=10,gu=`\r
|
|
5
|
+
`,tr=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,s=0,r=0;e:for(;n<this._chunks.length;){let l=this._chunks[n];for(s=0;s<l.length;){switch(l[s]){case pu:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case mu:switch(t){case 1:t=2;break;case 3:t=4,s++;break e;default:t=0}break;default:t=0}s++}r+=l.byteLength,n++}if(t!==4)return;let o=this._read(r+s),a=new Map,c=this.toString(o,"ascii").split(gu);if(c.length<2)return a;for(let l=0;l<c.length-2;l++){let u=c[l],d=u.indexOf(":");if(d===-1)throw new Error(`Message header must separate key and value using ':'
|
|
6
|
+
${u}`);let p=u.substr(0,d),f=u.substr(d+1).trim();a.set(e?p.toLowerCase():p,f)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let r=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(r)}if(this._chunks[0].byteLength>e){let r=this._chunks[0],o=this.asNative(r,e);return this._chunks[0]=r.slice(e),this._totalLength-=e,o}let t=this.allocNative(e),n=0,s=0;for(;e>0;){let r=this._chunks[s];if(r.byteLength>e){let o=r.slice(0,e);t.set(o,n),n+=e,this._chunks[s]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}};gi.AbstractMessageBuffer=tr});var Yo=le(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.createMessageConnection=I.ConnectionOptions=I.MessageStrategy=I.CancellationStrategy=I.CancellationSenderStrategy=I.CancellationReceiverStrategy=I.RequestCancellationReceiverStrategy=I.IdCancellationReceiverStrategy=I.ConnectionStrategy=I.ConnectionError=I.ConnectionErrors=I.LogTraceNotification=I.SetTraceNotification=I.TraceFormat=I.TraceValues=I.Trace=I.NullLogger=I.ProgressType=I.ProgressToken=void 0;var Go=ft(),X=Kt(),M=Ms(),Ho=Is(),Mn=tn(),nr=di(),Dn;(function(i){i.type=new M.NotificationType("$/cancelRequest")})(Dn||(Dn={}));var ir;(function(i){function e(t){return typeof t=="string"||typeof t=="number"}i.is=e})(ir||(I.ProgressToken=ir={}));var Ln;(function(i){i.type=new M.NotificationType("$/progress")})(Ln||(Ln={}));var sr=class{constructor(){}};I.ProgressType=sr;var rr;(function(i){function e(t){return X.func(t)}i.is=e})(rr||(rr={}));I.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var q;(function(i){i[i.Off=0]="Off",i[i.Messages=1]="Messages",i[i.Compact=2]="Compact",i[i.Verbose=3]="Verbose"})(q||(I.Trace=q={}));var Jo;(function(i){i.Off="off",i.Messages="messages",i.Compact="compact",i.Verbose="verbose"})(Jo||(I.TraceValues=Jo={}));(function(i){function e(n){if(!X.string(n))return i.Off;switch(n=n.toLowerCase(),n){case"off":return i.Off;case"messages":return i.Messages;case"compact":return i.Compact;case"verbose":return i.Verbose;default:return i.Off}}i.fromString=e;function t(n){switch(n){case i.Off:return"off";case i.Messages:return"messages";case i.Compact:return"compact";case i.Verbose:return"verbose";default:return"off"}}i.toString=t})(q||(I.Trace=q={}));var Re;(function(i){i.Text="text",i.JSON="json"})(Re||(I.TraceFormat=Re={}));(function(i){function e(t){return X.string(t)?(t=t.toLowerCase(),t==="json"?i.JSON:i.Text):i.Text}i.fromString=e})(Re||(I.TraceFormat=Re={}));var or;(function(i){i.type=new M.NotificationType("$/setTrace")})(or||(I.SetTraceNotification=or={}));var yi;(function(i){i.type=new M.NotificationType("$/logTrace")})(yi||(I.LogTraceNotification=yi={}));var In;(function(i){i[i.Closed=1]="Closed",i[i.Disposed=2]="Disposed",i[i.AlreadyListening=3]="AlreadyListening"})(In||(I.ConnectionErrors=In={}));var on=class i extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,i.prototype)}};I.ConnectionError=on;var ar;(function(i){function e(t){let n=t;return n&&X.func(n.cancelUndispatched)}i.is=e})(ar||(I.ConnectionStrategy=ar={}));var wi;(function(i){function e(t){let n=t;return n&&(n.kind===void 0||n.kind==="id")&&X.func(n.createCancellationTokenSource)&&(n.dispose===void 0||X.func(n.dispose))}i.is=e})(wi||(I.IdCancellationReceiverStrategy=wi={}));var cr;(function(i){function e(t){let n=t;return n&&n.kind==="request"&&X.func(n.createCancellationTokenSource)&&(n.dispose===void 0||X.func(n.dispose))}i.is=e})(cr||(I.RequestCancellationReceiverStrategy=cr={}));var vi;(function(i){i.Message=Object.freeze({createCancellationTokenSource(t){return new nr.CancellationTokenSource}});function e(t){return wi.is(t)||cr.is(t)}i.is=e})(vi||(I.CancellationReceiverStrategy=vi={}));var bi;(function(i){i.Message=Object.freeze({sendCancellation(t,n){return t.sendNotification(Dn.type,{id:n})},cleanup(t){}});function e(t){let n=t;return n&&X.func(n.sendCancellation)&&X.func(n.cleanup)}i.is=e})(bi||(I.CancellationSenderStrategy=bi={}));var _i;(function(i){i.Message=Object.freeze({receiver:vi.Message,sender:bi.Message});function e(t){let n=t;return n&&vi.is(n.receiver)&&bi.is(n.sender)}i.is=e})(_i||(I.CancellationStrategy=_i={}));var xi;(function(i){function e(t){let n=t;return n&&X.func(n.handleMessage)}i.is=e})(xi||(I.MessageStrategy=xi={}));var Xo;(function(i){function e(t){let n=t;return n&&(_i.is(n.cancellationStrategy)||ar.is(n.connectionStrategy)||xi.is(n.messageStrategy))}i.is=e})(Xo||(I.ConnectionOptions=Xo={}));var Fe;(function(i){i[i.New=1]="New",i[i.Listening=2]="Listening",i[i.Closed=3]="Closed",i[i.Disposed=4]="Disposed"})(Fe||(Fe={}));function yu(i,e,t,n){let s=t!==void 0?t:I.NullLogger,r=0,o=0,a=0,c="2.0",l,u=new Map,d,p=new Map,f=new Map,w,g=new Ho.LinkedMap,k=new Map,E=new Set,x=new Map,b=q.Off,S=Re.Text,O,B=Fe.New,K=new Mn.Emitter,pe=new Mn.Emitter,Te=new Mn.Emitter,et=new Mn.Emitter,os=new Mn.Emitter,lt=n&&n.cancellationStrategy?n.cancellationStrategy:_i.Message;function xo(h){if(h===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+h.toString()}function Rl(h){return h===null?"res-unknown-"+(++a).toString():"res-"+h.toString()}function Ol(){return"not-"+(++o).toString()}function Al(h,v){M.Message.isRequest(v)?h.set(xo(v.id),v):M.Message.isResponse(v)?h.set(Rl(v.id),v):h.set(Ol(),v)}function Nl(h){}function So(){return B===Fe.Listening}function ko(){return B===Fe.Closed}function Xt(){return B===Fe.Disposed}function Eo(){(B===Fe.New||B===Fe.Listening)&&(B=Fe.Closed,pe.fire(void 0))}function Pl(h){K.fire([h,void 0,void 0])}function jl(h){K.fire(h)}i.onClose(Eo),i.onError(Pl),e.onClose(Eo),e.onError(jl);function Co(){w||g.size===0||(w=(0,Go.default)().timer.setImmediate(()=>{w=void 0,Ml()}))}function To(h){M.Message.isRequest(h)?Il(h):M.Message.isNotification(h)?$l(h):M.Message.isResponse(h)?Dl(h):Fl(h)}function Ml(){if(g.size===0)return;let h=g.shift();try{let v=n?.messageStrategy;xi.is(v)?v.handleMessage(h,To):To(h)}finally{Co()}}let Ll=h=>{try{if(M.Message.isNotification(h)&&h.method===Dn.type.method){let v=h.params.id,C=xo(v),N=g.get(C);if(M.Message.isRequest(N)){let V=n?.connectionStrategy,Q=V&&V.cancelUndispatched?V.cancelUndispatched(N,Nl):void 0;if(Q&&(Q.error!==void 0||Q.result!==void 0)){g.delete(C),x.delete(v),Q.id=N.id,oi(Q,h.method,Date.now()),e.write(Q).catch(()=>s.error("Sending response for canceled message failed."));return}}let G=x.get(v);if(G!==void 0){G.cancel(),as(h);return}else E.add(v)}Al(g,h)}finally{Co()}};function Il(h){if(Xt())return;function v(z,J,U){let re={jsonrpc:c,id:h.id};z instanceof M.ResponseError?re.error=z.toJson():re.result=z===void 0?null:z,oi(re,J,U),e.write(re).catch(()=>s.error("Sending response failed."))}function C(z,J,U){let re={jsonrpc:c,id:h.id,error:z.toJson()};oi(re,J,U),e.write(re).catch(()=>s.error("Sending response failed."))}function N(z,J,U){z===void 0&&(z=null);let re={jsonrpc:c,id:h.id,result:z};oi(re,J,U),e.write(re).catch(()=>s.error("Sending response failed."))}ql(h);let G=u.get(h.method),V,Q;G&&(V=G.type,Q=G.handler);let ee=Date.now();if(Q||l){let z=h.id??String(Date.now()),J=wi.is(lt.receiver)?lt.receiver.createCancellationTokenSource(z):lt.receiver.createCancellationTokenSource(h);h.id!==null&&E.has(h.id)&&J.cancel(),h.id!==null&&x.set(z,J);try{let U;if(Q)if(h.params===void 0){if(V!==void 0&&V.numberOfParams!==0){C(new M.ResponseError(M.ErrorCodes.InvalidParams,`Request ${h.method} defines ${V.numberOfParams} params but received none.`),h.method,ee);return}U=Q(J.token)}else if(Array.isArray(h.params)){if(V!==void 0&&V.parameterStructures===M.ParameterStructures.byName){C(new M.ResponseError(M.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by name but received parameters by position`),h.method,ee);return}U=Q(...h.params,J.token)}else{if(V!==void 0&&V.parameterStructures===M.ParameterStructures.byPosition){C(new M.ResponseError(M.ErrorCodes.InvalidParams,`Request ${h.method} defines parameters by position but received parameters by name`),h.method,ee);return}U=Q(h.params,J.token)}else l&&(U=l(h.method,h.params,J.token));let re=U;U?re.then?re.then(be=>{x.delete(z),v(be,h.method,ee)},be=>{x.delete(z),be instanceof M.ResponseError?C(be,h.method,ee):be&&X.string(be.message)?C(new M.ResponseError(M.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${be.message}`),h.method,ee):C(new M.ResponseError(M.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,ee)}):(x.delete(z),v(U,h.method,ee)):(x.delete(z),N(U,h.method,ee))}catch(U){x.delete(z),U instanceof M.ResponseError?v(U,h.method,ee):U&&X.string(U.message)?C(new M.ResponseError(M.ErrorCodes.InternalError,`Request ${h.method} failed with message: ${U.message}`),h.method,ee):C(new M.ResponseError(M.ErrorCodes.InternalError,`Request ${h.method} failed unexpectedly without providing any details.`),h.method,ee)}}else C(new M.ResponseError(M.ErrorCodes.MethodNotFound,`Unhandled method ${h.method}`),h.method,ee)}function Dl(h){if(!Xt())if(h.id===null)h.error?s.error(`Received response message without id: Error is:
|
|
7
|
+
${JSON.stringify(h.error,void 0,4)}`):s.error("Received response message without id. No further error information provided.");else{let v=h.id,C=k.get(v);if(Bl(h,C),C!==void 0){k.delete(v);try{if(h.error){let N=h.error;C.reject(new M.ResponseError(N.code,N.message,N.data))}else if(h.result!==void 0)C.resolve(h.result);else throw new Error("Should never happen.")}catch(N){N.message?s.error(`Response handler '${C.method}' failed with message: ${N.message}`):s.error(`Response handler '${C.method}' failed unexpectedly.`)}}}}function $l(h){if(Xt())return;let v,C;if(h.method===Dn.type.method){let N=h.params.id;E.delete(N),as(h);return}else{let N=p.get(h.method);N&&(C=N.handler,v=N.type)}if(C||d)try{if(as(h),C)if(h.params===void 0)v!==void 0&&v.numberOfParams!==0&&v.parameterStructures!==M.ParameterStructures.byName&&s.error(`Notification ${h.method} defines ${v.numberOfParams} params but received none.`),C();else if(Array.isArray(h.params)){let N=h.params;h.method===Ln.type.method&&N.length===2&&ir.is(N[0])?C({token:N[0],value:N[1]}):(v!==void 0&&(v.parameterStructures===M.ParameterStructures.byName&&s.error(`Notification ${h.method} defines parameters by name but received parameters by position`),v.numberOfParams!==h.params.length&&s.error(`Notification ${h.method} defines ${v.numberOfParams} params but received ${N.length} arguments`)),C(...N))}else v!==void 0&&v.parameterStructures===M.ParameterStructures.byPosition&&s.error(`Notification ${h.method} defines parameters by position but received parameters by name`),C(h.params);else d&&d(h.method,h.params)}catch(N){N.message?s.error(`Notification handler '${h.method}' failed with message: ${N.message}`):s.error(`Notification handler '${h.method}' failed unexpectedly.`)}else Te.fire(h)}function Fl(h){if(!h){s.error("Received empty message.");return}s.error(`Received message which is neither a response nor a notification message:
|
|
8
|
+
${JSON.stringify(h,null,4)}`);let v=h;if(X.string(v.id)||X.number(v.id)){let C=v.id,N=k.get(C);N&&N.reject(new Error("The received response has neither a result nor an error property."))}}function ut(h){if(h!=null)switch(b){case q.Verbose:return JSON.stringify(h,null,4);case q.Compact:return JSON.stringify(h);default:return}}function Wl(h){if(!(b===q.Off||!O))if(S===Re.Text){let v;(b===q.Verbose||b===q.Compact)&&h.params&&(v=`Params: ${ut(h.params)}
|
|
9
9
|
|
|
10
|
-
`),O.log(`Sending request '${h.method} - (${h.id})'.`,v)}else
|
|
10
|
+
`),O.log(`Sending request '${h.method} - (${h.id})'.`,v)}else Yt("send-request",h)}function zl(h){if(!(b===q.Off||!O))if(S===Re.Text){let v;(b===q.Verbose||b===q.Compact)&&(h.params?v=`Params: ${ut(h.params)}
|
|
11
11
|
|
|
12
12
|
`:v=`No parameters provided.
|
|
13
13
|
|
|
14
|
-
`),O.log(`Sending notification '${h.method}'.`,v)}else
|
|
14
|
+
`),O.log(`Sending notification '${h.method}'.`,v)}else Yt("send-notification",h)}function oi(h,v,C){if(!(b===q.Off||!O))if(S===Re.Text){let N;(b===q.Verbose||b===q.Compact)&&(h.error&&h.error.data?N=`Error data: ${ut(h.error.data)}
|
|
15
15
|
|
|
16
|
-
`:h.result?N=`Result: ${
|
|
16
|
+
`:h.result?N=`Result: ${ut(h.result)}
|
|
17
17
|
|
|
18
18
|
`:h.error===void 0&&(N=`No result returned.
|
|
19
19
|
|
|
20
|
-
`)),O.log(`Sending response '${v} - (${h.id})'. Processing request took ${Date.now()-C}ms`,N)}else
|
|
20
|
+
`)),O.log(`Sending response '${v} - (${h.id})'. Processing request took ${Date.now()-C}ms`,N)}else Yt("send-response",h)}function ql(h){if(!(b===q.Off||!O))if(S===Re.Text){let v;(b===q.Verbose||b===q.Compact)&&h.params&&(v=`Params: ${ut(h.params)}
|
|
21
21
|
|
|
22
|
-
`),O.log(`Received request '${h.method} - (${h.id})'.`,v)}else
|
|
22
|
+
`),O.log(`Received request '${h.method} - (${h.id})'.`,v)}else Yt("receive-request",h)}function as(h){if(!(b===q.Off||!O||h.method===yi.type.method))if(S===Re.Text){let v;(b===q.Verbose||b===q.Compact)&&(h.params?v=`Params: ${ut(h.params)}
|
|
23
23
|
|
|
24
24
|
`:v=`No parameters provided.
|
|
25
25
|
|
|
26
|
-
`),O.log(`Received notification '${h.method}'.`,v)}else
|
|
26
|
+
`),O.log(`Received notification '${h.method}'.`,v)}else Yt("receive-notification",h)}function Bl(h,v){if(!(b===q.Off||!O))if(S===Re.Text){let C;if((b===q.Verbose||b===q.Compact)&&(h.error&&h.error.data?C=`Error data: ${ut(h.error.data)}
|
|
27
27
|
|
|
28
|
-
`:h.result?C=`Result: ${
|
|
28
|
+
`:h.result?C=`Result: ${ut(h.result)}
|
|
29
29
|
|
|
30
30
|
`:h.error===void 0&&(C=`No result returned.
|
|
31
31
|
|
|
32
|
-
`)),v){let N=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";O.log(`Received response '${v.method} - (${h.id})' in ${Date.now()-v.timerStart}ms.${N}`,C)}else O.log(`Received response ${h.id} without active response promise.`,C)}else Xt("receive-response",h)}function Xt(h,v){if(!O||b===q.Off)return;let C={isLSPMessage:!0,type:h,message:v,timestamp:Date.now()};O.log(C)}function An(){if(Eo())throw new rn(In.Closed,"Connection is closed.");if(Jt())throw new rn(In.Disposed,"Connection is disposed.")}function Vl(){if(ko())throw new rn(In.AlreadyListening,"Connection is already listening")}function Zl(){if(!ko())throw new Error("Call listen() first.")}function Nn(h){return h===void 0?null:h}function Oo(h){if(h!==null)return h}function Ao(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function cs(h,v){switch(h){case M.ParameterStructures.auto:return Ao(v)?Oo(v):[Nn(v)];case M.ParameterStructures.byName:if(!Ao(v))throw new Error("Received parameters by name but param is not an object literal.");return Oo(v);case M.ParameterStructures.byPosition:return[Nn(v)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function No(h,v){let C,N=h.numberOfParams;switch(N){case 0:C=void 0;break;case 1:C=cs(h.parameterStructures,v[0]);break;default:C=[];for(let G=0;G<v.length&&G<N;G++)C.push(Nn(v[G]));if(v.length<N)for(let G=v.length;G<N;G++)C.push(null);break}return C}let Yt={sendNotification:(h,...v)=>{An();let C,N;if(X.string(h)){C=h;let V=v[0],Q=0,ee=M.ParameterStructures.auto;M.ParameterStructures.is(V)&&(Q=1,ee=V);let z=v.length,J=z-Q;switch(J){case 0:N=void 0;break;case 1:N=cs(ee,v[Q]);break;default:if(ee===M.ParameterStructures.byName)throw new Error(`Received ${J} parameters for 'by Name' notification parameter structure.`);N=v.slice(Q,z).map(U=>Nn(U));break}}else{let V=v;C=h.method,N=No(h,V)}let G={jsonrpc:c,method:C,params:N};return ql(G),e.write(G).catch(V=>{throw s.error("Sending notification failed."),V})},onNotification:(h,v)=>{An();let C;return X.func(h)?d=h:v&&(X.string(h)?(C=h,p.set(h,{type:void 0,handler:v})):(C=h.method,p.set(h.method,{type:h,handler:v}))),{dispose:()=>{C!==void 0?p.delete(C):d=void 0}}},onProgress:(h,v,C)=>{if(f.has(v))throw new Error(`Progress handler for token ${v} already registered`);return f.set(v,C),{dispose:()=>{f.delete(v)}}},sendProgress:(h,v,C)=>Yt.sendNotification(Ln.type,{token:v,value:C}),onUnhandledProgress:Ht.event,sendRequest:(h,...v)=>{An(),Zl();let C,N,G;if(X.string(h)){C=h;let z=v[0],J=v[v.length-1],U=0,re=M.ParameterStructures.auto;M.ParameterStructures.is(z)&&(U=1,re=z);let be=v.length;nr.CancellationToken.is(J)&&(be=be-1,G=J);let Ge=be-U;switch(Ge){case 0:N=void 0;break;case 1:N=cs(re,v[U]);break;default:if(re===M.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' request parameter structure.`);N=v.slice(U,be).map(Gl=>Nn(Gl));break}}else{let z=v;C=h.method,N=No(h,z);let J=h.numberOfParams;G=nr.CancellationToken.is(z[J])?z[J]:void 0}let V=r++,Q;G&&(Q=G.onCancellationRequested(()=>{let z=ct.sender.sendCancellation(Yt,V);return z===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${V}`),Promise.resolve()):z.catch(()=>{s.log(`Sending cancellation messages for id ${V} failed`)})}));let ee={jsonrpc:c,id:V,method:C,params:N};return zl(ee),typeof ct.sender.enableCancellation=="function"&&ct.sender.enableCancellation(ee),new Promise(async(z,J)=>{let U=Ge=>{z(Ge),ct.sender.cleanup(V),Q?.dispose()},re=Ge=>{J(Ge),ct.sender.cleanup(V),Q?.dispose()},be={method:C,timerStart:Date.now(),resolve:U,reject:re};try{k.set(V,be),await e.write(ee)}catch(Ge){throw k.delete(V),be.reject(new M.ResponseError(M.ErrorCodes.MessageWriteError,Ge.message?Ge.message:"Unknown reason")),s.error("Sending request failed."),Ge}})},onRequest:(h,v)=>{An();let C=null;return rr.is(h)?(C=void 0,l=h):X.string(h)?(C=null,v!==void 0&&(C=h,u.set(h,{handler:v,type:void 0}))):v!==void 0&&(C=h.method,u.set(h.method,{type:h,handler:v})),{dispose:()=>{C!==null&&(C!==void 0?u.delete(C):l=void 0)}}},hasPendingResponse:()=>k.size>0,trace:async(h,v,C)=>{let N=!1,G=Re.Text;C!==void 0&&(X.boolean(C)?N=C:(N=C.sendNotification||!1,G=C.traceFormat||Re.Text)),b=h,S=G,b===q.Off?O=void 0:O=v,N&&!Eo()&&!Jt()&&await Yt.sendNotification(or.type,{value:q.toString(h)})},onError:K.event,onClose:pe.event,onUnhandledNotification:Te.event,onDispose:xo.event,end:()=>{e.end()},dispose:()=>{if(Jt())return;B=Fe.Disposed,xo.fire(void 0);let h=new M.ResponseError(M.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let v of k.values())v.reject(h);k=new Map,x=new Map,E=new Set,g=new Jo.LinkedMap,X.func(e.dispose)&&e.dispose(),X.func(i.dispose)&&i.dispose()},listen:()=>{An(),Vl(),B=Fe.Listening,i.listen(Il)},inspect:()=>{(0,Ho.default)().console.log("inspect")}};return Yt.onNotification(wi.type,h=>{if(b===q.Off||!O)return;let v=b===q.Verbose||b===q.Compact;O.log(h.message,v?h.verbose:void 0)}),Yt.onNotification(Ln.type,h=>{let v=f.get(h.token);v?v(h.value):Ht.fire(h)}),Yt}I.createMessageConnection=wu});var ki=le(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.ProgressType=y.ProgressToken=y.createMessageConnection=y.NullLogger=y.ConnectionOptions=y.ConnectionStrategy=y.AbstractMessageBuffer=y.WriteableStreamMessageWriter=y.AbstractMessageWriter=y.MessageWriter=y.ReadableStreamMessageReader=y.AbstractMessageReader=y.MessageReader=y.SharedArrayReceiverStrategy=y.SharedArraySenderStrategy=y.CancellationToken=y.CancellationTokenSource=y.Emitter=y.Event=y.Disposable=y.LRUCache=y.Touch=y.LinkedMap=y.ParameterStructures=y.NotificationType9=y.NotificationType8=y.NotificationType7=y.NotificationType6=y.NotificationType5=y.NotificationType4=y.NotificationType3=y.NotificationType2=y.NotificationType1=y.NotificationType0=y.NotificationType=y.ErrorCodes=y.ResponseError=y.RequestType9=y.RequestType8=y.RequestType7=y.RequestType6=y.RequestType5=y.RequestType4=y.RequestType3=y.RequestType2=y.RequestType1=y.RequestType0=y.RequestType=y.Message=y.RAL=void 0;y.MessageStrategy=y.CancellationStrategy=y.CancellationSenderStrategy=y.CancellationReceiverStrategy=y.ConnectionError=y.ConnectionErrors=y.LogTraceNotification=y.SetTraceNotification=y.TraceFormat=y.TraceValues=y.Trace=void 0;var Z=Ms();Object.defineProperty(y,"Message",{enumerable:!0,get:function(){return Z.Message}});Object.defineProperty(y,"RequestType",{enumerable:!0,get:function(){return Z.RequestType}});Object.defineProperty(y,"RequestType0",{enumerable:!0,get:function(){return Z.RequestType0}});Object.defineProperty(y,"RequestType1",{enumerable:!0,get:function(){return Z.RequestType1}});Object.defineProperty(y,"RequestType2",{enumerable:!0,get:function(){return Z.RequestType2}});Object.defineProperty(y,"RequestType3",{enumerable:!0,get:function(){return Z.RequestType3}});Object.defineProperty(y,"RequestType4",{enumerable:!0,get:function(){return Z.RequestType4}});Object.defineProperty(y,"RequestType5",{enumerable:!0,get:function(){return Z.RequestType5}});Object.defineProperty(y,"RequestType6",{enumerable:!0,get:function(){return Z.RequestType6}});Object.defineProperty(y,"RequestType7",{enumerable:!0,get:function(){return Z.RequestType7}});Object.defineProperty(y,"RequestType8",{enumerable:!0,get:function(){return Z.RequestType8}});Object.defineProperty(y,"RequestType9",{enumerable:!0,get:function(){return Z.RequestType9}});Object.defineProperty(y,"ResponseError",{enumerable:!0,get:function(){return Z.ResponseError}});Object.defineProperty(y,"ErrorCodes",{enumerable:!0,get:function(){return Z.ErrorCodes}});Object.defineProperty(y,"NotificationType",{enumerable:!0,get:function(){return Z.NotificationType}});Object.defineProperty(y,"NotificationType0",{enumerable:!0,get:function(){return Z.NotificationType0}});Object.defineProperty(y,"NotificationType1",{enumerable:!0,get:function(){return Z.NotificationType1}});Object.defineProperty(y,"NotificationType2",{enumerable:!0,get:function(){return Z.NotificationType2}});Object.defineProperty(y,"NotificationType3",{enumerable:!0,get:function(){return Z.NotificationType3}});Object.defineProperty(y,"NotificationType4",{enumerable:!0,get:function(){return Z.NotificationType4}});Object.defineProperty(y,"NotificationType5",{enumerable:!0,get:function(){return Z.NotificationType5}});Object.defineProperty(y,"NotificationType6",{enumerable:!0,get:function(){return Z.NotificationType6}});Object.defineProperty(y,"NotificationType7",{enumerable:!0,get:function(){return Z.NotificationType7}});Object.defineProperty(y,"NotificationType8",{enumerable:!0,get:function(){return Z.NotificationType8}});Object.defineProperty(y,"NotificationType9",{enumerable:!0,get:function(){return Z.NotificationType9}});Object.defineProperty(y,"ParameterStructures",{enumerable:!0,get:function(){return Z.ParameterStructures}});var lr=Is();Object.defineProperty(y,"LinkedMap",{enumerable:!0,get:function(){return lr.LinkedMap}});Object.defineProperty(y,"LRUCache",{enumerable:!0,get:function(){return lr.LRUCache}});Object.defineProperty(y,"Touch",{enumerable:!0,get:function(){return lr.Touch}});var vu=Do();Object.defineProperty(y,"Disposable",{enumerable:!0,get:function(){return vu.Disposable}});var Ko=en();Object.defineProperty(y,"Event",{enumerable:!0,get:function(){return Ko.Event}});Object.defineProperty(y,"Emitter",{enumerable:!0,get:function(){return Ko.Emitter}});var ea=fi();Object.defineProperty(y,"CancellationTokenSource",{enumerable:!0,get:function(){return ea.CancellationTokenSource}});Object.defineProperty(y,"CancellationToken",{enumerable:!0,get:function(){return ea.CancellationToken}});var ta=Fo();Object.defineProperty(y,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return ta.SharedArraySenderStrategy}});Object.defineProperty(y,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return ta.SharedArrayReceiverStrategy}});var ur=zo();Object.defineProperty(y,"MessageReader",{enumerable:!0,get:function(){return ur.MessageReader}});Object.defineProperty(y,"AbstractMessageReader",{enumerable:!0,get:function(){return ur.AbstractMessageReader}});Object.defineProperty(y,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return ur.ReadableStreamMessageReader}});var hr=Zo();Object.defineProperty(y,"MessageWriter",{enumerable:!0,get:function(){return hr.MessageWriter}});Object.defineProperty(y,"AbstractMessageWriter",{enumerable:!0,get:function(){return hr.AbstractMessageWriter}});Object.defineProperty(y,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return hr.WriteableStreamMessageWriter}});var bu=Go();Object.defineProperty(y,"AbstractMessageBuffer",{enumerable:!0,get:function(){return bu.AbstractMessageBuffer}});var ue=Qo();Object.defineProperty(y,"ConnectionStrategy",{enumerable:!0,get:function(){return ue.ConnectionStrategy}});Object.defineProperty(y,"ConnectionOptions",{enumerable:!0,get:function(){return ue.ConnectionOptions}});Object.defineProperty(y,"NullLogger",{enumerable:!0,get:function(){return ue.NullLogger}});Object.defineProperty(y,"createMessageConnection",{enumerable:!0,get:function(){return ue.createMessageConnection}});Object.defineProperty(y,"ProgressToken",{enumerable:!0,get:function(){return ue.ProgressToken}});Object.defineProperty(y,"ProgressType",{enumerable:!0,get:function(){return ue.ProgressType}});Object.defineProperty(y,"Trace",{enumerable:!0,get:function(){return ue.Trace}});Object.defineProperty(y,"TraceValues",{enumerable:!0,get:function(){return ue.TraceValues}});Object.defineProperty(y,"TraceFormat",{enumerable:!0,get:function(){return ue.TraceFormat}});Object.defineProperty(y,"SetTraceNotification",{enumerable:!0,get:function(){return ue.SetTraceNotification}});Object.defineProperty(y,"LogTraceNotification",{enumerable:!0,get:function(){return ue.LogTraceNotification}});Object.defineProperty(y,"ConnectionErrors",{enumerable:!0,get:function(){return ue.ConnectionErrors}});Object.defineProperty(y,"ConnectionError",{enumerable:!0,get:function(){return ue.ConnectionError}});Object.defineProperty(y,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ue.CancellationReceiverStrategy}});Object.defineProperty(y,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ue.CancellationSenderStrategy}});Object.defineProperty(y,"CancellationStrategy",{enumerable:!0,get:function(){return ue.CancellationStrategy}});Object.defineProperty(y,"MessageStrategy",{enumerable:!0,get:function(){return ue.MessageStrategy}});var _u=dt();y.RAL=_u.default});var sa=le(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});var na=require("util"),tt=ki(),Ei=class i extends tt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return i.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new na.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};Ei.emptyBuffer=Buffer.allocUnsafe(0);var dr=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),tt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),tt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),tt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),tt.Disposable.create(()=>this.stream.off("data",e))}},fr=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),tt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),tt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),tt.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((n,s)=>{let r=o=>{o==null?n():s(o)};typeof e=="string"?this.stream.write(e,t,r):this.stream.write(e,r)})}end(){this.stream.end()}},ia=Object.freeze({messageBuffer:Object.freeze({create:i=>new Ei(i)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(i,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(i,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(i,e)=>{try{return i instanceof Buffer?Promise.resolve(JSON.parse(i.toString(e.charset))):Promise.resolve(JSON.parse(new na.TextDecoder(e.charset).decode(i)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:i=>new dr(i),asWritableStream:i=>new fr(i)}),console,timer:Object.freeze({setTimeout(i,e,...t){let n=setTimeout(i,e,...t);return{dispose:()=>clearTimeout(n)}},setImmediate(i,...e){let t=setImmediate(i,...e);return{dispose:()=>clearImmediate(t)}},setInterval(i,e,...t){let n=setInterval(i,e,...t);return{dispose:()=>clearInterval(n)}}})});function pr(){return ia}(function(i){function e(){tt.RAL.install(ia)}i.install=e})(pr||(pr={}));mr.default=pr});var br=le(W=>{"use strict";var xu=W&&W.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]}),Su=W&&W.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&xu(e,i,t)};Object.defineProperty(W,"__esModule",{value:!0});W.createMessageConnection=W.createServerSocketTransport=W.createClientSocketTransport=W.createServerPipeTransport=W.createClientPipeTransport=W.generateRandomPipeName=W.StreamMessageWriter=W.StreamMessageReader=W.SocketMessageWriter=W.SocketMessageReader=W.PortMessageWriter=W.PortMessageReader=W.IPCMessageWriter=W.IPCMessageReader=void 0;var on=sa();on.default.install();var ra=require("path"),ku=require("os"),Eu=require("crypto"),Ri=require("net"),Oe=ki();Su(ki(),W);var gr=class extends Oe.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Oe.Disposable.create(()=>this.process.off("message",e))}};W.IPCMessageReader=gr;var yr=class extends Oe.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};W.IPCMessageWriter=yr;var wr=class extends Oe.AbstractMessageReader{constructor(e){super(),this.onData=new Oe.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};W.PortMessageReader=wr;var vr=class extends Oe.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};W.PortMessageWriter=vr;var Tt=class extends Oe.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,on.default)().stream.asReadableStream(e),t)}};W.SocketMessageReader=Tt;var Rt=class extends Oe.WriteableStreamMessageWriter{constructor(e,t){super((0,on.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};W.SocketMessageWriter=Rt;var Ci=class extends Oe.ReadableStreamMessageReader{constructor(e,t){super((0,on.default)().stream.asReadableStream(e),t)}};W.StreamMessageReader=Ci;var Ti=class extends Oe.WriteableStreamMessageWriter{constructor(e,t){super((0,on.default)().stream.asWritableStream(e),t)}};W.StreamMessageWriter=Ti;var oa=process.env.XDG_RUNTIME_DIR,Cu=new Map([["linux",107],["darwin",103]]);function Tu(){let i=(0,Eu.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${i}-sock`;let e;oa?e=ra.join(oa,`vscode-ipc-${i}.sock`):e=ra.join(ku.tmpdir(),`vscode-${i}.sock`);let t=Cu.get(process.platform);return t!==void 0&&e.length>t&&(0,on.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}W.generateRandomPipeName=Tu;function Ru(i,e="utf-8"){let t,n=new Promise((s,r)=>{t=s});return new Promise((s,r)=>{let o=(0,Ri.createServer)(a=>{o.close(),t([new Tt(a,e),new Rt(a,e)])});o.on("error",r),o.listen(i,()=>{o.removeListener("error",r),s({onConnected:()=>n})})})}W.createClientPipeTransport=Ru;function Ou(i,e="utf-8"){let t=(0,Ri.createConnection)(i);return[new Tt(t,e),new Rt(t,e)]}W.createServerPipeTransport=Ou;function Au(i,e="utf-8"){let t,n=new Promise((s,r)=>{t=s});return new Promise((s,r)=>{let o=(0,Ri.createServer)(a=>{o.close(),t([new Tt(a,e),new Rt(a,e)])});o.on("error",r),o.listen(i,"127.0.0.1",()=>{o.removeListener("error",r),s({onConnected:()=>n})})})}W.createClientSocketTransport=Au;function Nu(i,e="utf-8"){let t=(0,Ri.createConnection)(i,"127.0.0.1");return[new Tt(t,e),new Rt(t,e)]}W.createServerSocketTransport=Nu;function Pu(i){let e=i;return e.read!==void 0&&e.addListener!==void 0}function ju(i){let e=i;return e.write!==void 0&&e.addListener!==void 0}function Mu(i,e,t,n){t||(t=Oe.NullLogger);let s=Pu(i)?new Ci(i):i,r=ju(e)?new Ti(e):e;return Oe.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Oe.createMessageConnection)(s,r,t,n)}W.createMessageConnection=Mu});var ca=le((op,aa)=>{"use strict";aa.exports=br()});var _l=ut(require("child_process")),Et=ut(require("fs")),xl=ut(require("path")),Sl=ut(br()),os=ut(ca());var Y={};Kl(Y,{BRAND:()=>oh,DIRTY:()=>Ot,EMPTY_PATH:()=>$u,INVALID:()=>j,NEVER:()=>Uh,OK:()=>ye,ParseStatus:()=>he,Schema:()=>$,ZodAny:()=>yt,ZodArray:()=>rt,ZodBigInt:()=>Nt,ZodBoolean:()=>Pt,ZodBranded:()=>Fn,ZodCatch:()=>Bt,ZodDate:()=>jt,ZodDefault:()=>qt,ZodDiscriminatedUnion:()=>Ni,ZodEffects:()=>Le,ZodEnum:()=>Wt,ZodError:()=>ke,ZodFirstPartyTypeKind:()=>L,ZodFunction:()=>ji,ZodIntersection:()=>Dt,ZodIssueCode:()=>_,ZodLazy:()=>$t,ZodLiteral:()=>Ft,ZodMap:()=>dn,ZodNaN:()=>pn,ZodNativeEnum:()=>zt,ZodNever:()=>We,ZodNull:()=>Lt,ZodNullable:()=>Xe,ZodNumber:()=>At,ZodObject:()=>Ee,ZodOptional:()=>je,ZodParsedType:()=>R,ZodPipeline:()=>Wn,ZodPromise:()=>wt,ZodReadonly:()=>Ut,ZodRecord:()=>Pi,ZodSchema:()=>$,ZodSet:()=>fn,ZodString:()=>gt,ZodSymbol:()=>un,ZodTransformer:()=>Le,ZodTuple:()=>Je,ZodType:()=>$,ZodUndefined:()=>Mt,ZodUnion:()=>It,ZodUnknown:()=>st,ZodVoid:()=>hn,addIssueToContext:()=>T,any:()=>mh,array:()=>vh,bigint:()=>uh,boolean:()=>va,coerce:()=>Bh,custom:()=>ga,date:()=>hh,datetimeRegex:()=>pa,defaultErrorMap:()=>nt,discriminatedUnion:()=>Sh,effect:()=>Lh,enum:()=>Ph,function:()=>Oh,getErrorMap:()=>an,getParsedType:()=>He,instanceof:()=>ch,intersection:()=>kh,isAborted:()=>Oi,isAsync:()=>cn,isDirty:()=>Ai,isValid:()=>mt,late:()=>ah,lazy:()=>Ah,literal:()=>Nh,makeIssue:()=>$n,map:()=>Th,nan:()=>lh,nativeEnum:()=>jh,never:()=>yh,null:()=>ph,nullable:()=>Dh,number:()=>wa,object:()=>bh,objectUtil:()=>_r,oboolean:()=>qh,onumber:()=>zh,optional:()=>Ih,ostring:()=>Wh,pipeline:()=>Fh,preprocess:()=>$h,promise:()=>Mh,quotelessJson:()=>Lu,record:()=>Ch,set:()=>Rh,setErrorMap:()=>Du,strictObject:()=>_h,string:()=>ya,symbol:()=>dh,transformer:()=>Lh,tuple:()=>Eh,undefined:()=>fh,union:()=>xh,unknown:()=>gh,util:()=>F,void:()=>wh});var F;(function(i){i.assertEqual=s=>{};function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{let r={};for(let o of s)r[o]=o;return r},i.getValidEnumValues=s=>{let r=i.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of r)o[a]=s[a];return i.objectValues(o)},i.objectValues=s=>i.objectKeys(s).map(function(r){return s[r]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let r=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&r.push(o);return r},i.find=(s,r)=>{for(let o of s)if(r(o))return o},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,r=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}i.joinValues=n,i.jsonStringifyReplacer=(s,r)=>typeof r=="bigint"?r.toString():r})(F||(F={}));var _r;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(_r||(_r={}));var R=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),He=i=>{switch(typeof i){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(i)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(i)?R.array:i===null?R.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?R.promise:typeof Map<"u"&&i instanceof Map?R.map:typeof Set<"u"&&i instanceof Set?R.set:typeof Date<"u"&&i instanceof Date?R.date:R.object;default:return R.unknown}};var _=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Lu=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),ke=class i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(r){return r.message},n={_errors:[]},s=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let a=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return s(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ke.create=i=>new ke(i);var Iu=(i,e)=>{let t;switch(i.code){case _.invalid_type:i.received===R.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case _.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,F.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:t=`Unrecognized key(s) in object: ${F.joinValues(i.keys,", ")}`;break;case _.invalid_union:t="Invalid input";break;case _.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${F.joinValues(i.options)}`;break;case _.invalid_enum_value:t=`Invalid enum value. Expected ${F.joinValues(i.options)}, received '${i.received}'`;break;case _.invalid_arguments:t="Invalid function arguments";break;case _.invalid_return_type:t="Invalid function return type";break;case _.invalid_date:t="Invalid date";break;case _.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:F.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case _.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case _.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case _.custom:t="Invalid input";break;case _.invalid_intersection_types:t="Intersection results could not be merged";break;case _.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case _.not_finite:t="Number must be finite";break;default:t=e.defaultError,F.assertNever(i)}return{message:t}},nt=Iu;var la=nt;function Du(i){la=i}function an(){return la}var $n=i=>{let{data:e,path:t,errorMaps:n,issueData:s}=i,r=[...t,...s.path||[]],o={...s,path:r};if(s.message!==void 0)return{...s,path:r,message:s.message};let a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...s,path:r,message:a}},$u=[];function T(i,e){let t=an(),n=$n({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===nt?void 0:nt].filter(s=>!!s)});i.common.issues.push(n)}var he=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let s of t){if(s.status==="aborted")return j;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let s of t){let r=await s.key,o=await s.value;n.push({key:r,value:o})}return i.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let s of t){let{key:r,value:o}=s;if(r.status==="aborted"||o.status==="aborted")return j;r.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[r.value]=o.value)}return{status:e.value,value:n}}},j=Object.freeze({status:"aborted"}),Ot=i=>({status:"dirty",value:i}),ye=i=>({status:"valid",value:i}),Oi=i=>i.status==="aborted",Ai=i=>i.status==="dirty",mt=i=>i.status==="valid",cn=i=>typeof Promise<"u"&&i instanceof Promise;var A;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message})(A||(A={}));var Me=class{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ua=(i,e)=>{if(mt(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ke(i.common.issues);return this._error=t,this._error}}};function D(i){if(!i)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:s}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:c}=i;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:s}}var $=class{get description(){return this._def.description}_getType(e){return He(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new he,ctx:{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(cn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parseSync({data:e,path:n.path,parent:n});return ua(n,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return mt(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>mt(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(cn(s)?s:Promise.resolve(s));return ua(n,r)}refine(e,t){let n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,r)=>{let o=e(s),a=()=>r.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new Le({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return je.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rt.create(this)}promise(){return wt.create(this,this._def)}or(e){return It.create([this,e],this._def)}and(e){return Dt.create(this,e,this._def)}transform(e){return new Le({...D(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new qt({...D(this._def),innerType:this,defaultValue:t,typeName:L.ZodDefault})}brand(){return new Fn({typeName:L.ZodBranded,type:this,...D(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Bt({...D(this._def),innerType:this,catchValue:t,typeName:L.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Wn.create(this,e)}readonly(){return Ut.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Fu=/^c[^\s-]{8,}$/i,Wu=/^[0-9a-z]+$/,zu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qu=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bu=/^[a-z0-9_-]{21}$/i,Uu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Vu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Zu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Gu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xr,Hu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ju=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ku=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,da="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eh=new RegExp(`^${da}$`);function fa(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);let t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function th(i){return new RegExp(`^${fa(i)}$`)}function pa(i){let e=`${da}T${fa(i)}`,t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function nh(i,e){return!!((e==="v4"||!e)&&Hu.test(i)||(e==="v6"||!e)&&Xu.test(i))}function ih(i,e){if(!Uu.test(i))return!1;try{let[t]=i.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function sh(i,e){return!!((e==="v4"||!e)&&Ju.test(i)||(e==="v6"||!e)&&Yu.test(i))}var gt=class i extends ${_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.string,received:r.parsedType}),j}let n=new he,s;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?T(s,{code:_.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&T(s,{code:_.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Zu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"email",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")xr||(xr=new RegExp(Gu,"u")),xr.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"emoji",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")qu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"uuid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")Bu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"nanoid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")Fu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cuid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Wu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cuid2",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")zu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"ulid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),T(s,{validation:"url",code:_.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"regex",code:_.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?pa(r).test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?eh.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?th(r).test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?Vu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"duration",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?nh(e.data,r.version)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"ip",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?ih(e.data,r.alg)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"jwt",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?sh(e.data,r.version)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cidr",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?Qu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"base64",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?Ku.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"base64url",code:_.invalid_string,message:r.message}),n.dirty()):F.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:_.invalid_string,...A.errToObj(n)})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...A.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...A.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...A.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...A.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...A.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...A.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...A.errToObj(t)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};gt.create=i=>new gt({checks:[],typeName:L.ZodString,coerce:i?.coerce??!1,...D(i)});function rh(i,e){let t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,r=Number.parseInt(i.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return r%o/10**s}var At=class i extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.number,received:r.parsedType}),j}let n,s=new he;for(let r of this._def.checks)r.kind==="int"?F.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:_.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?rh(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_finite,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,s){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(s)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};At.create=i=>new At({checks:[],typeName:L.ZodNumber,coerce:i?.coerce||!1,...D(i)});var Nt=class i extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n,s=new he;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:_.invalid_type,expected:R.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,s){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(s)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Nt.create=i=>new Nt({checks:[],typeName:L.ZodBigInt,coerce:i?.coerce??!1,...D(i)});var Pt=class extends ${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),j}return ye(e.data)}};Pt.create=i=>new Pt({typeName:L.ZodBoolean,coerce:i?.coerce||!1,...D(i)});var jt=class i extends ${_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.date,received:r.parsedType}),j}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_date}),j}let n=new he,s;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):F.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};jt.create=i=>new jt({checks:[],coerce:i?.coerce||!1,typeName:L.ZodDate,...D(i)});var un=class extends ${_parse(e){if(this._getType(e)!==R.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),j}return ye(e.data)}};un.create=i=>new un({typeName:L.ZodSymbol,...D(i)});var Mt=class extends ${_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),j}return ye(e.data)}};Mt.create=i=>new Mt({typeName:L.ZodUndefined,...D(i)});var Lt=class extends ${_parse(e){if(this._getType(e)!==R.null){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),j}return ye(e.data)}};Lt.create=i=>new Lt({typeName:L.ZodNull,...D(i)});var yt=class extends ${constructor(){super(...arguments),this._any=!0}_parse(e){return ye(e.data)}};yt.create=i=>new yt({typeName:L.ZodAny,...D(i)});var st=class extends ${constructor(){super(...arguments),this._unknown=!0}_parse(e){return ye(e.data)}};st.create=i=>new st({typeName:L.ZodUnknown,...D(i)});var We=class extends ${_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:_.invalid_type,expected:R.never,received:t.parsedType}),j}};We.create=i=>new We({typeName:L.ZodNever,...D(i)});var hn=class extends ${_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),j}return ye(e.data)}};hn.create=i=>new hn({typeName:L.ZodVoid,...D(i)});var rt=class i extends ${_parse(e){let{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==R.array)return T(t,{code:_.invalid_type,expected:R.array,received:t.parsedType}),j;if(s.exactLength!==null){let o=t.data.length>s.exactLength.value,a=t.data.length<s.exactLength.value;(o||a)&&(T(t,{code:o?_.too_big:_.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(T(t,{code:_.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(T(t,{code:_.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>s.type._parseAsync(new Me(t,o,t.path,a)))).then(o=>he.mergeArray(n,o));let r=[...t.data].map((o,a)=>s.type._parseSync(new Me(t,o,t.path,a)));return he.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new i({...this._def,minLength:{value:e,message:A.toString(t)}})}max(e,t){return new i({...this._def,maxLength:{value:e,message:A.toString(t)}})}length(e,t){return new i({...this._def,exactLength:{value:e,message:A.toString(t)}})}nonempty(e){return this.min(1,e)}};rt.create=(i,e)=>new rt({type:i,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...D(e)});function ln(i){if(i instanceof Ee){let e={};for(let t in i.shape){let n=i.shape[t];e[t]=je.create(ln(n))}return new Ee({...i._def,shape:()=>e})}else return i instanceof rt?new rt({...i._def,type:ln(i.element)}):i instanceof je?je.create(ln(i.unwrap())):i instanceof Xe?Xe.create(ln(i.unwrap())):i instanceof Je?Je.create(i.items.map(e=>ln(e))):i}var Ee=class i extends ${constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=F.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==R.object){let l=this._getOrReturnCtx(e);return T(l,{code:_.invalid_type,expected:R.object,received:l.parsedType}),j}let{status:n,ctx:s}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof We&&this._def.unknownKeys==="strip"))for(let l in s.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let u=r[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Me(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof We){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")a.length>0&&(T(s,{code:_.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Me(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>he.mergeObjectSync(n,l)):he.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new i({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:A.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(e){return new i({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new i({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:L.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new i({...this._def,catchall:e})}pick(e){let t={};for(let n of F.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new i({...this._def,shape:()=>t})}omit(e){let t={};for(let n of F.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new i({...this._def,shape:()=>t})}deepPartial(){return ln(this)}partial(e){let t={};for(let n of F.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new i({...this._def,shape:()=>t})}required(e){let t={};for(let n of F.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof je;)r=r._def.innerType;t[n]=r}return new i({...this._def,shape:()=>t})}keyof(){return ma(F.objectKeys(this.shape))}};Ee.create=(i,e)=>new Ee({shape:()=>i,unknownKeys:"strip",catchall:We.create(),typeName:L.ZodObject,...D(e)});Ee.strictCreate=(i,e)=>new Ee({shape:()=>i,unknownKeys:"strict",catchall:We.create(),typeName:L.ZodObject,...D(e)});Ee.lazycreate=(i,e)=>new Ee({shape:i,unknownKeys:"strip",catchall:We.create(),typeName:L.ZodObject,...D(e)});var It=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function s(r){for(let a of r)if(a.result.status==="valid")return a.result;for(let a of r)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=r.map(a=>new ke(a.ctx.common.issues));return T(t,{code:_.invalid_union,unionErrors:o}),j}if(t.common.async)return Promise.all(n.map(async r=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let r,o=[];for(let c of n){let l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!r&&(r={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let a=o.map(c=>new ke(c));return T(t,{code:_.invalid_union,unionErrors:a}),j}}get options(){return this._def.options}};It.create=(i,e)=>new It({options:i,typeName:L.ZodUnion,...D(e)});var it=i=>i instanceof $t?it(i.schema):i instanceof Le?it(i.innerType()):i instanceof Ft?[i.value]:i instanceof Wt?i.options:i instanceof zt?F.objectValues(i.enum):i instanceof qt?it(i._def.innerType):i instanceof Mt?[void 0]:i instanceof Lt?[null]:i instanceof je?[void 0,...it(i.unwrap())]:i instanceof Xe?[null,...it(i.unwrap())]:i instanceof Fn||i instanceof Ut?it(i.unwrap()):i instanceof Bt?it(i._def.innerType):[],Ni=class i extends ${_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.object)return T(t,{code:_.invalid_type,expected:R.object,received:t.parsedType}),j;let n=this.discriminator,s=t.data[n],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(T(t,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let s=new Map;for(let r of t){let o=it(r.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,r)}}return new i({typeName:L.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...D(n)})}};function Sr(i,e){let t=He(i),n=He(e);if(i===e)return{valid:!0,data:i};if(t===R.object&&n===R.object){let s=F.objectKeys(e),r=F.objectKeys(i).filter(a=>s.indexOf(a)!==-1),o={...i,...e};for(let a of r){let c=Sr(i[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===R.array&&n===R.array){if(i.length!==e.length)return{valid:!1};let s=[];for(let r=0;r<i.length;r++){let o=i[r],a=e[r],c=Sr(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return t===R.date&&n===R.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}var Dt=class extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=(r,o)=>{if(Oi(r)||Oi(o))return j;let a=Sr(r.value,o.value);return a.valid?((Ai(r)||Ai(o))&&t.dirty(),{status:t.value,value:a.data}):(T(n,{code:_.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>s(r,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Dt.create=(i,e,t)=>new Dt({left:i,right:e,typeName:L.ZodIntersection,...D(t)});var Je=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return T(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return T(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Me(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>he.mergeArray(t,o)):he.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new i({...this._def,rest:e})}};Je.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:i,typeName:L.ZodTuple,rest:null,...D(e)})};var Pi=class i extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.object)return T(n,{code:_.invalid_type,expected:R.object,received:n.parsedType}),j;let s=[],r=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:r._parse(new Me(n,a,n.path,a)),value:o._parse(new Me(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?he.mergeObjectAsync(t,s):he.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof $?new i({keyType:e,valueType:t,typeName:L.ZodRecord,...D(n)}):new i({keyType:gt.create(),valueType:e,typeName:L.ZodRecord,...D(t)})}},dn=class extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return T(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),j;let s=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:s._parse(new Me(n,a,n.path,[l,"key"])),value:r._parse(new Me(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return j;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return j;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};dn.create=(i,e,t)=>new dn({valueType:e,keyType:i,typeName:L.ZodMap,...D(t)});var fn=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return T(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),j;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(T(n,{code:_.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(T(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let r=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return j;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}let a=[...n.data.values()].map((c,l)=>r._parse(new Me(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new i({...this._def,minSize:{value:e,message:A.toString(t)}})}max(e,t){return new i({...this._def,maxSize:{value:e,message:A.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};fn.create=(i,e)=>new fn({valueType:i,minSize:null,maxSize:null,typeName:L.ZodSet,...D(e)});var ji=class i extends ${constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.function)return T(t,{code:_.invalid_type,expected:R.function,received:t.parsedType}),j;function n(a,c){return $n({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,an(),nt].filter(l=>!!l),issueData:{code:_.invalid_arguments,argumentsError:c}})}function s(a,c){return $n({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,an(),nt].filter(l=>!!l),issueData:{code:_.invalid_return_type,returnTypeError:c}})}let r={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof wt){let a=this;return ye(async function(...c){let l=new ke([]),u=await a._def.args.parseAsync(c,r).catch(f=>{throw l.addIssue(n(c,f)),l}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,r).catch(f=>{throw l.addIssue(s(d,f)),l})})}else{let a=this;return ye(function(...c){let l=a._def.args.safeParse(c,r);if(!l.success)throw new ke([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=a._def.returns.safeParse(u,r);if(!d.success)throw new ke([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i({...this._def,args:Je.create(e).rest(st.create())})}returns(e){return new i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new i({args:e||Je.create([]).rest(st.create()),returns:t||st.create(),typeName:L.ZodFunction,...D(n)})}},$t=class extends ${get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};$t.create=(i,e)=>new $t({getter:i,typeName:L.ZodLazy,...D(e)});var Ft=class extends ${_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return T(t,{received:t.data,code:_.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ft.create=(i,e)=>new Ft({value:i,typeName:L.ZodLiteral,...D(e)});function ma(i,e){return new Wt({values:i,typeName:L.ZodEnum,...D(e)})}var Wt=class i extends ${_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return T(t,{expected:F.joinValues(n),received:t.parsedType,code:_.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return T(t,{received:t.data,code:_.invalid_enum_value,options:n}),j}return ye(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return i.create(e,{...this._def,...t})}exclude(e,t=this._def){return i.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};Wt.create=ma;var zt=class extends ${_parse(e){let t=F.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){let s=F.objectValues(t);return T(n,{expected:F.joinValues(s),received:n.parsedType,code:_.invalid_type}),j}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=F.objectValues(t);return T(n,{received:n.data,code:_.invalid_enum_value,options:s}),j}return ye(e.data)}get enum(){return this._def.values}};zt.create=(i,e)=>new zt({values:i,typeName:L.ZodNativeEnum,...D(e)});var wt=class extends ${unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.promise&&t.common.async===!1)return T(t,{code:_.invalid_type,expected:R.promise,received:t.parsedType}),j;let n=t.parsedType===R.promise?t.data:Promise.resolve(t.data);return ye(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}};wt.create=(i,e)=>new wt({type:i,typeName:L.ZodPromise,...D(e)});var Le=class extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,r={addIssue:o=>{T(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),s.type==="preprocess"){let o=s.transform(n.data,r);if(n.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return j;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"?Ot(c.value):t.value==="dirty"?Ot(c.value):c});{if(t.value==="aborted")return j;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?j:a.status==="dirty"?Ot(a.value):t.value==="dirty"?Ot(a.value):a}}if(s.type==="refinement"){let o=a=>{let c=s.refinement(a,r);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?j:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?j:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!mt(o))return j;let a=s.transform(o.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>mt(o)?Promise.resolve(s.transform(o.value,r)).then(a=>({status:t.value,value:a})):j);F.assertNever(s)}};Le.create=(i,e,t)=>new Le({schema:i,typeName:L.ZodEffects,effect:e,...D(t)});Le.createWithPreprocess=(i,e,t)=>new Le({schema:e,effect:{type:"preprocess",transform:i},typeName:L.ZodEffects,...D(t)});var je=class extends ${_parse(e){return this._getType(e)===R.undefined?ye(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};je.create=(i,e)=>new je({innerType:i,typeName:L.ZodOptional,...D(e)});var Xe=class extends ${_parse(e){return this._getType(e)===R.null?ye(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xe.create=(i,e)=>new Xe({innerType:i,typeName:L.ZodNullable,...D(e)});var qt=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};qt.create=(i,e)=>new qt({innerType:i,typeName:L.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...D(e)});var Bt=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return cn(s)?s.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ke(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ke(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Bt.create=(i,e)=>new Bt({innerType:i,typeName:L.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...D(e)});var pn=class extends ${_parse(e){if(this._getType(e)!==R.nan){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}};pn.create=i=>new pn({typeName:L.ZodNaN,...D(i)});var oh=Symbol("zod_brand"),Fn=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Wn=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),Ot(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?j:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new i({in:e,out:t,typeName:L.ZodPipeline})}},Ut=class extends ${_parse(e){let t=this._def.innerType._parse(e),n=s=>(mt(s)&&(s.value=Object.freeze(s.value)),s);return cn(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}};Ut.create=(i,e)=>new Ut({innerType:i,typeName:L.ZodReadonly,...D(e)});function ha(i,e){let t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function ga(i,e={},t){return i?yt.create().superRefine((n,s)=>{let r=i(n);if(r instanceof Promise)return r.then(o=>{if(!o){let a=ha(e,n),c=a.fatal??t??!0;s.addIssue({code:"custom",...a,fatal:c})}});if(!r){let o=ha(e,n),a=o.fatal??t??!0;s.addIssue({code:"custom",...o,fatal:a})}}):yt.create()}var ah={object:Ee.lazycreate},L;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(L||(L={}));var ch=(i,e={message:`Input not instance of ${i.name}`})=>ga(t=>t instanceof i,e),ya=gt.create,wa=At.create,lh=pn.create,uh=Nt.create,va=Pt.create,hh=jt.create,dh=un.create,fh=Mt.create,ph=Lt.create,mh=yt.create,gh=st.create,yh=We.create,wh=hn.create,vh=rt.create,bh=Ee.create,_h=Ee.strictCreate,xh=It.create,Sh=Ni.create,kh=Dt.create,Eh=Je.create,Ch=Pi.create,Th=dn.create,Rh=fn.create,Oh=ji.create,Ah=$t.create,Nh=Ft.create,Ph=Wt.create,jh=zt.create,Mh=wt.create,Lh=Le.create,Ih=je.create,Dh=Xe.create,$h=Le.createWithPreprocess,Fh=Wn.create,Wh=()=>ya().optional(),zh=()=>wa().optional(),qh=()=>va().optional(),Bh={string:i=>gt.create({...i,coerce:!0}),number:i=>At.create({...i,coerce:!0}),boolean:i=>Pt.create({...i,coerce:!0}),bigint:i=>Nt.create({...i,coerce:!0}),date:i=>jt.create({...i,coerce:!0})};var Uh=j;var kl=require("node:util"),Pe=require("node:path");var zn=class{diff(e,t,n={}){let s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);let r=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(r,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,s)}diffWithOptionsObj(e,t,n,s){var r;let o=x=>{if(x=this.postProcess(x,n),s){setTimeout(function(){s(x)},0);return}else return x},a=t.length,c=e.length,l=1,u=a+c;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let d=(r=n.timeout)!==null&&r!==void 0?r:1/0,p=Date.now()+d,f=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(f[0],t,e,0,n);if(f[0].oldPos+1>=c&&w+1>=a)return o(this.buildValues(f[0].lastComponent,t,e));let g=-1/0,k=1/0,E=()=>{for(let x=Math.max(g,-l);x<=Math.min(k,l);x+=2){let b,S=f[x-1],O=f[x+1];S&&(f[x-1]=void 0);let B=!1;if(O){let pe=O.oldPos-x;B=O&&0<=pe&&pe<a}let K=S&&S.oldPos+1<c;if(!B&&!K){f[x]=void 0;continue}if(!K||B&&S.oldPos<O.oldPos?b=this.addToPath(O,!0,!1,0,n):b=this.addToPath(S,!1,!0,1,n),w=this.extractCommon(b,t,e,x,n),b.oldPos+1>=c&&w+1>=a)return o(this.buildValues(b.lastComponent,t,e))||!0;f[x]=b,b.oldPos+1>=c&&(k=Math.min(k,x-1)),w+1>=a&&(g=Math.max(g,x+1))}l++};if(s)(function x(){setTimeout(function(){if(l>u||Date.now()>p)return s(void 0);E()||x()},0)})();else for(;l<=u&&Date.now()<=p;){let x=E();if(x)return x}}addToPath(e,t,n,s,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,s,r){let o=t.length,a=n.length,c=e.oldPos,l=c-s,u=0;for(;l+1<o&&c+1<a&&this.equals(n[c+1],t[l+1],r);)l++,c++,u++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!r.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let s=[],r;for(;e;)s.push(e),r=e.previousComponent,delete e.previousComponent,e=r;s.reverse();let o=s.length,a=0,c=0,l=0;for(;a<o;a++){let u=s[a];if(u.removed)u.value=this.join(n.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=t.slice(c,c+u.count);d=d.map(function(p,f){let w=n[l+f];return w.length>p.length?w:p}),u.value=this.join(d)}else u.value=this.join(t.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return s}};function ba(i){return i.includes(`\r
|
|
32
|
+
`)),v){let N=h.error?` Request failed: ${h.error.message} (${h.error.code}).`:"";O.log(`Received response '${v.method} - (${h.id})' in ${Date.now()-v.timerStart}ms.${N}`,C)}else O.log(`Received response ${h.id} without active response promise.`,C)}else Yt("receive-response",h)}function Yt(h,v){if(!O||b===q.Off)return;let C={isLSPMessage:!0,type:h,message:v,timestamp:Date.now()};O.log(C)}function An(){if(ko())throw new on(In.Closed,"Connection is closed.");if(Xt())throw new on(In.Disposed,"Connection is disposed.")}function Ul(){if(So())throw new on(In.AlreadyListening,"Connection is already listening")}function Vl(){if(!So())throw new Error("Call listen() first.")}function Nn(h){return h===void 0?null:h}function Ro(h){if(h!==null)return h}function Oo(h){return h!=null&&!Array.isArray(h)&&typeof h=="object"}function cs(h,v){switch(h){case M.ParameterStructures.auto:return Oo(v)?Ro(v):[Nn(v)];case M.ParameterStructures.byName:if(!Oo(v))throw new Error("Received parameters by name but param is not an object literal.");return Ro(v);case M.ParameterStructures.byPosition:return[Nn(v)];default:throw new Error(`Unknown parameter structure ${h.toString()}`)}}function Ao(h,v){let C,N=h.numberOfParams;switch(N){case 0:C=void 0;break;case 1:C=cs(h.parameterStructures,v[0]);break;default:C=[];for(let G=0;G<v.length&&G<N;G++)C.push(Nn(v[G]));if(v.length<N)for(let G=v.length;G<N;G++)C.push(null);break}return C}let Qt={sendNotification:(h,...v)=>{An();let C,N;if(X.string(h)){C=h;let V=v[0],Q=0,ee=M.ParameterStructures.auto;M.ParameterStructures.is(V)&&(Q=1,ee=V);let z=v.length,J=z-Q;switch(J){case 0:N=void 0;break;case 1:N=cs(ee,v[Q]);break;default:if(ee===M.ParameterStructures.byName)throw new Error(`Received ${J} parameters for 'by Name' notification parameter structure.`);N=v.slice(Q,z).map(U=>Nn(U));break}}else{let V=v;C=h.method,N=Ao(h,V)}let G={jsonrpc:c,method:C,params:N};return zl(G),e.write(G).catch(V=>{throw s.error("Sending notification failed."),V})},onNotification:(h,v)=>{An();let C;return X.func(h)?d=h:v&&(X.string(h)?(C=h,p.set(h,{type:void 0,handler:v})):(C=h.method,p.set(h.method,{type:h,handler:v}))),{dispose:()=>{C!==void 0?p.delete(C):d=void 0}}},onProgress:(h,v,C)=>{if(f.has(v))throw new Error(`Progress handler for token ${v} already registered`);return f.set(v,C),{dispose:()=>{f.delete(v)}}},sendProgress:(h,v,C)=>Qt.sendNotification(Ln.type,{token:v,value:C}),onUnhandledProgress:et.event,sendRequest:(h,...v)=>{An(),Vl();let C,N,G;if(X.string(h)){C=h;let z=v[0],J=v[v.length-1],U=0,re=M.ParameterStructures.auto;M.ParameterStructures.is(z)&&(U=1,re=z);let be=v.length;nr.CancellationToken.is(J)&&(be=be-1,G=J);let Ge=be-U;switch(Ge){case 0:N=void 0;break;case 1:N=cs(re,v[U]);break;default:if(re===M.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' request parameter structure.`);N=v.slice(U,be).map(Zl=>Nn(Zl));break}}else{let z=v;C=h.method,N=Ao(h,z);let J=h.numberOfParams;G=nr.CancellationToken.is(z[J])?z[J]:void 0}let V=r++,Q;G&&(Q=G.onCancellationRequested(()=>{let z=lt.sender.sendCancellation(Qt,V);return z===void 0?(s.log(`Received no promise from cancellation strategy when cancelling id ${V}`),Promise.resolve()):z.catch(()=>{s.log(`Sending cancellation messages for id ${V} failed`)})}));let ee={jsonrpc:c,id:V,method:C,params:N};return Wl(ee),typeof lt.sender.enableCancellation=="function"&<.sender.enableCancellation(ee),new Promise(async(z,J)=>{let U=Ge=>{z(Ge),lt.sender.cleanup(V),Q?.dispose()},re=Ge=>{J(Ge),lt.sender.cleanup(V),Q?.dispose()},be={method:C,timerStart:Date.now(),resolve:U,reject:re};try{k.set(V,be),await e.write(ee)}catch(Ge){throw k.delete(V),be.reject(new M.ResponseError(M.ErrorCodes.MessageWriteError,Ge.message?Ge.message:"Unknown reason")),s.error("Sending request failed."),Ge}})},onRequest:(h,v)=>{An();let C=null;return rr.is(h)?(C=void 0,l=h):X.string(h)?(C=null,v!==void 0&&(C=h,u.set(h,{handler:v,type:void 0}))):v!==void 0&&(C=h.method,u.set(h.method,{type:h,handler:v})),{dispose:()=>{C!==null&&(C!==void 0?u.delete(C):l=void 0)}}},hasPendingResponse:()=>k.size>0,trace:async(h,v,C)=>{let N=!1,G=Re.Text;C!==void 0&&(X.boolean(C)?N=C:(N=C.sendNotification||!1,G=C.traceFormat||Re.Text)),b=h,S=G,b===q.Off?O=void 0:O=v,N&&!ko()&&!Xt()&&await Qt.sendNotification(or.type,{value:q.toString(h)})},onError:K.event,onClose:pe.event,onUnhandledNotification:Te.event,onDispose:os.event,end:()=>{e.end()},dispose:()=>{if(Xt())return;B=Fe.Disposed,os.fire(void 0);let h=new M.ResponseError(M.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let v of k.values())v.reject(h);k=new Map,x=new Map,E=new Set,g=new Ho.LinkedMap,X.func(e.dispose)&&e.dispose(),X.func(i.dispose)&&i.dispose()},listen:()=>{An(),Ul(),B=Fe.Listening,i.listen(Ll)},inspect:()=>{(0,Go.default)().console.log("inspect")}};return Qt.onNotification(yi.type,h=>{if(b===q.Off||!O)return;let v=b===q.Verbose||b===q.Compact;O.log(h.message,v?h.verbose:void 0)}),Qt.onNotification(Ln.type,h=>{let v=f.get(h.token);v?v(h.value):et.fire(h)}),Qt}I.createMessageConnection=yu});var Si=le(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.ProgressType=y.ProgressToken=y.createMessageConnection=y.NullLogger=y.ConnectionOptions=y.ConnectionStrategy=y.AbstractMessageBuffer=y.WriteableStreamMessageWriter=y.AbstractMessageWriter=y.MessageWriter=y.ReadableStreamMessageReader=y.AbstractMessageReader=y.MessageReader=y.SharedArrayReceiverStrategy=y.SharedArraySenderStrategy=y.CancellationToken=y.CancellationTokenSource=y.Emitter=y.Event=y.Disposable=y.LRUCache=y.Touch=y.LinkedMap=y.ParameterStructures=y.NotificationType9=y.NotificationType8=y.NotificationType7=y.NotificationType6=y.NotificationType5=y.NotificationType4=y.NotificationType3=y.NotificationType2=y.NotificationType1=y.NotificationType0=y.NotificationType=y.ErrorCodes=y.ResponseError=y.RequestType9=y.RequestType8=y.RequestType7=y.RequestType6=y.RequestType5=y.RequestType4=y.RequestType3=y.RequestType2=y.RequestType1=y.RequestType0=y.RequestType=y.Message=y.RAL=void 0;y.MessageStrategy=y.CancellationStrategy=y.CancellationSenderStrategy=y.CancellationReceiverStrategy=y.ConnectionError=y.ConnectionErrors=y.LogTraceNotification=y.SetTraceNotification=y.TraceFormat=y.TraceValues=y.Trace=void 0;var Z=Ms();Object.defineProperty(y,"Message",{enumerable:!0,get:function(){return Z.Message}});Object.defineProperty(y,"RequestType",{enumerable:!0,get:function(){return Z.RequestType}});Object.defineProperty(y,"RequestType0",{enumerable:!0,get:function(){return Z.RequestType0}});Object.defineProperty(y,"RequestType1",{enumerable:!0,get:function(){return Z.RequestType1}});Object.defineProperty(y,"RequestType2",{enumerable:!0,get:function(){return Z.RequestType2}});Object.defineProperty(y,"RequestType3",{enumerable:!0,get:function(){return Z.RequestType3}});Object.defineProperty(y,"RequestType4",{enumerable:!0,get:function(){return Z.RequestType4}});Object.defineProperty(y,"RequestType5",{enumerable:!0,get:function(){return Z.RequestType5}});Object.defineProperty(y,"RequestType6",{enumerable:!0,get:function(){return Z.RequestType6}});Object.defineProperty(y,"RequestType7",{enumerable:!0,get:function(){return Z.RequestType7}});Object.defineProperty(y,"RequestType8",{enumerable:!0,get:function(){return Z.RequestType8}});Object.defineProperty(y,"RequestType9",{enumerable:!0,get:function(){return Z.RequestType9}});Object.defineProperty(y,"ResponseError",{enumerable:!0,get:function(){return Z.ResponseError}});Object.defineProperty(y,"ErrorCodes",{enumerable:!0,get:function(){return Z.ErrorCodes}});Object.defineProperty(y,"NotificationType",{enumerable:!0,get:function(){return Z.NotificationType}});Object.defineProperty(y,"NotificationType0",{enumerable:!0,get:function(){return Z.NotificationType0}});Object.defineProperty(y,"NotificationType1",{enumerable:!0,get:function(){return Z.NotificationType1}});Object.defineProperty(y,"NotificationType2",{enumerable:!0,get:function(){return Z.NotificationType2}});Object.defineProperty(y,"NotificationType3",{enumerable:!0,get:function(){return Z.NotificationType3}});Object.defineProperty(y,"NotificationType4",{enumerable:!0,get:function(){return Z.NotificationType4}});Object.defineProperty(y,"NotificationType5",{enumerable:!0,get:function(){return Z.NotificationType5}});Object.defineProperty(y,"NotificationType6",{enumerable:!0,get:function(){return Z.NotificationType6}});Object.defineProperty(y,"NotificationType7",{enumerable:!0,get:function(){return Z.NotificationType7}});Object.defineProperty(y,"NotificationType8",{enumerable:!0,get:function(){return Z.NotificationType8}});Object.defineProperty(y,"NotificationType9",{enumerable:!0,get:function(){return Z.NotificationType9}});Object.defineProperty(y,"ParameterStructures",{enumerable:!0,get:function(){return Z.ParameterStructures}});var lr=Is();Object.defineProperty(y,"LinkedMap",{enumerable:!0,get:function(){return lr.LinkedMap}});Object.defineProperty(y,"LRUCache",{enumerable:!0,get:function(){return lr.LRUCache}});Object.defineProperty(y,"Touch",{enumerable:!0,get:function(){return lr.Touch}});var wu=Io();Object.defineProperty(y,"Disposable",{enumerable:!0,get:function(){return wu.Disposable}});var Qo=tn();Object.defineProperty(y,"Event",{enumerable:!0,get:function(){return Qo.Event}});Object.defineProperty(y,"Emitter",{enumerable:!0,get:function(){return Qo.Emitter}});var Ko=di();Object.defineProperty(y,"CancellationTokenSource",{enumerable:!0,get:function(){return Ko.CancellationTokenSource}});Object.defineProperty(y,"CancellationToken",{enumerable:!0,get:function(){return Ko.CancellationToken}});var ea=$o();Object.defineProperty(y,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return ea.SharedArraySenderStrategy}});Object.defineProperty(y,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return ea.SharedArrayReceiverStrategy}});var ur=Wo();Object.defineProperty(y,"MessageReader",{enumerable:!0,get:function(){return ur.MessageReader}});Object.defineProperty(y,"AbstractMessageReader",{enumerable:!0,get:function(){return ur.AbstractMessageReader}});Object.defineProperty(y,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return ur.ReadableStreamMessageReader}});var hr=Vo();Object.defineProperty(y,"MessageWriter",{enumerable:!0,get:function(){return hr.MessageWriter}});Object.defineProperty(y,"AbstractMessageWriter",{enumerable:!0,get:function(){return hr.AbstractMessageWriter}});Object.defineProperty(y,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return hr.WriteableStreamMessageWriter}});var vu=Zo();Object.defineProperty(y,"AbstractMessageBuffer",{enumerable:!0,get:function(){return vu.AbstractMessageBuffer}});var ue=Yo();Object.defineProperty(y,"ConnectionStrategy",{enumerable:!0,get:function(){return ue.ConnectionStrategy}});Object.defineProperty(y,"ConnectionOptions",{enumerable:!0,get:function(){return ue.ConnectionOptions}});Object.defineProperty(y,"NullLogger",{enumerable:!0,get:function(){return ue.NullLogger}});Object.defineProperty(y,"createMessageConnection",{enumerable:!0,get:function(){return ue.createMessageConnection}});Object.defineProperty(y,"ProgressToken",{enumerable:!0,get:function(){return ue.ProgressToken}});Object.defineProperty(y,"ProgressType",{enumerable:!0,get:function(){return ue.ProgressType}});Object.defineProperty(y,"Trace",{enumerable:!0,get:function(){return ue.Trace}});Object.defineProperty(y,"TraceValues",{enumerable:!0,get:function(){return ue.TraceValues}});Object.defineProperty(y,"TraceFormat",{enumerable:!0,get:function(){return ue.TraceFormat}});Object.defineProperty(y,"SetTraceNotification",{enumerable:!0,get:function(){return ue.SetTraceNotification}});Object.defineProperty(y,"LogTraceNotification",{enumerable:!0,get:function(){return ue.LogTraceNotification}});Object.defineProperty(y,"ConnectionErrors",{enumerable:!0,get:function(){return ue.ConnectionErrors}});Object.defineProperty(y,"ConnectionError",{enumerable:!0,get:function(){return ue.ConnectionError}});Object.defineProperty(y,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return ue.CancellationReceiverStrategy}});Object.defineProperty(y,"CancellationSenderStrategy",{enumerable:!0,get:function(){return ue.CancellationSenderStrategy}});Object.defineProperty(y,"CancellationStrategy",{enumerable:!0,get:function(){return ue.CancellationStrategy}});Object.defineProperty(y,"MessageStrategy",{enumerable:!0,get:function(){return ue.MessageStrategy}});var bu=ft();y.RAL=bu.default});var ia=le(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});var ta=require("util"),tt=Si(),ki=class i extends tt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return i.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new ta.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};ki.emptyBuffer=Buffer.allocUnsafe(0);var dr=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),tt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),tt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),tt.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),tt.Disposable.create(()=>this.stream.off("data",e))}},fr=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),tt.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),tt.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),tt.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((n,s)=>{let r=o=>{o==null?n():s(o)};typeof e=="string"?this.stream.write(e,t,r):this.stream.write(e,r)})}end(){this.stream.end()}},na=Object.freeze({messageBuffer:Object.freeze({create:i=>new ki(i)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(i,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(i,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(i,e)=>{try{return i instanceof Buffer?Promise.resolve(JSON.parse(i.toString(e.charset))):Promise.resolve(JSON.parse(new ta.TextDecoder(e.charset).decode(i)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:i=>new dr(i),asWritableStream:i=>new fr(i)}),console,timer:Object.freeze({setTimeout(i,e,...t){let n=setTimeout(i,e,...t);return{dispose:()=>clearTimeout(n)}},setImmediate(i,...e){let t=setImmediate(i,...e);return{dispose:()=>clearImmediate(t)}},setInterval(i,e,...t){let n=setInterval(i,e,...t);return{dispose:()=>clearInterval(n)}}})});function pr(){return na}(function(i){function e(){tt.RAL.install(na)}i.install=e})(pr||(pr={}));mr.default=pr});var br=le(W=>{"use strict";var _u=W&&W.__createBinding||(Object.create?(function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]})),xu=W&&W.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&_u(e,i,t)};Object.defineProperty(W,"__esModule",{value:!0});W.createMessageConnection=W.createServerSocketTransport=W.createClientSocketTransport=W.createServerPipeTransport=W.createClientPipeTransport=W.generateRandomPipeName=W.StreamMessageWriter=W.StreamMessageReader=W.SocketMessageWriter=W.SocketMessageReader=W.PortMessageWriter=W.PortMessageReader=W.IPCMessageWriter=W.IPCMessageReader=void 0;var an=ia();an.default.install();var sa=require("path"),Su=require("os"),ku=require("crypto"),Ti=require("net"),Oe=Si();xu(Si(),W);var gr=class extends Oe.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),Oe.Disposable.create(()=>this.process.off("message",e))}};W.IPCMessageReader=gr;var yr=class extends Oe.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on("error",n=>this.fireError(n)),t.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};W.IPCMessageWriter=yr;var wr=class extends Oe.AbstractMessageReader{constructor(e){super(),this.onData=new Oe.Emitter,e.on("close",()=>this.fireClose),e.on("error",t=>this.fireError(t)),e.on("message",t=>{this.onData.fire(t)})}listen(e){return this.onData.event(e)}};W.PortMessageReader=wr;var vr=class extends Oe.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",t=>this.fireError(t))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};W.PortMessageWriter=vr;var Rt=class extends Oe.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,an.default)().stream.asReadableStream(e),t)}};W.SocketMessageReader=Rt;var Ot=class extends Oe.WriteableStreamMessageWriter{constructor(e,t){super((0,an.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};W.SocketMessageWriter=Ot;var Ei=class extends Oe.ReadableStreamMessageReader{constructor(e,t){super((0,an.default)().stream.asReadableStream(e),t)}};W.StreamMessageReader=Ei;var Ci=class extends Oe.WriteableStreamMessageWriter{constructor(e,t){super((0,an.default)().stream.asWritableStream(e),t)}};W.StreamMessageWriter=Ci;var ra=process.env.XDG_RUNTIME_DIR,Eu=new Map([["linux",107],["darwin",103]]);function Cu(){let i=(0,ku.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${i}-sock`;let e;ra?e=sa.join(ra,`vscode-ipc-${i}.sock`):e=sa.join(Su.tmpdir(),`vscode-${i}.sock`);let t=Eu.get(process.platform);return t!==void 0&&e.length>t&&(0,an.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${t} characters.`),e}W.generateRandomPipeName=Cu;function Tu(i,e="utf-8"){let t,n=new Promise((s,r)=>{t=s});return new Promise((s,r)=>{let o=(0,Ti.createServer)(a=>{o.close(),t([new Rt(a,e),new Ot(a,e)])});o.on("error",r),o.listen(i,()=>{o.removeListener("error",r),s({onConnected:()=>n})})})}W.createClientPipeTransport=Tu;function Ru(i,e="utf-8"){let t=(0,Ti.createConnection)(i);return[new Rt(t,e),new Ot(t,e)]}W.createServerPipeTransport=Ru;function Ou(i,e="utf-8"){let t,n=new Promise((s,r)=>{t=s});return new Promise((s,r)=>{let o=(0,Ti.createServer)(a=>{o.close(),t([new Rt(a,e),new Ot(a,e)])});o.on("error",r),o.listen(i,"127.0.0.1",()=>{o.removeListener("error",r),s({onConnected:()=>n})})})}W.createClientSocketTransport=Ou;function Au(i,e="utf-8"){let t=(0,Ti.createConnection)(i,"127.0.0.1");return[new Rt(t,e),new Ot(t,e)]}W.createServerSocketTransport=Au;function Nu(i){let e=i;return e.read!==void 0&&e.addListener!==void 0}function Pu(i){let e=i;return e.write!==void 0&&e.addListener!==void 0}function ju(i,e,t,n){t||(t=Oe.NullLogger);let s=Nu(i)?new Ei(i):i,r=Pu(e)?new Ci(e):e;return Oe.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,Oe.createMessageConnection)(s,r,t,n)}W.createMessageConnection=ju});var aa=le((op,oa)=>{"use strict";oa.exports=br()});var bl=ht(require("child_process")),Ct=ht(require("fs")),_l=ht(require("path")),xl=ht(br()),rs=ht(aa());var Y={};Ql(Y,{BRAND:()=>rh,DIRTY:()=>At,EMPTY_PATH:()=>Du,INVALID:()=>j,NEVER:()=>Bh,OK:()=>ye,ParseStatus:()=>he,Schema:()=>$,ZodAny:()=>wt,ZodArray:()=>rt,ZodBigInt:()=>Pt,ZodBoolean:()=>jt,ZodBranded:()=>Fn,ZodCatch:()=>Ut,ZodDate:()=>Mt,ZodDefault:()=>Bt,ZodDiscriminatedUnion:()=>Ai,ZodEffects:()=>Le,ZodEnum:()=>zt,ZodError:()=>ke,ZodFirstPartyTypeKind:()=>L,ZodFunction:()=>Pi,ZodIntersection:()=>$t,ZodIssueCode:()=>_,ZodLazy:()=>Ft,ZodLiteral:()=>Wt,ZodMap:()=>fn,ZodNaN:()=>mn,ZodNativeEnum:()=>qt,ZodNever:()=>We,ZodNull:()=>It,ZodNullable:()=>Xe,ZodNumber:()=>Nt,ZodObject:()=>Ee,ZodOptional:()=>je,ZodParsedType:()=>R,ZodPipeline:()=>Wn,ZodPromise:()=>vt,ZodReadonly:()=>Vt,ZodRecord:()=>Ni,ZodSchema:()=>$,ZodSet:()=>pn,ZodString:()=>yt,ZodSymbol:()=>hn,ZodTransformer:()=>Le,ZodTuple:()=>Je,ZodType:()=>$,ZodUndefined:()=>Lt,ZodUnion:()=>Dt,ZodUnknown:()=>st,ZodVoid:()=>dn,addIssueToContext:()=>T,any:()=>ph,array:()=>wh,bigint:()=>lh,boolean:()=>wa,coerce:()=>qh,custom:()=>ma,date:()=>uh,datetimeRegex:()=>fa,defaultErrorMap:()=>nt,discriminatedUnion:()=>xh,effect:()=>Mh,enum:()=>Nh,function:()=>Rh,getErrorMap:()=>cn,getParsedType:()=>He,instanceof:()=>ah,intersection:()=>Sh,isAborted:()=>Ri,isAsync:()=>ln,isDirty:()=>Oi,isValid:()=>gt,late:()=>oh,lazy:()=>Oh,literal:()=>Ah,makeIssue:()=>$n,map:()=>Ch,nan:()=>ch,nativeEnum:()=>Ph,never:()=>gh,null:()=>fh,nullable:()=>Ih,number:()=>ya,object:()=>vh,objectUtil:()=>_r,oboolean:()=>zh,onumber:()=>Wh,optional:()=>Lh,ostring:()=>Fh,pipeline:()=>$h,preprocess:()=>Dh,promise:()=>jh,quotelessJson:()=>Mu,record:()=>Eh,set:()=>Th,setErrorMap:()=>Iu,strictObject:()=>bh,string:()=>ga,symbol:()=>hh,transformer:()=>Mh,tuple:()=>kh,undefined:()=>dh,union:()=>_h,unknown:()=>mh,util:()=>F,void:()=>yh});var F;(function(i){i.assertEqual=s=>{};function e(s){}i.assertIs=e;function t(s){throw new Error}i.assertNever=t,i.arrayToEnum=s=>{let r={};for(let o of s)r[o]=o;return r},i.getValidEnumValues=s=>{let r=i.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(let a of r)o[a]=s[a];return i.objectValues(o)},i.objectValues=s=>i.objectKeys(s).map(function(r){return s[r]}),i.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let r=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&r.push(o);return r},i.find=(s,r)=>{for(let o of s)if(r(o))return o},i.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,r=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}i.joinValues=n,i.jsonStringifyReplacer=(s,r)=>typeof r=="bigint"?r.toString():r})(F||(F={}));var _r;(function(i){i.mergeShapes=(e,t)=>({...e,...t})})(_r||(_r={}));var R=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),He=i=>{switch(typeof i){case"undefined":return R.undefined;case"string":return R.string;case"number":return Number.isNaN(i)?R.nan:R.number;case"boolean":return R.boolean;case"function":return R.function;case"bigint":return R.bigint;case"symbol":return R.symbol;case"object":return Array.isArray(i)?R.array:i===null?R.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?R.promise:typeof Map<"u"&&i instanceof Map?R.map:typeof Set<"u"&&i instanceof Set?R.set:typeof Date<"u"&&i instanceof Date?R.date:R.object;default:return R.unknown}};var _=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Mu=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),ke=class i extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(r){return r.message},n={_errors:[]},s=r=>{for(let o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let a=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return s(this),n}static assert(e){if(!(e instanceof i))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let s of this.issues)if(s.path.length>0){let r=s.path[0];t[r]=t[r]||[],t[r].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};ke.create=i=>new ke(i);var Lu=(i,e)=>{let t;switch(i.code){case _.invalid_type:i.received===R.undefined?t="Required":t=`Expected ${i.expected}, received ${i.received}`;break;case _.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(i.expected,F.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:t=`Unrecognized key(s) in object: ${F.joinValues(i.keys,", ")}`;break;case _.invalid_union:t="Invalid input";break;case _.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${F.joinValues(i.options)}`;break;case _.invalid_enum_value:t=`Invalid enum value. Expected ${F.joinValues(i.options)}, received '${i.received}'`;break;case _.invalid_arguments:t="Invalid function arguments";break;case _.invalid_return_type:t="Invalid function return type";break;case _.invalid_date:t="Invalid date";break;case _.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(t=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?t=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?t=`Invalid input: must end with "${i.validation.endsWith}"`:F.assertNever(i.validation):i.validation!=="regex"?t=`Invalid ${i.validation}`:t="Invalid";break;case _.too_small:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?t=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:t="Invalid input";break;case _.too_big:i.type==="array"?t=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?t=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?t=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?t=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?t=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:t="Invalid input";break;case _.custom:t="Invalid input";break;case _.invalid_intersection_types:t="Intersection results could not be merged";break;case _.not_multiple_of:t=`Number must be a multiple of ${i.multipleOf}`;break;case _.not_finite:t="Number must be finite";break;default:t=e.defaultError,F.assertNever(i)}return{message:t}},nt=Lu;var ca=nt;function Iu(i){ca=i}function cn(){return ca}var $n=i=>{let{data:e,path:t,errorMaps:n,issueData:s}=i,r=[...t,...s.path||[]],o={...s,path:r};if(s.message!==void 0)return{...s,path:r,message:s.message};let a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...s,path:r,message:a}},Du=[];function T(i,e){let t=cn(),n=$n({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,t,t===nt?void 0:nt].filter(s=>!!s)});i.common.issues.push(n)}var he=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let s of t){if(s.status==="aborted")return j;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let s of t){let r=await s.key,o=await s.value;n.push({key:r,value:o})}return i.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let s of t){let{key:r,value:o}=s;if(r.status==="aborted"||o.status==="aborted")return j;r.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[r.value]=o.value)}return{status:e.value,value:n}}},j=Object.freeze({status:"aborted"}),At=i=>({status:"dirty",value:i}),ye=i=>({status:"valid",value:i}),Ri=i=>i.status==="aborted",Oi=i=>i.status==="dirty",gt=i=>i.status==="valid",ln=i=>typeof Promise<"u"&&i instanceof Promise;var A;(function(i){i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message})(A||(A={}));var Me=class{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},la=(i,e)=>{if(gt(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ke(i.common.issues);return this._error=t,this._error}}};function D(i){if(!i)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:s}=i;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{let{message:c}=i;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:s}}var $=class{get description(){return this._def.description}_getType(e){return He(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new he,ctx:{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ln(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parseSync({data:e,path:n.path,parent:n});return la(n,s)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return gt(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>gt(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parse({data:e,path:n.path,parent:n}),r=await(ln(s)?s:Promise.resolve(s));return la(n,r)}refine(e,t){let n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,r)=>{let o=e(s),a=()=>r.addIssue({code:_.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new Le({schema:this,typeName:L.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return je.create(this,this._def)}nullable(){return Xe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rt.create(this)}promise(){return vt.create(this,this._def)}or(e){return Dt.create([this,e],this._def)}and(e){return $t.create(this,e,this._def)}transform(e){return new Le({...D(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Bt({...D(this._def),innerType:this,defaultValue:t,typeName:L.ZodDefault})}brand(){return new Fn({typeName:L.ZodBranded,type:this,...D(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ut({...D(this._def),innerType:this,catchValue:t,typeName:L.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Wn.create(this,e)}readonly(){return Vt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$u=/^c[^\s-]{8,}$/i,Fu=/^[0-9a-z]+$/,Wu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zu=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qu=/^[a-z0-9_-]{21}$/i,Bu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Uu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",xr,Gu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ju=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Xu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ha="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ku=new RegExp(`^${ha}$`);function da(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);let t=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function eh(i){return new RegExp(`^${da(i)}$`)}function fa(i){let e=`${ha}T${da(i)}`,t=[];return t.push(i.local?"Z?":"Z"),i.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function th(i,e){return!!((e==="v4"||!e)&&Gu.test(i)||(e==="v6"||!e)&&Ju.test(i))}function nh(i,e){if(!Bu.test(i))return!1;try{let[t]=i.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function ih(i,e){return!!((e==="v4"||!e)&&Hu.test(i)||(e==="v6"||!e)&&Xu.test(i))}var yt=class i extends ${_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==R.string){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.string,received:r.parsedType}),j}let n=new he,s;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){let o=e.data.length>r.value,a=e.data.length<r.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?T(s,{code:_.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):a&&T(s,{code:_.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Vu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"email",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")xr||(xr=new RegExp(Zu,"u")),xr.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"emoji",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")zu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"uuid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")qu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"nanoid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")$u.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cuid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Fu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cuid2",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")Wu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"ulid",code:_.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),T(s,{validation:"url",code:_.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"regex",code:_.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?fa(r).test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?Ku.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?eh(r).test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{code:_.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?Uu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"duration",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?th(e.data,r.version)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"ip",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?nh(e.data,r.alg)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"jwt",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?ih(e.data,r.version)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"cidr",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?Yu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"base64",code:_.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?Qu.test(e.data)||(s=this._getOrReturnCtx(e,s),T(s,{validation:"base64url",code:_.invalid_string,message:r.message}),n.dirty()):F.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:_.invalid_string,...A.errToObj(n)})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...A.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...A.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...A.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...A.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...A.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...A.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...A.errToObj(t)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};yt.create=i=>new yt({checks:[],typeName:L.ZodString,coerce:i?.coerce??!1,...D(i)});function sh(i,e){let t=(i.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,r=Number.parseInt(i.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return r%o/10**s}var Nt=class i extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==R.number){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.number,received:r.parsedType}),j}let n,s=new he;for(let r of this._def.checks)r.kind==="int"?F.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:_.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty()):r.kind==="multipleOf"?sh(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_finite,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,s){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(s)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Nt.create=i=>new Nt({checks:[],typeName:L.ZodNumber,coerce:i?.coerce||!1,...D(i)});var Pt=class i extends ${constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==R.bigint)return this._getInvalidInput(e);let n,s=new he;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:_.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):F.assertNever(r);return{status:s.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return T(t,{code:_.invalid_type,expected:R.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,n,s){return new i({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(s)}]})}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Pt.create=i=>new Pt({checks:[],typeName:L.ZodBigInt,coerce:i?.coerce??!1,...D(i)});var jt=class extends ${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==R.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.boolean,received:n.parsedType}),j}return ye(e.data)}};jt.create=i=>new jt({typeName:L.ZodBoolean,coerce:i?.coerce||!1,...D(i)});var Mt=class i extends ${_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==R.date){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_type,expected:R.date,received:r.parsedType}),j}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return T(r,{code:_.invalid_date}),j}let n=new he,s;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(s=this._getOrReturnCtx(e,s),T(s,{code:_.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):F.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new i({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Mt.create=i=>new Mt({checks:[],coerce:i?.coerce||!1,typeName:L.ZodDate,...D(i)});var hn=class extends ${_parse(e){if(this._getType(e)!==R.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.symbol,received:n.parsedType}),j}return ye(e.data)}};hn.create=i=>new hn({typeName:L.ZodSymbol,...D(i)});var Lt=class extends ${_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.undefined,received:n.parsedType}),j}return ye(e.data)}};Lt.create=i=>new Lt({typeName:L.ZodUndefined,...D(i)});var It=class extends ${_parse(e){if(this._getType(e)!==R.null){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.null,received:n.parsedType}),j}return ye(e.data)}};It.create=i=>new It({typeName:L.ZodNull,...D(i)});var wt=class extends ${constructor(){super(...arguments),this._any=!0}_parse(e){return ye(e.data)}};wt.create=i=>new wt({typeName:L.ZodAny,...D(i)});var st=class extends ${constructor(){super(...arguments),this._unknown=!0}_parse(e){return ye(e.data)}};st.create=i=>new st({typeName:L.ZodUnknown,...D(i)});var We=class extends ${_parse(e){let t=this._getOrReturnCtx(e);return T(t,{code:_.invalid_type,expected:R.never,received:t.parsedType}),j}};We.create=i=>new We({typeName:L.ZodNever,...D(i)});var dn=class extends ${_parse(e){if(this._getType(e)!==R.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.void,received:n.parsedType}),j}return ye(e.data)}};dn.create=i=>new dn({typeName:L.ZodVoid,...D(i)});var rt=class i extends ${_parse(e){let{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==R.array)return T(t,{code:_.invalid_type,expected:R.array,received:t.parsedType}),j;if(s.exactLength!==null){let o=t.data.length>s.exactLength.value,a=t.data.length<s.exactLength.value;(o||a)&&(T(t,{code:o?_.too_big:_.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(T(t,{code:_.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(T(t,{code:_.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>s.type._parseAsync(new Me(t,o,t.path,a)))).then(o=>he.mergeArray(n,o));let r=[...t.data].map((o,a)=>s.type._parseSync(new Me(t,o,t.path,a)));return he.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new i({...this._def,minLength:{value:e,message:A.toString(t)}})}max(e,t){return new i({...this._def,maxLength:{value:e,message:A.toString(t)}})}length(e,t){return new i({...this._def,exactLength:{value:e,message:A.toString(t)}})}nonempty(e){return this.min(1,e)}};rt.create=(i,e)=>new rt({type:i,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...D(e)});function un(i){if(i instanceof Ee){let e={};for(let t in i.shape){let n=i.shape[t];e[t]=je.create(un(n))}return new Ee({...i._def,shape:()=>e})}else return i instanceof rt?new rt({...i._def,type:un(i.element)}):i instanceof je?je.create(un(i.unwrap())):i instanceof Xe?Xe.create(un(i.unwrap())):i instanceof Je?Je.create(i.items.map(e=>un(e))):i}var Ee=class i extends ${constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=F.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==R.object){let l=this._getOrReturnCtx(e);return T(l,{code:_.invalid_type,expected:R.object,received:l.parsedType}),j}let{status:n,ctx:s}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof We&&this._def.unknownKeys==="strip"))for(let l in s.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let u=r[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Me(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof We){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")a.length>0&&(T(s,{code:_.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Me(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>he.mergeObjectSync(n,l)):he.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new i({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let s=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:A.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(e){return new i({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new i({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:L.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new i({...this._def,catchall:e})}pick(e){let t={};for(let n of F.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new i({...this._def,shape:()=>t})}omit(e){let t={};for(let n of F.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new i({...this._def,shape:()=>t})}deepPartial(){return un(this)}partial(e){let t={};for(let n of F.objectKeys(this.shape)){let s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}return new i({...this._def,shape:()=>t})}required(e){let t={};for(let n of F.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof je;)r=r._def.innerType;t[n]=r}return new i({...this._def,shape:()=>t})}keyof(){return pa(F.objectKeys(this.shape))}};Ee.create=(i,e)=>new Ee({shape:()=>i,unknownKeys:"strip",catchall:We.create(),typeName:L.ZodObject,...D(e)});Ee.strictCreate=(i,e)=>new Ee({shape:()=>i,unknownKeys:"strict",catchall:We.create(),typeName:L.ZodObject,...D(e)});Ee.lazycreate=(i,e)=>new Ee({shape:i,unknownKeys:"strip",catchall:We.create(),typeName:L.ZodObject,...D(e)});var Dt=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function s(r){for(let a of r)if(a.result.status==="valid")return a.result;for(let a of r)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=r.map(a=>new ke(a.ctx.common.issues));return T(t,{code:_.invalid_union,unionErrors:o}),j}if(t.common.async)return Promise.all(n.map(async r=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(s);{let r,o=[];for(let c of n){let l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!r&&(r={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;let a=o.map(c=>new ke(c));return T(t,{code:_.invalid_union,unionErrors:a}),j}}get options(){return this._def.options}};Dt.create=(i,e)=>new Dt({options:i,typeName:L.ZodUnion,...D(e)});var it=i=>i instanceof Ft?it(i.schema):i instanceof Le?it(i.innerType()):i instanceof Wt?[i.value]:i instanceof zt?i.options:i instanceof qt?F.objectValues(i.enum):i instanceof Bt?it(i._def.innerType):i instanceof Lt?[void 0]:i instanceof It?[null]:i instanceof je?[void 0,...it(i.unwrap())]:i instanceof Xe?[null,...it(i.unwrap())]:i instanceof Fn||i instanceof Vt?it(i.unwrap()):i instanceof Ut?it(i._def.innerType):[],Ai=class i extends ${_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.object)return T(t,{code:_.invalid_type,expected:R.object,received:t.parsedType}),j;let n=this.discriminator,s=t.data[n],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(T(t,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let s=new Map;for(let r of t){let o=it(r.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,r)}}return new i({typeName:L.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...D(n)})}};function Sr(i,e){let t=He(i),n=He(e);if(i===e)return{valid:!0,data:i};if(t===R.object&&n===R.object){let s=F.objectKeys(e),r=F.objectKeys(i).filter(a=>s.indexOf(a)!==-1),o={...i,...e};for(let a of r){let c=Sr(i[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===R.array&&n===R.array){if(i.length!==e.length)return{valid:!1};let s=[];for(let r=0;r<i.length;r++){let o=i[r],a=e[r],c=Sr(o,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return t===R.date&&n===R.date&&+i==+e?{valid:!0,data:i}:{valid:!1}}var $t=class extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=(r,o)=>{if(Ri(r)||Ri(o))return j;let a=Sr(r.value,o.value);return a.valid?((Oi(r)||Oi(o))&&t.dirty(),{status:t.value,value:a.data}):(T(n,{code:_.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>s(r,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};$t.create=(i,e,t)=>new $t({left:i,right:e,typeName:L.ZodIntersection,...D(t)});var Je=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.array)return T(n,{code:_.invalid_type,expected:R.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return T(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Me(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>he.mergeArray(t,o)):he.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new i({...this._def,rest:e})}};Je.create=(i,e)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Je({items:i,typeName:L.ZodTuple,rest:null,...D(e)})};var Ni=class i extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.object)return T(n,{code:_.invalid_type,expected:R.object,received:n.parsedType}),j;let s=[],r=this._def.keyType,o=this._def.valueType;for(let a in n.data)s.push({key:r._parse(new Me(n,a,n.path,a)),value:o._parse(new Me(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?he.mergeObjectAsync(t,s):he.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof $?new i({keyType:e,valueType:t,typeName:L.ZodRecord,...D(n)}):new i({keyType:yt.create(),valueType:e,typeName:L.ZodRecord,...D(t)})}},fn=class extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.map)return T(n,{code:_.invalid_type,expected:R.map,received:n.parsedType}),j;let s=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:s._parse(new Me(n,a,n.path,[l,"key"])),value:r._parse(new Me(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return j;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return j;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};fn.create=(i,e,t)=>new fn({valueType:e,keyType:i,typeName:L.ZodMap,...D(t)});var pn=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==R.set)return T(n,{code:_.invalid_type,expected:R.set,received:n.parsedType}),j;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(T(n,{code:_.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(T(n,{code:_.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());let r=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return j;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}let a=[...n.data.values()].map((c,l)=>r._parse(new Me(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new i({...this._def,minSize:{value:e,message:A.toString(t)}})}max(e,t){return new i({...this._def,maxSize:{value:e,message:A.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};pn.create=(i,e)=>new pn({valueType:i,minSize:null,maxSize:null,typeName:L.ZodSet,...D(e)});var Pi=class i extends ${constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.function)return T(t,{code:_.invalid_type,expected:R.function,received:t.parsedType}),j;function n(a,c){return $n({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cn(),nt].filter(l=>!!l),issueData:{code:_.invalid_arguments,argumentsError:c}})}function s(a,c){return $n({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cn(),nt].filter(l=>!!l),issueData:{code:_.invalid_return_type,returnTypeError:c}})}let r={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof vt){let a=this;return ye(async function(...c){let l=new ke([]),u=await a._def.args.parseAsync(c,r).catch(f=>{throw l.addIssue(n(c,f)),l}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,r).catch(f=>{throw l.addIssue(s(d,f)),l})})}else{let a=this;return ye(function(...c){let l=a._def.args.safeParse(c,r);if(!l.success)throw new ke([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=a._def.returns.safeParse(u,r);if(!d.success)throw new ke([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i({...this._def,args:Je.create(e).rest(st.create())})}returns(e){return new i({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new i({args:e||Je.create([]).rest(st.create()),returns:t||st.create(),typeName:L.ZodFunction,...D(n)})}},Ft=class extends ${get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ft.create=(i,e)=>new Ft({getter:i,typeName:L.ZodLazy,...D(e)});var Wt=class extends ${_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return T(t,{received:t.data,code:_.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}};Wt.create=(i,e)=>new Wt({value:i,typeName:L.ZodLiteral,...D(e)});function pa(i,e){return new zt({values:i,typeName:L.ZodEnum,...D(e)})}var zt=class i extends ${_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return T(t,{expected:F.joinValues(n),received:t.parsedType,code:_.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return T(t,{received:t.data,code:_.invalid_enum_value,options:n}),j}return ye(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return i.create(e,{...this._def,...t})}exclude(e,t=this._def){return i.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};zt.create=pa;var qt=class extends ${_parse(e){let t=F.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==R.string&&n.parsedType!==R.number){let s=F.objectValues(t);return T(n,{expected:F.joinValues(s),received:n.parsedType,code:_.invalid_type}),j}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=F.objectValues(t);return T(n,{received:n.data,code:_.invalid_enum_value,options:s}),j}return ye(e.data)}get enum(){return this._def.values}};qt.create=(i,e)=>new qt({values:i,typeName:L.ZodNativeEnum,...D(e)});var vt=class extends ${unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==R.promise&&t.common.async===!1)return T(t,{code:_.invalid_type,expected:R.promise,received:t.parsedType}),j;let n=t.parsedType===R.promise?t.data:Promise.resolve(t.data);return ye(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}};vt.create=(i,e)=>new vt({type:i,typeName:L.ZodPromise,...D(e)});var Le=class extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,r={addIssue:o=>{T(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),s.type==="preprocess"){let o=s.transform(n.data,r);if(n.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return j;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"?At(c.value):t.value==="dirty"?At(c.value):c});{if(t.value==="aborted")return j;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?j:a.status==="dirty"?At(a.value):t.value==="dirty"?At(a.value):a}}if(s.type==="refinement"){let o=a=>{let c=s.refinement(a,r);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?j:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?j:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gt(o))return j;let a=s.transform(o.value,r);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>gt(o)?Promise.resolve(s.transform(o.value,r)).then(a=>({status:t.value,value:a})):j);F.assertNever(s)}};Le.create=(i,e,t)=>new Le({schema:i,typeName:L.ZodEffects,effect:e,...D(t)});Le.createWithPreprocess=(i,e,t)=>new Le({schema:e,effect:{type:"preprocess",transform:i},typeName:L.ZodEffects,...D(t)});var je=class extends ${_parse(e){return this._getType(e)===R.undefined?ye(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};je.create=(i,e)=>new je({innerType:i,typeName:L.ZodOptional,...D(e)});var Xe=class extends ${_parse(e){return this._getType(e)===R.null?ye(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xe.create=(i,e)=>new Xe({innerType:i,typeName:L.ZodNullable,...D(e)});var Bt=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===R.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Bt.create=(i,e)=>new Bt({innerType:i,typeName:L.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...D(e)});var Ut=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ln(s)?s.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ke(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ke(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ut.create=(i,e)=>new Ut({innerType:i,typeName:L.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...D(e)});var mn=class extends ${_parse(e){if(this._getType(e)!==R.nan){let n=this._getOrReturnCtx(e);return T(n,{code:_.invalid_type,expected:R.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}};mn.create=i=>new mn({typeName:L.ZodNaN,...D(i)});var rh=Symbol("zod_brand"),Fn=class extends ${_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Wn=class i extends ${_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),At(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?j:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new i({in:e,out:t,typeName:L.ZodPipeline})}},Vt=class extends ${_parse(e){let t=this._def.innerType._parse(e),n=s=>(gt(s)&&(s.value=Object.freeze(s.value)),s);return ln(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}};Vt.create=(i,e)=>new Vt({innerType:i,typeName:L.ZodReadonly,...D(e)});function ua(i,e){let t=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof t=="string"?{message:t}:t}function ma(i,e={},t){return i?wt.create().superRefine((n,s)=>{let r=i(n);if(r instanceof Promise)return r.then(o=>{if(!o){let a=ua(e,n),c=a.fatal??t??!0;s.addIssue({code:"custom",...a,fatal:c})}});if(!r){let o=ua(e,n),a=o.fatal??t??!0;s.addIssue({code:"custom",...o,fatal:a})}}):wt.create()}var oh={object:Ee.lazycreate},L;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(L||(L={}));var ah=(i,e={message:`Input not instance of ${i.name}`})=>ma(t=>t instanceof i,e),ga=yt.create,ya=Nt.create,ch=mn.create,lh=Pt.create,wa=jt.create,uh=Mt.create,hh=hn.create,dh=Lt.create,fh=It.create,ph=wt.create,mh=st.create,gh=We.create,yh=dn.create,wh=rt.create,vh=Ee.create,bh=Ee.strictCreate,_h=Dt.create,xh=Ai.create,Sh=$t.create,kh=Je.create,Eh=Ni.create,Ch=fn.create,Th=pn.create,Rh=Pi.create,Oh=Ft.create,Ah=Wt.create,Nh=zt.create,Ph=qt.create,jh=vt.create,Mh=Le.create,Lh=je.create,Ih=Xe.create,Dh=Le.createWithPreprocess,$h=Wn.create,Fh=()=>ga().optional(),Wh=()=>ya().optional(),zh=()=>wa().optional(),qh={string:(i=>yt.create({...i,coerce:!0})),number:(i=>Nt.create({...i,coerce:!0})),boolean:(i=>jt.create({...i,coerce:!0})),bigint:(i=>Pt.create({...i,coerce:!0})),date:(i=>Mt.create({...i,coerce:!0}))};var Bh=j;var Sl=require("node:util"),Pe=require("node:path");var zn=class{diff(e,t,n={}){let s;typeof n=="function"?(s=n,n={}):"callback"in n&&(s=n.callback);let r=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(r,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,s)}diffWithOptionsObj(e,t,n,s){var r;let o=x=>{if(x=this.postProcess(x,n),s){setTimeout(function(){s(x)},0);return}else return x},a=t.length,c=e.length,l=1,u=a+c;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let d=(r=n.timeout)!==null&&r!==void 0?r:1/0,p=Date.now()+d,f=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(f[0],t,e,0,n);if(f[0].oldPos+1>=c&&w+1>=a)return o(this.buildValues(f[0].lastComponent,t,e));let g=-1/0,k=1/0,E=()=>{for(let x=Math.max(g,-l);x<=Math.min(k,l);x+=2){let b,S=f[x-1],O=f[x+1];S&&(f[x-1]=void 0);let B=!1;if(O){let pe=O.oldPos-x;B=O&&0<=pe&&pe<a}let K=S&&S.oldPos+1<c;if(!B&&!K){f[x]=void 0;continue}if(!K||B&&S.oldPos<O.oldPos?b=this.addToPath(O,!0,!1,0,n):b=this.addToPath(S,!1,!0,1,n),w=this.extractCommon(b,t,e,x,n),b.oldPos+1>=c&&w+1>=a)return o(this.buildValues(b.lastComponent,t,e))||!0;f[x]=b,b.oldPos+1>=c&&(k=Math.min(k,x-1)),w+1>=a&&(g=Math.max(g,x+1))}l++};if(s)(function x(){setTimeout(function(){if(l>u||Date.now()>p)return s(void 0);E()||x()},0)})();else for(;l<=u&&Date.now()<=p;){let x=E();if(x)return x}}addToPath(e,t,n,s,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+s,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+s,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,s,r){let o=t.length,a=n.length,c=e.oldPos,l=c-s,u=0;for(;l+1<o&&c+1<a&&this.equals(n[c+1],t[l+1],r);)l++,c++,u++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!r.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let s=[],r;for(;e;)s.push(e),r=e.previousComponent,delete e.previousComponent,e=r;s.reverse();let o=s.length,a=0,c=0,l=0;for(;a<o;a++){let u=s[a];if(u.removed)u.value=this.join(n.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let d=t.slice(c,c+u.count);d=d.map(function(p,f){let w=n[l+f];return w.length>p.length?w:p}),u.value=this.join(d)}else u.value=this.join(t.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return s}};function va(i){return i.includes(`\r
|
|
33
33
|
`)&&!i.startsWith(`
|
|
34
|
-
`)&&!i.match(/[^\r]\n/)}function
|
|
34
|
+
`)&&!i.match(/[^\r]\n/)}function ba(i){return!i.includes(`\r
|
|
35
35
|
`)&&i.includes(`
|
|
36
|
-
`)}var kr=class extends zn{constructor(){super(...arguments),this.tokenize=
|
|
36
|
+
`)}var kr=class extends zn{constructor(){super(...arguments),this.tokenize=Vh}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
37
37
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
38
38
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
39
39
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
40
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}},
|
|
41
|
-
`));let t=[],n=i.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let s=0;s<n.length;s++){let r=n[s];s%2&&!e.newlineIsToken?t[t.length-1]+=r:t.push(r)}return t}function Cr(i){return Array.isArray(i)?i.map(e=>Cr(e)):Object.assign(Object.assign({},i),{hunks:i.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var s;return t.startsWith("\\")||t.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?t:t+"\r"})}))})}function Tr(i){return Array.isArray(i)?i.map(e=>Tr(e)):Object.assign(Object.assign({},i),{hunks:i.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(t=>t.endsWith("\r")?t.substring(0,t.length-1):t)}))})}function
|
|
42
|
-
`),s=e.hunks,r=t.compareLine||((w,g,k,E)=>g===E),o=t.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return i;let c="",l=!1,u=!1;for(let w=0;w<s[s.length-1].lines.length;w++){let g=s[s.length-1].lines[w];g[0]=="\\"&&(c[0]=="+"?l=!0:c[0]=="-"&&(u=!0)),c=g}if(l){if(u){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(u){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function d(w,g,k,E=0,x=!0,b=[],S=0){let O=0,B=!1;for(;E<w.length;E++){let K=w[E],pe=K.length>0?K[0]:" ",Te=K.length>0?K.substr(1):K;if(pe==="-")if(r(g+1,n[g],pe,Te))g++,O=0;else return!k||n[g]==null?null:(b[S]=n[g],d(w,g+1,k-1,E,!1,b,S+1));if(pe==="+"){if(!x)return null;b[S]=Te,S++,O=0,B=!0}if(pe===" ")if(O++,b[S]=n[g],r(g+1,n[g],pe,Te))S++,x=!0,B=!1,g++;else return B||!k?null:n[g]&&(d(w,g+1,k-1,E+1,!1,b,S+1)||d(w,g+1,k-1,E,!1,b,S+1))||d(w,g,k-1,E+1,!1,b,S)}return S-=O,g-=O,b.length=S,{patchedLines:b,oldLineLastI:g-1}}let p=[],f=0;for(let w=0;w<s.length;w++){let g=s[w],k,E=n.length-g.oldLines+o,x;for(let b=0;b<=o;b++){x=g.oldStart+f-1;let S=
|
|
43
|
-
`)}function Or(i,e,t,n,s,r,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:u}=a;Er(t,n,Object.assign(Object.assign({},a),{callback:d=>{let p=l(d);u(p)}}))}else return l(Er(t,n,a));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(x){return x.map(function(b){return" "+b})}let p=[],f=0,w=0,g=[],k=1,E=1;for(let x=0;x<u.length;x++){let b=u[x],S=b.lines||
|
|
44
|
-
`)?x.lines[b]=x.lines[b].slice(0,-1):(x.lines.splice(b+1,0,"\"),b++);return{oldFileName:i,newFileName:e,oldHeader:s,newHeader:r,hunks:p}}}function
|
|
40
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}},Uh=new kr;function Er(i,e,t){return Uh.diff(i,e,t)}function Vh(i,e){e.stripTrailingCr&&(i=i.replace(/\r\n/g,`
|
|
41
|
+
`));let t=[],n=i.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let s=0;s<n.length;s++){let r=n[s];s%2&&!e.newlineIsToken?t[t.length-1]+=r:t.push(r)}return t}function Cr(i){return Array.isArray(i)?i.map(e=>Cr(e)):Object.assign(Object.assign({},i),{hunks:i.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>{var s;return t.startsWith("\\")||t.endsWith("\r")||!((s=e.lines[n+1])===null||s===void 0)&&s.startsWith("\\")?t:t+"\r"})}))})}function Tr(i){return Array.isArray(i)?i.map(e=>Tr(e)):Object.assign(Object.assign({},i),{hunks:i.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(t=>t.endsWith("\r")?t.substring(0,t.length-1):t)}))})}function _a(i){return Array.isArray(i)||(i=[i]),!i.some(e=>e.hunks.some(t=>t.lines.some(n=>!n.startsWith("\\")&&n.endsWith("\r"))))}function xa(i){return Array.isArray(i)||(i=[i]),i.some(e=>e.hunks.some(t=>t.lines.some(n=>n.endsWith("\r"))))&&i.every(e=>e.hunks.every(t=>t.lines.every((n,s)=>{var r;return n.startsWith("\\")||n.endsWith("\r")||((r=t.lines[s+1])===null||r===void 0?void 0:r.startsWith("\\"))})))}function Sa(i){let e=i.split(/\n/),t=[],n=0;function s(){let a={};for(t.push(a);n<e.length;){let c=e[n];if(/^(---|\+\+\+|@@)\s/.test(c))break;let l=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(c);l&&(a.index=l[1]),n++}for(r(a),r(a),a.hunks=[];n<e.length;){let c=e[n];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(c))break;if(/^@@/.test(c))a.hunks.push(o());else{if(c)throw new Error("Unknown line "+(n+1)+" "+JSON.stringify(c));n++}}}function r(a){let c=/^(---|\+\+\+)\s+(.*)\r?$/.exec(e[n]);if(c){let l=c[2].split(" ",2),u=(l[1]||"").trim(),d=l[0].replace(/\\\\/g,"\\");/^".*"$/.test(d)&&(d=d.substr(1,d.length-2)),c[1]==="---"?(a.oldFileName=d,a.oldHeader=u):(a.newFileName=d,a.newHeader=u),n++}}function o(){var a;let c=n,l=e[n++],u=l.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),d={oldStart:+u[1],oldLines:typeof u[2]>"u"?1:+u[2],newStart:+u[3],newLines:typeof u[4]>"u"?1:+u[4],lines:[]};d.oldLines===0&&(d.oldStart+=1),d.newLines===0&&(d.newStart+=1);let p=0,f=0;for(;n<e.length&&(f<d.oldLines||p<d.newLines||!((a=e[n])===null||a===void 0)&&a.startsWith("\\"));n++){let w=e[n].length==0&&n!=e.length-1?" ":e[n][0];if(w==="+"||w==="-"||w===" "||w==="\\")d.lines.push(e[n]),w==="+"?p++:w==="-"?f++:w===" "&&(p++,f++);else throw new Error(`Hunk at line ${c+1} contained invalid line ${e[n]}`)}if(!p&&d.newLines===1&&(d.newLines=0),!f&&d.oldLines===1&&(d.oldLines=0),p!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(f!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1));return d}for(;n<e.length;)s();return t}function ka(i,e,t){let n=!0,s=!1,r=!1,o=1;return function a(){if(n&&!r){if(s?o++:n=!1,i+o<=t)return i+o;r=!0}if(!s)return r||(n=!0),e<=i-o?i-o++:(s=!0,a())}}function Rr(i,e,t={}){let n;if(typeof e=="string"?n=Sa(e):Array.isArray(e)?n=e:n=[e],n.length>1)throw new Error("applyPatch only works with a single input.");return Zh(i,n[0],t)}function Zh(i,e,t={}){(t.autoConvertLineEndings||t.autoConvertLineEndings==null)&&(va(i)&&_a(e)?e=Cr(e):ba(i)&&xa(e)&&(e=Tr(e)));let n=i.split(`
|
|
42
|
+
`),s=e.hunks,r=t.compareLine||((w,g,k,E)=>g===E),o=t.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!s.length)return i;let c="",l=!1,u=!1;for(let w=0;w<s[s.length-1].lines.length;w++){let g=s[s.length-1].lines[w];g[0]=="\\"&&(c[0]=="+"?l=!0:c[0]=="-"&&(u=!0)),c=g}if(l){if(u){if(!o&&n[n.length-1]=="")return!1}else if(n[n.length-1]=="")n.pop();else if(!o)return!1}else if(u){if(n[n.length-1]!="")n.push("");else if(!o)return!1}function d(w,g,k,E=0,x=!0,b=[],S=0){let O=0,B=!1;for(;E<w.length;E++){let K=w[E],pe=K.length>0?K[0]:" ",Te=K.length>0?K.substr(1):K;if(pe==="-")if(r(g+1,n[g],pe,Te))g++,O=0;else return!k||n[g]==null?null:(b[S]=n[g],d(w,g+1,k-1,E,!1,b,S+1));if(pe==="+"){if(!x)return null;b[S]=Te,S++,O=0,B=!0}if(pe===" ")if(O++,b[S]=n[g],r(g+1,n[g],pe,Te))S++,x=!0,B=!1,g++;else return B||!k?null:n[g]&&(d(w,g+1,k-1,E+1,!1,b,S+1)||d(w,g+1,k-1,E,!1,b,S+1))||d(w,g,k-1,E+1,!1,b,S)}return S-=O,g-=O,b.length=S,{patchedLines:b,oldLineLastI:g-1}}let p=[],f=0;for(let w=0;w<s.length;w++){let g=s[w],k,E=n.length-g.oldLines+o,x;for(let b=0;b<=o;b++){x=g.oldStart+f-1;let S=ka(x,a,E);for(;x!==void 0&&(k=d(g.lines,x,b),!k);x=S());if(k)break}if(!k)return!1;for(let b=a;b<x;b++)p.push(n[b]);for(let b=0;b<k.patchedLines.length;b++){let S=k.patchedLines[b];p.push(S)}a=k.oldLineLastI+1,f=x+1-g.oldStart}for(let w=a;w<n.length;w++)p.push(n[w]);return p.join(`
|
|
43
|
+
`)}function Or(i,e,t,n,s,r,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);let c=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:u}=a;Er(t,n,Object.assign(Object.assign({},a),{callback:d=>{let p=l(d);u(p)}}))}else return l(Er(t,n,a));function l(u){if(!u)return;u.push({value:"",lines:[]});function d(x){return x.map(function(b){return" "+b})}let p=[],f=0,w=0,g=[],k=1,E=1;for(let x=0;x<u.length;x++){let b=u[x],S=b.lines||Gh(b.value);if(b.lines=S,b.added||b.removed){if(!f){let O=u[x-1];f=k,w=E,O&&(g=c>0?d(O.lines.slice(-c)):[],f-=g.length,w-=g.length)}for(let O of S)g.push((b.added?"+":"-")+O);b.added?E+=S.length:k+=S.length}else{if(f)if(S.length<=c*2&&x<u.length-2)for(let O of d(S))g.push(O);else{let O=Math.min(S.length,c);for(let K of d(S.slice(0,O)))g.push(K);let B={oldStart:f,oldLines:k-f+O,newStart:w,newLines:E-w+O,lines:g};p.push(B),f=0,w=0,g=[]}k+=S.length,E+=S.length}}for(let x of p)for(let b=0;b<x.lines.length;b++)x.lines[b].endsWith(`
|
|
44
|
+
`)?x.lines[b]=x.lines[b].slice(0,-1):(x.lines.splice(b+1,0,"\"),b++);return{oldFileName:i,newFileName:e,oldHeader:s,newHeader:r,hunks:p}}}function ji(i){if(Array.isArray(i))return i.map(ji).join(`
|
|
45
45
|
`);let e=[];i.oldFileName==i.newFileName&&e.push("Index: "+i.oldFileName),e.push("==================================================================="),e.push("--- "+i.oldFileName+(typeof i.oldHeader>"u"?"":" "+i.oldHeader)),e.push("+++ "+i.newFileName+(typeof i.newHeader>"u"?"":" "+i.newHeader));for(let t=0;t<i.hunks.length;t++){let n=i.hunks[t];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),e.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@");for(let s of n.lines)e.push(s)}return e.join(`
|
|
46
46
|
`)+`
|
|
47
|
-
`}function
|
|
47
|
+
`}function Ea(i,e,t,n,s,r,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:a}=o;Or(i,e,t,n,s,r,Object.assign(Object.assign({},o),{callback:c=>{a(c?ji(c):void 0)}}))}else{let a=Or(i,e,t,n,s,r,o);return a?ji(a):void 0}}function Ar(i,e,t,n,s,r){return Ea(i,i,e,t,n,s,r)}function Gh(i){let e=i.endsWith(`
|
|
48
48
|
`),t=i.split(`
|
|
49
49
|
`).map(n=>n+`
|
|
50
|
-
`);return e?t.pop():t.push(t.pop().slice(0,-1)),t}var Nr=(i,e,t)=>{let n=i instanceof RegExp?Ta(i,t):i,s=e instanceof RegExp?Ta(e,t):e,r=n!==null&&s!=null&&Jh(n,s,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+s.length)}},Ta=(i,e)=>{let t=e.match(i);return t?t[0]:null},Jh=(i,e,t)=>{let n,s,r,o,a,c=t.indexOf(i),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(i===e)return[c,l];for(n=[],r=t.length;u>=0&&!a;){if(u===c)n.push(u),c=t.indexOf(i,u+1);else if(n.length===1){let d=n.pop();d!==void 0&&(a=[d,l])}else s=n.pop(),s!==void 0&&s<r&&(r=s,o=l),l=t.indexOf(e,u+1);u=c<l&&c>=0?c:l}n.length&&o!==void 0&&(a=[r,o])}return a};var Ra="\0SLASH"+Math.random()+"\0",Oa="\0OPEN"+Math.random()+"\0",jr="\0CLOSE"+Math.random()+"\0",Aa="\0COMMA"+Math.random()+"\0",Na="\0PERIOD"+Math.random()+"\0",Xh=new RegExp(Ra,"g"),Yh=new RegExp(Oa,"g"),Qh=new RegExp(jr,"g"),Kh=new RegExp(Aa,"g"),ed=new RegExp(Na,"g"),td=/\\\\/g,nd=/\\{/g,id=/\\}/g,sd=/\\,/g,rd=/\\./g;function Pr(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function od(i){return i.replace(td,Ra).replace(nd,Oa).replace(id,jr).replace(sd,Aa).replace(rd,Na)}function ad(i){return i.replace(Xh,"\\").replace(Yh,"{").replace(Qh,"}").replace(Kh,",").replace(ed,".")}function Pa(i){if(!i)return[""];let e=[],t=Nr("{","}",i);if(!t)return i.split(",");let{pre:n,body:s,post:r}=t,o=n.split(",");o[o.length-1]+="{"+s+"}";let a=Pa(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function ja(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),qn(od(i),!0).map(ad)):[]}function cd(i){return"{"+i+"}"}function ld(i){return/^-?0\d/.test(i)}function ud(i,e){return i<=e}function hd(i,e){return i>=e}function qn(i,e){let t=[],n=Nr("{","}",i);if(!n)return[i];let s=n.pre,r=n.post.length?qn(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<r.length;o++){let a=s+"{"+n.body+"}"+r[o];t.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=o||a,l=n.body.indexOf(",")>=0;if(!c&&!l)return n.post.match(/,(?!,).*\}/)?(i=n.pre+"{"+n.body+jr+n.post,qn(i)):[i];let u;if(c)u=n.body.split(/\.\./);else if(u=Pa(n.body),u.length===1&&u[0]!==void 0&&(u=qn(u[0],!1).map(cd),u.length===1))return r.map(p=>n.pre+u[0]+p);let d;if(c&&u[0]!==void 0&&u[1]!==void 0){let p=Pr(u[0]),f=Pr(u[1]),w=Math.max(u[0].length,u[1].length),g=u.length===3&&u[2]!==void 0?Math.abs(Pr(u[2])):1,k=ud;f<p&&(g*=-1,k=hd);let x=u.some(ld);d=[];for(let b=p;k(b,f);b+=g){let S;if(a)S=String.fromCharCode(b),S==="\\"&&(S="");else if(S=String(b),x){let O=w-S.length;if(O>0){let B=new Array(O+1).join("0");b<0?S="-"+B+S.slice(1):S=B+S}}d.push(S)}}else{d=[];for(let p=0;p<u.length;p++)d.push.apply(d,qn(u[p],!1))}for(let p=0;p<d.length;p++)for(let f=0;f<r.length;f++){let w=s+d[p]+r[f];(!e||c||w)&&t.push(w)}}return t}var Bn=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var dd={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Un=i=>i.replace(/[[\]\\-]/g,"\\$&"),fd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ma=i=>i.join(""),La=(i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],s=[],r=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;r<i.length;){let g=i.charAt(r);if((g==="!"||g==="^")&&r===t+1){l=!0,r++;continue}if(g==="]"&&o&&!c){u=r+1;break}if(o=!0,g==="\\"&&!c){c=!0,r++;continue}if(g==="["&&!c){for(let[k,[E,x,b]]of Object.entries(dd))if(i.startsWith(k,r)){if(d)return["$.",!1,i.length-t,!0];r+=k.length,b?s.push(E):n.push(E),a=a||x;continue e}}if(c=!1,d){g>d?n.push(Un(d)+"-"+Un(g)):g===d&&n.push(Un(g)),d="",r++;continue}if(i.startsWith("-]",r+1)){n.push(Un(g+"-")),r+=2;continue}if(i.startsWith("-",r+1)){d=g,r+=2;continue}n.push(Un(g)),r++}if(u<r)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let g=n[0].length===2?n[0].slice(-1):n[0];return[fd(g),!1,u-t,!1]}let p="["+(l?"^":"")+Ma(n)+"]",f="["+(l?"":"^")+Ma(s)+"]";return[n.length&&s.length?"("+p+"|"+f+")":n.length?p:f,a,u-t,!0]};var ze=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?i.replace(/\[([^\/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var pd=new Set(["!","?","+","*","@"]),Ia=i=>pd.has(i),md="(?!(?:^|/)\\.\\.?(?:$|/))",Li="(?!\\.)",gd=new Set(["[","."]),yd=new Set(["..","."]),wd=new Set("().*{}+?[]^$\\!"),vd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Mr="[^/]",Da=Mr+"*?",$a=Mr+"+?",mn=class i{type;#e;#t;#r=!1;#i=[];#o;#b;#y;#a=!1;#h;#c;#l=!1;constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#h=this.#e===this?n:this.#e.#h,this.#y=this.#e===this?[]:this.#e.#y,e==="!"&&!this.#e.#a&&this.#y.push(this),this.#b=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#c=this.#i.map(e=>String(e)).join("")}#n(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let t=e,n=t.#o;for(;n;){for(let s=t.#b+1;!n.type&&s<n.#i.length;s++)for(let r of e.#i){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#i[s])}t=n,n=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let e=this.#o;for(let t=0;t<this.#b;t++){let n=e.#i[t];if(!(n instanceof i&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let n of this.#i)t.copyIn(n);return t}static#d(e,t,n,s){let r=!1,o=!1,a=-1,c=!1;if(t.type===null){let f=n,w="";for(;f<e.length;){let g=e.charAt(f++);if(r||g==="\\"){r=!r,w+=g;continue}if(o){f===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(f===a+2&&c)&&(o=!1),w+=g;continue}else if(g==="["){o=!0,a=f,c=!1,w+=g;continue}if(!s.noext&&Ia(g)&&e.charAt(f)==="("){t.push(w),w="";let k=new i(g,t);f=i.#d(e,k,f,s),t.push(k);continue}w+=g}return t.push(w),f}let l=n+1,u=new i(null,t),d=[],p="";for(;l<e.length;){let f=e.charAt(l++);if(r||f==="\\"){r=!r,p+=f;continue}if(o){l===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===a+2&&c)&&(o=!1),p+=f;continue}else if(f==="["){o=!0,a=l,c=!1,p+=f;continue}if(Ia(f)&&e.charAt(l)==="("){u.push(p),p="";let w=new i(f,u);u.push(w),l=i.#d(e,w,l,s);continue}if(f==="|"){u.push(p),p="",d.push(u),u=new i(null,t);continue}if(f===")")return p===""&&t.#i.length===0&&(t.#l=!0),u.push(p),p="",t.push(...d,u),l;p+=f}return t.type=null,t.#t=void 0,t.#i=[e.substring(n-1)],l}static fromGlob(e,t={}){let n=new i(null,void 0,t);return i.#d(e,n,0,t),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,s,r]=this.toRegExpSource();if(!(s||this.#t||this.#h.nocase&&!this.#h.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#h.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#h}toRegExpSource(e){let t=e??!!this.#h.dot;if(this.#e===this&&this.#n(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#i.some(f=>typeof f!="string"),l=this.#i.map(f=>{let[w,g,k,E]=typeof f=="string"?i.#p(f,this.#t,c):f.toRegExpSource(e);return this.#t=this.#t||k,this.#r=this.#r||E,w}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&yd.has(this.#i[0]))){let w=gd,g=t&&w.has(l.charAt(0))||l.startsWith("\\.")&&w.has(l.charAt(2))||l.startsWith("\\.\\.")&&w.has(l.charAt(4)),k=!t&&!e&&w.has(l.charAt(0));u=g?md:k?Li:""}let d="";return this.isEnd()&&this.#e.#a&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,ze(l),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#w(t);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,ze(this.toString()),!1,!1]}let o=!n||e||t||!Li?"":this.#w(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!t?Li:"")+$a;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Li:"")+Da+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+r+c}return[a,ze(r),this.#t=!!this.#t,this.#r]}#w(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,s,r,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#p(e,t,n=!1){let s=!1,r="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,r+=(wd.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?r+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,p]=La(e,a);if(d){r+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){r+=n&&e==="*"?$a:Da,t=!0;continue}if(c==="?"){r+=Mr,t=!0;continue}r+=vd(c)}return[r,ze(e),!!t,o]}};var gn=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var _e=(i,e,t={})=>(Bn(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ae(e,t).match(i)),bd=/^\*+([^+@!?\*\[\(]*)$/,_d=i=>e=>!e.startsWith(".")&&e.endsWith(i),xd=i=>e=>e.endsWith(i),Sd=i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),kd=i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),Ed=/^\*+\.\*+$/,Cd=i=>!i.startsWith(".")&&i.includes("."),Td=i=>i!=="."&&i!==".."&&i.includes("."),Rd=/^\.\*+$/,Od=i=>i!=="."&&i!==".."&&i.startsWith("."),Ad=/^\*+$/,Nd=i=>i.length!==0&&!i.startsWith("."),Pd=i=>i.length!==0&&i!=="."&&i!=="..",jd=/^\?+([^+@!?\*\[\(]*)?$/,Md=([i,e=""])=>{let t=za([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Ld=([i,e=""])=>{let t=qa([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Id=([i,e=""])=>{let t=qa([i]);return e?n=>t(n)&&n.endsWith(e):t},Dd=([i,e=""])=>{let t=za([i]);return e?n=>t(n)&&n.endsWith(e):t},za=([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},qa=([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},Ba=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Fa={win32:{sep:"\\"},posix:{sep:"/"}},$d=Ba==="win32"?Fa.win32.sep:Fa.posix.sep;_e.sep=$d;var de=Symbol("globstar **");_e.GLOBSTAR=de;var Fd="[^/]",Wd=Fd+"*?",zd="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",qd="(?:(?!(?:\\/|^)\\.).)*?",Bd=(i,e={})=>t=>_e(t,i,e);_e.filter=Bd;var Ie=(i,e={})=>Object.assign({},i,e),Ud=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return _e;let e=_e;return Object.assign((n,s,r={})=>e(n,s,Ie(i,r)),{Minimatch:class extends e.Minimatch{constructor(s,r={}){super(s,Ie(i,r))}static defaults(s){return e.defaults(Ie(i,s)).Minimatch}},AST:class extends e.AST{constructor(s,r,o={}){super(s,r,Ie(i,o))}static fromGlob(s,r={}){return e.AST.fromGlob(s,Ie(i,r))}},unescape:(n,s={})=>e.unescape(n,Ie(i,s)),escape:(n,s={})=>e.escape(n,Ie(i,s)),filter:(n,s={})=>e.filter(n,Ie(i,s)),defaults:n=>e.defaults(Ie(i,n)),makeRe:(n,s={})=>e.makeRe(n,Ie(i,s)),braceExpand:(n,s={})=>e.braceExpand(n,Ie(i,s)),match:(n,s,r={})=>e.match(n,s,Ie(i,r)),sep:e.sep,GLOBSTAR:de})};_e.defaults=Ud;var Ua=(i,e={})=>(Bn(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:ja(i));_e.braceExpand=Ua;var Vd=(i,e={})=>new Ae(i,e).makeRe();_e.makeRe=Vd;var Zd=(i,e,t={})=>{let n=new Ae(e,t);return i=i.filter(s=>n.match(s)),n.options.nonull&&!i.length&&i.push(e),i};_e.match=Zd;var Wa=/[?*]|[+@!]\(.*?\)|\[|\]/,Gd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ae=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Bn(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Ba,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=r[0]===""&&r[1]===""&&(r[2]==="?"||!Wa.test(r[2]))&&!Wa.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(c)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(l)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let s=0;s<e[n].length;s++)e[n][s]==="**"&&(e[n][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let s=n;for(;t[s+1]==="**";)s++;s!==n&&t.splice(n,s-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,s)=>{let r=n[n.length-1];return s==="**"&&r==="**"?n:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(s),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let r=e[s];s===1&&r===""&&e[0]===""||(r==="."||r==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let o=s;for(;n[o+1]==="**";)o++;o>s&&n.splice(s+1,o-s);let a=n[s+1],c=n[s+2],l=n[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(s,1);let u=n.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){let o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...c),n.length===0&&n.push(""),r-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let s=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(s){e[t]=[],e[n]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let s=0,r=0,o=[],a="";for(;s<e.length&&r<t.length;)if(e[s]===t[r])o.push(a==="b"?t[r]:e[s]),s++,r++;else if(n&&e[s]==="**"&&t[r]===e[s+1])o.push(e[s]),s++;else if(n&&t[r]==="**"&&e[s]===t[r+1])o.push(t[r]),r++;else if(e[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,r++}else if(t[r]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[r]),s++,r++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),k=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=k?3:g?0:void 0,S=x?3:E?0:void 0;if(typeof b=="number"&&typeof S=="number"){let[O,B]=[e[b],t[S]];O.toLowerCase()===B.toLowerCase()&&(t[S]=O,S>b?t=t.slice(S):b>S&&(e=e.slice(b)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===de){this.debug("GLOBSTAR",[t,u,d]);var p=o,f=a+1;if(f===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var w=e[p];if(this.debug(`
|
|
50
|
+
`);return e?t.pop():t.push(t.pop().slice(0,-1)),t}var Nr=(i,e,t)=>{let n=i instanceof RegExp?Ca(i,t):i,s=e instanceof RegExp?Ca(e,t):e,r=n!==null&&s!=null&&Hh(n,s,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+s.length)}},Ca=(i,e)=>{let t=e.match(i);return t?t[0]:null},Hh=(i,e,t)=>{let n,s,r,o,a,c=t.indexOf(i),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(i===e)return[c,l];for(n=[],r=t.length;u>=0&&!a;){if(u===c)n.push(u),c=t.indexOf(i,u+1);else if(n.length===1){let d=n.pop();d!==void 0&&(a=[d,l])}else s=n.pop(),s!==void 0&&s<r&&(r=s,o=l),l=t.indexOf(e,u+1);u=c<l&&c>=0?c:l}n.length&&o!==void 0&&(a=[r,o])}return a};var Ta="\0SLASH"+Math.random()+"\0",Ra="\0OPEN"+Math.random()+"\0",jr="\0CLOSE"+Math.random()+"\0",Oa="\0COMMA"+Math.random()+"\0",Aa="\0PERIOD"+Math.random()+"\0",Jh=new RegExp(Ta,"g"),Xh=new RegExp(Ra,"g"),Yh=new RegExp(jr,"g"),Qh=new RegExp(Oa,"g"),Kh=new RegExp(Aa,"g"),ed=/\\\\/g,td=/\\{/g,nd=/\\}/g,id=/\\,/g,sd=/\\./g;function Pr(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function rd(i){return i.replace(ed,Ta).replace(td,Ra).replace(nd,jr).replace(id,Oa).replace(sd,Aa)}function od(i){return i.replace(Jh,"\\").replace(Xh,"{").replace(Yh,"}").replace(Qh,",").replace(Kh,".")}function Na(i){if(!i)return[""];let e=[],t=Nr("{","}",i);if(!t)return i.split(",");let{pre:n,body:s,post:r}=t,o=n.split(",");o[o.length-1]+="{"+s+"}";let a=Na(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Pa(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),qn(rd(i),!0).map(od)):[]}function ad(i){return"{"+i+"}"}function cd(i){return/^-?0\d/.test(i)}function ld(i,e){return i<=e}function ud(i,e){return i>=e}function qn(i,e){let t=[],n=Nr("{","}",i);if(!n)return[i];let s=n.pre,r=n.post.length?qn(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<r.length;o++){let a=s+"{"+n.body+"}"+r[o];t.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=o||a,l=n.body.indexOf(",")>=0;if(!c&&!l)return n.post.match(/,(?!,).*\}/)?(i=n.pre+"{"+n.body+jr+n.post,qn(i)):[i];let u;if(c)u=n.body.split(/\.\./);else if(u=Na(n.body),u.length===1&&u[0]!==void 0&&(u=qn(u[0],!1).map(ad),u.length===1))return r.map(p=>n.pre+u[0]+p);let d;if(c&&u[0]!==void 0&&u[1]!==void 0){let p=Pr(u[0]),f=Pr(u[1]),w=Math.max(u[0].length,u[1].length),g=u.length===3&&u[2]!==void 0?Math.abs(Pr(u[2])):1,k=ld;f<p&&(g*=-1,k=ud);let x=u.some(cd);d=[];for(let b=p;k(b,f);b+=g){let S;if(a)S=String.fromCharCode(b),S==="\\"&&(S="");else if(S=String(b),x){let O=w-S.length;if(O>0){let B=new Array(O+1).join("0");b<0?S="-"+B+S.slice(1):S=B+S}}d.push(S)}}else{d=[];for(let p=0;p<u.length;p++)d.push.apply(d,qn(u[p],!1))}for(let p=0;p<d.length;p++)for(let f=0;f<r.length;f++){let w=s+d[p]+r[f];(!e||c||w)&&t.push(w)}}return t}var Bn=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var hd={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Un=i=>i.replace(/[[\]\\-]/g,"\\$&"),dd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ja=i=>i.join(""),Ma=(i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],s=[],r=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;r<i.length;){let g=i.charAt(r);if((g==="!"||g==="^")&&r===t+1){l=!0,r++;continue}if(g==="]"&&o&&!c){u=r+1;break}if(o=!0,g==="\\"&&!c){c=!0,r++;continue}if(g==="["&&!c){for(let[k,[E,x,b]]of Object.entries(hd))if(i.startsWith(k,r)){if(d)return["$.",!1,i.length-t,!0];r+=k.length,b?s.push(E):n.push(E),a=a||x;continue e}}if(c=!1,d){g>d?n.push(Un(d)+"-"+Un(g)):g===d&&n.push(Un(g)),d="",r++;continue}if(i.startsWith("-]",r+1)){n.push(Un(g+"-")),r+=2;continue}if(i.startsWith("-",r+1)){d=g,r+=2;continue}n.push(Un(g)),r++}if(u<r)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let g=n[0].length===2?n[0].slice(-1):n[0];return[dd(g),!1,u-t,!1]}let p="["+(l?"^":"")+ja(n)+"]",f="["+(l?"":"^")+ja(s)+"]";return[n.length&&s.length?"("+p+"|"+f+")":n.length?p:f,a,u-t,!0]};var ze=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?i.replace(/\[([^\/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var fd=new Set(["!","?","+","*","@"]),La=i=>fd.has(i),pd="(?!(?:^|/)\\.\\.?(?:$|/))",Mi="(?!\\.)",md=new Set(["[","."]),gd=new Set(["..","."]),yd=new Set("().*{}+?[]^$\\!"),wd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Mr="[^/]",Ia=Mr+"*?",Da=Mr+"+?",gn=class i{type;#e;#n;#r=!1;#s=[];#o;#b;#y;#u=!1;#a;#d;#h=!1;constructor(e,t,n={}){this.type=e,e&&(this.#n=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#y=this.#e===this?[]:this.#e.#y,e==="!"&&!this.#e.#u&&this.#y.push(this),this.#b=this.#o?this.#o.#s.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#s)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#d!==void 0?this.#d:this.type?this.#d=this.type+"("+this.#s.map(e=>String(e)).join("|")+")":this.#d=this.#s.map(e=>String(e)).join("")}#c(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let t=e,n=t.#o;for(;n;){for(let s=t.#b+1;!n.type&&s<n.#s.length;s++)for(let r of e.#s){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#s[s])}t=n,n=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#o===this))throw new Error("invalid part: "+t);this.#s.push(t)}}toJSON(){let e=this.type===null?this.#s.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#s.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let e=this.#o;for(let t=0;t<this.#b;t++){let n=e.#s[t];if(!(n instanceof i&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#s.length:0;return this.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let n of this.#s)t.copyIn(n);return t}static#i(e,t,n,s){let r=!1,o=!1,a=-1,c=!1;if(t.type===null){let f=n,w="";for(;f<e.length;){let g=e.charAt(f++);if(r||g==="\\"){r=!r,w+=g;continue}if(o){f===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(f===a+2&&c)&&(o=!1),w+=g;continue}else if(g==="["){o=!0,a=f,c=!1,w+=g;continue}if(!s.noext&&La(g)&&e.charAt(f)==="("){t.push(w),w="";let k=new i(g,t);f=i.#i(e,k,f,s),t.push(k);continue}w+=g}return t.push(w),f}let l=n+1,u=new i(null,t),d=[],p="";for(;l<e.length;){let f=e.charAt(l++);if(r||f==="\\"){r=!r,p+=f;continue}if(o){l===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===a+2&&c)&&(o=!1),p+=f;continue}else if(f==="["){o=!0,a=l,c=!1,p+=f;continue}if(La(f)&&e.charAt(l)==="("){u.push(p),p="";let w=new i(f,u);u.push(w),l=i.#i(e,w,l,s);continue}if(f==="|"){u.push(p),p="",d.push(u),u=new i(null,t);continue}if(f===")")return p===""&&t.#s.length===0&&(t.#h=!0),u.push(p),p="",t.push(...d,u),l;p+=f}return t.type=null,t.#n=void 0,t.#s=[e.substring(n-1)],l}static fromGlob(e,t={}){let n=new i(null,void 0,t);return i.#i(e,n,0,t),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,s,r]=this.toRegExpSource();if(!(s||this.#n||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#c(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#s.some(f=>typeof f!="string"),l=this.#s.map(f=>{let[w,g,k,E]=typeof f=="string"?i.#_(f,this.#n,c):f.toRegExpSource(e);return this.#n=this.#n||k,this.#r=this.#r||E,w}).join(""),u="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&gd.has(this.#s[0]))){let w=md,g=t&&w.has(l.charAt(0))||l.startsWith("\\.")&&w.has(l.charAt(2))||l.startsWith("\\.\\.")&&w.has(l.charAt(4)),k=!t&&!e&&w.has(l.charAt(0));u=g?pd:k?Mi:""}let d="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,ze(l),this.#n=!!this.#n,this.#r]}let n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#f(t);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let c=this.toString();return this.#s=[c],this.type=null,this.#n=void 0,[c,ze(this.toString()),!1,!1]}let o=!n||e||t||!Mi?"":this.#f(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#h)a=(this.isStart()&&!t?Mi:"")+Da;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Mi:"")+Ia+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+r+c}return[a,ze(r),this.#n=!!this.#n,this.#r]}#f(e){return this.#s.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,s,r,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,n=!1){let s=!1,r="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,r+=(yd.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?r+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,p]=Ma(e,a);if(d){r+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){r+=n&&e==="*"?Da:Ia,t=!0;continue}if(c==="?"){r+=Mr,t=!0;continue}r+=wd(c)}return[r,ze(e),!!t,o]}};var yn=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var _e=(i,e,t={})=>(Bn(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ae(e,t).match(i)),vd=/^\*+([^+@!?\*\[\(]*)$/,bd=i=>e=>!e.startsWith(".")&&e.endsWith(i),_d=i=>e=>e.endsWith(i),xd=i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),Sd=i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),kd=/^\*+\.\*+$/,Ed=i=>!i.startsWith(".")&&i.includes("."),Cd=i=>i!=="."&&i!==".."&&i.includes("."),Td=/^\.\*+$/,Rd=i=>i!=="."&&i!==".."&&i.startsWith("."),Od=/^\*+$/,Ad=i=>i.length!==0&&!i.startsWith("."),Nd=i=>i.length!==0&&i!=="."&&i!=="..",Pd=/^\?+([^+@!?\*\[\(]*)?$/,jd=([i,e=""])=>{let t=Wa([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Md=([i,e=""])=>{let t=za([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Ld=([i,e=""])=>{let t=za([i]);return e?n=>t(n)&&n.endsWith(e):t},Id=([i,e=""])=>{let t=Wa([i]);return e?n=>t(n)&&n.endsWith(e):t},Wa=([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},za=([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},qa=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$a={win32:{sep:"\\"},posix:{sep:"/"}},Dd=qa==="win32"?$a.win32.sep:$a.posix.sep;_e.sep=Dd;var de=Symbol("globstar **");_e.GLOBSTAR=de;var $d="[^/]",Fd=$d+"*?",Wd="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",zd="(?:(?!(?:\\/|^)\\.).)*?",qd=(i,e={})=>t=>_e(t,i,e);_e.filter=qd;var Ie=(i,e={})=>Object.assign({},i,e),Bd=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return _e;let e=_e;return Object.assign((n,s,r={})=>e(n,s,Ie(i,r)),{Minimatch:class extends e.Minimatch{constructor(s,r={}){super(s,Ie(i,r))}static defaults(s){return e.defaults(Ie(i,s)).Minimatch}},AST:class extends e.AST{constructor(s,r,o={}){super(s,r,Ie(i,o))}static fromGlob(s,r={}){return e.AST.fromGlob(s,Ie(i,r))}},unescape:(n,s={})=>e.unescape(n,Ie(i,s)),escape:(n,s={})=>e.escape(n,Ie(i,s)),filter:(n,s={})=>e.filter(n,Ie(i,s)),defaults:n=>e.defaults(Ie(i,n)),makeRe:(n,s={})=>e.makeRe(n,Ie(i,s)),braceExpand:(n,s={})=>e.braceExpand(n,Ie(i,s)),match:(n,s,r={})=>e.match(n,s,Ie(i,r)),sep:e.sep,GLOBSTAR:de})};_e.defaults=Bd;var Ba=(i,e={})=>(Bn(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:Pa(i));_e.braceExpand=Ba;var Ud=(i,e={})=>new Ae(i,e).makeRe();_e.makeRe=Ud;var Vd=(i,e,t={})=>{let n=new Ae(e,t);return i=i.filter(s=>n.match(s)),n.options.nonull&&!i.length&&i.push(e),i};_e.match=Vd;var Fa=/[?*]|[+@!]\(.*?\)|\[|\]/,Zd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ae=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Bn(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||qa,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=r[0]===""&&r[1]===""&&(r[2]==="?"||!Fa.test(r[2]))&&!Fa.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(c)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(l)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let s=0;s<e[n].length;s++)e[n][s]==="**"&&(e[n][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let s=n;for(;t[s+1]==="**";)s++;s!==n&&t.splice(n,s-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,s)=>{let r=n[n.length-1];return s==="**"&&r==="**"?n:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(s),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let r=e[s];s===1&&r===""&&e[0]===""||(r==="."||r==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let o=s;for(;n[o+1]==="**";)o++;o>s&&n.splice(s+1,o-s);let a=n[s+1],c=n[s+2],l=n[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(s,1);let u=n.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){let o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...c),n.length===0&&n.push(""),r-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let s=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(s){e[t]=[],e[n]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let s=0,r=0,o=[],a="";for(;s<e.length&&r<t.length;)if(e[s]===t[r])o.push(a==="b"?t[r]:e[s]),s++,r++;else if(n&&e[s]==="**"&&t[r]===e[s+1])o.push(e[s]),s++;else if(n&&t[r]==="**"&&e[s]===t[r+1])o.push(t[r]),r++;else if(e[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,r++}else if(t[r]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[r]),s++,r++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),k=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=k?3:g?0:void 0,S=x?3:E?0:void 0;if(typeof b=="number"&&typeof S=="number"){let[O,B]=[e[b],t[S]];O.toLowerCase()===B.toLowerCase()&&(t[S]=O,S>b?t=t.slice(S):b>S&&(e=e.slice(b)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===de){this.debug("GLOBSTAR",[t,u,d]);var p=o,f=a+1;if(f===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var w=e[p];if(this.debug(`
|
|
51
51
|
globstar while`,e,p,t,f,w),this.matchOne(e.slice(p),t.slice(f),n))return this.debug("globstar found match!",p,c,w),!0;if(w==="."||w===".."||!s.dot&&w.charAt(0)==="."){this.debug("dot detected!",e,p,t,f);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(n&&(this.debug(`
|
|
52
|
-
>>> no match, partial?`,e,p,t,f),p===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ua(this.pattern,this.options)}parse(e){Bn(e);let t=this.options;if(e==="**")return de;if(e==="")return"";let n,s=null;(n=e.match(Ad))?s=t.dot?Pd:Nd:(n=e.match(bd))?s=(t.nocase?t.dot?kd:Sd:t.dot?xd:_d)(n[1]):(n=e.match(jd))?s=(t.nocase?t.dot?Ld:Md:t.dot?Id:Dd)(n):(n=e.match(Ed))?s=t.dot?Td:Cd:(n=e.match(Rd))&&(s=Od);let r=mn.fromGlob(e,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Wd:t.dot?zd:qd,s=new Set(t.nocase?["i"]:[]),r=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))s.add(p);return typeof d=="string"?Gd(d):d===de?de:d._src});l.forEach((d,p)=>{let f=l[p+1],w=l[p-1];d!==de||w===de||(w===void 0?f!==void 0&&f!==de?l[p+1]="(?:\\/|"+n+"\\/)?"+f:l[p]=n:f===void 0?l[p-1]=w+"(?:\\/|\\/"+n+")?":f!==de&&(l[p-1]=w+"(?:\\/|\\/"+n+"\\/)"+f,l[p+1]=de))});let u=l.filter(d=>d!==de);if(this.partial&&u.length>=1){let d=[];for(let p=1;p<=u.length;p++)d.push(u.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<r.length;a++){let c=r[a],l=s;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return _e.defaults(e).Minimatch}};_e.AST=mn;_e.Minimatch=Ae;_e.escape=gn;_e.unescape=ze;var pc=require("node:url");var yn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Za=new Set,Lr=typeof process=="object"&&process?process:{},Ga=(i,e,t,n)=>{typeof Lr.emitWarning=="function"?Lr.emitWarning(i,e,t,n):console.error(`[${t}] ${e}: ${i}`)},Ii=globalThis.AbortController,Va=globalThis.AbortSignal;if(typeof Ii>"u"){Va=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Ii=class{constructor(){e()}signal=new Va;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let i=Lr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{i&&(i=!1,Ga("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Hd=i=>!Za.has(i),km=Symbol("type"),vt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ha=i=>vt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?wn:null:null,wn=class extends Array{constructor(e){super(e),this.fill(0)}},Ir=class i{heap;length;static#e=!1;static create(e){let t=Ha(e);if(!t)return[];i.#e=!0;let n=new i(e,t);return i.#e=!1,n}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Vn=class i{#e;#t;#r;#i;#o;#b;#y;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#h;#c;#l;#n;#d;#w;#p;#m;#T;#g;#R;#x;#_;#v;#E;#f;#A;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#_,sizes:e.#R,keyMap:e.#c,keyList:e.#l,valList:e.#n,next:e.#d,prev:e.#w,get head(){return e.#p},get tail(){return e.#m},free:e.#T,isBackgroundFetch:t=>e.#u(t),backgroundFetch:(t,n,s,r)=>e.#L(t,n,s,r),moveToTail:t=>e.#$(t),indexes:t=>e.#C(t),rindexes:t=>e.#O(t),isStale:t=>e.#k(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#h}get size(){return this.#a}get fetchMethod(){return this.#b}get memoMethod(){return this.#y}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:w=0,maxEntrySize:g=0,sizeCalculation:k,fetchMethod:E,memoMethod:x,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:B,ignoreFetchAbort:K}=e;if(t!==0&&!vt(t))throw new TypeError("max option must be a nonnegative integer");let pe=t?Ha(t):Array;if(!pe)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=w,this.maxEntrySize=g||this.#t,this.sizeCalculation=k,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=x,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=E,this.#E=!!E,this.#c=new Map,this.#l=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#d=new pe(t),this.#w=new pe(t),this.#p=0,this.#m=0,this.#T=Ir.create(t),this.#a=0,this.#h=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#i=u),typeof d=="function"?(this.#o=d,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#v=!!this.#r,this.#A=!!this.#i,this.#f=!!this.#o,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(this.#t!==0&&!vt(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=vt(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#s()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let Te="LRU_CACHE_UNBOUNDED";Hd(Te)&&(Za.add(Te),Ga("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Te,i))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#s(){let e=new wn(this.#e),t=new wn(this.#e);this.#_=e,this.#x=t,this.#N=(r,o,a=yn.now())=>{if(t[r]=o!==0?a:0,e[r]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#k(r)&&this.#P(this.#l[r],"expire")},o+1);c.unref&&c.unref()}},this.#j=r=>{t[r]=e[r]!==0?yn.now():0},this.#S=(r,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;r.ttl=a,r.start=c,r.now=n||s();let l=r.now-c;r.remainingTTL=a-l}};let n=0,s=()=>{let r=yn.now();if(this.ttlResolution>0){n=r;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{let o=this.#c.get(r);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(n||s())-c;return a-l},this.#k=r=>{let o=t[r],a=e[r];return!!a&&!!o&&(n||s())-o>a}}#j=()=>{};#S=()=>{};#N=()=>{};#k=()=>!1;#W(){let e=new wn(this.#e);this.#h=0,this.#R=e,this.#M=t=>{this.#h-=e[t],e[t]=0},this.#z=(t,n,s,r)=>{if(this.#u(n))return 0;if(!vt(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!vt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#I=(t,n,s)=>{if(e[t]=n,this.#t){let r=this.#t-e[t];for(;this.#h>r;)this.#D(!0)}this.#h+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#h)}}#M=e=>{};#I=(e,t,n)=>{};#z=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#C({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;!(!this.#q(t)||((e||!this.#k(t))&&(yield t),t===this.#p));)t=this.#w[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;!(!this.#q(t)||((e||!this.#k(t))&&(yield t),t===this.#m));)t=this.#d[t]}#q(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#C())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#l[e]!==void 0&&!this.#u(this.#n[e])&&(yield[this.#l[e],this.#n[e]])}*keys(){for(let e of this.#C()){let t=this.#l[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#l[e];t!==void 0&&!this.#u(this.#n[e])&&(yield t)}}*values(){for(let e of this.#C())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#u(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#C()){let s=this.#n[n],r=this.#u(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#C()){let s=this.#n[n],r=this.#u(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#O()){let s=this.#n[n],r=this.#u(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#k(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(t===void 0)return;let n=this.#n[t],s=this.#u(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#_&&this.#x){let o=this.#_[t],a=this.#x[t];if(o&&a){let c=o-(yn.now()-a);r.ttl=c,r.start=Date.now()}}return this.#R&&(r.size=this.#R[t]),r}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let n=this.#l[t],s=this.#n[t],r=this.#u(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#_&&this.#x){o.ttl=this.#_[t];let a=yn.now()-this.#x[t];o.start=Math.floor(Date.now()-a)}this.#R&&(o.size=this.#R[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=yn.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#z(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let d=this.#a===0?void 0:this.#c.get(e);if(d===void 0)d=this.#a===0?this.#m:this.#T.length!==0?this.#T.pop():this.#a===this.#e?this.#D(!1):this.#a,this.#l[d]=e,this.#n[d]=t,this.#c.set(e,d),this.#d[this.#m]=d,this.#w[d]=this.#m,this.#m=d,this.#a++,this.#I(d,u,c),c&&(c.set="add"),l=!1,this.#A&&this.#i?.(t,e,"add");else{this.#$(d);let p=this.#n[d];if(t!==p){if(this.#E&&this.#u(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&!o&&(this.#v&&this.#r?.(f,e,"set"),this.#f&&this.#g?.push([f,e,"set"]))}else o||(this.#v&&this.#r?.(p,e,"set"),this.#f&&this.#g?.push([p,e,"set"]));if(this.#M(d),this.#I(d,u,c),this.#n[d]=t,c){c.set="replace";let f=p&&this.#u(p)?p.__staleWhileFetching:p;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#A&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#_&&this.#s(),this.#_&&(l||this.#N(d,s,r),c&&this.#S(c,d)),!o&&this.#f&&this.#g){let p=this.#g,f;for(;f=p?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#p];if(this.#D(!0),this.#u(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#o?.(...t)}}}#D(e){let t=this.#p,n=this.#l[t],s=this.#n[t];return this.#E&&this.#u(s)?s.__abortController.abort(new Error("evicted")):(this.#v||this.#f)&&(this.#v&&this.#r?.(s,n,"evict"),this.#f&&this.#g?.push([s,n,"evict"])),this.#M(t),e&&(this.#l[t]=void 0,this.#n[t]=void 0,this.#T.push(t)),this.#a===1?(this.#p=this.#m=0,this.#T.length=0):this.#p=this.#d[t],this.#c.delete(n),this.#a--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#c.get(e);if(r!==void 0){let o=this.#n[r];if(this.#u(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#k(r))s&&(s.has="stale",this.#S(s,r));else return n&&this.#j(r),s&&(s.has="hit",this.#S(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#c.get(e);if(s===void 0||!n&&this.#k(s))return;let r=this.#n[s];return this.#u(r)?r.__staleWhileFetching:r}#L(e,t,n,s){let r=t===void 0?void 0:this.#n[t];if(this.#u(r))return r;let o=new Ii,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,k=!1)=>{let{aborted:E}=o.signal,x=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(E&&!k?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!x&&!k)return d(o.signal.reason);let b=f;return this.#n[t]===f&&(g===void 0?b.__staleWhileFetching?this.#n[t]=b.__staleWhileFetching:this.#P(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:k}=o.signal,E=k&&n.allowStaleOnFetchAbort,x=E||n.allowStaleOnFetchRejection,b=x||n.noDeleteOnFetchRejection,S=f;if(this.#n[t]===f&&(!b||S.__staleWhileFetching===void 0?this.#P(e,"fetch"):E||(this.#n[t]=S.__staleWhileFetching)),x)return n.status&&S.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw g},p=(g,k)=>{let E=this.#b?.(e,r,c);E&&E instanceof Promise&&E.then(x=>g(x===void 0?void 0:x),k),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=x=>l(x,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(p).then(l,u),w=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,w,{...c.options,status:void 0}),t=this.#c.get(e)):this.#n[t]=w,w}#u(e){if(!this.#E)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ii}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:g,forceRefresh:k=!1,status:E,signal:x}=t;if(!this.#E)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:E});let b={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:w,ignoreFetchAbort:f,status:E,signal:x},S=this.#c.get(e);if(S===void 0){E&&(E.fetch="miss");let O=this.#L(e,S,b,g);return O.__returned=O}else{let O=this.#n[S];if(this.#u(O)){let Ht=n&&O.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",Ht&&(E.returnedStale=!0)),Ht?O.__staleWhileFetching:O.__returned=O}let B=this.#k(S);if(!k&&!B)return E&&(E.fetch="hit"),this.#$(S),s&&this.#j(S),E&&this.#S(E,S),O;let K=this.#L(e,S,b,g),Te=K.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=B?"stale":"refresh",Te&&B&&(E.returnedStale=!0)),Te?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#y;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...o}=t,a=this.get(e,o);if(!r&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#c.get(e);if(a!==void 0){let c=this.#n[a],l=this.#u(c);return o&&this.#S(o,a),this.#k(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(r||this.#P(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#$(a),s&&this.#j(a),c))}else o&&(o.get="miss")}#B(e,t){this.#w[t]=e,this.#d[e]=t}#$(e){e!==this.#m&&(e===this.#p?this.#p=this.#d[e]:this.#B(this.#w[e],this.#d[e]),this.#B(this.#m,e),this.#m=e)}delete(e){return this.#P(e,"delete")}#P(e,t){let n=!1;if(this.#a!==0){let s=this.#c.get(e);if(s!==void 0)if(n=!0,this.#a===1)this.#F(t);else{this.#M(s);let r=this.#n[s];if(this.#u(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#f)&&(this.#v&&this.#r?.(r,e,t),this.#f&&this.#g?.push([r,e,t])),this.#c.delete(e),this.#l[s]=void 0,this.#n[s]=void 0,s===this.#m)this.#m=this.#w[s];else if(s===this.#p)this.#p=this.#d[s];else{let o=this.#w[s];this.#d[o]=this.#d[s];let a=this.#d[s];this.#w[a]=this.#w[s]}this.#a--,this.#T.push(s)}}if(this.#f&&this.#g?.length){let s=this.#g,r;for(;r=s?.shift();)this.#o?.(...r)}return n}clear(){return this.#F("delete")}#F(e){for(let t of this.#O({allowStale:!0})){let n=this.#n[t];if(this.#u(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#l[t];this.#v&&this.#r?.(n,s,e),this.#f&&this.#g?.push([n,s,e])}}if(this.#c.clear(),this.#n.fill(void 0),this.#l.fill(void 0),this.#_&&this.#x&&(this.#_.fill(0),this.#x.fill(0)),this.#R&&this.#R.fill(0),this.#p=0,this.#m=0,this.#T.length=0,this.#h=0,this.#a=0,this.#f&&this.#g){let t=this.#g,n;for(;n=t?.shift();)this.#o?.(...n)}}};var _n=require("node:path"),sc=require("node:url"),Ke=require("fs"),rf=ut(require("node:fs"),1),xt=require("node:fs/promises");var Bi=require("node:events"),Br=ut(require("node:stream"),1),Ka=require("node:string_decoder"),Ja=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jd=i=>!!i&&typeof i=="object"&&(i instanceof _t||i instanceof Br.default||Xd(i)||Yd(i)),Xd=i=>!!i&&typeof i=="object"&&i instanceof Bi.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==Br.default.Writable.prototype.pipe,Yd=i=>!!i&&typeof i=="object"&&i instanceof Bi.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function",ot=Symbol("EOF"),at=Symbol("maybeEmitEnd"),bt=Symbol("emittedEnd"),Di=Symbol("emittingEnd"),Zn=Symbol("emittedError"),$i=Symbol("closed"),Xa=Symbol("read"),Fi=Symbol("flush"),Ya=Symbol("flushChunk"),qe=Symbol("encoding"),vn=Symbol("decoder"),oe=Symbol("flowing"),Gn=Symbol("paused"),bn=Symbol("resume"),ae=Symbol("buffer"),xe=Symbol("pipes"),ce=Symbol("bufferLength"),Dr=Symbol("bufferPush"),Wi=Symbol("bufferShift"),we=Symbol("objectMode"),te=Symbol("destroyed"),$r=Symbol("error"),Fr=Symbol("emitData"),Qa=Symbol("emitEnd"),Wr=Symbol("emitEnd2"),Ye=Symbol("async"),zr=Symbol("abort"),zi=Symbol("aborted"),Hn=Symbol("signal"),Vt=Symbol("dataListeners"),Ne=Symbol("discarded"),Jn=i=>Promise.resolve().then(i),Qd=i=>i(),Kd=i=>i==="end"||i==="finish"||i==="prefinish",ef=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,tf=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),qi=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[bn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},qr=class extends qi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},nf=i=>!!i.objectMode,sf=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",_t=class extends Bi.EventEmitter{[oe]=!1;[Gn]=!1;[xe]=[];[ae]=[];[we];[qe];[Ye];[vn];[ot]=!1;[bt]=!1;[Di]=!1;[$i]=!1;[Zn]=null;[ce]=0;[te]=!1;[Hn];[zi]=!1;[Vt]=0;[Ne]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");nf(t)?(this[we]=!0,this[qe]=null):sf(t)?(this[qe]=t.encoding,this[we]=!1):(this[we]=!1,this[qe]=null),this[Ye]=!!t.async,this[vn]=this[qe]?new Ka.StringDecoder(this[qe]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ae]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[xe]});let{signal:n}=t;n&&(this[Hn]=n,n.aborted?this[zr]():n.addEventListener("abort",()=>this[zr]()))}get bufferLength(){return this[ce]}get encoding(){return this[qe]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[we]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ye]}set async(e){this[Ye]=this[Ye]||!!e}[zr](){this[zi]=!0,this.emit("abort",this[Hn]?.reason),this.destroy(this[Hn]?.reason)}get aborted(){return this[zi]}set aborted(e){}write(e,t,n){if(this[zi])return!1;if(this[ot])throw new Error("write after end");if(this[te])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let s=this[Ye]?Jn:Qd;if(!this[we]&&!Buffer.isBuffer(e)){if(tf(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ef(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[oe]&&this[ce]!==0&&this[Fi](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):e.length?(typeof e=="string"&&!(t===this[qe]&&!this[vn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[qe]&&(e=this[vn].write(e)),this[oe]&&this[ce]!==0&&this[Fi](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):(this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe])}read(e){if(this[te])return null;if(this[Ne]=!1,this[ce]===0||e===0||e&&e>this[ce])return this[at](),null;this[we]&&(e=null),this[ae].length>1&&!this[we]&&(this[ae]=[this[qe]?this[ae].join(""):Buffer.concat(this[ae],this[ce])]);let t=this[Xa](e||null,this[ae][0]);return this[at](),t}[Xa](e,t){if(this[we])this[Wi]();else{let n=t;e===n.length||e===null?this[Wi]():typeof n=="string"?(this[ae][0]=n.slice(e),t=n.slice(0,e),this[ce]-=e):(this[ae][0]=n.subarray(e),t=n.subarray(0,e),this[ce]-=e)}return this.emit("data",t),!this[ae].length&&!this[ot]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[ot]=!0,this.writable=!1,(this[oe]||!this[Gn])&&this[at](),this}[bn](){this[te]||(!this[Vt]&&!this[xe].length&&(this[Ne]=!0),this[Gn]=!1,this[oe]=!0,this.emit("resume"),this[ae].length?this[Fi]():this[ot]?this[at]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[oe]=!1,this[Gn]=!0,this[Ne]=!1}get destroyed(){return this[te]}get flowing(){return this[oe]}get paused(){return this[Gn]}[Dr](e){this[we]?this[ce]+=1:this[ce]+=e.length,this[ae].push(e)}[Wi](){return this[we]?this[ce]-=1:this[ce]-=this[ae][0].length,this[ae].shift()}[Fi](e=!1){do;while(this[Ya](this[Wi]())&&this[ae].length);!e&&!this[ae].length&&!this[ot]&&this.emit("drain")}[Ya](e){return this.emit("data",e),this[oe]}pipe(e,t){if(this[te])return e;this[Ne]=!1;let n=this[bt];return t=t||{},e===Ja.stdout||e===Ja.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[xe].push(t.proxyErrors?new qr(this,e,t):new qi(this,e,t)),this[Ye]?Jn(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this[xe].find(n=>n.dest===e);t&&(this[xe].length===1?(this[oe]&&this[Vt]===0&&(this[oe]=!1),this[xe]=[]):this[xe].splice(this[xe].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Ne]=!1,this[Vt]++,!this[xe].length&&!this[oe]&&this[bn]();else if(e==="readable"&&this[ce]!==0)super.emit("readable");else if(Kd(e)&&this[bt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Zn]){let s=t;this[Ye]?Jn(()=>s.call(this,this[Zn])):s.call(this,this[Zn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Vt]=this.listeners("data").length,this[Vt]===0&&!this[Ne]&&!this[xe].length&&(this[oe]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Vt]=0,!this[Ne]&&!this[xe].length&&(this[oe]=!1)),t}get emittedEnd(){return this[bt]}[at](){!this[Di]&&!this[bt]&&!this[te]&&this[ae].length===0&&this[ot]&&(this[Di]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$i]&&this.emit("close"),this[Di]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==te&&this[te])return!1;if(e==="data")return!this[we]&&!n?!1:this[Ye]?(Jn(()=>this[Fr](n)),!0):this[Fr](n);if(e==="end")return this[Qa]();if(e==="close"){if(this[$i]=!0,!this[bt]&&!this[te])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Zn]=n,super.emit($r,n);let r=!this[Hn]||this.listeners("error").length?super.emit("error",n):!1;return this[at](),r}else if(e==="resume"){let r=super.emit("resume");return this[at](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[at](),s}[Fr](e){for(let n of this[xe])n.dest.write(e)===!1&&this.pause();let t=this[Ne]?!1:super.emit("data",e);return this[at](),t}[Qa](){return this[bt]?!1:(this[bt]=!0,this.readable=!1,this[Ye]?(Jn(()=>this[Wr]()),!0):this[Wr]())}[Wr](){if(this[vn]){let t=this[vn].end();if(t){for(let n of this[xe])n.dest.write(t);this[Ne]||super.emit("data",t)}}for(let t of this[xe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[we]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[we]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[qe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(te,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ne]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ot])return t();let r,o,a=d=>{this.off("data",c),this.off("end",l),this.off(te,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(te,u),this.pause(),r({value:d,done:!!this[ot]})},l=()=>{this.off("error",a),this.off("data",c),this.off(te,u),t(),r({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,r=d,this.once(te,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ne]=!1;let e=!1,t=()=>(this.pause(),this.off($r,t),this.off(te,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once($r,t),this.once(te,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[te])return e?this.emit("error",e):this.emit(te),this;this[te]=!0,this[Ne]=!0,this[ae].length=0,this[ce]=0;let t=this;return typeof t.close=="function"&&!this[$i]&&t.close(),e?this.emit("error",e):this.emit(te),this}static get isStream(){return Jd}};var of=Ke.realpathSync.native,Yn={lstatSync:Ke.lstatSync,readdir:Ke.readdir,readdirSync:Ke.readdirSync,readlinkSync:Ke.readlinkSync,realpathSync:of,promises:{lstat:xt.lstat,readdir:xt.readdir,readlink:xt.readlink,realpath:xt.realpath}},rc=i=>!i||i===Yn||i===rf?Yn:{...Yn,...i,promises:{...Yn.promises,...i.promises||{}}},oc=/^\\\\\?\\([a-z]:)\\?$/i,af=i=>i.replace(/\//g,"\\").replace(oc,"$1\\"),cf=/[\\\/]/,$e=0,ac=1,cc=2,Qe=4,lc=6,uc=8,Zt=10,hc=12,De=15,Xn=~De,Ur=16,ec=32,Qn=64,Be=128,Ui=256,Zi=512,tc=Qn|Be|Zi,lf=1023,Vr=i=>i.isFile()?uc:i.isDirectory()?Qe:i.isSymbolicLink()?Zt:i.isCharacterDevice()?cc:i.isBlockDevice()?lc:i.isSocket()?hc:i.isFIFO()?ac:$e,nc=new Map,Kn=i=>{let e=nc.get(i);if(e)return e;let t=i.normalize("NFKD");return nc.set(i,t),t},ic=new Map,Vi=i=>{let e=ic.get(i);if(e)return e;let t=Kn(i.toLowerCase());return ic.set(i,t),t},Gi=class extends Vn{constructor(){super({max:256})}},Zr=class extends Vn{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},dc=Symbol("PathScurry setAsCwd"),ve=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#y;get rdev(){return this.#y}#a;get blksize(){return this.#a}#h;get ino(){return this.#h}#c;get size(){return this.#c}#l;get blocks(){return this.#l}#n;get atimeMs(){return this.#n}#d;get mtimeMs(){return this.#d}#w;get ctimeMs(){return this.#w}#p;get birthtimeMs(){return this.#p}#m;get atime(){return this.#m}#T;get mtime(){return this.#T}#g;get ctime(){return this.#g}#R;get birthtime(){return this.#R}#x;#_;#v;#E;#f;#A;#s;#j;#S;#N;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=$e,n,s,r,o,a){this.name=e,this.#x=r?Vi(e):Kn(e),this.#s=t&lf,this.nocase=r,this.roots=s,this.root=n||this,this.#j=o,this.#v=a.fullpath,this.#f=a.relative,this.#A=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=rc(a.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#j}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#k(s):this.#k(s)}#k(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#j.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#j.set(this,t),this.#s&=~Ur,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?Vi(e):Kn(e);for(let c of n)if(c.#x===s)return c;let r=this.parent?this.sep:"",o=this.#v?this.#v+r+e:void 0,a=this.newChild(e,$e,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=Be),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#f!==void 0)return this.#f;let e=this.name,t=this.parent;if(!t)return this.#f=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,t=this.parent;if(!t)return this.#A=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#v=s}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#E=`//?/${s}`:this.#E=s}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#E=n}isUnknown(){return(this.#s&De)===$e}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&De)===uc}isDirectory(){return(this.#s&De)===Qe}isCharacterDevice(){return(this.#s&De)===cc}isBlockDevice(){return(this.#s&De)===lc}isFIFO(){return(this.#s&De)===ac}isSocket(){return(this.#s&De)===hc}isSymbolicLink(){return(this.#s&Zt)===Zt}lstatCached(){return this.#s&ec?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#N}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let e=this.#s&De;return!(e!==$e&&e!==Zt||this.#s&Ui||this.#s&Be)}calledReaddir(){return!!(this.#s&Ur)}isENOENT(){return!!(this.#s&Be)}isNamed(e){return this.nocase?this.#x===Vi(e):this.#x===Kn(e)}async readlink(){let e=this.#S;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#S=n}catch(t){this.#D(t.code);return}}readlinkSync(){let e=this.#S;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#S=n}catch(t){this.#D(t.code);return}}#W(e){this.#s|=Ur;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#M()}}#M(){this.#s&Be||(this.#s=(this.#s|Be)&Xn,this.#I())}#I(){let e=this.children();e.provisional=0;for(let t of e)t.#M()}#z(){this.#s|=Zi,this.#C()}#C(){if(this.#s&Qn)return;let e=this.#s;(e&De)===Qe&&(e&=Xn),this.#s=e|Qn,this.#I()}#O(e=""){e==="ENOTDIR"||e==="EPERM"?this.#C():e==="ENOENT"?this.#M():this.children().provisional=0}#q(e=""){e==="ENOTDIR"?this.parent.#C():e==="ENOENT"&&this.#M()}#D(e=""){let t=this.#s;t|=Ui,e==="ENOENT"&&(t|=Be),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Xn),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#C()}#L(e,t){return this.#B(e,t)||this.#u(e,t)}#u(e,t){let n=Vr(e),s=this.newChild(e.name,n,{parent:this}),r=s.#s&De;return r!==Qe&&r!==Zt&&r!==$e&&(s.#s|=Qn),t.unshift(s),t.provisional++,s}#B(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?Vi(e.name):Kn(e.name))===s.#x)return this.#$(e,s,n,t)}}#$(e,t,n,s){let r=t.name;return t.#s=t.#s&Xn|Vr(e),r!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#s&Be)===0)try{return this.#P(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#q(e.code)}}lstatSync(){if((this.#s&Be)===0)try{return this.#P(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#q(e.code)}}#P(e){let{atime:t,atimeMs:n,birthtime:s,birthtimeMs:r,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:f,mtime:w,mtimeMs:g,nlink:k,rdev:E,size:x,uid:b}=e;this.#m=t,this.#n=n,this.#R=s,this.#p=r,this.#a=o,this.#l=a,this.#g=c,this.#w=l,this.#t=u,this.#b=d,this.#h=p,this.#r=f,this.#T=w,this.#d=g,this.#i=k,this.#y=E,this.#c=x,this.#o=b;let S=Vr(e);this.#s=this.#s&Xn|S|ec,S!==$e&&S!==Qe&&S!==Zt&&(this.#s|=Qn)}#F=[];#V=!1;#Z(e){this.#V=!1;let t=this.#F.slice();this.#F.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#F.push(e),this.#V)return;this.#V=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(r,o)=>{if(r)this.#O(r.code),n.provisional=0;else{for(let a of o)this.#L(a,n);this.#W(n)}this.#Z(n.slice(0,n.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#U)await this.#U;else{let n=()=>{};this.#U=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#L(s,e);this.#W(e)}catch(s){this.#O(s.code),e.provisional=0}this.#U=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#L(n,e);this.#W(e)}catch(n){this.#O(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&tc)return!1;let e=De&this.#s;return e===$e||e===Qe||e===Zt}shouldWalk(e,t){return(this.#s&Qe)===Qe&&!(this.#s&tc)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#N)return this.#N;if(!((Zi|Ui|Be)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#N=this.resolve(e)}catch{this.#z()}}realpathSync(){if(this.#N)return this.#N;if(!((Zi|Ui|Be)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#N=this.resolve(e)}catch{this.#z()}}[dc](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#f=n.join(this.sep),s.#A=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#f=void 0,s.#A=void 0,s=s.parent}},Hi=class i extends ve{sep="\\";splitSep=cf;constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return _n.win32.parse(e).root}getRoot(e){if(e=af(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new xn(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(oc,"$1\\"),e===t}},Ji=class i extends ve{splitSep="/";sep="/";constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Xi=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#i;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:r=16*1024,fs:o=Yn}={}){this.#i=rc(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,sc.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Gi,this.#t=new Gi,this.#r=new Zr(r);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,f=!1;for(let w of c){let g=u--;l=l.child(w,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(f?"":d)+w}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?s:s.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((f,w)=>{if(f)return p(f);let g=w.length;if(!g)return p();let k=()=>{--g===0&&p()};for(let E of w)(!r||r(E))&&a.push(n?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(x=>x?.isUnknown()?x.lstat():x).then(x=>x?.shouldWalk(c,o)?l(x,k):k()):E.shouldWalk(c,o)?l(E,k):k()},!0)},u=e;return new Promise((d,p)=>{l(u,f=>{if(f)return p(f);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!r||r(d))&&a.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(s&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!r||r(u))&&(yield n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new _t({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=(k,E,x=!1)=>{if(k)return a.emit("error",k);if(s&&!x){let b=[];for(let S of E)S.isSymbolicLink()&&b.push(S.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>w(null,E,!0));return}}for(let b of E)b&&(!r||r(b))&&(a.write(n?b:b.fullpath())||(p=!0));u--;for(let b of E){let S=b.realpathCached()||b;S.shouldWalk(c,o)&&l.push(S)}p&&!a.flowing?a.once("drain",d):g||d()},g=!0;f.readdirCB(w,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new _t({objectMode:!0}),c=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=f.readdirSync();for(let g of w)(!r||r(g))&&(a.write(n?g:g.fullpath())||(p=!0));u--;for(let g of w){let k=g;if(g.isSymbolicLink()){if(!(s&&(k=g.realpathSync())))continue;k.isUnknown()&&k.lstatSync()}k.shouldWalk(c,o)&&l.push(k)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[dc](t)}},xn=class extends Xi{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,_n.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return _n.win32.parse(e).root.toUpperCase()}newRoot(e){return new Hi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sn=class extends Xi{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,_n.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Ji(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ei=class extends Sn{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},Om=process.platform==="win32"?Hi:Ji,fc=process.platform==="win32"?xn:process.platform==="darwin"?ei:Sn;var uf=i=>i.length>=1,hf=i=>i.length>=1,kn=class i{#e;#t;#r;length;#i;#o;#b;#y;#a;#h;#c=!0;constructor(e,t,n,s){if(!uf(e))throw new TypeError("empty pattern list");if(!hf(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#r=n,this.#i=s,this.#r===0){if(this.isUNC()){let[r,o,a,c,...l]=this.#e,[u,d,p,f,...w]=this.#t;l[0]===""&&(l.shift(),w.shift());let g=[r,o,a,c,""].join("/"),k=[u,d,p,f,""].join("/");this.#e=[g,...l],this.#t=[k,...w],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=r+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===de}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#e,this.#t,this.#r+1,this.#i),this.#o.#h=this.#h,this.#o.#a=this.#a,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var df=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",En=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:r,platform:o=df}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:s,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ae(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],r=t.globParts[n];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let o=new kn(s,r,0,this.platform),a=new Ae(o.globString(),this.mmopts),c=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,s=e.relative()||".",r=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(r))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Gr=class i{store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Hr=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?s:s&r)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Jr=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ti=class i{hasWalkedCache;matches=new Hr;subwalks=new Jr;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Gr}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,r]of n){this.hasWalkedCache.storeWalked(s,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=r.pattern())=="string"&&(l=r.rest());)s=s.resolve(c),r=l,u=!0;if(c=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(s,r))continue;this.hasWalkedCache.storeWalked(s,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===de){(!s.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(s,r);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(s,a,d===""||d===".");else if(d===".."){let f=s.parent||s;p?this.hasWalkedCache.hasWalked(f,p)||this.subwalks.add(f,p):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let r of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===de?s.testGlobstar(r,o,l,a):c instanceof RegExp?s.testRegExp(r,c,l,a):s.testString(r,c,l,a)}return s}testGlobstar(e,t,n,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),s);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var ff=(i,e)=>typeof i=="string"?new En([i],e):Array.isArray(i)?new En(i,e):i,Yi=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=ff(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let r=`${e.relativePosix()}/**`;this.#t.add(r)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+s)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+s:"."+s)}}async match(e,t,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ti(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#i(a)||(r++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ti(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ni=class extends Yi{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ii=class extends Yi{results;constructor(e,t,n){super(e,t,n),this.results=new _t({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ue=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,pc.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||pf,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?xn:t.platform==="darwin"?ei:t.platform?Sn:fc;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(c=>new Ae(c,s)),[o,a]=r.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new kn(c,u,0,this.platform)})}async walk(){return[...await new ni(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ni(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ii(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ii(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Xr=(i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Ae(t,e).hasMagic())return!0;return!1};function Qi(i,e={}){return new Ue(i,e).streamSync()}function yc(i,e={}){return new Ue(i,e).stream()}function Ki(i,e={}){return new Ue(i,e).walkSync()}async function mc(i,e={}){return new Ue(i,e).walk()}function es(i,e={}){return new Ue(i,e).iterateSync()}function wc(i,e={}){return new Ue(i,e).iterate()}var mf=Qi,gf=Object.assign(yc,{sync:Qi}),yf=es,wf=Object.assign(wc,{sync:es}),vf=Object.assign(Ki,{stream:Qi,iterate:es}),gc=Object.assign(mc,{glob:mc,globSync:Ki,sync:vf,globStream:yc,stream:gf,globStreamSync:Qi,streamSync:mf,globIterate:wc,iterate:wf,globIterateSync:es,iterateSync:yf,Glob:Ue,hasMagic:Xr,escape:gn,unescape:ze});gc.glob=gc;var Yr={name:"dts-linter",version:"0.3.10-beta1",main:"index.js",repository:{type:"git",url:"https://github.com/kylebonnici/dts-linter"},scripts:{compile:"node ./esbuild.js","compile:prod":"node ./esbuild.js --production"},bin:"./dist/dts-linter.js",files:["dist/dts-linter.js","THIRD_PARTY_LICENSES.txt"],keywords:["dts","linter","devicetree","formatting"],author:"Kyle Micallef Bonnici",license:"Apache-2.0",description:"",dependencies:{"devicetree-language-server":"^0.8.0-beta1"},devDependencies:{"@types/node":"^24.0.3","devicetree-language-server-types":"^0.0.2-alpha.8",diff:"^8.0.2",esbuild:"^0.25.5",glob:"^11.1.0","license-checker":"^25.0.1","ts-node":"^10.9.2",typescript:"^5.8.3","vscode-jsonrpc":"^8.2.1","vscode-languageserver-types":"^3.17.5",zod:"^3.25.67"}};var vc;(function(i){function e(t){return typeof t=="string"}i.is=e})(vc||(vc={}));var Qr;(function(i){function e(t){return typeof t=="string"}i.is=e})(Qr||(Qr={}));var bc;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(bc||(bc={}));var ts;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(ts||(ts={}));var Ve;(function(i){function e(n,s){return n===Number.MAX_VALUE&&(n=ts.MAX_VALUE),s===Number.MAX_VALUE&&(s=ts.MAX_VALUE),{line:n,character:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.line)&&m.uinteger(s.character)}i.is=t})(Ve||(Ve={}));var ne;(function(i){function e(n,s,r,o){if(m.uinteger(n)&&m.uinteger(s)&&m.uinteger(r)&&m.uinteger(o))return{start:Ve.create(n,s),end:Ve.create(r,o)};if(Ve.is(n)&&Ve.is(s))return{start:n,end:s};throw new Error(`Range#create called with invalid arguments[${n}, ${s}, ${r}, ${o}]`)}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.start)&&Ve.is(s.end)}i.is=t})(ne||(ne={}));var ns;(function(i){function e(n,s){return{uri:n,range:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(m.string(s.uri)||m.undefined(s.uri))}i.is=t})(ns||(ns={}));var _c;(function(i){function e(n,s,r,o){return{targetUri:n,targetRange:s,targetSelectionRange:r,originSelectionRange:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.targetRange)&&m.string(s.targetUri)&&ne.is(s.targetSelectionRange)&&(ne.is(s.originSelectionRange)||m.undefined(s.originSelectionRange))}i.is=t})(_c||(_c={}));var Kr;(function(i){function e(n,s,r,o){return{red:n,green:s,blue:r,alpha:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.numberRange(s.red,0,1)&&m.numberRange(s.green,0,1)&&m.numberRange(s.blue,0,1)&&m.numberRange(s.alpha,0,1)}i.is=t})(Kr||(Kr={}));var xc;(function(i){function e(n,s){return{range:n,color:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&Kr.is(s.color)}i.is=t})(xc||(xc={}));var Sc;(function(i){function e(n,s,r){return{label:n,textEdit:s,additionalTextEdits:r}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.undefined(s.textEdit)||Tn.is(s))&&(m.undefined(s.additionalTextEdits)||m.typedArray(s.additionalTextEdits,Tn.is))}i.is=t})(Sc||(Sc={}));var kc;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(kc||(kc={}));var Ec;(function(i){function e(n,s,r,o,a,c){let l={startLine:n,endLine:s};return m.defined(r)&&(l.startCharacter=r),m.defined(o)&&(l.endCharacter=o),m.defined(a)&&(l.kind=a),m.defined(c)&&(l.collapsedText=c),l}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.startLine)&&m.uinteger(s.startLine)&&(m.undefined(s.startCharacter)||m.uinteger(s.startCharacter))&&(m.undefined(s.endCharacter)||m.uinteger(s.endCharacter))&&(m.undefined(s.kind)||m.string(s.kind))}i.is=t})(Ec||(Ec={}));var eo;(function(i){function e(n,s){return{location:n,message:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ns.is(s.location)&&m.string(s.message)}i.is=t})(eo||(eo={}));var fe;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(fe||(fe={}));var Cc;(function(i){i.Unnecessary=1,i.Deprecated=2})(Cc||(Cc={}));var Tc;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&m.string(n.href)}i.is=e})(Tc||(Tc={}));var is;(function(i){function e(n,s,r,o,a,c){let l={range:n,message:s};return m.defined(r)&&(l.severity=r),m.defined(o)&&(l.code=o),m.defined(a)&&(l.source=a),m.defined(c)&&(l.relatedInformation=c),l}i.create=e;function t(n){var s;let r=n;return m.defined(r)&&ne.is(r.range)&&m.string(r.message)&&(m.number(r.severity)||m.undefined(r.severity))&&(m.integer(r.code)||m.string(r.code)||m.undefined(r.code))&&(m.undefined(r.codeDescription)||m.string((s=r.codeDescription)===null||s===void 0?void 0:s.href))&&(m.string(r.source)||m.undefined(r.source))&&(m.undefined(r.relatedInformation)||m.typedArray(r.relatedInformation,eo.is))}i.is=t})(is||(is={}));var Cn;(function(i){function e(n,s,...r){let o={title:n,command:s};return m.defined(r)&&r.length>0&&(o.arguments=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.title)&&m.string(s.command)}i.is=t})(Cn||(Cn={}));var Tn;(function(i){function e(r,o){return{range:r,newText:o}}i.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}i.insert=t;function n(r){return{range:r,newText:""}}i.del=n;function s(r){let o=r;return m.objectLiteral(o)&&m.string(o.newText)&&ne.is(o.range)}i.is=s})(Tn||(Tn={}));var to;(function(i){function e(n,s,r){let o={label:n};return s!==void 0&&(o.needsConfirmation=s),r!==void 0&&(o.description=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(m.string(s.description)||s.description===void 0)}i.is=t})(to||(to={}));var Rn;(function(i){function e(t){let n=t;return m.string(n)}i.is=e})(Rn||(Rn={}));var Rc;(function(i){function e(r,o,a){return{range:r,newText:o,annotationId:a}}i.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}i.insert=t;function n(r,o){return{range:r,newText:"",annotationId:o}}i.del=n;function s(r){let o=r;return Tn.is(o)&&(to.is(o.annotationId)||Rn.is(o.annotationId))}i.is=s})(Rc||(Rc={}));var no;(function(i){function e(n,s){return{textDocument:n,edits:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ao.is(s.textDocument)&&Array.isArray(s.edits)}i.is=t})(no||(no={}));var io;(function(i){function e(n,s,r){let o={kind:"create",uri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="create"&&m.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(io||(io={}));var so;(function(i){function e(n,s,r,o){let a={kind:"rename",oldUri:n,newUri:s};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}i.create=e;function t(n){let s=n;return s&&s.kind==="rename"&&m.string(s.oldUri)&&m.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(so||(so={}));var ro;(function(i){function e(n,s,r){let o={kind:"delete",uri:n};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="delete"&&m.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||m.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||m.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(ro||(ro={}));var oo;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(s=>m.string(s.kind)?io.is(s)||so.is(s)||ro.is(s):no.is(s)))}i.is=e})(oo||(oo={}));var Oc;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)}i.is=t})(Oc||(Oc={}));var Ac;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.integer(s.version)}i.is=t})(Ac||(Ac={}));var ao;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&(s.version===null||m.integer(s.version))}i.is=t})(ao||(ao={}));var Nc;(function(i){function e(n,s,r,o){return{uri:n,languageId:s,version:r,text:o}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.string(s.languageId)&&m.integer(s.version)&&m.string(s.text)}i.is=t})(Nc||(Nc={}));var co;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){let n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(co||(co={}));var si;(function(i){function e(t){let n=t;return m.objectLiteral(t)&&co.is(n.kind)&&m.string(n.value)}i.is=e})(si||(si={}));var Pc;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(Pc||(Pc={}));var jc;(function(i){i.PlainText=1,i.Snippet=2})(jc||(jc={}));var Mc;(function(i){i.Deprecated=1})(Mc||(Mc={}));var Lc;(function(i){function e(n,s,r){return{newText:n,insert:s,replace:r}}i.create=e;function t(n){let s=n;return s&&m.string(s.newText)&&ne.is(s.insert)&&ne.is(s.replace)}i.is=t})(Lc||(Lc={}));var Ic;(function(i){i.asIs=1,i.adjustIndentation=2})(Ic||(Ic={}));var Dc;(function(i){function e(t){let n=t;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}i.is=e})(Dc||(Dc={}));var $c;(function(i){function e(t){return{label:t}}i.create=e})($c||($c={}));var Fc;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})(Fc||(Fc={}));var ss;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){let s=n;return m.string(s)||m.objectLiteral(s)&&m.string(s.language)&&m.string(s.value)}i.is=t})(ss||(ss={}));var Wc;(function(i){function e(t){let n=t;return!!n&&m.objectLiteral(n)&&(si.is(n.contents)||ss.is(n.contents)||m.typedArray(n.contents,ss.is))&&(t.range===void 0||ne.is(t.range))}i.is=e})(Wc||(Wc={}));var zc;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(zc||(zc={}));var qc;(function(i){function e(t,n,...s){let r={label:t};return m.defined(n)&&(r.documentation=n),m.defined(s)?r.parameters=s:r.parameters=[],r}i.create=e})(qc||(qc={}));var Bc;(function(i){i.Text=1,i.Read=2,i.Write=3})(Bc||(Bc={}));var Uc;(function(i){function e(t,n){let s={range:t};return m.number(n)&&(s.kind=n),s}i.create=e})(Uc||(Uc={}));var Vc;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Vc||(Vc={}));var Zc;(function(i){i.Deprecated=1})(Zc||(Zc={}));var Gc;(function(i){function e(t,n,s,r,o){let a={name:t,kind:n,location:{uri:r,range:s}};return o&&(a.containerName=o),a}i.create=e})(Gc||(Gc={}));var Hc;(function(i){function e(t,n,s,r){return r!==void 0?{name:t,kind:n,location:{uri:s,range:r}}:{name:t,kind:n,location:{uri:s}}}i.create=e})(Hc||(Hc={}));var Jc;(function(i){function e(n,s,r,o,a,c){let l={name:n,detail:s,kind:r,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}i.create=e;function t(n){let s=n;return s&&m.string(s.name)&&m.number(s.kind)&&ne.is(s.range)&&ne.is(s.selectionRange)&&(s.detail===void 0||m.string(s.detail))&&(s.deprecated===void 0||m.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}i.is=t})(Jc||(Jc={}));var Xc;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(Xc||(Xc={}));var rs;(function(i){i.Invoked=1,i.Automatic=2})(rs||(rs={}));var Yc;(function(i){function e(n,s,r){let o={diagnostics:n};return s!=null&&(o.only=s),r!=null&&(o.triggerKind=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.typedArray(s.diagnostics,is.is)&&(s.only===void 0||m.typedArray(s.only,m.string))&&(s.triggerKind===void 0||s.triggerKind===rs.Invoked||s.triggerKind===rs.Automatic)}i.is=t})(Yc||(Yc={}));var Qc;(function(i){function e(n,s,r){let o={title:n},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Cn.is(s)?o.command=s:o.edit=s,a&&r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return s&&m.string(s.title)&&(s.diagnostics===void 0||m.typedArray(s.diagnostics,is.is))&&(s.kind===void 0||m.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Cn.is(s.command))&&(s.isPreferred===void 0||m.boolean(s.isPreferred))&&(s.edit===void 0||oo.is(s.edit))}i.is=t})(Qc||(Qc={}));var Kc;(function(i){function e(n,s){let r={range:n};return m.defined(s)&&(r.data=s),r}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.command)||Cn.is(s.command))}i.is=t})(Kc||(Kc={}));var el;(function(i){function e(n,s){return{tabSize:n,insertSpaces:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.uinteger(s.tabSize)&&m.boolean(s.insertSpaces)}i.is=t})(el||(el={}));var tl;(function(i){function e(n,s,r){return{range:n,target:s,data:r}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.target)||m.string(s.target))}i.is=t})(tl||(tl={}));var nl;(function(i){function e(n,s){return{range:n,parent:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(s.parent===void 0||i.is(s.parent))}i.is=t})(nl||(nl={}));var il;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(il||(il={}));var sl;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(sl||(sl={}));var rl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(rl||(rl={}));var ol;(function(i){function e(n,s){return{range:n,text:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.string(s.text)}i.is=t})(ol||(ol={}));var al;(function(i){function e(n,s,r){return{range:n,variableName:s,caseSensitiveLookup:r}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.boolean(s.caseSensitiveLookup)&&(m.string(s.variableName)||s.variableName===void 0)}i.is=t})(al||(al={}));var cl;(function(i){function e(n,s){return{range:n,expression:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&(m.string(s.expression)||s.expression===void 0)}i.is=t})(cl||(cl={}));var ll;(function(i){function e(n,s){return{frameId:n,stoppedLocation:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(n.stoppedLocation)}i.is=t})(ll||(ll={}));var lo;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(lo||(lo={}));var uo;(function(i){function e(n){return{value:n}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&(s.tooltip===void 0||m.string(s.tooltip)||si.is(s.tooltip))&&(s.location===void 0||ns.is(s.location))&&(s.command===void 0||Cn.is(s.command))}i.is=t})(uo||(uo={}));var ul;(function(i){function e(n,s,r){let o={position:n,label:s};return r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.position)&&(m.string(s.label)||m.typedArray(s.label,uo.is))&&(s.kind===void 0||lo.is(s.kind))&&s.textEdits===void 0||m.typedArray(s.textEdits,Tn.is)&&(s.tooltip===void 0||m.string(s.tooltip)||si.is(s.tooltip))&&(s.paddingLeft===void 0||m.boolean(s.paddingLeft))&&(s.paddingRight===void 0||m.boolean(s.paddingRight))}i.is=t})(ul||(ul={}));var hl;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(hl||(hl={}));var dl;(function(i){function e(t,n,s,r){return{insertText:t,filterText:n,range:s,command:r}}i.create=e})(dl||(dl={}));var fl;(function(i){function e(t){return{items:t}}i.create=e})(fl||(fl={}));var pl;(function(i){i.Invoked=0,i.Automatic=1})(pl||(pl={}));var ml;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(ml||(ml={}));var gl;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(gl||(gl={}));var yl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&Qr.is(n.uri)&&m.string(n.name)}i.is=e})(yl||(yl={}));var wl;(function(i){function e(r,o,a,c){return new ho(r,o,a,c)}i.create=e;function t(r){let o=r;return!!(m.defined(o)&&m.string(o.uri)&&(m.undefined(o.languageId)||m.string(o.languageId))&&m.uinteger(o.lineCount)&&m.func(o.getText)&&m.func(o.positionAt)&&m.func(o.offsetAt))}i.is=t;function n(r,o){let a=r.getText(),c=s(o,(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],p=r.offsetAt(d.range.start),f=r.offsetAt(d.range.end);if(f<=l)a=a.substring(0,p)+d.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=p}return a}i.applyEdits=n;function s(r,o){if(r.length<=1)return r;let a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);s(c,o),s(l,o);let u=0,d=0,p=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?r[p++]=c[u++]:r[p++]=l[d++];for(;u<c.length;)r[p++]=c[u++];for(;d<l.length;)r[p++]=l[d++];return r}})(wl||(wl={}));var ho=class{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let s=0;s<t.length;s++){n&&(e.push(s),n=!1);let r=t.charAt(s);n=r==="\r"||r===`
|
|
52
|
+
>>> no match, partial?`,e,p,t,f),p===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ba(this.pattern,this.options)}parse(e){Bn(e);let t=this.options;if(e==="**")return de;if(e==="")return"";let n,s=null;(n=e.match(Od))?s=t.dot?Nd:Ad:(n=e.match(vd))?s=(t.nocase?t.dot?Sd:xd:t.dot?_d:bd)(n[1]):(n=e.match(Pd))?s=(t.nocase?t.dot?Md:jd:t.dot?Ld:Id)(n):(n=e.match(kd))?s=t.dot?Cd:Ed:(n=e.match(Td))&&(s=Rd);let r=gn.fromGlob(e,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Fd:t.dot?Wd:zd,s=new Set(t.nocase?["i"]:[]),r=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))s.add(p);return typeof d=="string"?Zd(d):d===de?de:d._src});l.forEach((d,p)=>{let f=l[p+1],w=l[p-1];d!==de||w===de||(w===void 0?f!==void 0&&f!==de?l[p+1]="(?:\\/|"+n+"\\/)?"+f:l[p]=n:f===void 0?l[p-1]=w+"(?:\\/|\\/"+n+")?":f!==de&&(l[p-1]=w+"(?:\\/|\\/"+n+"\\/)"+f,l[p+1]=de))});let u=l.filter(d=>d!==de);if(this.partial&&u.length>=1){let d=[];for(let p=1;p<=u.length;p++)d.push(u.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<r.length;a++){let c=r[a],l=s;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return _e.defaults(e).Minimatch}};_e.AST=gn;_e.Minimatch=Ae;_e.escape=yn;_e.unescape=ze;var fc=require("node:url");var Gd=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Va=new Set,Lr=typeof process=="object"&&process?process:{},Za=(i,e,t,n)=>{typeof Lr.emitWarning=="function"?Lr.emitWarning(i,e,t,n):console.error(`[${t}] ${e}: ${i}`)},Li=globalThis.AbortController,Ua=globalThis.AbortSignal;if(typeof Li>"u"){Ua=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Li=class{constructor(){e()}signal=new Ua;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let i=Lr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{i&&(i=!1,Za("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Hd=i=>!Va.has(i),bm=Symbol("type"),bt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ga=i=>bt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?wn:null:null,wn=class extends Array{constructor(e){super(e),this.fill(0)}},Ir=class i{heap;length;static#e=!1;static create(e){let t=Ga(e);if(!t)return[];i.#e=!0;let n=new i(e,t);return i.#e=!1,n}constructor(e,t){if(!i.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Zt=class i{#e;#n;#r;#s;#o;#b;#y;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#h;#c;#i;#f;#_;#v;#p;#R;#m;#k;#E;#g;#w;#x;#C;#t;#M;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#g,autopurgeTimers:e.#w,sizes:e.#k,keyMap:e.#h,keyList:e.#c,valList:e.#i,next:e.#f,prev:e.#_,get head(){return e.#v},get tail(){return e.#p},free:e.#R,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,n,s,r)=>e.#q(t,n,s,r),moveToTail:t=>e.#I(t),indexes:t=>e.#A(t),rindexes:t=>e.#N(t),isStale:t=>e.#S(t)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#b}get memoMethod(){return this.#y}get dispose(){return this.#r}get onInsert(){return this.#s}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:w=0,maxEntrySize:g=0,sizeCalculation:k,fetchMethod:E,memoMethod:x,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:B,ignoreFetchAbort:K,perf:pe}=e;if(pe!==void 0&&typeof pe?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=pe??Gd,t!==0&&!bt(t))throw new TypeError("max option must be a nonnegative integer");let Te=t?Ga(t):Array;if(!Te)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=w,this.maxEntrySize=g||this.#n,this.sizeCalculation=k,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=x,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=E,this.#C=!!E,this.#h=new Map,this.#c=new Array(t).fill(void 0),this.#i=new Array(t).fill(void 0),this.#f=new Te(t),this.#_=new Te(t),this.#v=0,this.#p=0,this.#R=Ir.create(t),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#s=u),typeof d=="function"?(this.#o=d,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#x=!!this.#r,this.#M=!!this.#s,this.#t=!!this.#o,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(this.#n!==0&&!bt(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!bt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=bt(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!bt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let et="LRU_CACHE_UNBOUNDED";Hd(et)&&(Va.add(et),Za("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",et,i))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#P(){let e=new wn(this.#e),t=new wn(this.#e);this.#g=e,this.#E=t;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#w=n,this.#$=(o,a,c=this.#u.now())=>{if(t[o]=a!==0?c:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let l=setTimeout(()=>{this.#S(o)&&this.#O(this.#c[o],"expire")},a+1);l.unref&&l.unref(),n[o]=l}},this.#T=o=>{t[o]=e[o]!==0?this.#u.now():0},this.#j=(o,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=s||r();let u=o.now-l;o.remainingTTL=c-u}};let s=0,r=()=>{let o=this.#u.now();if(this.ttlResolution>0){s=o;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#h.get(o);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(s||r())-l;return c-u},this.#S=o=>{let a=t[o],c=e[o];return!!c&&!!a&&(s||r())-a>c}}#T=()=>{};#j=()=>{};#$=()=>{};#S=()=>!1;#U(){let e=new wn(this.#e);this.#d=0,this.#k=e,this.#D=t=>{this.#d-=e[t],e[t]=0},this.#F=(t,n,s,r)=>{if(this.#l(n))return 0;if(!bt(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!bt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,n,s)=>{if(e[t]=n,this.#n){let r=this.#n-e[t];for(;this.#d>r;)this.#z(!0)}this.#d+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#D=e=>{};#L=(e,t,n)=>{};#F=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#v));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#v;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#p));)t=this.#f[t]}#W(e){return e!==void 0&&this.#h.get(this.#c[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#N())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#A()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#N())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#S(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#h.get(e);if(t===void 0)return;let n=this.#i[t],s=this.#l(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#g&&this.#E){let o=this.#g[t],a=this.#E[t];if(o&&a){let c=o-(this.#u.now()-a);r.ttl=c,r.start=Date.now()}}return this.#k&&(r.size=this.#k[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let n=this.#c[t],s=this.#i[t],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#g&&this.#E){o.ttl=this.#g[t];let a=this.#u.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#u.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#F(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#a===0?void 0:this.#h.get(e);if(d===void 0)d=this.#a===0?this.#p:this.#R.length!==0?this.#R.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#c[d]=e,this.#i[d]=t,this.#h.set(e,d),this.#f[this.#p]=d,this.#_[d]=this.#p,this.#p=d,this.#a++,this.#L(d,u,c),c&&(c.set="add"),l=!1,this.#M&&this.#s?.(t,e,"add");else{this.#I(d);let p=this.#i[d];if(t!==p){if(this.#C&&this.#l(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&!o&&(this.#x&&this.#r?.(f,e,"set"),this.#t&&this.#m?.push([f,e,"set"]))}else o||(this.#x&&this.#r?.(p,e,"set"),this.#t&&this.#m?.push([p,e,"set"]));if(this.#D(d),this.#L(d,u,c),this.#i[d]=t,c){c.set="replace";let f=p&&this.#l(p)?p.__staleWhileFetching:p;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#M&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#g&&this.#P(),this.#g&&(l||this.#$(d,s,r),c&&this.#j(c,d)),!o&&this.#t&&this.#m){let p=this.#m,f;for(;f=p?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#v];if(this.#z(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#o?.(...t)}}}#z(e){let t=this.#v,n=this.#c[t],s=this.#i[t];return this.#C&&this.#l(s)?s.__abortController.abort(new Error("evicted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(s,n,"evict"),this.#t&&this.#m?.push([s,n,"evict"])),this.#D(t),this.#w?.[t]&&(clearTimeout(this.#w[t]),this.#w[t]=void 0),e&&(this.#c[t]=void 0,this.#i[t]=void 0,this.#R.push(t)),this.#a===1?(this.#v=this.#p=0,this.#R.length=0):this.#v=this.#f[t],this.#h.delete(n),this.#a--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#h.get(e);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#S(r))s&&(s.has="stale",this.#j(s,r));else return n&&this.#T(r),s&&(s.has="hit",this.#j(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#h.get(e);if(s===void 0||!n&&this.#S(s))return;let r=this.#i[s];return this.#l(r)?r.__staleWhileFetching:r}#q(e,t,n,s){let r=t===void 0?void 0:this.#i[t];if(this.#l(r))return r;let o=new Li,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,k=!1)=>{let{aborted:E}=o.signal,x=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(E&&!k?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!x&&!k)return d(o.signal.reason);let b=f,S=this.#i[t];return(S===f||x&&k&&S===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#i[t]=b.__staleWhileFetching:this.#O(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:k}=o.signal,E=k&&n.allowStaleOnFetchAbort,x=E||n.allowStaleOnFetchRejection,b=x||n.noDeleteOnFetchRejection,S=f;if(this.#i[t]===f&&(!b||S.__staleWhileFetching===void 0?this.#O(e,"fetch"):E||(this.#i[t]=S.__staleWhileFetching)),x)return n.status&&S.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw g},p=(g,k)=>{let E=this.#b?.(e,r,c);E&&E instanceof Promise&&E.then(x=>g(x===void 0?void 0:x),k),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=x=>l(x,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(p).then(l,u),w=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,w,{...c.options,status:void 0}),t=this.#h.get(e)):this.#i[t]=w,w}#l(e){if(!this.#C)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Li}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:g,forceRefresh:k=!1,status:E,signal:x}=t;if(!this.#C)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:E});let b={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:w,ignoreFetchAbort:f,status:E,signal:x},S=this.#h.get(e);if(S===void 0){E&&(E.fetch="miss");let O=this.#q(e,S,b,g);return O.__returned=O}else{let O=this.#i[S];if(this.#l(O)){let et=n&&O.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",et&&(E.returnedStale=!0)),et?O.__staleWhileFetching:O.__returned=O}let B=this.#S(S);if(!k&&!B)return E&&(E.fetch="hit"),this.#I(S),s&&this.#T(S),E&&this.#j(E,S),O;let K=this.#q(e,S,b,g),Te=K.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=B?"stale":"refresh",Te&&B&&(E.returnedStale=!0)),Te?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#y;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...o}=t,a=this.get(e,o);if(!r&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#h.get(e);if(a!==void 0){let c=this.#i[a],l=this.#l(c);return o&&this.#j(o,a),this.#S(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(r||this.#O(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#I(a),s&&this.#T(a),c))}else o&&(o.get="miss")}#B(e,t){this.#_[t]=e,this.#f[e]=t}#I(e){e!==this.#p&&(e===this.#v?this.#v=this.#f[e]:this.#B(this.#_[e],this.#f[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let n=!1;if(this.#a!==0){let s=this.#h.get(e);if(s!==void 0)if(this.#w?.[s]&&(clearTimeout(this.#w?.[s]),this.#w[s]=void 0),n=!0,this.#a===1)this.#V(t);else{this.#D(s);let r=this.#i[s];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(r,e,t),this.#t&&this.#m?.push([r,e,t])),this.#h.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#p)this.#p=this.#_[s];else if(s===this.#v)this.#v=this.#f[s];else{let o=this.#_[s];this.#f[o]=this.#f[s];let a=this.#f[s];this.#_[a]=this.#_[s]}this.#a--,this.#R.push(s)}}if(this.#t&&this.#m?.length){let s=this.#m,r;for(;r=s?.shift();)this.#o?.(...r)}return n}clear(){return this.#V("delete")}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#i[t];if(this.#l(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#x&&this.#r?.(n,s,e),this.#t&&this.#m?.push([n,s,e])}}if(this.#h.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#g&&this.#E){this.#g.fill(0),this.#E.fill(0);for(let t of this.#w??[])t!==void 0&&clearTimeout(t);this.#w?.fill(void 0)}if(this.#k&&this.#k.fill(0),this.#v=0,this.#p=0,this.#R.length=0,this.#d=0,this.#a=0,this.#t&&this.#m){let t=this.#m,n;for(;n=t?.shift();)this.#o?.(...n)}}};var _n=require("node:path"),ic=require("node:url"),Ke=require("fs"),rf=ht(require("node:fs"),1),St=require("node:fs/promises");var qi=require("node:events"),Br=ht(require("node:stream"),1),Qa=require("node:string_decoder"),Ha=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jd=i=>!!i&&typeof i=="object"&&(i instanceof xt||i instanceof Br.default||Xd(i)||Yd(i)),Xd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==Br.default.Writable.prototype.pipe,Yd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function",ot=Symbol("EOF"),at=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),Ii=Symbol("emittingEnd"),Vn=Symbol("emittedError"),Di=Symbol("closed"),Ja=Symbol("read"),$i=Symbol("flush"),Xa=Symbol("flushChunk"),qe=Symbol("encoding"),vn=Symbol("decoder"),oe=Symbol("flowing"),Zn=Symbol("paused"),bn=Symbol("resume"),ae=Symbol("buffer"),xe=Symbol("pipes"),ce=Symbol("bufferLength"),Dr=Symbol("bufferPush"),Fi=Symbol("bufferShift"),we=Symbol("objectMode"),te=Symbol("destroyed"),$r=Symbol("error"),Fr=Symbol("emitData"),Ya=Symbol("emitEnd"),Wr=Symbol("emitEnd2"),Ye=Symbol("async"),zr=Symbol("abort"),Wi=Symbol("aborted"),Gn=Symbol("signal"),Gt=Symbol("dataListeners"),Ne=Symbol("discarded"),Hn=i=>Promise.resolve().then(i),Qd=i=>i(),Kd=i=>i==="end"||i==="finish"||i==="prefinish",ef=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,tf=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),zi=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[bn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},qr=class extends zi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},nf=i=>!!i.objectMode,sf=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",xt=class extends qi.EventEmitter{[oe]=!1;[Zn]=!1;[xe]=[];[ae]=[];[we];[qe];[Ye];[vn];[ot]=!1;[_t]=!1;[Ii]=!1;[Di]=!1;[Vn]=null;[ce]=0;[te]=!1;[Gn];[Wi]=!1;[Gt]=0;[Ne]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");nf(t)?(this[we]=!0,this[qe]=null):sf(t)?(this[qe]=t.encoding,this[we]=!1):(this[we]=!1,this[qe]=null),this[Ye]=!!t.async,this[vn]=this[qe]?new Qa.StringDecoder(this[qe]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ae]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[xe]});let{signal:n}=t;n&&(this[Gn]=n,n.aborted?this[zr]():n.addEventListener("abort",()=>this[zr]()))}get bufferLength(){return this[ce]}get encoding(){return this[qe]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[we]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ye]}set async(e){this[Ye]=this[Ye]||!!e}[zr](){this[Wi]=!0,this.emit("abort",this[Gn]?.reason),this.destroy(this[Gn]?.reason)}get aborted(){return this[Wi]}set aborted(e){}write(e,t,n){if(this[Wi])return!1;if(this[ot])throw new Error("write after end");if(this[te])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let s=this[Ye]?Hn:Qd;if(!this[we]&&!Buffer.isBuffer(e)){if(tf(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ef(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):e.length?(typeof e=="string"&&!(t===this[qe]&&!this[vn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[qe]&&(e=this[vn].write(e)),this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):(this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe])}read(e){if(this[te])return null;if(this[Ne]=!1,this[ce]===0||e===0||e&&e>this[ce])return this[at](),null;this[we]&&(e=null),this[ae].length>1&&!this[we]&&(this[ae]=[this[qe]?this[ae].join(""):Buffer.concat(this[ae],this[ce])]);let t=this[Ja](e||null,this[ae][0]);return this[at](),t}[Ja](e,t){if(this[we])this[Fi]();else{let n=t;e===n.length||e===null?this[Fi]():typeof n=="string"?(this[ae][0]=n.slice(e),t=n.slice(0,e),this[ce]-=e):(this[ae][0]=n.subarray(e),t=n.subarray(0,e),this[ce]-=e)}return this.emit("data",t),!this[ae].length&&!this[ot]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[ot]=!0,this.writable=!1,(this[oe]||!this[Zn])&&this[at](),this}[bn](){this[te]||(!this[Gt]&&!this[xe].length&&(this[Ne]=!0),this[Zn]=!1,this[oe]=!0,this.emit("resume"),this[ae].length?this[$i]():this[ot]?this[at]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[oe]=!1,this[Zn]=!0,this[Ne]=!1}get destroyed(){return this[te]}get flowing(){return this[oe]}get paused(){return this[Zn]}[Dr](e){this[we]?this[ce]+=1:this[ce]+=e.length,this[ae].push(e)}[Fi](){return this[we]?this[ce]-=1:this[ce]-=this[ae][0].length,this[ae].shift()}[$i](e=!1){do;while(this[Xa](this[Fi]())&&this[ae].length);!e&&!this[ae].length&&!this[ot]&&this.emit("drain")}[Xa](e){return this.emit("data",e),this[oe]}pipe(e,t){if(this[te])return e;this[Ne]=!1;let n=this[_t];return t=t||{},e===Ha.stdout||e===Ha.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[xe].push(t.proxyErrors?new qr(this,e,t):new zi(this,e,t)),this[Ye]?Hn(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this[xe].find(n=>n.dest===e);t&&(this[xe].length===1?(this[oe]&&this[Gt]===0&&(this[oe]=!1),this[xe]=[]):this[xe].splice(this[xe].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Ne]=!1,this[Gt]++,!this[xe].length&&!this[oe]&&this[bn]();else if(e==="readable"&&this[ce]!==0)super.emit("readable");else if(Kd(e)&&this[_t])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Vn]){let s=t;this[Ye]?Hn(()=>s.call(this,this[Vn])):s.call(this,this[Vn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Gt]=this.listeners("data").length,this[Gt]===0&&!this[Ne]&&!this[xe].length&&(this[oe]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Gt]=0,!this[Ne]&&!this[xe].length&&(this[oe]=!1)),t}get emittedEnd(){return this[_t]}[at](){!this[Ii]&&!this[_t]&&!this[te]&&this[ae].length===0&&this[ot]&&(this[Ii]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Di]&&this.emit("close"),this[Ii]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==te&&this[te])return!1;if(e==="data")return!this[we]&&!n?!1:this[Ye]?(Hn(()=>this[Fr](n)),!0):this[Fr](n);if(e==="end")return this[Ya]();if(e==="close"){if(this[Di]=!0,!this[_t]&&!this[te])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Vn]=n,super.emit($r,n);let r=!this[Gn]||this.listeners("error").length?super.emit("error",n):!1;return this[at](),r}else if(e==="resume"){let r=super.emit("resume");return this[at](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[at](),s}[Fr](e){for(let n of this[xe])n.dest.write(e)===!1&&this.pause();let t=this[Ne]?!1:super.emit("data",e);return this[at](),t}[Ya](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[Ye]?(Hn(()=>this[Wr]()),!0):this[Wr]())}[Wr](){if(this[vn]){let t=this[vn].end();if(t){for(let n of this[xe])n.dest.write(t);this[Ne]||super.emit("data",t)}}for(let t of this[xe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[we]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[we]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[qe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(te,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ne]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ot])return t();let r,o,a=d=>{this.off("data",c),this.off("end",l),this.off(te,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(te,u),this.pause(),r({value:d,done:!!this[ot]})},l=()=>{this.off("error",a),this.off("data",c),this.off(te,u),t(),r({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,r=d,this.once(te,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ne]=!1;let e=!1,t=()=>(this.pause(),this.off($r,t),this.off(te,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once($r,t),this.once(te,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[te])return e?this.emit("error",e):this.emit(te),this;this[te]=!0,this[Ne]=!0,this[ae].length=0,this[ce]=0;let t=this;return typeof t.close=="function"&&!this[Di]&&t.close(),e?this.emit("error",e):this.emit(te),this}static get isStream(){return Jd}};var of=Ke.realpathSync.native,Xn={lstatSync:Ke.lstatSync,readdir:Ke.readdir,readdirSync:Ke.readdirSync,readlinkSync:Ke.readlinkSync,realpathSync:of,promises:{lstat:St.lstat,readdir:St.readdir,readlink:St.readlink,realpath:St.realpath}},sc=i=>!i||i===Xn||i===rf?Xn:{...Xn,...i,promises:{...Xn.promises,...i.promises||{}}},rc=/^\\\\\?\\([a-z]:)\\?$/i,af=i=>i.replace(/\//g,"\\").replace(rc,"$1\\"),cf=/[\\\/]/,$e=0,oc=1,ac=2,Qe=4,cc=6,lc=8,Ht=10,uc=12,De=15,Jn=~De,Ur=16,Ka=32,Yn=64,Be=128,Bi=256,Vi=512,ec=Yn|Be|Vi,lf=1023,Vr=i=>i.isFile()?lc:i.isDirectory()?Qe:i.isSymbolicLink()?Ht:i.isCharacterDevice()?ac:i.isBlockDevice()?cc:i.isSocket()?uc:i.isFIFO()?oc:$e,tc=new Zt({max:2**12}),Qn=i=>{let e=tc.get(i);if(e)return e;let t=i.normalize("NFKD");return tc.set(i,t),t},nc=new Zt({max:2**12}),Ui=i=>{let e=nc.get(i);if(e)return e;let t=Qn(i.toLowerCase());return nc.set(i,t),t},Zi=class extends Zt{constructor(){super({max:256})}},Zr=class extends Zt{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},hc=Symbol("PathScurry setAsCwd"),ve=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#s;get nlink(){return this.#s}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#y;get rdev(){return this.#y}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#d;get size(){return this.#d}#h;get blocks(){return this.#h}#c;get atimeMs(){return this.#c}#i;get mtimeMs(){return this.#i}#f;get ctimeMs(){return this.#f}#_;get birthtimeMs(){return this.#_}#v;get atime(){return this.#v}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#k;#E;#g;#w;#x;#C;#t;#M;#P;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=$e,n,s,r,o,a){this.name=e,this.#k=r?Ui(e):Qn(e),this.#t=t&lf,this.nocase=r,this.roots=s,this.root=n||this,this.#M=o,this.#g=a.fullpath,this.#x=a.relative,this.#C=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=sc(a.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#j(s):this.#j(s)}#j(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#M.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#M.set(this,t),this.#t&=~Ur,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?Ui(e):Qn(e);for(let c of n)if(c.#k===s)return c;let r=this.parent?this.sep:"",o=this.#g?this.#g+r+e:void 0,a=this.newChild(e,$e,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Be),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#g!==void 0)return this.#g;let e=this.name,t=this.parent;if(!t)return this.#g=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#g=s}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#w=`//?/${s}`:this.#w=s}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#w=n}isUnknown(){return(this.#t&De)===$e}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#t&De)===lc}isDirectory(){return(this.#t&De)===Qe}isCharacterDevice(){return(this.#t&De)===ac}isBlockDevice(){return(this.#t&De)===cc}isFIFO(){return(this.#t&De)===oc}isSocket(){return(this.#t&De)===uc}isSymbolicLink(){return(this.#t&Ht)===Ht}lstatCached(){return this.#t&Ka?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#T}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let e=this.#t&De;return!(e!==$e&&e!==Ht||this.#t&Bi||this.#t&Be)}calledReaddir(){return!!(this.#t&Ur)}isENOENT(){return!!(this.#t&Be)}isNamed(e){return this.nocase?this.#k===Ui(e):this.#k===Qn(e)}async readlink(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}readlinkSync(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}#$(e){this.#t|=Ur;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#S()}}#S(){this.#t&Be||(this.#t=(this.#t|Be)&Jn,this.#U())}#U(){let e=this.children();e.provisional=0;for(let t of e)t.#S()}#D(){this.#t|=Vi,this.#L()}#L(){if(this.#t&Yn)return;let e=this.#t;(e&De)===Qe&&(e&=Jn),this.#t=e|Yn,this.#U()}#F(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#S():this.children().provisional=0}#A(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#S()}#N(e=""){let t=this.#t;t|=Bi,e==="ENOENT"&&(t|=Be),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Jn),this.#t=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#W(e,t){return this.#q(e,t)||this.#z(e,t)}#z(e,t){let n=Vr(e),s=this.newChild(e.name,n,{parent:this}),r=s.#t&De;return r!==Qe&&r!==Ht&&r!==$e&&(s.#t|=Yn),t.unshift(s),t.provisional++,s}#q(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?Ui(e.name):Qn(e.name))===s.#k)return this.#l(e,s,n,t)}}#l(e,t,n,s){let r=t.name;return t.#t=t.#t&Jn|Vr(e),r!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#t&Be)===0)try{return this.#B(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#A(e.code)}}lstatSync(){if((this.#t&Be)===0)try{return this.#B(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#A(e.code)}}#B(e){let{atime:t,atimeMs:n,birthtime:s,birthtimeMs:r,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:f,mtime:w,mtimeMs:g,nlink:k,rdev:E,size:x,uid:b}=e;this.#v=t,this.#c=n,this.#m=s,this.#_=r,this.#u=o,this.#h=a,this.#R=c,this.#f=l,this.#n=u,this.#b=d,this.#a=p,this.#r=f,this.#p=w,this.#i=g,this.#s=k,this.#y=E,this.#d=x,this.#o=b;let S=Vr(e);this.#t=this.#t&Jn|S|Ka,S!==$e&&S!==Qe&&S!==Ht&&(this.#t|=Yn)}#I=[];#O=!1;#V(e){this.#O=!1;let t=this.#I.slice();this.#I.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#I.push(e),this.#O)return;this.#O=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(r,o)=>{if(r)this.#F(r.code),n.provisional=0;else{for(let a of o)this.#W(a,n);this.#$(n)}this.#V(n.slice(0,n.provisional))})}#Z;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#Z)await this.#Z;else{let n=()=>{};this.#Z=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#W(s,e);this.#$(e)}catch(s){this.#F(s.code),e.provisional=0}this.#Z=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#W(n,e);this.#$(e)}catch(n){this.#F(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&ec)return!1;let e=De&this.#t;return e===$e||e===Qe||e===Ht}shouldWalk(e,t){return(this.#t&Qe)===Qe&&!(this.#t&ec)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}[hc](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#x=n.join(this.sep),s.#C=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#x=void 0,s.#C=void 0,s=s.parent}},Gi=class i extends ve{sep="\\";splitSep=cf;constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return _n.win32.parse(e).root}getRoot(e){if(e=af(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new xn(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(rc,"$1\\"),e===t}},Hi=class i extends ve{splitSep="/";sep="/";constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Ji=class{root;rootPath;roots;cwd;#e;#n;#r;nocase;#s;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:r=16*1024,fs:o=Xn}={}){this.#s=sc(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ic.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Zi,this.#n=new Zi,this.#r=new Zr(r);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,f=!1;for(let w of c){let g=u--;l=l.child(w,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(f?"":d)+w}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#n.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?s:s.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((f,w)=>{if(f)return p(f);let g=w.length;if(!g)return p();let k=()=>{--g===0&&p()};for(let E of w)(!r||r(E))&&a.push(n?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(x=>x?.isUnknown()?x.lstat():x).then(x=>x?.shouldWalk(c,o)?l(x,k):k()):E.shouldWalk(c,o)?l(E,k):k()},!0)},u=e;return new Promise((d,p)=>{l(u,f=>{if(f)return p(f);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!r||r(d))&&a.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(s&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!r||r(u))&&(yield n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=(k,E,x=!1)=>{if(k)return a.emit("error",k);if(s&&!x){let b=[];for(let S of E)S.isSymbolicLink()&&b.push(S.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>w(null,E,!0));return}}for(let b of E)b&&(!r||r(b))&&(a.write(n?b:b.fullpath())||(p=!0));u--;for(let b of E){let S=b.realpathCached()||b;S.shouldWalk(c,o)&&l.push(S)}p&&!a.flowing?a.once("drain",d):g||d()},g=!0;f.readdirCB(w,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0}),c=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=f.readdirSync();for(let g of w)(!r||r(g))&&(a.write(n?g:g.fullpath())||(p=!0));u--;for(let g of w){let k=g;if(g.isSymbolicLink()){if(!(s&&(k=g.realpathSync())))continue;k.isUnknown()&&k.lstatSync()}k.shouldWalk(c,o)&&l.push(k)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[hc](t)}},xn=class extends Ji{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,_n.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return _n.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sn=class extends Ji{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,_n.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Hi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Kn=class extends Sn{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},Em=process.platform==="win32"?Gi:Hi,dc=process.platform==="win32"?xn:process.platform==="darwin"?Kn:Sn;var uf=i=>i.length>=1,hf=i=>i.length>=1,kn=class i{#e;#n;#r;length;#s;#o;#b;#y;#u;#a;#d=!0;constructor(e,t,n,s){if(!uf(e))throw new TypeError("empty pattern list");if(!hf(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=n,this.#s=s,this.#r===0){if(this.isUNC()){let[r,o,a,c,...l]=this.#e,[u,d,p,f,...w]=this.#n;l[0]===""&&(l.shift(),w.shift());let g=[r,o,a,c,""].join("/"),k=[u,d,p,f,""].join("/");this.#e=[g,...l],this.#n=[k,...w],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#n;o[0]===""&&(o.shift(),c.shift());let l=r+"/",u=a+"/";this.#e=[l,...o],this.#n=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===de}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#e,this.#n,this.#r+1,this.#s),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#s==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}};var df=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",En=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:r,platform:o=df}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:s,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ae(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],r=t.globParts[n];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let o=new kn(s,r,0,this.platform),a=new Ae(o.globString(),this.mmopts),c=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,s=e.relative()||".",r=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(r))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Gr=class i{store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Hr=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?s:s&r)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Jr=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ei=class i{hasWalkedCache;matches=new Hr;subwalks=new Jr;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Gr}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,r]of n){this.hasWalkedCache.storeWalked(s,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=r.pattern())=="string"&&(l=r.rest());)s=s.resolve(c),r=l,u=!0;if(c=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(s,r))continue;this.hasWalkedCache.storeWalked(s,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===de){(!s.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(s,r);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(s,a,d===""||d===".");else if(d===".."){let f=s.parent||s;p?this.hasWalkedCache.hasWalked(f,p)||this.subwalks.add(f,p):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let r of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===de?s.testGlobstar(r,o,l,a):c instanceof RegExp?s.testRegExp(r,c,l,a):s.testString(r,c,l,a)}return s}testGlobstar(e,t,n,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),s);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var ff=(i,e)=>typeof i=="string"?new En([i],e):Array.isArray(i)?new En(i,e):i,Xi=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#n=ff(n.ignore??[],n),!this.includeChildMatches&&typeof this.#n.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#s(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#o(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#s(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#s(e))return;if(!this.includeChildMatches&&this.#n?.add){let r=`${e.relativePosix()}/**`;this.#n.add(r)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+s)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+s:"."+s)}}async match(e,t,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ei(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ei(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ti=class extends Xi{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},ni=class extends Xi{results;constructor(e,t,n){super(e,t,n),this.results=new xt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ue=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,fc.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||pf,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?xn:t.platform==="darwin"?Kn:t.platform?Sn:dc;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(c=>new Ae(c,s)),[o,a]=r.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new kn(c,u,0,this.platform)})}async walk(){return[...await new ti(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ti(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ni(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ni(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Xr=(i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Ae(t,e).hasMagic())return!0;return!1};function Yi(i,e={}){return new Ue(i,e).streamSync()}function gc(i,e={}){return new Ue(i,e).stream()}function Qi(i,e={}){return new Ue(i,e).walkSync()}async function pc(i,e={}){return new Ue(i,e).walk()}function Ki(i,e={}){return new Ue(i,e).iterateSync()}function yc(i,e={}){return new Ue(i,e).iterate()}var mf=Yi,gf=Object.assign(gc,{sync:Yi}),yf=Ki,wf=Object.assign(yc,{sync:Ki}),vf=Object.assign(Qi,{stream:Yi,iterate:Ki}),mc=Object.assign(pc,{glob:pc,globSync:Qi,sync:vf,globStream:gc,stream:gf,globStreamSync:Yi,streamSync:mf,globIterate:yc,iterate:wf,globIterateSync:Ki,iterateSync:yf,Glob:Ue,hasMagic:Xr,escape:yn,unescape:ze});mc.glob=mc;var Yr={name:"dts-linter",version:"0.3.11-beta1",main:"index.js",repository:{type:"git",url:"https://github.com/kylebonnici/dts-linter"},scripts:{compile:"node ./esbuild.js","compile:prod":"node ./esbuild.js --production"},bin:"./dist/dts-linter.js",files:["dist/dts-linter.js","THIRD_PARTY_LICENSES.txt"],keywords:["dts","linter","devicetree","formatting"],author:"Kyle Micallef Bonnici",license:"Apache-2.0",description:"",dependencies:{"devicetree-language-server":"^0.8.0-beta2"},devDependencies:{"@types/node":"^24.0.3","devicetree-language-server-types":"^0.0.2-alpha.8",diff:"^8.0.2",esbuild:"^0.25.5",glob:"^13.0.0","license-checker":"^25.0.1","ts-node":"^10.9.2",typescript:"^5.8.3","vscode-jsonrpc":"^8.2.1","vscode-languageserver-types":"^3.17.5",zod:"^3.25.67"}};var wc;(function(i){function e(t){return typeof t=="string"}i.is=e})(wc||(wc={}));var Qr;(function(i){function e(t){return typeof t=="string"}i.is=e})(Qr||(Qr={}));var vc;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(vc||(vc={}));var es;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(es||(es={}));var Ve;(function(i){function e(n,s){return n===Number.MAX_VALUE&&(n=es.MAX_VALUE),s===Number.MAX_VALUE&&(s=es.MAX_VALUE),{line:n,character:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.line)&&m.uinteger(s.character)}i.is=t})(Ve||(Ve={}));var ne;(function(i){function e(n,s,r,o){if(m.uinteger(n)&&m.uinteger(s)&&m.uinteger(r)&&m.uinteger(o))return{start:Ve.create(n,s),end:Ve.create(r,o)};if(Ve.is(n)&&Ve.is(s))return{start:n,end:s};throw new Error(`Range#create called with invalid arguments[${n}, ${s}, ${r}, ${o}]`)}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.start)&&Ve.is(s.end)}i.is=t})(ne||(ne={}));var ts;(function(i){function e(n,s){return{uri:n,range:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(m.string(s.uri)||m.undefined(s.uri))}i.is=t})(ts||(ts={}));var bc;(function(i){function e(n,s,r,o){return{targetUri:n,targetRange:s,targetSelectionRange:r,originSelectionRange:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.targetRange)&&m.string(s.targetUri)&&ne.is(s.targetSelectionRange)&&(ne.is(s.originSelectionRange)||m.undefined(s.originSelectionRange))}i.is=t})(bc||(bc={}));var Kr;(function(i){function e(n,s,r,o){return{red:n,green:s,blue:r,alpha:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.numberRange(s.red,0,1)&&m.numberRange(s.green,0,1)&&m.numberRange(s.blue,0,1)&&m.numberRange(s.alpha,0,1)}i.is=t})(Kr||(Kr={}));var _c;(function(i){function e(n,s){return{range:n,color:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&Kr.is(s.color)}i.is=t})(_c||(_c={}));var xc;(function(i){function e(n,s,r){return{label:n,textEdit:s,additionalTextEdits:r}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.undefined(s.textEdit)||Tn.is(s))&&(m.undefined(s.additionalTextEdits)||m.typedArray(s.additionalTextEdits,Tn.is))}i.is=t})(xc||(xc={}));var Sc;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(Sc||(Sc={}));var kc;(function(i){function e(n,s,r,o,a,c){let l={startLine:n,endLine:s};return m.defined(r)&&(l.startCharacter=r),m.defined(o)&&(l.endCharacter=o),m.defined(a)&&(l.kind=a),m.defined(c)&&(l.collapsedText=c),l}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.startLine)&&m.uinteger(s.startLine)&&(m.undefined(s.startCharacter)||m.uinteger(s.startCharacter))&&(m.undefined(s.endCharacter)||m.uinteger(s.endCharacter))&&(m.undefined(s.kind)||m.string(s.kind))}i.is=t})(kc||(kc={}));var eo;(function(i){function e(n,s){return{location:n,message:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ts.is(s.location)&&m.string(s.message)}i.is=t})(eo||(eo={}));var fe;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(fe||(fe={}));var Ec;(function(i){i.Unnecessary=1,i.Deprecated=2})(Ec||(Ec={}));var Cc;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&m.string(n.href)}i.is=e})(Cc||(Cc={}));var ns;(function(i){function e(n,s,r,o,a,c){let l={range:n,message:s};return m.defined(r)&&(l.severity=r),m.defined(o)&&(l.code=o),m.defined(a)&&(l.source=a),m.defined(c)&&(l.relatedInformation=c),l}i.create=e;function t(n){var s;let r=n;return m.defined(r)&&ne.is(r.range)&&m.string(r.message)&&(m.number(r.severity)||m.undefined(r.severity))&&(m.integer(r.code)||m.string(r.code)||m.undefined(r.code))&&(m.undefined(r.codeDescription)||m.string((s=r.codeDescription)===null||s===void 0?void 0:s.href))&&(m.string(r.source)||m.undefined(r.source))&&(m.undefined(r.relatedInformation)||m.typedArray(r.relatedInformation,eo.is))}i.is=t})(ns||(ns={}));var Cn;(function(i){function e(n,s,...r){let o={title:n,command:s};return m.defined(r)&&r.length>0&&(o.arguments=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.title)&&m.string(s.command)}i.is=t})(Cn||(Cn={}));var Tn;(function(i){function e(r,o){return{range:r,newText:o}}i.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}i.insert=t;function n(r){return{range:r,newText:""}}i.del=n;function s(r){let o=r;return m.objectLiteral(o)&&m.string(o.newText)&&ne.is(o.range)}i.is=s})(Tn||(Tn={}));var to;(function(i){function e(n,s,r){let o={label:n};return s!==void 0&&(o.needsConfirmation=s),r!==void 0&&(o.description=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(m.string(s.description)||s.description===void 0)}i.is=t})(to||(to={}));var Rn;(function(i){function e(t){let n=t;return m.string(n)}i.is=e})(Rn||(Rn={}));var Tc;(function(i){function e(r,o,a){return{range:r,newText:o,annotationId:a}}i.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}i.insert=t;function n(r,o){return{range:r,newText:"",annotationId:o}}i.del=n;function s(r){let o=r;return Tn.is(o)&&(to.is(o.annotationId)||Rn.is(o.annotationId))}i.is=s})(Tc||(Tc={}));var no;(function(i){function e(n,s){return{textDocument:n,edits:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ao.is(s.textDocument)&&Array.isArray(s.edits)}i.is=t})(no||(no={}));var io;(function(i){function e(n,s,r){let o={kind:"create",uri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="create"&&m.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(io||(io={}));var so;(function(i){function e(n,s,r,o){let a={kind:"rename",oldUri:n,newUri:s};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}i.create=e;function t(n){let s=n;return s&&s.kind==="rename"&&m.string(s.oldUri)&&m.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(so||(so={}));var ro;(function(i){function e(n,s,r){let o={kind:"delete",uri:n};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="delete"&&m.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||m.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||m.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(ro||(ro={}));var oo;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(s=>m.string(s.kind)?io.is(s)||so.is(s)||ro.is(s):no.is(s)))}i.is=e})(oo||(oo={}));var Rc;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)}i.is=t})(Rc||(Rc={}));var Oc;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.integer(s.version)}i.is=t})(Oc||(Oc={}));var ao;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&(s.version===null||m.integer(s.version))}i.is=t})(ao||(ao={}));var Ac;(function(i){function e(n,s,r,o){return{uri:n,languageId:s,version:r,text:o}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.string(s.languageId)&&m.integer(s.version)&&m.string(s.text)}i.is=t})(Ac||(Ac={}));var co;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){let n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(co||(co={}));var ii;(function(i){function e(t){let n=t;return m.objectLiteral(t)&&co.is(n.kind)&&m.string(n.value)}i.is=e})(ii||(ii={}));var Nc;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(Nc||(Nc={}));var Pc;(function(i){i.PlainText=1,i.Snippet=2})(Pc||(Pc={}));var jc;(function(i){i.Deprecated=1})(jc||(jc={}));var Mc;(function(i){function e(n,s,r){return{newText:n,insert:s,replace:r}}i.create=e;function t(n){let s=n;return s&&m.string(s.newText)&&ne.is(s.insert)&&ne.is(s.replace)}i.is=t})(Mc||(Mc={}));var Lc;(function(i){i.asIs=1,i.adjustIndentation=2})(Lc||(Lc={}));var Ic;(function(i){function e(t){let n=t;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}i.is=e})(Ic||(Ic={}));var Dc;(function(i){function e(t){return{label:t}}i.create=e})(Dc||(Dc={}));var $c;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})($c||($c={}));var is;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){let s=n;return m.string(s)||m.objectLiteral(s)&&m.string(s.language)&&m.string(s.value)}i.is=t})(is||(is={}));var Fc;(function(i){function e(t){let n=t;return!!n&&m.objectLiteral(n)&&(ii.is(n.contents)||is.is(n.contents)||m.typedArray(n.contents,is.is))&&(t.range===void 0||ne.is(t.range))}i.is=e})(Fc||(Fc={}));var Wc;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(Wc||(Wc={}));var zc;(function(i){function e(t,n,...s){let r={label:t};return m.defined(n)&&(r.documentation=n),m.defined(s)?r.parameters=s:r.parameters=[],r}i.create=e})(zc||(zc={}));var qc;(function(i){i.Text=1,i.Read=2,i.Write=3})(qc||(qc={}));var Bc;(function(i){function e(t,n){let s={range:t};return m.number(n)&&(s.kind=n),s}i.create=e})(Bc||(Bc={}));var Uc;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Uc||(Uc={}));var Vc;(function(i){i.Deprecated=1})(Vc||(Vc={}));var Zc;(function(i){function e(t,n,s,r,o){let a={name:t,kind:n,location:{uri:r,range:s}};return o&&(a.containerName=o),a}i.create=e})(Zc||(Zc={}));var Gc;(function(i){function e(t,n,s,r){return r!==void 0?{name:t,kind:n,location:{uri:s,range:r}}:{name:t,kind:n,location:{uri:s}}}i.create=e})(Gc||(Gc={}));var Hc;(function(i){function e(n,s,r,o,a,c){let l={name:n,detail:s,kind:r,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}i.create=e;function t(n){let s=n;return s&&m.string(s.name)&&m.number(s.kind)&&ne.is(s.range)&&ne.is(s.selectionRange)&&(s.detail===void 0||m.string(s.detail))&&(s.deprecated===void 0||m.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}i.is=t})(Hc||(Hc={}));var Jc;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(Jc||(Jc={}));var ss;(function(i){i.Invoked=1,i.Automatic=2})(ss||(ss={}));var Xc;(function(i){function e(n,s,r){let o={diagnostics:n};return s!=null&&(o.only=s),r!=null&&(o.triggerKind=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.typedArray(s.diagnostics,ns.is)&&(s.only===void 0||m.typedArray(s.only,m.string))&&(s.triggerKind===void 0||s.triggerKind===ss.Invoked||s.triggerKind===ss.Automatic)}i.is=t})(Xc||(Xc={}));var Yc;(function(i){function e(n,s,r){let o={title:n},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Cn.is(s)?o.command=s:o.edit=s,a&&r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return s&&m.string(s.title)&&(s.diagnostics===void 0||m.typedArray(s.diagnostics,ns.is))&&(s.kind===void 0||m.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Cn.is(s.command))&&(s.isPreferred===void 0||m.boolean(s.isPreferred))&&(s.edit===void 0||oo.is(s.edit))}i.is=t})(Yc||(Yc={}));var Qc;(function(i){function e(n,s){let r={range:n};return m.defined(s)&&(r.data=s),r}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.command)||Cn.is(s.command))}i.is=t})(Qc||(Qc={}));var Kc;(function(i){function e(n,s){return{tabSize:n,insertSpaces:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.uinteger(s.tabSize)&&m.boolean(s.insertSpaces)}i.is=t})(Kc||(Kc={}));var el;(function(i){function e(n,s,r){return{range:n,target:s,data:r}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.target)||m.string(s.target))}i.is=t})(el||(el={}));var tl;(function(i){function e(n,s){return{range:n,parent:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(s.parent===void 0||i.is(s.parent))}i.is=t})(tl||(tl={}));var nl;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(nl||(nl={}));var il;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(il||(il={}));var sl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(sl||(sl={}));var rl;(function(i){function e(n,s){return{range:n,text:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.string(s.text)}i.is=t})(rl||(rl={}));var ol;(function(i){function e(n,s,r){return{range:n,variableName:s,caseSensitiveLookup:r}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.boolean(s.caseSensitiveLookup)&&(m.string(s.variableName)||s.variableName===void 0)}i.is=t})(ol||(ol={}));var al;(function(i){function e(n,s){return{range:n,expression:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&(m.string(s.expression)||s.expression===void 0)}i.is=t})(al||(al={}));var cl;(function(i){function e(n,s){return{frameId:n,stoppedLocation:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(n.stoppedLocation)}i.is=t})(cl||(cl={}));var lo;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(lo||(lo={}));var uo;(function(i){function e(n){return{value:n}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.location===void 0||ts.is(s.location))&&(s.command===void 0||Cn.is(s.command))}i.is=t})(uo||(uo={}));var ll;(function(i){function e(n,s,r){let o={position:n,label:s};return r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.position)&&(m.string(s.label)||m.typedArray(s.label,uo.is))&&(s.kind===void 0||lo.is(s.kind))&&s.textEdits===void 0||m.typedArray(s.textEdits,Tn.is)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.paddingLeft===void 0||m.boolean(s.paddingLeft))&&(s.paddingRight===void 0||m.boolean(s.paddingRight))}i.is=t})(ll||(ll={}));var ul;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(ul||(ul={}));var hl;(function(i){function e(t,n,s,r){return{insertText:t,filterText:n,range:s,command:r}}i.create=e})(hl||(hl={}));var dl;(function(i){function e(t){return{items:t}}i.create=e})(dl||(dl={}));var fl;(function(i){i.Invoked=0,i.Automatic=1})(fl||(fl={}));var pl;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(pl||(pl={}));var ml;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(ml||(ml={}));var gl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&Qr.is(n.uri)&&m.string(n.name)}i.is=e})(gl||(gl={}));var yl;(function(i){function e(r,o,a,c){return new ho(r,o,a,c)}i.create=e;function t(r){let o=r;return!!(m.defined(o)&&m.string(o.uri)&&(m.undefined(o.languageId)||m.string(o.languageId))&&m.uinteger(o.lineCount)&&m.func(o.getText)&&m.func(o.positionAt)&&m.func(o.offsetAt))}i.is=t;function n(r,o){let a=r.getText(),c=s(o,(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],p=r.offsetAt(d.range.start),f=r.offsetAt(d.range.end);if(f<=l)a=a.substring(0,p)+d.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=p}return a}i.applyEdits=n;function s(r,o){if(r.length<=1)return r;let a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);s(c,o),s(l,o);let u=0,d=0,p=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?r[p++]=c[u++]:r[p++]=l[d++];for(;u<c.length;)r[p++]=c[u++];for(;d<l.length;)r[p++]=l[d++];return r}})(yl||(yl={}));var ho=class{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let s=0;s<t.length;s++){n&&(e.push(s),n=!1);let r=t.charAt(s);n=r==="\r"||r===`
|
|
53
53
|
`,r==="\r"&&s+1<t.length&&t.charAt(s+1)===`
|
|
54
|
-
`&&s++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,s=t.length;if(s===0)return Ve.create(0,e);for(;n<s;){let o=Math.floor((n+s)/2);t[o]>e?s=o:n=o+1}let r=n-1;return Ve.create(r,e-t[r])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,s),n)}get lineCount(){return this.getLineOffsets().length}},m;(function(i){let e=Object.prototype.toString;function t(f){return typeof f<"u"}i.defined=t;function n(f){return typeof f>"u"}i.undefined=n;function s(f){return f===!0||f===!1}i.boolean=s;function r(f){return e.call(f)==="[object String]"}i.string=r;function o(f){return e.call(f)==="[object Number]"}i.number=o;function a(f,w,g){return e.call(f)==="[object Number]"&&w<=f&&f<=g}i.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}i.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}i.uinteger=l;function u(f){return e.call(f)==="[object Function]"}i.func=u;function d(f){return f!==null&&typeof f=="object"}i.objectLiteral=d;function p(f,w){return Array.isArray(f)&&f.every(w)}i.typedArray=p})(m||(m={}));var _f=require.resolve("devicetree-language-server/dist/server.js"),mo=class{constructor(e,t,n,s,r){this.poolSize=e;this.cwd=t;this.includesPaths=n;this.bindings=s;this.logLevel=r;this.workers=[];this.queue=[]}async initialize(){let e=[];for(let t=0;t<this.poolSize;t++)e.push(this.createWorker(t));await Promise.all(e)}async createWorker(e){let t=
|
|
54
|
+
`&&s++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,s=t.length;if(s===0)return Ve.create(0,e);for(;n<s;){let o=Math.floor((n+s)/2);t[o]>e?s=o:n=o+1}let r=n-1;return Ve.create(r,e-t[r])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,s),n)}get lineCount(){return this.getLineOffsets().length}},m;(function(i){let e=Object.prototype.toString;function t(f){return typeof f<"u"}i.defined=t;function n(f){return typeof f>"u"}i.undefined=n;function s(f){return f===!0||f===!1}i.boolean=s;function r(f){return e.call(f)==="[object String]"}i.string=r;function o(f){return e.call(f)==="[object Number]"}i.number=o;function a(f,w,g){return e.call(f)==="[object Number]"&&w<=f&&f<=g}i.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}i.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}i.uinteger=l;function u(f){return e.call(f)==="[object Function]"}i.func=u;function d(f){return f!==null&&typeof f=="object"}i.objectLiteral=d;function p(f,w){return Array.isArray(f)&&f.every(w)}i.typedArray=p})(m||(m={}));var _f=require.resolve("devicetree-language-server/dist/server.js"),mo=class{constructor(e,t,n,s,r){this.poolSize=e;this.cwd=t;this.includesPaths=n;this.bindings=s;this.logLevel=r;this.workers=[];this.queue=[]}async initialize(){let e=[];for(let t=0;t<this.poolSize;t++)e.push(this.createWorker(t));await Promise.all(e)}async createWorker(e){let t=bl.default.spawn(process.execPath,[_f,"--stdio"],{stdio:["pipe","pipe","pipe"]});t.stderr.on("data",o=>{this.logLevel==="verbose"&&console.error(`LSP Worker ${e} stderr:`,o.toString())});let n=(0,xl.createMessageConnection)(new rs.StreamMessageReader(t.stdout),new rs.StreamMessageWriter(t.stdin));this.logLevel==="verbose"&&n.onNotification("window/logMessage",o=>{let c={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[o.type]||"LOG";ie("info",`[LSP Worker ${e} ${c}] ${o.message}`)}),n.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${this.cwd}`,name:"root"}]),n.listen(),n.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:this.includesPaths,defaultBindingType:"Zephyr",defaultZephyrBindings:this.bindings,cwd:this.cwd,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[],disableFileWatchers:!0}}});let s=[{uri:go(this.cwd),name:"root"}];await n.sendRequest("initialize",{processId:process.pid,rootUri:go(this.cwd),capabilities:{},workspaceFolders:s}),await n.sendNotification("initialized");let r={id:e,process:t,connection:n,busy:!1};this.workers.push(r)}async getAvailableWorker(){return new Promise(e=>{let t=this.workers.find(n=>!n.busy);t?(t.busy=!0,e(t)):this.queue.push(()=>{let n=this.workers.find(s=>!s.busy);n&&(n.busy=!0,e(n))})})}releaseWorker(e){e.busy=!1;let t=this.queue.shift();t&&t()}async dispose(){for(let e of this.workers)e.connection.dispose(),e.process.kill();this.workers=[]}};function go(i){let e=_l.default.resolve(i);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function xf(){let i=process.env;return!!(i.CI&&(i.GITHUB_ACTIONS||i.GITLAB_CI||i.BITBUCKET_BUILD_NUMBER||i.CIRCLECI||i.TRAVIS))}var Sf=Y.object({file:Y.array(Y.string().optional()).optional(),cwd:Y.string().optional(),include:Y.array(Y.string()).optional().default([]),binding:Y.array(Y.string()).optional().default([]),logLevel:Y.enum(["none","verbose"]).optional().default("none"),format:Y.boolean().optional().default(!1),formatFixAll:Y.boolean().optional().default(!1),processIncludes:Y.boolean().optional().default(!1),diagnostics:Y.boolean().optional().default(!1),diagnosticsFull:Y.boolean().optional().default(!1),showInfoDiagnostics:Y.boolean().optional().default(!1),patchFile:Y.string().optional(),outputFormat:Y.enum(["auto","pretty","annotations","json"]).optional().default("auto"),threads:Y.number().int().min(1).optional().default(1),version:Y.boolean().optional().default(!1),help:Y.boolean().optional().default(!1)}),yo=`Usage: dts-linter [options]
|
|
55
55
|
|
|
56
56
|
Options:
|
|
57
57
|
--file List of input files (can be repeated).
|
|
58
58
|
--cwd <path> Set the current working directory.
|
|
59
|
-
--
|
|
60
|
-
--
|
|
59
|
+
--include Paths (absolute or relative to CWD) to resolve includes (default: []).
|
|
60
|
+
--binding Zephyr binding root directories (default: []).
|
|
61
61
|
--logLevel <none|verbose> Set the logging verbosity (default: none).
|
|
62
62
|
--format Format the files specified in --file (default: false).
|
|
63
63
|
--formatFixAll Apply formatting changes directly to the files (default: false).
|
|
@@ -72,16 +72,16 @@ Options:
|
|
|
72
72
|
--help Show help information (default: false).
|
|
73
73
|
|
|
74
74
|
Example:
|
|
75
|
-
dts-linter --file file1.dts --file file2.dtsi --format --diagnostics --threads 4`,se;try{let{values:i}=(0,
|
|
75
|
+
dts-linter --file file1.dts --file file2.dtsi --format --diagnostics --threads 4`,se;try{let{values:i}=(0,Sl.parseArgs)({options:{file:{type:"string",multiple:!0},cwd:{type:"string"},include:{type:"string",multiple:!0},binding:{type:"string",multiple:!0},logLevel:{type:"string"},format:{type:"boolean"},formatFixAll:{type:"boolean"},processIncludes:{type:"boolean"},diagnostics:{type:"boolean"},diagnosticsFull:{type:"boolean"},showInfoDiagnostics:{type:"boolean"},patchFile:{type:"string"},outputFormat:{type:"string"},threads:{type:"string"},version:{type:"boolean"},help:{type:"boolean"}},strict:!0}),e={...i,threads:i.threads?parseInt(i.threads,10):void 0},t=Sf.safeParse(e);t.success||(console.log(yo),process.exit(1)),se=t.data}catch{console.log(yo),process.exit(1)}se.help&&(console.log("Invalid arguments"),console.log(yo),process.exit(0));se.version&&(console.log(`${Yr.name} version ${Yr.version}`),process.exit(0));var kf=se.include,Ef=se.binding,Cf=se.logLevel,kl=se.formatFixAll,El=se.format||kl,ri=se.diagnosticsFull,fo=se.diagnostics||ri,Tf=se.showInfoDiagnostics,po=se.processIncludes||ri,Ze=se.outputFormat,wo=se.patchFile,Rf=se.threads,ct=xf()&&Ze==="auto"||Ze==="annotations",Of=()=>ct?"::group::":"",Af=()=>ct?"::endgroup::":"",Nf=i=>ct?`file=${(0,Pe.relative)(Ce,i)}`:(0,Pe.relative)(Ce,i),Pf=(i,e)=>ct?`line=${i}${e?`,col=${e}`:""}`:`line: ${i} ${e?`col=${e}`:""}`,jf=(i,e)=>ct?`endLine=${i}${e?`,endColumn=${e}`:""}`:`endLine: ${i} ${e?`endColumn=${e}`:""}`,Mf=ct?",":" ",Lf=i=>{switch(i){case"error":return"::error";case"warn":return"::warning";case"info":return"::notice"}},If=(i,e,t,n,s,r)=>{let o=[t?`file=${t}`:null,s?`line=${s.line}`:null,s?.col?`col=${s.col}`:null,r?`endLine=${r.line}`:null,r?.col?`endColumn=${r.col}`:null,n?`title=${n}`:null].filter(a=>!!a);console.log(`${Lf(i)} ${o.join(",")}::${e}`)},ie=(i,e,t,n,s,r,o,a)=>{if(Ze==="json"){Cl.issues.push({level:i,message:e.trim(),file:t?(0,Pe.relative)(Ce,t.trim()):void 0,title:n?.trim(),startLine:s?.line,startCol:s?.col,endLine:r?.line,endCol:r?.col});return}if(ct){If(i,e,t?(0,Pe.relative)(Ce,t):void 0,n,s,r);return}if(i==="info"){console.log(`\u2705 ${o??""}${a??""} ${e}`);return}console.log(`${i==="error"?"\u274C":"\u26A0\uFE0F"} ${o??""}${a??""} ${[t?Nf(t):void 0,s?Pf(s.line,s.col):void 0,r?jf(r.line,r.col):void 0,e].filter(c=>!!c).join(Mf)}`)},Ce=se.cwd??process.cwd(),Cl={cwd:Ce,issues:[]};se.file||(ie("info",`Searching for '**/*.{dts,dtsi,overlay}' in ${Ce}`),se.file=Qi(ri?"**/*.{dts}":"**/*.{dts,dtsi,overlay}",{cwd:se.cwd,nodir:!0}));var _o=se.file.filter(i=>i).map(i=>(0,Pe.resolve)(Ce,i));var lg=_o.length,si=new Map,Jt=[],On=[],Et=new Map,kt=new Set,wl=new Set;$f().catch(i=>{console.error("Error validating files:",i),process.exit(1)});var vl=(i=fe.Hint)=>{switch(i){case fe.Error:return"error";case fe.Warning:return"warn";case fe.Information:return"info";case fe.Hint:return"hint"}};async function Df(i,e,t,n){let s=Ct.default.readFileSync(e,"utf8"),r={uri:go(e),languageId:"devicetree",version:0,text:s},o=[e],a;(fo||po)&&(i.connection.sendNotification("textDocument/didOpen",{textDocument:r}),a=await zf(i.connection),o=[...vo(a.mainDtsPath),...a.overlays.flatMap(vo)].filter(u=>!u.endsWith(".h")&&(0,Ct.existsSync)(u)&&(po||_o.includes(u))));let c=u=>u===e,l=(u,d)=>u?`[${t}/${n}]`:`[${d}/${o.length-1}]`.padEnd((o.length-1).toString().length*2+3," ");El&&await Promise.all(o.map(async(u,d)=>{let p=c(u),f=l(p,d);try{await Ff(i.connection,u,p,f,p?s:Ct.default.readFileSync(u,"utf8"),a)}catch(w){if(Jt.push({file:u,context:a}),Ze==="json")w?.data?.map(g=>{ie("error",g.message,u,"Syntax error.",{line:g.range.start.line+1,col:g.range.start.character},{line:g.range.end.line+1,col:g.range.end.character})});else{let g=w?.data?.map(k=>`[${vl(k.severity)}] ${k.message}: ${JSON.stringify(k.range.start)}-${JSON.stringify(k.range.end)}`).join(`
|
|
76
76
|
`)??"";ie("error",`
|
|
77
|
-
${g}`,u,"
|
|
78
|
-
`)}))}else bo.add(u),ie("warn","Check can only be done on full context!",u,void 0,void 0,void 0,`${p?"":" "}`,l(p,d));
|
|
77
|
+
${g}`,u,"Syntax error.",void 0,void 0,f)}}kt.add(u)})),fo&&a&&await Promise.all(o.map(async(u,d)=>{let p=c(u);if(e.endsWith(".dts")||!ri){let f=await Wf(i.connection,u,p,l(p,d),(0,Pe.relative)(Ce,e));f?.length&&(Et.has(u)||Et.set(u,[]),Et.get(u)?.push({maxSeverity:f.reduce((w,g)=>(g.severity??fe.Hint)<w?g.severity??fe.Hint:w,fe.Hint),context:a,message:f.map(w=>`[${vl(w.severity)}] ${w.message}: ${JSON.stringify(w.range.start)}-${JSON.stringify(w.range.end)}`).join(`
|
|
78
|
+
`)}))}else bo.add(u),ie("warn","Check can only be done on full context!",u,void 0,void 0,void 0,`${p?"":" "}`,l(p,d));kt.add(u)})),(fo||po)&&(i.connection.sendNotification("textDocument/didClose",{textDocument:{uri:`file://${e}`}}),await qf(i.connection)),kl&&o.filter(u=>!wl.has(u)).forEach(u=>{let d=si.get(u);if(d){let p=Rr(Ct.default.readFileSync(u,"utf8"),d);p?(wl.add(u),Ct.default.writeFileSync(u,p,"utf8"),On.push({file:u,context:a})):ie("error","Failed to apply changes to file",u)}})}async function $f(){let i=new mo(Rf,Ce,kf,Ef,Cf);await i.initialize();let e=Array.from(new Set(_o)).sort((n,s)=>{let r=o=>o.endsWith(".dts")?0:o.endsWith(".dtsi")?1:2;return r(n)-r(s)}),t=e.map(async(n,s)=>{let r=await i.getAvailableWorker();await Df(r,n,s+1,e.length).finally(()=>{i.releaseWorker(r)})});if(await Promise.all(t),wo&&Ct.default.writeFileSync(wo,Array.from(si.values()).join(`
|
|
79
79
|
|
|
80
|
-
`)),await i.dispose(),Ze==="json")await new Promise(n=>{process.stdout.write(JSON.stringify(
|
|
80
|
+
`)),await i.dispose(),Ze==="json")await new Promise(n=>{process.stdout.write(JSON.stringify(Cl,void 0,4),()=>n())});else if(ie("info",`Processed ${kt.size} files`),El&&!ct&&(Jt.length-On.length&&ie("error",`${Jt.length-On.length} of ${kt.size} Failed formatting checks`),On.length&&ie("info",`${On.length} of ${Jt.length} formatted in place.`),Jt.length||ie("info","All files passed formatting")),Et.size){(Ze==="pretty"||Ze==="auto")&&(console.log("Diagnostic issues summary"),console.log(Array.from(Et.entries()).flatMap(([r,o])=>`${Of()}File: ${(0,Pe.relative)(Ce,r)}
|
|
81
81
|
${o.flatMap(a=>`Board File: ${(0,Pe.relative)(Ce,a.context.mainDtsPath.file)}
|
|
82
82
|
Issues:
|
|
83
|
-
${a.message}`).join(`
|
|
83
|
+
${a.message.replaceAll("[error]","[err]")}`).join(`
|
|
84
84
|
`)}
|
|
85
85
|
${Af()}`).join(`
|
|
86
|
-
`)),ie("error",`${
|
|
86
|
+
`)),ie("error",`${Et.size} of ${kt.size} file failed diagnostic checks`),bo.size&&ie("warn",`${bo.size} of ${kt.size} Skipped diagnostic checks`));let n=Array.from(Et).filter(r=>r[1].some(o=>o.maxSeverity<=fe.Warning)),s=!!n.length;Tl.size===kt.size&&!s?ie("info","All files passed diagnostic checks"):ie("error",`${n.length} of ${kt.size} Failed diagnostic checks`)}process.exit(Jt.length-On.length||Et.size?1:0)}var vo=i=>[i.file,...i.includes.flatMap(e=>vo(e))],Ff=async(i,e,t,n,s,r)=>{let o={textDocument:{uri:`file://${e}`},options:{tabSize:8,insertSpaces:!1,trimTrailingWhitespace:!0,insertFinalNewline:!0,trimFinalNewlines:!0},text:s},a=await i.sendRequest("devicetree/formattingText",o),c=t?"":" ";if(a&&a.text!==s){let l=a?.text,u=(0,Pe.relative)(Ce,e),d=Ar(`a/${u}`,s,l);return ie("error",d,e,"Not correctly formatted.",void 0,void 0,c,n),(Ze==="json"||Ze==="annotations")&&a.diagnostics.forEach(p=>{ie("error",p.message,e,void 0,{line:p.range.start.line+1,col:p.range.start.character},{line:p.range.end.line+1,col:p.range.end.character})}),si.has(e)?si.get(e)!==d&&wo&&ie("warn","Multiple diffs for the same file. This diff will not be in the generated file!",e,void 0,void 0,void 0,c,n):(Jt.push({file:e,context:r}),si.set(e,d)),d}else ie("info",`${(0,Pe.relative)(Ce,e)} is correctly formatted`,void 0,void 0,void 0,void 0,c,n)},Tl=new Set,bo=new Set,Wf=async(i,e,t,n,s)=>{Tl.add(e);let r=(await i.sendRequest("devicetree/diagnosticIssues",{uri:`file://${e}`,full:ri})??[]).filter(a=>a.severity===fe.Error||a.severity===fe.Warning||a.severity===fe.Information&&Tf),o=t?"":" ";if(r.length)return r.forEach((a,c)=>ie(a.severity===fe.Error?"error":(a.severity===fe.Warning,"warn"),Ze==="json"?`Board File: ${s}: ${a.message}`:a.message,ct||Ze==="json"?e:c?" ":`${e}
|
|
87
87
|
${o} `,void 0,{line:a.range.start.line+1,col:a.range.start.character},{line:a.range.end.line+1,col:a.range.end.character},o,c?"":n)),r;ie("info",`No diagnostic errors in ${(0,Pe.relative)(Ce,e)}`,void 0,void 0,void 0,void 0,o,n)};function zf(i,e=6e4){return new Promise((t,n)=>{let s=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/newActiveContext")),r.dispose()},e),r=i.onNotification("devicetree/newActiveContext",o=>{clearTimeout(s),t(o),r.dispose()})})}function qf(i,e=5e3){return new Promise((t,n)=>{let s=setTimeout(()=>{n(new Error("Timed out waiting for devicetree/contextDeleted")),r.dispose()},e),r=i.onNotification("devicetree/contextDeleted",()=>{clearTimeout(s),t(),r.dispose()})})}
|