@netlify/agent-runner-cli 1.172.0-model-default-effort.0 → 1.172.1-model-default-effort.0
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/bin-local.js +27 -27
- package/dist/bin.js +33 -33
- package/dist/index.js +27 -27
- package/package.json +1 -1
package/dist/bin-local.js
CHANGED
|
@@ -4,7 +4,7 @@ var q0e=Object.create;var ST=Object.defineProperty;var V0e=Object.getOwnProperty
|
|
|
4
4
|
for call at
|
|
5
5
|
${e}`;return Object.assign(new Error(r),t,{stack:i})}var Y$=class extends ONe.EventEmitter{constructor(){super()}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Cy.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}};_o.ClientUnaryCallImpl=Y$;var K$=class extends X$.Readable{constructor(e){super({objectMode:!0}),this.deserialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Cy.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}};_o.ClientReadableStreamImpl=K$;var Z$=class extends X$.Writable{constructor(e){super({objectMode:!0}),this.serialize=e}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Cy.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_write(e,r,n){var i;let o={callback:n},s=Number(r);Number.isNaN(s)||(o.flags=s),(i=this.call)===null||i===void 0||i.sendMessageWithContext(o,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};_o.ClientWritableStreamImpl=Z$;var J$=class extends X$.Duplex{constructor(e,r){super({objectMode:!0}),this.serialize=e,this.deserialize=r}cancel(){var e;(e=this.call)===null||e===void 0||e.cancelWithStatus(Cy.Status.CANCELLED,"Cancelled on client")}getPeer(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:"unknown"}getAuthContext(){var e,r;return(r=(e=this.call)===null||e===void 0?void 0:e.getAuthContext())!==null&&r!==void 0?r:null}_read(e){var r;(r=this.call)===null||r===void 0||r.startRead()}_write(e,r,n){var i;let o={callback:n},s=Number(r);Number.isNaN(s)||(o.flags=s),(i=this.call)===null||i===void 0||i.sendMessageWithContext(o,e)}_final(e){var r;(r=this.call)===null||r===void 0||r.halfClose(),e()}};_o.ClientDuplexStreamImpl=J$});var zu=y(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.InterceptingListenerImpl=void 0;Fu.statusOrFromValue=MNe;Fu.statusOrFromError=$Ne;Fu.isInterceptingListener=DNe;var kNe=Rr();function MNe(t){return{ok:!0,value:t}}function $Ne(t){var e;return{ok:!1,error:Object.assign(Object.assign({},t),{metadata:(e=t.metadata)!==null&&e!==void 0?e:new kNe.Metadata})}}function DNe(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var Q$=class{constructor(e,r){this.listener=e,this.nextListener=r,this.processingMetadata=!1,this.hasPendingMessage=!1,this.processingMessage=!1,this.pendingStatus=null}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingStatus(){this.pendingStatus&&this.nextListener.onReceiveStatus(this.pendingStatus)}onReceiveMetadata(e){this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}onReceiveMessage(e){this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingStatus())})}onReceiveStatus(e){this.listener.onReceiveStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextListener.onReceiveStatus(r)})}};Fu.InterceptingListenerImpl=Q$});var sD=y(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.InterceptingCall=yo.RequesterBuilder=yo.ListenerBuilder=yo.InterceptorConfigurationError=void 0;yo.getInterceptingCall=zNe;var LNe=Rr(),lQ=zu(),uQ=Xe(),dQ=SA(),Py=class t extends Error{constructor(e){super(e),this.name="InterceptorConfigurationError",Error.captureStackTrace(this,t)}};yo.InterceptorConfigurationError=Py;var tD=class{constructor(){this.metadata=void 0,this.message=void 0,this.status=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveStatus(e){return this.status=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveStatus:this.status}}};yo.ListenerBuilder=tD;var rD=class{constructor(){this.start=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withStart(e){return this.start=e,this}withSendMessage(e){return this.message=e,this}withHalfClose(e){return this.halfClose=e,this}withCancel(e){return this.cancel=e,this}build(){return{start:this.start,sendMessage:this.message,halfClose:this.halfClose,cancel:this.cancel}}};yo.RequesterBuilder=rD;var eD={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveStatus:(t,e)=>{e(t)}},Iy={start:(t,e,r)=>{r(t,e)},sendMessage:(t,e)=>{e(t)},halfClose:t=>{t()},cancel:t=>{t()}},nD=class{constructor(e,r){var n,i,o,s;this.nextCall=e,this.processingMetadata=!1,this.pendingMessageContext=null,this.processingMessage=!1,this.pendingHalfClose=!1,r?this.requester={start:(n=r.start)!==null&&n!==void 0?n:Iy.start,sendMessage:(i=r.sendMessage)!==null&&i!==void 0?i:Iy.sendMessage,halfClose:(o=r.halfClose)!==null&&o!==void 0?o:Iy.halfClose,cancel:(s=r.cancel)!==null&&s!==void 0?s:Iy.cancel}:this.requester=Iy}cancelWithStatus(e,r){this.requester.cancel(()=>{this.nextCall.cancelWithStatus(e,r)})}getPeer(){return this.nextCall.getPeer()}processPendingMessage(){this.pendingMessageContext&&(this.nextCall.sendMessageWithContext(this.pendingMessageContext,this.pendingMessage),this.pendingMessageContext=null,this.pendingMessage=null)}processPendingHalfClose(){this.pendingHalfClose&&this.nextCall.halfClose()}start(e,r){var n,i,o,s,a,c;let l={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:(u=>{}),onReceiveMessage:(s=(o=r?.onReceiveMessage)===null||o===void 0?void 0:o.bind(r))!==null&&s!==void 0?s:(u=>{}),onReceiveStatus:(c=(a=r?.onReceiveStatus)===null||a===void 0?void 0:a.bind(r))!==null&&c!==void 0?c:(u=>{})};this.processingMetadata=!0,this.requester.start(e,l,(u,d)=>{var f,p,h;this.processingMetadata=!1;let m;if((0,lQ.isInterceptingListener)(d))m=d;else{let g={onReceiveMetadata:(f=d.onReceiveMetadata)!==null&&f!==void 0?f:eD.onReceiveMetadata,onReceiveMessage:(p=d.onReceiveMessage)!==null&&p!==void 0?p:eD.onReceiveMessage,onReceiveStatus:(h=d.onReceiveStatus)!==null&&h!==void 0?h:eD.onReceiveStatus};m=new lQ.InterceptingListenerImpl(g,l)}this.nextCall.start(u,m),this.processPendingMessage(),this.processPendingHalfClose()})}sendMessageWithContext(e,r){this.processingMessage=!0,this.requester.sendMessage(r,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessageContext=e,this.pendingMessage=r):(this.nextCall.sendMessageWithContext(e,n),this.processPendingHalfClose())})}sendMessage(e){this.sendMessageWithContext({},e)}startRead(){this.nextCall.startRead()}halfClose(){this.requester.halfClose(()=>{this.processingMetadata||this.processingMessage?this.pendingHalfClose=!0:this.nextCall.halfClose()})}getAuthContext(){return this.nextCall.getAuthContext()}};yo.InterceptingCall=nD;function UNe(t,e,r){var n,i;let o=(n=r.deadline)!==null&&n!==void 0?n:1/0,s=r.host,a=(i=r.parent)!==null&&i!==void 0?i:null,c=r.propagate_flags,l=r.credentials,u=t.createCall(e,o,s,a,c);return l&&u.setCredentials(l),u}var FA=class{constructor(e,r){this.call=e,this.methodDefinition=r}cancelWithStatus(e,r){this.call.cancelWithStatus(e,r)}getPeer(){return this.call.getPeer()}sendMessageWithContext(e,r){let n;try{n=this.methodDefinition.requestSerialize(r)}catch(i){this.call.cancelWithStatus(uQ.Status.INTERNAL,`Request message serialization failure: ${(0,dQ.getErrorMessage)(i)}`);return}this.call.sendMessageWithContext(e,n)}sendMessage(e){this.sendMessageWithContext({},e)}start(e,r){let n=null;this.call.start(e,{onReceiveMetadata:i=>{var o;(o=r?.onReceiveMetadata)===null||o===void 0||o.call(r,i)},onReceiveMessage:i=>{var o;let s;try{s=this.methodDefinition.responseDeserialize(i)}catch(a){n={code:uQ.Status.INTERNAL,details:`Response message parsing error: ${(0,dQ.getErrorMessage)(a)}`,metadata:new LNe.Metadata},this.call.cancelWithStatus(n.code,n.details);return}(o=r?.onReceiveMessage)===null||o===void 0||o.call(r,s)},onReceiveStatus:i=>{var o,s;n?(o=r?.onReceiveStatus)===null||o===void 0||o.call(r,n):(s=r?.onReceiveStatus)===null||s===void 0||s.call(r,i)}})}startRead(){this.call.startRead()}halfClose(){this.call.halfClose()}getAuthContext(){return this.call.getAuthContext()}},iD=class extends FA{constructor(e,r){super(e,r)}start(e,r){var n,i;let o=!1,s={onReceiveMetadata:(i=(n=r?.onReceiveMetadata)===null||n===void 0?void 0:n.bind(r))!==null&&i!==void 0?i:(a=>{}),onReceiveMessage:a=>{var c;o=!0,(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,a)},onReceiveStatus:a=>{var c,l;o||(c=r?.onReceiveMessage)===null||c===void 0||c.call(r,null),(l=r?.onReceiveStatus)===null||l===void 0||l.call(r,a)}};super.start(e,s),this.call.startRead()}},oD=class extends FA{};function FNe(t,e,r){let n=UNe(t,r.path,e);return r.responseStream?new oD(n,r):new iD(n,r)}function zNe(t,e,r,n){if(t.clientInterceptors.length>0&&t.clientInterceptorProviders.length>0)throw new Py("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(t.callInterceptors.length>0&&t.callInterceptorProviders.length>0)throw new Py("Both interceptors and interceptor_providers were passed as call options. Only one of these is allowed.");let i=[];t.callInterceptors.length>0||t.callInterceptorProviders.length>0?i=[].concat(t.callInterceptors,t.callInterceptorProviders.map(a=>a(e))).filter(a=>a):i=[].concat(t.clientInterceptors,t.clientInterceptorProviders.map(a=>a(e))).filter(a=>a);let o=Object.assign({},r,{method_definition:e});return i.reduceRight((a,c)=>l=>c(l,a),a=>FNe(n,a,e))(o)}});var lD=y(jA=>{"use strict";Object.defineProperty(jA,"__esModule",{value:!0});jA.Client=void 0;var fs=cQ(),jNe=uD(),BNe=In(),Lc=Xe(),mp=Rr(),zA=sD(),So=Symbol(),gp=Symbol(),_p=Symbol(),ya=Symbol();function aD(t){return typeof t=="function"}function yp(t){var e;return((e=t.stack)===null||e===void 0?void 0:e.split(`
|
|
6
6
|
`).slice(1).join(`
|
|
7
|
-
`))||"no stack trace available"}var cD=class{constructor(e,r,n={}){var i,o;if(n=Object.assign({},n),this[gp]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[_p]=(o=n.interceptor_providers)!==null&&o!==void 0?o:[],delete n.interceptor_providers,this[gp].length>0&&this[_p].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[ya]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[So]=n.channelOverride;else if(n.channelFactoryOverride){let s=n.channelFactoryOverride;delete n.channelFactoryOverride,this[So]=s(e,r,n)}else this[So]=new jNe.ChannelImplementation(e,r,n)}close(){this[So].close()}getChannel(){return this[So]}waitForReady(e,r){let n=i=>{if(i){r(new Error("Failed to connect before the deadline"));return}let o;try{o=this[So].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(o===BNe.ConnectivityState.READY)r();else try{this[So].watchConnectivityState(o,e,n)}catch{r(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,r,n){if(aD(e))return{metadata:new mp.Metadata,options:{},callback:e};if(aD(r))return e instanceof mp.Metadata?{metadata:e,options:{},callback:r}:{metadata:new mp.Metadata,options:e,callback:r};if(!(e instanceof mp.Metadata&&r instanceof Object&&aD(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:n}}makeUnaryRequest(e,r,n,i,o,s,a){var c,l;let u=this.checkOptionalUnaryResponseArguments(o,s,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:n},f={argument:i,metadata:u.metadata,call:new fs.ClientUnaryCallImpl,channel:this[So],methodDefinition:d,callOptions:u.options,callback:u.callback};this[ya]&&(f=this[ya](f));let p=f.call,h={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},m=(0,zA.getInterceptingCall)(h,f.methodDefinition,f.callOptions,f.channel);p.call=m;let g=null,_=!1,b=new Error;return m.start(f.metadata,{onReceiveMetadata:T=>{p.emit("metadata",T)},onReceiveMessage(T){g!==null&&m.cancelWithStatus(Lc.Status.UNIMPLEMENTED,"Too many responses received"),g=T},onReceiveStatus(T){if(!_){if(_=!0,T.code===Lc.Status.OK)if(g===null){let E=yp(b);f.callback((0,fs.callErrorFromStatus)({code:Lc.Status.UNIMPLEMENTED,details:"No message received",metadata:T.metadata},E))}else f.callback(null,g);else{let E=yp(b);f.callback((0,fs.callErrorFromStatus)(T,E))}b=null,p.emit("status",T)}}}),m.sendMessage(i),m.halfClose(),p}makeClientStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,o,s),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:n},d={metadata:l.metadata,call:new fs.ClientWritableStreamImpl(r),channel:this[So],methodDefinition:u,callOptions:l.options,callback:l.callback};this[ya]&&(d=this[ya](d));let f=d.call,p={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,zA.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=null,g=!1,_=new Error;return h.start(d.metadata,{onReceiveMetadata:b=>{f.emit("metadata",b)},onReceiveMessage(b){m!==null&&h.cancelWithStatus(Lc.Status.UNIMPLEMENTED,"Too many responses received"),m=b,h.startRead()},onReceiveStatus(b){if(!g){if(g=!0,b.code===Lc.Status.OK)if(m===null){let T=yp(_);d.callback((0,fs.callErrorFromStatus)({code:Lc.Status.UNIMPLEMENTED,details:"No message received",metadata:b.metadata},T))}else d.callback(null,m);else{let T=yp(_);d.callback((0,fs.callErrorFromStatus)(b,T))}_=null,f.emit("status",b)}}}),f}checkMetadataAndOptions(e,r){let n,i;return e instanceof mp.Metadata?(n=e,r?i=r:i={}):(e?i=e:i={},n=new mp.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkMetadataAndOptions(o,s),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new fs.ClientReadableStreamImpl(n),channel:this[So],methodDefinition:u,callOptions:l.options};this[ya]&&(d=this[ya](d));let f=d.call,p={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,zA.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=!1,g=new Error;return h.start(d.metadata,{onReceiveMetadata(_){f.emit("metadata",_)},onReceiveMessage(_){f.push(_)},onReceiveStatus(_){if(!m){if(m=!0,f.push(null),_.code!==Lc.Status.OK){let b=yp(g);f.emit("error",(0,fs.callErrorFromStatus)(_,b))}g=null,f.emit("status",_)}}}),h.sendMessage(i),h.halfClose(),f}makeBidiStreamRequest(e,r,n,i,o){var s,a;let c=this.checkMetadataAndOptions(i,o),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:n},u={metadata:c.metadata,call:new fs.ClientDuplexStreamImpl(r,n),channel:this[So],methodDefinition:l,callOptions:c.options};this[ya]&&(u=this[ya](u));let d=u.call,f={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(s=u.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(a=u.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},p=(0,zA.getInterceptingCall)(f,u.methodDefinition,u.callOptions,u.channel);d.call=p;let h=!1,m=new Error;return p.start(u.metadata,{onReceiveMetadata(g){d.emit("metadata",g)},onReceiveMessage(g){d.push(g)},onReceiveStatus(g){if(!h){if(h=!0,d.push(null),g.code!==Lc.Status.OK){let _=yp(m);d.emit("error",(0,fs.callErrorFromStatus)(g,_))}m=null,d.emit("status",g)}}}),d}};jA.Client=cD});var qA=y(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.makeClientConstructor=fQ;BA.loadPackageDefinition=HNe;var Oy=lD(),qNe={unary:Oy.Client.prototype.makeUnaryRequest,server_stream:Oy.Client.prototype.makeServerStreamRequest,client_stream:Oy.Client.prototype.makeClientStreamRequest,bidi:Oy.Client.prototype.makeBidiStreamRequest};function dD(t){return["__proto__","prototype","constructor"].includes(t)}function fQ(t,e,r){r||(r={});class n extends Oy.Client{}return Object.keys(t).forEach(i=>{if(dD(i))return;let o=t[i],s;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");o.requestStream?o.responseStream?s="bidi":s="client_stream":o.responseStream?s="server_stream":s="unary";let a=o.requestSerialize,c=o.responseDeserialize,l=VNe(qNe[s],o.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],o),o.originalName&&!dD(o.originalName)&&(n.prototype[o.originalName]=n.prototype[i])}),n.service=t,n.serviceName=e,n}function VNe(t,e,r,n){return function(...i){return t.call(this,e,r,n,...i)}}function GNe(t){return"format"in t}function HNe(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r],i=r.split(".");if(i.some(a=>dD(a)))continue;let o=i[i.length-1],s=e;for(let a of i.slice(0,-1))s[a]||(s[a]={}),s=s[a];GNe(n)?s[o]=n:s[o]=fQ(n,o,{})}return e}});var LQ=y((Hxt,DQ)=>{"use strict";var WNe=1/0,YNe="[object Symbol]",KNe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ZNe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,GA="\\ud800-\\udfff",EQ="\\u0300-\\u036f\\ufe20-\\ufe23",vQ="\\u20d0-\\u20f0",bQ="\\u2700-\\u27bf",TQ="a-z\\xdf-\\xf6\\xf8-\\xff",JNe="\\xac\\xb1\\xd7\\xf7",XNe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",QNe="\\u2000-\\u206f",eke=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wQ="A-Z\\xc0-\\xd6\\xd8-\\xde",AQ="\\ufe0e\\ufe0f",xQ=JNe+XNe+QNe+eke,pD="['\u2019]",tke="["+GA+"]",pQ="["+xQ+"]",VA="["+EQ+vQ+"]",RQ="\\d+",rke="["+bQ+"]",CQ="["+TQ+"]",IQ="[^"+GA+xQ+RQ+bQ+TQ+wQ+"]",fD="\\ud83c[\\udffb-\\udfff]",nke="(?:"+VA+"|"+fD+")",PQ="[^"+GA+"]",hD="(?:\\ud83c[\\udde6-\\uddff]){2}",mD="[\\ud800-\\udbff][\\udc00-\\udfff]",Sp="["+wQ+"]",OQ="\\u200d",hQ="(?:"+CQ+"|"+IQ+")",ike="(?:"+Sp+"|"+IQ+")",mQ="(?:"+pD+"(?:d|ll|m|re|s|t|ve))?",gQ="(?:"+pD+"(?:D|LL|M|RE|S|T|VE))?",NQ=nke+"?",kQ="["+AQ+"]?",oke="(?:"+OQ+"(?:"+[PQ,hD,mD].join("|")+")"+kQ+NQ+")*",MQ=kQ+NQ+oke,ske="(?:"+[rke,hD,mD].join("|")+")"+MQ,ake="(?:"+[PQ+VA+"?",VA,hD,mD,tke].join("|")+")",cke=RegExp(pD,"g"),lke=RegExp(VA,"g"),uke=RegExp(fD+"(?="+fD+")|"+ake+MQ,"g"),dke=RegExp([Sp+"?"+CQ+"+"+mQ+"(?="+[pQ,Sp,"$"].join("|")+")",ike+"+"+gQ+"(?="+[pQ,Sp+hQ,"$"].join("|")+")",Sp+"?"+hQ+"+"+mQ,Sp+"+"+gQ,RQ,ske].join("|"),"g"),fke=RegExp("["+OQ+GA+EQ+vQ+AQ+"]"),pke=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hke={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},mke=typeof global=="object"&&global&&global.Object===Object&&global,gke=typeof self=="object"&&self&&self.Object===Object&&self,_ke=mke||gke||Function("return this")();function yke(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function Ske(t){return t.split("")}function Eke(t){return t.match(KNe)||[]}function vke(t){return function(e){return t?.[e]}}var bke=vke(hke);function $Q(t){return fke.test(t)}function Tke(t){return pke.test(t)}function wke(t){return $Q(t)?Ake(t):Ske(t)}function Ake(t){return t.match(uke)||[]}function xke(t){return t.match(dke)||[]}var Rke=Object.prototype,Cke=Rke.toString,_Q=_ke.Symbol,yQ=_Q?_Q.prototype:void 0,SQ=yQ?yQ.toString:void 0;function Ike(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function Pke(t){if(typeof t=="string")return t;if($ke(t))return SQ?SQ.call(t):"";var e=t+"";return e=="0"&&1/t==-WNe?"-0":e}function Oke(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:Ike(t,e,r)}function Nke(t){return function(e){e=HA(e);var r=$Q(e)?wke(e):void 0,n=r?r[0]:e.charAt(0),i=r?Oke(r,1).join(""):e.slice(1);return n[t]()+i}}function kke(t){return function(e){return yke(zke(Uke(e).replace(cke,"")),t,"")}}function Mke(t){return!!t&&typeof t=="object"}function $ke(t){return typeof t=="symbol"||Mke(t)&&Cke.call(t)==YNe}function HA(t){return t==null?"":Pke(t)}var Dke=kke(function(t,e,r){return e=e.toLowerCase(),t+(r?Lke(e):e)});function Lke(t){return Fke(HA(t).toLowerCase())}function Uke(t){return t=HA(t),t&&t.replace(ZNe,bke).replace(lke,"")}var Fke=Nke("toUpperCase");function zke(t,e,r){return t=HA(t),e=r?void 0:e,e===void 0?Tke(t)?xke(t):Eke(t):t.match(e)||[]}DQ.exports=Dke});var gD=y((Wxt,UQ)=>{"use strict";UQ.exports=jke;function jke(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(a,c){r[n]=function(u){if(o)if(o=!1,u)c(u);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];a.apply(null,d)}};try{t.apply(e||null,r)}catch(l){o&&(o=!1,c(l))}})}});var BQ=y(jQ=>{"use strict";var WA=jQ;WA.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var Ep=new Array(64),zQ=new Array(123);for(Eo=0;Eo<64;)zQ[Ep[Eo]=Eo<26?Eo+65:Eo<52?Eo+71:Eo<62?Eo-4:Eo-59|43]=Eo++;var Eo;WA.encode=function(e,r,n){for(var i=null,o=[],s=0,a=0,c;r<n;){var l=e[r++];switch(a){case 0:o[s++]=Ep[l>>2],c=(l&3)<<4,a=1;break;case 1:o[s++]=Ep[c|l>>4],c=(l&15)<<2,a=2;break;case 2:o[s++]=Ep[c|l>>6],o[s++]=Ep[l&63],a=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=Ep[c],o[s++]=61,a===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var FQ="invalid encoding";WA.decode=function(e,r,n){for(var i=n,o=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&o>1)break;if((c=zQ[c])===void 0)throw Error(FQ);switch(o){case 0:s=c,o=1;break;case 1:r[n++]=s<<2|(c&48)>>4,s=c,o=2;break;case 2:r[n++]=(s&15)<<4|(c&60)>>2,s=c,o=3;break;case 3:r[n++]=(s&3)<<6|c,o=0;break}}if(o===1)throw Error(FQ);return n-i};WA.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var VQ=y((Kxt,qQ)=>{"use strict";qQ.exports=YA;function YA(){this._listeners=Object.create(null)}YA.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};YA.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i}return this};YA.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var JQ=y((Zxt,ZQ)=>{"use strict";ZQ.exports=GQ(GQ);function GQ(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3]}function o(c,l,u){e[0]=c,l[u]=r[3],l[u+1]=r[2],l[u+2]=r[1],l[u+3]=r[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],e[0]}function a(c,l){return r[3]=c[l],r[2]=c[l+1],r[1]=c[l+2],r[0]=c[l+3],e[0]}t.readFloatLE=n?s:a,t.readFloatBE=n?a:s})():(function(){function e(n,i,o,s){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|l)>>>0,o,s)}}t.writeFloatLE=e.bind(null,HQ),t.writeFloatBE=e.bind(null,WQ);function r(n,i,o){var s=n(i,o),a=(s>>31)*2+1,c=s>>>23&255,l=s&8388607;return c===255?l?NaN:a*(1/0):c===0?a*1401298464324817e-60*l:a*Math.pow(2,c-150)*(l+8388608)}t.readFloatLE=r.bind(null,YQ),t.readFloatBE=r.bind(null,KQ)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3],l[u+4]=r[4],l[u+5]=r[5],l[u+6]=r[6],l[u+7]=r[7]}function o(c,l,u){e[0]=c,l[u]=r[7],l[u+1]=r[6],l[u+2]=r[5],l[u+3]=r[4],l[u+4]=r[3],l[u+5]=r[2],l[u+6]=r[1],l[u+7]=r[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],r[4]=c[l+4],r[5]=c[l+5],r[6]=c[l+6],r[7]=c[l+7],e[0]}function a(c,l){return r[7]=c[l],r[6]=c[l+1],r[5]=c[l+2],r[4]=c[l+3],r[3]=c[l+4],r[2]=c[l+5],r[1]=c[l+6],r[0]=c[l+7],e[0]}t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s})():(function(){function e(n,i,o,s,a,c){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,a,c+i),n(1/s>0?0:2147483648,a,c+o);else if(isNaN(s))n(0,a,c+i),n(2146959360,a,c+o);else if(s>17976931348623157e292)n(0,a,c+i),n((l<<31|2146435072)>>>0,a,c+o);else{var u;if(s<22250738585072014e-324)u=s/5e-324,n(u>>>0,a,c+i),n((l<<31|u/4294967296)>>>0,a,c+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),u=s*Math.pow(2,-d),n(u*4503599627370496>>>0,a,c+i),n((l<<31|d+1023<<20|u*1048576&1048575)>>>0,a,c+o)}}}t.writeDoubleLE=e.bind(null,HQ,0,4),t.writeDoubleBE=e.bind(null,WQ,4,0);function r(n,i,o,s,a){var c=n(s,a+i),l=n(s,a+o),u=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+c;return d===2047?f?NaN:u*(1/0):d===0?u*5e-324*f:u*Math.pow(2,d-1075)*(f+4503599627370496)}t.readDoubleLE=r.bind(null,YQ,0,4),t.readDoubleBE=r.bind(null,KQ,4,0)})(),t}function HQ(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function WQ(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function YQ(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function KQ(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var QQ=y((Jxt,XQ)=>{"use strict";XQ.exports=Bke;function Bke(t){try{if(typeof Z!="function")return null;var e=Z(t);return e&&(e.length||Object.keys(e).length)?e:null}catch{return null}}});var t7=y(e7=>{"use strict";var yD=e7,_D="\uFFFD";yD.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};yD.read=function(e,r,n){if(n-r<1)return"";for(var i="",o=r;o<n;){var s=e[o++];if(s<=127)i+=String.fromCharCode(s);else if(s>=192&&s<224){var a=(s&31)<<6|e[o++]&63;i+=a>=128?String.fromCharCode(a):_D}else if(s>=224&&s<240){var c=(s&15)<<12|(e[o++]&63)<<6|e[o++]&63;i+=c>=2048?String.fromCharCode(c):_D}else if(s>=240){var l=(s&7)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63;l<65536||l>1114111?i+=_D:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i};yD.write=function(e,r,n){for(var i=n,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128);return n-i}});var n7=y((eRt,r7)=>{"use strict";r7.exports=qke;function qke(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(c){if(c<1||c>i)return t(c);s+c>n&&(o=t(n),s=0);var l=e.call(o,s,s+=c);return s&7&&(s=(s|7)+1),l}}});var o7=y((tRt,i7)=>{"use strict";i7.exports=Cr;var Ny=vo();function Cr(t,e){this.lo=t>>>0,this.hi=e>>>0}var ju=Cr.zero=new Cr(0,0);ju.toNumber=function(){return 0};ju.zzEncode=ju.zzDecode=function(){return this};ju.length=function(){return 1};var Vke=Cr.zeroHash="\0\0\0\0\0\0\0\0";Cr.fromNumber=function(e){if(e===0)return ju;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new Cr(n,i)};Cr.from=function(e){if(typeof e=="number")return Cr.fromNumber(e);if(Ny.isString(e))if(Ny.Long)e=Ny.Long.fromString(e);else return Cr.fromNumber(parseInt(e,10));return e.low||e.high?new Cr(e.low>>>0,e.high>>>0):ju};Cr.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};Cr.prototype.toLong=function(e){return Ny.Long?new Ny.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Uc=String.prototype.charCodeAt;Cr.fromHash=function(e){return e===Vke?ju:new Cr((Uc.call(e,0)|Uc.call(e,1)<<8|Uc.call(e,2)<<16|Uc.call(e,3)<<24)>>>0,(Uc.call(e,4)|Uc.call(e,5)<<8|Uc.call(e,6)<<16|Uc.call(e,7)<<24)>>>0)};Cr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Cr.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Cr.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Cr.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var ED=y((ky,SD)=>{"use strict";(function(t,e){function r(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),r(n)}):typeof ky=="object"?(e(ky),typeof SD=="object"&&(SD.exports=r(ky))):(function(){var n={};e(n),t.Long=r(n)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:ky,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r($,S,w){this.low=$|0,this.high=S|0,this.unsigned=!!w}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n($){return($&&$.__isLong__)===!0}function i($){var S=Math.clz32($&-$);return $?31-S:S}r.isLong=n;var o={},s={};function a($,S){var w,k,Y;return S?($>>>=0,(Y=0<=$&&$<256)&&(k=s[$],k)?k:(w=l($,0,!0),Y&&(s[$]=w),w)):($|=0,(Y=-128<=$&&$<128)&&(k=o[$],k)?k:(w=l($,$<0?-1:0,!1),Y&&(o[$]=w),w))}r.fromInt=a;function c($,S){if(isNaN($))return S?E:T;if(S){if($<0)return E;if($>=g)return M}else{if($<=-_)return L;if($+1>=_)return N}return $<0?c(-$,S).neg():l($%m|0,$/m|0,S)}r.fromNumber=c;function l($,S,w){return new r($,S,w)}r.fromBits=l;var u=Math.pow;function d($,S,w){if($.length===0)throw Error("empty string");if(typeof S=="number"?(w=S,S=!1):S=!!S,$==="NaN"||$==="Infinity"||$==="+Infinity"||$==="-Infinity")return S?E:T;if(w=w||10,w<2||36<w)throw RangeError("radix");var k;if((k=$.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return d($.substring(1),S,w).neg();for(var Y=c(u(w,8)),H=T,he=0;he<$.length;he+=8){var je=Math.min(8,$.length-he),Ie=parseInt($.substring(he,he+je),w);if(je<8){var $e=c(u(w,je));H=H.mul($e).add(c(Ie))}else H=H.mul(Y),H=H.add(c(Ie))}return H.unsigned=S,H}r.fromString=d;function f($,S){return typeof $=="number"?c($,S):typeof $=="string"?d($,S):l($.low,$.high,typeof S=="boolean"?S:$.unsigned)}r.fromValue=f;var p=65536,h=1<<24,m=p*p,g=m*m,_=g/2,b=a(h),T=a(0);r.ZERO=T;var E=a(0,!0);r.UZERO=E;var A=a(1);r.ONE=A;var O=a(1,!0);r.UONE=O;var R=a(-1);r.NEG_ONE=R;var N=l(-1,2147483647,!1);r.MAX_VALUE=N;var M=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=M;var L=l(0,-2147483648,!1);r.MIN_VALUE=L;var v=r.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},v.toString=function(S){if(S=S||10,S<2||36<S)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(L)){var w=c(S),k=this.div(w),Y=k.mul(w).sub(this);return k.toString(S)+Y.toInt().toString(S)}else return"-"+this.neg().toString(S);for(var H=c(u(S,6),this.unsigned),he=this,je="";;){var Ie=he.div(H),$e=he.sub(Ie.mul(H)).toInt()>>>0,Oe=$e.toString(S);if(he=Ie,he.isZero())return Oe+je;for(;Oe.length<6;)Oe="0"+Oe;je=""+Oe+je}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(L)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,w=31;w>0&&(S&1<<w)==0;w--);return this.high!=0?w+33:w+1},v.isSafeInteger=function(){var S=this.high>>21;return S?this.unsigned?!1:S===-1&&!(this.low===0&&this.high===-2097152):!0},v.isZero=function(){return this.high===0&&this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(this.low&1)===1},v.isEven=function(){return(this.low&1)===0},v.equals=function(S){return n(S)||(S=f(S)),this.unsigned!==S.unsigned&&this.high>>>31===1&&S.high>>>31===1?!1:this.high===S.high&&this.low===S.low},v.eq=v.equals,v.notEquals=function(S){return!this.eq(S)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(S){return this.comp(S)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(S){return this.comp(S)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(S){return this.comp(S)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(S){return this.comp(S)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(S){if(n(S)||(S=f(S)),this.eq(S))return 0;var w=this.isNegative(),k=S.isNegative();return w&&!k?-1:!w&&k?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(L)?L:this.not().add(A)},v.neg=v.negate,v.add=function(S){n(S)||(S=f(S));var w=this.high>>>16,k=this.high&65535,Y=this.low>>>16,H=this.low&65535,he=S.high>>>16,je=S.high&65535,Ie=S.low>>>16,$e=S.low&65535,Oe=0,Je=0,Ne=0,le=0;return le+=H+$e,Ne+=le>>>16,le&=65535,Ne+=Y+Ie,Je+=Ne>>>16,Ne&=65535,Je+=k+je,Oe+=Je>>>16,Je&=65535,Oe+=w+he,Oe&=65535,l(Ne<<16|le,Oe<<16|Je,this.unsigned)},v.subtract=function(S){return n(S)||(S=f(S)),this.add(S.neg())},v.sub=v.subtract,v.multiply=function(S){if(this.isZero())return this;if(n(S)||(S=f(S)),e){var w=e.mul(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(S.isZero())return this.unsigned?E:T;if(this.eq(L))return S.isOdd()?L:T;if(S.eq(L))return this.isOdd()?L:T;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(b)&&S.lt(b))return c(this.toNumber()*S.toNumber(),this.unsigned);var k=this.high>>>16,Y=this.high&65535,H=this.low>>>16,he=this.low&65535,je=S.high>>>16,Ie=S.high&65535,$e=S.low>>>16,Oe=S.low&65535,Je=0,Ne=0,le=0,me=0;return me+=he*Oe,le+=me>>>16,me&=65535,le+=H*Oe,Ne+=le>>>16,le&=65535,le+=he*$e,Ne+=le>>>16,le&=65535,Ne+=Y*Oe,Je+=Ne>>>16,Ne&=65535,Ne+=H*$e,Je+=Ne>>>16,Ne&=65535,Ne+=he*Ie,Je+=Ne>>>16,Ne&=65535,Je+=k*Oe+Y*$e+H*Ie+he*je,Je&=65535,l(le<<16|me,Je<<16|Ne,this.unsigned)},v.mul=v.multiply,v.divide=function(S){if(n(S)||(S=f(S)),S.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var w=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?E:T;var k,Y,H;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return E;if(S.gt(this.shru(1)))return O;H=E}else{if(this.eq(L)){if(S.eq(A)||S.eq(R))return L;if(S.eq(L))return A;var he=this.shr(1);return k=he.div(S).shl(1),k.eq(T)?S.isNegative()?A:R:(Y=this.sub(S.mul(k)),H=k.add(Y.div(S)),H)}else if(S.eq(L))return this.unsigned?E:T;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();H=T}for(Y=this;Y.gte(S);){k=Math.max(1,Math.floor(Y.toNumber()/S.toNumber()));for(var je=Math.ceil(Math.log(k)/Math.LN2),Ie=je<=48?1:u(2,je-48),$e=c(k),Oe=$e.mul(S);Oe.isNegative()||Oe.gt(Y);)k-=Ie,$e=c(k,this.unsigned),Oe=$e.mul(S);$e.isZero()&&($e=A),H=H.add($e),Y=Y.sub(Oe)}return H},v.div=v.divide,v.modulo=function(S){if(n(S)||(S=f(S)),e){var w=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return l(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(S){return n(S)||(S=f(S)),l(this.low&S.low,this.high&S.high,this.unsigned)},v.or=function(S){return n(S)||(S=f(S)),l(this.low|S.low,this.high|S.high,this.unsigned)},v.xor=function(S){return n(S)||(S=f(S)),l(this.low^S.low,this.high^S.high,this.unsigned)},v.shiftLeft=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low<<S,this.high<<S|this.low>>>32-S,this.unsigned):l(0,this.low<<S-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>S,this.unsigned):l(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>>S,this.unsigned):S===32?l(this.high,0,this.unsigned):l(this.high>>>S-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.low<<S|this.high>>>w,this.high<<S|this.low>>>w,this.unsigned)):(S-=32,w=32-S,l(this.high<<S|this.low>>>w,this.low<<S|this.high>>>w,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.high<<w|this.low>>>S,this.low<<w|this.high>>>S,this.unsigned)):(S-=32,w=32-S,l(this.low<<w|this.high>>>S,this.high<<w|this.low>>>S,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},v.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var S=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},v.toBytesBE=function(){var S=this.high,w=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,w>>>24,w>>>16&255,w>>>8&255,w&255]},r.fromBytes=function(S,w,k){return k?r.fromBytesLE(S,w):r.fromBytesBE(S,w)},r.fromBytesLE=function(S,w){return new r(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,w)},r.fromBytesBE=function(S,w){return new r(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],w)},typeof BigInt=="function"&&(r.fromBigInt=function(S,w){var k=Number(BigInt.asIntN(32,S)),Y=Number(BigInt.asIntN(32,S>>BigInt(32)));return l(k,Y,w)},r.fromValue=function(S,w){return typeof S=="bigint"?r.fromBigInt(S,w):f(S,w)},v.toBigInt=function(){var S=BigInt(this.low>>>0),w=BigInt(this.unsigned?this.high>>>0:this.high);return w<<BigInt(32)|S});var oe=t.default=r})});var vo=y(vD=>{"use strict";var Ae=vD;Ae.asPromise=gD();Ae.base64=BQ();Ae.EventEmitter=VQ();Ae.float=JQ();Ae.inquire=QQ();Ae.utf8=t7();Ae.pool=n7();Ae.LongBits=o7();function s7(t){return t==="__proto__"||t==="prototype"||t==="constructor"}Ae.isUnsafeProperty=s7;Ae.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);Ae.global=Ae.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||vD;Ae.emptyArray=Object.freeze?Object.freeze([]):[];Ae.emptyObject=Object.freeze?Object.freeze({}):{};Ae.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};Ae.isString=function(e){return typeof e=="string"||e instanceof String};Ae.isObject=function(e){return e&&typeof e=="object"};Ae.isset=Ae.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};Ae.Buffer=(function(){try{var t=Ae.global.Buffer;return t.prototype.utf8Write?t:null}catch{return null}})();Ae._Buffer_from=null;Ae._Buffer_allocUnsafe=null;Ae.newBuffer=function(e){return typeof e=="number"?Ae.Buffer?Ae._Buffer_allocUnsafe(e):new Ae.Array(e):Ae.Buffer?Ae._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};Ae.Array=typeof Uint8Array<"u"?Uint8Array:Array;Ae.Long=Ae.global.dcodeIO&&Ae.global.dcodeIO.Long||Ae.global.Long||(function(){try{var t=ED();return t&&t.isLong?t:null}catch{return null}})();Ae.key2Re=/^true|false|0|1$/;Ae.key32Re=/^-?(?:0|[1-9][0-9]*)$/;Ae.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;Ae.longToHash=function(e){return e?Ae.LongBits.from(e).toHash():Ae.LongBits.zeroHash};Ae.longFromHash=function(e,r){var n=Ae.LongBits.fromHash(e);return Ae.Long?Ae.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function a7(t){var e=typeof arguments[arguments.length-1]=="boolean",r=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<r;++n){var i=arguments[n];if(i)for(var o=Object.keys(i),s=0;s<o.length;++s)!s7(o[s])&&(t[o[s]]===void 0||!e)&&(t[o[s]]=i[o[s]])}return t}Ae.merge=a7;Ae.nestingLimit=32;Ae.recursionLimit=100;Ae.makeProp=function(e,r){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0})};Ae.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function c7(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&a7(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}Ae.newError=c7;Ae.ProtocolError=c7("ProtocolError");Ae.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(r[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};Ae.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};Ae.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};Ae._configure=function(){var t=Ae.Buffer;if(!t){Ae._Buffer_from=Ae._Buffer_allocUnsafe=null;return}Ae._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},Ae._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var ZA=y((nRt,f7)=>{"use strict";f7.exports=ft;var ji=vo(),bD,KA=ji.LongBits,l7=ji.base64,u7=ji.utf8;function My(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function wD(){}function Gke(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function ft(){this.len=0,this.head=new My(wD,0,0),this.tail=this.head,this.states=null}var d7=function(){return ji.Buffer?function(){return(ft.create=function(){return new bD})()}:function(){return new ft}};ft.create=d7();ft.alloc=function(e){return new ji.Array(e)};ji.Array!==Array&&(ft.alloc=ji.pool(ft.alloc,ji.Array.prototype.subarray));ft.prototype._push=function(e,r,n){return this.tail=this.tail.next=new My(e,r,n),this.len+=r,this};function AD(t,e,r){e[r]=t&255}function Hke(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function xD(t,e){this.len=t,this.next=void 0,this.val=e}xD.prototype=Object.create(My.prototype);xD.prototype.fn=Hke;ft.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new xD((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};ft.prototype.int32=function(e){return(e|=0)<0?this._push(RD,10,KA.fromNumber(e)):this.uint32(e)};ft.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function RD(t,e,r){for(var n=t.lo,i=t.hi;i;)e[r++]=n&127|128,n=(n>>>7|i<<25)>>>0,i>>>=7;for(;n>127;)e[r++]=n&127|128,n=n>>>7;e[r++]=n}ft.prototype.uint64=function(e){var r=KA.from(e);return this._push(RD,r.length(),r)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(e){var r=KA.from(e).zzEncode();return this._push(RD,r.length(),r)};ft.prototype.bool=function(e){return this._push(AD,1,e?1:0)};function TD(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}ft.prototype.fixed32=function(e){return this._push(TD,4,e>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(e){var r=KA.from(e);return this._push(TD,4,r.lo)._push(TD,4,r.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(e){return this._push(ji.float.writeFloatLE,4,e)};ft.prototype.double=function(e){return this._push(ji.float.writeDoubleLE,8,e)};var Wke=ji.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};ft.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(AD,1,0);if(ji.isString(e)){var n=ft.alloc(r=l7.length(e));l7.decode(e,n,0),e=n}return this.uint32(r)._push(Wke,r,e)};ft.prototype.string=function(e){var r=u7.length(e);return r?this.uint32(r)._push(u7.write,r,e):this._push(AD,1,0)};ft.prototype.fork=function(){return this.states=new Gke(this),this.head=this.tail=new My(wD,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new My(wD,0,0),this.len=0),this};ft.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};ft.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};ft._configure=function(t){bD=t,ft.create=d7(),bD._configure()}});var m7=y((iRt,h7)=>{"use strict";h7.exports=ps;var p7=ZA();(ps.prototype=Object.create(p7.prototype)).constructor=ps;var Fc=vo();function ps(){p7.call(this)}ps._configure=function(){ps.alloc=Fc._Buffer_allocUnsafe,ps.writeBytesBuffer=Fc.Buffer&&Fc.Buffer.prototype instanceof Uint8Array&&Fc.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};ps.prototype.bytes=function(e){Fc.isString(e)&&(e=Fc._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(ps.writeBytesBuffer,r,e),this};function Yke(t,e,r){t.length<40?Fc.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}ps.prototype.string=function(e){var r=Fc.Buffer.byteLength(e);return this.uint32(r),r&&this._push(Yke,r,e),this};ps._configure()});var XA=y((oRt,E7)=>{"use strict";E7.exports=Wt;var Bi=vo(),ID,y7=Bi.LongBits,Kke=Bi.utf8;function bo(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Wt(t){this.buf=t,this.pos=0,this.len=t.length}var g7=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Wt(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Wt(e);throw Error("illegal buffer")},S7=function(){return Bi.Buffer?function(r){return(Wt.create=function(i){return Bi.Buffer.isBuffer(i)?new ID(i):g7(i)})(r)}:g7};Wt.create=S7();Wt.prototype._slice=Bi.Array.prototype.subarray||Bi.Array.prototype.slice;Wt.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,bo(this,10);return e}})();Wt.prototype.int32=function(){return this.uint32()|0};Wt.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function CD(){var t=new y7(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw bo(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw bo(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Wt.prototype.bool=function(){return this.uint32()!==0};function JA(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Wt.prototype.fixed32=function(){if(this.pos+4>this.len)throw bo(this,4);return JA(this.buf,this.pos+=4)};Wt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw bo(this,4);return JA(this.buf,this.pos+=4)|0};function _7(){if(this.pos+8>this.len)throw bo(this,8);return new y7(JA(this.buf,this.pos+=4),JA(this.buf,this.pos+=4))}Wt.prototype.float=function(){if(this.pos+4>this.len)throw bo(this,4);var e=Bi.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Wt.prototype.double=function(){if(this.pos+8>this.len)throw bo(this,4);var e=Bi.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Wt.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw bo(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=Bi.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)};Wt.prototype.string=function(){var e=this.bytes();return Kke.read(e,0,e.length)};Wt.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw bo(this,e);this.pos+=e}else do if(this.pos>=this.len)throw bo(this);while(this.buf[this.pos++]&128);return this};Wt.recursionLimit=Bi.recursionLimit;Wt.prototype.skipType=function(t,e){if(e===void 0&&(e=0),e>Wt.recursionLimit)throw Error("maximum nesting depth exceeded");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t,e+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Wt._configure=function(t){ID=t,Wt.create=S7(),ID._configure();var e=Bi.Long?"toLong":"toNumber";Bi.merge(Wt.prototype,{int64:function(){return CD.call(this)[e](!1)},uint64:function(){return CD.call(this)[e](!0)},sint64:function(){return CD.call(this).zzDecode()[e](!1)},fixed64:function(){return _7.call(this)[e](!0)},sfixed64:function(){return _7.call(this)[e](!1)}})}});var w7=y((sRt,T7)=>{"use strict";T7.exports=Bu;var b7=XA();(Bu.prototype=Object.create(b7.prototype)).constructor=Bu;var v7=vo();function Bu(t){b7.call(this,t)}Bu._configure=function(){v7.Buffer&&(Bu.prototype._slice=v7.Buffer.prototype.slice)};Bu.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Bu._configure()});var x7=y((aRt,A7)=>{"use strict";A7.exports=$y;var PD=vo();($y.prototype=Object.create(PD.EventEmitter.prototype)).constructor=$y;function $y(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");PD.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}$y.prototype.rpcCall=function t(e,r,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return PD.asPromise(t,s,e,r,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return s.emit("error",c,e),o(c);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(u){return s.emit("error",u,e),o(u)}return s.emit("data",l,e),o(null,l)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};$y.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var OD=y(R7=>{"use strict";var Zke=R7;Zke.Service=x7()});var ND=y((lRt,C7)=>{"use strict";C7.exports={}});var O7=y(P7=>{"use strict";var Hn=P7;Hn.build="minimal";Hn.Writer=ZA();Hn.BufferWriter=m7();Hn.Reader=XA();Hn.BufferReader=w7();Hn.util=vo();Hn.rpc=OD();Hn.roots=ND();Hn.configure=I7;function I7(){Hn.util._configure(),Hn.Writer._configure(Hn.BufferWriter),Hn.Reader._configure(Hn.BufferReader)}I7()});var k7=y((dRt,N7)=>{"use strict";N7.exports=kD;var Jke=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function kD(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function n(o){if(typeof o!="string"){var s=i();if(kD.verbose&&console.log("codegen: "+s),s="return "+s,o){for(var a=Object.keys(o),c=new Array(a.length+1),l=new Array(a.length),u=0;u<a.length;)c[u]=a[u],l[u]=o[a[u++]];return c[u]=s,Function.apply(null,c).apply(null,l)}return Function(s)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,o=o.replace(/%([%dfijs])/g,function(h,m){var g=d[f++];switch(m){case"d":case"f":return String(Number(g));case"i":return String(Math.floor(g));case"j":return JSON.stringify(g);case"s":return String(g)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return r.push(o),n}function i(o){return"function "+Xke(o||e)+"("+(t&&t.join(",")||"")+`){
|
|
7
|
+
`))||"no stack trace available"}var cD=class{constructor(e,r,n={}){var i,o;if(n=Object.assign({},n),this[gp]=(i=n.interceptors)!==null&&i!==void 0?i:[],delete n.interceptors,this[_p]=(o=n.interceptor_providers)!==null&&o!==void 0?o:[],delete n.interceptor_providers,this[gp].length>0&&this[_p].length>0)throw new Error("Both interceptors and interceptor_providers were passed as options to the client constructor. Only one of these is allowed.");if(this[ya]=n.callInvocationTransformer,delete n.callInvocationTransformer,n.channelOverride)this[So]=n.channelOverride;else if(n.channelFactoryOverride){let s=n.channelFactoryOverride;delete n.channelFactoryOverride,this[So]=s(e,r,n)}else this[So]=new jNe.ChannelImplementation(e,r,n)}close(){this[So].close()}getChannel(){return this[So]}waitForReady(e,r){let n=i=>{if(i){r(new Error("Failed to connect before the deadline"));return}let o;try{o=this[So].getConnectivityState(!0)}catch{r(new Error("The channel has been closed"));return}if(o===BNe.ConnectivityState.READY)r();else try{this[So].watchConnectivityState(o,e,n)}catch{r(new Error("The channel has been closed"))}};setImmediate(n)}checkOptionalUnaryResponseArguments(e,r,n){if(aD(e))return{metadata:new mp.Metadata,options:{},callback:e};if(aD(r))return e instanceof mp.Metadata?{metadata:e,options:{},callback:r}:{metadata:new mp.Metadata,options:e,callback:r};if(!(e instanceof mp.Metadata&&r instanceof Object&&aD(n)))throw new Error("Incorrect arguments passed");return{metadata:e,options:r,callback:n}}makeUnaryRequest(e,r,n,i,o,s,a){var c,l;let u=this.checkOptionalUnaryResponseArguments(o,s,a),d={path:e,requestStream:!1,responseStream:!1,requestSerialize:r,responseDeserialize:n},f={argument:i,metadata:u.metadata,call:new fs.ClientUnaryCallImpl,channel:this[So],methodDefinition:d,callOptions:u.options,callback:u.callback};this[ya]&&(f=this[ya](f));let p=f.call,h={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(c=f.callOptions.interceptors)!==null&&c!==void 0?c:[],callInterceptorProviders:(l=f.callOptions.interceptor_providers)!==null&&l!==void 0?l:[]},m=(0,zA.getInterceptingCall)(h,f.methodDefinition,f.callOptions,f.channel);p.call=m;let g=null,_=!1,b=new Error;return m.start(f.metadata,{onReceiveMetadata:T=>{p.emit("metadata",T)},onReceiveMessage(T){g!==null&&m.cancelWithStatus(Lc.Status.UNIMPLEMENTED,"Too many responses received"),g=T},onReceiveStatus(T){if(!_){if(_=!0,T.code===Lc.Status.OK)if(g===null){let E=yp(b);f.callback((0,fs.callErrorFromStatus)({code:Lc.Status.UNIMPLEMENTED,details:"No message received",metadata:T.metadata},E))}else f.callback(null,g);else{let E=yp(b);f.callback((0,fs.callErrorFromStatus)(T,E))}b=null,p.emit("status",T)}}}),m.sendMessage(i),m.halfClose(),p}makeClientStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkOptionalUnaryResponseArguments(i,o,s),u={path:e,requestStream:!0,responseStream:!1,requestSerialize:r,responseDeserialize:n},d={metadata:l.metadata,call:new fs.ClientWritableStreamImpl(r),channel:this[So],methodDefinition:u,callOptions:l.options,callback:l.callback};this[ya]&&(d=this[ya](d));let f=d.call,p={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,zA.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=null,g=!1,_=new Error;return h.start(d.metadata,{onReceiveMetadata:b=>{f.emit("metadata",b)},onReceiveMessage(b){m!==null&&h.cancelWithStatus(Lc.Status.UNIMPLEMENTED,"Too many responses received"),m=b,h.startRead()},onReceiveStatus(b){if(!g){if(g=!0,b.code===Lc.Status.OK)if(m===null){let T=yp(_);d.callback((0,fs.callErrorFromStatus)({code:Lc.Status.UNIMPLEMENTED,details:"No message received",metadata:b.metadata},T))}else d.callback(null,m);else{let T=yp(_);d.callback((0,fs.callErrorFromStatus)(b,T))}_=null,f.emit("status",b)}}}),f}checkMetadataAndOptions(e,r){let n,i;return e instanceof mp.Metadata?(n=e,r?i=r:i={}):(e?i=e:i={},n=new mp.Metadata),{metadata:n,options:i}}makeServerStreamRequest(e,r,n,i,o,s){var a,c;let l=this.checkMetadataAndOptions(o,s),u={path:e,requestStream:!1,responseStream:!0,requestSerialize:r,responseDeserialize:n},d={argument:i,metadata:l.metadata,call:new fs.ClientReadableStreamImpl(n),channel:this[So],methodDefinition:u,callOptions:l.options};this[ya]&&(d=this[ya](d));let f=d.call,p={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(a=d.callOptions.interceptors)!==null&&a!==void 0?a:[],callInterceptorProviders:(c=d.callOptions.interceptor_providers)!==null&&c!==void 0?c:[]},h=(0,zA.getInterceptingCall)(p,d.methodDefinition,d.callOptions,d.channel);f.call=h;let m=!1,g=new Error;return h.start(d.metadata,{onReceiveMetadata(_){f.emit("metadata",_)},onReceiveMessage(_){f.push(_)},onReceiveStatus(_){if(!m){if(m=!0,f.push(null),_.code!==Lc.Status.OK){let b=yp(g);f.emit("error",(0,fs.callErrorFromStatus)(_,b))}g=null,f.emit("status",_)}}}),h.sendMessage(i),h.halfClose(),f}makeBidiStreamRequest(e,r,n,i,o){var s,a;let c=this.checkMetadataAndOptions(i,o),l={path:e,requestStream:!0,responseStream:!0,requestSerialize:r,responseDeserialize:n},u={metadata:c.metadata,call:new fs.ClientDuplexStreamImpl(r,n),channel:this[So],methodDefinition:l,callOptions:c.options};this[ya]&&(u=this[ya](u));let d=u.call,f={clientInterceptors:this[gp],clientInterceptorProviders:this[_p],callInterceptors:(s=u.callOptions.interceptors)!==null&&s!==void 0?s:[],callInterceptorProviders:(a=u.callOptions.interceptor_providers)!==null&&a!==void 0?a:[]},p=(0,zA.getInterceptingCall)(f,u.methodDefinition,u.callOptions,u.channel);d.call=p;let h=!1,m=new Error;return p.start(u.metadata,{onReceiveMetadata(g){d.emit("metadata",g)},onReceiveMessage(g){d.push(g)},onReceiveStatus(g){if(!h){if(h=!0,d.push(null),g.code!==Lc.Status.OK){let _=yp(m);d.emit("error",(0,fs.callErrorFromStatus)(g,_))}m=null,d.emit("status",g)}}}),d}};jA.Client=cD});var qA=y(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.makeClientConstructor=fQ;BA.loadPackageDefinition=HNe;var Oy=lD(),qNe={unary:Oy.Client.prototype.makeUnaryRequest,server_stream:Oy.Client.prototype.makeServerStreamRequest,client_stream:Oy.Client.prototype.makeClientStreamRequest,bidi:Oy.Client.prototype.makeBidiStreamRequest};function dD(t){return["__proto__","prototype","constructor"].includes(t)}function fQ(t,e,r){r||(r={});class n extends Oy.Client{}return Object.keys(t).forEach(i=>{if(dD(i))return;let o=t[i],s;if(typeof i=="string"&&i.charAt(0)==="$")throw new Error("Method names cannot start with $");o.requestStream?o.responseStream?s="bidi":s="client_stream":o.responseStream?s="server_stream":s="unary";let a=o.requestSerialize,c=o.responseDeserialize,l=VNe(qNe[s],o.path,a,c);n.prototype[i]=l,Object.assign(n.prototype[i],o),o.originalName&&!dD(o.originalName)&&(n.prototype[o.originalName]=n.prototype[i])}),n.service=t,n.serviceName=e,n}function VNe(t,e,r,n){return function(...i){return t.call(this,e,r,n,...i)}}function GNe(t){return"format"in t}function HNe(t){let e={};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let n=t[r],i=r.split(".");if(i.some(a=>dD(a)))continue;let o=i[i.length-1],s=e;for(let a of i.slice(0,-1))s[a]||(s[a]={}),s=s[a];GNe(n)?s[o]=n:s[o]=fQ(n,o,{})}return e}});var LQ=y((Hxt,DQ)=>{"use strict";var WNe=1/0,YNe="[object Symbol]",KNe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ZNe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,GA="\\ud800-\\udfff",EQ="\\u0300-\\u036f\\ufe20-\\ufe23",vQ="\\u20d0-\\u20f0",bQ="\\u2700-\\u27bf",TQ="a-z\\xdf-\\xf6\\xf8-\\xff",JNe="\\xac\\xb1\\xd7\\xf7",XNe="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",QNe="\\u2000-\\u206f",eke=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",wQ="A-Z\\xc0-\\xd6\\xd8-\\xde",AQ="\\ufe0e\\ufe0f",xQ=JNe+XNe+QNe+eke,pD="['\u2019]",tke="["+GA+"]",pQ="["+xQ+"]",VA="["+EQ+vQ+"]",RQ="\\d+",rke="["+bQ+"]",CQ="["+TQ+"]",IQ="[^"+GA+xQ+RQ+bQ+TQ+wQ+"]",fD="\\ud83c[\\udffb-\\udfff]",nke="(?:"+VA+"|"+fD+")",PQ="[^"+GA+"]",hD="(?:\\ud83c[\\udde6-\\uddff]){2}",mD="[\\ud800-\\udbff][\\udc00-\\udfff]",Sp="["+wQ+"]",OQ="\\u200d",hQ="(?:"+CQ+"|"+IQ+")",ike="(?:"+Sp+"|"+IQ+")",mQ="(?:"+pD+"(?:d|ll|m|re|s|t|ve))?",gQ="(?:"+pD+"(?:D|LL|M|RE|S|T|VE))?",NQ=nke+"?",kQ="["+AQ+"]?",oke="(?:"+OQ+"(?:"+[PQ,hD,mD].join("|")+")"+kQ+NQ+")*",MQ=kQ+NQ+oke,ske="(?:"+[rke,hD,mD].join("|")+")"+MQ,ake="(?:"+[PQ+VA+"?",VA,hD,mD,tke].join("|")+")",cke=RegExp(pD,"g"),lke=RegExp(VA,"g"),uke=RegExp(fD+"(?="+fD+")|"+ake+MQ,"g"),dke=RegExp([Sp+"?"+CQ+"+"+mQ+"(?="+[pQ,Sp,"$"].join("|")+")",ike+"+"+gQ+"(?="+[pQ,Sp+hQ,"$"].join("|")+")",Sp+"?"+hQ+"+"+mQ,Sp+"+"+gQ,RQ,ske].join("|"),"g"),fke=RegExp("["+OQ+GA+EQ+vQ+AQ+"]"),pke=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hke={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"ss"},mke=typeof global=="object"&&global&&global.Object===Object&&global,gke=typeof self=="object"&&self&&self.Object===Object&&self,_ke=mke||gke||Function("return this")();function yke(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function Ske(t){return t.split("")}function Eke(t){return t.match(KNe)||[]}function vke(t){return function(e){return t?.[e]}}var bke=vke(hke);function $Q(t){return fke.test(t)}function Tke(t){return pke.test(t)}function wke(t){return $Q(t)?Ake(t):Ske(t)}function Ake(t){return t.match(uke)||[]}function xke(t){return t.match(dke)||[]}var Rke=Object.prototype,Cke=Rke.toString,_Q=_ke.Symbol,yQ=_Q?_Q.prototype:void 0,SQ=yQ?yQ.toString:void 0;function Ike(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function Pke(t){if(typeof t=="string")return t;if($ke(t))return SQ?SQ.call(t):"";var e=t+"";return e=="0"&&1/t==-WNe?"-0":e}function Oke(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:Ike(t,e,r)}function Nke(t){return function(e){e=HA(e);var r=$Q(e)?wke(e):void 0,n=r?r[0]:e.charAt(0),i=r?Oke(r,1).join(""):e.slice(1);return n[t]()+i}}function kke(t){return function(e){return yke(zke(Uke(e).replace(cke,"")),t,"")}}function Mke(t){return!!t&&typeof t=="object"}function $ke(t){return typeof t=="symbol"||Mke(t)&&Cke.call(t)==YNe}function HA(t){return t==null?"":Pke(t)}var Dke=kke(function(t,e,r){return e=e.toLowerCase(),t+(r?Lke(e):e)});function Lke(t){return Fke(HA(t).toLowerCase())}function Uke(t){return t=HA(t),t&&t.replace(ZNe,bke).replace(lke,"")}var Fke=Nke("toUpperCase");function zke(t,e,r){return t=HA(t),e=r?void 0:e,e===void 0?Tke(t)?xke(t):Eke(t):t.match(e)||[]}DQ.exports=Dke});var gD=y((Wxt,UQ)=>{"use strict";UQ.exports=jke;function jke(t,e){for(var r=new Array(arguments.length-1),n=0,i=2,o=!0;i<arguments.length;)r[n++]=arguments[i++];return new Promise(function(a,c){r[n]=function(u){if(o)if(o=!1,u)c(u);else{for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f++]=arguments[f];a.apply(null,d)}};try{t.apply(e||null,r)}catch(l){o&&(o=!1,c(l))}})}});var BQ=y(jQ=>{"use strict";var WA=jQ;WA.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var Ep=new Array(64),zQ=new Array(123);for(Eo=0;Eo<64;)zQ[Ep[Eo]=Eo<26?Eo+65:Eo<52?Eo+71:Eo<62?Eo-4:Eo-59|43]=Eo++;var Eo;WA.encode=function(e,r,n){for(var i=null,o=[],s=0,a=0,c;r<n;){var l=e[r++];switch(a){case 0:o[s++]=Ep[l>>2],c=(l&3)<<4,a=1;break;case 1:o[s++]=Ep[c|l>>4],c=(l&15)<<2,a=2;break;case 2:o[s++]=Ep[c|l>>6],o[s++]=Ep[l&63],a=0;break}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=Ep[c],o[s++]=61,a===1&&(o[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,o.slice(0,s))),i.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var FQ="invalid encoding";WA.decode=function(e,r,n){for(var i=n,o=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&o>1)break;if((c=zQ[c])===void 0)throw Error(FQ);switch(o){case 0:s=c,o=1;break;case 1:r[n++]=s<<2|(c&48)>>4,s=c,o=2;break;case 2:r[n++]=(s&15)<<4|(c&60)>>2,s=c,o=3;break;case 3:r[n++]=(s&3)<<6|c,o=0;break}}if(o===1)throw Error(FQ);return n-i};WA.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var VQ=y((Kxt,qQ)=>{"use strict";qQ.exports=YA;function YA(){this._listeners=Object.create(null)}YA.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};YA.prototype.off=function(e,r){if(e===void 0)this._listeners=Object.create(null);else if(r===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var i=0;i<n.length;)n[i].fn===r?n.splice(i,1):++i}return this};YA.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<r.length;)r[i].fn.apply(r[i++].ctx,n)}return this}});var JQ=y((Zxt,ZQ)=>{"use strict";ZQ.exports=GQ(GQ);function GQ(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3]}function o(c,l,u){e[0]=c,l[u]=r[3],l[u+1]=r[2],l[u+2]=r[1],l[u+3]=r[0]}t.writeFloatLE=n?i:o,t.writeFloatBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],e[0]}function a(c,l){return r[3]=c[l],r[2]=c[l+1],r[1]=c[l+2],r[0]=c[l+3],e[0]}t.readFloatLE=n?s:a,t.readFloatBE=n?a:s})():(function(){function e(n,i,o,s){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,o,s);else if(isNaN(i))n(2143289344,o,s);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,o,s);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,o,s);else{var c=Math.floor(Math.log(i)/Math.LN2),l=Math.round(i*Math.pow(2,-c)*8388608)&8388607;n((a<<31|c+127<<23|l)>>>0,o,s)}}t.writeFloatLE=e.bind(null,HQ),t.writeFloatBE=e.bind(null,WQ);function r(n,i,o){var s=n(i,o),a=(s>>31)*2+1,c=s>>>23&255,l=s&8388607;return c===255?l?NaN:a*(1/0):c===0?a*1401298464324817e-60*l:a*Math.pow(2,c-150)*(l+8388608)}t.readFloatLE=r.bind(null,YQ),t.readFloatBE=r.bind(null,KQ)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function i(c,l,u){e[0]=c,l[u]=r[0],l[u+1]=r[1],l[u+2]=r[2],l[u+3]=r[3],l[u+4]=r[4],l[u+5]=r[5],l[u+6]=r[6],l[u+7]=r[7]}function o(c,l,u){e[0]=c,l[u]=r[7],l[u+1]=r[6],l[u+2]=r[5],l[u+3]=r[4],l[u+4]=r[3],l[u+5]=r[2],l[u+6]=r[1],l[u+7]=r[0]}t.writeDoubleLE=n?i:o,t.writeDoubleBE=n?o:i;function s(c,l){return r[0]=c[l],r[1]=c[l+1],r[2]=c[l+2],r[3]=c[l+3],r[4]=c[l+4],r[5]=c[l+5],r[6]=c[l+6],r[7]=c[l+7],e[0]}function a(c,l){return r[7]=c[l],r[6]=c[l+1],r[5]=c[l+2],r[4]=c[l+3],r[3]=c[l+4],r[2]=c[l+5],r[1]=c[l+6],r[0]=c[l+7],e[0]}t.readDoubleLE=n?s:a,t.readDoubleBE=n?a:s})():(function(){function e(n,i,o,s,a,c){var l=s<0?1:0;if(l&&(s=-s),s===0)n(0,a,c+i),n(1/s>0?0:2147483648,a,c+o);else if(isNaN(s))n(0,a,c+i),n(2146959360,a,c+o);else if(s>17976931348623157e292)n(0,a,c+i),n((l<<31|2146435072)>>>0,a,c+o);else{var u;if(s<22250738585072014e-324)u=s/5e-324,n(u>>>0,a,c+i),n((l<<31|u/4294967296)>>>0,a,c+o);else{var d=Math.floor(Math.log(s)/Math.LN2);d===1024&&(d=1023),u=s*Math.pow(2,-d),n(u*4503599627370496>>>0,a,c+i),n((l<<31|d+1023<<20|u*1048576&1048575)>>>0,a,c+o)}}}t.writeDoubleLE=e.bind(null,HQ,0,4),t.writeDoubleBE=e.bind(null,WQ,4,0);function r(n,i,o,s,a){var c=n(s,a+i),l=n(s,a+o),u=(l>>31)*2+1,d=l>>>20&2047,f=4294967296*(l&1048575)+c;return d===2047?f?NaN:u*(1/0):d===0?u*5e-324*f:u*Math.pow(2,d-1075)*(f+4503599627370496)}t.readDoubleLE=r.bind(null,YQ,0,4),t.readDoubleBE=r.bind(null,KQ,4,0)})(),t}function HQ(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function WQ(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function YQ(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function KQ(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var QQ=y((Jxt,XQ)=>{"use strict";XQ.exports=Bke;function Bke(t){try{if(typeof Z!="function")return null;var e=Z(t);return e&&(e.length||Object.keys(e).length)?e:null}catch{return null}}});var t7=y(e7=>{"use strict";var yD=e7,_D="\uFFFD";yD.length=function(e){for(var r=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?r+=1:n<2048?r+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,r+=4):r+=3;return r};yD.read=function(e,r,n){if(n-r<1)return"";for(var i="",o=r;o<n;){var s=e[o++];if(s<=127)i+=String.fromCharCode(s);else if(s>=192&&s<224){var a=(s&31)<<6|e[o++]&63;i+=a>=128?String.fromCharCode(a):_D}else if(s>=224&&s<240){var c=(s&15)<<12|(e[o++]&63)<<6|e[o++]&63;i+=c>=2048?String.fromCharCode(c):_D}else if(s>=240){var l=(s&7)<<18|(e[o++]&63)<<12|(e[o++]&63)<<6|e[o++]&63;l<65536||l>1114111?i+=_D:(l-=65536,i+=String.fromCharCode(55296+(l>>10)),i+=String.fromCharCode(56320+(l&1023)))}}return i};yD.write=function(e,r,n){for(var i=n,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=o&63|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=o&63|128);return n-i}});var n7=y((eRt,r7)=>{"use strict";r7.exports=qke;function qke(t,e,r){var n=r||8192,i=n>>>1,o=null,s=n;return function(c){if(c<1||c>i)return t(c);s+c>n&&(o=t(n),s=0);var l=e.call(o,s,s+=c);return s&7&&(s=(s|7)+1),l}}});var o7=y((tRt,i7)=>{"use strict";i7.exports=Cr;var Ny=vo();function Cr(t,e){this.lo=t>>>0,this.hi=e>>>0}var ju=Cr.zero=new Cr(0,0);ju.toNumber=function(){return 0};ju.zzEncode=ju.zzDecode=function(){return this};ju.length=function(){return 1};var Vke=Cr.zeroHash="\0\0\0\0\0\0\0\0";Cr.fromNumber=function(e){if(e===0)return ju;var r=e<0;r&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new Cr(n,i)};Cr.from=function(e){if(typeof e=="number")return Cr.fromNumber(e);if(Ny.isString(e))if(Ny.Long)e=Ny.Long.fromString(e);else return Cr.fromNumber(parseInt(e,10));return e.low||e.high?new Cr(e.low>>>0,e.high>>>0):ju};Cr.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};Cr.prototype.toLong=function(e){return Ny.Long?new Ny.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Uc=String.prototype.charCodeAt;Cr.fromHash=function(e){return e===Vke?ju:new Cr((Uc.call(e,0)|Uc.call(e,1)<<8|Uc.call(e,2)<<16|Uc.call(e,3)<<24)>>>0,(Uc.call(e,4)|Uc.call(e,5)<<8|Uc.call(e,6)<<16|Uc.call(e,7)<<24)>>>0)};Cr.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Cr.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Cr.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Cr.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var ED=y((ky,SD)=>{"use strict";(function(t,e){function r(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),r(n)}):typeof ky=="object"?(e(ky),typeof SD=="object"&&(SD.exports=r(ky))):(function(){var n={};e(n),t.Long=r(n)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:ky,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r($,S,w){this.low=$|0,this.high=S|0,this.unsigned=!!w}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n($){return($&&$.__isLong__)===!0}function i($){var S=Math.clz32($&-$);return $?31-S:S}r.isLong=n;var o={},s={};function a($,S){var w,k,Y;return S?($>>>=0,(Y=0<=$&&$<256)&&(k=s[$],k)?k:(w=l($,0,!0),Y&&(s[$]=w),w)):($|=0,(Y=-128<=$&&$<128)&&(k=o[$],k)?k:(w=l($,$<0?-1:0,!1),Y&&(o[$]=w),w))}r.fromInt=a;function c($,S){if(isNaN($))return S?E:T;if(S){if($<0)return E;if($>=g)return M}else{if($<=-_)return L;if($+1>=_)return N}return $<0?c(-$,S).neg():l($%m|0,$/m|0,S)}r.fromNumber=c;function l($,S,w){return new r($,S,w)}r.fromBits=l;var u=Math.pow;function d($,S,w){if($.length===0)throw Error("empty string");if(typeof S=="number"?(w=S,S=!1):S=!!S,$==="NaN"||$==="Infinity"||$==="+Infinity"||$==="-Infinity")return S?E:T;if(w=w||10,w<2||36<w)throw RangeError("radix");var k;if((k=$.indexOf("-"))>0)throw Error("interior hyphen");if(k===0)return d($.substring(1),S,w).neg();for(var Y=c(u(w,8)),H=T,he=0;he<$.length;he+=8){var je=Math.min(8,$.length-he),Ie=parseInt($.substring(he,he+je),w);if(je<8){var $e=c(u(w,je));H=H.mul($e).add(c(Ie))}else H=H.mul(Y),H=H.add(c(Ie))}return H.unsigned=S,H}r.fromString=d;function f($,S){return typeof $=="number"?c($,S):typeof $=="string"?d($,S):l($.low,$.high,typeof S=="boolean"?S:$.unsigned)}r.fromValue=f;var p=65536,h=1<<24,m=p*p,g=m*m,_=g/2,b=a(h),T=a(0);r.ZERO=T;var E=a(0,!0);r.UZERO=E;var A=a(1);r.ONE=A;var O=a(1,!0);r.UONE=O;var R=a(-1);r.NEG_ONE=R;var N=l(-1,2147483647,!1);r.MAX_VALUE=N;var M=l(-1,-1,!0);r.MAX_UNSIGNED_VALUE=M;var L=l(0,-2147483648,!1);r.MIN_VALUE=L;var v=r.prototype;v.toInt=function(){return this.unsigned?this.low>>>0:this.low},v.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},v.toString=function(S){if(S=S||10,S<2||36<S)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(L)){var w=c(S),k=this.div(w),Y=k.mul(w).sub(this);return k.toString(S)+Y.toInt().toString(S)}else return"-"+this.neg().toString(S);for(var H=c(u(S,6),this.unsigned),he=this,je="";;){var Ie=he.div(H),$e=he.sub(Ie.mul(H)).toInt()>>>0,Pe=$e.toString(S);if(he=Ie,he.isZero())return Pe+je;for(;Pe.length<6;)Pe="0"+Pe;je=""+Pe+je}},v.getHighBits=function(){return this.high},v.getHighBitsUnsigned=function(){return this.high>>>0},v.getLowBits=function(){return this.low},v.getLowBitsUnsigned=function(){return this.low>>>0},v.getNumBitsAbs=function(){if(this.isNegative())return this.eq(L)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,w=31;w>0&&(S&1<<w)==0;w--);return this.high!=0?w+33:w+1},v.isSafeInteger=function(){var S=this.high>>21;return S?this.unsigned?!1:S===-1&&!(this.low===0&&this.high===-2097152):!0},v.isZero=function(){return this.high===0&&this.low===0},v.eqz=v.isZero,v.isNegative=function(){return!this.unsigned&&this.high<0},v.isPositive=function(){return this.unsigned||this.high>=0},v.isOdd=function(){return(this.low&1)===1},v.isEven=function(){return(this.low&1)===0},v.equals=function(S){return n(S)||(S=f(S)),this.unsigned!==S.unsigned&&this.high>>>31===1&&S.high>>>31===1?!1:this.high===S.high&&this.low===S.low},v.eq=v.equals,v.notEquals=function(S){return!this.eq(S)},v.neq=v.notEquals,v.ne=v.notEquals,v.lessThan=function(S){return this.comp(S)<0},v.lt=v.lessThan,v.lessThanOrEqual=function(S){return this.comp(S)<=0},v.lte=v.lessThanOrEqual,v.le=v.lessThanOrEqual,v.greaterThan=function(S){return this.comp(S)>0},v.gt=v.greaterThan,v.greaterThanOrEqual=function(S){return this.comp(S)>=0},v.gte=v.greaterThanOrEqual,v.ge=v.greaterThanOrEqual,v.compare=function(S){if(n(S)||(S=f(S)),this.eq(S))return 0;var w=this.isNegative(),k=S.isNegative();return w&&!k?-1:!w&&k?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},v.comp=v.compare,v.negate=function(){return!this.unsigned&&this.eq(L)?L:this.not().add(A)},v.neg=v.negate,v.add=function(S){n(S)||(S=f(S));var w=this.high>>>16,k=this.high&65535,Y=this.low>>>16,H=this.low&65535,he=S.high>>>16,je=S.high&65535,Ie=S.low>>>16,$e=S.low&65535,Pe=0,He=0,Ne=0,le=0;return le+=H+$e,Ne+=le>>>16,le&=65535,Ne+=Y+Ie,He+=Ne>>>16,Ne&=65535,He+=k+je,Pe+=He>>>16,He&=65535,Pe+=w+he,Pe&=65535,l(Ne<<16|le,Pe<<16|He,this.unsigned)},v.subtract=function(S){return n(S)||(S=f(S)),this.add(S.neg())},v.sub=v.subtract,v.multiply=function(S){if(this.isZero())return this;if(n(S)||(S=f(S)),e){var w=e.mul(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(S.isZero())return this.unsigned?E:T;if(this.eq(L))return S.isOdd()?L:T;if(S.eq(L))return this.isOdd()?L:T;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(b)&&S.lt(b))return c(this.toNumber()*S.toNumber(),this.unsigned);var k=this.high>>>16,Y=this.high&65535,H=this.low>>>16,he=this.low&65535,je=S.high>>>16,Ie=S.high&65535,$e=S.low>>>16,Pe=S.low&65535,He=0,Ne=0,le=0,me=0;return me+=he*Pe,le+=me>>>16,me&=65535,le+=H*Pe,Ne+=le>>>16,le&=65535,le+=he*$e,Ne+=le>>>16,le&=65535,Ne+=Y*Pe,He+=Ne>>>16,Ne&=65535,Ne+=H*$e,He+=Ne>>>16,Ne&=65535,Ne+=he*Ie,He+=Ne>>>16,Ne&=65535,He+=k*Pe+Y*$e+H*Ie+he*je,He&=65535,l(le<<16|me,He<<16|Ne,this.unsigned)},v.mul=v.multiply,v.divide=function(S){if(n(S)||(S=f(S)),S.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var w=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?E:T;var k,Y,H;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return E;if(S.gt(this.shru(1)))return O;H=E}else{if(this.eq(L)){if(S.eq(A)||S.eq(R))return L;if(S.eq(L))return A;var he=this.shr(1);return k=he.div(S).shl(1),k.eq(T)?S.isNegative()?A:R:(Y=this.sub(S.mul(k)),H=k.add(Y.div(S)),H)}else if(S.eq(L))return this.unsigned?E:T;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();H=T}for(Y=this;Y.gte(S);){k=Math.max(1,Math.floor(Y.toNumber()/S.toNumber()));for(var je=Math.ceil(Math.log(k)/Math.LN2),Ie=je<=48?1:u(2,je-48),$e=c(k),Pe=$e.mul(S);Pe.isNegative()||Pe.gt(Y);)k-=Ie,$e=c(k,this.unsigned),Pe=$e.mul(S);$e.isZero()&&($e=A),H=H.add($e),Y=Y.sub(Pe)}return H},v.div=v.divide,v.modulo=function(S){if(n(S)||(S=f(S)),e){var w=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,S.low,S.high);return l(w,e.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},v.mod=v.modulo,v.rem=v.modulo,v.not=function(){return l(~this.low,~this.high,this.unsigned)},v.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},v.clz=v.countLeadingZeros,v.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},v.ctz=v.countTrailingZeros,v.and=function(S){return n(S)||(S=f(S)),l(this.low&S.low,this.high&S.high,this.unsigned)},v.or=function(S){return n(S)||(S=f(S)),l(this.low|S.low,this.high|S.high,this.unsigned)},v.xor=function(S){return n(S)||(S=f(S)),l(this.low^S.low,this.high^S.high,this.unsigned)},v.shiftLeft=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low<<S,this.high<<S|this.low>>>32-S,this.unsigned):l(0,this.low<<S-32,this.unsigned)},v.shl=v.shiftLeft,v.shiftRight=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>S,this.unsigned):l(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},v.shr=v.shiftRight,v.shiftRightUnsigned=function(S){return n(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?l(this.low>>>S|this.high<<32-S,this.high>>>S,this.unsigned):S===32?l(this.high,0,this.unsigned):l(this.high>>>S-32,0,this.unsigned)},v.shru=v.shiftRightUnsigned,v.shr_u=v.shiftRightUnsigned,v.rotateLeft=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.low<<S|this.high>>>w,this.high<<S|this.low>>>w,this.unsigned)):(S-=32,w=32-S,l(this.high<<S|this.low>>>w,this.low<<S|this.high>>>w,this.unsigned))},v.rotl=v.rotateLeft,v.rotateRight=function(S){var w;return n(S)&&(S=S.toInt()),(S&=63)===0?this:S===32?l(this.high,this.low,this.unsigned):S<32?(w=32-S,l(this.high<<w|this.low>>>S,this.low<<w|this.high>>>S,this.unsigned)):(S-=32,w=32-S,l(this.low<<w|this.high>>>S,this.high<<w|this.low>>>S,this.unsigned))},v.rotr=v.rotateRight,v.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},v.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},v.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},v.toBytesLE=function(){var S=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},v.toBytesBE=function(){var S=this.high,w=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,w>>>24,w>>>16&255,w>>>8&255,w&255]},r.fromBytes=function(S,w,k){return k?r.fromBytesLE(S,w):r.fromBytesBE(S,w)},r.fromBytesLE=function(S,w){return new r(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,w)},r.fromBytesBE=function(S,w){return new r(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],w)},typeof BigInt=="function"&&(r.fromBigInt=function(S,w){var k=Number(BigInt.asIntN(32,S)),Y=Number(BigInt.asIntN(32,S>>BigInt(32)));return l(k,Y,w)},r.fromValue=function(S,w){return typeof S=="bigint"?r.fromBigInt(S,w):f(S,w)},v.toBigInt=function(){var S=BigInt(this.low>>>0),w=BigInt(this.unsigned?this.high>>>0:this.high);return w<<BigInt(32)|S});var oe=t.default=r})});var vo=y(vD=>{"use strict";var Ae=vD;Ae.asPromise=gD();Ae.base64=BQ();Ae.EventEmitter=VQ();Ae.float=JQ();Ae.inquire=QQ();Ae.utf8=t7();Ae.pool=n7();Ae.LongBits=o7();function s7(t){return t==="__proto__"||t==="prototype"||t==="constructor"}Ae.isUnsafeProperty=s7;Ae.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);Ae.global=Ae.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||vD;Ae.emptyArray=Object.freeze?Object.freeze([]):[];Ae.emptyObject=Object.freeze?Object.freeze({}):{};Ae.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};Ae.isString=function(e){return typeof e=="string"||e instanceof String};Ae.isObject=function(e){return e&&typeof e=="object"};Ae.isset=Ae.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};Ae.Buffer=(function(){try{var t=Ae.global.Buffer;return t.prototype.utf8Write?t:null}catch{return null}})();Ae._Buffer_from=null;Ae._Buffer_allocUnsafe=null;Ae.newBuffer=function(e){return typeof e=="number"?Ae.Buffer?Ae._Buffer_allocUnsafe(e):new Ae.Array(e):Ae.Buffer?Ae._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};Ae.Array=typeof Uint8Array<"u"?Uint8Array:Array;Ae.Long=Ae.global.dcodeIO&&Ae.global.dcodeIO.Long||Ae.global.Long||(function(){try{var t=ED();return t&&t.isLong?t:null}catch{return null}})();Ae.key2Re=/^true|false|0|1$/;Ae.key32Re=/^-?(?:0|[1-9][0-9]*)$/;Ae.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;Ae.longToHash=function(e){return e?Ae.LongBits.from(e).toHash():Ae.LongBits.zeroHash};Ae.longFromHash=function(e,r){var n=Ae.LongBits.fromHash(e);return Ae.Long?Ae.Long.fromBits(n.lo,n.hi,r):n.toNumber(!!r)};function a7(t){var e=typeof arguments[arguments.length-1]=="boolean",r=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<r;++n){var i=arguments[n];if(i)for(var o=Object.keys(i),s=0;s<o.length;++s)!s7(o[s])&&(t[o[s]]===void 0||!e)&&(t[o[s]]=i[o[s]])}return t}Ae.merge=a7;Ae.nestingLimit=32;Ae.recursionLimit=100;Ae.makeProp=function(e,r){Object.defineProperty(e,r,{enumerable:!0,configurable:!0,writable:!0})};Ae.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function c7(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&a7(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}Ae.newError=c7;Ae.ProtocolError=c7("ProtocolError");Ae.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var i=Object.keys(this),o=i.length-1;o>-1;--o)if(r[i[o]]===1&&this[i[o]]!==void 0&&this[i[o]]!==null)return i[o]}};Ae.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};Ae.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};Ae._configure=function(){var t=Ae.Buffer;if(!t){Ae._Buffer_from=Ae._Buffer_allocUnsafe=null;return}Ae._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},Ae._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var ZA=y((nRt,f7)=>{"use strict";f7.exports=ft;var ji=vo(),bD,KA=ji.LongBits,l7=ji.base64,u7=ji.utf8;function My(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function wD(){}function Gke(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function ft(){this.len=0,this.head=new My(wD,0,0),this.tail=this.head,this.states=null}var d7=function(){return ji.Buffer?function(){return(ft.create=function(){return new bD})()}:function(){return new ft}};ft.create=d7();ft.alloc=function(e){return new ji.Array(e)};ji.Array!==Array&&(ft.alloc=ji.pool(ft.alloc,ji.Array.prototype.subarray));ft.prototype._push=function(e,r,n){return this.tail=this.tail.next=new My(e,r,n),this.len+=r,this};function AD(t,e,r){e[r]=t&255}function Hke(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function xD(t,e){this.len=t,this.next=void 0,this.val=e}xD.prototype=Object.create(My.prototype);xD.prototype.fn=Hke;ft.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new xD((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};ft.prototype.int32=function(e){return(e|=0)<0?this._push(RD,10,KA.fromNumber(e)):this.uint32(e)};ft.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function RD(t,e,r){for(var n=t.lo,i=t.hi;i;)e[r++]=n&127|128,n=(n>>>7|i<<25)>>>0,i>>>=7;for(;n>127;)e[r++]=n&127|128,n=n>>>7;e[r++]=n}ft.prototype.uint64=function(e){var r=KA.from(e);return this._push(RD,r.length(),r)};ft.prototype.int64=ft.prototype.uint64;ft.prototype.sint64=function(e){var r=KA.from(e).zzEncode();return this._push(RD,r.length(),r)};ft.prototype.bool=function(e){return this._push(AD,1,e?1:0)};function TD(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}ft.prototype.fixed32=function(e){return this._push(TD,4,e>>>0)};ft.prototype.sfixed32=ft.prototype.fixed32;ft.prototype.fixed64=function(e){var r=KA.from(e);return this._push(TD,4,r.lo)._push(TD,4,r.hi)};ft.prototype.sfixed64=ft.prototype.fixed64;ft.prototype.float=function(e){return this._push(ji.float.writeFloatLE,4,e)};ft.prototype.double=function(e){return this._push(ji.float.writeDoubleLE,8,e)};var Wke=ji.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var i=0;i<e.length;++i)r[n+i]=e[i]};ft.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(AD,1,0);if(ji.isString(e)){var n=ft.alloc(r=l7.length(e));l7.decode(e,n,0),e=n}return this.uint32(r)._push(Wke,r,e)};ft.prototype.string=function(e){var r=u7.length(e);return r?this.uint32(r)._push(u7.write,r,e):this._push(AD,1,0)};ft.prototype.fork=function(){return this.states=new Gke(this),this.head=this.tail=new My(wD,0,0),this.len=0,this};ft.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new My(wD,0,0),this.len=0),this};ft.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};ft.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};ft._configure=function(t){bD=t,ft.create=d7(),bD._configure()}});var m7=y((iRt,h7)=>{"use strict";h7.exports=ps;var p7=ZA();(ps.prototype=Object.create(p7.prototype)).constructor=ps;var Fc=vo();function ps(){p7.call(this)}ps._configure=function(){ps.alloc=Fc._Buffer_allocUnsafe,ps.writeBytesBuffer=Fc.Buffer&&Fc.Buffer.prototype instanceof Uint8Array&&Fc.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var i=0;i<e.length;)r[n++]=e[i++]}};ps.prototype.bytes=function(e){Fc.isString(e)&&(e=Fc._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(ps.writeBytesBuffer,r,e),this};function Yke(t,e,r){t.length<40?Fc.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}ps.prototype.string=function(e){var r=Fc.Buffer.byteLength(e);return this.uint32(r),r&&this._push(Yke,r,e),this};ps._configure()});var XA=y((oRt,E7)=>{"use strict";E7.exports=Wt;var Bi=vo(),ID,y7=Bi.LongBits,Kke=Bi.utf8;function bo(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Wt(t){this.buf=t,this.pos=0,this.len=t.length}var g7=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Wt(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Wt(e);throw Error("illegal buffer")},S7=function(){return Bi.Buffer?function(r){return(Wt.create=function(i){return Bi.Buffer.isBuffer(i)?new ID(i):g7(i)})(r)}:g7};Wt.create=S7();Wt.prototype._slice=Bi.Array.prototype.subarray||Bi.Array.prototype.slice;Wt.prototype.uint32=(function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,bo(this,10);return e}})();Wt.prototype.int32=function(){return this.uint32()|0};Wt.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function CD(){var t=new y7(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw bo(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw bo(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Wt.prototype.bool=function(){return this.uint32()!==0};function JA(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Wt.prototype.fixed32=function(){if(this.pos+4>this.len)throw bo(this,4);return JA(this.buf,this.pos+=4)};Wt.prototype.sfixed32=function(){if(this.pos+4>this.len)throw bo(this,4);return JA(this.buf,this.pos+=4)|0};function _7(){if(this.pos+8>this.len)throw bo(this,8);return new y7(JA(this.buf,this.pos+=4),JA(this.buf,this.pos+=4))}Wt.prototype.float=function(){if(this.pos+4>this.len)throw bo(this,4);var e=Bi.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Wt.prototype.double=function(){if(this.pos+8>this.len)throw bo(this,4);var e=Bi.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Wt.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw bo(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(r,n);if(r===n){var i=Bi.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,r,n)};Wt.prototype.string=function(){var e=this.bytes();return Kke.read(e,0,e.length)};Wt.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw bo(this,e);this.pos+=e}else do if(this.pos>=this.len)throw bo(this);while(this.buf[this.pos++]&128);return this};Wt.recursionLimit=Bi.recursionLimit;Wt.prototype.skipType=function(t,e){if(e===void 0&&(e=0),e>Wt.recursionLimit)throw Error("maximum nesting depth exceeded");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!==4;)this.skipType(t,e+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Wt._configure=function(t){ID=t,Wt.create=S7(),ID._configure();var e=Bi.Long?"toLong":"toNumber";Bi.merge(Wt.prototype,{int64:function(){return CD.call(this)[e](!1)},uint64:function(){return CD.call(this)[e](!0)},sint64:function(){return CD.call(this).zzDecode()[e](!1)},fixed64:function(){return _7.call(this)[e](!0)},sfixed64:function(){return _7.call(this)[e](!1)}})}});var w7=y((sRt,T7)=>{"use strict";T7.exports=Bu;var b7=XA();(Bu.prototype=Object.create(b7.prototype)).constructor=Bu;var v7=vo();function Bu(t){b7.call(this,t)}Bu._configure=function(){v7.Buffer&&(Bu.prototype._slice=v7.Buffer.prototype.slice)};Bu.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};Bu._configure()});var x7=y((aRt,A7)=>{"use strict";A7.exports=$y;var PD=vo();($y.prototype=Object.create(PD.EventEmitter.prototype)).constructor=$y;function $y(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");PD.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!r}$y.prototype.rpcCall=function t(e,r,n,i,o){if(!i)throw TypeError("request must be specified");var s=this;if(!o)return PD.asPromise(t,s,e,r,n,i);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(c,l){if(c)return s.emit("error",c,e),o(c);if(l===null){s.end(!0);return}if(!(l instanceof n))try{l=n[s.responseDelimited?"decodeDelimited":"decode"](l)}catch(u){return s.emit("error",u,e),o(u)}return s.emit("data",l,e),o(null,l)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};$y.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var OD=y(R7=>{"use strict";var Zke=R7;Zke.Service=x7()});var ND=y((lRt,C7)=>{"use strict";C7.exports={}});var O7=y(P7=>{"use strict";var Hn=P7;Hn.build="minimal";Hn.Writer=ZA();Hn.BufferWriter=m7();Hn.Reader=XA();Hn.BufferReader=w7();Hn.util=vo();Hn.rpc=OD();Hn.roots=ND();Hn.configure=I7;function I7(){Hn.util._configure(),Hn.Writer._configure(Hn.BufferWriter),Hn.Reader._configure(Hn.BufferReader)}I7()});var k7=y((dRt,N7)=>{"use strict";N7.exports=kD;var Jke=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;function kD(t,e){typeof t=="string"&&(e=t,t=void 0);var r=[];function n(o){if(typeof o!="string"){var s=i();if(kD.verbose&&console.log("codegen: "+s),s="return "+s,o){for(var a=Object.keys(o),c=new Array(a.length+1),l=new Array(a.length),u=0;u<a.length;)c[u]=a[u],l[u]=o[a[u++]];return c[u]=s,Function.apply(null,c).apply(null,l)}return Function(s)()}for(var d=new Array(arguments.length-1),f=0;f<d.length;)d[f]=arguments[++f];if(f=0,o=o.replace(/%([%dfijs])/g,function(h,m){var g=d[f++];switch(m){case"d":case"f":return String(Number(g));case"i":return String(Math.floor(g));case"j":return JSON.stringify(g);case"s":return String(g)}return"%"}),f!==d.length)throw Error("parameter count mismatch");return r.push(o),n}function i(o){return"function "+Xke(o||e)+"("+(t&&t.join(",")||"")+`){
|
|
8
8
|
`+r.join(`
|
|
9
9
|
`)+`
|
|
10
10
|
}`}return n.toString=i,n}kD.verbose=!1;function Xke(t){return!t||(t=String(t).replace(/[^\w$]/g,""),!t)?"":(/^\d/.test(t)&&(t="_"+t),Jke.test(t)?t+"_":t)}});var $7=y((fRt,M7)=>{"use strict";var vp=null;try{vp=Z("fs"),(!vp||!vp.readFile||!vp.readFileSync)&&(vp=null)}catch{}M7.exports=vp});var L7=y((pRt,D7)=>{"use strict";D7.exports=Dy;var Qke=gD(),MD=$7();function Dy(t,e,r){return typeof e=="function"?(r=e,e={}):e||(e={}),r?!e.xhr&&MD&&MD.readFile?MD.readFile(t,function(i,o){return i&&typeof XMLHttpRequest<"u"?Dy.xhr(t,e,r):i?r(i):r(null,e.binary?o:o.toString("utf8"))}):Dy.xhr(t,e,r):Qke(Dy,this,t,e)}Dy.xhr=function(e,r,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return n(Error("status "+i.status));if(r.binary){var s=i.response;if(!s){s=[];for(var a=0;a<i.responseText.length;++a)s.push(i.responseText.charCodeAt(a)&255)}return n(null,typeof Uint8Array<"u"?new Uint8Array(s):s)}return n(null,i.responseText)}},r.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}});var z7=y(F7=>{"use strict";var DD=F7,U7=DD.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},$D=DD.normalize=function(e){e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var r=e.split("/"),n=U7(e),i="";n&&(i=r.shift()+"/");for(var o=0;o<r.length;)r[o]===".."?o>0&&r[o-1]!==".."?r.splice(--o,2):n?r.splice(o,1):++o:r[o]==="."?r.splice(o,1):++o;return i+r.join("/")};DD.resolve=function(e,r,n){return n||(r=$D(r)),U7(r)?r:(n||(e=$D(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?$D(e+"/"+r):r)}});var B7=y(j7=>{"use strict";var LD=j7;LD.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;LD.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;LD.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/});var V7=y((gRt,q7)=>{"use strict";var bp=null;try{bp=Z("fs"),(!bp||!bp.readFile||!bp.readFileSync)&&(bp=null)}catch{}q7.exports=bp});var wp=y((_Rt,W7)=>{"use strict";W7.exports=at;var QA=jc();((at.prototype=Object.create(QA.prototype)).constructor=at).className="Namespace";var UD=zc(),Vu=Ir(),eMe=Hu(),qu,Tp,Gu;at.fromJSON=function(e,r,n){return n=Vu.checkDepth(n),new at(e,r.options).addJSON(r.nested,n)};function G7(t,e){if(t&&t.length){for(var r={},n=0;n<t.length;++n)r[t[n].name]=t[n].toJSON(e);return r}}at.arrayToJSON=G7;at.isReservedId=function(e,r){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!="string"&&e[n][0]<=r&&e[n][1]>r)return!0}return!1};at.isReservedName=function(e,r){if(e){for(var n=0;n<e.length;++n)if(e[n]===r)return!0}return!1};function at(t,e){QA.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function H7(t){t._nestedArray=null,t._lookupCache=Object.create(null);for(var e=t;e=e.parent;)e._lookupCache=Object.create(null);return t}Object.defineProperty(at.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=Vu.toArray(this.nested))}});at.prototype.toJSON=function(e){return Vu.toObject(["options",this.options,"nested",G7(this.nestedArray,e)])};at.prototype.addJSON=function(e,r){r=Vu.checkDepth(r);var n=this;if(e)for(var i=Object.keys(e),o=0,s;o<i.length;++o)s=e[i[o]],n.add((s.fields!==void 0?qu.fromJSON:s.values!==void 0?Gu.fromJSON:s.methods!==void 0?Tp.fromJSON:s.id!==void 0?UD.fromJSON:at.fromJSON)(i[o],s,r+1));return this};at.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};at.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof Gu)return this.nested[e].values;throw Error("no such enum: "+e)};at.prototype.add=function(e){if(!(e instanceof UD&&e.extend!==void 0||e instanceof qu||e instanceof eMe||e instanceof Gu||e instanceof Tp||e instanceof at))throw TypeError("object must be a valid nested object");if(e.name==="__proto__")return this;if(!this.nested)this.nested={};else{var r=this.get(e.name);if(r)if(r instanceof at&&e instanceof at&&!(r instanceof qu||r instanceof Tp)){for(var n=r.nestedArray,i=0;i<n.length;++i)e.add(n[i]);this.remove(r),this.nested||(this.nested={}),e.setOptions(r.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof qu||this instanceof Tp||this instanceof Gu||this instanceof UD||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var o=this;o=o.parent;)o._needsRecursiveFeatureResolution=!0,o._needsRecursiveResolve=!0;return e.onAdd(this),H7(this)};at.prototype.remove=function(e){if(!(e instanceof QA))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),H7(this)};at.prototype.define=function(e,r){if(Vu.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");if(e.length>Vu.recursionLimit)throw Error("max depth exceeded");for(var n=this;e.length>0;){var i=e.shift();if(n.nested&&n.nested[i]){if(n=n.nested[i],!(n instanceof at))throw Error("path conflicts with non-namespace objects")}else n.add(n=new at(i))}return r&&n.addJSON(r),n};at.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,r=0;for(this.resolve();r<e.length;)e[r]instanceof at?e[r++].resolveAll():e[r++].resolve();return this._needsRecursiveResolve=!1,this};at.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,QA.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};at.prototype.lookup=function(e,r,n){if(typeof r=="boolean"?(n=r,r=void 0):r&&!Array.isArray(r)&&(r=[r]),Vu.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var i=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),r);var o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+i];if(o&&(!r||r.indexOf(o.constructor)>-1)||(o=this._lookupImpl(e,i),o&&(!r||r.indexOf(o.constructor)>-1)))return o;if(n)return null;for(var s=this;s.parent;){if(o=s.parent._lookupImpl(e,i),o&&(!r||r.indexOf(o.constructor)>-1))return o;s=s.parent}return null};at.prototype._lookupImpl=function(e,r){if(Object.prototype.hasOwnProperty.call(this._lookupCache,r))return this._lookupCache[r];var n=this.get(e[0]),i=null;if(n)e.length===1?i=n:n instanceof at&&(e=e.slice(1),i=n._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof at&&(n=this._nestedArray[o]._lookupImpl(e,r))){i=n;break}return this._lookupCache[r]=i,i};at.prototype.lookupType=function(e){var r=this.lookup(e,[qu]);if(!r)throw Error("no such type: "+e);return r};at.prototype.lookupEnum=function(e){var r=this.lookup(e,[Gu]);if(!r)throw Error("no such Enum '"+e+"' in "+this);return r};at.prototype.lookupTypeOrEnum=function(e){var r=this.lookup(e,[qu,Gu]);if(!r)throw Error("no such Type or Enum '"+e+"' in "+this);return r};at.prototype.lookupService=function(e){var r=this.lookup(e,[Tp]);if(!r)throw Error("no such Service '"+e+"' in "+this);return r};at._configure=function(t,e,r){qu=t,Tp=e,Gu=r}});var ex=y((yRt,Y7)=>{"use strict";Y7.exports=Sa;var FD=zc();((Sa.prototype=Object.create(FD.prototype)).constructor=Sa).className="MapField";var tMe=Wu(),Ly=Ir();function Sa(t,e,r,n,i,o){if(FD.call(this,t,e,n,void 0,void 0,i,o),!Ly.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}Sa.fromJSON=function(e,r){return new Sa(e,r.id,r.keyType,r.type,r.options,r.comment)};Sa.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Ly.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};Sa.prototype.resolve=function(){if(this.resolved)return this;if(tMe.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return FD.prototype.resolve.call(this)};Sa.d=function(e,r,n){return typeof n=="function"?n=Ly.decorateType(n).name:n&&typeof n=="object"&&(n=Ly.decorateEnum(n).name),function(o,s){Ly.decorateType(o.constructor).add(new Sa(s,e,r,n))}}});var tx=y((SRt,K7)=>{"use strict";K7.exports=Yu;var zD=jc();((Yu.prototype=Object.create(zD.prototype)).constructor=Yu).className="Method";var Ap=Ir();function Yu(t,e,r,n,i,o,s,a,c){if(Ap.isObject(i)?(s=i,i=o=void 0):Ap.isObject(o)&&(s=o,o=void 0),!(e===void 0||Ap.isString(e)))throw TypeError("type must be a string");if(!Ap.isString(r))throw TypeError("requestType must be a string");if(!Ap.isString(n))throw TypeError("responseType must be a string");zD.call(this,t,s),this.type=e||"rpc",this.requestType=r,this.requestStream=i?!0:void 0,this.responseType=n,this.responseStream=o?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=c}Yu.fromJSON=function(e,r){return new Yu(e,r.type,r.requestType,r.responseType,r.requestStream,r.responseStream,r.options,r.comment,r.parsedOptions)};Yu.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Ap.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",r?this.comment:void 0,"parsedOptions",this.parsedOptions])};Yu.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),zD.prototype.resolve.call(this))}});var rx=y((ERt,J7)=>{"use strict";J7.exports=hi;var Ea=wp();((hi.prototype=Object.create(Ea.prototype)).constructor=hi).className="Service";var jD=tx(),xp=Ir(),rMe=OD(),nMe=xp.patterns.reservedRe;function hi(t,e){Ea.call(this,t,e),this.methods={},this._methodsArray=null}hi.fromJSON=function(e,r,n){n=xp.checkDepth(n);var i=new hi(e,r.options);if(r.methods)for(var o=Object.keys(r.methods),s=0;s<o.length;++s)i.add(jD.fromJSON(o[s],r.methods[o[s]]));return r.nested&&i.addJSON(r.nested,n),r.edition&&(i._edition=r.edition),i.comment=r.comment,i._defaultEdition="proto3",i};hi.prototype.toJSON=function(e){var r=Ea.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return xp.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"methods",Ea.arrayToJSON(this.methodsArray,e)||{},"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(hi.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=xp.toArray(this.methods))}});function Z7(t){return t._methodsArray=null,t}hi.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:Ea.prototype.get.call(this,e)};hi.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Ea.prototype.resolve.call(this);for(var e=this.methodsArray,r=0;r<e.length;++r)e[r].resolve();return this};hi.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Ea.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(r=>{r._resolveFeaturesRecursive(e)}),this):this};hi.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof jD?e.name==="__proto__"?this:(this.methods[e.name]=e,e.parent=this,Z7(this)):Ea.prototype.add.call(this,e)};hi.prototype.remove=function(e){if(e instanceof jD){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,Z7(this)}return Ea.prototype.remove.call(this,e)};hi.prototype.create=function(e,r,n){for(var i=new rMe.Service(e,r,n),o=0,s;o<this.methodsArray.length;++o){var a=xp.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");i[a]=xp.codegen(["r","c"],nMe.test(a)?a+"_":a)("return this.rpcCall(m,q,s,r,c)")({m:s,q:s.resolvedRequestType.ctor,s:s.resolvedResponseType.ctor})}return i}});var nx=y((vRt,X7)=>{"use strict";X7.exports=hs;var iMe=vo();function hs(t){if(t)for(var e=Object.keys(t),r=0;r<e.length;++r){var n=e[r];n!=="__proto__"&&(this[n]=t[n])}}hs.create=function(e){return this.$type.create(e)};hs.encode=function(e,r){return this.$type.encode(e,r)};hs.encodeDelimited=function(e,r){return this.$type.encodeDelimited(e,r)};hs.decode=function(e){return this.$type.decode(e)};hs.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};hs.verify=function(e){return this.$type.verify(e)};hs.fromObject=function(e){return this.$type.fromObject(e)};hs.toObject=function(e,r){return this.$type.toObject(e,r)};hs.prototype.toJSON=function(){return this.$type.toObject(this,iMe.toJSONOptions)}});var BD=y((bRt,eee)=>{"use strict";eee.exports=aMe;var oMe=To(),va=Wu(),Q7=Ir();function sMe(t){return"missing required '"+t.name+"'"}function aMe(t){for(var e=Q7.codegen(["r","l","e","n"],t.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(n===undefined)n=0")("if(n>Reader.recursionLimit)")('throw Error("maximum nesting depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(t.fieldsArray.filter(function(a){return a.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),r=0;r<t.fieldsArray.length;++r){var n=t._fieldsArray[r].resolve(),i=n.resolvedType instanceof oMe?"int32":n.type,o="m"+Q7.safeProp(n.name);e("case %i: {",n.id),n.map?(e("if(%s===util.emptyObject)",o)("%s={}",o)("var c2 = r.uint32()+r.pos"),va.defaults[n.keyType]!==void 0?e("k=%j",va.defaults[n.keyType]):e("k=null"),va.defaults[i]!==void 0?e("value=%j",va.defaults[i]):e("value=null"),e("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",n.keyType)("case 2:"),va.basic[i]===void 0?e("value=types[%i].decode(r,r.uint32(),undefined,n+1)",r):e("value=r.%s()",i),e("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}"),va.long[n.keyType]!==void 0?e('%s[typeof k==="object"?util.longToHash(k):k]=value',o):(n.keyType==="string"&&e('if(k==="__proto__")')("util.makeProp(%s,k)",o),e("%s[k]=value",o))):n.repeated?(e("if(!(%s&&%s.length))",o,o)("%s=[]",o),va.packed[i]!==void 0&&e("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",o,i)("}else"),va.basic[i]===void 0?e(n.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))":"%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",o,r):e("%s.push(r.%s())",o,i)):va.basic[i]===void 0?e(n.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)":"%s=types[%i].decode(r,r.uint32(),undefined,n+1)",o,r):e("%s=r.%s()",o,i),e("break")("}")}for(e("default:")("r.skipType(t&7,n)")("break")("}")("}"),r=0;r<t._fieldsArray.length;++r){var s=t._fieldsArray[r];s.required&&e("if(!m.hasOwnProperty(%j))",s.name)("throw util.ProtocolError(%j,{instance:m})",sMe(s))}return e("return m")}});var GD=y((TRt,tee)=>{"use strict";tee.exports=uMe;var cMe=To(),qD=Ir();function qi(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function VD(t,e,r,n){if(e.resolvedType)if(e.resolvedType instanceof cMe){t("switch(%s){",n)("default:")("return%j",qi(e,"enum value"));for(var i=Object.keys(e.resolvedType.values),o=0;o<i.length;++o)t("case %i:",e.resolvedType.values[i[o]]);t("break")("}")}else t("{")("var e=types[%i].verify(%s,n+1);",r,n)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",n)("return%j",qi(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",qi(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',n)("return%j",qi(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',n)("return%j",qi(e,"boolean"));break;case"string":t("if(!util.isString(%s))",n)("return%j",qi(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",qi(e,"buffer"));break}return t}function lMe(t,e,r){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",r)("return%j",qi(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",r)("return%j",qi(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",r)("return%j",qi(e,"boolean key"));break}return t}function uMe(t){var e=qD.codegen(["m","n"],t.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(n===undefined)n=0")("if(n>util.recursionLimit)")("return%j","maximum nesting depth exceeded"),r=t.oneofsArray,n={};r.length&&e("var p={}");for(var i=0;i<t.fieldsArray.length;++i){var o=t._fieldsArray[i].resolve(),s="m"+qD.safeProp(o.name);if(o.optional&&e("if(%s!=null&&m.hasOwnProperty(%j)){",s,o.name),o.map)e("if(!util.isObject(%s))",s)("return%j",qi(o,"object"))("var k=Object.keys(%s)",s)("for(var i=0;i<k.length;++i){"),lMe(e,o,"k[i]"),VD(e,o,i,s+"[k[i]]")("}");else if(o.repeated)e("if(!Array.isArray(%s))",s)("return%j",qi(o,"array"))("for(var i=0;i<%s.length;++i){",s),VD(e,o,i,s+"[i]")("}");else{if(o.partOf){var a=qD.safeProp(o.partOf.name);n[o.partOf.name]===1&&e("if(p%s===1)",a)("return%j",o.partOf.name+": multiple values"),n[o.partOf.name]=1,e("p%s=1",a)}VD(e,o,i,s)}o.optional&&e("}")}return e("return null")}});var YD=y(nee=>{"use strict";var ree=nee,Uy=To(),ms=Ir();function HD(t,e,r,n){var i=!1;if(e.resolvedType)if(e.resolvedType instanceof Uy){t("switch(d%s){",n);for(var o=e.resolvedType.values,s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]===e.typeDefault&&!i&&(t("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),e.repeated||t("break"),i=!0),t("case%j:",s[a])("case %i:",o[s[a]])("m%s=%j",n,o[s[a]])("break");t("}")}else t('if(typeof d%s!=="object")',n)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s,n+1)",n,r,n);else{var c=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",n,n);break;case"uint64":case"fixed64":c=!0;case"int64":case"sint64":case"sfixed64":t("if(util.Long)")("m%s=util.Long.fromValue(d%s,%j)",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":t('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":t("m%s=String(d%s)",n,n);break;case"bool":t("m%s=Boolean(d%s)",n,n);break}}return t}ree.fromObject=function(e){var r=e.fieldsArray,n=ms.codegen(["d","n"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d")("if(n===undefined)n=0")("if(n>util.recursionLimit)")('throw Error("maximum nesting depth exceeded")');if(!r.length)return n("return new this.ctor");n("var m=new this.ctor");for(var i=0;i<r.length;++i){var o=r[i].resolve(),s=ms.safeProp(o.name);o.map?(n("if(d%s){",s)('if(typeof d%s!=="object")',s)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",s)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",s),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",s),HD(n,o,i,s+"[ks[i]]")("}")("}")):o.repeated?(n("if(d%s){",s)("if(!Array.isArray(d%s))",s)("throw TypeError(%j)",o.fullName+": array expected")("m%s=[]",s)("for(var i=0;i<d%s.length;++i){",s),HD(n,o,i,s+"[i]")("}")("}")):(o.resolvedType instanceof Uy||n("if(d%s!=null){",s),HD(n,o,i,s),o.resolvedType instanceof Uy||n("}"))}return n("return m")};function WD(t,e,r,n){if(e.resolvedType)e.resolvedType instanceof Uy?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):t("d%s=types[%i].toObject(m%s,o,q+1)",n,r,n);else{var i=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":case"fixed64":i=!0;case"int64":case"sint64":case"sfixed64":t('if(typeof BigInt!=="undefined"&&o.longs===BigInt)')('d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()',n,n,n,n,n,i)('else if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:t("d%s=m%s",n,n);break}}return t}ree.toObject=function(e){var r=e.fieldsArray.slice().sort(ms.compareFieldsById);if(!r.length)return ms.codegen()("return {}");for(var n=ms.codegen(["m","o","q"],e.name+"$toObject")("if(!o)")("o={}")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")')("var d={}"),i=[],o=[],s=[],a=0;a<r.length;++a)r[a].partOf||(r[a].resolve().repeated?i:r[a].map?o:s).push(r[a]);if(i.length){for(n("if(o.arrays||o.defaults){"),a=0;a<i.length;++a)n("d%s=[]",ms.safeProp(i[a].name));n("}")}if(o.length){for(n("if(o.objects||o.defaults){"),a=0;a<o.length;++a)n("d%s={}",ms.safeProp(o[a].name));n("}")}if(s.length){for(n("if(o.defaults){"),a=0;a<s.length;++a){var c=s[a],l=ms.safeProp(c.name);if(c.resolvedType instanceof Uy)n("d%s=o.enums===String?%j:%j",l,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)('d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n',l)("}else")('d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i',l,c.typeDefault.toString(),c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var u=Array.prototype.slice.call(c.typeDefault);n("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%j",l,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else n("d%s=%j",l,c.typeDefault)}n("}")}var d=!1;for(a=0;a<r.length;++a){var c=r[a],f=e._fieldsArray.indexOf(c),l=ms.safeProp(c.name);c.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",l),WD(n,c,f,l+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),WD(n,c,f,l+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",l,c.name),WD(n,c,f,l),c.partOf&&n("if(o.oneofs)")("d%s=%j",ms.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}});var KD=y(iee=>{"use strict";var dMe=iee,fMe=nx(),pMe=vo();dMe[".google.protobuf.Any"]={fromObject:function(t,e){if(t&&t["@type"]){var r=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(r);if(n){var i=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return i.indexOf("/")===-1&&(i="/"+i),this.create({type_url:i,value:n.encode(n.fromObject(t,e===void 0?1:e+1)).finish()})}}return this.fromObject(t,e)},toObject:function(t,e,r){if(r===void 0&&(r=0),r>pMe.recursionLimit)throw Error("max depth exceeded");var n="type.googleapis.com/",i="",o="";if(e&&e.json&&t.type_url&&t.value){o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),i=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var s=this.lookup(o);s&&(t=s.decode(t.value,void 0,void 0,r+1))}if(!(t instanceof this.ctor)&&t instanceof fMe){var a=t.$type.toObject(t,e,r+1),c=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return i===""&&(i=n),o=i+c,a["@type"]=o,a}return this.toObject(t,e,r)}}});var sx=y((xRt,see)=>{"use strict";see.exports=kt;var Vi=wp();((kt.prototype=Object.create(Vi.prototype)).constructor=kt).className="Type";var hMe=To(),XD=Hu(),ix=zc(),mMe=ex(),gMe=rx(),ZD=nx(),JD=XA(),_Me=ZA(),qr=Ir(),yMe=QD(),SMe=BD(),EMe=GD(),oee=YD(),vMe=KD();function kt(t,e){t=t.replace(/\W/g,""),Vi.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(kt.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var r=this.fields[t[e]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=qr.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=qr.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=kt.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof ZD||((t.prototype=new ZD).constructor=t,qr.merge(t.prototype,e)),t.$type=t.prototype.$type=this,qr.merge(t,ZD,!0),this._ctor=t;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:qr.oneOfGetter(this._oneofsArray[r].oneof),set:qr.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(t.prototype,n)}}});kt.generateConstructor=function(e){for(var r=qr.codegen(["p"],e.name),n=0,i;n<e.fieldsArray.length;++n)(i=e._fieldsArray[n]).map?r("this%s={}",qr.safeProp(i.name)):i.repeated&&r("this%s=[]",qr.safeProp(i.name));return r('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")};function ox(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=null,delete t.encode,delete t.decode,delete t.verify,t}kt.fromJSON=function(e,r,n){if(n===void 0&&(n=0),n>qr.nestingLimit)throw Error("max depth exceeded");var i=new kt(e,r.options);i.extensions=r.extensions,i.reserved=r.reserved;for(var o=Object.keys(r.fields),s=0;s<o.length;++s)i.add((typeof r.fields[o[s]].keyType<"u"?mMe.fromJSON:ix.fromJSON)(o[s],r.fields[o[s]]));if(r.oneofs)for(o=Object.keys(r.oneofs),s=0;s<o.length;++s)i.add(XD.fromJSON(o[s],r.oneofs[o[s]]));if(r.nested)for(o=Object.keys(r.nested),s=0;s<o.length;++s){var a=r.nested[o[s]];i.add((a.id!==void 0?ix.fromJSON:a.fields!==void 0?kt.fromJSON:a.values!==void 0?hMe.fromJSON:a.methods!==void 0?gMe.fromJSON:Vi.fromJSON)(o[s],a,n+1))}return r.extensions&&r.extensions.length&&(i.extensions=r.extensions),r.reserved&&r.reserved.length&&(i.reserved=r.reserved),r.group&&(i.group=!0),r.comment&&(i.comment=r.comment),r.edition&&(i._edition=r.edition),i._defaultEdition="proto3",i};kt.prototype.toJSON=function(e){var r=Vi.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return qr.toObject(["edition",this._editionToJSON(),"options",r&&r.options||void 0,"oneofs",Vi.arrayToJSON(this.oneofsArray,e),"fields",Vi.arrayToJSON(this.fieldsArray.filter(function(i){return!i.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",r&&r.nested||void 0,"comment",n?this.comment:void 0])};kt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Vi.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var r=this.fieldsArray,n=0;n<r.length;)r[n++].resolve();return this};kt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Vi.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(r=>{r._resolveFeatures(e)}),this.fieldsArray.forEach(r=>{r._resolveFeatures(e)}),this):this};kt.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};kt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof ix&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),ox(this))}return e instanceof XD?e.name==="__proto__"?this:(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),ox(this)):Vi.prototype.add.call(this,e)};kt.prototype.remove=function(e){if(e instanceof ix&&e.extend===void 0){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),ox(this)}if(e instanceof XD){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),ox(this)}return Vi.prototype.remove.call(this,e)};kt.prototype.isReservedId=function(e){return Vi.isReservedId(this.reserved,e)};kt.prototype.isReservedName=function(e){return Vi.isReservedName(this.reserved,e)};kt.prototype.create=function(e){return new this.ctor(e)};kt.prototype.setup=function(){for(var e=this.fullName,r=[],n=0;n<this.fieldsArray.length;++n)r.push(this._fieldsArray[n].resolve().resolvedType);this.encode=yMe(this)({Writer:_Me,types:r,util:qr}),this.decode=SMe(this)({Reader:JD,types:r,util:qr}),this.verify=EMe(this)({types:r,util:qr}),this.fromObject=oee.fromObject(this)({types:r,util:qr}),this.toObject=oee.toObject(this)({types:r,util:qr});var i=vMe[e];if(i){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(o),o.toObject=this.toObject,this.toObject=i.toObject.bind(o)}return this};kt.prototype.encode=function(e,r){return this.setup().encode.apply(this,arguments)};kt.prototype.encodeDelimited=function(e,r){return this.encode(e,r&&r.len?r.fork():r).ldelim()};kt.prototype.decode=function(e,r,n,i){return this.setup().decode(e,r,n,i)};kt.prototype.decodeDelimited=function(e){return e instanceof JD||(e=JD.create(e)),this.decode(e,e.uint32())};kt.prototype.verify=function(e,r){return this.setup().verify(e,r)};kt.prototype.fromObject=function(e,r){return this.setup().fromObject(e,r)};kt.prototype.toObject=function(e,r){return this.setup().toObject.apply(this,arguments)};kt.d=function(e){return function(n){qr.decorateType(n,e)}}});var ux=y((RRt,lee)=>{"use strict";lee.exports=mi;var lx=wp();((mi.prototype=Object.create(lx.prototype)).constructor=mi).className="Root";var ax=zc(),eL=To(),bMe=Hu(),gs=Ir(),tL,rL,Fy;function mi(t){lx.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}mi.fromJSON=function(e,r,n){return n=gs.checkDepth(n),r||(r=new mi),e.options&&r.setOptions(e.options),r.addJSON(e.nested,n).resolveAll()};mi.prototype.resolvePath=gs.path.resolve;mi.prototype.fetch=gs.fetch;function cee(){}mi.prototype.load=function t(e,r,n){typeof r=="function"&&(n=r,r=void 0);var i=this;if(!n)return gs.asPromise(t,i,e,r);var o=n===cee;function s(p,h){if(n){if(o)throw p;h&&h.resolveAll();var m=n;n=null,m(p,h)}}function a(p){var h=p.lastIndexOf("google/protobuf/");if(h>-1){var m=p.substring(h);if(m in Fy)return m}return null}function c(p,h,m){m===void 0&&(m=0);try{if(m>gs.recursionLimit)throw Error("max depth exceeded");if(gs.isString(h)&&h.charAt(0)==="{"&&(h=JSON.parse(h)),!gs.isString(h))i.setOptions(h.options).addJSON(h.nested);else{rL.filename=p;var g=rL(h,i,r),_,b=0;if(g.imports)for(;b<g.imports.length;++b)(_=a(g.imports[b])||i.resolvePath(p,g.imports[b]))&&l(_,!1,m+1);if(g.weakImports)for(b=0;b<g.weakImports.length;++b)(_=a(g.weakImports[b])||i.resolvePath(p,g.weakImports[b]))&&l(_,!0,m+1)}}catch(T){s(T)}!o&&!u&&s(null,i)}function l(p,h,m){if(m===void 0&&(m=0),p=a(p)||p,!(i.files.indexOf(p)>-1)){if(i.files.push(p),p in Fy){o?c(p,Fy[p],m):(++u,setTimeout(function(){--u,c(p,Fy[p],m)}));return}if(o){var g;try{g=gs.fs.readFileSync(p).toString("utf8")}catch(_){h||s(_);return}c(p,g,m)}else++u,i.fetch(p,function(_,b){if(--u,!!n){if(_){h?u||s(null,i):s(_);return}c(p,b,m)}})}}var u=0;gs.isString(e)&&(e=[e]);for(var d=0,f;d<e.length;++d)(f=i.resolvePath("",e[d]))&&l(f);return o?(i.resolveAll(),i):(u||s(null,i),i)};mi.prototype.loadSync=function(e,r){if(!gs.isNode)throw Error("not supported");return this.load(e,r,cee)};mi.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return lx.prototype.resolveAll.call(this)};var cx=/^[A-Z]/;function aee(t,e){var r=e.parent.lookup(e.extend);if(r){var n=new ax(e.fullName,e.id,e.type,e.rule,void 0,e.options);return r.get(n.name)||(n.declaringField=e,e.extensionField=n,r.add(n)),!0}return!1}mi.prototype._handleAdd=function(e){if(e instanceof ax)e.extend!==void 0&&!e.extensionField&&(aee(this,e)||this.deferred.push(e));else if(e instanceof eL)cx.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof bMe)){if(e instanceof tL)for(var r=0;r<this.deferred.length;)aee(this,this.deferred[r])?this.deferred.splice(r,1):++r;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);cx.test(e.name)&&(e.parent[e.name]=e)}(e instanceof tL||e instanceof eL||e instanceof ax)&&(this._fullyQualifiedObjects[e.fullName]=e)};mi.prototype._handleRemove=function(e){if(e instanceof ax){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var r=this.deferred.indexOf(e);r>-1&&this.deferred.splice(r,1)}}else if(e instanceof eL)cx.test(e.name)&&delete e.parent[e.name];else if(e instanceof lx){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);cx.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};mi._configure=function(t,e,r){tL=t,rL=e,Fy=r}});var Ir=y((CRt,fee)=>{"use strict";var jt=fee.exports=vo(),uee=ND(),nL,iL;jt.codegen=k7();jt.fetch=L7();jt.path=z7();jt.patterns=B7();var dee=jt.patterns.reservedRe;jt.fs=V7();jt.checkDepth=function(e){if(e===void 0&&(e=0),e>jt.recursionLimit)throw Error("max depth exceeded");return e};jt.toArray=function(e){if(e){for(var r=Object.keys(e),n=new Array(r.length),i=0;i<r.length;)n[i]=e[r[i++]];return n}return[]};jt.toObject=function(e){for(var r={},n=0;n<e.length;){var i=e[n++],o=e[n++];o!==void 0&&(r[i]=o)}return r};jt.isReserved=function(e){return dee.test(e)};jt.safeProp=function(e){return!/^[$\w_]+$/.test(e)||dee.test(e)?"["+JSON.stringify(e)+"]":"."+e};jt.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var TMe=/_([a-z])/g;jt.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(TMe,function(r,n){return n.toUpperCase()})};jt.compareFieldsById=function(e,r){return e.id-r.id};jt.decorateType=function(e,r){if(e.$type)return r&&e.$type.name!==r&&(jt.decorateRoot.remove(e.$type),e.$type.name=r,jt.decorateRoot.add(e.$type)),e.$type;nL||(nL=sx());var n=new nL(r||e.name);return jt.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var wMe=0;jt.decorateEnum=function(e){if(e.$type)return e.$type;iL||(iL=To());var r=new iL("Enum"+wMe++,e);return jt.decorateRoot.add(r),Object.defineProperty(e,"$type",{value:r,enumerable:!1}),r};jt.setProperty=function(e,r,n,i){function o(s,a,c){var l=a.shift();if(jt.isUnsafeProperty(l))return s;if(a.length>0)s[l]=o(s[l]||{},a,c);else{var u=s[l];if(u&&i)return s;u&&(c=[].concat(u).concat(c)),s[l]=c}return s}if(typeof e!="object")throw TypeError("dst must be an object");if(!r)throw TypeError("path must be specified");if(r=r.split("."),r.length>jt.recursionLimit)throw Error("max depth exceeded");return o(e,r,n)};Object.defineProperty(jt,"decorateRoot",{get:function(){return uee.decorated||(uee.decorated=new(ux()))}})});var Wu=y(pee=>{"use strict";var zy=pee,AMe=Ir(),xMe=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function jy(t,e){var r=0,n=Object.create(null);for(e|=0;r<t.length;)n[xMe[r+e]]=t[r++];return n}zy.basic=jy([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);zy.defaults=jy([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",AMe.emptyArray,null]);zy.long=jy([0,0,0,1,1],7);zy.mapKey=jy([0,0,0,5,5,0,0,0,1,1,0,2],2);zy.packed=jy([1,5,0,0,0,5,5,0,0,0,1,1,0])});var zc=y((PRt,mee)=>{"use strict";mee.exports=Pr;var qy=jc();((Pr.prototype=Object.create(qy.prototype)).constructor=Pr).className="Field";var hee=To(),oL=Wu(),dr=Ir(),By,RMe=/^required|optional|repeated$/;Pr.fromJSON=function(e,r){var n=new Pr(e,r.id,r.type,r.rule,r.extend,r.options,r.comment);return r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};function Pr(t,e,r,n,i,o,s){if(dr.isObject(n)?(s=i,o=n,n=i=void 0):dr.isObject(i)&&(s=o,o=i,i=void 0),qy.call(this,t,o),!dr.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!dr.isString(r))throw TypeError("type must be a string");if(n!==void 0&&!RMe.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!dr.isString(i))throw TypeError("extend must be a string");n==="proto3_optional"&&(n="optional"),this.rule=n&&n!=="optional"?n:void 0,this.type=r,this.id=e,this.extend=i||void 0,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=dr.Long?oL.long[r]!==void 0:!1,this.bytes=r==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=s}Object.defineProperty(Pr.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(Pr.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(Pr.prototype,"delimited",{get:function(){return this.resolvedType instanceof By&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(Pr.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(Pr.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});Pr.prototype.setOption=function(e,r,n){return qy.prototype.setOption.call(this,e,r,n)};Pr.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return dr.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",r?this.comment:void 0])};Pr.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=oL.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof By?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof hee&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof hee)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=dr.Long.fromNumber(this.typeDefault,this.type==="uint64"||this.type==="fixed64"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var e;dr.base64.test(this.typeDefault)?dr.base64.decode(this.typeDefault,e=dr.newBuffer(dr.base64.length(this.typeDefault)),0):dr.utf8.write(this.typeDefault,e=dr.newBuffer(dr.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=dr.emptyObject:this.repeated?this.defaultValue=dr.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof By&&(this.parent.ctor.prototype[this.name]=this.defaultValue),qy.prototype.resolve.call(this)};Pr.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var r={};if(this.rule==="required"&&(r.field_presence="LEGACY_REQUIRED"),this.parent&&oL.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof By&&n.group&&(r.message_encoding="DELIMITED")}return this.getOption("packed")===!0?r.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(r.repeated_field_encoding="EXPANDED"),r};Pr.prototype._resolveFeatures=function(e){return qy.prototype._resolveFeatures.call(this,this._edition||e)};Pr.d=function(e,r,n,i){return typeof r=="function"?r=dr.decorateType(r).name:r&&typeof r=="object"&&(r=dr.decorateEnum(r).name),function(s,a){dr.decorateType(s.constructor).add(new Pr(a,e,r,n,{default:i}))}};Pr._configure=function(e){By=e}});var Hu=y((ORt,yee)=>{"use strict";yee.exports=gi;var fx=jc();((gi.prototype=Object.create(fx.prototype)).constructor=gi).className="OneOf";var gee=zc(),dx=Ir();function gi(t,e,r,n){if(Array.isArray(e)||(r=e,e=void 0),fx.call(this,t,r),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=n}gi.fromJSON=function(e,r){return new gi(e,r.oneof,r.options,r.comment)};gi.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return dx.toObject(["options",this.options,"oneof",this.oneof,"comment",r?this.comment:void 0])};function _ee(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}gi.prototype.add=function(e){if(!(e instanceof gee))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,_ee(this),this};gi.prototype.remove=function(e){if(!(e instanceof gee))throw TypeError("field must be a Field");var r=this.fieldsArray.indexOf(e);if(r<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(r,1),r=this.oneof.indexOf(e.name),r>-1&&this.oneof.splice(r,1),e.partOf=null,this};gi.prototype.onAdd=function(e){fx.prototype.onAdd.call(this,e);for(var r=this,n=0;n<this.oneof.length;++n){var i=e.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=r,r.fieldsArray.push(i))}_ee(this)};gi.prototype.onRemove=function(e){for(var r=0,n;r<this.fieldsArray.length;++r)(n=this.fieldsArray[r]).parent&&n.parent.remove(n);fx.prototype.onRemove.call(this,e)};Object.defineProperty(gi.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var t=this.fieldsArray[0];return t.options!=null&&t.options.proto3_optional===!0}});gi.d=function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;)e[r]=arguments[r++];return function(i,o){dx.decorateType(i.constructor).add(new gi(o,e)),Object.defineProperty(i,o,{get:dx.oneOfGetter(e),set:dx.oneOfSetter(e)})}}});var jc=y((NRt,See)=>{"use strict";See.exports=Vr;Vr.className="ReflectionObject";var CMe=Hu(),wo=Ir(),px,IMe={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},PMe={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},OMe={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function Vr(t,e){if(!wo.isString(t))throw TypeError("name must be a string");if(e&&!wo.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(Vr.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});Vr.prototype.toJSON=function(){throw Error()};Vr.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var r=e.root;r instanceof px&&r._handleAdd(this)};Vr.prototype.onRemove=function(e){var r=e.root;r instanceof px&&r._handleRemove(this),this.parent=null,this.resolved=!1};Vr.prototype.resolve=function(){return this.resolved?this:(this.root instanceof px&&(this.resolved=!0),this)};Vr.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};Vr.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var r={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=wo.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")r=Object.assign({},PMe);else if(e==="proto3")r=Object.assign({},OMe);else if(e==="2023")r=Object.assign({},IMe);else throw new Error("Unknown edition: "+e);this._features=wo.merge(r,n),this._featuresResolved=!0;return}if(this.partOf instanceof CMe){var i=wo.merge({},this.partOf._features);this._features=wo.merge(i,n)}else if(!this.declaringField)if(this.parent){var o=wo.merge({},this.parent._features);this._features=wo.merge(o,n)}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};Vr.prototype._inferLegacyProtoFeatures=function(){return{}};Vr.prototype.getOption=function(e){if(this.options)return this.options[e]};Vr.prototype.setOption=function(e,r,n){return e==="__proto__"?this:(this.options||(this.options={}),/^features\./.test(e)?wo.setProperty(this.options,e,r,n):(!n||this.options[e]===void 0)&&(this.getOption(e)!==r&&(this.resolved=!1),this.options[e]=r),this)};Vr.prototype.setParsedOption=function(e,r,n){if(e==="__proto__")return this;this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var o=i.find(function(c){return Object.prototype.hasOwnProperty.call(c,e)});if(o){var s=o[e];wo.setProperty(s,n,r)}else o={},o[e]=wo.setProperty({},n,r),i.push(o)}else{var a={};a[e]=r,i.push(a)}return this};Vr.prototype.setOptions=function(e,r){if(e)for(var n=Object.keys(e),i=0;i<n.length;++i)this.setOption(n[i],e[n[i]],r);return this};Vr.prototype.toString=function(){var e=this.constructor.className,r=this.fullName;return r.length?e+" "+r:e};Vr.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};Vr._configure=function(t){px=t}});var To=y((kRt,vee)=>{"use strict";vee.exports=Ao;var sL=jc();((Ao.prototype=Object.create(sL.prototype)).constructor=Ao).className="Enum";var Eee=wp(),Rp=Ir();function Ao(t,e,r,n,i,o){if(sL.call(this,t,r),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,e)for(var s=Object.keys(e),a=0;a<s.length;++a)s[a]!=="__proto__"&&typeof e[s[a]]=="number"&&(this.valuesById[this.values[s[a]]=e[s[a]]]=s[a])}Ao.prototype._resolveFeatures=function(e){return e=this._edition||e,sL.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(r=>{var n=Rp.merge({},this._features);this._valuesFeatures[r]=Rp.merge(n,this.valuesOptions&&this.valuesOptions[r]&&this.valuesOptions[r].features||{})}),this};Ao.fromJSON=function(e,r){var n=new Ao(e,r.values,r.options,r.comment,r.comments);return n.reserved=r.reserved,r.edition&&(n._edition=r.edition),n._defaultEdition="proto3",n};Ao.prototype.toJSON=function(e){var r=e?!!e.keepComments:!1;return Rp.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",r?this.comment:void 0,"comments",r?this.comments:void 0])};Ao.prototype.add=function(e,r,n,i){if(!Rp.isString(e))throw TypeError("name must be a string");if(!Rp.isInteger(r))throw TypeError("id must be an integer");if(e==="__proto__")return this;if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(r))throw Error("id "+r+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[r]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+r+" in "+this);this.values[e]=r}else this.valuesById[this.values[e]=r]=e;return i&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=i||null),this.comments[e]=n||null,this};Ao.prototype.remove=function(e){if(!Rp.isString(e))throw TypeError("name must be a string");var r=this.values[e];if(r==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[r],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};Ao.prototype.isReservedId=function(e){return Eee.isReservedId(this.reserved,e)};Ao.prototype.isReservedName=function(e){return Eee.isReservedName(this.reserved,e)}});var QD=y((MRt,Tee)=>{"use strict";Tee.exports=kMe;var NMe=To(),aL=Wu(),cL=Ir();function bee(t,e,r,n){return e.delimited?t("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)",r,n,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()",r,n,(e.id<<3|2)>>>0)}function kMe(t){for(var e=cL.codegen(["m","w","q"],t.name+"$encode")("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")'),r,n,i=t.fieldsArray.slice().sort(cL.compareFieldsById),r=0;r<i.length;++r){var o=i[r].resolve(),s=t._fieldsArray.indexOf(o),a=o.resolvedType instanceof NMe?"int32":o.type,c=aL.basic[a];n="m"+cL.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|aL.mapKey[o.keyType],o.keyType),c===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()",s,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|c,a,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&aL.packed[a]!==void 0?e("w.uint32(%i).fork()",(o.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",a,n)("w.ldelim()"):(e("for(var i=0;i<%s.length;++i)",n),c===void 0?bee(e,o,s,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|c)>>>0,a,n)),e("}")):(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name),c===void 0?bee(e,o,s,n):e("w.uint32(%i).%s(%s)",(o.id<<3|c)>>>0,a,n))}return e("return w")}});var Aee=y(($Rt,wee)=>{"use strict";var ct=wee.exports=O7();ct.build="light";function MMe(t,e,r){return typeof e=="function"?(r=e,e=new ct.Root):e||(e=new ct.Root),e.load(t,r)}ct.load=MMe;function $Me(t,e){return e||(e=new ct.Root),e.loadSync(t)}ct.loadSync=$Me;ct.encoder=QD();ct.decoder=BD();ct.verifier=GD();ct.converter=YD();ct.ReflectionObject=jc();ct.Namespace=wp();ct.Root=ux();ct.Enum=To();ct.Type=sx();ct.Field=zc();ct.OneOf=Hu();ct.MapField=ex();ct.Service=rx();ct.Method=tx();ct.Message=nx();ct.wrappers=KD();ct.types=Wu();ct.util=Ir();ct.ReflectionObject._configure(ct.Root);ct.Namespace._configure(ct.Type,ct.Service,ct.Enum);ct.Root._configure(ct.Type);ct.Field._configure(ct.Type)});var uL=y((DRt,Cee)=>{"use strict";Cee.exports=Ree;var lL=/[\s{}=;:[\],'"()<>]/g,DMe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,LMe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,UMe=/^ *[*/]+ */,FMe=/^\s*\*?\/*/,zMe=/\n/g,jMe=/\s/,BMe=/\\(.?)/g,qMe={0:"\0",r:"\r",n:`
|
|
@@ -14,22 +14,22 @@ ${e}`;return Object.assign(new Error(r),t,{stack:i})}var Y$=class extends ONe.Ev
|
|
|
14
14
|
`;)A++;return A}function m(){if(a.length>0)return a.shift();if(c)return u();var E,A,O,R,N,M=r===0;do{if(r===n)return null;for(E=!1;jMe.test(O=d(r));)if(O===`
|
|
15
15
|
`&&(M=!0,++i),++r===n)return null;if(d(r)==="/"){if(++r===n)throw l("comment");if(d(r)==="/")if(e){if(R=r,N=!1,p(r-1)){N=!0;do if(r=h(r),r===n||(r++,!M))break;while(p(r))}else r=Math.min(n,h(r)+1);N&&(f(R,r,M),M=!0),i++,E=!0}else{for(N=d(R=r+1)==="/";d(++r)!==`
|
|
16
16
|
`;)if(r===n)return null;++r,N&&(f(R,r-1,M),M=!0),++i,E=!0}else if((O=d(r))==="*"){R=r+1,N=e||d(R)==="*";do{if(O===`
|
|
17
|
-
`&&++i,++r===n)throw l("comment");A=O,O=d(r)}while(A!=="*"||O!=="/");++r,N&&(f(R,r-2,M),M=!0),E=!0}else return"/"}}while(E);var L=r;lL.lastIndex=0;var v=lL.test(d(L++));if(!v)for(;L<n&&!lL.test(d(L));)++L;var oe=t.substring(r,r=L);return(oe==='"'||oe==="'")&&(c=oe),oe}function g(E){a.push(E)}function _(){if(!a.length){var E=m();if(E===null)return null;g(E)}return a[0]}function b(E,A){var O=_(),R=O===E;if(R)return m(),!0;if(!A)throw l("token '"+O+"', '"+E+"' expected");return!1}function T(E){var A=null,O;return E===void 0?(O=s[i-1],delete s[i-1],O&&(e||O.type==="*"||O.lineEmpty)&&(A=O.leading?O.text:null)):(o<E&&_(),O=s[E],delete s[E],O&&!O.lineEmpty&&(e||O.type==="/")&&(A=O.leading?null:O.text)),A}return Object.defineProperty({next:m,peek:_,push:g,skip:b,cmnt:T},"line",{get:function(){return i}})}});var Mee=y((LRt,kee)=>{"use strict";kee.exports=Ta;Ta.filename=null;Ta.defaults={keepCase:!1};var VMe=uL(),Iee=ux(),Pee=sx(),Oee=zc(),GMe=ex(),Nee=Hu(),HMe=To(),WMe=rx(),YMe=tx(),KMe=jc(),ZMe=Wu(),ba=Ir(),JMe=/^[1-9][0-9]*$/,XMe=/^-?[1-9][0-9]*$/,QMe=/^0[x][0-9a-fA-F]+$/,e$e=/^-?0[x][0-9a-fA-F]+$/,t$e=/^0[0-7]+$/,r$e=/^-?0[0-7]+$/,n$e=ba.patterns.numberRe,_s=/^[a-zA-Z_][a-zA-Z_0-9]*$/,ys=ba.patterns.typeRefRe;function Ta(t,e,r){e instanceof Iee||(r=e,e=new Iee),r||(r=Ta.defaults);var n=r.preferTrailingComment||!1,i=VMe(t,r.alternateCommentMode||!1),o=i.next,s=i.push,a=i.peek,c=i.skip,l=i.cmnt,u=!0,d,f,p,h="proto2",m=e,g=[],_={},b=r.keepCase?function(x){return x}:ba.camelCase;function T(){g.forEach(x=>{x._edition=h,Object.keys(_).forEach(I=>{x.getOption(I)===void 0&&x.setOption(I,_[I],!0)})})}function E(x,I,j){var B=Ta.filename;return j||(Ta.filename=null),Error("illegal "+(I||"token")+" '"+x+"' ("+(B?B+", ":"")+"line "+i.line+")")}function A(){var x=[],I;do{if((I=o())!=='"'&&I!=="'")throw E(I);x.push(o()),c(I),I=a()}while(I==='"'||I==="'");return x.join("")}function O(x){var I=o();switch(I){case"'":case'"':return s(I),A();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return N(I,!0)}catch{if(x&&ys.test(I))return I;throw E(I,"value")}}function R(x,I){var j,B;do if(I&&((j=a())==='"'||j==="'")){var te=A();if(x.push(te),h>=2023)throw E(te,"id")}else try{x.push([B=M(o()),c("to",!0)?M(o()):B])}catch(Ee){if(I&&ys.test(j)&&h>=2023)x.push(j);else throw Ee}while(c(",",!0));var ie={options:void 0};ie.setOption=function(Ee,yt){this.options===void 0&&(this.options={}),this.options[Ee]=yt},w(ie,function(yt){if(yt==="option")Oe(ie,yt),c(";");else throw E(yt)},function(){me(ie)})}function N(x,I){var j=1;switch(x.charAt(0)==="-"&&(j=-1,x=x.substring(1)),x){case"inf":case"INF":case"Inf":return j*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(JMe.test(x))return j*parseInt(x,10);if(QMe.test(x))return j*parseInt(x,16);if(t$e.test(x))return j*parseInt(x,8);if(n$e.test(x))return j*parseFloat(x);throw E(x,"number",I)}function M(x,I){switch(x){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!I&&x.charAt(0)==="-")throw E(x,"id");if(XMe.test(x))return parseInt(x,10);if(e$e.test(x))return parseInt(x,16);if(r$e.test(x))return parseInt(x,8);throw E(x,"id")}function L(){if(d!==void 0)throw E("package");if(d=o(),!ys.test(d))throw E(d,"name");m=m.define(d),c(";")}function v(){var x=a(),I;switch(x){case"weak":I=p||(p=[]),o();break;case"public":o();default:I=f||(f=[]);break}x=A(),c(";"),I.push(x)}function oe(){if(c("="),h=A(),h<2023)throw E(h,"syntax");c(";")}function $(){if(c("="),h=A(),!["2023"].includes(h))throw E(h,"edition");c(";")}function S(x,I,j){switch(j===void 0&&(j=0),I){case"option":return Oe(x,I),c(";"),!0;case"message":return k(x,I,j+1),!0;case"enum":return Ie(x,I),!0;case"service":return nt(x,I,j+1),!0;case"extend":return qe(x,I,j),!0}return!1}function w(x,I,j){var B=i.line;if(x&&(typeof x.comment!="string"&&(x.comment=l()),x.filename=Ta.filename),c("{",!0)){for(var te;(te=o())!=="}";)I(te);c(";",!0)}else j&&j(),c(";"),x&&(typeof x.comment!="string"||n)&&(x.comment=l(B)||x.comment)}function k(x,I,j){if(j===void 0&&(j=0),j>ba.nestingLimit)throw Error("max depth exceeded");if(!_s.test(I=o()))throw E(I,"type name");var B=new Pee(I);w(B,function(ie){if(!S(B,ie,j))switch(ie){case"map":he(B,ie);break;case"required":if(h!=="proto2")throw E(ie);case"repeated":Y(B,ie,void 0,j+1);break;case"optional":if(h==="proto3")Y(B,"proto3_optional",void 0,j+1);else{if(h!=="proto2")throw E(ie);Y(B,"optional",void 0,j+1)}break;case"oneof":je(B,ie,j+1);break;case"extensions":R(B.extensions||(B.extensions=[]));break;case"reserved":R(B.reserved||(B.reserved=[]),!0);break;default:if(h==="proto2"||!ys.test(ie))throw E(ie);s(ie),Y(B,"optional",void 0,j+1);break}}),x.add(B),x===m&&g.push(B)}function Y(x,I,j,B){var te=o();if(te==="group"){H(x,I,B);return}for(;te.endsWith(".")||a().startsWith(".");)te+=o();if(!ys.test(te))throw E(te,"type");var ie=o();if(!_s.test(ie))throw E(ie,"name");ie=b(ie),c("=");var Ee=new Oee(ie,M(o()),te,I,j);if(w(Ee,function(St){if(St==="option")Oe(Ee,St),c(";");else throw E(St)},function(){me(Ee)}),I==="proto3_optional"){var yt=new Nee("_"+ie);Ee.setOption("proto3_optional",!0),yt.add(Ee),x.add(yt)}else x.add(Ee);x===m&&g.push(Ee)}function H(x,I,j){if(j===void 0&&(j=0),j>ba.nestingLimit)throw Error("max depth exceeded");if(h>=2023)throw E("group");var B=o();if(!_s.test(B))throw E(B,"name");var te=ba.lcFirst(B);B===te&&(B=ba.ucFirst(B)),c("=");var ie=M(o()),Ee=new Pee(B);Ee.group=!0;var yt=new Oee(te,ie,B,I);yt.filename=Ta.filename,w(Ee,function(St){switch(St){case"option":Oe(Ee,St),c(";");break;case"required":case"repeated":Y(Ee,St,void 0,j+1);break;case"optional":h==="proto3"?Y(Ee,"proto3_optional",void 0,j+1):Y(Ee,"optional",void 0,j+1);break;case"message":k(Ee,St,j+1);break;case"enum":Ie(Ee,St);break;case"reserved":R(Ee.reserved||(Ee.reserved=[]),!0);break;default:throw E(St)}}),x.add(Ee).add(yt)}function he(x){c("<");var I=o();if(ZMe.mapKey[I]===void 0)throw E(I,"type");c(",");var j=o();if(!ys.test(j))throw E(j,"type");c(">");var B=o();if(!_s.test(B))throw E(B,"name");c("=");var te=new GMe(b(B),M(o()),I,j);w(te,function(Ee){if(Ee==="option")Oe(te,Ee),c(";");else throw E(Ee)},function(){me(te)}),x.add(te)}function je(x,I,j){if(!_s.test(I=o()))throw E(I,"name");var B=new Nee(b(I));w(B,function(ie){ie==="option"?(Oe(B,ie),c(";")):(s(ie),Y(B,"optional",void 0,j))}),x.add(B)}function Ie(x,I){if(!_s.test(I=o()))throw E(I,"name");var j=new HMe(I);w(j,function(te){switch(te){case"option":Oe(j,te),c(";");break;case"reserved":R(j.reserved||(j.reserved=[]),!0),j.reserved===void 0&&(j.reserved=[]);break;default:$e(j,te)}}),x.add(j),x===m&&g.push(j)}function $e(x,I){if(!_s.test(I))throw E(I,"name");c("=");var j=M(o(),!0),B={options:void 0};B.getOption=function(te){return this.options[te]},B.setOption=function(te,ie){KMe.prototype.setOption.call(B,te,ie)},B.setParsedOption=function(){},w(B,function(ie){if(ie==="option")Oe(B,ie),c(";");else throw E(ie)},function(){me(B)}),x.add(I,j,B.comment,B.parsedOptions||B.options)}function Oe(x,I){var j,B,te=!0;for(I==="option"&&(I=o());I!=="=";){if(I==="("){var ie=o();c(")"),I="("+ie+")"}if(te){if(te=!1,I.includes(".")&&!I.includes("(")){var Ee=I.split(".");j=Ee[0]+".",I=Ee[1];continue}j=I}else B=B?B+=I:I;I=o()}var yt=B?j.concat(B):j,lr=Je(x,yt);B=B&&B[0]==="."?B.slice(1):B,j=j&&j[j.length-1]==="."?j.slice(0,-1):j,le(x,j,lr,B)}function Je(x,I,j){if(j===void 0&&(j=0),j>ba.recursionLimit)throw Error("max depth exceeded");if(c("{",!0)){for(var B={};!c("}",!0);){if(!_s.test(z=o()))throw E(z,"name");if(z===null)throw E(z,"end of input");var te,ie=z;if(c(":",!0),a()==="{")te=Je(x,I+"."+z,j+1);else if(a()==="["){te=[];var Ee;if(c("[",!0)){do Ee=O(!0),te.push(Ee);while(c(",",!0));c("]"),typeof Ee<"u"&&Ne(x,I+"."+z,Ee)}}else te=O(!0),Ne(x,I+"."+z,te);var yt=B[ie];yt&&(te=[].concat(yt).concat(te)),ie!=="__proto__"&&(B[ie]=te),c(",",!0),c(";",!0)}return B}var lr=O(!0);return Ne(x,I,lr),lr}function Ne(x,I,j){if(m===x&&/^features\./.test(I)){_[I]=j;return}x.setOption&&x.setOption(I,j)}function le(x,I,j,B){x.setParsedOption&&x.setParsedOption(I,j,B)}function me(x){if(c("[",!0)){do Oe(x,"option");while(c(",",!0));c("]")}return x}function nt(x,I,j){if(j===void 0&&(j=0),j>ba.recursionLimit)throw Error("max depth exceeded");if(!_s.test(I=o()))throw E(I,"service name");var B=new WMe(I);w(B,function(ie){if(!S(B,ie,j))if(ie==="rpc")re(B,ie);else throw E(ie)}),x.add(B),x===m&&g.push(B)}function re(x,I){var j=l(),B=I;if(!_s.test(I=o()))throw E(I,"name");var te=I,ie,Ee,yt,lr;if(c("("),c("stream",!0)&&(Ee=!0),!ys.test(I=o())||(ie=I,c(")"),c("returns"),c("("),c("stream",!0)&&(lr=!0),!ys.test(I=o())))throw E(I);yt=I,c(")");var St=new YMe(te,B,ie,yt,Ee,lr);St.comment=j,w(St,function(He){if(He==="option")Oe(St,He),c(";");else throw E(He)}),x.add(St)}function qe(x,I,j){if(!ys.test(I=o()))throw E(I,"reference");var B=I;w(null,function(ie){switch(ie){case"required":case"repeated":Y(x,ie,B,j+1);break;case"optional":h==="proto3"?Y(x,"proto3_optional",B,j+1):Y(x,"optional",B,j+1);break;default:if(h==="proto2"||!ys.test(ie))throw E(ie);s(ie),Y(x,"optional",B,j+1);break}})}for(var z;(z=o())!==null;)switch(z){case"package":if(!u)throw E(z);L();break;case"import":if(!u)throw E(z);v();break;case"syntax":if(!u)throw E(z);oe();break;case"edition":if(!u)throw E(z);$();break;case"option":Oe(m,z),c(";",!0);break;default:if(S(m,z,0)){u=!1;continue}throw E(z)}return T(),Ta.filename=null,{package:d,imports:f,weakImports:p,root:e}}});var Lee=y((URt,Dee)=>{"use strict";Dee.exports=xo;var i$e=/\/|\./;function xo(t,e){i$e.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),xo[t]=e}xo("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var $ee;xo("duration",{Duration:$ee={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});xo("timestamp",{Timestamp:$ee});xo("empty",{Empty:{fields:{}}});xo("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});xo("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});xo("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});xo.get=function(e){return xo[e]||null}});var Fee=y((FRt,Uee)=>{"use strict";var Bc=Uee.exports=Aee();Bc.build="full";Bc.tokenize=uL();Bc.parse=Mee();Bc.common=Lee();Bc.Root._configure(Bc.Type,Bc.parse,Bc.common)});var hx=y((zRt,zee)=>{"use strict";zee.exports=Fee()});var dL=y((jRt,o$e)=>{o$e.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var Yee=y((Ke,Wee)=>{"use strict";var Pn=hx();Wee.exports=Ke=Pn.descriptor=Pn.Root.fromJSON(dL()).lookup(".google.protobuf");var jee=Pn.Namespace,Vy=Pn.Root,wa=Pn.Enum,Ro=Pn.Type,qc=Pn.Field,s$e=Pn.MapField,mx=Pn.OneOf,Gy=Pn.Service,gx=Pn.Method,Bee=Pn.util.patterns,a$e=Bee.numberRe,_x=Bee.typeRefRe;Vy.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ke.FileDescriptorSet.decode(e));var r=new Vy;if(e.file)for(var n,i,o=0,s;o<e.file.length;++o){i=r,(n=e.file[o]).package&&n.package.length&&(i=r.define(n.package));var a=g$e(n);if(n.name&&n.name.length&&r.files.push(i.filename=n.name),n.messageType)for(s=0;s<n.messageType.length;++s)i.add(Ro.fromDescriptor(n.messageType[s],a));if(n.enumType)for(s=0;s<n.enumType.length;++s)i.add(wa.fromDescriptor(n.enumType[s],a));if(n.extension)for(s=0;s<n.extension.length;++s)i.add(qc.fromDescriptor(n.extension[s],a));if(n.service)for(s=0;s<n.service.length;++s)i.add(Gy.fromDescriptor(n.service[s],a));var c=Cp(n.options,Ke.FileOptions);if(c){var l=Object.keys(c);for(s=0;s<l.length;++s)i.setOption(l[s],c[l[s]])}}return r.resolveAll()};Vy.prototype.toDescriptor=function(e){var r=Ke.FileDescriptorSet.create();return qee(this,r.file,e),r};function qee(t,e,r){var n=Ke.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});_$e(r,n),t instanceof Vy||(n.package=t.fullName.substring(1));for(var i=0,o;i<t.nestedArray.length;++i)(o=t._nestedArray[i])instanceof Ro?n.messageType.push(o.toDescriptor(r)):o instanceof wa?n.enumType.push(o.toDescriptor()):o instanceof qc?n.extension.push(o.toDescriptor(r)):o instanceof Gy?n.service.push(o.toDescriptor()):o instanceof jee&&qee(o,e,r);n.options=Ip(t.options,Ke.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var c$e=0;Ro.fromDescriptor=function(e,r,n,i){if(i===void 0&&(i=0),i>Pn.util.nestingLimit)throw Error("max depth exceeded");typeof e.length=="number"&&(e=Ke.DescriptorProto.decode(e));var o=new Ro(e.name.length?e.name:"Type"+c$e++,Cp(e.options,Ke.MessageOptions)),s;if(n||(o._edition=r),e.oneofDecl)for(s=0;s<e.oneofDecl.length;++s)o.add(mx.fromDescriptor(e.oneofDecl[s]));if(e.field)for(s=0;s<e.field.length;++s){var a=qc.fromDescriptor(e.field[s],r,!0);o.add(a),e.field[s].hasOwnProperty("oneofIndex")&&o.oneofsArray[e.field[s].oneofIndex].add(a)}if(e.extension)for(s=0;s<e.extension.length;++s)o.add(qc.fromDescriptor(e.extension[s],r,!0));if(e.nestedType)for(s=0;s<e.nestedType.length;++s)o.add(Ro.fromDescriptor(e.nestedType[s],r,!0,i+1)),e.nestedType[s].options&&e.nestedType[s].options.mapEntry&&o.setOption("map_entry",!0);if(e.enumType)for(s=0;s<e.enumType.length;++s)o.add(wa.fromDescriptor(e.enumType[s],r,!0));if(e.extensionRange&&e.extensionRange.length)for(o.extensions=[],s=0;s<e.extensionRange.length;++s)o.extensions.push([e.extensionRange[s].start,e.extensionRange[s].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(o.reserved=[],e.reservedRange)for(s=0;s<e.reservedRange.length;++s)o.reserved.push([e.reservedRange[s].start,e.reservedRange[s].end]);if(e.reservedName)for(s=0;s<e.reservedName.length;++s)o.reserved.push(e.reservedName[s])}return o};Ro.prototype.toDescriptor=function(e){var r=Ke.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(r.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof s$e){var o=fL(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),s=fL(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=s===11||s===14?this._fieldsArray[n].resolvedType&&Hee(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;r.nestedType.push(Ke.DescriptorProto.create({name:i.typeName,field:[Ke.FieldDescriptorProto.create({name:"key",number:1,label:1,type:o}),Ke.FieldDescriptorProto.create({name:"value",number:2,label:1,type:s,typeName:a})],options:Ke.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)r.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof qc?r.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof Ro?r.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof wa&&r.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)r.extensionRange.push(Ke.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?r.reservedName.push(this.reserved[n]):r.reservedRange.push(Ke.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return r.options=Ip(this.options,Ke.MessageOptions),r};qc.fromDescriptor=function(e,r,n){if(typeof e.length=="number"&&(e=Ke.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i=e.typeName,o;if(i!=null&&i!==""){if(typeof i!="string"||!_x.test(i))throw Error("illegal type name: "+i);o=i}else o=p$e(e.type);var s;switch(e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;if(a!=null&&a!==""){if(typeof a!="string"||!_x.test(a))throw Error("illegal type name: "+a)}else a=void 0;var c=new qc(e.name.length?e.name:"field"+e.number,e.number,o,s,a);if(n||(c._edition=r),c.options=Cp(e.options,Ke.FieldOptions),e.proto3_optional&&(c.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var u=a$e.exec(l);u&&(l=parseInt(l));break}c.setOption("default",l)}return h$e(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&c.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&c.setOption("packed",!0)),c};qc.prototype.toDescriptor=function(e){var r=Ke.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=Pn.util.ucFirst(this.name),r.label=3;else{switch(r.type=fL(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?Hee(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?r.label=3:this.required&&e==="proto2"?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof Ro&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=Ip(this.options,Ke.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),e==="proto3"?this.packed||((r.options||(r.options=Ke.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=Ke.FieldOptions.create())).packed=!0),r};var l$e=0;wa.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ke.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var o=0;o<e.value.length;++o){var s=e.value[o].name,a=e.value[o].number||0;i[s&&s.length?s:"NAME"+a]=a}var c=new wa(e.name&&e.name.length?e.name:"Enum"+l$e++,i,Cp(e.options,Ke.EnumOptions));return n||(c._edition=r),c};wa.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(Ke.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return Ke.EnumDescriptorProto.create({name:this.name,value:e,options:Ip(this.options,Ke.EnumOptions)})};var u$e=0;mx.fromDescriptor=function(e){return typeof e.length=="number"&&(e=Ke.OneofDescriptorProto.decode(e)),new mx(e.name&&e.name.length?e.name:"oneof"+u$e++)};mx.prototype.toDescriptor=function(){return Ke.OneofDescriptorProto.create({name:this.name})};var d$e=0;Gy.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ke.ServiceDescriptorProto.decode(e));var i=new Gy(e.name&&e.name.length?e.name:"Service"+d$e++,Cp(e.options,Ke.ServiceOptions));if(n||(i._edition=r),e.method)for(var o=0;o<e.method.length;++o)i.add(gx.fromDescriptor(e.method[o]));return i};Gy.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return Ke.ServiceDescriptorProto.create({name:this.name,method:e,options:Ip(this.options,Ke.ServiceOptions)})};var f$e=0;gx.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ke.MethodDescriptorProto.decode(e));var r=e.inputType,n=e.outputType;if(r!=null&&r!==""&&(typeof r!="string"||!_x.test(r)))throw Error("illegal type name: "+r);if(n!=null&&n!==""&&(typeof n!="string"||!_x.test(n)))throw Error("illegal type name: "+n);return new gx(e.name&&e.name.length?e.name:"Method"+f$e++,"rpc",r,n,!!e.clientStreaming,!!e.serverStreaming,Cp(e.options,Ke.MethodOptions))};gx.prototype.toDescriptor=function(){return Ke.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:Ip(this.options,Ke.MethodOptions)})};function p$e(t){switch(t){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+t)}function h$e(t){switch(t){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function fL(t,e,r){switch(t){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof wa)return 14;if(e instanceof Ro)return r?10:11;throw Error("illegal type: "+t)}function Vee(t,e){for(var r={},n=0,i,o;n<e.fieldsArray.length;++n)if((o=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,o)){var s=m$e(o);i.resolvedType instanceof Ro?r[s]=Vee(t[o],i.resolvedType):i.resolvedType instanceof wa?r[s]=i.resolvedType.valuesById[t[o]]:r[s]=t[o]}return r}function Cp(t,e){if(t)return Vee(e.toObject(t),e)}function Gee(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;++i){var o=n[i],s=Pn.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(e.fields,s)){var a=e.fields[s];a.resolvedType instanceof Ro?r[s]=Gee(t[o],a.resolvedType):r[s]=t[o],a.repeated&&!Array.isArray(r[s])&&(r[s]=[r[s]])}}return r}function Ip(t,e){if(t)return e.fromObject(Gee(t,e))}function Hee(t,e){var r=t.fullName.split("."),n=e.fullName.split("."),i=0,o=0,s=n.length-1;if(!(t instanceof Vy)&&e instanceof jee)for(;i<r.length&&o<s&&r[i]===n[o];){var a=e.lookup(r[i++],!0);if(a!==null&&a!==e)break;++o}else for(;i<r.length&&o<s&&r[i]===n[o];++i,++o);return n.slice(o).join(".")}function m$e(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function g$e(t){if(t.syntax==="editions"){if(t.edition===Ke.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function _$e(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else if(e.syntax="editions",t==="2023")e.edition=Ke.Edition.EDITION_2023;else throw new Error("Unsupported edition "+t)}});var Kee=y((BRt,y$e)=>{y$e.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Zee=y((qRt,S$e)=>{S$e.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Jee=y((VRt,E$e)=>{E$e.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var tte=y(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.addCommonProtos=Vc.loadProtosWithOptionsSync=Vc.loadProtosWithOptions=void 0;var Xee=Z("fs"),Qee=Z("path"),Pp=hx();function ete(t,e){let r=t.resolvePath;t.resolvePath=(n,i)=>{if(Qee.isAbsolute(i))return i;for(let o of e){let s=Qee.join(o,i);try{return Xee.accessSync(s,Xee.constants.R_OK),s}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),r(n,i)}}async function v$e(t,e){let r=new Pp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));ete(r,e.includeDirs)}let n=await r.load(t,e);return n.resolveAll(),n}Vc.loadProtosWithOptions=v$e;function b$e(t,e){let r=new Pp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");ete(r,e.includeDirs)}let n=r.loadSync(t,e);return n.resolveAll(),n}Vc.loadProtosWithOptionsSync=b$e;function T$e(){let t=Kee(),e=dL(),r=Zee(),n=Jee();Pp.common("api",t.nested.google.nested.protobuf.nested),Pp.common("descriptor",e.nested.google.nested.protobuf.nested),Pp.common("source_context",r.nested.google.nested.protobuf.nested),Pp.common("type",n.nested.google.nested.protobuf.nested)}Vc.addCommonProtos=T$e});var yL=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.loadFileDescriptorSetFromObject=gr.loadFileDescriptorSetFromBuffer=gr.fromJSON=gr.loadSync=gr.load=gr.IdempotencyLevel=gr.isAnyExtension=gr.Long=void 0;var w$e=LQ(),Ss=hx(),gL=Yee(),_L=tte(),A$e=ED();gr.Long=A$e;function x$e(t){return"@type"in t&&typeof t["@type"]=="string"}gr.isAnyExtension=x$e;var rte;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(rte=gr.IdempotencyLevel||(gr.IdempotencyLevel={}));var nte={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function R$e(t,e){return t===""?e:t+"."+e}function C$e(t){return t instanceof Ss.Service||t instanceof Ss.Type||t instanceof Ss.Enum}function I$e(t){return t instanceof Ss.Namespace||t instanceof Ss.Root}function ite(t,e){let r=R$e(e,t.name);return C$e(t)?[[r,t]]:I$e(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(n=>ite(t.nested[n],r)).reduce((n,i)=>n.concat(i),[]):[]}function pL(t,e){return function(n){return t.toObject(t.decode(n),e)}}function hL(t){return function(r){if(Array.isArray(r))throw new Error(`Failed to serialize message: expected object with ${t.name} structure, got array instead`);let n=t.fromObject(r);return t.encode(n).finish()}}function P$e(t){return(t||[]).reduce((e,r)=>{for(let[n,i]of Object.entries(r))n==="uninterpreted_option"?e.uninterpreted_option.push(r.uninterpreted_option):e[n]=i;return e},{deprecated:!1,idempotency_level:rte.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function O$e(t,e,r,n){let i=t.resolvedRequestType,o=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:hL(i),requestDeserialize:pL(i,r),responseSerialize:hL(o),responseDeserialize:pL(o,r),originalName:w$e(t.name),requestType:mL(i,r,n),responseType:mL(o,r,n),options:P$e(t.parsedOptions)}}function N$e(t,e,r,n){let i={};for(let o of t.methodsArray)i[o.name]=O$e(o,e,r,n);return i}function mL(t,e,r){let n=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,nte),fileDescriptorProtos:r,serialize:hL(t),deserialize:pL(t,e)}}function k$e(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,nte),fileDescriptorProtos:e}}function M$e(t,e,r,n){if(t instanceof Ss.Service)return N$e(t,e,r,n);if(t instanceof Ss.Type)return mL(t,r,n);if(t instanceof Ss.Enum)return k$e(t,n);throw new Error("Type mismatch in reflection object handling")}function yx(t,e){let r={};t.resolveAll();let i=t.toDescriptor("proto3").file.map(o=>Buffer.from(gL.FileDescriptorProto.encode(o).finish()));for(let[o,s]of ite(t,""))r[o]=M$e(s,o,e,i);return r}function ote(t,e){e=e||{};let r=Ss.Root.fromDescriptor(t);return r.resolveAll(),yx(r,e)}function $$e(t,e){return(0,_L.loadProtosWithOptions)(t,e).then(r=>yx(r,e))}gr.load=$$e;function D$e(t,e){let r=(0,_L.loadProtosWithOptionsSync)(t,e);return yx(r,e)}gr.loadSync=D$e;function L$e(t,e){e=e||{};let r=Ss.Root.fromJSON(t);return r.resolveAll(),yx(r,e)}gr.fromJSON=L$e;function U$e(t,e){let r=gL.FileDescriptorSet.decode(t);return ote(r,e)}gr.loadFileDescriptorSetFromBuffer=U$e;function F$e(t,e){let r=gL.FileDescriptorSet.fromObject(t);return ote(r,e)}gr.loadFileDescriptorSetFromObject=F$e;(0,_L.addCommonProtos)()});var Gc=y(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.registerChannelzSocket=Ft.registerChannelzServer=Ft.registerChannelzSubchannel=Ft.registerChannelzChannel=Ft.ChannelzCallTrackerStub=Ft.ChannelzCallTracker=Ft.ChannelzChildrenTrackerStub=Ft.ChannelzChildrenTracker=Ft.ChannelzTrace=Ft.ChannelzTraceStub=void 0;Ft.unregisterChannelzRef=V$e;Ft.getChannelzHandlers=pte;Ft.getChannelzServiceDefinition=hte;Ft.setup=tDe;var Ex=Z("net"),Ku=(sQ(),An(oQ)),Hy=In(),Wy=Xe(),z$e=Gn(),j$e=UA(),B$e=qA();function SL(t){return{channel_id:t.id,name:t.name}}function wL(t){return{subchannel_id:t.id,name:t.name}}function q$e(t){return{server_id:t.id}}function Tx(t){return{socket_id:t.id,name:t.name}}var ste=32,AL=100,EL=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Es(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ft.ChannelzTraceStub=EL;var vL=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,n){let i=new Date;this.events.push({description:r,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=ste*2&&(this.events=this.events.slice(ste)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Es(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Es(e.timestamp),channel_ref:e.childChannel?SL(e.childChannel):null,subchannel_ref:e.childSubchannel?wL(e.childSubchannel):null}))}}};Ft.ChannelzTrace=vL;var vx=class{constructor(){this.channelChildren=new Ku.OrderedMap,this.subchannelChildren=new Ku.OrderedMap,this.socketChildren=new Ku.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],n=r.find(e.id);n.equals(r.end())?r.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],n=r.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ft.ChannelzChildrenTracker=vx;var bL=class extends vx{refChild(){}unrefChild(){}};Ft.ChannelzChildrenTrackerStub=bL;var bx=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ft.ChannelzCallTracker=bx;var TL=class extends bx{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ft.ChannelzCallTrackerStub=TL;var Aa={channel:new Ku.OrderedMap,subchannel:new Ku.OrderedMap,server:new Ku.OrderedMap,socket:new Ku.OrderedMap},wx=t=>{let e=1;function r(){return e++}let n=Aa[t];return(i,o,s)=>{let a=r(),c={id:a,name:i,kind:t};return s&&n.setElement(a,{ref:c,getInfo:o}),c}};Ft.registerChannelzChannel=wx("channel");Ft.registerChannelzSubchannel=wx("subchannel");Ft.registerChannelzServer=wx("server");Ft.registerChannelzSocket=wx("socket");function V$e(t){Aa[t.kind].eraseElementByKey(t.id)}function G$e(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function ate(t){if(t==="")return[];let e=t.split(":").map(n=>G$e(n));return[].concat(...e)}function H$e(t){return(0,Ex.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,Ex.isIPv4)(t.substring(7))}function cte(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function W$e(t){if((0,Ex.isIPv4)(t))return cte(t);if(H$e(t))return cte(t.substring(7));if((0,Ex.isIPv6)(t)){let e,r,n=t.indexOf("::");n===-1?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));let i=Buffer.from(ate(e)),o=Buffer.from(ate(r)),s=Buffer.alloc(16-i.length-o.length,0);return Buffer.concat([i,s,o])}else return null}function ute(t){switch(t){case Hy.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Hy.ConnectivityState.IDLE:return{state:"IDLE"};case Hy.ConnectivityState.READY:return{state:"READY"};case Hy.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Hy.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Es(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function dte(t){let e=t.getInfo(),r=[],n=[];return e.children.channels.forEach(i=>{r.push(SL(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(wL(i[1].ref))}),{ref:SL(t.ref),data:{target:e.target,state:ute(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Es(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function Y$e(t,e){let r=parseInt(t.request.channel_id,10),n=Aa.channel.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:dte(n)})}function K$e(t,e){let r=parseInt(t.request.max_results,10)||AL,n=[],i=parseInt(t.request.start_channel_id,10),o=Aa.channel,s;for(s=o.lowerBound(i);!s.equals(o.end())&&n.length<r;s=s.next())n.push(dte(s.pointer[1]));e(null,{channel:n,end:s.equals(o.end())})}function fte(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(n=>{r.push(Tx(n[1].ref))}),{ref:q$e(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Es(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function Z$e(t,e){let r=parseInt(t.request.server_id,10),i=Aa.server.getElementByKey(r);if(i===void 0){e({code:Wy.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:fte(i)})}function J$e(t,e){let r=parseInt(t.request.max_results,10)||AL,n=parseInt(t.request.start_server_id,10),i=Aa.server,o=[],s;for(s=i.lowerBound(n);!s.equals(i.end())&&o.length<r;s=s.next())o.push(fte(s.pointer[1]));e(null,{server:o,end:s.equals(i.end())})}function X$e(t,e){let r=parseInt(t.request.subchannel_id,10),n=Aa.subchannel.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let i=n.getInfo(),o=[];i.children.sockets.forEach(a=>{o.push(Tx(a[1].ref))});let s={ref:wL(n.ref),data:{target:i.target,state:ute(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:Es(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:o};e(null,{subchannel:s})}function lte(t){var e;return(0,z$e.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=W$e(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function Q$e(t,e){var r,n,i,o,s;let a=parseInt(t.request.socket_id,10),c=Aa.socket.getElementByKey(a);if(c===void 0){e({code:Wy.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),u=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=l.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(o=l.security.remoteCertificate)!==null&&o!==void 0?o:void 0}}:null,d={ref:Tx(c.ref),local:l.localAddress?lte(l.localAddress):null,remote:l.remoteAddress?lte(l.remoteAddress):null,remote_name:(s=l.remoteName)!==null&&s!==void 0?s:void 0,security:u,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:Es(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Es(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:Es(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:Es(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function eDe(t,e){let r=parseInt(t.request.server_id,10),n=Aa.server.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No server data found for id "+r});return}let i=parseInt(t.request.start_socket_id,10),o=parseInt(t.request.max_results,10)||AL,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<o;l=l.next())c.push(Tx(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function pte(){return{GetChannel:Y$e,GetTopChannels:K$e,GetServer:Z$e,GetServers:J$e,GetSubchannel:X$e,GetSocket:Q$e,GetServerSockets:eDe}}var Sx=null;function hte(){if(Sx)return Sx;let t=yL().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return Sx=(0,B$e.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,Sx}function tDe(){(0,j$e.registerAdminService)(hte,pte)}});var Ax=y(xL=>{"use strict";Object.defineProperty(xL,"__esModule",{value:!0});xL.getNextCallNumber=nDe;var rDe=0;function nDe(){return rDe++}});var RL=y(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:!0});xx.CompressionAlgorithms=void 0;var mte;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(mte||(xx.CompressionAlgorithms=mte={}))});var IL=y(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:!0});Rx.BaseFilter=void 0;var CL=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};Rx.BaseFilter=CL});var ML=y(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.CompressionFilterFactory=Np.CompressionFilter=void 0;var Cx=Z("zlib"),_te=RL(),Hc=Xe(),iDe=IL(),oDe=Nt(),sDe=t=>typeof t=="number"&&typeof _te.CompressionAlgorithms[t]=="string",Op=class{async writeMessage(e,r){let n=e;r&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(r?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let r=e.readUInt8(0)===1,n=e.slice(5);return r&&(n=await this.decompressMessage(n)),n}},Zu=class extends Op{async compressMessage(e){return e}async writeMessage(e,r){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},PL=class extends Op{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Cx.deflate(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=Cx.createInflate();s.on("error",a=>{n({code:Hc.Status.INTERNAL,details:"Failed to decompress deflate-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:Hc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},OL=class extends Op{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Cx.gzip(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=Cx.createGunzip();s.on("error",a=>{n({code:Hc.Status.INTERNAL,details:"Failed to decompress gzip-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:Hc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},NL=class extends Op{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function gte(t,e){switch(t){case"identity":return new Zu;case"deflate":return new PL(e);case"gzip":return new OL(e);default:return new NL(t)}}var Ix=class extends iDe.BaseFilter{constructor(e,r){var n,i,o;super(),this.sharedFilterConfig=r,this.sendCompression=new Zu,this.receiveCompression=new Zu,this.currentCompressionAlgorithm="identity";let s=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:Hc.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:Hc.DEFAULT_MAX_SEND_MESSAGE_LENGTH,s!==void 0)if(sDe(s)){let a=_te.CompressionAlgorithms[s],c=(o=r.serverSupportedEncodingHeader)===null||o===void 0?void 0:o.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=gte(this.currentCompressionAlgorithm,-1))}else oDe.log(Hc.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${s}`)}async sendMetadata(e){let r=await e;return r.set("grpc-accept-encoding","identity,deflate,gzip"),r.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?r.remove("grpc-encoding"):r.set("grpc-encoding",this.currentCompressionAlgorithm),r}receiveMetadata(e){let r=e.get("grpc-encoding");if(r.length>0){let i=r[0];typeof i=="string"&&(this.receiveCompression=gte(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Zu,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:Hc.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof Zu?i=!1:i=(((r=n.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};Np.CompressionFilter=Ix;var kL=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new Ix(this.options,this.sharedFilterConfig)}};Np.CompressionFilterFactory=kL});var Yy=y($L=>{"use strict";Object.defineProperty($L,"__esModule",{value:!0});$L.restrictControlPlaneStatusCode=cDe;var vs=Xe(),aDe=[vs.Status.OK,vs.Status.INVALID_ARGUMENT,vs.Status.NOT_FOUND,vs.Status.ALREADY_EXISTS,vs.Status.FAILED_PRECONDITION,vs.Status.ABORTED,vs.Status.OUT_OF_RANGE,vs.Status.DATA_LOSS];function cDe(t,e){return aDe.includes(t)?{code:vs.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${vs.Status[t]} ${e}`}:{code:t,details:e}}});var kp=y(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.minDeadline=lDe;Ju.getDeadlineTimeoutString=dDe;Ju.getRelativeTimeout=pDe;Ju.deadlineToString=hDe;Ju.formatDateDifference=mDe;function lDe(...t){let e=1/0;for(let r of t){let n=r instanceof Date?r.getTime():r;n<e&&(e=n)}return e}var uDe=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function dDe(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[n,i]of uDe){let o=r/i;if(o<1e8)return String(Math.ceil(o))+n}throw new Error("Deadline is too far in the future")}var fDe=2147483647;function pDe(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),n=e-r;return n<0?0:n>fDe?1/0:n}function hDe(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function mDe(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var Ox=y(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.FilterStackFactory=Mp.FilterStack=void 0;var Px=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMessage(r);return r}receiveMessage(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Mp.FilterStack=Px;var DL=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new Px(this.factories.map(e=>e.createFilter()))}};Mp.FilterStackFactory=DL});var yte=y(kx=>{"use strict";Object.defineProperty(kx,"__esModule",{value:!0});kx.SingleSubchannelChannel=void 0;var gDe=Ax(),Ky=Gc(),_De=ML(),yDe=In(),Zy=Xe(),SDe=Yy(),EDe=kp(),vDe=Ox(),LL=Rr(),bDe=mo(),Nx=Cn(),UL=class{constructor(e,r,n,i,o){var s,a;this.subchannel=e,this.method=r,this.options=i,this.callNumber=o,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let c=this.method.split("/"),l="";c.length>=2&&(l=c[1]);let u=(a=(s=(0,Nx.splitHostPort)(this.options.host))===null||s===void 0?void 0:s.host)!==null&&a!==void 0?a:"localhost";this.serviceUrl=`https://${u}/${l}`;let d=(0,EDe.getRelativeTimeout)(i.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(Zy.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(Zy.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=n.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new LL.Metadata}}getPeer(){var e,r;return(r=(e=this.childCall)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.subchannel.getAddress()}async start(e,r){if(this.pendingStatus){r.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==yDe.ConnectivityState.READY){r.onReceiveStatus({code:Zy.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new LL.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),i;try{i=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(s){let a=s,{code:c,details:l}=(0,SDe.restrictControlPlaneStatusCode)(typeof a.code=="number"?a.code:Zy.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${a.message}`);r.onReceiveStatus({code:c,details:l,metadata:new LL.Metadata});return}i.merge(n);let o={onReceiveMetadata:async s=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(s))},onReceiveMessage:async s=>{this.readFilterPending=!0;let a=await this.filterStack.receiveMessage(s);this.readFilterPending=!1,r.onReceiveMessage(a),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async s=>{let a=await this.filterStack.receiveTrailers(s);this.readFilterPending?this.pendingStatus=a:r.onReceiveStatus(a)}};this.childCall=this.subchannel.createCall(i,this.options.host,this.method,o),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,r){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}},FL=class{constructor(e,r,n){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new Ky.ChannelzTrace,this.callTracker=new Ky.ChannelzCallTracker,this.childrenTracker=new Ky.ChannelzChildrenTracker,this.channelzEnabled=n["grpc.enable_channelz"]!==0,this.channelzRef=(0,Ky.registerChannelzChannel)((0,Nx.uriToString)(r),()=>({target:`${(0,Nx.uriToString)(r)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new vDe.FilterStackFactory([new _De.CompressionFilterFactory(this,n)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,Ky.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,Nx.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,n){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let n={deadline:r,host:(0,bDe.getDefaultAuthority)(this.target),flags:Zy.Propagate.DEFAULTS,parentCall:null};return new UL(this.subchannel,e,this.filterStackFactory,n,(0,gDe.getNextCallNumber)())}};kx.SingleSubchannelChannel=FL});var Ste=y($x=>{"use strict";Object.defineProperty($x,"__esModule",{value:!0});$x.Subchannel=void 0;var wt=In(),TDe=pp(),zL=Nt(),Mx=Xe(),wDe=Cn(),ADe=Gn(),bs=Gc(),xDe=yte(),RDe="subchannel",CDe=~(1<<31),jL=class{constructor(e,r,n,i,o){var s;this.channelTarget=e,this.subchannelAddress=r,this.options=n,this.connector=o,this.connectivityState=wt.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new TDe.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ADe.subchannelAddressToString)(r),this.keepaliveTime=(s=n["grpc.keepalive_time_ms"])!==null&&s!==void 0?s:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new bs.ChannelzTraceStub,this.callTracker=new bs.ChannelzCallTrackerStub,this.childrenTracker=new bs.ChannelzChildrenTrackerStub,this.streamTracker=new bs.ChannelzCallTrackerStub):(this.channelzTrace=new bs.ChannelzTrace,this.callTracker=new bs.ChannelzCallTracker,this.childrenTracker=new bs.ChannelzChildrenTracker,this.streamTracker=new bs.ChannelzCallTracker),this.channelzRef=(0,bs.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){zL.trace(Mx.LogVerbosity.DEBUG,RDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){zL.trace(Mx.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING):this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let r=Math.min(this.keepaliveTime,CDe);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":r})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.READY)?(this.transport=r,this.channelzEnabled&&this.childrenTracker.refChild(r.getChannelzRef()),r.addDisconnectListener(n=>{this.transitionToState([wt.ConnectivityState.READY],wt.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,zL.log(Mx.LogVerbosity.ERROR,`Connection to ${(0,wDe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):r.shutdown()},r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.TRANSIENT_FAILURE,`${r}`)})}transitionToState(e,r,n){var i,o;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]+' with error "'+n+'"'):this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+wt.ConnectivityState[r]);let s=this.connectivityState;switch(this.connectivityState=r,r){case wt.ConnectivityState.READY:this.stopBackoff();break;case wt.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case wt.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case wt.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(o=this.transport)===null||o===void 0||o.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let a of this.stateListeners)a(this,s,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,bs.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.CONNECTING,wt.ConnectivityState.READY],wt.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,r,n,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let o;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),o={onCallEnd:s=>{s.code===Mx.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):o={},this.transport.createCall(e,r,n,i,o)}startConnecting(){process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.IDLE],wt.ConnectivityState.CONNECTING)||this.connectivityState===wt.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new xDe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let n=this.dataProducers.get(e);if(n)return n;let i=r(this);return this.dataProducers.set(e,i),i}removeDataProducer(e){this.dataProducers.delete(e)}};$x.Subchannel=jL});var Ete=y(Dx=>{"use strict";var BL;Object.defineProperty(Dx,"__esModule",{value:!0});Dx.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Dx.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((BL=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&BL!==void 0?BL:"false")==="true"});var HL=y(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.DEFAULT_PORT=void 0;Xu.setup=DDe;var vte=mo(),qL=Z("dns"),IDe=z$(),VL=Xe(),$p=zu(),PDe=Rr(),ODe=Nt(),NDe=Xe(),Wc=Cn(),bte=Z("net"),kDe=pp(),Tte=Ete(),MDe="dns_resolver";function Ts(t){ODe.trace(NDe.LogVerbosity.DEBUG,MDe,t)}Xu.DEFAULT_PORT=443;var $De=3e4,GL=class{constructor(e,r,n){var i,o,s;this.target=e,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new qL.promises.Resolver,Ts("Resolver constructed for target "+(0,Wc.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,Wc.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,bte.isIPv4)(a.host)||(0,bte.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:Xu.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(o=a.port)!==null&&o!==void 0?o:Xu.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:VL.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,Wc.uriToString)(this.target)}`,metadata:new PDe.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new kDe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(s=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&s!==void 0?s:$De,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(Ts("Returning IP address for target "+(0,Wc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,$p.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Ts("Failed to parse DNS address "+(0,Wc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,$p.statusOrFromError)({code:VL.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,Wc.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Ts("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(r=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,$p.statusOrFromValue)(r.map(o=>({addresses:[o]})));let n="["+r.map(o=>o.host+":"+o.port).join(",")+"]";Ts("Resolved addresses for target "+(0,Wc.uriToString)(this.target)+": "+n);let i=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(i)},r=>{this.pendingLookupPromise!==null&&(Ts("Resolution error for target "+(0,Wc.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,$p.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(r=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let n;try{n=(0,IDe.extractAndSelectServiceConfig)(r,this.percentage),n?this.latestServiceConfigResult=(0,$p.statusOrFromValue)(n):this.latestServiceConfigResult=null}catch(i){this.latestServiceConfigResult=(0,$p.statusOrFromError)({code:VL.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},r=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(Tte.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Ts("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,o)=>o.status==="fulfilled"?[...i,...o.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await qL.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return Tte.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(Ts("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):qL.promises.resolveTxt(e)}startNextResolutionTimer(){var e,r;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(r=(e=this.nextResolutionTimer).unref)===null||r===void 0||r.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?Ts('resolution update delayed by "min time between resolutions" rate limit'):Ts("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function DDe(){(0,vte.registerResolver)("dns",GL),(0,vte.registerDefaultScheme)("dns")}});var WL=y(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.parseCIDR=xte;Qy.mapProxyName=HDe;Qy.getProxiedConnection=WDe;var Jy=Nt(),Dp=Xe(),Ate=Z("net"),LDe=Z("http"),UDe=Nt(),wte=Gn(),Xy=Cn(),FDe=Z("url"),zDe=HL(),jDe="proxy";function Lp(t){UDe.trace(Dp.LogVerbosity.DEBUG,jDe,t)}function BDe(){let t="",e="";if(process.env.grpc_proxy)e="grpc_proxy",t=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",t=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",t=process.env.http_proxy;else return{};let r;try{r=new FDe.URL(t)}catch{return(0,Jy.log)(Dp.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,Jy.log)(Dp.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let n=null;r.username&&(r.password?((0,Jy.log)(Dp.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${r.username}:${r.password}`)):n=r.username);let i=r.hostname,o=r.port;o===""&&(o="80");let s={address:`${i}:${o}`};return n&&(s.creds=n),Lp("Proxy server "+s.address+" set by environment variable "+e),s}function qDe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(Lp("No proxy server list set by environment variable "+e),t.split(",")):[]}function xte(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,Ate.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:Rte(e[0]),prefixLength:r}}function Rte(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function VDe(t,e){let r=t.ip,n=-1<<32-t.prefixLength;return(Rte(e)&n)===(r&n)}function GDe(t){for(let e of qDe()){let r=xte(e);if((0,Ate.isIPv4)(t)&&r&&VDe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function HDe(t,e){var r;let n={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return n;let i=BDe();if(!i.address)return n;let o=(0,Xy.splitHostPort)(t.path);if(!o)return n;let s=o.host;if(GDe(s))return Lp("Not using proxy for target in no_proxy list: "+(0,Xy.uriToString)(t)),n;let a={"grpc.http_connect_target":(0,Xy.uriToString)(t)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function WDe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,Xy.parseUri)(n);if(i===null)return Promise.resolve(null);let o=(0,Xy.splitHostPort)(i.path);if(o===null)return Promise.resolve(null);let s=`${o.host}:${(r=o.port)!==null&&r!==void 0?r:zDe.DEFAULT_PORT}`,a={method:"CONNECT",path:s},c={Host:s};(0,wte.isTcpSubchannelAddress)(t)?(a.host=t.host,a.port=t.port):a.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,wte.subchannelAddressToString)(t);return Lp("Using proxy "+l+" to connect to "+a.path),new Promise((u,d)=>{let f=LDe.request(a);f.once("connect",(p,h,m)=>{f.removeAllListeners(),h.removeAllListeners(),p.statusCode===200?(Lp("Successfully connected to "+a.path+" through proxy "+l),m.length>0&&h.unshift(m),Lp("Successfully established a plaintext connection to "+a.path+" through proxy "+l),u(h)):((0,Jy.log)(Dp.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+p.statusCode),d())}),f.once("error",p=>{f.removeAllListeners(),(0,Jy.log)(Dp.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+p.message),d()}),f.end()})}});var KL=y(Lx=>{"use strict";Object.defineProperty(Lx,"__esModule",{value:!0});Lx.StreamDecoder=void 0;var ws;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(ws||(ws={}));var YL=class{constructor(e){this.maxReadMessageLength=e,this.readState=ws.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let r=0,n,i=[];for(;r<e.length;)switch(this.readState){case ws.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=ws.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case ws.READING_SIZE:if(n=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+n),this.readSizeRemaining-=n,r+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=ws.READING_MESSAGE;else{let o=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=ws.NO_DATA,i.push(o)}}break;case ws.READING_MESSAGE:if(n=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+n)),this.readMessageRemaining-=n,r+=n,this.readMessageRemaining===0){let o=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),s=Buffer.concat(o,this.readMessageSize+5);this.readState=ws.NO_DATA,i.push(s)}break;default:throw new Error("Unexpected read state")}return i}};Lx.StreamDecoder=YL});var Cte=y(Ux=>{"use strict";Object.defineProperty(Ux,"__esModule",{value:!0});Ux.Http2SubchannelCall=void 0;var xa=Z("http2"),YDe=Z("os"),At=Xe(),Ra=Rr(),KDe=KL(),ZDe=Nt(),JDe=Xe(),XDe="subchannel_call";function QDe(t){for(let[e,r]of Object.entries(YDe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function ZL(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=At.Status.INTERNAL;break;case 401:r=At.Status.UNAUTHENTICATED;break;case 403:r=At.Status.PERMISSION_DENIED;break;case 404:r=At.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=At.Status.UNAVAILABLE;break;default:r=At.Status.UNKNOWN}return{code:r,details:e,metadata:new Ra.Metadata}}var JL=class{constructor(e,r,n,i,o){var s;this.http2Stream=e,this.callEventTracker=r,this.listener=n,this.transport=i,this.callId=o,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let a=(s=i.getOptions()["grpc.max_receive_message_length"])!==null&&s!==void 0?s:At.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new KDe.StreamDecoder(a),e.on("response",(c,l)=>{let u="";for(let d of Object.keys(c))u+=" "+d+": "+c[d]+`
|
|
17
|
+
`&&++i,++r===n)throw l("comment");A=O,O=d(r)}while(A!=="*"||O!=="/");++r,N&&(f(R,r-2,M),M=!0),E=!0}else return"/"}}while(E);var L=r;lL.lastIndex=0;var v=lL.test(d(L++));if(!v)for(;L<n&&!lL.test(d(L));)++L;var oe=t.substring(r,r=L);return(oe==='"'||oe==="'")&&(c=oe),oe}function g(E){a.push(E)}function _(){if(!a.length){var E=m();if(E===null)return null;g(E)}return a[0]}function b(E,A){var O=_(),R=O===E;if(R)return m(),!0;if(!A)throw l("token '"+O+"', '"+E+"' expected");return!1}function T(E){var A=null,O;return E===void 0?(O=s[i-1],delete s[i-1],O&&(e||O.type==="*"||O.lineEmpty)&&(A=O.leading?O.text:null)):(o<E&&_(),O=s[E],delete s[E],O&&!O.lineEmpty&&(e||O.type==="/")&&(A=O.leading?null:O.text)),A}return Object.defineProperty({next:m,peek:_,push:g,skip:b,cmnt:T},"line",{get:function(){return i}})}});var Mee=y((LRt,kee)=>{"use strict";kee.exports=Ta;Ta.filename=null;Ta.defaults={keepCase:!1};var VMe=uL(),Iee=ux(),Pee=sx(),Oee=zc(),GMe=ex(),Nee=Hu(),HMe=To(),WMe=rx(),YMe=tx(),KMe=jc(),ZMe=Wu(),ba=Ir(),JMe=/^[1-9][0-9]*$/,XMe=/^-?[1-9][0-9]*$/,QMe=/^0[x][0-9a-fA-F]+$/,e$e=/^-?0[x][0-9a-fA-F]+$/,t$e=/^0[0-7]+$/,r$e=/^-?0[0-7]+$/,n$e=ba.patterns.numberRe,_s=/^[a-zA-Z_][a-zA-Z_0-9]*$/,ys=ba.patterns.typeRefRe;function Ta(t,e,r){e instanceof Iee||(r=e,e=new Iee),r||(r=Ta.defaults);var n=r.preferTrailingComment||!1,i=VMe(t,r.alternateCommentMode||!1),o=i.next,s=i.push,a=i.peek,c=i.skip,l=i.cmnt,u=!0,d,f,p,h="proto2",m=e,g=[],_={},b=r.keepCase?function(x){return x}:ba.camelCase;function T(){g.forEach(x=>{x._edition=h,Object.keys(_).forEach(I=>{x.getOption(I)===void 0&&x.setOption(I,_[I],!0)})})}function E(x,I,j){var B=Ta.filename;return j||(Ta.filename=null),Error("illegal "+(I||"token")+" '"+x+"' ("+(B?B+", ":"")+"line "+i.line+")")}function A(){var x=[],I;do{if((I=o())!=='"'&&I!=="'")throw E(I);x.push(o()),c(I),I=a()}while(I==='"'||I==="'");return x.join("")}function O(x){var I=o();switch(I){case"'":case'"':return s(I),A();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return N(I,!0)}catch{if(x&&ys.test(I))return I;throw E(I,"value")}}function R(x,I){var j,B;do if(I&&((j=a())==='"'||j==="'")){var te=A();if(x.push(te),h>=2023)throw E(te,"id")}else try{x.push([B=M(o()),c("to",!0)?M(o()):B])}catch(Ee){if(I&&ys.test(j)&&h>=2023)x.push(j);else throw Ee}while(c(",",!0));var ie={options:void 0};ie.setOption=function(Ee,yt){this.options===void 0&&(this.options={}),this.options[Ee]=yt},w(ie,function(yt){if(yt==="option")Pe(ie,yt),c(";");else throw E(yt)},function(){me(ie)})}function N(x,I){var j=1;switch(x.charAt(0)==="-"&&(j=-1,x=x.substring(1)),x){case"inf":case"INF":case"Inf":return j*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(JMe.test(x))return j*parseInt(x,10);if(QMe.test(x))return j*parseInt(x,16);if(t$e.test(x))return j*parseInt(x,8);if(n$e.test(x))return j*parseFloat(x);throw E(x,"number",I)}function M(x,I){switch(x){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!I&&x.charAt(0)==="-")throw E(x,"id");if(XMe.test(x))return parseInt(x,10);if(e$e.test(x))return parseInt(x,16);if(r$e.test(x))return parseInt(x,8);throw E(x,"id")}function L(){if(d!==void 0)throw E("package");if(d=o(),!ys.test(d))throw E(d,"name");m=m.define(d),c(";")}function v(){var x=a(),I;switch(x){case"weak":I=p||(p=[]),o();break;case"public":o();default:I=f||(f=[]);break}x=A(),c(";"),I.push(x)}function oe(){if(c("="),h=A(),h<2023)throw E(h,"syntax");c(";")}function $(){if(c("="),h=A(),!["2023"].includes(h))throw E(h,"edition");c(";")}function S(x,I,j){switch(j===void 0&&(j=0),I){case"option":return Pe(x,I),c(";"),!0;case"message":return k(x,I,j+1),!0;case"enum":return Ie(x,I),!0;case"service":return nt(x,I,j+1),!0;case"extend":return qe(x,I,j),!0}return!1}function w(x,I,j){var B=i.line;if(x&&(typeof x.comment!="string"&&(x.comment=l()),x.filename=Ta.filename),c("{",!0)){for(var te;(te=o())!=="}";)I(te);c(";",!0)}else j&&j(),c(";"),x&&(typeof x.comment!="string"||n)&&(x.comment=l(B)||x.comment)}function k(x,I,j){if(j===void 0&&(j=0),j>ba.nestingLimit)throw Error("max depth exceeded");if(!_s.test(I=o()))throw E(I,"type name");var B=new Pee(I);w(B,function(ie){if(!S(B,ie,j))switch(ie){case"map":he(B,ie);break;case"required":if(h!=="proto2")throw E(ie);case"repeated":Y(B,ie,void 0,j+1);break;case"optional":if(h==="proto3")Y(B,"proto3_optional",void 0,j+1);else{if(h!=="proto2")throw E(ie);Y(B,"optional",void 0,j+1)}break;case"oneof":je(B,ie,j+1);break;case"extensions":R(B.extensions||(B.extensions=[]));break;case"reserved":R(B.reserved||(B.reserved=[]),!0);break;default:if(h==="proto2"||!ys.test(ie))throw E(ie);s(ie),Y(B,"optional",void 0,j+1);break}}),x.add(B),x===m&&g.push(B)}function Y(x,I,j,B){var te=o();if(te==="group"){H(x,I,B);return}for(;te.endsWith(".")||a().startsWith(".");)te+=o();if(!ys.test(te))throw E(te,"type");var ie=o();if(!_s.test(ie))throw E(ie,"name");ie=b(ie),c("=");var Ee=new Oee(ie,M(o()),te,I,j);if(w(Ee,function(St){if(St==="option")Pe(Ee,St),c(";");else throw E(St)},function(){me(Ee)}),I==="proto3_optional"){var yt=new Nee("_"+ie);Ee.setOption("proto3_optional",!0),yt.add(Ee),x.add(yt)}else x.add(Ee);x===m&&g.push(Ee)}function H(x,I,j){if(j===void 0&&(j=0),j>ba.nestingLimit)throw Error("max depth exceeded");if(h>=2023)throw E("group");var B=o();if(!_s.test(B))throw E(B,"name");var te=ba.lcFirst(B);B===te&&(B=ba.ucFirst(B)),c("=");var ie=M(o()),Ee=new Pee(B);Ee.group=!0;var yt=new Oee(te,ie,B,I);yt.filename=Ta.filename,w(Ee,function(St){switch(St){case"option":Pe(Ee,St),c(";");break;case"required":case"repeated":Y(Ee,St,void 0,j+1);break;case"optional":h==="proto3"?Y(Ee,"proto3_optional",void 0,j+1):Y(Ee,"optional",void 0,j+1);break;case"message":k(Ee,St,j+1);break;case"enum":Ie(Ee,St);break;case"reserved":R(Ee.reserved||(Ee.reserved=[]),!0);break;default:throw E(St)}}),x.add(Ee).add(yt)}function he(x){c("<");var I=o();if(ZMe.mapKey[I]===void 0)throw E(I,"type");c(",");var j=o();if(!ys.test(j))throw E(j,"type");c(">");var B=o();if(!_s.test(B))throw E(B,"name");c("=");var te=new GMe(b(B),M(o()),I,j);w(te,function(Ee){if(Ee==="option")Pe(te,Ee),c(";");else throw E(Ee)},function(){me(te)}),x.add(te)}function je(x,I,j){if(!_s.test(I=o()))throw E(I,"name");var B=new Nee(b(I));w(B,function(ie){ie==="option"?(Pe(B,ie),c(";")):(s(ie),Y(B,"optional",void 0,j))}),x.add(B)}function Ie(x,I){if(!_s.test(I=o()))throw E(I,"name");var j=new HMe(I);w(j,function(te){switch(te){case"option":Pe(j,te),c(";");break;case"reserved":R(j.reserved||(j.reserved=[]),!0),j.reserved===void 0&&(j.reserved=[]);break;default:$e(j,te)}}),x.add(j),x===m&&g.push(j)}function $e(x,I){if(!_s.test(I))throw E(I,"name");c("=");var j=M(o(),!0),B={options:void 0};B.getOption=function(te){return this.options[te]},B.setOption=function(te,ie){KMe.prototype.setOption.call(B,te,ie)},B.setParsedOption=function(){},w(B,function(ie){if(ie==="option")Pe(B,ie),c(";");else throw E(ie)},function(){me(B)}),x.add(I,j,B.comment,B.parsedOptions||B.options)}function Pe(x,I){var j,B,te=!0;for(I==="option"&&(I=o());I!=="=";){if(I==="("){var ie=o();c(")"),I="("+ie+")"}if(te){if(te=!1,I.includes(".")&&!I.includes("(")){var Ee=I.split(".");j=Ee[0]+".",I=Ee[1];continue}j=I}else B=B?B+=I:I;I=o()}var yt=B?j.concat(B):j,lr=He(x,yt);B=B&&B[0]==="."?B.slice(1):B,j=j&&j[j.length-1]==="."?j.slice(0,-1):j,le(x,j,lr,B)}function He(x,I,j){if(j===void 0&&(j=0),j>ba.recursionLimit)throw Error("max depth exceeded");if(c("{",!0)){for(var B={};!c("}",!0);){if(!_s.test(z=o()))throw E(z,"name");if(z===null)throw E(z,"end of input");var te,ie=z;if(c(":",!0),a()==="{")te=He(x,I+"."+z,j+1);else if(a()==="["){te=[];var Ee;if(c("[",!0)){do Ee=O(!0),te.push(Ee);while(c(",",!0));c("]"),typeof Ee<"u"&&Ne(x,I+"."+z,Ee)}}else te=O(!0),Ne(x,I+"."+z,te);var yt=B[ie];yt&&(te=[].concat(yt).concat(te)),ie!=="__proto__"&&(B[ie]=te),c(",",!0),c(";",!0)}return B}var lr=O(!0);return Ne(x,I,lr),lr}function Ne(x,I,j){if(m===x&&/^features\./.test(I)){_[I]=j;return}x.setOption&&x.setOption(I,j)}function le(x,I,j,B){x.setParsedOption&&x.setParsedOption(I,j,B)}function me(x){if(c("[",!0)){do Pe(x,"option");while(c(",",!0));c("]")}return x}function nt(x,I,j){if(j===void 0&&(j=0),j>ba.recursionLimit)throw Error("max depth exceeded");if(!_s.test(I=o()))throw E(I,"service name");var B=new WMe(I);w(B,function(ie){if(!S(B,ie,j))if(ie==="rpc")re(B,ie);else throw E(ie)}),x.add(B),x===m&&g.push(B)}function re(x,I){var j=l(),B=I;if(!_s.test(I=o()))throw E(I,"name");var te=I,ie,Ee,yt,lr;if(c("("),c("stream",!0)&&(Ee=!0),!ys.test(I=o())||(ie=I,c(")"),c("returns"),c("("),c("stream",!0)&&(lr=!0),!ys.test(I=o())))throw E(I);yt=I,c(")");var St=new YMe(te,B,ie,yt,Ee,lr);St.comment=j,w(St,function(We){if(We==="option")Pe(St,We),c(";");else throw E(We)}),x.add(St)}function qe(x,I,j){if(!ys.test(I=o()))throw E(I,"reference");var B=I;w(null,function(ie){switch(ie){case"required":case"repeated":Y(x,ie,B,j+1);break;case"optional":h==="proto3"?Y(x,"proto3_optional",B,j+1):Y(x,"optional",B,j+1);break;default:if(h==="proto2"||!ys.test(ie))throw E(ie);s(ie),Y(x,"optional",B,j+1);break}})}for(var z;(z=o())!==null;)switch(z){case"package":if(!u)throw E(z);L();break;case"import":if(!u)throw E(z);v();break;case"syntax":if(!u)throw E(z);oe();break;case"edition":if(!u)throw E(z);$();break;case"option":Pe(m,z),c(";",!0);break;default:if(S(m,z,0)){u=!1;continue}throw E(z)}return T(),Ta.filename=null,{package:d,imports:f,weakImports:p,root:e}}});var Lee=y((URt,Dee)=>{"use strict";Dee.exports=xo;var i$e=/\/|\./;function xo(t,e){i$e.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),xo[t]=e}xo("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var $ee;xo("duration",{Duration:$ee={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});xo("timestamp",{Timestamp:$ee});xo("empty",{Empty:{fields:{}}});xo("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});xo("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});xo("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});xo.get=function(e){return xo[e]||null}});var Fee=y((FRt,Uee)=>{"use strict";var Bc=Uee.exports=Aee();Bc.build="full";Bc.tokenize=uL();Bc.parse=Mee();Bc.common=Lee();Bc.Root._configure(Bc.Type,Bc.parse,Bc.common)});var hx=y((zRt,zee)=>{"use strict";zee.exports=Fee()});var dL=y((jRt,o$e)=>{o$e.exports={nested:{google:{nested:{protobuf:{options:{go_package:"google.golang.org/protobuf/types/descriptorpb",java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",csharp_namespace:"Google.Protobuf.Reflection",objc_class_prefix:"GPB",cc_enable_arenas:!0,optimize_for:"SPEED"},nested:{FileDescriptorSet:{edition:"proto2",fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}},extensions:[[536e6,536e6]]},Edition:{edition:"proto2",values:{EDITION_UNKNOWN:0,EDITION_LEGACY:900,EDITION_PROTO2:998,EDITION_PROTO3:999,EDITION_2023:1e3,EDITION_2024:1001,EDITION_1_TEST_ONLY:1,EDITION_2_TEST_ONLY:2,EDITION_99997_TEST_ONLY:99997,EDITION_99998_TEST_ONLY:99998,EDITION_99999_TEST_ONLY:99999,EDITION_MAX:2147483647}},FileDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},publicDependency:{rule:"repeated",type:"int32",id:10},weakDependency:{rule:"repeated",type:"int32",id:11},optionDependency:{rule:"repeated",type:"string",id:15},messageType:{rule:"repeated",type:"DescriptorProto",id:4},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},sourceCodeInfo:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12},edition:{type:"Edition",id:14}}},DescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nestedType:{rule:"repeated",type:"DescriptorProto",id:3},enumType:{rule:"repeated",type:"EnumDescriptorProto",id:4},extensionRange:{rule:"repeated",type:"ExtensionRange",id:5},oneofDecl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reservedRange:{rule:"repeated",type:"ReservedRange",id:9},reservedName:{rule:"repeated",type:"string",id:10},visibility:{type:"SymbolVisibility",id:11}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2},options:{type:"ExtensionRangeOptions",id:3}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},ExtensionRangeOptions:{edition:"proto2",fields:{uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999},declaration:{rule:"repeated",type:"Declaration",id:2,options:{retention:"RETENTION_SOURCE"}},features:{type:"FeatureSet",id:50},verification:{type:"VerificationState",id:3,options:{default:"UNVERIFIED",retention:"RETENTION_SOURCE"}}},extensions:[[1e3,536870911]],nested:{Declaration:{fields:{number:{type:"int32",id:1},fullName:{type:"string",id:2},type:{type:"string",id:3},reserved:{type:"bool",id:5},repeated:{type:"bool",id:6}},reserved:[[4,4]]},VerificationState:{values:{DECLARATION:0,UNVERIFIED:1}}}},FieldDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},typeName:{type:"string",id:6},extendee:{type:"string",id:2},defaultValue:{type:"string",id:7},oneofIndex:{type:"int32",id:9},jsonName:{type:"string",id:10},options:{type:"FieldOptions",id:8},proto3Optional:{type:"bool",id:17}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REPEATED:3,LABEL_REQUIRED:2}}}},OneofDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3},reservedRange:{rule:"repeated",type:"EnumReservedRange",id:4},reservedName:{rule:"repeated",type:"string",id:5},visibility:{type:"SymbolVisibility",id:6}},nested:{EnumReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},EnumValueDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{edition:"proto2",fields:{name:{type:"string",id:1},inputType:{type:"string",id:2},outputType:{type:"string",id:3},options:{type:"MethodOptions",id:4},clientStreaming:{type:"bool",id:5},serverStreaming:{type:"bool",id:6}}},FileOptions:{edition:"proto2",fields:{javaPackage:{type:"string",id:1},javaOuterClassname:{type:"string",id:8},javaMultipleFiles:{type:"bool",id:10},javaGenerateEqualsAndHash:{type:"bool",id:20,options:{deprecated:!0}},javaStringCheckUtf8:{type:"bool",id:27},optimizeFor:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},goPackage:{type:"string",id:11},ccGenericServices:{type:"bool",id:16},javaGenericServices:{type:"bool",id:17},pyGenericServices:{type:"bool",id:18},deprecated:{type:"bool",id:23},ccEnableArenas:{type:"bool",id:31,options:{default:!0}},objcClassPrefix:{type:"string",id:36},csharpNamespace:{type:"string",id:37},swiftPrefix:{type:"string",id:39},phpClassPrefix:{type:"string",id:40},phpNamespace:{type:"string",id:41},phpMetadataNamespace:{type:"string",id:44},rubyPackage:{type:"string",id:45},features:{type:"FeatureSet",id:50},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[42,42],[38,38],"php_generic_services"],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{edition:"proto2",fields:{messageSetWireFormat:{type:"bool",id:1},noStandardDescriptorAccessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},mapEntry:{type:"bool",id:7},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:11,options:{deprecated:!0}},features:{type:"FeatureSet",id:12},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[5,5],[6,6],[8,8],[9,9]]},FieldOptions:{edition:"proto2",fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},unverifiedLazy:{type:"bool",id:15},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10,options:{deprecated:!0}},debugRedact:{type:"bool",id:16},retention:{type:"OptionRetention",id:17},targets:{rule:"repeated",type:"OptionTargetType",id:19},editionDefaults:{rule:"repeated",type:"EditionDefault",id:20},features:{type:"FeatureSet",id:21},featureSupport:{type:"FeatureSupport",id:22},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4],[18,18]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}},OptionRetention:{values:{RETENTION_UNKNOWN:0,RETENTION_RUNTIME:1,RETENTION_SOURCE:2}},OptionTargetType:{values:{TARGET_TYPE_UNKNOWN:0,TARGET_TYPE_FILE:1,TARGET_TYPE_EXTENSION_RANGE:2,TARGET_TYPE_MESSAGE:3,TARGET_TYPE_FIELD:4,TARGET_TYPE_ONEOF:5,TARGET_TYPE_ENUM:6,TARGET_TYPE_ENUM_ENTRY:7,TARGET_TYPE_SERVICE:8,TARGET_TYPE_METHOD:9}},EditionDefault:{fields:{edition:{type:"Edition",id:3},value:{type:"string",id:2}}},FeatureSupport:{fields:{editionIntroduced:{type:"Edition",id:1},editionDeprecated:{type:"Edition",id:2},deprecationWarning:{type:"string",id:3},editionRemoved:{type:"Edition",id:4}}}}},OneofOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:1},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{edition:"proto2",fields:{allowAlias:{type:"bool",id:2},deprecated:{type:"bool",id:3},deprecatedLegacyJsonFieldConflicts:{type:"bool",id:6,options:{deprecated:!0}},features:{type:"FeatureSet",id:7},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[5,5]]},EnumValueOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:1},features:{type:"FeatureSet",id:2},debugRedact:{type:"bool",id:3},featureSupport:{type:"FieldOptions.FeatureSupport",id:4},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{edition:"proto2",fields:{features:{type:"FeatureSet",id:34},deprecated:{type:"bool",id:33},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{edition:"proto2",fields:{deprecated:{type:"bool",id:33},idempotencyLevel:{type:"IdempotencyLevel",id:34,options:{default:"IDEMPOTENCY_UNKNOWN"}},features:{type:"FeatureSet",id:35},uninterpretedOption:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],nested:{IdempotencyLevel:{values:{IDEMPOTENCY_UNKNOWN:0,NO_SIDE_EFFECTS:1,IDEMPOTENT:2}}}},UninterpretedOption:{edition:"proto2",fields:{name:{rule:"repeated",type:"NamePart",id:2},identifierValue:{type:"string",id:3},positiveIntValue:{type:"uint64",id:4},negativeIntValue:{type:"int64",id:5},doubleValue:{type:"double",id:6},stringValue:{type:"bytes",id:7},aggregateValue:{type:"string",id:8}},nested:{NamePart:{fields:{namePart:{rule:"required",type:"string",id:1},isExtension:{rule:"required",type:"bool",id:2}}}}},FeatureSet:{edition:"proto2",fields:{fieldPresence:{type:"FieldPresence",id:1,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_2023","edition_defaults.value":"EXPLICIT"}},enumType:{type:"EnumType",id:2,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"OPEN"}},repeatedFieldEncoding:{type:"RepeatedFieldEncoding",id:3,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"PACKED"}},utf8Validation:{type:"Utf8Validation",id:4,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"VERIFY"}},messageEncoding:{type:"MessageEncoding",id:5,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_LEGACY","edition_defaults.value":"LENGTH_PREFIXED"}},jsonFormat:{type:"JsonFormat",id:6,options:{retention:"RETENTION_RUNTIME",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2023","edition_defaults.edition":"EDITION_PROTO3","edition_defaults.value":"ALLOW"}},enforceNamingStyle:{type:"EnforceNamingStyle",id:7,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_METHOD","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"STYLE2024"}},defaultSymbolVisibility:{type:"VisibilityFeature.DefaultSymbolVisibility",id:8,options:{retention:"RETENTION_SOURCE",targets:"TARGET_TYPE_FILE","feature_support.edition_introduced":"EDITION_2024","edition_defaults.edition":"EDITION_2024","edition_defaults.value":"EXPORT_TOP_LEVEL"}}},extensions:[[1e3,9994],[9995,9999],[1e4,1e4]],reserved:[[999,999]],nested:{FieldPresence:{values:{FIELD_PRESENCE_UNKNOWN:0,EXPLICIT:1,IMPLICIT:2,LEGACY_REQUIRED:3}},EnumType:{values:{ENUM_TYPE_UNKNOWN:0,OPEN:1,CLOSED:2}},RepeatedFieldEncoding:{values:{REPEATED_FIELD_ENCODING_UNKNOWN:0,PACKED:1,EXPANDED:2}},Utf8Validation:{values:{UTF8_VALIDATION_UNKNOWN:0,VERIFY:2,NONE:3}},MessageEncoding:{values:{MESSAGE_ENCODING_UNKNOWN:0,LENGTH_PREFIXED:1,DELIMITED:2}},JsonFormat:{values:{JSON_FORMAT_UNKNOWN:0,ALLOW:1,LEGACY_BEST_EFFORT:2}},EnforceNamingStyle:{values:{ENFORCE_NAMING_STYLE_UNKNOWN:0,STYLE2024:1,STYLE_LEGACY:2}},VisibilityFeature:{fields:{},reserved:[[1,536870911]],nested:{DefaultSymbolVisibility:{values:{DEFAULT_SYMBOL_VISIBILITY_UNKNOWN:0,EXPORT_ALL:1,EXPORT_TOP_LEVEL:2,LOCAL_ALL:3,STRICT:4}}}}}},FeatureSetDefaults:{edition:"proto2",fields:{defaults:{rule:"repeated",type:"FeatureSetEditionDefault",id:1},minimumEdition:{type:"Edition",id:4},maximumEdition:{type:"Edition",id:5}},nested:{FeatureSetEditionDefault:{fields:{edition:{type:"Edition",id:3},overridableFeatures:{type:"FeatureSet",id:4},fixedFeatures:{type:"FeatureSet",id:5}},reserved:[[1,1],[2,2],"features"]}}},SourceCodeInfo:{edition:"proto2",fields:{location:{rule:"repeated",type:"Location",id:1}},extensions:[[536e6,536e6]],nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},span:{rule:"repeated",type:"int32",id:2,options:{packed:!0}},leadingComments:{type:"string",id:3},trailingComments:{type:"string",id:4},leadingDetachedComments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{edition:"proto2",fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1,options:{packed:!0}},sourceFile:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4},semantic:{type:"Semantic",id:5}},nested:{Semantic:{values:{NONE:0,SET:1,ALIAS:2}}}}}},SymbolVisibility:{edition:"proto2",values:{VISIBILITY_UNSET:0,VISIBILITY_LOCAL:1,VISIBILITY_EXPORT:2}}}}}}}}});var Yee=y((Ze,Wee)=>{"use strict";var Pn=hx();Wee.exports=Ze=Pn.descriptor=Pn.Root.fromJSON(dL()).lookup(".google.protobuf");var jee=Pn.Namespace,Vy=Pn.Root,wa=Pn.Enum,Ro=Pn.Type,qc=Pn.Field,s$e=Pn.MapField,mx=Pn.OneOf,Gy=Pn.Service,gx=Pn.Method,Bee=Pn.util.patterns,a$e=Bee.numberRe,_x=Bee.typeRefRe;Vy.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ze.FileDescriptorSet.decode(e));var r=new Vy;if(e.file)for(var n,i,o=0,s;o<e.file.length;++o){i=r,(n=e.file[o]).package&&n.package.length&&(i=r.define(n.package));var a=g$e(n);if(n.name&&n.name.length&&r.files.push(i.filename=n.name),n.messageType)for(s=0;s<n.messageType.length;++s)i.add(Ro.fromDescriptor(n.messageType[s],a));if(n.enumType)for(s=0;s<n.enumType.length;++s)i.add(wa.fromDescriptor(n.enumType[s],a));if(n.extension)for(s=0;s<n.extension.length;++s)i.add(qc.fromDescriptor(n.extension[s],a));if(n.service)for(s=0;s<n.service.length;++s)i.add(Gy.fromDescriptor(n.service[s],a));var c=Cp(n.options,Ze.FileOptions);if(c){var l=Object.keys(c);for(s=0;s<l.length;++s)i.setOption(l[s],c[l[s]])}}return r.resolveAll()};Vy.prototype.toDescriptor=function(e){var r=Ze.FileDescriptorSet.create();return qee(this,r.file,e),r};function qee(t,e,r){var n=Ze.FileDescriptorProto.create({name:t.filename||(t.fullName.substring(1).replace(/\./g,"_")||"root")+".proto"});_$e(r,n),t instanceof Vy||(n.package=t.fullName.substring(1));for(var i=0,o;i<t.nestedArray.length;++i)(o=t._nestedArray[i])instanceof Ro?n.messageType.push(o.toDescriptor(r)):o instanceof wa?n.enumType.push(o.toDescriptor()):o instanceof qc?n.extension.push(o.toDescriptor(r)):o instanceof Gy?n.service.push(o.toDescriptor()):o instanceof jee&&qee(o,e,r);n.options=Ip(t.options,Ze.FileOptions),n.messageType.length+n.enumType.length+n.extension.length+n.service.length&&e.push(n)}var c$e=0;Ro.fromDescriptor=function(e,r,n,i){if(i===void 0&&(i=0),i>Pn.util.nestingLimit)throw Error("max depth exceeded");typeof e.length=="number"&&(e=Ze.DescriptorProto.decode(e));var o=new Ro(e.name.length?e.name:"Type"+c$e++,Cp(e.options,Ze.MessageOptions)),s;if(n||(o._edition=r),e.oneofDecl)for(s=0;s<e.oneofDecl.length;++s)o.add(mx.fromDescriptor(e.oneofDecl[s]));if(e.field)for(s=0;s<e.field.length;++s){var a=qc.fromDescriptor(e.field[s],r,!0);o.add(a),e.field[s].hasOwnProperty("oneofIndex")&&o.oneofsArray[e.field[s].oneofIndex].add(a)}if(e.extension)for(s=0;s<e.extension.length;++s)o.add(qc.fromDescriptor(e.extension[s],r,!0));if(e.nestedType)for(s=0;s<e.nestedType.length;++s)o.add(Ro.fromDescriptor(e.nestedType[s],r,!0,i+1)),e.nestedType[s].options&&e.nestedType[s].options.mapEntry&&o.setOption("map_entry",!0);if(e.enumType)for(s=0;s<e.enumType.length;++s)o.add(wa.fromDescriptor(e.enumType[s],r,!0));if(e.extensionRange&&e.extensionRange.length)for(o.extensions=[],s=0;s<e.extensionRange.length;++s)o.extensions.push([e.extensionRange[s].start,e.extensionRange[s].end]);if(e.reservedRange&&e.reservedRange.length||e.reservedName&&e.reservedName.length){if(o.reserved=[],e.reservedRange)for(s=0;s<e.reservedRange.length;++s)o.reserved.push([e.reservedRange[s].start,e.reservedRange[s].end]);if(e.reservedName)for(s=0;s<e.reservedName.length;++s)o.reserved.push(e.reservedName[s])}return o};Ro.prototype.toDescriptor=function(e){var r=Ze.DescriptorProto.create({name:this.name}),n;for(n=0;n<this.fieldsArray.length;++n){var i;if(r.field.push(i=this._fieldsArray[n].toDescriptor(e)),this._fieldsArray[n]instanceof s$e){var o=fL(this._fieldsArray[n].keyType,this._fieldsArray[n].resolvedKeyType,!1),s=fL(this._fieldsArray[n].type,this._fieldsArray[n].resolvedType,!1),a=s===11||s===14?this._fieldsArray[n].resolvedType&&Hee(this.parent,this._fieldsArray[n].resolvedType)||this._fieldsArray[n].type:void 0;r.nestedType.push(Ze.DescriptorProto.create({name:i.typeName,field:[Ze.FieldDescriptorProto.create({name:"key",number:1,label:1,type:o}),Ze.FieldDescriptorProto.create({name:"value",number:2,label:1,type:s,typeName:a})],options:Ze.MessageOptions.create({mapEntry:!0})}))}}for(n=0;n<this.oneofsArray.length;++n)r.oneofDecl.push(this._oneofsArray[n].toDescriptor());for(n=0;n<this.nestedArray.length;++n)this._nestedArray[n]instanceof qc?r.field.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof Ro?r.nestedType.push(this._nestedArray[n].toDescriptor(e)):this._nestedArray[n]instanceof wa&&r.enumType.push(this._nestedArray[n].toDescriptor());if(this.extensions)for(n=0;n<this.extensions.length;++n)r.extensionRange.push(Ze.DescriptorProto.ExtensionRange.create({start:this.extensions[n][0],end:this.extensions[n][1]}));if(this.reserved)for(n=0;n<this.reserved.length;++n)typeof this.reserved[n]=="string"?r.reservedName.push(this.reserved[n]):r.reservedRange.push(Ze.DescriptorProto.ReservedRange.create({start:this.reserved[n][0],end:this.reserved[n][1]}));return r.options=Ip(this.options,Ze.MessageOptions),r};qc.fromDescriptor=function(e,r,n){if(typeof e.length=="number"&&(e=Ze.DescriptorProto.decode(e)),typeof e.number!="number")throw Error("missing field id");var i=e.typeName,o;if(i!=null&&i!==""){if(typeof i!="string"||!_x.test(i))throw Error("illegal type name: "+i);o=i}else o=p$e(e.type);var s;switch(e.label){case 1:s=void 0;break;case 2:s="required";break;case 3:s="repeated";break;default:throw Error("illegal label: "+e.label)}var a=e.extendee;if(a!=null&&a!==""){if(typeof a!="string"||!_x.test(a))throw Error("illegal type name: "+a)}else a=void 0;var c=new qc(e.name.length?e.name:"field"+e.number,e.number,o,s,a);if(n||(c._edition=r),c.options=Cp(e.options,Ze.FieldOptions),e.proto3_optional&&(c.options.proto3_optional=!0),e.defaultValue&&e.defaultValue.length){var l=e.defaultValue;switch(l){case"true":case"TRUE":l=!0;break;case"false":case"FALSE":l=!1;break;default:var u=a$e.exec(l);u&&(l=parseInt(l));break}c.setOption("default",l)}return h$e(e.type)&&(r==="proto3"?e.options&&!e.options.packed&&c.setOption("packed",!1):(!r||r==="proto2")&&e.options&&e.options.packed&&c.setOption("packed",!0)),c};qc.prototype.toDescriptor=function(e){var r=Ze.FieldDescriptorProto.create({name:this.name,number:this.id});if(this.map)r.type=11,r.typeName=Pn.util.ucFirst(this.name),r.label=3;else{switch(r.type=fL(this.type,this.resolve().resolvedType,this.delimited)){case 10:case 11:case 14:r.typeName=this.resolvedType?Hee(this.parent,this.resolvedType):this.type;break}this.rule==="repeated"?r.label=3:this.required&&e==="proto2"?r.label=2:r.label=1}if(r.extendee=this.extensionField?this.extensionField.parent.fullName:this.extend,this.partOf&&this.parent instanceof Ro&&(r.oneofIndex=this.parent.oneofsArray.indexOf(this.partOf))<0)throw Error("missing oneof");return this.options&&(r.options=Ip(this.options,Ze.FieldOptions),this.options.default!=null&&(r.defaultValue=String(this.options.default)),this.options.proto3_optional&&(r.proto3_optional=!0)),e==="proto3"?this.packed||((r.options||(r.options=Ze.FieldOptions.create())).packed=!1):(!e||e==="proto2")&&this.packed&&((r.options||(r.options=Ze.FieldOptions.create())).packed=!0),r};var l$e=0;wa.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ze.EnumDescriptorProto.decode(e));var i={};if(e.value)for(var o=0;o<e.value.length;++o){var s=e.value[o].name,a=e.value[o].number||0;i[s&&s.length?s:"NAME"+a]=a}var c=new wa(e.name&&e.name.length?e.name:"Enum"+l$e++,i,Cp(e.options,Ze.EnumOptions));return n||(c._edition=r),c};wa.prototype.toDescriptor=function(){for(var e=[],r=0,n=Object.keys(this.values);r<n.length;++r)e.push(Ze.EnumValueDescriptorProto.create({name:n[r],number:this.values[n[r]]}));return Ze.EnumDescriptorProto.create({name:this.name,value:e,options:Ip(this.options,Ze.EnumOptions)})};var u$e=0;mx.fromDescriptor=function(e){return typeof e.length=="number"&&(e=Ze.OneofDescriptorProto.decode(e)),new mx(e.name&&e.name.length?e.name:"oneof"+u$e++)};mx.prototype.toDescriptor=function(){return Ze.OneofDescriptorProto.create({name:this.name})};var d$e=0;Gy.fromDescriptor=function(e,r,n){typeof e.length=="number"&&(e=Ze.ServiceDescriptorProto.decode(e));var i=new Gy(e.name&&e.name.length?e.name:"Service"+d$e++,Cp(e.options,Ze.ServiceOptions));if(n||(i._edition=r),e.method)for(var o=0;o<e.method.length;++o)i.add(gx.fromDescriptor(e.method[o]));return i};Gy.prototype.toDescriptor=function(){for(var e=[],r=0;r<this.methodsArray.length;++r)e.push(this._methodsArray[r].toDescriptor());return Ze.ServiceDescriptorProto.create({name:this.name,method:e,options:Ip(this.options,Ze.ServiceOptions)})};var f$e=0;gx.fromDescriptor=function(e){typeof e.length=="number"&&(e=Ze.MethodDescriptorProto.decode(e));var r=e.inputType,n=e.outputType;if(r!=null&&r!==""&&(typeof r!="string"||!_x.test(r)))throw Error("illegal type name: "+r);if(n!=null&&n!==""&&(typeof n!="string"||!_x.test(n)))throw Error("illegal type name: "+n);return new gx(e.name&&e.name.length?e.name:"Method"+f$e++,"rpc",r,n,!!e.clientStreaming,!!e.serverStreaming,Cp(e.options,Ze.MethodOptions))};gx.prototype.toDescriptor=function(){return Ze.MethodDescriptorProto.create({name:this.name,inputType:this.resolvedRequestType?this.resolvedRequestType.fullName:this.requestType,outputType:this.resolvedResponseType?this.resolvedResponseType.fullName:this.responseType,clientStreaming:this.requestStream,serverStreaming:this.responseStream,options:Ip(this.options,Ze.MethodOptions)})};function p$e(t){switch(t){case 1:return"double";case 2:return"float";case 3:return"int64";case 4:return"uint64";case 5:return"int32";case 6:return"fixed64";case 7:return"fixed32";case 8:return"bool";case 9:return"string";case 12:return"bytes";case 13:return"uint32";case 15:return"sfixed32";case 16:return"sfixed64";case 17:return"sint32";case 18:return"sint64"}throw Error("illegal type: "+t)}function h$e(t){switch(t){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 13:case 14:case 15:case 16:case 17:case 18:return!0}return!1}function fL(t,e,r){switch(t){case"double":return 1;case"float":return 2;case"int64":return 3;case"uint64":return 4;case"int32":return 5;case"fixed64":return 6;case"fixed32":return 7;case"bool":return 8;case"string":return 9;case"bytes":return 12;case"uint32":return 13;case"sfixed32":return 15;case"sfixed64":return 16;case"sint32":return 17;case"sint64":return 18}if(e instanceof wa)return 14;if(e instanceof Ro)return r?10:11;throw Error("illegal type: "+t)}function Vee(t,e){for(var r={},n=0,i,o;n<e.fieldsArray.length;++n)if((o=(i=e._fieldsArray[n]).name)!=="uninterpretedOption"&&Object.prototype.hasOwnProperty.call(t,o)){var s=m$e(o);i.resolvedType instanceof Ro?r[s]=Vee(t[o],i.resolvedType):i.resolvedType instanceof wa?r[s]=i.resolvedType.valuesById[t[o]]:r[s]=t[o]}return r}function Cp(t,e){if(t)return Vee(e.toObject(t),e)}function Gee(t,e){for(var r={},n=Object.keys(t),i=0;i<n.length;++i){var o=n[i],s=Pn.util.camelCase(o);if(Object.prototype.hasOwnProperty.call(e.fields,s)){var a=e.fields[s];a.resolvedType instanceof Ro?r[s]=Gee(t[o],a.resolvedType):r[s]=t[o],a.repeated&&!Array.isArray(r[s])&&(r[s]=[r[s]])}}return r}function Ip(t,e){if(t)return e.fromObject(Gee(t,e))}function Hee(t,e){var r=t.fullName.split("."),n=e.fullName.split("."),i=0,o=0,s=n.length-1;if(!(t instanceof Vy)&&e instanceof jee)for(;i<r.length&&o<s&&r[i]===n[o];){var a=e.lookup(r[i++],!0);if(a!==null&&a!==e)break;++o}else for(;i<r.length&&o<s&&r[i]===n[o];++i,++o);return n.slice(o).join(".")}function m$e(t){return t.substring(0,1)+t.substring(1).replace(/([A-Z])(?=[a-z]|$)/g,function(e,r){return"_"+r.toLowerCase()})}function g$e(t){if(t.syntax==="editions"){if(t.edition===Ze.Edition.EDITION_2023)return"2023";throw new Error("Unsupported edition "+t.edition)}return t.syntax==="proto3"?"proto3":"proto2"}function _$e(t,e){if(t)if(t==="proto2"||t==="proto3")e.syntax=t;else if(e.syntax="editions",t==="2023")e.edition=Ze.Edition.EDITION_2023;else throw new Error("Unsupported edition "+t)}});var Kee=y((BRt,y$e)=>{y$e.exports={nested:{google:{nested:{protobuf:{nested:{Api:{fields:{name:{type:"string",id:1},methods:{rule:"repeated",type:"Method",id:2},options:{rule:"repeated",type:"Option",id:3},version:{type:"string",id:4},sourceContext:{type:"SourceContext",id:5},mixins:{rule:"repeated",type:"Mixin",id:6},syntax:{type:"Syntax",id:7}}},Method:{fields:{name:{type:"string",id:1},requestTypeUrl:{type:"string",id:2},requestStreaming:{type:"bool",id:3},responseTypeUrl:{type:"string",id:4},responseStreaming:{type:"bool",id:5},options:{rule:"repeated",type:"Option",id:6},syntax:{type:"Syntax",id:7}}},Mixin:{fields:{name:{type:"string",id:1},root:{type:"string",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}}}}}}}}});var Zee=y((qRt,S$e)=>{S$e.exports={nested:{google:{nested:{protobuf:{nested:{SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var Jee=y((VRt,E$e)=>{E$e.exports={nested:{google:{nested:{protobuf:{nested:{Type:{fields:{name:{type:"string",id:1},fields:{rule:"repeated",type:"Field",id:2},oneofs:{rule:"repeated",type:"string",id:3},options:{rule:"repeated",type:"Option",id:4},sourceContext:{type:"SourceContext",id:5},syntax:{type:"Syntax",id:6}}},Field:{fields:{kind:{type:"Kind",id:1},cardinality:{type:"Cardinality",id:2},number:{type:"int32",id:3},name:{type:"string",id:4},typeUrl:{type:"string",id:6},oneofIndex:{type:"int32",id:7},packed:{type:"bool",id:8},options:{rule:"repeated",type:"Option",id:9},jsonName:{type:"string",id:10},defaultValue:{type:"string",id:11}},nested:{Kind:{values:{TYPE_UNKNOWN:0,TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Cardinality:{values:{CARDINALITY_UNKNOWN:0,CARDINALITY_OPTIONAL:1,CARDINALITY_REQUIRED:2,CARDINALITY_REPEATED:3}}}},Enum:{fields:{name:{type:"string",id:1},enumvalue:{rule:"repeated",type:"EnumValue",id:2},options:{rule:"repeated",type:"Option",id:3},sourceContext:{type:"SourceContext",id:4},syntax:{type:"Syntax",id:5}}},EnumValue:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{rule:"repeated",type:"Option",id:3}}},Option:{fields:{name:{type:"string",id:1},value:{type:"Any",id:2}}},Syntax:{values:{SYNTAX_PROTO2:0,SYNTAX_PROTO3:1}},Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}},SourceContext:{fields:{fileName:{type:"string",id:1}}}}}}}}}});var tte=y(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.addCommonProtos=Vc.loadProtosWithOptionsSync=Vc.loadProtosWithOptions=void 0;var Xee=Z("fs"),Qee=Z("path"),Pp=hx();function ete(t,e){let r=t.resolvePath;t.resolvePath=(n,i)=>{if(Qee.isAbsolute(i))return i;for(let o of e){let s=Qee.join(o,i);try{return Xee.accessSync(s,Xee.constants.R_OK),s}catch{continue}}return process.emitWarning(`${i} not found in any of the include paths ${e}`),r(n,i)}}async function v$e(t,e){let r=new Pp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))return Promise.reject(new Error("The includeDirs option must be an array"));ete(r,e.includeDirs)}let n=await r.load(t,e);return n.resolveAll(),n}Vc.loadProtosWithOptions=v$e;function b$e(t,e){let r=new Pp.Root;if(e=e||{},e.includeDirs){if(!Array.isArray(e.includeDirs))throw new Error("The includeDirs option must be an array");ete(r,e.includeDirs)}let n=r.loadSync(t,e);return n.resolveAll(),n}Vc.loadProtosWithOptionsSync=b$e;function T$e(){let t=Kee(),e=dL(),r=Zee(),n=Jee();Pp.common("api",t.nested.google.nested.protobuf.nested),Pp.common("descriptor",e.nested.google.nested.protobuf.nested),Pp.common("source_context",r.nested.google.nested.protobuf.nested),Pp.common("type",n.nested.google.nested.protobuf.nested)}Vc.addCommonProtos=T$e});var yL=y(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.loadFileDescriptorSetFromObject=gr.loadFileDescriptorSetFromBuffer=gr.fromJSON=gr.loadSync=gr.load=gr.IdempotencyLevel=gr.isAnyExtension=gr.Long=void 0;var w$e=LQ(),Ss=hx(),gL=Yee(),_L=tte(),A$e=ED();gr.Long=A$e;function x$e(t){return"@type"in t&&typeof t["@type"]=="string"}gr.isAnyExtension=x$e;var rte;(function(t){t.IDEMPOTENCY_UNKNOWN="IDEMPOTENCY_UNKNOWN",t.NO_SIDE_EFFECTS="NO_SIDE_EFFECTS",t.IDEMPOTENT="IDEMPOTENT"})(rte=gr.IdempotencyLevel||(gr.IdempotencyLevel={}));var nte={longs:String,enums:String,bytes:String,defaults:!0,oneofs:!0,json:!0};function R$e(t,e){return t===""?e:t+"."+e}function C$e(t){return t instanceof Ss.Service||t instanceof Ss.Type||t instanceof Ss.Enum}function I$e(t){return t instanceof Ss.Namespace||t instanceof Ss.Root}function ite(t,e){let r=R$e(e,t.name);return C$e(t)?[[r,t]]:I$e(t)&&typeof t.nested<"u"?Object.keys(t.nested).map(n=>ite(t.nested[n],r)).reduce((n,i)=>n.concat(i),[]):[]}function pL(t,e){return function(n){return t.toObject(t.decode(n),e)}}function hL(t){return function(r){if(Array.isArray(r))throw new Error(`Failed to serialize message: expected object with ${t.name} structure, got array instead`);let n=t.fromObject(r);return t.encode(n).finish()}}function P$e(t){return(t||[]).reduce((e,r)=>{for(let[n,i]of Object.entries(r))n==="uninterpreted_option"?e.uninterpreted_option.push(r.uninterpreted_option):e[n]=i;return e},{deprecated:!1,idempotency_level:rte.IDEMPOTENCY_UNKNOWN,uninterpreted_option:[]})}function O$e(t,e,r,n){let i=t.resolvedRequestType,o=t.resolvedResponseType;return{path:"/"+e+"/"+t.name,requestStream:!!t.requestStream,responseStream:!!t.responseStream,requestSerialize:hL(i),requestDeserialize:pL(i,r),responseSerialize:hL(o),responseDeserialize:pL(o,r),originalName:w$e(t.name),requestType:mL(i,r,n),responseType:mL(o,r,n),options:P$e(t.parsedOptions)}}function N$e(t,e,r,n){let i={};for(let o of t.methodsArray)i[o.name]=O$e(o,e,r,n);return i}function mL(t,e,r){let n=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 DescriptorProto",type:n.$type.toObject(n,nte),fileDescriptorProtos:r,serialize:hL(t),deserialize:pL(t,e)}}function k$e(t,e){let r=t.toDescriptor("proto3");return{format:"Protocol Buffer 3 EnumDescriptorProto",type:r.$type.toObject(r,nte),fileDescriptorProtos:e}}function M$e(t,e,r,n){if(t instanceof Ss.Service)return N$e(t,e,r,n);if(t instanceof Ss.Type)return mL(t,r,n);if(t instanceof Ss.Enum)return k$e(t,n);throw new Error("Type mismatch in reflection object handling")}function yx(t,e){let r={};t.resolveAll();let i=t.toDescriptor("proto3").file.map(o=>Buffer.from(gL.FileDescriptorProto.encode(o).finish()));for(let[o,s]of ite(t,""))r[o]=M$e(s,o,e,i);return r}function ote(t,e){e=e||{};let r=Ss.Root.fromDescriptor(t);return r.resolveAll(),yx(r,e)}function $$e(t,e){return(0,_L.loadProtosWithOptions)(t,e).then(r=>yx(r,e))}gr.load=$$e;function D$e(t,e){let r=(0,_L.loadProtosWithOptionsSync)(t,e);return yx(r,e)}gr.loadSync=D$e;function L$e(t,e){e=e||{};let r=Ss.Root.fromJSON(t);return r.resolveAll(),yx(r,e)}gr.fromJSON=L$e;function U$e(t,e){let r=gL.FileDescriptorSet.decode(t);return ote(r,e)}gr.loadFileDescriptorSetFromBuffer=U$e;function F$e(t,e){let r=gL.FileDescriptorSet.fromObject(t);return ote(r,e)}gr.loadFileDescriptorSetFromObject=F$e;(0,_L.addCommonProtos)()});var Gc=y(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.registerChannelzSocket=Ft.registerChannelzServer=Ft.registerChannelzSubchannel=Ft.registerChannelzChannel=Ft.ChannelzCallTrackerStub=Ft.ChannelzCallTracker=Ft.ChannelzChildrenTrackerStub=Ft.ChannelzChildrenTracker=Ft.ChannelzTrace=Ft.ChannelzTraceStub=void 0;Ft.unregisterChannelzRef=V$e;Ft.getChannelzHandlers=pte;Ft.getChannelzServiceDefinition=hte;Ft.setup=tDe;var Ex=Z("net"),Ku=(sQ(),An(oQ)),Hy=In(),Wy=Xe(),z$e=Gn(),j$e=UA(),B$e=qA();function SL(t){return{channel_id:t.id,name:t.name}}function wL(t){return{subchannel_id:t.id,name:t.name}}function q$e(t){return{server_id:t.id}}function Tx(t){return{socket_id:t.id,name:t.name}}var ste=32,AL=100,EL=class{constructor(){this.events=[],this.creationTimestamp=new Date,this.eventsLogged=0}addTrace(){}getTraceMessage(){return{creation_timestamp:Es(this.creationTimestamp),num_events_logged:this.eventsLogged,events:[]}}};Ft.ChannelzTraceStub=EL;var vL=class{constructor(){this.events=[],this.eventsLogged=0,this.creationTimestamp=new Date}addTrace(e,r,n){let i=new Date;this.events.push({description:r,severity:e,timestamp:i,childChannel:n?.kind==="channel"?n:void 0,childSubchannel:n?.kind==="subchannel"?n:void 0}),this.events.length>=ste*2&&(this.events=this.events.slice(ste)),this.eventsLogged+=1}getTraceMessage(){return{creation_timestamp:Es(this.creationTimestamp),num_events_logged:this.eventsLogged,events:this.events.map(e=>({description:e.description,severity:e.severity,timestamp:Es(e.timestamp),channel_ref:e.childChannel?SL(e.childChannel):null,subchannel_ref:e.childSubchannel?wL(e.childSubchannel):null}))}}};Ft.ChannelzTrace=vL;var vx=class{constructor(){this.channelChildren=new Ku.OrderedMap,this.subchannelChildren=new Ku.OrderedMap,this.socketChildren=new Ku.OrderedMap,this.trackerMap={channel:this.channelChildren,subchannel:this.subchannelChildren,socket:this.socketChildren}}refChild(e){let r=this.trackerMap[e.kind],n=r.find(e.id);n.equals(r.end())?r.setElement(e.id,{ref:e,count:1},n):n.pointer[1].count+=1}unrefChild(e){let r=this.trackerMap[e.kind],n=r.getElementByKey(e.id);n!==void 0&&(n.count-=1,n.count===0&&r.eraseElementByKey(e.id))}getChildLists(){return{channels:this.channelChildren,subchannels:this.subchannelChildren,sockets:this.socketChildren}}};Ft.ChannelzChildrenTracker=vx;var bL=class extends vx{refChild(){}unrefChild(){}};Ft.ChannelzChildrenTrackerStub=bL;var bx=class{constructor(){this.callsStarted=0,this.callsSucceeded=0,this.callsFailed=0,this.lastCallStartedTimestamp=null}addCallStarted(){this.callsStarted+=1,this.lastCallStartedTimestamp=new Date}addCallSucceeded(){this.callsSucceeded+=1}addCallFailed(){this.callsFailed+=1}};Ft.ChannelzCallTracker=bx;var TL=class extends bx{addCallStarted(){}addCallSucceeded(){}addCallFailed(){}};Ft.ChannelzCallTrackerStub=TL;var Aa={channel:new Ku.OrderedMap,subchannel:new Ku.OrderedMap,server:new Ku.OrderedMap,socket:new Ku.OrderedMap},wx=t=>{let e=1;function r(){return e++}let n=Aa[t];return(i,o,s)=>{let a=r(),c={id:a,name:i,kind:t};return s&&n.setElement(a,{ref:c,getInfo:o}),c}};Ft.registerChannelzChannel=wx("channel");Ft.registerChannelzSubchannel=wx("subchannel");Ft.registerChannelzServer=wx("server");Ft.registerChannelzSocket=wx("socket");function V$e(t){Aa[t.kind].eraseElementByKey(t.id)}function G$e(t){let e=Number.parseInt(t,16);return[e/256|0,e%256]}function ate(t){if(t==="")return[];let e=t.split(":").map(n=>G$e(n));return[].concat(...e)}function H$e(t){return(0,Ex.isIPv6)(t)&&t.toLowerCase().startsWith("::ffff:")&&(0,Ex.isIPv4)(t.substring(7))}function cte(t){return Buffer.from(Uint8Array.from(t.split(".").map(e=>Number.parseInt(e))))}function W$e(t){if((0,Ex.isIPv4)(t))return cte(t);if(H$e(t))return cte(t.substring(7));if((0,Ex.isIPv6)(t)){let e,r,n=t.indexOf("::");n===-1?(e=t,r=""):(e=t.substring(0,n),r=t.substring(n+2));let i=Buffer.from(ate(e)),o=Buffer.from(ate(r)),s=Buffer.alloc(16-i.length-o.length,0);return Buffer.concat([i,s,o])}else return null}function ute(t){switch(t){case Hy.ConnectivityState.CONNECTING:return{state:"CONNECTING"};case Hy.ConnectivityState.IDLE:return{state:"IDLE"};case Hy.ConnectivityState.READY:return{state:"READY"};case Hy.ConnectivityState.SHUTDOWN:return{state:"SHUTDOWN"};case Hy.ConnectivityState.TRANSIENT_FAILURE:return{state:"TRANSIENT_FAILURE"};default:return{state:"UNKNOWN"}}}function Es(t){if(!t)return null;let e=t.getTime();return{seconds:e/1e3|0,nanos:e%1e3*1e6}}function dte(t){let e=t.getInfo(),r=[],n=[];return e.children.channels.forEach(i=>{r.push(SL(i[1].ref))}),e.children.subchannels.forEach(i=>{n.push(wL(i[1].ref))}),{ref:SL(t.ref),data:{target:e.target,state:ute(e.state),calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Es(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},channel_ref:r,subchannel_ref:n}}function Y$e(t,e){let r=parseInt(t.request.channel_id,10),n=Aa.channel.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No channel data found for id "+r});return}e(null,{channel:dte(n)})}function K$e(t,e){let r=parseInt(t.request.max_results,10)||AL,n=[],i=parseInt(t.request.start_channel_id,10),o=Aa.channel,s;for(s=o.lowerBound(i);!s.equals(o.end())&&n.length<r;s=s.next())n.push(dte(s.pointer[1]));e(null,{channel:n,end:s.equals(o.end())})}function fte(t){let e=t.getInfo(),r=[];return e.listenerChildren.sockets.forEach(n=>{r.push(Tx(n[1].ref))}),{ref:q$e(t.ref),data:{calls_started:e.callTracker.callsStarted,calls_succeeded:e.callTracker.callsSucceeded,calls_failed:e.callTracker.callsFailed,last_call_started_timestamp:Es(e.callTracker.lastCallStartedTimestamp),trace:e.trace.getTraceMessage()},listen_socket:r}}function Z$e(t,e){let r=parseInt(t.request.server_id,10),i=Aa.server.getElementByKey(r);if(i===void 0){e({code:Wy.Status.NOT_FOUND,details:"No server data found for id "+r});return}e(null,{server:fte(i)})}function J$e(t,e){let r=parseInt(t.request.max_results,10)||AL,n=parseInt(t.request.start_server_id,10),i=Aa.server,o=[],s;for(s=i.lowerBound(n);!s.equals(i.end())&&o.length<r;s=s.next())o.push(fte(s.pointer[1]));e(null,{server:o,end:s.equals(i.end())})}function X$e(t,e){let r=parseInt(t.request.subchannel_id,10),n=Aa.subchannel.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No subchannel data found for id "+r});return}let i=n.getInfo(),o=[];i.children.sockets.forEach(a=>{o.push(Tx(a[1].ref))});let s={ref:wL(n.ref),data:{target:i.target,state:ute(i.state),calls_started:i.callTracker.callsStarted,calls_succeeded:i.callTracker.callsSucceeded,calls_failed:i.callTracker.callsFailed,last_call_started_timestamp:Es(i.callTracker.lastCallStartedTimestamp),trace:i.trace.getTraceMessage()},socket_ref:o};e(null,{subchannel:s})}function lte(t){var e;return(0,z$e.isTcpSubchannelAddress)(t)?{address:"tcpip_address",tcpip_address:{ip_address:(e=W$e(t.host))!==null&&e!==void 0?e:void 0,port:t.port}}:{address:"uds_address",uds_address:{filename:t.path}}}function Q$e(t,e){var r,n,i,o,s;let a=parseInt(t.request.socket_id,10),c=Aa.socket.getElementByKey(a);if(c===void 0){e({code:Wy.Status.NOT_FOUND,details:"No socket data found for id "+a});return}let l=c.getInfo(),u=l.security?{model:"tls",tls:{cipher_suite:l.security.cipherSuiteStandardName?"standard_name":"other_name",standard_name:(r=l.security.cipherSuiteStandardName)!==null&&r!==void 0?r:void 0,other_name:(n=l.security.cipherSuiteOtherName)!==null&&n!==void 0?n:void 0,local_certificate:(i=l.security.localCertificate)!==null&&i!==void 0?i:void 0,remote_certificate:(o=l.security.remoteCertificate)!==null&&o!==void 0?o:void 0}}:null,d={ref:Tx(c.ref),local:l.localAddress?lte(l.localAddress):null,remote:l.remoteAddress?lte(l.remoteAddress):null,remote_name:(s=l.remoteName)!==null&&s!==void 0?s:void 0,security:u,data:{keep_alives_sent:l.keepAlivesSent,streams_started:l.streamsStarted,streams_succeeded:l.streamsSucceeded,streams_failed:l.streamsFailed,last_local_stream_created_timestamp:Es(l.lastLocalStreamCreatedTimestamp),last_remote_stream_created_timestamp:Es(l.lastRemoteStreamCreatedTimestamp),messages_received:l.messagesReceived,messages_sent:l.messagesSent,last_message_received_timestamp:Es(l.lastMessageReceivedTimestamp),last_message_sent_timestamp:Es(l.lastMessageSentTimestamp),local_flow_control_window:l.localFlowControlWindow?{value:l.localFlowControlWindow}:null,remote_flow_control_window:l.remoteFlowControlWindow?{value:l.remoteFlowControlWindow}:null}};e(null,{socket:d})}function eDe(t,e){let r=parseInt(t.request.server_id,10),n=Aa.server.getElementByKey(r);if(n===void 0){e({code:Wy.Status.NOT_FOUND,details:"No server data found for id "+r});return}let i=parseInt(t.request.start_socket_id,10),o=parseInt(t.request.max_results,10)||AL,a=n.getInfo().sessionChildren.sockets,c=[],l;for(l=a.lowerBound(i);!l.equals(a.end())&&c.length<o;l=l.next())c.push(Tx(l.pointer[1].ref));e(null,{socket_ref:c,end:l.equals(a.end())})}function pte(){return{GetChannel:Y$e,GetTopChannels:K$e,GetServer:Z$e,GetServers:J$e,GetSubchannel:X$e,GetSocket:Q$e,GetServerSockets:eDe}}var Sx=null;function hte(){if(Sx)return Sx;let t=yL().loadSync,e=t("channelz.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto`]});return Sx=(0,B$e.loadPackageDefinition)(e).grpc.channelz.v1.Channelz.service,Sx}function tDe(){(0,j$e.registerAdminService)(hte,pte)}});var Ax=y(xL=>{"use strict";Object.defineProperty(xL,"__esModule",{value:!0});xL.getNextCallNumber=nDe;var rDe=0;function nDe(){return rDe++}});var RL=y(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:!0});xx.CompressionAlgorithms=void 0;var mte;(function(t){t[t.identity=0]="identity",t[t.deflate=1]="deflate",t[t.gzip=2]="gzip"})(mte||(xx.CompressionAlgorithms=mte={}))});var IL=y(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:!0});Rx.BaseFilter=void 0;var CL=class{async sendMetadata(e){return e}receiveMetadata(e){return e}async sendMessage(e){return e}async receiveMessage(e){return e}receiveTrailers(e){return e}};Rx.BaseFilter=CL});var ML=y(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.CompressionFilterFactory=Np.CompressionFilter=void 0;var Cx=Z("zlib"),_te=RL(),Hc=Xe(),iDe=IL(),oDe=Nt(),sDe=t=>typeof t=="number"&&typeof _te.CompressionAlgorithms[t]=="string",Op=class{async writeMessage(e,r){let n=e;r&&(n=await this.compressMessage(n));let i=Buffer.allocUnsafe(n.length+5);return i.writeUInt8(r?1:0,0),i.writeUInt32BE(n.length,1),n.copy(i,5),i}async readMessage(e){let r=e.readUInt8(0)===1,n=e.slice(5);return r&&(n=await this.decompressMessage(n)),n}},Zu=class extends Op{async compressMessage(e){return e}async writeMessage(e,r){let n=Buffer.allocUnsafe(e.length+5);return n.writeUInt8(0,0),n.writeUInt32BE(e.length,1),e.copy(n,5),n}decompressMessage(e){return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'))}},PL=class extends Op{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Cx.deflate(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=Cx.createInflate();s.on("error",a=>{n({code:Hc.Status.INTERNAL,details:"Failed to decompress deflate-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:Hc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},OL=class extends Op{constructor(e){super(),this.maxRecvMessageLength=e}compressMessage(e){return new Promise((r,n)=>{Cx.gzip(e,(i,o)=>{i?n(i):r(o)})})}decompressMessage(e){return new Promise((r,n)=>{let i=0,o=[],s=Cx.createGunzip();s.on("error",a=>{n({code:Hc.Status.INTERNAL,details:"Failed to decompress gzip-encoded message"})}),s.on("data",a=>{o.push(a),i+=a.byteLength,this.maxRecvMessageLength!==-1&&i>this.maxRecvMessageLength&&(s.destroy(),n({code:Hc.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxRecvMessageLength}`}))}),s.on("end",()=>{r(Buffer.concat(o))}),s.write(e),s.end()})}},NL=class extends Op{constructor(e){super(),this.compressionName=e}compressMessage(e){return Promise.reject(new Error(`Received message compressed with unsupported compression method ${this.compressionName}`))}decompressMessage(e){return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`))}};function gte(t,e){switch(t){case"identity":return new Zu;case"deflate":return new PL(e);case"gzip":return new OL(e);default:return new NL(t)}}var Ix=class extends iDe.BaseFilter{constructor(e,r){var n,i,o;super(),this.sharedFilterConfig=r,this.sendCompression=new Zu,this.receiveCompression=new Zu,this.currentCompressionAlgorithm="identity";let s=e["grpc.default_compression_algorithm"];if(this.maxReceiveMessageLength=(n=e["grpc.max_receive_message_length"])!==null&&n!==void 0?n:Hc.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.maxSendMessageLength=(i=e["grpc.max_send_message_length"])!==null&&i!==void 0?i:Hc.DEFAULT_MAX_SEND_MESSAGE_LENGTH,s!==void 0)if(sDe(s)){let a=_te.CompressionAlgorithms[s],c=(o=r.serverSupportedEncodingHeader)===null||o===void 0?void 0:o.split(",");(!c||c.includes(a))&&(this.currentCompressionAlgorithm=a,this.sendCompression=gte(this.currentCompressionAlgorithm,-1))}else oDe.log(Hc.LogVerbosity.ERROR,`Invalid value provided for grpc.default_compression_algorithm option: ${s}`)}async sendMetadata(e){let r=await e;return r.set("grpc-accept-encoding","identity,deflate,gzip"),r.set("accept-encoding","identity"),this.currentCompressionAlgorithm==="identity"?r.remove("grpc-encoding"):r.set("grpc-encoding",this.currentCompressionAlgorithm),r}receiveMetadata(e){let r=e.get("grpc-encoding");if(r.length>0){let i=r[0];typeof i=="string"&&(this.receiveCompression=gte(i,this.maxReceiveMessageLength))}e.remove("grpc-encoding");let n=e.get("grpc-accept-encoding")[0];return n&&(this.sharedFilterConfig.serverSupportedEncodingHeader=n,n.split(",").includes(this.currentCompressionAlgorithm)||(this.sendCompression=new Zu,this.currentCompressionAlgorithm="identity")),e.remove("grpc-accept-encoding"),e}async sendMessage(e){var r;let n=await e;if(this.maxSendMessageLength!==-1&&n.message.length>this.maxSendMessageLength)throw{code:Hc.Status.RESOURCE_EXHAUSTED,details:`Attempted to send message with a size larger than ${this.maxSendMessageLength}`};let i;return this.sendCompression instanceof Zu?i=!1:i=(((r=n.flags)!==null&&r!==void 0?r:0)&2)===0,{message:await this.sendCompression.writeMessage(n.message,i),flags:n.flags}}async receiveMessage(e){return this.receiveCompression.readMessage(await e)}};Np.CompressionFilter=Ix;var kL=class{constructor(e,r){this.options=r,this.sharedFilterConfig={}}createFilter(){return new Ix(this.options,this.sharedFilterConfig)}};Np.CompressionFilterFactory=kL});var Yy=y($L=>{"use strict";Object.defineProperty($L,"__esModule",{value:!0});$L.restrictControlPlaneStatusCode=cDe;var vs=Xe(),aDe=[vs.Status.OK,vs.Status.INVALID_ARGUMENT,vs.Status.NOT_FOUND,vs.Status.ALREADY_EXISTS,vs.Status.FAILED_PRECONDITION,vs.Status.ABORTED,vs.Status.OUT_OF_RANGE,vs.Status.DATA_LOSS];function cDe(t,e){return aDe.includes(t)?{code:vs.Status.INTERNAL,details:`Invalid status from control plane: ${t} ${vs.Status[t]} ${e}`}:{code:t,details:e}}});var kp=y(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.minDeadline=lDe;Ju.getDeadlineTimeoutString=dDe;Ju.getRelativeTimeout=pDe;Ju.deadlineToString=hDe;Ju.formatDateDifference=mDe;function lDe(...t){let e=1/0;for(let r of t){let n=r instanceof Date?r.getTime():r;n<e&&(e=n)}return e}var uDe=[["m",1],["S",1e3],["M",60*1e3],["H",3600*1e3]];function dDe(t){let e=new Date().getTime();t instanceof Date&&(t=t.getTime());let r=Math.max(t-e,0);for(let[n,i]of uDe){let o=r/i;if(o<1e8)return String(Math.ceil(o))+n}throw new Error("Deadline is too far in the future")}var fDe=2147483647;function pDe(t){let e=t instanceof Date?t.getTime():t,r=new Date().getTime(),n=e-r;return n<0?0:n>fDe?1/0:n}function hDe(t){if(t instanceof Date)return t.toISOString();{let e=new Date(t);return Number.isNaN(e.getTime())?""+t:e.toISOString()}}function mDe(t,e){return((e.getTime()-t.getTime())/1e3).toFixed(3)+"s"}});var Ox=y(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.FilterStackFactory=Mp.FilterStack=void 0;var Px=class{constructor(e){this.filters=e}sendMetadata(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMetadata(r);return r}receiveMetadata(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMetadata(r);return r}sendMessage(e){let r=e;for(let n=0;n<this.filters.length;n++)r=this.filters[n].sendMessage(r);return r}receiveMessage(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveMessage(r);return r}receiveTrailers(e){let r=e;for(let n=this.filters.length-1;n>=0;n--)r=this.filters[n].receiveTrailers(r);return r}push(e){this.filters.unshift(...e)}getFilters(){return this.filters}};Mp.FilterStack=Px;var DL=class t{constructor(e){this.factories=e}push(e){this.factories.unshift(...e)}clone(){return new t([...this.factories])}createFilter(){return new Px(this.factories.map(e=>e.createFilter()))}};Mp.FilterStackFactory=DL});var yte=y(kx=>{"use strict";Object.defineProperty(kx,"__esModule",{value:!0});kx.SingleSubchannelChannel=void 0;var gDe=Ax(),Ky=Gc(),_De=ML(),yDe=In(),Zy=Xe(),SDe=Yy(),EDe=kp(),vDe=Ox(),LL=Rr(),bDe=mo(),Nx=Cn(),UL=class{constructor(e,r,n,i,o){var s,a;this.subchannel=e,this.method=r,this.options=i,this.callNumber=o,this.childCall=null,this.pendingMessage=null,this.readPending=!1,this.halfClosePending=!1,this.pendingStatus=null,this.readFilterPending=!1,this.writeFilterPending=!1;let c=this.method.split("/"),l="";c.length>=2&&(l=c[1]);let u=(a=(s=(0,Nx.splitHostPort)(this.options.host))===null||s===void 0?void 0:s.host)!==null&&a!==void 0?a:"localhost";this.serviceUrl=`https://${u}/${l}`;let d=(0,EDe.getRelativeTimeout)(i.deadline);d!==1/0&&(d<=0?this.cancelWithStatus(Zy.Status.DEADLINE_EXCEEDED,"Deadline exceeded"):setTimeout(()=>{this.cancelWithStatus(Zy.Status.DEADLINE_EXCEEDED,"Deadline exceeded")},d)),this.filterStack=n.createFilter()}cancelWithStatus(e,r){this.childCall?this.childCall.cancelWithStatus(e,r):this.pendingStatus={code:e,details:r,metadata:new LL.Metadata}}getPeer(){var e,r;return(r=(e=this.childCall)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.subchannel.getAddress()}async start(e,r){if(this.pendingStatus){r.onReceiveStatus(this.pendingStatus);return}if(this.subchannel.getConnectivityState()!==yDe.ConnectivityState.READY){r.onReceiveStatus({code:Zy.Status.UNAVAILABLE,details:"Subchannel not ready",metadata:new LL.Metadata});return}let n=await this.filterStack.sendMetadata(Promise.resolve(e)),i;try{i=await this.subchannel.getCallCredentials().generateMetadata({method_name:this.method,service_url:this.serviceUrl})}catch(s){let a=s,{code:c,details:l}=(0,SDe.restrictControlPlaneStatusCode)(typeof a.code=="number"?a.code:Zy.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${a.message}`);r.onReceiveStatus({code:c,details:l,metadata:new LL.Metadata});return}i.merge(n);let o={onReceiveMetadata:async s=>{r.onReceiveMetadata(await this.filterStack.receiveMetadata(s))},onReceiveMessage:async s=>{this.readFilterPending=!0;let a=await this.filterStack.receiveMessage(s);this.readFilterPending=!1,r.onReceiveMessage(a),this.pendingStatus&&r.onReceiveStatus(this.pendingStatus)},onReceiveStatus:async s=>{let a=await this.filterStack.receiveTrailers(s);this.readFilterPending?this.pendingStatus=a:r.onReceiveStatus(a)}};this.childCall=this.subchannel.createCall(i,this.options.host,this.method,o),this.readPending&&this.childCall.startRead(),this.pendingMessage&&this.childCall.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.halfClosePending&&!this.writeFilterPending&&this.childCall.halfClose()}async sendMessageWithContext(e,r){this.writeFilterPending=!0;let n=await this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags}));this.writeFilterPending=!1,this.childCall?(this.childCall.sendMessageWithContext(e,n.message),this.halfClosePending&&this.childCall.halfClose()):this.pendingMessage={context:e,message:n.message}}startRead(){this.childCall?this.childCall.startRead():this.readPending=!0}halfClose(){this.childCall&&!this.writeFilterPending?this.childCall.halfClose():this.halfClosePending=!0}getCallNumber(){return this.callNumber}setCredentials(e){throw new Error("Method not implemented.")}getAuthContext(){return this.childCall?this.childCall.getAuthContext():null}},FL=class{constructor(e,r,n){this.subchannel=e,this.target=r,this.channelzEnabled=!1,this.channelzTrace=new Ky.ChannelzTrace,this.callTracker=new Ky.ChannelzCallTracker,this.childrenTracker=new Ky.ChannelzChildrenTracker,this.channelzEnabled=n["grpc.enable_channelz"]!==0,this.channelzRef=(0,Ky.registerChannelzChannel)((0,Nx.uriToString)(r),()=>({target:`${(0,Nx.uriToString)(r)} (${e.getAddress()})`,state:this.subchannel.getConnectivityState(),trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()}),this.channelzEnabled),this.channelzEnabled&&this.childrenTracker.refChild(e.getChannelzRef()),this.filterStackFactory=new vDe.FilterStackFactory([new _De.CompressionFilterFactory(this,n)])}close(){this.channelzEnabled&&this.childrenTracker.unrefChild(this.subchannel.getChannelzRef()),(0,Ky.unregisterChannelzRef)(this.channelzRef)}getTarget(){return(0,Nx.uriToString)(this.target)}getConnectivityState(e){throw new Error("Method not implemented.")}watchConnectivityState(e,r,n){throw new Error("Method not implemented.")}getChannelzRef(){return this.channelzRef}createCall(e,r){let n={deadline:r,host:(0,bDe.getDefaultAuthority)(this.target),flags:Zy.Propagate.DEFAULTS,parentCall:null};return new UL(this.subchannel,e,this.filterStackFactory,n,(0,gDe.getNextCallNumber)())}};kx.SingleSubchannelChannel=FL});var Ste=y($x=>{"use strict";Object.defineProperty($x,"__esModule",{value:!0});$x.Subchannel=void 0;var wt=In(),TDe=pp(),zL=Nt(),Mx=Xe(),wDe=Cn(),ADe=Gn(),bs=Gc(),xDe=yte(),RDe="subchannel",CDe=~(1<<31),jL=class{constructor(e,r,n,i,o){var s;this.channelTarget=e,this.subchannelAddress=r,this.options=n,this.connector=o,this.connectivityState=wt.ConnectivityState.IDLE,this.transport=null,this.continueConnecting=!1,this.stateListeners=new Set,this.refcount=0,this.channelzEnabled=!0,this.dataProducers=new Map,this.subchannelChannel=null;let a={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoffTimeout=new TDe.BackoffTimeout(()=>{this.handleBackoffTimer()},a),this.backoffTimeout.unref(),this.subchannelAddressString=(0,ADe.subchannelAddressToString)(r),this.keepaliveTime=(s=n["grpc.keepalive_time_ms"])!==null&&s!==void 0?s:-1,n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new bs.ChannelzTraceStub,this.callTracker=new bs.ChannelzCallTrackerStub,this.childrenTracker=new bs.ChannelzChildrenTrackerStub,this.streamTracker=new bs.ChannelzCallTrackerStub):(this.channelzTrace=new bs.ChannelzTrace,this.callTracker=new bs.ChannelzCallTracker,this.childrenTracker=new bs.ChannelzChildrenTracker,this.streamTracker=new bs.ChannelzCallTracker),this.channelzRef=(0,bs.registerChannelzSubchannel)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Subchannel created"),this.trace("Subchannel constructed with options "+JSON.stringify(n,void 0,2)),this.secureConnector=i._createSecureConnector(e,n)}getChannelzInfo(){return{state:this.connectivityState,trace:this.channelzTrace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists(),target:this.subchannelAddressString}}trace(e){zL.trace(Mx.LogVerbosity.DEBUG,RDe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}refTrace(e){zL.trace(Mx.LogVerbosity.DEBUG,"subchannel_refcount","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}handleBackoffTimer(){this.continueConnecting?this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING):this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.IDLE)}startBackoff(){this.backoffTimeout.runOnce()}stopBackoff(){this.backoffTimeout.stop(),this.backoffTimeout.reset()}startConnectingInternal(){let e=this.options;if(e["grpc.keepalive_time_ms"]){let r=Math.min(this.keepaliveTime,CDe);e=Object.assign(Object.assign({},e),{"grpc.keepalive_time_ms":r})}this.connector.connect(this.subchannelAddress,this.secureConnector,e).then(r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.READY)?(this.transport=r,this.channelzEnabled&&this.childrenTracker.refChild(r.getChannelzRef()),r.addDisconnectListener(n=>{this.transitionToState([wt.ConnectivityState.READY],wt.ConnectivityState.IDLE),n&&this.keepaliveTime>0&&(this.keepaliveTime*=2,zL.log(Mx.LogVerbosity.ERROR,`Connection to ${(0,wDe.uriToString)(this.channelTarget)} at ${this.subchannelAddressString} rejected by server because of excess pings. Increasing ping interval to ${this.keepaliveTime} ms`))})):r.shutdown()},r=>{this.transitionToState([wt.ConnectivityState.CONNECTING],wt.ConnectivityState.TRANSIENT_FAILURE,`${r}`)})}transitionToState(e,r,n){var i,o;if(e.indexOf(this.connectivityState)===-1)return!1;n?this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]+' with error "'+n+'"'):this.trace(wt.ConnectivityState[this.connectivityState]+" -> "+wt.ConnectivityState[r]),this.channelzEnabled&&this.channelzTrace.addTrace("CT_INFO","Connectivity state change to "+wt.ConnectivityState[r]);let s=this.connectivityState;switch(this.connectivityState=r,r){case wt.ConnectivityState.READY:this.stopBackoff();break;case wt.ConnectivityState.CONNECTING:this.startBackoff(),this.startConnectingInternal(),this.continueConnecting=!1;break;case wt.ConnectivityState.TRANSIENT_FAILURE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(i=this.transport)===null||i===void 0||i.shutdown(),this.transport=null,this.backoffTimeout.isRunning()||process.nextTick(()=>{this.handleBackoffTimer()});break;case wt.ConnectivityState.IDLE:this.channelzEnabled&&this.transport&&this.childrenTracker.unrefChild(this.transport.getChannelzRef()),(o=this.transport)===null||o===void 0||o.shutdown(),this.transport=null;break;default:throw new Error(`Invalid state: unknown ConnectivityState ${r}`)}for(let a of this.stateListeners)a(this,s,r,this.keepaliveTime,n);return!0}ref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount+1)),this.refcount+=1}unref(){this.refTrace("refcount "+this.refcount+" -> "+(this.refcount-1)),this.refcount-=1,this.refcount===0&&(this.channelzTrace.addTrace("CT_INFO","Shutting down"),(0,bs.unregisterChannelzRef)(this.channelzRef),this.secureConnector.destroy(),process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.CONNECTING,wt.ConnectivityState.READY],wt.ConnectivityState.IDLE)}))}unrefIfOneRef(){return this.refcount===1?(this.unref(),!0):!1}createCall(e,r,n,i){if(!this.transport)throw new Error("Cannot create call, subchannel not READY");let o;return this.channelzEnabled?(this.callTracker.addCallStarted(),this.streamTracker.addCallStarted(),o={onCallEnd:s=>{s.code===Mx.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()}}):o={},this.transport.createCall(e,r,n,i,o)}startConnecting(){process.nextTick(()=>{this.transitionToState([wt.ConnectivityState.IDLE],wt.ConnectivityState.CONNECTING)||this.connectivityState===wt.ConnectivityState.TRANSIENT_FAILURE&&(this.continueConnecting=!0)})}getConnectivityState(){return this.connectivityState}addConnectivityStateListener(e){this.stateListeners.add(e)}removeConnectivityStateListener(e){this.stateListeners.delete(e)}resetBackoff(){process.nextTick(()=>{this.backoffTimeout.reset(),this.transitionToState([wt.ConnectivityState.TRANSIENT_FAILURE],wt.ConnectivityState.CONNECTING)})}getAddress(){return this.subchannelAddressString}getChannelzRef(){return this.channelzRef}isHealthy(){return!0}addHealthStateWatcher(e){}removeHealthStateWatcher(e){}getRealSubchannel(){return this}realSubchannelEquals(e){return e.getRealSubchannel()===this}throttleKeepalive(e){e>this.keepaliveTime&&(this.keepaliveTime=e)}getCallCredentials(){return this.secureConnector.getCallCredentials()}getChannel(){return this.subchannelChannel||(this.subchannelChannel=new xDe.SingleSubchannelChannel(this,this.channelTarget,this.options)),this.subchannelChannel}addDataWatcher(e){throw new Error("Not implemented")}getOrCreateDataProducer(e,r){let n=this.dataProducers.get(e);if(n)return n;let i=r(this);return this.dataProducers.set(e,i),i}removeDataProducer(e){this.dataProducers.delete(e)}};$x.Subchannel=jL});var Ete=y(Dx=>{"use strict";var BL;Object.defineProperty(Dx,"__esModule",{value:!0});Dx.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=void 0;Dx.GRPC_NODE_USE_ALTERNATIVE_RESOLVER=((BL=process.env.GRPC_NODE_USE_ALTERNATIVE_RESOLVER)!==null&&BL!==void 0?BL:"false")==="true"});var HL=y(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.DEFAULT_PORT=void 0;Xu.setup=DDe;var vte=mo(),qL=Z("dns"),IDe=z$(),VL=Xe(),$p=zu(),PDe=Rr(),ODe=Nt(),NDe=Xe(),Wc=Cn(),bte=Z("net"),kDe=pp(),Tte=Ete(),MDe="dns_resolver";function Ts(t){ODe.trace(NDe.LogVerbosity.DEBUG,MDe,t)}Xu.DEFAULT_PORT=443;var $De=3e4,GL=class{constructor(e,r,n){var i,o,s;this.target=e,this.listener=r,this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.continueResolving=!1,this.isNextResolutionTimerRunning=!1,this.isServiceConfigEnabled=!0,this.returnedIpResult=!1,this.alternativeResolver=new qL.promises.Resolver,Ts("Resolver constructed for target "+(0,Wc.uriToString)(e)),e.authority&&this.alternativeResolver.setServers([e.authority]);let a=(0,Wc.splitHostPort)(e.path);a===null?(this.ipResult=null,this.dnsHostname=null,this.port=null):(0,bte.isIPv4)(a.host)||(0,bte.isIPv6)(a.host)?(this.ipResult=[{addresses:[{host:a.host,port:(i=a.port)!==null&&i!==void 0?i:Xu.DEFAULT_PORT}]}],this.dnsHostname=null,this.port=null):(this.ipResult=null,this.dnsHostname=a.host,this.port=(o=a.port)!==null&&o!==void 0?o:Xu.DEFAULT_PORT),this.percentage=Math.random()*100,n["grpc.service_config_disable_resolution"]===1&&(this.isServiceConfigEnabled=!1),this.defaultResolutionError={code:VL.Status.UNAVAILABLE,details:`Name resolution failed for target ${(0,Wc.uriToString)(this.target)}`,metadata:new PDe.Metadata};let c={initialDelay:n["grpc.initial_reconnect_backoff_ms"],maxDelay:n["grpc.max_reconnect_backoff_ms"]};this.backoff=new kDe.BackoffTimeout(()=>{this.continueResolving&&this.startResolutionWithBackoff()},c),this.backoff.unref(),this.minTimeBetweenResolutionsMs=(s=n["grpc.dns_min_time_between_resolutions_ms"])!==null&&s!==void 0?s:$De,this.nextResolutionTimer=setTimeout(()=>{},0),clearTimeout(this.nextResolutionTimer)}startResolution(){if(this.ipResult!==null){this.returnedIpResult||(Ts("Returning IP address for target "+(0,Wc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,$p.statusOrFromValue)(this.ipResult),{},null,"")}),this.returnedIpResult=!0),this.backoff.stop(),this.backoff.reset(),this.stopNextResolutionTimer();return}if(this.dnsHostname===null)Ts("Failed to parse DNS address "+(0,Wc.uriToString)(this.target)),setImmediate(()=>{this.listener((0,$p.statusOrFromError)({code:VL.Status.UNAVAILABLE,details:`Failed to parse DNS address ${(0,Wc.uriToString)(this.target)}`}),{},null,"")}),this.stopNextResolutionTimer();else{if(this.pendingLookupPromise!==null)return;Ts("Looking up DNS hostname "+this.dnsHostname),this.latestLookupResult=null;let e=this.dnsHostname;this.pendingLookupPromise=this.lookup(e),this.pendingLookupPromise.then(r=>{if(this.pendingLookupPromise===null)return;this.pendingLookupPromise=null,this.latestLookupResult=(0,$p.statusOrFromValue)(r.map(o=>({addresses:[o]})));let n="["+r.map(o=>o.host+":"+o.port).join(",")+"]";Ts("Resolved addresses for target "+(0,Wc.uriToString)(this.target)+": "+n);let i=this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"");this.handleHealthStatus(i)},r=>{this.pendingLookupPromise!==null&&(Ts("Resolution error for target "+(0,Wc.uriToString)(this.target)+": "+r.message),this.pendingLookupPromise=null,this.stopNextResolutionTimer(),this.listener((0,$p.statusOrFromError)(this.defaultResolutionError),{},this.latestServiceConfigResult,""))}),this.isServiceConfigEnabled&&this.pendingTxtPromise===null&&(this.pendingTxtPromise=this.resolveTxt(e),this.pendingTxtPromise.then(r=>{if(this.pendingTxtPromise===null)return;this.pendingTxtPromise=null;let n;try{n=(0,IDe.extractAndSelectServiceConfig)(r,this.percentage),n?this.latestServiceConfigResult=(0,$p.statusOrFromValue)(n):this.latestServiceConfigResult=null}catch(i){this.latestServiceConfigResult=(0,$p.statusOrFromError)({code:VL.Status.UNAVAILABLE,details:`Parsing service config failed with error ${i.message}`})}this.latestLookupResult!==null&&this.listener(this.latestLookupResult,{},this.latestServiceConfigResult,"")},r=>{}))}}handleHealthStatus(e){e?(this.backoff.stop(),this.backoff.reset()):this.continueResolving=!0}async lookup(e){if(Tte.GRPC_NODE_USE_ALTERNATIVE_RESOLVER){Ts("Using alternative DNS resolver.");let n=await Promise.allSettled([this.alternativeResolver.resolve4(e),this.alternativeResolver.resolve6(e)]);if(n.every(i=>i.status==="rejected"))throw new Error(n[0].reason);return n.reduce((i,o)=>o.status==="fulfilled"?[...i,...o.value]:i,[]).map(i=>({host:i,port:+this.port}))}return(await qL.promises.lookup(e,{all:!0})).map(n=>({host:n.address,port:+this.port}))}async resolveTxt(e){return Tte.GRPC_NODE_USE_ALTERNATIVE_RESOLVER?(Ts("Using alternative DNS resolver."),this.alternativeResolver.resolveTxt(e)):qL.promises.resolveTxt(e)}startNextResolutionTimer(){var e,r;clearTimeout(this.nextResolutionTimer),this.nextResolutionTimer=setTimeout(()=>{this.stopNextResolutionTimer(),this.continueResolving&&this.startResolutionWithBackoff()},this.minTimeBetweenResolutionsMs),(r=(e=this.nextResolutionTimer).unref)===null||r===void 0||r.call(e),this.isNextResolutionTimerRunning=!0}stopNextResolutionTimer(){clearTimeout(this.nextResolutionTimer),this.isNextResolutionTimerRunning=!1}startResolutionWithBackoff(){this.pendingLookupPromise===null&&(this.continueResolving=!1,this.backoff.runOnce(),this.startNextResolutionTimer(),this.startResolution())}updateResolution(){this.pendingLookupPromise===null&&(this.isNextResolutionTimerRunning||this.backoff.isRunning()?(this.isNextResolutionTimerRunning?Ts('resolution update delayed by "min time between resolutions" rate limit'):Ts("resolution update delayed by backoff timer until "+this.backoff.getEndTime().toISOString()),this.continueResolving=!0):this.startResolutionWithBackoff())}destroy(){this.continueResolving=!1,this.backoff.reset(),this.backoff.stop(),this.stopNextResolutionTimer(),this.pendingLookupPromise=null,this.pendingTxtPromise=null,this.latestLookupResult=null,this.latestServiceConfigResult=null,this.returnedIpResult=!1}static getDefaultAuthority(e){return e.path}};function DDe(){(0,vte.registerResolver)("dns",GL),(0,vte.registerDefaultScheme)("dns")}});var WL=y(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.parseCIDR=xte;Qy.mapProxyName=HDe;Qy.getProxiedConnection=WDe;var Jy=Nt(),Dp=Xe(),Ate=Z("net"),LDe=Z("http"),UDe=Nt(),wte=Gn(),Xy=Cn(),FDe=Z("url"),zDe=HL(),jDe="proxy";function Lp(t){UDe.trace(Dp.LogVerbosity.DEBUG,jDe,t)}function BDe(){let t="",e="";if(process.env.grpc_proxy)e="grpc_proxy",t=process.env.grpc_proxy;else if(process.env.https_proxy)e="https_proxy",t=process.env.https_proxy;else if(process.env.http_proxy)e="http_proxy",t=process.env.http_proxy;else return{};let r;try{r=new FDe.URL(t)}catch{return(0,Jy.log)(Dp.LogVerbosity.ERROR,`cannot parse value of "${e}" env var`),{}}if(r.protocol!=="http:")return(0,Jy.log)(Dp.LogVerbosity.ERROR,`"${r.protocol}" scheme not supported in proxy URI`),{};let n=null;r.username&&(r.password?((0,Jy.log)(Dp.LogVerbosity.INFO,"userinfo found in proxy URI"),n=decodeURIComponent(`${r.username}:${r.password}`)):n=r.username);let i=r.hostname,o=r.port;o===""&&(o="80");let s={address:`${i}:${o}`};return n&&(s.creds=n),Lp("Proxy server "+s.address+" set by environment variable "+e),s}function qDe(){let t=process.env.no_grpc_proxy,e="no_grpc_proxy";return t||(t=process.env.no_proxy,e="no_proxy"),t?(Lp("No proxy server list set by environment variable "+e),t.split(",")):[]}function xte(t){let e=t.split("/");if(e.length!==2)return null;let r=parseInt(e[1],10);return!(0,Ate.isIPv4)(e[0])||Number.isNaN(r)||r<0||r>32?null:{ip:Rte(e[0]),prefixLength:r}}function Rte(t){return t.split(".").reduce((e,r)=>(e<<8)+parseInt(r,10),0)}function VDe(t,e){let r=t.ip,n=-1<<32-t.prefixLength;return(Rte(e)&n)===(r&n)}function GDe(t){for(let e of qDe()){let r=xte(e);if((0,Ate.isIPv4)(t)&&r&&VDe(r,t))return!0;if(t.endsWith(e))return!0}return!1}function HDe(t,e){var r;let n={target:t,extraOptions:{}};if(((r=e["grpc.enable_http_proxy"])!==null&&r!==void 0?r:1)===0||t.scheme==="unix")return n;let i=BDe();if(!i.address)return n;let o=(0,Xy.splitHostPort)(t.path);if(!o)return n;let s=o.host;if(GDe(s))return Lp("Not using proxy for target in no_proxy list: "+(0,Xy.uriToString)(t)),n;let a={"grpc.http_connect_target":(0,Xy.uriToString)(t)};return i.creds&&(a["grpc.http_connect_creds"]=i.creds),{target:{scheme:"dns",path:i.address},extraOptions:a}}function WDe(t,e){var r;if(!("grpc.http_connect_target"in e))return Promise.resolve(null);let n=e["grpc.http_connect_target"],i=(0,Xy.parseUri)(n);if(i===null)return Promise.resolve(null);let o=(0,Xy.splitHostPort)(i.path);if(o===null)return Promise.resolve(null);let s=`${o.host}:${(r=o.port)!==null&&r!==void 0?r:zDe.DEFAULT_PORT}`,a={method:"CONNECT",path:s},c={Host:s};(0,wte.isTcpSubchannelAddress)(t)?(a.host=t.host,a.port=t.port):a.socketPath=t.path,"grpc.http_connect_creds"in e&&(c["Proxy-Authorization"]="Basic "+Buffer.from(e["grpc.http_connect_creds"]).toString("base64")),a.headers=c;let l=(0,wte.subchannelAddressToString)(t);return Lp("Using proxy "+l+" to connect to "+a.path),new Promise((u,d)=>{let f=LDe.request(a);f.once("connect",(p,h,m)=>{f.removeAllListeners(),h.removeAllListeners(),p.statusCode===200?(Lp("Successfully connected to "+a.path+" through proxy "+l),m.length>0&&h.unshift(m),Lp("Successfully established a plaintext connection to "+a.path+" through proxy "+l),u(h)):((0,Jy.log)(Dp.LogVerbosity.ERROR,"Failed to connect to "+a.path+" through proxy "+l+" with status "+p.statusCode),d())}),f.once("error",p=>{f.removeAllListeners(),(0,Jy.log)(Dp.LogVerbosity.ERROR,"Failed to connect to proxy "+l+" with error "+p.message),d()}),f.end()})}});var KL=y(Lx=>{"use strict";Object.defineProperty(Lx,"__esModule",{value:!0});Lx.StreamDecoder=void 0;var ws;(function(t){t[t.NO_DATA=0]="NO_DATA",t[t.READING_SIZE=1]="READING_SIZE",t[t.READING_MESSAGE=2]="READING_MESSAGE"})(ws||(ws={}));var YL=class{constructor(e){this.maxReadMessageLength=e,this.readState=ws.NO_DATA,this.readCompressFlag=Buffer.alloc(1),this.readPartialSize=Buffer.alloc(4),this.readSizeRemaining=4,this.readMessageSize=0,this.readPartialMessage=[],this.readMessageRemaining=0}write(e){let r=0,n,i=[];for(;r<e.length;)switch(this.readState){case ws.NO_DATA:this.readCompressFlag=e.slice(r,r+1),r+=1,this.readState=ws.READING_SIZE,this.readPartialSize.fill(0),this.readSizeRemaining=4,this.readMessageSize=0,this.readMessageRemaining=0,this.readPartialMessage=[];break;case ws.READING_SIZE:if(n=Math.min(e.length-r,this.readSizeRemaining),e.copy(this.readPartialSize,4-this.readSizeRemaining,r,r+n),this.readSizeRemaining-=n,r+=n,this.readSizeRemaining===0){if(this.readMessageSize=this.readPartialSize.readUInt32BE(0),this.maxReadMessageLength!==-1&&this.readMessageSize>this.maxReadMessageLength)throw new Error(`Received message larger than max (${this.readMessageSize} vs ${this.maxReadMessageLength})`);if(this.readMessageRemaining=this.readMessageSize,this.readMessageRemaining>0)this.readState=ws.READING_MESSAGE;else{let o=Buffer.concat([this.readCompressFlag,this.readPartialSize],5);this.readState=ws.NO_DATA,i.push(o)}}break;case ws.READING_MESSAGE:if(n=Math.min(e.length-r,this.readMessageRemaining),this.readPartialMessage.push(e.slice(r,r+n)),this.readMessageRemaining-=n,r+=n,this.readMessageRemaining===0){let o=[this.readCompressFlag,this.readPartialSize].concat(this.readPartialMessage),s=Buffer.concat(o,this.readMessageSize+5);this.readState=ws.NO_DATA,i.push(s)}break;default:throw new Error("Unexpected read state")}return i}};Lx.StreamDecoder=YL});var Cte=y(Ux=>{"use strict";Object.defineProperty(Ux,"__esModule",{value:!0});Ux.Http2SubchannelCall=void 0;var xa=Z("http2"),YDe=Z("os"),At=Xe(),Ra=Rr(),KDe=KL(),ZDe=Nt(),JDe=Xe(),XDe="subchannel_call";function QDe(t){for(let[e,r]of Object.entries(YDe.constants.errno))if(r===t)return e;return"Unknown system error "+t}function ZL(t){let e=`Received HTTP status code ${t}`,r;switch(t){case 400:r=At.Status.INTERNAL;break;case 401:r=At.Status.UNAUTHENTICATED;break;case 403:r=At.Status.PERMISSION_DENIED;break;case 404:r=At.Status.UNIMPLEMENTED;break;case 429:case 502:case 503:case 504:r=At.Status.UNAVAILABLE;break;default:r=At.Status.UNKNOWN}return{code:r,details:e,metadata:new Ra.Metadata}}var JL=class{constructor(e,r,n,i,o){var s;this.http2Stream=e,this.callEventTracker=r,this.listener=n,this.transport=i,this.callId=o,this.isReadFilterPending=!1,this.isPushPending=!1,this.canPush=!1,this.readsClosed=!1,this.statusOutput=!1,this.unpushedReadMessages=[],this.finalStatus=null,this.internalError=null,this.serverEndedCall=!1,this.connectionDropped=!1;let a=(s=i.getOptions()["grpc.max_receive_message_length"])!==null&&s!==void 0?s:At.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH;this.decoder=new KDe.StreamDecoder(a),e.on("response",(c,l)=>{let u="";for(let d of Object.keys(c))u+=" "+d+": "+c[d]+`
|
|
18
18
|
`;if(this.trace(`Received server headers:
|
|
19
19
|
`+u),this.httpStatusCode=c[":status"],l&xa.constants.NGHTTP2_FLAG_END_STREAM)this.handleTrailers(c);else{let d;try{d=Ra.Metadata.fromHttp2Headers(c)}catch(f){this.endCall({code:At.Status.UNKNOWN,details:f.message,metadata:new Ra.Metadata});return}this.listener.onReceiveMetadata(d)}}),e.on("trailers",c=>{this.handleTrailers(c)}),e.on("data",c=>{if(this.statusOutput)return;this.trace("receive HTTP/2 data frame of length "+c.length);let l;try{l=this.decoder.write(c)}catch(u){if(this.httpStatusCode!==void 0&&this.httpStatusCode!==200){let d=ZL(this.httpStatusCode);this.cancelWithStatus(d.code,d.details)}else this.cancelWithStatus(At.Status.RESOURCE_EXHAUSTED,u.message);return}for(let u of l)this.trace("parsed message of length "+u.length),this.callEventTracker.addMessageReceived(),this.tryPush(u)}),e.on("end",()=>{this.readsClosed=!0,this.maybeOutputStatus()}),e.on("close",()=>{this.serverEndedCall=!0,process.nextTick(()=>{var c;if(this.trace("HTTP/2 stream closed with code "+e.rstCode),((c=this.finalStatus)===null||c===void 0?void 0:c.code)===At.Status.OK)return;let l,u="";switch(e.rstCode){case xa.constants.NGHTTP2_NO_ERROR:if(this.finalStatus!==null)return;if(this.httpStatusCode&&this.httpStatusCode!==200){let d=ZL(this.httpStatusCode);l=d.code,u=d.details}else l=At.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode} (Call ended without gRPC status)`;break;case xa.constants.NGHTTP2_REFUSED_STREAM:l=At.Status.UNAVAILABLE,u="Stream refused by server";break;case xa.constants.NGHTTP2_CANCEL:this.connectionDropped?(l=At.Status.UNAVAILABLE,u="Connection dropped"):(l=At.Status.CANCELLED,u="Call cancelled");break;case xa.constants.NGHTTP2_ENHANCE_YOUR_CALM:l=At.Status.RESOURCE_EXHAUSTED,u="Bandwidth exhausted or memory limit exceeded";break;case xa.constants.NGHTTP2_INADEQUATE_SECURITY:l=At.Status.PERMISSION_DENIED,u="Protocol not secure enough";break;case xa.constants.NGHTTP2_INTERNAL_ERROR:l=At.Status.INTERNAL,this.internalError===null?u=`Received RST_STREAM with code ${e.rstCode} (Internal server error)`:this.internalError.code==="ECONNRESET"||this.internalError.code==="ETIMEDOUT"?(l=At.Status.UNAVAILABLE,u=this.internalError.message):u=`Received RST_STREAM with code ${e.rstCode} triggered by internal client error: ${this.internalError.message}`;break;default:l=At.Status.INTERNAL,u=`Received RST_STREAM with code ${e.rstCode}`}this.endCall({code:l,details:u,metadata:new Ra.Metadata,rstCode:e.rstCode})})}),e.on("error",c=>{c.code!=="ERR_HTTP2_STREAM_ERROR"&&(this.trace("Node error event: message="+c.message+" code="+c.code+" errno="+QDe(c.errno)+" syscall="+c.syscall),this.internalError=c),this.callEventTracker.onStreamEnd(!1)})}getDeadlineInfo(){return[`remote_addr=${this.getPeer()}`]}onDisconnect(){this.connectionDropped=!0,setImmediate(()=>{this.endCall({code:At.Status.UNAVAILABLE,details:"Connection dropped",metadata:new Ra.Metadata})})}outputStatus(){this.statusOutput||(this.statusOutput=!0,this.trace("ended with status: code="+this.finalStatus.code+' details="'+this.finalStatus.details+'"'),this.callEventTracker.onCallEnd(this.finalStatus),process.nextTick(()=>{this.listener.onReceiveStatus(this.finalStatus)}),this.http2Stream.resume())}trace(e){ZDe.trace(JDe.LogVerbosity.DEBUG,XDe,"["+this.callId+"] "+e)}endCall(e){(this.finalStatus===null||this.finalStatus.code===At.Status.OK)&&(this.finalStatus=e,this.maybeOutputStatus()),this.destroyHttp2Stream()}maybeOutputStatus(){this.finalStatus!==null&&(this.finalStatus.code!==At.Status.OK||this.readsClosed&&this.unpushedReadMessages.length===0&&!this.isReadFilterPending&&!this.isPushPending)&&this.outputStatus()}push(e){this.trace("pushing to reader message of length "+(e instanceof Buffer?e.length:null)),this.canPush=!1,this.isPushPending=!0,process.nextTick(()=>{this.isPushPending=!1,!this.statusOutput&&(this.listener.onReceiveMessage(e),this.maybeOutputStatus())})}tryPush(e){this.canPush?(this.http2Stream.pause(),this.push(e)):(this.trace("unpushedReadMessages.push message of length "+e.length),this.unpushedReadMessages.push(e))}handleTrailers(e){this.serverEndedCall=!0,this.callEventTracker.onStreamEnd(!0);let r="";for(let s of Object.keys(e))r+=" "+s+": "+e[s]+`
|
|
20
20
|
`;this.trace(`Received server trailers:
|
|
21
21
|
`+r);let n;try{n=Ra.Metadata.fromHttp2Headers(e)}catch{n=new Ra.Metadata}let i=n.getMap(),o;if(typeof i["grpc-status"]=="string"){let s=Number(i["grpc-status"]);this.trace("received status code "+s+" from server"),n.remove("grpc-status");let a="";if(typeof i["grpc-message"]=="string"){try{a=decodeURI(i["grpc-message"])}catch{a=i["grpc-message"]}n.remove("grpc-message"),this.trace('received status details string "'+a+'" from server')}o={code:s,details:a,metadata:n}}else this.httpStatusCode?(o=ZL(this.httpStatusCode),o.metadata=n):o={code:At.Status.UNKNOWN,details:"No status information received",metadata:n};this.endCall(o)}destroyHttp2Stream(){var e;if(!this.http2Stream.destroyed)if(this.serverEndedCall)this.http2Stream.end();else{let r;((e=this.finalStatus)===null||e===void 0?void 0:e.code)===At.Status.OK?r=xa.constants.NGHTTP2_NO_ERROR:r=xa.constants.NGHTTP2_CANCEL,this.trace("close http2 stream with code "+r),this.http2Stream.close(r)}}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.endCall({code:e,details:r,metadata:new Ra.Metadata})}getStatus(){return this.finalStatus}getPeer(){return this.transport.getPeerName()}getCallNumber(){return this.callId}getAuthContext(){return this.transport.getAuthContext()}startRead(){if(this.finalStatus!==null&&this.finalStatus.code!==At.Status.OK){this.readsClosed=!0,this.maybeOutputStatus();return}if(this.canPush=!0,this.unpushedReadMessages.length>0){let e=this.unpushedReadMessages.shift();this.push(e);return}this.http2Stream.resume()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n=i=>{process.nextTick(()=>{var o;let s=At.Status.UNAVAILABLE;i?.code==="ERR_STREAM_WRITE_AFTER_END"&&(s=At.Status.INTERNAL),i&&this.cancelWithStatus(s,`Write error: ${i.message}`),(o=e.callback)===null||o===void 0||o.call(e)})};this.trace("sending data chunk of length "+r.length),this.callEventTracker.addMessageSent();try{this.http2Stream.write(r,n)}catch(i){this.endCall({code:At.Status.UNAVAILABLE,details:`Write failed with error ${i.message}`,metadata:new Ra.Metadata})}}halfClose(){this.trace("end() called"),this.trace("calling end() on HTTP/2 stream"),this.http2Stream.end()}};Ux.Http2SubchannelCall=JL});var Ite=y(jx=>{"use strict";Object.defineProperty(jx,"__esModule",{value:!0});jx.Http2SubchannelConnector=void 0;var Qu=Z("http2"),eLe=Z("tls"),Fx=Gc(),eS=Xe(),tLe=WL(),Up=Nt(),rLe=mo(),zx=Gn(),XL=Cn(),nLe=Z("net"),iLe=Cte(),oLe=Ax(),QL="transport",sLe="transport_flowctrl",aLe=E$().version,{HTTP2_HEADER_AUTHORITY:cLe,HTTP2_HEADER_CONTENT_TYPE:lLe,HTTP2_HEADER_METHOD:uLe,HTTP2_HEADER_PATH:dLe,HTTP2_HEADER_TE:fLe,HTTP2_HEADER_USER_AGENT:pLe}=Qu.constants,hLe=2e4,mLe=Buffer.from("too_many_pings","ascii"),e1=class{constructor(e,r,n,i){this.session=e,this.options=n,this.remoteName=i,this.keepaliveTimer=null,this.pendingSendKeepalivePing=!1,this.activeCalls=new Set,this.disconnectListeners=[],this.disconnectHandled=!1,this.channelzEnabled=!0,this.keepalivesSent=0,this.messagesSent=0,this.messagesReceived=0,this.lastMessageSentTimestamp=null,this.lastMessageReceivedTimestamp=null,this.subchannelAddressString=(0,zx.subchannelAddressToString)(r),n["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.streamTracker=new Fx.ChannelzCallTrackerStub):this.streamTracker=new Fx.ChannelzCallTracker,this.channelzRef=(0,Fx.registerChannelzSocket)(this.subchannelAddressString,()=>this.getChannelzInfo(),this.channelzEnabled),this.userAgent=[n["grpc.primary_user_agent"],`grpc-node-js/${aLe}`,n["grpc.secondary_user_agent"]].filter(o=>o).join(" "),"grpc.keepalive_time_ms"in n?this.keepaliveTimeMs=n["grpc.keepalive_time_ms"]:this.keepaliveTimeMs=-1,"grpc.keepalive_timeout_ms"in n?this.keepaliveTimeoutMs=n["grpc.keepalive_timeout_ms"]:this.keepaliveTimeoutMs=hLe,"grpc.keepalive_permit_without_calls"in n?this.keepaliveWithoutCalls=n["grpc.keepalive_permit_without_calls"]===1:this.keepaliveWithoutCalls=!1,e.once("close",()=>{this.trace("session closed"),this.handleDisconnect()}),e.once("goaway",(o,s,a)=>{let c=!1;o===Qu.constants.NGHTTP2_ENHANCE_YOUR_CALM&&a&&a.equals(mLe)&&(c=!0),this.trace("connection closed by GOAWAY with code "+o+" and data "+a?.toString()),this.reportDisconnectToOwner(c)}),e.once("error",o=>{this.trace("connection closed with error "+o.message),this.handleDisconnect()}),e.socket.once("close",o=>{this.trace("connection closed. hadError="+o),this.handleDisconnect()}),Up.isTracerEnabled(QL)&&(e.on("remoteSettings",o=>{this.trace("new settings received"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(o))}),e.on("localSettings",o=>{this.trace("local settings acknowledged by remote"+(this.session!==e?" on the old connection":"")+": "+JSON.stringify(o))})),this.keepaliveWithoutCalls&&this.maybeStartKeepalivePingTimer(),e.socket instanceof eLe.TLSSocket?this.authContext={transportSecurityType:"ssl",sslPeerCertificate:e.socket.getPeerCertificate()}:this.authContext={}}getChannelzInfo(){var e,r,n;let i=this.session.socket,o=i.remoteAddress?(0,zx.stringToSubchannelAddress)(i.remoteAddress,i.remotePort):null,s=i.localAddress?(0,zx.stringToSubchannelAddress)(i.localAddress,i.localPort):null,a;if(this.session.encrypted){let l=i,u=l.getCipher(),d=l.getCertificate(),f=l.getPeerCertificate();a={cipherSuiteStandardName:(e=u.standardName)!==null&&e!==void 0?e:null,cipherSuiteOtherName:u.standardName?null:u.name,localCertificate:d&&"raw"in d?d.raw:null,remoteCertificate:f&&"raw"in f?f.raw:null}}else a=null;return{remoteAddress:o,localAddress:s,security:a,remoteName:this.remoteName,streamsStarted:this.streamTracker.callsStarted,streamsSucceeded:this.streamTracker.callsSucceeded,streamsFailed:this.streamTracker.callsFailed,messagesSent:this.messagesSent,messagesReceived:this.messagesReceived,keepAlivesSent:this.keepalivesSent,lastLocalStreamCreatedTimestamp:this.streamTracker.lastCallStartedTimestamp,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:this.lastMessageSentTimestamp,lastMessageReceivedTimestamp:this.lastMessageReceivedTimestamp,localFlowControlWindow:(r=this.session.state.localWindowSize)!==null&&r!==void 0?r:null,remoteFlowControlWindow:(n=this.session.state.remoteWindowSize)!==null&&n!==void 0?n:null}}trace(e){Up.trace(eS.LogVerbosity.DEBUG,QL,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}keepaliveTrace(e){Up.trace(eS.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}flowControlTrace(e){Up.trace(eS.LogVerbosity.DEBUG,sLe,"("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}internalsTrace(e){Up.trace(eS.LogVerbosity.DEBUG,"transport_internals","("+this.channelzRef.id+") "+this.subchannelAddressString+" "+e)}reportDisconnectToOwner(e){this.disconnectHandled||(this.disconnectHandled=!0,this.disconnectListeners.forEach(r=>r(e)))}handleDisconnect(){this.clearKeepaliveTimeout(),this.reportDisconnectToOwner(!1);for(let e of this.activeCalls)e.onDisconnect();setImmediate(()=>{this.session.destroy()})}addDisconnectListener(e){this.disconnectListeners.push(e)}canSendPing(){return!this.session.destroyed&&this.keepaliveTimeMs>0&&(this.keepaliveWithoutCalls||this.activeCalls.size>0)}maybeSendPing(){var e,r;if(!this.canSendPing()){this.pendingSendKeepalivePing=!0;return}if(this.keepaliveTimer){console.error("keepaliveTimeout is not null");return}this.channelzEnabled&&(this.keepalivesSent+=1),this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.keepaliveTrace("Ping timeout passed without response"),this.handleDisconnect()},this.keepaliveTimeoutMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e);let n="";try{this.session.ping((o,s,a)=>{this.clearKeepaliveTimeout(),o?(this.keepaliveTrace("Ping failed with error "+o.message),this.handleDisconnect()):(this.keepaliveTrace("Received ping response"),this.maybeStartKeepalivePingTimer())})||(n="Ping returned false")}catch(i){n=(i instanceof Error?i.message:"")||"Unknown error"}n&&(this.keepaliveTrace("Ping send failed: "+n),this.handleDisconnect())}maybeStartKeepalivePingTimer(){var e,r;this.canSendPing()&&(this.pendingSendKeepalivePing?(this.pendingSendKeepalivePing=!1,this.maybeSendPing()):this.keepaliveTimer||(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),this.keepaliveTimer=setTimeout(()=>{this.keepaliveTimer=null,this.maybeSendPing()},this.keepaliveTimeMs),(r=(e=this.keepaliveTimer).unref)===null||r===void 0||r.call(e)))}clearKeepaliveTimeout(){this.keepaliveTimer&&(clearTimeout(this.keepaliveTimer),this.keepaliveTimer=null)}removeActiveCall(e){this.activeCalls.delete(e),this.activeCalls.size===0&&this.session.unref()}addActiveCall(e){this.activeCalls.add(e),this.activeCalls.size===1&&(this.session.ref(),this.keepaliveWithoutCalls||this.maybeStartKeepalivePingTimer())}createCall(e,r,n,i,o){let s=e.toHttp2Headers();s[cLe]=r,s[pLe]=this.userAgent,s[lLe]="application/grpc",s[uLe]="POST",s[dLe]=n,s[fLe]="trailers";let a;try{a=this.session.request(s)}catch(u){throw this.handleDisconnect(),u}this.flowControlTrace("local window size: "+this.session.state.localWindowSize+" remote window size: "+this.session.state.remoteWindowSize),this.internalsTrace("session.closed="+this.session.closed+" session.destroyed="+this.session.destroyed+" session.socket.destroyed="+this.session.socket.destroyed);let c,l;return this.channelzEnabled?(this.streamTracker.addCallStarted(),c={addMessageSent:()=>{var u;this.messagesSent+=1,this.lastMessageSentTimestamp=new Date,(u=o.addMessageSent)===null||u===void 0||u.call(o)},addMessageReceived:()=>{var u;this.messagesReceived+=1,this.lastMessageReceivedTimestamp=new Date,(u=o.addMessageReceived)===null||u===void 0||u.call(o)},onCallEnd:u=>{var d;(d=o.onCallEnd)===null||d===void 0||d.call(o,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;u?this.streamTracker.addCallSucceeded():this.streamTracker.addCallFailed(),(d=o.onStreamEnd)===null||d===void 0||d.call(o,u)}}):c={addMessageSent:()=>{var u;(u=o.addMessageSent)===null||u===void 0||u.call(o)},addMessageReceived:()=>{var u;(u=o.addMessageReceived)===null||u===void 0||u.call(o)},onCallEnd:u=>{var d;(d=o.onCallEnd)===null||d===void 0||d.call(o,u),this.removeActiveCall(l)},onStreamEnd:u=>{var d;(d=o.onStreamEnd)===null||d===void 0||d.call(o,u)}},l=new iLe.Http2SubchannelCall(a,c,i,this,(0,oLe.getNextCallNumber)()),this.addActiveCall(l),l}getChannelzRef(){return this.channelzRef}getPeerName(){return this.subchannelAddressString}getOptions(){return this.options}getAuthContext(){return this.authContext}shutdown(){this.session.close(),(0,Fx.unregisterChannelzRef)(this.channelzRef)}},t1=class{constructor(e){this.channelTarget=e,this.session=null,this.isShutdown=!1}trace(e){Up.trace(eS.LogVerbosity.DEBUG,QL,(0,XL.uriToString)(this.channelTarget)+" "+e)}createSession(e,r,n){return this.isShutdown?Promise.reject():e.socket.closed?Promise.reject("Connection closed before starting HTTP/2 handshake"):new Promise((i,o)=>{var s,a,c,l,u,d,f,p;let h=null,m=this.channelTarget;if("grpc.http_connect_target"in n){let L=(0,XL.parseUri)(n["grpc.http_connect_target"]);L&&(m=L,h=(0,XL.uriToString)(L))}let g=e.secure?"https":"http",_=(0,rLe.getDefaultAuthority)(m),b=()=>{var L;(L=this.session)===null||L===void 0||L.destroy(),this.session=null,setImmediate(()=>{M||(M=!0,o(`${N.trim()} (${new Date().toISOString()})`))})},T=L=>{var v;(v=this.session)===null||v===void 0||v.destroy(),N=L.message,this.trace("connection failed with error "+N),M||(M=!0,o(`${N} (${new Date().toISOString()})`))},E={createConnection:(L,v)=>e.socket,settings:{initialWindowSize:(l=(s=n["grpc-node.flow_control_window"])!==null&&s!==void 0?s:(c=(a=Qu.getDefaultSettings)===null||a===void 0?void 0:a.call(Qu))===null||c===void 0?void 0:c.initialWindowSize)!==null&&l!==void 0?l:65535},maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER,maxSessionMemory:(u=n["grpc-node.max_session_memory"])!==null&&u!==void 0?u:Number.MAX_SAFE_INTEGER},A=Qu.connect(`${g}://${_}`,E),O=(p=(f=(d=Qu.getDefaultSettings)===null||d===void 0?void 0:d.call(Qu))===null||f===void 0?void 0:f.initialWindowSize)!==null&&p!==void 0?p:65535,R=n["grpc-node.flow_control_window"];this.session=A;let N="Failed to connect",M=!1;A.unref(),A.once("remoteSettings",()=>{var L;if(R&&R>O)try{A.setLocalWindowSize(R)}catch{let oe=R-((L=A.state.localWindowSize)!==null&&L!==void 0?L:O);oe>0&&A.incrementWindowSize(oe)}A.removeAllListeners(),e.socket.removeListener("close",b),e.socket.removeListener("error",T),i(new e1(A,r,n,h)),this.session=null}),A.once("close",b),A.once("error",T),e.socket.once("close",b),e.socket.once("error",T)})}tcpConnect(e,r){return(0,tLe.getProxiedConnection)(e,r).then(n=>n||new Promise((i,o)=>{let s=()=>{o(new Error("Socket closed"))},a=l=>{o(l)},c=nLe.connect(e,()=>{c.removeListener("close",s),c.removeListener("error",a),i(c)});c.once("close",s),c.once("error",a)}))}async connect(e,r,n){if(this.isShutdown)return Promise.reject();let i=null,o=null,s=(0,zx.subchannelAddressToString)(e);try{return this.trace(s+" Waiting for secureConnector to be ready"),await r.waitForReady(),this.trace(s+" secureConnector is ready"),i=await this.tcpConnect(e,n),i.setNoDelay(),this.trace(s+" Established TCP connection"),o=await r.connect(i),this.trace(s+" Established secure connection"),this.createSession(o,e,n)}catch(a){throw i?.destroy(),o?.socket.destroy(),a}}shutdown(){var e;this.isShutdown=!0,(e=this.session)===null||e===void 0||e.close(),this.session=null}};jx.Http2SubchannelConnector=t1});var Pte=y(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});rS.SubchannelPool=void 0;rS.getSubchannelPool=TLe;var gLe=eQ(),_Le=Ste(),yLe=Gn(),SLe=Cn(),ELe=Ite(),vLe=1e4,tS=class{constructor(){this.pool=Object.create(null),this.cleanupTimer=null}unrefUnusedSubchannels(){let e=!0;for(let r in this.pool){let i=this.pool[r].filter(o=>!o.subchannel.unrefIfOneRef());i.length>0&&(e=!1),this.pool[r]=i}e&&this.cleanupTimer!==null&&(clearInterval(this.cleanupTimer),this.cleanupTimer=null)}ensureCleanupTask(){var e,r;this.cleanupTimer===null&&(this.cleanupTimer=setInterval(()=>{this.unrefUnusedSubchannels()},vLe),(r=(e=this.cleanupTimer).unref)===null||r===void 0||r.call(e))}getOrCreateSubchannel(e,r,n,i){this.ensureCleanupTask();let o=(0,SLe.uriToString)(e);if(o in this.pool){let a=this.pool[o];for(let c of a)if((0,yLe.subchannelAddressEqual)(r,c.subchannelAddress)&&(0,gLe.channelOptionsEqual)(n,c.channelArguments)&&i._equals(c.channelCredentials))return c.subchannel}let s=new _Le.Subchannel(e,r,n,i,new ELe.Http2SubchannelConnector(e));return o in this.pool||(this.pool[o]=[]),this.pool[o].push({subchannelAddress:r,channelArguments:n,channelCredentials:i,subchannel:s}),s.ref(),s}};rS.SubchannelPool=tS;var bLe=new tS;function TLe(t){return t?bLe:new tS}});var kte=y(Vx=>{"use strict";Object.defineProperty(Vx,"__esModule",{value:!0});Vx.LoadBalancingCall=void 0;var Ote=In(),Bx=Xe(),Nte=kp(),qx=Rr(),nS=ga(),wLe=Cn(),ALe=Nt(),r1=Yy(),xLe=Z("http2"),RLe="load_balancing_call",n1=class{constructor(e,r,n,i,o,s,a){var c,l;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=o,this.deadline=s,this.callNumber=a,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.metadata=null,this.listener=null,this.onCallEnded=null,this.childStartTime=null;let u=this.methodName.split("/"),d="";u.length>=2&&(d=u[1]);let f=(l=(c=(0,wLe.splitHostPort)(this.host))===null||c===void 0?void 0:c.host)!==null&&l!==void 0?l:"localhost";this.serviceUrl=`https://${f}/${d}`,this.startTime=new Date}getDeadlineInfo(){var e,r;let n=[];return this.childStartTime?(this.childStartTime>this.startTime&&(!((e=this.metadata)===null||e===void 0)&&e.getOptions().waitForReady&&n.push("wait_for_ready"),n.push(`LB pick: ${(0,Nte.formatDateDifference)(this.startTime,this.childStartTime)}`)),n.push(...this.child.getDeadlineInfo()),n):(!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady&&n.push("wait_for_ready"),n.push("Waiting for LB pick"),n)}trace(e){ALe.trace(Bx.LogVerbosity.DEBUG,RLe,"["+this.callNumber+"] "+e)}outputStatus(e,r){var n,i;if(!this.ended){this.ended=!0,this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString());let o=Object.assign(Object.assign({},e),{progress:r});(n=this.listener)===null||n===void 0||n.onReceiveStatus(o),(i=this.onCallEnded)===null||i===void 0||i.call(this,o.code,o.details,o.metadata)}}doPick(){var e,r;if(this.ended)return;if(!this.metadata)throw new Error("doPick called before start");this.trace("Pick called");let n=this.metadata.clone(),i=this.channel.doPick(n,this.callConfig.pickInformation),o=i.subchannel?"("+i.subchannel.getChannelzRef().id+") "+i.subchannel.getAddress():""+i.subchannel;switch(this.trace("Pick result: "+nS.PickResultType[i.pickResultType]+" subchannel: "+o+" status: "+((e=i.status)===null||e===void 0?void 0:e.code)+" "+((r=i.status)===null||r===void 0?void 0:r.details)),i.pickResultType){case nS.PickResultType.COMPLETE:this.credentials.compose(i.subchannel.getCallCredentials()).generateMetadata({method_name:this.methodName,service_url:this.serviceUrl}).then(l=>{var u;if(this.ended){this.trace("Credentials metadata generation finished after call ended");return}if(n.merge(l),n.get("authorization").length>1&&this.outputStatus({code:Bx.Status.INTERNAL,details:'"authorization" metadata cannot have multiple values',metadata:new qx.Metadata},"PROCESSED"),i.subchannel.getConnectivityState()!==Ote.ConnectivityState.READY){this.trace("Picked subchannel "+o+" has state "+Ote.ConnectivityState[i.subchannel.getConnectivityState()]+" after getting credentials metadata. Retrying pick"),this.doPick();return}this.deadline!==1/0&&n.set("grpc-timeout",(0,Nte.getDeadlineTimeoutString)(this.deadline));try{this.child=i.subchannel.getRealSubchannel().createCall(n,this.host,this.methodName,{onReceiveMetadata:d=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(d)},onReceiveMessage:d=>{this.trace("Received message"),this.listener.onReceiveMessage(d)},onReceiveStatus:d=>{this.trace("Received status"),d.rstCode===xLe.constants.NGHTTP2_REFUSED_STREAM?this.outputStatus(d,"REFUSED"):this.outputStatus(d,"PROCESSED")}}),this.childStartTime=new Date}catch(d){this.trace("Failed to start call on picked subchannel "+o+" with error "+d.message),this.outputStatus({code:Bx.Status.INTERNAL,details:"Failed to start HTTP/2 stream with error "+d.message,metadata:new qx.Metadata},"NOT_STARTED");return}(u=i.onCallStarted)===null||u===void 0||u.call(i),this.onCallEnded=i.onCallEnded,this.trace("Created child call ["+this.child.getCallNumber()+"]"),this.readPending&&this.child.startRead(),this.pendingMessage&&this.child.sendMessageWithContext(this.pendingMessage.context,this.pendingMessage.message),this.pendingHalfClose&&this.child.halfClose()},l=>{let{code:u,details:d}=(0,r1.restrictControlPlaneStatusCode)(typeof l.code=="number"?l.code:Bx.Status.UNKNOWN,`Getting metadata from plugin failed with error: ${l.message}`);this.outputStatus({code:u,details:d,metadata:new qx.Metadata},"PROCESSED")});break;case nS.PickResultType.DROP:let{code:a,details:c}=(0,r1.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:a,details:c,metadata:i.status.metadata},"DROP")});break;case nS.PickResultType.TRANSIENT_FAILURE:if(this.metadata.getOptions().waitForReady)this.channel.queueCallForPick(this);else{let{code:l,details:u}=(0,r1.restrictControlPlaneStatusCode)(i.status.code,i.status.details);setImmediate(()=>{this.outputStatus({code:l,details:u,metadata:i.status.metadata},"PROCESSED")})}break;case nS.PickResultType.QUEUE:this.channel.queueCallForPick(this)}}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new qx.Metadata},"PROCESSED")}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.listener=r,this.metadata=e,this.doPick()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.child.sendMessageWithContext(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){throw new Error("Method not implemented.")}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};Vx.LoadBalancingCall=n1});var $te=y(Gx=>{"use strict";Object.defineProperty(Gx,"__esModule",{value:!0});Gx.ResolvingCall=void 0;var CLe=TA(),ed=Xe(),td=kp(),Mte=Rr(),ILe=Nt(),PLe=Yy(),OLe="resolving_call",i1=class{constructor(e,r,n,i,o){this.channel=e,this.method=r,this.filterStackFactory=i,this.callNumber=o,this.child=null,this.readPending=!1,this.pendingMessage=null,this.pendingHalfClose=!1,this.ended=!1,this.readFilterPending=!1,this.writeFilterPending=!1,this.pendingChildStatus=null,this.metadata=null,this.listener=null,this.statusWatchers=[],this.deadlineTimer=setTimeout(()=>{},0),this.filterStack=null,this.deadlineStartTime=null,this.configReceivedTime=null,this.childStartTime=null,this.credentials=CLe.CallCredentials.createEmpty(),this.deadline=n.deadline,this.host=n.host,n.parentCall&&(n.flags&ed.Propagate.CANCELLATION&&n.parentCall.on("cancelled",()=>{this.cancelWithStatus(ed.Status.CANCELLED,"Cancelled by parent call")}),n.flags&ed.Propagate.DEADLINE&&(this.trace("Propagating deadline from parent: "+n.parentCall.getDeadline()),this.deadline=(0,td.minDeadline)(this.deadline,n.parentCall.getDeadline()))),this.trace("Created"),this.runDeadlineTimer()}trace(e){ILe.trace(ed.LogVerbosity.DEBUG,OLe,"["+this.callNumber+"] "+e)}runDeadlineTimer(){clearTimeout(this.deadlineTimer),this.deadlineStartTime=new Date,this.trace("Deadline: "+(0,td.deadlineToString)(this.deadline));let e=(0,td.getRelativeTimeout)(this.deadline);if(e!==1/0){this.trace("Deadline will be reached in "+e+"ms");let r=()=>{if(!this.deadlineStartTime){this.cancelWithStatus(ed.Status.DEADLINE_EXCEEDED,"Deadline exceeded");return}let n=[],i=new Date;n.push(`Deadline exceeded after ${(0,td.formatDateDifference)(this.deadlineStartTime,i)}`),this.configReceivedTime?(this.configReceivedTime>this.deadlineStartTime&&n.push(`name resolution: ${(0,td.formatDateDifference)(this.deadlineStartTime,this.configReceivedTime)}`),this.childStartTime?this.childStartTime>this.configReceivedTime&&n.push(`metadata filters: ${(0,td.formatDateDifference)(this.configReceivedTime,this.childStartTime)}`):n.push("waiting for metadata filters")):n.push("waiting for name resolution"),this.child&&n.push(...this.child.getDeadlineInfo()),this.cancelWithStatus(ed.Status.DEADLINE_EXCEEDED,n.join(","))};e<=0?process.nextTick(r):this.deadlineTimer=setTimeout(r,e)}}outputStatus(e){if(!this.ended){this.ended=!0,this.filterStack||(this.filterStack=this.filterStackFactory.createFilter()),clearTimeout(this.deadlineTimer);let r=this.filterStack.receiveTrailers(e);this.trace("ended with status: code="+r.code+' details="'+r.details+'"'),this.statusWatchers.forEach(n=>n(r)),process.nextTick(()=>{var n;(n=this.listener)===null||n===void 0||n.onReceiveStatus(r)})}}sendMessageOnChild(e,r){if(!this.child)throw new Error("sendMessageonChild called with child not populated");let n=this.child;this.writeFilterPending=!0,this.filterStack.sendMessage(Promise.resolve({message:r,flags:e.flags})).then(i=>{this.writeFilterPending=!1,n.sendMessageWithContext(e,i.message),this.pendingHalfClose&&n.halfClose()},i=>{this.cancelWithStatus(i.code,i.details)})}getConfig(){if(this.ended)return;if(!this.metadata||!this.listener)throw new Error("getConfig called before start");let e=this.channel.getConfig(this.method,this.metadata);if(e.type==="NONE"){this.channel.queueCallForConfig(this);return}else if(e.type==="ERROR"){this.metadata.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e.error);return}this.configReceivedTime=new Date;let r=e.config;if(r.status!==ed.Status.OK){let{code:n,details:i}=(0,PLe.restrictControlPlaneStatusCode)(r.status,"Failed to route call to method "+this.method);this.outputStatus({code:n,details:i,metadata:new Mte.Metadata});return}if(r.methodConfig.timeout){let n=new Date;n.setSeconds(n.getSeconds()+r.methodConfig.timeout.seconds),n.setMilliseconds(n.getMilliseconds()+r.methodConfig.timeout.nanos/1e6),this.deadline=(0,td.minDeadline)(this.deadline,n),this.runDeadlineTimer()}this.filterStackFactory.push(r.dynamicFilterFactories),this.filterStack=this.filterStackFactory.createFilter(),this.filterStack.sendMetadata(Promise.resolve(this.metadata)).then(n=>{this.child=this.channel.createRetryingCall(r,this.method,this.host,this.credentials,this.deadline),this.trace("Created child ["+this.child.getCallNumber()+"]"),this.childStartTime=new Date,this.child.start(n,{onReceiveMetadata:i=>{this.trace("Received metadata"),this.listener.onReceiveMetadata(this.filterStack.receiveMetadata(i))},onReceiveMessage:i=>{this.trace("Received message"),this.readFilterPending=!0,this.filterStack.receiveMessage(i).then(o=>{this.trace("Finished filtering received message"),this.readFilterPending=!1,this.listener.onReceiveMessage(o),this.pendingChildStatus&&this.outputStatus(this.pendingChildStatus)},o=>{this.cancelWithStatus(o.code,o.details)})},onReceiveStatus:i=>{this.trace("Received status"),this.readFilterPending?this.pendingChildStatus=i:this.outputStatus(i)}}),this.readPending&&this.child.startRead(),this.pendingMessage?this.sendMessageOnChild(this.pendingMessage.context,this.pendingMessage.message):this.pendingHalfClose&&this.child.halfClose()},n=>{this.outputStatus(n)})}reportResolverError(e){var r;!((r=this.metadata)===null||r===void 0)&&r.getOptions().waitForReady?this.channel.queueCallForConfig(this):this.outputStatus(e)}cancelWithStatus(e,r){var n;this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),(n=this.child)===null||n===void 0||n.cancelWithStatus(e,r),this.outputStatus({code:e,details:r,metadata:new Mte.Metadata})}getPeer(){var e,r;return(r=(e=this.child)===null||e===void 0?void 0:e.getPeer())!==null&&r!==void 0?r:this.channel.getTarget()}start(e,r){this.trace("start called"),this.metadata=e.clone(),this.listener=r,this.getConfig()}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length),this.child?this.sendMessageOnChild(e,r):this.pendingMessage={context:e,message:r}}startRead(){this.trace("startRead called"),this.child?this.child.startRead():this.readPending=!0}halfClose(){this.trace("halfClose called"),this.child&&!this.writeFilterPending?this.child.halfClose():this.pendingHalfClose=!0}setCredentials(e){this.credentials=e}addStatusWatcher(e){this.statusWatchers.push(e)}getCallNumber(){return this.callNumber}getAuthContext(){return this.child?this.child.getAuthContext():null}};Gx.ResolvingCall=i1});var Dte=y(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.RetryingCall=Yc.MessageBufferTracker=Yc.RetryThrottler=void 0;var Hx=Xe(),NLe=kp(),kLe=Rr(),MLe=Nt(),$Le="retrying_call",s1=class{constructor(e,r,n){this.maxTokens=e,this.tokenRatio=r,n?this.tokens=n.tokens*(e/n.maxTokens):this.tokens=e}addCallSucceeded(){this.tokens=Math.min(this.tokens+this.tokenRatio,this.maxTokens)}addCallFailed(){this.tokens=Math.max(this.tokens-1,0)}canRetryCall(){return this.tokens>this.maxTokens/2}};Yc.RetryThrottler=s1;var a1=class{constructor(e,r){this.totalLimit=e,this.limitPerCall=r,this.totalAllocated=0,this.allocatedPerCall=new Map}allocate(e,r){var n;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;return this.limitPerCall-i<e||this.totalLimit-this.totalAllocated<e?!1:(this.allocatedPerCall.set(r,i+e),this.totalAllocated+=e,!0)}free(e,r){var n;if(this.totalAllocated<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > total allocated ${this.totalAllocated}`);this.totalAllocated-=e;let i=(n=this.allocatedPerCall.get(r))!==null&&n!==void 0?n:0;if(i<e)throw new Error(`Invalid buffer allocation state: call ${r} freed ${e} > allocated for call ${i}`);this.allocatedPerCall.set(r,i-e)}freeAll(e){var r;let n=(r=this.allocatedPerCall.get(e))!==null&&r!==void 0?r:0;if(this.totalAllocated<n)throw new Error(`Invalid buffer allocation state: call ${e} allocated ${n} > total allocated ${this.totalAllocated}`);this.totalAllocated-=n,this.allocatedPerCall.delete(e)}};Yc.MessageBufferTracker=a1;var o1="grpc-previous-rpc-attempts",DLe=5,c1=class{constructor(e,r,n,i,o,s,a,c,l){var u;this.channel=e,this.callConfig=r,this.methodName=n,this.host=i,this.credentials=o,this.deadline=s,this.callNumber=a,this.bufferTracker=c,this.retryThrottler=l,this.listener=null,this.initialMetadata=null,this.underlyingCalls=[],this.writeBuffer=[],this.writeBufferOffset=0,this.readStarted=!1,this.transparentRetryUsed=!1,this.attempts=0,this.hedgingTimer=null,this.committedCallIndex=null,this.initialRetryBackoffSec=0,this.nextRetryBackoffSec=0;let d=(u=e.getOptions()["grpc-node.retry_max_attempts_limit"])!==null&&u!==void 0?u:DLe;if(e.getOptions()["grpc.enable_retries"]===0)this.state="NO_RETRY",this.maxAttempts=1;else if(r.methodConfig.retryPolicy){this.state="RETRY";let f=r.methodConfig.retryPolicy;this.nextRetryBackoffSec=this.initialRetryBackoffSec=Number(f.initialBackoff.substring(0,f.initialBackoff.length-1)),this.maxAttempts=Math.min(f.maxAttempts,d)}else r.methodConfig.hedgingPolicy?(this.state="HEDGING",this.maxAttempts=Math.min(r.methodConfig.hedgingPolicy.maxAttempts,d)):(this.state="TRANSPARENT_ONLY",this.maxAttempts=1);this.startTime=new Date}getDeadlineInfo(){if(this.underlyingCalls.length===0)return[];let e=[],r=this.underlyingCalls[this.underlyingCalls.length-1];return this.underlyingCalls.length>1&&e.push(`previous attempts: ${this.underlyingCalls.length-1}`),r.startTime>this.startTime&&e.push(`time to current attempt start: ${(0,NLe.formatDateDifference)(this.startTime,r.startTime)}`),e.push(...r.call.getDeadlineInfo()),e}getCallNumber(){return this.callNumber}trace(e){MLe.trace(Hx.LogVerbosity.DEBUG,$Le,"["+this.callNumber+"] "+e)}reportStatus(e){this.trace("ended with status: code="+e.code+' details="'+e.details+'" start time='+this.startTime.toISOString()),this.bufferTracker.freeAll(this.callNumber),this.writeBufferOffset=this.writeBufferOffset+this.writeBuffer.length,this.writeBuffer=[],process.nextTick(()=>{var r;(r=this.listener)===null||r===void 0||r.onReceiveStatus({code:e.code,details:e.details,metadata:e.metadata})})}cancelWithStatus(e,r){this.trace("cancelWithStatus code: "+e+' details: "'+r+'"'),this.reportStatus({code:e,details:r,metadata:new kLe.Metadata});for(let{call:n}of this.underlyingCalls)n.cancelWithStatus(e,r)}getPeer(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getPeer():"unknown"}getBufferEntry(e){var r;return(r=this.writeBuffer[e-this.writeBufferOffset])!==null&&r!==void 0?r:{entryType:"FREED",allocated:!1}}getNextBufferIndex(){return this.writeBufferOffset+this.writeBuffer.length}clearSentMessages(){if(this.state!=="COMMITTED")return;let e;this.underlyingCalls[this.committedCallIndex].state==="COMPLETED"?e=this.getNextBufferIndex():e=this.underlyingCalls[this.committedCallIndex].nextMessageToSend;for(let r=this.writeBufferOffset;r<e;r++){let n=this.getBufferEntry(r);n.allocated&&this.bufferTracker.free(n.message.message.length,this.callNumber)}this.writeBuffer=this.writeBuffer.slice(e-this.writeBufferOffset),this.writeBufferOffset=e}commitCall(e){var r,n;if(this.state!=="COMMITTED"){this.trace("Committing call ["+this.underlyingCalls[e].call.getCallNumber()+"] at index "+e),this.state="COMMITTED",(n=(r=this.callConfig).onCommitted)===null||n===void 0||n.call(r),this.committedCallIndex=e;for(let i=0;i<this.underlyingCalls.length;i++)i!==e&&this.underlyingCalls[i].state!=="COMPLETED"&&(this.underlyingCalls[i].state="COMPLETED",this.underlyingCalls[i].call.cancelWithStatus(Hx.Status.CANCELLED,"Discarded in favor of other hedged attempt"));this.clearSentMessages()}}commitCallWithMostMessages(){if(this.state==="COMMITTED")return;let e=-1,r=-1;for(let[n,i]of this.underlyingCalls.entries())i.state==="ACTIVE"&&i.nextMessageToSend>e&&(e=i.nextMessageToSend,r=n);r===-1?this.state="TRANSPARENT_ONLY":this.commitCall(r)}isStatusCodeInList(e,r){return e.some(n=>{var i;return n===r||n.toString().toLowerCase()===((i=Hx.Status[r])===null||i===void 0?void 0:i.toLowerCase())})}getNextRetryJitter(){return Math.random()*(1.2-.8)+.8}getNextRetryBackoffMs(){var e;let r=(e=this.callConfig)===null||e===void 0?void 0:e.methodConfig.retryPolicy;if(!r)return 0;let i=this.getNextRetryJitter()*this.nextRetryBackoffSec*1e3,o=Number(r.maxBackoff.substring(0,r.maxBackoff.length-1));return this.nextRetryBackoffSec=Math.min(this.nextRetryBackoffSec*r.backoffMultiplier,o),i}maybeRetryCall(e,r){if(this.state!=="RETRY"){r(!1);return}if(this.attempts>=this.maxAttempts){r(!1);return}let n;if(e===null)n=this.getNextRetryBackoffMs();else if(e<0){this.state="TRANSPARENT_ONLY",r(!1);return}else n=e,this.nextRetryBackoffSec=this.initialRetryBackoffSec;setTimeout(()=>{var i,o;if(this.state!=="RETRY"){r(!1);return}!((o=(i=this.retryThrottler)===null||i===void 0?void 0:i.canRetryCall())!==null&&o!==void 0)||o?(r(!0),this.attempts+=1,this.startNewAttempt()):(this.trace("Retry attempt denied by throttling policy"),r(!1))},n)}countActiveCalls(){let e=0;for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(e+=1);return e}handleProcessedStatus(e,r,n){var i,o,s;switch(this.state){case"COMMITTED":case"NO_RETRY":case"TRANSPARENT_ONLY":this.commitCall(r),this.reportStatus(e);break;case"HEDGING":if(this.isStatusCodeInList((i=this.callConfig.methodConfig.hedgingPolicy.nonFatalStatusCodes)!==null&&i!==void 0?i:[],e.code)){(o=this.retryThrottler)===null||o===void 0||o.addCallFailed();let a;if(n===null)a=0;else if(n<0){this.state="TRANSPARENT_ONLY",this.commitCall(r),this.reportStatus(e);return}else a=n;setTimeout(()=>{this.maybeStartHedgingAttempt(),this.countActiveCalls()===0&&(this.commitCall(r),this.reportStatus(e))},a)}else this.commitCall(r),this.reportStatus(e);break;case"RETRY":this.isStatusCodeInList(this.callConfig.methodConfig.retryPolicy.retryableStatusCodes,e.code)?((s=this.retryThrottler)===null||s===void 0||s.addCallFailed(),this.maybeRetryCall(n,a=>{a||(this.commitCall(r),this.reportStatus(e))})):(this.commitCall(r),this.reportStatus(e));break}}getPushback(e){let r=e.get("grpc-retry-pushback-ms");if(r.length===0)return null;try{return parseInt(r[0])}catch{return-1}}handleChildStatus(e,r){var n;if(this.underlyingCalls[r].state==="COMPLETED")return;if(this.trace("state="+this.state+" handling status with progress "+e.progress+" from child ["+this.underlyingCalls[r].call.getCallNumber()+"] in state "+this.underlyingCalls[r].state),this.underlyingCalls[r].state="COMPLETED",e.code===Hx.Status.OK){(n=this.retryThrottler)===null||n===void 0||n.addCallSucceeded(),this.commitCall(r),this.reportStatus(e);return}if(this.state==="NO_RETRY"){this.commitCall(r),this.reportStatus(e);return}if(this.state==="COMMITTED"){this.reportStatus(e);return}let i=this.getPushback(e.metadata);switch(e.progress){case"NOT_STARTED":this.startNewAttempt();break;case"REFUSED":this.transparentRetryUsed?this.handleProcessedStatus(e,r,i):(this.transparentRetryUsed=!0,this.startNewAttempt());break;case"DROP":this.commitCall(r),this.reportStatus(e);break;case"PROCESSED":this.handleProcessedStatus(e,r,i);break}}maybeStartHedgingAttempt(){this.state==="HEDGING"&&this.callConfig.methodConfig.hedgingPolicy&&(this.attempts>=this.maxAttempts||(this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()))}maybeStartHedgingTimer(){var e,r,n;if(this.hedgingTimer&&clearTimeout(this.hedgingTimer),this.state!=="HEDGING"||!this.callConfig.methodConfig.hedgingPolicy)return;let i=this.callConfig.methodConfig.hedgingPolicy;if(this.attempts>=this.maxAttempts)return;let o=(e=i.hedgingDelay)!==null&&e!==void 0?e:"0s",s=Number(o.substring(0,o.length-1));this.hedgingTimer=setTimeout(()=>{this.maybeStartHedgingAttempt()},s*1e3),(n=(r=this.hedgingTimer).unref)===null||n===void 0||n.call(r)}startNewAttempt(){let e=this.channel.createLoadBalancingCall(this.callConfig,this.methodName,this.host,this.credentials,this.deadline);this.trace("Created child call ["+e.getCallNumber()+"] for attempt "+this.attempts);let r=this.underlyingCalls.length;this.underlyingCalls.push({state:"ACTIVE",call:e,nextMessageToSend:0,startTime:new Date});let n=this.attempts-1,i=this.initialMetadata.clone();n>0&&i.set(o1,`${n}`);let o=!1;e.start(i,{onReceiveMetadata:s=>{this.trace("Received metadata from child ["+e.getCallNumber()+"]"),this.commitCall(r),o=!0,n>0&&s.set(o1,`${n}`),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMetadata(s)},onReceiveMessage:s=>{this.trace("Received message from child ["+e.getCallNumber()+"]"),this.commitCall(r),this.underlyingCalls[r].state==="ACTIVE"&&this.listener.onReceiveMessage(s)},onReceiveStatus:s=>{this.trace("Received status from child ["+e.getCallNumber()+"]"),!o&&n>0&&s.metadata.set(o1,`${n}`),this.handleChildStatus(s,r)}}),this.sendNextChildMessage(r),this.readStarted&&e.startRead()}start(e,r){this.trace("start called"),this.listener=r,this.initialMetadata=e,this.attempts+=1,this.startNewAttempt(),this.maybeStartHedgingTimer()}handleChildWriteCompleted(e,r){var n,i;(i=(n=this.getBufferEntry(r)).callback)===null||i===void 0||i.call(n),this.clearSentMessages();let o=this.underlyingCalls[e];o.nextMessageToSend+=1,this.sendNextChildMessage(e)}sendNextChildMessage(e){let r=this.underlyingCalls[e];if(r.state==="COMPLETED")return;let n=r.nextMessageToSend;if(this.getBufferEntry(n)){let i=this.getBufferEntry(n);switch(i.entryType){case"MESSAGE":r.call.sendMessageWithContext({callback:s=>{this.handleChildWriteCompleted(e,n)}},i.message.message),this.getBufferEntry(n+1).entryType==="HALF_CLOSE"&&(this.trace("Sending halfClose immediately after message to child ["+r.call.getCallNumber()+"] - optimizing for unary/final message"),r.nextMessageToSend+=1,r.call.halfClose());break;case"HALF_CLOSE":r.nextMessageToSend+=1,r.call.halfClose();break;case"FREED":break}}}sendMessageWithContext(e,r){this.trace("write() called with message of length "+r.length);let n={message:r,flags:e.flags},i=this.getNextBufferIndex(),o={entryType:"MESSAGE",message:n,allocated:this.bufferTracker.allocate(r.length,this.callNumber)};if(this.writeBuffer.push(o),o.allocated){process.nextTick(()=>{var s;(s=e.callback)===null||s===void 0||s.call(e)});for(let[s,a]of this.underlyingCalls.entries())a.state==="ACTIVE"&&a.nextMessageToSend===i&&a.call.sendMessageWithContext({callback:c=>{this.handleChildWriteCompleted(s,i)}},r)}else{if(this.commitCallWithMostMessages(),this.committedCallIndex===null)return;let s=this.underlyingCalls[this.committedCallIndex];o.callback=e.callback,s.state==="ACTIVE"&&s.nextMessageToSend===i&&s.call.sendMessageWithContext({callback:a=>{this.handleChildWriteCompleted(this.committedCallIndex,i)}},r)}}startRead(){this.trace("startRead called"),this.readStarted=!0;for(let e of this.underlyingCalls)e?.state==="ACTIVE"&&e.call.startRead()}halfClose(){this.trace("halfClose called");let e=this.getNextBufferIndex();this.writeBuffer.push({entryType:"HALF_CLOSE",allocated:!1});for(let r of this.underlyingCalls)r?.state==="ACTIVE"&&(r.nextMessageToSend===e||r.nextMessageToSend===e-1)&&(this.trace("Sending halfClose immediately to child ["+r.call.getCallNumber()+"] - all messages already sent"),r.nextMessageToSend+=1,r.call.halfClose())}setCredentials(e){throw new Error("Method not implemented.")}getMethod(){return this.methodName}getHost(){return this.host}getAuthContext(){return this.committedCallIndex!==null?this.underlyingCalls[this.committedCallIndex].call.getAuthContext():null}};Yc.RetryingCall=c1});var iS=y(Wx=>{"use strict";Object.defineProperty(Wx,"__esModule",{value:!0});Wx.BaseSubchannelWrapper=void 0;var l1=class{constructor(e){this.child=e,this.healthy=!0,this.healthListeners=new Set,this.refcount=0,this.dataWatchers=new Set,e.addHealthStateWatcher(r=>{this.healthy&&this.updateHealthListeners()})}updateHealthListeners(){for(let e of this.healthListeners)e(this.isHealthy())}getConnectivityState(){return this.child.getConnectivityState()}addConnectivityStateListener(e){this.child.addConnectivityStateListener(e)}removeConnectivityStateListener(e){this.child.removeConnectivityStateListener(e)}startConnecting(){this.child.startConnecting()}getAddress(){return this.child.getAddress()}throttleKeepalive(e){this.child.throttleKeepalive(e)}ref(){this.child.ref(),this.refcount+=1}unref(){this.child.unref(),this.refcount-=1,this.refcount===0&&this.destroy()}destroy(){for(let e of this.dataWatchers)e.destroy()}getChannelzRef(){return this.child.getChannelzRef()}isHealthy(){return this.healthy&&this.child.isHealthy()}addHealthStateWatcher(e){this.healthListeners.add(e)}removeHealthStateWatcher(e){this.healthListeners.delete(e)}addDataWatcher(e){e.setSubchannel(this.getRealSubchannel()),this.dataWatchers.add(e)}setHealthy(e){e!==this.healthy&&(this.healthy=e,this.child.isHealthy()&&this.updateHealthListeners())}getRealSubchannel(){return this.child.getRealSubchannel()}realSubchannelEquals(e){return this.getRealSubchannel()===e.getRealSubchannel()}getCallCredentials(){return this.child.getCallCredentials()}getChannel(){return this.child.getChannel()}};Wx.BaseSubchannelWrapper=l1});var _1=y(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.InternalChannel=rd.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=void 0;var LLe=fp(),ULe=QX(),FLe=Pte(),f1=ga(),zLe=Rr(),Kc=Xe(),jLe=Ox(),BLe=ML(),Lte=mo(),Yx=Nt(),qLe=WL(),Kx=Cn(),Gi=In(),oS=Gc(),VLe=kte(),GLe=kp(),HLe=$te(),u1=Ax(),WLe=Yy(),d1=Dte(),YLe=iS(),KLe=2147483647,ZLe=1e3,JLe=1800*1e3,Zx=new Map,XLe=1<<24,QLe=1<<20,p1=class extends YLe.BaseSubchannelWrapper{constructor(e,r){super(e),this.channel=r,this.refCount=0,this.subchannelStateListener=(n,i,o,s)=>{r.throttleKeepalive(s)}}ref(){this.refCount===0&&(this.child.addConnectivityStateListener(this.subchannelStateListener),this.channel.addWrappedSubchannel(this)),this.child.ref(),this.refCount+=1}unref(){this.child.unref(),this.refCount-=1,this.refCount<=0&&(this.child.removeConnectivityStateListener(this.subchannelStateListener),this.channel.removeWrappedSubchannel(this))}},h1=class{pick(e){return{pickResultType:f1.PickResultType.DROP,status:{code:Kc.Status.UNAVAILABLE,details:"Channel closed before call started",metadata:new zLe.Metadata},subchannel:null,onCallStarted:null,onCallEnded:null}}};rd.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX="grpc.internal.no_subchannel";var m1=class{constructor(e){this.target=e,this.trace=new oS.ChannelzTrace,this.callTracker=new oS.ChannelzCallTracker,this.childrenTracker=new oS.ChannelzChildrenTracker,this.state=Gi.ConnectivityState.IDLE}getChannelzInfoCallback(){return()=>({target:this.target,state:this.state,trace:this.trace,callTracker:this.callTracker,children:this.childrenTracker.getChildLists()})}},g1=class{constructor(e,r,n){var i,o,s,a,c,l;if(this.credentials=r,this.options=n,this.connectivityState=Gi.ConnectivityState.IDLE,this.currentPicker=new f1.UnavailablePicker,this.configSelectionQueue=[],this.pickQueue=[],this.connectivityStateWatchers=[],this.callRefTimer=null,this.configSelector=null,this.currentResolutionError=null,this.wrappedSubchannels=new Set,this.callCount=0,this.idleTimer=null,this.channelzEnabled=!0,this.randomChannelId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof LLe.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.channelzInfoTracker=new m1(e);let u=(0,Kx.parseUri)(e);if(u===null)throw new Error(`Could not parse target name "${e}"`);let d=(0,Lte.mapUriDefaultScheme)(u);if(d===null)throw new Error(`Could not find a default scheme for target name "${e}"`);this.options["grpc.enable_channelz"]===0&&(this.channelzEnabled=!1),this.channelzRef=(0,oS.registerChannelzChannel)(e,this.channelzInfoTracker.getChannelzInfoCallback(),this.channelzEnabled),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Channel created"),this.options["grpc.default_authority"]?this.defaultAuthority=this.options["grpc.default_authority"]:this.defaultAuthority=(0,Lte.getDefaultAuthority)(d);let f=(0,qLe.mapProxyName)(d,n);this.target=f.target,this.options=Object.assign({},this.options,f.extraOptions),this.subchannelPool=(0,FLe.getSubchannelPool)(((i=this.options["grpc.use_local_subchannel_pool"])!==null&&i!==void 0?i:0)===0),this.retryBufferTracker=new d1.MessageBufferTracker((o=this.options["grpc.retry_buffer_size"])!==null&&o!==void 0?o:XLe,(s=this.options["grpc.per_rpc_retry_buffer_size"])!==null&&s!==void 0?s:QLe),this.keepaliveTime=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:-1,this.idleTimeoutMs=Math.max((c=this.options["grpc.client_idle_timeout_ms"])!==null&&c!==void 0?c:JLe,ZLe);let p={createSubchannel:(m,g)=>{let _={};for(let[E,A]of Object.entries(g))E.startsWith(rd.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX)||(_[E]=A);let b=this.subchannelPool.getOrCreateSubchannel(this.target,m,_,this.credentials);return b.throttleKeepalive(this.keepaliveTime),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Created subchannel or used existing subchannel",b.getChannelzRef()),new p1(b,this)},updateState:(m,g)=>{this.currentPicker=g;let _=this.pickQueue.slice();this.pickQueue=[],_.length>0&&this.callRefTimerUnref();for(let b of _)b.doPick();this.updateState(m)},requestReresolution:()=>{throw new Error("Resolving load balancer should never call requestReresolution")},addChannelzChild:m=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.refChild(m)},removeChannelzChild:m=>{this.channelzEnabled&&this.channelzInfoTracker.childrenTracker.unrefChild(m)}};this.resolvingLoadBalancer=new ULe.ResolvingLoadBalancer(this.target,p,this.options,(m,g)=>{var _;m.retryThrottling?Zx.set(this.getTarget(),new d1.RetryThrottler(m.retryThrottling.maxTokens,m.retryThrottling.tokenRatio,Zx.get(this.getTarget()))):Zx.delete(this.getTarget()),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Address resolution succeeded"),(_=this.configSelector)===null||_===void 0||_.unref(),this.configSelector=g,this.currentResolutionError=null,process.nextTick(()=>{let b=this.configSelectionQueue;this.configSelectionQueue=[],b.length>0&&this.callRefTimerUnref();for(let T of b)T.getConfig()})},m=>{this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_WARNING","Address resolution failed with code "+m.code+' and details "'+m.details+'"'),this.configSelectionQueue.length>0&&this.trace("Name resolution failed with calls queued for config selection"),this.configSelector===null&&(this.currentResolutionError=Object.assign(Object.assign({},(0,WLe.restrictControlPlaneStatusCode)(m.code,m.details)),{metadata:m.metadata}));let g=this.configSelectionQueue;this.configSelectionQueue=[],g.length>0&&this.callRefTimerUnref();for(let _ of g)_.reportResolverError(m)}),this.filterStackFactory=new jLe.FilterStackFactory([new BLe.CompressionFilterFactory(this,this.options)]),this.trace("Channel constructed with options "+JSON.stringify(n,void 0,2));let h=new Error;(0,Yx.isTracerEnabled)("channel_stacktrace")&&(0,Yx.trace)(Kc.LogVerbosity.DEBUG,"channel_stacktrace","("+this.channelzRef.id+`) Channel constructed
|
|
22
22
|
`+((l=h.stack)===null||l===void 0?void 0:l.substring(h.stack.indexOf(`
|
|
23
|
-
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,Yx.trace)(r??Kc.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,Kx.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},KLe)),!((r=(e=this.callRefTimer).hasRef)===null||r===void 0)&&r.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,r,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||n===void 0||n.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(n=>n===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,Yx.trace)(Kc.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,Kx.uriToString)(this.target)+" "+Gi.ConnectivityState[this.connectivityState]+" -> "+Gi.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Gi.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let n of r)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Gi.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let r of this.wrappedSubchannels)r.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,r){return this.currentPicker.pick({metadata:e,extraPickInfo:r})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,r){return this.connectivityState!==Gi.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,r,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(Gi.ConnectivityState.IDLE),this.currentPicker=new f1.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let o=new Date().valueOf()-this.lastActivityTimestamp.valueOf();o>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-o)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Gi.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Kc.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+s+'] method="'+r+'"'),new VLe.LoadBalancingCall(this,e,r,n,i,o,s)}createRetryingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();return this.trace("createRetryingCall ["+s+'] method="'+r+'"'),new d1.RetryingCall(this,e,r,n,i,o,s,this.retryBufferTracker,Zx.get(this.getTarget()))}createResolvingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();this.trace("createResolvingCall ["+s+'] method="'+e+'", deadline='+(0,GLe.deadlineToString)(r));let a={deadline:r,flags:o??Kc.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new HLe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),s);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Gi.ConnectivityState.SHUTDOWN),this.currentPicker=new h1;for(let r of this.configSelectionQueue)r.cancelWithStatus(Kc.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(Kc.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,oS.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,Kx.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,n){if(this.connectivityState===Gi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let s=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||s<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(o),n(new Error("Deadline passed without connectivity state change"))},s.getTime()-a.getTime())}let o={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(o)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,o){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Gi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,o)}getOptions(){return this.options}};rd.InternalChannel=g1});var uD=y(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:!0});Jx.ChannelImplementation=void 0;var e1e=fp(),t1e=_1(),y1=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof e1e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new t1e.InternalChannel(e,r,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,n){this.internalChannel.watchConnectivityState(e,r,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,n,i,o){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,r,n,i,o)}};Jx.ChannelImplementation=y1});var Fte=y(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ServerDuplexStreamImpl=Co.ServerWritableStreamImpl=Co.ServerReadableStreamImpl=Co.ServerUnaryCallImpl=void 0;Co.serverErrorToStatus=A1;var r1e=Z("events"),T1=Z("stream"),w1=Xe(),Ute=Rr();function A1(t,e){var r;let n={code:w1.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:(r=e??t.metadata)!==null&&r!==void 0?r:null};return"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),n}var S1=class extends r1e.EventEmitter{constructor(e,r,n,i){super(),this.path=e,this.call=r,this.metadata=n,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};Co.ServerUnaryCallImpl=S1;var E1=class extends T1.Readable{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};Co.ServerReadableStreamImpl=E1;var v1=class extends T1.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:w1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ute.Metadata,this.on("error",o=>{this.pendingStatus=A1(o),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Co.ServerWritableStreamImpl=v1;var b1=class extends T1.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:w1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ute.Metadata,this.on("error",i=>{this.pendingStatus=A1(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Co.ServerDuplexStreamImpl=b1});var Xx=y(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ServerCredentials=void 0;Fp.createCertificateProviderServerCredentials=n1e;Fp.createServerCredentialsWithInterceptors=i1e;var x1=N$(),nd=class{constructor(e,r){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=r??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let r of this.watchers)r(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new R1}static createSsl(e,r,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let o=[],s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);o.push(c.cert_chain),s.push(c.private_key)}return new C1({requestCert:n,ciphers:x1.CIPHER_SUITES},{ca:(i=e??(0,x1.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:o,key:s})}};Fp.ServerCredentials=nd;var R1=class t extends nd{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},C1=class t extends nd{constructor(e,r){super(e,r),this.options=Object.assign(Object.assign({},e),r)}_equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let r=0;r<this.options.cert.length;r++){let n=this.options.cert[r],i=e.options.cert[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let r=0;r<this.options.key.length;r++){let n=this.options.key[r],i=e.options.key[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},I1=class t extends nd{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:x1.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var r;this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var r;super._removeWatcher(e),this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function n1e(t,e,r){return new I1(t,e,r)}var P1=class t extends nd{constructor(e,r){super({}),this.childCredentials=e,this.interceptors=r}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof t)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r]!==e.interceptors[r])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function i1e(t,e){return new P1(t,e)}});var sS=y(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.durationMessageToDuration=o1e;Ca.msToDuration=s1e;Ca.durationToMs=a1e;Ca.isDuration=c1e;Ca.isDurationMessage=l1e;Ca.parseDuration=d1e;Ca.durationToString=f1e;function o1e(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function s1e(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function a1e(t){return t.seconds*1e3+t.nanos/1e6|0}function c1e(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function l1e(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var u1e=/^(\d+)(?:\.(\d+))?s$/;function d1e(t){let e=t.match(u1e);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function f1e(t){if(t.nanos===0)return`${t.seconds}s`;let e;return t.nanos%1e6===0?e=1e6:t.nanos%1e3===0?e=1e3:e=1,`${t.seconds}.${t.nanos/e}s`}});var eR=y(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.OrcaOobMetricsSubchannelWrapper=_i.GRPC_METRICS_HEADER=_i.ServerMetricRecorder=_i.PerRequestMetricRecorder=void 0;_i.createOrcaClient=qte;_i.createMetricsReader=S1e;var p1e=qA(),O1=sS(),h1e=fp(),m1e=iS(),zte=Xe(),g1e=pp(),_1e=In(),jte=null;function Qx(){if(jte)return jte;let t=yL().loadSync,e=t("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,p1e.loadPackageDefinition)(e)}var N1=class{constructor(){this.message={}}recordRequestCostMetric(e,r){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=r}recordUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}recordNamedMetric(e,r){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=r}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return Qx().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};_i.PerRequestMetricRecorder=N1;var y1e=3e4,k1=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,O1.durationToMs)((0,O1.durationMessageToDuration)(e.request.report_interval)):y1e,n=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var r;(r=this.message.utilization)===null||r===void 0||delete r[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let r=Qx().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};_i.ServerMetricRecorder=k1;function qte(t){let e=Qx().xds.service.orca.v3.OpenRcaService;return new e("unused",h1e.ChannelCredentials.createInsecure(),{channelOverride:t})}_i.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var Bte="grpc_orca_load_report";function S1e(t,e){return(r,n,i)=>{let o=i.getOpaque(Bte);if(o)t(o);else{let s=i.get(_i.GRPC_METRICS_HEADER);s.length>0&&(o=Qx().xds.data.orca.v3.OrcaLoadReport.deserialize(s[0]),t(o),i.setOpaque(Bte,o))}e&&e(r,n,i)}}var Vte="orca_oob_metrics",M1=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(Vte,E1e);this.dataProducer=r,r.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)===null||e===void 0||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},$1=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new g1e.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=qte(r),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var r;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(Vte),(r=this.metricsCall)===null||r===void 0||r.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==_1e.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(n=>n.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let n=this.client.streamCoreMetrics({report_interval:(0,O1.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(o=>{o.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===zte.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==zte.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},D1=class extends m1e.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new M1(r,n))}getWrappedSubchannel(){return this.child}};_i.OrcaOobMetricsSubchannelWrapper=D1;function E1e(t){return new $1(t)}});var q1=y(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.BaseServerInterceptingCall=Hi.ServerInterceptingCall=Hi.ResponderBuilder=Hi.ServerListenerBuilder=void 0;Hi.isInterceptingServerListener=T1e;Hi.getServerInterceptingCall=C1e;var nR=Rr(),On=Xe(),zp=Z("http2"),Gte=SA(),Hte=Z("zlib"),v1e=KL(),Jte=Nt(),b1e=Z("tls"),Wte=eR(),Xte="server_call";function id(t){Jte.trace(On.LogVerbosity.DEBUG,Xte,t)}var U1=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};Hi.ServerListenerBuilder=U1;function T1e(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var F1=class{constructor(e,r){this.listener=e,this.nextListener=r,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},z1=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};Hi.ResponderBuilder=z1;var tR={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},rR={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},j1=class{constructor(e,r){var n,i,o,s;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=r?.start)!==null&&n!==void 0?n:rR.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:rR.sendMetadata,sendMessage:(o=r?.sendMessage)!==null&&o!==void 0?o:rR.sendMessage,sendStatus:(s=r?.sendStatus)!==null&&s!==void 0?s:rR.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(r=>{var n,i,o,s;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:tR.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:tR.onReceiveMessage,onReceiveHalfClose:(o=r?.onReceiveHalfClose)!==null&&o!==void 0?o:tR.onReceiveHalfClose,onCancel:(s=r?.onCancel)!==null&&s!==void 0?s:tR.onCancel},c=new F1(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,r=>{this.processingMetadata=!1,this.nextCall.sendMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new nR.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=r):this.nextCall.sendMessage(n,r)})}sendStatus(e){this.responder.sendStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextCall.sendStatus(r)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};Hi.ServerInterceptingCall=j1;var Qte="grpc-accept-encoding",B1="grpc-encoding",Yte="grpc-message",Kte="grpc-status",L1="grpc-timeout",w1e=/(\d{1,8})\s*([HMSmun])/,A1e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},x1e={[Qte]:"identity,deflate,gzip",[B1]:"identity"},Zte={[zp.constants.HTTP2_HEADER_STATUS]:zp.constants.HTTP_STATUS_OK,[zp.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},R1e={waitForTrailers:!0},iR=class{constructor(e,r,n,i,o){var s,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=On.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=On.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new Wte.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;id("Request to method "+((f=this.handler)===null||f===void 0?void 0:f.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:On.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",f=>{this.handleDataFrame(f)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in o&&(this.maxSendMessageSize=o["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in o&&(this.maxReceiveMessageSize=o["grpc.max_receive_message_length"]),this.host=(s=r[":authority"])!==null&&s!==void 0?s:r.host,this.decoder=new v1e.StreamDecoder(this.maxReceiveMessageSize);let c=nR.Metadata.fromHttp2Headers(r);Jte.isTracerEnabled(Xte)&&id("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(L1);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(B1);u.length>0&&(this.incomingEncoding=u[0]),c.remove(L1),c.remove(B1),c.remove(Qte),c.remove(zp.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(zp.constants.HTTP2_HEADER_TE),c.remove(zp.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(a=e.session)===null||a===void 0?void 0:a.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!o["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(w1e);if(r===null){let o={code:On.Status.INTERNAL,details:`Invalid ${L1} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(o)});return}let n=+r[1]*A1e[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let o={code:On.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(o)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new nR.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),n=r.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),r.copy(i,5),i}decompressMessage(e,r){let n=e.subarray(5);if(r==="identity")return n;if(r==="deflate"||r==="gzip"){let i;return r==="deflate"?i=Hte.createInflate():i=Hte.createGunzip(),new Promise((o,s)=>{let a=0,c=[];i.on("error",l=>{s({code:On.Status.INTERNAL,details:"Failed to decompress message"})}),i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),s({code:On.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{o(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:On.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(o){this.sendStatus(o);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(o){this.sendStatus({code:On.Status.INTERNAL,details:`Error deserializing request: ${o.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;id("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:On.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let o={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(o),this.decompressAndMaybePush(o),(r=this.callEventTracker)===null||r===void 0||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){id("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let r=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},Zte),x1e),r);this.stream.respond(n,R1e)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:On.Status.INTERNAL,details:`Error serializing response: ${(0,Gte.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:On.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),id("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var o;if(i){this.sendStatus({code:On.Status.INTERNAL,details:`Error writing message: ${(0,Gte.getErrorMessage)(i)}`,metadata:null});return}(o=this.callEventTracker)===null||o===void 0||o.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;id("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+On.Status[e.code]+" details: "+e.details);let o=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new nR.Metadata;if(this.shouldSendMetrics&&o.set(Wte.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign({[Kte]:e.code,[Yte]:encodeURI(e.details)},o.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Kte]:e.code,[Yte]:encodeURI(e.details)},Zte),o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){id("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let r=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return r?.remoteAddress?r.remotePort?`${r.remoteAddress}:${r.remotePort}`:r.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if(((e=this.stream.session)===null||e===void 0?void 0:e.socket)instanceof b1e.TLSSocket){let r=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:r.raw?r:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};Hi.BaseServerInterceptingCall=iR;function C1e(t,e,r,n,i,o){let s={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new iR(e,r,n,i,o);return t.reduce((c,l)=>l(s,c),a)}});var sre=y(Jc=>{"use strict";var I1e=Jc&&Jc.__runInitializers||function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0},P1e=Jc&&Jc.__esDecorate||function(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var h={};for(var m in n)h[m]=m==="access"?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(_){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var g=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=s(g.get))&&(u.get=d),(d=s(g.set))&&(u.set=d),(d=s(g.init))&&i.unshift(d)}else(d=s(g))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.Server=void 0;var Wn=Z("http2"),O1e=Z("util"),rr=Xe(),qp=Fte(),V1=Xx(),ere=mo(),Bp=Nt(),Zc=Gn(),Io=Cn(),_r=Gc(),tre=q1(),jp=~(1<<31),G1=~(1<<31),N1e=2e4,rre=~(1<<31),{HTTP2_HEADER_PATH:nre}=Wn.constants,k1e="server",ire=Buffer.from("max_age");function ore(t){Bp.trace(rr.LogVerbosity.DEBUG,"server_call",t)}function M1e(){}function $1e(t){return function(e,r){return O1e.deprecate(e,t)}}function H1(t){return{code:rr.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function D1e(t,e){let r=H1(e);switch(t){case"unary":return(n,i)=>{i(r,null)};case"clientStream":return(n,i)=>{i(r,null)};case"serverStream":return n=>{n.emit("error",r)};case"bidi":return n=>{n.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var L1e=(()=>{var t;let e=[],r;return t=class{constructor(i){var o,s,a,c,l,u;this.boundPorts=(I1e(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new _r.ChannelzTraceStub,this.callTracker=new _r.ChannelzCallTrackerStub,this.listenerChildrenTracker=new _r.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new _r.ChannelzChildrenTrackerStub):(this.channelzTrace=new _r.ChannelzTrace,this.callTracker=new _r.ChannelzCallTracker,this.listenerChildrenTracker=new _r.ChannelzChildrenTracker,this.sessionChildrenTracker=new _r.ChannelzChildrenTracker),this.channelzRef=(0,_r.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(o=this.options["grpc.max_connection_age_ms"])!==null&&o!==void 0?o:jp,this.maxConnectionAgeGraceMs=(s=this.options["grpc.max_connection_age_grace_ms"])!==null&&s!==void 0?s:jp,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:G1,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:N1e,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:rre,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var o,s,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Zc.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Zc.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),g=h.getCertificate(),_=h.getPeerCertificate();f={cipherSuiteStandardName:(o=m.standardName)!==null&&o!==void 0?o:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:g&&"raw"in g?g.raw:null,remoteCertificate:_&&"raw"in _?_.raw:null}}else f=null;return{remoteAddress:u,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(s=i.state.localWindowSize)!==null&&s!==void 0?s:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){Bp.trace(rr.LogVerbosity.DEBUG,k1e,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){Bp.trace(rr.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,o){if(i===null||typeof i!="object"||o===null||typeof o!="object")throw new Error("addService() requires two objects as arguments");let s=Object.keys(i);if(s.length===0)throw new Error("Cannot add an empty service to a server");s.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=o[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=o[c.originalName]),u!==void 0?d=u.bind(o):d=D1e(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(s=>{let a=i[s];this.unregister(a.path)})}bind(i,o){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,_r.registerChannelzSocket)((0,Zc.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(i){(0,_r.unregisterChannelzRef)(i)}createHttp2Server(i){let o;if(i._isSecure()){let s=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),s),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),o=Wn.createSecureServer(c),o.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),o.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let u=d=>{if(d){let f=o;try{f.setSecureContext(d)}catch(p){Bp.log(rr.LogVerbosity.ERROR,"Failed to set secure context with error "+p.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(u),o.on("close",()=>{i._removeWatcher(u)})}else o=Wn.createServer(this.commonServerOptions);return o.setTimeout(0,M1e),this._setupHandlers(o,i._getInterceptors()),o}bindOneAddress(i,o){this.trace("Attempting to bind "+(0,Zc.subchannelAddressToString)(i));let s=this.createHttp2Server(o.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Zc.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};s.once("error",l),s.listen(i,()=>{let u=s.address(),d;typeof u=="string"?d={path:u}:d={host:u.address,port:u.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(s,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),o.listeningServers.add(s),this.trace("Successfully bound "+(0,Zc.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),s.removeListener("error",l)})})}async bindManyPorts(i,o){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Zc.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let s=await this.bindOneAddress(i[0],o);if(s.error){let a=await this.bindManyPorts(i.slice(1),o);return Object.assign(Object.assign({},a),{errors:[s.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Zc.isTcpSubchannelAddress)(u)?{host:u.host,port:s.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,o))),l=[s,...c];return{count:l.filter(u=>u.error===void 0).length,port:s.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let s=await Promise.all(i.map(a=>this.bindOneAddress(a,o)));return{count:s.filter(a=>a.error===void 0).length,port:s[0].port,errors:s.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,o){let s=await this.bindManyPorts(i,o);if(s.count>0)return s.count<i.length&&Bp.log(rr.LogVerbosity.INFO,`WARNING Only ${s.count} addresses added out of total ${i.length} resolved`),s.port;{let a=`No address added out of total ${i.length} resolved`;throw Bp.log(rr.LogVerbosity.ERROR,a),new Error(`${a} errors: [${s.errors.join(",")}]`)}}resolvePort(i){return new Promise((o,s)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return s(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(s(new Error(`No addresses resolved for port ${i}`)),!0):(o(h),!0)};(0,ere.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,o){let s=await this.resolvePort(i);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(s,o);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let o=(0,Io.parseUri)(i);if(o===null)throw new Error(`Could not parse port "${i}"`);let s=(0,ere.mapUriDefaultScheme)(o);if(s===null)throw new Error(`Could not get a default scheme for port "${i}"`);return s}bindAsync(i,o,s){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(o===null||!(o instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof s!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>s(f,p))},l=this.boundPorts.get((0,Io.uriToString)(a));if(l){if(!o._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>s(null,f),f=>s(f,0)):c(null,l.portNumber);return}l={mapKey:(0,Io.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:o,listeningServers:new Set};let u=(0,Io.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,u?.port===0?d.then(f=>{let p={scheme:a.scheme,authority:a.authority,path:(0,Io.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,Io.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),s(null,f)},f=>{s(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,s(null,f)},f=>{s(f,0)}))}registerInjectorToChannelz(){return(0,_r.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(i,o,s=!1){if(i===null||!(i instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:o,sessions:c,ownsChannelzRef:s}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var u,d;for(let f of c)this.closeSession(f);(d=(u=setTimeout(()=>{for(let f of c)f.destroy(Wn.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(u)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let o=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,o,!0)}closeServer(i,o){this.trace("Closing server with address "+JSON.stringify(i.address()));let s=this.http2Servers.get(i);i.close(()=>{s&&s.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(s.channelzRef),(0,_r.unregisterChannelzRef)(s.channelzRef)),this.http2Servers.delete(i),o?.()})}closeSession(i,o){var s;this.trace("Closing session initiated by "+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,_r.unregisterChannelzRef)(a.ref)),o?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let o of i.listeningServers){let s=this.http2Servers.get(o);if(this.closeServer(o,()=>{i.listeningServers.delete(o)}),s)for(let a of s.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let o=this.normalizePort(i),s=(0,Io.splitHostPort)(o.path);if(s?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,Io.uriToString)(o));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,Io.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,o){var s,a;this.trace("drain port="+i+" graceTimeMs="+o);let c=this.normalizePort(i),l=(0,Io.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Io.uriToString)(c));if(!u)return;let d=new Set;for(let f of u.listeningServers){let p=this.http2Servers.get(f);if(p)for(let h of p.sessions)d.add(h),this.closeSession(h,()=>{d.delete(h)})}(a=(s=setTimeout(()=>{for(let f of d)f.destroy(Wn.constants.NGHTTP2_CANCEL)},o)).unref)===null||a===void 0||a.call(s)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,o)=>{this.closeSession(o),o.destroy(Wn.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,_r.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,o,s,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:o,serialize:s,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var o;let s=l=>{(0,_r.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&s()}this.shutdown=!0;for(let[l,u]of this.http2Servers.entries()){a++;let d=u.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of u.sessions.keys()){a++;let p=(o=f.socket)===null||o===void 0?void 0:o.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&s()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,o){let s=o[Wn.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof s!="string"||!s.startsWith("application/grpc")?(i.respond({[Wn.constants.HTTP2_HEADER_STATUS]:Wn.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){ore("Received call to method "+i+" at address "+this.serverAddressString);let o=this.handlers.get(i);return o===void 0?(ore("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):o}_respondWithError(i,o,s=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:rr.Status.INTERNAL,"grpc-message":i.details,[Wn.constants.HTTP2_HEADER_STATUS]:Wn.constants.HTTP_STATUS_OK,[Wn.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());o.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed()}_channelzHandler(i,o,s){o.once("error",f=>{}),this.onStreamOpened(o);let a=this.sessions.get(o.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(o,s)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=s[nre],l=this._retrieveHandler(c);if(!l){this._respondWithError(H1(c),o,a);return}let u={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===rr.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,tre.getServerInterceptingCall)([...i,...this.interceptors],o,s,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,o,s){if(o.once("error",u=>{}),this.onStreamOpened(o),this._verifyContentType(o,s)!==!0)return;let a=s[nre],c=this._retrieveHandler(a);if(!c){this._respondWithError(H1(a),o,null);return}let l=(0,tre.getServerInterceptingCall)([...i,...this.interceptors],o,s,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,o){let{type:s}=o;if(s==="unary")U1e(i,o);else if(s==="clientStream")F1e(i,o);else if(s==="serverStream")z1e(i,o);else if(s==="bidi")j1e(i,o);else return!1;return!0}_setupHandlers(i,o){if(i===null)return;let s=i.address(),a="null";s&&(typeof s=="string"?a=s:a=s.address+":"+s.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,o)),i.on("session",l)}_sessionHandler(i){return o=>{var s,a;(s=this.http2Servers.get(i))===null||s===void 0||s.sessions.add(o);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==jp){let _=this.maxConnectionAgeMs/10,b=Math.random()*_*2-_;c=setTimeout(()=>{var T,E;d=!0,this.trace("Connection dropped by max connection age: "+((T=o.socket)===null||T===void 0?void 0:T.remoteAddress));try{o.goaway(Wn.constants.NGHTTP2_NO_ERROR,~(1<<31),ire)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==jp&&(l=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(E=l.unref)===null||E===void 0||E.call(l))},this.maxConnectionAgeMs+b),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!o.destroyed&&this.keepaliveTimeMs<G1&&this.keepaliveTimeMs>0,m,g=()=>{var _;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(_=u.unref)===null||_===void 0||_.call(u))};m=()=>{var _;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let b="";try{o.ping((E,A,O)=>{p(),E?(this.keepaliveTrace("Ping failed with error: "+E.message),d=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),g())})||(b="Ping returned false")}catch(T){b=(T instanceof Error?T.message:"")||"Unknown error"}if(b){this.keepaliveTrace("Ping send failed: "+b),this.trace("Connection dropped due to ping send error: "+b),d=!0,o.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,o.destroy()},this.keepaliveTimeoutMs),(_=u.unref)===null||_===void 0||_.call(u)},g(),o.on("close",()=>{var _,b;d||this.trace(`Connection dropped by client ${(_=o.socket)===null||_===void 0?void 0:_.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(o)),(b=this.http2Servers.get(i))===null||b===void 0||b.sessions.delete(o)})}}_channelzSessionHandler(i){return o=>{var s,a,c,l;let u=(0,_r.registerChannelzSocket)((a=(s=o.socket)===null||s===void 0?void 0:s.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,o),this.channelzEnabled),d={ref:u,streamTracker:new _r.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(o),this.sessions.set(o,d);let f=`${o.socket.remoteAddress}:${o.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(u);let p=null,h=null,m=null,g=!1,_=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==jp){let O=this.maxConnectionAgeMs/10,R=Math.random()*O*2-O;p=setTimeout(()=>{var N;g=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{o.goaway(Wn.constants.NGHTTP2_NO_ERROR,~(1<<31),ire)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==jp&&(h=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(N=h.unref)===null||N===void 0||N.call(h))},this.maxConnectionAgeMs+R),(l=p.unref)===null||l===void 0||l.call(p)}let b=()=>{m&&(clearTimeout(m),m=null)},T=()=>!o.destroyed&&this.keepaliveTimeMs<G1&&this.keepaliveTimeMs>0,E,A=()=>{var O;T()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{b(),E()},this.keepaliveTimeMs),(O=m.unref)===null||O===void 0||O.call(m))};E=()=>{var O;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let R="";try{o.ping((M,L,v)=>{b(),M?(this.keepaliveTrace("Ping failed with error: "+M.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+M.message+" return in "+L),g=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),A())})||(R="Ping returned false")}catch(N){R=(N instanceof Error?N.message:"")||"Unknown error"}if(R){this.keepaliveTrace("Ping send failed: "+R),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+R),g=!0,o.destroy();return}d.keepAlivesSent+=1,m=setTimeout(()=>{b(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),g=!0,o.destroy()},this.keepaliveTimeoutMs),(O=m.unref)===null||O===void 0||O.call(m)},A(),o.on("close",()=>{var O;g||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,_r.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),b(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(o)),(O=this.http2Servers.get(i))===null||O===void 0||O.sessions.delete(o),this.sessions.delete(o)})}}enableIdleTimeout(i){var o,s;if(this.sessionIdleTimeout>=rre)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(s=(o=a.timeout).unref)===null||s===void 0||s.call(o),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,o){let{socket:s}=o,a=i.sessionIdleTimeouts.get(o);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+s?.remoteAddress+":"+s?.remotePort+" last idle at "+a.lastIdle),i.closeSession(o)):a.timeout.refresh())}onStreamOpened(i){let o=i.session,s=this.sessionIdleTimeouts.get(o);s&&(s.activeStreams+=1,i.once("close",s.onClose))}onStreamClose(i){var o,s;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress)+":"+((s=i.socket)===null||s===void 0?void 0:s.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[$1e("Calling start() is no longer necessary. It can be safely omitted.")],P1e(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),t})();Jc.Server=L1e;async function U1e(t,e){let r;function n(s,a,c,l){if(s){t.sendStatus((0,qp.serverErrorToStatus)(s,c));return}t.sendMessage(a,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:c??null})})}let i,o=null;t.start({onReceiveMetadata(s){i=s,t.startRead()},onReceiveMessage(s){if(o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}o=s,t.startRead()},onReceiveHalfClose(){if(!o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new qp.ServerWritableStreamImpl(e.path,t,i,o);try{e.func(r,n)}catch(s){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function F1e(t,e){let r;function n(i,o,s,a){if(i){t.sendStatus((0,qp.serverErrorToStatus)(i,s));return}t.sendMessage(o,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:s??null})})}t.start({onReceiveMetadata(i){r=new qp.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function z1e(t,e){let r,n,i=null;t.start({onReceiveMetadata(o){n=o,t.startRead()},onReceiveMessage(o){if(i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=o,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new qp.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function j1e(t,e){let r;t.start({onReceiveMetadata(n){r=new qp.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){r.push(n)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var are=y(oR=>{"use strict";Object.defineProperty(oR,"__esModule",{value:!0});oR.StatusBuilder=void 0;var W1=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};oR.StatusBuilder=W1});var uS=y(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.LeafLoadBalancer=As.PickFirstLoadBalancer=As.PickFirstLoadBalancingConfig=void 0;As.shuffled=dre;As.setup=K1e;var Y1=$c(),nr=In(),Xc=ga(),cre=Gn(),B1e=Nt(),q1e=Xe(),lre=Gn(),ure=Z("net"),V1e=zu(),G1e="pick_first";function aS(t){B1e.trace(q1e.LogVerbosity.DEBUG,G1e,t)}var cS="pick_first",H1e=250,Vp=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return cS}toJsonObject(){return{[cS]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new t(e.shuffleAddressList===!0)}};As.PickFirstLoadBalancingConfig=Vp;var K1=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Xc.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function dre(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let n=Math.floor(Math.random()*(r+1)),i=e[r];e[r]=e[n],e[n]=i}return e}function W1e(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,lre.isTcpSubchannelAddress)(t[0])&&(0,ure.isIPv6)(t[0].host);for(let a of t)(0,lre.isTcpSubchannelAddress)(a)&&(0,ure.isIPv6)(a.host)?r.push(a):n.push(a);let o=i?r:n,s=i?n:r;for(let a=0;a<Math.max(o.length,s.length);a++)a<o.length&&e.push(o[a]),a<s.length&&e.push(s[a]);return e}var fre="grpc-node.internal.pick-first.report_health_status",lS=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=nr.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,o,s)=>{this.onSubchannelStateUpdate(r,n,i,s)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let r=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.READY,new K1(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(nr.ConnectivityState.IDLE,new Xc.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.CONNECTING,new Xc.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var o;if(!((o=this.currentPick)===null||o===void 0)&&o.realSubchannelEquals(e)){n!==nr.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[s,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===nr.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===nr.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),s===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(s+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,n]of this.children.entries())if(r>=e){let i=n.subchannel.getConnectivityState();if(i===nr.ConnectivityState.IDLE||i===nr.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===nr.ConnectivityState.IDLE&&(aS("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},H1e),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){aS("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){aS(nr.ConnectivityState[this.currentState]+" -> "+nr.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){aS("connectToAddressList(["+e.map(i=>(0,cre.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===nr.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===nr.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Vp))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker(e.error),e.error.details),!0;let o=e.value;this.reportHealthStatus=n[fre],r.getShuffleAddressList()&&(o=dre(o));let s=[].concat(...o.map(c=>c.addresses));aS("updateAddressList(["+s.map(c=>(0,cre.subchannelAddressToString)(c))+"])");let a=W1e(s);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,s.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===nr.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return cS}};As.PickFirstLoadBalancer=lS;var Y1e=new Vp(!1),Z1=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=nr.ConnectivityState.IDLE;let o=(0,Y1.createChildChannelControlHelper)(r,{updateState:(s,a,c)=>{this.latestState=s,this.latestPicker=a,r.updateState(s,a,c)}});this.pickFirstBalancer=new lS(o),this.latestPicker=new Xc.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,V1e.statusOrFromValue)([this.endpoint]),Y1e,Object.assign(Object.assign({},this.options),{[fre]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==nr.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};As.LeafLoadBalancer=Z1;function K1e(){(0,Y1.registerLoadBalancerType)(cS,lS,Vp),(0,Y1.registerDefaultLoadBalancerType)(cS)}});var pre=y(aR=>{"use strict";Object.defineProperty(aR,"__esModule",{value:!0});aR.FileWatcherCertificateProvider=void 0;var Z1e=Z("fs"),J1e=Nt(),X1e=Xe(),Q1e=Z("util"),eUe="certificate_provider";function sR(t){J1e.trace(X1e.LogVerbosity.DEBUG,eUe,t)}var J1=(0,Q1e.promisify)(Z1e.readFile),X1=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");sR("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?J1(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?J1(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?J1(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){sR("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&r.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:r.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),sR("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),sR("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};aR.FileWatcherCertificateProvider=X1});var tU=y(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Se.createCertificateProviderChannelCredentials=Se.FileWatcherCertificateProvider=Se.createCertificateProviderServerCredentials=Se.createServerCredentialsWithInterceptors=Se.BaseSubchannelWrapper=Se.registerAdminService=Se.FilterStackFactory=Se.BaseFilter=Se.statusOrFromError=Se.statusOrFromValue=Se.PickResultType=Se.QueuePicker=Se.UnavailablePicker=Se.ChildLoadBalancerHandler=Se.EndpointMap=Se.endpointHasAddress=Se.endpointToString=Se.subchannelAddressToString=Se.LeafLoadBalancer=Se.isLoadBalancerNameRegistered=Se.parseLoadBalancingConfig=Se.selectLbConfigFromList=Se.registerLoadBalancerType=Se.createChildChannelControlHelper=Se.BackoffTimeout=Se.parseDuration=Se.durationToMs=Se.splitHostPort=Se.uriToString=Se.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Se.createResolver=Se.registerResolver=Se.log=Se.trace=void 0;var hre=Nt();Object.defineProperty(Se,"trace",{enumerable:!0,get:function(){return hre.trace}});Object.defineProperty(Se,"log",{enumerable:!0,get:function(){return hre.log}});var Q1=mo();Object.defineProperty(Se,"registerResolver",{enumerable:!0,get:function(){return Q1.registerResolver}});Object.defineProperty(Se,"createResolver",{enumerable:!0,get:function(){return Q1.createResolver}});Object.defineProperty(Se,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return Q1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var mre=Cn();Object.defineProperty(Se,"uriToString",{enumerable:!0,get:function(){return mre.uriToString}});Object.defineProperty(Se,"splitHostPort",{enumerable:!0,get:function(){return mre.splitHostPort}});var gre=sS();Object.defineProperty(Se,"durationToMs",{enumerable:!0,get:function(){return gre.durationToMs}});Object.defineProperty(Se,"parseDuration",{enumerable:!0,get:function(){return gre.parseDuration}});var tUe=pp();Object.defineProperty(Se,"BackoffTimeout",{enumerable:!0,get:function(){return tUe.BackoffTimeout}});var dS=$c();Object.defineProperty(Se,"createChildChannelControlHelper",{enumerable:!0,get:function(){return dS.createChildChannelControlHelper}});Object.defineProperty(Se,"registerLoadBalancerType",{enumerable:!0,get:function(){return dS.registerLoadBalancerType}});Object.defineProperty(Se,"selectLbConfigFromList",{enumerable:!0,get:function(){return dS.selectLbConfigFromList}});Object.defineProperty(Se,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return dS.parseLoadBalancingConfig}});Object.defineProperty(Se,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return dS.isLoadBalancerNameRegistered}});var rUe=uS();Object.defineProperty(Se,"LeafLoadBalancer",{enumerable:!0,get:function(){return rUe.LeafLoadBalancer}});var cR=Gn();Object.defineProperty(Se,"subchannelAddressToString",{enumerable:!0,get:function(){return cR.subchannelAddressToString}});Object.defineProperty(Se,"endpointToString",{enumerable:!0,get:function(){return cR.endpointToString}});Object.defineProperty(Se,"endpointHasAddress",{enumerable:!0,get:function(){return cR.endpointHasAddress}});Object.defineProperty(Se,"EndpointMap",{enumerable:!0,get:function(){return cR.EndpointMap}});var nUe=MA();Object.defineProperty(Se,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return nUe.ChildLoadBalancerHandler}});var eU=ga();Object.defineProperty(Se,"UnavailablePicker",{enumerable:!0,get:function(){return eU.UnavailablePicker}});Object.defineProperty(Se,"QueuePicker",{enumerable:!0,get:function(){return eU.QueuePicker}});Object.defineProperty(Se,"PickResultType",{enumerable:!0,get:function(){return eU.PickResultType}});var _re=zu();Object.defineProperty(Se,"statusOrFromValue",{enumerable:!0,get:function(){return _re.statusOrFromValue}});Object.defineProperty(Se,"statusOrFromError",{enumerable:!0,get:function(){return _re.statusOrFromError}});var iUe=IL();Object.defineProperty(Se,"BaseFilter",{enumerable:!0,get:function(){return iUe.BaseFilter}});var oUe=Ox();Object.defineProperty(Se,"FilterStackFactory",{enumerable:!0,get:function(){return oUe.FilterStackFactory}});var sUe=UA();Object.defineProperty(Se,"registerAdminService",{enumerable:!0,get:function(){return sUe.registerAdminService}});var aUe=iS();Object.defineProperty(Se,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return aUe.BaseSubchannelWrapper}});var yre=Xx();Object.defineProperty(Se,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return yre.createServerCredentialsWithInterceptors}});Object.defineProperty(Se,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return yre.createCertificateProviderServerCredentials}});var cUe=pre();Object.defineProperty(Se,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return cUe.FileWatcherCertificateProvider}});var lUe=fp();Object.defineProperty(Se,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return lUe.createCertificateProviderChannelCredentials}});var uUe=_1();Object.defineProperty(Se,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return uUe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var Sre=y(nU=>{"use strict";Object.defineProperty(nU,"__esModule",{value:!0});nU.setup=pUe;var dUe=mo(),fUe=zu(),rU=class{constructor(e,r,n){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,fUe.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function pUe(){(0,dUe.registerResolver)("unix",rU)}});var Are=y(aU=>{"use strict";Object.defineProperty(aU,"__esModule",{value:!0});aU.setup=yUe;var Ere=Z("net"),vre=zu(),lR=Xe(),iU=Rr(),bre=mo(),hUe=Gn(),Tre=Cn(),mUe=Nt(),gUe="ip_resolver";function wre(t){mUe.trace(lR.LogVerbosity.DEBUG,gUe,t)}var oU="ipv4",sU="ipv6",_Ue=443,uR=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,wre("Resolver constructed for target "+(0,Tre.uriToString)(e));let o=[];if(!(e.scheme===oU||e.scheme===sU)){this.error={code:lR.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new iU.Metadata};return}let s=e.path.split(",");for(let a of s){let c=(0,Tre.splitHostPort)(a);if(c===null){this.error={code:lR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new iU.Metadata};return}if(e.scheme===oU&&!(0,Ere.isIPv4)(c.host)||e.scheme===sU&&!(0,Ere.isIPv6)(c.host)){this.error={code:lR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new iU.Metadata};return}o.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:_Ue})}this.endpoints=o.map(a=>({addresses:[a]})),wre("Parsed "+e.scheme+" address list "+o.map(hUe.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,vre.statusOrFromError)(this.error),{},null,""):this.listener((0,vre.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function yUe(){(0,bre.registerResolver)(oU,uR),(0,bre.registerResolver)(sU,uR)}});var Ire=y(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});pS.RoundRobinLoadBalancer=void 0;pS.setup=wUe;var Cre=$c(),Gr=In(),fS=ga(),SUe=Nt(),EUe=Xe(),xre=Gn(),vUe=uS(),bUe="round_robin";function Rre(t){SUe.trace(EUe.LogVerbosity.DEBUG,bUe,t)}var dR="round_robin",fR=class t{getLoadBalancerName(){return dR}constructor(){}toJsonObject(){return{[dR]:{}}}static createFromJson(e){return new t}},cU=class{constructor(e,r=0){this.children=e,this.nextIndex=r}pick(e){let r=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,r.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function TUe(t,e){return[...t.slice(e),...t.slice(0,e)]}var pR=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Gr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,Cre.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===Gr.ConnectivityState.READY&&r!==Gr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(Gr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===Gr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,xre.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(Gr.ConnectivityState.READY,new cU(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(Gr.ConnectivityState.CONNECTING)>0)this.updateState(Gr.ConnectivityState.CONNECTING,new fS.QueuePicker(this),null);else if(this.countChildrenWithState(Gr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker({details:e}),e)}else this.updateState(Gr.ConnectivityState.IDLE,new fS.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===Gr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){Rre(Gr.ConnectivityState[this.currentState]+" -> "+Gr.ConnectivityState[e]),e===Gr.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,n,i){if(!(r instanceof fR))return!1;if(!e.ok)return this.children.length===0&&this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker(e.error),e.error.details),!0;let o=Math.random()*e.value.length|0,s=TUe(e.value,o);if(this.resetSubchannelList(),s.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker({details:a}),a)}Rre("Connect to endpoint list "+s.map(xre.endpointToString)),this.updatesPaused=!0,this.children=s.map(a=>new vUe.LeafLoadBalancer(a,this.childChannelControlHelper,n,i));for(let a of this.children)a.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return dR}};pS.RoundRobinLoadBalancer=pR;function wUe(){(0,Cre.registerLoadBalancerType)(dR,pR,fR)}});var Nre=y(sd=>{"use strict";var lU;Object.defineProperty(sd,"__esModule",{value:!0});sd.OutlierDetectionLoadBalancer=sd.OutlierDetectionLoadBalancingConfig=void 0;sd.setup=$Ue;var AUe=In(),Pre=Xe(),od=sS(),Ore=tU(),xUe=$c(),RUe=MA(),CUe=ga(),uU=Gn(),IUe=iS(),PUe=Nt(),OUe="outlier_detection";function Or(t){PUe.trace(Pre.LogVerbosity.DEBUG,OUe,t)}var gU="outlier_detection",NUe=((lU=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&lU!==void 0?lU:"true")==="true",kUe={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},MUe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Gp(t,e,r,n){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${r}, got ${typeof t[e]}`)}}function dU(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,od.isDuration)(t[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof t[e]}`);if(!(t[e].seconds>=0&&t[e].seconds<=315576e6&&t[e].nanos>=0&&t[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function hR(t,e,r){let n=r?`${r}.${e}`:e;if(Gp(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var hS=class t{constructor(e,r,n,i,o,s,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=r??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=o?Object.assign(Object.assign({},kUe),o):null,this.failurePercentageEjection=s?Object.assign(Object.assign({},MUe),s):null}getLoadBalancerName(){return gU}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,od.msToDuration)(this.intervalMs),base_ejection_time:(0,od.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,od.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(r=this.failurePercentageEjection)!==null&&r!==void 0?r:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var r;if(dU(e,"interval"),dU(e,"base_ejection_time"),dU(e,"max_ejection_time"),hR(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Gp(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),hR(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Gp(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Gp(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");hR(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),hR(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Gp(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Gp(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let n=(0,xUe.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,od.durationToMs)(e.interval):null,e.base_ejection_time?(0,od.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,od.durationToMs)(e.max_ejection_time):null,(r=e.max_ejection_percent)!==null&&r!==void 0?r:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};sd.OutlierDetectionLoadBalancingConfig=hS;var pU=class extends IUe.BaseSubchannelWrapper{constructor(e,r){super(e),this.mapEntry=r,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function fU(){return{success:0,failure:0}}var hU=class{constructor(){this.activeBucket=fU(),this.inactiveBucket=fU()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=fU()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},mU=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===CUe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let o=r.onCallEnded;return this.countCalls&&(o=(s,a,c)=>{var l;s===Pre.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,s,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:o})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},mR=class{constructor(e){this.entryMap=new uU.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new RUe.ChildLoadBalancerHandler((0,Ore.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),o=this.entryMap.getForSubchannelAddress(r),s=new pU(i,o);return o?.currentEjectionTimestamp!==null&&s.eject(),o?.subchannelWrappers.push(s),s},updateState:(r,n,i)=>{r===AUe.ConnectivityState.READY?e.updateState(r,new mU(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let r of this.entryMap.values())r.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getSuccessRateEjectionConfig();if(!r)return;Or("Running success rate check");let n=r.request_volume,i=0,o=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Or("Stats for "+(0,uU.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,o.push(p/(p+h)))}if(Or("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+o+"]"),i<r.minimum_hosts)return;let s=o.reduce((d,f)=>d+f)/o.length,a=0;for(let d of o){let f=d-s;a+=f*f}let c=a/o.length,l=Math.sqrt(c),u=s-l*(r.stdev_factor/1e3);Or("stdev="+l+" ejectionThreshold="+u);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();if(p+h<n)continue;let m=p/(p+h);if(Or("Checking candidate "+d+" successRate="+m),m<u){let g=Math.random()*100;Or("Candidate "+d+" randomNumber="+g+" enforcement_percentage="+r.enforcement_percentage),g<r.enforcement_percentage&&(Or("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Or("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let o=i.counter.getLastSuccesses(),s=i.counter.getLastFailures();o+s>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,o]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let s=o.counter.getLastSuccesses(),a=o.counter.getLastFailures();if(Or("Candidate successes="+s+" failures="+a),s+a<r.request_volume)continue;if(a*100/(a+s)>r.threshold){let l=Math.random()*100;Or("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Or("Ejecting candidate "+i),this.eject(o,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let r of e.subchannelWrappers)r.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var r,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(r=this.ejectionTimer).unref)===null||n===void 0||n.call(r)}runChecks(){let e=new Date;if(Or("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),o=this.latestConfig.getMaxEjectionTimeMs(),s=new Date(n.currentEjectionTimestamp.getTime());s.setMilliseconds(s.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,o))),s<new Date&&(Or("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof hS))return!1;if(Or("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let s of e.value)this.entryMap.has(s)||(Or("Adding map entry for "+(0,uU.endpointToString)(s)),this.entryMap.set(s,{counter:new hU,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let o=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,o,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Or("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else Or("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Or("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return gU}};sd.OutlierDetectionLoadBalancer=mR;function $Ue(){NUe&&(0,Ore.registerLoadBalancerType)(gU,mR,hS)}});var kre=y(_R=>{"use strict";Object.defineProperty(_R,"__esModule",{value:!0});_R.PriorityQueue=void 0;var Hp=0,_U=t=>Math.floor(t/2),gR=t=>t*2+1,mS=t=>t*2+2,yU=class{constructor(e=(r,n)=>r>n){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[Hp]}push(...e){return e.forEach(r=>{this.heap.push(r),this.siftUp()}),this.size()}pop(){let e=this.peek(),r=this.size()-1;return r>Hp&&this.swap(Hp,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[Hp]=e,this.siftDown(),r}greater(e,r){return this.comparator(this.heap[e],this.heap[r])}swap(e,r){[this.heap[e],this.heap[r]]=[this.heap[r],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>Hp&&this.greater(e,_U(e));)this.swap(e,_U(e)),e=_U(e)}siftDown(){let e=Hp;for(;gR(e)<this.size()&&this.greater(gR(e),e)||mS(e)<this.size()&&this.greater(mS(e),e);){let r=mS(e)<this.size()&&this.greater(mS(e),gR(e))?mS(e):gR(e);this.swap(e,r),e=r}}};_R.PriorityQueue=yU});var Ure=y(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});_S.WeightedRoundRobinLoadBalancingConfig=void 0;_S.setup=HUe;var Nr=In(),DUe=Xe(),yi=sS(),Dre=$c(),LUe=uS(),UUe=Nt(),Lre=eR(),Wp=ga(),FUe=kre(),Mre=Gn(),zUe="weighted_round_robin";function SU(t){UUe.trace(DUe.LogVerbosity.DEBUG,zUe,t)}var bU="weighted_round_robin",jUe=1e4,BUe=1e4,qUe=3*6e4,VUe=1e3,GUe=1;function $re(t,e,r){if(e in t&&t[e]!==void 0&&typeof t[e]!==r)throw new Error(`weighted round robin config ${e} parse error: expected ${r}, got ${typeof t[e]}`)}function yR(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,yi.isDuration)(t[e]))r=t[e];else if((0,yi.isDurationMessage)(t[e]))r=(0,yi.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,yi.parseDuration)(t[e]);if(!n)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=n}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,yi.durationToMs)(r)}return null}var gS=class t{constructor(e,r,n,i,o,s){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??jUe,this.blackoutPeriodMs=n??BUe,this.weightExpirationPeriodMs=i??qUe,this.weightUpdatePeriodMs=Math.max(o??VUe,100),this.errorUtilizationPenalty=s??GUe}getLoadBalancerName(){return bU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,yi.durationToString)((0,yi.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,yi.durationToString)((0,yi.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,yi.durationToString)((0,yi.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,yi.durationToString)((0,yi.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if($re(e,"enable_oob_load_report","boolean"),$re(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new t(e.enable_oob_load_report,yR(e,"oob_load_reporting_period"),yR(e,"blackout_period"),yR(e,"weight_expiration_period"),yR(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};_S.WeightedRoundRobinLoadBalancingConfig=gS;var EU=class{constructor(e,r){this.metricsHandler=r,this.queue=new FUe.PriorityQueue((o,s)=>o.deadline<s.deadline);let n=e.filter(o=>o.weight>0),i;if(n.length<2)i=1;else{let o=0;for(let{weight:s}of n)o+=s;i=o/n.length}for(let o of e){let s=o.weight>0?1/o.weight:i;this.queue.push({endpointName:o.endpointName,picker:o.picker,period:s,deadline:Math.random()*s})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let n=r.picker.pick(e);if(n.pickResultType===Wp.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,Lre.createMetricsReader)(i=>this.metricsHandler(i,r.endpointName),n.onCallEnded)});{let i=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}}else return n}},vU=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Nr.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var n,i;let o=r.rps_fractional,s=r.application_utilization;s>0&&o>0&&(s+=r.eps/o*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=s===0?0:o/s;if(a===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;let r=new Date().getTime();if(r-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(Nr.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Nr.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});SU("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let o=this.children.get(i);o&&this.updateWeight(o,n)},this.updateState(Nr.ConnectivityState.READY,new EU(e,r),null)}else if(this.countChildrenWithState(Nr.ConnectivityState.CONNECTING)>0)this.updateState(Nr.ConnectivityState.CONNECTING,new Wp.QueuePicker(this),null);else if(this.countChildrenWithState(Nr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker({details:e}),e)}else this.updateState(Nr.ConnectivityState.IDLE,new Wp.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Nr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){SU(Nr.ConnectivityState[this.currentState]+" -> "+Nr.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var o,s;if(!(r instanceof gS))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker({details:l}),l),!1}SU("Connect to endpoint list "+e.value.map(Mre.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,Mre.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new LUe.LeafLoadBalancer(l,(0,Dre.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Nr.ConnectivityState.READY&&f!==Nr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Nr.ConnectivityState.READY&&(d.nonEmptySince=null),h&&(this.lastError=h),this.calculateAndUpdateState()},createSubchannel:(f,p)=>{let h=this.channelControlHelper.createSubchannel(f,p);return d?.oobMetricsListener?new Lre.OrcaOobMetricsSubchannelWrapper(h,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):h}}),n,i),lastUpdated:a,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(u,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=f=>{this.updateWeight(d,f)}:d.oobMetricsListener=null}for(let[l,u]of this.children)c.has(l)?u.child.startConnecting():(u.child.destroy(),this.children.delete(l));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(s=(o=setInterval(()=>{this.currentState===Nr.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||s===void 0?void 0:s.call(o),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return bU}};function HUe(){(0,Dre.registerLoadBalancerType)(bU,vU,gS)}});var yS=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.experimental=_e.ServerMetricRecorder=_e.ServerInterceptingCall=_e.ResponderBuilder=_e.ServerListenerBuilder=_e.addAdminServicesToServer=_e.getChannelzHandlers=_e.getChannelzServiceDefinition=_e.InterceptorConfigurationError=_e.InterceptingCall=_e.RequesterBuilder=_e.ListenerBuilder=_e.StatusBuilder=_e.getClientChannel=_e.ServerCredentials=_e.Server=_e.setLogVerbosity=_e.setLogger=_e.load=_e.loadObject=_e.CallCredentials=_e.ChannelCredentials=_e.waitForClientReady=_e.closeClient=_e.Channel=_e.makeGenericClientConstructor=_e.makeClientConstructor=_e.loadPackageDefinition=_e.Client=_e.compressionAlgorithms=_e.propagate=_e.connectivityState=_e.status=_e.logVerbosity=_e.Metadata=_e.credentials=void 0;var SR=TA();Object.defineProperty(_e,"CallCredentials",{enumerable:!0,get:function(){return SR.CallCredentials}});var WUe=uD();Object.defineProperty(_e,"Channel",{enumerable:!0,get:function(){return WUe.ChannelImplementation}});var YUe=RL();Object.defineProperty(_e,"compressionAlgorithms",{enumerable:!0,get:function(){return YUe.CompressionAlgorithms}});var KUe=In();Object.defineProperty(_e,"connectivityState",{enumerable:!0,get:function(){return KUe.ConnectivityState}});var ER=fp();Object.defineProperty(_e,"ChannelCredentials",{enumerable:!0,get:function(){return ER.ChannelCredentials}});var Fre=lD();Object.defineProperty(_e,"Client",{enumerable:!0,get:function(){return Fre.Client}});var TU=Xe();Object.defineProperty(_e,"logVerbosity",{enumerable:!0,get:function(){return TU.LogVerbosity}});Object.defineProperty(_e,"status",{enumerable:!0,get:function(){return TU.Status}});Object.defineProperty(_e,"propagate",{enumerable:!0,get:function(){return TU.Propagate}});var zre=Nt(),wU=qA();Object.defineProperty(_e,"loadPackageDefinition",{enumerable:!0,get:function(){return wU.loadPackageDefinition}});Object.defineProperty(_e,"makeClientConstructor",{enumerable:!0,get:function(){return wU.makeClientConstructor}});Object.defineProperty(_e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return wU.makeClientConstructor}});var ZUe=Rr();Object.defineProperty(_e,"Metadata",{enumerable:!0,get:function(){return ZUe.Metadata}});var JUe=sre();Object.defineProperty(_e,"Server",{enumerable:!0,get:function(){return JUe.Server}});var XUe=Xx();Object.defineProperty(_e,"ServerCredentials",{enumerable:!0,get:function(){return XUe.ServerCredentials}});var QUe=are();Object.defineProperty(_e,"StatusBuilder",{enumerable:!0,get:function(){return QUe.StatusBuilder}});_e.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:ER.ChannelCredentials.createInsecure,createSsl:ER.ChannelCredentials.createSsl,createFromSecureContext:ER.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SR.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SR.CallCredentials.createFromGoogleCredential,createEmpty:SR.CallCredentials.createEmpty};var eFe=t=>t.close();_e.closeClient=eFe;var tFe=(t,e,r)=>t.waitForReady(e,r);_e.waitForClientReady=tFe;var rFe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.loadObject=rFe;var nFe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.load=nFe;var iFe=t=>{zre.setLogger(t)};_e.setLogger=iFe;var oFe=t=>{zre.setLoggerVerbosity(t)};_e.setLogVerbosity=oFe;var sFe=t=>Fre.Client.prototype.getChannel.call(t);_e.getClientChannel=sFe;var vR=sD();Object.defineProperty(_e,"ListenerBuilder",{enumerable:!0,get:function(){return vR.ListenerBuilder}});Object.defineProperty(_e,"RequesterBuilder",{enumerable:!0,get:function(){return vR.RequesterBuilder}});Object.defineProperty(_e,"InterceptingCall",{enumerable:!0,get:function(){return vR.InterceptingCall}});Object.defineProperty(_e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return vR.InterceptorConfigurationError}});var jre=Gc();Object.defineProperty(_e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return jre.getChannelzServiceDefinition}});Object.defineProperty(_e,"getChannelzHandlers",{enumerable:!0,get:function(){return jre.getChannelzHandlers}});var aFe=UA();Object.defineProperty(_e,"addAdminServicesToServer",{enumerable:!0,get:function(){return aFe.addAdminServicesToServer}});var AU=q1();Object.defineProperty(_e,"ServerListenerBuilder",{enumerable:!0,get:function(){return AU.ServerListenerBuilder}});Object.defineProperty(_e,"ResponderBuilder",{enumerable:!0,get:function(){return AU.ResponderBuilder}});Object.defineProperty(_e,"ServerInterceptingCall",{enumerable:!0,get:function(){return AU.ServerInterceptingCall}});var cFe=eR();Object.defineProperty(_e,"ServerMetricRecorder",{enumerable:!0,get:function(){return cFe.ServerMetricRecorder}});var lFe=tU();_e.experimental=lFe;var uFe=HL(),dFe=Sre(),fFe=Are(),pFe=uS(),hFe=Ire(),mFe=Nre(),gFe=Ure(),_Fe=Gc();uFe.setup(),dFe.setup(),fFe.setup(),pFe.setup(),hFe.setup(),mFe.setup(),gFe.setup(),_Fe.setup()});var Bre=y(bR=>{"use strict";Object.defineProperty(bR,"__esModule",{value:!0});bR.createServiceClientConstructor=void 0;var yFe=yS();function SFe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return yFe.makeGenericClientConstructor(r,e)}bR.createServiceClientConstructor=SFe});var SS=y(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createOtlpGrpcExporterTransport=Wi.GrpcExporterTransport=Wi.createEmptyMetadata=Wi.createSslCredentials=Wi.createInsecureCredentials=void 0;var EFe=$X(),qre=`OTel-OTLP-Exporter-JavaScript/${EFe.VERSION}`;function vFe(t){return t?`${t} ${qre}`:qre}var bFe=0,TFe=2;function wFe(t){return t==="gzip"?TFe:bFe}function AFe(){let{credentials:t}=yS();return t.createInsecure()}Wi.createInsecureCredentials=AFe;function xFe(t,e,r){let{credentials:n}=yS();return n.createSsl(t,e,r)}Wi.createSslCredentials=xFe;function RFe(){let{Metadata:t}=yS();return new t}Wi.createEmptyMetadata=RFe;var TR=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let n=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:i}=Bre();try{this._metadata=this._parameters.metadata()}catch(s){return Promise.resolve({status:"failure",error:s})}let o=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new o(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":wFe(this._parameters.compression),"grpc.primary_user_agent":vFe(this._parameters.userAgent)})}catch(s){return Promise.resolve({status:"failure",error:s})}}return new Promise(i=>{let o=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:o},(s,a)=>{i(s?{status:"failure",error:s}:{data:a,status:"success"})})})}};Wi.GrpcExporterTransport=TR;function CFe(t){return new TR(t)}Wi.createOtlpGrpcExporterTransport=CFe});var Yre=y(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.getOtlpGrpcDefaultConfiguration=Qc.mergeOtlpGrpcConfigurationWithDefaults=Qc.validateAndNormalizeUrl=void 0;var Hre=(gA(),An(mA)),ES=SS(),IFe=Z("url"),Vre=(ve(),An(xc));function Wre(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new IFe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&Vre.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),r.protocol!==""&&!r.protocol?.match(/^(http)s?:$/)&&Vre.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}Qc.validateAndNormalizeUrl=Wre;function Gre(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function PFe(t,e,r){let n=t.url??e.url??r.url;return{...(0,Hre.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return Gre(i,t.metadata?.().clone()??(0,ES.createEmptyMetadata)()),Gre(i,e.metadata?.()??(0,ES.createEmptyMetadata)()),i},url:Wre(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}Qc.mergeOtlpGrpcConfigurationWithDefaults=PFe;function OFe(){return{...(0,Hre.getSharedConfigurationDefaults)(),metadata:()=>(0,ES.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,ES.createInsecureCredentials)():()=>(0,ES.createSslCredentials)()}}Qc.getOtlpGrpcDefaultConfiguration=OFe});function Kre(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):J.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var Zre=C(()=>{"use strict";ve()});function NFe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,Kre(await t())),Object.assign(i,n)}}function kFe(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function Jre(t,e,r){return{...Vw(t,e,r),headers:NFe(t.headers,e.headers,r.headers),url:kFe(t.url)??e.url??r.url}}function Xre(t,e){return{...Gw(),headers:async()=>t,url:"http://localhost:4318/"+e}}var Qre=C(()=>{"use strict";py();Zre()});function ad(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:o,cert:s,key:a,...c}=t;return new i(c)}return new i(t)}}function ene(t,e,r){return{...Jre(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function tne(t,e){return{...Xre(t,e),agentFactory:ad({keepAlive:!0})}}var wR=C(()=>{"use strict";Qre()});function xU(t){return t===429||t===502||t===503||t===504}function RU(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let r=new Date(t).getTime()-Date.now();return r>=0?r:0}var rne=C(()=>{"use strict"});var nne,ine=C(()=>{"use strict";nne="0.218.0"});import*as ane from"zlib";import{Readable as MFe}from"stream";function cne(t,e,r,n,i,o,s,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${one}`:r["User-Agent"]=one;let d=t(l,{method:"POST",headers:r,agent:o},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>sne){let g=new Error(`OTLP export response body exceeded size limit of ${sne} bytes`);c({status:"failure",error:g}),f.destroy();return}p.push(m)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(p)});else if(f.statusCode&&xU(f.statusCode))c({status:"retryable",retryInMillis:RU(f.headers["retry-after"])});else{let m=new ha(f.statusMessage,f.statusCode,Buffer.concat(p).toString());c({status:"failure",error:m})}}),f.on("error",m=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&xU(f.statusCode)?c({status:"retryable",error:m,retryInMillis:RU(f.headers["retry-after"])}):c({status:"failure",error:m})})});d.setTimeout(a,()=>{d.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),d.on("error",f=>{LFe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),$Fe(d,n,s,f=>{c({status:"failure",error:f})})})}function $Fe(t,e,r,n){let i=DFe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(ane.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function DFe(t){let e=new MFe;return e.push(t),e.push(null),e}function LFe(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var one,sne,lne=C(()=>{"use strict";rne();Bw();ine();one=`OTel-OTLP-Exporter-JavaScript/${nne}`,sne=4*1024*1024});async function UFe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function une(t){return new CU(t)}var CU,dne=C(()=>{"use strict";lne();CU=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),o=await this._parameters.headers();return cne(i,this._parameters.url,o,this._parameters.compression,this._parameters.userAgent,n,e,r)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[n,i]=await Promise.all([this._parameters.agentFactory(r),UFe(r)]);e=this._utils={agent:n,request:i}}return e}}});function BFe(){return Math.random()*(2*fne)-fne}function pne(t){return new PU(t.transport)}var IU,FFe,zFe,jFe,fne,PU,hne=C(()=>{"use strict";ve();IU=5,FFe=1e3,zFe=5e3,jFe=1.5,fne=.2;PU=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){let n=IU,i=FFe,o=Date.now()+r,s=await this._transport.send(e,r);for(;s.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+BFe()),zFe),0);i=i*jFe;let c=s.retryInMillis??a,l=o-Date.now();if(c>l)return J.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),s;J.verbose(`Scheduling export retry in ${Math.round(c)}ms`),s=await this.retry(e,l,c)}return s.status==="success"?J.verbose(`Export succeeded after ${IU-n} retry attempts.`):s.status==="retryable"?J.info(`Export failed after maximum retry attempts (${IU}).`):J.info(`Export failed with non-retryable error: ${s.error}`),s}shutdown(){return this._transport.shutdown()}}});function mne(t,e){return hA({transport:pne({transport:une(t)}),serializer:e,promiseHandler:Ww(t)},{timeout:t.timeoutMillis})}var gne=C(()=>{"use strict";S$();dne();e$();hne()});function _ne(t){let e=ip(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;J.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function qFe(t){let e=_ne(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=_ne("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function yne(t){let e=qn(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;J.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function VFe(t){let e=yne(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=yne("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function AR(t){return{timeoutMillis:qFe(t),compression:VFe(t)}}var OU=C(()=>{"use strict";ap();ve()});import*as Sne from"fs";import*as Ene from"path";function GFe(t){let e=qn(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=qn("OTEL_EXPORTER_OTLP_HEADERS"),n=Mu(e),i=Mu(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},Mu(r),Mu(e))}function HFe(t){try{return new URL(t).toString()}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function WFe(t,e){try{new URL(t)}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{J.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function YFe(t){let e=qn("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return WFe(e,t)}function KFe(t){let e=qn(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return HFe(e)}function NU(t,e,r){let n=qn(t),i=qn(e),o=n??i;if(o!=null)try{return Sne.readFileSync(Ene.resolve(process.cwd(),o))}catch{J.warn(r);return}else return}function ZFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function JFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function XFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function vne(t,e){return{...AR(t),url:KFe(t)??YFe(e),headers:qw(GFe(t)),agentFactory:ad({keepAlive:!0,ca:XFe(t),cert:ZFe(t),key:JFe(t)})}}var bne=C(()=>{"use strict";ap();ve();OU();py();wR()});function Tne(t){return typeof t.headers=="function"?t.headers:qw(t.headers)}var wne=C(()=>{"use strict";py()});function QFe(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return ad(e)}function Ane(t,e,r,n){return t.metadata&&J.warn("Metadata cannot be set when using http"),ene({url:t.url,headers:Tne(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:QFe(t),userAgent:t.userAgent},vne(e,r),tne(n,r))}var xne=C(()=>{"use strict";ve();wR();kU();bne();wne()});var Rne={};jr(Rne,{convertLegacyHttpOptions:()=>Ane,createOtlpHttpExportDelegate:()=>mne,getSharedConfigurationFromEnvironment:()=>AR,httpAgentFactoryFromOptions:()=>ad});var kU=C(()=>{"use strict";wR();gne();OU();xne()});var Nne=y(xR=>{"use strict";Object.defineProperty(xR,"__esModule",{value:!0});xR.getOtlpGrpcConfigurationFromEnv=void 0;var Cne=(ap(),An(PX)),vS=SS(),eze=(kU(),An(Rne)),tze=Z("fs"),rze=Z("path"),Pne=(ve(),An(xc));function MU(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function nze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,Cne.parseKeyPairsIntoRecord)(e),i=(0,Cne.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let o=Object.assign({},i,n),s=(0,vS.createEmptyMetadata)();for(let[a,c]of Object.entries(o))s.set(a,c);return s}function ize(t){let e=nze(t);if(e!=null)return()=>e}function oze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return MU(e,r)}function sze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return MU(e,r)==="true"}function $U(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),o=MU(n,i);if(o!=null)try{return tze.readFileSync(rze.resolve(process.cwd(),o))}catch{Pne.diag.warn(r);return}else return}function aze(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function cze(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function Ine(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function One(t){let e=cze(t),r=aze(t),n=Ine(t),i=e!=null&&r!=null;return n!=null&&!i?(Pne.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,vS.createSslCredentials)(Ine(t))):(0,vS.createSslCredentials)(n,e,r)}function lze(t){return sze(t)?(0,vS.createInsecureCredentials)():One(t)}function uze(t){return{...(0,eze.getSharedConfigurationFromEnvironment)(t),metadata:ize(t),url:oze(t),credentials:e=>e.startsWith("http://")?()=>(0,vS.createInsecureCredentials)():e.startsWith("https://")?()=>One(t):()=>lze(t)}}xR.getOtlpGrpcConfigurationFromEnv=uze});var Mne=y(RR=>{"use strict";Object.defineProperty(RR,"__esModule",{value:!0});RR.convertLegacyOtlpGrpcOptions=void 0;var kne=Yre(),dze=SS(),fze=Nne();function pze(t,e){let r=t.credentials;return(0,kne.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,dze.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,fze.getOtlpGrpcConfigurationFromEnv)(e),(0,kne.getOtlpGrpcDefaultConfiguration)())}RR.convertLegacyOtlpGrpcOptions=pze});var $ne=y(CR=>{"use strict";Object.defineProperty(CR,"__esModule",{value:!0});CR.createOtlpGrpcExportDelegate=void 0;var hze=(gA(),An(mA)),mze=SS();function gze(t,e,r,n){return(0,hze.createOtlpNetworkExportDelegate)(t,e,(0,mze.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}CR.createOtlpGrpcExportDelegate=gze});var Dne=y(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.createOtlpGrpcExportDelegate=Yp.convertLegacyOtlpGrpcOptions=void 0;var _ze=Mne();Object.defineProperty(Yp,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return _ze.convertLegacyOtlpGrpcOptions}});var yze=$ne();Object.defineProperty(Yp,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return yze.createOtlpGrpcExportDelegate}})});function Ia(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var DU=C(()=>{"use strict"});var Sze,bS,el,IR=C(()=>{"use strict";ve();DU();Sze="ProtobufWriter: estimated size was too small, growing buffer.",bS=1,el=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let r=this.pos+e;if(r<=this._buffer.length)return;J.debug(Sze);let n=this._buffer.length*2;for(;n<r;)n*=2;let i=new Uint8Array(n);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(bS),this.pos+=bS,e}finishLengthDelimited(e,r){let n=r>>>0,i=Ia(n);if(i>bS){let s=i-bS;this._ensureCapacity(s),this._buffer.copyWithin(e+i,e+bS,this.pos),this.pos+=s}let o=e;n<128?this._buffer[o]=n:n<16384?(this._buffer[o++]=n&127|128,this._buffer[o]=n>>>7):n<2097152?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o]=n>>>14):n<268435456?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o]=n>>>21):(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o++]=n>>>21&127|128,this._buffer[o]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}this.writeFixed64(r,n)}writeVarint(e){if(this._ensureCapacity(Ia(e)),e>=0&&e<=4294967295){let r=e>>>0;for(;r>127;)this._buffer[this.pos++]=r&127|128,r>>>=7;this._buffer[this.pos++]=r}else{let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}for(;n>0||r>127;)this._buffer[this.pos++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=r&127}}writeFixed32(e){this._ensureCapacity(4);let r=e>>>0;this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeFixed64(e,r){this._ensureCapacity(8);let n=e>>>0,i=r>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=i&255,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let r=!0,n=e.length;for(let i=0;i<n;i++)if(e.charCodeAt(i)>127){r=!1;break}if(r){this.writeVarint(n),this._ensureCapacity(n);for(let i=0;i<n;i++)this._buffer[this.pos++]=e.charCodeAt(i)}else{let i=this._textEncoder.encode(e);this.writeBytes(i)}}}});function Lne(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Pa(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=Lne(t.charCodeAt(n)),o=Lne(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}var LU=C(()=>{"use strict"});var TS,Une=C(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(TS||(TS={}))});var wS,Fne,UU=C(()=>{"use strict";wS=class{emit(e){}enabled(){return!1}},Fne=new wS});function zne(t,e,r){return n=>n===t?e:r}var AS,Kp,FU,jne=C(()=>{"use strict";AS=Symbol.for("io.opentelemetry.js.api.logs"),Kp=globalThis;FU=1});var zU,PR,jU=C(()=>{"use strict";UU();zU=class{getLogger(e,r,n){return new wS}},PR=new zU});var OR,Bne=C(()=>{"use strict";UU();OR=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Fne}}});var xS,qne=C(()=>{"use strict";jU();Bne();xS=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new OR(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:PR}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}});var NR,Vne=C(()=>{"use strict";jne();jU();qne();NR=class t{constructor(){this._proxyLoggerProvider=new xS}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Kp[AS]?this.getLoggerProvider():(Kp[AS]=zne(FU,e,PR),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Kp[AS])===null||e===void 0?void 0:e.call(Kp,FU))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Kp[AS],this._proxyLoggerProvider=new xS}}});var JCt,Gne=C(()=>{"use strict";Une();Vne();JCt=NR.getInstance()});function Yn(t,e){let r=e[0],n=e[1],i=1e9,o=r&65535,s=r/65536>>>0,a=o*i,c=s*i,l=a>>>0,u=Math.floor(a/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+n,h=p>>>0,m=Math.floor(p/4294967296),g=u+f+m>>>0;t.writeFixed64(h,g)}function Po(t,e,r){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=e[n];t.writeTag(r,2);let o=t.startLengthDelimited(),s=t.pos;Eze(t,n,i),t.finishLengthDelimited(o,t.pos-s)}}function Eze(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;RS(t,r),t.finishLengthDelimited(n,t.pos-i)}function RS(t,e){let r=typeof e;if(r==="string")t.writeTag(1,2),t.writeString(e);else if(r==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(r==="number"){let n=e;Number.isInteger(n)&&n>=vze&&n<bze?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),i=t.pos;for(let o of e){t.writeTag(1,2);let s=t.startLengthDelimited(),a=t.pos;RS(t,o),t.finishLengthDelimited(s,t.pos-a)}t.finishLengthDelimited(n,t.pos-i)}else if(r==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),i=t.pos,o=e;for(let s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;let a=o[s];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(s),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;RS(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function Zp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),t.finishLengthDelimited(n,t.pos-i)}function Jp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&Po(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var vze,bze,kR=C(()=>{"use strict";vze=-(2**63),bze=2**63});function Tze(t){let e=t.length,r=0;for(let n=0;n<e;n++){let i=t.charCodeAt(n);i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4)}return r}var tl,MR=C(()=>{"use strict";DU();tl=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=Ia(r)}writeVarint(e){this.pos+=Ia(e)}writeSint32(e){this.pos+=Ia((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,r){this.pos+=8}writeBytes(e){this.pos+=Ia(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=Tze(e);this.pos+=Ia(r),this.pos+=r}}});function wze(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Yn(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==TS.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let i=t.startLengthDelimited(),o=t.pos;RS(t,e.body),t.finishLengthDelimited(i,t.pos-o)}e.attributes&&Po(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(Pa(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(Pa(e.spanContext.spanId))),t.writeTag(11,1),Yn(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function Aze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Zp(t,e,1);for(let o of r)t.writeTag(2,2),wze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Hne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Jp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;Aze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function xze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Wne(t){let e=xze(t),r=new tl;for(let[i,o]of e)r.writeTag(1,2),Hne(r,i,o);let n=new el(r.pos);for(let[i,o]of e)n.writeTag(1,2),Hne(n,i,o);return n.finish()}var Yne=C(()=>{"use strict";IR();LU();Gne();kR();MR()});var Oo,$R=C(()=>{"use strict";Oo=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,r=0,n=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(i&127)*Math.pow(2,r),r+=7,(i&128)===0){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let r=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,r}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:r}=this.readTag();if(r===4)break;this.skip(r)}break;case 4:break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function Rze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedLogRecords=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function Kne(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Rze(e.readBytes()):e.skip(i)}return r}var Zne=C(()=>{"use strict";$R()});var BU,Jne=C(()=>{"use strict";Yne();Zne();BU={serializeRequest:t=>Wne(t),deserializeResponse:t=>Kne(t)}});var Xne=C(()=>{"use strict";Jne()});var Oa,Qne=C(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(Oa||(Oa={}))});var qU,Si,eie=C(()=>{"use strict";(function(t){t.COUNTER="COUNTER",t.GAUGE="GAUGE",t.HISTOGRAM="HISTOGRAM",t.UP_DOWN_COUNTER="UP_DOWN_COUNTER",t.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",t.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",t.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(qU||(qU={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(Si||(Si={}))});var VU=C(()=>{"use strict";Qne();eie()});function nie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),r===ca.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&Po(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function Cze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.buckets.counts.length>0){t.writeTag(6,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(o,t.pos-s)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(o,t.pos-s)}e.attributes&&Po(t,e.attributes,9),i.min!==void 0&&(t.writeTag(11,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(12,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function tie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),r.length>0){t.writeTag(2,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(o,t.pos-s)}t.finishLengthDelimited(n,t.pos-i)}function Ize(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&Po(t,e.attributes,1),t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.scale!==0&&(t.writeTag(6,0),t.writeSint32(i.scale)),t.writeTag(7,1),t.writeFixed64(i.zeroCount>>>0,i.zeroCount/4294967296>>>0),t.writeTag(8,2),tie(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),tie(t,i.negative.offset,i.negative.bucketCounts),i.min!==void 0&&(t.writeTag(12,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(13,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function Pze(t,e){let r=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case Si.GAUGE:t.writeTag(5,2),Oze(t,e);break;case Si.SUM:t.writeTag(7,2),Nze(t,e);break;case Si.HISTOGRAM:t.writeTag(9,2),kze(t,e);break;case Si.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),Mze(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function Oze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),nie(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function Nze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),nie(t,o,e.descriptor.valueType);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(r,t.pos-n)}function kze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Cze(t,o);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function Mze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Ize(t,o);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function $ze(t,e){let r=t.startLengthDelimited(),n=t.pos;Zp(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),Pze(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function rie(t,e){let r=t.startLengthDelimited(),n=t.pos;Jp(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),$ze(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function GU(t){switch(t){case Oa.DELTA:return 1;case Oa.CUMULATIVE:return 2;default:return 0}}function iie(t){let e=new tl;e.writeTag(1,2),rie(e,t);let r=new el(e.pos);return r.writeTag(1,2),rie(r,t),r.finish()}var oie=C(()=>{"use strict";ve();VU();kR();MR();IR()});function Dze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedDataPoints=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function sie(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Dze(e.readBytes()):e.skip(i)}return r}var aie=C(()=>{"use strict";$R()});var HU,cie=C(()=>{"use strict";oie();aie();HU={serializeRequest:t=>iie(t),deserializeResponse:t=>sie(t)}});var lie=C(()=>{"use strict";cie()});function die(t,e){let r=t&255|Lze;return e&&(r|=Uze),r}function Fze(t,e){let r=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(r,t.pos-n)}function zze(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Yn(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&Po(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function jze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(Pa(i.traceId)),t.writeTag(2,2),t.writeBytes(Pa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.attributes&&Po(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let s=die(i.traceFlags,i.isRemote);s&&(t.writeTag(6,5),t.writeFixed32(s)),t.finishLengthDelimited(r,t.pos-n)}function Bze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(Pa(i.traceId)),t.writeTag(2,2),t.writeBytes(Pa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(Pa(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let s=e.kind==null?0:e.kind+1;s!==0&&(t.writeTag(6,0),t.writeVarint(s)),t.writeTag(7,1),Yn(t,e.startTime),t.writeTag(8,1),Yn(t,e.endTime),e.attributes&&Po(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),zze(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),jze(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),Fze(t,e.status);let a=die(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function qze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Zp(t,e,1);for(let o of r)t.writeTag(2,2),Bze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function uie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Jp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;qze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Vze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function fie(t){let e=Vze(t),r=new tl;for(let[i,o]of e)r.writeTag(1,2),uie(r,i,o);let n=new el(r.pos);for(let[i,o]of e)n.writeTag(1,2),uie(n,i,o);return n.finish()}var Lze,Uze,pie=C(()=>{"use strict";IR();LU();kR();MR();Lze=256,Uze=512});function Gze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedSpans=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function hie(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Gze(e.readBytes()):e.skip(i)}return r}var mie=C(()=>{"use strict";$R()});var WU,gie=C(()=>{"use strict";pie();mie();WU={serializeRequest:t=>fie(t),deserializeResponse:t=>hie(t)}});var _ie=C(()=>{"use strict";gie()});function Xp(t,e){let r={attributes:Na(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Qp(t){return{name:t.name,version:t.version}}function Na(t,e){return Object.keys(t).map(r=>YU(r,t[r],e))}function YU(t,e,r){return{key:t,value:CS(e,r)}}function CS(t,e){let r=typeof t;if(r==="string")return{stringValue:t};if(r==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(r==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=CS(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let o=0;o<n.length;o++)i[o]={key:n[o],value:CS(t[n[o]],e)};return{kvlistValue:{values:i}}}return{}}var DR=C(()=>{"use strict"});function yie(t,e){return{resourceLogs:Wze(t,e)}}function Hze(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${o}:${s}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function Wze(t,e){let r=Hze(t);return Array.from(r,([n,i])=>{let o=Xp(n,e);return{resource:o,scopeLogs:Array.from(i,([,s])=>({scope:Qp(s[0].instrumentationScope),logRecords:s.map(a=>Yze(a,e)),schemaUrl:s[0].instrumentationScope.schemaUrl})),schemaUrl:o.schemaUrl}})}function Yze(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:CS(t.body,e),eventName:t.eventName,attributes:Kze(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function Kze(t,e){return Object.keys(t).map(r=>YU(r,t[r],e))}var Sie=C(()=>{"use strict";DR()});function Zze(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Jze(t){return Zze(t).toString()}function Eie(t){return t}var Xze,eh,LR=C(()=>{"use strict";ap();Xze=typeof BigInt<"u"?Jze:oA;eh={encodeHrTime:Xze,encodeSpanContext:Eie,encodeOptionalSpanContext:Eie,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=String.fromCharCode(t[r]);return btoa(e.join(""))}}});var KU,vie=C(()=>{"use strict";Sie();LR();ve();KU={serializeRequest:t=>{let e=yie(t,eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var bie=C(()=>{"use strict";vie()});var IS,Tie=C(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(IS||(IS={}))});function Qze(t,e){let r=Xp(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:eje(t.scopeMetrics,e)}}function eje(t,e){return Array.from(t.map(r=>({scope:Qp(r.scope),metrics:r.metrics.map(n=>tje(n,e)),schemaUrl:r.scope.schemaUrl})))}function tje(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=oje(t.aggregationTemporality);switch(t.dataPointType){case Si.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:wie(t,e)};break;case Si.GAUGE:r.gauge={dataPoints:wie(t,e)};break;case Si.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:nje(t,e)};break;case Si.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:ije(t,e)};break}return r}function rje(t,e,r){let n={attributes:Na(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ca.INT:n.asInt=t.value;break;case ca.DOUBLE:n.asDouble=t.value;break}return n}function wie(t,e){return t.dataPoints.map(r=>rje(r,t.descriptor.valueType,e))}function nje(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Na(r.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function ije(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Na(r.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function oje(t){switch(t){case Oa.DELTA:return IS.AGGREGATION_TEMPORALITY_DELTA;case Oa.CUMULATIVE:return IS.AGGREGATION_TEMPORALITY_CUMULATIVE}}function Aie(t,e){return{resourceMetrics:t.map(r=>Qze(r,e))}}var xie=C(()=>{"use strict";ve();VU();Tie();DR()});var ZU,Rie=C(()=>{"use strict";xie();LR();ve();ZU={serializeRequest:t=>{let e=Aie([t],eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var Cie=C(()=>{"use strict";Rie()});function Iie(t,e){let r=t&255|sje;return e&&(r|=aje),r}function cje(t,e){let r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:Na(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>uje(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>lje(o,e)),droppedLinksCount:t.droppedLinksCount,flags:Iie(r.traceFlags,t.parentSpanContext?.isRemote)}}function lje(t,e){return{attributes:t.attributes?Na(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:Iie(t.context.traceFlags,t.context.isRemote)}}function uje(t,e){return{attributes:t.attributes?Na(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function Pie(t,e){return{resourceSpans:fje(t,e)}}function dje(t){let e=new Map;for(let r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));let i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function fje(t,e){let r=dje(t),n=[],i=r.entries(),o=i.next();for(;!o.done;){let[s,a]=o.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>cje(m,e));c.push({scope:Qp(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Xp(s,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),o=i.next()}return n}var sje,aje,Oie=C(()=>{"use strict";DR();sje=256,aje=512});var JU,Nie=C(()=>{"use strict";Oie();LR();ve();JU={serializeRequest:t=>{let e=Pie(t,eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var kie=C(()=>{"use strict";Nie()});var Mie={};jr(Mie,{JsonLogsSerializer:()=>KU,JsonMetricsSerializer:()=>ZU,JsonTraceSerializer:()=>JU,ProtobufLogsSerializer:()=>BU,ProtobufMetricsSerializer:()=>HU,ProtobufTraceSerializer:()=>WU});var $ie=C(()=>{"use strict";Xne();lie();_ie();bie();Cie();kie()});var Lie=y(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});UR.OTLPTraceExporter=void 0;var Die=Dne(),pje=($ie(),An(Mie)),hje=(gA(),An(mA)),XU=class extends hje.OTLPExporterBase{constructor(e={}){super((0,Die.createOtlpGrpcExportDelegate)((0,Die.convertLegacyOtlpGrpcOptions)(e,"TRACES"),pje.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};UR.OTLPTraceExporter=XU});var Uie=y(FR=>{"use strict";Object.defineProperty(FR,"__esModule",{value:!0});FR.OTLPTraceExporter=void 0;var mje=Lie();Object.defineProperty(FR,"OTLPTraceExporter",{enumerable:!0,get:function(){return mje.OTLPTraceExporter}})});var ase=y(($kt,sse)=>{"use strict";sse.exports=ose;ose.sync=G2e;var nse=Z("fs");function V2e(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function ise(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:V2e(e,r)}function ose(t,e,r){nse.stat(t,function(n,i){r(n,n?!1:ise(i,t,e))})}function G2e(t,e){return ise(nse.statSync(t),t,e)}});var fse=y((Dkt,dse)=>{"use strict";dse.exports=lse;lse.sync=H2e;var cse=Z("fs");function lse(t,e,r){cse.stat(t,function(n,i){r(n,n?!1:use(i,e))})}function H2e(t,e){return use(cse.statSync(t),e)}function use(t,e){return t.isFile()&&W2e(t,e)}function W2e(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var hse=y((Ukt,pse)=>{"use strict";var Lkt=Z("fs"),g0;process.platform==="win32"||global.TESTING_WINDOWS?g0=ase():g0=fse();pse.exports=kF;kF.sync=Y2e;function kF(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){kF(t,e||{},function(o,s){o?i(o):n(s)})})}g0(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Y2e(t,e){try{return g0.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vse=y((Fkt,Ese)=>{"use strict";var ah=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",mse=Z("path"),K2e=ah?";":":",gse=hse(),_se=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),yse=(t,e)=>{let r=e.colon||K2e,n=t.match(/\//)||ah&&t.match(/\\/)?[""]:[...ah?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=ah?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=ah?i.split(r):[""];return ah&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},Sse=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=yse(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(_se(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=mse.join(p,t),m=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+h:h;u(c(m,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let h=i[d];gse(l+h,{pathExt:o},(m,g)=>{if(!m&&g)if(e.all)s.push(l+h);else return f(l+h);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Z2e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=yse(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=mse.join(c,t),u=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let f=u+n[d];try{if(gse.sync(f,{pathExt:i}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw _se(t)};Ese.exports=Sse;Sse.sync=Z2e});var Tse=y((zkt,MF)=>{"use strict";var bse=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};MF.exports=bse;MF.exports.default=bse});var Rse=y((jkt,xse)=>{"use strict";var wse=Z("path"),J2e=vse(),X2e=Tse();function Ase(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=J2e.sync(t.command,{path:r[X2e({env:r})],pathExt:e?wse.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=wse.resolve(i?t.options.cwd:"",s)),s}function Q2e(t){return Ase(t)||Ase(t,!0)}xse.exports=Q2e});var Cse=y((Bkt,DF)=>{"use strict";var $F=/([()\][%!^"`<>&|;, *?])/g;function eqe(t){return t=t.replace($F,"^$1"),t}function tqe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($F,"^$1"),e&&(t=t.replace($F,"^$1")),t}DF.exports.command=eqe;DF.exports.argument=tqe});var Pse=y((qkt,Ise)=>{"use strict";Ise.exports=/^#!(.*)/});var Nse=y((Vkt,Ose)=>{"use strict";var rqe=Pse();Ose.exports=(t="")=>{let e=t.match(rqe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Mse=y((Gkt,kse)=>{"use strict";var LF=Z("fs"),nqe=Nse();function iqe(t){let r=Buffer.alloc(150),n;try{n=LF.openSync(t,"r"),LF.readSync(n,r,0,150,0),LF.closeSync(n)}catch{}return nqe(r.toString())}kse.exports=iqe});var Use=y((Hkt,Lse)=>{"use strict";var oqe=Z("path"),$se=Rse(),Dse=Cse(),sqe=Mse(),aqe=process.platform==="win32",cqe=/\.(?:com|exe)$/i,lqe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uqe(t){t.file=$se(t);let e=t.file&&sqe(t.file);return e?(t.args.unshift(t.file),t.command=e,$se(t)):t.file}function dqe(t){if(!aqe)return t;let e=uqe(t),r=!cqe.test(e);if(t.options.forceShell||r){let n=lqe.test(e);t.command=oqe.normalize(t.command),t.command=Dse.command(t.command),t.args=t.args.map(o=>Dse.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function fqe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:dqe(n)}Lse.exports=fqe});var jse=y((Wkt,zse)=>{"use strict";var UF=process.platform==="win32";function FF(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function pqe(t,e){if(!UF)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=Fse(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function Fse(t,e){return UF&&t===1&&!e.file?FF(e.original,"spawn"):null}function hqe(t,e){return UF&&t===1&&!e.file?FF(e.original,"spawnSync"):null}zse.exports={hookChildProcess:pqe,verifyENOENT:Fse,verifyENOENTSync:hqe,notFoundError:FF}});var Vse=y((Ykt,ch)=>{"use strict";var Bse=Z("child_process"),zF=Use(),jF=jse();function qse(t,e,r){let n=zF(t,e,r),i=Bse.spawn(n.command,n.args,n.options);return jF.hookChildProcess(i,n),i}function mqe(t,e,r){let n=zF(t,e,r),i=Bse.spawnSync(n.command,n.args,n.options);return i.error=i.error||jF.verifyENOENTSync(i.status,n),i}ch.exports=qse;ch.exports.spawn=qse;ch.exports.sync=mqe;ch.exports._parse=zF;ch.exports._enoent=jF});var eb=y(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.regexpCode=pt.getEsmExportName=pt.getProperty=pt.safeStringify=pt.stringify=pt.strConcat=pt.addCodeArg=pt.str=pt._=pt.nil=pt._Code=pt.Name=pt.IDENTIFIER=pt._CodeOrName=void 0;var Xv=class{};pt._CodeOrName=Xv;pt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var hf=class extends Xv{constructor(e){if(super(),!pt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pt.Name=hf;var no=class extends Xv{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof hf&&(r[n.str]=(r[n.str]||0)+1),r),{})}};pt._Code=no;pt.nil=new no("");function x_e(t,...e){let r=[t[0]],n=0;for(;n<e.length;)pH(r,e[n]),r.push(t[++n]);return new no(r)}pt._=x_e;var fH=new no("+");function R_e(t,...e){let r=[Qv(t[0])],n=0;for(;n<e.length;)r.push(fH),pH(r,e[n]),r.push(fH,Qv(t[++n]));return AXe(r),new no(r)}pt.str=R_e;function pH(t,e){e instanceof no?t.push(...e._items):e instanceof hf?t.push(e):t.push(CXe(e))}pt.addCodeArg=pH;function AXe(t){let e=1;for(;e<t.length-1;){if(t[e]===fH){let r=xXe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function xXe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof hf||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof hf))return`"${t}${e.slice(1)}`}function RXe(t,e){return e.emptyStr()?t:t.emptyStr()?e:R_e`${t}${e}`}pt.strConcat=RXe;function CXe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Qv(Array.isArray(t)?t.join(","):t)}function IXe(t){return new no(Qv(t))}pt.stringify=IXe;function Qv(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pt.safeStringify=Qv;function PXe(t){return typeof t=="string"&&pt.IDENTIFIER.test(t)?new no(`.${t}`):x_e`[${t}]`}pt.getProperty=PXe;function OXe(t){if(typeof t=="string"&&pt.IDENTIFIER.test(t))return new no(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pt.getEsmExportName=OXe;function NXe(t){return new no(t.toString())}pt.regexpCode=NXe});var gH=y(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.ValueScope=ii.ValueScopeName=ii.Scope=ii.varKinds=ii.UsedValueState=void 0;var ni=eb(),hH=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},AO;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(AO||(ii.UsedValueState=AO={}));ii.varKinds={const:new ni.Name("const"),let:new ni.Name("let"),var:new ni.Name("var")};var xO=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ni.Name?e:this.name(e)}name(e){return new ni.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};ii.Scope=xO;var RO=class extends ni.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ni._)`.${new ni.Name(r)}[${n}]`}};ii.ValueScopeName=RO;var kXe=(0,ni._)`\n`,mH=class extends xO{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?kXe:ni.nil}}get(){return this._scope}name(e){return new RO(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ni._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ni.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,AO.Started);let u=r(l);if(u){let d=this.opts.es5?ii.varKinds.var:ii.varKinds.const;o=(0,ni._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,ni._)`${o}${u}${this.opts._n}`;else throw new hH(l);c.set(l,AO.Completed)})}return o}};ii.ValueScope=mH});var Ze=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.or=et.and=et.not=et.CodeGen=et.operators=et.varKinds=et.ValueScopeName=et.ValueScope=et.Scope=et.Name=et.regexpCode=et.stringify=et.getProperty=et.nil=et.strConcat=et.str=et._=void 0;var st=eb(),Yo=gH(),tu=eb();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return tu._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return tu.str}});Object.defineProperty(et,"strConcat",{enumerable:!0,get:function(){return tu.strConcat}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return tu.nil}});Object.defineProperty(et,"getProperty",{enumerable:!0,get:function(){return tu.getProperty}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return tu.stringify}});Object.defineProperty(et,"regexpCode",{enumerable:!0,get:function(){return tu.regexpCode}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return tu.Name}});var OO=gH();Object.defineProperty(et,"Scope",{enumerable:!0,get:function(){return OO.Scope}});Object.defineProperty(et,"ValueScope",{enumerable:!0,get:function(){return OO.ValueScope}});Object.defineProperty(et,"ValueScopeName",{enumerable:!0,get:function(){return OO.ValueScopeName}});Object.defineProperty(et,"varKinds",{enumerable:!0,get:function(){return OO.varKinds}});et.operators={GT:new st._Code(">"),GTE:new st._Code(">="),LT:new st._Code("<"),LTE:new st._Code("<="),EQ:new st._Code("==="),NEQ:new st._Code("!=="),NOT:new st._Code("!"),OR:new st._Code("||"),AND:new st._Code("&&"),ADD:new st._Code("+")};var mc=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_H=class extends mc{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Yo.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=$g(this.rhs,e,r)),this}get names(){return this.rhs instanceof st._CodeOrName?this.rhs.names:{}}},CO=class extends mc{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof st.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$g(this.rhs,e,r),this}get names(){let e=this.lhs instanceof st.Name?{}:{...this.lhs.names};return PO(e,this.rhs)}},yH=class extends CO{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},SH=class extends mc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},EH=class extends mc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},vH=class extends mc{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},bH=class extends mc{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=$g(this.code,e,r),this}get names(){return this.code instanceof st._CodeOrName?this.code.names:{}}},tb=class extends mc{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(MXe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_f(e,r.names),{})}},gc=class extends tb{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},TH=class extends tb{},Mg=class extends gc{};Mg.kind="else";var mf=class t extends gc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Mg(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(C_e(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=$g(this.condition,e,r),this}get names(){let e=super.names;return PO(e,this.condition),this.else&&_f(e,this.else.names),e}};mf.kind="if";var gf=class extends gc{};gf.kind="for";var wH=class extends gf{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=$g(this.iteration,e,r),this}get names(){return _f(super.names,this.iteration.names)}},AH=class extends gf{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Yo.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=PO(super.names,this.from);return PO(e,this.to)}},IO=class extends gf{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=$g(this.iterable,e,r),this}get names(){return _f(super.names,this.iterable.names)}},rb=class extends gc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rb.kind="func";var nb=class extends tb{render(e){return"return "+super.render(e)}};nb.kind="return";var xH=class extends gc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&_f(e,this.catch.names),this.finally&&_f(e,this.finally.names),e}},ib=class extends gc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ib.kind="catch";var ob=class extends gc{render(e){return"finally"+super.render(e)}};ob.kind="finally";var RH=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Yo.Scope({parent:e}),this._nodes=[new TH]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new _H(e,o,n)),o}const(e,r,n){return this._def(Yo.varKinds.const,e,r,n)}let(e,r,n){return this._def(Yo.varKinds.let,e,r,n)}var(e,r,n){return this._def(Yo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new CO(e,r,n))}add(e,r){return this._leafNode(new yH(e,et.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==st.nil&&this._leafNode(new bH(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,st.addCodeArg)(r,i));return r.push("}"),new st._Code(r)}if(e,r,n){if(this._blockNode(new mf(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new mf(e))}else(){return this._elseNode(new Mg)}endIf(){return this._endBlockNode(mf,Mg)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wH(e),r)}forRange(e,r,n,i,o=this.opts.es5?Yo.varKinds.var:Yo.varKinds.let){let s=this._scope.toName(e);return this._for(new AH(o,s,r,n),()=>i(s))}forOf(e,r,n,i=Yo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof st.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,st._)`${s}.length`,a=>{this.var(o,(0,st._)`${s}[${a}]`),n(o)})}return this._for(new IO("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?Yo.varKinds.var:Yo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,st._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new IO("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(gf)}label(e){return this._leafNode(new SH(e))}break(e){return this._leafNode(new EH(e))}return(e){let r=new nb;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nb)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xH;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new ib(o),r(o)}return n&&(this._currNode=i.finally=new ob,this.code(n)),this._endBlockNode(ib,ob)}throw(e){return this._leafNode(new vH(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=st.nil,n,i){return this._blockNode(new rb(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(rb)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof mf))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};et.CodeGen=RH;function _f(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function PO(t,e){return e instanceof st._CodeOrName?_f(t,e.names):t}function $g(t,e,r){if(t instanceof st.Name)return n(t);if(!i(t))return t;return new st._Code(t._items.reduce((o,s)=>(s instanceof st.Name&&(s=n(s)),s instanceof st._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof st._Code&&o._items.some(s=>s instanceof st.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function MXe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function C_e(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,st._)`!${CH(t)}`}et.not=C_e;var $Xe=I_e(et.operators.AND);function DXe(...t){return t.reduce($Xe)}et.and=DXe;var LXe=I_e(et.operators.OR);function UXe(...t){return t.reduce(LXe)}et.or=UXe;function I_e(t){return(e,r)=>e===st.nil?r:r===st.nil?e:(0,st._)`${CH(e)} ${t} ${CH(r)}`}function CH(t){return t instanceof st.Name?t:(0,st._)`(${t})`}});var lt=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.checkStrictMode=rt.getErrorPath=rt.Type=rt.useFunc=rt.setEvaluated=rt.evaluatedPropsToName=rt.mergeEvaluated=rt.eachItem=rt.unescapeJsonPointer=rt.escapeJsonPointer=rt.escapeFragment=rt.unescapeFragment=rt.schemaRefOrVal=rt.schemaHasRulesButRef=rt.schemaHasRules=rt.checkUnknownRules=rt.alwaysValidSchema=rt.toHash=void 0;var Ut=Ze(),FXe=eb();function zXe(t){let e={};for(let r of t)e[r]=!0;return e}rt.toHash=zXe;function jXe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(N_e(t,e),!k_e(e,t.self.RULES.all))}rt.alwaysValidSchema=jXe;function N_e(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||D_e(t,`unknown keyword: "${o}"`)}rt.checkUnknownRules=N_e;function k_e(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}rt.schemaHasRules=k_e;function BXe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}rt.schemaHasRulesButRef=BXe;function qXe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ut._)`${r}`}return(0,Ut._)`${t}${e}${(0,Ut.getProperty)(n)}`}rt.schemaRefOrVal=qXe;function VXe(t){return M_e(decodeURIComponent(t))}rt.unescapeFragment=VXe;function GXe(t){return encodeURIComponent(PH(t))}rt.escapeFragment=GXe;function PH(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}rt.escapeJsonPointer=PH;function M_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}rt.unescapeJsonPointer=M_e;function HXe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}rt.eachItem=HXe;function P_e({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof Ut.Name?(o instanceof Ut.Name?t(i,o,s):e(i,o,s),s):o instanceof Ut.Name?(e(i,s,o),o):r(o,s);return a===Ut.Name&&!(c instanceof Ut.Name)?n(i,c):c}}rt.mergeEvaluated={props:P_e({mergeNames:(t,e,r)=>t.if((0,Ut._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Ut._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Ut._)`${r} || {}`).code((0,Ut._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Ut._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Ut._)`${r} || {}`),OH(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:$_e}),items:P_e({mergeNames:(t,e,r)=>t.if((0,Ut._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Ut._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Ut._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Ut._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function $_e(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Ut._)`{}`);return e!==void 0&&OH(t,r,e),r}rt.evaluatedPropsToName=$_e;function OH(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Ut._)`${e}${(0,Ut.getProperty)(n)}`,!0))}rt.setEvaluated=OH;var O_e={};function WXe(t,e){return t.scopeValue("func",{ref:e,code:O_e[e.code]||(O_e[e.code]=new FXe._Code(e.code))})}rt.useFunc=WXe;var IH;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(IH||(rt.Type=IH={}));function YXe(t,e,r){if(t instanceof Ut.Name){let n=e===IH.Num;return r?n?(0,Ut._)`"[" + ${t} + "]"`:(0,Ut._)`"['" + ${t} + "']"`:n?(0,Ut._)`"/" + ${t}`:(0,Ut._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ut.getProperty)(t).toString():"/"+PH(t)}rt.getErrorPath=YXe;function D_e(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}rt.checkStrictMode=D_e});var _c=y(NH=>{"use strict";Object.defineProperty(NH,"__esModule",{value:!0});var gn=Ze(),KXe={data:new gn.Name("data"),valCxt:new gn.Name("valCxt"),instancePath:new gn.Name("instancePath"),parentData:new gn.Name("parentData"),parentDataProperty:new gn.Name("parentDataProperty"),rootData:new gn.Name("rootData"),dynamicAnchors:new gn.Name("dynamicAnchors"),vErrors:new gn.Name("vErrors"),errors:new gn.Name("errors"),this:new gn.Name("this"),self:new gn.Name("self"),scope:new gn.Name("scope"),json:new gn.Name("json"),jsonPos:new gn.Name("jsonPos"),jsonLen:new gn.Name("jsonLen"),jsonPart:new gn.Name("jsonPart")};NH.default=KXe});var sb=y(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.extendErrors=_n.resetErrorsCount=_n.reportExtraError=_n.reportError=_n.keyword$DataError=_n.keywordError=void 0;var ut=Ze(),NO=lt(),Ln=_c();_n.keywordError={message:({keyword:t})=>(0,ut.str)`must pass "${t}" keyword validation`};_n.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ut.str)`"${t}" keyword must be ${e} ($data)`:(0,ut.str)`"${t}" keyword is invalid ($data)`};function ZXe(t,e=_n.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=F_e(t,e,r);n??(s||a)?L_e(o,c):U_e(i,(0,ut._)`[${c}]`)}_n.reportError=ZXe;function JXe(t,e=_n.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=F_e(t,e,r);L_e(i,a),o||s||U_e(n,Ln.default.vErrors)}_n.reportExtraError=JXe;function XXe(t,e){t.assign(Ln.default.errors,e),t.if((0,ut._)`${Ln.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ut._)`${Ln.default.vErrors}.length`,e),()=>t.assign(Ln.default.vErrors,null)))}_n.resetErrorsCount=XXe;function QXe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Ln.default.errors,a=>{t.const(s,(0,ut._)`${Ln.default.vErrors}[${a}]`),t.if((0,ut._)`${s}.instancePath === undefined`,()=>t.assign((0,ut._)`${s}.instancePath`,(0,ut.strConcat)(Ln.default.instancePath,o.errorPath))),t.assign((0,ut._)`${s}.schemaPath`,(0,ut.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ut._)`${s}.schema`,r),t.assign((0,ut._)`${s}.data`,n))})}_n.extendErrors=QXe;function L_e(t,e){let r=t.const("err",e);t.if((0,ut._)`${Ln.default.vErrors} === null`,()=>t.assign(Ln.default.vErrors,(0,ut._)`[${r}]`),(0,ut._)`${Ln.default.vErrors}.push(${r})`),t.code((0,ut._)`${Ln.default.errors}++`)}function U_e(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ut._)`new ${t.ValidationError}(${e})`):(r.assign((0,ut._)`${n}.errors`,e),r.return(!1))}var yf={keyword:new ut.Name("keyword"),schemaPath:new ut.Name("schemaPath"),params:new ut.Name("params"),propertyName:new ut.Name("propertyName"),message:new ut.Name("message"),schema:new ut.Name("schema"),parentSchema:new ut.Name("parentSchema")};function F_e(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ut._)`{}`:eQe(t,e,r)}function eQe(t,e,r={}){let{gen:n,it:i}=t,o=[tQe(i,r),rQe(t,r)];return nQe(t,e,o),n.object(...o)}function tQe({errorPath:t},{instancePath:e}){let r=e?(0,ut.str)`${t}${(0,NO.getErrorPath)(e,NO.Type.Str)}`:t;return[Ln.default.instancePath,(0,ut.strConcat)(Ln.default.instancePath,r)]}function rQe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ut.str)`${e}/${t}`;return r&&(i=(0,ut.str)`${i}${(0,NO.getErrorPath)(r,NO.Type.Str)}`),[yf.schemaPath,i]}function nQe(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([yf.keyword,i],[yf.params,typeof e=="function"?e(t):e||(0,ut._)`{}`]),c.messages&&n.push([yf.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([yf.schema,s],[yf.parentSchema,(0,ut._)`${u}${d}`],[Ln.default.data,o]),l&&n.push([yf.propertyName,l])}});var j_e=y(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.boolOrEmptySchema=Dg.topBoolOrEmptySchema=void 0;var iQe=sb(),oQe=Ze(),sQe=_c(),aQe={message:"boolean schema is false"};function cQe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?z_e(t,!1):typeof r=="object"&&r.$async===!0?e.return(sQe.default.data):(e.assign((0,oQe._)`${n}.errors`,null),e.return(!0))}Dg.topBoolOrEmptySchema=cQe;function lQe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),z_e(t)):r.var(e,!0)}Dg.boolOrEmptySchema=lQe;function z_e(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,iQe.reportError)(i,aQe,void 0,e)}});var kH=y(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.getRules=Lg.isJSONType=void 0;var uQe=["string","number","integer","boolean","null","object","array"],dQe=new Set(uQe);function fQe(t){return typeof t=="string"&&dQe.has(t)}Lg.isJSONType=fQe;function pQe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Lg.getRules=pQe});var MH=y(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.shouldUseRule=ru.shouldUseGroup=ru.schemaHasRulesForType=void 0;function hQe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&B_e(t,n)}ru.schemaHasRulesForType=hQe;function B_e(t,e){return e.rules.some(r=>q_e(t,r))}ru.shouldUseGroup=B_e;function q_e(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ru.shouldUseRule=q_e});var ab=y(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.reportTypeError=yn.checkDataTypes=yn.checkDataType=yn.coerceAndCheckDataType=yn.getJSONTypes=yn.getSchemaTypes=yn.DataType=void 0;var mQe=kH(),gQe=MH(),_Qe=sb(),Ye=Ze(),V_e=lt(),Ug;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ug||(yn.DataType=Ug={}));function yQe(t){let e=G_e(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}yn.getSchemaTypes=yQe;function G_e(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(mQe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}yn.getJSONTypes=G_e;function SQe(t,e){let{gen:r,data:n,opts:i}=t,o=EQe(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,gQe.schemaHasRulesForType)(t,e[0]));if(s){let a=DH(e,n,i.strictNumbers,Ug.Wrong);r.if(a,()=>{o.length?vQe(t,e,o):LH(t)})}return s}yn.coerceAndCheckDataType=SQe;var H_e=new Set(["string","number","integer","boolean","null"]);function EQe(t,e){return e?t.filter(r=>H_e.has(r)||e==="array"&&r==="array"):[]}function vQe(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Ye._)`typeof ${i}`),a=n.let("coerced",(0,Ye._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ye._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ye._)`${i}[0]`).assign(s,(0,Ye._)`typeof ${i}`).if(DH(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Ye._)`${a} !== undefined`);for(let l of r)(H_e.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),LH(t),n.endIf(),n.if((0,Ye._)`${a} !== undefined`,()=>{n.assign(i,a),bQe(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Ye._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Ye._)`"" + ${i}`).elseIf((0,Ye._)`${i} === null`).assign(a,(0,Ye._)`""`);return;case"number":n.elseIf((0,Ye._)`${s} == "boolean" || ${i} === null
|
|
25
|
-
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,
|
|
26
|
-
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,
|
|
27
|
-
|| ${s} === "boolean" || ${i} === null`).assign(a,(0,Ye._)`[${i}]`)}}}function bQe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ye._)`${e} !== undefined`,()=>t.assign((0,Ye._)`${e}[${r}]`,n))}function $H(t,e,r,n=Ug.Correct){let i=n===Ug.Correct?Ye.operators.EQ:Ye.operators.NEQ,o;switch(t){case"null":return(0,Ye._)`${e} ${i} null`;case"array":o=(0,Ye._)`Array.isArray(${e})`;break;case"object":o=(0,Ye._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Ye._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Ye._)`typeof ${e} ${i} ${t}`}return n===Ug.Correct?o:(0,Ye.not)(o);function s(a=Ye.nil){return(0,Ye.and)((0,Ye._)`typeof ${e} == "number"`,a,r?(0,Ye._)`isFinite(${e})`:Ye.nil)}}yn.checkDataType=$H;function DH(t,e,r,n){if(t.length===1)return $H(t[0],e,r,n);let i,o=(0,V_e.toHash)(t);if(o.array&&o.object){let s=(0,Ye._)`typeof ${e} != "object"`;i=o.null?s:(0,Ye._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Ye.nil;o.number&&delete o.integer;for(let s in o)i=(0,Ye.and)(i,$H(s,e,r,n));return i}yn.checkDataTypes=DH;var TQe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ye._)`{type: ${t}}`:(0,Ye._)`{type: ${e}}`};function LH(t){let e=wQe(t);(0,_Qe.reportError)(e,TQe)}yn.reportTypeError=LH;function wQe(t){let{gen:e,data:r,schema:n}=t,i=(0,V_e.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Y_e=y(kO=>{"use strict";Object.defineProperty(kO,"__esModule",{value:!0});kO.assignDefaults=void 0;var Fg=Ze(),AQe=lt();function xQe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)W_e(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>W_e(t,o,i.default))}kO.assignDefaults=xQe;function W_e(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Fg._)`${o}${(0,Fg.getProperty)(e)}`;if(i){(0,AQe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Fg._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Fg._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Fg._)`${a} = ${(0,Fg.stringify)(r)}`)}});var io=y(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateUnion=Pt.validateArray=Pt.usePattern=Pt.callValidateCode=Pt.schemaProperties=Pt.allSchemaProperties=Pt.noPropertyInData=Pt.propertyInData=Pt.isOwnProperty=Pt.hasPropFunc=Pt.reportMissingProp=Pt.checkMissingProp=Pt.checkReportMissingProp=void 0;var Bt=Ze(),UH=lt(),nu=_c(),RQe=lt();function CQe(t,e){let{gen:r,data:n,it:i}=t;r.if(zH(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Bt._)`${e}`},!0),t.error()})}Pt.checkReportMissingProp=CQe;function IQe({gen:t,data:e,it:{opts:r}},n,i){return(0,Bt.or)(...n.map(o=>(0,Bt.and)(zH(t,e,o,r.ownProperties),(0,Bt._)`${i} = ${o}`)))}Pt.checkMissingProp=IQe;function PQe(t,e){t.setParams({missingProperty:e},!0),t.error()}Pt.reportMissingProp=PQe;function K_e(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Bt._)`Object.prototype.hasOwnProperty`})}Pt.hasPropFunc=K_e;function FH(t,e,r){return(0,Bt._)`${K_e(t)}.call(${e}, ${r})`}Pt.isOwnProperty=FH;function OQe(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} !== undefined`;return n?(0,Bt._)`${i} && ${FH(t,e,r)}`:i}Pt.propertyInData=OQe;function zH(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} === undefined`;return n?(0,Bt.or)(i,(0,Bt.not)(FH(t,e,r))):i}Pt.noPropertyInData=zH;function Z_e(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pt.allSchemaProperties=Z_e;function NQe(t,e){return Z_e(e).filter(r=>!(0,UH.alwaysValidSchema)(t,e[r]))}Pt.schemaProperties=NQe;function kQe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,Bt._)`${t}, ${e}, ${n}${i}`:e,d=[[nu.default.instancePath,(0,Bt.strConcat)(nu.default.instancePath,o)],[nu.default.parentData,s.parentData],[nu.default.parentDataProperty,s.parentDataProperty],[nu.default.rootData,nu.default.rootData]];s.opts.dynamicRef&&d.push([nu.default.dynamicAnchors,nu.default.dynamicAnchors]);let f=(0,Bt._)`${u}, ${r.object(...d)}`;return c!==Bt.nil?(0,Bt._)`${a}.call(${c}, ${f})`:(0,Bt._)`${a}(${f})`}Pt.callValidateCode=kQe;var MQe=(0,Bt._)`new RegExp`;function $Qe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Bt._)`${i.code==="new RegExp"?MQe:(0,RQe.useFunc)(t,i)}(${r}, ${n})`})}Pt.usePattern=$Qe;function DQe(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Bt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:UH.Type.Num},o),e.if((0,Bt.not)(o),a)})}}Pt.validateArray=DQe;function LQe(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,UH.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Bt._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Bt.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pt.validateUnion=LQe});var Q_e=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.validateKeywordUsage=Zs.validSchemaType=Zs.funcKeywordCode=Zs.macroKeywordCode=void 0;var Un=Ze(),Sf=_c(),UQe=io(),FQe=sb();function zQe(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=X_e(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Un.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Zs.macroKeywordCode=zQe;function jQe(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;qQe(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=X_e(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)m(),e.modifying&&J_e(t),g(()=>t.error());else{let _=e.async?p():h();e.modifying&&J_e(t),g(()=>BQe(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>m((0,Un._)`await `),b=>n.assign(d,!1).if((0,Un._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Un._)`${b}.errors`),()=>n.throw(b))),_}function h(){let _=(0,Un._)`${u}.errors`;return n.assign(_,null),m(Un.nil),_}function m(_=e.async?(0,Un._)`await `:Un.nil){let b=c.opts.passContext?Sf.default.this:Sf.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Un._)`${_}${(0,UQe.callValidateCode)(t,u,b,T)}`,e.modifying)}function g(_){var b;n.if((0,Un.not)((b=e.valid)!==null&&b!==void 0?b:d),_)}}Zs.funcKeywordCode=jQe;function J_e(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Un._)`${n.parentData}[${n.parentDataProperty}]`))}function BQe(t,e){let{gen:r}=t;r.if((0,Un._)`Array.isArray(${e})`,()=>{r.assign(Sf.default.vErrors,(0,Un._)`${Sf.default.vErrors} === null ? ${e} : ${Sf.default.vErrors}.concat(${e})`).assign(Sf.default.errors,(0,Un._)`${Sf.default.vErrors}.length`),(0,FQe.extendErrors)(t)},()=>t.error())}function qQe({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function X_e(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Un.stringify)(r)})}function VQe(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Zs.validSchemaType=VQe;function GQe({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Zs.validateKeywordUsage=GQe});var tye=y(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.extendSubschemaMode=iu.extendSubschemaData=iu.getSubschema=void 0;var Js=Ze(),eye=lt();function HQe(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Js._)`${t.schemaPath}${(0,Js.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Js._)`${t.schemaPath}${(0,Js.getProperty)(e)}${(0,Js.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,eye.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}iu.getSubschema=HQe;function WQe(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Js._)`${e.data}${(0,Js.getProperty)(r)}`,!0);c(f),t.errorPath=(0,Js.str)`${l}${(0,eye.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Js._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Js.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}iu.extendSubschemaData=WQe;function YQe(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}iu.extendSubschemaMode=YQe});var jH=y((Wnr,rye)=>{"use strict";rye.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var iye=y((Ynr,nye)=>{"use strict";var ou=nye.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};MO(e,n,i,t,"",t)};ou.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ou.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ou.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ou.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function MO(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ou.arrayKeywords)for(var f=0;f<d.length;f++)MO(t,e,r,d[f],i+"/"+u+"/"+f,o,i,u,n,f)}else if(u in ou.propsKeywords){if(d&&typeof d=="object")for(var p in d)MO(t,e,r,d[p],i+"/"+u+"/"+KQe(p),o,i,u,n,p)}else(u in ou.keywords||t.allKeys&&!(u in ou.skipKeywords))&&MO(t,e,r,d,i+"/"+u,o,i,u,n)}r(n,i,o,s,a,c,l)}}function KQe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var cb=y(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.getSchemaRefs=oi.resolveUrl=oi.normalizeId=oi._getFullPath=oi.getFullPath=oi.inlineRef=void 0;var ZQe=lt(),JQe=jH(),XQe=iye(),QQe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function e7e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!BH(t):e?oye(t)<=e:!1}oi.inlineRef=e7e;var t7e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function BH(t){for(let e in t){if(t7e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(BH)||typeof r=="object"&&BH(r))return!0}return!1}function oye(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!QQe.has(r)&&(typeof t[r]=="object"&&(0,ZQe.eachItem)(t[r],n=>e+=oye(n)),e===1/0))return 1/0}return e}function sye(t,e="",r){r!==!1&&(e=zg(e));let n=t.parse(e);return aye(t,n)}oi.getFullPath=sye;function aye(t,e){return t.serialize(e).split("#")[0]+"#"}oi._getFullPath=aye;var r7e=/#\/?$/;function zg(t){return t?t.replace(r7e,""):""}oi.normalizeId=zg;function n7e(t,e,r){return r=zg(r),t.resolve(e,r)}oi.resolveUrl=n7e;var i7e=/^[a-z_][-a-z0-9._]*$/i;function o7e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=zg(t[r]||e),o={"":i},s=sye(n,i,!1),a={},c=new Set;return XQe(t,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let m=s+f,g=o[h];typeof d[r]=="string"&&(g=_.call(this,d[r])),b.call(this,d.$anchor),b.call(this,d.$dynamicAnchor),o[f]=g;function _(T){let E=this.opts.uriResolver.resolve;if(T=zg(g?E(g,T):T),c.has(T))throw u(T);c.add(T);let A=this.refs[T];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,T):T!==zg(m)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=m),T}function b(T){if(typeof T=="string"){if(!i7e.test(T))throw new Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!JQe(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}oi.getSchemaRefs=o7e});var db=y(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.getData=su.KeywordCxt=su.validateFunctionCode=void 0;var fye=j_e(),cye=ab(),VH=MH(),$O=ab(),s7e=Y_e(),ub=Q_e(),qH=tye(),Re=Ze(),Fe=_c(),a7e=cb(),yc=lt(),lb=sb();function c7e(t){if(mye(t)&&(gye(t),hye(t))){d7e(t);return}pye(t,()=>(0,fye.topBoolOrEmptySchema)(t))}su.validateFunctionCode=c7e;function pye({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,Re._)`${Fe.default.data}, ${Fe.default.valCxt}`,n.$async,()=>{t.code((0,Re._)`"use strict"; ${lye(r,i)}`),u7e(t,i),t.code(o)}):t.func(e,(0,Re._)`${Fe.default.data}, ${l7e(i)}`,n.$async,()=>t.code(lye(r,i)).code(o))}function l7e(t){return(0,Re._)`{${Fe.default.instancePath}="", ${Fe.default.parentData}, ${Fe.default.parentDataProperty}, ${Fe.default.rootData}=${Fe.default.data}${t.dynamicRef?(0,Re._)`, ${Fe.default.dynamicAnchors}={}`:Re.nil}}={}`}function u7e(t,e){t.if(Fe.default.valCxt,()=>{t.var(Fe.default.instancePath,(0,Re._)`${Fe.default.valCxt}.${Fe.default.instancePath}`),t.var(Fe.default.parentData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentData}`),t.var(Fe.default.parentDataProperty,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentDataProperty}`),t.var(Fe.default.rootData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.rootData}`),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`${Fe.default.valCxt}.${Fe.default.dynamicAnchors}`)},()=>{t.var(Fe.default.instancePath,(0,Re._)`""`),t.var(Fe.default.parentData,(0,Re._)`undefined`),t.var(Fe.default.parentDataProperty,(0,Re._)`undefined`),t.var(Fe.default.rootData,Fe.default.data),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`{}`)})}function d7e(t){let{schema:e,opts:r,gen:n}=t;pye(t,()=>{r.$comment&&e.$comment&&yye(t),g7e(t),n.let(Fe.default.vErrors,null),n.let(Fe.default.errors,0),r.unevaluated&&f7e(t),_ye(t),S7e(t)})}function f7e(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Re._)`${r}.evaluated`),e.if((0,Re._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Re._)`${t.evaluated}.props`,(0,Re._)`undefined`)),e.if((0,Re._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Re._)`${t.evaluated}.items`,(0,Re._)`undefined`))}function lye(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Re._)`/*# sourceURL=${r} */`:Re.nil}function p7e(t,e){if(mye(t)&&(gye(t),hye(t))){h7e(t,e);return}(0,fye.boolOrEmptySchema)(t,e)}function hye({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function mye(t){return typeof t.schema!="boolean"}function h7e(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&yye(t),_7e(t),y7e(t);let o=n.const("_errs",Fe.default.errors);_ye(t,o),n.var(e,(0,Re._)`${o} === ${Fe.default.errors}`)}function gye(t){(0,yc.checkUnknownRules)(t),m7e(t)}function _ye(t,e){if(t.opts.jtd)return uye(t,[],!1,e);let r=(0,cye.getSchemaTypes)(t.schema),n=(0,cye.coerceAndCheckDataType)(t,r);uye(t,r,!n,e)}function m7e(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,yc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function g7e(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,yc.checkStrictMode)(t,"default is ignored in the schema root")}function _7e(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,a7e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function y7e(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function yye({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,Re._)`${Fe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,Re.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Re._)`${Fe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function S7e(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,Re._)`${Fe.default.errors} === 0`,()=>e.return(Fe.default.data),()=>e.throw((0,Re._)`new ${i}(${Fe.default.vErrors})`)):(e.assign((0,Re._)`${n}.errors`,Fe.default.vErrors),o.unevaluated&&E7e(t),e.return((0,Re._)`${Fe.default.errors} === 0`))}function E7e({gen:t,evaluated:e,props:r,items:n}){r instanceof Re.Name&&t.assign((0,Re._)`${e}.props`,r),n instanceof Re.Name&&t.assign((0,Re._)`${e}.items`,n)}function uye(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,yc.schemaHasRulesButRef)(o,u))){i.block(()=>Eye(t,"$ref",u.all.$ref.definition));return}c.jtd||v7e(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,VH.shouldUseGroup)(o,f)&&(f.type?(i.if((0,$O.checkDataType)(f.type,s,c.strictNumbers)),dye(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,$O.reportTypeError)(t)),i.endIf()):dye(t,f),a||i.if((0,Re._)`${Fe.default.errors} === ${n||0}`))}}function dye(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,s7e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,VH.shouldUseRule)(n,o)&&Eye(t,o.keyword,o.definition,e.type)})}function v7e(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(b7e(t,e),t.opts.allowUnionTypes||T7e(t,e),w7e(t,t.dataTypes))}function b7e(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Sye(t.dataTypes,r)||GH(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),x7e(t,e)}}function T7e(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&GH(t,"use allowUnionTypes to allow union type keyword")}function w7e(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,VH.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>A7e(e,s))&&GH(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function A7e(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Sye(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function x7e(t,e){let r=[];for(let n of t.dataTypes)Sye(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function GH(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,yc.checkStrictMode)(t,e,t.opts.strictTypes)}var DO=class{constructor(e,r,n){if((0,ub.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",vye(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ub.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Fe.default.errors))}result(e,r,n){this.failResult((0,Re.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Re.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Re._)`${r} !== undefined && (${(0,Re.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?lb.reportExtraError:lb.reportError)(this,this.def.error,r)}$dataError(){(0,lb.reportError)(this,this.def.$dataError||lb.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lb.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=Re.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=Re.nil,r=Re.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,Re.or)((0,Re._)`${i} === undefined`,r)),e!==Re.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==Re.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,Re.or)(s(),a());function s(){if(n.length){if(!(r instanceof Re.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,Re._)`${(0,$O.checkDataTypes)(c,r,o.opts.strictNumbers,$O.DataType.Wrong)}`}return Re.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Re._)`!${c}(${r})`}return Re.nil}}subschema(e,r){let n=(0,qH.getSubschema)(this.it,e);(0,qH.extendSubschemaData)(n,this.it,e),(0,qH.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return p7e(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=yc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=yc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,Re.Name)),!0}};su.KeywordCxt=DO;function Eye(t,e,r,n){let i=new DO(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ub.funcKeywordCode)(i,r):"macro"in r?(0,ub.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ub.funcKeywordCode)(i,r)}var R7e=/^\/(?:[^~]|~0|~1)*$/,C7e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vye(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return Fe.default.rootData;if(t[0]==="/"){if(!R7e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=Fe.default.rootData}else{let l=C7e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,Re._)`${o}${(0,Re.getProperty)((0,yc.unescapeJsonPointer)(l))}`,s=(0,Re._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}su.getData=vye});var LO=y(WH=>{"use strict";Object.defineProperty(WH,"__esModule",{value:!0});var HH=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};WH.default=HH});var fb=y(ZH=>{"use strict";Object.defineProperty(ZH,"__esModule",{value:!0});var YH=cb(),KH=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,YH.resolveUrl)(e,r,n),this.missingSchema=(0,YH.normalizeId)((0,YH.getFullPath)(e,this.missingRef))}};ZH.default=KH});var FO=y(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.resolveSchema=oo.getCompilingSchema=oo.resolveRef=oo.compileSchema=oo.SchemaEnv=void 0;var Ko=Ze(),I7e=LO(),Ef=_c(),Zo=cb(),bye=lt(),P7e=db(),jg=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Zo.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};oo.SchemaEnv=jg;function XH(t){let e=Tye.call(this,t);if(e)return e;let r=(0,Zo.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Ko.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:I7e.default,code:(0,Ko._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Ef.default.data,parentData:Ef.default.parentData,parentDataProperty:Ef.default.parentDataProperty,dataNames:[Ef.default.data],dataPathArr:[Ko.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ko.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ko.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ko._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,P7e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Ef.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${Ef.default.self}`,`${Ef.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:m}=l;p.evaluated={props:h instanceof Ko.Name?void 0:h,items:m instanceof Ko.Name?void 0:m,dynamicProps:h instanceof Ko.Name,dynamicItems:m instanceof Ko.Name},p.source&&(p.source.evaluated=(0,Ko.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}oo.compileSchema=XH;function O7e(t,e,r){var n;r=(0,Zo.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=M7e.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new jg({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=N7e.call(this,o)}oo.resolveRef=O7e;function N7e(t){return(0,Zo.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:XH.call(this,t)}function Tye(t){for(let e of this._compilations)if(k7e(e,t))return e}oo.getCompilingSchema=Tye;function k7e(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function M7e(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||UO.call(this,t,e)}function UO(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Zo._getFullPath)(this.opts.uriResolver,r),i=(0,Zo.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return JH.call(this,r,t);let o=(0,Zo.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=UO.call(this,t,s);return typeof a?.schema!="object"?void 0:JH.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||XH.call(this,s),o===(0,Zo.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Zo.resolveUrl)(this.opts.uriResolver,i,l)),new jg({schema:a,schemaId:c,root:t,baseId:i})}return JH.call(this,r,s)}}oo.resolveSchema=UO;var $7e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function JH(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,bye.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!$7e.has(a)&&l&&(e=(0,Zo.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,bye.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Zo.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=UO.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new jg({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var wye=y((eir,D7e)=>{D7e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var t6=y((tir,Pye)=>{"use strict";var L7e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),xye=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),QH=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Rye=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),U7e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function e6(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var F7e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Aye(t){return t.length=0,!0}function z7e(t,e,r){if(t.length){let n=e6(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function j7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=z7e;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=Aye}else{i.push(l);continue}}return i.length&&(a===Aye?r.zone=i.join(""):s?n.push(i.join("")):n.push(e6(i))),r.address=n.join(""),r}function Cye(t){if(B7e(t,":")<2)return{host:t,isIPV6:!1};let e=j7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function B7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function q7e(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var V7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},G7e=/[@/?#:]/g,H7e=/[@/?#]/g;function Iye(t,e){let r=e?H7e:G7e;return r.lastIndex=0,t.replace(r,n=>V7e[n])}function W7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(QH(i)){let o=i.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&Rye(s)?r+=s:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function Y7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QH(n)){let i=n.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&Rye(o)?e+=o:e+="%"+i,r+=2;continue}}U7e(t[r])?e+=t[r]:e+=escape(t[r])}return e}function K7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QH(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function Z7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!xye(r)){let n=Cye(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Iye(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}Pye.exports={nonSimpleDomain:F7e,recomposeAuthority:Z7e,reescapeHostDelimiters:Iye,normalizePercentEncoding:W7e,normalizePathEncoding:Y7e,escapePreservingEscapes:K7e,removeDotSegments:q7e,isIPv4:xye,isUUID:L7e,normalizeIPv6:Cye,stringArrayToHexStripped:e6}});var $ye=y((rir,Mye)=>{"use strict";var{isUUID:J7e}=t6(),X7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Q7e=["http","https","ws","wss","urn","urn:uuid"];function eet(t){return Q7e.indexOf(t)!==-1}function r6(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Oye(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Nye(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function tet(t){return t.secure=r6(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ret(t){if((t.port===(r6(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function net(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(X7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=n6(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function iet(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=n6(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function oet(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!J7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function set(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kye={scheme:"http",domainHost:!0,parse:Oye,serialize:Nye},aet={scheme:"https",domainHost:kye.domainHost,parse:Oye,serialize:Nye},zO={scheme:"ws",domainHost:!0,parse:tet,serialize:ret},cet={scheme:"wss",domainHost:zO.domainHost,parse:zO.parse,serialize:zO.serialize},uet={scheme:"urn",parse:net,serialize:iet,skipNormalize:!0},det={scheme:"urn:uuid",parse:oet,serialize:set,skipNormalize:!0},jO={http:kye,https:aet,ws:zO,wss:cet,urn:uet,"urn:uuid":det};Object.setPrototypeOf(jO,null);function n6(t){return t&&(jO[t]||jO[t.toLowerCase()])||void 0}Mye.exports={wsIsSecure:r6,SCHEMES:jO,isValidSchemeName:eet,getSchemeHandler:n6}});var jye=y((nir,BO)=>{"use strict";var{normalizeIPv6:fet,removeDotSegments:pb,recomposeAuthority:pet,normalizePercentEncoding:het,normalizePathEncoding:met,escapePreservingEscapes:get,reescapeHostDelimiters:_et,isIPv4:yet,nonSimpleDomain:Eet}=t6(),{SCHEMES:vet,getSchemeHandler:Lye}=$ye();function bet(t,e){return typeof t=="string"?t=Ret(t,e):typeof t=="object"&&(t=Bg(vf(t,e),e)),t}function Tet(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Uye(Bg(t,n),Bg(e,n),n,!0);return n.skipEscape=!0,vf(i,n)}function Uye(t,e,r,n){let i={};return n||(t=Bg(vf(t,r),r),e=Bg(vf(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=pb(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=pb(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=pb(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=pb(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function wet(t,e,r){let n=Dye(t,r),i=Dye(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function vf(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Lye(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=het(r.path):(r.path=get(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=pet(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=pb(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var Aet=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function xet(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Fye(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(Aet);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=xet(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(yet(n.host)===!1){let u=fet(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Lye(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&Eet(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=_et(unescape(n.host),o))),n.path&&(n.path=met(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Bg(t,e){return Fye(t,e).parsed}function Ret(t,e){return zye(t,e).normalized}function zye(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Fye(t,e);return{normalized:n?t:vf(r,e),malformedAuthorityOrPort:n}}function Dye(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=zye(t,e);return n?void 0:r}if(typeof t=="object")return vf(t,e)}var i6={SCHEMES:vet,normalize:bet,resolve:Tet,resolveComponent:Uye,equal:wet,serialize:vf,parse:Bg};BO.exports=i6;BO.exports.default=i6;BO.exports.fastUri=i6});var qye=y(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});var Bye=jye();Bye.code='require("ajv/dist/runtime/uri").default';o6.default=Bye});var Jye=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.CodeGen=nn.Name=nn.nil=nn.stringify=nn.str=nn._=nn.KeywordCxt=void 0;var Cet=db();Object.defineProperty(nn,"KeywordCxt",{enumerable:!0,get:function(){return Cet.KeywordCxt}});var qg=Ze();Object.defineProperty(nn,"_",{enumerable:!0,get:function(){return qg._}});Object.defineProperty(nn,"str",{enumerable:!0,get:function(){return qg.str}});Object.defineProperty(nn,"stringify",{enumerable:!0,get:function(){return qg.stringify}});Object.defineProperty(nn,"nil",{enumerable:!0,get:function(){return qg.nil}});Object.defineProperty(nn,"Name",{enumerable:!0,get:function(){return qg.Name}});Object.defineProperty(nn,"CodeGen",{enumerable:!0,get:function(){return qg.CodeGen}});var Iet=LO(),Yye=fb(),Pet=kH(),hb=FO(),Oet=Ze(),mb=cb(),qO=ab(),a6=lt(),Vye=wye(),Net=qye(),Kye=(t,e)=>new RegExp(t,e);Kye.code="new RegExp";var ket=["removeAdditional","useDefaults","coerceTypes"],Met=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),$et={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Det={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Gye=200;function Let(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_,b,T,E,A,O,R,N,M;let L=t.strict,v=(e=t.code)===null||e===void 0?void 0:e.optimize,oe=v===!0||v===void 0?1:v||0,$=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Kye,S=(i=t.uriResolver)!==null&&i!==void 0?i:Net.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:L)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:L)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:L)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:L)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=t.strictRequired)!==null&&p!==void 0?p:L)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:oe,regExp:$}:{optimize:oe,regExp:$},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:Gye,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Gye,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(R=t.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(N=t.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(M=t.int32range)!==null&&M!==void 0?M:!0,uriResolver:S}}var gb=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Let(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Oet.ValueScope({scope:{},prefixes:Met,es5:r,lines:n}),this.logger=qet(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Pet.getRules)(),Hye.call(this,$et,e,"NOT SUPPORTED"),Hye.call(this,Det,e,"DEPRECATED","warn"),this._metaOpts=jet.call(this),e.formats&&Fet.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&zet.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Uet.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Vye;n==="id"&&(i={...Vye},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Yye.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,mb.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Wye.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new hb.SchemaEnv({schema:{},schemaId:n});if(r=hb.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Wye.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,mb.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Get.call(this,n,r),!r)return(0,a6.eachItem)(n,o=>s6.call(this,o)),this;Wet.call(this,r);let i={...r,type:(0,qO.getJSONTypes)(r.type),schemaType:(0,qO.getJSONTypes)(r.schemaType)};return(0,a6.eachItem)(n,i.type.length===0?o=>s6.call(this,o,i):o=>i.type.forEach(s=>s6.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Zye(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,mb.normalizeId)(s||n);let l=mb.getSchemaRefs.call(this,e,n);return c=new hb.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):hb.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{hb.compileSchema.call(this,e)}finally{this.opts=r}}};gb.ValidationError=Iet.default;gb.MissingRefError=Yye.default;nn.default=gb;function Hye(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Wye(t){return t=(0,mb.normalizeId)(t),this.schemas[t]||this.refs[t]}function Uet(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Fet(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function zet(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function jet(){let t={...this.opts};for(let e of ket)delete t[e];return t}var Bet={log(){},warn(){},error(){}};function qet(t){if(t===!1)return Bet;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Vet=/^[a-z_$][a-z0-9_$:-]*$/i;function Get(t,e){let{RULES:r}=this;if((0,a6.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Vet.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function s6(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,qO.getJSONTypes)(e.type),schemaType:(0,qO.getJSONTypes)(e.schemaType)}};e.before?Het.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Het(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Wet(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Zye(e)),t.validateSchema=this.compile(e,!0))}var Yet={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Zye(t){return{anyOf:[t,Yet]}}});var Xye=y(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var Ket={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};c6.default=Ket});var rSe=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.callRef=bf.getValidate=void 0;var Zet=fb(),Qye=io(),si=Ze(),Vg=_c(),eSe=FO(),VO=lt(),Jet={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=eSe.resolveRef.call(c,l,i,r);if(u===void 0)throw new Zet.default(n.opts.uriResolver,i,r);if(u instanceof eSe.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return GO(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return GO(t,(0,si._)`${h}.validate`,l,l.$async)}function f(h){let m=tSe(t,h);GO(t,m,h,h.$async)}function p(h){let m=e.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,si.stringify)(h)}:{ref:h}),g=e.name("valid"),_=t.subschema({schema:h,dataTypes:[],schemaPath:si.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function tSe(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,si._)`${r.scopeValue("wrapper",{ref:e})}.validate`}bf.getValidate=tSe;function GO(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Vg.default.this:si.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,si._)`await ${(0,Qye.callValidateCode)(t,e,l)}`),p(e),s||i.assign(h,!0)},m=>{i.if((0,si._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),f(m),s||i.assign(h,!1)}),t.ok(h)}function d(){t.result((0,Qye.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(h){let m=(0,si._)`${h}.errors`;i.assign(Vg.default.vErrors,(0,si._)`${Vg.default.vErrors} === null ? ${m} : ${Vg.default.vErrors}.concat(${m})`),i.assign(Vg.default.errors,(0,si._)`${Vg.default.vErrors}.length`)}function p(h){var m;if(!o.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=VO.mergeEvaluated.props(i,g.props,o.props));else{let _=i.var("props",(0,si._)`${h}.evaluated.props`);o.props=VO.mergeEvaluated.props(i,_,o.props,si.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=VO.mergeEvaluated.items(i,g.items,o.items));else{let _=i.var("items",(0,si._)`${h}.evaluated.items`);o.items=VO.mergeEvaluated.items(i,_,o.items,si.Name)}}}bf.callRef=GO;bf.default=Jet});var nSe=y(l6=>{"use strict";Object.defineProperty(l6,"__esModule",{value:!0});var Xet=Xye(),Qet=rSe(),ett=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Xet.default,Qet.default];l6.default=ett});var iSe=y(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var HO=Ze(),au=HO.operators,WO={maximum:{okStr:"<=",ok:au.LTE,fail:au.GT},minimum:{okStr:">=",ok:au.GTE,fail:au.LT},exclusiveMaximum:{okStr:"<",ok:au.LT,fail:au.GTE},exclusiveMinimum:{okStr:">",ok:au.GT,fail:au.LTE}},ttt={message:({keyword:t,schemaCode:e})=>(0,HO.str)`must be ${WO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,HO._)`{comparison: ${WO[t].okStr}, limit: ${e}}`},rtt={keyword:Object.keys(WO),type:"number",schemaType:"number",$data:!0,error:ttt,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,HO._)`${r} ${WO[e].fail} ${n} || isNaN(${r})`)}};u6.default=rtt});var oSe=y(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});var _b=Ze(),ntt={message:({schemaCode:t})=>(0,_b.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,_b._)`{multipleOf: ${t}}`},itt={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ntt,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,_b._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,_b._)`${s} !== parseInt(${s})`;t.fail$data((0,_b._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};d6.default=itt});var aSe=y(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});function sSe(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}f6.default=sSe;sSe.code='require("ajv/dist/runtime/ucs2length").default'});var cSe=y(p6=>{"use strict";Object.defineProperty(p6,"__esModule",{value:!0});var Tf=Ze(),ott=lt(),stt=aSe(),att={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Tf.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Tf._)`{limit: ${t}}`},ctt={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:att,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Tf.operators.GT:Tf.operators.LT,s=i.opts.unicode===!1?(0,Tf._)`${r}.length`:(0,Tf._)`${(0,ott.useFunc)(t.gen,stt.default)}(${r})`;t.fail$data((0,Tf._)`${s} ${o} ${n}`)}};p6.default=ctt});var lSe=y(h6=>{"use strict";Object.defineProperty(h6,"__esModule",{value:!0});var ltt=io(),utt=lt(),Gg=Ze(),dtt={message:({schemaCode:t})=>(0,Gg.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Gg._)`{pattern: ${t}}`},ftt={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dtt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Gg._)`new RegExp`:(0,utt.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Gg._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Gg._)`!${u}`)}else{let c=(0,ltt.usePattern)(t,i);t.fail$data((0,Gg._)`!${c}.test(${r})`)}}};h6.default=ftt});var uSe=y(m6=>{"use strict";Object.defineProperty(m6,"__esModule",{value:!0});var yb=Ze(),ptt={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yb.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,yb._)`{limit: ${t}}`},htt={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ptt,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?yb.operators.GT:yb.operators.LT;t.fail$data((0,yb._)`Object.keys(${r}).length ${i} ${n}`)}};m6.default=htt});var dSe=y(g6=>{"use strict";Object.defineProperty(g6,"__esModule",{value:!0});var Sb=io(),Eb=Ze(),mtt=lt(),gtt={message:({params:{missingProperty:t}})=>(0,Eb.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Eb._)`{missingProperty: ${t}}`},_tt={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gtt,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:h}=t.it;for(let m of r)if(p?.[m]===void 0&&!h.has(m)){let g=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,mtt.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Eb.nil,d);else for(let p of r)(0,Sb.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>f(p,h)),t.ok(h)}else e.if((0,Sb.checkMissingProp)(t,r,p)),(0,Sb.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Sb.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,h){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(h,(0,Sb.propertyInData)(e,i,p,a.ownProperties)),e.if((0,Eb.not)(h),()=>{t.error(),e.break()})},Eb.nil)}}};g6.default=_tt});var fSe=y(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});var vb=Ze(),ytt={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vb.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vb._)`{limit: ${t}}`},Stt={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ytt,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?vb.operators.GT:vb.operators.LT;t.fail$data((0,vb._)`${r}.length ${i} ${n}`)}};_6.default=Stt});var YO=y(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var pSe=jH();pSe.code='require("ajv/dist/runtime/equal").default';y6.default=pSe});var hSe=y(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var S6=ab(),on=Ze(),Ett=lt(),vtt=YO(),btt={message:({params:{i:t,j:e}})=>(0,on.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,on._)`{i: ${t}, j: ${e}}`},Ttt={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:btt,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,S6.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,on._)`${s} === false`),t.ok(c);function u(){let h=e.let("i",(0,on._)`${r}.length`),m=e.let("j");t.setParams({i:h,j:m}),e.assign(c,!0),e.if((0,on._)`${h} > 1`,()=>(d()?f:p)(h,m))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,m){let g=e.name("item"),_=(0,S6.checkDataTypes)(l,g,a.opts.strictNumbers,S6.DataType.Wrong),b=e.const("indices",(0,on._)`{}`);e.for((0,on._)`;${h}--;`,()=>{e.let(g,(0,on._)`${r}[${h}]`),e.if(_,(0,on._)`continue`),l.length>1&&e.if((0,on._)`typeof ${g} == "string"`,(0,on._)`${g} += "_"`),e.if((0,on._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,on._)`${b}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,on._)`${b}[${g}] = ${h}`)})}function p(h,m){let g=(0,Ett.useFunc)(e,vtt.default),_=e.name("outer");e.label(_).for((0,on._)`;${h}--;`,()=>e.for((0,on._)`${m} = ${h}; ${m}--;`,()=>e.if((0,on._)`${g}(${r}[${h}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};E6.default=Ttt});var mSe=y(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:!0});var v6=Ze(),wtt=lt(),Att=YO(),xtt={message:"must be equal to constant",params:({schemaCode:t})=>(0,v6._)`{allowedValue: ${t}}`},Rtt={keyword:"const",$data:!0,error:xtt,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,v6._)`!${(0,wtt.useFunc)(e,Att.default)}(${r}, ${i})`):t.fail((0,v6._)`${o} !== ${r}`)}};b6.default=Rtt});var gSe=y(T6=>{"use strict";Object.defineProperty(T6,"__esModule",{value:!0});var bb=Ze(),Ctt=lt(),Itt=YO(),Ptt={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,bb._)`{allowedValues: ${t}}`},Ott={keyword:"enum",schemaType:"array",$data:!0,error:Ptt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,Ctt.useFunc)(e,Itt.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,bb.or)(...i.map((h,m)=>f(p,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,bb._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,h){let m=i[h];return typeof m=="object"&&m!==null?(0,bb._)`${l()}(${r}, ${p}[${h}])`:(0,bb._)`${r} === ${m}`}}};T6.default=Ott});var _Se=y(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Ntt=iSe(),ktt=oSe(),Mtt=cSe(),$tt=lSe(),Dtt=uSe(),Ltt=dSe(),Utt=fSe(),Ftt=hSe(),ztt=mSe(),jtt=gSe(),Btt=[Ntt.default,ktt.default,Mtt.default,$tt.default,Dtt.default,Ltt.default,Utt.default,Ftt.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ztt.default,jtt.default];w6.default=Btt});var x6=y(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});Tb.validateAdditionalItems=void 0;var wf=Ze(),A6=lt(),qtt={message:({params:{len:t}})=>(0,wf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,wf._)`{limit: ${t}}`},Vtt={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qtt,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,A6.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ySe(t,n)}};function ySe(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,wf._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,wf._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,A6.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,wf._)`${a} <= ${e.length}`);r.if((0,wf.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:A6.Type.Num},l),s.allErrors||r.if((0,wf.not)(l),()=>r.break())})}}Tb.validateAdditionalItems=ySe;Tb.default=Vtt});var R6=y(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});wb.validateTuple=void 0;var SSe=Ze(),KO=lt(),Gtt=io(),Htt={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ESe(t,"additionalItems",e);r.items=!0,!(0,KO.alwaysValidSchema)(r,e)&&t.ok((0,Gtt.validateArray)(t))}};function ESe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=KO.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,SSe._)`${o}.length`);r.forEach((d,f)=>{(0,KO.alwaysValidSchema)(a,d)||(n.if((0,SSe._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,h=r.length,m=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let g=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,KO.checkStrictMode)(a,g,f.strictTuples)}}}wb.validateTuple=ESe;wb.default=Htt});var vSe=y(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});var Wtt=R6(),Ytt={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Wtt.validateTuple)(t,"items")};C6.default=Ytt});var TSe=y(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var bSe=Ze(),Ktt=lt(),Ztt=io(),Jtt=x6(),Xtt={message:({params:{len:t}})=>(0,bSe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,bSe._)`{limit: ${t}}`},Qtt={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Xtt,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,Ktt.alwaysValidSchema)(n,e)&&(i?(0,Jtt.validateAdditionalItems)(t,i):t.ok((0,Ztt.validateArray)(t)))}};I6.default=Qtt});var wSe=y(P6=>{"use strict";Object.defineProperty(P6,"__esModule",{value:!0});var so=Ze(),ZO=lt(),ert={message:({params:{min:t,max:e}})=>e===void 0?(0,so.str)`must contain at least ${t} valid item(s)`:(0,so.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,so._)`{minContains: ${t}}`:(0,so._)`{minContains: ${t}, maxContains: ${e}}`},trt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ert,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,so._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,ZO.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,ZO.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ZO.alwaysValidSchema)(o,r)){let m=(0,so._)`${u} >= ${s}`;a!==void 0&&(m=(0,so._)`${m} && ${u} <= ${a}`),t.pass(m);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,so._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),g=e.let("count",0);p(m,()=>e.if(m,()=>h(g)))}function p(m,g){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:ZO.Type.Num,compositeRule:!0},m),g()})}function h(m){e.code((0,so._)`${m}++`),a===void 0?e.if((0,so._)`${m} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,so._)`${m} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,so._)`${m} >= ${s}`,()=>e.assign(d,!0)))}}};P6.default=trt});var RSe=y(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.validateSchemaDeps=Xs.validatePropertyDeps=Xs.error=void 0;var O6=Ze(),rrt=lt(),Ab=io();Xs.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,O6.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,O6._)`{property: ${t},
|
|
23
|
+
`)+1))),this.lastActivityTimestamp=new Date}trace(e,r){(0,Yx.trace)(r??Kc.LogVerbosity.DEBUG,"channel","("+this.channelzRef.id+") "+(0,Kx.uriToString)(this.target)+" "+e)}callRefTimerRef(){var e,r,n,i;this.callRefTimer||(this.callRefTimer=setInterval(()=>{},KLe)),!((r=(e=this.callRefTimer).hasRef)===null||r===void 0)&&r.call(e)||(this.trace("callRefTimer.ref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(i=(n=this.callRefTimer).ref)===null||i===void 0||i.call(n))}callRefTimerUnref(){var e,r,n;(!(!((e=this.callRefTimer)===null||e===void 0)&&e.hasRef)||this.callRefTimer.hasRef())&&(this.trace("callRefTimer.unref | configSelectionQueue.length="+this.configSelectionQueue.length+" pickQueue.length="+this.pickQueue.length),(n=(r=this.callRefTimer)===null||r===void 0?void 0:r.unref)===null||n===void 0||n.call(r))}removeConnectivityStateWatcher(e){let r=this.connectivityStateWatchers.findIndex(n=>n===e);r>=0&&this.connectivityStateWatchers.splice(r,1)}updateState(e){(0,Yx.trace)(Kc.LogVerbosity.DEBUG,"connectivity_state","("+this.channelzRef.id+") "+(0,Kx.uriToString)(this.target)+" "+Gi.ConnectivityState[this.connectivityState]+" -> "+Gi.ConnectivityState[e]),this.channelzEnabled&&this.channelzInfoTracker.trace.addTrace("CT_INFO","Connectivity state change to "+Gi.ConnectivityState[e]),this.connectivityState=e,this.channelzInfoTracker.state=e;let r=this.connectivityStateWatchers.slice();for(let n of r)e!==n.currentState&&(n.timer&&clearTimeout(n.timer),this.removeConnectivityStateWatcher(n),n.callback());e!==Gi.ConnectivityState.TRANSIENT_FAILURE&&(this.currentResolutionError=null)}throttleKeepalive(e){if(e>this.keepaliveTime){this.keepaliveTime=e;for(let r of this.wrappedSubchannels)r.throttleKeepalive(e)}}addWrappedSubchannel(e){this.wrappedSubchannels.add(e)}removeWrappedSubchannel(e){this.wrappedSubchannels.delete(e)}doPick(e,r){return this.currentPicker.pick({metadata:e,extraPickInfo:r})}queueCallForPick(e){this.pickQueue.push(e),this.callRefTimerRef()}getConfig(e,r){return this.connectivityState!==Gi.ConnectivityState.SHUTDOWN&&this.resolvingLoadBalancer.exitIdle(),this.configSelector?{type:"SUCCESS",config:this.configSelector.invoke(e,r,this.randomChannelId)}:this.currentResolutionError?{type:"ERROR",error:this.currentResolutionError}:{type:"NONE"}}queueCallForConfig(e){this.configSelectionQueue.push(e),this.callRefTimerRef()}enterIdle(){this.resolvingLoadBalancer.destroy(),this.updateState(Gi.ConnectivityState.IDLE),this.currentPicker=new f1.QueuePicker(this.resolvingLoadBalancer),this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.callRefTimer&&(clearInterval(this.callRefTimer),this.callRefTimer=null)}startIdleTimeout(e){var r,n;this.idleTimer=setTimeout(()=>{if(this.callCount>0){this.startIdleTimeout(this.idleTimeoutMs);return}let o=new Date().valueOf()-this.lastActivityTimestamp.valueOf();o>=this.idleTimeoutMs?(this.trace("Idle timer triggered after "+this.idleTimeoutMs+"ms of inactivity"),this.enterIdle()):this.startIdleTimeout(this.idleTimeoutMs-o)},e),(n=(r=this.idleTimer).unref)===null||n===void 0||n.call(r)}maybeStartIdleTimer(){this.connectivityState!==Gi.ConnectivityState.SHUTDOWN&&!this.idleTimer&&this.startIdleTimeout(this.idleTimeoutMs)}onCallStart(){this.channelzEnabled&&this.channelzInfoTracker.callTracker.addCallStarted(),this.callCount+=1}onCallEnd(e){this.channelzEnabled&&(e.code===Kc.Status.OK?this.channelzInfoTracker.callTracker.addCallSucceeded():this.channelzInfoTracker.callTracker.addCallFailed()),this.callCount-=1,this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()}createLoadBalancingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();return this.trace("createLoadBalancingCall ["+s+'] method="'+r+'"'),new VLe.LoadBalancingCall(this,e,r,n,i,o,s)}createRetryingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();return this.trace("createRetryingCall ["+s+'] method="'+r+'"'),new d1.RetryingCall(this,e,r,n,i,o,s,this.retryBufferTracker,Zx.get(this.getTarget()))}createResolvingCall(e,r,n,i,o){let s=(0,u1.getNextCallNumber)();this.trace("createResolvingCall ["+s+'] method="'+e+'", deadline='+(0,GLe.deadlineToString)(r));let a={deadline:r,flags:o??Kc.Propagate.DEFAULTS,host:n??this.defaultAuthority,parentCall:i},c=new HLe.ResolvingCall(this,e,a,this.filterStackFactory.clone(),s);return this.onCallStart(),c.addStatusWatcher(l=>{this.onCallEnd(l)}),c}close(){var e;this.resolvingLoadBalancer.destroy(),this.updateState(Gi.ConnectivityState.SHUTDOWN),this.currentPicker=new h1;for(let r of this.configSelectionQueue)r.cancelWithStatus(Kc.Status.UNAVAILABLE,"Channel closed before call started");this.configSelectionQueue=[];for(let r of this.pickQueue)r.cancelWithStatus(Kc.Status.UNAVAILABLE,"Channel closed before call started");this.pickQueue=[],this.callRefTimer&&clearInterval(this.callRefTimer),this.idleTimer&&clearTimeout(this.idleTimer),this.channelzEnabled&&(0,oS.unregisterChannelzRef)(this.channelzRef),this.subchannelPool.unrefUnusedSubchannels(),(e=this.configSelector)===null||e===void 0||e.unref(),this.configSelector=null}getTarget(){return(0,Kx.uriToString)(this.target)}getConnectivityState(e){let r=this.connectivityState;return e&&(this.resolvingLoadBalancer.exitIdle(),this.lastActivityTimestamp=new Date,this.maybeStartIdleTimer()),r}watchConnectivityState(e,r,n){if(this.connectivityState===Gi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");let i=null;if(r!==1/0){let s=r instanceof Date?r:new Date(r),a=new Date;if(r===-1/0||s<=a){process.nextTick(n,new Error("Deadline passed without connectivity state change"));return}i=setTimeout(()=>{this.removeConnectivityStateWatcher(o),n(new Error("Deadline passed without connectivity state change"))},s.getTime()-a.getTime())}let o={currentState:e,callback:n,timer:i};this.connectivityStateWatchers.push(o)}getChannelzRef(){return this.channelzRef}createCall(e,r,n,i,o){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");if(this.connectivityState===Gi.ConnectivityState.SHUTDOWN)throw new Error("Channel has been shut down");return this.createResolvingCall(e,r,n,i,o)}getOptions(){return this.options}};rd.InternalChannel=g1});var uD=y(Jx=>{"use strict";Object.defineProperty(Jx,"__esModule",{value:!0});Jx.ChannelImplementation=void 0;var e1e=fp(),t1e=_1(),y1=class{constructor(e,r,n){if(typeof e!="string")throw new TypeError("Channel target must be a string");if(!(r instanceof e1e.ChannelCredentials))throw new TypeError("Channel credentials must be a ChannelCredentials object");if(n&&typeof n!="object")throw new TypeError("Channel options must be an object");this.internalChannel=new t1e.InternalChannel(e,r,n)}close(){this.internalChannel.close()}getTarget(){return this.internalChannel.getTarget()}getConnectivityState(e){return this.internalChannel.getConnectivityState(e)}watchConnectivityState(e,r,n){this.internalChannel.watchConnectivityState(e,r,n)}getChannelzRef(){return this.internalChannel.getChannelzRef()}createCall(e,r,n,i,o){if(typeof e!="string")throw new TypeError("Channel#createCall: method must be a string");if(!(typeof r=="number"||r instanceof Date))throw new TypeError("Channel#createCall: deadline must be a number or Date");return this.internalChannel.createCall(e,r,n,i,o)}};Jx.ChannelImplementation=y1});var Fte=y(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ServerDuplexStreamImpl=Co.ServerWritableStreamImpl=Co.ServerReadableStreamImpl=Co.ServerUnaryCallImpl=void 0;Co.serverErrorToStatus=A1;var r1e=Z("events"),T1=Z("stream"),w1=Xe(),Ute=Rr();function A1(t,e){var r;let n={code:w1.Status.UNKNOWN,details:"message"in t?t.message:"Unknown Error",metadata:(r=e??t.metadata)!==null&&r!==void 0?r:null};return"code"in t&&typeof t.code=="number"&&Number.isInteger(t.code)&&(n.code=t.code,"details"in t&&typeof t.details=="string"&&(n.details=t.details)),n}var S1=class extends r1e.EventEmitter{constructor(e,r,n,i){super(),this.path=e,this.call=r,this.metadata=n,this.request=i,this.cancelled=!1}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};Co.ServerUnaryCallImpl=S1;var E1=class extends T1.Readable{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.cancelled=!1}_read(e){this.call.startRead()}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}};Co.ServerReadableStreamImpl=E1;var v1=class extends T1.Writable{constructor(e,r,n,i){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.request=i,this.pendingStatus={code:w1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ute.Metadata,this.on("error",o=>{this.pendingStatus=A1(o),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Co.ServerWritableStreamImpl=v1;var b1=class extends T1.Duplex{constructor(e,r,n){super({objectMode:!0}),this.path=e,this.call=r,this.metadata=n,this.pendingStatus={code:w1.Status.OK,details:"OK"},this.cancelled=!1,this.trailingMetadata=new Ute.Metadata,this.on("error",i=>{this.pendingStatus=A1(i),this.end()})}getPeer(){return this.call.getPeer()}sendMetadata(e){this.call.sendMetadata(e)}getDeadline(){return this.call.getDeadline()}getPath(){return this.path}getHost(){return this.call.getHost()}getAuthContext(){return this.call.getAuthContext()}getMetricsRecorder(){return this.call.getMetricsRecorder()}_read(e){this.call.startRead()}_write(e,r,n){this.call.sendMessage(e,n)}_final(e){var r;e(null),this.call.sendStatus(Object.assign(Object.assign({},this.pendingStatus),{metadata:(r=this.pendingStatus.metadata)!==null&&r!==void 0?r:this.trailingMetadata}))}end(e){return e&&(this.trailingMetadata=e),super.end()}};Co.ServerDuplexStreamImpl=b1});var Xx=y(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.ServerCredentials=void 0;Fp.createCertificateProviderServerCredentials=n1e;Fp.createServerCredentialsWithInterceptors=i1e;var x1=N$(),nd=class{constructor(e,r){this.serverConstructorOptions=e,this.watchers=new Set,this.latestContextOptions=null,this.latestContextOptions=r??null}_addWatcher(e){this.watchers.add(e)}_removeWatcher(e){this.watchers.delete(e)}getWatcherCount(){return this.watchers.size}updateSecureContextOptions(e){this.latestContextOptions=e;for(let r of this.watchers)r(this.latestContextOptions)}_isSecure(){return this.serverConstructorOptions!==null}_getSecureContextOptions(){return this.latestContextOptions}_getConstructorOptions(){return this.serverConstructorOptions}_getInterceptors(){return[]}static createInsecure(){return new R1}static createSsl(e,r,n=!1){var i;if(e!==null&&!Buffer.isBuffer(e))throw new TypeError("rootCerts must be null or a Buffer");if(!Array.isArray(r))throw new TypeError("keyCertPairs must be an array");if(typeof n!="boolean")throw new TypeError("checkClientCertificate must be a boolean");let o=[],s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c===null||typeof c!="object")throw new TypeError(`keyCertPair[${a}] must be an object`);if(!Buffer.isBuffer(c.private_key))throw new TypeError(`keyCertPair[${a}].private_key must be a Buffer`);if(!Buffer.isBuffer(c.cert_chain))throw new TypeError(`keyCertPair[${a}].cert_chain must be a Buffer`);o.push(c.cert_chain),s.push(c.private_key)}return new C1({requestCert:n,ciphers:x1.CIPHER_SUITES},{ca:(i=e??(0,x1.getDefaultRootsData)())!==null&&i!==void 0?i:void 0,cert:o,key:s})}};Fp.ServerCredentials=nd;var R1=class t extends nd{constructor(){super(null)}_getSettings(){return null}_equals(e){return e instanceof t}},C1=class t extends nd{constructor(e,r){super(e,r),this.options=Object.assign(Object.assign({},e),r)}_equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(Buffer.isBuffer(this.options.ca)&&Buffer.isBuffer(e.options.ca)){if(!this.options.ca.equals(e.options.ca))return!1}else if(this.options.ca!==e.options.ca)return!1;if(Array.isArray(this.options.cert)&&Array.isArray(e.options.cert)){if(this.options.cert.length!==e.options.cert.length)return!1;for(let r=0;r<this.options.cert.length;r++){let n=this.options.cert[r],i=e.options.cert[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.cert!==e.options.cert)return!1;if(Array.isArray(this.options.key)&&Array.isArray(e.options.key)){if(this.options.key.length!==e.options.key.length)return!1;for(let r=0;r<this.options.key.length;r++){let n=this.options.key[r],i=e.options.key[r];if(Buffer.isBuffer(n)&&Buffer.isBuffer(i)){if(!n.equals(i))return!1}else if(n!==i)return!1}}else if(this.options.key!==e.options.key)return!1;return this.options.requestCert===e.options.requestCert}},I1=class t extends nd{constructor(e,r,n){super({requestCert:r!==null,rejectUnauthorized:n,ciphers:x1.CIPHER_SUITES}),this.identityCertificateProvider=e,this.caCertificateProvider=r,this.requireClientCertificate=n,this.latestCaUpdate=null,this.latestIdentityUpdate=null,this.caCertificateUpdateListener=this.handleCaCertificateUpdate.bind(this),this.identityCertificateUpdateListener=this.handleIdentityCertitificateUpdate.bind(this)}_addWatcher(e){var r;this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.addCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.addIdentityCertificateListener(this.identityCertificateUpdateListener)),super._addWatcher(e)}_removeWatcher(e){var r;super._removeWatcher(e),this.getWatcherCount()===0&&((r=this.caCertificateProvider)===null||r===void 0||r.removeCaCertificateListener(this.caCertificateUpdateListener),this.identityCertificateProvider.removeIdentityCertificateListener(this.identityCertificateUpdateListener))}_equals(e){return this===e?!0:e instanceof t?this.caCertificateProvider===e.caCertificateProvider&&this.identityCertificateProvider===e.identityCertificateProvider&&this.requireClientCertificate===e.requireClientCertificate:!1}calculateSecureContextOptions(){var e;return this.latestIdentityUpdate===null||this.caCertificateProvider!==null&&this.latestCaUpdate===null?null:{ca:(e=this.latestCaUpdate)===null||e===void 0?void 0:e.caCertificate,cert:[this.latestIdentityUpdate.certificate],key:[this.latestIdentityUpdate.privateKey]}}finalizeUpdate(){let e=this.calculateSecureContextOptions();this.updateSecureContextOptions(e)}handleCaCertificateUpdate(e){this.latestCaUpdate=e,this.finalizeUpdate()}handleIdentityCertitificateUpdate(e){this.latestIdentityUpdate=e,this.finalizeUpdate()}};function n1e(t,e,r){return new I1(t,e,r)}var P1=class t extends nd{constructor(e,r){super({}),this.childCredentials=e,this.interceptors=r}_isSecure(){return this.childCredentials._isSecure()}_equals(e){if(!(e instanceof t)||!this.childCredentials._equals(e.childCredentials)||this.interceptors.length!==e.interceptors.length)return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r]!==e.interceptors[r])return!1;return!0}_getInterceptors(){return this.interceptors}_addWatcher(e){this.childCredentials._addWatcher(e)}_removeWatcher(e){this.childCredentials._removeWatcher(e)}_getConstructorOptions(){return this.childCredentials._getConstructorOptions()}_getSecureContextOptions(){return this.childCredentials._getSecureContextOptions()}};function i1e(t,e){return new P1(t,e)}});var sS=y(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.durationMessageToDuration=o1e;Ca.msToDuration=s1e;Ca.durationToMs=a1e;Ca.isDuration=c1e;Ca.isDurationMessage=l1e;Ca.parseDuration=d1e;Ca.durationToString=f1e;function o1e(t){return{seconds:Number.parseInt(t.seconds),nanos:t.nanos}}function s1e(t){return{seconds:t/1e3|0,nanos:t%1e3*1e6|0}}function a1e(t){return t.seconds*1e3+t.nanos/1e6|0}function c1e(t){return typeof t.seconds=="number"&&typeof t.nanos=="number"}function l1e(t){return typeof t.seconds=="string"&&typeof t.nanos=="number"}var u1e=/^(\d+)(?:\.(\d+))?s$/;function d1e(t){let e=t.match(u1e);return e?{seconds:Number.parseInt(e[1],10),nanos:e[2]?Number.parseInt(e[2].padEnd(9,"0"),10):0}:null}function f1e(t){if(t.nanos===0)return`${t.seconds}s`;let e;return t.nanos%1e6===0?e=1e6:t.nanos%1e3===0?e=1e3:e=1,`${t.seconds}.${t.nanos/e}s`}});var eR=y(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.OrcaOobMetricsSubchannelWrapper=_i.GRPC_METRICS_HEADER=_i.ServerMetricRecorder=_i.PerRequestMetricRecorder=void 0;_i.createOrcaClient=qte;_i.createMetricsReader=S1e;var p1e=qA(),O1=sS(),h1e=fp(),m1e=iS(),zte=Xe(),g1e=pp(),_1e=In(),jte=null;function Qx(){if(jte)return jte;let t=yL().loadSync,e=t("xds/service/orca/v3/orca.proto",{keepCase:!0,longs:String,enums:String,defaults:!0,oneofs:!0,includeDirs:[`${__dirname}/../../proto/xds`,`${__dirname}/../../proto/protoc-gen-validate`]});return(0,p1e.loadPackageDefinition)(e)}var N1=class{constructor(){this.message={}}recordRequestCostMetric(e,r){this.message.request_cost||(this.message.request_cost={}),this.message.request_cost[e]=r}recordUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}recordNamedMetric(e,r){this.message.named_metrics||(this.message.named_metrics={}),this.message.named_metrics[e]=r}recordCPUUtilizationMetric(e){this.message.cpu_utilization=e}recordMemoryUtilizationMetric(e){this.message.mem_utilization=e}recordApplicationUtilizationMetric(e){this.message.application_utilization=e}recordQpsMetric(e){this.message.rps_fractional=e}recordEpsMetric(e){this.message.eps=e}serialize(){return Qx().xds.data.orca.v3.OrcaLoadReport.serialize(this.message)}};_i.PerRequestMetricRecorder=N1;var y1e=3e4,k1=class{constructor(){this.message={},this.serviceImplementation={StreamCoreMetrics:e=>{let r=e.request.report_interval?(0,O1.durationToMs)((0,O1.durationMessageToDuration)(e.request.report_interval)):y1e,n=setInterval(()=>{e.write(this.message)},r);e.on("cancelled",()=>{clearInterval(n)})}}}putUtilizationMetric(e,r){this.message.utilization||(this.message.utilization={}),this.message.utilization[e]=r}setAllUtilizationMetrics(e){this.message.utilization=Object.assign({},e)}deleteUtilizationMetric(e){var r;(r=this.message.utilization)===null||r===void 0||delete r[e]}setCpuUtilizationMetric(e){this.message.cpu_utilization=e}deleteCpuUtilizationMetric(){delete this.message.cpu_utilization}setApplicationUtilizationMetric(e){this.message.application_utilization=e}deleteApplicationUtilizationMetric(){delete this.message.application_utilization}setQpsMetric(e){this.message.rps_fractional=e}deleteQpsMetric(){delete this.message.rps_fractional}setEpsMetric(e){this.message.eps=e}deleteEpsMetric(){delete this.message.eps}addToServer(e){let r=Qx().xds.service.orca.v3.OpenRcaService.service;e.addService(r,this.serviceImplementation)}};_i.ServerMetricRecorder=k1;function qte(t){let e=Qx().xds.service.orca.v3.OpenRcaService;return new e("unused",h1e.ChannelCredentials.createInsecure(),{channelOverride:t})}_i.GRPC_METRICS_HEADER="endpoint-load-metrics-bin";var Bte="grpc_orca_load_report";function S1e(t,e){return(r,n,i)=>{let o=i.getOpaque(Bte);if(o)t(o);else{let s=i.get(_i.GRPC_METRICS_HEADER);s.length>0&&(o=Qx().xds.data.orca.v3.OrcaLoadReport.deserialize(s[0]),t(o),i.setOpaque(Bte,o))}e&&e(r,n,i)}}var Vte="orca_oob_metrics",M1=class{constructor(e,r){this.metricsListener=e,this.intervalMs=r,this.dataProducer=null}setSubchannel(e){let r=e.getOrCreateDataProducer(Vte,E1e);this.dataProducer=r,r.addDataWatcher(this)}destroy(){var e;(e=this.dataProducer)===null||e===void 0||e.removeDataWatcher(this)}getInterval(){return this.intervalMs}onMetricsUpdate(e){this.metricsListener(e)}},$1=class{constructor(e){this.subchannel=e,this.dataWatchers=new Set,this.orcaSupported=!0,this.metricsCall=null,this.currentInterval=1/0,this.backoffTimer=new g1e.BackoffTimeout(()=>this.updateMetricsSubscription()),this.subchannelStateListener=()=>this.updateMetricsSubscription();let r=e.getChannel();this.client=qte(r),e.addConnectivityStateListener(this.subchannelStateListener)}addDataWatcher(e){this.dataWatchers.add(e),this.updateMetricsSubscription()}removeDataWatcher(e){var r;this.dataWatchers.delete(e),this.dataWatchers.size===0?(this.subchannel.removeDataProducer(Vte),(r=this.metricsCall)===null||r===void 0||r.cancel(),this.metricsCall=null,this.client.close(),this.subchannel.removeConnectivityStateListener(this.subchannelStateListener)):this.updateMetricsSubscription()}updateMetricsSubscription(){var e;if(this.dataWatchers.size===0||!this.orcaSupported||this.subchannel.getConnectivityState()!==_1e.ConnectivityState.READY)return;let r=Math.min(...Array.from(this.dataWatchers).map(n=>n.getInterval()));if(!this.metricsCall||r!==this.currentInterval){(e=this.metricsCall)===null||e===void 0||e.cancel(),this.currentInterval=r;let n=this.client.streamCoreMetrics({report_interval:(0,O1.msToDuration)(r)});this.metricsCall=n,n.on("data",i=>{this.dataWatchers.forEach(o=>{o.onMetricsUpdate(i)})}),n.on("error",i=>{if(this.metricsCall=null,i.code===zte.Status.UNIMPLEMENTED){this.orcaSupported=!1;return}i.code!==zte.Status.CANCELLED&&this.backoffTimer.runOnce()})}}},D1=class extends m1e.BaseSubchannelWrapper{constructor(e,r,n){super(e),this.addDataWatcher(new M1(r,n))}getWrappedSubchannel(){return this.child}};_i.OrcaOobMetricsSubchannelWrapper=D1;function E1e(t){return new $1(t)}});var q1=y(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.BaseServerInterceptingCall=Hi.ServerInterceptingCall=Hi.ResponderBuilder=Hi.ServerListenerBuilder=void 0;Hi.isInterceptingServerListener=T1e;Hi.getServerInterceptingCall=C1e;var nR=Rr(),On=Xe(),zp=Z("http2"),Gte=SA(),Hte=Z("zlib"),v1e=KL(),Jte=Nt(),b1e=Z("tls"),Wte=eR(),Xte="server_call";function id(t){Jte.trace(On.LogVerbosity.DEBUG,Xte,t)}var U1=class{constructor(){this.metadata=void 0,this.message=void 0,this.halfClose=void 0,this.cancel=void 0}withOnReceiveMetadata(e){return this.metadata=e,this}withOnReceiveMessage(e){return this.message=e,this}withOnReceiveHalfClose(e){return this.halfClose=e,this}withOnCancel(e){return this.cancel=e,this}build(){return{onReceiveMetadata:this.metadata,onReceiveMessage:this.message,onReceiveHalfClose:this.halfClose,onCancel:this.cancel}}};Hi.ServerListenerBuilder=U1;function T1e(t){return t.onReceiveMetadata!==void 0&&t.onReceiveMetadata.length===1}var F1=class{constructor(e,r){this.listener=e,this.nextListener=r,this.cancelled=!1,this.processingMetadata=!1,this.hasPendingMessage=!1,this.pendingMessage=null,this.processingMessage=!1,this.hasPendingHalfClose=!1}processPendingMessage(){this.hasPendingMessage&&(this.nextListener.onReceiveMessage(this.pendingMessage),this.pendingMessage=null,this.hasPendingMessage=!1)}processPendingHalfClose(){this.hasPendingHalfClose&&(this.nextListener.onReceiveHalfClose(),this.hasPendingHalfClose=!1)}onReceiveMetadata(e){this.cancelled||(this.processingMetadata=!0,this.listener.onReceiveMetadata(e,r=>{this.processingMetadata=!1,!this.cancelled&&(this.nextListener.onReceiveMetadata(r),this.processPendingMessage(),this.processPendingHalfClose())}))}onReceiveMessage(e){this.cancelled||(this.processingMessage=!0,this.listener.onReceiveMessage(e,r=>{this.processingMessage=!1,!this.cancelled&&(this.processingMetadata?(this.pendingMessage=r,this.hasPendingMessage=!0):(this.nextListener.onReceiveMessage(r),this.processPendingHalfClose()))}))}onReceiveHalfClose(){this.cancelled||this.listener.onReceiveHalfClose(()=>{this.cancelled||(this.processingMetadata||this.processingMessage?this.hasPendingHalfClose=!0:this.nextListener.onReceiveHalfClose())})}onCancel(){this.cancelled=!0,this.listener.onCancel(),this.nextListener.onCancel()}},z1=class{constructor(){this.start=void 0,this.metadata=void 0,this.message=void 0,this.status=void 0}withStart(e){return this.start=e,this}withSendMetadata(e){return this.metadata=e,this}withSendMessage(e){return this.message=e,this}withSendStatus(e){return this.status=e,this}build(){return{start:this.start,sendMetadata:this.metadata,sendMessage:this.message,sendStatus:this.status}}};Hi.ResponderBuilder=z1;var tR={onReceiveMetadata:(t,e)=>{e(t)},onReceiveMessage:(t,e)=>{e(t)},onReceiveHalfClose:t=>{t()},onCancel:()=>{}},rR={start:t=>{t()},sendMetadata:(t,e)=>{e(t)},sendMessage:(t,e)=>{e(t)},sendStatus:(t,e)=>{e(t)}},j1=class{constructor(e,r){var n,i,o,s;this.nextCall=e,this.processingMetadata=!1,this.sentMetadata=!1,this.processingMessage=!1,this.pendingMessage=null,this.pendingMessageCallback=null,this.pendingStatus=null,this.responder={start:(n=r?.start)!==null&&n!==void 0?n:rR.start,sendMetadata:(i=r?.sendMetadata)!==null&&i!==void 0?i:rR.sendMetadata,sendMessage:(o=r?.sendMessage)!==null&&o!==void 0?o:rR.sendMessage,sendStatus:(s=r?.sendStatus)!==null&&s!==void 0?s:rR.sendStatus}}processPendingMessage(){this.pendingMessageCallback&&(this.nextCall.sendMessage(this.pendingMessage,this.pendingMessageCallback),this.pendingMessage=null,this.pendingMessageCallback=null)}processPendingStatus(){this.pendingStatus&&(this.nextCall.sendStatus(this.pendingStatus),this.pendingStatus=null)}start(e){this.responder.start(r=>{var n,i,o,s;let a={onReceiveMetadata:(n=r?.onReceiveMetadata)!==null&&n!==void 0?n:tR.onReceiveMetadata,onReceiveMessage:(i=r?.onReceiveMessage)!==null&&i!==void 0?i:tR.onReceiveMessage,onReceiveHalfClose:(o=r?.onReceiveHalfClose)!==null&&o!==void 0?o:tR.onReceiveHalfClose,onCancel:(s=r?.onCancel)!==null&&s!==void 0?s:tR.onCancel},c=new F1(a,e);this.nextCall.start(c)})}sendMetadata(e){this.processingMetadata=!0,this.sentMetadata=!0,this.responder.sendMetadata(e,r=>{this.processingMetadata=!1,this.nextCall.sendMetadata(r),this.processPendingMessage(),this.processPendingStatus()})}sendMessage(e,r){this.processingMessage=!0,this.sentMetadata||this.sendMetadata(new nR.Metadata),this.responder.sendMessage(e,n=>{this.processingMessage=!1,this.processingMetadata?(this.pendingMessage=n,this.pendingMessageCallback=r):this.nextCall.sendMessage(n,r)})}sendStatus(e){this.responder.sendStatus(e,r=>{this.processingMetadata||this.processingMessage?this.pendingStatus=r:this.nextCall.sendStatus(r)})}startRead(){this.nextCall.startRead()}getPeer(){return this.nextCall.getPeer()}getDeadline(){return this.nextCall.getDeadline()}getHost(){return this.nextCall.getHost()}getAuthContext(){return this.nextCall.getAuthContext()}getConnectionInfo(){return this.nextCall.getConnectionInfo()}getMetricsRecorder(){return this.nextCall.getMetricsRecorder()}};Hi.ServerInterceptingCall=j1;var Qte="grpc-accept-encoding",B1="grpc-encoding",Yte="grpc-message",Kte="grpc-status",L1="grpc-timeout",w1e=/(\d{1,8})\s*([HMSmun])/,A1e={H:36e5,M:6e4,S:1e3,m:1,u:.001,n:1e-6},x1e={[Qte]:"identity,deflate,gzip",[B1]:"identity"},Zte={[zp.constants.HTTP2_HEADER_STATUS]:zp.constants.HTTP_STATUS_OK,[zp.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},R1e={waitForTrailers:!0},iR=class{constructor(e,r,n,i,o){var s,a;this.stream=e,this.callEventTracker=n,this.handler=i,this.listener=null,this.deadlineTimer=null,this.deadline=1/0,this.maxSendMessageSize=On.DEFAULT_MAX_SEND_MESSAGE_LENGTH,this.maxReceiveMessageSize=On.DEFAULT_MAX_RECEIVE_MESSAGE_LENGTH,this.cancelled=!1,this.metadataSent=!1,this.wantTrailers=!1,this.cancelNotified=!1,this.incomingEncoding="identity",this.readQueue=[],this.isReadPending=!1,this.receivedHalfClose=!1,this.streamEnded=!1,this.metricsRecorder=new Wte.PerRequestMetricRecorder,this.stream.once("close",()=>{var f;id("Request to method "+((f=this.handler)===null||f===void 0?void 0:f.path)+" stream closed with rstCode "+this.stream.rstCode),this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!1),this.callEventTracker.onCallEnd({code:On.Status.CANCELLED,details:"Stream closed before sending status",metadata:null})),this.notifyOnCancel()}),this.stream.on("data",f=>{this.handleDataFrame(f)}),this.stream.pause(),this.stream.on("end",()=>{this.handleEndEvent()}),"grpc.max_send_message_length"in o&&(this.maxSendMessageSize=o["grpc.max_send_message_length"]),"grpc.max_receive_message_length"in o&&(this.maxReceiveMessageSize=o["grpc.max_receive_message_length"]),this.host=(s=r[":authority"])!==null&&s!==void 0?s:r.host,this.decoder=new v1e.StreamDecoder(this.maxReceiveMessageSize);let c=nR.Metadata.fromHttp2Headers(r);Jte.isTracerEnabled(Xte)&&id("Request to "+this.handler.path+" received headers "+JSON.stringify(c.toJSON()));let l=c.get(L1);l.length>0&&this.handleTimeoutHeader(l[0]);let u=c.get(B1);u.length>0&&(this.incomingEncoding=u[0]),c.remove(L1),c.remove(B1),c.remove(Qte),c.remove(zp.constants.HTTP2_HEADER_ACCEPT_ENCODING),c.remove(zp.constants.HTTP2_HEADER_TE),c.remove(zp.constants.HTTP2_HEADER_CONTENT_TYPE),this.metadata=c;let d=(a=e.session)===null||a===void 0?void 0:a.socket;this.connectionInfo={localAddress:d?.localAddress,localPort:d?.localPort,remoteAddress:d?.remoteAddress,remotePort:d?.remotePort},this.shouldSendMetrics=!!o["grpc.server_call_metric_recording"]}handleTimeoutHeader(e){let r=e.toString().match(w1e);if(r===null){let o={code:On.Status.INTERNAL,details:`Invalid ${L1} value "${e}"`,metadata:null};process.nextTick(()=>{this.sendStatus(o)});return}let n=+r[1]*A1e[r[2]]|0,i=new Date;this.deadline=i.setMilliseconds(i.getMilliseconds()+n),this.deadlineTimer=setTimeout(()=>{let o={code:On.Status.DEADLINE_EXCEEDED,details:"Deadline exceeded",metadata:null};this.sendStatus(o)},n)}checkCancelled(){return!this.cancelled&&(this.stream.destroyed||this.stream.closed)&&(this.notifyOnCancel(),this.cancelled=!0),this.cancelled}notifyOnCancel(){this.cancelNotified||(this.cancelNotified=!0,this.cancelled=!0,process.nextTick(()=>{var e;(e=this.listener)===null||e===void 0||e.onCancel()}),this.deadlineTimer&&clearTimeout(this.deadlineTimer),this.stream.resume())}maybeSendMetadata(){this.metadataSent||this.sendMetadata(new nR.Metadata)}serializeMessage(e){let r=this.handler.serialize(e),n=r.byteLength,i=Buffer.allocUnsafe(n+5);return i.writeUInt8(0,0),i.writeUInt32BE(n,1),r.copy(i,5),i}decompressMessage(e,r){let n=e.subarray(5);if(r==="identity")return n;if(r==="deflate"||r==="gzip"){let i;return r==="deflate"?i=Hte.createInflate():i=Hte.createGunzip(),new Promise((o,s)=>{let a=0,c=[];i.on("error",l=>{s({code:On.Status.INTERNAL,details:"Failed to decompress message"})}),i.on("data",l=>{c.push(l),a+=l.byteLength,this.maxReceiveMessageSize!==-1&&a>this.maxReceiveMessageSize&&(i.destroy(),s({code:On.Status.RESOURCE_EXHAUSTED,details:`Received message that decompresses to a size larger than ${this.maxReceiveMessageSize}`}))}),i.on("end",()=>{o(Buffer.concat(c))}),i.write(n),i.end()})}else return Promise.reject({code:On.Status.UNIMPLEMENTED,details:`Received message compressed with unsupported encoding "${r}"`})}async decompressAndMaybePush(e){if(e.type!=="COMPRESSED")throw new Error(`Invalid queue entry type: ${e.type}`);let n=e.compressedMessage.readUInt8(0)===1?this.incomingEncoding:"identity",i;try{i=await this.decompressMessage(e.compressedMessage,n)}catch(o){this.sendStatus(o);return}try{e.parsedMessage=this.handler.deserialize(i)}catch(o){this.sendStatus({code:On.Status.INTERNAL,details:`Error deserializing request: ${o.message}`});return}e.type="READABLE",this.maybePushNextMessage()}maybePushNextMessage(){if(this.listener&&this.isReadPending&&this.readQueue.length>0&&this.readQueue[0].type!=="COMPRESSED"){this.isReadPending=!1;let e=this.readQueue.shift();e.type==="READABLE"?this.listener.onReceiveMessage(e.parsedMessage):this.listener.onReceiveHalfClose()}}handleDataFrame(e){var r;if(this.checkCancelled())return;id("Request to "+this.handler.path+" received data frame of size "+e.length);let n;try{n=this.decoder.write(e)}catch(i){this.sendStatus({code:On.Status.RESOURCE_EXHAUSTED,details:i.message});return}for(let i of n){this.stream.pause();let o={type:"COMPRESSED",compressedMessage:i,parsedMessage:null};this.readQueue.push(o),this.decompressAndMaybePush(o),(r=this.callEventTracker)===null||r===void 0||r.addMessageReceived()}}handleEndEvent(){this.readQueue.push({type:"HALF_CLOSE",compressedMessage:null,parsedMessage:null}),this.receivedHalfClose=!0,this.maybePushNextMessage()}start(e){id("Request to "+this.handler.path+" start called"),!this.checkCancelled()&&(this.listener=e,e.onReceiveMetadata(this.metadata))}sendMetadata(e){if(this.checkCancelled()||this.metadataSent)return;this.metadataSent=!0;let r=e?e.toHttp2Headers():null,n=Object.assign(Object.assign(Object.assign({},Zte),x1e),r);this.stream.respond(n,R1e)}sendMessage(e,r){if(this.checkCancelled())return;let n;try{n=this.serializeMessage(e)}catch(i){this.sendStatus({code:On.Status.INTERNAL,details:`Error serializing response: ${(0,Gte.getErrorMessage)(i)}`,metadata:null});return}if(this.maxSendMessageSize!==-1&&n.length-5>this.maxSendMessageSize){this.sendStatus({code:On.Status.RESOURCE_EXHAUSTED,details:`Sent message larger than max (${n.length} vs. ${this.maxSendMessageSize})`,metadata:null});return}this.maybeSendMetadata(),id("Request to "+this.handler.path+" sent data frame of size "+n.length),this.stream.write(n,i=>{var o;if(i){this.sendStatus({code:On.Status.INTERNAL,details:`Error writing message: ${(0,Gte.getErrorMessage)(i)}`,metadata:null});return}(o=this.callEventTracker)===null||o===void 0||o.addMessageSent(),r()})}sendStatus(e){var r,n,i;if(this.checkCancelled())return;id("Request to method "+((r=this.handler)===null||r===void 0?void 0:r.path)+" ended with status code: "+On.Status[e.code]+" details: "+e.details);let o=(i=(n=e.metadata)===null||n===void 0?void 0:n.clone())!==null&&i!==void 0?i:new nR.Metadata;if(this.shouldSendMetrics&&o.set(Wte.GRPC_METRICS_HEADER,this.metricsRecorder.serialize()),this.metadataSent)this.wantTrailers?this.notifyOnCancel():(this.wantTrailers=!0,this.stream.once("wantTrailers",()=>{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign({[Kte]:e.code,[Yte]:encodeURI(e.details)},o.toHttp2Headers());this.stream.sendTrailers(s),this.notifyOnCancel()}),this.stream.end());else{this.callEventTracker&&!this.streamEnded&&(this.streamEnded=!0,this.callEventTracker.onStreamEnd(!0),this.callEventTracker.onCallEnd(e));let s=Object.assign(Object.assign({[Kte]:e.code,[Yte]:encodeURI(e.details)},Zte),o.toHttp2Headers());this.stream.respond(s,{endStream:!0}),this.notifyOnCancel()}}startRead(){id("Request to "+this.handler.path+" startRead called"),!this.checkCancelled()&&(this.isReadPending=!0,this.readQueue.length===0?this.receivedHalfClose||this.stream.resume():this.maybePushNextMessage())}getPeer(){var e;let r=(e=this.stream.session)===null||e===void 0?void 0:e.socket;return r?.remoteAddress?r.remotePort?`${r.remoteAddress}:${r.remotePort}`:r.remoteAddress:"unknown"}getDeadline(){return this.deadline}getHost(){return this.host}getAuthContext(){var e;if(((e=this.stream.session)===null||e===void 0?void 0:e.socket)instanceof b1e.TLSSocket){let r=this.stream.session.socket.getPeerCertificate();return{transportSecurityType:"ssl",sslPeerCertificate:r.raw?r:void 0}}else return{}}getConnectionInfo(){return this.connectionInfo}getMetricsRecorder(){return this.metricsRecorder}};Hi.BaseServerInterceptingCall=iR;function C1e(t,e,r,n,i,o){let s={path:i.path,requestStream:i.type==="clientStream"||i.type==="bidi",responseStream:i.type==="serverStream"||i.type==="bidi",requestDeserialize:i.deserialize,responseSerialize:i.serialize},a=new iR(e,r,n,i,o);return t.reduce((c,l)=>l(s,c),a)}});var sre=y(Jc=>{"use strict";var I1e=Jc&&Jc.__runInitializers||function(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0},P1e=Jc&&Jc.__esDecorate||function(t,e,r,n,i,o){function s(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var h={};for(var m in n)h[m]=m==="access"?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(_){if(f)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(_||null))};var g=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],h);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=s(g.get))&&(u.get=d),(d=s(g.set))&&(u.set=d),(d=s(g.init))&&i.unshift(d)}else(d=s(g))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.Server=void 0;var Wn=Z("http2"),O1e=Z("util"),rr=Xe(),qp=Fte(),V1=Xx(),ere=mo(),Bp=Nt(),Zc=Gn(),Io=Cn(),_r=Gc(),tre=q1(),jp=~(1<<31),G1=~(1<<31),N1e=2e4,rre=~(1<<31),{HTTP2_HEADER_PATH:nre}=Wn.constants,k1e="server",ire=Buffer.from("max_age");function ore(t){Bp.trace(rr.LogVerbosity.DEBUG,"server_call",t)}function M1e(){}function $1e(t){return function(e,r){return O1e.deprecate(e,t)}}function H1(t){return{code:rr.Status.UNIMPLEMENTED,details:`The server does not implement the method ${t}`}}function D1e(t,e){let r=H1(e);switch(t){case"unary":return(n,i)=>{i(r,null)};case"clientStream":return(n,i)=>{i(r,null)};case"serverStream":return n=>{n.emit("error",r)};case"bidi":return n=>{n.emit("error",r)};default:throw new Error(`Invalid handlerType ${t}`)}}var L1e=(()=>{var t;let e=[],r;return t=class{constructor(i){var o,s,a,c,l,u;this.boundPorts=(I1e(this,e),new Map),this.http2Servers=new Map,this.sessionIdleTimeouts=new Map,this.handlers=new Map,this.sessions=new Map,this.started=!1,this.shutdown=!1,this.serverAddressString="null",this.channelzEnabled=!0,this.options=i??{},this.options["grpc.enable_channelz"]===0?(this.channelzEnabled=!1,this.channelzTrace=new _r.ChannelzTraceStub,this.callTracker=new _r.ChannelzCallTrackerStub,this.listenerChildrenTracker=new _r.ChannelzChildrenTrackerStub,this.sessionChildrenTracker=new _r.ChannelzChildrenTrackerStub):(this.channelzTrace=new _r.ChannelzTrace,this.callTracker=new _r.ChannelzCallTracker,this.listenerChildrenTracker=new _r.ChannelzChildrenTracker,this.sessionChildrenTracker=new _r.ChannelzChildrenTracker),this.channelzRef=(0,_r.registerChannelzServer)("server",()=>this.getChannelzInfo(),this.channelzEnabled),this.channelzTrace.addTrace("CT_INFO","Server created"),this.maxConnectionAgeMs=(o=this.options["grpc.max_connection_age_ms"])!==null&&o!==void 0?o:jp,this.maxConnectionAgeGraceMs=(s=this.options["grpc.max_connection_age_grace_ms"])!==null&&s!==void 0?s:jp,this.keepaliveTimeMs=(a=this.options["grpc.keepalive_time_ms"])!==null&&a!==void 0?a:G1,this.keepaliveTimeoutMs=(c=this.options["grpc.keepalive_timeout_ms"])!==null&&c!==void 0?c:N1e,this.sessionIdleTimeout=(l=this.options["grpc.max_connection_idle_ms"])!==null&&l!==void 0?l:rre,this.commonServerOptions={maxSendHeaderBlockLength:Number.MAX_SAFE_INTEGER},"grpc-node.max_session_memory"in this.options?this.commonServerOptions.maxSessionMemory=this.options["grpc-node.max_session_memory"]:this.commonServerOptions.maxSessionMemory=Number.MAX_SAFE_INTEGER,"grpc.max_concurrent_streams"in this.options&&(this.commonServerOptions.settings={maxConcurrentStreams:this.options["grpc.max_concurrent_streams"]}),this.interceptors=(u=this.options.interceptors)!==null&&u!==void 0?u:[],this.trace("Server constructed")}getChannelzInfo(){return{trace:this.channelzTrace,callTracker:this.callTracker,listenerChildren:this.listenerChildrenTracker.getChildLists(),sessionChildren:this.sessionChildrenTracker.getChildLists()}}getChannelzSessionInfo(i){var o,s,a;let c=this.sessions.get(i),l=i.socket,u=l.remoteAddress?(0,Zc.stringToSubchannelAddress)(l.remoteAddress,l.remotePort):null,d=l.localAddress?(0,Zc.stringToSubchannelAddress)(l.localAddress,l.localPort):null,f;if(i.encrypted){let h=l,m=h.getCipher(),g=h.getCertificate(),_=h.getPeerCertificate();f={cipherSuiteStandardName:(o=m.standardName)!==null&&o!==void 0?o:null,cipherSuiteOtherName:m.standardName?null:m.name,localCertificate:g&&"raw"in g?g.raw:null,remoteCertificate:_&&"raw"in _?_.raw:null}}else f=null;return{remoteAddress:u,localAddress:d,security:f,remoteName:null,streamsStarted:c.streamTracker.callsStarted,streamsSucceeded:c.streamTracker.callsSucceeded,streamsFailed:c.streamTracker.callsFailed,messagesSent:c.messagesSent,messagesReceived:c.messagesReceived,keepAlivesSent:c.keepAlivesSent,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:c.streamTracker.lastCallStartedTimestamp,lastMessageSentTimestamp:c.lastMessageSentTimestamp,lastMessageReceivedTimestamp:c.lastMessageReceivedTimestamp,localFlowControlWindow:(s=i.state.localWindowSize)!==null&&s!==void 0?s:null,remoteFlowControlWindow:(a=i.state.remoteWindowSize)!==null&&a!==void 0?a:null}}trace(i){Bp.trace(rr.LogVerbosity.DEBUG,k1e,"("+this.channelzRef.id+") "+i)}keepaliveTrace(i){Bp.trace(rr.LogVerbosity.DEBUG,"keepalive","("+this.channelzRef.id+") "+i)}addProtoService(){throw new Error("Not implemented. Use addService() instead")}addService(i,o){if(i===null||typeof i!="object"||o===null||typeof o!="object")throw new Error("addService() requires two objects as arguments");let s=Object.keys(i);if(s.length===0)throw new Error("Cannot add an empty service to a server");s.forEach(a=>{let c=i[a],l;c.requestStream?c.responseStream?l="bidi":l="clientStream":c.responseStream?l="serverStream":l="unary";let u=o[a],d;if(u===void 0&&typeof c.originalName=="string"&&(u=o[c.originalName]),u!==void 0?d=u.bind(o):d=D1e(l,a),this.register(c.path,d,c.responseSerialize,c.requestDeserialize,l)===!1)throw new Error(`Method handler for ${c.path} already provided.`)})}removeService(i){if(i===null||typeof i!="object")throw new Error("removeService() requires object as argument");Object.keys(i).forEach(s=>{let a=i[s];this.unregister(a.path)})}bind(i,o){throw new Error("Not implemented. Use bindAsync() instead")}experimentalRegisterListenerToChannelz(i){return(0,_r.registerChannelzSocket)((0,Zc.subchannelAddressToString)(i),()=>({localAddress:i,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalUnregisterListenerFromChannelz(i){(0,_r.unregisterChannelzRef)(i)}createHttp2Server(i){let o;if(i._isSecure()){let s=i._getConstructorOptions(),a=i._getSecureContextOptions(),c=Object.assign(Object.assign(Object.assign(Object.assign({},this.commonServerOptions),s),a),{enableTrace:this.options["grpc-node.tls_enable_trace"]===1}),l=a!==null;this.trace("Initial credentials valid: "+l),o=Wn.createSecureServer(c),o.prependListener("connection",d=>{l||(this.trace("Dropped connection from "+JSON.stringify(d.address())+" due to unloaded credentials"),d.destroy())}),o.on("secureConnection",d=>{d.on("error",f=>{this.trace("An incoming TLS connection closed with error: "+f.message)})});let u=d=>{if(d){let f=o;try{f.setSecureContext(d)}catch(p){Bp.log(rr.LogVerbosity.ERROR,"Failed to set secure context with error "+p.message),d=null}}l=d!==null,this.trace("Post-update credentials valid: "+l)};i._addWatcher(u),o.on("close",()=>{i._removeWatcher(u)})}else o=Wn.createServer(this.commonServerOptions);return o.setTimeout(0,M1e),this._setupHandlers(o,i._getInterceptors()),o}bindOneAddress(i,o){this.trace("Attempting to bind "+(0,Zc.subchannelAddressToString)(i));let s=this.createHttp2Server(o.credentials);return new Promise((a,c)=>{let l=u=>{this.trace("Failed to bind "+(0,Zc.subchannelAddressToString)(i)+" with error "+u.message),a({port:"port"in i?i.port:1,error:u.message})};s.once("error",l),s.listen(i,()=>{let u=s.address(),d;typeof u=="string"?d={path:u}:d={host:u.address,port:u.port};let f=this.experimentalRegisterListenerToChannelz(d);this.listenerChildrenTracker.refChild(f),this.http2Servers.set(s,{channelzRef:f,sessions:new Set,ownsChannelzRef:!0}),o.listeningServers.add(s),this.trace("Successfully bound "+(0,Zc.subchannelAddressToString)(d)),a({port:"port"in d?d.port:1}),s.removeListener("error",l)})})}async bindManyPorts(i,o){if(i.length===0)return{count:0,port:0,errors:[]};if((0,Zc.isTcpSubchannelAddress)(i[0])&&i[0].port===0){let s=await this.bindOneAddress(i[0],o);if(s.error){let a=await this.bindManyPorts(i.slice(1),o);return Object.assign(Object.assign({},a),{errors:[s.error,...a.errors]})}else{let a=i.slice(1).map(u=>(0,Zc.isTcpSubchannelAddress)(u)?{host:u.host,port:s.port}:u),c=await Promise.all(a.map(u=>this.bindOneAddress(u,o))),l=[s,...c];return{count:l.filter(u=>u.error===void 0).length,port:s.port,errors:l.filter(u=>u.error).map(u=>u.error)}}}else{let s=await Promise.all(i.map(a=>this.bindOneAddress(a,o)));return{count:s.filter(a=>a.error===void 0).length,port:s[0].port,errors:s.filter(a=>a.error).map(a=>a.error)}}}async bindAddressList(i,o){let s=await this.bindManyPorts(i,o);if(s.count>0)return s.count<i.length&&Bp.log(rr.LogVerbosity.INFO,`WARNING Only ${s.count} addresses added out of total ${i.length} resolved`),s.port;{let a=`No address added out of total ${i.length} resolved`;throw Bp.log(rr.LogVerbosity.ERROR,a),new Error(`${a} errors: [${s.errors.join(",")}]`)}}resolvePort(i){return new Promise((o,s)=>{let a=!1,c=(u,d,f,p)=>{if(a)return!0;if(a=!0,!u.ok)return s(new Error(u.error.details)),!0;let h=[].concat(...u.value.map(m=>m.addresses));return h.length===0?(s(new Error(`No addresses resolved for port ${i}`)),!0):(o(h),!0)};(0,ere.createResolver)(i,c,this.options).updateResolution()})}async bindPort(i,o){let s=await this.resolvePort(i);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");let a=await this.bindAddressList(s,o);if(o.cancelled)throw this.completeUnbind(o),new Error("bindAsync operation cancelled by unbind call");return a}normalizePort(i){let o=(0,Io.parseUri)(i);if(o===null)throw new Error(`Could not parse port "${i}"`);let s=(0,ere.mapUriDefaultScheme)(o);if(s===null)throw new Error(`Could not get a default scheme for port "${i}"`);return s}bindAsync(i,o,s){if(this.shutdown)throw new Error("bindAsync called after shutdown");if(typeof i!="string")throw new TypeError("port must be a string");if(o===null||!(o instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");if(typeof s!="function")throw new TypeError("callback must be a function");this.trace("bindAsync port="+i);let a=this.normalizePort(i),c=(f,p)=>{process.nextTick(()=>s(f,p))},l=this.boundPorts.get((0,Io.uriToString)(a));if(l){if(!o._equals(l.credentials)){c(new Error(`${i} already bound with incompatible credentials`),0);return}l.cancelled=!1,l.completionPromise?l.completionPromise.then(f=>s(null,f),f=>s(f,0)):c(null,l.portNumber);return}l={mapKey:(0,Io.uriToString)(a),originalUri:a,completionPromise:null,cancelled:!1,portNumber:0,credentials:o,listeningServers:new Set};let u=(0,Io.splitHostPort)(a.path),d=this.bindPort(a,l);l.completionPromise=d,u?.port===0?d.then(f=>{let p={scheme:a.scheme,authority:a.authority,path:(0,Io.combineHostPort)({host:u.host,port:f})};l.mapKey=(0,Io.uriToString)(p),l.completionPromise=null,l.portNumber=f,this.boundPorts.set(l.mapKey,l),s(null,f)},f=>{s(f,0)}):(this.boundPorts.set(l.mapKey,l),d.then(f=>{l.completionPromise=null,l.portNumber=f,s(null,f)},f=>{s(f,0)}))}registerInjectorToChannelz(){return(0,_r.registerChannelzSocket)("injector",()=>({localAddress:null,remoteAddress:null,security:null,remoteName:null,streamsStarted:0,streamsSucceeded:0,streamsFailed:0,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastLocalStreamCreatedTimestamp:null,lastRemoteStreamCreatedTimestamp:null,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null,localFlowControlWindow:null,remoteFlowControlWindow:null}),this.channelzEnabled)}experimentalCreateConnectionInjectorWithChannelzRef(i,o,s=!1){if(i===null||!(i instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");this.channelzEnabled&&this.listenerChildrenTracker.refChild(o);let a=this.createHttp2Server(i),c=new Set;return this.http2Servers.set(a,{channelzRef:o,sessions:c,ownsChannelzRef:s}),{injectConnection:l=>{a.emit("connection",l)},drain:l=>{var u,d;for(let f of c)this.closeSession(f);(d=(u=setTimeout(()=>{for(let f of c)f.destroy(Wn.constants.NGHTTP2_CANCEL)},l)).unref)===null||d===void 0||d.call(u)},destroy:()=>{this.closeServer(a);for(let l of c)this.closeSession(l)}}}createConnectionInjector(i){if(i===null||!(i instanceof V1.ServerCredentials))throw new TypeError("creds must be a ServerCredentials object");let o=this.registerInjectorToChannelz();return this.experimentalCreateConnectionInjectorWithChannelzRef(i,o,!0)}closeServer(i,o){this.trace("Closing server with address "+JSON.stringify(i.address()));let s=this.http2Servers.get(i);i.close(()=>{s&&s.ownsChannelzRef&&(this.listenerChildrenTracker.unrefChild(s.channelzRef),(0,_r.unregisterChannelzRef)(s.channelzRef)),this.http2Servers.delete(i),o?.()})}closeSession(i,o){var s;this.trace("Closing session initiated by "+((s=i.socket)===null||s===void 0?void 0:s.remoteAddress));let a=this.sessions.get(i),c=()=>{a&&(this.sessionChildrenTracker.unrefChild(a.ref),(0,_r.unregisterChannelzRef)(a.ref)),o?.()};i.closed?queueMicrotask(c):i.close(c)}completeUnbind(i){for(let o of i.listeningServers){let s=this.http2Servers.get(o);if(this.closeServer(o,()=>{i.listeningServers.delete(o)}),s)for(let a of s.sessions)this.closeSession(a)}this.boundPorts.delete(i.mapKey)}unbind(i){this.trace("unbind port="+i);let o=this.normalizePort(i),s=(0,Io.splitHostPort)(o.path);if(s?.port===0)throw new Error("Cannot unbind port 0");let a=this.boundPorts.get((0,Io.uriToString)(o));a&&(this.trace("unbinding "+a.mapKey+" originally bound as "+(0,Io.uriToString)(a.originalUri)),a.completionPromise?a.cancelled=!0:this.completeUnbind(a))}drain(i,o){var s,a;this.trace("drain port="+i+" graceTimeMs="+o);let c=this.normalizePort(i),l=(0,Io.splitHostPort)(c.path);if(l?.port===0)throw new Error("Cannot drain port 0");let u=this.boundPorts.get((0,Io.uriToString)(c));if(!u)return;let d=new Set;for(let f of u.listeningServers){let p=this.http2Servers.get(f);if(p)for(let h of p.sessions)d.add(h),this.closeSession(h,()=>{d.delete(h)})}(a=(s=setTimeout(()=>{for(let f of d)f.destroy(Wn.constants.NGHTTP2_CANCEL)},o)).unref)===null||a===void 0||a.call(s)}forceShutdown(){for(let i of this.boundPorts.values())i.cancelled=!0;this.boundPorts.clear();for(let i of this.http2Servers.keys())this.closeServer(i);this.sessions.forEach((i,o)=>{this.closeSession(o),o.destroy(Wn.constants.NGHTTP2_CANCEL)}),this.sessions.clear(),(0,_r.unregisterChannelzRef)(this.channelzRef),this.shutdown=!0}register(i,o,s,a,c){return this.handlers.has(i)?!1:(this.handlers.set(i,{func:o,serialize:s,deserialize:a,type:c,path:i}),!0)}unregister(i){return this.handlers.delete(i)}start(){if(this.http2Servers.size===0||[...this.http2Servers.keys()].every(i=>!i.listening))throw new Error("server must be bound in order to start");if(this.started===!0)throw new Error("server is already started");this.started=!0}tryShutdown(i){var o;let s=l=>{(0,_r.unregisterChannelzRef)(this.channelzRef),i(l)},a=0;function c(){a--,a===0&&s()}this.shutdown=!0;for(let[l,u]of this.http2Servers.entries()){a++;let d=u.channelzRef.name;this.trace("Waiting for server "+d+" to close"),this.closeServer(l,()=>{this.trace("Server "+d+" finished closing"),c()});for(let f of u.sessions.keys()){a++;let p=(o=f.socket)===null||o===void 0?void 0:o.remoteAddress;this.trace("Waiting for session "+p+" to close"),this.closeSession(f,()=>{this.trace("Session "+p+" finished closing"),c()})}}a===0&&s()}addHttp2Port(){throw new Error("Not yet implemented")}getChannelzRef(){return this.channelzRef}_verifyContentType(i,o){let s=o[Wn.constants.HTTP2_HEADER_CONTENT_TYPE];return typeof s!="string"||!s.startsWith("application/grpc")?(i.respond({[Wn.constants.HTTP2_HEADER_STATUS]:Wn.constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE},{endStream:!0}),!1):!0}_retrieveHandler(i){ore("Received call to method "+i+" at address "+this.serverAddressString);let o=this.handlers.get(i);return o===void 0?(ore("No handler registered for method "+i+". Sending UNIMPLEMENTED status."),null):o}_respondWithError(i,o,s=null){var a,c;let l=Object.assign({"grpc-status":(a=i.code)!==null&&a!==void 0?a:rr.Status.INTERNAL,"grpc-message":i.details,[Wn.constants.HTTP2_HEADER_STATUS]:Wn.constants.HTTP_STATUS_OK,[Wn.constants.HTTP2_HEADER_CONTENT_TYPE]:"application/grpc+proto"},(c=i.metadata)===null||c===void 0?void 0:c.toHttp2Headers());o.respond(l,{endStream:!0}),this.callTracker.addCallFailed(),s?.streamTracker.addCallFailed()}_channelzHandler(i,o,s){o.once("error",f=>{}),this.onStreamOpened(o);let a=this.sessions.get(o.session);if(this.callTracker.addCallStarted(),a?.streamTracker.addCallStarted(),!this._verifyContentType(o,s)){this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed();return}let c=s[nre],l=this._retrieveHandler(c);if(!l){this._respondWithError(H1(c),o,a);return}let u={addMessageSent:()=>{a&&(a.messagesSent+=1,a.lastMessageSentTimestamp=new Date)},addMessageReceived:()=>{a&&(a.messagesReceived+=1,a.lastMessageReceivedTimestamp=new Date)},onCallEnd:f=>{f.code===rr.Status.OK?this.callTracker.addCallSucceeded():this.callTracker.addCallFailed()},onStreamEnd:f=>{a&&(f?a.streamTracker.addCallSucceeded():a.streamTracker.addCallFailed())}},d=(0,tre.getServerInterceptingCall)([...i,...this.interceptors],o,s,u,l,this.options);this._runHandlerForCall(d,l)||(this.callTracker.addCallFailed(),a?.streamTracker.addCallFailed(),d.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${l.type}`}))}_streamHandler(i,o,s){if(o.once("error",u=>{}),this.onStreamOpened(o),this._verifyContentType(o,s)!==!0)return;let a=s[nre],c=this._retrieveHandler(a);if(!c){this._respondWithError(H1(a),o,null);return}let l=(0,tre.getServerInterceptingCall)([...i,...this.interceptors],o,s,null,c,this.options);this._runHandlerForCall(l,c)||l.sendStatus({code:rr.Status.INTERNAL,details:`Unknown handler type: ${c.type}`})}_runHandlerForCall(i,o){let{type:s}=o;if(s==="unary")U1e(i,o);else if(s==="clientStream")F1e(i,o);else if(s==="serverStream")z1e(i,o);else if(s==="bidi")j1e(i,o);else return!1;return!0}_setupHandlers(i,o){if(i===null)return;let s=i.address(),a="null";s&&(typeof s=="string"?a=s:a=s.address+":"+s.port),this.serverAddressString=a;let c=this.channelzEnabled?this._channelzHandler:this._streamHandler,l=this.channelzEnabled?this._channelzSessionHandler(i):this._sessionHandler(i);i.on("stream",c.bind(this,o)),i.on("session",l)}_sessionHandler(i){return o=>{var s,a;(s=this.http2Servers.get(i))===null||s===void 0||s.sessions.add(o);let c=null,l=null,u=null,d=!1,f=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==jp){let _=this.maxConnectionAgeMs/10,b=Math.random()*_*2-_;c=setTimeout(()=>{var T,E;d=!0,this.trace("Connection dropped by max connection age: "+((T=o.socket)===null||T===void 0?void 0:T.remoteAddress));try{o.goaway(Wn.constants.NGHTTP2_NO_ERROR,~(1<<31),ire)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==jp&&(l=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(E=l.unref)===null||E===void 0||E.call(l))},this.maxConnectionAgeMs+b),(a=c.unref)===null||a===void 0||a.call(c)}let p=()=>{u&&(clearTimeout(u),u=null)},h=()=>!o.destroyed&&this.keepaliveTimeMs<G1&&this.keepaliveTimeMs>0,m,g=()=>{var _;h()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),u=setTimeout(()=>{p(),m()},this.keepaliveTimeMs),(_=u.unref)===null||_===void 0||_.call(u))};m=()=>{var _;if(!h())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let b="";try{o.ping((E,A,O)=>{p(),E?(this.keepaliveTrace("Ping failed with error: "+E.message),d=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),g())})||(b="Ping returned false")}catch(T){b=(T instanceof Error?T.message:"")||"Unknown error"}if(b){this.keepaliveTrace("Ping send failed: "+b),this.trace("Connection dropped due to ping send error: "+b),d=!0,o.destroy();return}u=setTimeout(()=>{p(),this.keepaliveTrace("Ping timeout passed without response"),this.trace("Connection dropped by keepalive timeout"),d=!0,o.destroy()},this.keepaliveTimeoutMs),(_=u.unref)===null||_===void 0||_.call(u)},g(),o.on("close",()=>{var _,b;d||this.trace(`Connection dropped by client ${(_=o.socket)===null||_===void 0?void 0:_.remoteAddress}`),c&&clearTimeout(c),l&&clearTimeout(l),p(),f!==null&&(clearTimeout(f.timeout),this.sessionIdleTimeouts.delete(o)),(b=this.http2Servers.get(i))===null||b===void 0||b.sessions.delete(o)})}}_channelzSessionHandler(i){return o=>{var s,a,c,l;let u=(0,_r.registerChannelzSocket)((a=(s=o.socket)===null||s===void 0?void 0:s.remoteAddress)!==null&&a!==void 0?a:"unknown",this.getChannelzSessionInfo.bind(this,o),this.channelzEnabled),d={ref:u,streamTracker:new _r.ChannelzCallTracker,messagesSent:0,messagesReceived:0,keepAlivesSent:0,lastMessageSentTimestamp:null,lastMessageReceivedTimestamp:null};(c=this.http2Servers.get(i))===null||c===void 0||c.sessions.add(o),this.sessions.set(o,d);let f=`${o.socket.remoteAddress}:${o.socket.remotePort}`;this.channelzTrace.addTrace("CT_INFO","Connection established by client "+f),this.trace("Connection established by client "+f),this.sessionChildrenTracker.refChild(u);let p=null,h=null,m=null,g=!1,_=this.enableIdleTimeout(o);if(this.maxConnectionAgeMs!==jp){let O=this.maxConnectionAgeMs/10,R=Math.random()*O*2-O;p=setTimeout(()=>{var N;g=!0,this.channelzTrace.addTrace("CT_INFO","Connection dropped by max connection age from "+f);try{o.goaway(Wn.constants.NGHTTP2_NO_ERROR,~(1<<31),ire)}catch{o.destroy();return}o.close(),this.maxConnectionAgeGraceMs!==jp&&(h=setTimeout(()=>{o.destroy()},this.maxConnectionAgeGraceMs),(N=h.unref)===null||N===void 0||N.call(h))},this.maxConnectionAgeMs+R),(l=p.unref)===null||l===void 0||l.call(p)}let b=()=>{m&&(clearTimeout(m),m=null)},T=()=>!o.destroyed&&this.keepaliveTimeMs<G1&&this.keepaliveTimeMs>0,E,A=()=>{var O;T()&&(this.keepaliveTrace("Starting keepalive timer for "+this.keepaliveTimeMs+"ms"),m=setTimeout(()=>{b(),E()},this.keepaliveTimeMs),(O=m.unref)===null||O===void 0||O.call(m))};E=()=>{var O;if(!T())return;this.keepaliveTrace("Sending ping with timeout "+this.keepaliveTimeoutMs+"ms");let R="";try{o.ping((M,L,v)=>{b(),M?(this.keepaliveTrace("Ping failed with error: "+M.message),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to error of a ping frame "+M.message+" return in "+L),g=!0,o.destroy()):(this.keepaliveTrace("Received ping response"),A())})||(R="Ping returned false")}catch(N){R=(N instanceof Error?N.message:"")||"Unknown error"}if(R){this.keepaliveTrace("Ping send failed: "+R),this.channelzTrace.addTrace("CT_INFO","Connection dropped due to ping send error: "+R),g=!0,o.destroy();return}d.keepAlivesSent+=1,m=setTimeout(()=>{b(),this.keepaliveTrace("Ping timeout passed without response"),this.channelzTrace.addTrace("CT_INFO","Connection dropped by keepalive timeout from "+f),g=!0,o.destroy()},this.keepaliveTimeoutMs),(O=m.unref)===null||O===void 0||O.call(m)},A(),o.on("close",()=>{var O;g||this.channelzTrace.addTrace("CT_INFO","Connection dropped by client "+f),this.sessionChildrenTracker.unrefChild(u),(0,_r.unregisterChannelzRef)(u),p&&clearTimeout(p),h&&clearTimeout(h),b(),_!==null&&(clearTimeout(_.timeout),this.sessionIdleTimeouts.delete(o)),(O=this.http2Servers.get(i))===null||O===void 0||O.sessions.delete(o),this.sessions.delete(o)})}}enableIdleTimeout(i){var o,s;if(this.sessionIdleTimeout>=rre)return null;let a={activeStreams:0,lastIdle:Date.now(),onClose:this.onStreamClose.bind(this,i),timeout:setTimeout(this.onIdleTimeout,this.sessionIdleTimeout,this,i)};(s=(o=a.timeout).unref)===null||s===void 0||s.call(o),this.sessionIdleTimeouts.set(i,a);let{socket:c}=i;return this.trace("Enable idle timeout for "+c.remoteAddress+":"+c.remotePort),a}onIdleTimeout(i,o){let{socket:s}=o,a=i.sessionIdleTimeouts.get(o);a!==void 0&&a.activeStreams===0&&(Date.now()-a.lastIdle>=i.sessionIdleTimeout?(i.trace("Session idle timeout triggered for "+s?.remoteAddress+":"+s?.remotePort+" last idle at "+a.lastIdle),i.closeSession(o)):a.timeout.refresh())}onStreamOpened(i){let o=i.session,s=this.sessionIdleTimeouts.get(o);s&&(s.activeStreams+=1,i.once("close",s.onClose))}onStreamClose(i){var o,s;let a=this.sessionIdleTimeouts.get(i);a&&(a.activeStreams-=1,a.activeStreams===0&&(a.lastIdle=Date.now(),a.timeout.refresh(),this.trace("Session onStreamClose"+((o=i.socket)===null||o===void 0?void 0:o.remoteAddress)+":"+((s=i.socket)===null||s===void 0?void 0:s.remotePort)+" at "+a.lastIdle)))}},(()=>{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;r=[$1e("Calling start() is no longer necessary. It can be safely omitted.")],P1e(t,null,r,{kind:"method",name:"start",static:!1,private:!1,access:{has:i=>"start"in i,get:i=>i.start},metadata:n},null,e),n&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})})(),t})();Jc.Server=L1e;async function U1e(t,e){let r;function n(s,a,c,l){if(s){t.sendStatus((0,qp.serverErrorToStatus)(s,c));return}t.sendMessage(a,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:c??null})})}let i,o=null;t.start({onReceiveMetadata(s){i=s,t.startRead()},onReceiveMessage(s){if(o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}o=s,t.startRead()},onReceiveHalfClose(){if(!o){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new qp.ServerWritableStreamImpl(e.path,t,i,o);try{e.func(r,n)}catch(s){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${s.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"))}})}function F1e(t,e){let r;function n(i,o,s,a){if(i){t.sendStatus((0,qp.serverErrorToStatus)(i,s));return}t.sendMessage(o,()=>{t.sendStatus({code:rr.Status.OK,details:"OK",metadata:s??null})})}t.start({onReceiveMetadata(i){r=new qp.ServerDuplexStreamImpl(e.path,t,i);try{e.func(r,n)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onReceiveMessage(i){r.push(i)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function z1e(t,e){let r,n,i=null;t.start({onReceiveMetadata(o){n=o,t.startRead()},onReceiveMessage(o){if(i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received a second request message for server streaming method ${e.path}`,metadata:null});return}i=o,t.startRead()},onReceiveHalfClose(){if(!i){t.sendStatus({code:rr.Status.UNIMPLEMENTED,details:`Received no request message for server streaming method ${e.path}`,metadata:null});return}r=new qp.ServerWritableStreamImpl(e.path,t,n,i);try{e.func(r)}catch(o){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${o.message}`,metadata:null})}},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}function j1e(t,e){let r;t.start({onReceiveMetadata(n){r=new qp.ServerDuplexStreamImpl(e.path,t,n);try{e.func(r)}catch(i){t.sendStatus({code:rr.Status.UNKNOWN,details:`Server method handler threw error ${i.message}`,metadata:null})}},onReceiveMessage(n){r.push(n)},onReceiveHalfClose(){r.push(null)},onCancel(){r&&(r.cancelled=!0,r.emit("cancelled","cancelled"),r.destroy())}})}});var are=y(oR=>{"use strict";Object.defineProperty(oR,"__esModule",{value:!0});oR.StatusBuilder=void 0;var W1=class{constructor(){this.code=null,this.details=null,this.metadata=null}withCode(e){return this.code=e,this}withDetails(e){return this.details=e,this}withMetadata(e){return this.metadata=e,this}build(){let e={};return this.code!==null&&(e.code=this.code),this.details!==null&&(e.details=this.details),this.metadata!==null&&(e.metadata=this.metadata),e}};oR.StatusBuilder=W1});var uS=y(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.LeafLoadBalancer=As.PickFirstLoadBalancer=As.PickFirstLoadBalancingConfig=void 0;As.shuffled=dre;As.setup=K1e;var Y1=$c(),nr=In(),Xc=ga(),cre=Gn(),B1e=Nt(),q1e=Xe(),lre=Gn(),ure=Z("net"),V1e=zu(),G1e="pick_first";function aS(t){B1e.trace(q1e.LogVerbosity.DEBUG,G1e,t)}var cS="pick_first",H1e=250,Vp=class t{constructor(e){this.shuffleAddressList=e}getLoadBalancerName(){return cS}toJsonObject(){return{[cS]:{shuffleAddressList:this.shuffleAddressList}}}getShuffleAddressList(){return this.shuffleAddressList}static createFromJson(e){if("shuffleAddressList"in e&&typeof e.shuffleAddressList!="boolean")throw new Error("pick_first config field shuffleAddressList must be a boolean if provided");return new t(e.shuffleAddressList===!0)}};As.PickFirstLoadBalancingConfig=Vp;var K1=class{constructor(e){this.subchannel=e}pick(e){return{pickResultType:Xc.PickResultType.COMPLETE,subchannel:this.subchannel,status:null,onCallStarted:null,onCallEnded:null}}};function dre(t){let e=t.slice();for(let r=e.length-1;r>1;r--){let n=Math.floor(Math.random()*(r+1)),i=e[r];e[r]=e[n],e[n]=i}return e}function W1e(t){if(t.length===0)return[];let e=[],r=[],n=[],i=(0,lre.isTcpSubchannelAddress)(t[0])&&(0,ure.isIPv6)(t[0].host);for(let a of t)(0,lre.isTcpSubchannelAddress)(a)&&(0,ure.isIPv6)(a.host)?r.push(a):n.push(a);let o=i?r:n,s=i?n:r;for(let a=0;a<Math.max(o.length,s.length);a++)a<o.length&&e.push(o[a]),a<s.length&&e.push(s[a]);return e}var fre="grpc-node.internal.pick-first.report_health_status",lS=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=nr.ConnectivityState.IDLE,this.currentSubchannelIndex=0,this.currentPick=null,this.subchannelStateListener=(r,n,i,o,s)=>{this.onSubchannelStateUpdate(r,n,i,s)},this.pickedSubchannelHealthListener=()=>this.calculateAndReportNewState(),this.stickyTransientFailureMode=!1,this.reportHealthStatus=!1,this.lastError=null,this.latestAddressList=null,this.latestOptions={},this.latestResolutionNote="",this.connectionDelayTimeout=setTimeout(()=>{},0),clearTimeout(this.connectionDelayTimeout)}allChildrenHaveReportedTF(){return this.children.every(e=>e.hasReportedTransientFailure)}resetChildrenReportedTF(){this.children.every(e=>e.hasReportedTransientFailure=!1)}calculateAndReportNewState(){var e;if(this.currentPick)if(this.reportHealthStatus&&!this.currentPick.isHealthy()){let r=`Picked subchannel ${this.currentPick.getAddress()} is unhealthy`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.READY,new K1(this.currentPick),null);else if(((e=this.latestAddressList)===null||e===void 0?void 0:e.length)===0){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else if(this.children.length===0)this.updateState(nr.ConnectivityState.IDLE,new Xc.QueuePicker(this),null);else if(this.stickyTransientFailureMode){let r=`No connection established. Last error: ${this.lastError}. Resolution note: ${this.latestResolutionNote}`;this.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker({details:r}),r)}else this.updateState(nr.ConnectivityState.CONNECTING,new Xc.QueuePicker(this),null)}requestReresolution(){this.channelControlHelper.requestReresolution()}maybeEnterStickyTransientFailureMode(){if(this.allChildrenHaveReportedTF()){if(this.requestReresolution(),this.resetChildrenReportedTF(),this.stickyTransientFailureMode){this.calculateAndReportNewState();return}this.stickyTransientFailureMode=!0;for(let{subchannel:e}of this.children)e.startConnecting();this.calculateAndReportNewState()}}removeCurrentPick(){this.currentPick!==null&&(this.currentPick.removeConnectivityStateListener(this.subchannelStateListener),this.channelControlHelper.removeChannelzChild(this.currentPick.getChannelzRef()),this.currentPick.removeHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick.unref(),this.currentPick=null)}onSubchannelStateUpdate(e,r,n,i){var o;if(!((o=this.currentPick)===null||o===void 0)&&o.realSubchannelEquals(e)){n!==nr.ConnectivityState.READY&&(this.removeCurrentPick(),this.calculateAndReportNewState());return}for(let[s,a]of this.children.entries())if(e.realSubchannelEquals(a.subchannel)){n===nr.ConnectivityState.READY&&this.pickSubchannel(a.subchannel),n===nr.ConnectivityState.TRANSIENT_FAILURE&&(a.hasReportedTransientFailure=!0,i&&(this.lastError=i),this.maybeEnterStickyTransientFailureMode(),s===this.currentSubchannelIndex&&this.startNextSubchannelConnecting(s+1)),a.subchannel.startConnecting();return}}startNextSubchannelConnecting(e){clearTimeout(this.connectionDelayTimeout);for(let[r,n]of this.children.entries())if(r>=e){let i=n.subchannel.getConnectivityState();if(i===nr.ConnectivityState.IDLE||i===nr.ConnectivityState.CONNECTING){this.startConnecting(r);return}}this.maybeEnterStickyTransientFailureMode()}startConnecting(e){var r,n;clearTimeout(this.connectionDelayTimeout),this.currentSubchannelIndex=e,this.children[e].subchannel.getConnectivityState()===nr.ConnectivityState.IDLE&&(aS("Start connecting to subchannel with address "+this.children[e].subchannel.getAddress()),process.nextTick(()=>{var i;(i=this.children[e])===null||i===void 0||i.subchannel.startConnecting()})),this.connectionDelayTimeout=setTimeout(()=>{this.startNextSubchannelConnecting(e+1)},H1e),(n=(r=this.connectionDelayTimeout).unref)===null||n===void 0||n.call(r)}pickSubchannel(e){aS("Pick subchannel with address "+e.getAddress()),this.stickyTransientFailureMode=!1,e.ref(),this.channelControlHelper.addChannelzChild(e.getChannelzRef()),this.removeCurrentPick(),this.resetSubchannelList(),e.addConnectivityStateListener(this.subchannelStateListener),e.addHealthStateWatcher(this.pickedSubchannelHealthListener),this.currentPick=e,clearTimeout(this.connectionDelayTimeout),this.calculateAndReportNewState()}updateState(e,r,n){aS(nr.ConnectivityState[this.currentState]+" -> "+nr.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.subchannel.removeConnectivityStateListener(this.subchannelStateListener),e.subchannel.unref(),this.channelControlHelper.removeChannelzChild(e.subchannel.getChannelzRef());this.currentSubchannelIndex=0,this.children=[]}connectToAddressList(e,r){aS("connectToAddressList(["+e.map(i=>(0,cre.subchannelAddressToString)(i))+"])");let n=e.map(i=>({subchannel:this.channelControlHelper.createSubchannel(i,r),hasReportedTransientFailure:!1}));for(let{subchannel:i}of n)if(i.getConnectivityState()===nr.ConnectivityState.READY){this.pickSubchannel(i);return}for(let{subchannel:i}of n)i.ref(),this.channelControlHelper.addChannelzChild(i.getChannelzRef());this.resetSubchannelList(),this.children=n;for(let{subchannel:i}of this.children)i.addConnectivityStateListener(this.subchannelStateListener);for(let i of this.children)i.subchannel.getConnectivityState()===nr.ConnectivityState.TRANSIENT_FAILURE&&(i.hasReportedTransientFailure=!0);this.startNextSubchannelConnecting(0),this.calculateAndReportNewState()}updateAddressList(e,r,n,i){if(!(r instanceof Vp))return!1;if(!e.ok)return this.children.length===0&&this.currentPick===null&&this.channelControlHelper.updateState(nr.ConnectivityState.TRANSIENT_FAILURE,new Xc.UnavailablePicker(e.error),e.error.details),!0;let o=e.value;this.reportHealthStatus=n[fre],r.getShuffleAddressList()&&(o=dre(o));let s=[].concat(...o.map(c=>c.addresses));aS("updateAddressList(["+s.map(c=>(0,cre.subchannelAddressToString)(c))+"])");let a=W1e(s);return this.latestAddressList=a,this.latestOptions=n,this.connectToAddressList(a,n),this.latestResolutionNote=i,s.length>0?!0:(this.lastError="No addresses resolved",!1)}exitIdle(){this.currentState===nr.ConnectivityState.IDLE&&this.latestAddressList&&this.connectToAddressList(this.latestAddressList,this.latestOptions)}resetBackoff(){}destroy(){this.resetSubchannelList(),this.removeCurrentPick()}getTypeName(){return cS}};As.PickFirstLoadBalancer=lS;var Y1e=new Vp(!1),Z1=class{constructor(e,r,n,i){this.endpoint=e,this.options=n,this.resolutionNote=i,this.latestState=nr.ConnectivityState.IDLE;let o=(0,Y1.createChildChannelControlHelper)(r,{updateState:(s,a,c)=>{this.latestState=s,this.latestPicker=a,r.updateState(s,a,c)}});this.pickFirstBalancer=new lS(o),this.latestPicker=new Xc.QueuePicker(this.pickFirstBalancer)}startConnecting(){this.pickFirstBalancer.updateAddressList((0,V1e.statusOrFromValue)([this.endpoint]),Y1e,Object.assign(Object.assign({},this.options),{[fre]:!0}),this.resolutionNote)}updateEndpoint(e,r){this.options=r,this.endpoint=e,this.latestState!==nr.ConnectivityState.IDLE&&this.startConnecting()}getConnectivityState(){return this.latestState}getPicker(){return this.latestPicker}getEndpoint(){return this.endpoint}exitIdle(){this.pickFirstBalancer.exitIdle()}destroy(){this.pickFirstBalancer.destroy()}};As.LeafLoadBalancer=Z1;function K1e(){(0,Y1.registerLoadBalancerType)(cS,lS,Vp),(0,Y1.registerDefaultLoadBalancerType)(cS)}});var pre=y(aR=>{"use strict";Object.defineProperty(aR,"__esModule",{value:!0});aR.FileWatcherCertificateProvider=void 0;var Z1e=Z("fs"),J1e=Nt(),X1e=Xe(),Q1e=Z("util"),eUe="certificate_provider";function sR(t){J1e.trace(X1e.LogVerbosity.DEBUG,eUe,t)}var J1=(0,Q1e.promisify)(Z1e.readFile),X1=class{constructor(e){if(this.config=e,this.refreshTimer=null,this.fileResultPromise=null,this.latestCaUpdate=void 0,this.caListeners=new Set,this.latestIdentityUpdate=void 0,this.identityListeners=new Set,this.lastUpdateTime=null,e.certificateFile===void 0!=(e.privateKeyFile===void 0))throw new Error("certificateFile and privateKeyFile must be set or unset together");if(e.certificateFile===void 0&&e.caCertificateFile===void 0)throw new Error("At least one of certificateFile and caCertificateFile must be set");sR("File watcher constructed with config "+JSON.stringify(e))}updateCertificates(){this.fileResultPromise||(this.fileResultPromise=Promise.allSettled([this.config.certificateFile?J1(this.config.certificateFile):Promise.reject(),this.config.privateKeyFile?J1(this.config.privateKeyFile):Promise.reject(),this.config.caCertificateFile?J1(this.config.caCertificateFile):Promise.reject()]),this.fileResultPromise.then(([e,r,n])=>{if(this.refreshTimer){sR("File watcher read certificates certificate "+e.status+", privateKey "+r.status+", CA certificate "+n.status),this.lastUpdateTime=new Date,this.fileResultPromise=null,e.status==="fulfilled"&&r.status==="fulfilled"?this.latestIdentityUpdate={certificate:e.value,privateKey:r.value}:this.latestIdentityUpdate=null,n.status==="fulfilled"?this.latestCaUpdate={caCertificate:n.value}:this.latestCaUpdate=null;for(let i of this.identityListeners)i(this.latestIdentityUpdate);for(let i of this.caListeners)i(this.latestCaUpdate)}}),sR("File watcher initiated certificate update"))}maybeStartWatchingFiles(){if(!this.refreshTimer){let e=this.lastUpdateTime?new Date().getTime()-this.lastUpdateTime.getTime():1/0;e>this.config.refreshIntervalMs&&this.updateCertificates(),e>this.config.refreshIntervalMs*2&&(this.latestCaUpdate=void 0,this.latestIdentityUpdate=void 0),this.refreshTimer=setInterval(()=>this.updateCertificates(),this.config.refreshIntervalMs),sR("File watcher started watching")}}maybeStopWatchingFiles(){this.caListeners.size===0&&this.identityListeners.size===0&&(this.fileResultPromise=null,this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=null))}addCaCertificateListener(e){this.caListeners.add(e),this.maybeStartWatchingFiles(),this.latestCaUpdate!==void 0&&process.nextTick(e,this.latestCaUpdate)}removeCaCertificateListener(e){this.caListeners.delete(e),this.maybeStopWatchingFiles()}addIdentityCertificateListener(e){this.identityListeners.add(e),this.maybeStartWatchingFiles(),this.latestIdentityUpdate!==void 0&&process.nextTick(e,this.latestIdentityUpdate)}removeIdentityCertificateListener(e){this.identityListeners.delete(e),this.maybeStopWatchingFiles()}};aR.FileWatcherCertificateProvider=X1});var tU=y(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX=Se.createCertificateProviderChannelCredentials=Se.FileWatcherCertificateProvider=Se.createCertificateProviderServerCredentials=Se.createServerCredentialsWithInterceptors=Se.BaseSubchannelWrapper=Se.registerAdminService=Se.FilterStackFactory=Se.BaseFilter=Se.statusOrFromError=Se.statusOrFromValue=Se.PickResultType=Se.QueuePicker=Se.UnavailablePicker=Se.ChildLoadBalancerHandler=Se.EndpointMap=Se.endpointHasAddress=Se.endpointToString=Se.subchannelAddressToString=Se.LeafLoadBalancer=Se.isLoadBalancerNameRegistered=Se.parseLoadBalancingConfig=Se.selectLbConfigFromList=Se.registerLoadBalancerType=Se.createChildChannelControlHelper=Se.BackoffTimeout=Se.parseDuration=Se.durationToMs=Se.splitHostPort=Se.uriToString=Se.CHANNEL_ARGS_CONFIG_SELECTOR_KEY=Se.createResolver=Se.registerResolver=Se.log=Se.trace=void 0;var hre=Nt();Object.defineProperty(Se,"trace",{enumerable:!0,get:function(){return hre.trace}});Object.defineProperty(Se,"log",{enumerable:!0,get:function(){return hre.log}});var Q1=mo();Object.defineProperty(Se,"registerResolver",{enumerable:!0,get:function(){return Q1.registerResolver}});Object.defineProperty(Se,"createResolver",{enumerable:!0,get:function(){return Q1.createResolver}});Object.defineProperty(Se,"CHANNEL_ARGS_CONFIG_SELECTOR_KEY",{enumerable:!0,get:function(){return Q1.CHANNEL_ARGS_CONFIG_SELECTOR_KEY}});var mre=Cn();Object.defineProperty(Se,"uriToString",{enumerable:!0,get:function(){return mre.uriToString}});Object.defineProperty(Se,"splitHostPort",{enumerable:!0,get:function(){return mre.splitHostPort}});var gre=sS();Object.defineProperty(Se,"durationToMs",{enumerable:!0,get:function(){return gre.durationToMs}});Object.defineProperty(Se,"parseDuration",{enumerable:!0,get:function(){return gre.parseDuration}});var tUe=pp();Object.defineProperty(Se,"BackoffTimeout",{enumerable:!0,get:function(){return tUe.BackoffTimeout}});var dS=$c();Object.defineProperty(Se,"createChildChannelControlHelper",{enumerable:!0,get:function(){return dS.createChildChannelControlHelper}});Object.defineProperty(Se,"registerLoadBalancerType",{enumerable:!0,get:function(){return dS.registerLoadBalancerType}});Object.defineProperty(Se,"selectLbConfigFromList",{enumerable:!0,get:function(){return dS.selectLbConfigFromList}});Object.defineProperty(Se,"parseLoadBalancingConfig",{enumerable:!0,get:function(){return dS.parseLoadBalancingConfig}});Object.defineProperty(Se,"isLoadBalancerNameRegistered",{enumerable:!0,get:function(){return dS.isLoadBalancerNameRegistered}});var rUe=uS();Object.defineProperty(Se,"LeafLoadBalancer",{enumerable:!0,get:function(){return rUe.LeafLoadBalancer}});var cR=Gn();Object.defineProperty(Se,"subchannelAddressToString",{enumerable:!0,get:function(){return cR.subchannelAddressToString}});Object.defineProperty(Se,"endpointToString",{enumerable:!0,get:function(){return cR.endpointToString}});Object.defineProperty(Se,"endpointHasAddress",{enumerable:!0,get:function(){return cR.endpointHasAddress}});Object.defineProperty(Se,"EndpointMap",{enumerable:!0,get:function(){return cR.EndpointMap}});var nUe=MA();Object.defineProperty(Se,"ChildLoadBalancerHandler",{enumerable:!0,get:function(){return nUe.ChildLoadBalancerHandler}});var eU=ga();Object.defineProperty(Se,"UnavailablePicker",{enumerable:!0,get:function(){return eU.UnavailablePicker}});Object.defineProperty(Se,"QueuePicker",{enumerable:!0,get:function(){return eU.QueuePicker}});Object.defineProperty(Se,"PickResultType",{enumerable:!0,get:function(){return eU.PickResultType}});var _re=zu();Object.defineProperty(Se,"statusOrFromValue",{enumerable:!0,get:function(){return _re.statusOrFromValue}});Object.defineProperty(Se,"statusOrFromError",{enumerable:!0,get:function(){return _re.statusOrFromError}});var iUe=IL();Object.defineProperty(Se,"BaseFilter",{enumerable:!0,get:function(){return iUe.BaseFilter}});var oUe=Ox();Object.defineProperty(Se,"FilterStackFactory",{enumerable:!0,get:function(){return oUe.FilterStackFactory}});var sUe=UA();Object.defineProperty(Se,"registerAdminService",{enumerable:!0,get:function(){return sUe.registerAdminService}});var aUe=iS();Object.defineProperty(Se,"BaseSubchannelWrapper",{enumerable:!0,get:function(){return aUe.BaseSubchannelWrapper}});var yre=Xx();Object.defineProperty(Se,"createServerCredentialsWithInterceptors",{enumerable:!0,get:function(){return yre.createServerCredentialsWithInterceptors}});Object.defineProperty(Se,"createCertificateProviderServerCredentials",{enumerable:!0,get:function(){return yre.createCertificateProviderServerCredentials}});var cUe=pre();Object.defineProperty(Se,"FileWatcherCertificateProvider",{enumerable:!0,get:function(){return cUe.FileWatcherCertificateProvider}});var lUe=fp();Object.defineProperty(Se,"createCertificateProviderChannelCredentials",{enumerable:!0,get:function(){return lUe.createCertificateProviderChannelCredentials}});var uUe=_1();Object.defineProperty(Se,"SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX",{enumerable:!0,get:function(){return uUe.SUBCHANNEL_ARGS_EXCLUDE_KEY_PREFIX}})});var Sre=y(nU=>{"use strict";Object.defineProperty(nU,"__esModule",{value:!0});nU.setup=pUe;var dUe=mo(),fUe=zu(),rU=class{constructor(e,r,n){this.listener=r,this.hasReturnedResult=!1,this.endpoints=[];let i;e.authority===""?i="/"+e.path:i=e.path,this.endpoints=[{addresses:[{path:i}]}]}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(this.listener,(0,fUe.statusOrFromValue)(this.endpoints),{},null,""))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return"localhost"}};function pUe(){(0,dUe.registerResolver)("unix",rU)}});var Are=y(aU=>{"use strict";Object.defineProperty(aU,"__esModule",{value:!0});aU.setup=yUe;var Ere=Z("net"),vre=zu(),lR=Xe(),iU=Rr(),bre=mo(),hUe=Gn(),Tre=Cn(),mUe=Nt(),gUe="ip_resolver";function wre(t){mUe.trace(lR.LogVerbosity.DEBUG,gUe,t)}var oU="ipv4",sU="ipv6",_Ue=443,uR=class{constructor(e,r,n){var i;this.listener=r,this.endpoints=[],this.error=null,this.hasReturnedResult=!1,wre("Resolver constructed for target "+(0,Tre.uriToString)(e));let o=[];if(!(e.scheme===oU||e.scheme===sU)){this.error={code:lR.Status.UNAVAILABLE,details:`Unrecognized scheme ${e.scheme} in IP resolver`,metadata:new iU.Metadata};return}let s=e.path.split(",");for(let a of s){let c=(0,Tre.splitHostPort)(a);if(c===null){this.error={code:lR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new iU.Metadata};return}if(e.scheme===oU&&!(0,Ere.isIPv4)(c.host)||e.scheme===sU&&!(0,Ere.isIPv6)(c.host)){this.error={code:lR.Status.UNAVAILABLE,details:`Failed to parse ${e.scheme} address ${a}`,metadata:new iU.Metadata};return}o.push({host:c.host,port:(i=c.port)!==null&&i!==void 0?i:_Ue})}this.endpoints=o.map(a=>({addresses:[a]})),wre("Parsed "+e.scheme+" address list "+o.map(hUe.subchannelAddressToString))}updateResolution(){this.hasReturnedResult||(this.hasReturnedResult=!0,process.nextTick(()=>{this.error?this.listener((0,vre.statusOrFromError)(this.error),{},null,""):this.listener((0,vre.statusOrFromValue)(this.endpoints),{},null,"")}))}destroy(){this.hasReturnedResult=!1}static getDefaultAuthority(e){return e.path.split(",")[0]}};function yUe(){(0,bre.registerResolver)(oU,uR),(0,bre.registerResolver)(sU,uR)}});var Ire=y(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});pS.RoundRobinLoadBalancer=void 0;pS.setup=wUe;var Cre=$c(),Gr=In(),fS=ga(),SUe=Nt(),EUe=Xe(),xre=Gn(),vUe=uS(),bUe="round_robin";function Rre(t){SUe.trace(EUe.LogVerbosity.DEBUG,bUe,t)}var dR="round_robin",fR=class t{getLoadBalancerName(){return dR}constructor(){}toJsonObject(){return{[dR]:{}}}static createFromJson(e){return new t}},cU=class{constructor(e,r=0){this.children=e,this.nextIndex=r}pick(e){let r=this.children[this.nextIndex].picker;return this.nextIndex=(this.nextIndex+1)%this.children.length,r.pick(e)}peekNextEndpoint(){return this.children[this.nextIndex].endpoint}};function TUe(t,e){return[...t.slice(e),...t.slice(0,e)]}var pR=class{constructor(e){this.channelControlHelper=e,this.children=[],this.currentState=Gr.ConnectivityState.IDLE,this.currentReadyPicker=null,this.updatesPaused=!1,this.lastError=null,this.childChannelControlHelper=(0,Cre.createChildChannelControlHelper)(e,{updateState:(r,n,i)=>{this.currentState===Gr.ConnectivityState.READY&&r!==Gr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),i&&(this.lastError=i),this.calculateAndUpdateState()}})}countChildrenWithState(e){return this.children.filter(r=>r.getConnectivityState()===e).length}calculateAndUpdateState(){if(!this.updatesPaused){if(this.countChildrenWithState(Gr.ConnectivityState.READY)>0){let e=this.children.filter(n=>n.getConnectivityState()===Gr.ConnectivityState.READY),r=0;if(this.currentReadyPicker!==null){let n=this.currentReadyPicker.peekNextEndpoint();r=e.findIndex(i=>(0,xre.endpointEqual)(i.getEndpoint(),n)),r<0&&(r=0)}this.updateState(Gr.ConnectivityState.READY,new cU(e.map(n=>({endpoint:n.getEndpoint(),picker:n.getPicker()})),r),null)}else if(this.countChildrenWithState(Gr.ConnectivityState.CONNECTING)>0)this.updateState(Gr.ConnectivityState.CONNECTING,new fS.QueuePicker(this),null);else if(this.countChildrenWithState(Gr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker({details:e}),e)}else this.updateState(Gr.ConnectivityState.IDLE,new fS.QueuePicker(this),null);for(let e of this.children)e.getConnectivityState()===Gr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){Rre(Gr.ConnectivityState[this.currentState]+" -> "+Gr.ConnectivityState[e]),e===Gr.ConnectivityState.READY?this.currentReadyPicker=r:this.currentReadyPicker=null,this.currentState=e,this.channelControlHelper.updateState(e,r,n)}resetSubchannelList(){for(let e of this.children)e.destroy();this.children=[]}updateAddressList(e,r,n,i){if(!(r instanceof fR))return!1;if(!e.ok)return this.children.length===0&&this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker(e.error),e.error.details),!0;let o=Math.random()*e.value.length|0,s=TUe(e.value,o);if(this.resetSubchannelList(),s.length===0){let a=`No addresses resolved. Resolution note: ${i}`;this.updateState(Gr.ConnectivityState.TRANSIENT_FAILURE,new fS.UnavailablePicker({details:a}),a)}Rre("Connect to endpoint list "+s.map(xre.endpointToString)),this.updatesPaused=!0,this.children=s.map(a=>new vUe.LeafLoadBalancer(a,this.childChannelControlHelper,n,i));for(let a of this.children)a.startConnecting();return this.updatesPaused=!1,this.calculateAndUpdateState(),!0}exitIdle(){}resetBackoff(){}destroy(){this.resetSubchannelList()}getTypeName(){return dR}};pS.RoundRobinLoadBalancer=pR;function wUe(){(0,Cre.registerLoadBalancerType)(dR,pR,fR)}});var Nre=y(sd=>{"use strict";var lU;Object.defineProperty(sd,"__esModule",{value:!0});sd.OutlierDetectionLoadBalancer=sd.OutlierDetectionLoadBalancingConfig=void 0;sd.setup=$Ue;var AUe=In(),Pre=Xe(),od=sS(),Ore=tU(),xUe=$c(),RUe=MA(),CUe=ga(),uU=Gn(),IUe=iS(),PUe=Nt(),OUe="outlier_detection";function Or(t){PUe.trace(Pre.LogVerbosity.DEBUG,OUe,t)}var gU="outlier_detection",NUe=((lU=process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION)!==null&&lU!==void 0?lU:"true")==="true",kUe={stdev_factor:1900,enforcement_percentage:100,minimum_hosts:5,request_volume:100},MUe={threshold:85,enforcement_percentage:100,minimum_hosts:5,request_volume:50};function Gp(t,e,r,n){if(e in t&&t[e]!==void 0&&typeof t[e]!==r){let i=n?`${n}.${e}`:e;throw new Error(`outlier detection config ${i} parse error: expected ${r}, got ${typeof t[e]}`)}}function dU(t,e,r){let n=r?`${r}.${e}`:e;if(e in t&&t[e]!==void 0){if(!(0,od.isDuration)(t[e]))throw new Error(`outlier detection config ${n} parse error: expected Duration, got ${typeof t[e]}`);if(!(t[e].seconds>=0&&t[e].seconds<=315576e6&&t[e].nanos>=0&&t[e].nanos<=999999999))throw new Error(`outlier detection config ${n} parse error: values out of range for non-negative Duaration`)}}function hR(t,e,r){let n=r?`${r}.${e}`:e;if(Gp(t,e,"number",r),e in t&&t[e]!==void 0&&!(t[e]>=0&&t[e]<=100))throw new Error(`outlier detection config ${n} parse error: value out of range for percentage (0-100)`)}var hS=class t{constructor(e,r,n,i,o,s,a){if(this.childPolicy=a,a.getLoadBalancerName()==="pick_first")throw new Error("outlier_detection LB policy cannot have a pick_first child policy");this.intervalMs=e??1e4,this.baseEjectionTimeMs=r??3e4,this.maxEjectionTimeMs=n??3e5,this.maxEjectionPercent=i??10,this.successRateEjection=o?Object.assign(Object.assign({},kUe),o):null,this.failurePercentageEjection=s?Object.assign(Object.assign({},MUe),s):null}getLoadBalancerName(){return gU}toJsonObject(){var e,r;return{outlier_detection:{interval:(0,od.msToDuration)(this.intervalMs),base_ejection_time:(0,od.msToDuration)(this.baseEjectionTimeMs),max_ejection_time:(0,od.msToDuration)(this.maxEjectionTimeMs),max_ejection_percent:this.maxEjectionPercent,success_rate_ejection:(e=this.successRateEjection)!==null&&e!==void 0?e:void 0,failure_percentage_ejection:(r=this.failurePercentageEjection)!==null&&r!==void 0?r:void 0,child_policy:[this.childPolicy.toJsonObject()]}}}getIntervalMs(){return this.intervalMs}getBaseEjectionTimeMs(){return this.baseEjectionTimeMs}getMaxEjectionTimeMs(){return this.maxEjectionTimeMs}getMaxEjectionPercent(){return this.maxEjectionPercent}getSuccessRateEjectionConfig(){return this.successRateEjection}getFailurePercentageEjectionConfig(){return this.failurePercentageEjection}getChildPolicy(){return this.childPolicy}static createFromJson(e){var r;if(dU(e,"interval"),dU(e,"base_ejection_time"),dU(e,"max_ejection_time"),hR(e,"max_ejection_percent"),"success_rate_ejection"in e&&e.success_rate_ejection!==void 0){if(typeof e.success_rate_ejection!="object")throw new Error("outlier detection config success_rate_ejection must be an object");Gp(e.success_rate_ejection,"stdev_factor","number","success_rate_ejection"),hR(e.success_rate_ejection,"enforcement_percentage","success_rate_ejection"),Gp(e.success_rate_ejection,"minimum_hosts","number","success_rate_ejection"),Gp(e.success_rate_ejection,"request_volume","number","success_rate_ejection")}if("failure_percentage_ejection"in e&&e.failure_percentage_ejection!==void 0){if(typeof e.failure_percentage_ejection!="object")throw new Error("outlier detection config failure_percentage_ejection must be an object");hR(e.failure_percentage_ejection,"threshold","failure_percentage_ejection"),hR(e.failure_percentage_ejection,"enforcement_percentage","failure_percentage_ejection"),Gp(e.failure_percentage_ejection,"minimum_hosts","number","failure_percentage_ejection"),Gp(e.failure_percentage_ejection,"request_volume","number","failure_percentage_ejection")}if(!("child_policy"in e)||!Array.isArray(e.child_policy))throw new Error("outlier detection config child_policy must be an array");let n=(0,xUe.selectLbConfigFromList)(e.child_policy);if(!n)throw new Error("outlier detection config child_policy: no valid recognized policy found");return new t(e.interval?(0,od.durationToMs)(e.interval):null,e.base_ejection_time?(0,od.durationToMs)(e.base_ejection_time):null,e.max_ejection_time?(0,od.durationToMs)(e.max_ejection_time):null,(r=e.max_ejection_percent)!==null&&r!==void 0?r:null,e.success_rate_ejection,e.failure_percentage_ejection,n)}};sd.OutlierDetectionLoadBalancingConfig=hS;var pU=class extends IUe.BaseSubchannelWrapper{constructor(e,r){super(e),this.mapEntry=r,this.refCount=0}ref(){this.child.ref(),this.refCount+=1}unref(){if(this.child.unref(),this.refCount-=1,this.refCount<=0&&this.mapEntry){let e=this.mapEntry.subchannelWrappers.indexOf(this);e>=0&&this.mapEntry.subchannelWrappers.splice(e,1)}}eject(){this.setHealthy(!1)}uneject(){this.setHealthy(!0)}getMapEntry(){return this.mapEntry}getWrappedSubchannel(){return this.child}};function fU(){return{success:0,failure:0}}var hU=class{constructor(){this.activeBucket=fU(),this.inactiveBucket=fU()}addSuccess(){this.activeBucket.success+=1}addFailure(){this.activeBucket.failure+=1}switchBuckets(){this.inactiveBucket=this.activeBucket,this.activeBucket=fU()}getLastSuccesses(){return this.inactiveBucket.success}getLastFailures(){return this.inactiveBucket.failure}},mU=class{constructor(e,r){this.wrappedPicker=e,this.countCalls=r}pick(e){let r=this.wrappedPicker.pick(e);if(r.pickResultType===CUe.PickResultType.COMPLETE){let n=r.subchannel,i=n.getMapEntry();if(i){let o=r.onCallEnded;return this.countCalls&&(o=(s,a,c)=>{var l;s===Pre.Status.OK?i.counter.addSuccess():i.counter.addFailure(),(l=r.onCallEnded)===null||l===void 0||l.call(r,s,a,c)}),Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel(),onCallEnded:o})}else return Object.assign(Object.assign({},r),{subchannel:n.getWrappedSubchannel()})}else return r}},mR=class{constructor(e){this.entryMap=new uU.EndpointMap,this.latestConfig=null,this.timerStartTime=null,this.childBalancer=new RUe.ChildLoadBalancerHandler((0,Ore.createChildChannelControlHelper)(e,{createSubchannel:(r,n)=>{let i=e.createSubchannel(r,n),o=this.entryMap.getForSubchannelAddress(r),s=new pU(i,o);return o?.currentEjectionTimestamp!==null&&s.eject(),o?.subchannelWrappers.push(s),s},updateState:(r,n,i)=>{r===AUe.ConnectivityState.READY?e.updateState(r,new mU(n,this.isCountingEnabled()),i):e.updateState(r,n,i)}})),this.ejectionTimer=setInterval(()=>{},0),clearInterval(this.ejectionTimer)}isCountingEnabled(){return this.latestConfig!==null&&(this.latestConfig.getSuccessRateEjectionConfig()!==null||this.latestConfig.getFailurePercentageEjectionConfig()!==null)}getCurrentEjectionPercent(){let e=0;for(let r of this.entryMap.values())r.currentEjectionTimestamp!==null&&(e+=1);return e*100/this.entryMap.size}runSuccessRateCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getSuccessRateEjectionConfig();if(!r)return;Or("Running success rate check");let n=r.request_volume,i=0,o=[];for(let[d,f]of this.entryMap.entries()){let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();Or("Stats for "+(0,uU.endpointToString)(d)+": successes="+p+" failures="+h+" targetRequestVolume="+n),p+h>=n&&(i+=1,o.push(p/(p+h)))}if(Or("Found "+i+" success rate candidates; currentEjectionPercent="+this.getCurrentEjectionPercent()+" successRates=["+o+"]"),i<r.minimum_hosts)return;let s=o.reduce((d,f)=>d+f)/o.length,a=0;for(let d of o){let f=d-s;a+=f*f}let c=a/o.length,l=Math.sqrt(c),u=s-l*(r.stdev_factor/1e3);Or("stdev="+l+" ejectionThreshold="+u);for(let[d,f]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let p=f.counter.getLastSuccesses(),h=f.counter.getLastFailures();if(p+h<n)continue;let m=p/(p+h);if(Or("Checking candidate "+d+" successRate="+m),m<u){let g=Math.random()*100;Or("Candidate "+d+" randomNumber="+g+" enforcement_percentage="+r.enforcement_percentage),g<r.enforcement_percentage&&(Or("Ejecting candidate "+d),this.eject(f,e))}}}runFailurePercentageCheck(e){if(!this.latestConfig)return;let r=this.latestConfig.getFailurePercentageEjectionConfig();if(!r)return;Or("Running failure percentage check. threshold="+r.threshold+" request volume threshold="+r.request_volume);let n=0;for(let i of this.entryMap.values()){let o=i.counter.getLastSuccesses(),s=i.counter.getLastFailures();o+s>=r.request_volume&&(n+=1)}if(!(n<r.minimum_hosts))for(let[i,o]of this.entryMap.entries()){if(this.getCurrentEjectionPercent()>=this.latestConfig.getMaxEjectionPercent())break;let s=o.counter.getLastSuccesses(),a=o.counter.getLastFailures();if(Or("Candidate successes="+s+" failures="+a),s+a<r.request_volume)continue;if(a*100/(a+s)>r.threshold){let l=Math.random()*100;Or("Candidate "+i+" randomNumber="+l+" enforcement_percentage="+r.enforcement_percentage),l<r.enforcement_percentage&&(Or("Ejecting candidate "+i),this.eject(o,e))}}}eject(e,r){e.currentEjectionTimestamp=new Date,e.ejectionTimeMultiplier+=1;for(let n of e.subchannelWrappers)n.eject()}uneject(e){e.currentEjectionTimestamp=null;for(let r of e.subchannelWrappers)r.uneject()}switchAllBuckets(){for(let e of this.entryMap.values())e.counter.switchBuckets()}startTimer(e){var r,n;this.ejectionTimer=setTimeout(()=>this.runChecks(),e),(n=(r=this.ejectionTimer).unref)===null||n===void 0||n.call(r)}runChecks(){let e=new Date;if(Or("Ejection timer running"),this.switchAllBuckets(),!!this.latestConfig){this.timerStartTime=e,this.startTimer(this.latestConfig.getIntervalMs()),this.runSuccessRateCheck(e),this.runFailurePercentageCheck(e);for(let[r,n]of this.entryMap.entries())if(n.currentEjectionTimestamp===null)n.ejectionTimeMultiplier>0&&(n.ejectionTimeMultiplier-=1);else{let i=this.latestConfig.getBaseEjectionTimeMs(),o=this.latestConfig.getMaxEjectionTimeMs(),s=new Date(n.currentEjectionTimestamp.getTime());s.setMilliseconds(s.getMilliseconds()+Math.min(i*n.ejectionTimeMultiplier,Math.max(i,o))),s<new Date&&(Or("Unejecting "+r),this.uneject(n))}}}updateAddressList(e,r,n,i){if(!(r instanceof hS))return!1;if(Or("Received update with config: "+JSON.stringify(r.toJsonObject(),void 0,2)),e.ok){for(let s of e.value)this.entryMap.has(s)||(Or("Adding map entry for "+(0,uU.endpointToString)(s)),this.entryMap.set(s,{counter:new hU,currentEjectionTimestamp:null,ejectionTimeMultiplier:0,subchannelWrappers:[]}));this.entryMap.deleteMissing(e.value)}let o=r.getChildPolicy();if(this.childBalancer.updateAddressList(e,o,n,i),r.getSuccessRateEjectionConfig()||r.getFailurePercentageEjectionConfig())if(this.timerStartTime){Or("Previous timer existed. Replacing timer"),clearTimeout(this.ejectionTimer);let s=r.getIntervalMs()-(new Date().getTime()-this.timerStartTime.getTime());this.startTimer(s)}else Or("Starting new timer"),this.timerStartTime=new Date,this.startTimer(r.getIntervalMs()),this.switchAllBuckets();else{Or("Counting disabled. Cancelling timer."),this.timerStartTime=null,clearTimeout(this.ejectionTimer);for(let s of this.entryMap.values())this.uneject(s),s.ejectionTimeMultiplier=0}return this.latestConfig=r,!0}exitIdle(){this.childBalancer.exitIdle()}resetBackoff(){this.childBalancer.resetBackoff()}destroy(){clearTimeout(this.ejectionTimer),this.childBalancer.destroy()}getTypeName(){return gU}};sd.OutlierDetectionLoadBalancer=mR;function $Ue(){NUe&&(0,Ore.registerLoadBalancerType)(gU,mR,hS)}});var kre=y(_R=>{"use strict";Object.defineProperty(_R,"__esModule",{value:!0});_R.PriorityQueue=void 0;var Hp=0,_U=t=>Math.floor(t/2),gR=t=>t*2+1,mS=t=>t*2+2,yU=class{constructor(e=(r,n)=>r>n){this.comparator=e,this.heap=[]}size(){return this.heap.length}isEmpty(){return this.size()==0}peek(){return this.heap[Hp]}push(...e){return e.forEach(r=>{this.heap.push(r),this.siftUp()}),this.size()}pop(){let e=this.peek(),r=this.size()-1;return r>Hp&&this.swap(Hp,r),this.heap.pop(),this.siftDown(),e}replace(e){let r=this.peek();return this.heap[Hp]=e,this.siftDown(),r}greater(e,r){return this.comparator(this.heap[e],this.heap[r])}swap(e,r){[this.heap[e],this.heap[r]]=[this.heap[r],this.heap[e]]}siftUp(){let e=this.size()-1;for(;e>Hp&&this.greater(e,_U(e));)this.swap(e,_U(e)),e=_U(e)}siftDown(){let e=Hp;for(;gR(e)<this.size()&&this.greater(gR(e),e)||mS(e)<this.size()&&this.greater(mS(e),e);){let r=mS(e)<this.size()&&this.greater(mS(e),gR(e))?mS(e):gR(e);this.swap(e,r),e=r}}};_R.PriorityQueue=yU});var Ure=y(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});_S.WeightedRoundRobinLoadBalancingConfig=void 0;_S.setup=HUe;var Nr=In(),DUe=Xe(),yi=sS(),Dre=$c(),LUe=uS(),UUe=Nt(),Lre=eR(),Wp=ga(),FUe=kre(),Mre=Gn(),zUe="weighted_round_robin";function SU(t){UUe.trace(DUe.LogVerbosity.DEBUG,zUe,t)}var bU="weighted_round_robin",jUe=1e4,BUe=1e4,qUe=3*6e4,VUe=1e3,GUe=1;function $re(t,e,r){if(e in t&&t[e]!==void 0&&typeof t[e]!==r)throw new Error(`weighted round robin config ${e} parse error: expected ${r}, got ${typeof t[e]}`)}function yR(t,e){if(e in t&&t[e]!==void 0&&t[e]!==null){let r;if((0,yi.isDuration)(t[e]))r=t[e];else if((0,yi.isDurationMessage)(t[e]))r=(0,yi.durationMessageToDuration)(t[e]);else if(typeof t[e]=="string"){let n=(0,yi.parseDuration)(t[e]);if(!n)throw new Error(`weighted round robin config ${e}: failed to parse duration string ${t[e]}`);r=n}else throw new Error(`weighted round robin config ${e}: expected duration, got ${typeof t[e]}`);return(0,yi.durationToMs)(r)}return null}var gS=class t{constructor(e,r,n,i,o,s){this.enableOobLoadReport=e??!1,this.oobLoadReportingPeriodMs=r??jUe,this.blackoutPeriodMs=n??BUe,this.weightExpirationPeriodMs=i??qUe,this.weightUpdatePeriodMs=Math.max(o??VUe,100),this.errorUtilizationPenalty=s??GUe}getLoadBalancerName(){return bU}toJsonObject(){return{enable_oob_load_report:this.enableOobLoadReport,oob_load_reporting_period:(0,yi.durationToString)((0,yi.msToDuration)(this.oobLoadReportingPeriodMs)),blackout_period:(0,yi.durationToString)((0,yi.msToDuration)(this.blackoutPeriodMs)),weight_expiration_period:(0,yi.durationToString)((0,yi.msToDuration)(this.weightExpirationPeriodMs)),weight_update_period:(0,yi.durationToString)((0,yi.msToDuration)(this.weightUpdatePeriodMs)),error_utilization_penalty:this.errorUtilizationPenalty}}static createFromJson(e){if($re(e,"enable_oob_load_report","boolean"),$re(e,"error_utilization_penalty","number"),e.error_utilization_penalty<0)throw new Error("weighted round robin config error_utilization_penalty < 0");return new t(e.enable_oob_load_report,yR(e,"oob_load_reporting_period"),yR(e,"blackout_period"),yR(e,"weight_expiration_period"),yR(e,"weight_update_period"),e.error_utilization_penalty)}getEnableOobLoadReport(){return this.enableOobLoadReport}getOobLoadReportingPeriodMs(){return this.oobLoadReportingPeriodMs}getBlackoutPeriodMs(){return this.blackoutPeriodMs}getWeightExpirationPeriodMs(){return this.weightExpirationPeriodMs}getWeightUpdatePeriodMs(){return this.weightUpdatePeriodMs}getErrorUtilizationPenalty(){return this.errorUtilizationPenalty}};_S.WeightedRoundRobinLoadBalancingConfig=gS;var EU=class{constructor(e,r){this.metricsHandler=r,this.queue=new FUe.PriorityQueue((o,s)=>o.deadline<s.deadline);let n=e.filter(o=>o.weight>0),i;if(n.length<2)i=1;else{let o=0;for(let{weight:s}of n)o+=s;i=o/n.length}for(let o of e){let s=o.weight>0?1/o.weight:i;this.queue.push({endpointName:o.endpointName,picker:o.picker,period:s,deadline:Math.random()*s})}}pick(e){let r=this.queue.pop();this.queue.push(Object.assign(Object.assign({},r),{deadline:r.deadline+r.period}));let n=r.picker.pick(e);if(n.pickResultType===Wp.PickResultType.COMPLETE){if(this.metricsHandler)return Object.assign(Object.assign({},n),{onCallEnded:(0,Lre.createMetricsReader)(i=>this.metricsHandler(i,r.endpointName),n.onCallEnded)});{let i=n.subchannel;return Object.assign(Object.assign({},n),{subchannel:i.getWrappedSubchannel()})}}else return n}},vU=class{constructor(e){this.channelControlHelper=e,this.latestConfig=null,this.children=new Map,this.currentState=Nr.ConnectivityState.IDLE,this.updatesPaused=!1,this.lastError=null,this.weightUpdateTimer=null}countChildrenWithState(e){let r=0;for(let n of this.children.values())n.child.getConnectivityState()===e&&(r+=1);return r}updateWeight(e,r){var n,i;let o=r.rps_fractional,s=r.application_utilization;s>0&&o>0&&(s+=r.eps/o*((i=(n=this.latestConfig)===null||n===void 0?void 0:n.getErrorUtilizationPenalty())!==null&&i!==void 0?i:0));let a=s===0?0:o/s;if(a===0)return;let c=new Date;e.nonEmptySince===null&&(e.nonEmptySince=c),e.lastUpdated=c,e.weight=a}getWeight(e){if(!this.latestConfig)return 0;let r=new Date().getTime();if(r-e.lastUpdated.getTime()>=this.latestConfig.getWeightExpirationPeriodMs())return e.nonEmptySince=null,0;let n=this.latestConfig.getBlackoutPeriodMs();return n>0&&(e.nonEmptySince===null||r-e.nonEmptySince.getTime()<n)?0:e.weight}calculateAndUpdateState(){if(!(this.updatesPaused||!this.latestConfig)){if(this.countChildrenWithState(Nr.ConnectivityState.READY)>0){let e=[];for(let[n,i]of this.children)i.child.getConnectivityState()===Nr.ConnectivityState.READY&&e.push({endpointName:n,picker:i.child.getPicker(),weight:this.getWeight(i)});SU("Created picker with weights: "+e.map(n=>n.endpointName+":"+n.weight).join(","));let r;this.latestConfig.getEnableOobLoadReport()?r=null:r=(n,i)=>{let o=this.children.get(i);o&&this.updateWeight(o,n)},this.updateState(Nr.ConnectivityState.READY,new EU(e,r),null)}else if(this.countChildrenWithState(Nr.ConnectivityState.CONNECTING)>0)this.updateState(Nr.ConnectivityState.CONNECTING,new Wp.QueuePicker(this),null);else if(this.countChildrenWithState(Nr.ConnectivityState.TRANSIENT_FAILURE)>0){let e=`weighted_round_robin: No connection established. Last error: ${this.lastError}`;this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker({details:e}),e)}else this.updateState(Nr.ConnectivityState.IDLE,new Wp.QueuePicker(this),null);for(let{child:e}of this.children.values())e.getConnectivityState()===Nr.ConnectivityState.IDLE&&e.exitIdle()}}updateState(e,r,n){SU(Nr.ConnectivityState[this.currentState]+" -> "+Nr.ConnectivityState[e]),this.currentState=e,this.channelControlHelper.updateState(e,r,n)}updateAddressList(e,r,n,i){var o,s;if(!(r instanceof gS))return!1;if(!e.ok)return this.children.size===0&&this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker(e.error),e.error.details),!0;if(e.value.length===0){let l=`No addresses resolved. Resolution note: ${i}`;return this.updateState(Nr.ConnectivityState.TRANSIENT_FAILURE,new Wp.UnavailablePicker({details:l}),l),!1}SU("Connect to endpoint list "+e.value.map(Mre.endpointToString));let a=new Date,c=new Set;this.updatesPaused=!0,this.latestConfig=r;for(let l of e.value){let u=(0,Mre.endpointToString)(l);c.add(u);let d=this.children.get(u);d||(d={child:new LUe.LeafLoadBalancer(l,(0,Dre.createChildChannelControlHelper)(this.channelControlHelper,{updateState:(f,p,h)=>{this.currentState===Nr.ConnectivityState.READY&&f!==Nr.ConnectivityState.READY&&this.channelControlHelper.requestReresolution(),f===Nr.ConnectivityState.READY&&(d.nonEmptySince=null),h&&(this.lastError=h),this.calculateAndUpdateState()},createSubchannel:(f,p)=>{let h=this.channelControlHelper.createSubchannel(f,p);return d?.oobMetricsListener?new Lre.OrcaOobMetricsSubchannelWrapper(h,d.oobMetricsListener,this.latestConfig.getOobLoadReportingPeriodMs()):h}}),n,i),lastUpdated:a,nonEmptySince:null,weight:0,oobMetricsListener:null},this.children.set(u,d)),r.getEnableOobLoadReport()?d.oobMetricsListener=f=>{this.updateWeight(d,f)}:d.oobMetricsListener=null}for(let[l,u]of this.children)c.has(l)?u.child.startConnecting():(u.child.destroy(),this.children.delete(l));return this.updatesPaused=!1,this.calculateAndUpdateState(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer),this.weightUpdateTimer=(s=(o=setInterval(()=>{this.currentState===Nr.ConnectivityState.READY&&this.calculateAndUpdateState()},r.getWeightUpdatePeriodMs())).unref)===null||s===void 0?void 0:s.call(o),!0}exitIdle(){}resetBackoff(){}destroy(){for(let e of this.children.values())e.child.destroy();this.children.clear(),this.weightUpdateTimer&&clearInterval(this.weightUpdateTimer)}getTypeName(){return bU}};function HUe(){(0,Dre.registerLoadBalancerType)(bU,vU,gS)}});var yS=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.experimental=_e.ServerMetricRecorder=_e.ServerInterceptingCall=_e.ResponderBuilder=_e.ServerListenerBuilder=_e.addAdminServicesToServer=_e.getChannelzHandlers=_e.getChannelzServiceDefinition=_e.InterceptorConfigurationError=_e.InterceptingCall=_e.RequesterBuilder=_e.ListenerBuilder=_e.StatusBuilder=_e.getClientChannel=_e.ServerCredentials=_e.Server=_e.setLogVerbosity=_e.setLogger=_e.load=_e.loadObject=_e.CallCredentials=_e.ChannelCredentials=_e.waitForClientReady=_e.closeClient=_e.Channel=_e.makeGenericClientConstructor=_e.makeClientConstructor=_e.loadPackageDefinition=_e.Client=_e.compressionAlgorithms=_e.propagate=_e.connectivityState=_e.status=_e.logVerbosity=_e.Metadata=_e.credentials=void 0;var SR=TA();Object.defineProperty(_e,"CallCredentials",{enumerable:!0,get:function(){return SR.CallCredentials}});var WUe=uD();Object.defineProperty(_e,"Channel",{enumerable:!0,get:function(){return WUe.ChannelImplementation}});var YUe=RL();Object.defineProperty(_e,"compressionAlgorithms",{enumerable:!0,get:function(){return YUe.CompressionAlgorithms}});var KUe=In();Object.defineProperty(_e,"connectivityState",{enumerable:!0,get:function(){return KUe.ConnectivityState}});var ER=fp();Object.defineProperty(_e,"ChannelCredentials",{enumerable:!0,get:function(){return ER.ChannelCredentials}});var Fre=lD();Object.defineProperty(_e,"Client",{enumerable:!0,get:function(){return Fre.Client}});var TU=Xe();Object.defineProperty(_e,"logVerbosity",{enumerable:!0,get:function(){return TU.LogVerbosity}});Object.defineProperty(_e,"status",{enumerable:!0,get:function(){return TU.Status}});Object.defineProperty(_e,"propagate",{enumerable:!0,get:function(){return TU.Propagate}});var zre=Nt(),wU=qA();Object.defineProperty(_e,"loadPackageDefinition",{enumerable:!0,get:function(){return wU.loadPackageDefinition}});Object.defineProperty(_e,"makeClientConstructor",{enumerable:!0,get:function(){return wU.makeClientConstructor}});Object.defineProperty(_e,"makeGenericClientConstructor",{enumerable:!0,get:function(){return wU.makeClientConstructor}});var ZUe=Rr();Object.defineProperty(_e,"Metadata",{enumerable:!0,get:function(){return ZUe.Metadata}});var JUe=sre();Object.defineProperty(_e,"Server",{enumerable:!0,get:function(){return JUe.Server}});var XUe=Xx();Object.defineProperty(_e,"ServerCredentials",{enumerable:!0,get:function(){return XUe.ServerCredentials}});var QUe=are();Object.defineProperty(_e,"StatusBuilder",{enumerable:!0,get:function(){return QUe.StatusBuilder}});_e.credentials={combineChannelCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),combineCallCredentials:(t,...e)=>e.reduce((r,n)=>r.compose(n),t),createInsecure:ER.ChannelCredentials.createInsecure,createSsl:ER.ChannelCredentials.createSsl,createFromSecureContext:ER.ChannelCredentials.createFromSecureContext,createFromMetadataGenerator:SR.CallCredentials.createFromMetadataGenerator,createFromGoogleCredential:SR.CallCredentials.createFromGoogleCredential,createEmpty:SR.CallCredentials.createEmpty};var eFe=t=>t.close();_e.closeClient=eFe;var tFe=(t,e,r)=>t.waitForReady(e,r);_e.waitForClientReady=tFe;var rFe=(t,e)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.loadObject=rFe;var nFe=(t,e,r)=>{throw new Error("Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead")};_e.load=nFe;var iFe=t=>{zre.setLogger(t)};_e.setLogger=iFe;var oFe=t=>{zre.setLoggerVerbosity(t)};_e.setLogVerbosity=oFe;var sFe=t=>Fre.Client.prototype.getChannel.call(t);_e.getClientChannel=sFe;var vR=sD();Object.defineProperty(_e,"ListenerBuilder",{enumerable:!0,get:function(){return vR.ListenerBuilder}});Object.defineProperty(_e,"RequesterBuilder",{enumerable:!0,get:function(){return vR.RequesterBuilder}});Object.defineProperty(_e,"InterceptingCall",{enumerable:!0,get:function(){return vR.InterceptingCall}});Object.defineProperty(_e,"InterceptorConfigurationError",{enumerable:!0,get:function(){return vR.InterceptorConfigurationError}});var jre=Gc();Object.defineProperty(_e,"getChannelzServiceDefinition",{enumerable:!0,get:function(){return jre.getChannelzServiceDefinition}});Object.defineProperty(_e,"getChannelzHandlers",{enumerable:!0,get:function(){return jre.getChannelzHandlers}});var aFe=UA();Object.defineProperty(_e,"addAdminServicesToServer",{enumerable:!0,get:function(){return aFe.addAdminServicesToServer}});var AU=q1();Object.defineProperty(_e,"ServerListenerBuilder",{enumerable:!0,get:function(){return AU.ServerListenerBuilder}});Object.defineProperty(_e,"ResponderBuilder",{enumerable:!0,get:function(){return AU.ResponderBuilder}});Object.defineProperty(_e,"ServerInterceptingCall",{enumerable:!0,get:function(){return AU.ServerInterceptingCall}});var cFe=eR();Object.defineProperty(_e,"ServerMetricRecorder",{enumerable:!0,get:function(){return cFe.ServerMetricRecorder}});var lFe=tU();_e.experimental=lFe;var uFe=HL(),dFe=Sre(),fFe=Are(),pFe=uS(),hFe=Ire(),mFe=Nre(),gFe=Ure(),_Fe=Gc();uFe.setup(),dFe.setup(),fFe.setup(),pFe.setup(),hFe.setup(),mFe.setup(),gFe.setup(),_Fe.setup()});var Bre=y(bR=>{"use strict";Object.defineProperty(bR,"__esModule",{value:!0});bR.createServiceClientConstructor=void 0;var yFe=yS();function SFe(t,e){let r={export:{path:t,requestStream:!1,responseStream:!1,requestSerialize:n=>n,requestDeserialize:n=>n,responseSerialize:n=>n,responseDeserialize:n=>n}};return yFe.makeGenericClientConstructor(r,e)}bR.createServiceClientConstructor=SFe});var SS=y(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.createOtlpGrpcExporterTransport=Wi.GrpcExporterTransport=Wi.createEmptyMetadata=Wi.createSslCredentials=Wi.createInsecureCredentials=void 0;var EFe=$X(),qre=`OTel-OTLP-Exporter-JavaScript/${EFe.VERSION}`;function vFe(t){return t?`${t} ${qre}`:qre}var bFe=0,TFe=2;function wFe(t){return t==="gzip"?TFe:bFe}function AFe(){let{credentials:t}=yS();return t.createInsecure()}Wi.createInsecureCredentials=AFe;function xFe(t,e,r){let{credentials:n}=yS();return n.createSsl(t,e,r)}Wi.createSslCredentials=xFe;function RFe(){let{Metadata:t}=yS();return new t}Wi.createEmptyMetadata=RFe;var TR=class{_client;_metadata;_parameters;constructor(e){this._parameters=e}shutdown(){this._client?.close()}send(e,r){let n=Buffer.from(e);if(this._client==null){let{createServiceClientConstructor:i}=Bre();try{this._metadata=this._parameters.metadata()}catch(s){return Promise.resolve({status:"failure",error:s})}let o=i(this._parameters.grpcPath,this._parameters.grpcName);try{this._client=new o(this._parameters.address,this._parameters.credentials(),{"grpc.default_compression_algorithm":wFe(this._parameters.compression),"grpc.primary_user_agent":vFe(this._parameters.userAgent)})}catch(s){return Promise.resolve({status:"failure",error:s})}}return new Promise(i=>{let o=Date.now()+r;if(this._metadata==null)return i({error:new Error("metadata was null"),status:"failure"});this._client.export(n,this._metadata,{deadline:o},(s,a)=>{i(s?{status:"failure",error:s}:{data:a,status:"success"})})})}};Wi.GrpcExporterTransport=TR;function CFe(t){return new TR(t)}Wi.createOtlpGrpcExporterTransport=CFe});var Yre=y(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.getOtlpGrpcDefaultConfiguration=Qc.mergeOtlpGrpcConfigurationWithDefaults=Qc.validateAndNormalizeUrl=void 0;var Hre=(gA(),An(mA)),ES=SS(),IFe=Z("url"),Vre=(ve(),An(xc));function Wre(t){t=t.trim(),t.match(/^([\w]{1,8}):\/\//)||(t=`https://${t}`);let r=new IFe.URL(t);return r.protocol==="unix:"?t:(r.pathname&&r.pathname!=="/"&&Vre.diag.warn("URL path should not be set when using grpc, the path part of the URL will be ignored."),r.protocol!==""&&!r.protocol?.match(/^(http)s?:$/)&&Vre.diag.warn("URL protocol should be http(s)://. Using http://."),r.host)}Qc.validateAndNormalizeUrl=Wre;function Gre(t,e){for(let[r,n]of Object.entries(e.getMap()))t.get(r).length<1&&t.set(r,n)}function PFe(t,e,r){let n=t.url??e.url??r.url;return{...(0,Hre.mergeOtlpSharedConfigurationWithDefaults)(t,e,r),metadata:()=>{let i=r.metadata();return Gre(i,t.metadata?.().clone()??(0,ES.createEmptyMetadata)()),Gre(i,e.metadata?.()??(0,ES.createEmptyMetadata)()),i},url:Wre(n),credentials:t.credentials??e.credentials?.(n)??r.credentials(n),userAgent:t.userAgent}}Qc.mergeOtlpGrpcConfigurationWithDefaults=PFe;function OFe(){return{...(0,Hre.getSharedConfigurationDefaults)(),metadata:()=>(0,ES.createEmptyMetadata)(),url:"http://localhost:4317",credentials:t=>t.startsWith("http://")?()=>(0,ES.createInsecureCredentials)():()=>(0,ES.createSslCredentials)()}}Qc.getOtlpGrpcDefaultConfiguration=OFe});function Kre(t){let e={};return Object.entries(t??{}).forEach(([r,n])=>{typeof n<"u"?e[r]=String(n):J.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),e}var Zre=C(()=>{"use strict";ve()});function NFe(t,e,r){return async()=>{let n={...await r()},i={};return e!=null&&Object.assign(i,await e()),t!=null&&Object.assign(i,Kre(await t())),Object.assign(i,n)}}function kFe(t){if(t!=null)try{let e=globalThis.location?.href;return new URL(t,e).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${t}'`)}}function Jre(t,e,r){return{...Vw(t,e,r),headers:NFe(t.headers,e.headers,r.headers),url:kFe(t.url)??e.url??r.url}}function Xre(t,e){return{...Gw(),headers:async()=>t,url:"http://localhost:4318/"+e}}var Qre=C(()=>{"use strict";py();Zre()});function ad(t){return async e=>{let r=e==="http:",n=r?import("http"):import("https"),{Agent:i}=await n;if(r){let{ca:o,cert:s,key:a,...c}=t;return new i(c)}return new i(t)}}function ene(t,e,r){return{...Jre(t,e,r),agentFactory:t.agentFactory??e.agentFactory??r.agentFactory,userAgent:t.userAgent}}function tne(t,e){return{...Xre(t,e),agentFactory:ad({keepAlive:!0})}}var wR=C(()=>{"use strict";Qre()});function xU(t){return t===429||t===502||t===503||t===504}function RU(t){if(t==null)return;let e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let r=new Date(t).getTime()-Date.now();return r>=0?r:0}var rne=C(()=>{"use strict"});var nne,ine=C(()=>{"use strict";nne="0.218.0"});import*as ane from"zlib";import{Readable as MFe}from"stream";function cne(t,e,r,n,i,o,s,a){return new Promise(c=>{let l=new URL(e);i?r["User-Agent"]=`${i} ${one}`:r["User-Agent"]=one;let d=t(l,{method:"POST",headers:r,agent:o},f=>{let p=[],h=0;f.on("data",m=>{if(h+=m.length,h>sne){let g=new Error(`OTLP export response body exceeded size limit of ${sne} bytes`);c({status:"failure",error:g}),f.destroy();return}p.push(m)}),f.on("end",()=>{if(f.statusCode&&f.statusCode<=299)c({status:"success",data:Buffer.concat(p)});else if(f.statusCode&&xU(f.statusCode))c({status:"retryable",retryInMillis:RU(f.headers["retry-after"])});else{let m=new ha(f.statusMessage,f.statusCode,Buffer.concat(p).toString());c({status:"failure",error:m})}}),f.on("error",m=>{f.statusCode&&f.statusCode<=299?c({status:"success"}):f.statusCode&&xU(f.statusCode)?c({status:"retryable",error:m,retryInMillis:RU(f.headers["retry-after"])}):c({status:"failure",error:m})})});d.setTimeout(a,()=>{d.destroy(),c({status:"retryable",error:new Error("Request timed out")})}),d.on("error",f=>{LFe(f)?c({status:"retryable",error:f}):c({status:"failure",error:f})}),$Fe(d,n,s,f=>{c({status:"failure",error:f})})})}function $Fe(t,e,r,n){let i=DFe(r);e==="gzip"&&(t.setHeader("Content-Encoding","gzip"),i=i.on("error",n).pipe(ane.createGzip()).on("error",n)),i.pipe(t).on("error",n)}function DFe(t){let e=new MFe;return e.push(t),e.push(null),e}function LFe(t){let e=new Set(["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH"]);return"code"in t&&typeof t.code=="string"?e.has(t.code):!1}var one,sne,lne=C(()=>{"use strict";rne();Bw();ine();one=`OTel-OTLP-Exporter-JavaScript/${nne}`,sne=4*1024*1024});async function UFe(t){let e=t==="http:"?import("http"):import("https"),{request:r}=await e;return r}function une(t){return new CU(t)}var CU,dne=C(()=>{"use strict";lne();CU=class{_utils=null;_parameters;constructor(e){this._parameters=e}async send(e,r){let{agent:n,request:i}=await this._loadUtils(),o=await this._parameters.headers();return cne(i,this._parameters.url,o,this._parameters.compression,this._parameters.userAgent,n,e,r)}shutdown(){}async _loadUtils(){let e=this._utils;if(e===null){let r=new URL(this._parameters.url).protocol,[n,i]=await Promise.all([this._parameters.agentFactory(r),UFe(r)]);e=this._utils={agent:n,request:i}}return e}}});function BFe(){return Math.random()*(2*fne)-fne}function pne(t){return new PU(t.transport)}var IU,FFe,zFe,jFe,fne,PU,hne=C(()=>{"use strict";ve();IU=5,FFe=1e3,zFe=5e3,jFe=1.5,fne=.2;PU=class{_transport;constructor(e){this._transport=e}retry(e,r,n){return new Promise((i,o)=>{setTimeout(()=>{this._transport.send(e,r).then(i,o)},n)})}async send(e,r){let n=IU,i=FFe,o=Date.now()+r,s=await this._transport.send(e,r);for(;s.status==="retryable"&&n>0;){n--;let a=Math.max(Math.min(i*(1+BFe()),zFe),0);i=i*jFe;let c=s.retryInMillis??a,l=o-Date.now();if(c>l)return J.info(`Export retry time ${Math.round(c)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),s;J.verbose(`Scheduling export retry in ${Math.round(c)}ms`),s=await this.retry(e,l,c)}return s.status==="success"?J.verbose(`Export succeeded after ${IU-n} retry attempts.`):s.status==="retryable"?J.info(`Export failed after maximum retry attempts (${IU}).`):J.info(`Export failed with non-retryable error: ${s.error}`),s}shutdown(){return this._transport.shutdown()}}});function mne(t,e){return hA({transport:pne({transport:une(t)}),serializer:e,promiseHandler:Ww(t)},{timeout:t.timeoutMillis})}var gne=C(()=>{"use strict";S$();dne();e$();hne()});function _ne(t){let e=ip(t);if(e!=null){if(Number.isFinite(e)&&e>0)return e;J.warn(`Configuration: ${t} is invalid, expected number greater than 0 (actual: ${e})`)}}function qFe(t){let e=_ne(`OTEL_EXPORTER_OTLP_${t}_TIMEOUT`),r=_ne("OTEL_EXPORTER_OTLP_TIMEOUT");return e??r}function yne(t){let e=qn(t)?.trim();if(e==null||e==="none"||e==="gzip")return e;J.warn(`Configuration: ${t} is invalid, expected 'none' or 'gzip' (actual: '${e}')`)}function VFe(t){let e=yne(`OTEL_EXPORTER_OTLP_${t}_COMPRESSION`),r=yne("OTEL_EXPORTER_OTLP_COMPRESSION");return e??r}function AR(t){return{timeoutMillis:qFe(t),compression:VFe(t)}}var OU=C(()=>{"use strict";ap();ve()});import*as Sne from"fs";import*as Ene from"path";function GFe(t){let e=qn(`OTEL_EXPORTER_OTLP_${t}_HEADERS`),r=qn("OTEL_EXPORTER_OTLP_HEADERS"),n=Mu(e),i=Mu(r);if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return Object.assign({},Mu(r),Mu(e))}function HFe(t){try{return new URL(t).toString()}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}}function WFe(t,e){try{new URL(t)}catch{J.warn(`Configuration: Could not parse environment-provided export URL: '${t}', falling back to undefined`);return}t.endsWith("/")||(t=t+"/"),t+=e;try{new URL(t)}catch{J.warn(`Configuration: Provided URL appended with '${e}' is not a valid URL, using 'undefined' instead of '${t}'`);return}return t}function YFe(t){let e=qn("OTEL_EXPORTER_OTLP_ENDPOINT");if(e!==void 0)return WFe(e,t)}function KFe(t){let e=qn(`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`);if(e!==void 0)return HFe(e)}function NU(t,e,r){let n=qn(t),i=qn(e),o=n??i;if(o!=null)try{return Sne.readFileSync(Ene.resolve(process.cwd(),o))}catch{J.warn(r);return}else return}function ZFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function JFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function XFe(t){return NU(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function vne(t,e){return{...AR(t),url:KFe(t)??YFe(e),headers:qw(GFe(t)),agentFactory:ad({keepAlive:!0,ca:XFe(t),cert:ZFe(t),key:JFe(t)})}}var bne=C(()=>{"use strict";ap();ve();OU();py();wR()});function Tne(t){return typeof t.headers=="function"?t.headers:qw(t.headers)}var wne=C(()=>{"use strict";py()});function QFe(t){if(typeof t.httpAgentOptions=="function")return t.httpAgentOptions;let e=t.httpAgentOptions;if(t.keepAlive!=null&&(e={keepAlive:t.keepAlive,...e}),e!=null)return ad(e)}function Ane(t,e,r,n){return t.metadata&&J.warn("Metadata cannot be set when using http"),ene({url:t.url,headers:Tne(t),concurrencyLimit:t.concurrencyLimit,timeoutMillis:t.timeoutMillis,compression:t.compression,agentFactory:QFe(t),userAgent:t.userAgent},vne(e,r),tne(n,r))}var xne=C(()=>{"use strict";ve();wR();kU();bne();wne()});var Rne={};jr(Rne,{convertLegacyHttpOptions:()=>Ane,createOtlpHttpExportDelegate:()=>mne,getSharedConfigurationFromEnvironment:()=>AR,httpAgentFactoryFromOptions:()=>ad});var kU=C(()=>{"use strict";wR();gne();OU();xne()});var Nne=y(xR=>{"use strict";Object.defineProperty(xR,"__esModule",{value:!0});xR.getOtlpGrpcConfigurationFromEnv=void 0;var Cne=(ap(),An(PX)),vS=SS(),eze=(kU(),An(Rne)),tze=Z("fs"),rze=Z("path"),Pne=(ve(),An(xc));function MU(t,e){if(t!=null&&t!=="")return t;if(e!=null&&e!=="")return e}function nze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_HEADERS`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),n=(0,Cne.parseKeyPairsIntoRecord)(e),i=(0,Cne.parseKeyPairsIntoRecord)(r);if(Object.keys(n).length===0&&Object.keys(i).length===0)return;let o=Object.assign({},i,n),s=(0,vS.createEmptyMetadata)();for(let[a,c]of Object.entries(o))s.set(a,c);return s}function ize(t){let e=nze(t);if(e!=null)return()=>e}function oze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_ENDPOINT`]?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();return MU(e,r)}function sze(t){let e=process.env[`OTEL_EXPORTER_OTLP_${t}_INSECURE`]?.toLowerCase().trim(),r=process.env.OTEL_EXPORTER_OTLP_INSECURE?.toLowerCase().trim();return MU(e,r)==="true"}function $U(t,e,r){let n=process.env[t]?.trim(),i=process.env[e]?.trim(),o=MU(n,i);if(o!=null)try{return tze.readFileSync(rze.resolve(process.cwd(),o))}catch{Pne.diag.warn(r);return}else return}function aze(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CLIENT_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE","Failed to read client certificate chain file")}function cze(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CLIENT_KEY`,"OTEL_EXPORTER_OTLP_CLIENT_KEY","Failed to read client certificate private key file")}function Ine(t){return $U(`OTEL_EXPORTER_OTLP_${t}_CERTIFICATE`,"OTEL_EXPORTER_OTLP_CERTIFICATE","Failed to read root certificate file")}function One(t){let e=cze(t),r=aze(t),n=Ine(t),i=e!=null&&r!=null;return n!=null&&!i?(Pne.diag.warn("Client key and certificate must both be provided, but one was missing - attempting to create credentials from just the root certificate"),(0,vS.createSslCredentials)(Ine(t))):(0,vS.createSslCredentials)(n,e,r)}function lze(t){return sze(t)?(0,vS.createInsecureCredentials)():One(t)}function uze(t){return{...(0,eze.getSharedConfigurationFromEnvironment)(t),metadata:ize(t),url:oze(t),credentials:e=>e.startsWith("http://")?()=>(0,vS.createInsecureCredentials)():e.startsWith("https://")?()=>One(t):()=>lze(t)}}xR.getOtlpGrpcConfigurationFromEnv=uze});var Mne=y(RR=>{"use strict";Object.defineProperty(RR,"__esModule",{value:!0});RR.convertLegacyOtlpGrpcOptions=void 0;var kne=Yre(),dze=SS(),fze=Nne();function pze(t,e){let r=t.credentials;return(0,kne.mergeOtlpGrpcConfigurationWithDefaults)({url:t.url,metadata:()=>t.metadata??(0,dze.createEmptyMetadata)(),compression:t.compression,timeoutMillis:t.timeoutMillis,concurrencyLimit:t.concurrencyLimit,credentials:r!=null?()=>r:void 0,userAgent:t.userAgent},(0,fze.getOtlpGrpcConfigurationFromEnv)(e),(0,kne.getOtlpGrpcDefaultConfiguration)())}RR.convertLegacyOtlpGrpcOptions=pze});var $ne=y(CR=>{"use strict";Object.defineProperty(CR,"__esModule",{value:!0});CR.createOtlpGrpcExportDelegate=void 0;var hze=(gA(),An(mA)),mze=SS();function gze(t,e,r,n){return(0,hze.createOtlpNetworkExportDelegate)(t,e,(0,mze.createOtlpGrpcExporterTransport)({address:t.url,compression:t.compression,credentials:t.credentials,metadata:t.metadata,userAgent:t.userAgent,grpcName:r,grpcPath:n}))}CR.createOtlpGrpcExportDelegate=gze});var Dne=y(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.createOtlpGrpcExportDelegate=Yp.convertLegacyOtlpGrpcOptions=void 0;var _ze=Mne();Object.defineProperty(Yp,"convertLegacyOtlpGrpcOptions",{enumerable:!0,get:function(){return _ze.convertLegacyOtlpGrpcOptions}});var yze=$ne();Object.defineProperty(Yp,"createOtlpGrpcExportDelegate",{enumerable:!0,get:function(){return yze.createOtlpGrpcExportDelegate}})});function Ia(t){return t<0?10:t<128?1:t<16384?2:t<2097152?3:t<268435456?4:t<34359738368?5:t<4398046511104?6:t<562949953421312?7:t<72057594037927940?8:9}var DU=C(()=>{"use strict"});var Sze,bS,el,IR=C(()=>{"use strict";ve();DU();Sze="ProtobufWriter: estimated size was too small, growing buffer.",bS=1,el=class{_buffer;_textEncoder;_dataView;pos=0;constructor(e=65536){this._buffer=new Uint8Array(e),this._textEncoder=new TextEncoder,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}_ensureCapacity(e){let r=this.pos+e;if(r<=this._buffer.length)return;J.debug(Sze);let n=this._buffer.length*2;for(;n<r;)n*=2;let i=new Uint8Array(n);i.set(this._buffer),this._buffer=i,this._dataView=new DataView(this._buffer.buffer,this._buffer.byteOffset)}finish(){return this._buffer.subarray(0,this.pos)}startLengthDelimited(){let e=this.pos;return this._ensureCapacity(bS),this.pos+=bS,e}finishLengthDelimited(e,r){let n=r>>>0,i=Ia(n);if(i>bS){let s=i-bS;this._ensureCapacity(s),this._buffer.copyWithin(e+i,e+bS,this.pos),this.pos+=s}let o=e;n<128?this._buffer[o]=n:n<16384?(this._buffer[o++]=n&127|128,this._buffer[o]=n>>>7):n<2097152?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o]=n>>>14):n<268435456?(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o]=n>>>21):(this._buffer[o++]=n&127|128,this._buffer[o++]=n>>>7&127|128,this._buffer[o++]=n>>>14&127|128,this._buffer[o++]=n>>>21&127|128,this._buffer[o]=n>>>28)}writeSint32(e){this.writeVarint((e<<1^e>>31)>>>0)}writeSfixed64(e){let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}this.writeFixed64(r,n)}writeVarint(e){if(this._ensureCapacity(Ia(e)),e>=0&&e<=4294967295){let r=e>>>0;for(;r>127;)this._buffer[this.pos++]=r&127|128,r>>>=7;this._buffer[this.pos++]=r}else{let r,n;if(e>=0)r=e>>>0,n=e/4294967296>>>0;else{let i=Math.abs(e);r=i>>>0,n=i/4294967296>>>0,r=~r>>>0,n=~n>>>0,r=r+1>>>0,r===0&&(n=n+1>>>0)}for(;n>0||r>127;)this._buffer[this.pos++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;this._buffer[this.pos++]=r&127}}writeFixed32(e){this._ensureCapacity(4);let r=e>>>0;this._buffer[this.pos++]=r&255,this._buffer[this.pos++]=r>>>8&255,this._buffer[this.pos++]=r>>>16&255,this._buffer[this.pos++]=r>>>24&255}writeFixed64(e,r){this._ensureCapacity(8);let n=e>>>0,i=r>>>0;this._buffer[this.pos++]=n&255,this._buffer[this.pos++]=n>>>8&255,this._buffer[this.pos++]=n>>>16&255,this._buffer[this.pos++]=n>>>24&255,this._buffer[this.pos++]=i&255,this._buffer[this.pos++]=i>>>8&255,this._buffer[this.pos++]=i>>>16&255,this._buffer[this.pos++]=i>>>24&255}writeBytes(e){this.writeVarint(e.length),this._ensureCapacity(e.length),this._buffer.set(e,this.pos),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this._ensureCapacity(8),this._dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeString(e){let r=!0,n=e.length;for(let i=0;i<n;i++)if(e.charCodeAt(i)>127){r=!1;break}if(r){this.writeVarint(n),this._ensureCapacity(n);for(let i=0;i<n;i++)this._buffer[this.pos++]=e.charCodeAt(i)}else{let i=this._textEncoder.encode(e);this.writeBytes(i)}}}});function Lne(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Pa(t){let e=new Uint8Array(t.length/2),r=0;for(let n=0;n<t.length;n+=2){let i=Lne(t.charCodeAt(n)),o=Lne(t.charCodeAt(n+1));e[r++]=i<<4|o}return e}var LU=C(()=>{"use strict"});var TS,Une=C(()=>{"use strict";(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(TS||(TS={}))});var wS,Fne,UU=C(()=>{"use strict";wS=class{emit(e){}enabled(){return!1}},Fne=new wS});function zne(t,e,r){return n=>n===t?e:r}var AS,Kp,FU,jne=C(()=>{"use strict";AS=Symbol.for("io.opentelemetry.js.api.logs"),Kp=globalThis;FU=1});var zU,PR,jU=C(()=>{"use strict";UU();zU=class{getLogger(e,r,n){return new wS}},PR=new zU});var OR,Bne=C(()=>{"use strict";UU();OR=class{constructor(e,r,n,i){this._provider=e,this.name=r,this.version=n,this.options=i}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Fne}}});var xS,qne=C(()=>{"use strict";jU();Bne();xS=class{getLogger(e,r,n){var i;return(i=this._getDelegateLogger(e,r,n))!==null&&i!==void 0?i:new OR(this,e,r,n)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:PR}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(e,r,n)}}});var NR,Vne=C(()=>{"use strict";jne();jU();qne();NR=class t{constructor(){this._proxyLoggerProvider=new xS}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Kp[AS]?this.getLoggerProvider():(Kp[AS]=zne(FU,e,PR),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Kp[AS])===null||e===void 0?void 0:e.call(Kp,FU))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Kp[AS],this._proxyLoggerProvider=new xS}}});var JCt,Gne=C(()=>{"use strict";Une();Vne();JCt=NR.getInstance()});function Yn(t,e){let r=e[0],n=e[1],i=1e9,o=r&65535,s=r/65536>>>0,a=o*i,c=s*i,l=a>>>0,u=Math.floor(a/4294967296),d=(c&65535)*65536>>>0,f=c/65536>>>0,p=l+d+n,h=p>>>0,m=Math.floor(p/4294967296),g=u+f+m>>>0;t.writeFixed64(h,g)}function Po(t,e,r){for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let i=e[n];t.writeTag(r,2);let o=t.startLengthDelimited(),s=t.pos;Eze(t,n,i),t.finishLengthDelimited(o,t.pos-s)}}function Eze(t,e,r){t.writeTag(1,2),t.writeString(e),t.writeTag(2,2);let n=t.startLengthDelimited(),i=t.pos;RS(t,r),t.finishLengthDelimited(n,t.pos-i)}function RS(t,e){let r=typeof e;if(r==="string")t.writeTag(1,2),t.writeString(e);else if(r==="boolean")t.writeTag(2,0),t.writeVarint(e?1:0);else if(r==="number"){let n=e;Number.isInteger(n)&&n>=vze&&n<bze?(t.writeTag(3,0),t.writeVarint(n)):(t.writeTag(4,1),t.writeDouble(n))}else if(e instanceof Uint8Array)t.writeTag(7,2),t.writeBytes(e);else if(Array.isArray(e)){t.writeTag(5,2);let n=t.startLengthDelimited(),i=t.pos;for(let o of e){t.writeTag(1,2);let s=t.startLengthDelimited(),a=t.pos;RS(t,o),t.finishLengthDelimited(s,t.pos-a)}t.finishLengthDelimited(n,t.pos-i)}else if(r==="object"&&e!=null){t.writeTag(6,2);let n=t.startLengthDelimited(),i=t.pos,o=e;for(let s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;let a=o[s];t.writeTag(1,2);let c=t.startLengthDelimited(),l=t.pos;t.writeTag(1,2),t.writeString(s),t.writeTag(2,2);let u=t.startLengthDelimited(),d=t.pos;RS(t,a),t.finishLengthDelimited(u,t.pos-d),t.finishLengthDelimited(c,t.pos-l)}t.finishLengthDelimited(n,t.pos-i)}}function Zp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;t.writeTag(1,2),t.writeString(e.name),e.version&&(t.writeTag(2,2),t.writeString(e.version)),t.finishLengthDelimited(n,t.pos-i)}function Jp(t,e,r){t.writeTag(r,2);let n=t.startLengthDelimited(),i=t.pos;e.attributes&&Po(t,e.attributes,1),t.writeTag(2,0),t.writeVarint(0),t.finishLengthDelimited(n,t.pos-i)}var vze,bze,kR=C(()=>{"use strict";vze=-(2**63),bze=2**63});function Tze(t){let e=t.length,r=0;for(let n=0;n<e;n++){let i=t.charCodeAt(n);i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4)}return r}var tl,MR=C(()=>{"use strict";DU();tl=class{pos=0;startLengthDelimited(){return this.pos}finishLengthDelimited(e,r){this.pos+=Ia(r)}writeVarint(e){this.pos+=Ia(e)}writeSint32(e){this.pos+=Ia((e<<1^e>>31)>>>0)}writeSfixed64(e){this.pos+=8}writeFixed32(e){this.pos+=4}writeFixed64(e,r){this.pos+=8}writeBytes(e){this.pos+=Ia(e.length),this.pos+=e.length}writeTag(e,r){this.writeVarint(e<<3|r)}writeDouble(e){this.pos+=8}writeString(e){let r=Tze(e);this.pos+=Ia(r),this.pos+=r}}});function wze(t,e){let r=t.startLengthDelimited(),n=t.pos;if(t.writeTag(1,1),Yn(t,e.hrTime),e.severityNumber!==void 0&&e.severityNumber!==TS.UNSPECIFIED&&(t.writeTag(2,0),t.writeVarint(e.severityNumber)),e.severityText&&(t.writeTag(3,2),t.writeString(e.severityText)),e.body!==void 0){t.writeTag(5,2);let i=t.startLengthDelimited(),o=t.pos;RS(t,e.body),t.finishLengthDelimited(i,t.pos-o)}e.attributes&&Po(t,e.attributes,6),t.writeTag(7,0),t.writeVarint(e.droppedAttributesCount),e.spanContext?.traceFlags&&(t.writeTag(8,5),t.writeFixed32(e.spanContext.traceFlags)),e.spanContext?.traceId&&(t.writeTag(9,2),t.writeBytes(Pa(e.spanContext.traceId))),e.spanContext?.spanId&&(t.writeTag(10,2),t.writeBytes(Pa(e.spanContext.spanId))),t.writeTag(11,1),Yn(t,e.hrTimeObserved),e.eventName&&(t.writeTag(12,2),t.writeString(e.eventName)),t.finishLengthDelimited(r,t.pos-n)}function Aze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Zp(t,e,1);for(let o of r)t.writeTag(2,2),wze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Hne(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Jp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;Aze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function xze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function Wne(t){let e=xze(t),r=new tl;for(let[i,o]of e)r.writeTag(1,2),Hne(r,i,o);let n=new el(r.pos);for(let[i,o]of e)n.writeTag(1,2),Hne(n,i,o);return n.finish()}var Yne=C(()=>{"use strict";IR();LU();Gne();kR();MR()});var Oo,$R=C(()=>{"use strict";Oo=class{pos=0;_buf;_textDecoder;constructor(e){this._buf=e,this._textDecoder=new TextDecoder}isAtEnd(){return this.pos>=this._buf.length}readTag(){let e=this.readVarint();return{fieldNumber:e>>>3,wireType:e&7}}readVarint(){let e=0,r=0,n=!1;for(;this.pos<this._buf.length;){let i=this._buf[this.pos++];if(e+=(i&127)*Math.pow(2,r),r+=7,(i&128)===0){n=!0;break}}if(!n)throw new Error("Truncated buffer: unexpected end of data while reading varint");return e}readBytes(){let e=this.readVarint();if(this.pos+e>this._buf.length)throw new Error(`Truncated buffer: expected ${e} bytes at position ${this.pos}, but only ${this._buf.length-this.pos} available`);let r=this._buf.subarray(this.pos,this.pos+e);return this.pos+=e,r}readString(){return this._textDecoder.decode(this.readBytes())}skip(e){switch(e){case 0:this.readVarint();break;case 1:this.pos+=8;break;case 2:this.readBytes();break;case 3:for(;!this.isAtEnd();){let{wireType:r}=this.readTag();if(r===4)break;this.skip(r)}break;case 4:break;case 5:this.pos+=4;break;default:throw new Error(`Unknown wire type ${e}, cannot safely skip`)}}}});function Rze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedLogRecords=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function Kne(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Rze(e.readBytes()):e.skip(i)}return r}var Zne=C(()=>{"use strict";$R()});var BU,Jne=C(()=>{"use strict";Yne();Zne();BU={serializeRequest:t=>Wne(t),deserializeResponse:t=>Kne(t)}});var Xne=C(()=>{"use strict";Jne()});var Oa,Qne=C(()=>{"use strict";(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE"})(Oa||(Oa={}))});var qU,Si,eie=C(()=>{"use strict";(function(t){t.COUNTER="COUNTER",t.GAUGE="GAUGE",t.HISTOGRAM="HISTOGRAM",t.UP_DOWN_COUNTER="UP_DOWN_COUNTER",t.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",t.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",t.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(qU||(qU={}));(function(t){t[t.HISTOGRAM=0]="HISTOGRAM",t[t.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",t[t.GAUGE=2]="GAUGE",t[t.SUM=3]="SUM"})(Si||(Si={}))});var VU=C(()=>{"use strict";Qne();eie()});function nie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),r===ca.INT?(t.writeTag(6,1),t.writeSfixed64(e.value)):(t.writeTag(4,1),t.writeDouble(e.value)),e.attributes&&Po(t,e.attributes,7),t.finishLengthDelimited(n,t.pos-i)}function Cze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;if(t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.buckets.counts.length>0){t.writeTag(6,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.counts)t.writeFixed64(a>>>0,a/4294967296>>>0);t.finishLengthDelimited(o,t.pos-s)}if(i.buckets.boundaries.length>0){t.writeTag(7,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of i.buckets.boundaries)t.writeDouble(a);t.finishLengthDelimited(o,t.pos-s)}e.attributes&&Po(t,e.attributes,9),i.min!==void 0&&(t.writeTag(11,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(12,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function tie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;if(e!==0&&(t.writeTag(1,0),t.writeSint32(e)),r.length>0){t.writeTag(2,2);let o=t.startLengthDelimited(),s=t.pos;for(let a of r)t.writeVarint(a);t.finishLengthDelimited(o,t.pos-s)}t.finishLengthDelimited(n,t.pos-i)}function Ize(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.value;e.attributes&&Po(t,e.attributes,1),t.writeTag(2,1),Yn(t,e.startTime),t.writeTag(3,1),Yn(t,e.endTime),t.writeTag(4,1),t.writeFixed64(i.count>>>0,i.count/4294967296>>>0),i.sum!==void 0&&(t.writeTag(5,1),t.writeDouble(i.sum)),i.scale!==0&&(t.writeTag(6,0),t.writeSint32(i.scale)),t.writeTag(7,1),t.writeFixed64(i.zeroCount>>>0,i.zeroCount/4294967296>>>0),t.writeTag(8,2),tie(t,i.positive.offset,i.positive.bucketCounts),t.writeTag(9,2),tie(t,i.negative.offset,i.negative.bucketCounts),i.min!==void 0&&(t.writeTag(12,1),t.writeDouble(i.min)),i.max!==void 0&&(t.writeTag(13,1),t.writeDouble(i.max)),t.finishLengthDelimited(r,t.pos-n)}function Pze(t,e){let r=t.startLengthDelimited(),n=t.pos;switch(t.writeTag(1,2),t.writeString(e.descriptor.name),e.descriptor.description&&(t.writeTag(2,2),t.writeString(e.descriptor.description)),e.descriptor.unit&&(t.writeTag(3,2),t.writeString(e.descriptor.unit)),e.dataPointType){case Si.GAUGE:t.writeTag(5,2),Oze(t,e);break;case Si.SUM:t.writeTag(7,2),Nze(t,e);break;case Si.HISTOGRAM:t.writeTag(9,2),kze(t,e);break;case Si.EXPONENTIAL_HISTOGRAM:t.writeTag(10,2),Mze(t,e);break;default:{let i=e}}t.finishLengthDelimited(r,t.pos-n)}function Oze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let i of e.dataPoints)t.writeTag(1,2),nie(t,i,e.descriptor.valueType);t.finishLengthDelimited(r,t.pos-n)}function Nze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),nie(t,o,e.descriptor.valueType);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),e.isMonotonic&&(t.writeTag(3,0),t.writeVarint(1)),t.finishLengthDelimited(r,t.pos-n)}function kze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Cze(t,o);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function Mze(t,e){let r=t.startLengthDelimited(),n=t.pos;for(let o of e.dataPoints)t.writeTag(1,2),Ize(t,o);let i=GU(e.aggregationTemporality);i!==0&&(t.writeTag(2,0),t.writeVarint(i)),t.finishLengthDelimited(r,t.pos-n)}function $ze(t,e){let r=t.startLengthDelimited(),n=t.pos;Zp(t,e.scope,1);for(let i of e.metrics)t.writeTag(2,2),Pze(t,i);e.scope.schemaUrl&&(t.writeTag(3,2),t.writeString(e.scope.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function rie(t,e){let r=t.startLengthDelimited(),n=t.pos;Jp(t,e.resource,1);for(let i of e.scopeMetrics)t.writeTag(2,2),$ze(t,i);e.resource.schemaUrl&&(t.writeTag(3,2),t.writeString(e.resource.schemaUrl)),t.finishLengthDelimited(r,t.pos-n)}function GU(t){switch(t){case Oa.DELTA:return 1;case Oa.CUMULATIVE:return 2;default:return 0}}function iie(t){let e=new tl;e.writeTag(1,2),rie(e,t);let r=new el(e.pos);return r.writeTag(1,2),rie(r,t),r.finish()}var oie=C(()=>{"use strict";ve();VU();kR();MR();IR()});function Dze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedDataPoints=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function sie(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Dze(e.readBytes()):e.skip(i)}return r}var aie=C(()=>{"use strict";$R()});var HU,cie=C(()=>{"use strict";oie();aie();HU={serializeRequest:t=>iie(t),deserializeResponse:t=>sie(t)}});var lie=C(()=>{"use strict";cie()});function die(t,e){let r=t&255|Lze;return e&&(r|=Uze),r}function Fze(t,e){let r=t.startLengthDelimited(),n=t.pos;e.message&&(t.writeTag(2,2),t.writeString(e.message)),t.writeTag(3,0),t.writeVarint(e.code),t.finishLengthDelimited(r,t.pos-n)}function zze(t,e){let r=t.startLengthDelimited(),n=t.pos;t.writeTag(1,1),Yn(t,e.time),t.writeTag(2,2),t.writeString(e.name),e.attributes&&Po(t,e.attributes,3),t.writeTag(4,0),t.writeVarint(e.droppedAttributesCount||0),t.finishLengthDelimited(r,t.pos-n)}function jze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.context;t.writeTag(1,2),t.writeBytes(Pa(i.traceId)),t.writeTag(2,2),t.writeBytes(Pa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.attributes&&Po(t,e.attributes,4),t.writeTag(5,0),t.writeVarint(e.droppedAttributesCount||0);let s=die(i.traceFlags,i.isRemote);s&&(t.writeTag(6,5),t.writeFixed32(s)),t.finishLengthDelimited(r,t.pos-n)}function Bze(t,e){let r=t.startLengthDelimited(),n=t.pos,i=e.spanContext();t.writeTag(1,2),t.writeBytes(Pa(i.traceId)),t.writeTag(2,2),t.writeBytes(Pa(i.spanId));let o=i.traceState?.serialize();o&&(t.writeTag(3,2),t.writeString(o)),e.parentSpanContext?.spanId&&(t.writeTag(4,2),t.writeBytes(Pa(e.parentSpanContext.spanId))),t.writeTag(5,2),t.writeString(e.name);let s=e.kind==null?0:e.kind+1;s!==0&&(t.writeTag(6,0),t.writeVarint(s)),t.writeTag(7,1),Yn(t,e.startTime),t.writeTag(8,1),Yn(t,e.endTime),e.attributes&&Po(t,e.attributes,9),t.writeTag(10,0),t.writeVarint(e.droppedAttributesCount);for(let c of e.events)t.writeTag(11,2),zze(t,c);t.writeTag(12,0),t.writeVarint(e.droppedEventsCount);for(let c of e.links)t.writeTag(13,2),jze(t,c);t.writeTag(14,0),t.writeVarint(e.droppedLinksCount),t.writeTag(15,2),Fze(t,e.status);let a=die(i.traceFlags,e.parentSpanContext?.isRemote);a&&(t.writeTag(16,5),t.writeFixed32(a)),t.finishLengthDelimited(r,t.pos-n)}function qze(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Zp(t,e,1);for(let o of r)t.writeTag(2,2),Bze(t,o);e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function uie(t,e,r){let n=t.startLengthDelimited(),i=t.pos;Jp(t,e,1);for(let o of r.values()){t.writeTag(2,2);let s=o[0].instrumentationScope;qze(t,s,o)}e.schemaUrl&&(t.writeTag(3,2),t.writeString(e.schemaUrl)),t.finishLengthDelimited(n,t.pos-i)}function Vze(t){let e=new Map;for(let r of t){let n=r.resource,i=r.instrumentationScope,o=e.get(n);o||(o=new Map,e.set(n,o));let s=o.get(i);s||(s=[],o.set(i,s)),s.push(r)}return e}function fie(t){let e=Vze(t),r=new tl;for(let[i,o]of e)r.writeTag(1,2),uie(r,i,o);let n=new el(r.pos);for(let[i,o]of e)n.writeTag(1,2),uie(n,i,o);return n.finish()}var Lze,Uze,pie=C(()=>{"use strict";IR();LU();kR();MR();Lze=256,Uze=512});function Gze(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();switch(n){case 1:i===0?r.rejectedSpans=e.readVarint():e.skip(i);break;case 2:i===2?r.errorMessage=e.readString():e.skip(i);break;default:e.skip(i);break}}return r}function hie(t){let e=new Oo(t),r={};for(;!e.isAtEnd();){let{fieldNumber:n,wireType:i}=e.readTag();n===1&&i===2?r.partialSuccess=Gze(e.readBytes()):e.skip(i)}return r}var mie=C(()=>{"use strict";$R()});var WU,gie=C(()=>{"use strict";pie();mie();WU={serializeRequest:t=>fie(t),deserializeResponse:t=>hie(t)}});var _ie=C(()=>{"use strict";gie()});function Xp(t,e){let r={attributes:Na(t.attributes,e),droppedAttributesCount:0},n=t.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Qp(t){return{name:t.name,version:t.version}}function Na(t,e){return Object.keys(t).map(r=>YU(r,t[r],e))}function YU(t,e,r){return{key:t,value:CS(e,r)}}function CS(t,e){let r=typeof t;if(r==="string")return{stringValue:t};if(r==="number")return Number.isInteger(t)?{intValue:t}:{doubleValue:t};if(r==="boolean")return{boolValue:t};if(t instanceof Uint8Array)return{bytesValue:e.encodeUint8Array(t)};if(Array.isArray(t)){let n=new Array(t.length);for(let i=0;i<t.length;i++)n[i]=CS(t[i],e);return{arrayValue:{values:n}}}if(r==="object"&&t!=null){let n=Object.keys(t),i=new Array(n.length);for(let o=0;o<n.length;o++)i[o]={key:n[o],value:CS(t[n[o]],e)};return{kvlistValue:{values:i}}}return{}}var DR=C(()=>{"use strict"});function yie(t,e){return{resourceLogs:Wze(t,e)}}function Hze(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${o}:${s}`,l=a.get(c);l||(l=[],a.set(c,l)),l.push(r)}return e}function Wze(t,e){let r=Hze(t);return Array.from(r,([n,i])=>{let o=Xp(n,e);return{resource:o,scopeLogs:Array.from(i,([,s])=>({scope:Qp(s[0].instrumentationScope),logRecords:s.map(a=>Yze(a,e)),schemaUrl:s[0].instrumentationScope.schemaUrl})),schemaUrl:o.schemaUrl}})}function Yze(t,e){return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:CS(t.body,e),eventName:t.eventName,attributes:Kze(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,flags:t.spanContext?.traceFlags,traceId:e.encodeOptionalSpanContext(t.spanContext?.traceId),spanId:e.encodeOptionalSpanContext(t.spanContext?.spanId)}}function Kze(t,e){return Object.keys(t).map(r=>YU(r,t[r],e))}var Sie=C(()=>{"use strict";DR()});function Zze(t){let e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Jze(t){return Zze(t).toString()}function Eie(t){return t}var Xze,eh,LR=C(()=>{"use strict";ap();Xze=typeof BigInt<"u"?Jze:oA;eh={encodeHrTime:Xze,encodeSpanContext:Eie,encodeOptionalSpanContext:Eie,encodeUint8Array:t=>{if(typeof Buffer<"u")return Buffer.from(t).toString("base64");let e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=String.fromCharCode(t[r]);return btoa(e.join(""))}}});var KU,vie=C(()=>{"use strict";Sie();LR();ve();KU={serializeRequest:t=>{let e=yie(t,eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}}});var bie=C(()=>{"use strict";vie()});var IS,Tie=C(()=>{"use strict";(function(t){t[t.AGGREGATION_TEMPORALITY_UNSPECIFIED=0]="AGGREGATION_TEMPORALITY_UNSPECIFIED",t[t.AGGREGATION_TEMPORALITY_DELTA=1]="AGGREGATION_TEMPORALITY_DELTA",t[t.AGGREGATION_TEMPORALITY_CUMULATIVE=2]="AGGREGATION_TEMPORALITY_CUMULATIVE"})(IS||(IS={}))});function Qze(t,e){let r=Xp(t.resource,e);return{resource:r,schemaUrl:r.schemaUrl,scopeMetrics:eje(t.scopeMetrics,e)}}function eje(t,e){return Array.from(t.map(r=>({scope:Qp(r.scope),metrics:r.metrics.map(n=>tje(n,e)),schemaUrl:r.scope.schemaUrl})))}function tje(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=oje(t.aggregationTemporality);switch(t.dataPointType){case Si.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:wie(t,e)};break;case Si.GAUGE:r.gauge={dataPoints:wie(t,e)};break;case Si.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:nje(t,e)};break;case Si.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:ije(t,e)};break}return r}function rje(t,e,r){let n={attributes:Na(t.attributes,r),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case ca.INT:n.asInt=t.value;break;case ca.DOUBLE:n.asDouble=t.value;break}return n}function wie(t,e){return t.dataPoints.map(r=>rje(r,t.descriptor.valueType,e))}function nje(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Na(r.attributes,e),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function ije(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:Na(r.attributes,e),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function oje(t){switch(t){case Oa.DELTA:return IS.AGGREGATION_TEMPORALITY_DELTA;case Oa.CUMULATIVE:return IS.AGGREGATION_TEMPORALITY_CUMULATIVE}}function Aie(t,e){return{resourceMetrics:t.map(r=>Qze(r,e))}}var xie=C(()=>{"use strict";ve();VU();Tie();DR()});var ZU,Rie=C(()=>{"use strict";xie();LR();ve();ZU={serializeRequest:t=>{let e=Aie([t],eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse metrics export response: ${r.message}. Returning empty response`),{}}}}});var Cie=C(()=>{"use strict";Rie()});function Iie(t,e){let r=t&255|sje;return e&&(r|=aje),r}function cje(t,e){let r=t.spanContext(),n=t.status,i=t.parentSpanContext?.spanId?e.encodeSpanContext(t.parentSpanContext?.spanId):void 0;return{traceId:e.encodeSpanContext(r.traceId),spanId:e.encodeSpanContext(r.spanId),parentSpanId:i,traceState:r.traceState?.serialize(),name:t.name,kind:t.kind==null?0:t.kind+1,startTimeUnixNano:e.encodeHrTime(t.startTime),endTimeUnixNano:e.encodeHrTime(t.endTime),attributes:Na(t.attributes,e),droppedAttributesCount:t.droppedAttributesCount,events:t.events.map(o=>uje(o,e)),droppedEventsCount:t.droppedEventsCount,status:{code:n.code,message:n.message},links:t.links.map(o=>lje(o,e)),droppedLinksCount:t.droppedLinksCount,flags:Iie(r.traceFlags,t.parentSpanContext?.isRemote)}}function lje(t,e){return{attributes:t.attributes?Na(t.attributes,e):[],spanId:e.encodeSpanContext(t.context.spanId),traceId:e.encodeSpanContext(t.context.traceId),traceState:t.context.traceState?.serialize(),droppedAttributesCount:t.droppedAttributesCount||0,flags:Iie(t.context.traceFlags,t.context.isRemote)}}function uje(t,e){return{attributes:t.attributes?Na(t.attributes,e):[],name:t.name,timeUnixNano:e.encodeHrTime(t.time),droppedAttributesCount:t.droppedAttributesCount||0}}function Pie(t,e){return{resourceSpans:fje(t,e)}}function dje(t){let e=new Map;for(let r of t){let n=e.get(r.resource);n||(n=new Map,e.set(r.resource,n));let i=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`,o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return e}function fje(t,e){let r=dje(t),n=[],i=r.entries(),o=i.next();for(;!o.done;){let[s,a]=o.value,c=[],l=a.values(),u=l.next();for(;!u.done;){let p=u.value;if(p.length>0){let h=p.map(m=>cje(m,e));c.push({scope:Qp(p[0].instrumentationScope),spans:h,schemaUrl:p[0].instrumentationScope.schemaUrl})}u=l.next()}let d=Xp(s,e),f={resource:d,scopeSpans:c,schemaUrl:d.schemaUrl};n.push(f),o=i.next()}return n}var sje,aje,Oie=C(()=>{"use strict";DR();sje=256,aje=512});var JU,Nie=C(()=>{"use strict";Oie();LR();ve();JU={serializeRequest:t=>{let e=Pie(t,eh);return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{if(t.length===0)return{};let e=new TextDecoder;try{return JSON.parse(e.decode(t))}catch(r){return J.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}}});var kie=C(()=>{"use strict";Nie()});var Mie={};jr(Mie,{JsonLogsSerializer:()=>KU,JsonMetricsSerializer:()=>ZU,JsonTraceSerializer:()=>JU,ProtobufLogsSerializer:()=>BU,ProtobufMetricsSerializer:()=>HU,ProtobufTraceSerializer:()=>WU});var $ie=C(()=>{"use strict";Xne();lie();_ie();bie();Cie();kie()});var Lie=y(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});UR.OTLPTraceExporter=void 0;var Die=Dne(),pje=($ie(),An(Mie)),hje=(gA(),An(mA)),XU=class extends hje.OTLPExporterBase{constructor(e={}){super((0,Die.createOtlpGrpcExportDelegate)((0,Die.convertLegacyOtlpGrpcOptions)(e,"TRACES"),pje.ProtobufTraceSerializer,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export"))}};UR.OTLPTraceExporter=XU});var Uie=y(FR=>{"use strict";Object.defineProperty(FR,"__esModule",{value:!0});FR.OTLPTraceExporter=void 0;var mje=Lie();Object.defineProperty(FR,"OTLPTraceExporter",{enumerable:!0,get:function(){return mje.OTLPTraceExporter}})});var ase=y(($kt,sse)=>{"use strict";sse.exports=ose;ose.sync=G2e;var nse=Z("fs");function V2e(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function ise(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:V2e(e,r)}function ose(t,e,r){nse.stat(t,function(n,i){r(n,n?!1:ise(i,t,e))})}function G2e(t,e){return ise(nse.statSync(t),t,e)}});var fse=y((Dkt,dse)=>{"use strict";dse.exports=lse;lse.sync=H2e;var cse=Z("fs");function lse(t,e,r){cse.stat(t,function(n,i){r(n,n?!1:use(i,e))})}function H2e(t,e){return use(cse.statSync(t),e)}function use(t,e){return t.isFile()&&W2e(t,e)}function W2e(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var hse=y((Ukt,pse)=>{"use strict";var Lkt=Z("fs"),g0;process.platform==="win32"||global.TESTING_WINDOWS?g0=ase():g0=fse();pse.exports=kF;kF.sync=Y2e;function kF(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){kF(t,e||{},function(o,s){o?i(o):n(s)})})}g0(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Y2e(t,e){try{return g0.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vse=y((Fkt,Ese)=>{"use strict";var ah=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",mse=Z("path"),K2e=ah?";":":",gse=hse(),_se=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),yse=(t,e)=>{let r=e.colon||K2e,n=t.match(/\//)||ah&&t.match(/\\/)?[""]:[...ah?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=ah?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=ah?i.split(r):[""];return ah&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},Sse=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=yse(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(_se(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,h=mse.join(p,t),m=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+h:h;u(c(m,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let h=i[d];gse(l+h,{pathExt:o},(m,g)=>{if(!m&&g)if(e.all)s.push(l+h);else return f(l+h);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Z2e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=yse(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,l=mse.join(c,t),u=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<n.length;d++){let f=u+n[d];try{if(gse.sync(f,{pathExt:i}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw _se(t)};Ese.exports=Sse;Sse.sync=Z2e});var Tse=y((zkt,MF)=>{"use strict";var bse=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};MF.exports=bse;MF.exports.default=bse});var Rse=y((jkt,xse)=>{"use strict";var wse=Z("path"),J2e=vse(),X2e=Tse();function Ase(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=J2e.sync(t.command,{path:r[X2e({env:r})],pathExt:e?wse.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=wse.resolve(i?t.options.cwd:"",s)),s}function Q2e(t){return Ase(t)||Ase(t,!0)}xse.exports=Q2e});var Cse=y((Bkt,DF)=>{"use strict";var $F=/([()\][%!^"`<>&|;, *?])/g;function eqe(t){return t=t.replace($F,"^$1"),t}function tqe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($F,"^$1"),e&&(t=t.replace($F,"^$1")),t}DF.exports.command=eqe;DF.exports.argument=tqe});var Pse=y((qkt,Ise)=>{"use strict";Ise.exports=/^#!(.*)/});var Nse=y((Vkt,Ose)=>{"use strict";var rqe=Pse();Ose.exports=(t="")=>{let e=t.match(rqe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Mse=y((Gkt,kse)=>{"use strict";var LF=Z("fs"),nqe=Nse();function iqe(t){let r=Buffer.alloc(150),n;try{n=LF.openSync(t,"r"),LF.readSync(n,r,0,150,0),LF.closeSync(n)}catch{}return nqe(r.toString())}kse.exports=iqe});var Use=y((Hkt,Lse)=>{"use strict";var oqe=Z("path"),$se=Rse(),Dse=Cse(),sqe=Mse(),aqe=process.platform==="win32",cqe=/\.(?:com|exe)$/i,lqe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uqe(t){t.file=$se(t);let e=t.file&&sqe(t.file);return e?(t.args.unshift(t.file),t.command=e,$se(t)):t.file}function dqe(t){if(!aqe)return t;let e=uqe(t),r=!cqe.test(e);if(t.options.forceShell||r){let n=lqe.test(e);t.command=oqe.normalize(t.command),t.command=Dse.command(t.command),t.args=t.args.map(o=>Dse.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function fqe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:dqe(n)}Lse.exports=fqe});var jse=y((Wkt,zse)=>{"use strict";var UF=process.platform==="win32";function FF(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function pqe(t,e){if(!UF)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=Fse(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function Fse(t,e){return UF&&t===1&&!e.file?FF(e.original,"spawn"):null}function hqe(t,e){return UF&&t===1&&!e.file?FF(e.original,"spawnSync"):null}zse.exports={hookChildProcess:pqe,verifyENOENT:Fse,verifyENOENTSync:hqe,notFoundError:FF}});var Vse=y((Ykt,ch)=>{"use strict";var Bse=Z("child_process"),zF=Use(),jF=jse();function qse(t,e,r){let n=zF(t,e,r),i=Bse.spawn(n.command,n.args,n.options);return jF.hookChildProcess(i,n),i}function mqe(t,e,r){let n=zF(t,e,r),i=Bse.spawnSync(n.command,n.args,n.options);return i.error=i.error||jF.verifyENOENTSync(i.status,n),i}ch.exports=qse;ch.exports.spawn=qse;ch.exports.sync=mqe;ch.exports._parse=zF;ch.exports._enoent=jF});var eb=y(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.regexpCode=pt.getEsmExportName=pt.getProperty=pt.safeStringify=pt.stringify=pt.strConcat=pt.addCodeArg=pt.str=pt._=pt.nil=pt._Code=pt.Name=pt.IDENTIFIER=pt._CodeOrName=void 0;var Xv=class{};pt._CodeOrName=Xv;pt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var hf=class extends Xv{constructor(e){if(super(),!pt.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pt.Name=hf;var no=class extends Xv{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof hf&&(r[n.str]=(r[n.str]||0)+1),r),{})}};pt._Code=no;pt.nil=new no("");function x_e(t,...e){let r=[t[0]],n=0;for(;n<e.length;)pH(r,e[n]),r.push(t[++n]);return new no(r)}pt._=x_e;var fH=new no("+");function R_e(t,...e){let r=[Qv(t[0])],n=0;for(;n<e.length;)r.push(fH),pH(r,e[n]),r.push(fH,Qv(t[++n]));return AXe(r),new no(r)}pt.str=R_e;function pH(t,e){e instanceof no?t.push(...e._items):e instanceof hf?t.push(e):t.push(CXe(e))}pt.addCodeArg=pH;function AXe(t){let e=1;for(;e<t.length-1;){if(t[e]===fH){let r=xXe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function xXe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof hf||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof hf))return`"${t}${e.slice(1)}`}function RXe(t,e){return e.emptyStr()?t:t.emptyStr()?e:R_e`${t}${e}`}pt.strConcat=RXe;function CXe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Qv(Array.isArray(t)?t.join(","):t)}function IXe(t){return new no(Qv(t))}pt.stringify=IXe;function Qv(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pt.safeStringify=Qv;function PXe(t){return typeof t=="string"&&pt.IDENTIFIER.test(t)?new no(`.${t}`):x_e`[${t}]`}pt.getProperty=PXe;function OXe(t){if(typeof t=="string"&&pt.IDENTIFIER.test(t))return new no(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pt.getEsmExportName=OXe;function NXe(t){return new no(t.toString())}pt.regexpCode=NXe});var gH=y(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.ValueScope=ii.ValueScopeName=ii.Scope=ii.varKinds=ii.UsedValueState=void 0;var ni=eb(),hH=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},AO;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(AO||(ii.UsedValueState=AO={}));ii.varKinds={const:new ni.Name("const"),let:new ni.Name("let"),var:new ni.Name("var")};var xO=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ni.Name?e:this.name(e)}name(e){return new ni.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};ii.Scope=xO;var RO=class extends ni.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ni._)`.${new ni.Name(r)}[${n}]`}};ii.ValueScopeName=RO;var kXe=(0,ni._)`\n`,mH=class extends xO{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?kXe:ni.nil}}get(){return this._scope}name(e){return new RO(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ni._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ni.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,AO.Started);let u=r(l);if(u){let d=this.opts.es5?ii.varKinds.var:ii.varKinds.const;o=(0,ni._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,ni._)`${o}${u}${this.opts._n}`;else throw new hH(l);c.set(l,AO.Completed)})}return o}};ii.ValueScope=mH});var Je=y(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.or=et.and=et.not=et.CodeGen=et.operators=et.varKinds=et.ValueScopeName=et.ValueScope=et.Scope=et.Name=et.regexpCode=et.stringify=et.getProperty=et.nil=et.strConcat=et.str=et._=void 0;var st=eb(),Yo=gH(),tu=eb();Object.defineProperty(et,"_",{enumerable:!0,get:function(){return tu._}});Object.defineProperty(et,"str",{enumerable:!0,get:function(){return tu.str}});Object.defineProperty(et,"strConcat",{enumerable:!0,get:function(){return tu.strConcat}});Object.defineProperty(et,"nil",{enumerable:!0,get:function(){return tu.nil}});Object.defineProperty(et,"getProperty",{enumerable:!0,get:function(){return tu.getProperty}});Object.defineProperty(et,"stringify",{enumerable:!0,get:function(){return tu.stringify}});Object.defineProperty(et,"regexpCode",{enumerable:!0,get:function(){return tu.regexpCode}});Object.defineProperty(et,"Name",{enumerable:!0,get:function(){return tu.Name}});var OO=gH();Object.defineProperty(et,"Scope",{enumerable:!0,get:function(){return OO.Scope}});Object.defineProperty(et,"ValueScope",{enumerable:!0,get:function(){return OO.ValueScope}});Object.defineProperty(et,"ValueScopeName",{enumerable:!0,get:function(){return OO.ValueScopeName}});Object.defineProperty(et,"varKinds",{enumerable:!0,get:function(){return OO.varKinds}});et.operators={GT:new st._Code(">"),GTE:new st._Code(">="),LT:new st._Code("<"),LTE:new st._Code("<="),EQ:new st._Code("==="),NEQ:new st._Code("!=="),NOT:new st._Code("!"),OR:new st._Code("||"),AND:new st._Code("&&"),ADD:new st._Code("+")};var mc=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_H=class extends mc{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Yo.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=$g(this.rhs,e,r)),this}get names(){return this.rhs instanceof st._CodeOrName?this.rhs.names:{}}},CO=class extends mc{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof st.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$g(this.rhs,e,r),this}get names(){let e=this.lhs instanceof st.Name?{}:{...this.lhs.names};return PO(e,this.rhs)}},yH=class extends CO{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},SH=class extends mc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},EH=class extends mc{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},vH=class extends mc{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},bH=class extends mc{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=$g(this.code,e,r),this}get names(){return this.code instanceof st._CodeOrName?this.code.names:{}}},tb=class extends mc{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(MXe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>_f(e,r.names),{})}},gc=class extends tb{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},TH=class extends tb{},Mg=class extends gc{};Mg.kind="else";var mf=class t extends gc{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Mg(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(C_e(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=$g(this.condition,e,r),this}get names(){let e=super.names;return PO(e,this.condition),this.else&&_f(e,this.else.names),e}};mf.kind="if";var gf=class extends gc{};gf.kind="for";var wH=class extends gf{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=$g(this.iteration,e,r),this}get names(){return _f(super.names,this.iteration.names)}},AH=class extends gf{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Yo.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=PO(super.names,this.from);return PO(e,this.to)}},IO=class extends gf{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=$g(this.iterable,e,r),this}get names(){return _f(super.names,this.iterable.names)}},rb=class extends gc{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};rb.kind="func";var nb=class extends tb{render(e){return"return "+super.render(e)}};nb.kind="return";var xH=class extends gc{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&_f(e,this.catch.names),this.finally&&_f(e,this.finally.names),e}},ib=class extends gc{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ib.kind="catch";var ob=class extends gc{render(e){return"finally"+super.render(e)}};ob.kind="finally";var RH=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Yo.Scope({parent:e}),this._nodes=[new TH]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new _H(e,o,n)),o}const(e,r,n){return this._def(Yo.varKinds.const,e,r,n)}let(e,r,n){return this._def(Yo.varKinds.let,e,r,n)}var(e,r,n){return this._def(Yo.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new CO(e,r,n))}add(e,r){return this._leafNode(new yH(e,et.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==st.nil&&this._leafNode(new bH(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,st.addCodeArg)(r,i));return r.push("}"),new st._Code(r)}if(e,r,n){if(this._blockNode(new mf(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new mf(e))}else(){return this._elseNode(new Mg)}endIf(){return this._endBlockNode(mf,Mg)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wH(e),r)}forRange(e,r,n,i,o=this.opts.es5?Yo.varKinds.var:Yo.varKinds.let){let s=this._scope.toName(e);return this._for(new AH(o,s,r,n),()=>i(s))}forOf(e,r,n,i=Yo.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof st.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,st._)`${s}.length`,a=>{this.var(o,(0,st._)`${s}[${a}]`),n(o)})}return this._for(new IO("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?Yo.varKinds.var:Yo.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,st._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new IO("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(gf)}label(e){return this._leafNode(new SH(e))}break(e){return this._leafNode(new EH(e))}return(e){let r=new nb;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(nb)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xH;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new ib(o),r(o)}return n&&(this._currNode=i.finally=new ob,this.code(n)),this._endBlockNode(ib,ob)}throw(e){return this._leafNode(new vH(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=st.nil,n,i){return this._blockNode(new rb(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(rb)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof mf))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};et.CodeGen=RH;function _f(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function PO(t,e){return e instanceof st._CodeOrName?_f(t,e.names):t}function $g(t,e,r){if(t instanceof st.Name)return n(t);if(!i(t))return t;return new st._Code(t._items.reduce((o,s)=>(s instanceof st.Name&&(s=n(s)),s instanceof st._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof st._Code&&o._items.some(s=>s instanceof st.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function MXe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function C_e(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,st._)`!${CH(t)}`}et.not=C_e;var $Xe=I_e(et.operators.AND);function DXe(...t){return t.reduce($Xe)}et.and=DXe;var LXe=I_e(et.operators.OR);function UXe(...t){return t.reduce(LXe)}et.or=UXe;function I_e(t){return(e,r)=>e===st.nil?r:r===st.nil?e:(0,st._)`${CH(e)} ${t} ${CH(r)}`}function CH(t){return t instanceof st.Name?t:(0,st._)`(${t})`}});var lt=y(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.checkStrictMode=rt.getErrorPath=rt.Type=rt.useFunc=rt.setEvaluated=rt.evaluatedPropsToName=rt.mergeEvaluated=rt.eachItem=rt.unescapeJsonPointer=rt.escapeJsonPointer=rt.escapeFragment=rt.unescapeFragment=rt.schemaRefOrVal=rt.schemaHasRulesButRef=rt.schemaHasRules=rt.checkUnknownRules=rt.alwaysValidSchema=rt.toHash=void 0;var Ut=Je(),FXe=eb();function zXe(t){let e={};for(let r of t)e[r]=!0;return e}rt.toHash=zXe;function jXe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(N_e(t,e),!k_e(e,t.self.RULES.all))}rt.alwaysValidSchema=jXe;function N_e(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||D_e(t,`unknown keyword: "${o}"`)}rt.checkUnknownRules=N_e;function k_e(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}rt.schemaHasRules=k_e;function BXe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}rt.schemaHasRulesButRef=BXe;function qXe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ut._)`${r}`}return(0,Ut._)`${t}${e}${(0,Ut.getProperty)(n)}`}rt.schemaRefOrVal=qXe;function VXe(t){return M_e(decodeURIComponent(t))}rt.unescapeFragment=VXe;function GXe(t){return encodeURIComponent(PH(t))}rt.escapeFragment=GXe;function PH(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}rt.escapeJsonPointer=PH;function M_e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}rt.unescapeJsonPointer=M_e;function HXe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}rt.eachItem=HXe;function P_e({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof Ut.Name?(o instanceof Ut.Name?t(i,o,s):e(i,o,s),s):o instanceof Ut.Name?(e(i,s,o),o):r(o,s);return a===Ut.Name&&!(c instanceof Ut.Name)?n(i,c):c}}rt.mergeEvaluated={props:P_e({mergeNames:(t,e,r)=>t.if((0,Ut._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Ut._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Ut._)`${r} || {}`).code((0,Ut._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Ut._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Ut._)`${r} || {}`),OH(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:$_e}),items:P_e({mergeNames:(t,e,r)=>t.if((0,Ut._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Ut._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Ut._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Ut._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function $_e(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Ut._)`{}`);return e!==void 0&&OH(t,r,e),r}rt.evaluatedPropsToName=$_e;function OH(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Ut._)`${e}${(0,Ut.getProperty)(n)}`,!0))}rt.setEvaluated=OH;var O_e={};function WXe(t,e){return t.scopeValue("func",{ref:e,code:O_e[e.code]||(O_e[e.code]=new FXe._Code(e.code))})}rt.useFunc=WXe;var IH;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(IH||(rt.Type=IH={}));function YXe(t,e,r){if(t instanceof Ut.Name){let n=e===IH.Num;return r?n?(0,Ut._)`"[" + ${t} + "]"`:(0,Ut._)`"['" + ${t} + "']"`:n?(0,Ut._)`"/" + ${t}`:(0,Ut._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ut.getProperty)(t).toString():"/"+PH(t)}rt.getErrorPath=YXe;function D_e(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}rt.checkStrictMode=D_e});var _c=y(NH=>{"use strict";Object.defineProperty(NH,"__esModule",{value:!0});var gn=Je(),KXe={data:new gn.Name("data"),valCxt:new gn.Name("valCxt"),instancePath:new gn.Name("instancePath"),parentData:new gn.Name("parentData"),parentDataProperty:new gn.Name("parentDataProperty"),rootData:new gn.Name("rootData"),dynamicAnchors:new gn.Name("dynamicAnchors"),vErrors:new gn.Name("vErrors"),errors:new gn.Name("errors"),this:new gn.Name("this"),self:new gn.Name("self"),scope:new gn.Name("scope"),json:new gn.Name("json"),jsonPos:new gn.Name("jsonPos"),jsonLen:new gn.Name("jsonLen"),jsonPart:new gn.Name("jsonPart")};NH.default=KXe});var sb=y(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.extendErrors=_n.resetErrorsCount=_n.reportExtraError=_n.reportError=_n.keyword$DataError=_n.keywordError=void 0;var ut=Je(),NO=lt(),Ln=_c();_n.keywordError={message:({keyword:t})=>(0,ut.str)`must pass "${t}" keyword validation`};_n.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ut.str)`"${t}" keyword must be ${e} ($data)`:(0,ut.str)`"${t}" keyword is invalid ($data)`};function ZXe(t,e=_n.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=F_e(t,e,r);n??(s||a)?L_e(o,c):U_e(i,(0,ut._)`[${c}]`)}_n.reportError=ZXe;function JXe(t,e=_n.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=F_e(t,e,r);L_e(i,a),o||s||U_e(n,Ln.default.vErrors)}_n.reportExtraError=JXe;function XXe(t,e){t.assign(Ln.default.errors,e),t.if((0,ut._)`${Ln.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ut._)`${Ln.default.vErrors}.length`,e),()=>t.assign(Ln.default.vErrors,null)))}_n.resetErrorsCount=XXe;function QXe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Ln.default.errors,a=>{t.const(s,(0,ut._)`${Ln.default.vErrors}[${a}]`),t.if((0,ut._)`${s}.instancePath === undefined`,()=>t.assign((0,ut._)`${s}.instancePath`,(0,ut.strConcat)(Ln.default.instancePath,o.errorPath))),t.assign((0,ut._)`${s}.schemaPath`,(0,ut.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,ut._)`${s}.schema`,r),t.assign((0,ut._)`${s}.data`,n))})}_n.extendErrors=QXe;function L_e(t,e){let r=t.const("err",e);t.if((0,ut._)`${Ln.default.vErrors} === null`,()=>t.assign(Ln.default.vErrors,(0,ut._)`[${r}]`),(0,ut._)`${Ln.default.vErrors}.push(${r})`),t.code((0,ut._)`${Ln.default.errors}++`)}function U_e(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ut._)`new ${t.ValidationError}(${e})`):(r.assign((0,ut._)`${n}.errors`,e),r.return(!1))}var yf={keyword:new ut.Name("keyword"),schemaPath:new ut.Name("schemaPath"),params:new ut.Name("params"),propertyName:new ut.Name("propertyName"),message:new ut.Name("message"),schema:new ut.Name("schema"),parentSchema:new ut.Name("parentSchema")};function F_e(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ut._)`{}`:eQe(t,e,r)}function eQe(t,e,r={}){let{gen:n,it:i}=t,o=[tQe(i,r),rQe(t,r)];return nQe(t,e,o),n.object(...o)}function tQe({errorPath:t},{instancePath:e}){let r=e?(0,ut.str)`${t}${(0,NO.getErrorPath)(e,NO.Type.Str)}`:t;return[Ln.default.instancePath,(0,ut.strConcat)(Ln.default.instancePath,r)]}function rQe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ut.str)`${e}/${t}`;return r&&(i=(0,ut.str)`${i}${(0,NO.getErrorPath)(r,NO.Type.Str)}`),[yf.schemaPath,i]}function nQe(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([yf.keyword,i],[yf.params,typeof e=="function"?e(t):e||(0,ut._)`{}`]),c.messages&&n.push([yf.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([yf.schema,s],[yf.parentSchema,(0,ut._)`${u}${d}`],[Ln.default.data,o]),l&&n.push([yf.propertyName,l])}});var j_e=y(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.boolOrEmptySchema=Dg.topBoolOrEmptySchema=void 0;var iQe=sb(),oQe=Je(),sQe=_c(),aQe={message:"boolean schema is false"};function cQe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?z_e(t,!1):typeof r=="object"&&r.$async===!0?e.return(sQe.default.data):(e.assign((0,oQe._)`${n}.errors`,null),e.return(!0))}Dg.topBoolOrEmptySchema=cQe;function lQe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),z_e(t)):r.var(e,!0)}Dg.boolOrEmptySchema=lQe;function z_e(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,iQe.reportError)(i,aQe,void 0,e)}});var kH=y(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.getRules=Lg.isJSONType=void 0;var uQe=["string","number","integer","boolean","null","object","array"],dQe=new Set(uQe);function fQe(t){return typeof t=="string"&&dQe.has(t)}Lg.isJSONType=fQe;function pQe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Lg.getRules=pQe});var MH=y(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.shouldUseRule=ru.shouldUseGroup=ru.schemaHasRulesForType=void 0;function hQe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&B_e(t,n)}ru.schemaHasRulesForType=hQe;function B_e(t,e){return e.rules.some(r=>q_e(t,r))}ru.shouldUseGroup=B_e;function q_e(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ru.shouldUseRule=q_e});var ab=y(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.reportTypeError=yn.checkDataTypes=yn.checkDataType=yn.coerceAndCheckDataType=yn.getJSONTypes=yn.getSchemaTypes=yn.DataType=void 0;var mQe=kH(),gQe=MH(),_Qe=sb(),Ke=Je(),V_e=lt(),Ug;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ug||(yn.DataType=Ug={}));function yQe(t){let e=G_e(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}yn.getSchemaTypes=yQe;function G_e(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(mQe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}yn.getJSONTypes=G_e;function SQe(t,e){let{gen:r,data:n,opts:i}=t,o=EQe(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,gQe.schemaHasRulesForType)(t,e[0]));if(s){let a=DH(e,n,i.strictNumbers,Ug.Wrong);r.if(a,()=>{o.length?vQe(t,e,o):LH(t)})}return s}yn.coerceAndCheckDataType=SQe;var H_e=new Set(["string","number","integer","boolean","null"]);function EQe(t,e){return e?t.filter(r=>H_e.has(r)||e==="array"&&r==="array"):[]}function vQe(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Ke._)`typeof ${i}`),a=n.let("coerced",(0,Ke._)`undefined`);o.coerceTypes==="array"&&n.if((0,Ke._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ke._)`${i}[0]`).assign(s,(0,Ke._)`typeof ${i}`).if(DH(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Ke._)`${a} !== undefined`);for(let l of r)(H_e.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),LH(t),n.endIf(),n.if((0,Ke._)`${a} !== undefined`,()=>{n.assign(i,a),bQe(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Ke._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Ke._)`"" + ${i}`).elseIf((0,Ke._)`${i} === null`).assign(a,(0,Ke._)`""`);return;case"number":n.elseIf((0,Ke._)`${s} == "boolean" || ${i} === null
|
|
25
|
+
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,Ke._)`+${i}`);return;case"integer":n.elseIf((0,Ke._)`${s} === "boolean" || ${i} === null
|
|
26
|
+
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,Ke._)`+${i}`);return;case"boolean":n.elseIf((0,Ke._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,Ke._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Ke._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Ke._)`${s} === "string" || ${s} === "number"
|
|
27
|
+
|| ${s} === "boolean" || ${i} === null`).assign(a,(0,Ke._)`[${i}]`)}}}function bQe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ke._)`${e} !== undefined`,()=>t.assign((0,Ke._)`${e}[${r}]`,n))}function $H(t,e,r,n=Ug.Correct){let i=n===Ug.Correct?Ke.operators.EQ:Ke.operators.NEQ,o;switch(t){case"null":return(0,Ke._)`${e} ${i} null`;case"array":o=(0,Ke._)`Array.isArray(${e})`;break;case"object":o=(0,Ke._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Ke._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Ke._)`typeof ${e} ${i} ${t}`}return n===Ug.Correct?o:(0,Ke.not)(o);function s(a=Ke.nil){return(0,Ke.and)((0,Ke._)`typeof ${e} == "number"`,a,r?(0,Ke._)`isFinite(${e})`:Ke.nil)}}yn.checkDataType=$H;function DH(t,e,r,n){if(t.length===1)return $H(t[0],e,r,n);let i,o=(0,V_e.toHash)(t);if(o.array&&o.object){let s=(0,Ke._)`typeof ${e} != "object"`;i=o.null?s:(0,Ke._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Ke.nil;o.number&&delete o.integer;for(let s in o)i=(0,Ke.and)(i,$H(s,e,r,n));return i}yn.checkDataTypes=DH;var TQe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ke._)`{type: ${t}}`:(0,Ke._)`{type: ${e}}`};function LH(t){let e=wQe(t);(0,_Qe.reportError)(e,TQe)}yn.reportTypeError=LH;function wQe(t){let{gen:e,data:r,schema:n}=t,i=(0,V_e.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Y_e=y(kO=>{"use strict";Object.defineProperty(kO,"__esModule",{value:!0});kO.assignDefaults=void 0;var Fg=Je(),AQe=lt();function xQe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)W_e(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>W_e(t,o,i.default))}kO.assignDefaults=xQe;function W_e(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Fg._)`${o}${(0,Fg.getProperty)(e)}`;if(i){(0,AQe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Fg._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Fg._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Fg._)`${a} = ${(0,Fg.stringify)(r)}`)}});var io=y(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.validateUnion=Pt.validateArray=Pt.usePattern=Pt.callValidateCode=Pt.schemaProperties=Pt.allSchemaProperties=Pt.noPropertyInData=Pt.propertyInData=Pt.isOwnProperty=Pt.hasPropFunc=Pt.reportMissingProp=Pt.checkMissingProp=Pt.checkReportMissingProp=void 0;var Bt=Je(),UH=lt(),nu=_c(),RQe=lt();function CQe(t,e){let{gen:r,data:n,it:i}=t;r.if(zH(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Bt._)`${e}`},!0),t.error()})}Pt.checkReportMissingProp=CQe;function IQe({gen:t,data:e,it:{opts:r}},n,i){return(0,Bt.or)(...n.map(o=>(0,Bt.and)(zH(t,e,o,r.ownProperties),(0,Bt._)`${i} = ${o}`)))}Pt.checkMissingProp=IQe;function PQe(t,e){t.setParams({missingProperty:e},!0),t.error()}Pt.reportMissingProp=PQe;function K_e(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Bt._)`Object.prototype.hasOwnProperty`})}Pt.hasPropFunc=K_e;function FH(t,e,r){return(0,Bt._)`${K_e(t)}.call(${e}, ${r})`}Pt.isOwnProperty=FH;function OQe(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} !== undefined`;return n?(0,Bt._)`${i} && ${FH(t,e,r)}`:i}Pt.propertyInData=OQe;function zH(t,e,r,n){let i=(0,Bt._)`${e}${(0,Bt.getProperty)(r)} === undefined`;return n?(0,Bt.or)(i,(0,Bt.not)(FH(t,e,r))):i}Pt.noPropertyInData=zH;function Z_e(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Pt.allSchemaProperties=Z_e;function NQe(t,e){return Z_e(e).filter(r=>!(0,UH.alwaysValidSchema)(t,e[r]))}Pt.schemaProperties=NQe;function kQe({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,Bt._)`${t}, ${e}, ${n}${i}`:e,d=[[nu.default.instancePath,(0,Bt.strConcat)(nu.default.instancePath,o)],[nu.default.parentData,s.parentData],[nu.default.parentDataProperty,s.parentDataProperty],[nu.default.rootData,nu.default.rootData]];s.opts.dynamicRef&&d.push([nu.default.dynamicAnchors,nu.default.dynamicAnchors]);let f=(0,Bt._)`${u}, ${r.object(...d)}`;return c!==Bt.nil?(0,Bt._)`${a}.call(${c}, ${f})`:(0,Bt._)`${a}(${f})`}Pt.callValidateCode=kQe;var MQe=(0,Bt._)`new RegExp`;function $Qe({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Bt._)`${i.code==="new RegExp"?MQe:(0,RQe.useFunc)(t,i)}(${r}, ${n})`})}Pt.usePattern=$Qe;function DQe(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,Bt._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:UH.Type.Num},o),e.if((0,Bt.not)(o),a)})}}Pt.validateArray=DQe;function LQe(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,UH.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,Bt._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,Bt.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}Pt.validateUnion=LQe});var Q_e=y(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.validateKeywordUsage=Zs.validSchemaType=Zs.funcKeywordCode=Zs.macroKeywordCode=void 0;var Un=Je(),Sf=_c(),UQe=io(),FQe=sb();function zQe(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=X_e(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Un.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}Zs.macroKeywordCode=zQe;function jQe(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;qQe(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=X_e(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)m(),e.modifying&&J_e(t),g(()=>t.error());else{let _=e.async?p():h();e.modifying&&J_e(t),g(()=>BQe(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>m((0,Un._)`await `),b=>n.assign(d,!1).if((0,Un._)`${b} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Un._)`${b}.errors`),()=>n.throw(b))),_}function h(){let _=(0,Un._)`${u}.errors`;return n.assign(_,null),m(Un.nil),_}function m(_=e.async?(0,Un._)`await `:Un.nil){let b=c.opts.passContext?Sf.default.this:Sf.default.self,T=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Un._)`${_}${(0,UQe.callValidateCode)(t,u,b,T)}`,e.modifying)}function g(_){var b;n.if((0,Un.not)((b=e.valid)!==null&&b!==void 0?b:d),_)}}Zs.funcKeywordCode=jQe;function J_e(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Un._)`${n.parentData}[${n.parentDataProperty}]`))}function BQe(t,e){let{gen:r}=t;r.if((0,Un._)`Array.isArray(${e})`,()=>{r.assign(Sf.default.vErrors,(0,Un._)`${Sf.default.vErrors} === null ? ${e} : ${Sf.default.vErrors}.concat(${e})`).assign(Sf.default.errors,(0,Un._)`${Sf.default.vErrors}.length`),(0,FQe.extendErrors)(t)},()=>t.error())}function qQe({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function X_e(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Un.stringify)(r)})}function VQe(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Zs.validSchemaType=VQe;function GQe({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Zs.validateKeywordUsage=GQe});var tye=y(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.extendSubschemaMode=iu.extendSubschemaData=iu.getSubschema=void 0;var Js=Je(),eye=lt();function HQe(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Js._)`${t.schemaPath}${(0,Js.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Js._)`${t.schemaPath}${(0,Js.getProperty)(e)}${(0,Js.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,eye.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}iu.getSubschema=HQe;function WQe(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,Js._)`${e.data}${(0,Js.getProperty)(r)}`,!0);c(f),t.errorPath=(0,Js.str)`${l}${(0,eye.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Js._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof Js.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}iu.extendSubschemaData=WQe;function YQe(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}iu.extendSubschemaMode=YQe});var jH=y((Wnr,rye)=>{"use strict";rye.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var iye=y((Ynr,nye)=>{"use strict";var ou=nye.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};MO(e,n,i,t,"",t)};ou.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ou.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ou.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ou.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function MO(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ou.arrayKeywords)for(var f=0;f<d.length;f++)MO(t,e,r,d[f],i+"/"+u+"/"+f,o,i,u,n,f)}else if(u in ou.propsKeywords){if(d&&typeof d=="object")for(var p in d)MO(t,e,r,d[p],i+"/"+u+"/"+KQe(p),o,i,u,n,p)}else(u in ou.keywords||t.allKeys&&!(u in ou.skipKeywords))&&MO(t,e,r,d,i+"/"+u,o,i,u,n)}r(n,i,o,s,a,c,l)}}function KQe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var cb=y(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.getSchemaRefs=oi.resolveUrl=oi.normalizeId=oi._getFullPath=oi.getFullPath=oi.inlineRef=void 0;var ZQe=lt(),JQe=jH(),XQe=iye(),QQe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function e7e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!BH(t):e?oye(t)<=e:!1}oi.inlineRef=e7e;var t7e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function BH(t){for(let e in t){if(t7e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(BH)||typeof r=="object"&&BH(r))return!0}return!1}function oye(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!QQe.has(r)&&(typeof t[r]=="object"&&(0,ZQe.eachItem)(t[r],n=>e+=oye(n)),e===1/0))return 1/0}return e}function sye(t,e="",r){r!==!1&&(e=zg(e));let n=t.parse(e);return aye(t,n)}oi.getFullPath=sye;function aye(t,e){return t.serialize(e).split("#")[0]+"#"}oi._getFullPath=aye;var r7e=/#\/?$/;function zg(t){return t?t.replace(r7e,""):""}oi.normalizeId=zg;function n7e(t,e,r){return r=zg(r),t.resolve(e,r)}oi.resolveUrl=n7e;var i7e=/^[a-z_][-a-z0-9._]*$/i;function o7e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=zg(t[r]||e),o={"":i},s=sye(n,i,!1),a={},c=new Set;return XQe(t,{allKeys:!0},(d,f,p,h)=>{if(h===void 0)return;let m=s+f,g=o[h];typeof d[r]=="string"&&(g=_.call(this,d[r])),b.call(this,d.$anchor),b.call(this,d.$dynamicAnchor),o[f]=g;function _(T){let E=this.opts.uriResolver.resolve;if(T=zg(g?E(g,T):T),c.has(T))throw u(T);c.add(T);let A=this.refs[T];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?l(d,A.schema,T):T!==zg(m)&&(T[0]==="#"?(l(d,a[T],T),a[T]=d):this.refs[T]=m),T}function b(T){if(typeof T=="string"){if(!i7e.test(T))throw new Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function l(d,f,p){if(f!==void 0&&!JQe(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}oi.getSchemaRefs=o7e});var db=y(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.getData=su.KeywordCxt=su.validateFunctionCode=void 0;var fye=j_e(),cye=ab(),VH=MH(),$O=ab(),s7e=Y_e(),ub=Q_e(),qH=tye(),Re=Je(),Fe=_c(),a7e=cb(),yc=lt(),lb=sb();function c7e(t){if(mye(t)&&(gye(t),hye(t))){d7e(t);return}pye(t,()=>(0,fye.topBoolOrEmptySchema)(t))}su.validateFunctionCode=c7e;function pye({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,Re._)`${Fe.default.data}, ${Fe.default.valCxt}`,n.$async,()=>{t.code((0,Re._)`"use strict"; ${lye(r,i)}`),u7e(t,i),t.code(o)}):t.func(e,(0,Re._)`${Fe.default.data}, ${l7e(i)}`,n.$async,()=>t.code(lye(r,i)).code(o))}function l7e(t){return(0,Re._)`{${Fe.default.instancePath}="", ${Fe.default.parentData}, ${Fe.default.parentDataProperty}, ${Fe.default.rootData}=${Fe.default.data}${t.dynamicRef?(0,Re._)`, ${Fe.default.dynamicAnchors}={}`:Re.nil}}={}`}function u7e(t,e){t.if(Fe.default.valCxt,()=>{t.var(Fe.default.instancePath,(0,Re._)`${Fe.default.valCxt}.${Fe.default.instancePath}`),t.var(Fe.default.parentData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentData}`),t.var(Fe.default.parentDataProperty,(0,Re._)`${Fe.default.valCxt}.${Fe.default.parentDataProperty}`),t.var(Fe.default.rootData,(0,Re._)`${Fe.default.valCxt}.${Fe.default.rootData}`),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`${Fe.default.valCxt}.${Fe.default.dynamicAnchors}`)},()=>{t.var(Fe.default.instancePath,(0,Re._)`""`),t.var(Fe.default.parentData,(0,Re._)`undefined`),t.var(Fe.default.parentDataProperty,(0,Re._)`undefined`),t.var(Fe.default.rootData,Fe.default.data),e.dynamicRef&&t.var(Fe.default.dynamicAnchors,(0,Re._)`{}`)})}function d7e(t){let{schema:e,opts:r,gen:n}=t;pye(t,()=>{r.$comment&&e.$comment&&yye(t),g7e(t),n.let(Fe.default.vErrors,null),n.let(Fe.default.errors,0),r.unevaluated&&f7e(t),_ye(t),S7e(t)})}function f7e(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Re._)`${r}.evaluated`),e.if((0,Re._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Re._)`${t.evaluated}.props`,(0,Re._)`undefined`)),e.if((0,Re._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Re._)`${t.evaluated}.items`,(0,Re._)`undefined`))}function lye(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Re._)`/*# sourceURL=${r} */`:Re.nil}function p7e(t,e){if(mye(t)&&(gye(t),hye(t))){h7e(t,e);return}(0,fye.boolOrEmptySchema)(t,e)}function hye({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function mye(t){return typeof t.schema!="boolean"}function h7e(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&yye(t),_7e(t),y7e(t);let o=n.const("_errs",Fe.default.errors);_ye(t,o),n.var(e,(0,Re._)`${o} === ${Fe.default.errors}`)}function gye(t){(0,yc.checkUnknownRules)(t),m7e(t)}function _ye(t,e){if(t.opts.jtd)return uye(t,[],!1,e);let r=(0,cye.getSchemaTypes)(t.schema),n=(0,cye.coerceAndCheckDataType)(t,r);uye(t,r,!n,e)}function m7e(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,yc.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function g7e(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,yc.checkStrictMode)(t,"default is ignored in the schema root")}function _7e(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,a7e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function y7e(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function yye({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,Re._)`${Fe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,Re.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,Re._)`${Fe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function S7e(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,Re._)`${Fe.default.errors} === 0`,()=>e.return(Fe.default.data),()=>e.throw((0,Re._)`new ${i}(${Fe.default.vErrors})`)):(e.assign((0,Re._)`${n}.errors`,Fe.default.vErrors),o.unevaluated&&E7e(t),e.return((0,Re._)`${Fe.default.errors} === 0`))}function E7e({gen:t,evaluated:e,props:r,items:n}){r instanceof Re.Name&&t.assign((0,Re._)`${e}.props`,r),n instanceof Re.Name&&t.assign((0,Re._)`${e}.items`,n)}function uye(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,yc.schemaHasRulesButRef)(o,u))){i.block(()=>Eye(t,"$ref",u.all.$ref.definition));return}c.jtd||v7e(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,VH.shouldUseGroup)(o,f)&&(f.type?(i.if((0,$O.checkDataType)(f.type,s,c.strictNumbers)),dye(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,$O.reportTypeError)(t)),i.endIf()):dye(t,f),a||i.if((0,Re._)`${Fe.default.errors} === ${n||0}`))}}function dye(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,s7e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,VH.shouldUseRule)(n,o)&&Eye(t,o.keyword,o.definition,e.type)})}function v7e(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(b7e(t,e),t.opts.allowUnionTypes||T7e(t,e),w7e(t,t.dataTypes))}function b7e(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Sye(t.dataTypes,r)||GH(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),x7e(t,e)}}function T7e(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&GH(t,"use allowUnionTypes to allow union type keyword")}function w7e(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,VH.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>A7e(e,s))&&GH(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function A7e(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Sye(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function x7e(t,e){let r=[];for(let n of t.dataTypes)Sye(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function GH(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,yc.checkStrictMode)(t,e,t.opts.strictTypes)}var DO=class{constructor(e,r,n){if((0,ub.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,yc.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",vye(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ub.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Fe.default.errors))}result(e,r,n){this.failResult((0,Re.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Re.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Re._)`${r} !== undefined && (${(0,Re.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?lb.reportExtraError:lb.reportError)(this,this.def.error,r)}$dataError(){(0,lb.reportError)(this,this.def.$dataError||lb.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lb.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=Re.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=Re.nil,r=Re.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,Re.or)((0,Re._)`${i} === undefined`,r)),e!==Re.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==Re.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,Re.or)(s(),a());function s(){if(n.length){if(!(r instanceof Re.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,Re._)`${(0,$O.checkDataTypes)(c,r,o.opts.strictNumbers,$O.DataType.Wrong)}`}return Re.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,Re._)`!${c}(${r})`}return Re.nil}}subschema(e,r){let n=(0,qH.getSubschema)(this.it,e);(0,qH.extendSubschemaData)(n,this.it,e),(0,qH.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return p7e(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=yc.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=yc.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,Re.Name)),!0}};su.KeywordCxt=DO;function Eye(t,e,r,n){let i=new DO(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ub.funcKeywordCode)(i,r):"macro"in r?(0,ub.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ub.funcKeywordCode)(i,r)}var R7e=/^\/(?:[^~]|~0|~1)*$/,C7e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function vye(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return Fe.default.rootData;if(t[0]==="/"){if(!R7e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=Fe.default.rootData}else{let l=C7e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,Re._)`${o}${(0,Re.getProperty)((0,yc.unescapeJsonPointer)(l))}`,s=(0,Re._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}su.getData=vye});var LO=y(WH=>{"use strict";Object.defineProperty(WH,"__esModule",{value:!0});var HH=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};WH.default=HH});var fb=y(ZH=>{"use strict";Object.defineProperty(ZH,"__esModule",{value:!0});var YH=cb(),KH=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,YH.resolveUrl)(e,r,n),this.missingSchema=(0,YH.normalizeId)((0,YH.getFullPath)(e,this.missingRef))}};ZH.default=KH});var FO=y(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.resolveSchema=oo.getCompilingSchema=oo.resolveRef=oo.compileSchema=oo.SchemaEnv=void 0;var Ko=Je(),I7e=LO(),Ef=_c(),Zo=cb(),bye=lt(),P7e=db(),jg=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Zo.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};oo.SchemaEnv=jg;function XH(t){let e=Tye.call(this,t);if(e)return e;let r=(0,Zo.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new Ko.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:I7e.default,code:(0,Ko._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Ef.default.data,parentData:Ef.default.parentData,parentDataProperty:Ef.default.parentDataProperty,dataNames:[Ef.default.data],dataPathArr:[Ko.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ko.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ko.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ko._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,P7e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Ef.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${Ef.default.self}`,`${Ef.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:m}=l;p.evaluated={props:h instanceof Ko.Name?void 0:h,items:m instanceof Ko.Name?void 0:m,dynamicProps:h instanceof Ko.Name,dynamicItems:m instanceof Ko.Name},p.source&&(p.source.evaluated=(0,Ko.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}oo.compileSchema=XH;function O7e(t,e,r){var n;r=(0,Zo.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=M7e.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new jg({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=N7e.call(this,o)}oo.resolveRef=O7e;function N7e(t){return(0,Zo.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:XH.call(this,t)}function Tye(t){for(let e of this._compilations)if(k7e(e,t))return e}oo.getCompilingSchema=Tye;function k7e(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function M7e(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||UO.call(this,t,e)}function UO(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Zo._getFullPath)(this.opts.uriResolver,r),i=(0,Zo.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return JH.call(this,r,t);let o=(0,Zo.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=UO.call(this,t,s);return typeof a?.schema!="object"?void 0:JH.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||XH.call(this,s),o===(0,Zo.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Zo.resolveUrl)(this.opts.uriResolver,i,l)),new jg({schema:a,schemaId:c,root:t,baseId:i})}return JH.call(this,r,s)}}oo.resolveSchema=UO;var $7e=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function JH(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,bye.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!$7e.has(a)&&l&&(e=(0,Zo.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,bye.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Zo.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=UO.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new jg({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var wye=y((eir,D7e)=>{D7e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var t6=y((tir,Pye)=>{"use strict";var L7e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),xye=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),QH=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Rye=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),U7e=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function e6(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var F7e=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Aye(t){return t.length=0,!0}function z7e(t,e,r){if(t.length){let n=e6(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function j7e(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=z7e;for(let c=0;c<t.length;c++){let l=t[c];if(!(l==="["||l==="]"))if(l===":"){if(o===!0&&(s=!0),!a(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=Aye}else{i.push(l);continue}}return i.length&&(a===Aye?r.zone=i.join(""):s?n.push(i.join("")):n.push(e6(i))),r.address=n.join(""),r}function Cye(t){if(B7e(t,":")<2)return{host:t,isIPV6:!1};let e=j7e(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function B7e(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function q7e(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var V7e={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},G7e=/[@/?#:]/g,H7e=/[@/?#]/g;function Iye(t,e){let r=e?H7e:G7e;return r.lastIndex=0,t.replace(r,n=>V7e[n])}function W7e(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(QH(i)){let o=i.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&Rye(s)?r+=s:r+="%"+o,n+=2;continue}}r+=t[n]}return r}function Y7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QH(n)){let i=n.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&Rye(o)?e+=o:e+="%"+i,r+=2;continue}}U7e(t[r])?e+=t[r]:e+=escape(t[r])}return e}function K7e(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(QH(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function Z7e(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!xye(r)){let n=Cye(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Iye(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}Pye.exports={nonSimpleDomain:F7e,recomposeAuthority:Z7e,reescapeHostDelimiters:Iye,normalizePercentEncoding:W7e,normalizePathEncoding:Y7e,escapePreservingEscapes:K7e,removeDotSegments:q7e,isIPv4:xye,isUUID:L7e,normalizeIPv6:Cye,stringArrayToHexStripped:e6}});var $ye=y((rir,Mye)=>{"use strict";var{isUUID:J7e}=t6(),X7e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Q7e=["http","https","ws","wss","urn","urn:uuid"];function eet(t){return Q7e.indexOf(t)!==-1}function r6(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function Oye(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Nye(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function tet(t){return t.secure=r6(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ret(t){if((t.port===(r6(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function net(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(X7e);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=n6(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function iet(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=n6(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function oet(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!J7e(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function set(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kye={scheme:"http",domainHost:!0,parse:Oye,serialize:Nye},aet={scheme:"https",domainHost:kye.domainHost,parse:Oye,serialize:Nye},zO={scheme:"ws",domainHost:!0,parse:tet,serialize:ret},cet={scheme:"wss",domainHost:zO.domainHost,parse:zO.parse,serialize:zO.serialize},uet={scheme:"urn",parse:net,serialize:iet,skipNormalize:!0},det={scheme:"urn:uuid",parse:oet,serialize:set,skipNormalize:!0},jO={http:kye,https:aet,ws:zO,wss:cet,urn:uet,"urn:uuid":det};Object.setPrototypeOf(jO,null);function n6(t){return t&&(jO[t]||jO[t.toLowerCase()])||void 0}Mye.exports={wsIsSecure:r6,SCHEMES:jO,isValidSchemeName:eet,getSchemeHandler:n6}});var jye=y((nir,BO)=>{"use strict";var{normalizeIPv6:fet,removeDotSegments:pb,recomposeAuthority:pet,normalizePercentEncoding:het,normalizePathEncoding:met,escapePreservingEscapes:get,reescapeHostDelimiters:_et,isIPv4:yet,nonSimpleDomain:Eet}=t6(),{SCHEMES:vet,getSchemeHandler:Lye}=$ye();function bet(t,e){return typeof t=="string"?t=Ret(t,e):typeof t=="object"&&(t=Bg(vf(t,e),e)),t}function Tet(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Uye(Bg(t,n),Bg(e,n),n,!0);return n.skipEscape=!0,vf(i,n)}function Uye(t,e,r,n){let i={};return n||(t=Bg(vf(t,r),r),e=Bg(vf(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=pb(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=pb(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=pb(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=pb(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function wet(t,e,r){let n=Dye(t,r),i=Dye(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function vf(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Lye(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=het(r.path):(r.path=get(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=pet(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=pb(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var Aet=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function xet(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Fye(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(Aet);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=xet(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(yet(n.host)===!1){let u=fet(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Lye(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&Eet(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=_et(unescape(n.host),o))),n.path&&(n.path=met(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Bg(t,e){return Fye(t,e).parsed}function Ret(t,e){return zye(t,e).normalized}function zye(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Fye(t,e);return{normalized:n?t:vf(r,e),malformedAuthorityOrPort:n}}function Dye(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=zye(t,e);return n?void 0:r}if(typeof t=="object")return vf(t,e)}var i6={SCHEMES:vet,normalize:bet,resolve:Tet,resolveComponent:Uye,equal:wet,serialize:vf,parse:Bg};BO.exports=i6;BO.exports.default=i6;BO.exports.fastUri=i6});var qye=y(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});var Bye=jye();Bye.code='require("ajv/dist/runtime/uri").default';o6.default=Bye});var Jye=y(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.CodeGen=nn.Name=nn.nil=nn.stringify=nn.str=nn._=nn.KeywordCxt=void 0;var Cet=db();Object.defineProperty(nn,"KeywordCxt",{enumerable:!0,get:function(){return Cet.KeywordCxt}});var qg=Je();Object.defineProperty(nn,"_",{enumerable:!0,get:function(){return qg._}});Object.defineProperty(nn,"str",{enumerable:!0,get:function(){return qg.str}});Object.defineProperty(nn,"stringify",{enumerable:!0,get:function(){return qg.stringify}});Object.defineProperty(nn,"nil",{enumerable:!0,get:function(){return qg.nil}});Object.defineProperty(nn,"Name",{enumerable:!0,get:function(){return qg.Name}});Object.defineProperty(nn,"CodeGen",{enumerable:!0,get:function(){return qg.CodeGen}});var Iet=LO(),Yye=fb(),Pet=kH(),hb=FO(),Oet=Je(),mb=cb(),qO=ab(),a6=lt(),Vye=wye(),Net=qye(),Kye=(t,e)=>new RegExp(t,e);Kye.code="new RegExp";var ket=["removeAdditional","useDefaults","coerceTypes"],Met=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),$et={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Det={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Gye=200;function Let(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_,b,T,E,A,O,R,N,M;let L=t.strict,v=(e=t.code)===null||e===void 0?void 0:e.optimize,oe=v===!0||v===void 0?1:v||0,$=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Kye,S=(i=t.uriResolver)!==null&&i!==void 0?i:Net.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:L)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:L)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:L)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:L)!==null&&f!==void 0?f:"log",strictRequired:(h=(p=t.strictRequired)!==null&&p!==void 0?p:L)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:oe,regExp:$}:{optimize:oe,regExp:$},loopRequired:(m=t.loopRequired)!==null&&m!==void 0?m:Gye,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Gye,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(b=t.messages)!==null&&b!==void 0?b:!0,inlineRefs:(T=t.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(E=t.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(A=t.addUsedSchema)!==null&&A!==void 0?A:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(R=t.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(N=t.unicodeRegExp)!==null&&N!==void 0?N:!0,int32range:(M=t.int32range)!==null&&M!==void 0?M:!0,uriResolver:S}}var gb=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Let(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Oet.ValueScope({scope:{},prefixes:Met,es5:r,lines:n}),this.logger=qet(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Pet.getRules)(),Hye.call(this,$et,e,"NOT SUPPORTED"),Hye.call(this,Det,e,"DEPRECATED","warn"),this._metaOpts=jet.call(this),e.formats&&Fet.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&zet.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Uet.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Vye;n==="id"&&(i={...Vye},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Yye.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,mb.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Wye.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new hb.SchemaEnv({schema:{},schemaId:n});if(r=hb.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Wye.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,mb.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Get.call(this,n,r),!r)return(0,a6.eachItem)(n,o=>s6.call(this,o)),this;Wet.call(this,r);let i={...r,type:(0,qO.getJSONTypes)(r.type),schemaType:(0,qO.getJSONTypes)(r.schemaType)};return(0,a6.eachItem)(n,i.type.length===0?o=>s6.call(this,o,i):o=>i.type.forEach(s=>s6.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Zye(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,mb.normalizeId)(s||n);let l=mb.getSchemaRefs.call(this,e,n);return c=new hb.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):hb.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{hb.compileSchema.call(this,e)}finally{this.opts=r}}};gb.ValidationError=Iet.default;gb.MissingRefError=Yye.default;nn.default=gb;function Hye(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Wye(t){return t=(0,mb.normalizeId)(t),this.schemas[t]||this.refs[t]}function Uet(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Fet(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function zet(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function jet(){let t={...this.opts};for(let e of ket)delete t[e];return t}var Bet={log(){},warn(){},error(){}};function qet(t){if(t===!1)return Bet;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var Vet=/^[a-z_$][a-z0-9_$:-]*$/i;function Get(t,e){let{RULES:r}=this;if((0,a6.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Vet.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function s6(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,qO.getJSONTypes)(e.type),schemaType:(0,qO.getJSONTypes)(e.schemaType)}};e.before?Het.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function Het(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Wet(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Zye(e)),t.validateSchema=this.compile(e,!0))}var Yet={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Zye(t){return{anyOf:[t,Yet]}}});var Xye=y(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});var Ket={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};c6.default=Ket});var rSe=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.callRef=bf.getValidate=void 0;var Zet=fb(),Qye=io(),si=Je(),Vg=_c(),eSe=FO(),VO=lt(),Jet={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=eSe.resolveRef.call(c,l,i,r);if(u===void 0)throw new Zet.default(n.opts.uriResolver,i,r);if(u instanceof eSe.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return GO(t,s,o,o.$async);let h=e.scopeValue("root",{ref:l});return GO(t,(0,si._)`${h}.validate`,l,l.$async)}function f(h){let m=tSe(t,h);GO(t,m,h,h.$async)}function p(h){let m=e.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,si.stringify)(h)}:{ref:h}),g=e.name("valid"),_=t.subschema({schema:h,dataTypes:[],schemaPath:si.nil,topSchemaRef:m,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function tSe(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,si._)`${r.scopeValue("wrapper",{ref:e})}.validate`}bf.getValidate=tSe;function GO(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Vg.default.this:si.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let h=i.let("valid");i.try(()=>{i.code((0,si._)`await ${(0,Qye.callValidateCode)(t,e,l)}`),p(e),s||i.assign(h,!0)},m=>{i.if((0,si._)`!(${m} instanceof ${o.ValidationError})`,()=>i.throw(m)),f(m),s||i.assign(h,!1)}),t.ok(h)}function d(){t.result((0,Qye.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(h){let m=(0,si._)`${h}.errors`;i.assign(Vg.default.vErrors,(0,si._)`${Vg.default.vErrors} === null ? ${m} : ${Vg.default.vErrors}.concat(${m})`),i.assign(Vg.default.errors,(0,si._)`${Vg.default.vErrors}.length`)}function p(h){var m;if(!o.opts.unevaluated)return;let g=(m=r?.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=VO.mergeEvaluated.props(i,g.props,o.props));else{let _=i.var("props",(0,si._)`${h}.evaluated.props`);o.props=VO.mergeEvaluated.props(i,_,o.props,si.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=VO.mergeEvaluated.items(i,g.items,o.items));else{let _=i.var("items",(0,si._)`${h}.evaluated.items`);o.items=VO.mergeEvaluated.items(i,_,o.items,si.Name)}}}bf.callRef=GO;bf.default=Jet});var nSe=y(l6=>{"use strict";Object.defineProperty(l6,"__esModule",{value:!0});var Xet=Xye(),Qet=rSe(),ett=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Xet.default,Qet.default];l6.default=ett});var iSe=y(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});var HO=Je(),au=HO.operators,WO={maximum:{okStr:"<=",ok:au.LTE,fail:au.GT},minimum:{okStr:">=",ok:au.GTE,fail:au.LT},exclusiveMaximum:{okStr:"<",ok:au.LT,fail:au.GTE},exclusiveMinimum:{okStr:">",ok:au.GT,fail:au.LTE}},ttt={message:({keyword:t,schemaCode:e})=>(0,HO.str)`must be ${WO[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,HO._)`{comparison: ${WO[t].okStr}, limit: ${e}}`},rtt={keyword:Object.keys(WO),type:"number",schemaType:"number",$data:!0,error:ttt,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,HO._)`${r} ${WO[e].fail} ${n} || isNaN(${r})`)}};u6.default=rtt});var oSe=y(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});var _b=Je(),ntt={message:({schemaCode:t})=>(0,_b.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,_b._)`{multipleOf: ${t}}`},itt={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ntt,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,_b._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,_b._)`${s} !== parseInt(${s})`;t.fail$data((0,_b._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};d6.default=itt});var aSe=y(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});function sSe(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}f6.default=sSe;sSe.code='require("ajv/dist/runtime/ucs2length").default'});var cSe=y(p6=>{"use strict";Object.defineProperty(p6,"__esModule",{value:!0});var Tf=Je(),ott=lt(),stt=aSe(),att={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Tf.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Tf._)`{limit: ${t}}`},ctt={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:att,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Tf.operators.GT:Tf.operators.LT,s=i.opts.unicode===!1?(0,Tf._)`${r}.length`:(0,Tf._)`${(0,ott.useFunc)(t.gen,stt.default)}(${r})`;t.fail$data((0,Tf._)`${s} ${o} ${n}`)}};p6.default=ctt});var lSe=y(h6=>{"use strict";Object.defineProperty(h6,"__esModule",{value:!0});var ltt=io(),utt=lt(),Gg=Je(),dtt={message:({schemaCode:t})=>(0,Gg.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Gg._)`{pattern: ${t}}`},ftt={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dtt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Gg._)`new RegExp`:(0,utt.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Gg._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Gg._)`!${u}`)}else{let c=(0,ltt.usePattern)(t,i);t.fail$data((0,Gg._)`!${c}.test(${r})`)}}};h6.default=ftt});var uSe=y(m6=>{"use strict";Object.defineProperty(m6,"__esModule",{value:!0});var yb=Je(),ptt={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,yb.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,yb._)`{limit: ${t}}`},htt={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ptt,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?yb.operators.GT:yb.operators.LT;t.fail$data((0,yb._)`Object.keys(${r}).length ${i} ${n}`)}};m6.default=htt});var dSe=y(g6=>{"use strict";Object.defineProperty(g6,"__esModule",{value:!0});var Sb=io(),Eb=Je(),mtt=lt(),gtt={message:({params:{missingProperty:t}})=>(0,Eb.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Eb._)`{missingProperty: ${t}}`},_tt={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gtt,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:h}=t.it;for(let m of r)if(p?.[m]===void 0&&!h.has(m)){let g=s.schemaEnv.baseId+s.errSchemaPath,_=`required property "${m}" is not defined at "${g}" (strictRequired)`;(0,mtt.checkStrictMode)(s,_,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Eb.nil,d);else for(let p of r)(0,Sb.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let h=e.let("valid",!0);t.block$data(h,()=>f(p,h)),t.ok(h)}else e.if((0,Sb.checkMissingProp)(t,r,p)),(0,Sb.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Sb.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,h){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(h,(0,Sb.propertyInData)(e,i,p,a.ownProperties)),e.if((0,Eb.not)(h),()=>{t.error(),e.break()})},Eb.nil)}}};g6.default=_tt});var fSe=y(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});var vb=Je(),ytt={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vb.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vb._)`{limit: ${t}}`},Stt={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ytt,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?vb.operators.GT:vb.operators.LT;t.fail$data((0,vb._)`${r}.length ${i} ${n}`)}};_6.default=Stt});var YO=y(y6=>{"use strict";Object.defineProperty(y6,"__esModule",{value:!0});var pSe=jH();pSe.code='require("ajv/dist/runtime/equal").default';y6.default=pSe});var hSe=y(E6=>{"use strict";Object.defineProperty(E6,"__esModule",{value:!0});var S6=ab(),on=Je(),Ett=lt(),vtt=YO(),btt={message:({params:{i:t,j:e}})=>(0,on.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,on._)`{i: ${t}, j: ${e}}`},Ttt={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:btt,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,S6.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,on._)`${s} === false`),t.ok(c);function u(){let h=e.let("i",(0,on._)`${r}.length`),m=e.let("j");t.setParams({i:h,j:m}),e.assign(c,!0),e.if((0,on._)`${h} > 1`,()=>(d()?f:p)(h,m))}function d(){return l.length>0&&!l.some(h=>h==="object"||h==="array")}function f(h,m){let g=e.name("item"),_=(0,S6.checkDataTypes)(l,g,a.opts.strictNumbers,S6.DataType.Wrong),b=e.const("indices",(0,on._)`{}`);e.for((0,on._)`;${h}--;`,()=>{e.let(g,(0,on._)`${r}[${h}]`),e.if(_,(0,on._)`continue`),l.length>1&&e.if((0,on._)`typeof ${g} == "string"`,(0,on._)`${g} += "_"`),e.if((0,on._)`typeof ${b}[${g}] == "number"`,()=>{e.assign(m,(0,on._)`${b}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,on._)`${b}[${g}] = ${h}`)})}function p(h,m){let g=(0,Ett.useFunc)(e,vtt.default),_=e.name("outer");e.label(_).for((0,on._)`;${h}--;`,()=>e.for((0,on._)`${m} = ${h}; ${m}--;`,()=>e.if((0,on._)`${g}(${r}[${h}], ${r}[${m}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};E6.default=Ttt});var mSe=y(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:!0});var v6=Je(),wtt=lt(),Att=YO(),xtt={message:"must be equal to constant",params:({schemaCode:t})=>(0,v6._)`{allowedValue: ${t}}`},Rtt={keyword:"const",$data:!0,error:xtt,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,v6._)`!${(0,wtt.useFunc)(e,Att.default)}(${r}, ${i})`):t.fail((0,v6._)`${o} !== ${r}`)}};b6.default=Rtt});var gSe=y(T6=>{"use strict";Object.defineProperty(T6,"__esModule",{value:!0});var bb=Je(),Ctt=lt(),Itt=YO(),Ptt={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,bb._)`{allowedValues: ${t}}`},Ott={keyword:"enum",schemaType:"array",$data:!0,error:Ptt,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,Ctt.useFunc)(e,Itt.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,bb.or)(...i.map((h,m)=>f(p,m)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,bb._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,h){let m=i[h];return typeof m=="object"&&m!==null?(0,bb._)`${l()}(${r}, ${p}[${h}])`:(0,bb._)`${r} === ${m}`}}};T6.default=Ott});var _Se=y(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Ntt=iSe(),ktt=oSe(),Mtt=cSe(),$tt=lSe(),Dtt=uSe(),Ltt=dSe(),Utt=fSe(),Ftt=hSe(),ztt=mSe(),jtt=gSe(),Btt=[Ntt.default,ktt.default,Mtt.default,$tt.default,Dtt.default,Ltt.default,Utt.default,Ftt.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ztt.default,jtt.default];w6.default=Btt});var x6=y(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});Tb.validateAdditionalItems=void 0;var wf=Je(),A6=lt(),qtt={message:({params:{len:t}})=>(0,wf.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,wf._)`{limit: ${t}}`},Vtt={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qtt,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,A6.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ySe(t,n)}};function ySe(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,wf._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,wf._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,A6.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,wf._)`${a} <= ${e.length}`);r.if((0,wf.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:A6.Type.Num},l),s.allErrors||r.if((0,wf.not)(l),()=>r.break())})}}Tb.validateAdditionalItems=ySe;Tb.default=Vtt});var R6=y(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});wb.validateTuple=void 0;var SSe=Je(),KO=lt(),Gtt=io(),Htt={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ESe(t,"additionalItems",e);r.items=!0,!(0,KO.alwaysValidSchema)(r,e)&&t.ok((0,Gtt.validateArray)(t))}};function ESe(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=KO.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,SSe._)`${o}.length`);r.forEach((d,f)=>{(0,KO.alwaysValidSchema)(a,d)||(n.if((0,SSe._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,h=r.length,m=h===d.minItems&&(h===d.maxItems||d[e]===!1);if(f.strictTuples&&!m){let g=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,KO.checkStrictMode)(a,g,f.strictTuples)}}}wb.validateTuple=ESe;wb.default=Htt});var vSe=y(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});var Wtt=R6(),Ytt={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Wtt.validateTuple)(t,"items")};C6.default=Ytt});var TSe=y(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var bSe=Je(),Ktt=lt(),Ztt=io(),Jtt=x6(),Xtt={message:({params:{len:t}})=>(0,bSe.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,bSe._)`{limit: ${t}}`},Qtt={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Xtt,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,Ktt.alwaysValidSchema)(n,e)&&(i?(0,Jtt.validateAdditionalItems)(t,i):t.ok((0,Ztt.validateArray)(t)))}};I6.default=Qtt});var wSe=y(P6=>{"use strict";Object.defineProperty(P6,"__esModule",{value:!0});var so=Je(),ZO=lt(),ert={message:({params:{min:t,max:e}})=>e===void 0?(0,so.str)`must contain at least ${t} valid item(s)`:(0,so.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,so._)`{minContains: ${t}}`:(0,so._)`{minContains: ${t}, maxContains: ${e}}`},trt={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ert,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,so._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,ZO.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,ZO.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ZO.alwaysValidSchema)(o,r)){let m=(0,so._)`${u} >= ${s}`;a!==void 0&&(m=(0,so._)`${m} && ${u} <= ${a}`),t.pass(m);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,so._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let m=e.name("_valid"),g=e.let("count",0);p(m,()=>e.if(m,()=>h(g)))}function p(m,g){e.forRange("i",0,u,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:ZO.Type.Num,compositeRule:!0},m),g()})}function h(m){e.code((0,so._)`${m}++`),a===void 0?e.if((0,so._)`${m} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,so._)`${m} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,so._)`${m} >= ${s}`,()=>e.assign(d,!0)))}}};P6.default=trt});var RSe=y(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.validateSchemaDeps=Xs.validatePropertyDeps=Xs.error=void 0;var O6=Je(),rrt=lt(),Ab=io();Xs.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,O6.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,O6._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var nrt={keyword:"dependencies",type:"object",schemaType:"object",error:Xs.error,code(t){let[e,r]=irt(t);ASe(t,e),xSe(t,r)}};function irt({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function ASe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,Ab.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,Ab.checkReportMissingProp)(t,l)}):(r.if((0,O6._)`${c} && (${(0,Ab.checkMissingProp)(t,a,o)})`),(0,Ab.reportMissingProp)(t,o),r.else())}}Xs.validatePropertyDeps=ASe;function xSe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,rrt.alwaysValidSchema)(o,e[a])||(r.if((0,Ab.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}Xs.validateSchemaDeps=xSe;Xs.default=nrt});var ISe=y(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var CSe=Ze(),ort=lt(),srt={message:"property name must be valid",params:({params:t})=>(0,CSe._)`{propertyName: ${t.propertyName}}`},art={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:srt,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,ort.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,CSe.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};N6.default=art});var M6=y(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});var JO=io(),Jo=Ze(),crt=_c(),XO=lt(),lrt={message:"must NOT have additional properties",params:({params:t})=>(0,Jo._)`{additionalProperty: ${t.additionalProperty}}`},urt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lrt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,XO.alwaysValidSchema)(s,r))return;let l=(0,JO.allSchemaProperties)(n.properties),u=(0,JO.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Jo._)`${o} === ${crt.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?h(g):e.if(f(g),()=>h(g))})}function f(g){let _;if(l.length>8){let b=(0,XO.schemaRefOrVal)(s,n.properties,"properties");_=(0,JO.isOwnProperty)(e,b,g)}else l.length?_=(0,Jo.or)(...l.map(b=>(0,Jo._)`${g} === ${b}`)):_=Jo.nil;return u.length&&(_=(0,Jo.or)(_,...u.map(b=>(0,Jo._)`${(0,JO.usePattern)(t,b)}.test(${g})`))),(0,Jo.not)(_)}function p(g){e.code((0,Jo._)`delete ${i}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,XO.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(m(g,_,!1),e.if((0,Jo.not)(_),()=>{t.reset(),p(g)})):(m(g,_),a||e.if((0,Jo.not)(_),()=>e.break()))}}function m(g,_,b){let T={keyword:"additionalProperties",dataProp:g,dataPropType:XO.Type.Str};b===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,_)}}};k6.default=urt});var NSe=y(D6=>{"use strict";Object.defineProperty(D6,"__esModule",{value:!0});var drt=db(),PSe=io(),$6=lt(),OSe=M6(),frt={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&OSe.default.code(new drt.KeywordCxt(o,OSe.default,"additionalProperties"));let s=(0,PSe.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=$6.mergeEvaluated.props(e,(0,$6.toHash)(s),o.props));let a=s.filter(d=>!(0,$6.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,PSe.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};D6.default=frt});var DSe=y(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var kSe=io(),QO=Ze(),MSe=lt(),$Se=lt(),prt={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,kSe.allSchemaProperties)(r),c=a.filter(m=>(0,MSe.alwaysValidSchema)(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof QO.Name)&&(o.props=(0,$Se.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let m of a)l&&p(m),o.allErrors?h(m):(e.var(u,!0),h(m),e.if(u))}function p(m){for(let g in l)new RegExp(m).test(g)&&(0,MSe.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",n,g=>{e.if((0,QO._)`${(0,kSe.usePattern)(t,m)}.test(${g})`,()=>{let _=c.includes(m);_||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:$Se.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,QO._)`${d}[${g}]`,!0):!_&&!o.allErrors&&e.if((0,QO.not)(u),()=>e.break())})})}}};L6.default=prt});var LSe=y(U6=>{"use strict";Object.defineProperty(U6,"__esModule",{value:!0});var hrt=lt(),mrt={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,hrt.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};U6.default=mrt});var USe=y(F6=>{"use strict";Object.defineProperty(F6,"__esModule",{value:!0});var grt=io(),_rt={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:grt.validateUnion,error:{message:"must match a schema in anyOf"}};F6.default=_rt});var FSe=y(z6=>{"use strict";Object.defineProperty(z6,"__esModule",{value:!0});var eN=Ze(),yrt=lt(),Srt={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,eN._)`{passingSchemas: ${t.passing}}`},Ert={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Srt,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,yrt.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,eN._)`${c} && ${s}`).assign(s,!1).assign(a,(0,eN._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,eN.Name)})})}}};z6.default=Ert});var zSe=y(j6=>{"use strict";Object.defineProperty(j6,"__esModule",{value:!0});var vrt=lt(),brt={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,vrt.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};j6.default=brt});var qSe=y(B6=>{"use strict";Object.defineProperty(B6,"__esModule",{value:!0});var tN=Ze(),BSe=lt(),Trt={message:({params:t})=>(0,tN.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,tN._)`{failingKeyword: ${t.ifClause}}`},wrt={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Trt,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,BSe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=jSe(n,"then"),o=jSe(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,tN.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,tN._)`${u}`):t.setParams({ifClause:u})}}}};function jSe(t,e){let r=t.schema[e];return r!==void 0&&!(0,BSe.alwaysValidSchema)(t,r)}B6.default=wrt});var VSe=y(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});var Art=lt(),xrt={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Art.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};q6.default=xrt});var GSe=y(V6=>{"use strict";Object.defineProperty(V6,"__esModule",{value:!0});var Rrt=x6(),Crt=vSe(),Irt=R6(),Prt=TSe(),Ort=wSe(),Nrt=RSe(),krt=ISe(),Mrt=M6(),$rt=NSe(),Drt=DSe(),Lrt=LSe(),Urt=USe(),Frt=FSe(),zrt=zSe(),jrt=qSe(),Brt=VSe();function qrt(t=!1){let e=[Lrt.default,Urt.default,Frt.default,zrt.default,jrt.default,Brt.default,krt.default,Mrt.default,Nrt.default,$rt.default,Drt.default];return t?e.push(Crt.default,Prt.default):e.push(Rrt.default,Irt.default),e.push(Ort.default),e}V6.default=qrt});var HSe=y(G6=>{"use strict";Object.defineProperty(G6,"__esModule",{value:!0});var ar=Ze(),Vrt={message:({schemaCode:t})=>(0,ar.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ar._)`{format: ${t}}`},Grt={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Vrt,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=r.const("fDef",(0,ar._)`${h}[${s}]`),g=r.let("fType"),_=r.let("format");r.if((0,ar._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,ar._)`${m}.type || "string"`).assign(_,(0,ar._)`${m}.validate`),()=>r.assign(g,(0,ar._)`"string"`).assign(_,m)),t.fail$data((0,ar.or)(b(),T()));function b(){return c.strictSchema===!1?ar.nil:(0,ar._)`${s} && !${_}`}function T(){let E=u.$async?(0,ar._)`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ar._)`${_}(${n})`,A=(0,ar._)`(typeof ${_} == "function" ? ${E} : ${_}.test(${n}))`;return(0,ar._)`${_} && ${_} !== true && ${g} === ${e} && !${A}`}}function p(){let h=d.formats[o];if(!h){b();return}if(h===!0)return;let[m,g,_]=T(h);m===e&&t.pass(E());function b(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function T(A){let O=A instanceof RegExp?(0,ar.regexpCode)(A):c.code.formats?(0,ar._)`${c.code.formats}${(0,ar.getProperty)(o)}`:void 0,R=r.scopeValue("formats",{key:o,ref:A,code:O});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,ar._)`${R}.validate`]:["string",A,R]}function E(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ar._)`await ${_}(${n})`}return typeof g=="function"?(0,ar._)`${_}(${n})`:(0,ar._)`${_}.test(${n})`}}}};G6.default=Grt});var WSe=y(H6=>{"use strict";Object.defineProperty(H6,"__esModule",{value:!0});var Hrt=HSe(),Wrt=[Hrt.default];H6.default=Wrt});var YSe=y(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.contentVocabulary=Hg.metadataVocabulary=void 0;Hg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Hg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ZSe=y(W6=>{"use strict";Object.defineProperty(W6,"__esModule",{value:!0});var Yrt=nSe(),Krt=_Se(),Zrt=GSe(),Jrt=WSe(),KSe=YSe(),Xrt=[Yrt.default,Krt.default,(0,Zrt.default)(),Jrt.default,KSe.metadataVocabulary,KSe.contentVocabulary];W6.default=Xrt});var XSe=y(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});rN.DiscrError=void 0;var JSe;(function(t){t.Tag="tag",t.Mapping="mapping"})(JSe||(rN.DiscrError=JSe={}))});var eEe=y(K6=>{"use strict";Object.defineProperty(K6,"__esModule",{value:!0});var Wg=Ze(),Y6=XSe(),QSe=FO(),Qrt=fb(),ent=lt(),tnt={message:({params:{discrError:t,tagName:e}})=>t===Y6.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wg._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},rnt={keyword:"discriminator",type:"object",schemaType:"object",error:tnt,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Wg._)`${r}${(0,Wg.getProperty)(a)}`);e.if((0,Wg._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:Y6.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let h in p)e.elseIf((0,Wg._)`${l} === ${h}`),e.assign(c,d(p[h]));e.else(),t.error(!1,{discrError:Y6.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let h=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:p},h);return t.mergeEvaluated(m,Wg.Name),h}function f(){var p;let h={},m=_(i),g=!0;for(let E=0;E<s.length;E++){let A=s[E];if(A?.$ref&&!(0,ent.schemaHasRulesButRef)(A,o.self.RULES)){let R=A.$ref;if(A=QSe.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,R),A instanceof QSe.SchemaEnv&&(A=A.schema),A===void 0)throw new Qrt.default(o.opts.uriResolver,o.baseId,R)}let O=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof O!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||_(A)),b(O,E)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function _({required:E}){return Array.isArray(E)&&E.includes(a)}function b(E,A){if(E.const)T(E.const,A);else if(E.enum)for(let O of E.enum)T(O,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(E,A){if(typeof E!="string"||E in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[E]=A}}}};K6.default=rnt});var tEe=y((Gir,nnt)=>{nnt.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var nEe=y((qt,Z6)=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.MissingRefError=qt.ValidationError=qt.CodeGen=qt.Name=qt.nil=qt.stringify=qt.str=qt._=qt.KeywordCxt=qt.Ajv=void 0;var int=Jye(),ont=ZSe(),snt=eEe(),rEe=tEe(),ant=["/properties"],nN="http://json-schema.org/draft-07/schema",Yg=class extends int.default{_addVocabularies(){super._addVocabularies(),ont.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(snt.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(rEe,ant):rEe;this.addMetaSchema(e,nN,!1),this.refs["http://json-schema.org/schema"]=nN}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nN)?nN:void 0)}};qt.Ajv=Yg;Z6.exports=qt=Yg;Z6.exports.Ajv=Yg;Object.defineProperty(qt,"__esModule",{value:!0});qt.default=Yg;var cnt=db();Object.defineProperty(qt,"KeywordCxt",{enumerable:!0,get:function(){return cnt.KeywordCxt}});var Kg=Ze();Object.defineProperty(qt,"_",{enumerable:!0,get:function(){return Kg._}});Object.defineProperty(qt,"str",{enumerable:!0,get:function(){return Kg.str}});Object.defineProperty(qt,"stringify",{enumerable:!0,get:function(){return Kg.stringify}});Object.defineProperty(qt,"nil",{enumerable:!0,get:function(){return Kg.nil}});Object.defineProperty(qt,"Name",{enumerable:!0,get:function(){return Kg.Name}});Object.defineProperty(qt,"CodeGen",{enumerable:!0,get:function(){return Kg.CodeGen}});var lnt=LO();Object.defineProperty(qt,"ValidationError",{enumerable:!0,get:function(){return lnt.default}});var unt=fb();Object.defineProperty(qt,"MissingRefError",{enumerable:!0,get:function(){return unt.default}})});var dEe=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.formatNames=ea.fastFormats=ea.fullFormats=void 0;function Qs(t,e){return{validate:t,compare:e}}ea.fullFormats={date:Qs(aEe,e3),time:Qs(X6(!0),t3),"date-time":Qs(iEe(!0),lEe),"iso-time":Qs(X6(),cEe),"iso-date-time":Qs(iEe(),uEe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:gnt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Tnt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_nt,int32:{type:"number",validate:Ent},int64:{type:"number",validate:vnt},float:{type:"number",validate:sEe},double:{type:"number",validate:sEe},password:!0,binary:!0};ea.fastFormats={...ea.fullFormats,date:Qs(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,e3),time:Qs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,t3),"date-time":Qs(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lEe),"iso-time":Qs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,cEe),"iso-date-time":Qs(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,uEe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ea.formatNames=Object.keys(ea.fullFormats);function dnt(t){return t%4===0&&(t%100!==0||t%400===0)}var fnt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,pnt=[0,31,28,31,30,31,30,31,31,30,31,30,31];function aEe(t){let e=fnt.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&dnt(r)?29:pnt[n])}function e3(t,e){if(t&&e)return t>e?1:t<e?-1:0}var J6=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function X6(t){return function(r){let n=J6.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function t3(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function cEe(t,e){if(!(t&&e))return;let r=J6.exec(t),n=J6.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Q6=/t|\s/i;function iEe(t){let e=X6(t);return function(n){let i=n.split(Q6);return i.length===2&&aEe(i[0])&&e(i[1])}}function lEe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function uEe(t,e){if(!(t&&e))return;let[r,n]=t.split(Q6),[i,o]=e.split(Q6),s=e3(r,i);if(s!==void 0)return s||t3(n,o)}var hnt=/\/|:/,mnt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function gnt(t){return hnt.test(t)&&mnt.test(t)}var oEe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _nt(t){return oEe.lastIndex=0,oEe.test(t)}var ynt=-(2**31),Snt=2**31-1;function Ent(t){return Number.isInteger(t)&&t<=Snt&&t>=ynt}function vnt(t){return Number.isInteger(t)}function sEe(){return!0}var bnt=/[^\\]\\Z/;function Tnt(t){if(bnt.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var fEe=y(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.formatLimitDefinition=void 0;var wnt=nEe(),Xo=Ze(),cu=Xo.operators,iN={formatMaximum:{okStr:"<=",ok:cu.LTE,fail:cu.GT},formatMinimum:{okStr:">=",ok:cu.GTE,fail:cu.LT},formatExclusiveMaximum:{okStr:"<",ok:cu.LT,fail:cu.GTE},formatExclusiveMinimum:{okStr:">",ok:cu.GT,fail:cu.LTE}},Ant={message:({keyword:t,schemaCode:e})=>(0,Xo.str)`should be ${iN[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Xo._)`{comparison: ${iN[t].okStr}, limit: ${e}}`};Zg.formatLimitDefinition={keyword:Object.keys(iN),type:"string",schemaType:"string",$data:!0,error:Ant,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new wnt.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Xo._)`${f}[${c.schemaCode}]`);t.fail$data((0,Xo.or)((0,Xo._)`typeof ${p} != "object"`,(0,Xo._)`${p} instanceof RegExp`,(0,Xo._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let h=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Xo._)`${s.code.formats}${(0,Xo.getProperty)(f)}`:void 0});t.fail$data(d(h))}function d(f){return(0,Xo._)`${f}.compare(${r}, ${n}) ${iN[i].fail} 0`}},dependencies:["format"]};var xnt=t=>(t.addKeyword(Zg.formatLimitDefinition),t);Zg.default=xnt});var gEe=y((xb,mEe)=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var Jg=dEe(),Rnt=fEe(),r3=Ze(),pEe=new r3.Name("fullFormats"),Cnt=new r3.Name("fastFormats"),n3=(t,e={keywords:!0})=>{if(Array.isArray(e))return hEe(t,e,Jg.fullFormats,pEe),t;let[r,n]=e.mode==="fast"?[Jg.fastFormats,Cnt]:[Jg.fullFormats,pEe],i=e.formats||Jg.formatNames;return hEe(t,i,r,n),e.keywords&&(0,Rnt.default)(t),t};n3.get=(t,e="full")=>{let n=(e==="fast"?Jg.fastFormats:Jg.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function hEe(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,r3._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}mEe.exports=xb=n3;Object.defineProperty(xb,"__esModule",{value:!0});xb.default=n3});var ive=y((Qsr,nve)=>{"use strict";var lu=Z("constants"),Cit=process.cwd,lN=null,Iit=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return lN||(lN=Cit.call(process)),lN};try{process.cwd()}catch{}typeof process.chdir=="function"&&(_3=process.chdir,process.chdir=function(t){lN=null,_3.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,_3));var _3;nve.exports=Pit;function Pit(t){lu.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,f){f&&process.nextTick(f)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,f,p){p&&process.nextTick(p)},t.lchownSync=function(){}),Iit==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),g=0;u(f,p,function _(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(T,E){T&&T.code==="ENOENT"?u(f,p,_):h(b)})},g),g<100&&(g+=10);return}h&&h(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(f,p,h,m,g,_){var b;if(_&&typeof _=="function"){var T=0;b=function(E,A,O){if(E&&E.code==="EAGAIN"&&T<10)return T++,u.call(t,f,p,h,m,g,b);_.apply(this,arguments)}}return u.call(t,f,p,h,m,g,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,f,p,h,m){for(var g=0;;)try{return u.call(t,d,f,p,h,m)}catch(_){if(_.code==="EAGAIN"&&g<10){g++;continue}throw _}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,lu.O_WRONLY|lu.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(g){u.close(m,function(_){p&&p(g||_)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,lu.O_WRONLY|lu.O_SYMLINK,f),h=!0,m;try{m=u.fchmodSync(p,f),h=!1}finally{if(h)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function r(u){lu.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,lu.O_SYMLINK,function(m,g){if(m){h&&h(m);return}u.futimes(g,f,p,function(_){u.close(g,function(b){h&&h(_||b)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,lu.O_SYMLINK),m,g=!0;try{m=u.futimesSync(h,f,p),g=!1}finally{if(g)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}):u.futimes&&(u.lutimes=function(d,f,p,h){h&&process.nextTick(h)},u.lutimesSync=function(){})}function n(u){return u&&function(d,f,p){return u.call(t,d,f,function(h){l(h)&&(h=null),p&&p.apply(this,arguments)})}}function i(u){return u&&function(d,f){try{return u.call(t,d,f)}catch(p){if(!l(p))throw p}}}function o(u){return u&&function(d,f,p,h){return u.call(t,d,f,p,function(m){l(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(u){return u&&function(d,f,p){try{return u.call(t,d,f,p)}catch(h){if(!l(h))throw h}}}function a(u){return u&&function(d,f,p){typeof f=="function"&&(p=f,f=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),p&&p.apply(this,arguments)}return f?u.call(t,d,f,h):u.call(t,d,h)}}function c(u){return u&&function(d,f){var p=f?u.call(t,d,f):u.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var ave=y((ear,sve)=>{"use strict";var ove=Z("stream").Stream;sve.exports=Oit;function Oit(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);ove.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){o.emit("error",u),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);ove.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var lve=y((tar,cve)=>{"use strict";cve.exports=kit;var Nit=Object.getPrototypeOf||function(t){return t.__proto__};function kit(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Nit(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var pve=y((rar,E3)=>{"use strict";var Kt=Z("fs"),Mit=ive(),$it=ave(),Dit=lve(),uN=Z("util"),an,fN;typeof Symbol=="function"&&typeof Symbol.for=="function"?(an=Symbol.for("graceful-fs.queue"),fN=Symbol.for("graceful-fs.previous")):(an="___graceful-fs.queue",fN="___graceful-fs.previous");function Lit(){}function fve(t,e){Object.defineProperty(t,an,{get:function(){return e}})}var xf=Lit;uN.debuglog?xf=uN.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(xf=function(){var t=uN.format.apply(uN,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
30
|
+
deps: ${r}}`};var nrt={keyword:"dependencies",type:"object",schemaType:"object",error:Xs.error,code(t){let[e,r]=irt(t);ASe(t,e),xSe(t,r)}};function irt({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function ASe(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,Ab.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,Ab.checkReportMissingProp)(t,l)}):(r.if((0,O6._)`${c} && (${(0,Ab.checkMissingProp)(t,a,o)})`),(0,Ab.reportMissingProp)(t,o),r.else())}}Xs.validatePropertyDeps=ASe;function xSe(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,rrt.alwaysValidSchema)(o,e[a])||(r.if((0,Ab.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}Xs.validateSchemaDeps=xSe;Xs.default=nrt});var ISe=y(N6=>{"use strict";Object.defineProperty(N6,"__esModule",{value:!0});var CSe=Je(),ort=lt(),srt={message:"property name must be valid",params:({params:t})=>(0,CSe._)`{propertyName: ${t.propertyName}}`},art={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:srt,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,ort.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,CSe.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};N6.default=art});var M6=y(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});var JO=io(),Jo=Je(),crt=_c(),XO=lt(),lrt={message:"must NOT have additional properties",params:({params:t})=>(0,Jo._)`{additionalProperty: ${t.additionalProperty}}`},urt={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lrt,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,XO.alwaysValidSchema)(s,r))return;let l=(0,JO.allSchemaProperties)(n.properties),u=(0,JO.allSchemaProperties)(n.patternProperties);d(),t.ok((0,Jo._)`${o} === ${crt.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?h(g):e.if(f(g),()=>h(g))})}function f(g){let _;if(l.length>8){let b=(0,XO.schemaRefOrVal)(s,n.properties,"properties");_=(0,JO.isOwnProperty)(e,b,g)}else l.length?_=(0,Jo.or)(...l.map(b=>(0,Jo._)`${g} === ${b}`)):_=Jo.nil;return u.length&&(_=(0,Jo.or)(_,...u.map(b=>(0,Jo._)`${(0,JO.usePattern)(t,b)}.test(${g})`))),(0,Jo.not)(_)}function p(g){e.code((0,Jo._)`delete ${i}[${g}]`)}function h(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,XO.alwaysValidSchema)(s,r)){let _=e.name("valid");c.removeAdditional==="failing"?(m(g,_,!1),e.if((0,Jo.not)(_),()=>{t.reset(),p(g)})):(m(g,_),a||e.if((0,Jo.not)(_),()=>e.break()))}}function m(g,_,b){let T={keyword:"additionalProperties",dataProp:g,dataPropType:XO.Type.Str};b===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(T,_)}}};k6.default=urt});var NSe=y(D6=>{"use strict";Object.defineProperty(D6,"__esModule",{value:!0});var drt=db(),PSe=io(),$6=lt(),OSe=M6(),frt={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&OSe.default.code(new drt.KeywordCxt(o,OSe.default,"additionalProperties"));let s=(0,PSe.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=$6.mergeEvaluated.props(e,(0,$6.toHash)(s),o.props));let a=s.filter(d=>!(0,$6.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,PSe.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};D6.default=frt});var DSe=y(L6=>{"use strict";Object.defineProperty(L6,"__esModule",{value:!0});var kSe=io(),QO=Je(),MSe=lt(),$Se=lt(),prt={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,kSe.allSchemaProperties)(r),c=a.filter(m=>(0,MSe.alwaysValidSchema)(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof QO.Name)&&(o.props=(0,$Se.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let m of a)l&&p(m),o.allErrors?h(m):(e.var(u,!0),h(m),e.if(u))}function p(m){for(let g in l)new RegExp(m).test(g)&&(0,MSe.checkStrictMode)(o,`property ${g} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){e.forIn("key",n,g=>{e.if((0,QO._)`${(0,kSe.usePattern)(t,m)}.test(${g})`,()=>{let _=c.includes(m);_||t.subschema({keyword:"patternProperties",schemaProp:m,dataProp:g,dataPropType:$Se.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,QO._)`${d}[${g}]`,!0):!_&&!o.allErrors&&e.if((0,QO.not)(u),()=>e.break())})})}}};L6.default=prt});var LSe=y(U6=>{"use strict";Object.defineProperty(U6,"__esModule",{value:!0});var hrt=lt(),mrt={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,hrt.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};U6.default=mrt});var USe=y(F6=>{"use strict";Object.defineProperty(F6,"__esModule",{value:!0});var grt=io(),_rt={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:grt.validateUnion,error:{message:"must match a schema in anyOf"}};F6.default=_rt});var FSe=y(z6=>{"use strict";Object.defineProperty(z6,"__esModule",{value:!0});var eN=Je(),yrt=lt(),Srt={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,eN._)`{passingSchemas: ${t.passing}}`},Ert={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Srt,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,yrt.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,eN._)`${c} && ${s}`).assign(s,!1).assign(a,(0,eN._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,eN.Name)})})}}};z6.default=Ert});var zSe=y(j6=>{"use strict";Object.defineProperty(j6,"__esModule",{value:!0});var vrt=lt(),brt={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,vrt.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};j6.default=brt});var qSe=y(B6=>{"use strict";Object.defineProperty(B6,"__esModule",{value:!0});var tN=Je(),BSe=lt(),Trt={message:({params:t})=>(0,tN.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,tN._)`{failingKeyword: ${t.ifClause}}`},wrt={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Trt,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,BSe.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=jSe(n,"then"),o=jSe(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,tN.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,tN._)`${u}`):t.setParams({ifClause:u})}}}};function jSe(t,e){let r=t.schema[e];return r!==void 0&&!(0,BSe.alwaysValidSchema)(t,r)}B6.default=wrt});var VSe=y(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});var Art=lt(),xrt={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Art.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};q6.default=xrt});var GSe=y(V6=>{"use strict";Object.defineProperty(V6,"__esModule",{value:!0});var Rrt=x6(),Crt=vSe(),Irt=R6(),Prt=TSe(),Ort=wSe(),Nrt=RSe(),krt=ISe(),Mrt=M6(),$rt=NSe(),Drt=DSe(),Lrt=LSe(),Urt=USe(),Frt=FSe(),zrt=zSe(),jrt=qSe(),Brt=VSe();function qrt(t=!1){let e=[Lrt.default,Urt.default,Frt.default,zrt.default,jrt.default,Brt.default,krt.default,Mrt.default,Nrt.default,$rt.default,Drt.default];return t?e.push(Crt.default,Prt.default):e.push(Rrt.default,Irt.default),e.push(Ort.default),e}V6.default=qrt});var HSe=y(G6=>{"use strict";Object.defineProperty(G6,"__esModule",{value:!0});var ar=Je(),Vrt={message:({schemaCode:t})=>(0,ar.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ar._)`{format: ${t}}`},Grt={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Vrt,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let h=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),m=r.const("fDef",(0,ar._)`${h}[${s}]`),g=r.let("fType"),_=r.let("format");r.if((0,ar._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(g,(0,ar._)`${m}.type || "string"`).assign(_,(0,ar._)`${m}.validate`),()=>r.assign(g,(0,ar._)`"string"`).assign(_,m)),t.fail$data((0,ar.or)(b(),T()));function b(){return c.strictSchema===!1?ar.nil:(0,ar._)`${s} && !${_}`}function T(){let E=u.$async?(0,ar._)`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ar._)`${_}(${n})`,A=(0,ar._)`(typeof ${_} == "function" ? ${E} : ${_}.test(${n}))`;return(0,ar._)`${_} && ${_} !== true && ${g} === ${e} && !${A}`}}function p(){let h=d.formats[o];if(!h){b();return}if(h===!0)return;let[m,g,_]=T(h);m===e&&t.pass(E());function b(){if(c.strictSchema===!1){d.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function T(A){let O=A instanceof RegExp?(0,ar.regexpCode)(A):c.code.formats?(0,ar._)`${c.code.formats}${(0,ar.getProperty)(o)}`:void 0,R=r.scopeValue("formats",{key:o,ref:A,code:O});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,ar._)`${R}.validate`]:["string",A,R]}function E(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ar._)`await ${_}(${n})`}return typeof g=="function"?(0,ar._)`${_}(${n})`:(0,ar._)`${_}.test(${n})`}}}};G6.default=Grt});var WSe=y(H6=>{"use strict";Object.defineProperty(H6,"__esModule",{value:!0});var Hrt=HSe(),Wrt=[Hrt.default];H6.default=Wrt});var YSe=y(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.contentVocabulary=Hg.metadataVocabulary=void 0;Hg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Hg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ZSe=y(W6=>{"use strict";Object.defineProperty(W6,"__esModule",{value:!0});var Yrt=nSe(),Krt=_Se(),Zrt=GSe(),Jrt=WSe(),KSe=YSe(),Xrt=[Yrt.default,Krt.default,(0,Zrt.default)(),Jrt.default,KSe.metadataVocabulary,KSe.contentVocabulary];W6.default=Xrt});var XSe=y(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});rN.DiscrError=void 0;var JSe;(function(t){t.Tag="tag",t.Mapping="mapping"})(JSe||(rN.DiscrError=JSe={}))});var eEe=y(K6=>{"use strict";Object.defineProperty(K6,"__esModule",{value:!0});var Wg=Je(),Y6=XSe(),QSe=FO(),Qrt=fb(),ent=lt(),tnt={message:({params:{discrError:t,tagName:e}})=>t===Y6.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wg._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},rnt={keyword:"discriminator",type:"object",schemaType:"object",error:tnt,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Wg._)`${r}${(0,Wg.getProperty)(a)}`);e.if((0,Wg._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:Y6.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let h in p)e.elseIf((0,Wg._)`${l} === ${h}`),e.assign(c,d(p[h]));e.else(),t.error(!1,{discrError:Y6.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let h=e.name("valid"),m=t.subschema({keyword:"oneOf",schemaProp:p},h);return t.mergeEvaluated(m,Wg.Name),h}function f(){var p;let h={},m=_(i),g=!0;for(let E=0;E<s.length;E++){let A=s[E];if(A?.$ref&&!(0,ent.schemaHasRulesButRef)(A,o.self.RULES)){let R=A.$ref;if(A=QSe.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,R),A instanceof QSe.SchemaEnv&&(A=A.schema),A===void 0)throw new Qrt.default(o.opts.uriResolver,o.baseId,R)}let O=(p=A?.properties)===null||p===void 0?void 0:p[a];if(typeof O!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(m||_(A)),b(O,E)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return h;function _({required:E}){return Array.isArray(E)&&E.includes(a)}function b(E,A){if(E.const)T(E.const,A);else if(E.enum)for(let O of E.enum)T(O,A);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(E,A){if(typeof E!="string"||E in h)throw new Error(`discriminator: "${a}" values must be unique strings`);h[E]=A}}}};K6.default=rnt});var tEe=y((Gir,nnt)=>{nnt.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var nEe=y((qt,Z6)=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.MissingRefError=qt.ValidationError=qt.CodeGen=qt.Name=qt.nil=qt.stringify=qt.str=qt._=qt.KeywordCxt=qt.Ajv=void 0;var int=Jye(),ont=ZSe(),snt=eEe(),rEe=tEe(),ant=["/properties"],nN="http://json-schema.org/draft-07/schema",Yg=class extends int.default{_addVocabularies(){super._addVocabularies(),ont.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(snt.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(rEe,ant):rEe;this.addMetaSchema(e,nN,!1),this.refs["http://json-schema.org/schema"]=nN}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(nN)?nN:void 0)}};qt.Ajv=Yg;Z6.exports=qt=Yg;Z6.exports.Ajv=Yg;Object.defineProperty(qt,"__esModule",{value:!0});qt.default=Yg;var cnt=db();Object.defineProperty(qt,"KeywordCxt",{enumerable:!0,get:function(){return cnt.KeywordCxt}});var Kg=Je();Object.defineProperty(qt,"_",{enumerable:!0,get:function(){return Kg._}});Object.defineProperty(qt,"str",{enumerable:!0,get:function(){return Kg.str}});Object.defineProperty(qt,"stringify",{enumerable:!0,get:function(){return Kg.stringify}});Object.defineProperty(qt,"nil",{enumerable:!0,get:function(){return Kg.nil}});Object.defineProperty(qt,"Name",{enumerable:!0,get:function(){return Kg.Name}});Object.defineProperty(qt,"CodeGen",{enumerable:!0,get:function(){return Kg.CodeGen}});var lnt=LO();Object.defineProperty(qt,"ValidationError",{enumerable:!0,get:function(){return lnt.default}});var unt=fb();Object.defineProperty(qt,"MissingRefError",{enumerable:!0,get:function(){return unt.default}})});var dEe=y(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.formatNames=ea.fastFormats=ea.fullFormats=void 0;function Qs(t,e){return{validate:t,compare:e}}ea.fullFormats={date:Qs(aEe,e3),time:Qs(X6(!0),t3),"date-time":Qs(iEe(!0),lEe),"iso-time":Qs(X6(),cEe),"iso-date-time":Qs(iEe(),uEe),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:gnt,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Tnt,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_nt,int32:{type:"number",validate:Ent},int64:{type:"number",validate:vnt},float:{type:"number",validate:sEe},double:{type:"number",validate:sEe},password:!0,binary:!0};ea.fastFormats={...ea.fullFormats,date:Qs(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,e3),time:Qs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,t3),"date-time":Qs(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,lEe),"iso-time":Qs(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,cEe),"iso-date-time":Qs(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,uEe),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ea.formatNames=Object.keys(ea.fullFormats);function dnt(t){return t%4===0&&(t%100!==0||t%400===0)}var fnt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,pnt=[0,31,28,31,30,31,30,31,31,30,31,30,31];function aEe(t){let e=fnt.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&dnt(r)?29:pnt[n])}function e3(t,e){if(t&&e)return t>e?1:t<e?-1:0}var J6=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function X6(t){return function(r){let n=J6.exec(r);if(!n)return!1;let i=+n[1],o=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function t3(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function cEe(t,e){if(!(t&&e))return;let r=J6.exec(t),n=J6.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Q6=/t|\s/i;function iEe(t){let e=X6(t);return function(n){let i=n.split(Q6);return i.length===2&&aEe(i[0])&&e(i[1])}}function lEe(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function uEe(t,e){if(!(t&&e))return;let[r,n]=t.split(Q6),[i,o]=e.split(Q6),s=e3(r,i);if(s!==void 0)return s||t3(n,o)}var hnt=/\/|:/,mnt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function gnt(t){return hnt.test(t)&&mnt.test(t)}var oEe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _nt(t){return oEe.lastIndex=0,oEe.test(t)}var ynt=-(2**31),Snt=2**31-1;function Ent(t){return Number.isInteger(t)&&t<=Snt&&t>=ynt}function vnt(t){return Number.isInteger(t)}function sEe(){return!0}var bnt=/[^\\]\\Z/;function Tnt(t){if(bnt.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var fEe=y(Zg=>{"use strict";Object.defineProperty(Zg,"__esModule",{value:!0});Zg.formatLimitDefinition=void 0;var wnt=nEe(),Xo=Je(),cu=Xo.operators,iN={formatMaximum:{okStr:"<=",ok:cu.LTE,fail:cu.GT},formatMinimum:{okStr:">=",ok:cu.GTE,fail:cu.LT},formatExclusiveMaximum:{okStr:"<",ok:cu.LT,fail:cu.GTE},formatExclusiveMinimum:{okStr:">",ok:cu.GT,fail:cu.LTE}},Ant={message:({keyword:t,schemaCode:e})=>(0,Xo.str)`should be ${iN[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Xo._)`{comparison: ${iN[t].okStr}, limit: ${e}}`};Zg.formatLimitDefinition={keyword:Object.keys(iN),type:"string",schemaType:"string",$data:!0,error:Ant,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new wnt.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Xo._)`${f}[${c.schemaCode}]`);t.fail$data((0,Xo.or)((0,Xo._)`typeof ${p} != "object"`,(0,Xo._)`${p} instanceof RegExp`,(0,Xo._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let h=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Xo._)`${s.code.formats}${(0,Xo.getProperty)(f)}`:void 0});t.fail$data(d(h))}function d(f){return(0,Xo._)`${f}.compare(${r}, ${n}) ${iN[i].fail} 0`}},dependencies:["format"]};var xnt=t=>(t.addKeyword(Zg.formatLimitDefinition),t);Zg.default=xnt});var gEe=y((xb,mEe)=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var Jg=dEe(),Rnt=fEe(),r3=Je(),pEe=new r3.Name("fullFormats"),Cnt=new r3.Name("fastFormats"),n3=(t,e={keywords:!0})=>{if(Array.isArray(e))return hEe(t,e,Jg.fullFormats,pEe),t;let[r,n]=e.mode==="fast"?[Jg.fastFormats,Cnt]:[Jg.fullFormats,pEe],i=e.formats||Jg.formatNames;return hEe(t,i,r,n),e.keywords&&(0,Rnt.default)(t),t};n3.get=(t,e="full")=>{let n=(e==="fast"?Jg.fastFormats:Jg.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function hEe(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,r3._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}mEe.exports=xb=n3;Object.defineProperty(xb,"__esModule",{value:!0});xb.default=n3});var ive=y((Qsr,nve)=>{"use strict";var lu=Z("constants"),Cit=process.cwd,lN=null,Iit=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return lN||(lN=Cit.call(process)),lN};try{process.cwd()}catch{}typeof process.chdir=="function"&&(_3=process.chdir,process.chdir=function(t){lN=null,_3.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,_3));var _3;nve.exports=Pit;function Pit(t){lu.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,f){f&&process.nextTick(f)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,f,p){p&&process.nextTick(p)},t.lchownSync=function(){}),Iit==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(f,p,h){var m=Date.now(),g=0;u(f,p,function _(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(T,E){T&&T.code==="ENOENT"?u(f,p,_):h(b)})},g),g<100&&(g+=10);return}h&&h(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(f,p,h,m,g,_){var b;if(_&&typeof _=="function"){var T=0;b=function(E,A,O){if(E&&E.code==="EAGAIN"&&T<10)return T++,u.call(t,f,p,h,m,g,b);_.apply(this,arguments)}}return u.call(t,f,p,h,m,g,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,f,p,h,m){for(var g=0;;)try{return u.call(t,d,f,p,h,m)}catch(_){if(_.code==="EAGAIN"&&g<10){g++;continue}throw _}}})(t.readSync);function e(u){u.lchmod=function(d,f,p){u.open(d,lu.O_WRONLY|lu.O_SYMLINK,f,function(h,m){if(h){p&&p(h);return}u.fchmod(m,f,function(g){u.close(m,function(_){p&&p(g||_)})})})},u.lchmodSync=function(d,f){var p=u.openSync(d,lu.O_WRONLY|lu.O_SYMLINK,f),h=!0,m;try{m=u.fchmodSync(p,f),h=!1}finally{if(h)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function r(u){lu.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,f,p,h){u.open(d,lu.O_SYMLINK,function(m,g){if(m){h&&h(m);return}u.futimes(g,f,p,function(_){u.close(g,function(b){h&&h(_||b)})})})},u.lutimesSync=function(d,f,p){var h=u.openSync(d,lu.O_SYMLINK),m,g=!0;try{m=u.futimesSync(h,f,p),g=!1}finally{if(g)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}):u.futimes&&(u.lutimes=function(d,f,p,h){h&&process.nextTick(h)},u.lutimesSync=function(){})}function n(u){return u&&function(d,f,p){return u.call(t,d,f,function(h){l(h)&&(h=null),p&&p.apply(this,arguments)})}}function i(u){return u&&function(d,f){try{return u.call(t,d,f)}catch(p){if(!l(p))throw p}}}function o(u){return u&&function(d,f,p,h){return u.call(t,d,f,p,function(m){l(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(u){return u&&function(d,f,p){try{return u.call(t,d,f,p)}catch(h){if(!l(h))throw h}}}function a(u){return u&&function(d,f,p){typeof f=="function"&&(p=f,f=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),p&&p.apply(this,arguments)}return f?u.call(t,d,f,h):u.call(t,d,h)}}function c(u){return u&&function(d,f){var p=f?u.call(t,d,f):u.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var ave=y((ear,sve)=>{"use strict";var ove=Z("stream").Stream;sve.exports=Oit;function Oit(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);ove.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){o.emit("error",u),o.readable=!1;return}o.fd=d,o.emit("open",d),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);ove.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var lve=y((tar,cve)=>{"use strict";cve.exports=kit;var Nit=Object.getPrototypeOf||function(t){return t.__proto__};function kit(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Nit(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var pve=y((rar,E3)=>{"use strict";var Kt=Z("fs"),Mit=ive(),$it=ave(),Dit=lve(),uN=Z("util"),an,fN;typeof Symbol=="function"&&typeof Symbol.for=="function"?(an=Symbol.for("graceful-fs.queue"),fN=Symbol.for("graceful-fs.previous")):(an="___graceful-fs.queue",fN="___graceful-fs.previous");function Lit(){}function fve(t,e){Object.defineProperty(t,an,{get:function(){return e}})}var xf=Lit;uN.debuglog?xf=uN.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(xf=function(){var t=uN.format.apply(uN,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
31
31
|
GFS4: `),console.error(t)});Kt[an]||(uve=global[an]||[],fve(Kt,uve),Kt.close=(function(t){function e(r,n){return t.call(Kt,r,function(i){i||dve(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,fN,{value:t}),e})(Kt.close),Kt.closeSync=(function(t){function e(r){t.apply(Kt,arguments),dve()}return Object.defineProperty(e,fN,{value:t}),e})(Kt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){xf(Kt[an]),Z("assert").equal(Kt[an].length,0)}));var uve;global[an]||fve(global,Kt[an]);E3.exports=y3(Dit(Kt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Kt.__patched&&(E3.exports=y3(Kt),Kt.__patched=!0);function y3(t){Mit(t),t.gracefulify=y3,t.createReadStream=A,t.createWriteStream=O;var e=t.readFile;t.readFile=r;function r(M,L,v){return typeof L=="function"&&(v=L,L=null),oe(M,L,v);function oe($,S,w,k){return e($,S,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?i_([oe,[$,S,w],Y,k||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(M,L,v,oe){return typeof v=="function"&&(oe=v,v=null),$(M,L,v,oe);function $(S,w,k,Y,H){return n(S,w,k,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?i_([$,[S,w,k,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(M,L,v,oe){return typeof v=="function"&&(oe=v,v=null),$(M,L,v,oe);function $(S,w,k,Y,H){return o(S,w,k,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?i_([$,[S,w,k,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=c);function c(M,L,v,oe){return typeof v=="function"&&(oe=v,v=0),$(M,L,v,oe);function $(S,w,k,Y,H){return a(S,w,k,function(he){he&&(he.code==="EMFILE"||he.code==="ENFILE")?i_([$,[S,w,k,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(M,L,v){typeof L=="function"&&(v=L,L=null);var oe=u.test(process.version)?function(w,k,Y,H){return l(w,$(w,k,Y,H))}:function(w,k,Y,H){return l(w,k,$(w,k,Y,H))};return oe(M,L,v);function $(S,w,k,Y){return function(H,he){H&&(H.code==="EMFILE"||H.code==="ENFILE")?i_([oe,[S,w,k],H,Y||Date.now(),Date.now()]):(he&&he.sort&&he.sort(),typeof k=="function"&&k.call(this,H,he))}}}if(process.version.substr(0,4)==="v0.8"){var f=$it(t);_=f.ReadStream,T=f.WriteStream}var p=t.ReadStream;p&&(_.prototype=Object.create(p.prototype),_.prototype.open=b);var h=t.WriteStream;h&&(T.prototype=Object.create(h.prototype),T.prototype.open=E),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(M){_=M},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return T},set:function(M){T=M},enumerable:!0,configurable:!0});var m=_;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(M){m=M},enumerable:!0,configurable:!0});var g=T;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(M){g=M},enumerable:!0,configurable:!0});function _(M,L){return this instanceof _?(p.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function b(){var M=this;N(M.path,M.flags,M.mode,function(L,v){L?(M.autoClose&&M.destroy(),M.emit("error",L)):(M.fd=v,M.emit("open",v),M.read())})}function T(M,L){return this instanceof T?(h.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function E(){var M=this;N(M.path,M.flags,M.mode,function(L,v){L?(M.destroy(),M.emit("error",L)):(M.fd=v,M.emit("open",v))})}function A(M,L){return new t.ReadStream(M,L)}function O(M,L){return new t.WriteStream(M,L)}var R=t.open;t.open=N;function N(M,L,v,oe){return typeof v=="function"&&(oe=v,v=null),$(M,L,v,oe);function $(S,w,k,Y,H){return R(S,w,k,function(he,je){he&&(he.code==="EMFILE"||he.code==="ENFILE")?i_([$,[S,w,k,Y],he,H||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}return t}function i_(t){xf("ENQUEUE",t[0].name,t[1]),Kt[an].push(t),S3()}var dN;function dve(){for(var t=Date.now(),e=0;e<Kt[an].length;++e)Kt[an][e].length>2&&(Kt[an][e][3]=t,Kt[an][e][4]=t);S3()}function S3(){if(clearTimeout(dN),dN=void 0,Kt[an].length!==0){var t=Kt[an].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)xf("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){xf("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,c=Math.max(o-i,1),l=Math.min(c*1.2,100);a>=l?(xf("RETRY",e.name,r),e.apply(null,r.concat([i]))):Kt[an].push(t)}dN===void 0&&(dN=setTimeout(S3,0))}}});var Rve=y(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.splitWhen=o_.flatten=void 0;function not(t){return t.reduce((e,r)=>[].concat(e,r),[])}o_.flatten=not;function iot(t,e){let r=[[]],n=0;for(let i of t)e(i)?(n++,r[n]=[]):r[n].push(i);return r}o_.splitWhen=iot});var Cve=y(hN=>{"use strict";Object.defineProperty(hN,"__esModule",{value:!0});hN.isEnoentCodeError=void 0;function oot(t){return t.code==="ENOENT"}hN.isEnoentCodeError=oot});var Ive=y(mN=>{"use strict";Object.defineProperty(mN,"__esModule",{value:!0});mN.createDirentFromStats=void 0;var I3=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function sot(t,e){return new I3(t,e)}mN.createDirentFromStats=sot});var kve=y(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.convertPosixPathToPattern=mr.convertWindowsPathToPattern=mr.convertPathToPattern=mr.escapePosixPath=mr.escapeWindowsPath=mr.escape=mr.removeLeadingDotSegment=mr.makeAbsolute=mr.unixify=void 0;var aot=Z("os"),cot=Z("path"),Pve=aot.platform()==="win32",lot=2,uot=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,dot=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,fot=/^\\\\([.?])/,pot=/\\(?![!()+@[\]{}])/g;function hot(t){return t.replace(/\\/g,"/")}mr.unixify=hot;function mot(t,e){return cot.resolve(t,e)}mr.makeAbsolute=mot;function got(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(lot)}return t}mr.removeLeadingDotSegment=got;mr.escape=Pve?P3:O3;function P3(t){return t.replace(dot,"\\$2")}mr.escapeWindowsPath=P3;function O3(t){return t.replace(uot,"\\$2")}mr.escapePosixPath=O3;mr.convertPathToPattern=Pve?Ove:Nve;function Ove(t){return P3(t).replace(fot,"//$1").replace(pot,"/")}mr.convertWindowsPathToPattern=Ove;function Nve(t){return O3(t)}mr.convertPosixPathToPattern=Nve});var $ve=y((Par,Mve)=>{"use strict";Mve.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Uve=y((Oar,Lve)=>{"use strict";var _ot=$ve(),Dve={"{":"}","(":")","[":"]"},yot=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,i=-2,o=-2,s=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(s===-1||s>n||(s=t.indexOf("\\",e),s===-1||s>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(s=t.indexOf("\\",e),s===-1||s>i))||o!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(o=t.indexOf(")",e),o>e&&(s=t.indexOf("\\",e),s===-1||s>o))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(o=t.indexOf(")",r),o>r&&(s=t.indexOf("\\",r),s===-1||s>o))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var c=Dve[a];if(c){var l=t.indexOf(c,e);l!==-1&&(e=l+1)}if(t[e]==="!")return!0}else e++}return!1},Sot=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=Dve[r];if(n){var i=t.indexOf(n,e);i!==-1&&(e=i+1)}if(t[e]==="!")return!0}else e++}return!1};Lve.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(_ot(e))return!0;var n=yot;return r&&r.strict===!1&&(n=Sot),n(e)}});var zve=y((Nar,Fve)=>{"use strict";var Eot=Uve(),vot=Z("path").posix.dirname,bot=Z("os").platform()==="win32",N3="/",Tot=/\\/g,wot=/[\{\[].*[\}\]]$/,Aot=/(^|[^\\])([\{\[]|\([^\)]+$)/,xot=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Fve.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&bot&&e.indexOf(N3)<0&&(e=e.replace(Tot,N3)),wot.test(e)&&(e+=N3),e+="a";do e=vot(e);while(Eot(e)||Aot.test(e));return e.replace(xot,"$1")}});var gN=y(ao=>{"use strict";ao.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;ao.find=(t,e)=>t.nodes.find(r=>r.type===e);ao.exceedsLimit=(t,e,r=1,n)=>n===!1||!ao.isInteger(t)||!ao.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;ao.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ao.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;ao.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;ao.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;ao.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);ao.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let o=n[i];if(Array.isArray(o)){r(o);continue}o!==void 0&&e.push(o)}return e};return r(t),e}});var _N=y((Mar,Bve)=>{"use strict";var jve=gN();Bve.exports=(t,e={})=>{let r=(n,i={})=>{let o=e.escapeInvalid&&jve.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(o||s)&&jve.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=r(c);return a};return r(t)}});var Vve=y(($ar,qve)=>{"use strict";qve.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Qve=y((Dar,Xve)=>{"use strict";var Gve=Vve(),Cf=(t,e,r)=>{if(Gve(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Gve(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),o=String(n.shorthand),s=String(n.capture),a=String(n.wrap),c=t+":"+e+"="+i+o+s+a;if(Cf.cache.hasOwnProperty(c))return Cf.cache[c].result;let l=Math.min(t,e),u=Math.max(t,e);if(Math.abs(l-u)===1){let m=t+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let d=Jve(t)||Jve(e),f={min:t,max:e,a:l,b:u},p=[],h=[];if(d&&(f.isPadded=d,f.maxLen=String(f.max).length),l<0){let m=u<0?Math.abs(u):1;h=Hve(m,Math.abs(l),f,n),l=f.a=0}return u>=0&&(p=Hve(l,u,f,n)),f.negatives=h,f.positives=p,f.result=Rot(h,p,n),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&p.length+h.length>1&&(f.result=`(?:${f.result})`),Cf.cache[c]=f,f.result};function Rot(t,e,r){let n=k3(t,e,"-",!1,r)||[],i=k3(e,t,"",!1,r)||[],o=k3(t,e,"-?",!0,r)||[];return n.concat(o).concat(i).join("|")}function Cot(t,e){let r=1,n=1,i=Yve(t,r),o=new Set([e]);for(;t<=i&&i<=e;)o.add(i),r+=1,i=Yve(t,r);for(i=Kve(e+1,n)-1;t<i&&i<=e;)o.add(i),n+=1,i=Kve(e+1,n)-1;return o=[...o],o.sort(Oot),o}function Iot(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=Pot(t,e),i=n.length,o="",s=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?o+=c:c!=="0"||l!=="9"?o+=Not(c,l,r):s++}return s&&(o+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:o,count:[s],digits:i}}function Hve(t,e,r,n){let i=Cot(t,e),o=[],s=t,a;for(let c=0;c<i.length;c++){let l=i[c],u=Iot(String(s),String(l),n),d="";if(!r.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Zve(a.count),s=l+1;continue}r.isPadded&&(d=kot(l,r,n)),u.string=d+u.pattern+Zve(u.count),o.push(u),s=l+1,a=u}return o}function k3(t,e,r,n,i){let o=[];for(let s of t){let{string:a}=s;!n&&!Wve(e,"string",a)&&o.push(r+a),n&&Wve(e,"string",a)&&o.push(r+a)}return o}function Pot(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Oot(t,e){return t>e?1:e>t?-1:0}function Wve(t,e,r){return t.some(n=>n[e]===r)}function Yve(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Kve(t,e){return t-t%Math.pow(10,e)}function Zve(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Not(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function Jve(t){return/^-?(0+)\d/.test(t)}function kot(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Cf.cache={};Cf.clearCache=()=>Cf.cache={};Xve.exports=Cf});var D3=y((Lar,sbe)=>{"use strict";var Mot=Z("util"),tbe=Qve(),ebe=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),$ot=t=>e=>t===!0?Number(e):String(e),M3=t=>typeof t=="number"||typeof t=="string"&&t!=="",Bb=t=>Number.isInteger(+t),$3=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},Dot=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Lot=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},SN=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},Uot=(t,e,r)=>{t.negatives.sort((a,c)=>a<c?-1:a>c?1:0),t.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",o="",s;return t.positives.length&&(i=t.positives.map(a=>SN(String(a),r)).join("|")),t.negatives.length&&(o=`-(${n}${t.negatives.map(a=>SN(String(a),r)).join("|")})`),i&&o?s=`${i}|${o}`:s=i||o,e.wrap?`(${n}${s})`:s},rbe=(t,e,r,n)=>{if(r)return tbe(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let o=String.fromCharCode(e);return`[${i}-${o}]`},nbe=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return tbe(t,e,r)},ibe=(...t)=>new RangeError("Invalid range arguments: "+Mot.inspect(...t)),obe=(t,e,r)=>{if(r.strictRanges===!0)throw ibe([t,e]);return[]},Fot=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},zot=(t,e,r=1,n={})=>{let i=Number(t),o=Number(e);if(!Number.isInteger(i)||!Number.isInteger(o)){if(n.strictRanges===!0)throw ibe([t,e]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,a=String(t),c=String(e),l=String(r);r=Math.max(Math.abs(r),1);let u=$3(a)||$3(c)||$3(l),d=u?Math.max(a.length,c.length,l.length):0,f=u===!1&&Dot(t,e,n)===!1,p=n.transform||$ot(f);if(n.toRegex&&r===1)return rbe(SN(t,d),SN(e,d),!0,n);let h={negatives:[],positives:[]},m=b=>h[b<0?"negatives":"positives"].push(Math.abs(b)),g=[],_=0;for(;s?i>=o:i<=o;)n.toRegex===!0&&r>1?m(i):g.push(Lot(p(i,_),d,f)),i=s?i-r:i+r,_++;return n.toRegex===!0?r>1?Uot(h,n,d):nbe(g,null,{wrap:!1,...n}):g},jot=(t,e,r=1,n={})=>{if(!Bb(t)&&t.length>1||!Bb(e)&&e.length>1)return obe(t,e,n);let i=n.transform||(f=>String.fromCharCode(f)),o=`${t}`.charCodeAt(0),s=`${e}`.charCodeAt(0),a=o>s,c=Math.min(o,s),l=Math.max(o,s);if(n.toRegex&&r===1)return rbe(c,l,!1,n);let u=[],d=0;for(;a?o>=s:o<=s;)u.push(i(o,d)),o=a?o-r:o+r,d++;return n.toRegex===!0?nbe(u,null,{wrap:!1,options:n}):u},yN=(t,e,r,n={})=>{if(e==null&&M3(t))return[t];if(!M3(t)||!M3(e))return obe(t,e,n);if(typeof r=="function")return yN(t,e,1,{transform:r});if(ebe(r))return yN(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,Bb(r)?Bb(t)&&Bb(e)?zot(t,e,r,i):jot(t,e,Math.max(Math.abs(r),1),i):r!=null&&!ebe(r)?Fot(r,i):yN(t,e,1,r)};sbe.exports=yN});var lbe=y((Uar,cbe)=>{"use strict";var Bot=D3(),abe=gN(),qot=(t,e={})=>{let r=(n,i={})=>{let o=abe.isInvalidBrace(i),s=n.invalid===!0&&e.escapeInvalid===!0,a=o===!0||s===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=abe.reduce(n.nodes),d=Bot(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(d.length!==0)return u.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let u of n.nodes)l+=r(u,n);return l};return r(t)};cbe.exports=qot});var fbe=y((Far,dbe)=>{"use strict";var Vot=D3(),ube=_N(),s_=gN(),If=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?s_.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let o of i)n.push(If(o,e,r));else for(let o of e)r===!0&&typeof o=="string"&&(o=`{${o}}`),n.push(Array.isArray(o)?If(i,o,r):i+o);return s_.flatten(n)},Got=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,o={})=>{i.queue=[];let s=o,a=o.queue;for(;s.type!=="brace"&&s.type!=="root"&&s.parent;)s=s.parent,a=s.queue;if(i.invalid||i.dollar){a.push(If(a.pop(),ube(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(If(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let d=s_.reduce(i.nodes);if(s_.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Vot(...d,e);f.length===0&&(f=ube(i,e)),a.push(If(a.pop(),f)),i.nodes=[];return}let c=s_.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let d=0;d<i.nodes.length;d++){let f=i.nodes[d];if(f.type==="comma"&&i.type==="brace"){d===1&&l.push(""),l.push("");continue}if(f.type==="close"){a.push(If(a.pop(),l,c));continue}if(f.value&&f.type!=="open"){l.push(If(l.pop(),f.value));continue}f.nodes&&n(f,i)}return l};return s_.flatten(n(t))};dbe.exports=Got});var hbe=y((zar,pbe)=>{"use strict";pbe.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
32
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Sbe=y((jar,ybe)=>{"use strict";var Hot=_N(),{MAX_LENGTH:mbe,CHAR_BACKSLASH:L3,CHAR_BACKTICK:Wot,CHAR_COMMA:Yot,CHAR_DOT:Kot,CHAR_LEFT_PARENTHESES:Zot,CHAR_RIGHT_PARENTHESES:Jot,CHAR_LEFT_CURLY_BRACE:Xot,CHAR_RIGHT_CURLY_BRACE:Qot,CHAR_LEFT_SQUARE_BRACKET:gbe,CHAR_RIGHT_SQUARE_BRACKET:_be,CHAR_DOUBLE_QUOTE:est,CHAR_SINGLE_QUOTE:tst,CHAR_NO_BREAK_SPACE:rst,CHAR_ZERO_WIDTH_NOBREAK_SPACE:nst}=hbe(),ist=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(mbe,r.maxLength):mbe;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},o=[i],s=i,a=i,c=0,l=t.length,u=0,d=0,f,p=()=>t[u++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(s=o[o.length-1],f=p(),!(f===nst||f===rst)){if(f===L3){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===_be){h({type:"text",value:"\\"+f});continue}if(f===gbe){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===gbe){c++;continue}if(m===L3){f+=p();continue}if(m===_be&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===Zot){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:f});continue}if(f===Jot){if(s.type!=="paren"){h({type:"text",value:f});continue}s=o.pop(),h({type:"text",value:f}),s=o[o.length-1];continue}if(f===est||f===tst||f===Wot){let m=f,g;for(e.keepQuotes!==!0&&(f="");u<l&&(g=p());){if(g===L3){f+=g+p();continue}if(g===m){e.keepQuotes===!0&&(f+=g);break}f+=g}h({type:"text",value:f});continue}if(f===Xot){d++;let g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=h(g),o.push(s),h({type:"open",value:f});continue}if(f===Qot){if(s.type!=="brace"){h({type:"text",value:f});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:f}),d--,s=o[o.length-1];continue}if(f===Yot&&d>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Hot(s)}]}h({type:"comma",value:f}),s.commas++;continue}if(f===Kot&&d>0&&s.commas===0){let m=s.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let g=m[m.length-1];g.value+=a.value+f,a=g,s.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(_=>{_.nodes||(_.type==="open"&&(_.isOpen=!0),_.type==="close"&&(_.isClose=!0),_.nodes||(_.type="text"),_.invalid=!0)});let m=o[o.length-1],g=m.nodes.indexOf(s);m.nodes.splice(g,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};ybe.exports=ist});var bbe=y((Bar,vbe)=>{"use strict";var Ebe=_N(),ost=lbe(),sst=fbe(),ast=Sbe(),Oi=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Oi.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Oi.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.parse=(t,e={})=>ast(t,e);Oi.stringify=(t,e={})=>Ebe(typeof t=="string"?Oi.parse(t,e):t,e);Oi.compile=(t,e={})=>(typeof t=="string"&&(t=Oi.parse(t,e)),ost(t,e));Oi.expand=(t,e={})=>{typeof t=="string"&&(t=Oi.parse(t,e));let r=sst(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Oi.compile(t,e):Oi.expand(t,e);vbe.exports=Oi});var qb=y((qar,Rbe)=>{"use strict";var cst=Z("path"),ra="\\\\/",Tbe=`[^${ra}]`,lst=0,Sc="\\.",ust="\\+",dst="\\?",EN="\\/",fst="(?=.)",wbe="[^/]",U3=`(?:${EN}|$)`,Abe=`(?:^|${EN})`,F3=`${Sc}{1,2}${U3}`,pst=`(?!${Sc})`,hst=`(?!${Abe}${F3})`,mst=`(?!${Sc}{0,1}${U3})`,gst=`(?!${F3})`,_st=`[^.${EN}]`,yst=`${wbe}*?`,xbe={DOT_LITERAL:Sc,PLUS_LITERAL:ust,QMARK_LITERAL:dst,SLASH_LITERAL:EN,ONE_CHAR:fst,QMARK:wbe,END_ANCHOR:U3,DOTS_SLASH:F3,NO_DOT:pst,NO_DOTS:hst,NO_DOT_SLASH:mst,NO_DOTS_SLASH:gst,QMARK_NO_DOT:_st,STAR:yst,START_ANCHOR:Abe},Sst={...xbe,SLASH_LITERAL:`[${ra}]`,QMARK:Tbe,STAR:`${Tbe}*?`,DOTS_SLASH:`${Sc}{1,2}(?:[${ra}]|$)`,NO_DOT:`(?!${Sc})`,NO_DOTS:`(?!(?:^|[${ra}])${Sc}{1,2}(?:[${ra}]|$))`,NO_DOT_SLASH:`(?!${Sc}{0,1}(?:[${ra}]|$))`,NO_DOTS_SLASH:`(?!${Sc}{1,2}(?:[${ra}]|$))`,QMARK_NO_DOT:`[^.${ra}]`,START_ANCHOR:`(?:^|[${ra}])`,END_ANCHOR:`(?:[${ra}]|$)`},Est={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Rbe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:lst,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Est,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:cst.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Sst:xbe}}});var Vb=y(ci=>{"use strict";var vst=Z("path"),bst=process.platform==="win32",{REGEX_BACKSLASH:Tst,REGEX_REMOVE_BACKSLASH:wst,REGEX_SPECIAL_CHARS:Ast,REGEX_SPECIAL_CHARS_GLOBAL:xst}=qb();ci.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ci.hasRegexChars=t=>Ast.test(t);ci.isRegexChar=t=>t.length===1&&ci.hasRegexChars(t);ci.escapeRegex=t=>t.replace(xst,"\\$1");ci.toPosixSlashes=t=>t.replace(Tst,"/");ci.removeBackslashes=t=>t.replace(wst,e=>e==="\\"?"":e);ci.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ci.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:bst===!0||vst.sep==="\\";ci.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?ci.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};ci.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ci.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var $be=y((Gar,Mbe)=>{"use strict";var Cbe=Vb(),{CHAR_ASTERISK:z3,CHAR_AT:Rst,CHAR_BACKWARD_SLASH:Gb,CHAR_COMMA:Cst,CHAR_DOT:j3,CHAR_EXCLAMATION_MARK:B3,CHAR_FORWARD_SLASH:kbe,CHAR_LEFT_CURLY_BRACE:q3,CHAR_LEFT_PARENTHESES:V3,CHAR_LEFT_SQUARE_BRACKET:Ist,CHAR_PLUS:Pst,CHAR_QUESTION_MARK:Ibe,CHAR_RIGHT_CURLY_BRACE:Ost,CHAR_RIGHT_PARENTHESES:Pbe,CHAR_RIGHT_SQUARE_BRACKET:Nst}=qb(),Obe=t=>t===kbe||t===Gb,Nbe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},kst=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,g=!1,_=!1,b=!1,T=!1,E=!1,A=!1,O=0,R,N,M={value:"",depth:0,isGlob:!1},L=()=>l>=n,v=()=>c.charCodeAt(l+1),oe=()=>(R=N,c.charCodeAt(++l));for(;l<n;){N=oe();let Y;if(N===Gb){b=M.backslashes=!0,N=oe(),N===q3&&(_=!0);continue}if(_===!0||N===q3){for(O++;L()!==!0&&(N=oe());){if(N===Gb){b=M.backslashes=!0,oe();continue}if(N===q3){O++;continue}if(_!==!0&&N===j3&&(N=oe())===j3){if(f=M.isBrace=!0,h=M.isGlob=!0,A=!0,i===!0)continue;break}if(_!==!0&&N===Cst){if(f=M.isBrace=!0,h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ost&&(O--,O===0)){_=!1,f=M.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(N===kbe){if(o.push(l),s.push(M),M={value:"",depth:0,isGlob:!1},A===!0)continue;if(R===j3&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(N===Pst||N===Rst||N===z3||N===Ibe||N===B3)===!0&&v()===V3){if(h=M.isGlob=!0,m=M.isExtglob=!0,A=!0,N===B3&&l===u&&(E=!0),i===!0){for(;L()!==!0&&(N=oe());){if(N===Gb){b=M.backslashes=!0,N=oe();continue}if(N===Pbe){h=M.isGlob=!0,A=!0;break}}continue}break}if(N===z3){if(R===z3&&(g=M.isGlobstar=!0),h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ibe){if(h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ist){for(;L()!==!0&&(Y=oe());){if(Y===Gb){b=M.backslashes=!0,oe();continue}if(Y===Nst){p=M.isBracket=!0,h=M.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&N===B3&&l===u){T=M.negated=!0,u++;continue}if(r.noparen!==!0&&N===V3){if(h=M.isGlob=!0,i===!0){for(;L()!==!0&&(N=oe());){if(N===V3){b=M.backslashes=!0,N=oe();continue}if(N===Pbe){A=!0;break}}continue}break}if(h===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let $=c,S="",w="";u>0&&(S=c.slice(0,u),c=c.slice(u),d-=u),$&&h===!0&&d>0?($=c.slice(0,d),w=c.slice(d)):h===!0?($="",w=c):$=c,$&&$!==""&&$!=="/"&&$!==c&&Obe($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(w&&(w=Cbe.removeBackslashes(w)),$&&b===!0&&($=Cbe.removeBackslashes($)));let k={prefix:S,input:t,start:u,base:$,glob:w,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:E};if(r.tokens===!0&&(k.maxDepth=0,Obe(N)||s.push(M),k.tokens=s),r.parts===!0||r.tokens===!0){let Y;for(let H=0;H<o.length;H++){let he=Y?Y+1:u,je=o[H],Ie=t.slice(he,je);r.tokens&&(H===0&&u!==0?(s[H].isPrefix=!0,s[H].value=S):s[H].value=Ie,Nbe(s[H]),k.maxDepth+=s[H].depth),(H!==0||Ie!=="")&&a.push(Ie),Y=je}if(Y&&Y+1<t.length){let H=t.slice(Y+1);a.push(H),r.tokens&&(s[s.length-1].value=H,Nbe(s[s.length-1]),k.maxDepth+=s[s.length-1].depth)}k.slashes=o,k.parts=a}return k};Mbe.exports=kst});var zbe=y((Har,Fbe)=>{"use strict";var Hb=qb(),Sn=Vb(),{MAX_LENGTH:vN,POSIX_REGEX_SOURCE:Mst,REGEX_NON_SPECIAL_CHARS:$st,REGEX_SPECIAL_CHARS_BACKREF:Dst,REPLACEMENTS:Dbe}=Hb,Lst=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Sn.escapeRegex(i)).join("..")}return r},a_=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Lbe=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Ust=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Ube=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Ust(e))return e.replace(/\\(.)/g,"$1")},Fst=t=>{let e=t.map(Ube).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],o=e[n],s=i[0];if(!(!s||i!==s.repeat(i.length)||o!==s.repeat(o.length))&&(i===o||i.startsWith(o)||o.startsWith(i)))return!0}return!1},G3=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s<t.length;s++){let a=t[s];if(o===!0){o=!1;continue}if(a==="\\"){o=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},zst=t=>{let e=0,r=[];for(;e<t.length;){let i=G3(t.slice(e),!1);if(!i||i.type!=="*")return;let o=Lbe(i.body).map(a=>a.trim());if(o.length!==1)return;let s=Ube(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Sn.escapeRegex(r[0]):`[${r.map(i=>Sn.escapeRegex(i)).join("")}]`}*`},jst=t=>{let e=0,r=t.trim(),n=G3(r);for(;n;)e++,r=n.body.trim(),n=G3(r);return e},Bst=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Hb.DEFAULT_MAX_EXTGLOB_RECURSION,n=Lbe(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Fst(n)))return{risky:!0};for(let i of n){let o=zst(i);if(o)return{risky:!0,safeOutput:o};if(jst(i)>r)return{risky:!0}}return{risky:!1}},H3=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Dbe[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(vN,r.maxLength):vN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=Sn.isWindows(e),l=Hb.globChars(c),u=Hb.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:b,QMARK:T,QMARK_NO_DOT:E,STAR:A,START_ANCHOR:O}=l,R=re=>`(${a}(?:(?!${O}${re.dot?m:d}).)*?)`,N=r.dot?"":g,M=r.dot?T:E,L=r.bash===!0?R(r):A;r.capture&&(L=`(${L})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let v={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Sn.removePrefix(t,v),i=t.length;let oe=[],$=[],S=[],w=o,k,Y=()=>v.index===i-1,H=v.peek=(re=1)=>t[v.index+re],he=v.advance=()=>t[++v.index]||"",je=()=>t.slice(v.index+1),Ie=(re="",qe=0)=>{v.consumed+=re,v.index+=qe},$e=re=>{v.output+=re.output!=null?re.output:re.value,Ie(re.value)},Oe=()=>{let re=1;for(;H()==="!"&&(H(2)!=="("||H(3)==="?");)he(),v.start++,re++;return re%2===0?!1:(v.negated=!0,v.start++,!0)},Je=re=>{v[re]++,S.push(re)},Ne=re=>{v[re]--,S.pop()},le=re=>{if(w.type==="globstar"){let qe=v.braces>0&&(re.type==="comma"||re.type==="brace"),z=re.extglob===!0||oe.length&&(re.type==="pipe"||re.type==="paren");re.type!=="slash"&&re.type!=="paren"&&!qe&&!z&&(v.output=v.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=L,v.output+=w.output)}if(oe.length&&re.type!=="paren"&&(oe[oe.length-1].inner+=re.value),(re.value||re.output)&&$e(re),w&&w.type==="text"&&re.type==="text"){w.value+=re.value,w.output=(w.output||"")+re.value;return}re.prev=w,s.push(re),w=re},me=(re,qe)=>{let z={...u[qe],conditions:1,inner:""};z.prev=w,z.parens=v.parens,z.output=v.output,z.startIndex=v.index,z.tokensIndex=s.length;let x=(r.capture?"(":"")+z.open;Je("parens"),le({type:re,value:qe,output:v.output?"":h}),le({type:"paren",extglob:!0,value:he(),output:x}),oe.push(z)},nt=re=>{let qe=t.slice(re.startIndex,v.index+1),z=t.slice(re.startIndex+2,v.index),x=Bst(z,r);if((re.type==="plus"||re.type==="star")&&x.risky){let B=x.safeOutput?(re.output?"":h)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,te=s[re.tokensIndex];te.type="text",te.value=qe,te.output=B||Sn.escapeRegex(qe);for(let ie=re.tokensIndex+1;ie<s.length;ie++)s[ie].value="",s[ie].output="",delete s[ie].suffix;v.output=re.output+te.output,v.backtrack=!0,le({type:"paren",extglob:!0,value:k,output:""}),Ne("parens");return}let I=re.close+(r.capture?")":""),j;if(re.type==="negate"){let B=L;if(re.inner&&re.inner.length>1&&re.inner.includes("/")&&(B=R(r)),(B!==L||Y()||/^\)+$/.test(je()))&&(I=re.close=`)$))${B}`),re.inner.includes("*")&&(j=je())&&/^\.[^\\/.]+$/.test(j)){let te=H3(j,{...e,fastpaths:!1}).output;I=re.close=`)${te})${B})`}re.prev.type==="bos"&&(v.negatedExtglob=!0)}le({type:"paren",extglob:!0,value:k,output:I}),Ne("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let re=!1,qe=t.replace(Dst,(z,x,I,j,B,te)=>j==="\\"?(re=!0,z):j==="?"?x?x+j+(B?T.repeat(B.length):""):te===0?M+(B?T.repeat(B.length):""):T.repeat(I.length):j==="."?d.repeat(I.length):j==="*"?x?x+j+(B?L:""):L:x?z:`\\${z}`);return re===!0&&(r.unescape===!0?qe=qe.replace(/\\/g,""):qe=qe.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),qe===t&&r.contains===!0?(v.output=t,v):(v.output=Sn.wrapOutput(qe,v,e),v)}for(;!Y();){if(k=he(),k==="\0")continue;if(k==="\\"){let z=H();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){k+="\\",le({type:"text",value:k});continue}let x=/^\\+/.exec(je()),I=0;if(x&&x[0].length>2&&(I=x[0].length,v.index+=I,I%2!==0&&(k+="\\")),r.unescape===!0?k=he():k+=he(),v.brackets===0){le({type:"text",value:k});continue}}if(v.brackets>0&&(k!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&k===":"){let z=w.value.slice(1);if(z.includes("[")&&(w.posix=!0,z.includes(":"))){let x=w.value.lastIndexOf("["),I=w.value.slice(0,x),j=w.value.slice(x+2),B=Mst[j];if(B){w.value=I+B,v.backtrack=!0,he(),!o.output&&s.indexOf(w)===1&&(o.output=h);continue}}}(k==="["&&H()!==":"||k==="-"&&H()==="]")&&(k=`\\${k}`),k==="]"&&(w.value==="["||w.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&w.value==="["&&(k="^"),w.value+=k,$e({value:k});continue}if(v.quotes===1&&k!=='"'){k=Sn.escapeRegex(k),w.value+=k,$e({value:k});continue}if(k==='"'){v.quotes=v.quotes===1?0:1,r.keepQuotes===!0&&le({type:"text",value:k});continue}if(k==="("){Je("parens"),le({type:"paren",value:k});continue}if(k===")"){if(v.parens===0&&r.strictBrackets===!0)throw new SyntaxError(a_("opening","("));let z=oe[oe.length-1];if(z&&v.parens===z.parens+1){nt(oe.pop());continue}le({type:"paren",value:k,output:v.parens?")":"\\)"}),Ne("parens");continue}if(k==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(a_("closing","]"));k=`\\${k}`}else Je("brackets");le({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){le({type:"text",value:k,output:`\\${k}`});continue}if(v.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(a_("opening","["));le({type:"text",value:k,output:`\\${k}`});continue}Ne("brackets");let z=w.value.slice(1);if(w.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(k=`/${k}`),w.value+=k,$e({value:k}),r.literalBrackets===!1||Sn.hasRegexChars(z))continue;let x=Sn.escapeRegex(w.value);if(v.output=v.output.slice(0,-w.value.length),r.literalBrackets===!0){v.output+=x,w.value=x;continue}w.value=`(${a}${x}|${w.value})`,v.output+=w.value;continue}if(k==="{"&&r.nobrace!==!0){Je("braces");let z={type:"brace",value:k,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};$.push(z),le(z);continue}if(k==="}"){let z=$[$.length-1];if(r.nobrace===!0||!z){le({type:"text",value:k,output:k});continue}let x=")";if(z.dots===!0){let I=s.slice(),j=[];for(let B=I.length-1;B>=0&&(s.pop(),I[B].type!=="brace");B--)I[B].type!=="dots"&&j.unshift(I[B].value);x=Lst(j,r),v.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let I=v.output.slice(0,z.outputIndex),j=v.tokens.slice(z.tokensIndex);z.value=z.output="\\{",k=x="\\}",v.output=I;for(let B of j)v.output+=B.output||B.value}le({type:"brace",value:k,output:x}),Ne("braces"),$.pop();continue}if(k==="|"){oe.length>0&&oe[oe.length-1].conditions++,le({type:"text",value:k});continue}if(k===","){let z=k,x=$[$.length-1];x&&S[S.length-1]==="braces"&&(x.comma=!0,z="|"),le({type:"comma",value:k,output:z});continue}if(k==="/"){if(w.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",s.pop(),w=o;continue}le({type:"slash",value:k,output:p});continue}if(k==="."){if(v.braces>0&&w.type==="dot"){w.value==="."&&(w.output=d);let z=$[$.length-1];w.type="dots",w.output+=k,w.value+=k,z.dots=!0;continue}if(v.braces+v.parens===0&&w.type!=="bos"&&w.type!=="slash"){le({type:"text",value:k,output:d});continue}le({type:"dot",value:k,output:d});continue}if(k==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("qmark",k);continue}if(w&&w.type==="paren"){let x=H(),I=k;if(x==="<"&&!Sn.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(je()))&&(I=`\\${k}`),le({type:"text",value:k,output:I});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){le({type:"qmark",value:k,output:E});continue}le({type:"qmark",value:k,output:T});continue}if(k==="!"){if(r.noextglob!==!0&&H()==="("&&(H(2)!=="?"||!/[!=<:]/.test(H(3)))){me("negate",k);continue}if(r.nonegate!==!0&&v.index===0){Oe();continue}}if(k==="+"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("plus",k);continue}if(w&&w.value==="("||r.regex===!1){le({type:"plus",value:k,output:f});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||v.parens>0){le({type:"plus",value:k});continue}le({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){le({type:"at",extglob:!0,value:k,output:""});continue}le({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let z=$st.exec(je());z&&(k+=z[0],v.index+=z[0].length),le({type:"text",value:k});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=k,w.output=L,v.backtrack=!0,v.globstar=!0,Ie(k);continue}let re=je();if(r.noextglob!==!0&&/^\([^?]/.test(re)){me("star",k);continue}if(w.type==="star"){if(r.noglobstar===!0){Ie(k);continue}let z=w.prev,x=z.prev,I=z.type==="slash"||z.type==="bos",j=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!I||re[0]&&re[0]!=="/")){le({type:"star",value:k,output:""});continue}let B=v.braces>0&&(z.type==="comma"||z.type==="brace"),te=oe.length&&(z.type==="pipe"||z.type==="paren");if(!I&&z.type!=="paren"&&!B&&!te){le({type:"star",value:k,output:""});continue}for(;re.slice(0,3)==="/**";){let ie=t[v.index+4];if(ie&&ie!=="/")break;re=re.slice(3),Ie("/**",3)}if(z.type==="bos"&&Y()){w.type="globstar",w.value+=k,w.output=R(r),v.output=w.output,v.globstar=!0,Ie(k);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!j&&Y()){v.output=v.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=R(r)+(r.strictSlashes?")":"|$)"),w.value+=k,v.globstar=!0,v.output+=z.output+w.output,Ie(k);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&re[0]==="/"){let ie=re[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=`${R(r)}${p}|${p}${ie})`,w.value+=k,v.output+=z.output+w.output,v.globstar=!0,Ie(k+he()),le({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&re[0]==="/"){w.type="globstar",w.value+=k,w.output=`(?:^|${p}|${R(r)}${p})`,v.output=w.output,v.globstar=!0,Ie(k+he()),le({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-w.output.length),w.type="globstar",w.output=R(r),w.value+=k,v.output+=w.output,v.globstar=!0,Ie(k);continue}let qe={type:"star",value:k,output:L};if(r.bash===!0){qe.output=".*?",(w.type==="bos"||w.type==="slash")&&(qe.output=N+qe.output),le(qe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){qe.output=k,le(qe);continue}(v.index===v.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(v.output+=_,w.output+=_):r.dot===!0?(v.output+=b,w.output+=b):(v.output+=N,w.output+=N),H()!=="*"&&(v.output+=h,w.output+=h)),le(qe)}for(;v.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing","]"));v.output=Sn.escapeLast(v.output,"["),Ne("brackets")}for(;v.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing",")"));v.output=Sn.escapeLast(v.output,"("),Ne("parens")}for(;v.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing","}"));v.output=Sn.escapeLast(v.output,"{"),Ne("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&le({type:"maybe_slash",value:"",output:`${p}?`}),v.backtrack===!0){v.output="";for(let re of v.tokens)v.output+=re.output!=null?re.output:re.value,re.suffix&&(v.output+=re.suffix)}return v};H3.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(vN,r.maxLength):vN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=Dbe[t]||t;let o=Sn.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=Hb.globChars(o),m=r.dot?d:u,g=r.dot?f:u,_=r.capture?"":"?:",b={negated:!1,prefix:""},T=r.bash===!0?".*?":p;r.capture&&(T=`(${T})`);let E=N=>N.noglobstar===!0?T:`(${_}(?:(?!${h}${N.dot?l:s}).)*?)`,A=N=>{switch(N){case"*":return`${m}${c}${T}`;case".*":return`${s}${c}${T}`;case"*.*":return`${m}${T}${s}${c}${T}`;case"*/*":return`${m}${T}${a}${c}${g}${T}`;case"**":return m+E(r);case"**/*":return`(?:${m}${E(r)}${a})?${g}${c}${T}`;case"**/*.*":return`(?:${m}${E(r)}${a})?${g}${T}${s}${c}${T}`;case"**/.*":return`(?:${m}${E(r)}${a})?${s}${c}${T}`;default:{let M=/^(.*?)\.(\w+)$/.exec(N);if(!M)return;let L=A(M[1]);return L?L+s+M[2]:void 0}}},O=Sn.removePrefix(t,b),R=A(O);return R&&r.strictSlashes!==!0&&(R+=`${a}?`),R};Fbe.exports=H3});var Bbe=y((War,jbe)=>{"use strict";var qst=Z("path"),Vst=$be(),W3=zbe(),Y3=Vb(),Gst=qb(),Hst=t=>t&&typeof t=="object"&&!Array.isArray(t),cr=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>cr(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Hst(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=Y3.isWindows(e),s=n?cr.compileRe(t,e):cr.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=cr(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=cr.test(u,s,e,{glob:t,posix:o}),m={glob:t,state:a,regex:s,posix:o,input:u,output:h,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(m),f===!1?(m.isMatch=!1,d?m:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,d?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),d?m:!0)};return r&&(l.state=a),l};cr.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?Y3.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=cr.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};cr.matchBase=(t,e,r,n=Y3.isWindows(r))=>(e instanceof RegExp?e:cr.makeRe(e,r)).test(qst.basename(t));cr.isMatch=(t,e,r)=>cr(e,r)(t);cr.parse=(t,e)=>Array.isArray(t)?t.map(r=>cr.parse(r,e)):W3(t,{...e,fastpaths:!1});cr.scan=(t,e)=>Vst(t,e);cr.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=cr.toRegex(a,e);return n===!0&&(c.state=t),c};cr.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=W3.fastpaths(t,e)),i.output||(i=W3(t,e)),cr.compileRe(i,e,r,n)};cr.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};cr.constants=Gst;jbe.exports=cr});var Vbe=y((Yar,qbe)=>{"use strict";qbe.exports=Bbe()});var Z3=y((Kar,Kbe)=>{"use strict";var Hbe=Z("util"),Wbe=bbe(),na=Vbe(),K3=Vb(),Gbe=t=>t===""||t==="./",Ybe=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Vt=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,o=new Set,s=0,a=u=>{o.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=na(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&s++;for(let p of t){let h=d(p,!0);(f?!h.isMatch:h.isMatch)&&(f?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let l=(s===e.length?[...o]:[...i]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(u=>u.replace(/\\/g,"")):e}return l};Vt.match=Vt;Vt.matcher=(t,e)=>na(t,e);Vt.isMatch=(t,e,r)=>na(e,r)(t);Vt.any=Vt.isMatch;Vt.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{r.onResult&&r.onResult(a),i.push(a.output)},s=new Set(Vt(t,e,{...r,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Vt.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Hbe.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Vt.contains(t,n,r));if(typeof e=="string"){if(Gbe(t)||Gbe(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Vt.isMatch(t,e,{...r,contains:!0})};Vt.matchKeys=(t,e,r)=>{if(!K3.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Vt(Object.keys(t),e,r),i={};for(let o of n)i[o]=t[o];return i};Vt.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=na(String(i),r);if(n.some(s=>o(s)))return!0}return!1};Vt.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=na(String(i),r);if(!n.every(s=>o(s)))return!1}return!0};Vt.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Hbe.inspect(t)}"`);return[].concat(e).every(n=>na(n,r)(t))};Vt.capture=(t,e,r)=>{let n=K3.isWindows(r),o=na.makeRe(String(t),{...r,capture:!0}).exec(n?K3.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Vt.makeRe=(...t)=>na.makeRe(...t);Vt.scan=(...t)=>na.scan(...t);Vt.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Wbe(String(n),e))r.push(na.parse(i,e));return r};Vt.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Ybe(t)?[t]:Wbe(t,e)};Vt.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Vt.braces(t,{...e,expand:!0})};Vt.hasBraces=Ybe;Kbe.exports=Vt});var oTe=y(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isAbsolute=ke.partitionAbsoluteAndRelative=ke.removeDuplicateSlashes=ke.matchAny=ke.convertPatternsToRe=ke.makeRe=ke.getPatternParts=ke.expandBraceExpansion=ke.expandPatternsWithBraceExpansion=ke.isAffectDepthOfReadingPattern=ke.endsWithSlashGlobStar=ke.hasGlobStar=ke.getBaseDirectory=ke.isPatternRelatedToParentDirectory=ke.getPatternsOutsideCurrentDirectory=ke.getPatternsInsideCurrentDirectory=ke.getPositivePatterns=ke.getNegativePatterns=ke.isPositivePattern=ke.isNegativePattern=ke.convertToNegativePattern=ke.convertToPositivePattern=ke.isDynamicPattern=ke.isStaticPattern=void 0;var Zbe=Z("path"),Wst=zve(),J3=Z3(),Jbe="**",Yst="\\",Kst=/[*?]|^!/,Zst=/\[[^[]*]/,Jst=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Xst=/[!*+?@]\([^(]*\)/,Qst=/,|\.\./,eat=/(?!^)\/{2,}/g;function Xbe(t,e={}){return!Qbe(t,e)}ke.isStaticPattern=Xbe;function Qbe(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Yst)||Kst.test(t)||Zst.test(t)||Jst.test(t)||e.extglob!==!1&&Xst.test(t)||e.braceExpansion!==!1&&tat(t))}ke.isDynamicPattern=Qbe;function tat(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return Qst.test(n)}function rat(t){return bN(t)?t.slice(1):t}ke.convertToPositivePattern=rat;function nat(t){return"!"+t}ke.convertToNegativePattern=nat;function bN(t){return t.startsWith("!")&&t[1]!=="("}ke.isNegativePattern=bN;function eTe(t){return!bN(t)}ke.isPositivePattern=eTe;function iat(t){return t.filter(bN)}ke.getNegativePatterns=iat;function oat(t){return t.filter(eTe)}ke.getPositivePatterns=oat;function sat(t){return t.filter(e=>!X3(e))}ke.getPatternsInsideCurrentDirectory=sat;function aat(t){return t.filter(X3)}ke.getPatternsOutsideCurrentDirectory=aat;function X3(t){return t.startsWith("..")||t.startsWith("./..")}ke.isPatternRelatedToParentDirectory=X3;function cat(t){return Wst(t,{flipBackslashes:!1})}ke.getBaseDirectory=cat;function lat(t){return t.includes(Jbe)}ke.hasGlobStar=lat;function tTe(t){return t.endsWith("/"+Jbe)}ke.endsWithSlashGlobStar=tTe;function uat(t){let e=Zbe.basename(t);return tTe(t)||Xbe(e)}ke.isAffectDepthOfReadingPattern=uat;function dat(t){return t.reduce((e,r)=>e.concat(rTe(r)),[])}ke.expandPatternsWithBraceExpansion=dat;function rTe(t){let e=J3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ke.expandBraceExpansion=rTe;function fat(t,e){let{parts:r}=J3.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}ke.getPatternParts=fat;function nTe(t,e){return J3.makeRe(t,e)}ke.makeRe=nTe;function pat(t,e){return t.map(r=>nTe(r,e))}ke.convertPatternsToRe=pat;function hat(t,e){return e.some(r=>r.test(t))}ke.matchAny=hat;function mat(t){return t.replace(eat,"/")}ke.removeDuplicateSlashes=mat;function gat(t){let e=[],r=[];for(let n of t)iTe(n)?e.push(n):r.push(n);return[e,r]}ke.partitionAbsoluteAndRelative=gat;function iTe(t){return Zbe.isAbsolute(t)}ke.isAbsolute=iTe});var lTe=y((Jar,cTe)=>{"use strict";var _at=Z("stream"),sTe=_at.PassThrough,yat=Array.prototype.slice;cTe.exports=Sat;function Sat(){let t=[],e=yat.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,o=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=sTe(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(aTe(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=t.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let d=u.length+1;function f(){--d>0||(r=!1,c())}function p(h){function m(){h.removeListener("merge2UnpipeEnd",m),h.removeListener("end",m),o&&h.removeListener("error",g),f()}function g(_){s.emit("error",_)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),o&&h.on("error",g),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,s.emit("queueDrain"),i&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),s}function aTe(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=aTe(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(sTe(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var dTe=y(TN=>{"use strict";Object.defineProperty(TN,"__esModule",{value:!0});TN.merge=void 0;var Eat=lTe();function vat(t){let e=Eat(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>uTe(t)),e.once("end",()=>uTe(t)),e}TN.merge=vat;function uTe(t){t.forEach(e=>e.emit("close"))}});var fTe=y(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.isEmpty=c_.isString=void 0;function bat(t){return typeof t=="string"}c_.isString=bat;function Tat(t){return t===""}c_.isEmpty=Tat});var Ec=y(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.string=En.stream=En.pattern=En.path=En.fs=En.errno=En.array=void 0;var wat=Rve();En.array=wat;var Aat=Cve();En.errno=Aat;var xat=Ive();En.fs=xat;var Rat=kve();En.path=Rat;var Cat=oTe();En.pattern=Cat;var Iat=dTe();En.stream=Iat;var Pat=fTe();En.string=Pat});var gTe=y(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.convertPatternGroupToTask=vn.convertPatternGroupsToTasks=vn.groupPatternsByBaseDirectory=vn.getNegativePatternsAsPositive=vn.getPositivePatterns=vn.convertPatternsToTasks=vn.generate=void 0;var es=Ec();function Oat(t,e){let r=pTe(t,e),n=pTe(e.ignore,e),i=hTe(r),o=mTe(r,n),s=i.filter(u=>es.pattern.isStaticPattern(u,e)),a=i.filter(u=>es.pattern.isDynamicPattern(u,e)),c=Q3(s,o,!1),l=Q3(a,o,!0);return c.concat(l)}vn.generate=Oat;function pTe(t,e){let r=t;return e.braceExpansion&&(r=es.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>es.pattern.removeDuplicateSlashes(n))}function Q3(t,e,r){let n=[],i=es.pattern.getPatternsOutsideCurrentDirectory(t),o=es.pattern.getPatternsInsideCurrentDirectory(t),s=eW(i),a=eW(o);return n.push(...tW(s,e,r)),"."in a?n.push(rW(".",o,e,r)):n.push(...tW(a,e,r)),n}vn.convertPatternsToTasks=Q3;function hTe(t){return es.pattern.getPositivePatterns(t)}vn.getPositivePatterns=hTe;function mTe(t,e){return es.pattern.getNegativePatterns(t).concat(e).map(es.pattern.convertToPositivePattern)}vn.getNegativePatternsAsPositive=mTe;function eW(t){let e={};return t.reduce((r,n)=>{let i=es.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}vn.groupPatternsByBaseDirectory=eW;function tW(t,e,r){return Object.keys(t).map(n=>rW(n,t[n],e,r))}vn.convertPatternGroupsToTasks=tW;function rW(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(es.pattern.convertToNegativePattern))}}vn.convertPatternGroupToTask=rW});var yTe=y(wN=>{"use strict";Object.defineProperty(wN,"__esModule",{value:!0});wN.read=void 0;function Nat(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){_Te(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){nW(r,i);return}e.fs.stat(t,(o,s)=>{if(o!==null){if(e.throwErrorOnBrokenSymbolicLink){_Te(r,o);return}nW(r,i);return}e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),nW(r,s)})})}wN.read=Nat;function _Te(t,e){t(e)}function nW(t,e){t(null,e)}});var STe=y(AN=>{"use strict";Object.defineProperty(AN,"__esModule",{value:!0});AN.read=void 0;function kat(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}AN.read=kat});var ETe=y(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.createFileSystemAdapter=uu.FILE_SYSTEM_ADAPTER=void 0;var xN=Z("fs");uu.FILE_SYSTEM_ADAPTER={lstat:xN.lstat,stat:xN.stat,lstatSync:xN.lstatSync,statSync:xN.statSync};function Mat(t){return t===void 0?uu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},uu.FILE_SYSTEM_ADAPTER),t)}uu.createFileSystemAdapter=Mat});var vTe=y(oW=>{"use strict";Object.defineProperty(oW,"__esModule",{value:!0});var $at=ETe(),iW=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=$at.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};oW.default=iW});var Pf=y(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.statSync=du.stat=du.Settings=void 0;var bTe=yTe(),Dat=STe(),sW=vTe();du.Settings=sW.default;function Lat(t,e,r){if(typeof e=="function"){bTe.read(t,aW(),e);return}bTe.read(t,aW(e),r)}du.stat=Lat;function Uat(t,e){let r=aW(e);return Dat.read(t,r)}du.statSync=Uat;function aW(t={}){return t instanceof sW.default?t:new sW.default(t)}});var ATe=y((acr,wTe)=>{"use strict";var TTe;wTe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(TTe||(TTe=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var RTe=y((ccr,xTe)=>{"use strict";xTe.exports=zat;var Fat=ATe();function zat(t,e){let r,n,i,o=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function s(c){function l(){e&&e(c,r),e=null}o?Fat(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(l)}n?i?i.forEach(function(c){t[c](function(l,u){a(c,l,u)})}):t.forEach(function(c,l){c(function(u,d){a(l,u,d)})}):s(null),o=!1}});var cW=y(CN=>{"use strict";Object.defineProperty(CN,"__esModule",{value:!0});CN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var RN=process.versions.node.split(".");if(RN[0]===void 0||RN[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var CTe=Number.parseInt(RN[0],10),jat=Number.parseInt(RN[1],10),ITe=10,Bat=10,qat=CTe>ITe,Vat=CTe===ITe&&jat>=Bat;CN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=qat||Vat});var PTe=y(IN=>{"use strict";Object.defineProperty(IN,"__esModule",{value:!0});IN.createDirentFromStats=void 0;var lW=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Gat(t,e){return new lW(t,e)}IN.createDirentFromStats=Gat});var uW=y(PN=>{"use strict";Object.defineProperty(PN,"__esModule",{value:!0});PN.fs=void 0;var Hat=PTe();PN.fs=Hat});var dW=y(ON=>{"use strict";Object.defineProperty(ON,"__esModule",{value:!0});ON.joinPathSegments=void 0;function Wat(t,e,r){return t.endsWith(r)?t+e:t+r+e}ON.joinPathSegments=Wat});var DTe=y(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.readdir=fu.readdirWithFileTypes=fu.read=void 0;var Yat=Pf(),OTe=RTe(),Kat=cW(),NTe=uW(),kTe=dW();function Zat(t,e,r){if(!e.stats&&Kat.IS_SUPPORT_READDIR_WITH_FILE_TYPES){MTe(t,e,r);return}$Te(t,e,r)}fu.read=Zat;function MTe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){NN(r,n);return}let o=i.map(a=>({dirent:a,name:a.name,path:kTe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){fW(r,o);return}let s=o.map(a=>Jat(a,e));OTe(s,(a,c)=>{if(a!==null){NN(r,a);return}fW(r,c)})})}fu.readdirWithFileTypes=MTe;function Jat(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=NTe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function $Te(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){NN(r,n);return}let o=i.map(s=>{let a=kTe.joinPathSegments(t,s,e.pathSegmentSeparator);return c=>{Yat.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:s,path:a,dirent:NTe.fs.createDirentFromStats(s,u)};e.stats&&(d.stats=u),c(null,d)})}});OTe(o,(s,a)=>{if(s!==null){NN(r,s);return}fW(r,a)})})}fu.readdir=$Te;function NN(t,e){t(e)}function fW(t,e){t(null,e)}});var jTe=y(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.readdir=pu.readdirWithFileTypes=pu.read=void 0;var Xat=Pf(),Qat=cW(),LTe=uW(),UTe=dW();function ect(t,e){return!e.stats&&Qat.IS_SUPPORT_READDIR_WITH_FILE_TYPES?FTe(t,e):zTe(t,e)}pu.read=ect;function FTe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:UTe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let o=e.fs.statSync(i.path);i.dirent=LTe.fs.createDirentFromStats(i.name,o)}catch(o){if(e.throwErrorOnBrokenSymbolicLink)throw o}return i})}pu.readdirWithFileTypes=FTe;function zTe(t,e){return e.fs.readdirSync(t).map(n=>{let i=UTe.joinPathSegments(t,n,e.pathSegmentSeparator),o=Xat.statSync(i,e.fsStatSettings),s={name:n,path:i,dirent:LTe.fs.createDirentFromStats(n,o)};return e.stats&&(s.stats=o),s})}pu.readdir=zTe});var BTe=y(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.createFileSystemAdapter=hu.FILE_SYSTEM_ADAPTER=void 0;var l_=Z("fs");hu.FILE_SYSTEM_ADAPTER={lstat:l_.lstat,stat:l_.stat,lstatSync:l_.lstatSync,statSync:l_.statSync,readdir:l_.readdir,readdirSync:l_.readdirSync};function tct(t){return t===void 0?hu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},hu.FILE_SYSTEM_ADAPTER),t)}hu.createFileSystemAdapter=tct});var qTe=y(hW=>{"use strict";Object.defineProperty(hW,"__esModule",{value:!0});var rct=Z("path"),nct=Pf(),ict=BTe(),pW=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=ict.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,rct.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new nct.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};hW.default=pW});var kN=y(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.Settings=mu.scandirSync=mu.scandir=void 0;var VTe=DTe(),oct=jTe(),mW=qTe();mu.Settings=mW.default;function sct(t,e,r){if(typeof e=="function"){VTe.read(t,gW(),e);return}VTe.read(t,gW(e),r)}mu.scandir=sct;function act(t,e){let r=gW(e);return oct.read(t,r)}mu.scandirSync=act;function gW(t={}){return t instanceof mW.default?t:new mW.default(t)}});var HTe=y((ycr,GTe)=>{"use strict";function cct(t){var e=new t,r=e;function n(){var o=e;return o.next?e=o.next:(e=new t,r=e),o.next=null,o}function i(o){r.next=o,r=o}return{get:n,release:i}}GTe.exports=cct});var YTe=y((Scr,_W)=>{"use strict";var lct=HTe();function WTe(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=lct(uct),i=null,o=null,s=0,a=null,c={push:m,drain:li,saturated:li,pause:u,paused:!1,get concurrency(){return r},set concurrency(O){if(!(O>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=O,!c.paused)for(;i&&s<r;)s++,_()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:g,empty:li,kill:b,killAndDrain:T,error:A,abort:E};return c;function l(){return s}function u(){c.paused=!0}function d(){for(var O=i,R=0;O;)O=O.next,R++;return R}function f(){for(var O=i,R=[];O;)R.push(O.value),O=O.next;return R}function p(){if(c.paused){if(c.paused=!1,i===null){s++,_();return}for(;i&&s<r;)s++,_()}}function h(){return s===0&&c.length()===0}function m(O,R){var N=n.get();N.context=t,N.release=_,N.value=O,N.callback=R||li,N.errorHandler=a,s>=r||c.paused?o?(o.next=N,o=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function g(O,R){var N=n.get();N.context=t,N.release=_,N.value=O,N.callback=R||li,N.errorHandler=a,s>=r||c.paused?i?(N.next=i,i=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function _(O){O&&n.release(O);var R=i;R&&s<=r?c.paused?s--:(o===i&&(o=null),i=R.next,R.next=null,e.call(t,R.value,R.worked),o===null&&c.empty()):--s===0&&c.drain()}function b(){i=null,o=null,c.drain=li}function T(){i=null,o=null,c.drain(),c.drain=li}function E(){var O=i;for(i=null,o=null;O;){var R=O.next,N=O.callback,M=O.errorHandler,L=O.value,v=O.context;O.value=null,O.callback=li,O.errorHandler=null,M&&M(new Error("abort"),L),N.call(v,new Error("abort")),O.release(O),O=R}c.drain=li}function A(O){a=O}}function li(){}function uct(){this.value=null,this.callback=li,this.next=null,this.release=li,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,o=t.errorHandler,s=t.value;t.value=null,t.callback=li,t.errorHandler&&o(r,s),i.call(t.context,r,n),t.release(t)}}function dct(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(u,d){e.call(this,u).then(function(f){d(null,f)},d)}var i=WTe(t,n,r),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(li),d}function c(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(li),d}function l(){var u=new Promise(function(d){process.nextTick(function(){if(i.idle())d();else{var f=i.drain;i.drain=function(){typeof f=="function"&&f(),d(),i.drain=f}}})});return u}}_W.exports=WTe;_W.exports.promise=dct});var MN=y(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.joinPathSegments=ia.replacePathSegmentSeparator=ia.isAppliedFilter=ia.isFatalError=void 0;function fct(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}ia.isFatalError=fct;function pct(t,e){return t===null||t(e)}ia.isAppliedFilter=pct;function hct(t,e){return t.split(/[/\\]/).join(e)}ia.replacePathSegmentSeparator=hct;function mct(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}ia.joinPathSegments=mct});var EW=y(SW=>{"use strict";Object.defineProperty(SW,"__esModule",{value:!0});var gct=MN(),yW=class{constructor(e,r){this._root=e,this._settings=r,this._root=gct.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};SW.default=yW});var TW=y(bW=>{"use strict";Object.defineProperty(bW,"__esModule",{value:!0});var _ct=Z("events"),yct=kN(),Sct=YTe(),$N=MN(),Ect=EW(),vW=class extends Ect.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=yct.scandir,this._emitter=new _ct.EventEmitter,this._queue=Sct(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let o of i)this._handleEntry(o,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!$N.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=$N.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),$N.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&$N.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};bW.default=vW});var KTe=y(AW=>{"use strict";Object.defineProperty(AW,"__esModule",{value:!0});var vct=TW(),wW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new vct.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{bct(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Tct(e,this._storage)}),this._reader.read()}};AW.default=wW;function bct(t,e){t(e)}function Tct(t,e){t(null,e)}});var ZTe=y(RW=>{"use strict";Object.defineProperty(RW,"__esModule",{value:!0});var wct=Z("stream"),Act=TW(),xW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Act.default(this._root,this._settings),this._stream=new wct.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};RW.default=xW});var JTe=y(IW=>{"use strict";Object.defineProperty(IW,"__esModule",{value:!0});var xct=kN(),DN=MN(),Rct=EW(),CW=class extends Rct.default{constructor(){super(...arguments),this._scandir=xct.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(DN.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=DN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),DN.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&DN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};IW.default=CW});var XTe=y(OW=>{"use strict";Object.defineProperty(OW,"__esModule",{value:!0});var Cct=JTe(),PW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Cct.default(this._root,this._settings)}read(){return this._reader.read()}};OW.default=PW});var QTe=y(kW=>{"use strict";Object.defineProperty(kW,"__esModule",{value:!0});var Ict=Z("path"),Pct=kN(),NW=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Ict.sep),this.fsScandirSettings=new Pct.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};kW.default=NW});var UN=y(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.Settings=oa.walkStream=oa.walkSync=oa.walk=void 0;var ewe=KTe(),Oct=ZTe(),Nct=XTe(),MW=QTe();oa.Settings=MW.default;function kct(t,e,r){if(typeof e=="function"){new ewe.default(t,LN()).read(e);return}new ewe.default(t,LN(e)).read(r)}oa.walk=kct;function Mct(t,e){let r=LN(e);return new Nct.default(t,r).read()}oa.walkSync=Mct;function $ct(t,e){let r=LN(e);return new Oct.default(t,r).read()}oa.walkStream=$ct;function LN(t={}){return t instanceof MW.default?t:new MW.default(t)}});var FN=y(DW=>{"use strict";Object.defineProperty(DW,"__esModule",{value:!0});var Dct=Z("path"),Lct=Pf(),twe=Ec(),$W=class{constructor(e){this._settings=e,this._fsStatSettings=new Lct.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Dct.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:twe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!twe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};DW.default=$W});var FW=y(UW=>{"use strict";Object.defineProperty(UW,"__esModule",{value:!0});var Uct=Z("stream"),Fct=Pf(),zct=UN(),jct=FN(),LW=class extends jct.default{constructor(){super(...arguments),this._walkStream=zct.walkStream,this._stat=Fct.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new Uct.PassThrough({objectMode:!0});i._write=(o,s,a)=>this._getEntry(n[o],e[o],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),o===n.length-1&&i.end(),a()}).catch(a);for(let o=0;o<n.length;o++)i.write(o);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,o)=>i===null?r(o):n(i))})}};UW.default=LW});var rwe=y(jW=>{"use strict";Object.defineProperty(jW,"__esModule",{value:!0});var Bct=UN(),qct=FN(),Vct=FW(),zW=class extends qct.default{constructor(){super(...arguments),this._walkAsync=Bct.walk,this._readerStream=new Vct.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(o,s)=>{o===null?n(s):i(o)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((o,s)=>{i.once("error",s),i.on("data",a=>n.push(a)),i.once("end",()=>o(n))})}};jW.default=zW});var nwe=y(qW=>{"use strict";Object.defineProperty(qW,"__esModule",{value:!0});var Wb=Ec(),BW=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Wb.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Wb.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Wb.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Wb.array.splitWhen(e,r=>r.dynamic&&Wb.pattern.hasGlobStar(r.pattern))}};qW.default=BW});var iwe=y(GW=>{"use strict";Object.defineProperty(GW,"__esModule",{value:!0});var Gct=nwe(),VW=class extends Gct.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(o=>!o.complete||o.segments.length>n);for(let o of i){let s=o.sections[0];if(!o.complete&&n>s.length||r.every((c,l)=>{let u=o.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};GW.default=VW});var owe=y(WW=>{"use strict";Object.defineProperty(WW,"__esModule",{value:!0});var zN=Ec(),Hct=iwe(),HW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),o=this._getNegativePatternsRe(n);return s=>this._filter(e,s,i,o)}_getMatcher(e){return new Hct.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(zN.pattern.isAffectDepthOfReadingPattern);return zN.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let o=zN.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(o,n)?!1:this._isSkippedByNegativePatterns(o,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!zN.pattern.matchAny(e,r)}};WW.default=HW});var swe=y(KW=>{"use strict";Object.defineProperty(KW,"__esModule",{value:!0});var gu=Ec(),YW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=gu.pattern.partitionAbsoluteAndRelative(r),o={positive:{all:gu.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:gu.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:gu.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,o)}_filter(e,r){let n=gu.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=gu.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=gu.pattern.matchAny(e,r);return!i&&n?gu.pattern.matchAny(e+"/",r):i}};KW.default=YW});var awe=y(JW=>{"use strict";Object.defineProperty(JW,"__esModule",{value:!0});var Wct=Ec(),ZW=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Wct.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};JW.default=ZW});var lwe=y(QW=>{"use strict";Object.defineProperty(QW,"__esModule",{value:!0});var cwe=Ec(),XW=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=cwe.path.makeAbsolute(this._settings.cwd,r),r=cwe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};QW.default=XW});var jN=y(tY=>{"use strict";Object.defineProperty(tY,"__esModule",{value:!0});var Yct=Z("path"),Kct=owe(),Zct=swe(),Jct=awe(),Xct=lwe(),eY=class{constructor(e){this._settings=e,this.errorFilter=new Jct.default(this._settings),this.entryFilter=new Zct.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Kct.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Xct.default(this._settings)}_getRootDirectory(e){return Yct.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};tY.default=eY});var uwe=y(nY=>{"use strict";Object.defineProperty(nY,"__esModule",{value:!0});var Qct=rwe(),elt=jN(),rY=class extends elt.default{constructor(){super(...arguments),this._reader=new Qct.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(o=>n.transform(o))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};nY.default=rY});var dwe=y(oY=>{"use strict";Object.defineProperty(oY,"__esModule",{value:!0});var tlt=Z("stream"),rlt=FW(),nlt=jN(),iY=class extends nlt.default{constructor(){super(...arguments),this._reader=new rlt.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),o=new tlt.Readable({objectMode:!0,read:()=>{}});return i.once("error",s=>o.emit("error",s)).on("data",s=>o.emit("data",n.transform(s))).once("end",()=>o.emit("end")),o.once("close",()=>i.destroy()),o}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};oY.default=iY});var fwe=y(aY=>{"use strict";Object.defineProperty(aY,"__esModule",{value:!0});var ilt=Pf(),olt=UN(),slt=FN(),sY=class extends slt.default{constructor(){super(...arguments),this._walkSync=olt.walkSync,this._statSync=ilt.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let o=this._getFullEntryPath(i),s=this._getEntry(o,i,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};aY.default=sY});var pwe=y(lY=>{"use strict";Object.defineProperty(lY,"__esModule",{value:!0});var alt=fwe(),clt=jN(),cY=class extends clt.default{constructor(){super(...arguments),this._reader=new alt.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};lY.default=cY});var hwe=y(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var u_=Z("fs"),llt=Z("os"),ult=Math.max(llt.cpus().length,1);d_.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:u_.lstat,lstatSync:u_.lstatSync,stat:u_.stat,statSync:u_.statSync,readdir:u_.readdir,readdirSync:u_.readdirSync};var uY=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,ult),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},d_.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};d_.default=uY});var Yb=y((Vcr,gwe)=>{"use strict";var mwe=gTe(),dlt=uwe(),flt=dwe(),plt=pwe(),dY=hwe(),co=Ec();async function fY(t,e){ts(t);let r=pY(t,dlt.default,e),n=await Promise.all(r);return co.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){ts(l);let d=pY(l,plt.default,u);return co.array.flatten(d)}t.sync=e;function r(l,u){ts(l);let d=pY(l,flt.default,u);return co.stream.merge(d)}t.stream=r;function n(l,u){ts(l);let d=[].concat(l),f=new dY.default(u);return mwe.generate(d,f)}t.generateTasks=n;function i(l,u){ts(l);let d=new dY.default(u);return co.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function o(l){return ts(l),co.path.escape(l)}t.escapePath=o;function s(l){return ts(l),co.path.convertPathToPattern(l)}t.convertPathToPattern=s;let a;(function(l){function u(f){return ts(f),co.path.escapePosixPath(f)}l.escapePath=u;function d(f){return ts(f),co.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return ts(f),co.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return ts(f),co.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(fY||(fY={}));function pY(t,e,r){let n=[].concat(t),i=new dY.default(r),o=mwe.generate(n,i),s=new e(i);return o.map(s.read,s)}function ts(t){if(![].concat(t).every(n=>co.string.isString(n)&&!co.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}gwe.exports=fY});var bY=y((Xcr,VN)=>{"use strict";function vwe(t){return Array.isArray(t)?t:[t]}var glt=void 0,_Y="",Swe=" ",gY="\\",_lt=/^\s+$/,ylt=/(?:[^\\]|^)\\$/,Slt=/^\\!/,Elt=/^\\#/,vlt=/\r?\n/g,blt=/^\.{0,2}\/|^\.{1,2}$/,Tlt=/\/$/,f_="/",bwe="node-ignore";typeof Symbol<"u"&&(bwe=Symbol.for("node-ignore"));var Twe=bwe,p_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),wlt=/([0-z])-([0-z])/g,wwe=()=>!1,Alt=t=>t.replace(wlt,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:_Y),xlt=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Rlt=[[/^\uFEFF/,()=>_Y],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?Swe:_Y)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+Swe}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>gY],[/\\\\/g,()=>gY],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===gY?`\\[${r}${xlt(n)}${i}`:i==="]"&&n.length%2===0?`[${Alt(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],Clt=/(^|\\\/)?\\\*$/,Kb="regex",BN="checkRegex",Ewe="_",Ilt={[Kb](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[BN](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Plt=t=>Rlt.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),qN=t=>typeof t=="string",Olt=t=>t&&qN(t)&&!_lt.test(t)&&!ylt.test(t)&&t.indexOf("#")!==0,Nlt=t=>t.split(vlt).filter(Boolean),yY=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,p_(this,"body",n),p_(this,"ignoreCase",i),p_(this,"regexPrefix",s)}get regex(){let e=Ewe+Kb;return this[e]?this[e]:this._make(Kb,e)}get checkRegex(){let e=Ewe+BN;return this[e]?this[e]:this._make(BN,e)}_make(e,r){let n=this.regexPrefix.replace(Clt,Ilt[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p_(this,r,i)}},klt=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(Slt,"!").replace(Elt,"#");let o=Plt(i);return new yY(t,e,i,r,n,o)},SY=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Twe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(qN(e)&&(e={pattern:e}),Olt(e.pattern)){let r=klt(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,vwe(qN(e)?Nlt(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:l}=c;o===l&&i!==o||l&&!i&&!o&&!r||!c[n].test(e)||(i=!l,o=l,s=l?glt:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},Mlt=(t,e)=>{throw new e(t)},vc=(t,e,r)=>qN(t)?t?vc.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),Awe=t=>blt.test(t);vc.isNotRelative=Awe;vc.convert=t=>t;var EY=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){p_(this,Twe,!0),this._rules=new SY(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let o=e&&vc.convert(e);return vc(o,e,this._strictPathCheck?Mlt:wwe),this._t(o,r,n,i)}checkIgnore(e){if(!Tlt.test(e))return this.test(e);let r=e.split(f_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(f_)+f_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,BN)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(f_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,Kb);let o=this._t(i.join(f_)+f_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,Kb)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return vwe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},vY=t=>new EY(t),$lt=t=>vc(t&&vc.convert(t),t,wwe),xwe=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");vc.convert=t;let e=/^[a-z]:\//i;vc.isNotRelative=r=>e.test(r)||Awe(r)};typeof process<"u"&&process.platform==="win32"&&xwe();VN.exports=vY;vY.default=vY;VN.exports.isPathValid=$lt;p_(VN.exports,Symbol.for("setupWindows"),xwe)});var tK=y(xxe=>{"use strict";xxe.parse=function(t,e){return new eK(t,e).parse()};var eK=class t{constructor(e,r){this.source=e,this.transform=r||lft,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var r;(this.recorded.length>0||e)&&(r=this.recorded.join(""),r==="NULL"&&!e&&(r=null),r!==null&&(r=this.transform(r)),this.entries.push(r),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var r,n,i;for(this.consumeDimensions();!this.isEof();)if(r=this.nextCharacter(),r.value==="{"&&!i)this.dimension++,this.dimension>1&&(n=new t(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);else if(r.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),e))return this.entries}else r.value==='"'&&!r.escaped?(i&&this.newEntry(!0),i=!i):r.value===","&&!i?this.newEntry():this.record(r.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function lft(t){return t}});var rK=y((hpr,Rxe)=>{"use strict";var uft=tK();Rxe.exports={create:function(t,e){return{parse:function(){return uft.parse(t,e)}}}}});var Pxe=y((mpr,Ixe)=>{"use strict";var dft=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,fft=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,pft=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,hft=/^-?infinity$/;Ixe.exports=function(e){if(hft.test(e))return Number(e.replace("i","I"));var r=dft.exec(e);if(!r)return mft(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=Cxe(i));var o=parseInt(r[2],10)-1,s=r[3],a=parseInt(r[4],10),c=parseInt(r[5],10),l=parseInt(r[6],10),u=r[7];u=u?1e3*parseFloat(u):0;var d,f=gft(e);return f!=null?(d=new Date(Date.UTC(i,o,s,a,c,l,u)),nK(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,o,s,a,c,l,u),nK(i)&&d.setFullYear(i)),d};function mft(t){var e=fft.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=Cxe(r));var i=parseInt(e[2],10)-1,o=e[3],s=new Date(r,i,o);return nK(r)&&s.setFullYear(r),s}}function gft(t){if(t.endsWith("+00"))return 0;var e=pft.exec(t.split(" ")[1]);if(e){var r=e[1];if(r==="Z")return 0;var n=r==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt(e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}function Cxe(t){return-(t-1)}function nK(t){return t>=0&&t<100}});var Nxe=y((gpr,Oxe)=>{"use strict";Oxe.exports=yft;var _ft=Object.prototype.hasOwnProperty;function yft(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)_ft.call(r,n)&&(t[n]=r[n])}return t}});var $xe=y((_pr,Mxe)=>{"use strict";var Sft=Nxe();Mxe.exports=T_;function T_(t){if(!(this instanceof T_))return new T_(t);Sft(this,Oft(t))}var Eft=["seconds","minutes","hours","days","months","years"];T_.prototype.toPostgres=function(){var t=Eft.filter(this.hasOwnProperty,this);return this.milliseconds&&t.indexOf("seconds")<0&&t.push("seconds"),t.length===0?"0":t.map(function(e){var r=this[e]||0;return e==="seconds"&&this.milliseconds&&(r=(r+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),r+" "+e},this).join(" ")};var vft={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},bft=["years","months","days"],Tft=["hours","minutes","seconds"];T_.prototype.toISOString=T_.prototype.toISO=function(){var t=bft.map(r,this).join(""),e=Tft.map(r,this).join("");return"P"+t+"T"+e;function r(n){var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),i+vft[n]}};var iK="([+-]?\\d+)",wft=iK+"\\s+years?",Aft=iK+"\\s+mons?",xft=iK+"\\s+days?",Rft="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Cft=new RegExp([wft,Aft,xft,Rft].map(function(t){return"("+t+")?"}).join("\\s*")),kxe={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Ift=["hours","minutes","seconds","milliseconds"];function Pft(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function Oft(t){if(!t)return{};var e=Cft.exec(t),r=e[8]==="-";return Object.keys(kxe).reduce(function(n,i){var o=kxe[i],s=e[o];return!s||(s=i==="milliseconds"?Pft(s):parseInt(s,10),!s)||(r&&~Ift.indexOf(i)&&(s*=-1),n[i]=s),n},{})}});var Uxe=y((ypr,Lxe)=>{"use strict";var Dxe=Buffer.from||Buffer;Lxe.exports=function(e){if(/^\\x/.test(e))return Dxe(e.substr(2),"hex");for(var r="",n=0;n<e.length;)if(e[n]!=="\\")r+=e[n],++n;else if(/[0-7]{3}/.test(e.substr(n+1,3)))r+=String.fromCharCode(parseInt(e.substr(n+1,3),8)),n+=4;else{for(var i=1;n+i<e.length&&e[n+i]==="\\";)i++;for(var o=0;o<Math.floor(i/2);++o)r+="\\";n+=Math.floor(i/2)*2}return Dxe(r,"binary")}});var Gxe=y((Spr,Vxe)=>{"use strict";var sT=tK(),aT=rK(),ik=Pxe(),zxe=$xe(),jxe=Uxe();function ok(t){return function(r){return r===null?r:t(r)}}function Bxe(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function Nft(t){return t?sT.parse(t,Bxe):null}function kft(t){return parseInt(t,10)}function oK(t){return t?sT.parse(t,ok(kft)):null}function Mft(t){return t?sT.parse(t,ok(function(e){return qxe(e).trim()})):null}var $ft=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=lK(r)),r});return e.parse()},sK=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},lo=function(t){if(!t)return null;var e=aT.create(t);return e.parse()},aK=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=ik(r)),r});return e.parse()},Dft=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=zxe(r)),r});return e.parse()},Lft=function(t){return t?sT.parse(t,ok(jxe)):null},cK=function(t){return parseInt(t,10)},qxe=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},Fxe=function(t){return t?sT.parse(t,ok(JSON.parse)):null},lK=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},Uft=function(t){if(t[0]!=="<"&&t[1]!=="(")return null;for(var e="(",r="",n=!1,i=2;i<t.length-1;i++){if(n||(e+=t[i]),t[i]===")"){n=!0;continue}else if(!n)continue;t[i]!==","&&(r+=t[i])}var o=lK(e);return o.radius=parseFloat(r),o},Fft=function(t){t(20,qxe),t(21,cK),t(23,cK),t(26,cK),t(700,parseFloat),t(701,parseFloat),t(16,Bxe),t(1082,ik),t(1114,ik),t(1184,ik),t(600,lK),t(651,lo),t(718,Uft),t(1e3,Nft),t(1001,Lft),t(1005,oK),t(1007,oK),t(1028,oK),t(1016,Mft),t(1017,$ft),t(1021,sK),t(1022,sK),t(1231,sK),t(1014,lo),t(1015,lo),t(1008,lo),t(1009,lo),t(1040,lo),t(1041,lo),t(1115,aK),t(1182,aK),t(1185,aK),t(1186,zxe),t(1187,Dft),t(17,jxe),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,Fxe),t(3807,Fxe),t(3907,lo),t(2951,lo),t(791,lo),t(1183,lo),t(1270,lo)};Vxe.exports={init:Fft}});var Wxe=y((Epr,Hxe)=>{"use strict";var ui=1e6;function zft(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",o,s,a,c,l,u;{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}return o=e%ui,s=4294967296*o+r,a=""+s%ui,n+a+i}Hxe.exports=zft});var Xxe=y((vpr,Jxe)=>{"use strict";var jft=Wxe(),Zt=function(t,e,r,n,i){r=r||0,n=n||!1,i=i||function(p,h,m){return p*Math.pow(2,m)+h};var o=r>>3,s=function(p){return n?~p&255:p},a=255,c=8-r%8;e<c&&(a=255<<8-e&255,c=e),r&&(a=a>>r%8);var l=0;r%8+e>=8&&(l=i(0,s(t[o])&a,c));for(var u=e+r>>3,d=o+1;d<u;d++)l=i(l,s(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,s(t[u])>>8-f,f)),l},Zxe=function(t,e,r){var n=Math.pow(2,r-1)-1,i=Zt(t,1),o=Zt(t,r,1);if(o===0)return 0;var s=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)s/=2,(u&1<<d-f)>0&&(l+=s);return l},c=Zt(t,e,r+1,!1,a);return o==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,o-n)*c},Bft=function(t){return Zt(t,1)==1?-1*(Zt(t,15,1,!0)+1):Zt(t,15,1)},Yxe=function(t){return Zt(t,1)==1?-1*(Zt(t,31,1,!0)+1):Zt(t,31,1)},qft=function(t){return Zxe(t,23,8)},Vft=function(t){return Zxe(t,52,11)},Gft=function(t){var e=Zt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,Zt(t,16,16)),n=0,i=[],o=Zt(t,16),s=0;s<o;s++)n+=Zt(t,16,64+16*s)*r,r/=1e4;var a=Math.pow(10,Zt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},Kxe=function(t,e){var r=Zt(e,1),n=Zt(e,63,1),i=new Date((r===0?1:-1)*n/1e3+9466848e5);return t||i.setTime(i.getTime()+i.getTimezoneOffset()*6e4),i.usec=n%1e3,i.getMicroSeconds=function(){return this.usec},i.setMicroSeconds=function(o){this.usec=o},i.getUTCMicroSeconds=function(){return this.usec},i},cT=function(t){for(var e=Zt(t,32),r=Zt(t,32,32),n=Zt(t,32,64),i=96,o=[],s=0;s<e;s++)o[s]=Zt(t,32,i),i+=32,i+=32;var a=function(l){var u=Zt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=Zt(t,u*8,i),i+=u*8,d;if(l==25)return d=t.toString(this.encoding,i>>3,(i+=u<<3)>>3),d;console.log("ERROR: ElementType not implemented: "+l)},c=function(l,u){var d=[],f;if(l.length>1){var p=l.shift();for(f=0;f<p;f++)d[f]=c(l,u);l.unshift(p)}else for(f=0;f<l[0];f++)d[f]=a(u);return d};return c(o,n)},Hft=function(t){return t.toString("utf8")},Wft=function(t){return t===null?null:Zt(t,8)>0},Yft=function(t){t(20,jft),t(21,Bft),t(23,Yxe),t(26,Yxe),t(1700,Gft),t(700,qft),t(701,Vft),t(16,Wft),t(1114,Kxe.bind(null,!1)),t(1184,Kxe.bind(null,!0)),t(1e3,cT),t(1007,cT),t(1016,cT),t(1008,cT),t(1009,cT),t(25,Hft)};Jxe.exports={init:Yft}});var eRe=y((bpr,Qxe)=>{"use strict";Qxe.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var dT=y(uT=>{"use strict";var Kft=Gxe(),Zft=Xxe(),Jft=rK(),Xft=eRe();uT.getTypeParser=Qft;uT.setTypeParser=ept;uT.arrayParser=Jft;uT.builtins=Xft;var lT={text:{},binary:{}};function tRe(t){return String(t)}function Qft(t,e){return e=e||"text",lT[e]&&lT[e][t]||tRe}function ept(t,e,r){typeof e=="function"&&(r=e,e="text"),lT[e][t]=r}Kft.init(function(t,e){lT.text[t]=e});Zft.init(function(t,e){lT.binary[t]=e})});var fT=y((wpr,uK)=>{"use strict";var rRe;try{rRe=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}uK.exports={host:"localhost",user:rRe,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var w_=dT(),tpt=w_.getTypeParser(20,"text"),rpt=w_.getTypeParser(1016,"text");uK.exports.__defineSetter__("parseInt8",function(t){w_.setTypeParser(20,"text",t?w_.getTypeParser(23,"text"):tpt),w_.setTypeParser(1016,"text",t?w_.getTypeParser(1007,"text"):rpt)})});var A_=y((Apr,iRe)=>{"use strict";var npt=fT(),{isDate:ipt}=Z("util/types");function opt(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function nRe(t){let e="{";for(let r=0;r<t.length;r++){r>0&&(e+=",");let n=t[r];n==null?e+="NULL":Array.isArray(n)?e+=nRe(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=opt(sk(n))}return e+="}",e}var sk=function(t,e){return t==null?null:typeof t=="object"?t instanceof Buffer?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):ipt(t)?npt.parseInputDatesAsUTC?cpt(t):apt(t):Array.isArray(t)?nRe(t):spt(t,e):t.toString()};function spt(t,e){if(t&&typeof t.toPostgres=="function"){if(e=e||[],e.indexOf(t)!==-1)throw new Error('circular reference detected while preparing "'+t+'" for query');return e.push(t),sk(t.toPostgres(sk),e)}return JSON.stringify(t)}function apt(t){let e=-t.getTimezoneOffset(),r=t.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);let i=String(r).padStart(4,"0")+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+String(t.getMilliseconds()).padStart(3,"0");return e<0?(i+="-",e*=-1):i+="+",i+=String(Math.floor(e/60)).padStart(2,"0")+":"+String(e%60).padStart(2,"0"),n&&(i+=" BC"),i}function cpt(t){let e=t.getUTCFullYear(),r=e<1;r&&(e=Math.abs(e)+1);let n=String(e).padStart(4,"0")+"-"+String(t.getUTCMonth()+1).padStart(2,"0")+"-"+String(t.getUTCDate()).padStart(2,"0")+"T"+String(t.getUTCHours()).padStart(2,"0")+":"+String(t.getUTCMinutes()).padStart(2,"0")+":"+String(t.getUTCSeconds()).padStart(2,"0")+"."+String(t.getUTCMilliseconds()).padStart(3,"0");return n+="+00:00",r&&(n+=" BC"),n}function lpt(t,e,r){return t=typeof t=="string"?{text:t}:t,e&&(typeof e=="function"?t.callback=e:t.values=e),r&&(t.callback=r),t}var upt=function(t){return'"'+t.replace(/"/g,'""')+'"'},dpt=function(t){let e=!1,r="'";if(t==null||typeof t!="string")return"''";for(let n=0;n<t.length;n++){let i=t[n];i==="'"?r+=i+i:i==="\\"?(r+=i+i,e=!0):r+=i}return r+="'",e===!0&&(r=" E"+r),r};iRe.exports={prepareValue:function(e){return sk(e)},normalizeQueryConfig:lpt,escapeIdentifier:upt,escapeLiteral:dpt}});var pK=y((xpr,aRe)=>{"use strict";var oRe=Z("crypto");aRe.exports={postgresMd5PasswordHash:ppt,randomBytes:fpt,deriveKey:_pt,sha256:hpt,hashByName:mpt,hmacSha256:gpt,md5:dK};var sRe=oRe.webcrypto||globalThis.crypto,kf=sRe.subtle,fK=new TextEncoder;function fpt(t){return sRe.getRandomValues(Buffer.alloc(t))}async function dK(t){try{return oRe.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?fK.encode(t):t,n=await kf.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function ppt(t,e,r){let n=await dK(e+t);return"md5"+await dK(Buffer.concat([Buffer.from(n),r]))}async function hpt(t){return await kf.digest("SHA-256",t)}async function mpt(t,e){return await kf.digest(t,e)}async function gpt(t,e){let r=await kf.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await kf.sign("HMAC",r,fK.encode(e))}async function _pt(t,e,r){let n=await kf.importKey("raw",fK.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await kf.deriveBits(i,n,256,["deriveBits"])}});var uRe=y((Rpr,lRe)=>{"use strict";function Mf(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function hK(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw Mf("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function cRe(t,e){if(t[e++]!==6)throw Mf("non-OID data",t);let{length:r,index:n}=hK(t,e);e=n;let i=e+r,o=t[e++],s=(o/40>>0)+"."+o%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}s+="."+a}return{oid:s,index:e}}function pT(t,e){if(t[e++]!==48)throw Mf("non-sequence data",t);return hK(t,e)}function ypt(t,e){e===void 0&&(e=0),e=pT(t,e).index;let{length:r,index:n}=pT(t,e);e=n+r,e=pT(t,e).index;let{oid:i,index:o}=cRe(t,e);switch(i){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(e=o,e=pT(t,e).index,t[e++]!==160)throw Mf("non-tag data",t);e=hK(t,e).index,e=pT(t,e).index;let{oid:s}=cRe(t,e);switch(s){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw Mf("unknown hash OID "+s,t)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw Mf("Ed448 certificate channel binding is not currently supported by Postgres")}throw Mf("unknown OID "+i,t)}lRe.exports={signatureAlgorithmHashFromCertificate:ypt}});var hRe=y((Cpr,pRe)=>{"use strict";var Su=pK(),{signatureAlgorithmHashFromCertificate:Spt}=uRe();function Ept(t){let e=/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,r=/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g;return t.replace(e," ").replace(r,"").normalize("NFKC")}var mK=1e5;function vpt(t,e,r=mK){let n=["SCRAM-SHA-256"];e&&n.unshift("SCRAM-SHA-256-PLUS");let i=n.find(a=>t.includes(a));if(!i)throw new Error("SASL: Only mechanism(s) "+n.join(" and ")+" are supported");if(i==="SCRAM-SHA-256-PLUS"&&typeof e.getPeerCertificate!="function")throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let o=Su.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:o,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+o,message:"SASLInitialResponse",scramMaxIterations:r}}async function bpt(t,e,r,n){if(t.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(e==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof r!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let i=Apt(r);if(i.nonce.startsWith(t.clientNonce)){if(i.nonce.length===t.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");let o=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:mK;if(o!==0&&i.iteration>o)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+o);let s="n=*,r="+t.clientNonce,a="r="+i.nonce+",s="+i.salt+",i="+i.iteration,c=n?"eSws":"biws";if(t.mechanism==="SCRAM-SHA-256-PLUS"){let T=n.getPeerCertificate().raw,E=Spt(T);(E==="MD5"||E==="SHA-1")&&(E="SHA-256");let A=await Su.hashByName(E,T);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(A)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=s+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await Su.deriveKey(Ept(e),d,i.iteration),p=await Su.hmacSha256(f,"Client Key"),h=await Su.sha256(p),m=await Su.hmacSha256(h,u),g=Rpt(Buffer.from(p),Buffer.from(m)).toString("base64"),_=await Su.hmacSha256(f,"Server Key"),b=await Su.hmacSha256(_,u);t.message="SASLResponse",t.serverSignature=Buffer.from(b).toString("base64"),t.response=l+",p="+g}function Tpt(t,e){if(t.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=xpt(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function wpt(t){if(typeof t!="string")throw new TypeError("SASL: text must be a string");return t.split("").map((e,r)=>t.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function dRe(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function fRe(t){if(typeof t!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(t.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let r=e[0],n=e.substring(2);return[r,n]}))}function Apt(t){let e=fRe(t),r=e.get("r");if(r){if(!wpt(r))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!dRe(n))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let o=parseInt(i,10);return{nonce:r,salt:n,iteration:o}}function xpt(t){let e=fRe(t),r=e.get("e"),n=e.get("v");if(r)throw new Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${r}"`);if(n){if(!dRe(n))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:n}}function Rpt(t,e){if(!Buffer.isBuffer(t))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(e))throw new TypeError("second argument must be a Buffer");if(t.length!==e.length)throw new Error("Buffer lengths must match");if(t.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(t.map((r,n)=>t[n]^e[n]))}pRe.exports={startSession:vpt,continueSession:bpt,finalizeSession:Tpt,DEFAULT_MAX_SCRAM_ITERATIONS:mK}});var ck=y((Ipr,mRe)=>{"use strict";var Cpt=dT();function ak(t){this._types=t||Cpt,this.text={},this.binary={}}ak.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};ak.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};ak.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};mRe.exports=ak});var yRe=y((Ppr,_Re)=>{"use strict";function x_(t,e={}){if(t.charAt(0)==="/"){let c=t.split(" ");return{host:c[0],database:c[1]}}let r=Object.create(null),n,i=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,"%$1"));try{try{n=new URL(t,"postgres://base")}catch{n=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),i=!0}}catch(c){throw c.input&&(c.input="*****REDACTED*****"),c}for(let c of n.searchParams.entries())r[c[0]]=c[1];if(r.user=r.user||decodeURIComponent(n.username),r.password=r.password||decodeURIComponent(n.password),n.protocol=="socket:")return r.host=decodeURI(n.pathname),r.database=n.searchParams.get("db"),r.client_encoding=n.searchParams.get("encoding"),r;let o=i?"":n.hostname;r.host?o&&/^%2f/i.test(o)&&(n.pathname=o+n.pathname):r.host=decodeURIComponent(o),r.port||(r.port=n.port);let s=n.pathname.slice(1)||null;r.database=s?decodeURI(s):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let a=r.sslcert||r.sslkey||r.sslrootcert?Z("fs"):null;if(r.sslcert&&(r.ssl.cert=a.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=a.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=a.readFileSync(r.sslrootcert).toString()),e.useLibpqCompat&&r.uselibpqcompat)throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(r.uselibpqcompat==="true"||e.useLibpqCompat)switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":{r.ssl.rejectUnauthorized=!1;break}case"require":{r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!r.ssl.ca)throw new Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");r.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":{r.sslmode!=="verify-full"&&gK(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function Ipt(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function gRe(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let o=i;typeof o=="boolean"&&(r[n]=o),typeof o=="object"&&(r[n]=Ipt(o))}else if(i!=null)if(n==="port"){if(i!==""){let o=parseInt(i,10);if(isNaN(o))throw new Error(`Invalid ${n}: ${i}`);r[n]=o}}else r[n]=i;return r},Object.create(null))}function Ppt(t){return gRe(x_(t))}function gK(t){!gK.warned&&typeof process<"u"&&process.emitWarning&&(gK.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
32
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Sbe=y((jar,ybe)=>{"use strict";var Hot=_N(),{MAX_LENGTH:mbe,CHAR_BACKSLASH:L3,CHAR_BACKTICK:Wot,CHAR_COMMA:Yot,CHAR_DOT:Kot,CHAR_LEFT_PARENTHESES:Zot,CHAR_RIGHT_PARENTHESES:Jot,CHAR_LEFT_CURLY_BRACE:Xot,CHAR_RIGHT_CURLY_BRACE:Qot,CHAR_LEFT_SQUARE_BRACKET:gbe,CHAR_RIGHT_SQUARE_BRACKET:_be,CHAR_DOUBLE_QUOTE:est,CHAR_SINGLE_QUOTE:tst,CHAR_NO_BREAK_SPACE:rst,CHAR_ZERO_WIDTH_NOBREAK_SPACE:nst}=hbe(),ist=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(mbe,r.maxLength):mbe;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},o=[i],s=i,a=i,c=0,l=t.length,u=0,d=0,f,p=()=>t[u++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return s.nodes.push(m),m.parent=s,m.prev=a,a=m,m};for(h({type:"bos"});u<l;)if(s=o[o.length-1],f=p(),!(f===nst||f===rst)){if(f===L3){h({type:"text",value:(e.keepEscaping?f:"")+p()});continue}if(f===_be){h({type:"text",value:"\\"+f});continue}if(f===gbe){c++;let m;for(;u<l&&(m=p());){if(f+=m,m===gbe){c++;continue}if(m===L3){f+=p();continue}if(m===_be&&(c--,c===0))break}h({type:"text",value:f});continue}if(f===Zot){s=h({type:"paren",nodes:[]}),o.push(s),h({type:"text",value:f});continue}if(f===Jot){if(s.type!=="paren"){h({type:"text",value:f});continue}s=o.pop(),h({type:"text",value:f}),s=o[o.length-1];continue}if(f===est||f===tst||f===Wot){let m=f,g;for(e.keepQuotes!==!0&&(f="");u<l&&(g=p());){if(g===L3){f+=g+p();continue}if(g===m){e.keepQuotes===!0&&(f+=g);break}f+=g}h({type:"text",value:f});continue}if(f===Xot){d++;let g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||s.dollar===!0,depth:d,commas:0,ranges:0,nodes:[]};s=h(g),o.push(s),h({type:"open",value:f});continue}if(f===Qot){if(s.type!=="brace"){h({type:"text",value:f});continue}let m="close";s=o.pop(),s.close=!0,h({type:m,value:f}),d--,s=o[o.length-1];continue}if(f===Yot&&d>0){if(s.ranges>0){s.ranges=0;let m=s.nodes.shift();s.nodes=[m,{type:"text",value:Hot(s)}]}h({type:"comma",value:f}),s.commas++;continue}if(f===Kot&&d>0&&s.commas===0){let m=s.nodes;if(d===0||m.length===0){h({type:"text",value:f});continue}if(a.type==="dot"){if(s.range=[],a.value+=f,a.type="range",s.nodes.length!==3&&s.nodes.length!==5){s.invalid=!0,s.ranges=0,a.type="text";continue}s.ranges++,s.args=[];continue}if(a.type==="range"){m.pop();let g=m[m.length-1];g.value+=a.value+f,a=g,s.ranges--;continue}h({type:"dot",value:f});continue}h({type:"text",value:f})}do if(s=o.pop(),s.type!=="root"){s.nodes.forEach(_=>{_.nodes||(_.type==="open"&&(_.isOpen=!0),_.type==="close"&&(_.isClose=!0),_.nodes||(_.type="text"),_.invalid=!0)});let m=o[o.length-1],g=m.nodes.indexOf(s);m.nodes.splice(g,1,...s.nodes)}while(o.length>0);return h({type:"eos"}),i};ybe.exports=ist});var bbe=y((Bar,vbe)=>{"use strict";var Ebe=_N(),ost=lbe(),sst=fbe(),ast=Sbe(),Oi=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Oi.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Oi.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.parse=(t,e={})=>ast(t,e);Oi.stringify=(t,e={})=>Ebe(typeof t=="string"?Oi.parse(t,e):t,e);Oi.compile=(t,e={})=>(typeof t=="string"&&(t=Oi.parse(t,e)),ost(t,e));Oi.expand=(t,e={})=>{typeof t=="string"&&(t=Oi.parse(t,e));let r=sst(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Oi.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Oi.compile(t,e):Oi.expand(t,e);vbe.exports=Oi});var qb=y((qar,Rbe)=>{"use strict";var cst=Z("path"),ra="\\\\/",Tbe=`[^${ra}]`,lst=0,Sc="\\.",ust="\\+",dst="\\?",EN="\\/",fst="(?=.)",wbe="[^/]",U3=`(?:${EN}|$)`,Abe=`(?:^|${EN})`,F3=`${Sc}{1,2}${U3}`,pst=`(?!${Sc})`,hst=`(?!${Abe}${F3})`,mst=`(?!${Sc}{0,1}${U3})`,gst=`(?!${F3})`,_st=`[^.${EN}]`,yst=`${wbe}*?`,xbe={DOT_LITERAL:Sc,PLUS_LITERAL:ust,QMARK_LITERAL:dst,SLASH_LITERAL:EN,ONE_CHAR:fst,QMARK:wbe,END_ANCHOR:U3,DOTS_SLASH:F3,NO_DOT:pst,NO_DOTS:hst,NO_DOT_SLASH:mst,NO_DOTS_SLASH:gst,QMARK_NO_DOT:_st,STAR:yst,START_ANCHOR:Abe},Sst={...xbe,SLASH_LITERAL:`[${ra}]`,QMARK:Tbe,STAR:`${Tbe}*?`,DOTS_SLASH:`${Sc}{1,2}(?:[${ra}]|$)`,NO_DOT:`(?!${Sc})`,NO_DOTS:`(?!(?:^|[${ra}])${Sc}{1,2}(?:[${ra}]|$))`,NO_DOT_SLASH:`(?!${Sc}{0,1}(?:[${ra}]|$))`,NO_DOTS_SLASH:`(?!${Sc}{1,2}(?:[${ra}]|$))`,QMARK_NO_DOT:`[^.${ra}]`,START_ANCHOR:`(?:^|[${ra}])`,END_ANCHOR:`(?:[${ra}]|$)`},Est={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Rbe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:lst,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Est,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:cst.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Sst:xbe}}});var Vb=y(ci=>{"use strict";var vst=Z("path"),bst=process.platform==="win32",{REGEX_BACKSLASH:Tst,REGEX_REMOVE_BACKSLASH:wst,REGEX_SPECIAL_CHARS:Ast,REGEX_SPECIAL_CHARS_GLOBAL:xst}=qb();ci.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ci.hasRegexChars=t=>Ast.test(t);ci.isRegexChar=t=>t.length===1&&ci.hasRegexChars(t);ci.escapeRegex=t=>t.replace(xst,"\\$1");ci.toPosixSlashes=t=>t.replace(Tst,"/");ci.removeBackslashes=t=>t.replace(wst,e=>e==="\\"?"":e);ci.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ci.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:bst===!0||vst.sep==="\\";ci.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?ci.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};ci.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ci.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o}});var $be=y((Gar,Mbe)=>{"use strict";var Cbe=Vb(),{CHAR_ASTERISK:z3,CHAR_AT:Rst,CHAR_BACKWARD_SLASH:Gb,CHAR_COMMA:Cst,CHAR_DOT:j3,CHAR_EXCLAMATION_MARK:B3,CHAR_FORWARD_SLASH:kbe,CHAR_LEFT_CURLY_BRACE:q3,CHAR_LEFT_PARENTHESES:V3,CHAR_LEFT_SQUARE_BRACKET:Ist,CHAR_PLUS:Pst,CHAR_QUESTION_MARK:Ibe,CHAR_RIGHT_CURLY_BRACE:Ost,CHAR_RIGHT_PARENTHESES:Pbe,CHAR_RIGHT_SQUARE_BRACKET:Nst}=qb(),Obe=t=>t===kbe||t===Gb,Nbe=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},kst=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,h=!1,m=!1,g=!1,_=!1,b=!1,T=!1,E=!1,A=!1,O=0,R,N,M={value:"",depth:0,isGlob:!1},L=()=>l>=n,v=()=>c.charCodeAt(l+1),oe=()=>(R=N,c.charCodeAt(++l));for(;l<n;){N=oe();let Y;if(N===Gb){b=M.backslashes=!0,N=oe(),N===q3&&(_=!0);continue}if(_===!0||N===q3){for(O++;L()!==!0&&(N=oe());){if(N===Gb){b=M.backslashes=!0,oe();continue}if(N===q3){O++;continue}if(_!==!0&&N===j3&&(N=oe())===j3){if(f=M.isBrace=!0,h=M.isGlob=!0,A=!0,i===!0)continue;break}if(_!==!0&&N===Cst){if(f=M.isBrace=!0,h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ost&&(O--,O===0)){_=!1,f=M.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(N===kbe){if(o.push(l),s.push(M),M={value:"",depth:0,isGlob:!1},A===!0)continue;if(R===j3&&l===u+1){u+=2;continue}d=l+1;continue}if(r.noext!==!0&&(N===Pst||N===Rst||N===z3||N===Ibe||N===B3)===!0&&v()===V3){if(h=M.isGlob=!0,m=M.isExtglob=!0,A=!0,N===B3&&l===u&&(E=!0),i===!0){for(;L()!==!0&&(N=oe());){if(N===Gb){b=M.backslashes=!0,N=oe();continue}if(N===Pbe){h=M.isGlob=!0,A=!0;break}}continue}break}if(N===z3){if(R===z3&&(g=M.isGlobstar=!0),h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ibe){if(h=M.isGlob=!0,A=!0,i===!0)continue;break}if(N===Ist){for(;L()!==!0&&(Y=oe());){if(Y===Gb){b=M.backslashes=!0,oe();continue}if(Y===Nst){p=M.isBracket=!0,h=M.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&N===B3&&l===u){T=M.negated=!0,u++;continue}if(r.noparen!==!0&&N===V3){if(h=M.isGlob=!0,i===!0){for(;L()!==!0&&(N=oe());){if(N===V3){b=M.backslashes=!0,N=oe();continue}if(N===Pbe){A=!0;break}}continue}break}if(h===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,h=!1);let $=c,S="",w="";u>0&&(S=c.slice(0,u),c=c.slice(u),d-=u),$&&h===!0&&d>0?($=c.slice(0,d),w=c.slice(d)):h===!0?($="",w=c):$=c,$&&$!==""&&$!=="/"&&$!==c&&Obe($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(w&&(w=Cbe.removeBackslashes(w)),$&&b===!0&&($=Cbe.removeBackslashes($)));let k={prefix:S,input:t,start:u,base:$,glob:w,isBrace:f,isBracket:p,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:E};if(r.tokens===!0&&(k.maxDepth=0,Obe(N)||s.push(M),k.tokens=s),r.parts===!0||r.tokens===!0){let Y;for(let H=0;H<o.length;H++){let he=Y?Y+1:u,je=o[H],Ie=t.slice(he,je);r.tokens&&(H===0&&u!==0?(s[H].isPrefix=!0,s[H].value=S):s[H].value=Ie,Nbe(s[H]),k.maxDepth+=s[H].depth),(H!==0||Ie!=="")&&a.push(Ie),Y=je}if(Y&&Y+1<t.length){let H=t.slice(Y+1);a.push(H),r.tokens&&(s[s.length-1].value=H,Nbe(s[s.length-1]),k.maxDepth+=s[s.length-1].depth)}k.slashes=o,k.parts=a}return k};Mbe.exports=kst});var zbe=y((Har,Fbe)=>{"use strict";var Hb=qb(),Sn=Vb(),{MAX_LENGTH:vN,POSIX_REGEX_SOURCE:Mst,REGEX_NON_SPECIAL_CHARS:$st,REGEX_SPECIAL_CHARS_BACKREF:Dst,REPLACEMENTS:Dbe}=Hb,Lst=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Sn.escapeRegex(i)).join("..")}return r},a_=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Lbe=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Ust=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Ube=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Ust(e))return e.replace(/\\(.)/g,"$1")},Fst=t=>{let e=t.map(Ube).filter(Boolean);for(let r=0;r<e.length;r++)for(let n=r+1;n<e.length;n++){let i=e[r],o=e[n],s=i[0];if(!(!s||i!==s.repeat(i.length)||o!==s.repeat(o.length))&&(i===o||i.startsWith(o)||o.startsWith(i)))return!0}return!1},G3=(t,e=!0)=>{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s<t.length;s++){let a=t[s];if(o===!0){o=!1;continue}if(a==="\\"){o=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){r++;continue}if(a==="]"&&r>0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},zst=t=>{let e=0,r=[];for(;e<t.length;){let i=G3(t.slice(e),!1);if(!i||i.type!=="*")return;let o=Lbe(i.body).map(a=>a.trim());if(o.length!==1)return;let s=Ube(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Sn.escapeRegex(r[0]):`[${r.map(i=>Sn.escapeRegex(i)).join("")}]`}*`},jst=t=>{let e=0,r=t.trim(),n=G3(r);for(;n;)e++,r=n.body.trim(),n=G3(r);return e},Bst=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Hb.DEFAULT_MAX_EXTGLOB_RECURSION,n=Lbe(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Fst(n)))return{risky:!0};for(let i of n){let o=zst(i);if(o)return{risky:!0,safeOutput:o};if(jst(i)>r)return{risky:!0}}return{risky:!1}},H3=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Dbe[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(vN,r.maxLength):vN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=Sn.isWindows(e),l=Hb.globChars(c),u=Hb.extglobChars(l),{DOT_LITERAL:d,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:_,NO_DOTS_SLASH:b,QMARK:T,QMARK_NO_DOT:E,STAR:A,START_ANCHOR:O}=l,R=re=>`(${a}(?:(?!${O}${re.dot?m:d}).)*?)`,N=r.dot?"":g,M=r.dot?T:E,L=r.bash===!0?R(r):A;r.capture&&(L=`(${L})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let v={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Sn.removePrefix(t,v),i=t.length;let oe=[],$=[],S=[],w=o,k,Y=()=>v.index===i-1,H=v.peek=(re=1)=>t[v.index+re],he=v.advance=()=>t[++v.index]||"",je=()=>t.slice(v.index+1),Ie=(re="",qe=0)=>{v.consumed+=re,v.index+=qe},$e=re=>{v.output+=re.output!=null?re.output:re.value,Ie(re.value)},Pe=()=>{let re=1;for(;H()==="!"&&(H(2)!=="("||H(3)==="?");)he(),v.start++,re++;return re%2===0?!1:(v.negated=!0,v.start++,!0)},He=re=>{v[re]++,S.push(re)},Ne=re=>{v[re]--,S.pop()},le=re=>{if(w.type==="globstar"){let qe=v.braces>0&&(re.type==="comma"||re.type==="brace"),z=re.extglob===!0||oe.length&&(re.type==="pipe"||re.type==="paren");re.type!=="slash"&&re.type!=="paren"&&!qe&&!z&&(v.output=v.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=L,v.output+=w.output)}if(oe.length&&re.type!=="paren"&&(oe[oe.length-1].inner+=re.value),(re.value||re.output)&&$e(re),w&&w.type==="text"&&re.type==="text"){w.value+=re.value,w.output=(w.output||"")+re.value;return}re.prev=w,s.push(re),w=re},me=(re,qe)=>{let z={...u[qe],conditions:1,inner:""};z.prev=w,z.parens=v.parens,z.output=v.output,z.startIndex=v.index,z.tokensIndex=s.length;let x=(r.capture?"(":"")+z.open;He("parens"),le({type:re,value:qe,output:v.output?"":h}),le({type:"paren",extglob:!0,value:he(),output:x}),oe.push(z)},nt=re=>{let qe=t.slice(re.startIndex,v.index+1),z=t.slice(re.startIndex+2,v.index),x=Bst(z,r);if((re.type==="plus"||re.type==="star")&&x.risky){let B=x.safeOutput?(re.output?"":h)+(r.capture?`(${x.safeOutput})`:x.safeOutput):void 0,te=s[re.tokensIndex];te.type="text",te.value=qe,te.output=B||Sn.escapeRegex(qe);for(let ie=re.tokensIndex+1;ie<s.length;ie++)s[ie].value="",s[ie].output="",delete s[ie].suffix;v.output=re.output+te.output,v.backtrack=!0,le({type:"paren",extglob:!0,value:k,output:""}),Ne("parens");return}let I=re.close+(r.capture?")":""),j;if(re.type==="negate"){let B=L;if(re.inner&&re.inner.length>1&&re.inner.includes("/")&&(B=R(r)),(B!==L||Y()||/^\)+$/.test(je()))&&(I=re.close=`)$))${B}`),re.inner.includes("*")&&(j=je())&&/^\.[^\\/.]+$/.test(j)){let te=H3(j,{...e,fastpaths:!1}).output;I=re.close=`)${te})${B})`}re.prev.type==="bos"&&(v.negatedExtglob=!0)}le({type:"paren",extglob:!0,value:k,output:I}),Ne("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let re=!1,qe=t.replace(Dst,(z,x,I,j,B,te)=>j==="\\"?(re=!0,z):j==="?"?x?x+j+(B?T.repeat(B.length):""):te===0?M+(B?T.repeat(B.length):""):T.repeat(I.length):j==="."?d.repeat(I.length):j==="*"?x?x+j+(B?L:""):L:x?z:`\\${z}`);return re===!0&&(r.unescape===!0?qe=qe.replace(/\\/g,""):qe=qe.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),qe===t&&r.contains===!0?(v.output=t,v):(v.output=Sn.wrapOutput(qe,v,e),v)}for(;!Y();){if(k=he(),k==="\0")continue;if(k==="\\"){let z=H();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){k+="\\",le({type:"text",value:k});continue}let x=/^\\+/.exec(je()),I=0;if(x&&x[0].length>2&&(I=x[0].length,v.index+=I,I%2!==0&&(k+="\\")),r.unescape===!0?k=he():k+=he(),v.brackets===0){le({type:"text",value:k});continue}}if(v.brackets>0&&(k!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&k===":"){let z=w.value.slice(1);if(z.includes("[")&&(w.posix=!0,z.includes(":"))){let x=w.value.lastIndexOf("["),I=w.value.slice(0,x),j=w.value.slice(x+2),B=Mst[j];if(B){w.value=I+B,v.backtrack=!0,he(),!o.output&&s.indexOf(w)===1&&(o.output=h);continue}}}(k==="["&&H()!==":"||k==="-"&&H()==="]")&&(k=`\\${k}`),k==="]"&&(w.value==="["||w.value==="[^")&&(k=`\\${k}`),r.posix===!0&&k==="!"&&w.value==="["&&(k="^"),w.value+=k,$e({value:k});continue}if(v.quotes===1&&k!=='"'){k=Sn.escapeRegex(k),w.value+=k,$e({value:k});continue}if(k==='"'){v.quotes=v.quotes===1?0:1,r.keepQuotes===!0&&le({type:"text",value:k});continue}if(k==="("){He("parens"),le({type:"paren",value:k});continue}if(k===")"){if(v.parens===0&&r.strictBrackets===!0)throw new SyntaxError(a_("opening","("));let z=oe[oe.length-1];if(z&&v.parens===z.parens+1){nt(oe.pop());continue}le({type:"paren",value:k,output:v.parens?")":"\\)"}),Ne("parens");continue}if(k==="["){if(r.nobracket===!0||!je().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(a_("closing","]"));k=`\\${k}`}else He("brackets");le({type:"bracket",value:k});continue}if(k==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){le({type:"text",value:k,output:`\\${k}`});continue}if(v.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(a_("opening","["));le({type:"text",value:k,output:`\\${k}`});continue}Ne("brackets");let z=w.value.slice(1);if(w.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(k=`/${k}`),w.value+=k,$e({value:k}),r.literalBrackets===!1||Sn.hasRegexChars(z))continue;let x=Sn.escapeRegex(w.value);if(v.output=v.output.slice(0,-w.value.length),r.literalBrackets===!0){v.output+=x,w.value=x;continue}w.value=`(${a}${x}|${w.value})`,v.output+=w.value;continue}if(k==="{"&&r.nobrace!==!0){He("braces");let z={type:"brace",value:k,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};$.push(z),le(z);continue}if(k==="}"){let z=$[$.length-1];if(r.nobrace===!0||!z){le({type:"text",value:k,output:k});continue}let x=")";if(z.dots===!0){let I=s.slice(),j=[];for(let B=I.length-1;B>=0&&(s.pop(),I[B].type!=="brace");B--)I[B].type!=="dots"&&j.unshift(I[B].value);x=Lst(j,r),v.backtrack=!0}if(z.comma!==!0&&z.dots!==!0){let I=v.output.slice(0,z.outputIndex),j=v.tokens.slice(z.tokensIndex);z.value=z.output="\\{",k=x="\\}",v.output=I;for(let B of j)v.output+=B.output||B.value}le({type:"brace",value:k,output:x}),Ne("braces"),$.pop();continue}if(k==="|"){oe.length>0&&oe[oe.length-1].conditions++,le({type:"text",value:k});continue}if(k===","){let z=k,x=$[$.length-1];x&&S[S.length-1]==="braces"&&(x.comma=!0,z="|"),le({type:"comma",value:k,output:z});continue}if(k==="/"){if(w.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",s.pop(),w=o;continue}le({type:"slash",value:k,output:p});continue}if(k==="."){if(v.braces>0&&w.type==="dot"){w.value==="."&&(w.output=d);let z=$[$.length-1];w.type="dots",w.output+=k,w.value+=k,z.dots=!0;continue}if(v.braces+v.parens===0&&w.type!=="bos"&&w.type!=="slash"){le({type:"text",value:k,output:d});continue}le({type:"dot",value:k,output:d});continue}if(k==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("qmark",k);continue}if(w&&w.type==="paren"){let x=H(),I=k;if(x==="<"&&!Sn.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(x)||x==="<"&&!/<([!=]|\w+>)/.test(je()))&&(I=`\\${k}`),le({type:"text",value:k,output:I});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){le({type:"qmark",value:k,output:E});continue}le({type:"qmark",value:k,output:T});continue}if(k==="!"){if(r.noextglob!==!0&&H()==="("&&(H(2)!=="?"||!/[!=<:]/.test(H(3)))){me("negate",k);continue}if(r.nonegate!==!0&&v.index===0){Pe();continue}}if(k==="+"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){me("plus",k);continue}if(w&&w.value==="("||r.regex===!1){le({type:"plus",value:k,output:f});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||v.parens>0){le({type:"plus",value:k});continue}le({type:"plus",value:f});continue}if(k==="@"){if(r.noextglob!==!0&&H()==="("&&H(2)!=="?"){le({type:"at",extglob:!0,value:k,output:""});continue}le({type:"text",value:k});continue}if(k!=="*"){(k==="$"||k==="^")&&(k=`\\${k}`);let z=$st.exec(je());z&&(k+=z[0],v.index+=z[0].length),le({type:"text",value:k});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=k,w.output=L,v.backtrack=!0,v.globstar=!0,Ie(k);continue}let re=je();if(r.noextglob!==!0&&/^\([^?]/.test(re)){me("star",k);continue}if(w.type==="star"){if(r.noglobstar===!0){Ie(k);continue}let z=w.prev,x=z.prev,I=z.type==="slash"||z.type==="bos",j=x&&(x.type==="star"||x.type==="globstar");if(r.bash===!0&&(!I||re[0]&&re[0]!=="/")){le({type:"star",value:k,output:""});continue}let B=v.braces>0&&(z.type==="comma"||z.type==="brace"),te=oe.length&&(z.type==="pipe"||z.type==="paren");if(!I&&z.type!=="paren"&&!B&&!te){le({type:"star",value:k,output:""});continue}for(;re.slice(0,3)==="/**";){let ie=t[v.index+4];if(ie&&ie!=="/")break;re=re.slice(3),Ie("/**",3)}if(z.type==="bos"&&Y()){w.type="globstar",w.value+=k,w.output=R(r),v.output=w.output,v.globstar=!0,Ie(k);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!j&&Y()){v.output=v.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=R(r)+(r.strictSlashes?")":"|$)"),w.value+=k,v.globstar=!0,v.output+=z.output+w.output,Ie(k);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&re[0]==="/"){let ie=re[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(z.output+w.output).length),z.output=`(?:${z.output}`,w.type="globstar",w.output=`${R(r)}${p}|${p}${ie})`,w.value+=k,v.output+=z.output+w.output,v.globstar=!0,Ie(k+he()),le({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&re[0]==="/"){w.type="globstar",w.value+=k,w.output=`(?:^|${p}|${R(r)}${p})`,v.output=w.output,v.globstar=!0,Ie(k+he()),le({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-w.output.length),w.type="globstar",w.output=R(r),w.value+=k,v.output+=w.output,v.globstar=!0,Ie(k);continue}let qe={type:"star",value:k,output:L};if(r.bash===!0){qe.output=".*?",(w.type==="bos"||w.type==="slash")&&(qe.output=N+qe.output),le(qe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){qe.output=k,le(qe);continue}(v.index===v.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(v.output+=_,w.output+=_):r.dot===!0?(v.output+=b,w.output+=b):(v.output+=N,w.output+=N),H()!=="*"&&(v.output+=h,w.output+=h)),le(qe)}for(;v.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing","]"));v.output=Sn.escapeLast(v.output,"["),Ne("brackets")}for(;v.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing",")"));v.output=Sn.escapeLast(v.output,"("),Ne("parens")}for(;v.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(a_("closing","}"));v.output=Sn.escapeLast(v.output,"{"),Ne("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&le({type:"maybe_slash",value:"",output:`${p}?`}),v.backtrack===!0){v.output="";for(let re of v.tokens)v.output+=re.output!=null?re.output:re.value,re.suffix&&(v.output+=re.suffix)}return v};H3.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(vN,r.maxLength):vN,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=Dbe[t]||t;let o=Sn.isWindows(e),{DOT_LITERAL:s,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:d,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:h}=Hb.globChars(o),m=r.dot?d:u,g=r.dot?f:u,_=r.capture?"":"?:",b={negated:!1,prefix:""},T=r.bash===!0?".*?":p;r.capture&&(T=`(${T})`);let E=N=>N.noglobstar===!0?T:`(${_}(?:(?!${h}${N.dot?l:s}).)*?)`,A=N=>{switch(N){case"*":return`${m}${c}${T}`;case".*":return`${s}${c}${T}`;case"*.*":return`${m}${T}${s}${c}${T}`;case"*/*":return`${m}${T}${a}${c}${g}${T}`;case"**":return m+E(r);case"**/*":return`(?:${m}${E(r)}${a})?${g}${c}${T}`;case"**/*.*":return`(?:${m}${E(r)}${a})?${g}${T}${s}${c}${T}`;case"**/.*":return`(?:${m}${E(r)}${a})?${s}${c}${T}`;default:{let M=/^(.*?)\.(\w+)$/.exec(N);if(!M)return;let L=A(M[1]);return L?L+s+M[2]:void 0}}},O=Sn.removePrefix(t,b),R=A(O);return R&&r.strictSlashes!==!0&&(R+=`${a}?`),R};Fbe.exports=H3});var Bbe=y((War,jbe)=>{"use strict";var qst=Z("path"),Vst=$be(),W3=zbe(),Y3=Vb(),Gst=qb(),Hst=t=>t&&typeof t=="object"&&!Array.isArray(t),cr=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>cr(f,e,r));return f=>{for(let p of u){let h=p(f);if(h)return h}return!1}}let n=Hst(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=Y3.isWindows(e),s=n?cr.compileRe(t,e):cr.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=cr(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:h}=cr.test(u,s,e,{glob:t,posix:o}),m={glob:t,state:a,regex:s,posix:o,input:u,output:h,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(m),f===!1?(m.isMatch=!1,d?m:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,d?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),d?m:!0)};return r&&(l.state=a),l};cr.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?Y3.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=cr.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};cr.matchBase=(t,e,r,n=Y3.isWindows(r))=>(e instanceof RegExp?e:cr.makeRe(e,r)).test(qst.basename(t));cr.isMatch=(t,e,r)=>cr(e,r)(t);cr.parse=(t,e)=>Array.isArray(t)?t.map(r=>cr.parse(r,e)):W3(t,{...e,fastpaths:!1});cr.scan=(t,e)=>Vst(t,e);cr.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=cr.toRegex(a,e);return n===!0&&(c.state=t),c};cr.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=W3.fastpaths(t,e)),i.output||(i=W3(t,e)),cr.compileRe(i,e,r,n)};cr.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};cr.constants=Gst;jbe.exports=cr});var Vbe=y((Yar,qbe)=>{"use strict";qbe.exports=Bbe()});var Z3=y((Kar,Kbe)=>{"use strict";var Hbe=Z("util"),Wbe=bbe(),na=Vbe(),K3=Vb(),Gbe=t=>t===""||t==="./",Ybe=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Vt=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,o=new Set,s=0,a=u=>{o.add(u.output),r&&r.onResult&&r.onResult(u)};for(let u=0;u<e.length;u++){let d=na(String(e[u]),{...r,onResult:a},!0),f=d.state.negated||d.state.negatedExtglob;f&&s++;for(let p of t){let h=d(p,!0);(f?!h.isMatch:h.isMatch)&&(f?n.add(h.output):(n.delete(h.output),i.add(h.output)))}}let l=(s===e.length?[...o]:[...i]).filter(u=>!n.has(u));if(r&&l.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(u=>u.replace(/\\/g,"")):e}return l};Vt.match=Vt;Vt.matcher=(t,e)=>na(t,e);Vt.isMatch=(t,e,r)=>na(e,r)(t);Vt.any=Vt.isMatch;Vt.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],o=a=>{r.onResult&&r.onResult(a),i.push(a.output)},s=new Set(Vt(t,e,{...r,onResult:o}));for(let a of i)s.has(a)||n.add(a);return[...n]};Vt.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Hbe.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Vt.contains(t,n,r));if(typeof e=="string"){if(Gbe(t)||Gbe(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Vt.isMatch(t,e,{...r,contains:!0})};Vt.matchKeys=(t,e,r)=>{if(!K3.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Vt(Object.keys(t),e,r),i={};for(let o of n)i[o]=t[o];return i};Vt.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=na(String(i),r);if(n.some(s=>o(s)))return!0}return!1};Vt.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let o=na(String(i),r);if(!n.every(s=>o(s)))return!1}return!0};Vt.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${Hbe.inspect(t)}"`);return[].concat(e).every(n=>na(n,r)(t))};Vt.capture=(t,e,r)=>{let n=K3.isWindows(r),o=na.makeRe(String(t),{...r,capture:!0}).exec(n?K3.toPosixSlashes(e):e);if(o)return o.slice(1).map(s=>s===void 0?"":s)};Vt.makeRe=(...t)=>na.makeRe(...t);Vt.scan=(...t)=>na.scan(...t);Vt.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of Wbe(String(n),e))r.push(na.parse(i,e));return r};Vt.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!Ybe(t)?[t]:Wbe(t,e)};Vt.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Vt.braces(t,{...e,expand:!0})};Vt.hasBraces=Ybe;Kbe.exports=Vt});var oTe=y(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.isAbsolute=ke.partitionAbsoluteAndRelative=ke.removeDuplicateSlashes=ke.matchAny=ke.convertPatternsToRe=ke.makeRe=ke.getPatternParts=ke.expandBraceExpansion=ke.expandPatternsWithBraceExpansion=ke.isAffectDepthOfReadingPattern=ke.endsWithSlashGlobStar=ke.hasGlobStar=ke.getBaseDirectory=ke.isPatternRelatedToParentDirectory=ke.getPatternsOutsideCurrentDirectory=ke.getPatternsInsideCurrentDirectory=ke.getPositivePatterns=ke.getNegativePatterns=ke.isPositivePattern=ke.isNegativePattern=ke.convertToNegativePattern=ke.convertToPositivePattern=ke.isDynamicPattern=ke.isStaticPattern=void 0;var Zbe=Z("path"),Wst=zve(),J3=Z3(),Jbe="**",Yst="\\",Kst=/[*?]|^!/,Zst=/\[[^[]*]/,Jst=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Xst=/[!*+?@]\([^(]*\)/,Qst=/,|\.\./,eat=/(?!^)\/{2,}/g;function Xbe(t,e={}){return!Qbe(t,e)}ke.isStaticPattern=Xbe;function Qbe(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Yst)||Kst.test(t)||Zst.test(t)||Jst.test(t)||e.extglob!==!1&&Xst.test(t)||e.braceExpansion!==!1&&tat(t))}ke.isDynamicPattern=Qbe;function tat(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return Qst.test(n)}function rat(t){return bN(t)?t.slice(1):t}ke.convertToPositivePattern=rat;function nat(t){return"!"+t}ke.convertToNegativePattern=nat;function bN(t){return t.startsWith("!")&&t[1]!=="("}ke.isNegativePattern=bN;function eTe(t){return!bN(t)}ke.isPositivePattern=eTe;function iat(t){return t.filter(bN)}ke.getNegativePatterns=iat;function oat(t){return t.filter(eTe)}ke.getPositivePatterns=oat;function sat(t){return t.filter(e=>!X3(e))}ke.getPatternsInsideCurrentDirectory=sat;function aat(t){return t.filter(X3)}ke.getPatternsOutsideCurrentDirectory=aat;function X3(t){return t.startsWith("..")||t.startsWith("./..")}ke.isPatternRelatedToParentDirectory=X3;function cat(t){return Wst(t,{flipBackslashes:!1})}ke.getBaseDirectory=cat;function lat(t){return t.includes(Jbe)}ke.hasGlobStar=lat;function tTe(t){return t.endsWith("/"+Jbe)}ke.endsWithSlashGlobStar=tTe;function uat(t){let e=Zbe.basename(t);return tTe(t)||Xbe(e)}ke.isAffectDepthOfReadingPattern=uat;function dat(t){return t.reduce((e,r)=>e.concat(rTe(r)),[])}ke.expandPatternsWithBraceExpansion=dat;function rTe(t){let e=J3.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}ke.expandBraceExpansion=rTe;function fat(t,e){let{parts:r}=J3.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}ke.getPatternParts=fat;function nTe(t,e){return J3.makeRe(t,e)}ke.makeRe=nTe;function pat(t,e){return t.map(r=>nTe(r,e))}ke.convertPatternsToRe=pat;function hat(t,e){return e.some(r=>r.test(t))}ke.matchAny=hat;function mat(t){return t.replace(eat,"/")}ke.removeDuplicateSlashes=mat;function gat(t){let e=[],r=[];for(let n of t)iTe(n)?e.push(n):r.push(n);return[e,r]}ke.partitionAbsoluteAndRelative=gat;function iTe(t){return Zbe.isAbsolute(t)}ke.isAbsolute=iTe});var lTe=y((Jar,cTe)=>{"use strict";var _at=Z("stream"),sTe=_at.PassThrough,yat=Array.prototype.slice;cTe.exports=Sat;function Sat(){let t=[],e=yat.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,o=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let s=sTe(n);function a(){for(let u=0,d=arguments.length;u<d;u++)t.push(aTe(arguments[u],n));return c(),this}function c(){if(r)return;r=!0;let u=t.shift();if(!u){process.nextTick(l);return}Array.isArray(u)||(u=[u]);let d=u.length+1;function f(){--d>0||(r=!1,c())}function p(h){function m(){h.removeListener("merge2UnpipeEnd",m),h.removeListener("end",m),o&&h.removeListener("error",g),f()}function g(_){s.emit("error",_)}if(h._readableState.endEmitted)return f();h.on("merge2UnpipeEnd",m),h.on("end",m),o&&h.on("error",g),h.pipe(s,{end:!1}),h.resume()}for(let h=0;h<u.length;h++)p(u[h]);f()}function l(){r=!1,s.emit("queueDrain"),i&&s.end()}return s.setMaxListeners(0),s.add=a,s.on("unpipe",function(u){u.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),s}function aTe(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=aTe(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(sTe(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var dTe=y(TN=>{"use strict";Object.defineProperty(TN,"__esModule",{value:!0});TN.merge=void 0;var Eat=lTe();function vat(t){let e=Eat(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>uTe(t)),e.once("end",()=>uTe(t)),e}TN.merge=vat;function uTe(t){t.forEach(e=>e.emit("close"))}});var fTe=y(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.isEmpty=c_.isString=void 0;function bat(t){return typeof t=="string"}c_.isString=bat;function Tat(t){return t===""}c_.isEmpty=Tat});var Ec=y(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.string=En.stream=En.pattern=En.path=En.fs=En.errno=En.array=void 0;var wat=Rve();En.array=wat;var Aat=Cve();En.errno=Aat;var xat=Ive();En.fs=xat;var Rat=kve();En.path=Rat;var Cat=oTe();En.pattern=Cat;var Iat=dTe();En.stream=Iat;var Pat=fTe();En.string=Pat});var gTe=y(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.convertPatternGroupToTask=vn.convertPatternGroupsToTasks=vn.groupPatternsByBaseDirectory=vn.getNegativePatternsAsPositive=vn.getPositivePatterns=vn.convertPatternsToTasks=vn.generate=void 0;var es=Ec();function Oat(t,e){let r=pTe(t,e),n=pTe(e.ignore,e),i=hTe(r),o=mTe(r,n),s=i.filter(u=>es.pattern.isStaticPattern(u,e)),a=i.filter(u=>es.pattern.isDynamicPattern(u,e)),c=Q3(s,o,!1),l=Q3(a,o,!0);return c.concat(l)}vn.generate=Oat;function pTe(t,e){let r=t;return e.braceExpansion&&(r=es.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>es.pattern.removeDuplicateSlashes(n))}function Q3(t,e,r){let n=[],i=es.pattern.getPatternsOutsideCurrentDirectory(t),o=es.pattern.getPatternsInsideCurrentDirectory(t),s=eW(i),a=eW(o);return n.push(...tW(s,e,r)),"."in a?n.push(rW(".",o,e,r)):n.push(...tW(a,e,r)),n}vn.convertPatternsToTasks=Q3;function hTe(t){return es.pattern.getPositivePatterns(t)}vn.getPositivePatterns=hTe;function mTe(t,e){return es.pattern.getNegativePatterns(t).concat(e).map(es.pattern.convertToPositivePattern)}vn.getNegativePatternsAsPositive=mTe;function eW(t){let e={};return t.reduce((r,n)=>{let i=es.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}vn.groupPatternsByBaseDirectory=eW;function tW(t,e,r){return Object.keys(t).map(n=>rW(n,t[n],e,r))}vn.convertPatternGroupsToTasks=tW;function rW(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(es.pattern.convertToNegativePattern))}}vn.convertPatternGroupToTask=rW});var yTe=y(wN=>{"use strict";Object.defineProperty(wN,"__esModule",{value:!0});wN.read=void 0;function Nat(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){_Te(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){nW(r,i);return}e.fs.stat(t,(o,s)=>{if(o!==null){if(e.throwErrorOnBrokenSymbolicLink){_Te(r,o);return}nW(r,i);return}e.markSymbolicLink&&(s.isSymbolicLink=()=>!0),nW(r,s)})})}wN.read=Nat;function _Te(t,e){t(e)}function nW(t,e){t(null,e)}});var STe=y(AN=>{"use strict";Object.defineProperty(AN,"__esModule",{value:!0});AN.read=void 0;function kat(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}AN.read=kat});var ETe=y(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.createFileSystemAdapter=uu.FILE_SYSTEM_ADAPTER=void 0;var xN=Z("fs");uu.FILE_SYSTEM_ADAPTER={lstat:xN.lstat,stat:xN.stat,lstatSync:xN.lstatSync,statSync:xN.statSync};function Mat(t){return t===void 0?uu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},uu.FILE_SYSTEM_ADAPTER),t)}uu.createFileSystemAdapter=Mat});var vTe=y(oW=>{"use strict";Object.defineProperty(oW,"__esModule",{value:!0});var $at=ETe(),iW=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=$at.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};oW.default=iW});var Pf=y(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.statSync=du.stat=du.Settings=void 0;var bTe=yTe(),Dat=STe(),sW=vTe();du.Settings=sW.default;function Lat(t,e,r){if(typeof e=="function"){bTe.read(t,aW(),e);return}bTe.read(t,aW(e),r)}du.stat=Lat;function Uat(t,e){let r=aW(e);return Dat.read(t,r)}du.statSync=Uat;function aW(t={}){return t instanceof sW.default?t:new sW.default(t)}});var ATe=y((acr,wTe)=>{"use strict";var TTe;wTe.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(TTe||(TTe=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var RTe=y((ccr,xTe)=>{"use strict";xTe.exports=zat;var Fat=ATe();function zat(t,e){let r,n,i,o=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function s(c){function l(){e&&e(c,r),e=null}o?Fat(l):l()}function a(c,l,u){r[c]=u,(--n===0||l)&&s(l)}n?i?i.forEach(function(c){t[c](function(l,u){a(c,l,u)})}):t.forEach(function(c,l){c(function(u,d){a(l,u,d)})}):s(null),o=!1}});var cW=y(CN=>{"use strict";Object.defineProperty(CN,"__esModule",{value:!0});CN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var RN=process.versions.node.split(".");if(RN[0]===void 0||RN[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var CTe=Number.parseInt(RN[0],10),jat=Number.parseInt(RN[1],10),ITe=10,Bat=10,qat=CTe>ITe,Vat=CTe===ITe&&jat>=Bat;CN.IS_SUPPORT_READDIR_WITH_FILE_TYPES=qat||Vat});var PTe=y(IN=>{"use strict";Object.defineProperty(IN,"__esModule",{value:!0});IN.createDirentFromStats=void 0;var lW=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Gat(t,e){return new lW(t,e)}IN.createDirentFromStats=Gat});var uW=y(PN=>{"use strict";Object.defineProperty(PN,"__esModule",{value:!0});PN.fs=void 0;var Hat=PTe();PN.fs=Hat});var dW=y(ON=>{"use strict";Object.defineProperty(ON,"__esModule",{value:!0});ON.joinPathSegments=void 0;function Wat(t,e,r){return t.endsWith(r)?t+e:t+r+e}ON.joinPathSegments=Wat});var DTe=y(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.readdir=fu.readdirWithFileTypes=fu.read=void 0;var Yat=Pf(),OTe=RTe(),Kat=cW(),NTe=uW(),kTe=dW();function Zat(t,e,r){if(!e.stats&&Kat.IS_SUPPORT_READDIR_WITH_FILE_TYPES){MTe(t,e,r);return}$Te(t,e,r)}fu.read=Zat;function MTe(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){NN(r,n);return}let o=i.map(a=>({dirent:a,name:a.name,path:kTe.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){fW(r,o);return}let s=o.map(a=>Jat(a,e));OTe(s,(a,c)=>{if(a!==null){NN(r,a);return}fW(r,c)})})}fu.readdirWithFileTypes=MTe;function Jat(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=NTe.fs.createDirentFromStats(t.name,i),r(null,t)})}}function $Te(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){NN(r,n);return}let o=i.map(s=>{let a=kTe.joinPathSegments(t,s,e.pathSegmentSeparator);return c=>{Yat.stat(a,e.fsStatSettings,(l,u)=>{if(l!==null){c(l);return}let d={name:s,path:a,dirent:NTe.fs.createDirentFromStats(s,u)};e.stats&&(d.stats=u),c(null,d)})}});OTe(o,(s,a)=>{if(s!==null){NN(r,s);return}fW(r,a)})})}fu.readdir=$Te;function NN(t,e){t(e)}function fW(t,e){t(null,e)}});var jTe=y(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.readdir=pu.readdirWithFileTypes=pu.read=void 0;var Xat=Pf(),Qat=cW(),LTe=uW(),UTe=dW();function ect(t,e){return!e.stats&&Qat.IS_SUPPORT_READDIR_WITH_FILE_TYPES?FTe(t,e):zTe(t,e)}pu.read=ect;function FTe(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:UTe.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let o=e.fs.statSync(i.path);i.dirent=LTe.fs.createDirentFromStats(i.name,o)}catch(o){if(e.throwErrorOnBrokenSymbolicLink)throw o}return i})}pu.readdirWithFileTypes=FTe;function zTe(t,e){return e.fs.readdirSync(t).map(n=>{let i=UTe.joinPathSegments(t,n,e.pathSegmentSeparator),o=Xat.statSync(i,e.fsStatSettings),s={name:n,path:i,dirent:LTe.fs.createDirentFromStats(n,o)};return e.stats&&(s.stats=o),s})}pu.readdir=zTe});var BTe=y(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.createFileSystemAdapter=hu.FILE_SYSTEM_ADAPTER=void 0;var l_=Z("fs");hu.FILE_SYSTEM_ADAPTER={lstat:l_.lstat,stat:l_.stat,lstatSync:l_.lstatSync,statSync:l_.statSync,readdir:l_.readdir,readdirSync:l_.readdirSync};function tct(t){return t===void 0?hu.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},hu.FILE_SYSTEM_ADAPTER),t)}hu.createFileSystemAdapter=tct});var qTe=y(hW=>{"use strict";Object.defineProperty(hW,"__esModule",{value:!0});var rct=Z("path"),nct=Pf(),ict=BTe(),pW=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=ict.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,rct.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new nct.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};hW.default=pW});var kN=y(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.Settings=mu.scandirSync=mu.scandir=void 0;var VTe=DTe(),oct=jTe(),mW=qTe();mu.Settings=mW.default;function sct(t,e,r){if(typeof e=="function"){VTe.read(t,gW(),e);return}VTe.read(t,gW(e),r)}mu.scandir=sct;function act(t,e){let r=gW(e);return oct.read(t,r)}mu.scandirSync=act;function gW(t={}){return t instanceof mW.default?t:new mW.default(t)}});var HTe=y((ycr,GTe)=>{"use strict";function cct(t){var e=new t,r=e;function n(){var o=e;return o.next?e=o.next:(e=new t,r=e),o.next=null,o}function i(o){r.next=o,r=o}return{get:n,release:i}}GTe.exports=cct});var YTe=y((Scr,_W)=>{"use strict";var lct=HTe();function WTe(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=lct(uct),i=null,o=null,s=0,a=null,c={push:m,drain:li,saturated:li,pause:u,paused:!1,get concurrency(){return r},set concurrency(O){if(!(O>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=O,!c.paused)for(;i&&s<r;)s++,_()},running:l,resume:p,idle:h,length:d,getQueue:f,unshift:g,empty:li,kill:b,killAndDrain:T,error:A,abort:E};return c;function l(){return s}function u(){c.paused=!0}function d(){for(var O=i,R=0;O;)O=O.next,R++;return R}function f(){for(var O=i,R=[];O;)R.push(O.value),O=O.next;return R}function p(){if(c.paused){if(c.paused=!1,i===null){s++,_();return}for(;i&&s<r;)s++,_()}}function h(){return s===0&&c.length()===0}function m(O,R){var N=n.get();N.context=t,N.release=_,N.value=O,N.callback=R||li,N.errorHandler=a,s>=r||c.paused?o?(o.next=N,o=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function g(O,R){var N=n.get();N.context=t,N.release=_,N.value=O,N.callback=R||li,N.errorHandler=a,s>=r||c.paused?i?(N.next=i,i=N):(i=N,o=N,c.saturated()):(s++,e.call(t,N.value,N.worked))}function _(O){O&&n.release(O);var R=i;R&&s<=r?c.paused?s--:(o===i&&(o=null),i=R.next,R.next=null,e.call(t,R.value,R.worked),o===null&&c.empty()):--s===0&&c.drain()}function b(){i=null,o=null,c.drain=li}function T(){i=null,o=null,c.drain(),c.drain=li}function E(){var O=i;for(i=null,o=null;O;){var R=O.next,N=O.callback,M=O.errorHandler,L=O.value,v=O.context;O.value=null,O.callback=li,O.errorHandler=null,M&&M(new Error("abort"),L),N.call(v,new Error("abort")),O.release(O),O=R}c.drain=li}function A(O){a=O}}function li(){}function uct(){this.value=null,this.callback=li,this.next=null,this.release=li,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,o=t.errorHandler,s=t.value;t.value=null,t.callback=li,t.errorHandler&&o(r,s),i.call(t.context,r,n),t.release(t)}}function dct(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(u,d){e.call(this,u).then(function(f){d(null,f)},d)}var i=WTe(t,n,r),o=i.push,s=i.unshift;return i.push=a,i.unshift=c,i.drained=l,i;function a(u){var d=new Promise(function(f,p){o(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(li),d}function c(u){var d=new Promise(function(f,p){s(u,function(h,m){if(h){p(h);return}f(m)})});return d.catch(li),d}function l(){var u=new Promise(function(d){process.nextTick(function(){if(i.idle())d();else{var f=i.drain;i.drain=function(){typeof f=="function"&&f(),d(),i.drain=f}}})});return u}}_W.exports=WTe;_W.exports.promise=dct});var MN=y(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.joinPathSegments=ia.replacePathSegmentSeparator=ia.isAppliedFilter=ia.isFatalError=void 0;function fct(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}ia.isFatalError=fct;function pct(t,e){return t===null||t(e)}ia.isAppliedFilter=pct;function hct(t,e){return t.split(/[/\\]/).join(e)}ia.replacePathSegmentSeparator=hct;function mct(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}ia.joinPathSegments=mct});var EW=y(SW=>{"use strict";Object.defineProperty(SW,"__esModule",{value:!0});var gct=MN(),yW=class{constructor(e,r){this._root=e,this._settings=r,this._root=gct.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};SW.default=yW});var TW=y(bW=>{"use strict";Object.defineProperty(bW,"__esModule",{value:!0});var _ct=Z("events"),yct=kN(),Sct=YTe(),$N=MN(),Ect=EW(),vW=class extends Ect.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=yct.scandir,this._emitter=new _ct.EventEmitter,this._queue=Sct(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let o of i)this._handleEntry(o,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!$N.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=$N.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),$N.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&$N.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};bW.default=vW});var KTe=y(AW=>{"use strict";Object.defineProperty(AW,"__esModule",{value:!0});var vct=TW(),wW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new vct.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{bct(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Tct(e,this._storage)}),this._reader.read()}};AW.default=wW;function bct(t,e){t(e)}function Tct(t,e){t(null,e)}});var ZTe=y(RW=>{"use strict";Object.defineProperty(RW,"__esModule",{value:!0});var wct=Z("stream"),Act=TW(),xW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Act.default(this._root,this._settings),this._stream=new wct.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};RW.default=xW});var JTe=y(IW=>{"use strict";Object.defineProperty(IW,"__esModule",{value:!0});var xct=kN(),DN=MN(),Rct=EW(),CW=class extends Rct.default{constructor(){super(...arguments),this._scandir=xct.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(DN.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=DN.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),DN.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&DN.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};IW.default=CW});var XTe=y(OW=>{"use strict";Object.defineProperty(OW,"__esModule",{value:!0});var Cct=JTe(),PW=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Cct.default(this._root,this._settings)}read(){return this._reader.read()}};OW.default=PW});var QTe=y(kW=>{"use strict";Object.defineProperty(kW,"__esModule",{value:!0});var Ict=Z("path"),Pct=kN(),NW=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Ict.sep),this.fsScandirSettings=new Pct.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};kW.default=NW});var UN=y(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.Settings=oa.walkStream=oa.walkSync=oa.walk=void 0;var ewe=KTe(),Oct=ZTe(),Nct=XTe(),MW=QTe();oa.Settings=MW.default;function kct(t,e,r){if(typeof e=="function"){new ewe.default(t,LN()).read(e);return}new ewe.default(t,LN(e)).read(r)}oa.walk=kct;function Mct(t,e){let r=LN(e);return new Nct.default(t,r).read()}oa.walkSync=Mct;function $ct(t,e){let r=LN(e);return new Oct.default(t,r).read()}oa.walkStream=$ct;function LN(t={}){return t instanceof MW.default?t:new MW.default(t)}});var FN=y(DW=>{"use strict";Object.defineProperty(DW,"__esModule",{value:!0});var Dct=Z("path"),Lct=Pf(),twe=Ec(),$W=class{constructor(e){this._settings=e,this._fsStatSettings=new Lct.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Dct.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:twe.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!twe.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};DW.default=$W});var FW=y(UW=>{"use strict";Object.defineProperty(UW,"__esModule",{value:!0});var Uct=Z("stream"),Fct=Pf(),zct=UN(),jct=FN(),LW=class extends jct.default{constructor(){super(...arguments),this._walkStream=zct.walkStream,this._stat=Fct.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new Uct.PassThrough({objectMode:!0});i._write=(o,s,a)=>this._getEntry(n[o],e[o],r).then(c=>{c!==null&&r.entryFilter(c)&&i.push(c),o===n.length-1&&i.end(),a()}).catch(a);for(let o=0;o<n.length;o++)i.write(o);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,o)=>i===null?r(o):n(i))})}};UW.default=LW});var rwe=y(jW=>{"use strict";Object.defineProperty(jW,"__esModule",{value:!0});var Bct=UN(),qct=FN(),Vct=FW(),zW=class extends qct.default{constructor(){super(...arguments),this._walkAsync=Bct.walk,this._readerStream=new Vct.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(o,s)=>{o===null?n(s):i(o)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((o,s)=>{i.once("error",s),i.on("data",a=>n.push(a)),i.once("end",()=>o(n))})}};jW.default=zW});var nwe=y(qW=>{"use strict";Object.defineProperty(qW,"__esModule",{value:!0});var Wb=Ec(),BW=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Wb.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Wb.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Wb.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Wb.array.splitWhen(e,r=>r.dynamic&&Wb.pattern.hasGlobStar(r.pattern))}};qW.default=BW});var iwe=y(GW=>{"use strict";Object.defineProperty(GW,"__esModule",{value:!0});var Gct=nwe(),VW=class extends Gct.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(o=>!o.complete||o.segments.length>n);for(let o of i){let s=o.sections[0];if(!o.complete&&n>s.length||r.every((c,l)=>{let u=o.segments[l];return!!(u.dynamic&&u.patternRe.test(c)||!u.dynamic&&u.pattern===c)}))return!0}return!1}};GW.default=VW});var owe=y(WW=>{"use strict";Object.defineProperty(WW,"__esModule",{value:!0});var zN=Ec(),Hct=iwe(),HW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),o=this._getNegativePatternsRe(n);return s=>this._filter(e,s,i,o)}_getMatcher(e){return new Hct.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(zN.pattern.isAffectDepthOfReadingPattern);return zN.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let o=zN.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(o,n)?!1:this._isSkippedByNegativePatterns(o,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!zN.pattern.matchAny(e,r)}};WW.default=HW});var swe=y(KW=>{"use strict";Object.defineProperty(KW,"__esModule",{value:!0});var gu=Ec(),YW=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=gu.pattern.partitionAbsoluteAndRelative(r),o={positive:{all:gu.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:gu.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:gu.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return s=>this._filter(s,o)}_filter(e,r){let n=gu.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=gu.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=gu.pattern.matchAny(e,r);return!i&&n?gu.pattern.matchAny(e+"/",r):i}};KW.default=YW});var awe=y(JW=>{"use strict";Object.defineProperty(JW,"__esModule",{value:!0});var Wct=Ec(),ZW=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Wct.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};JW.default=ZW});var lwe=y(QW=>{"use strict";Object.defineProperty(QW,"__esModule",{value:!0});var cwe=Ec(),XW=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=cwe.path.makeAbsolute(this._settings.cwd,r),r=cwe.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};QW.default=XW});var jN=y(tY=>{"use strict";Object.defineProperty(tY,"__esModule",{value:!0});var Yct=Z("path"),Kct=owe(),Zct=swe(),Jct=awe(),Xct=lwe(),eY=class{constructor(e){this._settings=e,this.errorFilter=new Jct.default(this._settings),this.entryFilter=new Zct.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Kct.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Xct.default(this._settings)}_getRootDirectory(e){return Yct.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};tY.default=eY});var uwe=y(nY=>{"use strict";Object.defineProperty(nY,"__esModule",{value:!0});var Qct=rwe(),elt=jN(),rY=class extends elt.default{constructor(){super(...arguments),this._reader=new Qct.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(o=>n.transform(o))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};nY.default=rY});var dwe=y(oY=>{"use strict";Object.defineProperty(oY,"__esModule",{value:!0});var tlt=Z("stream"),rlt=FW(),nlt=jN(),iY=class extends nlt.default{constructor(){super(...arguments),this._reader=new rlt.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),o=new tlt.Readable({objectMode:!0,read:()=>{}});return i.once("error",s=>o.emit("error",s)).on("data",s=>o.emit("data",n.transform(s))).once("end",()=>o.emit("end")),o.once("close",()=>i.destroy()),o}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};oY.default=iY});var fwe=y(aY=>{"use strict";Object.defineProperty(aY,"__esModule",{value:!0});var ilt=Pf(),olt=UN(),slt=FN(),sY=class extends slt.default{constructor(){super(...arguments),this._walkSync=olt.walkSync,this._statSync=ilt.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let o=this._getFullEntryPath(i),s=this._getEntry(o,i,r);s===null||!r.entryFilter(s)||n.push(s)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};aY.default=sY});var pwe=y(lY=>{"use strict";Object.defineProperty(lY,"__esModule",{value:!0});var alt=fwe(),clt=jN(),cY=class extends clt.default{constructor(){super(...arguments),this._reader=new alt.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};lY.default=cY});var hwe=y(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var u_=Z("fs"),llt=Z("os"),ult=Math.max(llt.cpus().length,1);d_.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:u_.lstat,lstatSync:u_.lstatSync,stat:u_.stat,statSync:u_.statSync,readdir:u_.readdir,readdirSync:u_.readdirSync};var uY=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,ult),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},d_.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};d_.default=uY});var Yb=y((Vcr,gwe)=>{"use strict";var mwe=gTe(),dlt=uwe(),flt=dwe(),plt=pwe(),dY=hwe(),co=Ec();async function fY(t,e){ts(t);let r=pY(t,dlt.default,e),n=await Promise.all(r);return co.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(l,u){ts(l);let d=pY(l,plt.default,u);return co.array.flatten(d)}t.sync=e;function r(l,u){ts(l);let d=pY(l,flt.default,u);return co.stream.merge(d)}t.stream=r;function n(l,u){ts(l);let d=[].concat(l),f=new dY.default(u);return mwe.generate(d,f)}t.generateTasks=n;function i(l,u){ts(l);let d=new dY.default(u);return co.pattern.isDynamicPattern(l,d)}t.isDynamicPattern=i;function o(l){return ts(l),co.path.escape(l)}t.escapePath=o;function s(l){return ts(l),co.path.convertPathToPattern(l)}t.convertPathToPattern=s;let a;(function(l){function u(f){return ts(f),co.path.escapePosixPath(f)}l.escapePath=u;function d(f){return ts(f),co.path.convertPosixPathToPattern(f)}l.convertPathToPattern=d})(a=t.posix||(t.posix={}));let c;(function(l){function u(f){return ts(f),co.path.escapeWindowsPath(f)}l.escapePath=u;function d(f){return ts(f),co.path.convertWindowsPathToPattern(f)}l.convertPathToPattern=d})(c=t.win32||(t.win32={}))})(fY||(fY={}));function pY(t,e,r){let n=[].concat(t),i=new dY.default(r),o=mwe.generate(n,i),s=new e(i);return o.map(s.read,s)}function ts(t){if(![].concat(t).every(n=>co.string.isString(n)&&!co.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}gwe.exports=fY});var bY=y((Xcr,VN)=>{"use strict";function vwe(t){return Array.isArray(t)?t:[t]}var glt=void 0,_Y="",Swe=" ",gY="\\",_lt=/^\s+$/,ylt=/(?:[^\\]|^)\\$/,Slt=/^\\!/,Elt=/^\\#/,vlt=/\r?\n/g,blt=/^\.{0,2}\/|^\.{1,2}$/,Tlt=/\/$/,f_="/",bwe="node-ignore";typeof Symbol<"u"&&(bwe=Symbol.for("node-ignore"));var Twe=bwe,p_=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),wlt=/([0-z])-([0-z])/g,wwe=()=>!1,Alt=t=>t.replace(wlt,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:_Y),xlt=t=>{let{length:e}=t;return t.slice(0,e-e%2)},Rlt=[[/^\uFEFF/,()=>_Y],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?Swe:_Y)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+Swe}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>gY],[/\\\\/g,()=>gY],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===gY?`\\[${r}${xlt(n)}${i}`:i==="]"&&n.length%2===0?`[${Alt(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],Clt=/(^|\\\/)?\\\*$/,Kb="regex",BN="checkRegex",Ewe="_",Ilt={[Kb](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[BN](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},Plt=t=>Rlt.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),qN=t=>typeof t=="string",Olt=t=>t&&qN(t)&&!_lt.test(t)&&!ylt.test(t)&&t.indexOf("#")!==0,Nlt=t=>t.split(vlt).filter(Boolean),yY=class{constructor(e,r,n,i,o,s){this.pattern=e,this.mark=r,this.negative=o,p_(this,"body",n),p_(this,"ignoreCase",i),p_(this,"regexPrefix",s)}get regex(){let e=Ewe+Kb;return this[e]?this[e]:this._make(Kb,e)}get checkRegex(){let e=Ewe+BN;return this[e]?this[e]:this._make(BN,e)}_make(e,r){let n=this.regexPrefix.replace(Clt,Ilt[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return p_(this,r,i)}},klt=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(Slt,"!").replace(Elt,"#");let o=Plt(i);return new yY(t,e,i,r,n,o)},SY=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Twe]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(qN(e)&&(e={pattern:e}),Olt(e.pattern)){let r=klt(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,vwe(qN(e)?Nlt(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,o=!1,s;this._rules.forEach(c=>{let{negative:l}=c;o===l&&i!==o||l&&!i&&!o&&!r||!c[n].test(e)||(i=!l,o=l,s=l?glt:c)});let a={ignored:i,unignored:o};return s&&(a.rule=s),a}},Mlt=(t,e)=>{throw new e(t)},vc=(t,e,r)=>qN(t)?t?vc.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),Awe=t=>blt.test(t);vc.isNotRelative=Awe;vc.convert=t=>t;var EY=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){p_(this,Twe,!0),this._rules=new SY(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let o=e&&vc.convert(e);return vc(o,e,this._strictPathCheck?Mlt:wwe),this._t(o,r,n,i)}checkIgnore(e){if(!Tlt.test(e))return this.test(e);let r=e.split(f_).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(f_)+f_,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,BN)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(f_).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,Kb);let o=this._t(i.join(f_)+f_,r,n,i);return r[e]=o.ignored?o:this._rules.test(e,n,Kb)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return vwe(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},vY=t=>new EY(t),$lt=t=>vc(t&&vc.convert(t),t,wwe),xwe=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");vc.convert=t;let e=/^[a-z]:\//i;vc.isNotRelative=r=>e.test(r)||Awe(r)};typeof process<"u"&&process.platform==="win32"&&xwe();VN.exports=vY;vY.default=vY;VN.exports.isPathValid=$lt;p_(VN.exports,Symbol.for("setupWindows"),xwe)});var tK=y(xxe=>{"use strict";xxe.parse=function(t,e){return new eK(t,e).parse()};var eK=class t{constructor(e,r){this.source=e,this.transform=r||lft,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e==="\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var r;(this.recorded.length>0||e)&&(r=this.recorded.join(""),r==="NULL"&&!e&&(r=null),r!==null&&(r=this.transform(r)),this.entries.push(r),this.recorded=[])}consumeDimensions(){if(this.source[0]==="[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var r,n,i;for(this.consumeDimensions();!this.isEof();)if(r=this.nextCharacter(),r.value==="{"&&!i)this.dimension++,this.dimension>1&&(n=new t(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);else if(r.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),e))return this.entries}else r.value==='"'&&!r.escaped?(i&&this.newEntry(!0),i=!i):r.value===","&&!i?this.newEntry():this.record(r.value);if(this.dimension!==0)throw new Error("array dimension not balanced");return this.entries}};function lft(t){return t}});var rK=y((hpr,Rxe)=>{"use strict";var uft=tK();Rxe.exports={create:function(t,e){return{parse:function(){return uft.parse(t,e)}}}}});var Pxe=y((mpr,Ixe)=>{"use strict";var dft=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,fft=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,pft=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,hft=/^-?infinity$/;Ixe.exports=function(e){if(hft.test(e))return Number(e.replace("i","I"));var r=dft.exec(e);if(!r)return mft(e)||null;var n=!!r[8],i=parseInt(r[1],10);n&&(i=Cxe(i));var o=parseInt(r[2],10)-1,s=r[3],a=parseInt(r[4],10),c=parseInt(r[5],10),l=parseInt(r[6],10),u=r[7];u=u?1e3*parseFloat(u):0;var d,f=gft(e);return f!=null?(d=new Date(Date.UTC(i,o,s,a,c,l,u)),nK(i)&&d.setUTCFullYear(i),f!==0&&d.setTime(d.getTime()-f)):(d=new Date(i,o,s,a,c,l,u),nK(i)&&d.setFullYear(i)),d};function mft(t){var e=fft.exec(t);if(e){var r=parseInt(e[1],10),n=!!e[4];n&&(r=Cxe(r));var i=parseInt(e[2],10)-1,o=e[3],s=new Date(r,i,o);return nK(r)&&s.setFullYear(r),s}}function gft(t){if(t.endsWith("+00"))return 0;var e=pft.exec(t.split(" ")[1]);if(e){var r=e[1];if(r==="Z")return 0;var n=r==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt(e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}function Cxe(t){return-(t-1)}function nK(t){return t>=0&&t<100}});var Nxe=y((gpr,Oxe)=>{"use strict";Oxe.exports=yft;var _ft=Object.prototype.hasOwnProperty;function yft(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)_ft.call(r,n)&&(t[n]=r[n])}return t}});var $xe=y((_pr,Mxe)=>{"use strict";var Sft=Nxe();Mxe.exports=T_;function T_(t){if(!(this instanceof T_))return new T_(t);Sft(this,Oft(t))}var Eft=["seconds","minutes","hours","days","months","years"];T_.prototype.toPostgres=function(){var t=Eft.filter(this.hasOwnProperty,this);return this.milliseconds&&t.indexOf("seconds")<0&&t.push("seconds"),t.length===0?"0":t.map(function(e){var r=this[e]||0;return e==="seconds"&&this.milliseconds&&(r=(r+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),r+" "+e},this).join(" ")};var vft={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},bft=["years","months","days"],Tft=["hours","minutes","seconds"];T_.prototype.toISOString=T_.prototype.toISO=function(){var t=bft.map(r,this).join(""),e=Tft.map(r,this).join("");return"P"+t+"T"+e;function r(n){var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),i+vft[n]}};var iK="([+-]?\\d+)",wft=iK+"\\s+years?",Aft=iK+"\\s+mons?",xft=iK+"\\s+days?",Rft="([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Cft=new RegExp([wft,Aft,xft,Rft].map(function(t){return"("+t+")?"}).join("\\s*")),kxe={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},Ift=["hours","minutes","seconds","milliseconds"];function Pft(t){var e=t+"000000".slice(t.length);return parseInt(e,10)/1e3}function Oft(t){if(!t)return{};var e=Cft.exec(t),r=e[8]==="-";return Object.keys(kxe).reduce(function(n,i){var o=kxe[i],s=e[o];return!s||(s=i==="milliseconds"?Pft(s):parseInt(s,10),!s)||(r&&~Ift.indexOf(i)&&(s*=-1),n[i]=s),n},{})}});var Uxe=y((ypr,Lxe)=>{"use strict";var Dxe=Buffer.from||Buffer;Lxe.exports=function(e){if(/^\\x/.test(e))return Dxe(e.substr(2),"hex");for(var r="",n=0;n<e.length;)if(e[n]!=="\\")r+=e[n],++n;else if(/[0-7]{3}/.test(e.substr(n+1,3)))r+=String.fromCharCode(parseInt(e.substr(n+1,3),8)),n+=4;else{for(var i=1;n+i<e.length&&e[n+i]==="\\";)i++;for(var o=0;o<Math.floor(i/2);++o)r+="\\";n+=Math.floor(i/2)*2}return Dxe(r,"binary")}});var Gxe=y((Spr,Vxe)=>{"use strict";var sT=tK(),aT=rK(),ik=Pxe(),zxe=$xe(),jxe=Uxe();function ok(t){return function(r){return r===null?r:t(r)}}function Bxe(t){return t===null?t:t==="TRUE"||t==="t"||t==="true"||t==="y"||t==="yes"||t==="on"||t==="1"}function Nft(t){return t?sT.parse(t,Bxe):null}function kft(t){return parseInt(t,10)}function oK(t){return t?sT.parse(t,ok(kft)):null}function Mft(t){return t?sT.parse(t,ok(function(e){return qxe(e).trim()})):null}var $ft=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=lK(r)),r});return e.parse()},sK=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=parseFloat(r)),r});return e.parse()},lo=function(t){if(!t)return null;var e=aT.create(t);return e.parse()},aK=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=ik(r)),r});return e.parse()},Dft=function(t){if(!t)return null;var e=aT.create(t,function(r){return r!==null&&(r=zxe(r)),r});return e.parse()},Lft=function(t){return t?sT.parse(t,ok(jxe)):null},cK=function(t){return parseInt(t,10)},qxe=function(t){var e=String(t);return/^\d+$/.test(e)?e:t},Fxe=function(t){return t?sT.parse(t,ok(JSON.parse)):null},lK=function(t){return t[0]!=="("?null:(t=t.substring(1,t.length-1).split(","),{x:parseFloat(t[0]),y:parseFloat(t[1])})},Uft=function(t){if(t[0]!=="<"&&t[1]!=="(")return null;for(var e="(",r="",n=!1,i=2;i<t.length-1;i++){if(n||(e+=t[i]),t[i]===")"){n=!0;continue}else if(!n)continue;t[i]!==","&&(r+=t[i])}var o=lK(e);return o.radius=parseFloat(r),o},Fft=function(t){t(20,qxe),t(21,cK),t(23,cK),t(26,cK),t(700,parseFloat),t(701,parseFloat),t(16,Bxe),t(1082,ik),t(1114,ik),t(1184,ik),t(600,lK),t(651,lo),t(718,Uft),t(1e3,Nft),t(1001,Lft),t(1005,oK),t(1007,oK),t(1028,oK),t(1016,Mft),t(1017,$ft),t(1021,sK),t(1022,sK),t(1231,sK),t(1014,lo),t(1015,lo),t(1008,lo),t(1009,lo),t(1040,lo),t(1041,lo),t(1115,aK),t(1182,aK),t(1185,aK),t(1186,zxe),t(1187,Dft),t(17,jxe),t(114,JSON.parse.bind(JSON)),t(3802,JSON.parse.bind(JSON)),t(199,Fxe),t(3807,Fxe),t(3907,lo),t(2951,lo),t(791,lo),t(1183,lo),t(1270,lo)};Vxe.exports={init:Fft}});var Wxe=y((Epr,Hxe)=>{"use strict";var ui=1e6;function zft(t){var e=t.readInt32BE(0),r=t.readUInt32BE(4),n="";e<0&&(e=~e+(r===0),r=~r+1>>>0,n="-");var i="",o,s,a,c,l,u;{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}{if(o=e%ui,e=e/ui>>>0,s=4294967296*o+r,r=s/ui>>>0,a=""+(s-ui*r),r===0&&e===0)return n+a+i;for(c="",l=6-a.length,u=0;u<l;u++)c+="0";i=c+a+i}return o=e%ui,s=4294967296*o+r,a=""+s%ui,n+a+i}Hxe.exports=zft});var Xxe=y((vpr,Jxe)=>{"use strict";var jft=Wxe(),Zt=function(t,e,r,n,i){r=r||0,n=n||!1,i=i||function(p,h,m){return p*Math.pow(2,m)+h};var o=r>>3,s=function(p){return n?~p&255:p},a=255,c=8-r%8;e<c&&(a=255<<8-e&255,c=e),r&&(a=a>>r%8);var l=0;r%8+e>=8&&(l=i(0,s(t[o])&a,c));for(var u=e+r>>3,d=o+1;d<u;d++)l=i(l,s(t[d]),8);var f=(e+r)%8;return f>0&&(l=i(l,s(t[u])>>8-f,f)),l},Zxe=function(t,e,r){var n=Math.pow(2,r-1)-1,i=Zt(t,1),o=Zt(t,r,1);if(o===0)return 0;var s=1,a=function(l,u,d){l===0&&(l=1);for(var f=1;f<=d;f++)s/=2,(u&1<<d-f)>0&&(l+=s);return l},c=Zt(t,e,r+1,!1,a);return o==Math.pow(2,r+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,o-n)*c},Bft=function(t){return Zt(t,1)==1?-1*(Zt(t,15,1,!0)+1):Zt(t,15,1)},Yxe=function(t){return Zt(t,1)==1?-1*(Zt(t,31,1,!0)+1):Zt(t,31,1)},qft=function(t){return Zxe(t,23,8)},Vft=function(t){return Zxe(t,52,11)},Gft=function(t){var e=Zt(t,16,32);if(e==49152)return NaN;for(var r=Math.pow(1e4,Zt(t,16,16)),n=0,i=[],o=Zt(t,16),s=0;s<o;s++)n+=Zt(t,16,64+16*s)*r,r/=1e4;var a=Math.pow(10,Zt(t,16,48));return(e===0?1:-1)*Math.round(n*a)/a},Kxe=function(t,e){var r=Zt(e,1),n=Zt(e,63,1),i=new Date((r===0?1:-1)*n/1e3+9466848e5);return t||i.setTime(i.getTime()+i.getTimezoneOffset()*6e4),i.usec=n%1e3,i.getMicroSeconds=function(){return this.usec},i.setMicroSeconds=function(o){this.usec=o},i.getUTCMicroSeconds=function(){return this.usec},i},cT=function(t){for(var e=Zt(t,32),r=Zt(t,32,32),n=Zt(t,32,64),i=96,o=[],s=0;s<e;s++)o[s]=Zt(t,32,i),i+=32,i+=32;var a=function(l){var u=Zt(t,32,i);if(i+=32,u==4294967295)return null;var d;if(l==23||l==20)return d=Zt(t,u*8,i),i+=u*8,d;if(l==25)return d=t.toString(this.encoding,i>>3,(i+=u<<3)>>3),d;console.log("ERROR: ElementType not implemented: "+l)},c=function(l,u){var d=[],f;if(l.length>1){var p=l.shift();for(f=0;f<p;f++)d[f]=c(l,u);l.unshift(p)}else for(f=0;f<l[0];f++)d[f]=a(u);return d};return c(o,n)},Hft=function(t){return t.toString("utf8")},Wft=function(t){return t===null?null:Zt(t,8)>0},Yft=function(t){t(20,jft),t(21,Bft),t(23,Yxe),t(26,Yxe),t(1700,Gft),t(700,qft),t(701,Vft),t(16,Wft),t(1114,Kxe.bind(null,!1)),t(1184,Kxe.bind(null,!0)),t(1e3,cT),t(1007,cT),t(1016,cT),t(1008,cT),t(1009,cT),t(25,Hft)};Jxe.exports={init:Yft}});var eRe=y((bpr,Qxe)=>{"use strict";Qxe.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}});var dT=y(uT=>{"use strict";var Kft=Gxe(),Zft=Xxe(),Jft=rK(),Xft=eRe();uT.getTypeParser=Qft;uT.setTypeParser=ept;uT.arrayParser=Jft;uT.builtins=Xft;var lT={text:{},binary:{}};function tRe(t){return String(t)}function Qft(t,e){return e=e||"text",lT[e]&&lT[e][t]||tRe}function ept(t,e,r){typeof e=="function"&&(r=e,e="text"),lT[e][t]=r}Kft.init(function(t,e){lT.text[t]=e});Zft.init(function(t,e){lT.binary[t]=e})});var fT=y((wpr,uK)=>{"use strict";var rRe;try{rRe=process.platform==="win32"?process.env.USERNAME:process.env.USER}catch{}uK.exports={host:"localhost",user:rRe,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var w_=dT(),tpt=w_.getTypeParser(20,"text"),rpt=w_.getTypeParser(1016,"text");uK.exports.__defineSetter__("parseInt8",function(t){w_.setTypeParser(20,"text",t?w_.getTypeParser(23,"text"):tpt),w_.setTypeParser(1016,"text",t?w_.getTypeParser(1007,"text"):rpt)})});var A_=y((Apr,iRe)=>{"use strict";var npt=fT(),{isDate:ipt}=Z("util/types");function opt(t){return'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function nRe(t){let e="{";for(let r=0;r<t.length;r++){r>0&&(e+=",");let n=t[r];n==null?e+="NULL":Array.isArray(n)?e+=nRe(n):ArrayBuffer.isView(n)?(n instanceof Buffer||(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),e+="\\\\x"+n.toString("hex")):e+=opt(sk(n))}return e+="}",e}var sk=function(t,e){return t==null?null:typeof t=="object"?t instanceof Buffer?t:ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):ipt(t)?npt.parseInputDatesAsUTC?cpt(t):apt(t):Array.isArray(t)?nRe(t):spt(t,e):t.toString()};function spt(t,e){if(t&&typeof t.toPostgres=="function"){if(e=e||[],e.indexOf(t)!==-1)throw new Error('circular reference detected while preparing "'+t+'" for query');return e.push(t),sk(t.toPostgres(sk),e)}return JSON.stringify(t)}function apt(t){let e=-t.getTimezoneOffset(),r=t.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);let i=String(r).padStart(4,"0")+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+String(t.getMilliseconds()).padStart(3,"0");return e<0?(i+="-",e*=-1):i+="+",i+=String(Math.floor(e/60)).padStart(2,"0")+":"+String(e%60).padStart(2,"0"),n&&(i+=" BC"),i}function cpt(t){let e=t.getUTCFullYear(),r=e<1;r&&(e=Math.abs(e)+1);let n=String(e).padStart(4,"0")+"-"+String(t.getUTCMonth()+1).padStart(2,"0")+"-"+String(t.getUTCDate()).padStart(2,"0")+"T"+String(t.getUTCHours()).padStart(2,"0")+":"+String(t.getUTCMinutes()).padStart(2,"0")+":"+String(t.getUTCSeconds()).padStart(2,"0")+"."+String(t.getUTCMilliseconds()).padStart(3,"0");return n+="+00:00",r&&(n+=" BC"),n}function lpt(t,e,r){return t=typeof t=="string"?{text:t}:t,e&&(typeof e=="function"?t.callback=e:t.values=e),r&&(t.callback=r),t}var upt=function(t){return'"'+t.replace(/"/g,'""')+'"'},dpt=function(t){let e=!1,r="'";if(t==null||typeof t!="string")return"''";for(let n=0;n<t.length;n++){let i=t[n];i==="'"?r+=i+i:i==="\\"?(r+=i+i,e=!0):r+=i}return r+="'",e===!0&&(r=" E"+r),r};iRe.exports={prepareValue:function(e){return sk(e)},normalizeQueryConfig:lpt,escapeIdentifier:upt,escapeLiteral:dpt}});var pK=y((xpr,aRe)=>{"use strict";var oRe=Z("crypto");aRe.exports={postgresMd5PasswordHash:ppt,randomBytes:fpt,deriveKey:_pt,sha256:hpt,hashByName:mpt,hmacSha256:gpt,md5:dK};var sRe=oRe.webcrypto||globalThis.crypto,kf=sRe.subtle,fK=new TextEncoder;function fpt(t){return sRe.getRandomValues(Buffer.alloc(t))}async function dK(t){try{return oRe.createHash("md5").update(t,"utf-8").digest("hex")}catch{let r=typeof t=="string"?fK.encode(t):t,n=await kf.digest("MD5",r);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}}async function ppt(t,e,r){let n=await dK(e+t);return"md5"+await dK(Buffer.concat([Buffer.from(n),r]))}async function hpt(t){return await kf.digest("SHA-256",t)}async function mpt(t,e){return await kf.digest(t,e)}async function gpt(t,e){let r=await kf.importKey("raw",t,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return await kf.sign("HMAC",r,fK.encode(e))}async function _pt(t,e,r){let n=await kf.importKey("raw",fK.encode(t),"PBKDF2",!1,["deriveBits"]),i={name:"PBKDF2",hash:"SHA-256",salt:e,iterations:r};return await kf.deriveBits(i,n,256,["deriveBits"])}});var uRe=y((Rpr,lRe)=>{"use strict";function Mf(t,e){return new Error("SASL channel binding: "+t+" when parsing public certificate "+e.toString("base64"))}function hK(t,e){let r=t[e++];if(r<128)return{length:r,index:e};let n=r&127;if(n>4)throw Mf("bad length",t);r=0;for(let i=0;i<n;i++)r=r<<8|t[e++];return{length:r,index:e}}function cRe(t,e){if(t[e++]!==6)throw Mf("non-OID data",t);let{length:r,index:n}=hK(t,e);e=n;let i=e+r,o=t[e++],s=(o/40>>0)+"."+o%40;for(;e<i;){let a=0;for(;e<i;){let c=t[e++];if(a=a<<7|c&127,c<128)break}s+="."+a}return{oid:s,index:e}}function pT(t,e){if(t[e++]!==48)throw Mf("non-sequence data",t);return hK(t,e)}function ypt(t,e){e===void 0&&(e=0),e=pT(t,e).index;let{length:r,index:n}=pT(t,e);e=n+r,e=pT(t,e).index;let{oid:i,index:o}=cRe(t,e);switch(i){case"1.2.840.113549.1.1.4":return"MD5";case"1.2.840.113549.1.1.5":return"SHA-1";case"1.2.840.113549.1.1.11":return"SHA-256";case"1.2.840.113549.1.1.12":return"SHA-384";case"1.2.840.113549.1.1.13":return"SHA-512";case"1.2.840.113549.1.1.14":return"SHA-224";case"1.2.840.113549.1.1.15":return"SHA512-224";case"1.2.840.113549.1.1.16":return"SHA512-256";case"1.2.840.10045.4.1":return"SHA-1";case"1.2.840.10045.4.3.1":return"SHA-224";case"1.2.840.10045.4.3.2":return"SHA-256";case"1.2.840.10045.4.3.3":return"SHA-384";case"1.2.840.10045.4.3.4":return"SHA-512";case"1.2.840.113549.1.1.10":{if(e=o,e=pT(t,e).index,t[e++]!==160)throw Mf("non-tag data",t);e=hK(t,e).index,e=pT(t,e).index;let{oid:s}=cRe(t,e);switch(s){case"1.2.840.113549.2.5":return"MD5";case"1.3.14.3.2.26":return"SHA-1";case"2.16.840.1.101.3.4.2.1":return"SHA-256";case"2.16.840.1.101.3.4.2.2":return"SHA-384";case"2.16.840.1.101.3.4.2.3":return"SHA-512"}throw Mf("unknown hash OID "+s,t)}case"1.3.101.110":case"1.3.101.112":return"SHA-512";case"1.3.101.111":case"1.3.101.113":throw Mf("Ed448 certificate channel binding is not currently supported by Postgres")}throw Mf("unknown OID "+i,t)}lRe.exports={signatureAlgorithmHashFromCertificate:ypt}});var hRe=y((Cpr,pRe)=>{"use strict";var Su=pK(),{signatureAlgorithmHashFromCertificate:Spt}=uRe();function Ept(t){let e=/[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g,r=/[\u00AD\u034F\u1806\u180B\u180C\u180D\u200C\u200D\u2060\uFE00-\uFE0F\uFEFF]/g;return t.replace(e," ").replace(r,"").normalize("NFKC")}var mK=1e5;function vpt(t,e,r=mK){let n=["SCRAM-SHA-256"];e&&n.unshift("SCRAM-SHA-256-PLUS");let i=n.find(a=>t.includes(a));if(!i)throw new Error("SASL: Only mechanism(s) "+n.join(" and ")+" are supported");if(i==="SCRAM-SHA-256-PLUS"&&typeof e.getPeerCertificate!="function")throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");let o=Su.randomBytes(18).toString("base64");return{mechanism:i,clientNonce:o,response:(i==="SCRAM-SHA-256-PLUS"?"p=tls-server-end-point":e?"y":"n")+",,n=*,r="+o,message:"SASLInitialResponse",scramMaxIterations:r}}async function bpt(t,e,r,n){if(t.message!=="SASLInitialResponse")throw new Error("SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if(e==="")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string");if(typeof r!="string")throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let i=Apt(r);if(i.nonce.startsWith(t.clientNonce)){if(i.nonce.length===t.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");let o=typeof t.scramMaxIterations=="number"?t.scramMaxIterations:mK;if(o!==0&&i.iteration>o)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration count "+i.iteration+" exceeds scramMaxIterations of "+o);let s="n=*,r="+t.clientNonce,a="r="+i.nonce+",s="+i.salt+",i="+i.iteration,c=n?"eSws":"biws";if(t.mechanism==="SCRAM-SHA-256-PLUS"){let T=n.getPeerCertificate().raw,E=Spt(T);(E==="MD5"||E==="SHA-1")&&(E="SHA-256");let A=await Su.hashByName(E,T);c=Buffer.concat([Buffer.from("p=tls-server-end-point,,"),Buffer.from(A)]).toString("base64")}let l="c="+c+",r="+i.nonce,u=s+","+a+","+l,d=Buffer.from(i.salt,"base64"),f=await Su.deriveKey(Ept(e),d,i.iteration),p=await Su.hmacSha256(f,"Client Key"),h=await Su.sha256(p),m=await Su.hmacSha256(h,u),g=Rpt(Buffer.from(p),Buffer.from(m)).toString("base64"),_=await Su.hmacSha256(f,"Server Key"),b=await Su.hmacSha256(_,u);t.message="SASLResponse",t.serverSignature=Buffer.from(b).toString("base64"),t.response=l+",p="+g}function Tpt(t,e){if(t.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!="string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=xpt(e);if(r!==t.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function wpt(t){if(typeof t!="string")throw new TypeError("SASL: text must be a string");return t.split("").map((e,r)=>t.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function dRe(t){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(t)}function fRe(t){if(typeof t!="string")throw new TypeError("SASL: attribute pairs text must be a string");return new Map(t.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("SASL: Invalid attribute pair entry");let r=e[0],n=e.substring(2);return[r,n]}))}function Apt(t){let e=fRe(t),r=e.get("r");if(r){if(!wpt(r))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!dRe(n))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");let o=parseInt(i,10);return{nonce:r,salt:n,iteration:o}}function xpt(t){let e=fRe(t),r=e.get("e"),n=e.get("v");if(r)throw new Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server returned error: "${r}"`);if(n){if(!dRe(n))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:n}}function Rpt(t,e){if(!Buffer.isBuffer(t))throw new TypeError("first argument must be a Buffer");if(!Buffer.isBuffer(e))throw new TypeError("second argument must be a Buffer");if(t.length!==e.length)throw new Error("Buffer lengths must match");if(t.length===0)throw new Error("Buffers cannot be empty");return Buffer.from(t.map((r,n)=>t[n]^e[n]))}pRe.exports={startSession:vpt,continueSession:bpt,finalizeSession:Tpt,DEFAULT_MAX_SCRAM_ITERATIONS:mK}});var ck=y((Ipr,mRe)=>{"use strict";var Cpt=dT();function ak(t){this._types=t||Cpt,this.text={},this.binary={}}ak.prototype.getOverrides=function(t){switch(t){case"text":return this.text;case"binary":return this.binary;default:return{}}};ak.prototype.setTypeParser=function(t,e,r){typeof e=="function"&&(r=e,e="text"),this.getOverrides(e)[t]=r};ak.prototype.getTypeParser=function(t,e){return e=e||"text",this.getOverrides(e)[t]||this._types.getTypeParser(t,e)};mRe.exports=ak});var yRe=y((Ppr,_Re)=>{"use strict";function x_(t,e={}){if(t.charAt(0)==="/"){let c=t.split(" ");return{host:c[0],database:c[1]}}let r=Object.create(null),n,i=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,"%$1"));try{try{n=new URL(t,"postgres://base")}catch{n=new URL(t.replace("@/","@___DUMMY___/"),"postgres://base"),i=!0}}catch(c){throw c.input&&(c.input="*****REDACTED*****"),c}for(let c of n.searchParams.entries())r[c[0]]=c[1];if(r.user=r.user||decodeURIComponent(n.username),r.password=r.password||decodeURIComponent(n.password),n.protocol=="socket:")return r.host=decodeURI(n.pathname),r.database=n.searchParams.get("db"),r.client_encoding=n.searchParams.get("encoding"),r;let o=i?"":n.hostname;r.host?o&&/^%2f/i.test(o)&&(n.pathname=o+n.pathname):r.host=decodeURIComponent(o),r.port||(r.port=n.port);let s=n.pathname.slice(1)||null;r.database=s?decodeURI(s):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let a=r.sslcert||r.sslkey||r.sslrootcert?Z("fs"):null;if(r.sslcert&&(r.ssl.cert=a.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=a.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=a.readFileSync(r.sslrootcert).toString()),e.useLibpqCompat&&r.uselibpqcompat)throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");if(r.uselibpqcompat==="true"||e.useLibpqCompat)switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":{r.ssl.rejectUnauthorized=!1;break}case"require":{r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break}case"verify-ca":{if(!r.ssl.ca)throw new Error("SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.");r.ssl.checkServerIdentity=function(){};break}case"verify-full":break}else switch(r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":{r.sslmode!=="verify-full"&&gK(r.sslmode);break}case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}function Ipt(t){return Object.entries(t).reduce((r,[n,i])=>(i!=null&&(r[n]=i),r),Object.create(null))}function gRe(t){return Object.entries(t).reduce((r,[n,i])=>{if(n==="ssl"){let o=i;typeof o=="boolean"&&(r[n]=o),typeof o=="object"&&(r[n]=Ipt(o))}else if(i!=null)if(n==="port"){if(i!==""){let o=parseInt(i,10);if(isNaN(o))throw new Error(`Invalid ${n}: ${i}`);r[n]=o}}else r[n]=i;return r},Object.create(null))}function Ppt(t){return gRe(x_(t))}function gK(t){!gK.warned&&typeof process<"u"&&process.emitWarning&&(gK.warned=!0,process.emitWarning(`SECURITY WARNING: The SSL modes 'prefer', 'require', and 'verify-ca' are treated as aliases for 'verify-full'.
|
|
33
33
|
In the next major version (pg-connection-string v3.0.0 and pg v9.0.0), these modes will adopt standard libpq semantics, which have weaker security guarantees.
|
|
34
34
|
|
|
35
35
|
To prepare for this change:
|
|
@@ -105,7 +105,7 @@ ${s}
|
|
|
105
105
|
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
106
106
|
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},CF=t=>{if(t==="all")return t;if(Ki.includes(t))return Ki.indexOf(t);let e=u2e.exec(t);if(e!==null)return Number(e[1])},u2e=/^fd(\d+)$/,d2e=(t,e)=>t.map(r=>r===void 0?p2e[e]:r),f2e=i2e("execa").enabled?"full":"none",p2e={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:f2e,stripFinalNewline:!0},IF=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Fa=(t,e)=>e==="ipc"?t.at(-1):t[e];var oh=({verbose:t},e)=>PF(t,e)!=="none",sh=({verbose:t},e)=>!["none","short"].includes(PF(t,e)),joe=({verbose:t},e)=>{let r=PF(t,e);return c0(r)?r:void 0},PF=(t,e)=>e===void 0?h2e(t):Fa(t,e),h2e=t=>t.find(e=>c0(e))??l0.findLast(e=>t.includes(e)),c0=t=>typeof t=="function",l0=["none","short","full"];import{inspect as D2e}from"util";import{platform as m2e}from"process";import{stripVTControlCharacters as g2e}from"util";var Boe=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>b2e(qoe(o))).join(" ");return{command:n,escapedCommand:i}},BS=t=>g2e(t).split(`
|
|
107
107
|
`).map(e=>qoe(e)).join(`
|
|
108
|
-
`),qoe=t=>t.replaceAll(S2e,e=>_2e(e)),_2e=t=>{let e=E2e[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=v2e?`\\u${n.padStart(4,"0")}`:`\\U${n}`},y2e=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},S2e=y2e(),E2e={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},v2e=65535,b2e=t=>T2e.test(t)?t:m2e==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,T2e=/^[\w./-]+$/;import Voe from"process";function OF(){let{env:t}=Voe,{TERM:e,TERM_PROGRAM:r}=t;return Voe.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Goe={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Hoe={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},w2e={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},A2e={...Goe,...Hoe},x2e={...Goe,...w2e},R2e=OF(),C2e=R2e?A2e:x2e,u0=C2e,ANt=Object.entries(Hoe);import I2e from"tty";var P2e=I2e?.WriteStream?.prototype?.hasColors?.()??!1,
|
|
108
|
+
`),qoe=t=>t.replaceAll(S2e,e=>_2e(e)),_2e=t=>{let e=E2e[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=v2e?`\\u${n.padStart(4,"0")}`:`\\U${n}`},y2e=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},S2e=y2e(),E2e={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},v2e=65535,b2e=t=>T2e.test(t)?t:m2e==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,T2e=/^[\w./-]+$/;import Voe from"process";function OF(){let{env:t}=Voe,{TERM:e,TERM_PROGRAM:r}=t;return Voe.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Goe={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Hoe={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},w2e={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},A2e={...Goe,...Hoe},x2e={...Goe,...w2e},R2e=OF(),C2e=R2e?A2e:x2e,u0=C2e,ANt=Object.entries(Hoe);import I2e from"tty";var P2e=I2e?.WriteStream?.prototype?.hasColors?.()??!1,Ye=(t,e)=>{if(!P2e)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},CNt=Ye(0,0),Woe=Ye(1,22),INt=Ye(2,22),PNt=Ye(3,23),ONt=Ye(4,24),NNt=Ye(53,55),kNt=Ye(7,27),MNt=Ye(8,28),$Nt=Ye(9,29),DNt=Ye(30,39),LNt=Ye(31,39),UNt=Ye(32,39),FNt=Ye(33,39),zNt=Ye(34,39),jNt=Ye(35,39),BNt=Ye(36,39),qNt=Ye(37,39),d0=Ye(90,39),VNt=Ye(40,49),GNt=Ye(41,49),HNt=Ye(42,49),WNt=Ye(43,49),YNt=Ye(44,49),KNt=Ye(45,49),ZNt=Ye(46,49),JNt=Ye(47,49),XNt=Ye(100,49),Yoe=Ye(91,39),QNt=Ye(92,39),Koe=Ye(93,39),ekt=Ye(94,39),tkt=Ye(95,39),rkt=Ye(96,39),nkt=Ye(97,39),ikt=Ye(101,49),okt=Ye(102,49),skt=Ye(103,49),akt=Ye(104,49),ckt=Ye(105,49),lkt=Ye(106,49),ukt=Ye(107,49);var Xoe=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=O2e(r),c=N2e[t]({failed:o,reject:s,piped:n}),l=k2e[t]({reject:s});return`${d0(`[${a}]`)} ${d0(`[${i}]`)} ${l(c)} ${l(e)}`},O2e=t=>`${f0(t.getHours(),2)}:${f0(t.getMinutes(),2)}:${f0(t.getSeconds(),2)}.${f0(t.getMilliseconds(),3)}`,f0=(t,e)=>String(t).padStart(e,"0"),Zoe=({failed:t,reject:e})=>t?e?u0.cross:u0.warning:u0.tick,N2e={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:Zoe,duration:Zoe},Joe=t=>t,k2e={command:()=>Woe,output:()=>Joe,ipc:()=>Joe,error:({reject:t})=>t?Yoe:Koe,duration:()=>d0};var Qoe=(t,e,r)=>{let n=joe(e,r);return t.map(({verboseLine:i,verboseObject:o})=>M2e(i,o,n)).filter(i=>i!==void 0).map(i=>$2e(i)).join("")},M2e=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},$2e=t=>t.endsWith(`
|
|
109
109
|
`)?t:`${t}
|
|
110
110
|
`;var Cs=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=L2e({type:t,result:i,verboseInfo:n}),s=U2e(e,o),a=Qoe(s,n,r);a!==""&&console.warn(a.slice(0,-1))},L2e=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),U2e=(t,e)=>t.split(`
|
|
111
111
|
`).map(r=>F2e({...e,message:r})),F2e=t=>({verboseLine:Xoe(t),verboseObject:t}),p0=t=>{let e=typeof t=="string"?t:D2e(t);return BS(e).replaceAll(" "," ".repeat(z2e))},z2e=2;var ese=(t,e)=>{oh(e)&&Cs({type:"command",verboseMessage:t,verboseInfo:e})};var tse=(t,e,r)=>{q2e(t);let n=j2e(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},j2e=t=>oh({verbose:t})?B2e++:void 0,B2e=0n,q2e=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!l0.includes(e)&&!c0(e)){let r=l0.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};import{hrtime as rse}from"process";var h0=()=>rse.bigint(),NF=t=>Number(rse.bigint()-t)/1e6;var m0=(t,e,r)=>{let n=h0(),{command:i,escapedCommand:o}=Boe(t,e),s=RF(r,"verbose"),a=tse(s,o,{...r});return ese(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}};var tce=wn(Vse(),1);import x4e from"path";import ece from"process";import y0 from"process";import dd from"path";function _0(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as gqe}from"util";import{execFile as _qe,execFileSync as Xkt}from"child_process";import Gse from"path";import{fileURLToPath as yqe}from"url";var tMt=gqe(_qe);function Jn(t){return t instanceof URL?yqe(t):t}function Hse(t){return{*[Symbol.iterator](){let e=Gse.resolve(Jn(t)),r;for(;r!==e;)yield e,r=e,e=Gse.resolve(e,"..")}}}var rMt=10*1024*1024;var Sqe=({cwd:t=y0.cwd(),path:e=y0.env[_0()],preferLocal:r=!0,execPath:n=y0.execPath,addExecPath:i=!0}={})=>{let o=dd.resolve(Jn(t)),s=[],a=e.split(dd.delimiter);return r&&Eqe(s,a,o),i&&vqe(s,a,n,o),e===""||e===dd.delimiter?`${s.join(dd.delimiter)}${e}`:[...s,e].join(dd.delimiter)},Eqe=(t,e,r)=>{for(let n of Hse(r)){let i=dd.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},vqe=(t,e,r,n)=>{let i=dd.resolve(n,Jn(r),"..");e.includes(i)||t.push(i)},Wse=({env:t=y0.env,...e}={})=>{t={...t};let r=_0({env:t});return e.path=t[r],t[r]=Sqe(e),t};import{setTimeout as Dqe}from"timers/promises";var Yse=(t,e,r)=>{let n=r?VS:qS,i=t instanceof Lo?{}:{cause:t};return new n(e,i)},Lo=class extends Error{},Kse=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,Jse,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Zse=t=>S0(t)&&Jse in t,Jse=Symbol("isExecaError"),S0=t=>Object.prototype.toString.call(t)==="[object Error]",qS=class extends Error{};Kse(qS,qS.name);var VS=class extends Error{};Kse(VS,VS.name);import{constants as GS}from"os";import{constants as Aqe}from"os";var Xse=()=>{let t=eae-Qse+1;return Array.from({length:t},bqe)},bqe=(t,e)=>({name:`SIGRT${e+1}`,number:Qse+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Qse=34,eae=64;import{constants as Tqe}from"os";var tae=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var BF=()=>{let t=Xse();return[...tae,...t].map(wqe)},wqe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Tqe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}};var xqe=()=>{let t=BF();return Object.fromEntries(t.map(Rqe))},Rqe=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],rae=xqe(),Cqe=()=>{let t=BF(),e=65,r=Array.from({length:e},(n,i)=>Iqe(i,t));return Object.assign({},...r)},Iqe=(t,e)=>{let r=Pqe(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},Pqe=(t,e)=>{let r=e.find(({name:n})=>Aqe.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},SMt=Cqe();var iae=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return sae(t,e)},oae=t=>t===0?t:sae(t,"`subprocess.kill()`'s argument"),sae=(t,e)=>{if(Number.isInteger(t))return Oqe(t,e);if(typeof t=="string")return kqe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
@@ -141,7 +141,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
|
|
|
141
141
|
`,LF:`
|
|
142
142
|
`,concatBytes:mz},CGe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},IGe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:CGe};import{Buffer as PGe}from"buffer";var ole=(t,e)=>t?void 0:OGe.bind(void 0,e),OGe=function*(t,e){if(typeof e!="string"&&!yr(e)&&!PGe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},sle=(t,e)=>t?NGe.bind(void 0,e):kGe.bind(void 0,e),NGe=function*(t,e){ale(t,e),yield e},kGe=function*(t,e){if(ale(t,e),typeof e!="string"&&!yr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},ale=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
143
143
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
144
|
-
if (condition) { yield value; }`)};import{Buffer as MGe}from"buffer";import{StringDecoder as $Ge}from"string_decoder";var Z0=(t,e,r)=>{if(r)return;if(t)return{transform:DGe.bind(void 0,new TextEncoder)};let n=new $Ge(e);return{transform:LGe.bind(void 0,n),final:UGe.bind(void 0,n)}},DGe=function*(t,e){MGe.isBuffer(e)?yield Ua(e):typeof e=="string"?yield t.encode(e):yield e},LGe=function*(t,e){yield yr(e)?t.write(e):e},UGe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as cle}from"util";var _z=cle(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),J0=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=zGe}=e[r];for await(let i of n(t))yield*J0(i,e,r+1)},lle=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*FGe(r,Number(e),t)},FGe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*J0(n,r,e+1)},ule=cle(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),zGe=function*(t){yield t};var yz=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},dle=(t,e)=>[...e.flatMap(r=>[...md(r,t,0)]),...JS(t)],md=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=BGe}=e[r];for(let i of n(t))yield*md(i,e,r+1)},JS=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*jGe(r,Number(e),t)},jGe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*md(n,r,e+1)},BGe=function*(t){yield t};var Sz=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=ple(t,s,o),l=hd(e),u=hd(r),d=l?_z.bind(void 0,J0,a):yz.bind(void 0,md),f=l||u?_z.bind(void 0,lle,a):yz.bind(void 0,JS),p=l||u?ule.bind(void 0,a):void 0;return{stream:new qGe({writableObjectMode:n,writableHighWaterMark:fle(n),readableObjectMode:i,readableHighWaterMark:fle(i),transform(m,g,_){d([m,c,0],this,_)},flush(m){f([c],this,m)},destroy:p})}},X0=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=ple(s,r,a);t=dle(c,t)}return t},ple=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ole(n,a)},Z0(r,s,n),K0(r,o,n,c),{transform:t,final:e},{transform:sle(i,a)},ile({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var hle=(t,e)=>{for(let r of VGe(t))GGe(t,r,e)},VGe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),GGe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${al[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>HGe(a,n));r.input=jS(s)},HGe=(t,e)=>{let r=X0(t,e,"utf8",!0);return WGe(r),jS(r)},WGe=t=>{let e=t.find(r=>typeof r!="string"&&!yr(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as JGe,appendFileSync as XGe}from"fs";var Q0=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&sh(r,n)&&!Ei.has(e)&&YGe(n)&&(t.some(({type:i,value:o})=>i==="native"&&KGe.has(o))||t.every(({type:i})=>Zi.has(i))),YGe=t=>t===1||t===2,KGe=new Set(["pipe","overlapped"]),mle=async(t,e,r,n)=>{for await(let i of t)ZGe(e)||_le(i,r,n)},gle=(t,e,r)=>{for(let n of t)_le(n,e,r)},ZGe=t=>t._readableState.pipes.length>0,_le=(t,e,r)=>{let n=p0(t);Cs({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var yle=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>QGe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},QGe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=Sce(t,o,d),p=Ua(f),{stdioItems:h,objectMode:m}=e[r],g=eHe([p],h,c,n),{serializedResult:_,finalResult:b=_}=tHe({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});rHe({serializedResult:_,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let T=a[r]?b:void 0;try{return n.error===void 0&&nHe(_,h,i),T}catch(E){return n.error=E,T}},eHe=(t,e,r,n)=>{try{return X0(t,e,r,!1)}catch(i){return n.error=i,t}},tHe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:jS(t)};let s=koe(t,r);return n[o]?{serializedResult:s,finalResult:gz(s,!i[o],e)}:{serializedResult:s}},rHe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!Q0({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gz(t,!1,s);try{gle(a,e,n)}catch(c){r.error??=c}},nHe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>W0.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?XGe(n,t):(r.add(o),JGe(n,t))}};var Sle=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ja(e,r,"all")]:Array.isArray(e)?[ja(t,r,"all"),...e]:yr(t)&&yr(e)?AF([t,e]):`${t}${e}`};import{once as Ez}from"events";var Ele=async(t,e)=>{let[r,n]=await iHe(t);return e.isForcefullyTerminated??=!1,[r,n]},iHe=async t=>{let[e,r]=await Promise.allSettled([Ez(t,"spawn"),Ez(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?vle(t):r.value},vle=async t=>{try{return await Ez(t,"exit")}catch{return vle(t)}},ble=async t=>{let[e,r]=await t;if(!oHe(e,r)&&vz(e,r))throw new Lo;return[e,r]},oHe=(t,e)=>t===void 0&&e===void 0,vz=(t,e)=>t!==0||e!==null;var Tle=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=sHe(t,e,r),s=o?.code==="ETIMEDOUT",a=yce(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},sHe=(t,e,r)=>t!==void 0?t:vz(e,r)?new Lo:void 0;var wle=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=cHe(t,e,r),d=dHe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return gh(d,c,l)},cHe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=m0(t,e,r),a=lHe(r),{file:c,commandArguments:l,options:u}=$0(t,e,a);uHe(u);let d=ele(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},lHe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,uHe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&eC("ipcInput"),t&&eC("ipc: true"),r&&eC("detached: true"),n&&eC("cancelSignal")},eC=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},dHe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=fHe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Tle(c,r),{output:h,error:m=l}=yle({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=h.map((b,T)=>ja(b,r,T)),_=ja(Sle(h,r),r,"all");return hHe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:r,command:n,escapedCommand:i,startTime:a})},fHe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{hle(o,r);let a=pHe(r);return aHe(...D0(t,e,a))}catch(a){return mh({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},pHe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:q0(e)}),hHe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?V0({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):ZS({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as t3e}from"events";import{spawn as r3e}from"child_process";import Ile from"process";import{once as bz,on as mHe}from"events";var Ale=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(lh({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:I0(t)}),gHe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),gHe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{A0(e,i);let o=sl(t,e,r),s=new AbortController;try{return await Promise.race([_He(o,n,s),yHe(o,r,s),SHe(o,r,s)])}catch(a){throw uh(t),a}finally{s.abort(),x0(e,i)}},_He=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await bz(t,"message",{signal:r});return n}for await(let[n]of mHe(t,"message",{signal:r}))if(e(n))return n},yHe=async(t,e,{signal:r})=>{await bz(t,"disconnect",{signal:r}),dae(e)},SHe=async(t,e,{signal:r})=>{let[n]=await bz(t,"strict:error",{signal:r});throw b0(n,e)};import{once as Rle,on as EHe}from"events";var Cle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>Tz({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),Tz=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{lh({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:I0(t)}),A0(e,o);let s=sl(t,e,r),a=new AbortController,c={};return vHe(t,s,a),bHe({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),THe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},vHe=async(t,e,r)=>{try{await Rle(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},bHe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Rle(t,"strict:error",{signal:r.signal});n.error=b0(i,e),r.abort()}catch{}},THe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of EHe(r,"message",{signal:o.signal}))xle(s),yield c}catch{xle(s)}finally{o.abort(),x0(e,a),n||uh(t),i&&await t}},xle=({error:t})=>{if(t)throw t};var Ple=(t,{ipc:e})=>{Object.assign(t,Nle(t,!1,e))},Ole=()=>{let t=Ile,e=!0,r=Ile.channel!==void 0;return{...Nle(t,e,r),getCancelSignal:Uae.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Nle=(t,e,r)=>({sendMessage:k0.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Ale.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Cle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as wHe}from"child_process";import{PassThrough as AHe,Readable as xHe,Writable as RHe,Duplex as CHe}from"stream";var kle=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pz(n);let a=new wHe;IHe(a,n),Object.assign(a,{readable:PHe,writable:OHe,duplex:NHe});let c=mh({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=kHe(c,s,i);return{subprocess:a,promise:l}},IHe=(t,e)=>{let r=XS(),n=XS(),i=XS(),o=Array.from({length:e.length-3},XS),s=XS(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},XS=()=>{let t=new AHe;return t.end(),t},PHe=()=>new xHe({read(){}}),OHe=()=>new RHe({write(){}}),NHe=()=>new CHe({read(){},write(){}}),kHe=async(t,e,r)=>gh(t,e,r);import{createReadStream as Mle,createWriteStream as $le}from"fs";import{Buffer as MHe}from"buffer";import{Readable as QS,Writable as $He,Duplex as DHe}from"stream";var Lle=(t,e)=>Y0(LHe,t,e,!1),eE=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${al[t]}.`)},Dle={fileNumber:eE,generator:Sz,asyncGenerator:Sz,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:DHe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},LHe={input:{...Dle,fileUrl:({value:t})=>({stream:Mle(t)}),filePath:({value:{file:t}})=>({stream:Mle(t)}),webStream:({value:t})=>({stream:QS.fromWeb(t)}),iterable:({value:t})=>({stream:QS.from(t)}),asyncIterable:({value:t})=>({stream:QS.from(t)}),string:({value:t})=>({stream:QS.from(t)}),uint8Array:({value:t})=>({stream:QS.from(MHe.from(t))})},output:{...Dle,fileUrl:({value:t})=>({stream:$le(t)}),filePath:({value:{file:t,append:e}})=>({stream:$le(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:$He.fromWeb(t)}),iterable:eE,asyncIterable:eE,string:eE,uint8Array:eE}};import{on as UHe,once as Ule}from"events";import{PassThrough as FHe,getDefaultHighWaterMark as zHe}from"stream";import{finished as jle}from"stream/promises";function gd(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)Az(i);let e=t.some(({readableObjectMode:i})=>i),r=jHe(t,e),n=new wz({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var jHe=(t,e)=>{if(t.length===0)return zHe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},wz=class extends FHe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(Az(e),this.#e.has(e))return;this.#e.add(e),this.#n??=BHe(this,this.#e,this.#o);let r=GHe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Az(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},BHe=async(t,e,r)=>{tC(t,Fle);let n=new AbortController;try{await Promise.race([qHe(t,n),VHe(t,e,r,n)])}finally{n.abort(),tC(t,-Fle)}},qHe=async(t,{signal:e})=>{try{await jle(t,{signal:e,cleanup:!0})}catch(r){throw Ble(t,r),r}},VHe=async(t,e,r,{signal:n})=>{for await(let[i]of UHe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},Az=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},GHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{tC(t,zle);let a=new AbortController;try{await Promise.race([HHe(o,e,a),WHe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),YHe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),tC(t,-zle)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?xz(t):KHe(t))},HHe=async(t,e,{signal:r})=>{try{await t,r.aborted||xz(e)}catch(n){r.aborted||Ble(e,n)}},WHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await jle(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;qle(s)?i.add(e):Vle(t,s)}},YHe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await Ule(t,i,{signal:o}),!t.readable)return Ule(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},KHe=t=>{t.writable&&t.end()},Ble=(t,e)=>{qle(e)?xz(t):Vle(t,e)},qle=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",xz=t=>{(t.readable||t.writable)&&t.destroy()},Vle=(t,e)=>{t.destroyed||(t.once("error",ZHe),t.destroy(e))},ZHe=()=>{},tC=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},Fle=2,zle=1;import{finished as Gle}from"stream/promises";var yh=(t,e)=>{t.pipe(e),JHe(t,e),XHe(t,e)},JHe=async(t,e)=>{if(!(Do(t)||Do(e))){try{await Gle(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Rz(e)}},Rz=t=>{t.writable&&t.end()},XHe=async(t,e)=>{if(!(Do(t)||Do(e))){try{await Gle(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Cz(t)}},Cz=t=>{t.readable&&t.destroy()};var Hle=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Zi.has(c)))QHe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Zi.has(c)))t6e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:gd(o);yh(s,i)}},QHe=(t,e,r,n)=>{r==="output"?yh(t.stdio[n],e):yh(e,t.stdio[n]);let i=e6e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},e6e=["stdin","stdout","stderr"],t6e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;r6e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},r6e=(t,{signal:e})=>{Do(t)&&fd(t,n6e,e)},n6e=2;import{addAbortListener as s6e}from"events";var _d=[];_d.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_d.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_d.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var rC=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Iz=Symbol.for("signal-exit emitter"),Pz=globalThis,i6e=Object.defineProperty.bind(Object),Oz=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Pz[Iz])return Pz[Iz];i6e(Pz,Iz,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},nC=class{},o6e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Nz=class extends nC{onExit(){return()=>{}}load(){}unload(){}},kz=class extends nC{#e=Mz.platform==="win32"?"SIGINT":"SIGHUP";#r=new Oz;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of _d)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!rC(this.#t))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of _d)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,_d.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#r.count-=1)}#a(e){return rC(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&rC(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},Mz=globalThis.process,{onExit:Wle,load:rFt,unload:nFt}=o6e(rC(Mz)?new kz(Mz):new Nz);var Yle=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Wle(()=>{t.kill()});s6e(n,()=>{i()})};var Zle=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=h0(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=a6e(r,n,i),{sourceStream:d,sourceError:f}=l6e(t,l),{options:p,fileDescriptors:h}=Ps.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},a6e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=c6e(t,e,...r),a=w0(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},c6e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Kle,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||TF(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=i0(r,...n);return{destination:e(Kle)(i,o,s),pipeOptions:s}}if(Ps.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Kle=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),l6e=(t,e)=>{try{return{sourceStream:dh(t,e)}}catch(r){return{sourceError:r}}};var Xle=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=u6e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw $z({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},u6e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return Cz(t),n;if(e!==void 0)return Rz(r),e},$z=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>mh({error:t,command:Jle,escapedCommand:Jle,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Jle="source.pipe(destination)";var Qle=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as d6e}from"stream/promises";var eue=(t,e,r)=>{let n=iC.has(e)?p6e(t,e):f6e(t,e);return fd(t,m6e,r.signal),fd(e,g6e,r.signal),h6e(e),n},f6e=(t,e)=>{let r=gd([t]);return yh(r,e),iC.set(e,r),r},p6e=(t,e)=>{let r=iC.get(e);return r.add(t),r},h6e=async t=>{try{await d6e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}iC.delete(t)},iC=new WeakMap,m6e=2,g6e=1;import{aborted as _6e}from"util";var tue=(t,e)=>t===void 0?[]:[y6e(t,e)],y6e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await _6e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw $z({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var oC=(t,...e)=>{if(ir(e[0]))return oC.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Zle(t,...e),i=S6e({...n,destination:r});return i.pipe=oC.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},S6e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E6e(t,i);Xle({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=eue(e,o,d);return await Promise.race([Qle(u),...tue(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E6e=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as R6e}from"timers/promises";import{on as v6e}from"events";import{getDefaultHighWaterMark as b6e}from"stream";var sC=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return T6e(e,s),nue({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},T6e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Dz=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;w6e(e,s,t);let a=t.readableObjectMode&&!o;return nue({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},w6e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},nue=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=v6e(t,"data",{signal:e.signal,highWaterMark:rue,highWatermark:rue});return A6e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},Lz=b6e(!0),rue=Lz,A6e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=x6e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*md(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*JS(a)}},x6e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Z0(t,r,!e),K0(t,i,!n,{})].filter(Boolean);var iue=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=C6e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([I6e(t),d]);return}let f=hz(c,r),p=Dz({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([P6e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},C6e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!Q0({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Dz({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await mle(a,t,r,o)},I6e=async t=>{await R6e(),t.readableFlowing===null&&t.resume()},P6e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await z0(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await j0(r,{maxBuffer:o})):await hh(r,{maxBuffer:o})}catch(a){return oue(mce({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},Uz=async t=>{try{return await t}catch(e){return oue(e)}},oue=({bufferedData:t})=>Ooe(t)?new Uint8Array(t):t;import{finished as O6e}from"stream/promises";var tE=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=N6e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],O6e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||$6e(a,e,r,n)}finally{s.abort()}},N6e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&k6e(t,r,n),n},k6e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{M6e(e,r),n.call(t,...i)}},M6e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},$6e=(t,e,r,n)=>{if(!D6e(t,e,r,n))throw t},D6e=(t,e,r,n=!0)=>r.propagating?sue(t)||aC(t):(r.propagating=!0,Fz(r,e)===n?sue(t):aC(t)),Fz=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",aC=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",sue=t=>t?.code==="EPIPE";var aue=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>zz({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),zz=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=tE(t,e,l);if(Fz(l,e)){await u;return}let[d]=await Promise.all([iue({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var cue=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?gd([t,e].filter(Boolean)):void 0,lue=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>zz({...L6e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:U6e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),L6e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},U6e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as F6e}from"events";var uue=t=>sh(t,"ipc"),due=(t,e)=>{let r=p0(t);Cs({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var fue=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=uue(o),a=Fa(e,"ipc"),c=Fa(r,"ipc");for await(let l of Tz({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(gce(t,i,c),i.push(l)),s&&due(l,o);return i},pue=async(t,e)=>(await Promise.allSettled([t]),e);var hue=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:_})=>{let b=Ele(t,f),T={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:b,propagating:!1},E=aue({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),A=lue({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),O=[],R=fue({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),N=z6e(m,t,T),M=j6e(h,T);try{return await Promise.race([Promise.all([{},ble(b),Promise.all(E),A,R,Yae(t,d),...N,...M]),g,B6e(t,_),...qae(t,o,f,_),...uae({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:_}),...jae({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:_})])}catch(L){return f.terminationReason??="other",Promise.all([{error:L},b,Promise.all(E.map(v=>Uz(v))),Uz(A),pue(R,O),Promise.allSettled(N),Promise.allSettled(M)])}},z6e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:tE(n,i,r)),j6e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Fo(o,{checkOpen:!1})&&!Do(o)).map(({type:i,value:o,stream:s=o})=>tE(s,n,e,{isSameDirection:Zi.has(i),stopOnExit:i==="native"}))),B6e=async(t,{signal:e})=>{let[r]=await F6e(t,"error",{signal:e});throw r};var mue=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),rE=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Is();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Sh=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as q6e}from"stream";import{callbackify as V6e}from"util";import{finished as gue}from"stream/promises";var jz=async t=>{if(t!==void 0)try{await Bz(t)}catch{}},_ue=async t=>{if(t!==void 0)try{await qz(t)}catch{}},Bz=async t=>{await gue(t,{cleanup:!0,readable:!1,writable:!0})},qz=async t=>{await gue(t,{cleanup:!0,readable:!0,writable:!1})},cC=async(t,e)=>{if(await t,e)throw e},lC=(t,e,r)=>{r&&!aC(r)?t.destroy(r):e&&t.destroy()};var yue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Ei.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Vz(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Gz(a,s),{read:f,onStdoutDataDone:p}=Hz({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new q6e({read:f,destroy:V6e(Yz.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Wz({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},Vz=(t,e,r)=>{let n=dh(t,e),i=rE(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},Gz=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Lz},Hz=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Is(),s=sC({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){G6e(this,s,o)},onStdoutDataDone:o}},G6e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},Wz=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await qz(t),await n,await jz(i),await e,r.readable&&r.push(null)}catch(o){await jz(i),Sue(r,o)}},Yz=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Sh(r,e)&&(Sue(t,n),await cC(e,n))},Sue=(t,e)=>{lC(t,t.readable,e)};import{Writable as H6e}from"stream";import{callbackify as Eue}from"util";var vue=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=Kz(t,r,e),s=new H6e({...Zz(n,t,i),destroy:Eue(Xz.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Jz(n,s),s},Kz=(t,e,r)=>{let n=w0(t,e),i=rE(r,n,"writableFinal"),o=rE(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},Zz=(t,e,r)=>({write:W6e.bind(void 0,t),final:Eue(Y6e.bind(void 0,t,e,r))}),W6e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Y6e=async(t,e,r)=>{await Sh(r,e)&&(t.writable&&t.end(),await e)},Jz=async(t,e,r)=>{try{await Bz(t),e.writable&&e.end()}catch(n){await _ue(r),bue(e,n)}},Xz=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Sh(r,e),await Sh(n,e)&&(bue(t,i),await cC(e,i))},bue=(t,e)=>{lC(t,t.writable,e)};import{Duplex as K6e}from"stream";import{callbackify as Z6e}from"util";var Tue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Ei.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Vz(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Kz(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=Gz(c,a),{read:g,onStdoutDataDone:_}=Hz({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),b=new K6e({read:g,...Zz(u,t,d),destroy:Z6e(J6e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return Wz({subprocessStdout:c,onStdoutDataDone:_,readable:b,subprocess:t,subprocessStdin:u}),Jz(u,b,c),b},J6e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([Yz({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),Xz({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var Qz=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Ei.has(e),s=dh(t,r),a=sC({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return X6e(a,s,t)},X6e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var wue=(t,{encoding:e})=>{let r=mue();t.readable=yue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=vue.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Tue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Qz.bind(void 0,t,e),t[Symbol.asyncIterator]=Qz.bind(void 0,t,e,{})};var Aue=(t,e)=>{for(let[r,n]of e3e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Q6e=(async()=>{})().constructor.prototype,e3e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Q6e,t)]);var xue=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=n3e(t,e,r),{subprocess:f,promise:p}=o3e({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=oC.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Aue(f,p),Ps.set(f,{options:u,fileDescriptors:d}),f},n3e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=m0(t,e,r),{file:a,commandArguments:c,options:l}=$0(t,e,r),u=i3e(l),d=Lle(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},i3e=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},o3e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=r3e(...D0(t,e,r))}catch(h){return kle({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;t3e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];Hle(c,a,l),Yle(c,r,l);let d={},f=Is();c.kill=cae.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=cue(c,r),wue(c,r),Ple(c,r);let p=s3e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},s3e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,g]=await hue({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let _=h.map((E,A)=>ja(E,e,A)),b=ja(m,e,"all"),T=a3e({errorInfo:d,exitCode:f,signal:p,stdio:_,all:b,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return gh(T,n,e)},a3e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?ZS({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Os,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):V0({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var uC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,c3e(n,t[n],i)]));return{...t,...r}},c3e=(t,e,r)=>l3e.has(t)&&ir(e)&&ir(r)?{...e,...r}:r,l3e=new Set(["env",...IF]);var cl=(t,e,r,n)=>{let i=(s,a,c)=>cl(s,a,r,c),o=(...s)=>u3e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},u3e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(ir(o))return i(t,uC(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=d3e({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?wle(a,c,l):xue(a,c,l,i)},d3e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=Loe(e)?Uoe(e,r):[e,...r],[s,a,c]=i0(...o),l=uC(uC(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Rue=({file:t,commandArguments:e})=>Iue(t,e),Cue=({file:t,commandArguments:e})=>({...Iue(t,e),isSync:!0}),Iue=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=f3e(t);return{file:r,commandArguments:n}},f3e=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(p3e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},p3e=/ +/g;var Pue=(t,e,r)=>{t.sync=e(h3e,r),t.s=t.sync},Oue=({options:t})=>Nue(t),h3e=({options:t})=>({...Nue(t),isSync:!0}),Nue=t=>({options:{...m3e(t),...t}}),m3e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},kue={preferLocal:!0};var Mue=cl(()=>({})),Hjt=cl(()=>({isSync:!0})),$ue=cl(Rue),Wjt=cl(Cue),Yjt=cl(Gae),Kjt=cl(Oue,{},kue,Pue),{sendMessage:Zjt,getOneMessage:Jjt,getEachMessage:Xjt,getCancelSignal:Qjt}=Ole();var Due=!1,Lue=()=>{Due=!0},ks=()=>Due;var nE=null,Uue=t=>(nE&&nE.destroy(),nE=new zo({totalAllowedTime:t}),nE),Fue=()=>nE;var zo=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&ks())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await GR({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ne.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var zue={name:"@netlify/agent-runner-cli",type:"module",version:"1.172.0-model-default-effort.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{prebuild:"rm -rf dist",build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:opencode":"vitest run test/integration/opencode.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.6","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.153.4","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.12.1",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var S3e=_3e(import.meta.url),E3e=Ba.dirname(S3e),v3e=y3e(import.meta.url),Eh=ce("shell"),ej=new Set,jue={preferLocal:!0},$t=(t,e,r)=>{let[n,i]=b3e(e,r),o={...jue,...i},s=Mue(t,n,o);que(s,o),Hue(s);let a=r?.idleTimeout;return a&&a>0&&Gue(s,a),s},Bue=(t,e)=>{let r={...jue,...e},n=$ue(t,r);return que(n,r),Hue(n),e?.idleTimeout&&e.idleTimeout>0&&Gue(n,e.idleTimeout),n},b3e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},que=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0||Ms.env.NETLIFY_LOCAL_QUIET==="true")return;if(Ms.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new NS).pipe(Ms.stdout),t.stderr?.pipe(new NS).pipe(Ms.stderr);return}t.stdout?.pipe(Ms.stdout),t.stderr?.pipe(Ms.stderr)},tj=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Ms.kill(-t.pid,e),Eh.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return Eh.error("Error killing process:",r),!1}},Vue=t=>tj(t,"SIGKILL"),Gue=(t,e)=>{let r=null,n=()=>{Eh.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),tj(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Eh.log(`Force killing idle process ${t.pid}`),Vue(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},Hue=t=>{ej.add(t);let e=Fue();if(e){let r=e.onTimesUp(()=>{Eh.log(`Global timer expired, killing process ${t.pid}`),tj(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Eh.log(`Force killing process ${t.pid} after timeout`),Vue(t))},5e3)});t.on("exit",()=>{ej.delete(t),r()}),t.on("error",()=>{ej.delete(t),r()})}};function fC(t,e){return!!jo(t,e)}function jo(t,e){if(!Ms.env.NETLIFY_LOCAL_MODE)try{let i=v3e.resolve(zue.name),o=Ba.dirname(i);for(;o!==Ba.dirname(o);){let s=Ba.dirname(o);if(Ba.basename(s)==="node_modules"){let a=Ba.join(s,".bin",e);if(dC.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Ms.env.NODE_PATH){let i=Ba.join(Ms.env.NODE_PATH,".bin",e);if(dC.existsSync(i))return i}let r=Ba.join(t,"node_modules",".bin",e);if(dC.existsSync(r))return r;let n=Ba.join(E3e,"..","node_modules",".bin",e);if(dC.existsSync(n))return n}var Wue=ce("repo"),Xue="runner-diffs-",Que=t=>`${Xue}${t}-`,ede=async t=>{let e=Jue.tmpdir(),r;try{r=await pC.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(Xue)&&!n.startsWith(Que(t))).map(n=>pC.rm(hC.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Xn=(t,e={})=>$t("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),mC=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Wue.info("Getting runner diffs");let n=await x3e(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=C3e(o);await I3e(h,r)}Wue.info("Changes after processing"),await nj(r);let s=await ij(o,r);if(await rj(s,r),i=await R3e(r),!i)return{hasChanges:!1,ignored:s};await Xn(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await pC.mkdtemp(hC.join(Jue.tmpdir(),Que(t.sessionId))),c=async({from:h,to:m,fileName:g,binary:_})=>{let b=hC.join(a,g);await Xn([..._?["diff",h,m,"--binary"]:["diff",h,m],`--output=${b}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:E}=await pC.stat(b);return{path:b,size:E}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await Zue(r),{hasChanges:!1,ignored:s};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await Kue(d,h)||(f=h)}await Zue(r),ne.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Kue(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Yue=async t=>{let e=T3e("sha256");for await(let r of w3e(t))e.update(r);return e.digest("hex")},Kue=async(t,e)=>t.size===e.size&&await Yue(t.path)===await Yue(e.path),Zue=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Xn(["reset","--soft","HEAD~1"],{cwd:t})},rj=async(t=[],e=process.cwd())=>{await Xn(["add",".",...t],{cwd:e})},nj=async(t=process.cwd())=>{let e=await Xn(["status","-s"],{cwd:t});return String(e.stdout??"")},tde=/.. (.+)?\.log$/,A3e=[tde],x3e=async(t=process.cwd())=>{let e=await nj(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
144
|
+
if (condition) { yield value; }`)};import{Buffer as MGe}from"buffer";import{StringDecoder as $Ge}from"string_decoder";var Z0=(t,e,r)=>{if(r)return;if(t)return{transform:DGe.bind(void 0,new TextEncoder)};let n=new $Ge(e);return{transform:LGe.bind(void 0,n),final:UGe.bind(void 0,n)}},DGe=function*(t,e){MGe.isBuffer(e)?yield Ua(e):typeof e=="string"?yield t.encode(e):yield e},LGe=function*(t,e){yield yr(e)?t.write(e):e},UGe=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as cle}from"util";var _z=cle(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),J0=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=zGe}=e[r];for await(let i of n(t))yield*J0(i,e,r+1)},lle=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*FGe(r,Number(e),t)},FGe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*J0(n,r,e+1)},ule=cle(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),zGe=function*(t){yield t};var yz=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},dle=(t,e)=>[...e.flatMap(r=>[...md(r,t,0)]),...JS(t)],md=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=BGe}=e[r];for(let i of n(t))yield*md(i,e,r+1)},JS=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*jGe(r,Number(e),t)},jGe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*md(n,r,e+1)},BGe=function*(t){yield t};var Sz=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=ple(t,s,o),l=hd(e),u=hd(r),d=l?_z.bind(void 0,J0,a):yz.bind(void 0,md),f=l||u?_z.bind(void 0,lle,a):yz.bind(void 0,JS),p=l||u?ule.bind(void 0,a):void 0;return{stream:new qGe({writableObjectMode:n,writableHighWaterMark:fle(n),readableObjectMode:i,readableHighWaterMark:fle(i),transform(m,g,_){d([m,c,0],this,_)},flush(m){f([c],this,m)},destroy:p})}},X0=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=ple(s,r,a);t=dle(c,t)}return t},ple=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ole(n,a)},Z0(r,s,n),K0(r,o,n,c),{transform:t,final:e},{transform:sle(i,a)},ile({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var hle=(t,e)=>{for(let r of VGe(t))GGe(t,r,e)},VGe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),GGe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${al[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>HGe(a,n));r.input=jS(s)},HGe=(t,e)=>{let r=X0(t,e,"utf8",!0);return WGe(r),jS(r)},WGe=t=>{let e=t.find(r=>typeof r!="string"&&!yr(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as JGe,appendFileSync as XGe}from"fs";var Q0=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&sh(r,n)&&!Ei.has(e)&&YGe(n)&&(t.some(({type:i,value:o})=>i==="native"&&KGe.has(o))||t.every(({type:i})=>Zi.has(i))),YGe=t=>t===1||t===2,KGe=new Set(["pipe","overlapped"]),mle=async(t,e,r,n)=>{for await(let i of t)ZGe(e)||_le(i,r,n)},gle=(t,e,r)=>{for(let n of t)_le(n,e,r)},ZGe=t=>t._readableState.pipes.length>0,_le=(t,e,r)=>{let n=p0(t);Cs({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var yle=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>QGe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},QGe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=Sce(t,o,d),p=Ua(f),{stdioItems:h,objectMode:m}=e[r],g=eHe([p],h,c,n),{serializedResult:_,finalResult:b=_}=tHe({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});rHe({serializedResult:_,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let T=a[r]?b:void 0;try{return n.error===void 0&&nHe(_,h,i),T}catch(E){return n.error=E,T}},eHe=(t,e,r,n)=>{try{return X0(t,e,r,!1)}catch(i){return n.error=i,t}},tHe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:jS(t)};let s=koe(t,r);return n[o]?{serializedResult:s,finalResult:gz(s,!i[o],e)}:{serializedResult:s}},rHe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!Q0({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gz(t,!1,s);try{gle(a,e,n)}catch(c){r.error??=c}},nHe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>W0.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?XGe(n,t):(r.add(o),JGe(n,t))}};var Sle=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ja(e,r,"all")]:Array.isArray(e)?[ja(t,r,"all"),...e]:yr(t)&&yr(e)?AF([t,e]):`${t}${e}`};import{once as Ez}from"events";var Ele=async(t,e)=>{let[r,n]=await iHe(t);return e.isForcefullyTerminated??=!1,[r,n]},iHe=async t=>{let[e,r]=await Promise.allSettled([Ez(t,"spawn"),Ez(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?vle(t):r.value},vle=async t=>{try{return await Ez(t,"exit")}catch{return vle(t)}},ble=async t=>{let[e,r]=await t;if(!oHe(e,r)&&vz(e,r))throw new Lo;return[e,r]},oHe=(t,e)=>t===void 0&&e===void 0,vz=(t,e)=>t!==0||e!==null;var Tle=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=sHe(t,e,r),s=o?.code==="ETIMEDOUT",a=yce(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},sHe=(t,e,r)=>t!==void 0?t:vz(e,r)?new Lo:void 0;var wle=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=cHe(t,e,r),d=dHe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return gh(d,c,l)},cHe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=m0(t,e,r),a=lHe(r),{file:c,commandArguments:l,options:u}=$0(t,e,a);uHe(u);let d=ele(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},lHe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,uHe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&eC("ipcInput"),t&&eC("ipc: true"),r&&eC("detached: true"),n&&eC("cancelSignal")},eC=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},dHe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=fHe({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Tle(c,r),{output:h,error:m=l}=yle({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=h.map((b,T)=>ja(b,r,T)),_=ja(Sle(h,r),r,"all");return hHe({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:r,command:n,escapedCommand:i,startTime:a})},fHe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{hle(o,r);let a=pHe(r);return aHe(...D0(t,e,a))}catch(a){return mh({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},pHe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:q0(e)}),hHe=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?V0({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):ZS({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as t3e}from"events";import{spawn as r3e}from"child_process";import Ile from"process";import{once as bz,on as mHe}from"events";var Ale=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(lh({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:I0(t)}),gHe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),gHe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{A0(e,i);let o=sl(t,e,r),s=new AbortController;try{return await Promise.race([_He(o,n,s),yHe(o,r,s),SHe(o,r,s)])}catch(a){throw uh(t),a}finally{s.abort(),x0(e,i)}},_He=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await bz(t,"message",{signal:r});return n}for await(let[n]of mHe(t,"message",{signal:r}))if(e(n))return n},yHe=async(t,e,{signal:r})=>{await bz(t,"disconnect",{signal:r}),dae(e)},SHe=async(t,e,{signal:r})=>{let[n]=await bz(t,"strict:error",{signal:r});throw b0(n,e)};import{once as Rle,on as EHe}from"events";var Cle=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>Tz({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),Tz=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{lh({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:I0(t)}),A0(e,o);let s=sl(t,e,r),a=new AbortController,c={};return vHe(t,s,a),bHe({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),THe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},vHe=async(t,e,r)=>{try{await Rle(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},bHe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Rle(t,"strict:error",{signal:r.signal});n.error=b0(i,e),r.abort()}catch{}},THe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of EHe(r,"message",{signal:o.signal}))xle(s),yield c}catch{xle(s)}finally{o.abort(),x0(e,a),n||uh(t),i&&await t}},xle=({error:t})=>{if(t)throw t};var Ple=(t,{ipc:e})=>{Object.assign(t,Nle(t,!1,e))},Ole=()=>{let t=Ile,e=!0,r=Ile.channel!==void 0;return{...Nle(t,e,r),getCancelSignal:Uae.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Nle=(t,e,r)=>({sendMessage:k0.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Ale.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Cle.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as wHe}from"child_process";import{PassThrough as AHe,Readable as xHe,Writable as RHe,Duplex as CHe}from"stream";var kle=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pz(n);let a=new wHe;IHe(a,n),Object.assign(a,{readable:PHe,writable:OHe,duplex:NHe});let c=mh({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=kHe(c,s,i);return{subprocess:a,promise:l}},IHe=(t,e)=>{let r=XS(),n=XS(),i=XS(),o=Array.from({length:e.length-3},XS),s=XS(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},XS=()=>{let t=new AHe;return t.end(),t},PHe=()=>new xHe({read(){}}),OHe=()=>new RHe({write(){}}),NHe=()=>new CHe({read(){},write(){}}),kHe=async(t,e,r)=>gh(t,e,r);import{createReadStream as Mle,createWriteStream as $le}from"fs";import{Buffer as MHe}from"buffer";import{Readable as QS,Writable as $He,Duplex as DHe}from"stream";var Lle=(t,e)=>Y0(LHe,t,e,!1),eE=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${al[t]}.`)},Dle={fileNumber:eE,generator:Sz,asyncGenerator:Sz,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:DHe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},LHe={input:{...Dle,fileUrl:({value:t})=>({stream:Mle(t)}),filePath:({value:{file:t}})=>({stream:Mle(t)}),webStream:({value:t})=>({stream:QS.fromWeb(t)}),iterable:({value:t})=>({stream:QS.from(t)}),asyncIterable:({value:t})=>({stream:QS.from(t)}),string:({value:t})=>({stream:QS.from(t)}),uint8Array:({value:t})=>({stream:QS.from(MHe.from(t))})},output:{...Dle,fileUrl:({value:t})=>({stream:$le(t)}),filePath:({value:{file:t,append:e}})=>({stream:$le(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:$He.fromWeb(t)}),iterable:eE,asyncIterable:eE,string:eE,uint8Array:eE}};import{on as UHe,once as Ule}from"events";import{PassThrough as FHe,getDefaultHighWaterMark as zHe}from"stream";import{finished as jle}from"stream/promises";function gd(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)Az(i);let e=t.some(({readableObjectMode:i})=>i),r=jHe(t,e),n=new wz({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var jHe=(t,e)=>{if(t.length===0)return zHe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},wz=class extends FHe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(Az(e),this.#e.has(e))return;this.#e.add(e),this.#n??=BHe(this,this.#e,this.#o);let r=GHe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Az(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},BHe=async(t,e,r)=>{tC(t,Fle);let n=new AbortController;try{await Promise.race([qHe(t,n),VHe(t,e,r,n)])}finally{n.abort(),tC(t,-Fle)}},qHe=async(t,{signal:e})=>{try{await jle(t,{signal:e,cleanup:!0})}catch(r){throw Ble(t,r),r}},VHe=async(t,e,r,{signal:n})=>{for await(let[i]of UHe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},Az=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},GHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{tC(t,zle);let a=new AbortController;try{await Promise.race([HHe(o,e,a),WHe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),YHe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),tC(t,-zle)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?xz(t):KHe(t))},HHe=async(t,e,{signal:r})=>{try{await t,r.aborted||xz(e)}catch(n){r.aborted||Ble(e,n)}},WHe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await jle(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;qle(s)?i.add(e):Vle(t,s)}},YHe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await Ule(t,i,{signal:o}),!t.readable)return Ule(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},KHe=t=>{t.writable&&t.end()},Ble=(t,e)=>{qle(e)?xz(t):Vle(t,e)},qle=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",xz=t=>{(t.readable||t.writable)&&t.destroy()},Vle=(t,e)=>{t.destroyed||(t.once("error",ZHe),t.destroy(e))},ZHe=()=>{},tC=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},Fle=2,zle=1;import{finished as Gle}from"stream/promises";var yh=(t,e)=>{t.pipe(e),JHe(t,e),XHe(t,e)},JHe=async(t,e)=>{if(!(Do(t)||Do(e))){try{await Gle(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Rz(e)}},Rz=t=>{t.writable&&t.end()},XHe=async(t,e)=>{if(!(Do(t)||Do(e))){try{await Gle(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Cz(t)}},Cz=t=>{t.readable&&t.destroy()};var Hle=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Zi.has(c)))QHe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Zi.has(c)))t6e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:gd(o);yh(s,i)}},QHe=(t,e,r,n)=>{r==="output"?yh(t.stdio[n],e):yh(e,t.stdio[n]);let i=e6e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},e6e=["stdin","stdout","stderr"],t6e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;r6e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},r6e=(t,{signal:e})=>{Do(t)&&fd(t,n6e,e)},n6e=2;import{addAbortListener as s6e}from"events";var _d=[];_d.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_d.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_d.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var rC=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Iz=Symbol.for("signal-exit emitter"),Pz=globalThis,i6e=Object.defineProperty.bind(Object),Oz=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Pz[Iz])return Pz[Iz];i6e(Pz,Iz,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},nC=class{},o6e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Nz=class extends nC{onExit(){return()=>{}}load(){}unload(){}},kz=class extends nC{#e=Mz.platform==="win32"?"SIGINT":"SIGHUP";#r=new Oz;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of _d)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!rC(this.#t))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of _d)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,_d.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#r.count-=1)}#a(e){return rC(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&rC(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},Mz=globalThis.process,{onExit:Wle,load:rFt,unload:nFt}=o6e(rC(Mz)?new kz(Mz):new Nz);var Yle=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Wle(()=>{t.kill()});s6e(n,()=>{i()})};var Zle=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=h0(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=a6e(r,n,i),{sourceStream:d,sourceError:f}=l6e(t,l),{options:p,fileDescriptors:h}=Ps.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},a6e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=c6e(t,e,...r),a=w0(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},c6e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Kle,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||TF(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=i0(r,...n);return{destination:e(Kle)(i,o,s),pipeOptions:s}}if(Ps.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Kle=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),l6e=(t,e)=>{try{return{sourceStream:dh(t,e)}}catch(r){return{sourceError:r}}};var Xle=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=u6e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw $z({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},u6e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return Cz(t),n;if(e!==void 0)return Rz(r),e},$z=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>mh({error:t,command:Jle,escapedCommand:Jle,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Jle="source.pipe(destination)";var Qle=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as d6e}from"stream/promises";var eue=(t,e,r)=>{let n=iC.has(e)?p6e(t,e):f6e(t,e);return fd(t,m6e,r.signal),fd(e,g6e,r.signal),h6e(e),n},f6e=(t,e)=>{let r=gd([t]);return yh(r,e),iC.set(e,r),r},p6e=(t,e)=>{let r=iC.get(e);return r.add(t),r},h6e=async t=>{try{await d6e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}iC.delete(t)},iC=new WeakMap,m6e=2,g6e=1;import{aborted as _6e}from"util";var tue=(t,e)=>t===void 0?[]:[y6e(t,e)],y6e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await _6e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw $z({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var oC=(t,...e)=>{if(ir(e[0]))return oC.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Zle(t,...e),i=S6e({...n,destination:r});return i.pipe=oC.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},S6e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E6e(t,i);Xle({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=eue(e,o,d);return await Promise.race([Qle(u),...tue(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E6e=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as R6e}from"timers/promises";import{on as v6e}from"events";import{getDefaultHighWaterMark as b6e}from"stream";var sC=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return T6e(e,s),nue({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},T6e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Dz=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;w6e(e,s,t);let a=t.readableObjectMode&&!o;return nue({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},w6e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},nue=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=v6e(t,"data",{signal:e.signal,highWaterMark:rue,highWatermark:rue});return A6e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},Lz=b6e(!0),rue=Lz,A6e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=x6e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*md(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*JS(a)}},x6e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Z0(t,r,!e),K0(t,i,!n,{})].filter(Boolean);var iue=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=C6e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([I6e(t),d]);return}let f=hz(c,r),p=Dz({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([P6e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},C6e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!Q0({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Dz({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await mle(a,t,r,o)},I6e=async t=>{await R6e(),t.readableFlowing===null&&t.resume()},P6e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await z0(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await j0(r,{maxBuffer:o})):await hh(r,{maxBuffer:o})}catch(a){return oue(mce({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},Uz=async t=>{try{return await t}catch(e){return oue(e)}},oue=({bufferedData:t})=>Ooe(t)?new Uint8Array(t):t;import{finished as O6e}from"stream/promises";var tE=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=N6e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],O6e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||$6e(a,e,r,n)}finally{s.abort()}},N6e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&k6e(t,r,n),n},k6e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{M6e(e,r),n.call(t,...i)}},M6e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},$6e=(t,e,r,n)=>{if(!D6e(t,e,r,n))throw t},D6e=(t,e,r,n=!0)=>r.propagating?sue(t)||aC(t):(r.propagating=!0,Fz(r,e)===n?sue(t):aC(t)),Fz=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",aC=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",sue=t=>t?.code==="EPIPE";var aue=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>zz({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),zz=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=tE(t,e,l);if(Fz(l,e)){await u;return}let[d]=await Promise.all([iue({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var cue=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?gd([t,e].filter(Boolean)):void 0,lue=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>zz({...L6e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:U6e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),L6e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},U6e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as F6e}from"events";var uue=t=>sh(t,"ipc"),due=(t,e)=>{let r=p0(t);Cs({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var fue=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=uue(o),a=Fa(e,"ipc"),c=Fa(r,"ipc");for await(let l of Tz({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(gce(t,i,c),i.push(l)),s&&due(l,o);return i},pue=async(t,e)=>(await Promise.allSettled([t]),e);var hue=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:_})=>{let b=Ele(t,f),T={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:b,propagating:!1},E=aue({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),A=lue({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:T}),O=[],R=fue({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),N=z6e(m,t,T),M=j6e(h,T);try{return await Promise.race([Promise.all([{},ble(b),Promise.all(E),A,R,Yae(t,d),...N,...M]),g,B6e(t,_),...qae(t,o,f,_),...uae({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:_}),...jae({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:_})])}catch(L){return f.terminationReason??="other",Promise.all([{error:L},b,Promise.all(E.map(v=>Uz(v))),Uz(A),pue(R,O),Promise.allSettled(N),Promise.allSettled(M)])}},z6e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:tE(n,i,r)),j6e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Fo(o,{checkOpen:!1})&&!Do(o)).map(({type:i,value:o,stream:s=o})=>tE(s,n,e,{isSameDirection:Zi.has(i),stopOnExit:i==="native"}))),B6e=async(t,{signal:e})=>{let[r]=await F6e(t,"error",{signal:e});throw r};var mue=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),rE=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Is();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Sh=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as q6e}from"stream";import{callbackify as V6e}from"util";import{finished as gue}from"stream/promises";var jz=async t=>{if(t!==void 0)try{await Bz(t)}catch{}},_ue=async t=>{if(t!==void 0)try{await qz(t)}catch{}},Bz=async t=>{await gue(t,{cleanup:!0,readable:!1,writable:!0})},qz=async t=>{await gue(t,{cleanup:!0,readable:!0,writable:!1})},cC=async(t,e)=>{if(await t,e)throw e},lC=(t,e,r)=>{r&&!aC(r)?t.destroy(r):e&&t.destroy()};var yue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Ei.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Vz(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Gz(a,s),{read:f,onStdoutDataDone:p}=Hz({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new q6e({read:f,destroy:V6e(Yz.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Wz({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},Vz=(t,e,r)=>{let n=dh(t,e),i=rE(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},Gz=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Lz},Hz=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Is(),s=sC({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){G6e(this,s,o)},onStdoutDataDone:o}},G6e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},Wz=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await qz(t),await n,await jz(i),await e,r.readable&&r.push(null)}catch(o){await jz(i),Sue(r,o)}},Yz=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Sh(r,e)&&(Sue(t,n),await cC(e,n))},Sue=(t,e)=>{lC(t,t.readable,e)};import{Writable as H6e}from"stream";import{callbackify as Eue}from"util";var vue=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=Kz(t,r,e),s=new H6e({...Zz(n,t,i),destroy:Eue(Xz.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Jz(n,s),s},Kz=(t,e,r)=>{let n=w0(t,e),i=rE(r,n,"writableFinal"),o=rE(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},Zz=(t,e,r)=>({write:W6e.bind(void 0,t),final:Eue(Y6e.bind(void 0,t,e,r))}),W6e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Y6e=async(t,e,r)=>{await Sh(r,e)&&(t.writable&&t.end(),await e)},Jz=async(t,e,r)=>{try{await Bz(t),e.writable&&e.end()}catch(n){await _ue(r),bue(e,n)}},Xz=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Sh(r,e),await Sh(n,e)&&(bue(t,i),await cC(e,i))},bue=(t,e)=>{lC(t,t.writable,e)};import{Duplex as K6e}from"stream";import{callbackify as Z6e}from"util";var Tue=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Ei.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Vz(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=Kz(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=Gz(c,a),{read:g,onStdoutDataDone:_}=Hz({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),b=new K6e({read:g,...Zz(u,t,d),destroy:Z6e(J6e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return Wz({subprocessStdout:c,onStdoutDataDone:_,readable:b,subprocess:t,subprocessStdin:u}),Jz(u,b,c),b},J6e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([Yz({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),Xz({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var Qz=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Ei.has(e),s=dh(t,r),a=sC({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return X6e(a,s,t)},X6e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var wue=(t,{encoding:e})=>{let r=mue();t.readable=yue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=vue.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Tue.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Qz.bind(void 0,t,e),t[Symbol.asyncIterator]=Qz.bind(void 0,t,e,{})};var Aue=(t,e)=>{for(let[r,n]of e3e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Q6e=(async()=>{})().constructor.prototype,e3e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Q6e,t)]);var xue=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=n3e(t,e,r),{subprocess:f,promise:p}=o3e({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=oC.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Aue(f,p),Ps.set(f,{options:u,fileDescriptors:d}),f},n3e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=m0(t,e,r),{file:a,commandArguments:c,options:l}=$0(t,e,r),u=i3e(l),d=Lle(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},i3e=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},o3e=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=r3e(...D0(t,e,r))}catch(h){return kle({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;t3e(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];Hle(c,a,l),Yle(c,r,l);let d={},f=Is();c.kill=cae.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=cue(c,r),wue(c,r),Ple(c,r);let p=s3e({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},s3e=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,g]=await hue({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let _=h.map((E,A)=>ja(E,e,A)),b=ja(m,e,"all"),T=a3e({errorInfo:d,exitCode:f,signal:p,stdio:_,all:b,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return gh(T,n,e)},a3e=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?ZS({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Os,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):V0({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var uC=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,c3e(n,t[n],i)]));return{...t,...r}},c3e=(t,e,r)=>l3e.has(t)&&ir(e)&&ir(r)?{...e,...r}:r,l3e=new Set(["env",...IF]);var cl=(t,e,r,n)=>{let i=(s,a,c)=>cl(s,a,r,c),o=(...s)=>u3e({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},u3e=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(ir(o))return i(t,uC(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=d3e({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?wle(a,c,l):xue(a,c,l,i)},d3e=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=Loe(e)?Uoe(e,r):[e,...r],[s,a,c]=i0(...o),l=uC(uC(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Rue=({file:t,commandArguments:e})=>Iue(t,e),Cue=({file:t,commandArguments:e})=>({...Iue(t,e),isSync:!0}),Iue=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=f3e(t);return{file:r,commandArguments:n}},f3e=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(p3e)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},p3e=/ +/g;var Pue=(t,e,r)=>{t.sync=e(h3e,r),t.s=t.sync},Oue=({options:t})=>Nue(t),h3e=({options:t})=>({...Nue(t),isSync:!0}),Nue=t=>({options:{...m3e(t),...t}}),m3e=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},kue={preferLocal:!0};var Mue=cl(()=>({})),Hjt=cl(()=>({isSync:!0})),$ue=cl(Rue),Wjt=cl(Cue),Yjt=cl(Gae),Kjt=cl(Oue,{},kue,Pue),{sendMessage:Zjt,getOneMessage:Jjt,getEachMessage:Xjt,getCancelSignal:Qjt}=Ole();var Due=!1,Lue=()=>{Due=!0},ks=()=>Due;var nE=null,Uue=t=>(nE&&nE.destroy(),nE=new zo({totalAllowedTime:t}),nE),Fue=()=>nE;var zo=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&ks())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await GR({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ne.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var zue={name:"@netlify/agent-runner-cli",type:"module",version:"1.172.1-model-default-effort.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{prebuild:"rm -rf dist",build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:opencode":"vitest run test/integration/opencode.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.6","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.153.4","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.12.1",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var S3e=_3e(import.meta.url),E3e=Ba.dirname(S3e),v3e=y3e(import.meta.url),Eh=ce("shell"),ej=new Set,jue={preferLocal:!0},$t=(t,e,r)=>{let[n,i]=b3e(e,r),o={...jue,...i},s=Mue(t,n,o);que(s,o),Hue(s);let a=r?.idleTimeout;return a&&a>0&&Gue(s,a),s},Bue=(t,e)=>{let r={...jue,...e},n=$ue(t,r);return que(n,r),Hue(n),e?.idleTimeout&&e.idleTimeout>0&&Gue(n,e.idleTimeout),n},b3e=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},que=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0||Ms.env.NETLIFY_LOCAL_QUIET==="true")return;if(Ms.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new NS).pipe(Ms.stdout),t.stderr?.pipe(new NS).pipe(Ms.stderr);return}t.stdout?.pipe(Ms.stdout),t.stderr?.pipe(Ms.stderr)},tj=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Ms.kill(-t.pid,e),Eh.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return Eh.error("Error killing process:",r),!1}},Vue=t=>tj(t,"SIGKILL"),Gue=(t,e)=>{let r=null,n=()=>{Eh.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),tj(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Eh.log(`Force killing idle process ${t.pid}`),Vue(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},Hue=t=>{ej.add(t);let e=Fue();if(e){let r=e.onTimesUp(()=>{Eh.log(`Global timer expired, killing process ${t.pid}`),tj(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Eh.log(`Force killing process ${t.pid} after timeout`),Vue(t))},5e3)});t.on("exit",()=>{ej.delete(t),r()}),t.on("error",()=>{ej.delete(t),r()})}};function fC(t,e){return!!jo(t,e)}function jo(t,e){if(!Ms.env.NETLIFY_LOCAL_MODE)try{let i=v3e.resolve(zue.name),o=Ba.dirname(i);for(;o!==Ba.dirname(o);){let s=Ba.dirname(o);if(Ba.basename(s)==="node_modules"){let a=Ba.join(s,".bin",e);if(dC.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Ms.env.NODE_PATH){let i=Ba.join(Ms.env.NODE_PATH,".bin",e);if(dC.existsSync(i))return i}let r=Ba.join(t,"node_modules",".bin",e);if(dC.existsSync(r))return r;let n=Ba.join(E3e,"..","node_modules",".bin",e);if(dC.existsSync(n))return n}var Wue=ce("repo"),Xue="runner-diffs-",Que=t=>`${Xue}${t}-`,ede=async t=>{let e=Jue.tmpdir(),r;try{r=await pC.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(Xue)&&!n.startsWith(Que(t))).map(n=>pC.rm(hC.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Xn=(t,e={})=>$t("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),mC=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{Wue.info("Getting runner diffs");let n=await x3e(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=C3e(o);await I3e(h,r)}Wue.info("Changes after processing"),await nj(r);let s=await ij(o,r);if(await rj(s,r),i=await R3e(r),!i)return{hasChanges:!1,ignored:s};await Xn(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await pC.mkdtemp(hC.join(Jue.tmpdir(),Que(t.sessionId))),c=async({from:h,to:m,fileName:g,binary:_})=>{let b=hC.join(a,g);await Xn([..._?["diff",h,m,"--binary"]:["diff",h,m],`--output=${b}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:E}=await pC.stat(b);return{path:b,size:E}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await Zue(r),{hasChanges:!1,ignored:s};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await Kue(d,h)||(f=h)}await Zue(r),ne.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Kue(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Yue=async t=>{let e=T3e("sha256");for await(let r of w3e(t))e.update(r);return e.digest("hex")},Kue=async(t,e)=>t.size===e.size&&await Yue(t.path)===await Yue(e.path),Zue=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Xn(["reset","--soft","HEAD~1"],{cwd:t})},rj=async(t=[],e=process.cwd())=>{await Xn(["add",".",...t],{cwd:e})},nj=async(t=process.cwd())=>{let e=await Xn(["status","-s"],{cwd:t});return String(e.stdout??"")},tde=/.. (.+)?\.log$/,A3e=[tde],x3e=async(t=process.cwd())=>{let e=await nj(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
|
|
145
145
|
`).filter(i=>A3e.some(s=>s instanceof RegExp?s.test(i):i===s)?!1:i[1]?.trim()!=="")).length!==0,status:e}},R3e=async(t=process.cwd())=>{try{return await Xn(["diff","--staged","--quiet"],{cwd:t}),!1}catch{return!0}},iE=async(t=process.cwd())=>{let{stdout:e}=await Xn(["rev-parse","HEAD"],{cwd:t});return String(e??"").trim()},rde=async(t=process.cwd())=>{let{stdout:e}=await Xn(["rev-list","--max-parents=0","HEAD"],{cwd:t});return String(e??"").trim()},ij=async(t,e=process.cwd())=>{t||=await nj(e);let r=[".netlify","node_modules","dist",".next","out",".nuxt",".output",".cache",".turbo",".parcel-cache","coverage",".nyc_output","storybook-static","public/build","CLAUDE.local.md"],n=[];return t.split(`
|
|
146
146
|
`).forEach(i=>{r.forEach(s=>{let a=i===`?? ${s}`,c=i.startsWith(`?? ${s}/`)||i.startsWith(`?? ${s}${hC.sep}`);(a||c)&&n.push(`:!${s}`)});let o=i.match(tde)?.[1];o&&n.push(`:!${o}.log`)}),n},nde=async(t=process.cwd())=>{await Xn(["reset","--hard","HEAD"],{cwd:t})},ide=async(t=process.cwd())=>{let e=await Xn(["clean","-fd","-e",".netlify"],{stdio:["ignore","pipe","pipe"],cwd:t});return String(e.stdout??"").split(`
|
|
147
147
|
`).filter(r=>r.startsWith("Removing ")).map(r=>r.slice(9))},C3e=t=>{let e=t.split(`
|
|
@@ -368,12 +368,12 @@ Replace \`<template-id>\` with the matching template \`id\`. Include \`--package
|
|
|
368
368
|
`,1);return/^(Async agent launched successfully|Agent launched in background)/.test(e)||/\(internal ID:?\s*[\w./-]+\)/i.test(e)},vme=new Set(["SendMessage","ToolSearch","TaskList","TaskGet","EnterPlanMode","TaskStop"]);var pn=ce("runner_claude"),pv="Claude Code",Tme="claude-opus-5",KV="claude-sonnet-5",SZe={[aF]:"claude-sonnet-5"};async function EZe({aiGateway:t,config:e,model:r}){let n=r;if(t)if(e.modelVersionOverrides?.claude){let i=e.modelVersionOverrides?.claude?.[e.accountType];if(i){if(!await t.isModelAvailableForProvider("anthropic",i))throw new Error(`Model override '${i}' is not available for anthropic provider`);n=i}}else if(r){if(!await t.isModelAvailableForProvider("anthropic",r))throw new Error(`Model '${r}' is not available for anthropic provider`)}else{let i=SZe[e.accountType],o=i||Tme;!!o&&await t.isModelAvailableForProvider("anthropic",o)?(pn.log(`Using ${i?"account override":"default"} model: ${o}`),n=o):o&&pn.log(`Model ${o} is not available, proceeding without model specification`)}return n}function vZe({aiGateway:t}){if(t){let{token:e,url:r}=t;if(!e||!r)throw new Error("No token or url provided from AI Gateway");return{...Mm.env,ANTHROPIC_API_KEY:e,ANTHROPIC_BASE_URL:r}}if(!Mm.env.ANTHROPIC_API_KEY)throw new Error("ANTHROPIC_API_KEY is not provided");return{...Mm.env}}async function bZe(){let t=hv.join(Mm.cwd(),"AGENTS.md");try{await km.access(t)}catch{return}let e=hv.join(Mm.cwd(),"CLAUDE.local.md"),r="@AGENTS.md";try{if((await km.readFile(e,"utf-8")).includes(r))return;await km.appendFile(e,`
|
|
369
369
|
${r}
|
|
370
370
|
`)}catch{await km.writeFile(e,`${r}
|
|
371
|
-
`)}pn.log("Added @AGENTS.md import to CLAUDE.local.md")}async function ZV({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=Mm.cwd(),cliPath:s="netlify",abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let u=t,{prompt:d}=u,{model:f}=t,p="";await bZe();let h=vZe({aiGateway:r}),m=await EZe({config:t,aiGateway:r,model:f});l&&m?.includes("fable")&&(!r||await r.isModelAvailableForProvider("anthropic",KV))&&(pn.log(`Credit wrap-up: downgrading model ${m} to ${KV}`),m=KV);let g=[],_=[],b={},T=new Set,E=[],A=
|
|
372
|
-
`)||void 0},R=(
|
|
371
|
+
`)}pn.log("Added @AGENTS.md import to CLAUDE.local.md")}async function ZV({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=Mm.cwd(),cliPath:s="netlify",abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let u=t,{prompt:d}=u,{model:f}=t,p="";await bZe();let h=vZe({aiGateway:r}),m=await EZe({config:t,aiGateway:r,model:f});l&&m?.includes("fable")&&(!r||await r.isModelAvailableForProvider("anthropic",KV))&&(pn.log(`Credit wrap-up: downgrading model ${m} to ${KV}`),m=KV);let g=[],_=[],b={},T=new Set,E=[],A=We=>We?.match(/task\s+#([\w-]+)\s+created/i)?.[1],O=We=>{if(typeof We=="string")return We;if(Array.isArray(We))return We.filter(Ve=>Ve?.type==="text"&&typeof Ve.text=="string").map(Ve=>Ve.text).join(`
|
|
372
|
+
`)||void 0},R=(We,De)=>{let Ve=We.input||{};if(We.name==="TaskCreate"){E.push({id:A(De),subject:typeof Ve.subject=="string"?Ve.subject:"",activeForm:typeof Ve.activeForm=="string"?Ve.activeForm:void 0,status:"pending"});return}let xe=typeof Ve.taskId=="string"?Ve.taskId:void 0,we=xe===void 0?void 0:E.find(ln=>ln.id===xe);if(!we&&typeof Ve.subject=="string"){let ln=E.filter(fo=>fo.subject===Ve.subject);ln.length===1&&(we=ln[0])}if(Ve.status==="deleted"){we&&E.splice(E.indexOf(we),1);return}if(!we){if(xe===void 0||typeof Ve.subject!="string"&&typeof Ve.activeForm!="string")return;we={id:xe,subject:"",status:"pending"},E.push(we)}typeof Ve.status=="string"&&(we.status=Ve.status),typeof Ve.subject=="string"&&(we.subject=Ve.subject),typeof Ve.activeForm=="string"&&(we.activeForm=Ve.activeForm)},N=()=>E.map(We=>({name:We.status==="in_progress"&&We.activeForm||We.subject,value:We.status})),M=0,L=0,v,oe,$,S,w,k="",Y="mode"in t&&t.mode==="create"&&t.accountType===aF,H="mode"in t&&t.mode==="ask",he=El({creditWrapUpTurn:l}),je=tt().creditWrapUpEnabled&&Fd(t),Ie=t.effort===Yi,$e=Y&&!je&&!Ie,Pe=["ExitPlanMode","EnterPlanMode","AskUserQuestion"];$e&&Pe.push("TodoWrite","TaskCreate","TaskUpdate","TaskList","TaskGet"),H&&(Pe.push("Edit","Write","NotebookEdit","EnterWorktree","Bash(git push:*)","Bash(netlify deploy:*)"),Xh(t)||Pe.push(...WC(s).map(We=>`Bash(${We}:*)`)));let He=Zh("claude",t.effort);t.effort&&!He&&pn.log(`Effort '${t.effort}' is not available on ${pv}; using its default`);let le=l||$e?"low":Ie?Yi:He??"high",me=jo(o,"claude");if(!me)throw new Error("Claude CLI binary not found");let nt=Sl(t,{creditWrapUpTurn:l}),re=he||nt?await _fe({interactions:he,connections:nt}):void 0,qe=["--permission-mode","bypassPermissions","--dangerously-skip-permissions","--output-format","stream-json","--verbose","--disallowed-tools",Pe.join(","),...re?.args??[],...le===Yi?[]:["--effort",le],...m?["--model",m]:[],...n?i?["--resume",i]:["--continue"]:[],"-p"];pn.log(`Running ${me} ${qe.join(" ")}`);let z=$t(me,qe,{all:!0,env:h,cwd:o,idleTimeout:Ma,cancelSignal:a});z.stdin?.end(d);let x=il(()=>{e?.({steps:g,duration:L})},250),I=(We,De)=>{let{wrapMessage:Ve,...xe}=We,we=n0({...xe,id:M});we.message&&(we.message=we.message.replace(/\n?<system-reminder>.+?<\/system-reminder>\n?/gs,"").trim(),Ve&&we.message&&(we.message=`\`\`\`
|
|
373
373
|
${we.message}
|
|
374
|
-
\`\`\``)),M+=1,_.push(we),g.push(we),De||x.flush(),x(),De&&x.flush()},j=m||Tme,B
|
|
374
|
+
\`\`\``)),M+=1,_.push(we),g.push(we),De||x.flush(),x(),De&&x.flush()},j=m||Tme,B=$e?`Using ${pv} with ${j} and low effort because you are reaching your user limit`:`Using ${pv} with ${j}`;t.answeredInteraction||I({title:B,category:G.Environment},!0);let te=yZe.createInterface({input:z.all});te.on("error",We=>{pn.error("Readline interface error",{error:We.message,stack:We.stack})});let ie=!1,Ee=!1;te.on("line",We=>{let De=null;try{De=JSON.parse(We)}catch{pn.log("Could not parse line",We)}if(De?.session_id&&De.session_id!==p&&(p=De.session_id,c?.(p)),De?.type==="system"&&De.subtype==="status"&&De.status==="compacting"?ie||(I({category:G.Compaction,message:"Compacting context\u2026"}),ie=!0):De?.type==="system"&&De.subtype==="compact_boundary"&&(ie=!1,Ee=!0),Array.isArray(De?.message?.content)){let Ve=Ee&&De.message?.role==="user";Ee=!1,De.message.content.forEach(xe=>{switch(xe.type){case"text":{if(xe.text){if(xe.text.startsWith("Base directory for this skill:"))break;De.message?.role!=="user"&&(k=xe.text);let we=G.AgentMessage;Ve?we=G.Compaction:De.message?.role==="user"&&(we=G.SubagentPrompt),I({message:xe.text,category:we,parentGroupId:De.parent_tool_use_id||void 0})}break}case"image":{typeof xe.source=="object"&&xe.source&&xe.source.type==="base64"&&xe.source.media_type?I({message:``,category:G.AgentMessage,parentGroupId:De.parent_tool_use_id||void 0}):pn.log(`Unsupported image type ${xe.source?.type}`,xe.source);break}case"tool_use":{if(xe.name&&!rc[xe.name]&&!T.has(xe.name)&&(T.add(xe.name),pn.log(`Unmapped tool in stream: ${xe.name}`)),YV(xe.name)){let ln=xe.input?.description&&`\`${xe.input.description}\``;I({title:[fv(xe.name),ln].filter(Boolean).join(" "),category:rc[xe.name]?.category,groupId:xe.id,parentGroupId:De.parent_tool_use_id||void 0})}else xe.name==="Bash"&&tc(xe.input?.command)&&I({title:"Generating the site",category:G.SiteGeneration,groupId:xe.id,parentGroupId:De.parent_tool_use_id||void 0});let we=xe.id&&!w?Om(xe.name,xe.input,Lj):void 0;we&&"interaction"in we?(w=we.interaction,z.kill()):we&&(pn.warn("Ignoring malformed pause tool input",{toolUseId:xe.id,tool:xe.name,issues:we.issues}),ne.inc(we.metric,1)),xe.id&&(b[xe.id]=xe),x.flush();break}case"tool_result":{let we=xe.tool_use_id?b[xe.tool_use_id]:void 0;if(Nm(we?.name,Lj))break;let ln=YV(we?.name),fo=we?.name==="Bash"&&tc(we?.input?.command);if(we?.name==="Skill"&&we?.input?.skill){let zr=Rs(we.input.skill?.toString());La(pn,zr),I({title:`Use ${zr}`,category:G.Skill,type:we.input.skill?.toString(),parentGroupId:De.parent_tool_use_id||void 0},!0);break}if(we?.name==="TodoWrite"){let{name:zr,category:ur}=rc.TodoWrite;I({title:zr,category:ur,parentGroupId:De.parent_tool_use_id||void 0,tasks:De.tool_use_result?.newTodos?.map(yT=>({name:yT.status==="in_progress"?yT.activeForm:yT.content,value:yT.status}))},!0);break}if(we?.name==="TaskCreate"||we?.name==="TaskUpdate"){xe.is_error||R(we,O(xe.content)),I({title:fv(we.name),category:G.Todo,parentGroupId:De.parent_tool_use_id||void 0,tasks:N()},!0);break}if(we?.name&&vme.has(we.name)){let zr=rc[we.name]?.category||G.Tool,ur=zr===G.Todo&&E.length>0;I({title:fv(we.name),category:zr===G.Todo&&!ur?G.Tool:zr,parentGroupId:De.parent_tool_use_id||void 0,...ur?{tasks:N()}:{}},!0);break}let k_=!!(we?.name&&rc[we.name]),Oe;if(!ln&&!fo&&we){let zr=we.input?.file_path&&hv.relative(o,we.input.file_path);zr||(zr=we.input?.pattern||we.input?.command);let ur=zr&&`\`${zr}\``;Oe=[fv(we.name||""),ur].filter(Boolean).join(" ")}else!ln&&!fo&&!we&&(Oe="Tool result");let zt=["Bash","Glob","Grep","LS","Read","Edit","Write","TaskOutput"].includes(we?.name||"")||!ln&&!fo&&!k_,Fr=De.parent_tool_use_id||void 0;!Fr&&(ln||fo)&&(Fr=xe.tool_use_id);let wr,sa=ln&&De.tool_use_result?.content||xe.content;if(typeof sa=="string")wr=sa;else if(Array.isArray(sa)){let zr=[];sa.forEach(ur=>{ur?.type==="text"&&typeof ur.text=="string"?zr.push(ur.text):ur?.type==="image"&&typeof ur.source=="object"&&ur.source?ur.source.type==="base64"&&ur.source.media_type?zr.push(``):pn.log(`Unsupported image type ${ur.source.type}`,ur.source):pn.log(`Unsupported block type ${ur?.type}`)}),wr=zr.join(`
|
|
375
375
|
|
|
376
|
-
`)}if(ln&&wr&&Eme(wr)){I({title:"Running in background",category:G.Task,parentGroupId:Fr},!0);break}I({title:Pe,message:wr,wrapMessage:zt,category:ln?G.AgentMessage:fo?G.SiteGeneration:rc[we?.name??""]?.category||G.Tool,parentGroupId:Fr},!0);break}case"thinking":{xe.thinking&&I({title:"Reasoning",message:xe.thinking,category:G.Reasoning,parentGroupId:De.parent_tool_use_id||void 0},!0);break}default:pn.log(`Message content type is not supported ${xe.type}`,xe)}})}else De?.type==="result"&&(L=De.duration_ms||0,De.is_error?w||(oe=De.result,$=De.api_error_status??void 0):v=De.result,De.usage&&(rl(De.usage,m?{model:m}:{}),S=De.usage),[_,g].forEach(Ve=>{Ve[Ve.length-1]?.message===v&&Ve.pop()}))});let yt=!1;if(await z.catch(He=>{yt=_l(He,a),{error:oe,result:v}=Jh({catchError:He,runCmd:z,error:oe,result:v,runnerName:"Claude"})}),re&&await km.rm(re.mcpConfigPath,{force:!0}).catch(()=>{}),te.close(),x.flush(),w)return{steps:_,duration:L,agentSessionId:p,resolvedModel:m,effort:le,usage:S,pendingInteraction:w};let lr=yt;lr&&(!v&&k.trim()&&(v=k.trim()),oe=void 0);let St=oe?dme({error:oe,apiErrorStatus:$}):void 0,di=$P(St);return di&&pn.log(`Classified provider failure as ${di.failureClass}`,JSON.stringify({...St,retryable:di.retryable})),{steps:_,duration:L,result:await Nl({initialResult:v,agentName:pv,hasError:!!oe}),error:kl({error:oe,agentName:pv}),isRetryableError:di?.retryable??Ml(oe),isProviderUnavailableError:di?.providerFault??$l(oe),...St?{providerFailure:St}:{},agentSessionId:p,resolvedModel:m,effort:le,usage:S,...lr?{aborted:!0}:{}}}var wme=async()=>{let t=hv.join(bme.homedir(),".claude");await km.rm(t,{recursive:!0,force:!0})},Ame={baseDir:hv.join(bme.homedir(),".claude"),include:["projects"]};import Lv from"fs/promises";import Uv from"os";import Ql from"path";import fc from"process";import W8e from"readline";function Ce(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function F(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var JV=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return JV=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};function mv(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var gv=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};var ye=class extends Error{},er=class t extends ye{constructor(e,r,n,i){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=r;let o=r;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new Dl({message:n,cause:gv(r)});let o=r?.error;return e===400?new $m(e,o,n,i):e===401?new Dm(e,o,n,i):e===403?new Lm(e,o,n,i):e===404?new Um(e,o,n,i):e===409?new Fm(e,o,n,i):e===422?new zm(e,o,n,i):e===429?new jm(e,o,n,i):e>=500?new Bm(e,o,n,i):new t(e,o,n,i)}},fr=class extends er{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Dl=class extends er{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},Ll=class extends Dl{constructor({message:e}={}){super({message:e??"Request timed out."})}},$m=class extends er{},Dm=class extends er{},Lm=class extends er{},Um=class extends er{},Fm=class extends er{},zm=class extends er{},jm=class extends er{},Bm=class extends er{},qm=class extends ye{constructor(){super("Could not parse response content as the length limit was reached")}},Vm=class extends ye{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},Bs=class extends Error{constructor(e){super(e)}},jd=class extends er{constructor(e,r,n){let i="OAuth2 authentication error",o;if(r&&typeof r=="object"){let s=r;o=s.error;let a=s.error_description;a&&typeof a=="string"?i=a:o&&(i=o)}super(e,r,i,n),this.error_code=o}},_v=class extends ye{constructor(e,r,n){super(e),this.provider=r,this.cause=n}};var wZe=/^[a-z][a-z0-9+.-]*:/i,xme=t=>wZe.test(t),hn=t=>(hn=Array.isArray,hn(t)),XV=hn;function QV(t){return typeof t!="object"?{}:t??{}}function eG(t){if(!t)return!0;for(let e in t)return!1;return!0}function Rme(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yv(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var Cme=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new ye(`${t} must be an integer`);if(e<0)throw new ye(`${t} must be a positive integer`);return e};var Ime=t=>{try{return JSON.parse(t)}catch{return}};var qs=t=>new Promise(e=>setTimeout(e,t));var Ul="6.34.0";var kme=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function AZe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var xZe=()=>{let t=AZe();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":Ome(Deno.build.os),"X-Stainless-Arch":Pme(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":Ome(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Pme(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=RZe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function RZe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var Pme=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",Ome=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),Nme,Mme=()=>Nme??(Nme=xZe());function UP(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function tG(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function FP(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return tG({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function rG(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function nG(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var Dme=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var iG="RFC3986",oG=t=>String(t),sG={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:oG},Lme="RFC1738";var zP=(t,e)=>(zP=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),zP(t,e)),Vs=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();var aG=1024,Ume=(t,e,r,n,i)=>{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a<o.length;a+=aG){let c=o.length>=aG?o.slice(a,a+aG):o,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===Lme&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Vs[d];continue}if(d<2048){l[l.length]=Vs[192|d>>6]+Vs[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Vs[224|d>>12]+Vs[128|d>>6&63]+Vs[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Vs[240|d>>18]+Vs[128|d>>12&63]+Vs[128|d>>6&63]+Vs[128|d&63]}s+=l.join("")}return s};function Fme(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function cG(t,e){if(hn(t)){let r=[];for(let n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)}var jme={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},Bme=function(t,e){Array.prototype.push.apply(t,hn(e)?e:[e])},zme,Er={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ume,encodeValuesOnly:!1,format:iG,formatter:oG,indices:!1,serializeDate(t){return(zme??(zme=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function IZe(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var lG={};function qme(t,e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_){let b=t,T=_,E=0,A=!1;for(;(T=T.get(lG))!==void 0&&!A;){let L=T.get(t);if(E+=1,typeof L<"u"){if(L===E)throw new RangeError("Cyclic object value");A=!0}typeof T.get(lG)>"u"&&(E=0)}if(typeof l=="function"?b=l(e,b):b instanceof Date?b=f?.(b):r==="comma"&&hn(b)&&(b=cG(b,function(L){return L instanceof Date?f?.(L):L})),b===null){if(o)return c&&!m?c(e,Er.encoder,g,"key",p):e;b=""}if(IZe(b)||Fme(b)){if(c){let L=m?e:c(e,Er.encoder,g,"key",p);return[h?.(L)+"="+h?.(c(b,Er.encoder,g,"value",p))]}return[h?.(e)+"="+h?.(String(b))]}let O=[];if(typeof b>"u")return O;let R;if(r==="comma"&&hn(b))m&&c&&(b=cG(b,c)),R=[{value:b.length>0?b.join(",")||null:void 0}];else if(hn(l))R=l;else{let L=Object.keys(b);R=u?L.sort(u):L}let N=a?String(e).replace(/\./g,"%2E"):String(e),M=n&&hn(b)&&b.length===1?N+"[]":N;if(i&&hn(b)&&b.length===0)return M+"[]";for(let L=0;L<R.length;++L){let v=R[L],oe=typeof v=="object"&&typeof v.value<"u"?v.value:b[v];if(s&&oe===null)continue;let $=d&&a?v.replace(/\./g,"%2E"):v,S=hn(b)?typeof r=="function"?r(M,$):M:M+(d?"."+$:"["+$+"]");_.set(t,E);let w=new WeakMap;w.set(lG,_),Bme(O,qme(oe,S,r,n,i,o,s,a,r==="comma"&&m&&hn(b)?null:c,l,u,d,f,p,h,m,g,w))}return O}function PZe(t=Er){if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=t.charset||Er.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=iG;if(typeof t.format<"u"){if(!zP(sG,t.format))throw new TypeError("Unknown format option provided.");r=t.format}let n=sG[r],i=Er.filter;(typeof t.filter=="function"||hn(t.filter))&&(i=t.filter);let o;if(t.arrayFormat&&t.arrayFormat in jme?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=Er.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let s=typeof t.allowDots>"u"?t.encodeDotInKeys?!0:Er.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Er.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Er.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Er.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Er.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Er.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Er.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Er.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Er.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Er.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Er.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Er.strictNullHandling}}function Vme(t,e={}){let r=t,n=PZe(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):hn(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=jme[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f<i.length;++f){let p=i[f];n.skipNulls&&r[p]===null||Bme(s,qme(r[p],p,a,c,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let u=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""}function Gme(t){return Vme(t,{arrayFormat:"brackets"})}function Yme(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var Hme;function Gm(t){let e;return(Hme??(e=new globalThis.TextEncoder,Hme=e.encode.bind(e)))(t)}var Wme;function uG(t){let e;return(Wme??(e=new globalThis.TextDecoder,Wme=e.decode.bind(e)))(t)}var xi,Ri,Bd=class{constructor(){xi.set(this,void 0),Ri.set(this,void 0),Ce(this,xi,new Uint8Array,"f"),Ce(this,Ri,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Gm(e):e;Ce(this,xi,Yme([F(this,xi,"f"),r]),"f");let n=[],i;for(;(i=NZe(F(this,xi,"f"),F(this,Ri,"f")))!=null;){if(i.carriage&&F(this,Ri,"f")==null){Ce(this,Ri,i.index,"f");continue}if(F(this,Ri,"f")!=null&&(i.index!==F(this,Ri,"f")+1||i.carriage)){n.push(uG(F(this,xi,"f").subarray(0,F(this,Ri,"f")-1))),Ce(this,xi,F(this,xi,"f").subarray(F(this,Ri,"f")),"f"),Ce(this,Ri,null,"f");continue}let o=F(this,Ri,"f")!==null?i.preceding-1:i.preceding,s=uG(F(this,xi,"f").subarray(0,o));n.push(s),Ce(this,xi,F(this,xi,"f").subarray(i.index),"f"),Ce(this,Ri,null,"f")}return n}flush(){return F(this,xi,"f").length?this.decode(`
|
|
376
|
+
`)}if(ln&&wr&&Eme(wr)){I({title:"Running in background",category:G.Task,parentGroupId:Fr},!0);break}I({title:Oe,message:wr,wrapMessage:zt,category:ln?G.AgentMessage:fo?G.SiteGeneration:rc[we?.name??""]?.category||G.Tool,parentGroupId:Fr},!0);break}case"thinking":{xe.thinking&&I({title:"Reasoning",message:xe.thinking,category:G.Reasoning,parentGroupId:De.parent_tool_use_id||void 0},!0);break}default:pn.log(`Message content type is not supported ${xe.type}`,xe)}})}else De?.type==="result"&&(L=De.duration_ms||0,De.is_error?w||(oe=De.result,$=De.api_error_status??void 0):v=De.result,De.usage&&(rl(De.usage,m?{model:m}:{}),S=De.usage),[_,g].forEach(Ve=>{Ve[Ve.length-1]?.message===v&&Ve.pop()}))});let yt=!1;if(await z.catch(We=>{yt=_l(We,a),{error:oe,result:v}=Jh({catchError:We,runCmd:z,error:oe,result:v,runnerName:"Claude"})}),re&&await km.rm(re.mcpConfigPath,{force:!0}).catch(()=>{}),te.close(),x.flush(),w)return{steps:_,duration:L,agentSessionId:p,resolvedModel:m,effort:le,usage:S,pendingInteraction:w};let lr=yt;lr&&(!v&&k.trim()&&(v=k.trim()),oe=void 0);let St=oe?dme({error:oe,apiErrorStatus:$}):void 0,di=$P(St);return di&&pn.log(`Classified provider failure as ${di.failureClass}`,JSON.stringify({...St,retryable:di.retryable})),{steps:_,duration:L,result:await Nl({initialResult:v,agentName:pv,hasError:!!oe}),error:kl({error:oe,agentName:pv}),isRetryableError:di?.retryable??Ml(oe),isProviderUnavailableError:di?.providerFault??$l(oe),...St?{providerFailure:St}:{},agentSessionId:p,resolvedModel:m,effort:le,usage:S,...lr?{aborted:!0}:{}}}var wme=async()=>{let t=hv.join(bme.homedir(),".claude");await km.rm(t,{recursive:!0,force:!0})},Ame={baseDir:hv.join(bme.homedir(),".claude"),include:["projects"]};import Lv from"fs/promises";import Uv from"os";import Ql from"path";import fc from"process";import W8e from"readline";function Ce(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function F(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var JV=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return JV=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};function mv(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var gv=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};var ye=class extends Error{},er=class t extends ye{constructor(e,r,n,i){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=r;let o=r;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new Dl({message:n,cause:gv(r)});let o=r?.error;return e===400?new $m(e,o,n,i):e===401?new Dm(e,o,n,i):e===403?new Lm(e,o,n,i):e===404?new Um(e,o,n,i):e===409?new Fm(e,o,n,i):e===422?new zm(e,o,n,i):e===429?new jm(e,o,n,i):e>=500?new Bm(e,o,n,i):new t(e,o,n,i)}},fr=class extends er{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},Dl=class extends er{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},Ll=class extends Dl{constructor({message:e}={}){super({message:e??"Request timed out."})}},$m=class extends er{},Dm=class extends er{},Lm=class extends er{},Um=class extends er{},Fm=class extends er{},zm=class extends er{},jm=class extends er{},Bm=class extends er{},qm=class extends ye{constructor(){super("Could not parse response content as the length limit was reached")}},Vm=class extends ye{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},Bs=class extends Error{constructor(e){super(e)}},jd=class extends er{constructor(e,r,n){let i="OAuth2 authentication error",o;if(r&&typeof r=="object"){let s=r;o=s.error;let a=s.error_description;a&&typeof a=="string"?i=a:o&&(i=o)}super(e,r,i,n),this.error_code=o}},_v=class extends ye{constructor(e,r,n){super(e),this.provider=r,this.cause=n}};var wZe=/^[a-z][a-z0-9+.-]*:/i,xme=t=>wZe.test(t),hn=t=>(hn=Array.isArray,hn(t)),XV=hn;function QV(t){return typeof t!="object"?{}:t??{}}function eG(t){if(!t)return!0;for(let e in t)return!1;return!0}function Rme(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yv(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var Cme=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new ye(`${t} must be an integer`);if(e<0)throw new ye(`${t} must be a positive integer`);return e};var Ime=t=>{try{return JSON.parse(t)}catch{return}};var qs=t=>new Promise(e=>setTimeout(e,t));var Ul="6.34.0";var kme=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function AZe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var xZe=()=>{let t=AZe();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":Ome(Deno.build.os),"X-Stainless-Arch":Pme(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":Ome(globalThis.process.platform??"unknown"),"X-Stainless-Arch":Pme(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=RZe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Ul,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function RZe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var Pme=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",Ome=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),Nme,Mme=()=>Nme??(Nme=xZe());function UP(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function tG(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function FP(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return tG({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function rG(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function nG(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var Dme=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var iG="RFC3986",oG=t=>String(t),sG={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:oG},Lme="RFC1738";var zP=(t,e)=>(zP=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),zP(t,e)),Vs=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();var aG=1024,Ume=(t,e,r,n,i)=>{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a<o.length;a+=aG){let c=o.length>=aG?o.slice(a,a+aG):o,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===Lme&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Vs[d];continue}if(d<2048){l[l.length]=Vs[192|d>>6]+Vs[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Vs[224|d>>12]+Vs[128|d>>6&63]+Vs[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Vs[240|d>>18]+Vs[128|d>>12&63]+Vs[128|d>>6&63]+Vs[128|d&63]}s+=l.join("")}return s};function Fme(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function cG(t,e){if(hn(t)){let r=[];for(let n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)}var jme={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},Bme=function(t,e){Array.prototype.push.apply(t,hn(e)?e:[e])},zme,Er={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ume,encodeValuesOnly:!1,format:iG,formatter:oG,indices:!1,serializeDate(t){return(zme??(zme=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function IZe(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var lG={};function qme(t,e,r,n,i,o,s,a,c,l,u,d,f,p,h,m,g,_){let b=t,T=_,E=0,A=!1;for(;(T=T.get(lG))!==void 0&&!A;){let L=T.get(t);if(E+=1,typeof L<"u"){if(L===E)throw new RangeError("Cyclic object value");A=!0}typeof T.get(lG)>"u"&&(E=0)}if(typeof l=="function"?b=l(e,b):b instanceof Date?b=f?.(b):r==="comma"&&hn(b)&&(b=cG(b,function(L){return L instanceof Date?f?.(L):L})),b===null){if(o)return c&&!m?c(e,Er.encoder,g,"key",p):e;b=""}if(IZe(b)||Fme(b)){if(c){let L=m?e:c(e,Er.encoder,g,"key",p);return[h?.(L)+"="+h?.(c(b,Er.encoder,g,"value",p))]}return[h?.(e)+"="+h?.(String(b))]}let O=[];if(typeof b>"u")return O;let R;if(r==="comma"&&hn(b))m&&c&&(b=cG(b,c)),R=[{value:b.length>0?b.join(",")||null:void 0}];else if(hn(l))R=l;else{let L=Object.keys(b);R=u?L.sort(u):L}let N=a?String(e).replace(/\./g,"%2E"):String(e),M=n&&hn(b)&&b.length===1?N+"[]":N;if(i&&hn(b)&&b.length===0)return M+"[]";for(let L=0;L<R.length;++L){let v=R[L],oe=typeof v=="object"&&typeof v.value<"u"?v.value:b[v];if(s&&oe===null)continue;let $=d&&a?v.replace(/\./g,"%2E"):v,S=hn(b)?typeof r=="function"?r(M,$):M:M+(d?"."+$:"["+$+"]");_.set(t,E);let w=new WeakMap;w.set(lG,_),Bme(O,qme(oe,S,r,n,i,o,s,a,r==="comma"&&m&&hn(b)?null:c,l,u,d,f,p,h,m,g,w))}return O}function PZe(t=Er){if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=t.charset||Er.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=iG;if(typeof t.format<"u"){if(!zP(sG,t.format))throw new TypeError("Unknown format option provided.");r=t.format}let n=sG[r],i=Er.filter;(typeof t.filter=="function"||hn(t.filter))&&(i=t.filter);let o;if(t.arrayFormat&&t.arrayFormat in jme?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=Er.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let s=typeof t.allowDots>"u"?t.encodeDotInKeys?!0:Er.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Er.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Er.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Er.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Er.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Er.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Er.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Er.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Er.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Er.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Er.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Er.strictNullHandling}}function Vme(t,e={}){let r=t,n=PZe(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):hn(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=jme[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f<i.length;++f){let p=i[f];n.skipNulls&&r[p]===null||Bme(s,qme(r[p],p,a,c,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}let u=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""}function Gme(t){return Vme(t,{arrayFormat:"brackets"})}function Yme(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var Hme;function Gm(t){let e;return(Hme??(e=new globalThis.TextEncoder,Hme=e.encode.bind(e)))(t)}var Wme;function uG(t){let e;return(Wme??(e=new globalThis.TextDecoder,Wme=e.decode.bind(e)))(t)}var xi,Ri,Bd=class{constructor(){xi.set(this,void 0),Ri.set(this,void 0),Ce(this,xi,new Uint8Array,"f"),Ce(this,Ri,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Gm(e):e;Ce(this,xi,Yme([F(this,xi,"f"),r]),"f");let n=[],i;for(;(i=NZe(F(this,xi,"f"),F(this,Ri,"f")))!=null;){if(i.carriage&&F(this,Ri,"f")==null){Ce(this,Ri,i.index,"f");continue}if(F(this,Ri,"f")!=null&&(i.index!==F(this,Ri,"f")+1||i.carriage)){n.push(uG(F(this,xi,"f").subarray(0,F(this,Ri,"f")-1))),Ce(this,xi,F(this,xi,"f").subarray(F(this,Ri,"f")),"f"),Ce(this,Ri,null,"f");continue}let o=F(this,Ri,"f")!==null?i.preceding-1:i.preceding,s=uG(F(this,xi,"f").subarray(0,o));n.push(s),Ce(this,xi,F(this,xi,"f").subarray(i.index),"f"),Ce(this,Ri,null,"f")}return n}flush(){return F(this,xi,"f").length?this.decode(`
|
|
377
377
|
`):[]}};xi=new WeakMap,Ri=new WeakMap;Bd.NEWLINE_CHARS=new Set([`
|
|
378
378
|
`,"\r"]);Bd.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function NZe(t,e){for(let i=e??0;i<t.length;i++){if(t[i]===10)return{preceding:i,index:i+1,carriage:!1};if(t[i]===13)return{preceding:i,index:i+1,carriage:!0}}return null}function Kme(t){for(let n=0;n<t.length-1;n++){if(t[n]===10&&t[n+1]===10||t[n]===13&&t[n+1]===13)return n+2;if(t[n]===13&&t[n+1]===10&&n+3<t.length&&t[n+2]===13&&t[n+3]===10)return n+4}return-1}var BP={off:0,error:200,warn:300,info:400,debug:500},dG=(t,e,r)=>{if(t){if(Rme(BP,t))return t;sr(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(BP))}`)}};function Sv(){}function jP(t,e,r){return!e||BP[t]>BP[r]?Sv:e[t].bind(e)}var kZe={error:Sv,warn:Sv,info:Sv,debug:Sv},Zme=new WeakMap;function sr(t){let e=t.logger,r=t.logLevel??"off";if(!e)return kZe;let n=Zme.get(e);if(n&&n[0]===r)return n[1];let i={error:jP("error",e,r),warn:jP("warn",e,r),info:jP("info",e,r),debug:jP("debug",e,r)};return Zme.set(e,[r,i]),i}var nc=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);var Ev,Gs=class t{constructor(e,r,n){this.iterator=e,Ev.set(this,void 0),this.controller=r,Ce(this,Ev,n,"f")}static fromSSEResponse(e,r,n,i){let o=!1,s=n?sr(n):console;async function*a(){if(o)throw new ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let c=!1;try{for await(let l of MZe(e,r))if(!c){if(l.data.startsWith("[DONE]")){c=!0;continue}if(l.event===null||!l.event.startsWith("thread.")){let u;try{u=JSON.parse(l.data)}catch(d){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),d}if(u&&u.error)throw new er(void 0,u.error,void 0,e.headers);yield i?{event:l.event,data:u}:u}else{let u;try{u=JSON.parse(l.data)}catch(d){throw console.error("Could not parse message into JSON:",l.data),console.error("From chunk:",l.raw),d}if(l.event=="error")throw new er(void 0,u.error,u.message,void 0);yield{event:l.event,data:u}}}c=!0}catch(l){if(mv(l))return;throw l}finally{c||r.abort()}}return new t(a,r,n)}static fromReadableStream(e,r,n){let i=!1;async function*o(){let a=new Bd,c=rG(e);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(i)throw new ye("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if(mv(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}[(Ev=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),i=o=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),r.push(s)}return o.shift()}});return[new t(()=>i(e),this.controller,F(this,Ev,"f")),new t(()=>i(r),this.controller,F(this,Ev,"f"))]}toReadableStream(){let e=this,r;return tG({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:o}=await r.next();if(o)return n.close();let s=Gm(JSON.stringify(i)+`
|
|
379
379
|
`);n.enqueue(s)}catch(i){n.error(i)}},async cancel(){await r.return?.()}})}};async function*MZe(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ye("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ye("Attempted to iterate over a response with no body");let r=new fG,n=new Bd,i=rG(t.body);for await(let o of $Ze(i))for(let s of n.decode(o)){let a=r.decode(s);a&&(yield a)}for(let o of n.flush()){let s=r.decode(o);s&&(yield s)}}async function*$Ze(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?Gm(r):r,i=new Uint8Array(e.length+n.length);i.set(e),i.set(n,e.length),e=i;let o;for(;(o=Kme(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var fG=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
|
|
@@ -398,9 +398,9 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
398
398
|
`);this.baseURL=c.baseURL,this.timeout=c.timeout??LG.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=dG(c.logLevel,"ClientOptions.logLevel",this)??dG(Gl("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??UP(),Ce(this,fO,Dme,"f"),this._options=c,s&&(this._workloadIdentityAuth=new GP(s,this.fetch)),this.apiKey=typeof r=="string"?r:"Missing Key",this.organization=n,this.project=i,this.webhookSecret=o}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){}async authHeaders(e){return se([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return Gme(e)}getUserAgent(){return`${this.constructor.name}/JS ${Ul}`}defaultIdempotencyKey(){return`stainless-node-retry-${JV()}`}makeStatusError(e,r,n,i){return er.generate(e,r,n,i)}async _callApiKey(){let e=this._options.apiKey;if(typeof e!="function")return!1;let r;try{r=await e()}catch(n){throw n instanceof ye?n:new ye(`Failed to get token from 'apiKey' function: ${n.message}`,{cause:n})}if(typeof r!="string"||!r)throw new ye(`Expected 'apiKey' function argument to return a string but it returned ${r}`);return this.apiKey=r,!0}buildURL(e,r,n){let i=!F(this,DG,"m",Cge).call(this)&&n||this.baseURL,o=xme(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),s=this.defaultQuery(),a=Object.fromEntries(o.searchParams);return(!eG(s)||!eG(a))&&(r={...a,...s,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(o.search=this.stringifyQuery(r)),o.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:r,options:n}){}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(i=>({method:e,path:r,...i})))}request(e,r=null){return new qd(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let i=await e,o=i.maxRetries??this.maxRetries;r==null&&(r=o),await this.prepareOptions(i);let{req:s,url:a,timeout:c}=await this.buildRequest(i,{retryCount:o-r});await this.prepareRequest(s,{url:a,options:i});let l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=n===void 0?"":`, retryOf: ${n}`,d=Date.now();if(sr(this).debug(`[${l}] sending request`,nc({retryOfRequestLogID:n,method:i.method,url:a,options:i,headers:s.headers})),i.signal?.aborted)throw new fr;let f=new AbortController,p=await this.fetchWithAuth(a,s,c,f).catch(gv),h=Date.now();if(p instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(i.signal?.aborted)throw new fr;let b=mv(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(r)return sr(this).info(`[${l}] connection ${b?"timed out":"failed"} - ${_}`),sr(this).debug(`[${l}] connection ${b?"timed out":"failed"} (${_})`,nc({retryOfRequestLogID:n,url:a,durationMs:h-d,message:p.message})),this.retryRequest(i,r,n??l);throw sr(this).info(`[${l}] connection ${b?"timed out":"failed"} - error; no more retries left`),sr(this).debug(`[${l}] connection ${b?"timed out":"failed"} (error; no more retries left)`,nc({retryOfRequestLogID:n,url:a,durationMs:h-d,message:p.message})),p instanceof jd||p instanceof _v?p:b?new Ll:new Dl({cause:p})}let m=[...p.headers.entries()].filter(([_])=>_==="x-request-id").map(([_,b])=>", "+_+": "+JSON.stringify(b)).join(""),g=`[${l}${u}${m}] ${s.method} ${a} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${h-d}ms`;if(!p.ok){if(p.status===401&&this._workloadIdentityAuth&&!i.__metadata?.hasStreamingBody&&!i.__metadata?.workloadIdentityTokenRefreshed)return await nG(p.body),this._workloadIdentityAuth.invalidateToken(),this.makeRequest({...i,__metadata:{...i.__metadata,workloadIdentityTokenRefreshed:!0}},r,n??l);let _=await this.shouldRetry(p);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await nG(p.body),sr(this).info(`${g} - ${R}`),sr(this).debug(`[${l}] response error (${R})`,nc({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),this.retryRequest(i,r,n??l,p.headers)}let b=_?"error; no more retries left":"error; not retryable";sr(this).info(`${g} - ${b}`);let T=await p.text().catch(R=>gv(R).message),E=Ime(T),A=E?void 0:T;throw sr(this).debug(`[${l}] response error (${b})`,nc({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,message:A,durationMs:Date.now()-d})),this.makeStatusError(p.status,E,A,p.headers)}return sr(this).info(g),sr(this).debug(`[${l}] response start`,nc({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:h-d})),{response:p,options:i,controller:f,requestLogID:l,retryOfRequestLogID:n,startTime:d}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(i=>({method:"get",path:e,...i})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new Tv(this,n,e)}async fetchWithAuth(e,r,n,i){if(this._workloadIdentityAuth){let s=r.headers,a=s.get("Authorization");if(!a||a===`Bearer ${$G}`){let c=await this._workloadIdentityAuth.getToken();s.set("Authorization",`Bearer ${c}`)}}return await this.fetchWithTimeout(e,r,n,i)}async fetchWithTimeout(e,r,n,i){let{signal:o,method:s,...a}=r||{},c=this._makeAbort(i);o&&o.addEventListener("abort",c,{once:!0});let l=setTimeout(c,n),u=globalThis.ReadableStream&&a.body instanceof globalThis.ReadableStream||typeof a.body=="object"&&a.body!==null&&Symbol.asyncIterator in a.body,d={signal:i.signal,...u?{duplex:"half"}:{},method:"GET",...a};s&&(d.method=s.toUpperCase());try{return await this.fetch.call(void 0,e,d)}finally{clearTimeout(l)}}async shouldRetry(e){let r=e.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,i){let o,s=i?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(o=c)}let a=i?.get("retry-after");if(a&&!o){let c=parseFloat(a);Number.isNaN(c)?o=Date.parse(a)-Date.now():o=c*1e3}if(o===void 0){let c=e.maxRetries??this.maxRetries;o=this.calculateDefaultRetryTimeoutMillis(r,c)}return await qs(o),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let o=r-e,s=Math.min(.5*Math.pow(2,o),8),a=1-Math.random()*.25;return s*a*1e3}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:i,path:o,query:s,defaultBaseURL:a}=n,c=this.buildURL(o,s,a);"timeout"in n&&Cme("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:u,isStreamingBody:d}=this.buildBody({options:n});d&&(e.__metadata={...e.__metadata,hasStreamingBody:!0});let f=await this.buildHeaders({options:e,method:i,bodyHeaders:l,retryCount:r});return{req:{method:i,headers:f,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...n.fetchOptions??{}},url:c,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:i}){let o={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),o[this.idempotencyHeader]=e.idempotencyKey);let s=se([o,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Mme(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(s),s.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let n=se([r]),i=typeof globalThis.ReadableStream<"u"&&e instanceof globalThis.ReadableStream,o=!i&&(typeof e=="string"||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob||e instanceof URLSearchParams||e instanceof FormData);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||i?{bodyHeaders:void 0,body:e,isStreamingBody:!o}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:FP(e),isStreamingBody:!0}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e),isStreamingBody:!1}:{...F(this,fO,"f").call(this,{body:e,headers:n}),isStreamingBody:!1}}};LG=Ue,fO=new WeakMap,DG=new WeakSet,Cge=function(){return this.baseURL!=="https://api.openai.com/v1"};Ue.OpenAI=LG;Ue.DEFAULT_TIMEOUT=6e5;Ue.OpenAIError=ye;Ue.APIError=er;Ue.APIConnectionError=Dl;Ue.APIConnectionTimeoutError=Ll;Ue.APIUserAbortError=fr;Ue.NotFoundError=Um;Ue.ConflictError=Fm;Ue.RateLimitError=jm;Ue.BadRequestError=$m;Ue.AuthenticationError=Dm;Ue.InternalServerError=Bm;Ue.PermissionDeniedError=Lm;Ue.UnprocessableEntityError=zm;Ue.InvalidWebhookSignatureError=Bs;Ue.toFile=WP;Ue.Completions=Xd;Ue.Chat=Bl;Ue.Embeddings=ef;Ue.Files=rf;Ue.Images=af;Ue.Audio=Ws;Ue.Moderations=lf;Ue.Models=cf;Ue.FineTuning=Wo;Ue.Graders=Zl;Ue.VectorStores=dc;Ue.Webhooks=ff;Ue.Beta=Ho;Ue.Batches=Wd;Ue.Uploads=Xl;Ue.Responses=lc;Ue.Realtime=cc;Ue.Conversations=Yl;Ue.Evals=Kl;Ue.Containers=Wl;Ue.Skills=uc;Ue.Videos=df;var Ii=ce("runner_codex"),pO="Codex CLI",Rg="gpt-5.6-sol";async function Y8e({aiGateway:t,config:e,model:r}){let n=r;if(t)if(e.modelVersionOverrides?.codex){let i=e.modelVersionOverrides?.codex?.[e.accountType];if(i){if(!await t.isModelAvailableForProvider("openai",i))throw new Error(`Model override '${i}' is not available for openai provider`);n=i}}else if(r){if(!await t.isModelAvailableForProvider("openai",r))throw new Error(`Model '${r}' is not available for openai provider`)}else!!Rg&&await t.isModelAvailableForProvider("openai",Rg)?(n=Rg,Ii.log(`Using default model: ${Rg}`)):Rg&&Ii.log(`Default model ${Rg} is not available, proceeding without model specification`);return n}var hO="netlify-ask-db",K8e=`default_permissions = "${hO}"`,Z8e=()=>Ql.join(fc.env.XDG_CONFIG_HOME??Ql.join(Uv.homedir(),".config"),"netlify"),J8e=t=>["",`[permissions.${hO}]`,'description = "Ask mode: read-only filesystem, network access for database reads"','extends = ":read-only"',"",`[permissions.${hO}.filesystem]`,'":minimal" = "read"','"/" = "read"',`"${t}" = "write"`,"",`[permissions.${hO}.network]`,"enabled = true"];function X8e({aiGateway:t}){if(t){let{token:e,url:r}=t;if(!e||!r)throw new Error("No token or url provided from AI Gateway");fc.env.OPENAI_API_KEY=e,fc.env.OPENAI_BASE_URL=r}else if(!fc.env.OPENAI_API_KEY)throw new Error("OPENAI_API_KEY is not provided")}async function UG({config:t,persistSteps:e,sendSteps:r,aiGateway:n,continueSession:i,priorAgentSessionId:o,cwd:s=fc.cwd(),abortSignal:a,onSessionId:c,forceLowEffortForCreditWrapUp:l}){let{prompt:u}=t,{model:d}=t;X8e({aiGateway:n});let f=await Y8e({config:t,aiGateway:n,model:d}),p=[],h=[],m=[],g={},_=new Set,b=0,T=0,E,A,O,R,N,M=Xh(t),L=`${fc.env.NVM_BIN}/node`,v=Ql.join(Uv.homedir(),".codex"),oe=Ql.join(v,"config.toml"),$=Ql.join(v,"auth.json");try{await Lv.mkdir(v,{recursive:!0});let z={OPENAI_API_KEY:fc.env.OPENAI_API_KEY};await Lv.writeFile($,JSON.stringify(z,null,2),"utf-8"),Ii.log("Created Codex auth.json file");let x=fc.env.OPENAI_BASE_URL,I=['forced_login_method = "api"'],j=El({creditWrapUpTurn:l}),B=Sl(t,{creditWrapUpTurn:l});M&&I.push(K8e),x&&I.push('model_provider = "openai_proxy"',"","[model_providers.openai_proxy]",'name = "OpenAI Proxy"',`base_url = "${x}"`,'env_key = "OPENAI_API_KEY"','wire_api = "responses"',"supports_websockets = false","requires_openai_auth = true"),j&&I.push(...ffe()),B&&I.push(...pfe(B));let te=[];M&&(te=J8e(Z8e()),I.push(...te)),await Lv.writeFile(oe,`${I.join(`
|
|
399
399
|
`)}
|
|
400
400
|
`,"utf-8"),Ii.log("Wrote Codex config.toml",...te.length?[te.join(`
|
|
401
|
-
`)]:[])}catch(z){let x=z instanceof Error?z.message:String(z);throw Ii.warn("Failed to setup Codex config and credentials",{error:x}),new Error(`Codex setup failed: ${x}`)}let S=f==="gpt-5.6-sol",w=Zh("codex",t.effort);t.effort&&!w&&Ii.log(`Effort '${t.effort}' is not available on ${pO}; using its default`);let H=l?"low":w===Yi?Yi:w??(S?"low":void 0),he=H??"high",je=!!(i&&o),Ie="mode"in t&&t.mode==="ask",$e=!!M,
|
|
401
|
+
`)]:[])}catch(z){let x=z instanceof Error?z.message:String(z);throw Ii.warn("Failed to setup Codex config and credentials",{error:x}),new Error(`Codex setup failed: ${x}`)}let S=f==="gpt-5.6-sol",w=Zh("codex",t.effort);t.effort&&!w&&Ii.log(`Effort '${t.effort}' is not available on ${pO}; using its default`);let H=l?"low":w===Yi?Yi:w??(S?"low":void 0),he=H??"high",je=!!(i&&o),Ie="mode"in t&&t.mode==="ask",$e=!!M,Pe=[jo(s,"codex"),"exec",...Ie&&!$e?["--sandbox","read-only"]:[],...je?["resume",o]:[],...Ie?[]:["--yolo"],"--json",...H&&H!==Yi?["-c",`model_reasoning_effort="${H}"`]:[],...f?["--model",f]:[]].filter(Boolean);Ii.log(`Running ${L} ${Pe.join(" ")}`);let He=$t(L,Pe,{all:!0,cwd:s,env:{...fc.env},stdin:"pipe",idleTimeout:Ma,cancelSignal:a});He.stdin?.end(u);let Ne=il(()=>{e?.({steps:p,duration:T}),r?.({steps:h,duration:T}),h=[]},250),le=(z,x)=>{let I={...z,id:b};b+=1,m.push(I),p.push(I),h.push(I),x||Ne.flush(),Ne(),x&&Ne.flush()},me=f||"default";t.answeredInteraction||le({title:`Using ${pO} with ${me}`,category:G.Environment},!0);let nt=W8e.createInterface({input:He.all});nt.on("error",z=>{Ii.error("Readline interface error",{error:z.message,stack:z.stack})}),nt.on("line",z=>{let x;try{x=JSON.parse(z)}catch{Ii.log("Could not parse line",z);return}if(x?.duration_ms&&(T=x.duration_ms),x?.type==="thread.started"&&typeof x?.thread_id=="string"&&(O=x.thread_id,c?.(O)),x?.type==="item.started"&&x?.item?.type==="command_execution")g[x.item.id]=x.item;else if(x?.type==="item.completed"&&x?.item?.type==="command_execution"){let I=x.item,j=t5e(I);j&&le(j,!0);let B=I.command?.match(/\.agents\/skills\/([^\s/]+)/)?.[1];if(B&&!_.has(B)){_.add(B);let te=Rs(B);La(Ii,te),le({title:`Use ${te}`,category:G.Skill,type:B},!0)}}else if(x?.type==="item.completed"&&x?.item?.type==="reasoning"){let I={title:"Reasoning",message:x.item.text,category:G.Reasoning};le(I,!0)}else if(x?.type==="item.completed"&&x?.item?.type==="agent_message")E=x.item.text;else if(x?.type==="item.started"&&x?.item?.type==="mcp_tool_call"){let I=x.item,j=ofe(I.server)&&!N?Om(I.tool,I.arguments,ife):void 0;j&&"interaction"in j?(N=j.interaction,He.kill()):j&&(Ii.warn("Ignoring malformed pause tool input",{toolUseId:I.id,tool:I.tool,issues:j.issues}),ne.inc(j.metric,1))}else if(x?.type==="turn.completed"&&x.usage)R={input_tokens:x.usage.input_tokens,output_tokens:x.usage.output_tokens},rl(R,f?{model:f}:{});else if(x?.type==="turn.failed"&&x?.error?.message)A=x.error.message;else if(x?.type==="local_shell_call"){let I=x;g[I.call_id]=I}else if(x?.type==="local_shell_call_output"){let I=x,j=g[I.call_id],B=r5e(j,I);B&&le(B,!0);let ie=(j?.action?.command?.join(" ")??"").match(/\.agents\/skills\/([^\s/]+)/)?.[1];if(ie&&!_.has(ie)){_.add(ie);let Ee=Rs(ie);La(Ii,Ee),le({title:`Use ${Ee}`,category:G.Skill,type:ie},!0)}}else x?.type==="message"&&x.role==="assistant"?E=x.content?.map(I=>I.text).join(`
|
|
402
402
|
`):x?.type==="message"&&x.role==="system"&&(A=x.content?.map(I=>I.text).join(`
|
|
403
|
-
`))});let re=!1;if(await
|
|
403
|
+
`))});let re=!1;if(await He.catch(z=>{re=_l(z,a);let x=Jh({catchError:z,runCmd:He,error:A,result:E,runnerName:"Codex"});A=x.error,E=x.result}),nt.close(),Ne.flush(),N)return{steps:m,duration:T,agentSessionId:O,resolvedModel:f,effort:he,usage:R,pendingInteraction:N};let qe=re;return qe&&(A=void 0),{steps:m,duration:T,result:await Nl({initialResult:E,agentName:pO,hasError:!!A}),error:kl({error:A,agentName:pO}),isRetryableError:Ml(A),isProviderUnavailableError:$l(A),resolvedModel:f,effort:he,agentSessionId:O,usage:R,...qe?{aborted:!0}:{}}}var Ige=async()=>{let t=Ql.join(Uv.homedir(),".codex");await Lv.rm(t,{recursive:!0,force:!0});let e=Ql.join(Uv.homedir(),".agents","skills");await Lv.rm(e,{recursive:!0,force:!0})},Pge={baseDir:Ql.join(Uv.homedir(),".codex"),include:["sessions"]},Q8e=new Set(["bash","-lc"]),e5e=/^sed\s+-n\s+(?:'[^']*'|"[^"]*"|\S+)\s+(\S+)\s*$/,Oge=t=>{if(tc(t))return{title:"Generating the site",category:G.SiteGeneration};let e=t.match(e5e);return e?{title:`Reading \`${e[1]}\``,category:G.FileRead}:{title:`Running \`${t}\``,category:G.RunCommand}},t5e=t=>{if(!t||t.type!=="command_execution")return null;let e=t.command;e=e.replace(/^(\/usr\/bin\/)?bash -lc ['"]/,"").replace(/['"]$/,"");let{command:r,heredocContent:n}=vF(e),{title:i,category:o}=Oge(r),s=t.aggregated_output?.trim();return n?s=`\`\`\`
|
|
404
404
|
${n}
|
|
405
405
|
\`\`\`${s?`
|
|
406
406
|
|
|
@@ -431,18 +431,18 @@ commandPrefix = [${i}]
|
|
|
431
431
|
decision = "allow"
|
|
432
432
|
priority = 20
|
|
433
433
|
`),Qr.log("Ask policy allows the read-only database query command",{allowedPrefixes:i})}let n=eu.join(jv.homedir(),".gemini","ask-policy.toml");return await pf.mkdir(eu.dirname(n),{recursive:!0}),await pf.writeFile(n,r.join(`
|
|
434
|
-
`),"utf-8"),n};async function jG({config:t,persistSteps:e=void 0,sendSteps:r=void 0,aiGateway:n,continueSession:i=!1,priorAgentSessionId:o=void 0,cwd:s=Ig.cwd(),cliPath:a="netlify",abortSignal:c=void 0,onSessionId:l=void 0,forceLowEffortForCreditWrapUp:u=void 0}){let{prompt:d}=t,f=Zh("gemini",t.effort);t.effort&&!f&&Qr.log(`Effort '${t.effort}' is not available on ${gO}; using its default`);let h=u?"low":f===Yi?void 0:f;p5e({aiGateway:n});let m=await h5e({aiGateway:n,config:t,model:t.model});await d5e({config:t,model:m,effort:h,creditWrapUpTurn:u});let g=[],_=[],b=[],T={},E=0,A=0,O,R,N,M,L,v=!!(i&&o),oe=!1;v&&(oe=await zv(o)),v&&!oe&&(Qr.log(`Gemini resume requested for session ${o} but it was not resumable; starting a fresh session`),ne.inc("inference.native_resume",1,{outcome:"sanitize_failed"}));let $=t.mode==="ask",S=$?await m5e({config:t,cliPath:a}):void 0,w=[jo(s,"gemini"),...m?["--model",m]:[],...$?["--approval-mode","default","--policy",S]:["--yolo"],"--skip-trust","--output-format","stream-json",...oe?["-r",o]:[],"-p",""],k=`${Ig.env.NVM_BIN}/node`;Qr.log(`Running ${k} ${w.join(" ")}`);let Y=$t(k,w,{all:!0,env:{...Ig.env,GEMINI_CLI_NO_RELAUNCH:"1"},cwd:s,idleTimeout:Ma,cancelSignal:c});Y.stdin?.end(d);let H=il(()=>{e?.({steps:g,duration:A}),r?.({steps:_,duration:A}),_=[]},250),he=(le,me)=>{le.id=E,E+=1,b.push(le),g.push(le),_.push(le),me||H.flush(),H(),me&&H.flush()},je=m||"default";t.answeredInteraction||he({title:`Using ${gO} with ${je}`,category:G.Environment},!0);let Ie=a5e.createInterface({input:Y.all});Ie.on("error",le=>{Qr.error("Readline interface error",{error:le.message,stack:le.stack})});let $e="",
|
|
434
|
+
`),"utf-8"),n};async function jG({config:t,persistSteps:e=void 0,sendSteps:r=void 0,aiGateway:n,continueSession:i=!1,priorAgentSessionId:o=void 0,cwd:s=Ig.cwd(),cliPath:a="netlify",abortSignal:c=void 0,onSessionId:l=void 0,forceLowEffortForCreditWrapUp:u=void 0}){let{prompt:d}=t,f=Zh("gemini",t.effort);t.effort&&!f&&Qr.log(`Effort '${t.effort}' is not available on ${gO}; using its default`);let h=u?"low":f===Yi?void 0:f;p5e({aiGateway:n});let m=await h5e({aiGateway:n,config:t,model:t.model});await d5e({config:t,model:m,effort:h,creditWrapUpTurn:u});let g=[],_=[],b=[],T={},E=0,A=0,O,R,N,M,L,v=!!(i&&o),oe=!1;v&&(oe=await zv(o)),v&&!oe&&(Qr.log(`Gemini resume requested for session ${o} but it was not resumable; starting a fresh session`),ne.inc("inference.native_resume",1,{outcome:"sanitize_failed"}));let $=t.mode==="ask",S=$?await m5e({config:t,cliPath:a}):void 0,w=[jo(s,"gemini"),...m?["--model",m]:[],...$?["--approval-mode","default","--policy",S]:["--yolo"],"--skip-trust","--output-format","stream-json",...oe?["-r",o]:[],"-p",""],k=`${Ig.env.NVM_BIN}/node`;Qr.log(`Running ${k} ${w.join(" ")}`);let Y=$t(k,w,{all:!0,env:{...Ig.env,GEMINI_CLI_NO_RELAUNCH:"1"},cwd:s,idleTimeout:Ma,cancelSignal:c});Y.stdin?.end(d);let H=il(()=>{e?.({steps:g,duration:A}),r?.({steps:_,duration:A}),_=[]},250),he=(le,me)=>{le.id=E,E+=1,b.push(le),g.push(le),_.push(le),me||H.flush(),H(),me&&H.flush()},je=m||"default";t.answeredInteraction||he({title:`Using ${gO} with ${je}`,category:G.Environment},!0);let Ie=a5e.createInterface({input:Y.all});Ie.on("error",le=>{Qr.error("Readline interface error",{error:le.message,stack:le.stack})});let $e="",Pe=()=>{$e&&he({message:$e.trim(),category:G.AgentMessage}),$e=""};Ie.on("line",le=>{let me;try{if(le.startsWith("[API Error")){let nt=le.match(/\[api error: (.+?)]$/i)?.[1];me={type:"error",value:Coe(nt,!1)?.error?.message||nt||"Gemini encountered error"}}else me=JSON.parse(le)}catch{return}if(me)switch(me.type==="init"&&typeof me.session_id=="string"&&(M=me.session_id,l?.(M)),["message","result"].includes(me.type)||Pe(),me.type){case"message":{me.role!=="user"&&me.content&&($e+=me.content);break}case"tool_use":{let nt=me.tool_id&&!L?Om(me.tool_name,me.parameters,Uj):void 0;if(nt&&"interaction"in nt){L=nt.interaction,Y.kill();break}if(nt){Qr.warn("Ignoring malformed pause tool input",{toolUseId:me.tool_id,tool:me.tool_name,issues:nt.issues}),ne.inc(nt.metric,1);break}if(Nm(me.tool_name,Uj))break;let re=zG[me.tool_name]?.name??me.tool_name,qe=me.parameters?.file_path,z=qe&&eu.relative(s,qe),x=me.parameters?.command,I=me.tool_name==="activate_skill"&&me.parameters?.name,j=me.tool_name==="run_shell_command"&&tc(x),B=[re,z&&`\`${z}\``,x&&`\`${x}\``].filter(Boolean).join(" ");if(I)B=`Use ${Rs(I)}`;else if(j)B="Generating the site";else if(me.tool_name==="grep_search"){let{dir_path:ie,pattern:Ee}=me.parameters||{};ie&&Ee?B=`Search in \`${ie}\` for \`${Ee}\``:ie?B=`Search in \`${ie}\``:Ee&&(B=`Search for \`${Ee}\``)}else if(me.tool_name==="update_topic"){let ie=me.parameters?.title;ie&&(B=`${re} \`${ie}\``)}let te={title:B,category:j?G.SiteGeneration:zG[me.tool_name]?.category,...I&&{type:I}};T[me.tool_id]=te,H.flush();break}case"tool_result":{let nt=T[me.tool_id];nt&&(me.output&&(nt.message=`\`\`\`
|
|
435
435
|
${me.output.trim()}
|
|
436
|
-
\`\`\``),he(nt,!0),f5e(nt));break}case"result":{A=me.stats?.duration_ms,me.stats&&(rl(me.stats,m?{model:m}:{}),N=me.stats),me.status==="error"?R=me.error?.message:O=$e.trim();break}case"error":{R=me.error;break}case"finished":break;case"init":break;default:{Qr.warn("Unhandled message type:",me.type);break}}});let
|
|
436
|
+
\`\`\``),he(nt,!0),f5e(nt));break}case"result":{A=me.stats?.duration_ms,me.stats&&(rl(me.stats,m?{model:m}:{}),N=me.stats),me.status==="error"?R=me.error?.message:O=$e.trim();break}case"error":{R=me.error;break}case"finished":break;case"init":break;default:{Qr.warn("Unhandled message type:",me.type);break}}});let He=!1;if(await Y.catch(le=>{He=_l(le,c),{error:R,result:O}=c5e({catchError:le,runCmd:Y,error:R,result:O,runnerName:"Gemini"})}),Ie.close(),L)return H.flush(),{steps:b,duration:A,agentSessionId:M,resolvedModel:m,usage:N,pendingInteraction:L};let Ne=He;return Ne&&(!O&&$e.trim()&&(O=$e.trim()),R=void 0),H.flush(),{steps:b,duration:A,result:await Nl({initialResult:O,agentName:gO,hasError:!!R}),error:kl({error:R,agentName:gO}),isRetryableError:Ml(R),isProviderUnavailableError:$l(R),resolvedModel:m,usage:N,agentSessionId:M,...h&&kge(m)?{effort:h}:{},...Ne?{aborted:!0}:{}}}var Mge=async()=>{let t=eu.join(jv.homedir(),".gemini");await pf.rm(t,{recursive:!0,force:!0});let e=eu.join(jv.homedir(),".agents","skills");await pf.rm(e,{recursive:!0,force:!0})},$ge={baseDir:eu.join(jv.homedir(),".gemini"),include:["tmp"]};import qG from"fs/promises";import zge from"os";import Bv from"path";import GG from"process";import y5e from"readline";import g5e from"os";import Uge from"path";import BG from"fs";var Dge=ce("opencode_install"),Lge="1.17.19",_5e=()=>Uge.join(g5e.homedir(),".netlify-agent-runner","opencode"),_O=async t=>{let e=jo(t,"opencode");if(e)return e;let r=_5e(),n=Uge.join(r,"node_modules",".bin","opencode");if(BG.existsSync(n))return n;BG.mkdirSync(r,{recursive:!0}),Dge.log(`Installing opencode-ai@${Lge} on demand`);let i=Date.now();await $t("npm",["install","--no-save","--no-audit","--no-fund","--prefix",r,`opencode-ai@${Lge}`],{cwd:r});let o=Date.now()-i;if(ne.timing("opencode.install_duration",o),Dge.log(`Installed opencode-ai in ${o}ms`),!BG.existsSync(n))throw new Error("OpenCode CLI binary not found after installing opencode-ai");return n};var pc=ce("runner_opencode"),yO="OpenCode",jge="gateway",S5e="z-ai/glm-5.3-flash",E5e=new Set(["z-ai/glm-5.3-flash","deepseek/deepseek-v4-pro","x-ai/grok-4.6"]),v5e=(t,e)=>!t||!jR.includes(t)?t:e&&E5e.has(e)?"xhigh":"max",VG={bash:{name:"Run command",category:G.RunCommand},read:{name:"Read file",category:G.FileRead},write:{name:"Edit file",category:G.FileWrite},edit:{name:"Edit file",category:G.FileWrite},glob:{name:"Find files",category:G.Explore},grep:{name:"Search files",category:G.Explore},list:{name:"List directory",category:G.Explore},task:{name:"Task",category:G.Task},todowrite:{name:"Update task list",category:G.Todo},webfetch:{name:"Fetch web",category:G.Web},websearch:{name:"Search web",category:G.Web},skill:{name:"Use Skill",category:G.Skill}},Fge=t=>VG[t]?.name||t,b5e=t=>Array.isArray(t)?t.flatMap(e=>{let{content:r,status:n}=e??{};return typeof r!="string"||!r?[]:[{name:r,value:typeof n=="string"&&n?n:"pending"}]}):[],T5e=250,w5e=t=>{let e;try{e=JSON.parse(t)}catch{return{issues:"invalid_json"}}let r=NP.safeParse(e);return r.success?{questions:r.data.questions}:{issues:Pm(r.error.issues)}},Bge=(t,e,r,n)=>{let i=!0,o=setInterval(async()=>{let s=await qG.readFile(t,"utf-8").catch(()=>{});if(s===void 0)return;clearInterval(o),await qG.rm(t,{force:!0}).catch(()=>{});let{value:a,issues:c}=e(s);if(a===void 0){pc.warn(n.message,{filePath:t,issues:c}),ne.inc(n.metric,1);return}i&&r(a)},T5e);return o.unref(),{stop:()=>{i=!1,clearInterval(o)}}},A5e=(t,e)=>Bge(t,r=>{let{questions:n,issues:i}=w5e(r);return n?{value:n}:{issues:i}},e,{message:"Ignoring malformed ask tool questions file",metric:"inference.malformed_ask"}),x5e=(t,e)=>Bge(t,r=>{let n;try{n=JSON.parse(r)}catch{return{issues:"invalid_json"}}let i=kP.safeParse(n);return i.success?{value:i.data}:{issues:Pm(i.error.issues)}},e,{message:"Ignoring malformed authorization request file",metric:"inference.malformed_authorization"});async function R5e({aiGateway:t,config:e,model:r}){let n=r;if(t){let i=t.isModelAvailable;if(!i)throw new Error("OpenCode runner requires a gateway with isModelAvailable support");let o=e.modelVersionOverrides?.opencode?.[e.accountType];o?n=o:r||(n=tt().opencodeDefaultModel||S5e),n&&(await i(n)||pc.log(`Model '${n}' not found in gateway catalog; proceeding anyway (gateway is authoritative, e.g. flag-gated OpenRouter models)`))}return n}function C5e({aiGateway:t,model:e,effort:r,questionsFilePath:n,connections:i}){if(!t)throw new Error("OpenCode runner requires the AI gateway");let{token:o,url:s}=t;if(!o||!s)throw new Error("No token or url provided from AI Gateway");let a=e?{[e]:{id:e,name:e,tool_call:!0,reasoning:!0,interleaved:{field:/^~?deepseek\//.test(e)?"reasoning_content":"reasoning_details"},...r?{options:{reasoningEffort:r}}:{}}}:{},c={$schema:"https://opencode.ai/config.json",provider:{[jge]:{api:"openai",name:"Netlify AI Gateway",options:{apiKey:o,baseURL:s},...Object.keys(a).length>0?{models:a}:{}}},...n||i?{mcp:{...n?ufe(n):{},...i?dfe(i):{}}}:{}};return{...GG.env,OPENCODE_CONFIG_CONTENT:JSON.stringify(c),OPENCODE_DISABLE_AUTOUPDATE:"1"}}async function HG({config:t,persistSteps:e,aiGateway:r,continueSession:n,priorAgentSessionId:i,cwd:o=GG.cwd(),abortSignal:s,onSessionId:a,forceLowEffortForCreditWrapUp:c}){let{prompt:l}=t,{model:u}=t,d=t.effort===Yi,f=c?"low":d?void 0:t.effort,p="",h,m,g,_,b=0,T=0,E,A=await R5e({config:t,aiGateway:r,model:u}),O=v5e(f,A);pc.log(f?`Requesting reasoning effort '${f}' for model '${A}'${O===f?"":` (sent as '${O}')`}; ignored if unsupported`:`No reasoning effort requested for model '${A}'; running at its own default`);let R=El({creditWrapUpTurn:c})?await mfe():void 0,N=Bj({creditWrapUpTurn:c})?await gfe():void 0,M=Sl(t,{requestFilePath:N?.filePath,creditWrapUpTurn:c}),L=C5e({aiGateway:r,model:A,effort:O,questionsFilePath:R?.filePath,connections:M}),v=[],oe=[],$=0,S=Date.now(),w=await _O(o),k=["run","--format","json","--dangerously-skip-permissions","--agent","build",...A?["--model",`${jge}/${A}`]:[],...n?i?["--session",i]:["--continue"]:[]];pc.log(`Running ${w} ${k.join(" ")}`);let Y=$t(w,k,{all:!0,env:L,cwd:o,idleTimeout:Ma,cancelSignal:s});Y.stdin?.end(l);let H=R?A5e(R.filePath,z=>{E||(E={questions:z},Y.kill())}):void 0,he=N?x5e(N.filePath,z=>{E||(E={authorization:z},Y.kill())}):void 0,je=il(()=>{e?.({steps:oe,duration:Date.now()-S})},250),Ie=(z,x)=>{let{wrapMessage:I,...j}=z,B=n0({...j,id:$});B.message&&I&&(B.message=`\`\`\`
|
|
437
437
|
${B.message}
|
|
438
|
-
\`\`\``),$+=1,v.push(B),oe.push(B),x||je.flush(),je(),x&&je.flush()},$e=A||"default";t.answeredInteraction||Ie({title:`Using ${yO} with ${$e}`,category:G.Environment},!0);let
|
|
438
|
+
\`\`\``),$+=1,v.push(B),oe.push(B),x||je.flush(),je(),x&&je.flush()},$e=A||"default";t.answeredInteraction||Ie({title:`Using ${yO} with ${$e}`,category:G.Environment},!0);let Pe=y5e.createInterface({input:Y.all});Pe.on("error",z=>{pc.error("Readline interface error",{error:z.message,stack:z.stack})});let He="",Ne,le=new Set,me=()=>{He&&(Ie({message:He,category:G.AgentMessage}),Ne=He,He="")};Pe.on("line",z=>{let x;try{x=JSON.parse(z)}catch{pc.log("Could not parse line",z);return}switch(x.sessionID&&x.sessionID!==p&&(p=x.sessionID,a?.(p)),x.type){case"step_start":{me();break}case"text":{let I=x.part?.text;I&&(He+=I);break}case"reasoning":{me();let I=x.part?.text;I&&Ie({title:"Reasoning",message:I,category:G.Reasoning},!0);break}case"tool_use":{me();let I=x.part?.tool;if(!I)break;let j=x.part?.state?.input??{},B=x.part?.state?.status,te=x.part?.state?.output,ie=x.part?.state?.error;if(Nm(I,nfe)){B==="error"&&pc.warn("Pause tool call rejected before it could pause the run",{tool:I,error:ie});break}if(B==="error"&&(b+=1),(B==="completed"||B==="error")&&(T+=1),I==="skill"){let Ve=typeof j.name=="string"?j.name:void 0;if(Ve){let xe=Rs(Ve);La(pc,xe),Ie({title:`Use ${xe}`,category:G.Skill,type:Ve},!0);break}}if(I==="todowrite"){let Ve=b5e(j.todos);Ie({title:Fge(I),category:Ve.length>0?VG.todowrite.category:G.Tool,...Ve.length>0?{tasks:Ve}:{}},!0);break}let Ee=typeof j.command=="string"?j.command:void 0,yt=Ee?tc(Ee):!1,lr=typeof j.path=="string"&&j.path||typeof j.file_path=="string"&&j.file_path||typeof j.pattern=="string"&&j.pattern||void 0,St,di;if(yt)St="Generating the site",di=G.SiteGeneration;else if(Ee&&I==="bash")St=`Running \`${Ee}\``,di=G.RunCommand;else{let Ve=lr&&`\`${Bv.relative(o,lr)}\``;St=[Fge(I),Ve].filter(Boolean).join(" "),di=VG[I]?.category||G.AgentMessage}let We,De=["bash","read","glob","grep","list","webfetch","websearch"].includes(I);ie?We=`\`\`\`
|
|
439
439
|
${ie.trim()}
|
|
440
|
-
\`\`\``:te&&(
|
|
440
|
+
\`\`\``:te&&(We=De?`\`\`\`
|
|
441
441
|
${te.trim()}
|
|
442
|
-
\`\`\``:te.trim()),B==="error"&&ie&&(
|
|
442
|
+
\`\`\``:te.trim()),B==="error"&&ie&&(We=We?`${We}
|
|
443
443
|
|
|
444
|
-
*Command failed*`:`*Command failed: ${ie.trim()}*`),Ie({title:St,message:
|
|
445
|
-
${j}`:j;break}default:x.type&&!le.has(x.type)&&(le.add(x.type),pc.log(`Unhandled opencode event type: ${x.type}`))}});let nt=!1;await Y.catch(z=>{nt=_l(z,s),me();let x=Jh({catchError:z,runCmd:Y,error:m,result:h??Ne,runnerName:yO});m=x.error,h=x.result}),H?.stop(),he?.stop(),await R?.remove(),await N?.remove();let re=Date.now()-S;me(),
|
|
444
|
+
*Command failed*`:`*Command failed: ${ie.trim()}*`),Ie({title:St,message:We,category:di},!0);break}case"step_finish":{me();let I=x.part?.tokens;I&&(g={input_tokens:(g?.input_tokens??0)+(I.input??0),output_tokens:(g?.output_tokens??0)+(I.output??0),reasoning_output_tokens:(g?.reasoning_output_tokens??0)+(I.reasoning??0),cache_creation_input_tokens:(g?.cache_creation_input_tokens??0)+(I.cache?.write??0),cache_read_input_tokens:(g?.cache_read_input_tokens??0)+(I.cache?.read??0)}),x.part?.cost!=null&&(_=(_??0)+x.part.cost);break}case"error":{me();let j=x.error?.data?.message??x.error?.message??x.part?.state?.error??(x.error?JSON.stringify(x.error).slice(0,500):"unknown error");m=m?`${m}
|
|
445
|
+
${j}`:j;break}default:x.type&&!le.has(x.type)&&(le.add(x.type),pc.log(`Unhandled opencode event type: ${x.type}`))}});let nt=!1;await Y.catch(z=>{nt=_l(z,s),me();let x=Jh({catchError:z,runCmd:Y,error:m,result:h??Ne,runnerName:yO});m=x.error,h=x.result}),H?.stop(),he?.stop(),await R?.remove(),await N?.remove();let re=Date.now()-S;me(),Pe.close(),je.flush();let qe=nt;return qe&&(m=void 0),!m&&!h&&Ne&&(h=Ne),g&&rl(g,A?{model:A}:{}),E?{steps:v,duration:re,agentSessionId:p,resolvedModel:A,effort:f,resolvedProviderEffort:O,usage:g,costUsd:_,toolErrorCount:b,toolCallCount:T,pendingInteraction:E}:{steps:v,duration:re,result:await Nl({initialResult:h,agentName:yO,hasError:!!m}),error:kl({error:m,agentName:yO}),isRetryableError:Ml(m),isProviderUnavailableError:$l(m),agentSessionId:p,resolvedModel:A,effort:f,resolvedProviderEffort:O,usage:g,costUsd:_,toolErrorCount:b,toolCallCount:T,...qe?{aborted:!0}:{}}}var I5e=()=>Bv.join(zge.homedir(),".config","opencode"),qge=()=>{let t=GG.env.XDG_DATA_HOME,e=t&&Bv.isAbsolute(t)?t:Bv.join(zge.homedir(),".local","share");return Bv.join(e,"opencode")},Vge=async()=>{let t=[I5e(),qge()];await Promise.all(t.map(e=>qG.rm(e,{recursive:!0,force:!0})))},Gge={baseDir:qge(),include:["opencode.db","opencode.db-shm","opencode.db-wal"]};var WG={codex:{runner:UG,clean:Ige,nativeSessionArchive:Pge},claude:{runner:ZV,clean:wme,nativeSessionArchive:Ame},gemini:{runner:jG,clean:Mge,nativeSessionArchive:$ge},opencode:{runner:HG,clean:Vge,nativeSessionArchive:Gge}},l7t=Object.keys(WG),Ks=t=>WG[t]?.nativeSessionArchive,Pg=WG;import{execSync as P5e}from"child_process";import Hge from"fs/promises";import O5e from"path";import Og from"process";var Wge=ce("git-wrapper"),N5e=["status","diff","log","show","rev-parse","rev-list","ls-files","show-ref","cat-file","merge-base","blame","grep","describe"],k5e=t=>`#!/bin/bash
|
|
446
446
|
# Git wrapper that only allows read-only commands.
|
|
447
447
|
# The deployment system handles staging, moves, and commits automatically.
|
|
448
448
|
|
|
@@ -636,13 +636,13 @@ Preview deploy created successfully:`,{deployId:p.deploy_id,deployUrl:p.deploy_u
|
|
|
636
636
|
`)},vxe=async({cliPath:t,cwd:e,isFreshDatabase:r})=>{if(r)return aft();try{return cft(await QY({cliPath:t,cwd:e}))}catch(n){return nk.warn("Skipping migration context injection \u2014 failed to build state block",{error:n}),null}},bxe=t=>{let e=[];return t.missingOnDisk.length>0&&e.push("You deleted the following migration file(s) that are already applied to the preview database branch:",...t.missingOnDisk.map(r=>`- ${r.name}`),"","Applied migrations cannot be removed \u2014 the deploy will fail because the platform requires every applied","migration to exist on disk with its original content. Please revise your work:","","1. Restore the deleted file(s) by running `netlify db migrations pull --force`, which overwrites the"," local migrations directory with the authoritative state of the branch. Note this also wipes any"," unapplied migration files you generated this session \u2014 regenerate them via `npx drizzle-kit generate`"," afterwards if you still need them (your `db/schema.ts` edits aren't affected by the pull).","2. If the underlying problem is that an applied migration is wrong, add a NEW migration on top that"," corrects whatever it did (drop a column, rename a table, etc.). Do not touch the original."),t.outOfOrder.length>0&&(e.length>0&&e.push(""),e.push("The following pending migration file(s) have a version prefix that sorts BEFORE migrations already","applied to the branch, so the platform will reject them on deploy:",...t.outOfOrder.map(r=>`- ${r.name} (version ${r.version} \u2264 applied max ${r.maxApplied})`),"","Delete these out-of-order files (use `netlify db migrations reset` \u2014 it only removes unapplied files),","then run `npx drizzle-kit generate` to produce a replacement whose version sorts after the applied","migrations.")),e.length===0?null:e.join(`
|
|
637
637
|
`)},Txe=t=>t.missingOnDisk.length>0||t.outOfOrder.length>0;var wxe=ce("db_migrations_verify"),Axe=async t=>await Mt(dt(),"db-migrations-verify-stage",async e=>{let r;try{r=await QY({cliPath:t.cliPath,cwd:t.cwd})}catch(i){return wxe.warn("Skipping migration verification \u2014 failed to read status",{error:i}),e?.setAttributes({"verify.skipped":!0,"verify.skip_reason":"status_error"}),{}}if(!Txe(r))return e?.setAttributes({"verify.drift":!1}),{};let n=bxe(r);return e?.setAttributes({"verify.drift":!0,"verify.missing_on_disk_count":r.missingOnDisk.length,"verify.out_of_order_count":r.outOfOrder.length}),wxe.log("Detected post-inference migration drift",{missingOnDisk:r.missingOnDisk.map(i=>i.name),outOfOrder:r.outOfOrder.map(i=>i.name)}),{error:n??void 0}});import n9 from"process";import Omt from"net";var $i=wn(e9(),1),ehr=$i.default.Client,thr=$i.default.Pool,rhr=$i.default.Connection,nhr=$i.default.types,ihr=$i.default.Query,ohr=$i.default.DatabaseError,shr=$i.default.escapeIdentifier,ahr=$i.default.escapeLiteral,chr=$i.default.Result,lhr=$i.default.TypeOverrides,uhr=$i.default.defaults,m0e=$i.default;var Nmt=80877103,kmt=196608,Mmt=Buffer.from([78]);function $mt(){let t=Buffer.alloc(9);t.writeUInt8(82,0),t.writeInt32BE(8,1),t.writeInt32BE(0,5);let e=Buffer.alloc(6);return e.writeUInt8(90,0),e.writeInt32BE(5,1),e.writeUInt8(73,5),Buffer.concat([t,e])}function vk(t){let e=Buffer.from("SERROR\0","utf8"),r=Buffer.concat([Buffer.from("M","utf8"),Buffer.from(t+"\0","utf8")]),n=Buffer.from("CXX000\0","utf8"),i=Buffer.from([0]),o=e.length+r.length+n.length+i.length,s=Buffer.alloc(5);return s.writeUInt8(69,0),s.writeInt32BE(o+4,1),Buffer.concat([s,e,n,r,i])}async function Dmt(t){let{clientSocket:e,provision:r,logger:n,cleanup:i}=t,o;try{o=await r()}catch(f){let p=f instanceof Error?f.message:"Provisioning failed";throw n("Provisioning error:",p),e.end(vk(p)),i(),f}let s=Umt(o),a=new m0e.Client({host:s.host,port:s.port,user:s.user,password:s.password,database:s.database,ssl:s.ssl,options:s.options});a.on("error",()=>{});try{await a.connect()}catch(f){let p=f instanceof Error?f.message:"Remote connection failed";throw n("Remote connection error:",p),e.end(vk(p)),i(),f}let c=a.connection,l=c.stream;c.removeAllListeners(),l.removeAllListeners();let u=l,d=f=>p=>{p.code!=="ECONNRESET"&&n(`${f} socket error:`,p.message),i()};return u.on("error",d("Remote")),u.on("close",i),e.on("error",d("Client")),e.on("close",i),e.write($mt()),e.on("data",f=>{u.destroyed||u.write(f)}),u.on("data",f=>{e.destroyed||e.write(f)}),e.resume(),u}function Lmt(t,e){let{provision:r,logger:n,onCleanup:i}=e,o,s="ssl",a=!1;function c(){a||(a=!0,t.destroy(),o?.destroy(),i())}t.on("error",l=>{l.code!=="ECONNRESET"&&n("Client socket error:",l.message),c()}),t.on("data",l=>{if(s==="ssl"){if(l.length>=8&&l.readInt32BE(4)===Nmt){t.write(Mmt),s="startup";return}s="startup"}if(s==="startup"){if(l.length<8){t.end(vk("Invalid startup message")),c();return}if(l.readInt32BE(4)!==kmt){t.end(vk("Unsupported protocol version")),c();return}t.pause(),t.removeAllListeners("data"),Dmt({clientSocket:t,provision:r,logger:n,cleanup:c}).then(d=>{o=d},d=>{n("Startup error:",d),c()})}})}function Umt(t){let e=new URL(t);return{host:e.hostname,port:Number(e.port)||5432,user:decodeURIComponent(e.username),password:decodeURIComponent(e.password),database:e.pathname.slice(1)||"postgres",ssl:e.searchParams.get("sslmode")==="require"?!0:void 0,options:e.searchParams.get("options")??void 0}}var g0e=class{server;sockets=new Set;host;port;logger;provision;constructor(t){this.host=t.host??"127.0.0.1",this.port=t.port??0,this.logger=t.logger??(()=>{}),this.provision=t.provision}async start(){return new Promise((t,e)=>{let r=Omt.createServer(n=>{this.sockets.add(n),n.on("close",()=>{this.sockets.delete(n)}),Lmt(n,{provision:this.provision,logger:this.logger,onCleanup:()=>{this.sockets.delete(n)}})});r.on("error",n=>{e(n)}),r.listen(this.port,this.host,()=>{this.server=r;let n=r.address(),i=`postgres://${this.host}:${String(n.port)}`;this.logger("Proxy listening on",i),t(i)})})}async stop(){for(let t of this.sockets)t.destroy();return this.sockets.clear(),new Promise(t=>{if(!this.server){t();return}this.server.close(()=>{this.server=void 0,t()})})}};var bk=ce("db_setup"),_0e=async({siteId:t,isProd:e,alias:r,connectionString:n})=>await Mt(dt(),"db-setup-stage",async i=>{i?.setAttributes({"db_setup.site_id":t,"db_setup.is_prod":e,...r&&{"db_setup.alias":r}});let o;if(e?o="production":r&&(o=r),n9.env.NETLIFY_DB_BRANCH=o,n)return i?.setAttributes({"db_setup.source":"config","db_setup.has_proxy":!1}),bk.log("Using database connection string provided by the API"),n9.env.NETLIFY_DB_URL=n,{connectionString:n,wasProvisioned:()=>!1};let s=!1,a=new g0e({logger:(...l)=>bk.log("db-proxy:",...l),provision:async()=>(s=!0,bk.log("Provisioning database for site via API"),await Soe(t),await Fmt(t,e,r))}),c=await a.start();return i?.setAttributes({"db_setup.source":"proxy","db_setup.has_proxy":!0}),bk.log("Local DB proxy started",{connectionString:c}),n9.env.NETLIFY_DB_URL=c,{connectionString:c,proxy:a,wasProvisioned:()=>s}}),Fmt=async(t,e,r)=>e||!r?(await goe(t)).connection_string:(await Eoe(t,r),(await yoe(t,r)).connection_string);var S0e=({config:t,cliPath:e,cwd:r,withStageTimer:n})=>{let i,o=null,s=t.mode==="ask";return{prepare:async({deploySubdomain:a,isProdDeploy:c})=>{if(s)return o=Kde(t,a),o?(ne.inc("ask_mode.db_read_granted",1),xEe({cliPath:e,branch:o.branch})):void 0;y0e.env.EXPERIMENTAL_NETLIFY_DB_ENABLED="1";let l=t.siteId;if(y0e.env.NETLIFY_LOCAL_MODE||!l)return;let u=await n("db-setup",()=>_0e({siteId:l,isProd:c,alias:a,connectionString:t.dbConnectionString}),zo.timeUnits.minutes(10));return i=u.proxy,r?await vxe({cliPath:e,cwd:r,isFreshDatabase:!!u.proxy})??void 0:void 0},generateMigrations:async()=>s?{skipped:!0}:await Exe({cwd:r}),verifyMigrations:async()=>r?await n("db-migrations-verify",()=>Axe({cliPath:e,cwd:r})):{},hasDatabase:async()=>t.siteId?await _oe(t.siteId):!1,stop:async()=>{await i?.stop()},revokeAskAccess:()=>{o&&Dj()}}};import zmt from"process";var E0e=ce("teardown"),v0e=({config:t,cwd:e,database:r,stopUsageTracking:n})=>{let i,o=t.mode==="ask";return{setRunnerCleanup:s=>{i=s},run:async s=>{let a=async(l,u)=>{try{await u()}catch(d){E0e.warn(`Teardown step failed: ${l}`,{state:s,error:d?.message||d}),ne.inc("teardown.step_failed",1,{step:l,state:s})}},c=s==="completed"&&!zmt.env.NETLIFY_LOCAL_MODE;await a("usage-tracker",n),(s==="errored"||c)&&await a("runner-cleanup",()=>i?.()),await a("db-proxy",()=>r.stop()),c&&await a("reset-repo",()=>nde(e)),o&&c&&await a("remove-untracked-files",async()=>{let l=await ide(e);l.length>0&&(E0e.warn(`Removed ${l.length} leftover untracked change(s) after ask run`,{removed:l}),ne.inc("ask_mode.leaked_untracked_files",l.length))})}}};var jmt=({isHotFollowUp:t,enqueuedAt:e})=>t?e===void 0?[]:[["request",e]]:[["spawn",Number(process.env.NETLIFY_AGENT_RUNNER_SPAWN_AT_MS)],["enqueue",Number(process.env.NETLIFY_AGENT_RUNNER_ENQUEUED_AT_MS)]],i9=(t,e,r,n)=>{for(let[i,o]of jmt(r))Number.isFinite(o)&&o>0&&o<=n&&t.timing(e,n-o,{from:i})},b0e=(t,e=Date.now(),r=ne)=>i9(r,"startup.duration",t,e),T0e=(t,e=Date.now(),r=ne)=>i9(r,"startup.time_to_prompt",t,e),w0e=(t,e=Date.now(),r=ne)=>i9(r,"startup.time_to_first_output",t,e);var A0e=(t,e=Date.now(),r=ne)=>{let n={outcome:t.outcome,native_resume:t.nativeResume,is_answer_resume:t.isAnswerResume};r.timing("session.duration",e-t.startedAt,{hot_follow_up:t.isHotFollowUp,...n}),t.creditsCost!=null&&r.distribution("session.credits_cost",t.creditsCost,{...n,...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{}})};function x0e(t){return["One or more AI functions use the legacy **v1** syntax (`exports.handler` / `module.exports.handler`):","",t.map(r=>`- ${r}`).join(`
|
|
638
638
|
`),"",'Netlify AI Gateway credentials (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` and the matching `*_BASE_URL` variables) are injected ONLY into the modern v2/v3 function runtime. A v1 function builds and deploys successfully but throws "missing API key" at runtime \u2014 this will NOT appear as a build error.',"","Rewrite each listed function using **v2** syntax \u2014 `export default async (req: Request) => Response` \u2014 or **v3** object export (`satisfies NetlifyFunction`), preserving its existing behavior and route. Do not set your own API keys; rely on the injected gateway credentials. See the `netlify-ai-gateway` skill for examples."].join(`
|
|
639
|
-
`)}var $f=ce("usage_tracker"),Bmt=4e3,qmt=5e3,Vmt=2e4,Gmt=(t,e,r)=>t===!0||r!=null&&e!=null&&e>=r,Hmt=(t,e,r)=>e!=null&&e>0&&r!=null&&t!=null&&e-t<=r,R0e=(t,e,r,{creditReserve:n,onCreditReserveReached:i}={})=>{let o=!1,s=!1,a=!1,c=!1,l,u,d,f=r,p,h=i!=null&&n!=null,m=()=>{p&&(clearInterval(p),p=void 0)},g=R=>{m(),p=setInterval(()=>{b()},R),p.unref?.()},_=async()=>{try{let R=await QR(t,e);$f.log("Usage update response",{usage:R?.usage});let N=R?.usage?.total_credits_cost;N!=null&&(l=N);let M=R?.enforced_credits_cap;if(M!=null&&M!==f){let v=f==null;f=M,$f.log("Took the session credit limit from a usage poll",{sessionCreditLimit:f,totalCreditsCost:N,isFirstLimit:v}),v&&ne.inc("session.credit_cap_late_arrival",1)}let L=Gmt(R?.credit_limit_exceeded,N,f);if(L&&($f.log("Credit limit exceeded",{totalCreditsCost:N,sessionCreditLimit:f}),a||(u=Date.now(),d=N??l??0,g(Vmt)),a=!0),h&&!c&&!L&&Hmt(N,f,n)){c=!0,$f.log("Credit reserve reached",{totalCreditsCost:N,sessionCreditLimit:f,creditReserve:n});try{i()}catch(v){$f.warn("onCreditReserveReached callback threw",{error:v?.message||v})}}}catch(R){$f.warn("Failed to update usage",{error:R?.message||R})}},b=r0(_,Bmt);return{onAgentOutput:()=>{if(a)throw new Mo("AI credit usage exceeded enforced limit.",503,"Credit limit reached. Check credit limits to continue using Agent Runners.",!0);s||(o=!0,p||g(qmt))},stop:async()=>{s||(s=!0,m(),o&&(b.cancel(),$f.log("Sending final usage update"),await _(),u!==void 0&&(ne.timing("credit_limit.overage_duration",Date.now()-u),ne.distribution("credit_limit.overage_credits",Math.max(0,(l??d??0)-(d??0))))))},getCreditsCost:()=>l,getSessionCreditLimit:()=>f}};var C0e=ce("session_credit_limit"),Wmt=async t=>{if(t.sessionCreditLimit!=null)return{limit:t.sessionCreditLimit,source:"env"};try{let e=(await QR(t.id,t.sessionId))?.enforced_credits_cap;if(e!=null)return C0e.log("Resolved the session credit limit from the usage endpoint",{limit:e}),{limit:e,source:"usage"}}catch(e){C0e.warn("Usage call for the session credit limit failed",{error:e?.message||e})}return{source:"none"}},I0e=async(t,e=!1)=>{let{limit:r,source:n}=await Wmt(t);t.sessionCreditLimit=r,ne.inc("session.credit_cap_source",1,{source:n,hot_follow_up:e})};var bu=ce("credit_wrapup"),P0e="low",Ymt=t=>t.mode==="ask"?iF:t.mode==="normal"?oF:Fd(t)?rF:nF,o9=t=>{let e=tt();return e.creditWrapUpReserveByModeAndModel[t.mode]?.[t.runner]??e.creditWrapUpReserve},O0e=(t,e)=>{if(e<=0)return!1;let r=tt();return t.mode==="create"?r.creditWrapUpEnabled:t.mode==="ask"||t.mode==="normal"?r.creditWrapUpNormalEnabled:!1},s9=(t,e)=>{if(t==="fix"){bu.log("Credit reserve reached outside of the main inference turn \u2014 letting the fix finish without a wrap-up"),ne.inc("session.credit_wrapup_skipped_fix_turn",1,{credit_reserve:e});return}if(t==="no_session"){bu.warn("Credit reserve reached but no session id yet \u2014 skipping wrap-up interrupt"),ne.inc("session.credit_wrapup_skipped_no_session",1,{credit_reserve:e});return}bu.log("Credit reserve reached with no turn to interrupt \u2014 the agent had already finished")},N0e=(t,e,r)=>{if(e==null)return;let n=Math.max(0,e-t.creditsSpentBeforeWrapUp);bu.log("Credit wrap-up cost",{credits:n,creditsCostAtSessionEnd:e,effort:P0e,inferenceAfterWrapUp:r,...t}),ne.distribution("session.credit_wrapup_cost",n,{outcome:t.outcome,effort:P0e,credit_reserve:t.creditReserve,inference_after_wrap_up:r,...t.model?{model:t.model}:{}})},k0e=async({runnerResult:t,interruptedSessionId:e,creditsSpentBeforeWrapUp:r,cliPath:n,config:i,context:o,runner:s,aiGateway:a,cwd:c,persistSteps:l,usageTracker:u,withStageTimer:d,answerFold:f})=>{let p=o9(i),h=new AbortController,m=!1,g=!1,_,b=Object.assign(async A=>{try{u.onAgentOutput()}catch(O){Da(O)&&!m&&(m=!0,bu.log("Wrap-up turn spent the credit reserve \u2014 stopping wrap-up",{creditsSpentBeforeWrapUp:r}),ne.inc("session.credit_wrapup_aborted",1,{credit_reserve:p}),h.abort())}return l(A)},{flush:l.flush.bind(l)});bu.log("Running credit wrap-up inference turn",{creditsSpentBeforeWrapUp:r,creditReserve:p});try{await l({steps:[{category:G.WrapUp,message:`You are reaching your usage limit. ${i.mode==="ask"?"Wrapping up and gathering the info found so far.":"Wrapping up and leaving your work in a usable state."}`}],duration:0})}catch{}let T;try{let{runnerResult:A}=await d("inference-credit-wrapup",()=>yu({cliPath:n,config:i,context:o,runner:s,persistSteps:b,aiGateway:a,cwd:c,contextPrefix:Ymt(i),priorAgentSessionId:e,resumeForCreditWrapUp:!0,answerFold:f,forceLowEffortForCreditWrapUp:!0,abortSignal:h.signal}));_=A.resolvedModel,m&&bu.log("Wrap-up turn was aborted due to budget limit"),T={...IE(t,A),resolvedModel:t.resolvedModel,effort:t.effort,resolvedProviderEffort:t.resolvedProviderEffort}}catch(A){bu.warn("Credit wrap-up turn failed \u2014 proceeding with pre-wrap-up result",{error:A?.message||A}),ne.inc("session.credit_wrapup_failed",1,{credit_reserve:p}),g=!0,T=t}let E=_??t.resolvedModel;return{runnerResult:T,costReport:{creditsSpentBeforeWrapUp:r,creditReserve:p,outcome:g?"failed":m?"aborted":"completed",...E?{model:E}:{}}}};var M0e=t=>{let e,r=!1;return{getActiveTurn:()=>e?"main":r?"fix":"none",getMainTurnAbortSignal:()=>t?e?.signal:void 0,startMainTurn:()=>{e=new AbortController},finishMainTurn:()=>{e=void 0},runFixTurn:async n=>{r=!0;try{return await n()}finally{r=!1}},abortMainTurn:()=>e?.abort()}};import Kmt from"process";var a9=ce("shutdown"),$0e=!1,Zmt,Jmt=async t=>{if($0e)return;if($0e=!0,a9.info("Shutting down...",{signal:t}),Lue(),ne.distribution("session.hot_followups",zEe()),!FEe()){let r=Date.now(),n=jEe(),i=BEe();n!==void 0&&ne.timing("session.last_linger",r-n),i!==void 0&&ne.timing("session.total_linger",r-i)}let e=Zmt?.close().catch(r=>{a9.error("Error closing server during graceful shutdown",r)});await VEe(),await e,await qR(),a9.info("Shutdown complete"),Kmt.exit(0)};var D0e=t=>{Jmt(t)};var Xmt=4e3,Qmt=3e4,gT=ce("credit_limit_preservation"),L0e=async(t,e)=>{if(!e)return null;n_(e);let r=Ks(t.runner),n=null;try{await Promise.race([Promise.all([Nf({runnerId:t.id,sessionId:t.sessionId,archive:r,nativeSessionId:e}).then(i=>{n=i}),nT({archive:r,cache:t.cache,nativeSessionId:e}).catch(i=>{gT.warn("Failed to seed the native session cache before teardown",{error:i?.message||i})})]),new Promise(i=>{setTimeout(i,Xmt).unref()})])}catch(i){gT.warn("Failed to preserve native session before teardown",{error:i?.message||i})}return n},U0e=async(t,e)=>{let r=null,n={},i=[];if(e){n_(e);let o=Ks(t.runner);i.push(Promise.all([Nf({runnerId:t.id,sessionId:t.sessionId,archive:o,nativeSessionId:e}).then(s=>{r=s}),nT({archive:o,cache:t.cache,nativeSessionId:e}).catch(s=>{gT.warn("Failed to seed the native session cache on credit-limit shutdown",{error:s?.message||s})})]).catch(s=>{gT.warn("Failed to preserve native session on credit-limit shutdown",{error:s?.message||s})}))}if(t.mode!=="ask"&&i.push(mC({config:t}).then(o=>o.hasChanges?JY({config:t,diff:o.diff,diffBinary:o.diffBinary,resultDiff:o.resultDiff,resultDiffBinary:o.resultDiffBinary}):{}).then(o=>{n=o}).catch(o=>{gT.warn("Failed to preserve working-tree diff on credit-limit shutdown",{error:o?.message||o})})),i.length>0){let o=!1;await Promise.race([Promise.all(i).then(()=>{o=!0}),new Promise(s=>{setTimeout(s,Qmt).unref()})]),o||ne.inc("credit_preservation.timed_out",1)}return{nativeSessionS3Key:r,diffFields:n}};var tgt=egt(import.meta.url),_T=tgt("../package.json"),cn=ce("pipeline_index"),N_=3,rgt=["codex","gemini"],f3=async({config:t,apiToken:e,cliPath:r="netlify",cwd:n,filter:i,isHotFollowUp:o=!1,enqueuedAt:s,tracing:a={}})=>{let c,l=Date.now(),u="success",d=!1,f,p,h=!1,m,g=!1,{withStageTimer:_}=Uue(zo.timeUnits.hours(4)),b=S0e({config:t,cliPath:r,cwd:n,withStageTimer:_}),T=v0e({config:t,cwd:n,database:b,stopUsageTracking:()=>c?.stop()}),E=await Yie(_T.version,t.id,a);cn.log(`Agent runner orchestrator v${_T.version}`,{featureFlags:tt().raw,metrics:roe()});let A={agent:t.runner,mode:t.mode,is_follow_up:t.sessionHistoryContext.length>0,version:_T.version,fast_init:t.fastInit,credit_wrapup:!1,budget_eligible:!1,budget_constrained:!1,ask_first:!1};$S({...A});let O=!!t.answeredInteraction;b0e({isHotFollowUp:o,enqueuedAt:s}),ede(t.sessionId);try{await fy(dt(),"run-pipeline",{},E,async R=>{await d3(u3(),t.runner),R?.setAttributes({"gen_ai.capability.name":t.mode,"session.id":t.sessionId,...process.env.NETLIFY_DEV_SERVER_ID?{"dev_server.id":process.env.NETLIFY_DEV_SERVER_ID}:{}});let{aiGateway:N,context:M,persistSteps:L,runner:v,sha:oe}=await _("init",()=>Kge({config:t,apiToken:e,cliPath:r,cwd:n,filter:i,runnerVersion:_T.version}),zo.timeUnits.minutes(10)),$=v.runner;tt().idleTimeoutEnabled||T.setRunnerCleanup(v.clean),await I0e(t,o),Object.assign(A,gme(t)),$S({...A});let S=o9(t),w=O0e(t,S),k=M0e(w),Y,H=!1,he=0,je;c=R0e(t.id,t.sessionId,t.sessionCreditLimit,{...w?{creditReserve:S,onCreditReserveReached:()=>{if(!H){if(k.getActiveTurn()!=="main"){H=!0,s9(k.getActiveTurn(),S);return}if(!je){s9("no_session",S);return}H=!0,he=c?.getCreditsCost()??0,cn.log("Credit reserve reached \u2014 interrupting agent to wrap up",{creditsSpentBeforeWrapUp:he,creditReserve:S}),A.credit_wrapup=!0,$S({...A}),ne.inc("session.credit_wrapup_triggered",1,{credit_reserve:S}),k.abortMainTurn()}}}:{}});let Ie=GC(t.mode),$e;t.deployAlias&&t.deployAlias.length>0?$e=t.deployAlias:(t.deployAlias!==void 0&&!Ie&&cn.warn("Received empty deploy alias for a non-prod deploy, falling back to local computation"),$e=Ioe(t.id,process.env.SITE_NAME,Ie));let Oe=!1,Je=!1,Ne=Object.assign(async Pe=>{Oe||(Oe=!0,T0e({isHotFollowUp:o,enqueuedAt:s}));try{c?.onAgentOutput()}catch(zt){return Da(zt)?Y??=zt:cn.warn("Unexpected error in onAgentOutput",{error:zt?.message||zt}),L(Pe)}return!Je&&Pe.steps?.some(zt=>zt.category!==G.Environment&&zt.category!==G.SubagentPrompt)&&(Je=!0,w0e({isHotFollowUp:o,enqueuedAt:s})),L(Pe)},{flush:L.flush.bind(L)});if(t.sha=oe,t.mode==="redeploy"){await yxe({cliPath:r,config:t,filter:i,deploySubdomain:$e,isProdDeploy:Ie,withStageTimer:_,stopUsageTracking:async()=>{await c?.stop()}}),await T.run("completed");return}let le=JEe(),me=t.mode==="ask",nt;t.mode==="create"&&(nt=(await _("create",()=>Sme({config:t,cwd:n}))).additionalContext),nt=await REe(nt,t);let re=await b.prepare({deploySubdomain:$e,isProdDeploy:Ie});re&&(nt=[re,nt].filter(Boolean).join(`
|
|
639
|
+
`)}var $f=ce("usage_tracker"),Bmt=4e3,qmt=5e3,Vmt=2e4,Gmt=(t,e,r)=>t===!0||r!=null&&e!=null&&e>=r,Hmt=(t,e,r)=>e!=null&&e>0&&r!=null&&t!=null&&e-t<=r,R0e=(t,e,r,{creditReserve:n,onCreditReserveReached:i}={})=>{let o=!1,s=!1,a=!1,c=!1,l,u,d,f=r,p,h=i!=null&&n!=null,m=()=>{p&&(clearInterval(p),p=void 0)},g=R=>{m(),p=setInterval(()=>{b()},R),p.unref?.()},_=async()=>{try{let R=await QR(t,e);$f.log("Usage update response",{usage:R?.usage});let N=R?.usage?.total_credits_cost;N!=null&&(l=N);let M=R?.enforced_credits_cap;if(M!=null&&M!==f){let v=f==null;f=M,$f.log("Took the session credit limit from a usage poll",{sessionCreditLimit:f,totalCreditsCost:N,isFirstLimit:v}),v&&ne.inc("session.credit_cap_late_arrival",1)}let L=Gmt(R?.credit_limit_exceeded,N,f);if(L&&($f.log("Credit limit exceeded",{totalCreditsCost:N,sessionCreditLimit:f}),a||(u=Date.now(),d=N??l??0,g(Vmt)),a=!0),h&&!c&&!L&&Hmt(N,f,n)){c=!0,$f.log("Credit reserve reached",{totalCreditsCost:N,sessionCreditLimit:f,creditReserve:n});try{i()}catch(v){$f.warn("onCreditReserveReached callback threw",{error:v?.message||v})}}}catch(R){$f.warn("Failed to update usage",{error:R?.message||R})}},b=r0(_,Bmt);return{onAgentOutput:()=>{if(a)throw new Mo("AI credit usage exceeded enforced limit.",503,"Credit limit reached. Check credit limits to continue using Agent Runners.",!0);s||(o=!0,p||g(qmt))},stop:async()=>{s||(s=!0,m(),o&&(b.cancel(),$f.log("Sending final usage update"),await _(),u!==void 0&&(ne.timing("credit_limit.overage_duration",Date.now()-u),ne.distribution("credit_limit.overage_credits",Math.max(0,(l??d??0)-(d??0))))))},getCreditsCost:()=>l,getSessionCreditLimit:()=>f}};var C0e=ce("session_credit_limit"),Wmt=async t=>{if(t.sessionCreditLimit!=null)return{limit:t.sessionCreditLimit,source:"env"};try{let e=(await QR(t.id,t.sessionId))?.enforced_credits_cap;if(e!=null)return C0e.log("Resolved the session credit limit from the usage endpoint",{limit:e}),{limit:e,source:"usage"}}catch(e){C0e.warn("Usage call for the session credit limit failed",{error:e?.message||e})}return{source:"none"}},I0e=async(t,e=!1)=>{let{limit:r,source:n}=await Wmt(t);t.sessionCreditLimit=r,ne.inc("session.credit_cap_source",1,{source:n,hot_follow_up:e})};var bu=ce("credit_wrapup"),P0e="low",Ymt=t=>t.mode==="ask"?iF:t.mode==="normal"?oF:Fd(t)?rF:nF,o9=t=>{let e=tt();return e.creditWrapUpReserveByModeAndModel[t.mode]?.[t.runner]??e.creditWrapUpReserve},O0e=(t,e)=>{if(e<=0)return!1;let r=tt();return t.mode==="create"?r.creditWrapUpEnabled:t.mode==="ask"||t.mode==="normal"?r.creditWrapUpNormalEnabled:!1},s9=(t,e)=>{if(t==="fix"){bu.log("Credit reserve reached outside of the main inference turn \u2014 letting the fix finish without a wrap-up"),ne.inc("session.credit_wrapup_skipped_fix_turn",1,{credit_reserve:e});return}if(t==="no_session"){bu.warn("Credit reserve reached but no session id yet \u2014 skipping wrap-up interrupt"),ne.inc("session.credit_wrapup_skipped_no_session",1,{credit_reserve:e});return}bu.log("Credit reserve reached with no turn to interrupt \u2014 the agent had already finished")},N0e=(t,e,r)=>{if(e==null)return;let n=Math.max(0,e-t.creditsSpentBeforeWrapUp);bu.log("Credit wrap-up cost",{credits:n,creditsCostAtSessionEnd:e,effort:P0e,inferenceAfterWrapUp:r,...t}),ne.distribution("session.credit_wrapup_cost",n,{outcome:t.outcome,effort:P0e,credit_reserve:t.creditReserve,inference_after_wrap_up:r,...t.model?{model:t.model}:{}})},k0e=async({runnerResult:t,interruptedSessionId:e,creditsSpentBeforeWrapUp:r,cliPath:n,config:i,context:o,runner:s,aiGateway:a,cwd:c,persistSteps:l,usageTracker:u,withStageTimer:d,answerFold:f})=>{let p=o9(i),h=new AbortController,m=!1,g=!1,_,b=Object.assign(async A=>{try{u.onAgentOutput()}catch(O){Da(O)&&!m&&(m=!0,bu.log("Wrap-up turn spent the credit reserve \u2014 stopping wrap-up",{creditsSpentBeforeWrapUp:r}),ne.inc("session.credit_wrapup_aborted",1,{credit_reserve:p}),h.abort())}return l(A)},{flush:l.flush.bind(l)});bu.log("Running credit wrap-up inference turn",{creditsSpentBeforeWrapUp:r,creditReserve:p});try{await l({steps:[{category:G.WrapUp,message:`You are reaching your usage limit. ${i.mode==="ask"?"Wrapping up and gathering the info found so far.":"Wrapping up and leaving your work in a usable state."}`}],duration:0})}catch{}let T;try{let{runnerResult:A}=await d("inference-credit-wrapup",()=>yu({cliPath:n,config:i,context:o,runner:s,persistSteps:b,aiGateway:a,cwd:c,contextPrefix:Ymt(i),priorAgentSessionId:e,resumeForCreditWrapUp:!0,answerFold:f,forceLowEffortForCreditWrapUp:!0,abortSignal:h.signal}));_=A.resolvedModel,m&&bu.log("Wrap-up turn was aborted due to budget limit"),T={...IE(t,A),resolvedModel:t.resolvedModel,effort:t.effort,resolvedProviderEffort:t.resolvedProviderEffort}}catch(A){bu.warn("Credit wrap-up turn failed \u2014 proceeding with pre-wrap-up result",{error:A?.message||A}),ne.inc("session.credit_wrapup_failed",1,{credit_reserve:p}),g=!0,T=t}let E=_??t.resolvedModel;return{runnerResult:T,costReport:{creditsSpentBeforeWrapUp:r,creditReserve:p,outcome:g?"failed":m?"aborted":"completed",...E?{model:E}:{}}}};var M0e=t=>{let e,r=!1;return{getActiveTurn:()=>e?"main":r?"fix":"none",getMainTurnAbortSignal:()=>t?e?.signal:void 0,startMainTurn:()=>{e=new AbortController},finishMainTurn:()=>{e=void 0},runFixTurn:async n=>{r=!0;try{return await n()}finally{r=!1}},abortMainTurn:()=>e?.abort()}};import Kmt from"process";var a9=ce("shutdown"),$0e=!1,Zmt,Jmt=async t=>{if($0e)return;if($0e=!0,a9.info("Shutting down...",{signal:t}),Lue(),ne.distribution("session.hot_followups",zEe()),!FEe()){let r=Date.now(),n=jEe(),i=BEe();n!==void 0&&ne.timing("session.last_linger",r-n),i!==void 0&&ne.timing("session.total_linger",r-i)}let e=Zmt?.close().catch(r=>{a9.error("Error closing server during graceful shutdown",r)});await VEe(),await e,await qR(),a9.info("Shutdown complete"),Kmt.exit(0)};var D0e=t=>{Jmt(t)};var Xmt=4e3,Qmt=3e4,gT=ce("credit_limit_preservation"),L0e=async(t,e)=>{if(!e)return null;n_(e);let r=Ks(t.runner),n=null;try{await Promise.race([Promise.all([Nf({runnerId:t.id,sessionId:t.sessionId,archive:r,nativeSessionId:e}).then(i=>{n=i}),nT({archive:r,cache:t.cache,nativeSessionId:e}).catch(i=>{gT.warn("Failed to seed the native session cache before teardown",{error:i?.message||i})})]),new Promise(i=>{setTimeout(i,Xmt).unref()})])}catch(i){gT.warn("Failed to preserve native session before teardown",{error:i?.message||i})}return n},U0e=async(t,e)=>{let r=null,n={},i=[];if(e){n_(e);let o=Ks(t.runner);i.push(Promise.all([Nf({runnerId:t.id,sessionId:t.sessionId,archive:o,nativeSessionId:e}).then(s=>{r=s}),nT({archive:o,cache:t.cache,nativeSessionId:e}).catch(s=>{gT.warn("Failed to seed the native session cache on credit-limit shutdown",{error:s?.message||s})})]).catch(s=>{gT.warn("Failed to preserve native session on credit-limit shutdown",{error:s?.message||s})}))}if(t.mode!=="ask"&&i.push(mC({config:t}).then(o=>o.hasChanges?JY({config:t,diff:o.diff,diffBinary:o.diffBinary,resultDiff:o.resultDiff,resultDiffBinary:o.resultDiffBinary}):{}).then(o=>{n=o}).catch(o=>{gT.warn("Failed to preserve working-tree diff on credit-limit shutdown",{error:o?.message||o})})),i.length>0){let o=!1;await Promise.race([Promise.all(i).then(()=>{o=!0}),new Promise(s=>{setTimeout(s,Qmt).unref()})]),o||ne.inc("credit_preservation.timed_out",1)}return{nativeSessionS3Key:r,diffFields:n}};var tgt=egt(import.meta.url),_T=tgt("../package.json"),cn=ce("pipeline_index"),N_=3,rgt=["codex","gemini"],f3=async({config:t,apiToken:e,cliPath:r="netlify",cwd:n,filter:i,isHotFollowUp:o=!1,enqueuedAt:s,tracing:a={}})=>{let c,l=Date.now(),u="success",d=!1,f,p,h=!1,m,g=!1,{withStageTimer:_}=Uue(zo.timeUnits.hours(4)),b=S0e({config:t,cliPath:r,cwd:n,withStageTimer:_}),T=v0e({config:t,cwd:n,database:b,stopUsageTracking:()=>c?.stop()}),E=await Yie(_T.version,t.id,a);cn.log(`Agent runner orchestrator v${_T.version}`,{featureFlags:tt().raw,metrics:roe()});let A={agent:t.runner,mode:t.mode,is_follow_up:t.sessionHistoryContext.length>0,version:_T.version,fast_init:t.fastInit,credit_wrapup:!1,budget_eligible:!1,budget_constrained:!1,ask_first:!1};$S({...A});let O=!!t.answeredInteraction;b0e({isHotFollowUp:o,enqueuedAt:s}),ede(t.sessionId);try{await fy(dt(),"run-pipeline",{},E,async R=>{await d3(u3(),t.runner),R?.setAttributes({"gen_ai.capability.name":t.mode,"session.id":t.sessionId,...process.env.NETLIFY_DEV_SERVER_ID?{"dev_server.id":process.env.NETLIFY_DEV_SERVER_ID}:{}});let{aiGateway:N,context:M,persistSteps:L,runner:v,sha:oe}=await _("init",()=>Kge({config:t,apiToken:e,cliPath:r,cwd:n,filter:i,runnerVersion:_T.version}),zo.timeUnits.minutes(10)),$=v.runner;tt().idleTimeoutEnabled||T.setRunnerCleanup(v.clean),await I0e(t,o),Object.assign(A,gme(t)),$S({...A});let S=o9(t),w=O0e(t,S),k=M0e(w),Y,H=!1,he=0,je;c=R0e(t.id,t.sessionId,t.sessionCreditLimit,{...w?{creditReserve:S,onCreditReserveReached:()=>{if(!H){if(k.getActiveTurn()!=="main"){H=!0,s9(k.getActiveTurn(),S);return}if(!je){s9("no_session",S);return}H=!0,he=c?.getCreditsCost()??0,cn.log("Credit reserve reached \u2014 interrupting agent to wrap up",{creditsSpentBeforeWrapUp:he,creditReserve:S}),A.credit_wrapup=!0,$S({...A}),ne.inc("session.credit_wrapup_triggered",1,{credit_reserve:S}),k.abortMainTurn()}}}:{}});let Ie=GC(t.mode),$e;t.deployAlias&&t.deployAlias.length>0?$e=t.deployAlias:(t.deployAlias!==void 0&&!Ie&&cn.warn("Received empty deploy alias for a non-prod deploy, falling back to local computation"),$e=Ioe(t.id,process.env.SITE_NAME,Ie));let Pe=!1,He=!1,Ne=Object.assign(async Oe=>{Pe||(Pe=!0,T0e({isHotFollowUp:o,enqueuedAt:s}));try{c?.onAgentOutput()}catch(zt){return Da(zt)?Y??=zt:cn.warn("Unexpected error in onAgentOutput",{error:zt?.message||zt}),L(Oe)}return!He&&Oe.steps?.some(zt=>zt.category!==G.Environment&&zt.category!==G.SubagentPrompt)&&(He=!0,w0e({isHotFollowUp:o,enqueuedAt:s})),L(Oe)},{flush:L.flush.bind(L)});if(t.sha=oe,t.mode==="redeploy"){await yxe({cliPath:r,config:t,filter:i,deploySubdomain:$e,isProdDeploy:Ie,withStageTimer:_,stopUsageTracking:async()=>{await c?.stop()}}),await T.run("completed");return}let le=JEe(),me=t.mode==="ask",nt;t.mode==="create"&&(nt=(await _("create",()=>Sme({config:t,cwd:n}))).additionalContext),nt=await REe(nt,t);let re=await b.prepare({deploySubdomain:$e,isProdDeploy:Ie});re&&(nt=[re,nt].filter(Boolean).join(`
|
|
640
640
|
|
|
641
|
-
`)),k.startMainTurn();let qe=await _("inference",async()=>{try{return await yu({cliPath:r,config:t,context:M,runner:$,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:le,abortSignal:k.getMainTurnAbortSignal(),onSessionId:w?
|
|
641
|
+
`)),k.startMainTurn();let qe=await _("inference",async()=>{try{return await yu({cliPath:r,config:t,context:M,runner:$,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:le,abortSignal:k.getMainTurnAbortSignal(),onSessionId:w?Oe=>{je=Oe}:void 0})}catch(Oe){if(!(Oe instanceof rh)||t.mode!=="rebase"&&t.mode!=="conflict_resolution")throw Oe;for(let zt of rgt){if(Y&&Da(Y))throw Y;if(zt===t.runner)continue;let Fr=Pg[zt];if(Fr){cn.log(`Primary runner ${t.runner} failed in ${t.mode} mode, falling back to ${zt}`),$S({...A,agent:zt}),await d3(u3(),zt);try{let wr=await yu({cliPath:r,config:{...t,runner:zt},context:M,runner:Fr.runner,persistSteps:Ne,aiGateway:N,additionalContext:nt,cwd:n,answerFold:le,abortSignal:k.getMainTurnAbortSignal()});return t.runner=zt,$=Fr.runner,tt().idleTimeoutEnabled||T.setRunnerCleanup(Fr.clean),wr}catch(wr){if(Da(wr))throw wr;cn.error(`Fallback runner ${zt} also failed`,{error:String(wr)})}}}throw Oe}}).finally(k.finishMainTurn),z=qe.runnerResult;d=qe.nativeResume??!1,f=z.resolvedModel,p=z.effort;let x=async(Oe,zt)=>{let{runnerResult:Fr}=await k.runFixTurn(()=>_(Oe,()=>yu({cliPath:r,config:t,context:M,runner:$,persistSteps:Ne,aiGateway:N,buildErrors:zt,priorAgentSessionId:z.agentSessionId,answerFold:le})));if(Y)throw Object.assign(Y,{agentSessionId:Fr.agentSessionId??z.agentSessionId}),Y;z=IE(z,Fr)},I=z.agentSessionId;if(w&&H&&z.aborted&&!Y&&I&&c){h=!0;let Oe=await k0e({runnerResult:z,interruptedSessionId:I,creditsSpentBeforeWrapUp:he,cliPath:r,config:t,context:M,runner:$,aiGateway:N,cwd:n,persistSteps:L,usageTracker:c,withStageTimer:_,answerFold:le});z=Oe.runnerResult,m=Oe.costReport}if(t.mode==="create"&&await yme(n??process.cwd()),Y)throw Object.assign(Y,{agentSessionId:z.agentSessionId}),Y;if(z.pendingInteraction){let Oe=z.agentSessionId;Oe&&n_(Oe);let zt=await Nf({runnerId:t.id,sessionId:t.sessionId,archive:Ks(t.runner)}),Fr;try{Fr=await YEe(t,z.pendingInteraction,{nativeSessionId:Oe,nativeSessionS3Key:zt??void 0})}catch(wr){throw ne.inc("inference.pause_persist_failed",1),wr}KEe(z.pendingInteraction,t.sessionId,Fr),u="awaiting_input",await T.run("awaiting-input");return}let B=await b.generateMigrations();if(B.error&&(cn.log("Migration generation failed, running inference to fix the issue"),await x("inference-migration-fix",[`Running \`drizzle-kit generate\` to generate database migrations failed with the following error:
|
|
642
642
|
|
|
643
643
|
${B.error}
|
|
644
644
|
|
|
645
|
-
Please fix the issue and do NOT run \`drizzle-kit generate\` yourself \u2014 it will be run automatically after you're done.`]),await b.generateMigrations()),!B.skipped){let
|
|
645
|
+
Please fix the issue and do NOT run \`drizzle-kit generate\` yourself \u2014 it will be run automatically after you're done.`]),await b.generateMigrations()),!B.skipped){let Oe=await b.verifyMigrations();Oe.error&&(cn.log("Migration drift detected, running inference to fix"),await x("inference-migration-drift-fix",[Oe.error]))}if(tt().aiFnV1GuardrailEnabled&&n&&!me)try{let Oe=await uF(n);Oe.v1>0&&(cn.log(`Detected ${Oe.v1} v1 AI function(s), running inference to fix`),await x("inference-ai-fn-v1-fix",[x0e(Oe.v1Files)]))}catch(Oe){if(Da(Oe))throw Oe;cn.warn("ai_fn_v1_guardrail failed",{err:Oe})}let te=await _("deploy",()=>oT({cliPath:r,config:t,result:z.result,filter:i,isRetry:!1,deploySubdomain:$e})),ie=te.hasChanges?te:void 0,Ee=z;te.deployError&&ne.inc("deploy.failed",1,{attempt:1});let yt=[],lr;if(te.hasChanges&&te.deployError){yt.push(Jie(te.deployError));let Oe=1,zt=!1;for(;Oe<=N_&&!te.previewInfo&&!zt;)cn.log(`Deploy attempt had errors. Retrying. ${Oe}/${N_}`),await fy(dt(),"deploy-stage",async Fr=>{Fr?.setAttributes({"stage.attempt":Oe});let wr;try{g=h,wr=(await k.runFixTurn(()=>_(`inference-retry-${Oe}`,()=>yu({cliPath:r,config:t,context:M,runner:$,persistSteps:Ne,aiGateway:N,buildErrors:yt,priorAgentSessionId:z.agentSessionId,answerFold:le})))).runnerResult}catch(sa){if(Da(sa))throw sa;cn.warn(`Inference retry ${Oe} failed, stopping deploy retries:`,sa),zt=!0;return}if(Y)throw Object.assign(Y,{agentSessionId:wr.agentSessionId??z.agentSessionId}),Y;Ee=IE(Ee,wr),await b.generateMigrations(),te=await _(`deploy-retry-${Oe}`,()=>oT({cliPath:r,config:t,result:wr.result,filter:i,isRetry:!0,deploySubdomain:$e})),te.hasChanges&&(ie=te),te.deployError&&(ne.inc("deploy.failed",1,{attempt:Oe+1}),yt.push(te.deployError)),Oe++});Oe>N_&&!te.previewInfo&&(ne.inc("deploy.retries_exhausted",1),t.mode==="create"?(console.warn(`Deploy still failing after ${N_} retries, failing the create run`),lr=new Error(`Deploy failed after ${N_} retries`)):console.warn(`Deploy still failing after ${N_} retries, completing run without a preview`))}let St=te.previewInfo||te.hasChanges?te:ie??te,{diff:di,resultDiff:We,previewInfo:De,diffBinary:Ve,resultDiffBinary:xe,hasNetlifyForm:we,hasNetlifyIdentity:ln}=St;St.hasChanges&&HR({previewDeployed:!!St.previewInfo,hadFailedAttempts:yt.length>0}),await c?.stop(),R?.setAttributes(Qie(Ee,c?.getCreditsCost())),f=Ee.resolvedModel,p=Ee.effort??p;let fo=Ee.agentSessionId??z.agentSessionId;if(fo&&n_(fo),await _("cleanup",()=>rk({config:t,diff:di,result:Ee.result,duration:Ee.duration,resultDiff:We,diffBinary:Ve,resultDiffBinary:xe,previewInfo:De,isProdDeploy:Ie,hasNetlifyForm:we,hasNetlifyIdentity:ln,nativeSessionArchive:Ks(t.runner),nativeSessionId:fo,finalAgentConfig:{agent:t.runner,model:f,effort:p},creditWrapUp:h}),zo.timeUnits.minutes(10),{interruptible:!1}),lr)throw lr;try{let Oe=await uF(n??process.cwd());Oe.aiTotal>0&&R?.setAttributes({"agent.fn_ai_total":Oe.aiTotal,"agent.fn_ai_v1":Oe.v1,"agent.fn_ai_v2":Oe.v2,"agent.fn_ai_v3":Oe.v3,"agent.fn_ai_unknown":Oe.unknown})}catch{}await T.run("completed");let k_=await b.hasDatabase();typeof k_=="boolean"&&R?.setAttributes({"actual.has_db":k_}),await Toe({config:t,hasDb:k_,pipelineSpan:R,resolvedModel:Ee.resolvedModel??z.resolvedModel,cliVersion:_T.version})})}catch(R){if(Da(R)){u="gracefulError",cn.info("Agent run terminated gracefully",{statusCode:R.statusCode,reason:R.message}),await c?.stop();let $=R?.agentSessionId,S=R.isCreditLimitExceeded&&!!$,{nativeSessionS3Key:w,diffFields:k}=R.isCreditLimitExceeded?await U0e(t,$):{nativeSessionS3Key:null,diffFields:{}};await T.run("errored");try{await dn(t.id,t.sessionId,{result:R.userMessage,state:R.isCreditLimitExceeded?"cancelled":"error",...R.isCreditLimitExceeded&&{credit_limit_exceeded:!0},...S?{native_session_id:$}:{},...w?{native_session_s3_key:w}:{},...k,metadata:{final_agent_config:{agent:t.runner,model:f,effort:p},...h?{credit_wrap_up:!0}:{}}})}catch{cn.info("Could not update session (site may have been deleted)")}R.isCreditLimitExceeded&&D0e("credit_limit_cancelled");return}u=ks()?"interrupted":"error",cn.error("Got error while running pipeline",R),await c?.stop();let N=R?.agentSessionId,M=ks()&&!!N,L=M?await L0e(t,N):null;await T.run("errored");let v=R instanceof Error?R.shortMessage||R.message:"",oe=v?hme(DP(v)):"Encountered error when running agent";try{await dn(t.id,t.sessionId,{result:oe,state:"error",...M?{native_session_id:N}:{},...L?{native_session_s3_key:L}:{}})}catch($){cn.error("Failed to update session with error state, retrying with minimal payload:",$);try{await dn(t.id,t.sessionId,{result:"Encountered error when running agent",state:"error"})}catch(S){cn.error("Failed to mark session as errored:",S)}}throw R}finally{b.revokeAskAccess(),m&&N0e(m,c?.getCreditsCost(),g),A0e({isHotFollowUp:o,startedAt:l,outcome:u,nativeResume:d,isAnswerResume:O,creditsCost:c?.getCreditsCost(),model:f,effort:p})}};import F0e from"crypto";var Tn=ce("bin_local"),jn=(0,B0e.default)(Tr.argv.slice(2),{string:["cwd","cli-path","filter","prompt","runner","model","netlify-api-token","trace-exporter-url"],boolean:["quiet","help","preview"],alias:{h:"help",q:"quiet"}});jn.quiet&&(Tr.env.LOG="0",Tr.env.NETLIFY_LOCAL_QUIET="true");var l9=()=>{console.log(`
|
|
646
646
|
agent-runner-cli-local - Run Netlify agent runner locally without API connections
|
|
647
647
|
|
|
648
648
|
USAGE:
|