@malloydata/cli 0.0.54-next.2026.5.4.1a92a44 → 0.0.54-next.2026.5.4.8d18d45
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/cli.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4116,12 +4116,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
4116
4116
|
`);return o===-1?"":i.stack.slice(o+1)})();try{if(!n.stack)n.stack=s;else if(s){let o=s.indexOf(`
|
|
4117
4117
|
`),a=o===-1?-1:s.indexOf(`
|
|
4118
4118
|
`,o+1),c=a===-1?"":s.slice(a+1);String(n.stack).endsWith(c)||(n.stack+=`
|
|
4119
|
-
`+s)}}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=s7(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&Bje.assertOptions(n,{silentJSONParsing:B_.transitional(B_.boolean),forcedJSONParsing:B_.transitional(B_.boolean),clarifyTimeoutError:B_.transitional(B_.boolean),legacyInterceptorReqResOrdering:B_.transitional(B_.boolean)},!1),i!=null&&(Vt.isFunction(i)?r.paramsSerializer={serialize:i}:Bje.assertOptions(i,{encode:B_.function,serialize:B_.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Bje.assertOptions(r,{baseUrl:B_.spelling("baseURL"),withXsrfToken:B_.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Vt.merge(s.common,s[r.method]);s&&Vt.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),r.headers=bd.concat(o,s);let a=[],c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(r)===!1)return;c=c&&g.synchronous;let E=r.transitional||Qje;E&&E.legacyInterceptorReqResOrdering?a.unshift(g.fulfilled,g.rejected):a.push(g.fulfilled,g.rejected)});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,A=0,p;if(!c){let h=[Xmn.bind(this),void 0];for(h.unshift(...a),h.push(...u),p=h.length,l=Promise.resolve(r);A<p;)l=l.then(h[A++],h[A++]);return l}p=a.length;let f=r;for(;A<p;){let h=a[A++],g=a[A++];try{f=h(f)}catch(E){g.call(this,E);break}}try{l=Xmn.call(this,f)}catch(h){return Promise.reject(h)}for(A=0,p=u.length;A<p;)l=l.then(u[A++],u[A++]);return l}getUri(e){e=s7(this.defaults,e);let r=kHt(e.baseURL,e.url,e.allowAbsoluteUrls);return LHt(r,e.params,e.paramsSerializer)}};Vt.forEach(["delete","get","head","options"],function(e){Uv.prototype[e]=function(r,n){return this.request(s7(n||{},{method:e,url:r,data:(n||{}).data}))}});Vt.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,a){return this.request(s7(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Uv.prototype[e]=r(),Uv.prototype[e+"Form"]=r(!0)});var vHt=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Gv(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}};function _to(t){return function(r){return t.apply(null,r)}}function xto(t){return Vt.isObject(t)&&t.isAxiosError===!0}var NHt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(NHt).forEach(([t,e])=>{NHt[e]=t});function _En(t){let e=new Uv(t),r=rEn(Uv.prototype.request,e);return Vt.extend(r,Uv.prototype,e,{allOwnKeys:!0}),Vt.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return _En(s7(t,i))},r}var P1=_En(xEe);P1.Axios=Uv;P1.CanceledError=Gv;P1.CancelToken=vHt;P1.isCancel=gEn;P1.VERSION=Oje;P1.toFormData=Nje;P1.AxiosError=Pn;P1.Cancel=P1.CanceledError;P1.all=function(e){return Promise.all(e)};P1.spread=_to;P1.isAxiosError=xto;P1.mergeConfig=s7;P1.AxiosHeaders=bd;P1.formToJSON=t=>fEn(Vt.isHTMLForm(t)?new FormData(t):t);P1.getAdapter=bEn.getAdapter;P1.HttpStatusCode=NHt;P1.default=P1;xEn.exports=P1});var qHt=m(BEn=>{"use strict";BEn.paramsNames=Object.freeze({SF_REQUEST_GUID:"request_guid",SF_REQUEST_ID:"requestId",SF_TOKEN:"token",SF_WAREHOUSE_NAME:"warehouse",SF_DB_NAME:"databaseName",SF_SCHEMA_NAME:"schemaName"})});var UHt=m(dte=>{"use strict";var MEn=nHe(),lte=qHt(),Lje=["baseUrl","path","method",lte.paramsNames.SF_REQUEST_ID,lte.paramsNames.SF_REQUEST_GUID,lte.paramsNames.SF_WAREHOUSE_NAME,lte.paramsNames.SF_DB_NAME,lte.paramsNames.SF_SCHEMA_NAME],Pje=[lte.paramsNames.SF_TOKEN];function Ate(t,e){return e||t}function Bto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n=Ate(Lje,e),i=Ate(Pje,r),{method:s,url:o,params:a}=t||{};return OEn({method:s,url:o,params:a},n,i)}function Mto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n,i,s,o=t?.config,a=Ate(Lje,e),c=Ate(Pje,r);return o&&(n=o.method,i=o.url,s=o.params),OEn({method:n,url:i,params:s},a,c)}function OEn({method:t,url:e,params:r}={},n,i){let s={method:t?.toUpperCase(),...REn(e,r)};return MEn.describeAttributes(s,n,i)}function REn(t,e={}){if(!t)return{baseUrl:void 0,path:void 0,queryParams:{}};let r=new URL(t),n={...e};return r.searchParams.forEach((s,o)=>{n[o]=s}),{baseUrl:`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}`,path:r.pathname,...n}}function Oto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n=Ate(Lje,e),i=Ate(Pje,r),s=REn(t);return MEn.describeAttributes(s,n,i)}dte.DEFAULT_ATTRIBUTES_DESCRIBING_REQUEST_WITH_VALUES=Lje;dte.DEFAULT_ATTRIBUTES_DESCRIBING_REQUEST_WITHOUT_VALUES=Pje;dte.describeRequestFromOptions=Bto;dte.describeRequestFromResponse=Mto;dte.describeURL=Oto});var QEn=m((iZa,NEn)=>{"use strict";var Rto=require("zlib"),o7=hs(),$c=Rs(),SEn=Sme(),wEn=BEe(),Sto=require("node:url").URL,Ql=UHt(),wto=36e4;function Wv(t){$c.getInstance().trace("Initializing base HttpClient with Connection Config[%s]",t.describeIdentityAttributes()),this._connectionConfig=t}Wv.prototype.request=function(t){$c.getInstance().trace("Request%s - preparing for sending.",Ql.describeRequestFromOptions(t));let e={},r=new AbortController,n={signal:r.signal},i=vEn.call(this,t,n),s=async function(){$c.getInstance().trace("Request%s - sending.",Ql.describeRequestFromOptions(i));let a=new SEn().start();e.requestPromise=wEn.request(i).then(c=>{let u=a.getDuration();return $c.getInstance().debug("Request%s - response received after %s milliseconds with status %s.",Ql.describeRequestFromOptions(i),u,c.status),TEn(c),GHt(c),o7.isFunction(t.callback)?($c.getInstance().trace("Request%s - calling callback function.",Ql.describeRequestFromOptions(i)),t.callback(null,kje(c),c.data)):($c.getInstance().trace("Request%s - callback function was not provided.",Ql.describeRequestFromOptions(i)),null)}).catch(c=>{let u=a.getDuration();if($c.getInstance().debug("Request%s - failed after %s milliseconds.",Ql.describeRequestFromOptions(i),u),DEn(c),o7.isFunction(t.callback))return c.response?($c.getInstance().trace("Request%s - calling callback function for error from response. Received code: ",Ql.describeRequestFromOptions(i),c.response.status),t.callback(null,kje(c.response),c.response.data)):($c.getInstance().trace("Request%s - calling callback function for error without response.",Ql.describeRequestFromOptions(i)),t.callback(c,kje(null),null)),null;throw $c.getInstance().warn("Request%s - callback function was not provided. Error will be re-raised.",Ql.describeRequestFromOptions(i)),c})};return s=s.bind(this),$c.getInstance().trace("Request%s - issued for the next tick.",Ql.describeRequestFromOptions(i)),process.nextTick(s),e.abort=function(){r&&($c.getInstance().trace("Request%s - aborting.",Ql.describeRequestFromOptions(i)),r.abort(),$c.getInstance().debug("Request%s - aborted.",Ql.describeRequestFromOptions(i)))},e};Wv.prototype.requestAsync=async function(t){$c.getInstance().trace("Request%s - preparing for async sending.",Ql.describeRequestFromOptions(t));let e=new SEn;try{let r=vEn.call(this,t);e.start();let n=await wEn.request(r),i=e.getDuration();return $c.getInstance().debug("Request%s - response received after %s milliseconds with status %s.",Ql.describeRequestFromOptions(r),i,n.status),TEn(n),GHt(n),kje(n)}catch(r){let n=e.getDuration();throw $c.getInstance().debug("Request%s - failed after %s milliseconds. Error will be re-raised.",Ql.describeRequestFromOptions(t),n),DEn(r),r}};function TEn(t){$c.getInstance().trace("Request%s - parsing response data.",Ql.describeRequestFromResponse(t)),Tto(t)}function Tto(t){o7.isString(t.data)&&t.headers["content-type"]==="application/json"&&(t.data.includes("smkId")&&(t.data=o7.convertSmkIdToString(t.data)),t.json=t.data,t.data=JSON.parse(t.data))}Wv.prototype.post=async function(t,e,r){return this.requestAsync({url:t,method:"POST",data:e,...r})};Wv.prototype.get=async function(t,e){return this.requestAsync({url:t,method:"GET",...e})};Wv.prototype.head=async function(t,e){return this.requestAsync({url:t,method:"HEAD",...e})};Wv.prototype.put=async function(t,e,r){return this.requestAsync({url:t,method:"PUT",data:e,...r})};Wv.prototype.getRequestModule=function(){return null};Wv.prototype.getAgent=function(){return null};NEn.exports=Wv;function GHt(t){$c.getInstance().trace("Request%s - sanitizing response data.",Ql.describeRequestFromResponse(t)),t.request=void 0,t.config&&(t.config.data=void 0,t.config.headers=void 0)}function DEn(t){t.request=void 0,t.config=void 0,t.response&&($c.getInstance().trace("Request%s - sanitizing response error data.",Ql.describeRequestFromResponse(t.response)),GHt(t.response))}function vEn(t,e={}){$c.getInstance().trace("Request%s - constructing options.",Ql.describeRequestFromOptions(t));let r=Dto(t.headers)||{},n=t.timeout||this._connectionConfig.getTimeout()||wto,i=t.data||t.json||t.body;if(i){let p=Buffer.from(JSON.stringify(i),"utf8");Rto.gzip(p,null,function(f,h){f?$c.getInstance().warn("Request%s - could not compress request data.",Ql.describeRequestFromOptions(t)):(i=h,r["Content-Encoding"]="gzip",$c.getInstance().debug("Request%s - original buffer length: %d bytes. Compressed buffer length: %d bytes.",Ql.describeRequestFromOptions(t),p.buffer.byteLength,h.buffer.byteLength))})}let s=t.params,o;this._connectionConfig.agentClass&&(o={agentClass:this._connectionConfig.agentClass});let a=this.constructExponentialBackoffStrategy(),c={method:t.method,url:t.url,headers:r,data:i,params:s,timeout:n,requestOCSP:!0,retryDelay:a,rejectUnauthorized:!0,responseType:t.responseType||"text",proxy:!1,...e},u=new Sto(t.url),l=u.protocol==="https:",A=this.getAgent(u,this._connectionConfig.getProxy(),o);return l?c.httpsAgent=A:c.httpAgent=A,$c.getInstance().debug("Request%s - options - timeout: %s, retryDelay: %s, responseType: %s",Ql.describeRequestFromOptions(t),c.timeout,c.retryDelay,c.responseType),c}function Dto(t){if($c.getInstance().trace("Normalizing headers"),o7.isObject(t)){let e={"user-agent":o7.userAgent},r;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r=n.toLowerCase(),r==="accept"||r==="content-type"?e[r]=t[n]:e[n]=t[n]);return $c.getInstance().trace("Headers were normalized"),e}else return $c.getInstance().trace("Headers were not an object. Original value will be returned."),t}function kje(t){return t&&!t.getResponseHeader&&($c.getInstance().trace("Request%s - normalizing.",Ql.describeRequestFromResponse(t)),t.getResponseHeader=function(e){return t.headers&&t.headers[o7.isString(e)?e.toLowerCase():e]}),t&&(t.body=t.data,t.statusCode=t.status),t}});var PEn=m((sZa,LEn)=>{var zEn=qw(),WHt=class{constructor(e){this.options=e||{},this.cache={},this.options.probe&&(this.probe=this.options.probe),this.options.store&&(this.store=this.options.store),this.options.filter&&(this.filter=this.options.filter)}filter(e,r){r(null)}probe(e,r){Object.prototype.hasOwnProperty.call(this.cache,e)?r(null,this.cache[e]):r(null,!1)}store(e,r,n,i){Object.prototype.hasOwnProperty.call(this.cache,e)&&clearTimeout(this.cache[e].timer),this.cache[e]={response:r,timer:setTimeout(()=>{delete this.cache[e]},n)},i(null,null)}request(e,r,n){function i(o,a){n&&n(o,a),n=null}let s=(o,a)=>{if(o)return i(o);i(null,a),this.getMaxStoreTime(a,(c,u)=>{c||this.store(e,a,u,()=>{})})};this.filter(r.url,function(o){if(o)return i(o,null);zEn.utils.getResponse(r.url,r.ocsp,s)})}getMaxStoreTime(e,r){let n;try{n=zEn.utils.parseResponse(e).value}catch(a){return r(a)}if(n.tbsResponseData.responses.length===0)return r(new Error("No OCSP responses"));let i=n.tbsResponseData.responses;if(!i.every(function(a){return a.certStatus.type==="good"}))return r(new Error("Some OCSP responses are not good"));let o=0;for(let a=0;a<i.length;a++){let u=i[a].nextUpdate;u&&(o===0||o>u)&&(o=u)}return r(null,Math.min(Math.max(0,o-new Date),2147483647))}clear(){Object.keys(this.cache).forEach(r=>{clearTimeout(this.cache[r].timer),delete this.cache[r]})}};LEn.exports=WHt});var jHt=m((kEn,HHt)=>{(function(t,e){"use strict";function r(X,_){if(!X)throw new Error(_||"Assertion failed")}function n(X,_){X.super_=_;var L=function(){};L.prototype=_.prototype,X.prototype=new L,X.prototype.constructor=X}function i(X,_,L){if(i.isBN(X))return X;this.negative=0,this.words=null,this.length=0,this.red=null,X!==null&&((_==="le"||_==="be")&&(L=_,_=10),this._init(X||0,_||10,L||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(_){return _ instanceof i?!0:_!==null&&typeof _=="object"&&_.constructor.wordSize===i.wordSize&&Array.isArray(_.words)},i.max=function(_,L){return _.cmp(L)>0?_:L},i.min=function(_,L){return _.cmp(L)<0?_:L},i.prototype._init=function(_,L,Q){if(typeof _=="number")return this._initNumber(_,L,Q);if(typeof _=="object")return this._initArray(_,L,Q);L==="hex"&&(L=16),r(L===(L|0)&&L>=2&&L<=36),_=_.toString().replace(/\s+/g,"");var I=0;_[0]==="-"&&(I++,this.negative=1),I<_.length&&(L===16?this._parseHex(_,I,Q):(this._parseBase(_,L,I),Q==="le"&&this._initArray(this.toArray(),L,Q)))},i.prototype._initNumber=function(_,L,Q){_<0&&(this.negative=1,_=-_),_<67108864?(this.words=[_&67108863],this.length=1):_<4503599627370496?(this.words=[_&67108863,_/67108864&67108863],this.length=2):(r(_<9007199254740992),this.words=[_&67108863,_/67108864&67108863,1],this.length=3),Q==="le"&&this._initArray(this.toArray(),L,Q)},i.prototype._initArray=function(_,L,Q){if(r(typeof _.length=="number"),_.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(_.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N,T,U=0;if(Q==="be")for(I=_.length-1,N=0;I>=0;I-=3)T=_[I]|_[I-1]<<8|_[I-2]<<16,this.words[N]|=T<<U&67108863,this.words[N+1]=T>>>26-U&67108863,U+=24,U>=26&&(U-=26,N++);else if(Q==="le")for(I=0,N=0;I<_.length;I+=3)T=_[I]|_[I+1]<<8|_[I+2]<<16,this.words[N]|=T<<U&67108863,this.words[N+1]=T>>>26-U&67108863,U+=24,U>=26&&(U-=26,N++);return this.strip()};function o(X,_){var L=X.charCodeAt(_);return L>=65&&L<=70?L-55:L>=97&&L<=102?L-87:L-48&15}function a(X,_,L){var Q=o(X,L);return L-1>=_&&(Q|=o(X,L-1)<<4),Q}i.prototype._parseHex=function(_,L,Q){this.length=Math.ceil((_.length-L)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N=0,T=0,U;if(Q==="be")for(I=_.length-1;I>=L;I-=2)U=a(_,L,I)<<N,this.words[T]|=U&67108863,N>=18?(N-=18,T+=1,this.words[T]|=U>>>26):N+=8;else{var q=_.length-L;for(I=q%2===0?L+1:L;I<_.length;I+=2)U=a(_,L,I)<<N,this.words[T]|=U&67108863,N>=18?(N-=18,T+=1,this.words[T]|=U>>>26):N+=8}this.strip()};function c(X,_,L,Q){for(var I=0,N=Math.min(X.length,L),T=_;T<N;T++){var U=X.charCodeAt(T)-48;I*=Q,U>=49?I+=U-49+10:U>=17?I+=U-17+10:I+=U}return I}i.prototype._parseBase=function(_,L,Q){this.words=[0],this.length=1;for(var I=0,N=1;N<=67108863;N*=L)I++;I--,N=N/L|0;for(var T=_.length-Q,U=T%I,q=Math.min(T,T-U)+Q,D=0,v=Q;v<q;v+=I)D=c(_,v,v+I,L),this.imuln(N),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(U!==0){var k=1;for(D=c(_,v,_.length,L),v=0;v<U;v++)k*=L;this.imuln(k),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this.strip()},i.prototype.copy=function(_){_.words=new Array(this.length);for(var L=0;L<this.length;L++)_.words[L]=this.words[L];_.length=this.length,_.negative=this.negative,_.red=this.red},i.prototype.clone=function(){var _=new i(null);return this.copy(_),_},i.prototype._expand=function(_){for(;this.length<_;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(_,L){_=_||10,L=L|0||1;var Q;if(_===16||_==="hex"){Q="";for(var I=0,N=0,T=0;T<this.length;T++){var U=this.words[T],q=((U<<I|N)&16777215).toString(16);N=U>>>24-I&16777215,I+=2,I>=26&&(I-=26,T--),N!==0||T!==this.length-1?Q=u[6-q.length]+q+Q:Q=q+Q}for(N!==0&&(Q=N.toString(16)+Q);Q.length%L!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(_===(_|0)&&_>=2&&_<=36){var D=l[_],v=A[_];Q="";var k=this.clone();for(k.negative=0;!k.isZero();){var G=k.modn(v).toString(_);k=k.idivn(v),k.isZero()?Q=G+Q:Q=u[D-G.length]+G+Q}for(this.isZero()&&(Q="0"+Q);Q.length%L!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var _=this.words[0];return this.length===2?_+=this.words[1]*67108864:this.length===3&&this.words[2]===1?_+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-_:_},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(_,L){return r(typeof s<"u"),this.toArrayLike(s,_,L)},i.prototype.toArray=function(_,L){return this.toArrayLike(Array,_,L)},i.prototype.toArrayLike=function(_,L,Q){var I=this.byteLength(),N=Q||Math.max(1,I);r(I<=N,"byte array longer than desired length"),r(N>0,"Requested array length <= 0"),this.strip();var T=L==="le",U=new _(N),q,D,v=this.clone();if(T){for(D=0;!v.isZero();D++)q=v.andln(255),v.iushrn(8),U[D]=q;for(;D<N;D++)U[D]=0}else{for(D=0;D<N-I;D++)U[D]=0;for(D=0;!v.isZero();D++)q=v.andln(255),v.iushrn(8),U[N-D-1]=q}return U},Math.clz32?i.prototype._countBits=function(_){return 32-Math.clz32(_)}:i.prototype._countBits=function(_){var L=_,Q=0;return L>=4096&&(Q+=13,L>>>=13),L>=64&&(Q+=7,L>>>=7),L>=8&&(Q+=4,L>>>=4),L>=2&&(Q+=2,L>>>=2),Q+L},i.prototype._zeroBits=function(_){if(_===0)return 26;var L=_,Q=0;return(L&8191)===0&&(Q+=13,L>>>=13),(L&127)===0&&(Q+=7,L>>>=7),(L&15)===0&&(Q+=4,L>>>=4),(L&3)===0&&(Q+=2,L>>>=2),(L&1)===0&&Q++,Q},i.prototype.bitLength=function(){var _=this.words[this.length-1],L=this._countBits(_);return(this.length-1)*26+L};function p(X){for(var _=new Array(X.bitLength()),L=0;L<_.length;L++){var Q=L/26|0,I=L%26;_[L]=(X.words[Q]&1<<I)>>>I}return _}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var _=0,L=0;L<this.length;L++){var Q=this._zeroBits(this.words[L]);if(_+=Q,Q!==26)break}return _},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(_){return this.negative!==0?this.abs().inotn(_).iaddn(1):this.clone()},i.prototype.fromTwos=function(_){return this.testn(_-1)?this.notn(_).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(_){for(;this.length<_.length;)this.words[this.length++]=0;for(var L=0;L<_.length;L++)this.words[L]=this.words[L]|_.words[L];return this.strip()},i.prototype.ior=function(_){return r((this.negative|_.negative)===0),this.iuor(_)},i.prototype.or=function(_){return this.length>_.length?this.clone().ior(_):_.clone().ior(this)},i.prototype.uor=function(_){return this.length>_.length?this.clone().iuor(_):_.clone().iuor(this)},i.prototype.iuand=function(_){var L;this.length>_.length?L=_:L=this;for(var Q=0;Q<L.length;Q++)this.words[Q]=this.words[Q]&_.words[Q];return this.length=L.length,this.strip()},i.prototype.iand=function(_){return r((this.negative|_.negative)===0),this.iuand(_)},i.prototype.and=function(_){return this.length>_.length?this.clone().iand(_):_.clone().iand(this)},i.prototype.uand=function(_){return this.length>_.length?this.clone().iuand(_):_.clone().iuand(this)},i.prototype.iuxor=function(_){var L,Q;this.length>_.length?(L=this,Q=_):(L=_,Q=this);for(var I=0;I<Q.length;I++)this.words[I]=L.words[I]^Q.words[I];if(this!==L)for(;I<L.length;I++)this.words[I]=L.words[I];return this.length=L.length,this.strip()},i.prototype.ixor=function(_){return r((this.negative|_.negative)===0),this.iuxor(_)},i.prototype.xor=function(_){return this.length>_.length?this.clone().ixor(_):_.clone().ixor(this)},i.prototype.uxor=function(_){return this.length>_.length?this.clone().iuxor(_):_.clone().iuxor(this)},i.prototype.inotn=function(_){r(typeof _=="number"&&_>=0);var L=Math.ceil(_/26)|0,Q=_%26;this._expand(L),Q>0&&L--;for(var I=0;I<L;I++)this.words[I]=~this.words[I]&67108863;return Q>0&&(this.words[I]=~this.words[I]&67108863>>26-Q),this.strip()},i.prototype.notn=function(_){return this.clone().inotn(_)},i.prototype.setn=function(_,L){r(typeof _=="number"&&_>=0);var Q=_/26|0,I=_%26;return this._expand(Q+1),L?this.words[Q]=this.words[Q]|1<<I:this.words[Q]=this.words[Q]&~(1<<I),this.strip()},i.prototype.iadd=function(_){var L;if(this.negative!==0&&_.negative===0)return this.negative=0,L=this.isub(_),this.negative^=1,this._normSign();if(this.negative===0&&_.negative!==0)return _.negative=0,L=this.isub(_),_.negative=1,L._normSign();var Q,I;this.length>_.length?(Q=this,I=_):(Q=_,I=this);for(var N=0,T=0;T<I.length;T++)L=(Q.words[T]|0)+(I.words[T]|0)+N,this.words[T]=L&67108863,N=L>>>26;for(;N!==0&&T<Q.length;T++)L=(Q.words[T]|0)+N,this.words[T]=L&67108863,N=L>>>26;if(this.length=Q.length,N!==0)this.words[this.length]=N,this.length++;else if(Q!==this)for(;T<Q.length;T++)this.words[T]=Q.words[T];return this},i.prototype.add=function(_){var L;return _.negative!==0&&this.negative===0?(_.negative=0,L=this.sub(_),_.negative^=1,L):_.negative===0&&this.negative!==0?(this.negative=0,L=_.sub(this),this.negative=1,L):this.length>_.length?this.clone().iadd(_):_.clone().iadd(this)},i.prototype.isub=function(_){if(_.negative!==0){_.negative=0;var L=this.iadd(_);return _.negative=1,L._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(_),this.negative=1,this._normSign();var Q=this.cmp(_);if(Q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,N;Q>0?(I=this,N=_):(I=_,N=this);for(var T=0,U=0;U<N.length;U++)L=(I.words[U]|0)-(N.words[U]|0)+T,T=L>>26,this.words[U]=L&67108863;for(;T!==0&&U<I.length;U++)L=(I.words[U]|0)+T,T=L>>26,this.words[U]=L&67108863;if(T===0&&U<I.length&&I!==this)for(;U<I.length;U++)this.words[U]=I.words[U];return this.length=Math.max(this.length,U),I!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(_){return this.clone().isub(_)};function f(X,_,L){L.negative=_.negative^X.negative;var Q=X.length+_.length|0;L.length=Q,Q=Q-1|0;var I=X.words[0]|0,N=_.words[0]|0,T=I*N,U=T&67108863,q=T/67108864|0;L.words[0]=U;for(var D=1;D<Q;D++){for(var v=q>>>26,k=q&67108863,G=Math.min(D,_.length-1),J=Math.max(0,D-X.length+1);J<=G;J++){var Qe=D-J|0;I=X.words[Qe]|0,N=_.words[J]|0,T=I*N+k,v+=T/67108864|0,k=T&67108863}L.words[D]=k|0,q=v|0}return q!==0?L.words[D]=q|0:L.length--,L.strip()}var h=function(_,L,Q){var I=_.words,N=L.words,T=Q.words,U=0,q,D,v,k=I[0]|0,G=k&8191,J=k>>>13,Qe=I[1]|0,Re=Qe&8191,$e=Qe>>>13,Bt=I[2]|0,Pt=Bt&8191,ge=Bt>>>13,Ve=I[3]|0,Ke=Ve&8191,Me=Ve>>>13,ke=I[4]|0,Fe=ke&8191,rt=ke>>>13,ct=I[5]|0,at=ct&8191,gt=ct>>>13,mt=I[6]|0,Ye=mt&8191,jt=mt>>>13,Ar=I[7]|0,yr=Ar&8191,le=Ar>>>13,Se=I[8]|0,ve=Se&8191,nt=Se>>>13,de=I[9]|0,K=de&8191,ae=de>>>13,Oe=N[0]|0,ze=Oe&8191,_e=Oe>>>13,bt=N[1]|0,vt=bt&8191,kt=bt>>>13,It=N[2]|0,it=It&8191,Ft=It>>>13,De=N[3]|0,we=De&8191,ot=De>>>13,xt=N[4]|0,H=xt&8191,fe=xt>>>13,Ie=N[5]|0,Be=Ie&8191,Le=Ie>>>13,er=N[6]|0,te=er&8191,Y=er>>>13,ie=N[7]|0,xe=ie&8191,qe=ie>>>13,Je=N[8]|0,wt=Je&8191,lt=Je>>>13,Wt=N[9]|0,zt=Wt&8191,sr=Wt>>>13;Q.negative=_.negative^L.negative,Q.length=19,q=Math.imul(G,ze),D=Math.imul(G,_e),D=D+Math.imul(J,ze)|0,v=Math.imul(J,_e);var tn=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(tn>>>26)|0,tn&=67108863,q=Math.imul(Re,ze),D=Math.imul(Re,_e),D=D+Math.imul($e,ze)|0,v=Math.imul($e,_e),q=q+Math.imul(G,vt)|0,D=D+Math.imul(G,kt)|0,D=D+Math.imul(J,vt)|0,v=v+Math.imul(J,kt)|0;var pe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(pe>>>26)|0,pe&=67108863,q=Math.imul(Pt,ze),D=Math.imul(Pt,_e),D=D+Math.imul(ge,ze)|0,v=Math.imul(ge,_e),q=q+Math.imul(Re,vt)|0,D=D+Math.imul(Re,kt)|0,D=D+Math.imul($e,vt)|0,v=v+Math.imul($e,kt)|0,q=q+Math.imul(G,it)|0,D=D+Math.imul(G,Ft)|0,D=D+Math.imul(J,it)|0,v=v+Math.imul(J,Ft)|0;var j=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(j>>>26)|0,j&=67108863,q=Math.imul(Ke,ze),D=Math.imul(Ke,_e),D=D+Math.imul(Me,ze)|0,v=Math.imul(Me,_e),q=q+Math.imul(Pt,vt)|0,D=D+Math.imul(Pt,kt)|0,D=D+Math.imul(ge,vt)|0,v=v+Math.imul(ge,kt)|0,q=q+Math.imul(Re,it)|0,D=D+Math.imul(Re,Ft)|0,D=D+Math.imul($e,it)|0,v=v+Math.imul($e,Ft)|0,q=q+Math.imul(G,we)|0,D=D+Math.imul(G,ot)|0,D=D+Math.imul(J,we)|0,v=v+Math.imul(J,ot)|0;var se=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(se>>>26)|0,se&=67108863,q=Math.imul(Fe,ze),D=Math.imul(Fe,_e),D=D+Math.imul(rt,ze)|0,v=Math.imul(rt,_e),q=q+Math.imul(Ke,vt)|0,D=D+Math.imul(Ke,kt)|0,D=D+Math.imul(Me,vt)|0,v=v+Math.imul(Me,kt)|0,q=q+Math.imul(Pt,it)|0,D=D+Math.imul(Pt,Ft)|0,D=D+Math.imul(ge,it)|0,v=v+Math.imul(ge,Ft)|0,q=q+Math.imul(Re,we)|0,D=D+Math.imul(Re,ot)|0,D=D+Math.imul($e,we)|0,v=v+Math.imul($e,ot)|0,q=q+Math.imul(G,H)|0,D=D+Math.imul(G,fe)|0,D=D+Math.imul(J,H)|0,v=v+Math.imul(J,fe)|0;var Ne=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,q=Math.imul(at,ze),D=Math.imul(at,_e),D=D+Math.imul(gt,ze)|0,v=Math.imul(gt,_e),q=q+Math.imul(Fe,vt)|0,D=D+Math.imul(Fe,kt)|0,D=D+Math.imul(rt,vt)|0,v=v+Math.imul(rt,kt)|0,q=q+Math.imul(Ke,it)|0,D=D+Math.imul(Ke,Ft)|0,D=D+Math.imul(Me,it)|0,v=v+Math.imul(Me,Ft)|0,q=q+Math.imul(Pt,we)|0,D=D+Math.imul(Pt,ot)|0,D=D+Math.imul(ge,we)|0,v=v+Math.imul(ge,ot)|0,q=q+Math.imul(Re,H)|0,D=D+Math.imul(Re,fe)|0,D=D+Math.imul($e,H)|0,v=v+Math.imul($e,fe)|0,q=q+Math.imul(G,Be)|0,D=D+Math.imul(G,Le)|0,D=D+Math.imul(J,Be)|0,v=v+Math.imul(J,Le)|0;var Pe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,q=Math.imul(Ye,ze),D=Math.imul(Ye,_e),D=D+Math.imul(jt,ze)|0,v=Math.imul(jt,_e),q=q+Math.imul(at,vt)|0,D=D+Math.imul(at,kt)|0,D=D+Math.imul(gt,vt)|0,v=v+Math.imul(gt,kt)|0,q=q+Math.imul(Fe,it)|0,D=D+Math.imul(Fe,Ft)|0,D=D+Math.imul(rt,it)|0,v=v+Math.imul(rt,Ft)|0,q=q+Math.imul(Ke,we)|0,D=D+Math.imul(Ke,ot)|0,D=D+Math.imul(Me,we)|0,v=v+Math.imul(Me,ot)|0,q=q+Math.imul(Pt,H)|0,D=D+Math.imul(Pt,fe)|0,D=D+Math.imul(ge,H)|0,v=v+Math.imul(ge,fe)|0,q=q+Math.imul(Re,Be)|0,D=D+Math.imul(Re,Le)|0,D=D+Math.imul($e,Be)|0,v=v+Math.imul($e,Le)|0,q=q+Math.imul(G,te)|0,D=D+Math.imul(G,Y)|0,D=D+Math.imul(J,te)|0,v=v+Math.imul(J,Y)|0;var tt=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(tt>>>26)|0,tt&=67108863,q=Math.imul(yr,ze),D=Math.imul(yr,_e),D=D+Math.imul(le,ze)|0,v=Math.imul(le,_e),q=q+Math.imul(Ye,vt)|0,D=D+Math.imul(Ye,kt)|0,D=D+Math.imul(jt,vt)|0,v=v+Math.imul(jt,kt)|0,q=q+Math.imul(at,it)|0,D=D+Math.imul(at,Ft)|0,D=D+Math.imul(gt,it)|0,v=v+Math.imul(gt,Ft)|0,q=q+Math.imul(Fe,we)|0,D=D+Math.imul(Fe,ot)|0,D=D+Math.imul(rt,we)|0,v=v+Math.imul(rt,ot)|0,q=q+Math.imul(Ke,H)|0,D=D+Math.imul(Ke,fe)|0,D=D+Math.imul(Me,H)|0,v=v+Math.imul(Me,fe)|0,q=q+Math.imul(Pt,Be)|0,D=D+Math.imul(Pt,Le)|0,D=D+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Le)|0,q=q+Math.imul(Re,te)|0,D=D+Math.imul(Re,Y)|0,D=D+Math.imul($e,te)|0,v=v+Math.imul($e,Y)|0,q=q+Math.imul(G,xe)|0,D=D+Math.imul(G,qe)|0,D=D+Math.imul(J,xe)|0,v=v+Math.imul(J,qe)|0;var Ht=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,q=Math.imul(ve,ze),D=Math.imul(ve,_e),D=D+Math.imul(nt,ze)|0,v=Math.imul(nt,_e),q=q+Math.imul(yr,vt)|0,D=D+Math.imul(yr,kt)|0,D=D+Math.imul(le,vt)|0,v=v+Math.imul(le,kt)|0,q=q+Math.imul(Ye,it)|0,D=D+Math.imul(Ye,Ft)|0,D=D+Math.imul(jt,it)|0,v=v+Math.imul(jt,Ft)|0,q=q+Math.imul(at,we)|0,D=D+Math.imul(at,ot)|0,D=D+Math.imul(gt,we)|0,v=v+Math.imul(gt,ot)|0,q=q+Math.imul(Fe,H)|0,D=D+Math.imul(Fe,fe)|0,D=D+Math.imul(rt,H)|0,v=v+Math.imul(rt,fe)|0,q=q+Math.imul(Ke,Be)|0,D=D+Math.imul(Ke,Le)|0,D=D+Math.imul(Me,Be)|0,v=v+Math.imul(Me,Le)|0,q=q+Math.imul(Pt,te)|0,D=D+Math.imul(Pt,Y)|0,D=D+Math.imul(ge,te)|0,v=v+Math.imul(ge,Y)|0,q=q+Math.imul(Re,xe)|0,D=D+Math.imul(Re,qe)|0,D=D+Math.imul($e,xe)|0,v=v+Math.imul($e,qe)|0,q=q+Math.imul(G,wt)|0,D=D+Math.imul(G,lt)|0,D=D+Math.imul(J,wt)|0,v=v+Math.imul(J,lt)|0;var Et=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Et>>>26)|0,Et&=67108863,q=Math.imul(K,ze),D=Math.imul(K,_e),D=D+Math.imul(ae,ze)|0,v=Math.imul(ae,_e),q=q+Math.imul(ve,vt)|0,D=D+Math.imul(ve,kt)|0,D=D+Math.imul(nt,vt)|0,v=v+Math.imul(nt,kt)|0,q=q+Math.imul(yr,it)|0,D=D+Math.imul(yr,Ft)|0,D=D+Math.imul(le,it)|0,v=v+Math.imul(le,Ft)|0,q=q+Math.imul(Ye,we)|0,D=D+Math.imul(Ye,ot)|0,D=D+Math.imul(jt,we)|0,v=v+Math.imul(jt,ot)|0,q=q+Math.imul(at,H)|0,D=D+Math.imul(at,fe)|0,D=D+Math.imul(gt,H)|0,v=v+Math.imul(gt,fe)|0,q=q+Math.imul(Fe,Be)|0,D=D+Math.imul(Fe,Le)|0,D=D+Math.imul(rt,Be)|0,v=v+Math.imul(rt,Le)|0,q=q+Math.imul(Ke,te)|0,D=D+Math.imul(Ke,Y)|0,D=D+Math.imul(Me,te)|0,v=v+Math.imul(Me,Y)|0,q=q+Math.imul(Pt,xe)|0,D=D+Math.imul(Pt,qe)|0,D=D+Math.imul(ge,xe)|0,v=v+Math.imul(ge,qe)|0,q=q+Math.imul(Re,wt)|0,D=D+Math.imul(Re,lt)|0,D=D+Math.imul($e,wt)|0,v=v+Math.imul($e,lt)|0,q=q+Math.imul(G,zt)|0,D=D+Math.imul(G,sr)|0,D=D+Math.imul(J,zt)|0,v=v+Math.imul(J,sr)|0;var We=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(We>>>26)|0,We&=67108863,q=Math.imul(K,vt),D=Math.imul(K,kt),D=D+Math.imul(ae,vt)|0,v=Math.imul(ae,kt),q=q+Math.imul(ve,it)|0,D=D+Math.imul(ve,Ft)|0,D=D+Math.imul(nt,it)|0,v=v+Math.imul(nt,Ft)|0,q=q+Math.imul(yr,we)|0,D=D+Math.imul(yr,ot)|0,D=D+Math.imul(le,we)|0,v=v+Math.imul(le,ot)|0,q=q+Math.imul(Ye,H)|0,D=D+Math.imul(Ye,fe)|0,D=D+Math.imul(jt,H)|0,v=v+Math.imul(jt,fe)|0,q=q+Math.imul(at,Be)|0,D=D+Math.imul(at,Le)|0,D=D+Math.imul(gt,Be)|0,v=v+Math.imul(gt,Le)|0,q=q+Math.imul(Fe,te)|0,D=D+Math.imul(Fe,Y)|0,D=D+Math.imul(rt,te)|0,v=v+Math.imul(rt,Y)|0,q=q+Math.imul(Ke,xe)|0,D=D+Math.imul(Ke,qe)|0,D=D+Math.imul(Me,xe)|0,v=v+Math.imul(Me,qe)|0,q=q+Math.imul(Pt,wt)|0,D=D+Math.imul(Pt,lt)|0,D=D+Math.imul(ge,wt)|0,v=v+Math.imul(ge,lt)|0,q=q+Math.imul(Re,zt)|0,D=D+Math.imul(Re,sr)|0,D=D+Math.imul($e,zt)|0,v=v+Math.imul($e,sr)|0;var Xe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,q=Math.imul(K,it),D=Math.imul(K,Ft),D=D+Math.imul(ae,it)|0,v=Math.imul(ae,Ft),q=q+Math.imul(ve,we)|0,D=D+Math.imul(ve,ot)|0,D=D+Math.imul(nt,we)|0,v=v+Math.imul(nt,ot)|0,q=q+Math.imul(yr,H)|0,D=D+Math.imul(yr,fe)|0,D=D+Math.imul(le,H)|0,v=v+Math.imul(le,fe)|0,q=q+Math.imul(Ye,Be)|0,D=D+Math.imul(Ye,Le)|0,D=D+Math.imul(jt,Be)|0,v=v+Math.imul(jt,Le)|0,q=q+Math.imul(at,te)|0,D=D+Math.imul(at,Y)|0,D=D+Math.imul(gt,te)|0,v=v+Math.imul(gt,Y)|0,q=q+Math.imul(Fe,xe)|0,D=D+Math.imul(Fe,qe)|0,D=D+Math.imul(rt,xe)|0,v=v+Math.imul(rt,qe)|0,q=q+Math.imul(Ke,wt)|0,D=D+Math.imul(Ke,lt)|0,D=D+Math.imul(Me,wt)|0,v=v+Math.imul(Me,lt)|0,q=q+Math.imul(Pt,zt)|0,D=D+Math.imul(Pt,sr)|0,D=D+Math.imul(ge,zt)|0,v=v+Math.imul(ge,sr)|0;var Ct=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,q=Math.imul(K,we),D=Math.imul(K,ot),D=D+Math.imul(ae,we)|0,v=Math.imul(ae,ot),q=q+Math.imul(ve,H)|0,D=D+Math.imul(ve,fe)|0,D=D+Math.imul(nt,H)|0,v=v+Math.imul(nt,fe)|0,q=q+Math.imul(yr,Be)|0,D=D+Math.imul(yr,Le)|0,D=D+Math.imul(le,Be)|0,v=v+Math.imul(le,Le)|0,q=q+Math.imul(Ye,te)|0,D=D+Math.imul(Ye,Y)|0,D=D+Math.imul(jt,te)|0,v=v+Math.imul(jt,Y)|0,q=q+Math.imul(at,xe)|0,D=D+Math.imul(at,qe)|0,D=D+Math.imul(gt,xe)|0,v=v+Math.imul(gt,qe)|0,q=q+Math.imul(Fe,wt)|0,D=D+Math.imul(Fe,lt)|0,D=D+Math.imul(rt,wt)|0,v=v+Math.imul(rt,lt)|0,q=q+Math.imul(Ke,zt)|0,D=D+Math.imul(Ke,sr)|0,D=D+Math.imul(Me,zt)|0,v=v+Math.imul(Me,sr)|0;var Gt=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,q=Math.imul(K,H),D=Math.imul(K,fe),D=D+Math.imul(ae,H)|0,v=Math.imul(ae,fe),q=q+Math.imul(ve,Be)|0,D=D+Math.imul(ve,Le)|0,D=D+Math.imul(nt,Be)|0,v=v+Math.imul(nt,Le)|0,q=q+Math.imul(yr,te)|0,D=D+Math.imul(yr,Y)|0,D=D+Math.imul(le,te)|0,v=v+Math.imul(le,Y)|0,q=q+Math.imul(Ye,xe)|0,D=D+Math.imul(Ye,qe)|0,D=D+Math.imul(jt,xe)|0,v=v+Math.imul(jt,qe)|0,q=q+Math.imul(at,wt)|0,D=D+Math.imul(at,lt)|0,D=D+Math.imul(gt,wt)|0,v=v+Math.imul(gt,lt)|0,q=q+Math.imul(Fe,zt)|0,D=D+Math.imul(Fe,sr)|0,D=D+Math.imul(rt,zt)|0,v=v+Math.imul(rt,sr)|0;var Mr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,q=Math.imul(K,Be),D=Math.imul(K,Le),D=D+Math.imul(ae,Be)|0,v=Math.imul(ae,Le),q=q+Math.imul(ve,te)|0,D=D+Math.imul(ve,Y)|0,D=D+Math.imul(nt,te)|0,v=v+Math.imul(nt,Y)|0,q=q+Math.imul(yr,xe)|0,D=D+Math.imul(yr,qe)|0,D=D+Math.imul(le,xe)|0,v=v+Math.imul(le,qe)|0,q=q+Math.imul(Ye,wt)|0,D=D+Math.imul(Ye,lt)|0,D=D+Math.imul(jt,wt)|0,v=v+Math.imul(jt,lt)|0,q=q+Math.imul(at,zt)|0,D=D+Math.imul(at,sr)|0,D=D+Math.imul(gt,zt)|0,v=v+Math.imul(gt,sr)|0;var ir=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(ir>>>26)|0,ir&=67108863,q=Math.imul(K,te),D=Math.imul(K,Y),D=D+Math.imul(ae,te)|0,v=Math.imul(ae,Y),q=q+Math.imul(ve,xe)|0,D=D+Math.imul(ve,qe)|0,D=D+Math.imul(nt,xe)|0,v=v+Math.imul(nt,qe)|0,q=q+Math.imul(yr,wt)|0,D=D+Math.imul(yr,lt)|0,D=D+Math.imul(le,wt)|0,v=v+Math.imul(le,lt)|0,q=q+Math.imul(Ye,zt)|0,D=D+Math.imul(Ye,sr)|0,D=D+Math.imul(jt,zt)|0,v=v+Math.imul(jt,sr)|0;var Cr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,q=Math.imul(K,xe),D=Math.imul(K,qe),D=D+Math.imul(ae,xe)|0,v=Math.imul(ae,qe),q=q+Math.imul(ve,wt)|0,D=D+Math.imul(ve,lt)|0,D=D+Math.imul(nt,wt)|0,v=v+Math.imul(nt,lt)|0,q=q+Math.imul(yr,zt)|0,D=D+Math.imul(yr,sr)|0,D=D+Math.imul(le,zt)|0,v=v+Math.imul(le,sr)|0;var kr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(kr>>>26)|0,kr&=67108863,q=Math.imul(K,wt),D=Math.imul(K,lt),D=D+Math.imul(ae,wt)|0,v=Math.imul(ae,lt),q=q+Math.imul(ve,zt)|0,D=D+Math.imul(ve,sr)|0,D=D+Math.imul(nt,zt)|0,v=v+Math.imul(nt,sr)|0;var qn=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(qn>>>26)|0,qn&=67108863,q=Math.imul(K,zt),D=Math.imul(K,sr),D=D+Math.imul(ae,zt)|0,v=Math.imul(ae,sr);var Li=(U+q|0)+((D&8191)<<13)|0;return U=(v+(D>>>13)|0)+(Li>>>26)|0,Li&=67108863,T[0]=tn,T[1]=pe,T[2]=j,T[3]=se,T[4]=Ne,T[5]=Pe,T[6]=tt,T[7]=Ht,T[8]=Et,T[9]=We,T[10]=Xe,T[11]=Ct,T[12]=Gt,T[13]=Mr,T[14]=ir,T[15]=Cr,T[16]=kr,T[17]=qn,T[18]=Li,U!==0&&(T[19]=U,Q.length++),Q};Math.imul||(h=f);function g(X,_,L){L.negative=_.negative^X.negative,L.length=X.length+_.length;for(var Q=0,I=0,N=0;N<L.length-1;N++){var T=I;I=0;for(var U=Q&67108863,q=Math.min(N,_.length-1),D=Math.max(0,N-X.length+1);D<=q;D++){var v=N-D,k=X.words[v]|0,G=_.words[D]|0,J=k*G,Qe=J&67108863;T=T+(J/67108864|0)|0,Qe=Qe+U|0,U=Qe&67108863,T=T+(Qe>>>26)|0,I+=T>>>26,T&=67108863}L.words[N]=U,Q=T,T=I}return Q!==0?L.words[N]=Q:L.length--,L.strip()}function E(X,_,L){var Q=new C;return Q.mulp(X,_,L)}i.prototype.mulTo=function(_,L){var Q,I=this.length+_.length;return this.length===10&&_.length===10?Q=h(this,_,L):I<63?Q=f(this,_,L):I<1024?Q=g(this,_,L):Q=E(this,_,L),Q};function C(X,_){this.x=X,this.y=_}C.prototype.makeRBT=function(_){for(var L=new Array(_),Q=i.prototype._countBits(_)-1,I=0;I<_;I++)L[I]=this.revBin(I,Q,_);return L},C.prototype.revBin=function(_,L,Q){if(_===0||_===Q-1)return _;for(var I=0,N=0;N<L;N++)I|=(_&1)<<L-N-1,_>>=1;return I},C.prototype.permute=function(_,L,Q,I,N,T){for(var U=0;U<T;U++)I[U]=L[_[U]],N[U]=Q[_[U]]},C.prototype.transform=function(_,L,Q,I,N,T){this.permute(T,_,L,Q,I,N);for(var U=1;U<N;U<<=1)for(var q=U<<1,D=Math.cos(2*Math.PI/q),v=Math.sin(2*Math.PI/q),k=0;k<N;k+=q)for(var G=D,J=v,Qe=0;Qe<U;Qe++){var Re=Q[k+Qe],$e=I[k+Qe],Bt=Q[k+Qe+U],Pt=I[k+Qe+U],ge=G*Bt-J*Pt;Pt=G*Pt+J*Bt,Bt=ge,Q[k+Qe]=Re+Bt,I[k+Qe]=$e+Pt,Q[k+Qe+U]=Re-Bt,I[k+Qe+U]=$e-Pt,Qe!==q&&(ge=D*G-v*J,J=D*J+v*G,G=ge)}},C.prototype.guessLen13b=function(_,L){var Q=Math.max(L,_)|1,I=Q&1,N=0;for(Q=Q/2|0;Q;Q=Q>>>1)N++;return 1<<N+1+I},C.prototype.conjugate=function(_,L,Q){if(!(Q<=1))for(var I=0;I<Q/2;I++){var N=_[I];_[I]=_[Q-I-1],_[Q-I-1]=N,N=L[I],L[I]=-L[Q-I-1],L[Q-I-1]=-N}},C.prototype.normalize13b=function(_,L){for(var Q=0,I=0;I<L/2;I++){var N=Math.round(_[2*I+1]/L)*8192+Math.round(_[2*I]/L)+Q;_[I]=N&67108863,N<67108864?Q=0:Q=N/67108864|0}return _},C.prototype.convert13b=function(_,L,Q,I){for(var N=0,T=0;T<L;T++)N=N+(_[T]|0),Q[2*T]=N&8191,N=N>>>13,Q[2*T+1]=N&8191,N=N>>>13;for(T=2*L;T<I;++T)Q[T]=0;r(N===0),r((N&-8192)===0)},C.prototype.stub=function(_){for(var L=new Array(_),Q=0;Q<_;Q++)L[Q]=0;return L},C.prototype.mulp=function(_,L,Q){var I=2*this.guessLen13b(_.length,L.length),N=this.makeRBT(I),T=this.stub(I),U=new Array(I),q=new Array(I),D=new Array(I),v=new Array(I),k=new Array(I),G=new Array(I),J=Q.words;J.length=I,this.convert13b(_.words,_.length,U,I),this.convert13b(L.words,L.length,v,I),this.transform(U,T,q,D,I,N),this.transform(v,T,k,G,I,N);for(var Qe=0;Qe<I;Qe++){var Re=q[Qe]*k[Qe]-D[Qe]*G[Qe];D[Qe]=q[Qe]*G[Qe]+D[Qe]*k[Qe],q[Qe]=Re}return this.conjugate(q,D,I),this.transform(q,D,J,T,I,N),this.conjugate(J,T,I),this.normalize13b(J,I),Q.negative=_.negative^L.negative,Q.length=_.length+L.length,Q.strip()},i.prototype.mul=function(_){var L=new i(null);return L.words=new Array(this.length+_.length),this.mulTo(_,L)},i.prototype.mulf=function(_){var L=new i(null);return L.words=new Array(this.length+_.length),E(this,_,L)},i.prototype.imul=function(_){return this.clone().mulTo(_,this)},i.prototype.imuln=function(_){r(typeof _=="number"),r(_<67108864);for(var L=0,Q=0;Q<this.length;Q++){var I=(this.words[Q]|0)*_,N=(I&67108863)+(L&67108863);L>>=26,L+=I/67108864|0,L+=N>>>26,this.words[Q]=N&67108863}return L!==0&&(this.words[Q]=L,this.length++),this.length=_===0?1:this.length,this},i.prototype.muln=function(_){return this.clone().imuln(_)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(_){var L=p(_);if(L.length===0)return new i(1);for(var Q=this,I=0;I<L.length&&L[I]===0;I++,Q=Q.sqr());if(++I<L.length)for(var N=Q.sqr();I<L.length;I++,N=N.sqr())L[I]!==0&&(Q=Q.mul(N));return Q},i.prototype.iushln=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26,I=67108863>>>26-L<<26-L,N;if(L!==0){var T=0;for(N=0;N<this.length;N++){var U=this.words[N]&I,q=(this.words[N]|0)-U<<L;this.words[N]=q|T,T=U>>>26-L}T&&(this.words[N]=T,this.length++)}if(Q!==0){for(N=this.length-1;N>=0;N--)this.words[N+Q]=this.words[N];for(N=0;N<Q;N++)this.words[N]=0;this.length+=Q}return this.strip()},i.prototype.ishln=function(_){return r(this.negative===0),this.iushln(_)},i.prototype.iushrn=function(_,L,Q){r(typeof _=="number"&&_>=0);var I;L?I=(L-L%26)/26:I=0;var N=_%26,T=Math.min((_-N)/26,this.length),U=67108863^67108863>>>N<<N,q=Q;if(I-=T,I=Math.max(0,I),q){for(var D=0;D<T;D++)q.words[D]=this.words[D];q.length=T}if(T!==0)if(this.length>T)for(this.length-=T,D=0;D<this.length;D++)this.words[D]=this.words[D+T];else this.words[0]=0,this.length=1;var v=0;for(D=this.length-1;D>=0&&(v!==0||D>=I);D--){var k=this.words[D]|0;this.words[D]=v<<26-N|k>>>N,v=k&U}return q&&v!==0&&(q.words[q.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(_,L,Q){return r(this.negative===0),this.iushrn(_,L,Q)},i.prototype.shln=function(_){return this.clone().ishln(_)},i.prototype.ushln=function(_){return this.clone().iushln(_)},i.prototype.shrn=function(_){return this.clone().ishrn(_)},i.prototype.ushrn=function(_){return this.clone().iushrn(_)},i.prototype.testn=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26,I=1<<L;if(this.length<=Q)return!1;var N=this.words[Q];return!!(N&I)},i.prototype.imaskn=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(L!==0&&Q++,this.length=Math.min(Q,this.length),L!==0){var I=67108863^67108863>>>L<<L;this.words[this.length-1]&=I}return this.strip()},i.prototype.maskn=function(_){return this.clone().imaskn(_)},i.prototype.iaddn=function(_){return r(typeof _=="number"),r(_<67108864),_<0?this.isubn(-_):this.negative!==0?this.length===1&&(this.words[0]|0)<_?(this.words[0]=_-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(_),this.negative=1,this):this._iaddn(_)},i.prototype._iaddn=function(_){this.words[0]+=_;for(var L=0;L<this.length&&this.words[L]>=67108864;L++)this.words[L]-=67108864,L===this.length-1?this.words[L+1]=1:this.words[L+1]++;return this.length=Math.max(this.length,L+1),this},i.prototype.isubn=function(_){if(r(typeof _=="number"),r(_<67108864),_<0)return this.iaddn(-_);if(this.negative!==0)return this.negative=0,this.iaddn(_),this.negative=1,this;if(this.words[0]-=_,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var L=0;L<this.length&&this.words[L]<0;L++)this.words[L]+=67108864,this.words[L+1]-=1;return this.strip()},i.prototype.addn=function(_){return this.clone().iaddn(_)},i.prototype.subn=function(_){return this.clone().isubn(_)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(_,L,Q){var I=_.length+Q,N;this._expand(I);var T,U=0;for(N=0;N<_.length;N++){T=(this.words[N+Q]|0)+U;var q=(_.words[N]|0)*L;T-=q&67108863,U=(T>>26)-(q/67108864|0),this.words[N+Q]=T&67108863}for(;N<this.length-Q;N++)T=(this.words[N+Q]|0)+U,U=T>>26,this.words[N+Q]=T&67108863;if(U===0)return this.strip();for(r(U===-1),U=0,N=0;N<this.length;N++)T=-(this.words[N]|0)+U,U=T>>26,this.words[N]=T&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(_,L){var Q=this.length-_.length,I=this.clone(),N=_,T=N.words[N.length-1]|0,U=this._countBits(T);Q=26-U,Q!==0&&(N=N.ushln(Q),I.iushln(Q),T=N.words[N.length-1]|0);var q=I.length-N.length,D;if(L!=="mod"){D=new i(null),D.length=q+1,D.words=new Array(D.length);for(var v=0;v<D.length;v++)D.words[v]=0}var k=I.clone()._ishlnsubmul(N,1,q);k.negative===0&&(I=k,D&&(D.words[q]=1));for(var G=q-1;G>=0;G--){var J=(I.words[N.length+G]|0)*67108864+(I.words[N.length+G-1]|0);for(J=Math.min(J/T|0,67108863),I._ishlnsubmul(N,J,G);I.negative!==0;)J--,I.negative=0,I._ishlnsubmul(N,1,G),I.isZero()||(I.negative^=1);D&&(D.words[G]=J)}return D&&D.strip(),I.strip(),L!=="div"&&Q!==0&&I.iushrn(Q),{div:D||null,mod:I}},i.prototype.divmod=function(_,L,Q){if(r(!_.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var I,N,T;return this.negative!==0&&_.negative===0?(T=this.neg().divmod(_,L),L!=="mod"&&(I=T.div.neg()),L!=="div"&&(N=T.mod.neg(),Q&&N.negative!==0&&N.iadd(_)),{div:I,mod:N}):this.negative===0&&_.negative!==0?(T=this.divmod(_.neg(),L),L!=="mod"&&(I=T.div.neg()),{div:I,mod:T.mod}):(this.negative&_.negative)!==0?(T=this.neg().divmod(_.neg(),L),L!=="div"&&(N=T.mod.neg(),Q&&N.negative!==0&&N.isub(_)),{div:T.div,mod:N}):_.length>this.length||this.cmp(_)<0?{div:new i(0),mod:this}:_.length===1?L==="div"?{div:this.divn(_.words[0]),mod:null}:L==="mod"?{div:null,mod:new i(this.modn(_.words[0]))}:{div:this.divn(_.words[0]),mod:new i(this.modn(_.words[0]))}:this._wordDiv(_,L)},i.prototype.div=function(_){return this.divmod(_,"div",!1).div},i.prototype.mod=function(_){return this.divmod(_,"mod",!1).mod},i.prototype.umod=function(_){return this.divmod(_,"mod",!0).mod},i.prototype.divRound=function(_){var L=this.divmod(_);if(L.mod.isZero())return L.div;var Q=L.div.negative!==0?L.mod.isub(_):L.mod,I=_.ushrn(1),N=_.andln(1),T=Q.cmp(I);return T<0||N===1&&T===0?L.div:L.div.negative!==0?L.div.isubn(1):L.div.iaddn(1)},i.prototype.modn=function(_){r(_<=67108863);for(var L=(1<<26)%_,Q=0,I=this.length-1;I>=0;I--)Q=(L*Q+(this.words[I]|0))%_;return Q},i.prototype.idivn=function(_){r(_<=67108863);for(var L=0,Q=this.length-1;Q>=0;Q--){var I=(this.words[Q]|0)+L*67108864;this.words[Q]=I/_|0,L=I%_}return this.strip()},i.prototype.divn=function(_){return this.clone().idivn(_)},i.prototype.egcd=function(_){r(_.negative===0),r(!_.isZero());var L=this,Q=_.clone();L.negative!==0?L=L.umod(_):L=L.clone();for(var I=new i(1),N=new i(0),T=new i(0),U=new i(1),q=0;L.isEven()&&Q.isEven();)L.iushrn(1),Q.iushrn(1),++q;for(var D=Q.clone(),v=L.clone();!L.isZero();){for(var k=0,G=1;(L.words[0]&G)===0&&k<26;++k,G<<=1);if(k>0)for(L.iushrn(k);k-- >0;)(I.isOdd()||N.isOdd())&&(I.iadd(D),N.isub(v)),I.iushrn(1),N.iushrn(1);for(var J=0,Qe=1;(Q.words[0]&Qe)===0&&J<26;++J,Qe<<=1);if(J>0)for(Q.iushrn(J);J-- >0;)(T.isOdd()||U.isOdd())&&(T.iadd(D),U.isub(v)),T.iushrn(1),U.iushrn(1);L.cmp(Q)>=0?(L.isub(Q),I.isub(T),N.isub(U)):(Q.isub(L),T.isub(I),U.isub(N))}return{a:T,b:U,gcd:Q.iushln(q)}},i.prototype._invmp=function(_){r(_.negative===0),r(!_.isZero());var L=this,Q=_.clone();L.negative!==0?L=L.umod(_):L=L.clone();for(var I=new i(1),N=new i(0),T=Q.clone();L.cmpn(1)>0&&Q.cmpn(1)>0;){for(var U=0,q=1;(L.words[0]&q)===0&&U<26;++U,q<<=1);if(U>0)for(L.iushrn(U);U-- >0;)I.isOdd()&&I.iadd(T),I.iushrn(1);for(var D=0,v=1;(Q.words[0]&v)===0&&D<26;++D,v<<=1);if(D>0)for(Q.iushrn(D);D-- >0;)N.isOdd()&&N.iadd(T),N.iushrn(1);L.cmp(Q)>=0?(L.isub(Q),I.isub(N)):(Q.isub(L),N.isub(I))}var k;return L.cmpn(1)===0?k=I:k=N,k.cmpn(0)<0&&k.iadd(_),k},i.prototype.gcd=function(_){if(this.isZero())return _.abs();if(_.isZero())return this.abs();var L=this.clone(),Q=_.clone();L.negative=0,Q.negative=0;for(var I=0;L.isEven()&&Q.isEven();I++)L.iushrn(1),Q.iushrn(1);do{for(;L.isEven();)L.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var N=L.cmp(Q);if(N<0){var T=L;L=Q,Q=T}else if(N===0||Q.cmpn(1)===0)break;L.isub(Q)}while(!0);return Q.iushln(I)},i.prototype.invm=function(_){return this.egcd(_).a.umod(_)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(_){return this.words[0]&_},i.prototype.bincn=function(_){r(typeof _=="number");var L=_%26,Q=(_-L)/26,I=1<<L;if(this.length<=Q)return this._expand(Q+1),this.words[Q]|=I,this;for(var N=I,T=Q;N!==0&&T<this.length;T++){var U=this.words[T]|0;U+=N,N=U>>>26,U&=67108863,this.words[T]=U}return N!==0&&(this.words[T]=N,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(_){var L=_<0;if(this.negative!==0&&!L)return-1;if(this.negative===0&&L)return 1;this.strip();var Q;if(this.length>1)Q=1;else{L&&(_=-_),r(_<=67108863,"Number is too big");var I=this.words[0]|0;Q=I===_?0:I<_?-1:1}return this.negative!==0?-Q|0:Q},i.prototype.cmp=function(_){if(this.negative!==0&&_.negative===0)return-1;if(this.negative===0&&_.negative!==0)return 1;var L=this.ucmp(_);return this.negative!==0?-L|0:L},i.prototype.ucmp=function(_){if(this.length>_.length)return 1;if(this.length<_.length)return-1;for(var L=0,Q=this.length-1;Q>=0;Q--){var I=this.words[Q]|0,N=_.words[Q]|0;if(I!==N){I<N?L=-1:I>N&&(L=1);break}}return L},i.prototype.gtn=function(_){return this.cmpn(_)===1},i.prototype.gt=function(_){return this.cmp(_)===1},i.prototype.gten=function(_){return this.cmpn(_)>=0},i.prototype.gte=function(_){return this.cmp(_)>=0},i.prototype.ltn=function(_){return this.cmpn(_)===-1},i.prototype.lt=function(_){return this.cmp(_)===-1},i.prototype.lten=function(_){return this.cmpn(_)<=0},i.prototype.lte=function(_){return this.cmp(_)<=0},i.prototype.eqn=function(_){return this.cmpn(_)===0},i.prototype.eq=function(_){return this.cmp(_)===0},i.red=function(_){return new V(_)},i.prototype.toRed=function(_){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),_.convertTo(this)._forceRed(_)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(_){return this.red=_,this},i.prototype.forceRed=function(_){return r(!this.red,"Already a number in reduction context"),this._forceRed(_)},i.prototype.redAdd=function(_){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,_)},i.prototype.redIAdd=function(_){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,_)},i.prototype.redSub=function(_){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,_)},i.prototype.redISub=function(_){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,_)},i.prototype.redShl=function(_){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,_)},i.prototype.redMul=function(_){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.mul(this,_)},i.prototype.redIMul=function(_){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.imul(this,_)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(_){return r(this.red&&!_.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,_)};var y={k256:null,p224:null,p192:null,p25519:null};function b(X,_){this.name=X,this.p=new i(_,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}b.prototype._tmp=function(){var _=new i(null);return _.words=new Array(Math.ceil(this.n/13)),_},b.prototype.ireduce=function(_){var L=_,Q;do this.split(L,this.tmp),L=this.imulK(L),L=L.iadd(this.tmp),Q=L.bitLength();while(Q>this.n);var I=Q<this.n?-1:L.ucmp(this.p);return I===0?(L.words[0]=0,L.length=1):I>0?L.isub(this.p):L.strip!==void 0?L.strip():L._strip(),L},b.prototype.split=function(_,L){_.iushrn(this.n,0,L)},b.prototype.imulK=function(_){return _.imul(this.k)};function O(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(O,b),O.prototype.split=function(_,L){for(var Q=4194303,I=Math.min(_.length,9),N=0;N<I;N++)L.words[N]=_.words[N];if(L.length=I,_.length<=9){_.words[0]=0,_.length=1;return}var T=_.words[9];for(L.words[L.length++]=T&Q,N=10;N<_.length;N++){var U=_.words[N]|0;_.words[N-10]=(U&Q)<<4|T>>>22,T=U}T>>>=22,_.words[N-10]=T,T===0&&_.length>10?_.length-=10:_.length-=9},O.prototype.imulK=function(_){_.words[_.length]=0,_.words[_.length+1]=0,_.length+=2;for(var L=0,Q=0;Q<_.length;Q++){var I=_.words[Q]|0;L+=I*977,_.words[Q]=L&67108863,L=I*64+(L/67108864|0)}return _.words[_.length-1]===0&&(_.length--,_.words[_.length-1]===0&&_.length--),_};function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(M,b);function S(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(S,b);function P(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(P,b),P.prototype.imulK=function(_){for(var L=0,Q=0;Q<_.length;Q++){var I=(_.words[Q]|0)*19+L,N=I&67108863;I>>>=26,_.words[Q]=N,L=I}return L!==0&&(_.words[_.length++]=L),_},i._prime=function(_){if(y[_])return y[_];var L;if(_==="k256")L=new O;else if(_==="p224")L=new M;else if(_==="p192")L=new S;else if(_==="p25519")L=new P;else throw new Error("Unknown prime "+_);return y[_]=L,L};function V(X){if(typeof X=="string"){var _=i._prime(X);this.m=_.p,this.prime=_}else r(X.gtn(1),"modulus must be greater than 1"),this.m=X,this.prime=null}V.prototype._verify1=function(_){r(_.negative===0,"red works only with positives"),r(_.red,"red works only with red numbers")},V.prototype._verify2=function(_,L){r((_.negative|L.negative)===0,"red works only with positives"),r(_.red&&_.red===L.red,"red works only with red numbers")},V.prototype.imod=function(_){return this.prime?this.prime.ireduce(_)._forceRed(this):_.umod(this.m)._forceRed(this)},V.prototype.neg=function(_){return _.isZero()?_.clone():this.m.sub(_)._forceRed(this)},V.prototype.add=function(_,L){this._verify2(_,L);var Q=_.add(L);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},V.prototype.iadd=function(_,L){this._verify2(_,L);var Q=_.iadd(L);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},V.prototype.sub=function(_,L){this._verify2(_,L);var Q=_.sub(L);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},V.prototype.isub=function(_,L){this._verify2(_,L);var Q=_.isub(L);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},V.prototype.shl=function(_,L){return this._verify1(_),this.imod(_.ushln(L))},V.prototype.imul=function(_,L){return this._verify2(_,L),this.imod(_.imul(L))},V.prototype.mul=function(_,L){return this._verify2(_,L),this.imod(_.mul(L))},V.prototype.isqr=function(_){return this.imul(_,_.clone())},V.prototype.sqr=function(_){return this.mul(_,_)},V.prototype.sqrt=function(_){if(_.isZero())return _.clone();var L=this.m.andln(3);if(r(L%2===1),L===3){var Q=this.m.add(new i(1)).iushrn(2);return this.pow(_,Q)}for(var I=this.m.subn(1),N=0;!I.isZero()&&I.andln(1)===0;)N++,I.iushrn(1);r(!I.isZero());var T=new i(1).toRed(this),U=T.redNeg(),q=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new i(2*D*D).toRed(this);this.pow(D,q).cmp(U)!==0;)D.redIAdd(U);for(var v=this.pow(D,I),k=this.pow(_,I.addn(1).iushrn(1)),G=this.pow(_,I),J=N;G.cmp(T)!==0;){for(var Qe=G,Re=0;Qe.cmp(T)!==0;Re++)Qe=Qe.redSqr();r(Re<J);var $e=this.pow(v,new i(1).iushln(J-Re-1));k=k.redMul($e),v=$e.redSqr(),G=G.redMul(v),J=Re}return k},V.prototype.invm=function(_){var L=_._invmp(this.m);return L.negative!==0?(L.negative=0,this.imod(L).redNeg()):this.imod(L)},V.prototype.pow=function(_,L){if(L.isZero())return new i(1).toRed(this);if(L.cmpn(1)===0)return _.clone();var Q=4,I=new Array(1<<Q);I[0]=new i(1).toRed(this),I[1]=_;for(var N=2;N<I.length;N++)I[N]=this.mul(I[N-1],_);var T=I[0],U=0,q=0,D=L.bitLength()%26;for(D===0&&(D=26),N=L.length-1;N>=0;N--){for(var v=L.words[N],k=D-1;k>=0;k--){var G=v>>k&1;if(T!==I[0]&&(T=this.sqr(T)),G===0&&U===0){q=0;continue}U<<=1,U|=G,q++,!(q!==Q&&(N!==0||k!==0))&&(T=this.mul(T,I[U]),q=0,U=0)}D=26}return T},V.prototype.convertTo=function(_){var L=_.umod(this.m);return L===_?L.clone():L},V.prototype.convertFrom=function(_){var L=_.clone();return L.red=null,L},i.mont=function(_){return new Z(_)};function Z(X){V.call(this,X),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Z,V),Z.prototype.convertTo=function(_){return this.imod(_.ushln(this.shift))},Z.prototype.convertFrom=function(_){var L=this.imod(_.mul(this.rinv));return L.red=null,L},Z.prototype.imul=function(_,L){if(_.isZero()||L.isZero())return _.words[0]=0,_.length=1,_;var Q=_.imul(L),I=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=Q.isub(I).iushrn(this.shift),T=N;return N.cmp(this.m)>=0?T=N.isub(this.m):N.cmpn(0)<0&&(T=N.iadd(this.m)),T._forceRed(this)},Z.prototype.mul=function(_,L){if(_.isZero()||L.isZero())return new i(0)._forceRed(this);var Q=_.mul(L),I=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=Q.isub(I).iushrn(this.shift),T=N;return N.cmp(this.m)>=0?T=N.isub(this.m):N.cmpn(0)<0&&(T=N.iadd(this.m)),T._forceRed(this)},Z.prototype.invm=function(_){var L=this.imod(_._invmp(this.m).mul(this.r2));return L._forceRed(this)}})(typeof HHt>"u"||HHt,kEn)});var Fje=m(FEn=>{"use strict";var vto=TE();function M_(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}FEn.Reporter=M_;M_.prototype.isError=function(e){return e instanceof pte};M_.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};M_.prototype.restore=function(e){let r=this._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)};M_.prototype.enterKey=function(e){return this._reporterState.path.push(e)};M_.prototype.exitKey=function(e){let r=this._reporterState;r.path=r.path.slice(0,e-1)};M_.prototype.leaveKey=function(e,r,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[r]=n)};M_.prototype.path=function(){return this._reporterState.path.join("/")};M_.prototype.enterObject=function(){let e=this._reporterState,r=e.obj;return e.obj={},r};M_.prototype.leaveObject=function(e){let r=this._reporterState,n=r.obj;return r.obj=e,n};M_.prototype.error=function(e){let r,n=this._reporterState,i=e instanceof pte;if(i?r=e:r=new pte(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw r;return i||n.errors.push(r),r};M_.prototype.wrapResult=function(e){let r=this._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e};function pte(t,e){this.path=t,this.rethrow(e)}vto(pte,Error);pte.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,pte),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}});var gte=m(VHt=>{"use strict";var Nto=TE(),qje=Fje().Reporter,fte=Tb().Buffer;function O_(t,e){if(qje.call(this,e),!fte.isBuffer(t)){this.error("Input not Buffer");return}this.base=t,this.offset=0,this.length=t.length}Nto(O_,qje);VHt.DecoderBuffer=O_;O_.isDecoderBuffer=function(e){return e instanceof O_?!0:typeof e=="object"&&fte.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};O_.prototype.save=function(){return{offset:this.offset,reporter:qje.prototype.save.call(this)}};O_.prototype.restore=function(e){let r=new O_(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,qje.prototype.restore.call(this,e.reporter),r};O_.prototype.isEmpty=function(){return this.offset===this.length};O_.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};O_.prototype.skip=function(e,r){if(!(this.offset+e<=this.length))return this.error(r||"DecoderBuffer overrun");let n=new O_(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};O_.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function hte(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(r){return hte.isEncoderBuffer(r)||(r=new hte(r,e)),this.length+=r.length,r},this);else if(typeof t=="number"){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if(typeof t=="string")this.value=t,this.length=fte.byteLength(t);else if(fte.isBuffer(t))this.value=t,this.length=t.length;else return e.error("Unsupported type: "+typeof t)}VHt.EncoderBuffer=hte;hte.isEncoderBuffer=function(e){return e instanceof hte?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};hte.prototype.join=function(e,r){return e||(e=fte.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,r),r+=n.length}):(typeof this.value=="number"?e[r]=this.value:typeof this.value=="string"?e.write(this.value,r):fte.isBuffer(this.value)&&this.value.copy(e,r),r+=this.length)),e}});var GEn=m((cZa,UEn)=>{UEn.exports=qEn;function qEn(t,e){if(!t)throw new Error(e||"Assertion failed")}qEn.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)}});var Uje=m((uZa,HEn)=>{"use strict";var Qto=Fje().Reporter,zto=gte().EncoderBuffer,Lto=gte().DecoderBuffer,vm=GEn(),WEn=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Pto=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(WEn),kto=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Mc(t,e,r){let n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}HEn.exports=Mc;var Fto=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Mc.prototype.clone=function(){let e=this._baseState,r={};Fto.forEach(function(i){r[i]=e[i]});let n=new this.constructor(r.parent);return n._baseState=r,n};Mc.prototype._wrap=function(){let e=this._baseState;Pto.forEach(function(r){this[r]=function(){let i=new this.constructor(this);return e.children.push(i),i[r].apply(i,arguments)}},this)};Mc.prototype._init=function(e){let r=this._baseState;vm(r.parent===null),e.call(this),r.children=r.children.filter(function(n){return n._baseState.parent===this},this),vm.equal(r.children.length,1,"Root node can have only one child")};Mc.prototype._useArgs=function(e){let r=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(vm(r.children===null),r.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(vm(r.args===null),r.args=e,r.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};kto.forEach(function(t){Mc.prototype[t]=function(){let r=this._baseState;throw new Error(t+" not implemented for encoding: "+r.enc)}});WEn.forEach(function(t){Mc.prototype[t]=function(){let r=this._baseState,n=Array.prototype.slice.call(arguments);return vm(r.tag===null),r.tag=t,this._useArgs(n),this}});Mc.prototype.use=function(e){vm(e);let r=this._baseState;return vm(r.use===null),r.use=e,this};Mc.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};Mc.prototype.def=function(e){let r=this._baseState;return vm(r.default===null),r.default=e,r.optional=!0,this};Mc.prototype.explicit=function(e){let r=this._baseState;return vm(r.explicit===null&&r.implicit===null),r.explicit=e,this};Mc.prototype.implicit=function(e){let r=this._baseState;return vm(r.explicit===null&&r.implicit===null),r.implicit=e,this};Mc.prototype.obj=function(){let e=this._baseState,r=Array.prototype.slice.call(arguments);return e.obj=!0,r.length!==0&&this._useArgs(r),this};Mc.prototype.key=function(e){let r=this._baseState;return vm(r.key===null),r.key=e,this};Mc.prototype.any=function(){let e=this._baseState;return e.any=!0,this};Mc.prototype.choice=function(e){let r=this._baseState;return vm(r.choice===null),r.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};Mc.prototype.contains=function(e){let r=this._baseState;return vm(r.use===null),r.contains=e,this};Mc.prototype._decode=function(e,r){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,r));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,r):this._decodeChoice(e,r),s=!0}catch{s=!1}e.restore(u)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let l=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(l))return l;n.any?i=e.raw(u):e=l}if(r&&r.track&&n.tag!==null&&r.track(e.path(),c,e.length,"tagged"),r&&r.track&&n.tag!==null&&r.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,r):i=this._decodeChoice(e,r)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(l){l._decode(e,r)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new Lto(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,r)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};Mc.prototype._decodeGeneric=function(e,r,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(r,e,i.args[0],n):/str$/.test(e)?this._decodeStr(r,e,n):e==="objid"&&i.args?this._decodeObjid(r,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(r,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(r,e,n):e==="null_"?this._decodeNull(r,n):e==="bool"?this._decodeBool(r,n):e==="objDesc"?this._decodeStr(r,e,n):e==="int"||e==="enum"?this._decodeInt(r,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,r._reporterState.obj)._decode(r,n):r.error("unknown tag: "+e)};Mc.prototype._getUse=function(e,r){let n=this._baseState;return n.useDecoder=this._use(e,r),vm(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};Mc.prototype._decodeChoice=function(e,r){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let u=c._decode(e,r);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};Mc.prototype._createEncoderBuffer=function(e){return new zto(e,this.reporter)};Mc.prototype._encode=function(e,r,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,r,n);if(s!==void 0&&!this._skipDefault(s,r,n))return s};Mc.prototype._encodeValue=function(e,r,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,r||new Qto);let s=null;if(this.reporter=r,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,r);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,r),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,r,e);if(c._baseState.key===null)return r.error("Child should have a key");let u=r.enterKey(c._baseState.key);if(typeof e!="object")return r.error("Child expected, but input is not object");let l=c._encode(e[c._baseState.key],r,e);return r.leaveKey(u),l},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return r.error("Too many args for : "+i.tag);if(!Array.isArray(e))return r.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(u){let l=this._baseState;return this._getUse(l.args[0],e)._encode(u,r)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,r):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,u=i.implicit===null?"universal":"context";c===null?i.use===null&&r.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};Mc.prototype._encodeChoice=function(e,r){let n=this._baseState,i=n.choice[e.type];return i||vm(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,r)};Mc.prototype._encodePrimitive=function(e,r){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(r,e);if(e==="objid"&&n.args)return this._encodeObjid(r,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(r,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(r,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(r,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(r);if(e==="objDesc")return this._encodeStr(r,e);throw new Error("Unsupported tag: "+e)};Mc.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};Mc.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Gje=m(a7=>{"use strict";function jEn(t){let e={};return Object.keys(t).forEach(function(r){(r|0)==r&&(r=r|0);let n=t[r];e[n]=r}),e}a7.tagClass={0:"universal",1:"application",2:"context",3:"private"};a7.tagClassByName=jEn(a7.tagClass);a7.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};a7.tagByName=jEn(a7.tag)});var $Ht=m((AZa,$En)=>{"use strict";var qto=TE(),Hv=Tb().Buffer,VEn=Uje(),KHt=Gje();function KEn(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new OM,this.tree._init(t.body)}$En.exports=KEn;KEn.prototype.encode=function(e,r){return this.tree._encode(e,r).join()};function OM(t){VEn.call(this,"der",t)}qto(OM,VEn);OM.prototype._encodeComposite=function(e,r,n,i){let s=Uto(e,r,n,this.reporter);if(i.length<128){let c=Hv.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=Hv.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};OM.prototype._encodeStr=function(e,r){if(r==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(r==="bmpstr"){let n=Hv.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return r==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):r==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)?this._createEncoderBuffer(e):r==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")};OM.prototype._encodeObjid=function(e,r,n){if(typeof e=="string"){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=Hv.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function R_(t){return t<10?"0"+t:t}OM.prototype._encodeTime=function(e,r){let n,i=new Date(e);return r==="gentime"?n=[R_(i.getUTCFullYear()),R_(i.getUTCMonth()+1),R_(i.getUTCDate()),R_(i.getUTCHours()),R_(i.getUTCMinutes()),R_(i.getUTCSeconds()),"Z"].join(""):r==="utctime"?n=[R_(i.getUTCFullYear()%100),R_(i.getUTCMonth()+1),R_(i.getUTCDate()),R_(i.getUTCHours()),R_(i.getUTCMinutes()),R_(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(n,"octstr")};OM.prototype._encodeNull=function(){return this._createEncoderBuffer("")};OM.prototype._encodeInt=function(e,r){if(typeof e=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if(typeof e!="number"&&!Hv.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=Hv.from(s)}if(Hv.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=Hv.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(Hv.from(i))};OM.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};OM.prototype._use=function(e,r){return typeof e=="function"&&(e=e(r)),e._getEncoder("der").tree};OM.prototype._skipDefault=function(e,r,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,r,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function Uto(t,e,r,n){let i;if(t==="seqof"?t="seq":t==="setof"&&(t="set"),KHt.tagByName.hasOwnProperty(t))i=KHt.tagByName[t];else if(typeof t=="number"&&(t|0)===t)i=t;else return n.error("Unknown tag: "+t);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=KHt.tagClassByName[r||"universal"]<<6,i)}});var JEn=m((dZa,YEn)=>{"use strict";var Gto=TE(),YHt=$Ht();function JHt(t){YHt.call(this,t),this.enc="pem"}Gto(JHt,YHt);YEn.exports=JHt;JHt.prototype.encode=function(e,r){let i=YHt.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+r.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+r.label+"-----"),s.join(`
|
|
4119
|
+
`+s)}}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=s7(this.defaults,r);let{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&Bje.assertOptions(n,{silentJSONParsing:B_.transitional(B_.boolean),forcedJSONParsing:B_.transitional(B_.boolean),clarifyTimeoutError:B_.transitional(B_.boolean),legacyInterceptorReqResOrdering:B_.transitional(B_.boolean)},!1),i!=null&&(Vt.isFunction(i)?r.paramsSerializer={serialize:i}:Bje.assertOptions(i,{encode:B_.function,serialize:B_.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Bje.assertOptions(r,{baseUrl:B_.spelling("baseURL"),withXsrfToken:B_.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Vt.merge(s.common,s[r.method]);s&&Vt.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),r.headers=bd.concat(o,s);let a=[],c=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(r)===!1)return;c=c&&g.synchronous;let E=r.transitional||Qje;E&&E.legacyInterceptorReqResOrdering?a.unshift(g.fulfilled,g.rejected):a.push(g.fulfilled,g.rejected)});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,A=0,p;if(!c){let h=[Xmn.bind(this),void 0];for(h.unshift(...a),h.push(...u),p=h.length,l=Promise.resolve(r);A<p;)l=l.then(h[A++],h[A++]);return l}p=a.length;let f=r;for(;A<p;){let h=a[A++],g=a[A++];try{f=h(f)}catch(E){g.call(this,E);break}}try{l=Xmn.call(this,f)}catch(h){return Promise.reject(h)}for(A=0,p=u.length;A<p;)l=l.then(u[A++],u[A++]);return l}getUri(e){e=s7(this.defaults,e);let r=kHt(e.baseURL,e.url,e.allowAbsoluteUrls);return LHt(r,e.params,e.paramsSerializer)}};Vt.forEach(["delete","get","head","options"],function(e){Uv.prototype[e]=function(r,n){return this.request(s7(n||{},{method:e,url:r,data:(n||{}).data}))}});Vt.forEach(["post","put","patch"],function(e){function r(n){return function(s,o,a){return this.request(s7(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Uv.prototype[e]=r(),Uv.prototype[e+"Form"]=r(!0)});var vHt=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Gv(s,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new t(function(i){e=i}),cancel:e}}};function _to(t){return function(r){return t.apply(null,r)}}function xto(t){return Vt.isObject(t)&&t.isAxiosError===!0}var NHt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(NHt).forEach(([t,e])=>{NHt[e]=t});function _En(t){let e=new Uv(t),r=rEn(Uv.prototype.request,e);return Vt.extend(r,Uv.prototype,e,{allOwnKeys:!0}),Vt.extend(r,e,null,{allOwnKeys:!0}),r.create=function(i){return _En(s7(t,i))},r}var P1=_En(xEe);P1.Axios=Uv;P1.CanceledError=Gv;P1.CancelToken=vHt;P1.isCancel=gEn;P1.VERSION=Oje;P1.toFormData=Nje;P1.AxiosError=Pn;P1.Cancel=P1.CanceledError;P1.all=function(e){return Promise.all(e)};P1.spread=_to;P1.isAxiosError=xto;P1.mergeConfig=s7;P1.AxiosHeaders=bd;P1.formToJSON=t=>fEn(Vt.isHTMLForm(t)?new FormData(t):t);P1.getAdapter=bEn.getAdapter;P1.HttpStatusCode=NHt;P1.default=P1;xEn.exports=P1});var qHt=m(BEn=>{"use strict";BEn.paramsNames=Object.freeze({SF_REQUEST_GUID:"request_guid",SF_REQUEST_ID:"requestId",SF_TOKEN:"token",SF_WAREHOUSE_NAME:"warehouse",SF_DB_NAME:"databaseName",SF_SCHEMA_NAME:"schemaName"})});var UHt=m(dte=>{"use strict";var MEn=nHe(),lte=qHt(),Lje=["baseUrl","path","method",lte.paramsNames.SF_REQUEST_ID,lte.paramsNames.SF_REQUEST_GUID,lte.paramsNames.SF_WAREHOUSE_NAME,lte.paramsNames.SF_DB_NAME,lte.paramsNames.SF_SCHEMA_NAME],Pje=[lte.paramsNames.SF_TOKEN];function Ate(t,e){return e||t}function Bto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n=Ate(Lje,e),i=Ate(Pje,r),{method:s,url:o,params:a}=t||{};return OEn({method:s,url:o,params:a},n,i)}function Mto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n,i,s,o=t?.config,a=Ate(Lje,e),c=Ate(Pje,r);return o&&(n=o.method,i=o.url,s=o.params),OEn({method:n,url:i,params:s},a,c)}function OEn({method:t,url:e,params:r}={},n,i){let s={method:t?.toUpperCase(),...REn(e,r)};return MEn.describeAttributes(s,n,i)}function REn(t,e={}){if(!t)return{baseUrl:void 0,path:void 0,queryParams:{}};let r=new URL(t),n={...e};return r.searchParams.forEach((s,o)=>{n[o]=s}),{baseUrl:`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}`,path:r.pathname,...n}}function Oto(t,{overrideAttributesDescribedWithValues:e,overrideAttributesDescribedWithoutValues:r}={}){let n=Ate(Lje,e),i=Ate(Pje,r),s=REn(t);return MEn.describeAttributes(s,n,i)}dte.DEFAULT_ATTRIBUTES_DESCRIBING_REQUEST_WITH_VALUES=Lje;dte.DEFAULT_ATTRIBUTES_DESCRIBING_REQUEST_WITHOUT_VALUES=Pje;dte.describeRequestFromOptions=Bto;dte.describeRequestFromResponse=Mto;dte.describeURL=Oto});var QEn=m((iZa,NEn)=>{"use strict";var Rto=require("zlib"),o7=hs(),$c=Rs(),SEn=Sme(),wEn=BEe(),Sto=require("node:url").URL,Ql=UHt(),wto=36e4;function Wv(t){$c.getInstance().trace("Initializing base HttpClient with Connection Config[%s]",t.describeIdentityAttributes()),this._connectionConfig=t}Wv.prototype.request=function(t){$c.getInstance().trace("Request%s - preparing for sending.",Ql.describeRequestFromOptions(t));let e={},r=new AbortController,n={signal:r.signal},i=vEn.call(this,t,n),s=async function(){$c.getInstance().trace("Request%s - sending.",Ql.describeRequestFromOptions(i));let a=new SEn().start();e.requestPromise=wEn.request(i).then(c=>{let u=a.getDuration();return $c.getInstance().debug("Request%s - response received after %s milliseconds with status %s.",Ql.describeRequestFromOptions(i),u,c.status),TEn(c),GHt(c),o7.isFunction(t.callback)?($c.getInstance().trace("Request%s - calling callback function.",Ql.describeRequestFromOptions(i)),t.callback(null,kje(c),c.data)):($c.getInstance().trace("Request%s - callback function was not provided.",Ql.describeRequestFromOptions(i)),null)}).catch(c=>{let u=a.getDuration();if($c.getInstance().debug("Request%s - failed after %s milliseconds.",Ql.describeRequestFromOptions(i),u),DEn(c),o7.isFunction(t.callback))return c.response?($c.getInstance().trace("Request%s - calling callback function for error from response. Received code: ",Ql.describeRequestFromOptions(i),c.response.status),t.callback(null,kje(c.response),c.response.data)):($c.getInstance().trace("Request%s - calling callback function for error without response.",Ql.describeRequestFromOptions(i)),t.callback(c,kje(null),null)),null;throw $c.getInstance().warn("Request%s - callback function was not provided. Error will be re-raised.",Ql.describeRequestFromOptions(i)),c})};return s=s.bind(this),$c.getInstance().trace("Request%s - issued for the next tick.",Ql.describeRequestFromOptions(i)),process.nextTick(s),e.abort=function(){r&&($c.getInstance().trace("Request%s - aborting.",Ql.describeRequestFromOptions(i)),r.abort(),$c.getInstance().debug("Request%s - aborted.",Ql.describeRequestFromOptions(i)))},e};Wv.prototype.requestAsync=async function(t){$c.getInstance().trace("Request%s - preparing for async sending.",Ql.describeRequestFromOptions(t));let e=new SEn;try{let r=vEn.call(this,t);e.start();let n=await wEn.request(r),i=e.getDuration();return $c.getInstance().debug("Request%s - response received after %s milliseconds with status %s.",Ql.describeRequestFromOptions(r),i,n.status),TEn(n),GHt(n),kje(n)}catch(r){let n=e.getDuration();throw $c.getInstance().debug("Request%s - failed after %s milliseconds. Error will be re-raised.",Ql.describeRequestFromOptions(t),n),DEn(r),r}};function TEn(t){$c.getInstance().trace("Request%s - parsing response data.",Ql.describeRequestFromResponse(t)),Tto(t)}function Tto(t){o7.isString(t.data)&&t.headers["content-type"]==="application/json"&&(t.data.includes("smkId")&&(t.data=o7.convertSmkIdToString(t.data)),t.json=t.data,t.data=JSON.parse(t.data))}Wv.prototype.post=async function(t,e,r){return this.requestAsync({url:t,method:"POST",data:e,...r})};Wv.prototype.get=async function(t,e){return this.requestAsync({url:t,method:"GET",...e})};Wv.prototype.head=async function(t,e){return this.requestAsync({url:t,method:"HEAD",...e})};Wv.prototype.put=async function(t,e,r){return this.requestAsync({url:t,method:"PUT",data:e,...r})};Wv.prototype.getRequestModule=function(){return null};Wv.prototype.getAgent=function(){return null};NEn.exports=Wv;function GHt(t){$c.getInstance().trace("Request%s - sanitizing response data.",Ql.describeRequestFromResponse(t)),t.request=void 0,t.config&&(t.config.data=void 0,t.config.headers=void 0)}function DEn(t){t.request=void 0,t.config=void 0,t.response&&($c.getInstance().trace("Request%s - sanitizing response error data.",Ql.describeRequestFromResponse(t.response)),GHt(t.response))}function vEn(t,e={}){$c.getInstance().trace("Request%s - constructing options.",Ql.describeRequestFromOptions(t));let r=Dto(t.headers)||{},n=t.timeout||this._connectionConfig.getTimeout()||wto,i=t.data||t.json||t.body;if(i){let p=Buffer.from(JSON.stringify(i),"utf8");Rto.gzip(p,null,function(f,h){f?$c.getInstance().warn("Request%s - could not compress request data.",Ql.describeRequestFromOptions(t)):(i=h,r["Content-Encoding"]="gzip",$c.getInstance().debug("Request%s - original buffer length: %d bytes. Compressed buffer length: %d bytes.",Ql.describeRequestFromOptions(t),p.buffer.byteLength,h.buffer.byteLength))})}let s=t.params,o;this._connectionConfig.agentClass&&(o={agentClass:this._connectionConfig.agentClass});let a=this.constructExponentialBackoffStrategy(),c={method:t.method,url:t.url,headers:r,data:i,params:s,timeout:n,requestOCSP:!0,retryDelay:a,rejectUnauthorized:!0,responseType:t.responseType||"text",proxy:!1,...e},u=new Sto(t.url),l=u.protocol==="https:",A=this.getAgent(u,this._connectionConfig.getProxy(),o);return l?c.httpsAgent=A:c.httpAgent=A,$c.getInstance().debug("Request%s - options - timeout: %s, retryDelay: %s, responseType: %s",Ql.describeRequestFromOptions(t),c.timeout,c.retryDelay,c.responseType),c}function Dto(t){if($c.getInstance().trace("Normalizing headers"),o7.isObject(t)){let e={"user-agent":o7.userAgent},r;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r=n.toLowerCase(),r==="accept"||r==="content-type"?e[r]=t[n]:e[n]=t[n]);return $c.getInstance().trace("Headers were normalized"),e}else return $c.getInstance().trace("Headers were not an object. Original value will be returned."),t}function kje(t){return t&&!t.getResponseHeader&&($c.getInstance().trace("Request%s - normalizing.",Ql.describeRequestFromResponse(t)),t.getResponseHeader=function(e){return t.headers&&t.headers[o7.isString(e)?e.toLowerCase():e]}),t&&(t.body=t.data,t.statusCode=t.status),t}});var PEn=m((sZa,LEn)=>{var zEn=qw(),WHt=class{constructor(e){this.options=e||{},this.cache={},this.options.probe&&(this.probe=this.options.probe),this.options.store&&(this.store=this.options.store),this.options.filter&&(this.filter=this.options.filter)}filter(e,r){r(null)}probe(e,r){Object.prototype.hasOwnProperty.call(this.cache,e)?r(null,this.cache[e]):r(null,!1)}store(e,r,n,i){Object.prototype.hasOwnProperty.call(this.cache,e)&&clearTimeout(this.cache[e].timer),this.cache[e]={response:r,timer:setTimeout(()=>{delete this.cache[e]},n)},i(null,null)}request(e,r,n){function i(o,a){n&&n(o,a),n=null}let s=(o,a)=>{if(o)return i(o);i(null,a),this.getMaxStoreTime(a,(c,u)=>{c||this.store(e,a,u,()=>{})})};this.filter(r.url,function(o){if(o)return i(o,null);zEn.utils.getResponse(r.url,r.ocsp,s)})}getMaxStoreTime(e,r){let n;try{n=zEn.utils.parseResponse(e).value}catch(a){return r(a)}if(n.tbsResponseData.responses.length===0)return r(new Error("No OCSP responses"));let i=n.tbsResponseData.responses;if(!i.every(function(a){return a.certStatus.type==="good"}))return r(new Error("Some OCSP responses are not good"));let o=0;for(let a=0;a<i.length;a++){let u=i[a].nextUpdate;u&&(o===0||o>u)&&(o=u)}return r(null,Math.min(Math.max(0,o-new Date),2147483647))}clear(){Object.keys(this.cache).forEach(r=>{clearTimeout(this.cache[r].timer),delete this.cache[r]})}};LEn.exports=WHt});var jHt=m((kEn,HHt)=>{(function(t,e){"use strict";function r(X,_){if(!X)throw new Error(_||"Assertion failed")}function n(X,_){X.super_=_;var L=function(){};L.prototype=_.prototype,X.prototype=new L,X.prototype.constructor=X}function i(X,_,L){if(i.isBN(X))return X;this.negative=0,this.words=null,this.length=0,this.red=null,X!==null&&((_==="le"||_==="be")&&(L=_,_=10),this._init(X||0,_||10,L||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(_){return _ instanceof i?!0:_!==null&&typeof _=="object"&&_.constructor.wordSize===i.wordSize&&Array.isArray(_.words)},i.max=function(_,L){return _.cmp(L)>0?_:L},i.min=function(_,L){return _.cmp(L)<0?_:L},i.prototype._init=function(_,L,Q){if(typeof _=="number")return this._initNumber(_,L,Q);if(typeof _=="object")return this._initArray(_,L,Q);L==="hex"&&(L=16),r(L===(L|0)&&L>=2&&L<=36),_=_.toString().replace(/\s+/g,"");var I=0;_[0]==="-"&&(I++,this.negative=1),I<_.length&&(L===16?this._parseHex(_,I,Q):(this._parseBase(_,L,I),Q==="le"&&this._initArray(this.toArray(),L,Q)))},i.prototype._initNumber=function(_,L,Q){_<0&&(this.negative=1,_=-_),_<67108864?(this.words=[_&67108863],this.length=1):_<4503599627370496?(this.words=[_&67108863,_/67108864&67108863],this.length=2):(r(_<9007199254740992),this.words=[_&67108863,_/67108864&67108863,1],this.length=3),Q==="le"&&this._initArray(this.toArray(),L,Q)},i.prototype._initArray=function(_,L,Q){if(r(typeof _.length=="number"),_.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(_.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N,T,U=0;if(Q==="be")for(I=_.length-1,N=0;I>=0;I-=3)T=_[I]|_[I-1]<<8|_[I-2]<<16,this.words[N]|=T<<U&67108863,this.words[N+1]=T>>>26-U&67108863,U+=24,U>=26&&(U-=26,N++);else if(Q==="le")for(I=0,N=0;I<_.length;I+=3)T=_[I]|_[I+1]<<8|_[I+2]<<16,this.words[N]|=T<<U&67108863,this.words[N+1]=T>>>26-U&67108863,U+=24,U>=26&&(U-=26,N++);return this.strip()};function o(X,_){var L=X.charCodeAt(_);return L>=65&&L<=70?L-55:L>=97&&L<=102?L-87:L-48&15}function a(X,_,L){var Q=o(X,L);return L-1>=_&&(Q|=o(X,L-1)<<4),Q}i.prototype._parseHex=function(_,L,Q){this.length=Math.ceil((_.length-L)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N=0,T=0,U;if(Q==="be")for(I=_.length-1;I>=L;I-=2)U=a(_,L,I)<<N,this.words[T]|=U&67108863,N>=18?(N-=18,T+=1,this.words[T]|=U>>>26):N+=8;else{var q=_.length-L;for(I=q%2===0?L+1:L;I<_.length;I+=2)U=a(_,L,I)<<N,this.words[T]|=U&67108863,N>=18?(N-=18,T+=1,this.words[T]|=U>>>26):N+=8}this.strip()};function c(X,_,L,Q){for(var I=0,N=Math.min(X.length,L),T=_;T<N;T++){var U=X.charCodeAt(T)-48;I*=Q,U>=49?I+=U-49+10:U>=17?I+=U-17+10:I+=U}return I}i.prototype._parseBase=function(_,L,Q){this.words=[0],this.length=1;for(var I=0,N=1;N<=67108863;N*=L)I++;I--,N=N/L|0;for(var T=_.length-Q,U=T%I,q=Math.min(T,T-U)+Q,D=0,v=Q;v<q;v+=I)D=c(_,v,v+I,L),this.imuln(N),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(U!==0){var k=1;for(D=c(_,v,_.length,L),v=0;v<U;v++)k*=L;this.imuln(k),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this.strip()},i.prototype.copy=function(_){_.words=new Array(this.length);for(var L=0;L<this.length;L++)_.words[L]=this.words[L];_.length=this.length,_.negative=this.negative,_.red=this.red},i.prototype.clone=function(){var _=new i(null);return this.copy(_),_},i.prototype._expand=function(_){for(;this.length<_;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(_,L){_=_||10,L=L|0||1;var Q;if(_===16||_==="hex"){Q="";for(var I=0,N=0,T=0;T<this.length;T++){var U=this.words[T],q=((U<<I|N)&16777215).toString(16);N=U>>>24-I&16777215,I+=2,I>=26&&(I-=26,T--),N!==0||T!==this.length-1?Q=u[6-q.length]+q+Q:Q=q+Q}for(N!==0&&(Q=N.toString(16)+Q);Q.length%L!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(_===(_|0)&&_>=2&&_<=36){var D=l[_],v=A[_];Q="";var k=this.clone();for(k.negative=0;!k.isZero();){var G=k.modn(v).toString(_);k=k.idivn(v),k.isZero()?Q=G+Q:Q=u[D-G.length]+G+Q}for(this.isZero()&&(Q="0"+Q);Q.length%L!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var _=this.words[0];return this.length===2?_+=this.words[1]*67108864:this.length===3&&this.words[2]===1?_+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-_:_},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(_,L){return r(typeof s<"u"),this.toArrayLike(s,_,L)},i.prototype.toArray=function(_,L){return this.toArrayLike(Array,_,L)},i.prototype.toArrayLike=function(_,L,Q){var I=this.byteLength(),N=Q||Math.max(1,I);r(I<=N,"byte array longer than desired length"),r(N>0,"Requested array length <= 0"),this.strip();var T=L==="le",U=new _(N),q,D,v=this.clone();if(T){for(D=0;!v.isZero();D++)q=v.andln(255),v.iushrn(8),U[D]=q;for(;D<N;D++)U[D]=0}else{for(D=0;D<N-I;D++)U[D]=0;for(D=0;!v.isZero();D++)q=v.andln(255),v.iushrn(8),U[N-D-1]=q}return U},Math.clz32?i.prototype._countBits=function(_){return 32-Math.clz32(_)}:i.prototype._countBits=function(_){var L=_,Q=0;return L>=4096&&(Q+=13,L>>>=13),L>=64&&(Q+=7,L>>>=7),L>=8&&(Q+=4,L>>>=4),L>=2&&(Q+=2,L>>>=2),Q+L},i.prototype._zeroBits=function(_){if(_===0)return 26;var L=_,Q=0;return(L&8191)===0&&(Q+=13,L>>>=13),(L&127)===0&&(Q+=7,L>>>=7),(L&15)===0&&(Q+=4,L>>>=4),(L&3)===0&&(Q+=2,L>>>=2),(L&1)===0&&Q++,Q},i.prototype.bitLength=function(){var _=this.words[this.length-1],L=this._countBits(_);return(this.length-1)*26+L};function p(X){for(var _=new Array(X.bitLength()),L=0;L<_.length;L++){var Q=L/26|0,I=L%26;_[L]=(X.words[Q]&1<<I)>>>I}return _}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var _=0,L=0;L<this.length;L++){var Q=this._zeroBits(this.words[L]);if(_+=Q,Q!==26)break}return _},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(_){return this.negative!==0?this.abs().inotn(_).iaddn(1):this.clone()},i.prototype.fromTwos=function(_){return this.testn(_-1)?this.notn(_).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(_){for(;this.length<_.length;)this.words[this.length++]=0;for(var L=0;L<_.length;L++)this.words[L]=this.words[L]|_.words[L];return this.strip()},i.prototype.ior=function(_){return r((this.negative|_.negative)===0),this.iuor(_)},i.prototype.or=function(_){return this.length>_.length?this.clone().ior(_):_.clone().ior(this)},i.prototype.uor=function(_){return this.length>_.length?this.clone().iuor(_):_.clone().iuor(this)},i.prototype.iuand=function(_){var L;this.length>_.length?L=_:L=this;for(var Q=0;Q<L.length;Q++)this.words[Q]=this.words[Q]&_.words[Q];return this.length=L.length,this.strip()},i.prototype.iand=function(_){return r((this.negative|_.negative)===0),this.iuand(_)},i.prototype.and=function(_){return this.length>_.length?this.clone().iand(_):_.clone().iand(this)},i.prototype.uand=function(_){return this.length>_.length?this.clone().iuand(_):_.clone().iuand(this)},i.prototype.iuxor=function(_){var L,Q;this.length>_.length?(L=this,Q=_):(L=_,Q=this);for(var I=0;I<Q.length;I++)this.words[I]=L.words[I]^Q.words[I];if(this!==L)for(;I<L.length;I++)this.words[I]=L.words[I];return this.length=L.length,this.strip()},i.prototype.ixor=function(_){return r((this.negative|_.negative)===0),this.iuxor(_)},i.prototype.xor=function(_){return this.length>_.length?this.clone().ixor(_):_.clone().ixor(this)},i.prototype.uxor=function(_){return this.length>_.length?this.clone().iuxor(_):_.clone().iuxor(this)},i.prototype.inotn=function(_){r(typeof _=="number"&&_>=0);var L=Math.ceil(_/26)|0,Q=_%26;this._expand(L),Q>0&&L--;for(var I=0;I<L;I++)this.words[I]=~this.words[I]&67108863;return Q>0&&(this.words[I]=~this.words[I]&67108863>>26-Q),this.strip()},i.prototype.notn=function(_){return this.clone().inotn(_)},i.prototype.setn=function(_,L){r(typeof _=="number"&&_>=0);var Q=_/26|0,I=_%26;return this._expand(Q+1),L?this.words[Q]=this.words[Q]|1<<I:this.words[Q]=this.words[Q]&~(1<<I),this.strip()},i.prototype.iadd=function(_){var L;if(this.negative!==0&&_.negative===0)return this.negative=0,L=this.isub(_),this.negative^=1,this._normSign();if(this.negative===0&&_.negative!==0)return _.negative=0,L=this.isub(_),_.negative=1,L._normSign();var Q,I;this.length>_.length?(Q=this,I=_):(Q=_,I=this);for(var N=0,T=0;T<I.length;T++)L=(Q.words[T]|0)+(I.words[T]|0)+N,this.words[T]=L&67108863,N=L>>>26;for(;N!==0&&T<Q.length;T++)L=(Q.words[T]|0)+N,this.words[T]=L&67108863,N=L>>>26;if(this.length=Q.length,N!==0)this.words[this.length]=N,this.length++;else if(Q!==this)for(;T<Q.length;T++)this.words[T]=Q.words[T];return this},i.prototype.add=function(_){var L;return _.negative!==0&&this.negative===0?(_.negative=0,L=this.sub(_),_.negative^=1,L):_.negative===0&&this.negative!==0?(this.negative=0,L=_.sub(this),this.negative=1,L):this.length>_.length?this.clone().iadd(_):_.clone().iadd(this)},i.prototype.isub=function(_){if(_.negative!==0){_.negative=0;var L=this.iadd(_);return _.negative=1,L._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(_),this.negative=1,this._normSign();var Q=this.cmp(_);if(Q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,N;Q>0?(I=this,N=_):(I=_,N=this);for(var T=0,U=0;U<N.length;U++)L=(I.words[U]|0)-(N.words[U]|0)+T,T=L>>26,this.words[U]=L&67108863;for(;T!==0&&U<I.length;U++)L=(I.words[U]|0)+T,T=L>>26,this.words[U]=L&67108863;if(T===0&&U<I.length&&I!==this)for(;U<I.length;U++)this.words[U]=I.words[U];return this.length=Math.max(this.length,U),I!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(_){return this.clone().isub(_)};function f(X,_,L){L.negative=_.negative^X.negative;var Q=X.length+_.length|0;L.length=Q,Q=Q-1|0;var I=X.words[0]|0,N=_.words[0]|0,T=I*N,U=T&67108863,q=T/67108864|0;L.words[0]=U;for(var D=1;D<Q;D++){for(var v=q>>>26,k=q&67108863,G=Math.min(D,_.length-1),J=Math.max(0,D-X.length+1);J<=G;J++){var Qe=D-J|0;I=X.words[Qe]|0,N=_.words[J]|0,T=I*N+k,v+=T/67108864|0,k=T&67108863}L.words[D]=k|0,q=v|0}return q!==0?L.words[D]=q|0:L.length--,L.strip()}var h=function(_,L,Q){var I=_.words,N=L.words,T=Q.words,U=0,q,D,v,k=I[0]|0,G=k&8191,J=k>>>13,Qe=I[1]|0,Re=Qe&8191,$e=Qe>>>13,Bt=I[2]|0,Pt=Bt&8191,ge=Bt>>>13,Ve=I[3]|0,Ke=Ve&8191,Me=Ve>>>13,ke=I[4]|0,Fe=ke&8191,rt=ke>>>13,ct=I[5]|0,at=ct&8191,gt=ct>>>13,mt=I[6]|0,Ye=mt&8191,jt=mt>>>13,Ar=I[7]|0,yr=Ar&8191,le=Ar>>>13,Se=I[8]|0,ve=Se&8191,nt=Se>>>13,de=I[9]|0,K=de&8191,ae=de>>>13,Oe=N[0]|0,ze=Oe&8191,_e=Oe>>>13,bt=N[1]|0,vt=bt&8191,kt=bt>>>13,It=N[2]|0,it=It&8191,Ft=It>>>13,De=N[3]|0,we=De&8191,ot=De>>>13,xt=N[4]|0,H=xt&8191,fe=xt>>>13,Ie=N[5]|0,Be=Ie&8191,Le=Ie>>>13,er=N[6]|0,te=er&8191,Y=er>>>13,ie=N[7]|0,xe=ie&8191,qe=ie>>>13,Je=N[8]|0,wt=Je&8191,lt=Je>>>13,Wt=N[9]|0,zt=Wt&8191,sr=Wt>>>13;Q.negative=_.negative^L.negative,Q.length=19,q=Math.imul(G,ze),D=Math.imul(G,_e),D=D+Math.imul(J,ze)|0,v=Math.imul(J,_e);var tn=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(tn>>>26)|0,tn&=67108863,q=Math.imul(Re,ze),D=Math.imul(Re,_e),D=D+Math.imul($e,ze)|0,v=Math.imul($e,_e),q=q+Math.imul(G,vt)|0,D=D+Math.imul(G,kt)|0,D=D+Math.imul(J,vt)|0,v=v+Math.imul(J,kt)|0;var pe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(pe>>>26)|0,pe&=67108863,q=Math.imul(Pt,ze),D=Math.imul(Pt,_e),D=D+Math.imul(ge,ze)|0,v=Math.imul(ge,_e),q=q+Math.imul(Re,vt)|0,D=D+Math.imul(Re,kt)|0,D=D+Math.imul($e,vt)|0,v=v+Math.imul($e,kt)|0,q=q+Math.imul(G,it)|0,D=D+Math.imul(G,Ft)|0,D=D+Math.imul(J,it)|0,v=v+Math.imul(J,Ft)|0;var j=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(j>>>26)|0,j&=67108863,q=Math.imul(Ke,ze),D=Math.imul(Ke,_e),D=D+Math.imul(Me,ze)|0,v=Math.imul(Me,_e),q=q+Math.imul(Pt,vt)|0,D=D+Math.imul(Pt,kt)|0,D=D+Math.imul(ge,vt)|0,v=v+Math.imul(ge,kt)|0,q=q+Math.imul(Re,it)|0,D=D+Math.imul(Re,Ft)|0,D=D+Math.imul($e,it)|0,v=v+Math.imul($e,Ft)|0,q=q+Math.imul(G,we)|0,D=D+Math.imul(G,ot)|0,D=D+Math.imul(J,we)|0,v=v+Math.imul(J,ot)|0;var se=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(se>>>26)|0,se&=67108863,q=Math.imul(Fe,ze),D=Math.imul(Fe,_e),D=D+Math.imul(rt,ze)|0,v=Math.imul(rt,_e),q=q+Math.imul(Ke,vt)|0,D=D+Math.imul(Ke,kt)|0,D=D+Math.imul(Me,vt)|0,v=v+Math.imul(Me,kt)|0,q=q+Math.imul(Pt,it)|0,D=D+Math.imul(Pt,Ft)|0,D=D+Math.imul(ge,it)|0,v=v+Math.imul(ge,Ft)|0,q=q+Math.imul(Re,we)|0,D=D+Math.imul(Re,ot)|0,D=D+Math.imul($e,we)|0,v=v+Math.imul($e,ot)|0,q=q+Math.imul(G,H)|0,D=D+Math.imul(G,fe)|0,D=D+Math.imul(J,H)|0,v=v+Math.imul(J,fe)|0;var Ne=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,q=Math.imul(at,ze),D=Math.imul(at,_e),D=D+Math.imul(gt,ze)|0,v=Math.imul(gt,_e),q=q+Math.imul(Fe,vt)|0,D=D+Math.imul(Fe,kt)|0,D=D+Math.imul(rt,vt)|0,v=v+Math.imul(rt,kt)|0,q=q+Math.imul(Ke,it)|0,D=D+Math.imul(Ke,Ft)|0,D=D+Math.imul(Me,it)|0,v=v+Math.imul(Me,Ft)|0,q=q+Math.imul(Pt,we)|0,D=D+Math.imul(Pt,ot)|0,D=D+Math.imul(ge,we)|0,v=v+Math.imul(ge,ot)|0,q=q+Math.imul(Re,H)|0,D=D+Math.imul(Re,fe)|0,D=D+Math.imul($e,H)|0,v=v+Math.imul($e,fe)|0,q=q+Math.imul(G,Be)|0,D=D+Math.imul(G,Le)|0,D=D+Math.imul(J,Be)|0,v=v+Math.imul(J,Le)|0;var Pe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,q=Math.imul(Ye,ze),D=Math.imul(Ye,_e),D=D+Math.imul(jt,ze)|0,v=Math.imul(jt,_e),q=q+Math.imul(at,vt)|0,D=D+Math.imul(at,kt)|0,D=D+Math.imul(gt,vt)|0,v=v+Math.imul(gt,kt)|0,q=q+Math.imul(Fe,it)|0,D=D+Math.imul(Fe,Ft)|0,D=D+Math.imul(rt,it)|0,v=v+Math.imul(rt,Ft)|0,q=q+Math.imul(Ke,we)|0,D=D+Math.imul(Ke,ot)|0,D=D+Math.imul(Me,we)|0,v=v+Math.imul(Me,ot)|0,q=q+Math.imul(Pt,H)|0,D=D+Math.imul(Pt,fe)|0,D=D+Math.imul(ge,H)|0,v=v+Math.imul(ge,fe)|0,q=q+Math.imul(Re,Be)|0,D=D+Math.imul(Re,Le)|0,D=D+Math.imul($e,Be)|0,v=v+Math.imul($e,Le)|0,q=q+Math.imul(G,te)|0,D=D+Math.imul(G,Y)|0,D=D+Math.imul(J,te)|0,v=v+Math.imul(J,Y)|0;var tt=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(tt>>>26)|0,tt&=67108863,q=Math.imul(yr,ze),D=Math.imul(yr,_e),D=D+Math.imul(le,ze)|0,v=Math.imul(le,_e),q=q+Math.imul(Ye,vt)|0,D=D+Math.imul(Ye,kt)|0,D=D+Math.imul(jt,vt)|0,v=v+Math.imul(jt,kt)|0,q=q+Math.imul(at,it)|0,D=D+Math.imul(at,Ft)|0,D=D+Math.imul(gt,it)|0,v=v+Math.imul(gt,Ft)|0,q=q+Math.imul(Fe,we)|0,D=D+Math.imul(Fe,ot)|0,D=D+Math.imul(rt,we)|0,v=v+Math.imul(rt,ot)|0,q=q+Math.imul(Ke,H)|0,D=D+Math.imul(Ke,fe)|0,D=D+Math.imul(Me,H)|0,v=v+Math.imul(Me,fe)|0,q=q+Math.imul(Pt,Be)|0,D=D+Math.imul(Pt,Le)|0,D=D+Math.imul(ge,Be)|0,v=v+Math.imul(ge,Le)|0,q=q+Math.imul(Re,te)|0,D=D+Math.imul(Re,Y)|0,D=D+Math.imul($e,te)|0,v=v+Math.imul($e,Y)|0,q=q+Math.imul(G,xe)|0,D=D+Math.imul(G,qe)|0,D=D+Math.imul(J,xe)|0,v=v+Math.imul(J,qe)|0;var Ht=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,q=Math.imul(ve,ze),D=Math.imul(ve,_e),D=D+Math.imul(nt,ze)|0,v=Math.imul(nt,_e),q=q+Math.imul(yr,vt)|0,D=D+Math.imul(yr,kt)|0,D=D+Math.imul(le,vt)|0,v=v+Math.imul(le,kt)|0,q=q+Math.imul(Ye,it)|0,D=D+Math.imul(Ye,Ft)|0,D=D+Math.imul(jt,it)|0,v=v+Math.imul(jt,Ft)|0,q=q+Math.imul(at,we)|0,D=D+Math.imul(at,ot)|0,D=D+Math.imul(gt,we)|0,v=v+Math.imul(gt,ot)|0,q=q+Math.imul(Fe,H)|0,D=D+Math.imul(Fe,fe)|0,D=D+Math.imul(rt,H)|0,v=v+Math.imul(rt,fe)|0,q=q+Math.imul(Ke,Be)|0,D=D+Math.imul(Ke,Le)|0,D=D+Math.imul(Me,Be)|0,v=v+Math.imul(Me,Le)|0,q=q+Math.imul(Pt,te)|0,D=D+Math.imul(Pt,Y)|0,D=D+Math.imul(ge,te)|0,v=v+Math.imul(ge,Y)|0,q=q+Math.imul(Re,xe)|0,D=D+Math.imul(Re,qe)|0,D=D+Math.imul($e,xe)|0,v=v+Math.imul($e,qe)|0,q=q+Math.imul(G,wt)|0,D=D+Math.imul(G,lt)|0,D=D+Math.imul(J,wt)|0,v=v+Math.imul(J,lt)|0;var Et=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Et>>>26)|0,Et&=67108863,q=Math.imul(K,ze),D=Math.imul(K,_e),D=D+Math.imul(ae,ze)|0,v=Math.imul(ae,_e),q=q+Math.imul(ve,vt)|0,D=D+Math.imul(ve,kt)|0,D=D+Math.imul(nt,vt)|0,v=v+Math.imul(nt,kt)|0,q=q+Math.imul(yr,it)|0,D=D+Math.imul(yr,Ft)|0,D=D+Math.imul(le,it)|0,v=v+Math.imul(le,Ft)|0,q=q+Math.imul(Ye,we)|0,D=D+Math.imul(Ye,ot)|0,D=D+Math.imul(jt,we)|0,v=v+Math.imul(jt,ot)|0,q=q+Math.imul(at,H)|0,D=D+Math.imul(at,fe)|0,D=D+Math.imul(gt,H)|0,v=v+Math.imul(gt,fe)|0,q=q+Math.imul(Fe,Be)|0,D=D+Math.imul(Fe,Le)|0,D=D+Math.imul(rt,Be)|0,v=v+Math.imul(rt,Le)|0,q=q+Math.imul(Ke,te)|0,D=D+Math.imul(Ke,Y)|0,D=D+Math.imul(Me,te)|0,v=v+Math.imul(Me,Y)|0,q=q+Math.imul(Pt,xe)|0,D=D+Math.imul(Pt,qe)|0,D=D+Math.imul(ge,xe)|0,v=v+Math.imul(ge,qe)|0,q=q+Math.imul(Re,wt)|0,D=D+Math.imul(Re,lt)|0,D=D+Math.imul($e,wt)|0,v=v+Math.imul($e,lt)|0,q=q+Math.imul(G,zt)|0,D=D+Math.imul(G,sr)|0,D=D+Math.imul(J,zt)|0,v=v+Math.imul(J,sr)|0;var We=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(We>>>26)|0,We&=67108863,q=Math.imul(K,vt),D=Math.imul(K,kt),D=D+Math.imul(ae,vt)|0,v=Math.imul(ae,kt),q=q+Math.imul(ve,it)|0,D=D+Math.imul(ve,Ft)|0,D=D+Math.imul(nt,it)|0,v=v+Math.imul(nt,Ft)|0,q=q+Math.imul(yr,we)|0,D=D+Math.imul(yr,ot)|0,D=D+Math.imul(le,we)|0,v=v+Math.imul(le,ot)|0,q=q+Math.imul(Ye,H)|0,D=D+Math.imul(Ye,fe)|0,D=D+Math.imul(jt,H)|0,v=v+Math.imul(jt,fe)|0,q=q+Math.imul(at,Be)|0,D=D+Math.imul(at,Le)|0,D=D+Math.imul(gt,Be)|0,v=v+Math.imul(gt,Le)|0,q=q+Math.imul(Fe,te)|0,D=D+Math.imul(Fe,Y)|0,D=D+Math.imul(rt,te)|0,v=v+Math.imul(rt,Y)|0,q=q+Math.imul(Ke,xe)|0,D=D+Math.imul(Ke,qe)|0,D=D+Math.imul(Me,xe)|0,v=v+Math.imul(Me,qe)|0,q=q+Math.imul(Pt,wt)|0,D=D+Math.imul(Pt,lt)|0,D=D+Math.imul(ge,wt)|0,v=v+Math.imul(ge,lt)|0,q=q+Math.imul(Re,zt)|0,D=D+Math.imul(Re,sr)|0,D=D+Math.imul($e,zt)|0,v=v+Math.imul($e,sr)|0;var Xe=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,q=Math.imul(K,it),D=Math.imul(K,Ft),D=D+Math.imul(ae,it)|0,v=Math.imul(ae,Ft),q=q+Math.imul(ve,we)|0,D=D+Math.imul(ve,ot)|0,D=D+Math.imul(nt,we)|0,v=v+Math.imul(nt,ot)|0,q=q+Math.imul(yr,H)|0,D=D+Math.imul(yr,fe)|0,D=D+Math.imul(le,H)|0,v=v+Math.imul(le,fe)|0,q=q+Math.imul(Ye,Be)|0,D=D+Math.imul(Ye,Le)|0,D=D+Math.imul(jt,Be)|0,v=v+Math.imul(jt,Le)|0,q=q+Math.imul(at,te)|0,D=D+Math.imul(at,Y)|0,D=D+Math.imul(gt,te)|0,v=v+Math.imul(gt,Y)|0,q=q+Math.imul(Fe,xe)|0,D=D+Math.imul(Fe,qe)|0,D=D+Math.imul(rt,xe)|0,v=v+Math.imul(rt,qe)|0,q=q+Math.imul(Ke,wt)|0,D=D+Math.imul(Ke,lt)|0,D=D+Math.imul(Me,wt)|0,v=v+Math.imul(Me,lt)|0,q=q+Math.imul(Pt,zt)|0,D=D+Math.imul(Pt,sr)|0,D=D+Math.imul(ge,zt)|0,v=v+Math.imul(ge,sr)|0;var Ct=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,q=Math.imul(K,we),D=Math.imul(K,ot),D=D+Math.imul(ae,we)|0,v=Math.imul(ae,ot),q=q+Math.imul(ve,H)|0,D=D+Math.imul(ve,fe)|0,D=D+Math.imul(nt,H)|0,v=v+Math.imul(nt,fe)|0,q=q+Math.imul(yr,Be)|0,D=D+Math.imul(yr,Le)|0,D=D+Math.imul(le,Be)|0,v=v+Math.imul(le,Le)|0,q=q+Math.imul(Ye,te)|0,D=D+Math.imul(Ye,Y)|0,D=D+Math.imul(jt,te)|0,v=v+Math.imul(jt,Y)|0,q=q+Math.imul(at,xe)|0,D=D+Math.imul(at,qe)|0,D=D+Math.imul(gt,xe)|0,v=v+Math.imul(gt,qe)|0,q=q+Math.imul(Fe,wt)|0,D=D+Math.imul(Fe,lt)|0,D=D+Math.imul(rt,wt)|0,v=v+Math.imul(rt,lt)|0,q=q+Math.imul(Ke,zt)|0,D=D+Math.imul(Ke,sr)|0,D=D+Math.imul(Me,zt)|0,v=v+Math.imul(Me,sr)|0;var Gt=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,q=Math.imul(K,H),D=Math.imul(K,fe),D=D+Math.imul(ae,H)|0,v=Math.imul(ae,fe),q=q+Math.imul(ve,Be)|0,D=D+Math.imul(ve,Le)|0,D=D+Math.imul(nt,Be)|0,v=v+Math.imul(nt,Le)|0,q=q+Math.imul(yr,te)|0,D=D+Math.imul(yr,Y)|0,D=D+Math.imul(le,te)|0,v=v+Math.imul(le,Y)|0,q=q+Math.imul(Ye,xe)|0,D=D+Math.imul(Ye,qe)|0,D=D+Math.imul(jt,xe)|0,v=v+Math.imul(jt,qe)|0,q=q+Math.imul(at,wt)|0,D=D+Math.imul(at,lt)|0,D=D+Math.imul(gt,wt)|0,v=v+Math.imul(gt,lt)|0,q=q+Math.imul(Fe,zt)|0,D=D+Math.imul(Fe,sr)|0,D=D+Math.imul(rt,zt)|0,v=v+Math.imul(rt,sr)|0;var Mr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,q=Math.imul(K,Be),D=Math.imul(K,Le),D=D+Math.imul(ae,Be)|0,v=Math.imul(ae,Le),q=q+Math.imul(ve,te)|0,D=D+Math.imul(ve,Y)|0,D=D+Math.imul(nt,te)|0,v=v+Math.imul(nt,Y)|0,q=q+Math.imul(yr,xe)|0,D=D+Math.imul(yr,qe)|0,D=D+Math.imul(le,xe)|0,v=v+Math.imul(le,qe)|0,q=q+Math.imul(Ye,wt)|0,D=D+Math.imul(Ye,lt)|0,D=D+Math.imul(jt,wt)|0,v=v+Math.imul(jt,lt)|0,q=q+Math.imul(at,zt)|0,D=D+Math.imul(at,sr)|0,D=D+Math.imul(gt,zt)|0,v=v+Math.imul(gt,sr)|0;var ir=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(ir>>>26)|0,ir&=67108863,q=Math.imul(K,te),D=Math.imul(K,Y),D=D+Math.imul(ae,te)|0,v=Math.imul(ae,Y),q=q+Math.imul(ve,xe)|0,D=D+Math.imul(ve,qe)|0,D=D+Math.imul(nt,xe)|0,v=v+Math.imul(nt,qe)|0,q=q+Math.imul(yr,wt)|0,D=D+Math.imul(yr,lt)|0,D=D+Math.imul(le,wt)|0,v=v+Math.imul(le,lt)|0,q=q+Math.imul(Ye,zt)|0,D=D+Math.imul(Ye,sr)|0,D=D+Math.imul(jt,zt)|0,v=v+Math.imul(jt,sr)|0;var Cr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,q=Math.imul(K,xe),D=Math.imul(K,qe),D=D+Math.imul(ae,xe)|0,v=Math.imul(ae,qe),q=q+Math.imul(ve,wt)|0,D=D+Math.imul(ve,lt)|0,D=D+Math.imul(nt,wt)|0,v=v+Math.imul(nt,lt)|0,q=q+Math.imul(yr,zt)|0,D=D+Math.imul(yr,sr)|0,D=D+Math.imul(le,zt)|0,v=v+Math.imul(le,sr)|0;var kr=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(kr>>>26)|0,kr&=67108863,q=Math.imul(K,wt),D=Math.imul(K,lt),D=D+Math.imul(ae,wt)|0,v=Math.imul(ae,lt),q=q+Math.imul(ve,zt)|0,D=D+Math.imul(ve,sr)|0,D=D+Math.imul(nt,zt)|0,v=v+Math.imul(nt,sr)|0;var qn=(U+q|0)+((D&8191)<<13)|0;U=(v+(D>>>13)|0)+(qn>>>26)|0,qn&=67108863,q=Math.imul(K,zt),D=Math.imul(K,sr),D=D+Math.imul(ae,zt)|0,v=Math.imul(ae,sr);var Li=(U+q|0)+((D&8191)<<13)|0;return U=(v+(D>>>13)|0)+(Li>>>26)|0,Li&=67108863,T[0]=tn,T[1]=pe,T[2]=j,T[3]=se,T[4]=Ne,T[5]=Pe,T[6]=tt,T[7]=Ht,T[8]=Et,T[9]=We,T[10]=Xe,T[11]=Ct,T[12]=Gt,T[13]=Mr,T[14]=ir,T[15]=Cr,T[16]=kr,T[17]=qn,T[18]=Li,U!==0&&(T[19]=U,Q.length++),Q};Math.imul||(h=f);function g(X,_,L){L.negative=_.negative^X.negative,L.length=X.length+_.length;for(var Q=0,I=0,N=0;N<L.length-1;N++){var T=I;I=0;for(var U=Q&67108863,q=Math.min(N,_.length-1),D=Math.max(0,N-X.length+1);D<=q;D++){var v=N-D,k=X.words[v]|0,G=_.words[D]|0,J=k*G,Qe=J&67108863;T=T+(J/67108864|0)|0,Qe=Qe+U|0,U=Qe&67108863,T=T+(Qe>>>26)|0,I+=T>>>26,T&=67108863}L.words[N]=U,Q=T,T=I}return Q!==0?L.words[N]=Q:L.length--,L.strip()}function E(X,_,L){var Q=new C;return Q.mulp(X,_,L)}i.prototype.mulTo=function(_,L){var Q,I=this.length+_.length;return this.length===10&&_.length===10?Q=h(this,_,L):I<63?Q=f(this,_,L):I<1024?Q=g(this,_,L):Q=E(this,_,L),Q};function C(X,_){this.x=X,this.y=_}C.prototype.makeRBT=function(_){for(var L=new Array(_),Q=i.prototype._countBits(_)-1,I=0;I<_;I++)L[I]=this.revBin(I,Q,_);return L},C.prototype.revBin=function(_,L,Q){if(_===0||_===Q-1)return _;for(var I=0,N=0;N<L;N++)I|=(_&1)<<L-N-1,_>>=1;return I},C.prototype.permute=function(_,L,Q,I,N,T){for(var U=0;U<T;U++)I[U]=L[_[U]],N[U]=Q[_[U]]},C.prototype.transform=function(_,L,Q,I,N,T){this.permute(T,_,L,Q,I,N);for(var U=1;U<N;U<<=1)for(var q=U<<1,D=Math.cos(2*Math.PI/q),v=Math.sin(2*Math.PI/q),k=0;k<N;k+=q)for(var G=D,J=v,Qe=0;Qe<U;Qe++){var Re=Q[k+Qe],$e=I[k+Qe],Bt=Q[k+Qe+U],Pt=I[k+Qe+U],ge=G*Bt-J*Pt;Pt=G*Pt+J*Bt,Bt=ge,Q[k+Qe]=Re+Bt,I[k+Qe]=$e+Pt,Q[k+Qe+U]=Re-Bt,I[k+Qe+U]=$e-Pt,Qe!==q&&(ge=D*G-v*J,J=D*J+v*G,G=ge)}},C.prototype.guessLen13b=function(_,L){var Q=Math.max(L,_)|1,I=Q&1,N=0;for(Q=Q/2|0;Q;Q=Q>>>1)N++;return 1<<N+1+I},C.prototype.conjugate=function(_,L,Q){if(!(Q<=1))for(var I=0;I<Q/2;I++){var N=_[I];_[I]=_[Q-I-1],_[Q-I-1]=N,N=L[I],L[I]=-L[Q-I-1],L[Q-I-1]=-N}},C.prototype.normalize13b=function(_,L){for(var Q=0,I=0;I<L/2;I++){var N=Math.round(_[2*I+1]/L)*8192+Math.round(_[2*I]/L)+Q;_[I]=N&67108863,N<67108864?Q=0:Q=N/67108864|0}return _},C.prototype.convert13b=function(_,L,Q,I){for(var N=0,T=0;T<L;T++)N=N+(_[T]|0),Q[2*T]=N&8191,N=N>>>13,Q[2*T+1]=N&8191,N=N>>>13;for(T=2*L;T<I;++T)Q[T]=0;r(N===0),r((N&-8192)===0)},C.prototype.stub=function(_){for(var L=new Array(_),Q=0;Q<_;Q++)L[Q]=0;return L},C.prototype.mulp=function(_,L,Q){var I=2*this.guessLen13b(_.length,L.length),N=this.makeRBT(I),T=this.stub(I),U=new Array(I),q=new Array(I),D=new Array(I),v=new Array(I),k=new Array(I),G=new Array(I),J=Q.words;J.length=I,this.convert13b(_.words,_.length,U,I),this.convert13b(L.words,L.length,v,I),this.transform(U,T,q,D,I,N),this.transform(v,T,k,G,I,N);for(var Qe=0;Qe<I;Qe++){var Re=q[Qe]*k[Qe]-D[Qe]*G[Qe];D[Qe]=q[Qe]*G[Qe]+D[Qe]*k[Qe],q[Qe]=Re}return this.conjugate(q,D,I),this.transform(q,D,J,T,I,N),this.conjugate(J,T,I),this.normalize13b(J,I),Q.negative=_.negative^L.negative,Q.length=_.length+L.length,Q.strip()},i.prototype.mul=function(_){var L=new i(null);return L.words=new Array(this.length+_.length),this.mulTo(_,L)},i.prototype.mulf=function(_){var L=new i(null);return L.words=new Array(this.length+_.length),E(this,_,L)},i.prototype.imul=function(_){return this.clone().mulTo(_,this)},i.prototype.imuln=function(_){r(typeof _=="number"),r(_<67108864);for(var L=0,Q=0;Q<this.length;Q++){var I=(this.words[Q]|0)*_,N=(I&67108863)+(L&67108863);L>>=26,L+=I/67108864|0,L+=N>>>26,this.words[Q]=N&67108863}return L!==0&&(this.words[Q]=L,this.length++),this.length=_===0?1:this.length,this},i.prototype.muln=function(_){return this.clone().imuln(_)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(_){var L=p(_);if(L.length===0)return new i(1);for(var Q=this,I=0;I<L.length&&L[I]===0;I++,Q=Q.sqr());if(++I<L.length)for(var N=Q.sqr();I<L.length;I++,N=N.sqr())L[I]!==0&&(Q=Q.mul(N));return Q},i.prototype.iushln=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26,I=67108863>>>26-L<<26-L,N;if(L!==0){var T=0;for(N=0;N<this.length;N++){var U=this.words[N]&I,q=(this.words[N]|0)-U<<L;this.words[N]=q|T,T=U>>>26-L}T&&(this.words[N]=T,this.length++)}if(Q!==0){for(N=this.length-1;N>=0;N--)this.words[N+Q]=this.words[N];for(N=0;N<Q;N++)this.words[N]=0;this.length+=Q}return this.strip()},i.prototype.ishln=function(_){return r(this.negative===0),this.iushln(_)},i.prototype.iushrn=function(_,L,Q){r(typeof _=="number"&&_>=0);var I;L?I=(L-L%26)/26:I=0;var N=_%26,T=Math.min((_-N)/26,this.length),U=67108863^67108863>>>N<<N,q=Q;if(I-=T,I=Math.max(0,I),q){for(var D=0;D<T;D++)q.words[D]=this.words[D];q.length=T}if(T!==0)if(this.length>T)for(this.length-=T,D=0;D<this.length;D++)this.words[D]=this.words[D+T];else this.words[0]=0,this.length=1;var v=0;for(D=this.length-1;D>=0&&(v!==0||D>=I);D--){var k=this.words[D]|0;this.words[D]=v<<26-N|k>>>N,v=k&U}return q&&v!==0&&(q.words[q.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(_,L,Q){return r(this.negative===0),this.iushrn(_,L,Q)},i.prototype.shln=function(_){return this.clone().ishln(_)},i.prototype.ushln=function(_){return this.clone().iushln(_)},i.prototype.shrn=function(_){return this.clone().ishrn(_)},i.prototype.ushrn=function(_){return this.clone().iushrn(_)},i.prototype.testn=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26,I=1<<L;if(this.length<=Q)return!1;var N=this.words[Q];return!!(N&I)},i.prototype.imaskn=function(_){r(typeof _=="number"&&_>=0);var L=_%26,Q=(_-L)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(L!==0&&Q++,this.length=Math.min(Q,this.length),L!==0){var I=67108863^67108863>>>L<<L;this.words[this.length-1]&=I}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(_){return this.clone().imaskn(_)},i.prototype.iaddn=function(_){return r(typeof _=="number"),r(_<67108864),_<0?this.isubn(-_):this.negative!==0?this.length===1&&(this.words[0]|0)<_?(this.words[0]=_-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(_),this.negative=1,this):this._iaddn(_)},i.prototype._iaddn=function(_){this.words[0]+=_;for(var L=0;L<this.length&&this.words[L]>=67108864;L++)this.words[L]-=67108864,L===this.length-1?this.words[L+1]=1:this.words[L+1]++;return this.length=Math.max(this.length,L+1),this},i.prototype.isubn=function(_){if(r(typeof _=="number"),r(_<67108864),_<0)return this.iaddn(-_);if(this.negative!==0)return this.negative=0,this.iaddn(_),this.negative=1,this;if(this.words[0]-=_,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var L=0;L<this.length&&this.words[L]<0;L++)this.words[L]+=67108864,this.words[L+1]-=1;return this.strip()},i.prototype.addn=function(_){return this.clone().iaddn(_)},i.prototype.subn=function(_){return this.clone().isubn(_)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(_,L,Q){var I=_.length+Q,N;this._expand(I);var T,U=0;for(N=0;N<_.length;N++){T=(this.words[N+Q]|0)+U;var q=(_.words[N]|0)*L;T-=q&67108863,U=(T>>26)-(q/67108864|0),this.words[N+Q]=T&67108863}for(;N<this.length-Q;N++)T=(this.words[N+Q]|0)+U,U=T>>26,this.words[N+Q]=T&67108863;if(U===0)return this.strip();for(r(U===-1),U=0,N=0;N<this.length;N++)T=-(this.words[N]|0)+U,U=T>>26,this.words[N]=T&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(_,L){var Q=this.length-_.length,I=this.clone(),N=_,T=N.words[N.length-1]|0,U=this._countBits(T);Q=26-U,Q!==0&&(N=N.ushln(Q),I.iushln(Q),T=N.words[N.length-1]|0);var q=I.length-N.length,D;if(L!=="mod"){D=new i(null),D.length=q+1,D.words=new Array(D.length);for(var v=0;v<D.length;v++)D.words[v]=0}var k=I.clone()._ishlnsubmul(N,1,q);k.negative===0&&(I=k,D&&(D.words[q]=1));for(var G=q-1;G>=0;G--){var J=(I.words[N.length+G]|0)*67108864+(I.words[N.length+G-1]|0);for(J=Math.min(J/T|0,67108863),I._ishlnsubmul(N,J,G);I.negative!==0;)J--,I.negative=0,I._ishlnsubmul(N,1,G),I.isZero()||(I.negative^=1);D&&(D.words[G]=J)}return D&&D.strip(),I.strip(),L!=="div"&&Q!==0&&I.iushrn(Q),{div:D||null,mod:I}},i.prototype.divmod=function(_,L,Q){if(r(!_.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var I,N,T;return this.negative!==0&&_.negative===0?(T=this.neg().divmod(_,L),L!=="mod"&&(I=T.div.neg()),L!=="div"&&(N=T.mod.neg(),Q&&N.negative!==0&&N.iadd(_)),{div:I,mod:N}):this.negative===0&&_.negative!==0?(T=this.divmod(_.neg(),L),L!=="mod"&&(I=T.div.neg()),{div:I,mod:T.mod}):(this.negative&_.negative)!==0?(T=this.neg().divmod(_.neg(),L),L!=="div"&&(N=T.mod.neg(),Q&&N.negative!==0&&N.isub(_)),{div:T.div,mod:N}):_.length>this.length||this.cmp(_)<0?{div:new i(0),mod:this}:_.length===1?L==="div"?{div:this.divn(_.words[0]),mod:null}:L==="mod"?{div:null,mod:new i(this.modn(_.words[0]))}:{div:this.divn(_.words[0]),mod:new i(this.modn(_.words[0]))}:this._wordDiv(_,L)},i.prototype.div=function(_){return this.divmod(_,"div",!1).div},i.prototype.mod=function(_){return this.divmod(_,"mod",!1).mod},i.prototype.umod=function(_){return this.divmod(_,"mod",!0).mod},i.prototype.divRound=function(_){var L=this.divmod(_);if(L.mod.isZero())return L.div;var Q=L.div.negative!==0?L.mod.isub(_):L.mod,I=_.ushrn(1),N=_.andln(1),T=Q.cmp(I);return T<0||N===1&&T===0?L.div:L.div.negative!==0?L.div.isubn(1):L.div.iaddn(1)},i.prototype.modn=function(_){r(_<=67108863);for(var L=(1<<26)%_,Q=0,I=this.length-1;I>=0;I--)Q=(L*Q+(this.words[I]|0))%_;return Q},i.prototype.idivn=function(_){r(_<=67108863);for(var L=0,Q=this.length-1;Q>=0;Q--){var I=(this.words[Q]|0)+L*67108864;this.words[Q]=I/_|0,L=I%_}return this.strip()},i.prototype.divn=function(_){return this.clone().idivn(_)},i.prototype.egcd=function(_){r(_.negative===0),r(!_.isZero());var L=this,Q=_.clone();L.negative!==0?L=L.umod(_):L=L.clone();for(var I=new i(1),N=new i(0),T=new i(0),U=new i(1),q=0;L.isEven()&&Q.isEven();)L.iushrn(1),Q.iushrn(1),++q;for(var D=Q.clone(),v=L.clone();!L.isZero();){for(var k=0,G=1;(L.words[0]&G)===0&&k<26;++k,G<<=1);if(k>0)for(L.iushrn(k);k-- >0;)(I.isOdd()||N.isOdd())&&(I.iadd(D),N.isub(v)),I.iushrn(1),N.iushrn(1);for(var J=0,Qe=1;(Q.words[0]&Qe)===0&&J<26;++J,Qe<<=1);if(J>0)for(Q.iushrn(J);J-- >0;)(T.isOdd()||U.isOdd())&&(T.iadd(D),U.isub(v)),T.iushrn(1),U.iushrn(1);L.cmp(Q)>=0?(L.isub(Q),I.isub(T),N.isub(U)):(Q.isub(L),T.isub(I),U.isub(N))}return{a:T,b:U,gcd:Q.iushln(q)}},i.prototype._invmp=function(_){r(_.negative===0),r(!_.isZero());var L=this,Q=_.clone();L.negative!==0?L=L.umod(_):L=L.clone();for(var I=new i(1),N=new i(0),T=Q.clone();L.cmpn(1)>0&&Q.cmpn(1)>0;){for(var U=0,q=1;(L.words[0]&q)===0&&U<26;++U,q<<=1);if(U>0)for(L.iushrn(U);U-- >0;)I.isOdd()&&I.iadd(T),I.iushrn(1);for(var D=0,v=1;(Q.words[0]&v)===0&&D<26;++D,v<<=1);if(D>0)for(Q.iushrn(D);D-- >0;)N.isOdd()&&N.iadd(T),N.iushrn(1);L.cmp(Q)>=0?(L.isub(Q),I.isub(N)):(Q.isub(L),N.isub(I))}var k;return L.cmpn(1)===0?k=I:k=N,k.cmpn(0)<0&&k.iadd(_),k},i.prototype.gcd=function(_){if(this.isZero())return _.abs();if(_.isZero())return this.abs();var L=this.clone(),Q=_.clone();L.negative=0,Q.negative=0;for(var I=0;L.isEven()&&Q.isEven();I++)L.iushrn(1),Q.iushrn(1);do{for(;L.isEven();)L.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var N=L.cmp(Q);if(N<0){var T=L;L=Q,Q=T}else if(N===0||Q.cmpn(1)===0)break;L.isub(Q)}while(!0);return Q.iushln(I)},i.prototype.invm=function(_){return this.egcd(_).a.umod(_)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(_){return this.words[0]&_},i.prototype.bincn=function(_){r(typeof _=="number");var L=_%26,Q=(_-L)/26,I=1<<L;if(this.length<=Q)return this._expand(Q+1),this.words[Q]|=I,this;for(var N=I,T=Q;N!==0&&T<this.length;T++){var U=this.words[T]|0;U+=N,N=U>>>26,U&=67108863,this.words[T]=U}return N!==0&&(this.words[T]=N,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(_){var L=_<0;if(this.negative!==0&&!L)return-1;if(this.negative===0&&L)return 1;this.strip();var Q;if(this.length>1)Q=1;else{L&&(_=-_),r(_<=67108863,"Number is too big");var I=this.words[0]|0;Q=I===_?0:I<_?-1:1}return this.negative!==0?-Q|0:Q},i.prototype.cmp=function(_){if(this.negative!==0&&_.negative===0)return-1;if(this.negative===0&&_.negative!==0)return 1;var L=this.ucmp(_);return this.negative!==0?-L|0:L},i.prototype.ucmp=function(_){if(this.length>_.length)return 1;if(this.length<_.length)return-1;for(var L=0,Q=this.length-1;Q>=0;Q--){var I=this.words[Q]|0,N=_.words[Q]|0;if(I!==N){I<N?L=-1:I>N&&(L=1);break}}return L},i.prototype.gtn=function(_){return this.cmpn(_)===1},i.prototype.gt=function(_){return this.cmp(_)===1},i.prototype.gten=function(_){return this.cmpn(_)>=0},i.prototype.gte=function(_){return this.cmp(_)>=0},i.prototype.ltn=function(_){return this.cmpn(_)===-1},i.prototype.lt=function(_){return this.cmp(_)===-1},i.prototype.lten=function(_){return this.cmpn(_)<=0},i.prototype.lte=function(_){return this.cmp(_)<=0},i.prototype.eqn=function(_){return this.cmpn(_)===0},i.prototype.eq=function(_){return this.cmp(_)===0},i.red=function(_){return new V(_)},i.prototype.toRed=function(_){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),_.convertTo(this)._forceRed(_)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(_){return this.red=_,this},i.prototype.forceRed=function(_){return r(!this.red,"Already a number in reduction context"),this._forceRed(_)},i.prototype.redAdd=function(_){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,_)},i.prototype.redIAdd=function(_){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,_)},i.prototype.redSub=function(_){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,_)},i.prototype.redISub=function(_){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,_)},i.prototype.redShl=function(_){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,_)},i.prototype.redMul=function(_){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.mul(this,_)},i.prototype.redIMul=function(_){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,_),this.red.imul(this,_)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(_){return r(this.red&&!_.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,_)};var y={k256:null,p224:null,p192:null,p25519:null};function b(X,_){this.name=X,this.p=new i(_,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}b.prototype._tmp=function(){var _=new i(null);return _.words=new Array(Math.ceil(this.n/13)),_},b.prototype.ireduce=function(_){var L=_,Q;do this.split(L,this.tmp),L=this.imulK(L),L=L.iadd(this.tmp),Q=L.bitLength();while(Q>this.n);var I=Q<this.n?-1:L.ucmp(this.p);return I===0?(L.words[0]=0,L.length=1):I>0?L.isub(this.p):L.strip!==void 0?L.strip():L._strip(),L},b.prototype.split=function(_,L){_.iushrn(this.n,0,L)},b.prototype.imulK=function(_){return _.imul(this.k)};function O(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(O,b),O.prototype.split=function(_,L){for(var Q=4194303,I=Math.min(_.length,9),N=0;N<I;N++)L.words[N]=_.words[N];if(L.length=I,_.length<=9){_.words[0]=0,_.length=1;return}var T=_.words[9];for(L.words[L.length++]=T&Q,N=10;N<_.length;N++){var U=_.words[N]|0;_.words[N-10]=(U&Q)<<4|T>>>22,T=U}T>>>=22,_.words[N-10]=T,T===0&&_.length>10?_.length-=10:_.length-=9},O.prototype.imulK=function(_){_.words[_.length]=0,_.words[_.length+1]=0,_.length+=2;for(var L=0,Q=0;Q<_.length;Q++){var I=_.words[Q]|0;L+=I*977,_.words[Q]=L&67108863,L=I*64+(L/67108864|0)}return _.words[_.length-1]===0&&(_.length--,_.words[_.length-1]===0&&_.length--),_};function M(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(M,b);function S(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(S,b);function P(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(P,b),P.prototype.imulK=function(_){for(var L=0,Q=0;Q<_.length;Q++){var I=(_.words[Q]|0)*19+L,N=I&67108863;I>>>=26,_.words[Q]=N,L=I}return L!==0&&(_.words[_.length++]=L),_},i._prime=function(_){if(y[_])return y[_];var L;if(_==="k256")L=new O;else if(_==="p224")L=new M;else if(_==="p192")L=new S;else if(_==="p25519")L=new P;else throw new Error("Unknown prime "+_);return y[_]=L,L};function V(X){if(typeof X=="string"){var _=i._prime(X);this.m=_.p,this.prime=_}else r(X.gtn(1),"modulus must be greater than 1"),this.m=X,this.prime=null}V.prototype._verify1=function(_){r(_.negative===0,"red works only with positives"),r(_.red,"red works only with red numbers")},V.prototype._verify2=function(_,L){r((_.negative|L.negative)===0,"red works only with positives"),r(_.red&&_.red===L.red,"red works only with red numbers")},V.prototype.imod=function(_){return this.prime?this.prime.ireduce(_)._forceRed(this):_.umod(this.m)._forceRed(this)},V.prototype.neg=function(_){return _.isZero()?_.clone():this.m.sub(_)._forceRed(this)},V.prototype.add=function(_,L){this._verify2(_,L);var Q=_.add(L);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},V.prototype.iadd=function(_,L){this._verify2(_,L);var Q=_.iadd(L);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},V.prototype.sub=function(_,L){this._verify2(_,L);var Q=_.sub(L);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},V.prototype.isub=function(_,L){this._verify2(_,L);var Q=_.isub(L);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},V.prototype.shl=function(_,L){return this._verify1(_),this.imod(_.ushln(L))},V.prototype.imul=function(_,L){return this._verify2(_,L),this.imod(_.imul(L))},V.prototype.mul=function(_,L){return this._verify2(_,L),this.imod(_.mul(L))},V.prototype.isqr=function(_){return this.imul(_,_.clone())},V.prototype.sqr=function(_){return this.mul(_,_)},V.prototype.sqrt=function(_){if(_.isZero())return _.clone();var L=this.m.andln(3);if(r(L%2===1),L===3){var Q=this.m.add(new i(1)).iushrn(2);return this.pow(_,Q)}for(var I=this.m.subn(1),N=0;!I.isZero()&&I.andln(1)===0;)N++,I.iushrn(1);r(!I.isZero());var T=new i(1).toRed(this),U=T.redNeg(),q=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new i(2*D*D).toRed(this);this.pow(D,q).cmp(U)!==0;)D.redIAdd(U);for(var v=this.pow(D,I),k=this.pow(_,I.addn(1).iushrn(1)),G=this.pow(_,I),J=N;G.cmp(T)!==0;){for(var Qe=G,Re=0;Qe.cmp(T)!==0;Re++)Qe=Qe.redSqr();r(Re<J);var $e=this.pow(v,new i(1).iushln(J-Re-1));k=k.redMul($e),v=$e.redSqr(),G=G.redMul(v),J=Re}return k},V.prototype.invm=function(_){var L=_._invmp(this.m);return L.negative!==0?(L.negative=0,this.imod(L).redNeg()):this.imod(L)},V.prototype.pow=function(_,L){if(L.isZero())return new i(1).toRed(this);if(L.cmpn(1)===0)return _.clone();var Q=4,I=new Array(1<<Q);I[0]=new i(1).toRed(this),I[1]=_;for(var N=2;N<I.length;N++)I[N]=this.mul(I[N-1],_);var T=I[0],U=0,q=0,D=L.bitLength()%26;for(D===0&&(D=26),N=L.length-1;N>=0;N--){for(var v=L.words[N],k=D-1;k>=0;k--){var G=v>>k&1;if(T!==I[0]&&(T=this.sqr(T)),G===0&&U===0){q=0;continue}U<<=1,U|=G,q++,!(q!==Q&&(N!==0||k!==0))&&(T=this.mul(T,I[U]),q=0,U=0)}D=26}return T},V.prototype.convertTo=function(_){var L=_.umod(this.m);return L===_?L.clone():L},V.prototype.convertFrom=function(_){var L=_.clone();return L.red=null,L},i.mont=function(_){return new Z(_)};function Z(X){V.call(this,X),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(Z,V),Z.prototype.convertTo=function(_){return this.imod(_.ushln(this.shift))},Z.prototype.convertFrom=function(_){var L=this.imod(_.mul(this.rinv));return L.red=null,L},Z.prototype.imul=function(_,L){if(_.isZero()||L.isZero())return _.words[0]=0,_.length=1,_;var Q=_.imul(L),I=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=Q.isub(I).iushrn(this.shift),T=N;return N.cmp(this.m)>=0?T=N.isub(this.m):N.cmpn(0)<0&&(T=N.iadd(this.m)),T._forceRed(this)},Z.prototype.mul=function(_,L){if(_.isZero()||L.isZero())return new i(0)._forceRed(this);var Q=_.mul(L),I=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=Q.isub(I).iushrn(this.shift),T=N;return N.cmp(this.m)>=0?T=N.isub(this.m):N.cmpn(0)<0&&(T=N.iadd(this.m)),T._forceRed(this)},Z.prototype.invm=function(_){var L=this.imod(_._invmp(this.m).mul(this.r2));return L._forceRed(this)}})(typeof HHt>"u"||HHt,kEn)});var Fje=m(FEn=>{"use strict";var vto=TE();function M_(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}FEn.Reporter=M_;M_.prototype.isError=function(e){return e instanceof pte};M_.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};M_.prototype.restore=function(e){let r=this._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)};M_.prototype.enterKey=function(e){return this._reporterState.path.push(e)};M_.prototype.exitKey=function(e){let r=this._reporterState;r.path=r.path.slice(0,e-1)};M_.prototype.leaveKey=function(e,r,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[r]=n)};M_.prototype.path=function(){return this._reporterState.path.join("/")};M_.prototype.enterObject=function(){let e=this._reporterState,r=e.obj;return e.obj={},r};M_.prototype.leaveObject=function(e){let r=this._reporterState,n=r.obj;return r.obj=e,n};M_.prototype.error=function(e){let r,n=this._reporterState,i=e instanceof pte;if(i?r=e:r=new pte(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw r;return i||n.errors.push(r),r};M_.prototype.wrapResult=function(e){let r=this._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e};function pte(t,e){this.path=t,this.rethrow(e)}vto(pte,Error);pte.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,pte),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}});var gte=m(VHt=>{"use strict";var Nto=TE(),qje=Fje().Reporter,fte=Tb().Buffer;function O_(t,e){if(qje.call(this,e),!fte.isBuffer(t)){this.error("Input not Buffer");return}this.base=t,this.offset=0,this.length=t.length}Nto(O_,qje);VHt.DecoderBuffer=O_;O_.isDecoderBuffer=function(e){return e instanceof O_?!0:typeof e=="object"&&fte.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};O_.prototype.save=function(){return{offset:this.offset,reporter:qje.prototype.save.call(this)}};O_.prototype.restore=function(e){let r=new O_(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,qje.prototype.restore.call(this,e.reporter),r};O_.prototype.isEmpty=function(){return this.offset===this.length};O_.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};O_.prototype.skip=function(e,r){if(!(this.offset+e<=this.length))return this.error(r||"DecoderBuffer overrun");let n=new O_(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};O_.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function hte(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(r){return hte.isEncoderBuffer(r)||(r=new hte(r,e)),this.length+=r.length,r},this);else if(typeof t=="number"){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if(typeof t=="string")this.value=t,this.length=fte.byteLength(t);else if(fte.isBuffer(t))this.value=t,this.length=t.length;else return e.error("Unsupported type: "+typeof t)}VHt.EncoderBuffer=hte;hte.isEncoderBuffer=function(e){return e instanceof hte?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};hte.prototype.join=function(e,r){return e||(e=fte.alloc(this.length)),r||(r=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,r),r+=n.length}):(typeof this.value=="number"?e[r]=this.value:typeof this.value=="string"?e.write(this.value,r):fte.isBuffer(this.value)&&this.value.copy(e,r),r+=this.length)),e}});var GEn=m((cZa,UEn)=>{UEn.exports=qEn;function qEn(t,e){if(!t)throw new Error(e||"Assertion failed")}qEn.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)}});var Uje=m((uZa,HEn)=>{"use strict";var Qto=Fje().Reporter,zto=gte().EncoderBuffer,Lto=gte().DecoderBuffer,vm=GEn(),WEn=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],Pto=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(WEn),kto=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Mc(t,e,r){let n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}HEn.exports=Mc;var Fto=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Mc.prototype.clone=function(){let e=this._baseState,r={};Fto.forEach(function(i){r[i]=e[i]});let n=new this.constructor(r.parent);return n._baseState=r,n};Mc.prototype._wrap=function(){let e=this._baseState;Pto.forEach(function(r){this[r]=function(){let i=new this.constructor(this);return e.children.push(i),i[r].apply(i,arguments)}},this)};Mc.prototype._init=function(e){let r=this._baseState;vm(r.parent===null),e.call(this),r.children=r.children.filter(function(n){return n._baseState.parent===this},this),vm.equal(r.children.length,1,"Root node can have only one child")};Mc.prototype._useArgs=function(e){let r=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(vm(r.children===null),r.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(vm(r.args===null),r.args=e,r.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};kto.forEach(function(t){Mc.prototype[t]=function(){let r=this._baseState;throw new Error(t+" not implemented for encoding: "+r.enc)}});WEn.forEach(function(t){Mc.prototype[t]=function(){let r=this._baseState,n=Array.prototype.slice.call(arguments);return vm(r.tag===null),r.tag=t,this._useArgs(n),this}});Mc.prototype.use=function(e){vm(e);let r=this._baseState;return vm(r.use===null),r.use=e,this};Mc.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};Mc.prototype.def=function(e){let r=this._baseState;return vm(r.default===null),r.default=e,r.optional=!0,this};Mc.prototype.explicit=function(e){let r=this._baseState;return vm(r.explicit===null&&r.implicit===null),r.explicit=e,this};Mc.prototype.implicit=function(e){let r=this._baseState;return vm(r.explicit===null&&r.implicit===null),r.implicit=e,this};Mc.prototype.obj=function(){let e=this._baseState,r=Array.prototype.slice.call(arguments);return e.obj=!0,r.length!==0&&this._useArgs(r),this};Mc.prototype.key=function(e){let r=this._baseState;return vm(r.key===null),r.key=e,this};Mc.prototype.any=function(){let e=this._baseState;return e.any=!0,this};Mc.prototype.choice=function(e){let r=this._baseState;return vm(r.choice===null),r.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};Mc.prototype.contains=function(e){let r=this._baseState;return vm(r.use===null),r.contains=e,this};Mc.prototype._decode=function(e,r){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,r));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,r):this._decodeChoice(e,r),s=!0}catch{s=!1}e.restore(u)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let l=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(l))return l;n.any?i=e.raw(u):e=l}if(r&&r.track&&n.tag!==null&&r.track(e.path(),c,e.length,"tagged"),r&&r.track&&n.tag!==null&&r.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,r):i=this._decodeChoice(e,r)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(l){l._decode(e,r)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new Lto(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,r)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};Mc.prototype._decodeGeneric=function(e,r,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(r,e,i.args[0],n):/str$/.test(e)?this._decodeStr(r,e,n):e==="objid"&&i.args?this._decodeObjid(r,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(r,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(r,e,n):e==="null_"?this._decodeNull(r,n):e==="bool"?this._decodeBool(r,n):e==="objDesc"?this._decodeStr(r,e,n):e==="int"||e==="enum"?this._decodeInt(r,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,r._reporterState.obj)._decode(r,n):r.error("unknown tag: "+e)};Mc.prototype._getUse=function(e,r){let n=this._baseState;return n.useDecoder=this._use(e,r),vm(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};Mc.prototype._decodeChoice=function(e,r){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let u=c._decode(e,r);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};Mc.prototype._createEncoderBuffer=function(e){return new zto(e,this.reporter)};Mc.prototype._encode=function(e,r,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,r,n);if(s!==void 0&&!this._skipDefault(s,r,n))return s};Mc.prototype._encodeValue=function(e,r,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,r||new Qto);let s=null;if(this.reporter=r,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,r);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,r),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,r,e);if(c._baseState.key===null)return r.error("Child should have a key");let u=r.enterKey(c._baseState.key);if(typeof e!="object")return r.error("Child expected, but input is not object");let l=c._encode(e[c._baseState.key],r,e);return r.leaveKey(u),l},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return r.error("Too many args for : "+i.tag);if(!Array.isArray(e))return r.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(u){let l=this._baseState;return this._getUse(l.args[0],e)._encode(u,r)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,r):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,u=i.implicit===null?"universal":"context";c===null?i.use===null&&r.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};Mc.prototype._encodeChoice=function(e,r){let n=this._baseState,i=n.choice[e.type];return i||vm(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,r)};Mc.prototype._encodePrimitive=function(e,r){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(r,e);if(e==="objid"&&n.args)return this._encodeObjid(r,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(r,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(r,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(r,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(r);if(e==="objDesc")return this._encodeStr(r,e);throw new Error("Unsupported tag: "+e)};Mc.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};Mc.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Gje=m(a7=>{"use strict";function jEn(t){let e={};return Object.keys(t).forEach(function(r){(r|0)==r&&(r=r|0);let n=t[r];e[n]=r}),e}a7.tagClass={0:"universal",1:"application",2:"context",3:"private"};a7.tagClassByName=jEn(a7.tagClass);a7.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};a7.tagByName=jEn(a7.tag)});var $Ht=m((AZa,$En)=>{"use strict";var qto=TE(),Hv=Tb().Buffer,VEn=Uje(),KHt=Gje();function KEn(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new OM,this.tree._init(t.body)}$En.exports=KEn;KEn.prototype.encode=function(e,r){return this.tree._encode(e,r).join()};function OM(t){VEn.call(this,"der",t)}qto(OM,VEn);OM.prototype._encodeComposite=function(e,r,n,i){let s=Uto(e,r,n,this.reporter);if(i.length<128){let c=Hv.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=Hv.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};OM.prototype._encodeStr=function(e,r){if(r==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(r==="bmpstr"){let n=Hv.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return r==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):r==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)?this._createEncoderBuffer(e):r==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")};OM.prototype._encodeObjid=function(e,r,n){if(typeof e=="string"){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=Hv.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function R_(t){return t<10?"0"+t:t}OM.prototype._encodeTime=function(e,r){let n,i=new Date(e);return r==="gentime"?n=[R_(i.getUTCFullYear()),R_(i.getUTCMonth()+1),R_(i.getUTCDate()),R_(i.getUTCHours()),R_(i.getUTCMinutes()),R_(i.getUTCSeconds()),"Z"].join(""):r==="utctime"?n=[R_(i.getUTCFullYear()%100),R_(i.getUTCMonth()+1),R_(i.getUTCDate()),R_(i.getUTCHours()),R_(i.getUTCMinutes()),R_(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(n,"octstr")};OM.prototype._encodeNull=function(){return this._createEncoderBuffer("")};OM.prototype._encodeInt=function(e,r){if(typeof e=="string"){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if(typeof e!="number"&&!Hv.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=Hv.from(s)}if(Hv.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=Hv.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(Hv.from(i))};OM.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};OM.prototype._use=function(e,r){return typeof e=="function"&&(e=e(r)),e._getEncoder("der").tree};OM.prototype._skipDefault=function(e,r,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,r,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function Uto(t,e,r,n){let i;if(t==="seqof"?t="seq":t==="setof"&&(t="set"),KHt.tagByName.hasOwnProperty(t))i=KHt.tagByName[t];else if(typeof t=="number"&&(t|0)===t)i=t;else return n.error("Unknown tag: "+t);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=KHt.tagClassByName[r||"universal"]<<6,i)}});var JEn=m((dZa,YEn)=>{"use strict";var Gto=TE(),YHt=$Ht();function JHt(t){YHt.call(this,t),this.enc="pem"}Gto(JHt,YHt);YEn.exports=JHt;JHt.prototype.encode=function(e,r){let i=YHt.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+r.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+r.label+"-----"),s.join(`
|
|
4120
4120
|
`)}});var XHt=m(ZEn=>{"use strict";var XEn=ZEn;XEn.der=$Ht();XEn.pem=JEn()});var ejt=m((fZa,s2n)=>{"use strict";var Wto=TE(),Hto=jHt(),e2n=gte().DecoderBuffer,r2n=Uje(),t2n=Gje();function n2n(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new CI,this.tree._init(t.body)}s2n.exports=n2n;n2n.prototype.decode=function(e,r){return e2n.isDecoderBuffer(e)||(e=new e2n(e,r)),this.tree._decode(e,r)};function CI(t){r2n.call(this,"der",t)}Wto(CI,r2n);CI.prototype._peekTag=function(e,r,n){if(e.isEmpty())return!1;let i=e.save(),s=ZHt(e,'Failed to peek tag: "'+r+'"');return e.isError(s)?s:(e.restore(i),s.tag===r||s.tagStr===r||s.tagStr+"of"===r||n)};CI.prototype._decodeTag=function(e,r,n){let i=ZHt(e,'Failed to decode tag of "'+r+'"');if(e.isError(i))return i;let s=i2n(e,i.primitive,'Failed to get length of "'+r+'"');if(e.isError(s))return s;if(!n&&i.tag!==r&&i.tagStr!==r&&i.tagStr+"of"!==r)return e.error('Failed to match tag: "'+r+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+r+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+r+'"'))};CI.prototype._skipUntilEnd=function(e,r){for(;;){let n=ZHt(e,r);if(e.isError(n))return n;let i=i2n(e,n.primitive,r);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,r),e.isError(s))return s;if(n.tagStr==="end")break}};CI.prototype._decodeList=function(e,r,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};CI.prototype._decodeStr=function(e,r){if(r==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(r==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(r==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(r==="octstr")return e.raw();if(r==="objDesc")return e.raw();if(r==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(r)?e.raw().toString():e.error("Decoding of string type: "+r+" unsupported")}};CI.prototype._decodeObjid=function(e,r,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),r){let l=r[i.join(" ")];l===void 0&&(l=r[i.join(".")]),l!==void 0&&(i=l)}return i};CI.prototype._decodeTime=function(e,r){let n=e.raw().toString(),i,s,o,a,c,u;if(r==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,u=n.slice(12,14)|0;else if(r==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,u=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+r+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,u,0)};CI.prototype._decodeNull=function(){return null};CI.prototype._decodeBool=function(e){let r=e.readUInt8();return e.isError(r)?r:r!==0};CI.prototype._decodeInt=function(e,r){let n=e.raw(),i=new Hto(n);return r&&(i=r[i.toString(10)]||i),i};CI.prototype._use=function(e,r){return typeof e=="function"&&(e=e(r)),e._getDecoder("der").tree};function ZHt(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;let n=t2n.tagClass[r>>6],i=(r&32)===0;if((r&31)===31){let o=r;for(r=0;(o&128)===128;){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=o&127}}else r&=31;let s=t2n.tag[r];return{cls:n,primitive:i,tag:r,tagStr:s}}function i2n(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return t.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=t.readUInt8(r);if(t.isError(o))return o;n|=o}return n}});var a2n=m((hZa,o2n)=>{"use strict";var jto=TE(),Vto=Tb().Buffer,tjt=ejt();function rjt(t){tjt.call(this,t),this.enc="pem"}jto(rjt,tjt);o2n.exports=rjt;rjt.prototype.decode=function(e,r){let n=e.toString().split(/[\r\n]+/g),i=r.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let l=0;l<n.length;l++){let A=n[l].match(s);if(A!==null&&A[2]===i)if(o===-1){if(A[1]!=="BEGIN")break;o=l}else{if(A[1]!=="END")break;a=l;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let u=Vto.from(c,"base64");return tjt.prototype.decode.call(this,u,r)}});var njt=m(u2n=>{"use strict";var c2n=u2n;c2n.der=ejt();c2n.pem=a2n()});var A2n=m(l2n=>{"use strict";var Kto=XHt(),$to=njt(),Yto=TE(),Jto=l2n;Jto.define=function(e,r){return new mte(e,r)};function mte(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}mte.prototype._createNamed=function(e){let r=this.name;function n(i){this._initNamed(i,r)}return Yto(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};mte.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed($to[e])),this.decoders[e]};mte.prototype.decode=function(e,r,n){return this._getDecoder(r).decode(e,n)};mte.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(Kto[e])),this.encoders[e]};mte.prototype.encode=function(e,r,n){return this._getEncoder(r).encode(e,n)}});var p2n=m(d2n=>{"use strict";var Wje=d2n;Wje.Reporter=Fje().Reporter;Wje.DecoderBuffer=gte().DecoderBuffer;Wje.EncoderBuffer=gte().EncoderBuffer;Wje.Node=Uje()});var g2n=m(h2n=>{"use strict";var f2n=h2n;f2n._reverse=function(e){let r={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];r[i]=n}),r};f2n.der=Gje()});var Hje=m(m2n=>{"use strict";var Ete=m2n;Ete.bignum=jHt();Ete.define=A2n().define;Ete.base=p2n();Ete.constants=g2n();Ete.decoders=njt();Ete.encoders=XHt()});var S_=m(CCn=>{"use strict";var zn=Hje(),Fn=CCn,Xto={"2 5 29 9":"subjectDirectoryAttributes","2 5 29 14":"subjectKeyIdentifier","2 5 29 15":"keyUsage","2 5 29 17":"subjectAlternativeName","2 5 29 18":"issuerAlternativeName","2 5 29 19":"basicConstraints","2 5 29 20":"cRLNumber","2 5 29 21":"reasonCode","2 5 29 24":"invalidityDate","2 5 29 27":"deltaCRLIndicator","2 5 29 28":"issuingDistributionPoint","2 5 29 29":"certificateIssuer","2 5 29 30":"nameConstraints","2 5 29 31":"cRLDistributionPoints","2 5 29 32":"certificatePolicies","2 5 29 33":"policyMappings","2 5 29 35":"authorityKeyIdentifier","2 5 29 36":"policyConstraints","2 5 29 37":"extendedKeyUsage","2 5 29 46":"freshestCRL","2 5 29 54":"inhibitAnyPolicy","1 3 6 1 5 5 7 1 1":"authorityInformationAccess","1 3 6 1 5 5 7 11":"subjectInformationAccess"},Zto=zn.define("CertificateList",function(){this.seq().obj(this.key("tbsCertList").use(b2n),this.key("signatureAlgorithm").use(Ite),this.key("signature").bitstr())});Fn.CertificateList=Zto;var Ite=zn.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional().any())});Fn.AlgorithmIdentifier=Ite;var ero=zn.define("Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(E2n),this.key("signatureAlgorithm").use(Ite),this.key("signature").bitstr())});Fn.Certificate=ero;var E2n=zn.define("TBSCertificate",function(){this.seq().obj(this.key("version").def("v1").explicit(0).use(C2n),this.key("serialNumber").int(),this.key("signature").use(Ite),this.key("issuer").use(MEe),this.key("validity").use(I2n),this.key("subject").use(MEe),this.key("subjectPublicKeyInfo").use(y2n),this.key("issuerUniqueID").optional().implicit(1).bitstr(),this.key("subjectUniqueID").optional().implicit(2).bitstr(),this.key("extensions").optional().explicit(3).seqof(Kje))});Fn.TBSCertificate=E2n;var C2n=zn.define("Version",function(){this.int({0:"v1",1:"v2",2:"v3"})});Fn.Version=C2n;var I2n=zn.define("Validity",function(){this.seq().obj(this.key("notBefore").use(Cte),this.key("notAfter").use(Cte))});Fn.Validity=I2n;var Cte=zn.define("Time",function(){this.choice({utcTime:this.utctime(),genTime:this.gentime()})});Fn.Time=Cte;var y2n=zn.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Ite),this.key("subjectPublicKey").bitstr())});Fn.SubjectPublicKeyInfo=y2n;var b2n=zn.define("TBSCertList",function(){this.seq().obj(this.key("version").optional().int(),this.key("signature").use(Ite),this.key("issuer").use(MEe),this.key("thisUpdate").use(Cte),this.key("nextUpdate").use(Cte),this.key("revokedCertificates").optional().seqof(tro),this.key("crlExtensions").explicit(0).optional().seqof(Kje))});Fn.TBSCertList=b2n;var tro=zn.define("RevokedCertificate",function(){this.seq().obj(this.key("userCertificate").use(Ajt),this.key("revocationDate").use(Cte),this.key("crlEntryExtensions").optional().seqof(Kje))}),Kje=zn.define("Extension",function(){this.seq().obj(this.key("extnID").objid(Xto),this.key("critical").bool().def(!1),this.key("extnValue").octstr().contains(function(t){let e=nro[t.extnID];return e||zn.define("OctString",function(){this.any()})}))});Fn.Extension=Kje;var MEe=zn.define("Name",function(){this.choice({rdnSequence:this.use(B2n)})});Fn.Name=MEe;var $je=zn.define("GeneralName",function(){this.choice({otherName:this.implicit(0).use(_2n),rfc822Name:this.implicit(1).ia5str(),dNSName:this.implicit(2).ia5str(),directoryName:this.explicit(4).use(MEe),ediPartyName:this.implicit(5).use(x2n),uniformResourceIdentifier:this.implicit(6).ia5str(),iPAddress:this.implicit(7).octstr(),registeredID:this.implicit(8).objid()})});Fn.GeneralName=$je;var c7=zn.define("GeneralNames",function(){this.seqof($je)});Fn.GeneralNames=c7;var _2n=zn.define("AnotherName",function(){this.seq().obj(this.key("type-id").objid(),this.key("value").explicit(0).any())});Fn.AnotherName=_2n;var x2n=zn.define("EDIPartyName",function(){this.seq().obj(this.key("nameAssigner").implicit(0).optional().use(ijt),this.key("partyName").implicit(1).use(ijt))});Fn.EDIPartyName=x2n;var B2n=zn.define("RDNSequence",function(){this.seqof(ajt)});Fn.RDNSequence=B2n;var ajt=zn.define("RelativeDistinguishedName",function(){this.setof(M2n)});Fn.RelativeDistinguishedName=ajt;var M2n=zn.define("AttributeTypeAndValue",function(){this.seq().obj(this.key("type").use(cjt),this.key("value").use(ujt))});Fn.AttributeTypeAndValue=M2n;var O2n=zn.define("Attribute",function(){this.seq().obj(this.key("type").use(cjt),this.key("values").setof(ujt))});Fn.Attribute=O2n;var cjt=zn.define("AttributeType",function(){this.objid()});Fn.AttributeType=cjt;var ujt=zn.define("AttributeValue",function(){this.any()});Fn.AttributeValue=ujt;var ijt=zn.define("DirectoryString",function(){this.choice({teletexString:this.t61str(),printableString:this.printstr(),universalString:this.unistr(),utf8String:this.utf8str(),bmpString:this.bmpstr()})});Fn.DirectoryString=ijt;var R2n=zn.define("AuthorityKeyIdentifier",function(){this.seq().obj(this.key("keyIdentifier").implicit(0).optional().use(ljt),this.key("authorityCertIssuer").implicit(1).optional().use(c7),this.key("authorityCertSerialNumber").implicit(2).optional().use(Ajt))});Fn.AuthorityKeyIdentifier=R2n;var ljt=zn.define("KeyIdentifier",function(){this.octstr()});Fn.KeyIdentifier=ljt;var Ajt=zn.define("CertificateSerialNumber",function(){this.int()});Fn.CertificateSerialNumber=Ajt;var rro=zn.define("ORAddress",function(){this.seq().obj(this.key("builtInStandardAttributes").use(S2n),this.key("builtInDomainDefinedAttributes").optional().use(q2n),this.key("extensionAttributes").optional().use(G2n))});Fn.ORAddress=rro;var S2n=zn.define("BuiltInStandardAttributes",function(){this.seq().obj(this.key("countryName").optional().use(w2n),this.key("administrationDomainName").optional().use(T2n),this.key("networkAddress").implicit(0).optional().use(D2n),this.key("terminalIdentifier").implicit(1).optional().use(N2n),this.key("privateDomainName").explicit(2).optional().use(Q2n),this.key("organizationName").implicit(3).optional().use(z2n),this.key("numericUserIdentifier").implicit(4).optional().use(L2n),this.key("personalName").implicit(5).optional().use(P2n),this.key("organizationalUnitNames").implicit(6).optional().use(k2n))});Fn.BuiltInStandardAttributes=S2n;var w2n=zn.define("CountryName",function(){this.choice({x121DccCode:this.numstr(),iso3166Alpha2Code:this.printstr()})});Fn.CountryName=w2n;var T2n=zn.define("AdministrationDomainName",function(){this.choice({numeric:this.numstr(),printable:this.printstr()})});Fn.AdministrationDomainName=T2n;var D2n=zn.define("NetworkAddress",function(){this.use(v2n)});Fn.NetworkAddress=D2n;var v2n=zn.define("X121Address",function(){this.numstr()});Fn.X121Address=v2n;var N2n=zn.define("TerminalIdentifier",function(){this.printstr()});Fn.TerminalIdentifier=N2n;var Q2n=zn.define("PrivateDomainName",function(){this.choice({numeric:this.numstr(),printable:this.printstr()})});Fn.PrivateDomainName=Q2n;var z2n=zn.define("OrganizationName",function(){this.printstr()});Fn.OrganizationName=z2n;var L2n=zn.define("NumericUserIdentifier",function(){this.numstr()});Fn.NumericUserIdentifier=L2n;var P2n=zn.define("PersonalName",function(){this.set().obj(this.key("surname").implicit(0).printstr(),this.key("givenName").implicit(1).printstr(),this.key("initials").implicit(2).printstr(),this.key("generationQualifier").implicit(3).printstr())});Fn.PersonalName=P2n;var k2n=zn.define("OrganizationalUnitNames",function(){this.seqof(F2n)});Fn.OrganizationalUnitNames=k2n;var F2n=zn.define("OrganizationalUnitName",function(){this.printstr()});Fn.OrganizationalUnitName=F2n;var q2n=zn.define("BuiltInDomainDefinedAttributes",function(){this.seqof(U2n)});Fn.BuiltInDomainDefinedAttributes=q2n;var U2n=zn.define("BuiltInDomainDefinedAttribute",function(){this.seq().obj(this.key("type").printstr(),this.key("value").printstr())});Fn.BuiltInDomainDefinedAttribute=U2n;var G2n=zn.define("ExtensionAttributes",function(){this.seqof(W2n)});Fn.ExtensionAttributes=G2n;var W2n=zn.define("ExtensionAttribute",function(){this.seq().obj(this.key("extensionAttributeType").implicit(0).int(),this.key("extensionAttributeValue").any().explicit(1).int())});Fn.ExtensionAttribute=W2n;var H2n=zn.define("SubjectKeyIdentifier",function(){this.use(ljt)});Fn.SubjectKeyIdentifier=H2n;var j2n=zn.define("KeyUsage",function(){this.bitstr()});Fn.KeyUsage=j2n;var V2n=zn.define("CertificatePolicies",function(){this.seqof(K2n)});Fn.CertificatePolicies=V2n;var K2n=zn.define("PolicyInformation",function(){this.seq().obj(this.key("policyIdentifier").use(jje),this.key("policyQualifiers").optional().use($2n))});Fn.PolicyInformation=K2n;var jje=zn.define("CertPolicyId",function(){this.objid()});Fn.CertPolicyId=jje;var $2n=zn.define("PolicyQualifiers",function(){this.seqof(Y2n)});Fn.PolicyQualifiers=$2n;var Y2n=zn.define("PolicyQualifierInfo",function(){this.seq().obj(this.key("policyQualifierId").use(J2n),this.key("qualifier").any())});Fn.PolicyQualifierInfo=Y2n;var J2n=zn.define("PolicyQualifierId",function(){this.objid()});Fn.PolicyQualifierId=J2n;var X2n=zn.define("PolicyMappings",function(){this.seqof(Z2n)});Fn.PolicyMappings=X2n;var Z2n=zn.define("PolicyMapping",function(){this.seq().obj(this.key("issuerDomainPolicy").use(jje),this.key("subjectDomainPolicy").use(jje))});Fn.PolicyMapping=Z2n;var eCn=zn.define("SubjectAlternativeName",function(){this.use(c7)});Fn.SubjectAlternativeName=eCn;var tCn=zn.define("IssuerAlternativeName",function(){this.use(c7)});Fn.IssuerAlternativeName=tCn;var rCn=zn.define("SubjectDirectoryAttributes",function(){this.seqof(O2n)});Fn.SubjectDirectoryAttributes=rCn;var nCn=zn.define("BasicConstraints",function(){this.seq().obj(this.key("cA").bool().def(!1),this.key("pathLenConstraint").optional().int())});Fn.BasicConstraints=nCn;var iCn=zn.define("NameConstraints",function(){this.seq().obj(this.key("permittedSubtrees").implicit(0).optional().use(sjt),this.key("excludedSubtrees").implicit(1).optional().use(sjt))});Fn.NameConstraints=iCn;var sjt=zn.define("GeneralSubtrees",function(){this.seqof(sCn)});Fn.GeneralSubtrees=sjt;var sCn=zn.define("GeneralSubtree",function(){this.seq().obj(this.key("base").use($je),this.key("minimum").implicit(0).def(0).use(ojt),this.key("maximum").implicit(0).optional().use(ojt))});Fn.GeneralSubtree=sCn;var ojt=zn.define("BaseDistance",function(){this.int()});Fn.BaseDistance=ojt;var oCn=zn.define("PolicyConstraints",function(){this.seq().obj(this.key("requireExplicitPolicy").implicit(0).optional().use(Vje),this.key("inhibitPolicyMapping").implicit(1).optional().use(Vje))});Fn.PolicyConstraints=oCn;var Vje=zn.define("SkipCerts",function(){this.int()});Fn.SkipCerts=Vje;var aCn=zn.define("ExtendedKeyUsage",function(){this.seqof(cCn)});Fn.ExtendedKeyUsage=aCn;var cCn=zn.define("KeyPurposeId",function(){this.objid()});Fn.KeyPurposeId=cCn;var djt=zn.define("CRLDistributionPoints",function(){this.seqof(uCn)});Fn.CRLDistributionPoints=djt;var uCn=zn.define("DistributionPoint",function(){this.seq().obj(this.key("distributionPoint").optional().explicit(0).use(pjt),this.key("reasons").optional().implicit(1).use(fjt),this.key("cRLIssuer").optional().implicit(2).use(c7))});Fn.DistributionPoint=uCn;var pjt=zn.define("DistributionPointName",function(){this.choice({fullName:this.implicit(0).use(c7),nameRelativeToCRLIssuer:this.implicit(1).use(ajt)})});Fn.DistributionPointName=pjt;var fjt=zn.define("ReasonFlags",function(){this.bitstr()});Fn.ReasonFlags=fjt;var lCn=zn.define("InhibitAnyPolicy",function(){this.use(Vje)});Fn.InhibitAnyPolicy=lCn;var ACn=zn.define("FreshestCRL",function(){this.use(djt)});Fn.FreshestCRL=ACn;var dCn=zn.define("AuthorityInfoAccessSyntax",function(){this.seqof(hjt)});Fn.AuthorityInfoAccessSyntax=dCn;var hjt=zn.define("AccessDescription",function(){this.seq().obj(this.key("accessMethod").objid(),this.key("accessLocation").use($je))});Fn.AccessDescription=hjt;var pCn=zn.define("SubjectInformationAccess",function(){this.seqof(hjt)});Fn.SubjectInformationAccess=pCn;var gjt=zn.define("CRLNumber",function(){this.int()});Fn.CRLNumber=gjt;var fCn=zn.define("DeltaCRLIndicator",function(){this.use(gjt)});Fn.DeltaCRLIndicator=fCn;var hCn=zn.define("IssuingDistributionPoint",function(){this.seq().obj(this.key("distributionPoint").explicit(0).optional().use(pjt),this.key("onlyContainsUserCerts").implicit(1).def(!1).bool(),this.key("onlyContainsCACerts").implicit(2).def(!1).bool(),this.key("onlySomeReasons").implicit(3).optional().use(fjt),this.key("indirectCRL").implicit(4).def(!1).bool(),this.key("onlyContainsAttributeCerts").implicit(5).def(!1).bool())});Fn.IssuingDistributionPoint=hCn;var gCn=zn.define("ReasonCode",function(){this.enum({0:"unspecified",1:"keyCompromise",2:"cACompromise",3:"affiliationChanged",4:"superseded",5:"cessationOfOperation",6:"certificateHold",8:"removeFromCRL",9:"privilegeWithdrawn",10:"aACompromise"})});Fn.ReasonCode=gCn;var mCn=zn.define("InvalidityDate",function(){this.gentime()});Fn.InvalidityDate=mCn;var ECn=zn.define("CertificateIssuer",function(){this.use(c7)});Fn.CertificateIssuer=ECn;var nro={subjectDirectoryAttributes:rCn,subjectKeyIdentifier:H2n,keyUsage:j2n,subjectAlternativeName:eCn,issuerAlternativeName:tCn,basicConstraints:nCn,cRLNumber:gjt,reasonCode:gCn,invalidityDate:mCn,deltaCRLIndicator:fCn,issuingDistributionPoint:hCn,certificateIssuer:ECn,nameConstraints:iCn,cRLDistributionPoints:djt,certificatePolicies:V2n,policyMappings:X2n,authorityKeyIdentifier:R2n,policyConstraints:oCn,extendedKeyUsage:aCn,freshestCRL:ACn,inhibitAnyPolicy:lCn,authorityInformationAccess:dCn,subjectInformationAccess:pCn}});var yCn=m((bZa,ICn)=>{"use strict";function mjt(t,e,r,n){this.before=t,this.next=e,this.key=r,this.value=n}mjt.prototype.setKey=function(t){this.key=t};mjt.prototype.setValue=function(t){this.value=t};function jv(t){t||(t={}),this.maxSize=t.maxSize,this.reset()}jv.prototype.reset=function(){this.size=0,this.cache={},this.tail=void 0,this.head=void 0};jv.prototype.get=function(t,e){var r=this.cache[t];if(e=e!=null&&e!=null?e:!0,r&&e)this.hit(r);else return;return r.value};jv.prototype.set=function(t,e,r){var n=this.cache[t];if(r=r!=null&&r!=null?r:!0,n)n.value=e,r&&this.hit(n);else{var i;if(this.size>=this.maxSize){var s=this.tail.key;this.detach(this.tail),i=this.cache[s],delete this.cache[s],i.next=void 0,i.before=void 0,i.setKey(t),i.setValue(e)}i=i||new mjt(void 0,void 0,t,e),this.cache[t]=i,this.attach(i)}};jv.prototype.del=function(t){var e=this.cache[t];e&&(this.detach(e),delete this.cache[t])};jv.prototype.hit=function(t){this.detach(t),this.attach(t)};jv.prototype.attach=function(t){t&&(t.before=void 0,t.next=this.head,this.head=t,t.next?t.next.before=t:this.tail=t,this.size++)};jv.prototype.detach=function(t){if(t){var e=t.before,r=t.next;e?e.next=r:this.head=r,r?r.before=e:this.tail=e,this.size--}};jv.prototype.forEach=function(t){var e=this;Object.keys(this.cache).forEach(function(r){var n=e.cache[r];t(n.value,r)})};ICn.exports=jv});var Ejt=m((_Za,bCn)=>{bCn.exports=yCn()});var xCn=m((xZa,_Cn)=>{var OEe=qw(),iro=require("http"),sro=require("https"),oro=sro.Agent,Cjt=S_(),aro=Ejt(),Ijt=class extends oro{constructor(e){e=Object.assign({CACacheSize:1024},e),super(e),this.caCache=new aro({maxSize:e.CACacheSize})}createConnection(e,r){e.requestOCSP=!0;let n=super.createConnection(e,r),i=null;return n.on("OCSPResponse",function(s){i=s}),n.on("secure",()=>this.handleOCSPResponse(n,i,function(s){if(s)return n.destroy(s);n.uncork()})),n.cork(),n}handleOCSPResponse(e,r,n){if(!e.authorized)return n(new Error(e.authorizationError));let i,s;try{i=(e.ssl||e).getPeerCertificate(!0),s=i&&i.issuerCertificate,i=i&&i.raw,i=Cjt.Certificate.decode(i,"der"),s&&(s=s.raw,s=Cjt.Certificate.decode(s,"der"))}catch(a){return n(a)}function o(a,c){if(a)return n(a);if(s=c,r){let u=OEe.request.generate(i,s);OEe.verify({request:u,response:r},n)}else return OEe.check({cert:i,issuer:s},n)}return s?o(null,s):this.fetchIssuer(i,r,o)}fetchIssuer(e,r,n){let i=OEe.utils["id-ad-caIssuers"].join(".");OEe.utils.getAuthorityInfo(e,i,(s,o)=>{if(s)return n(s);let a=this.caCache.get(o);if(a)return n(null,a);let c=!1;function u(A,p){c||(c=!0,n(A,p))}function l(A){if(A.statusCode<200||A.statusCode>=400)return u(new Error("Failed to fetch CA: "+A.statusCode));let p=[];A.on("readable",function(){let f=A.read();f&&p.push(f)}),A.on("end",function(){let f=Buffer.concat(p);try{f=Cjt.Certificate.decode(f,"der")}catch(h){return u(h)}this.caCache.set(o,f),u(null,f)})}try{iro.get(o).on("error",u).on("response",l.bind(this))}catch(A){return u(A)}})}};_Cn.exports=Ijt});var MCn=m((Yje,BCn)=>{(function(t,e){typeof Yje=="object"&&typeof BCn<"u"?e(Yje):typeof define=="function"&&define.amd?define(["exports"],e):e(t.async={})})(Yje,function(t){"use strict";function e(Ze,...He){return(...et)=>Ze(...He,...et)}function r(Ze){return function(...He){var et=He.pop();return Ze.call(this,He,et)}}var n=typeof queueMicrotask=="function"&&queueMicrotask,i=typeof setImmediate=="function"&&setImmediate,s=typeof process=="object"&&typeof process.nextTick=="function";function o(Ze){setTimeout(Ze,0)}function a(Ze){return(He,...et)=>Ze(()=>He(...et))}var c;n?c=queueMicrotask:i?c=setImmediate:s?c=process.nextTick:c=o;var u=a(c);function l(Ze){return f(Ze)?function(...He){let et=He.pop(),Rt=Ze.apply(this,He);return A(Rt,et)}:r(function(He,et){var Rt;try{Rt=Ze.apply(this,He)}catch(Zt){return et(Zt)}if(Rt&&typeof Rt.then=="function")return A(Rt,et);et(null,Rt)})}function A(Ze,He){return Ze.then(et=>{p(He,null,et)},et=>{p(He,et&&et.message?et:new Error(et))})}function p(Ze,He,et){try{Ze(He,et)}catch(Rt){u(Zt=>{throw Zt},Rt)}}function f(Ze){return Ze[Symbol.toStringTag]==="AsyncFunction"}function h(Ze){return Ze[Symbol.toStringTag]==="AsyncGenerator"}function g(Ze){return typeof Ze[Symbol.asyncIterator]=="function"}function E(Ze){if(typeof Ze!="function")throw new Error("expected a function");return f(Ze)?l(Ze):Ze}function C(Ze,He=Ze.length){if(!He)throw new Error("arity is undefined");function et(...Rt){return typeof Rt[He-1]=="function"?Ze.apply(this,Rt):new Promise((Zt,Yt)=>{Rt[He-1]=(dr,...cr)=>{if(dr)return Yt(dr);Zt(cr.length>1?cr:cr[0])},Ze.apply(this,Rt)})}return et}function y(Ze){return function(et,...Rt){return C(function(Yt){var dr=this;return Ze(et,(cr,Wr)=>{E(cr).apply(dr,Rt.concat(Wr))},Yt)})}}function b(Ze,He,et,Rt){He=He||[];var Zt=[],Yt=0,dr=E(et);return Ze(He,(cr,Wr,ei)=>{var Js=Yt++;dr(cr,(Xs,qs)=>{Zt[Js]=qs,ei(Xs)})},cr=>{Rt(cr,Zt)})}function O(Ze){return Ze&&typeof Ze.length=="number"&&Ze.length>=0&&Ze.length%1===0}let M={};function S(Ze){function He(...et){if(Ze!==null){var Rt=Ze;Ze=null,Rt.apply(this,et)}}return Object.assign(He,Ze),He}function P(Ze){return Ze[Symbol.iterator]&&Ze[Symbol.iterator]()}function V(Ze){var He=-1,et=Ze.length;return function(){return++He<et?{value:Ze[He],key:He}:null}}function Z(Ze){var He=-1;return function(){var Rt=Ze.next();return Rt.done?null:(He++,{value:Rt.value,key:He})}}function X(Ze){var He=Ze?Object.keys(Ze):[],et=-1,Rt=He.length;return function Zt(){var Yt=He[++et];return Yt==="__proto__"?Zt():et<Rt?{value:Ze[Yt],key:Yt}:null}}function _(Ze){if(O(Ze))return V(Ze);var He=P(Ze);return He?Z(He):X(Ze)}function L(Ze){return function(...He){if(Ze===null)throw new Error("Callback was already called.");var et=Ze;Ze=null,et.apply(this,He)}}function Q(Ze,He,et,Rt){let Zt=!1,Yt=!1,dr=!1,cr=0,Wr=0;function ei(){cr>=He||dr||Zt||(dr=!0,Ze.next().then(({value:qs,done:SA})=>{if(!(Yt||Zt)){if(dr=!1,SA){Zt=!0,cr<=0&&Rt(null);return}cr++,et(qs,Wr,Js),Wr++,ei()}}).catch(Xs))}function Js(qs,SA){if(cr-=1,!Yt){if(qs)return Xs(qs);if(qs===!1){Zt=!0,Yt=!0;return}if(SA===M||Zt&&cr<=0)return Zt=!0,Rt(null);ei()}}function Xs(qs){Yt||(dr=!1,Zt=!0,Rt(qs))}ei()}var I=Ze=>(He,et,Rt)=>{if(Rt=S(Rt),Ze<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!He)return Rt(null);if(h(He))return Q(He,Ze,et,Rt);if(g(He))return Q(He[Symbol.asyncIterator](),Ze,et,Rt);var Zt=_(He),Yt=!1,dr=!1,cr=0,Wr=!1;function ei(Xs,qs){if(!dr)if(cr-=1,Xs)Yt=!0,Rt(Xs);else if(Xs===!1)Yt=!0,dr=!0;else{if(qs===M||Yt&&cr<=0)return Yt=!0,Rt(null);Wr||Js()}}function Js(){for(Wr=!0;cr<Ze&&!Yt;){var Xs=Zt();if(Xs===null){Yt=!0,cr<=0&&Rt(null);return}cr+=1,et(Xs.value,Xs.key,L(ei))}Wr=!1}Js()};function N(Ze,He,et,Rt){return I(He)(Ze,E(et),Rt)}var T=C(N,4);function U(Ze,He,et){et=S(et);var Rt=0,Zt=0,{length:Yt}=Ze,dr=!1;Yt===0&&et(null);function cr(Wr,ei){Wr===!1&&(dr=!0),dr!==!0&&(Wr?et(Wr):(++Zt===Yt||ei===M)&&et(null))}for(;Rt<Yt;Rt++)He(Ze[Rt],Rt,L(cr))}function q(Ze,He,et){return T(Ze,1/0,He,et)}function D(Ze,He,et){var Rt=O(Ze)?U:q;return Rt(Ze,E(He),et)}var v=C(D,3);function k(Ze,He,et){return b(v,Ze,He,et)}var G=C(k,3),J=y(G);function Qe(Ze,He,et){return T(Ze,1,He,et)}var Re=C(Qe,3);function $e(Ze,He,et){return b(Re,Ze,He,et)}var Bt=C($e,3),Pt=y(Bt);let ge=Symbol("promiseCallback");function Ve(){let Ze,He;function et(Rt,...Zt){if(Rt)return He(Rt);Ze(Zt.length>1?Zt:Zt[0])}return et[ge]=new Promise((Rt,Zt)=>{Ze=Rt,He=Zt}),et}function Ke(Ze,He,et){typeof He!="number"&&(et=He,He=null),et=S(et||Ve());var Rt=Object.keys(Ze).length;if(!Rt)return et(null);He||(He=Rt);var Zt={},Yt=0,dr=!1,cr=!1,Wr=Object.create(null),ei=[],Js=[],Xs={};Object.keys(Ze).forEach(Qn=>{var xn=Ze[Qn];if(!Array.isArray(xn)){qs(Qn,[xn]),Js.push(Qn);return}var Ts=xn.slice(0,xn.length-1),pa=Ts.length;if(pa===0){qs(Qn,xn),Js.push(Qn);return}Xs[Qn]=pa,Ts.forEach(Lc=>{if(!Ze[Lc])throw new Error("async.auto task `"+Qn+"` has a non-existent dependency `"+Lc+"` in "+Ts.join(", "));Yp(Lc,()=>{pa--,pa===0&&qs(Qn,xn)})})}),ws(),SA();function qs(Qn,xn){ei.push(()=>Ec(Qn,xn))}function SA(){if(!dr){if(ei.length===0&&Yt===0)return et(null,Zt);for(;ei.length&&Yt<He;){var Qn=ei.shift();Qn()}}}function Yp(Qn,xn){var Ts=Wr[Qn];Ts||(Ts=Wr[Qn]=[]),Ts.push(xn)}function kn(Qn){var xn=Wr[Qn]||[];xn.forEach(Ts=>Ts()),SA()}function Ec(Qn,xn){if(!cr){var Ts=L((Lc,...iu)=>{if(Yt--,Lc===!1){dr=!0;return}if(iu.length<2&&([iu]=iu),Lc){var Hg={};if(Object.keys(Zt).forEach(p1=>{Hg[p1]=Zt[p1]}),Hg[Qn]=iu,cr=!0,Wr=Object.create(null),dr)return;et(Lc,Hg)}else Zt[Qn]=iu,kn(Qn)});Yt++;var pa=E(xn[xn.length-1]);xn.length>1?pa(Zt,Ts):pa(Ts)}}function ws(){for(var Qn,xn=0;Js.length;)Qn=Js.pop(),xn++,Ci(Qn).forEach(Ts=>{--Xs[Ts]===0&&Js.push(Ts)});if(xn!==Rt)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function Ci(Qn){var xn=[];return Object.keys(Ze).forEach(Ts=>{let pa=Ze[Ts];Array.isArray(pa)&&pa.indexOf(Qn)>=0&&xn.push(Ts)}),xn}return et[ge]}var Me=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,ke=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Fe=/,/,rt=/(=.+)?(\s*)$/;function ct(Ze){let He="",et=0,Rt=Ze.indexOf("*/");for(;et<Ze.length;)if(Ze[et]==="/"&&Ze[et+1]==="/"){let Zt=Ze.indexOf(`
|
|
4121
4121
|
`,et);et=Zt===-1?Ze.length:Zt}else if(Rt!==-1&&Ze[et]==="/"&&Ze[et+1]==="*"){let Zt=Ze.indexOf("*/",et);Zt!==-1?(et=Zt+2,Rt=Ze.indexOf("*/",et)):(He+=Ze[et],et++)}else He+=Ze[et],et++;return He}function at(Ze){let He=ct(Ze.toString()),et=He.match(Me);if(et||(et=He.match(ke)),!et)throw new Error(`could not parse args in autoInject
|
|
4122
4122
|
Source:
|
|
4123
4123
|
`+He);let[,Rt]=et;return Rt.replace(/\s/g,"").split(Fe).map(Zt=>Zt.replace(rt,"").trim())}function gt(Ze,He){var et={};return Object.keys(Ze).forEach(Rt=>{var Zt=Ze[Rt],Yt,dr=f(Zt),cr=!dr&&Zt.length===1||dr&&Zt.length===0;if(Array.isArray(Zt))Yt=[...Zt],Zt=Yt.pop(),et[Rt]=Yt.concat(Yt.length>0?Wr:Zt);else if(cr)et[Rt]=Zt;else{if(Yt=at(Zt),Zt.length===0&&!dr&&Yt.length===0)throw new Error("autoInject task functions require explicit parameters.");dr||Yt.pop(),et[Rt]=Yt.concat(Wr)}function Wr(ei,Js){var Xs=Yt.map(qs=>ei[qs]);Xs.push(Js),E(Zt)(...Xs)}}),Ke(et,He)}class mt{constructor(){this.head=this.tail=null,this.length=0}removeLink(He){return He.prev?He.prev.next=He.next:this.head=He.next,He.next?He.next.prev=He.prev:this.tail=He.prev,He.prev=He.next=null,this.length-=1,He}empty(){for(;this.head;)this.shift();return this}insertAfter(He,et){et.prev=He,et.next=He.next,He.next?He.next.prev=et:this.tail=et,He.next=et,this.length+=1}insertBefore(He,et){et.prev=He.prev,et.next=He,He.prev?He.prev.next=et:this.head=et,He.prev=et,this.length+=1}unshift(He){this.head?this.insertBefore(this.head,He):Ye(this,He)}push(He){this.tail?this.insertAfter(this.tail,He):Ye(this,He)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var He=this.head;He;)yield He.data,He=He.next}remove(He){for(var et=this.head;et;){var{next:Rt}=et;He(et)&&this.removeLink(et),et=Rt}return this}}function Ye(Ze,He){Ze.length=1,Ze.head=Ze.tail=He}function jt(Ze,He,et){if(He==null)He=1;else if(He===0)throw new RangeError("Concurrency must not be zero");var Rt=E(Ze),Zt=0,Yt=[];let dr={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function cr(Ci,Qn){dr[Ci].push(Qn)}function Wr(Ci,Qn){let xn=(...Ts)=>{ei(Ci,xn),Qn(...Ts)};dr[Ci].push(xn)}function ei(Ci,Qn){if(!Ci)return Object.keys(dr).forEach(xn=>dr[xn]=[]);if(!Qn)return dr[Ci]=[];dr[Ci]=dr[Ci].filter(xn=>xn!==Qn)}function Js(Ci,...Qn){dr[Ci].forEach(xn=>xn(...Qn))}var Xs=!1;function qs(Ci,Qn,xn,Ts){if(Ts!=null&&typeof Ts!="function")throw new Error("task callback must be a function");ws.started=!0;var pa,Lc;function iu(p1,...td){if(p1)return xn?Lc(p1):pa();if(td.length<=1)return pa(td[0]);pa(td)}var Hg=ws._createTaskItem(Ci,xn?iu:Ts||iu);if(Qn?ws._tasks.unshift(Hg):ws._tasks.push(Hg),Xs||(Xs=!0,u(()=>{Xs=!1,ws.process()})),xn||!Ts)return new Promise((p1,td)=>{pa=p1,Lc=td})}function SA(Ci){return function(Qn,...xn){Zt-=1;for(var Ts=0,pa=Ci.length;Ts<pa;Ts++){var Lc=Ci[Ts],iu=Yt.indexOf(Lc);iu===0?Yt.shift():iu>0&&Yt.splice(iu,1),Lc.callback(Qn,...xn),Qn!=null&&Js("error",Qn,Lc.data)}Zt<=ws.concurrency-ws.buffer&&Js("unsaturated"),ws.idle()&&Js("drain"),ws.process()}}function Yp(Ci){return Ci.length===0&&ws.idle()?(u(()=>Js("drain")),!0):!1}let kn=Ci=>Qn=>{if(!Qn)return new Promise((xn,Ts)=>{Wr(Ci,(pa,Lc)=>{if(pa)return Ts(pa);xn(Lc)})});ei(Ci),cr(Ci,Qn)};var Ec=!1,ws={_tasks:new mt,_createTaskItem(Ci,Qn){return{data:Ci,callback:Qn}},*[Symbol.iterator](){yield*ws._tasks[Symbol.iterator]()},concurrency:He,payload:et,buffer:He/4,started:!1,paused:!1,push(Ci,Qn){return Array.isArray(Ci)?Yp(Ci)?void 0:Ci.map(xn=>qs(xn,!1,!1,Qn)):qs(Ci,!1,!1,Qn)},pushAsync(Ci,Qn){return Array.isArray(Ci)?Yp(Ci)?void 0:Ci.map(xn=>qs(xn,!1,!0,Qn)):qs(Ci,!1,!0,Qn)},kill(){ei(),ws._tasks.empty()},unshift(Ci,Qn){return Array.isArray(Ci)?Yp(Ci)?void 0:Ci.map(xn=>qs(xn,!0,!1,Qn)):qs(Ci,!0,!1,Qn)},unshiftAsync(Ci,Qn){return Array.isArray(Ci)?Yp(Ci)?void 0:Ci.map(xn=>qs(xn,!0,!0,Qn)):qs(Ci,!0,!0,Qn)},remove(Ci){ws._tasks.remove(Ci)},process(){if(!Ec){for(Ec=!0;!ws.paused&&Zt<ws.concurrency&&ws._tasks.length;){var Ci=[],Qn=[],xn=ws._tasks.length;ws.payload&&(xn=Math.min(xn,ws.payload));for(var Ts=0;Ts<xn;Ts++){var pa=ws._tasks.shift();Ci.push(pa),Yt.push(pa),Qn.push(pa.data)}Zt+=1,ws._tasks.length===0&&Js("empty"),Zt===ws.concurrency&&Js("saturated");var Lc=L(SA(Ci));Rt(Qn,Lc)}Ec=!1}},length(){return ws._tasks.length},running(){return Zt},workersList(){return Yt},idle(){return ws._tasks.length+Zt===0},pause(){ws.paused=!0},resume(){ws.paused!==!1&&(ws.paused=!1,u(ws.process))}};return Object.defineProperties(ws,{saturated:{writable:!1,value:kn("saturated")},unsaturated:{writable:!1,value:kn("unsaturated")},empty:{writable:!1,value:kn("empty")},drain:{writable:!1,value:kn("drain")},error:{writable:!1,value:kn("error")}}),ws}function Ar(Ze,He){return jt(Ze,1,He)}function yr(Ze,He,et){return jt(Ze,He,et)}function le(Ze,He,et,Rt){Rt=S(Rt);var Zt=E(et);return Re(Ze,(Yt,dr,cr)=>{Zt(He,Yt,(Wr,ei)=>{He=ei,cr(Wr)})},Yt=>Rt(Yt,He))}var Se=C(le,4);function ve(...Ze){var He=Ze.map(E);return function(...et){var Rt=this,Zt=et[et.length-1];return typeof Zt=="function"?et.pop():Zt=Ve(),Se(He,et,(Yt,dr,cr)=>{dr.apply(Rt,Yt.concat((Wr,...ei)=>{cr(Wr,ei)}))},(Yt,dr)=>Zt(Yt,...dr)),Zt[ge]}}function nt(...Ze){return ve(...Ze.reverse())}function de(Ze,He,et,Rt){return b(I(He),Ze,et,Rt)}var K=C(de,4);function ae(Ze,He,et,Rt){var Zt=E(et);return K(Ze,He,(Yt,dr)=>{Zt(Yt,(cr,...Wr)=>cr?dr(cr):dr(cr,Wr))},(Yt,dr)=>{for(var cr=[],Wr=0;Wr<dr.length;Wr++)dr[Wr]&&(cr=cr.concat(...dr[Wr]));return Rt(Yt,cr)})}var Oe=C(ae,4);function ze(Ze,He,et){return Oe(Ze,1/0,He,et)}var _e=C(ze,3);function bt(Ze,He,et){return Oe(Ze,1,He,et)}var vt=C(bt,3);function kt(...Ze){return function(...He){var et=He.pop();return et(null,...Ze)}}function It(Ze,He){return(et,Rt,Zt,Yt)=>{var dr=!1,cr;let Wr=E(Zt);et(Rt,(ei,Js,Xs)=>{Wr(ei,(qs,SA)=>{if(qs||qs===!1)return Xs(qs);if(Ze(SA)&&!cr)return dr=!0,cr=He(!0,ei),Xs(null,M);Xs()})},ei=>{if(ei)return Yt(ei);Yt(null,dr?cr:He(!1))})}}function it(Ze,He,et){return It(Rt=>Rt,(Rt,Zt)=>Zt)(v,Ze,He,et)}var Ft=C(it,3);function De(Ze,He,et,Rt){return It(Zt=>Zt,(Zt,Yt)=>Yt)(I(He),Ze,et,Rt)}var we=C(De,4);function ot(Ze,He,et){return It(Rt=>Rt,(Rt,Zt)=>Zt)(I(1),Ze,He,et)}var xt=C(ot,3);function H(Ze){return(He,...et)=>E(He)(...et,(Rt,...Zt)=>{typeof console=="object"&&(Rt?console.error&&console.error(Rt):console[Ze]&&Zt.forEach(Yt=>console[Ze](Yt)))})}var fe=H("dir");function Ie(Ze,He,et){et=L(et);var Rt=E(Ze),Zt=E(He),Yt;function dr(Wr,...ei){if(Wr)return et(Wr);Wr!==!1&&(Yt=ei,Zt(...ei,cr))}function cr(Wr,ei){if(Wr)return et(Wr);if(Wr!==!1){if(!ei)return et(null,...Yt);Rt(dr)}}return cr(null,!0)}var Be=C(Ie,3);function Le(Ze,He,et){let Rt=E(He);return Be(Ze,(...Zt)=>{let Yt=Zt.pop();Rt(...Zt,(dr,cr)=>Yt(dr,!cr))},et)}function er(Ze){return(He,et,Rt)=>Ze(He,Rt)}function te(Ze,He,et){return v(Ze,er(E(He)),et)}var Y=C(te,3);function ie(Ze,He,et,Rt){return I(He)(Ze,er(E(et)),Rt)}var xe=C(ie,4);function qe(Ze,He,et){return xe(Ze,1,He,et)}var Je=C(qe,3);function wt(Ze){return f(Ze)?Ze:function(...He){var et=He.pop(),Rt=!0;He.push((...Zt)=>{Rt?u(()=>et(...Zt)):et(...Zt)}),Ze.apply(this,He),Rt=!1}}function lt(Ze,He,et){return It(Rt=>!Rt,Rt=>!Rt)(v,Ze,He,et)}var Wt=C(lt,3);function zt(Ze,He,et,Rt){return It(Zt=>!Zt,Zt=>!Zt)(I(He),Ze,et,Rt)}var sr=C(zt,4);function tn(Ze,He,et){return It(Rt=>!Rt,Rt=>!Rt)(Re,Ze,He,et)}var pe=C(tn,3);function j(Ze,He,et,Rt){var Zt=new Array(He.length);Ze(He,(Yt,dr,cr)=>{et(Yt,(Wr,ei)=>{Zt[dr]=!!ei,cr(Wr)})},Yt=>{if(Yt)return Rt(Yt);for(var dr=[],cr=0;cr<He.length;cr++)Zt[cr]&&dr.push(He[cr]);Rt(null,dr)})}function se(Ze,He,et,Rt){var Zt=[];Ze(He,(Yt,dr,cr)=>{et(Yt,(Wr,ei)=>{if(Wr)return cr(Wr);ei&&Zt.push({index:dr,value:Yt}),cr(Wr)})},Yt=>{if(Yt)return Rt(Yt);Rt(null,Zt.sort((dr,cr)=>dr.index-cr.index).map(dr=>dr.value))})}function Ne(Ze,He,et,Rt){var Zt=O(He)?j:se;return Zt(Ze,He,E(et),Rt)}function Pe(Ze,He,et){return Ne(v,Ze,He,et)}var tt=C(Pe,3);function Ht(Ze,He,et,Rt){return Ne(I(He),Ze,et,Rt)}var Et=C(Ht,4);function We(Ze,He,et){return Ne(Re,Ze,He,et)}var Xe=C(We,3);function Ct(Ze,He){var et=L(He),Rt=E(wt(Ze));function Zt(Yt){if(Yt)return et(Yt);Yt!==!1&&Rt(Zt)}return Zt()}var Gt=C(Ct,2);function Mr(Ze,He,et,Rt){var Zt=E(et);return K(Ze,He,(Yt,dr)=>{Zt(Yt,(cr,Wr)=>cr?dr(cr):dr(cr,{key:Wr,val:Yt}))},(Yt,dr)=>{for(var cr={},{hasOwnProperty:Wr}=Object.prototype,ei=0;ei<dr.length;ei++)if(dr[ei]){var{key:Js}=dr[ei],{val:Xs}=dr[ei];Wr.call(cr,Js)?cr[Js].push(Xs):cr[Js]=[Xs]}return Rt(Yt,cr)})}var ir=C(Mr,4);function Cr(Ze,He,et){return ir(Ze,1/0,He,et)}function kr(Ze,He,et){return ir(Ze,1,He,et)}var qn=H("log");function Li(Ze,He,et,Rt){Rt=S(Rt);var Zt={},Yt=E(et);return I(He)(Ze,(dr,cr,Wr)=>{Yt(dr,cr,(ei,Js)=>{if(ei)return Wr(ei);Zt[cr]=Js,Wr(ei)})},dr=>Rt(dr,Zt))}var Va=C(Li,4);function mc(Ze,He,et){return Va(Ze,1/0,He,et)}function F0(Ze,He,et){return Va(Ze,1,He,et)}function da(Ze,He=et=>et){var et=Object.create(null),Rt=Object.create(null),Zt=E(Ze),Yt=r((dr,cr)=>{var Wr=He(...dr);Wr in et?u(()=>cr(null,...et[Wr])):Wr in Rt?Rt[Wr].push(cr):(Rt[Wr]=[cr],Zt(...dr,(ei,...Js)=>{ei||(et[Wr]=Js);var Xs=Rt[Wr];delete Rt[Wr];for(var qs=0,SA=Xs.length;qs<SA;qs++)Xs[qs](ei,...Js)}))});return Yt.memo=et,Yt.unmemoized=Ze,Yt}var Z1;s?Z1=process.nextTick:i?Z1=setImmediate:Z1=o;var Ch=a(Z1),Cy=C((Ze,He,et)=>{var Rt=O(He)?[]:{};Ze(He,(Zt,Yt,dr)=>{E(Zt)((cr,...Wr)=>{Wr.length<2&&([Wr]=Wr),Rt[Yt]=Wr,dr(cr)})},Zt=>et(Zt,Rt))},3);function IE(Ze,He){return Cy(v,Ze,He)}function yE(Ze,He,et){return Cy(I(He),Ze,et)}function Iy(Ze,He){var et=E(Ze);return jt((Rt,Zt)=>{et(Rt[0],Zt)},He,1)}class bE{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(He){let et;for(;He>0&&A1(this.heap[He],this.heap[et=_E(He)]);){let Rt=this.heap[He];this.heap[He]=this.heap[et],this.heap[et]=Rt,He=et}}percDown(He){let et;for(;(et=yy(He))<this.heap.length&&(et+1<this.heap.length&&A1(this.heap[et+1],this.heap[et])&&(et=et+1),!A1(this.heap[He],this.heap[et]));){let Rt=this.heap[He];this.heap[He]=this.heap[et],this.heap[et]=Rt,He=et}}push(He){He.pushCount=++this.pushCount,this.heap.push(He),this.percUp(this.heap.length-1)}unshift(He){return this.heap.push(He)}shift(){let[He]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),He}toArray(){return[...this]}*[Symbol.iterator](){for(let He=0;He<this.heap.length;He++)yield this.heap[He].data}remove(He){let et=0;for(let Rt=0;Rt<this.heap.length;Rt++)He(this.heap[Rt])||(this.heap[et]=this.heap[Rt],et++);this.heap.splice(et);for(let Rt=_E(this.heap.length-1);Rt>=0;Rt--)this.percDown(Rt);return this}}function yy(Ze){return(Ze<<1)+1}function _E(Ze){return(Ze+1>>1)-1}function A1(Ze,He){return Ze.priority!==He.priority?Ze.priority<He.priority:Ze.pushCount<He.pushCount}function kd(Ze,He){var et=Iy(Ze,He),{push:Rt,pushAsync:Zt}=et;et._tasks=new bE,et._createTaskItem=({data:dr,priority:cr},Wr)=>({data:dr,priority:cr,callback:Wr});function Yt(dr,cr){return Array.isArray(dr)?dr.map(Wr=>({data:Wr,priority:cr})):{data:dr,priority:cr}}return et.push=function(dr,cr=0,Wr){return Rt(Yt(dr,cr),Wr)},et.pushAsync=function(dr,cr=0,Wr){return Zt(Yt(dr,cr),Wr)},delete et.unshift,delete et.unshiftAsync,et}function ne(Ze,He){if(He=S(He),!Array.isArray(Ze))return He(new TypeError("First argument to race must be an array of functions"));if(!Ze.length)return He();for(var et=0,Rt=Ze.length;et<Rt;et++)E(Ze[et])(He)}var Jn=C(ne,2);function Kp(Ze,He,et,Rt){var Zt=[...Ze].reverse();return Se(Zt,He,et,Rt)}function kg(Ze){var He=E(Ze);return r(function(Rt,Zt){return Rt.push((Yt,...dr)=>{let cr={};if(Yt&&(cr.error=Yt),dr.length>0){var Wr=dr;dr.length<=1&&([Wr]=dr),cr.value=Wr}Zt(null,cr)}),He.apply(this,Rt)})}function bC(Ze){var He;return Array.isArray(Ze)?He=Ze.map(kg):(He={},Object.keys(Ze).forEach(et=>{He[et]=kg.call(this,Ze[et])})),He}function xE(Ze,He,et,Rt){let Zt=E(et);return Ne(Ze,He,(Yt,dr)=>{Zt(Yt,(cr,Wr)=>{dr(cr,!Wr)})},Rt)}function Lr(Ze,He,et){return xE(v,Ze,He,et)}var Fr=C(Lr,3);function d1(Ze,He,et,Rt){return xE(I(He),Ze,et,Rt)}var QO=C(d1,4);function sT(Ze,He,et){return xE(Re,Ze,He,et)}var zc=C(sT,3);function ec(Ze){return function(){return Ze}}let BE=5,by=0;function $p(Ze,He,et){var Rt={times:BE,intervalFunc:ec(by)};if(arguments.length<3&&typeof Ze=="function"?(et=He||Ve(),He=Ze):(un(Rt,Ze),et=et||Ve()),typeof He!="function")throw new Error("Invalid arguments for async.retry");var Zt=E(He),Yt=1;function dr(){Zt((cr,...Wr)=>{cr!==!1&&(cr&&Yt++<Rt.times&&(typeof Rt.errorFilter!="function"||Rt.errorFilter(cr))?setTimeout(dr,Rt.intervalFunc(Yt-1)):et(cr,...Wr))})}return dr(),et[ge]}function un(Ze,He){if(typeof He=="object")Ze.times=+He.times||BE,Ze.intervalFunc=typeof He.interval=="function"?He.interval:ec(+He.interval||by),Ze.errorFilter=He.errorFilter;else if(typeof He=="number"||typeof He=="string")Ze.times=+He||BE;else throw new Error("Invalid arguments for async.retry")}function re(Ze,He){He||(He=Ze,Ze=null);let et=Ze&&Ze.arity||He.length;f(He)&&(et+=1);var Rt=E(He);return r((Zt,Yt)=>{(Zt.length<et-1||Yt==null)&&(Zt.push(Yt),Yt=Ve());function dr(cr){Rt(...Zt,cr)}return Ze?$p(Ze,dr,Yt):$p(dr,Yt),Yt[ge]})}function Bi(Ze,He){return Cy(Re,Ze,He)}function Fg(Ze,He,et){return It(Boolean,Rt=>Rt)(v,Ze,He,et)}var Hl=C(Fg,3);function qg(Ze,He,et,Rt){return It(Boolean,Zt=>Zt)(I(He),Ze,et,Rt)}var Dt=C(qg,4);function _C(Ze,He,et){return It(Boolean,Rt=>Rt)(Re,Ze,He,et)}var _y=C(_C,3);function oT(Ze,He,et){var Rt=E(He);return G(Ze,(Yt,dr)=>{Rt(Yt,(cr,Wr)=>{if(cr)return dr(cr);dr(cr,{value:Yt,criteria:Wr})})},(Yt,dr)=>{if(Yt)return et(Yt);et(null,dr.sort(Zt).map(cr=>cr.value))});function Zt(Yt,dr){var cr=Yt.criteria,Wr=dr.criteria;return cr<Wr?-1:cr>Wr?1:0}}var ed=C(oT,3);function xy(Ze,He,et){var Rt=E(Ze);return r((Zt,Yt)=>{var dr=!1,cr;function Wr(){var ei=Ze.name||"anonymous",Js=new Error('Callback function "'+ei+'" timed out.');Js.code="ETIMEDOUT",et&&(Js.info=et),dr=!0,Yt(Js)}Zt.push((...ei)=>{dr||(Yt(...ei),clearTimeout(cr))}),cr=setTimeout(Wr,He),Rt(...Zt)})}function By(Ze){for(var He=Array(Ze);Ze--;)He[Ze]=Ze;return He}function Ug(Ze,He,et,Rt){var Zt=E(et);return K(By(Ze),He,Zt,Rt)}function Qi(Ze,He,et){return Ug(Ze,1/0,He,et)}function El(Ze,He,et){return Ug(Ze,1,He,et)}function My(Ze,He,et,Rt){arguments.length<=3&&typeof He=="function"&&(Rt=et,et=He,He=Array.isArray(Ze)?[]:{}),Rt=S(Rt||Ve());var Zt=E(et);return v(Ze,(Yt,dr,cr)=>{Zt(He,Yt,dr,cr)},Yt=>Rt(Yt,He)),Rt[ge]}function Wx(Ze,He){var et=null,Rt;return Je(Ze,(Zt,Yt)=>{E(Zt)((dr,...cr)=>{if(dr===!1)return Yt(dr);cr.length<2?[Rt]=cr:Rt=cr,et=dr,Yt(dr?null:{})})},()=>He(et,Rt))}var Oy=C(Wx);function Gg(Ze){return(...He)=>(Ze.unmemoized||Ze)(...He)}function Wo(Ze,He,et){et=L(et);var Rt=E(He),Zt=E(Ze),Yt=[];function dr(Wr,...ei){if(Wr)return et(Wr);Yt=ei,Wr!==!1&&Zt(cr)}function cr(Wr,ei){if(Wr)return et(Wr);if(Wr!==!1){if(!ei)return et(null,...Yt);Rt(dr)}}return Zt(cr)}var rr=C(Wo,3);function Wg(Ze,He,et){let Rt=E(Ze);return rr(Zt=>Rt((Yt,dr)=>Zt(Yt,!dr)),He,et)}function zO(Ze,He){if(He=S(He),!Array.isArray(Ze))return He(new Error("First argument to waterfall must be an array of functions"));if(!Ze.length)return He();var et=0;function Rt(Yt){var dr=E(Ze[et++]);dr(...Yt,L(Zt))}function Zt(Yt,...dr){if(Yt!==!1){if(Yt||et===Ze.length)return He(Yt,...dr);Rt(dr)}}Rt([])}var ME=C(zO),Hx={apply:e,applyEach:J,applyEachSeries:Pt,asyncify:l,auto:Ke,autoInject:gt,cargo:Ar,cargoQueue:yr,compose:nt,concat:_e,concatLimit:Oe,concatSeries:vt,constant:kt,detect:Ft,detectLimit:we,detectSeries:xt,dir:fe,doUntil:Le,doWhilst:Be,each:Y,eachLimit:xe,eachOf:v,eachOfLimit:T,eachOfSeries:Re,eachSeries:Je,ensureAsync:wt,every:Wt,everyLimit:sr,everySeries:pe,filter:tt,filterLimit:Et,filterSeries:Xe,forever:Gt,groupBy:Cr,groupByLimit:ir,groupBySeries:kr,log:qn,map:G,mapLimit:K,mapSeries:Bt,mapValues:mc,mapValuesLimit:Va,mapValuesSeries:F0,memoize:da,nextTick:Ch,parallel:IE,parallelLimit:yE,priorityQueue:kd,queue:Iy,race:Jn,reduce:Se,reduceRight:Kp,reflect:kg,reflectAll:bC,reject:Fr,rejectLimit:QO,rejectSeries:zc,retry:$p,retryable:re,seq:ve,series:Bi,setImmediate:u,some:Hl,someLimit:Dt,someSeries:_y,sortBy:ed,timeout:xy,times:Qi,timesLimit:Ug,timesSeries:El,transform:My,tryEach:Oy,unmemoize:Gg,until:Wg,waterfall:ME,whilst:rr,all:Wt,allLimit:sr,allSeries:pe,any:Hl,anyLimit:Dt,anySeries:_y,find:Ft,findLimit:we,findSeries:xt,flatMap:_e,flatMapLimit:Oe,flatMapSeries:vt,forEach:Y,forEachSeries:Je,forEachLimit:xe,forEachOf:v,forEachOfSeries:Re,forEachOfLimit:T,inject:Se,foldl:Se,foldr:Kp,select:tt,selectLimit:Et,selectSeries:Xe,wrapSync:l,during:rr,doDuring:Be};t.default=Hx,t.apply=e,t.applyEach=J,t.applyEachSeries=Pt,t.asyncify=l,t.auto=Ke,t.autoInject=gt,t.cargo=Ar,t.cargoQueue=yr,t.compose=nt,t.concat=_e,t.concatLimit=Oe,t.concatSeries=vt,t.constant=kt,t.detect=Ft,t.detectLimit=we,t.detectSeries=xt,t.dir=fe,t.doUntil=Le,t.doWhilst=Be,t.each=Y,t.eachLimit=xe,t.eachOf=v,t.eachOfLimit=T,t.eachOfSeries=Re,t.eachSeries=Je,t.ensureAsync=wt,t.every=Wt,t.everyLimit=sr,t.everySeries=pe,t.filter=tt,t.filterLimit=Et,t.filterSeries=Xe,t.forever=Gt,t.groupBy=Cr,t.groupByLimit=ir,t.groupBySeries=kr,t.log=qn,t.map=G,t.mapLimit=K,t.mapSeries=Bt,t.mapValues=mc,t.mapValuesLimit=Va,t.mapValuesSeries=F0,t.memoize=da,t.nextTick=Ch,t.parallel=IE,t.parallelLimit=yE,t.priorityQueue=kd,t.queue=Iy,t.race=Jn,t.reduce=Se,t.reduceRight=Kp,t.reflect=kg,t.reflectAll=bC,t.reject=Fr,t.rejectLimit=QO,t.rejectSeries=zc,t.retry=$p,t.retryable=re,t.seq=ve,t.series=Bi,t.setImmediate=u,t.some=Hl,t.someLimit=Dt,t.someSeries=_y,t.sortBy=ed,t.timeout=xy,t.times=Qi,t.timesLimit=Ug,t.timesSeries=El,t.transform=My,t.tryEach=Oy,t.unmemoize=Gg,t.until=Wg,t.waterfall=ME,t.whilst=rr,t.all=Wt,t.allLimit=sr,t.allSeries=pe,t.any=Hl,t.anyLimit=Dt,t.anySeries=_y,t.find=Ft,t.findLimit=we,t.findSeries=xt,t.flatMap=_e,t.flatMapLimit=Oe,t.flatMapSeries=vt,t.forEach=Y,t.forEachSeries=Je,t.forEachLimit=xe,t.forEachOf=v,t.forEachOfSeries=Re,t.forEachOfLimit=T,t.inject=Se,t.foldl=Se,t.foldr=Kp,t.select=tt,t.selectLimit=Et,t.selectSeries=Xe,t.wrapSync=l,t.during=rr,t.doDuring=Be,Object.defineProperty(t,"__esModule",{value:!0})})});var V5=m(_p=>{"use strict";var Qm=Hje(),Nm=S_(),cro=Qm.define("OCSPRequest",function(){this.seq().obj(this.key("tbsRequest").use(OCn),this.key("optionalSignature").optional().explicit(0).use(RCn))});_p.OCSPRequest=cro;var OCn=Qm.define("TBSRequest",function(){this.seq().obj(this.key("version").def("v1").explicit(0).use(Nm.Version),this.key("requestorName").optional().explicit(1).use(Nm.GeneralName),this.key("requestList").seqof(SCn),this.key("requestExtensions").optional().explicit(2).seqof(Nm.Extension))});_p.TBSRequest=OCn;var RCn=Qm.define("Signature",function(){this.seq().obj(this.key("signatureAlgorithm").use(Nm.AlgorithmIdentifier),this.key("signature").bitstr(),this.key("certs").optional().explicit(0).seqof(Nm.Certificate))});_p.Signature=RCn;var SCn=Qm.define("Request",function(){this.seq().obj(this.key("reqCert").use(yjt),this.key("singleRequestExtensions").optional().explicit(0).seqof(Nm.Extension))});_p.Request=SCn;var uro=Qm.define("OCSPResponse",function(){this.seq().obj(this.key("responseStatus").use(wCn),this.key("responseBytes").optional().explicit(0).seq().obj(this.key("responseType").objid({"1 3 6 1 5 5 7 48 1 1":"id-pkix-ocsp-basic"}),this.key("response").octstr()))});_p.OCSPResponse=uro;var wCn=Qm.define("ResponseStatus",function(){this.enum({0:"successful",1:"malformed_request",2:"internal_error",3:"try_later",5:"sig_required",6:"unauthorized"})});_p.ResponseStatus=wCn;var lro=Qm.define("BasicOCSPResponse",function(){this.seq().obj(this.key("tbsResponseData").use(TCn),this.key("signatureAlgorithm").use(Nm.AlgorithmIdentifier),this.key("signature").bitstr(),this.key("certs").optional().explicit(0).seqof(Nm.Certificate))});_p.BasicOCSPResponse=lro;var TCn=Qm.define("ResponseData",function(){this.seq().obj(this.key("version").def("v1").explicit(0).use(Nm.Version),this.key("responderID").use(DCn),this.key("producedAt").gentime(),this.key("responses").seqof(NCn),this.key("responseExtensions").optional().explicit(1).seqof(Nm.Extension))});_p.ResponseData=TCn;var DCn=Qm.define("ResponderId",function(){this.choice({byName:this.explicit(1).use(Nm.Name),byKey:this.explicit(2).use(vCn)})});_p.ResponderID=DCn;var vCn=Qm.define("KeyHash",function(){this.octstr()});_p.KeyHash=vCn;var NCn=Qm.define("SingleResponse",function(){this.seq().obj(this.key("certId").use(yjt),this.key("certStatus").use(QCn),this.key("thisUpdate").gentime(),this.key("nextUpdate").optional().explicit(0).gentime(),this.key("singleExtensions").optional().explicit(1).seqof(Nm.Extension))});_p.SingleResponse=NCn;var QCn=Qm.define("CertStatus",function(){this.choice({good:this.implicit(0).null_(),revoked:this.implicit(1).use(zCn),unknown:this.implicit(2).null_()})});_p.CertStatus=QCn;var zCn=Qm.define("RevokedInfo",function(){this.seq().obj(this.key("revocationTime").gentime(),this.key("revocationReason").optional().explicit(0).use(Nm.ReasonCode))});_p.RevokedInfo=zCn;var yjt=Qm.define("CertID",function(){this.seq().obj(this.key("hashAlgorithm").use(Nm.AlgorithmIdentifier),this.key("issuerNameHash").octstr(),this.key("issuerKeyHash").octstr(),this.key("serialNumber").use(Nm.CertificateSerialNumber))});_p.CertID=yjt;var Aro=Qm.define("Nonce",function(){this.octstr()});_p.Nonce=Aro;_p["id-pkix-ocsp"]=[1,3,6,1,5,5,7,48,1];_p["id-pkix-ocsp-nonce"]=[1,3,6,1,5,5,7,48,1,2]});var kCn=m((MZa,PCn)=>{var Jje=qw(),dro=require("http"),pro=dro.Server,bjt=require("crypto"),fro=MCn(),REe=V5(),LCn=S_();function hro(t,e){if(t.method!=="POST"||t.headers["content-type"]!=="application/ocsp-request")return e.writeHead(400);let r=[];t.on("readable",function(){let s=t.read();s&&r.push(s)});function n(s){return REe.OCSPResponse.encode({responseStatus:s},"der")}function i(s){e.writeHead(200,{"Content-Type":"application/ocsp-response","Content-Length":s.length}),e.end(s)}t.on("end",()=>{let s=Buffer.concat(r),o;try{o=REe.OCSPRequest.decode(s,"der")}catch{return i(n("malformed_request"))}this.getResponses(o,(a,c)=>{if(a){e.writeHead(404),e.end();return}return i(c)})})}var _jt=class t extends pro{constructor(e){super(hro),this.options=Object.assign({nextUpdate:24*3600*1e3},e),this.key=this.options.key,this.certroot=LCn.Certificate.decode(Jje.utils.toDER(e.cert,"CERTIFICATE"),"der"),this.cert=this.certroot.tbsCertificate;let r=LCn.Name.encode(this.cert.subject,"der"),n=this.cert.subjectPublicKeyInfo.subjectPublicKey.data;this.certID={},Object.keys(Jje.utils.digestRev).forEach(function(i){this.certID[i]={issuerNameHash:bjt.createHash(i).update(r).digest(),issuerKeyHash:bjt.createHash(i).update(n).digest()}},this),this.certs={}}static create(e){return new t(e)}addCert(e,r,n){this.certs[e.toString(16)]={type:r,value:n}}getResponses(e,r){let n=e.tbsRequest.requestList;fro.map(n,(i,s)=>{this.getResponse(i,s)},(i,s)=>{if(i)return r(i);let o={tbsResponseData:{version:"v1",responderID:{type:"byKey",value:this.certID.sha1.issuerKeyHash},producedAt:new Date,responses:s},signatureAlgorithm:{algorithm:Jje.utils.signRev.sha512WithRSAEncryption},signature:null,certs:[this.certroot]},a=bjt.createSign("sha512WithRSAEncryption");a.update(REe.ResponseData.encode(o.tbsResponseData,"der")),o.signature={unused:0,data:a.sign(this.key)};let c={responseStatus:"successful",responseBytes:{responseType:"id-pkix-ocsp-basic",response:REe.BasicOCSPResponse.encode(o,"der")}};r(null,REe.OCSPResponse.encode(c,"der"))})}getResponse(e,r){let n=e.reqCert,i=n.hashAlgorithm.algorithm.join("."),s=Jje.utils.digest[i];if(!s)return r(new Error("Unknown digest: "+i));let o=this.certID[s];if(!o)return r(new Error("No pre-generated CertID for digest: "+s));if(o.issuerNameHash.toString("hex")!==n.issuerNameHash.toString("hex"))return r(new Error("Issuer name mismatch"));if(o.issuerKeyHash.toString("hex")!==n.issuerKeyHash.toString("hex"))return r(new Error("Issuer key mismatch"));let a=n.serialNumber.toString(16),c=this.certs[a],u={certId:n,certStatus:null,thisUpdate:new Date,nextUpdate:new Date(+new Date+this.options.nextUpdate)};c?u.certStatus=c:u.certStatus={type:"unknown",value:null},r(null,u)}};PCn.exports=_jt});var UCn=m(qCn=>{var FCn=qw(),gro=V5(),mro=S_();qCn.getOCSPURI=function(e,r){let n=gro["id-pkix-ocsp"].join("."),i=FCn.utils.toDER(e,"CERTIFICATE");i=mro.Certificate.decode(i,"der"),FCn.utils.getAuthorityInfo(i,n,r)}});var jCn=m(HCn=>{var GCn=qw(),WCn=require("crypto"),Xje=V5(),xjt=S_();function Bjt(t){return WCn.createHash("sha1").update(t).digest()}HCn.generate=function(e,r){let n;e.tbsCertificate?n=e:n=xjt.Certificate.decode(GCn.utils.toDER(e,"CERTIFICATE"),"der");let i;r.tbsCertificate?i=r:i=xjt.Certificate.decode(GCn.utils.toDER(r,"CERTIFICATE"),"der");let s=n.tbsCertificate,o=i.tbsCertificate,a={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:Bjt(xjt.Name.encode(s.issuer,"der")),issuerKeyHash:Bjt(o.subjectPublicKeyInfo.subjectPublicKey.data),serialNumber:s.serialNumber},u={tbsRequest:{version:"v1",requestList:[{reqCert:a}],requestExtensions:[{extnID:Xje["id-pkix-ocsp-nonce"],critical:!1,extnValue:Xje.Nonce.encode(WCn.randomBytes(16),"der")}]}};return{id:Bjt(Xje.CertID.encode(a,"der")),certID:a,data:Xje.OCSPRequest.encode(u,"der"),cert:n,issuer:i}}});var KCn=m((SZa,VCn)=>{var Zje=qw(),Ero=V5();VCn.exports=function(e,r){let n=!0,i;function s(a,c){if(n){n=!1,process.nextTick(function(){r(a,c)});return}r(a,c)}try{i=Zje.request.generate(e.cert,e.issuer)}catch(a){return s(a)}let o=Ero["id-pkix-ocsp"].join(".");Zje.utils.getAuthorityInfo(i.cert,o,function(a,c){if(a)return s(a);Zje.utils.getResponse(c,i.data,function(u,l){if(u)return s(u);try{Zje.verify({request:i,response:l},s)}catch(A){return s(A)}})}),n=!1}});var JCn=m((wZa,YCn)=>{var yte=qw(),Mjt=S_(),$Cn=require("crypto");function Cro(t,e,r){let n=t.tbsCertificate.subjectPublicKeyInfo;if(n=yte.utils.toPEM(Mjt.SubjectPublicKeyInfo.encode(n,"der"),"PUBLIC KEY"),e.length){let i=e[0],s=yte.utils.sign[i.signatureAlgorithm.algorithm.join(".")];if(!s)throw new Error("Unknown signature algorithm "+i.signatureAlgorithm.algorithm);let o=$Cn.createVerify(s);if(o.update(r[0]),!o.verify(n,i.signature.data))throw new Error("Invalid signature");let a=i.tbsCertificate.subjectPublicKeyInfo;return a=yte.utils.toPEM(Mjt.SubjectPublicKeyInfo.encode(a,"der"),"PUBLIC KEY"),a}return n}YCn.exports=function(e,r){function n(i,s){process.nextTick(()=>{r(i,s)})}try{let i=e.request,s=i.issuer||Mjt.Certificate.decode(yte.utils.toDER(e.issuer,"CERTIFICATE"),"der"),o=yte.utils.parseResponse(e.response),a=e.response.slice(o.start,o.end),c=o.certs,u=o.certsTbs.map(C=>e.response.slice(C.start,C.end));o=o.value;let l=yte.utils.sign[o.signatureAlgorithm.algorithm.join(".")];if(!l){n(new Error("Unknown signature algorithm "+o.signatureAlgorithm.algorithm),o);return}let A=Cro(s,c,u),p=$Cn.createVerify(l),f=o.tbsResponseData,h=o.signature.data;if(p.update(a),!p.verify(A,h))return n(new Error("Invalid signature"),o);if(f.responses.length<1)return n(new Error("Expected at least one response"));if(o=f.responses[0],o.certId.hashAlgorithm.algorithm.join(".")!==i.certID.hashAlgorithm.algorithm.join("."))return n(new Error("Hash algorithm mismatch"),o);if(o.certId.issuerNameHash.toString("hex")!==i.certID.issuerNameHash.toString("hex"))return n(new Error("Issuer name hash mismatch"),o);if(o.certId.issuerKeyHash.toString("hex")!==i.certID.issuerKeyHash.toString("hex"))return n(new Error("Issuer key hash mismatch"),o);if(o.certId.serialNumber.cmp(i.certID.serialNumber)!==0)return n(new Error("Serial number mismatch"),o);if(o.certStatus.type!=="good")return n(new Error("OCSP Status: "+o.certStatus.type),o);let g=+new Date,E=e.nudge||6e4;return o.thisUpdate-E>g||o.nextUpdate+E<g?n(new Error("OCSP Response expired"),o):n(null,o)}catch(i){return n(i)}}});var ZCn=m(F2=>{var Iro=require("http"),yro=Hje(),XCn=V5(),Ojt=require("buffer").Buffer;F2["id-ad-caIssuers"]=[1,3,6,1,5,5,7,48,2];F2["id-kp-OCSPSigning"]=[1,3,6,1,5,5,7,3,9];F2.getResponse=function(e,r,n){let i={method:"POST",headers:{"Content-Type":"application/ocsp-request","Content-Length":r.length}};function s(a,c){n&&n(a,c),n=null}function o(a){if(a.statusCode<200||a.statusCode>=400)return s(new Error("Failed to obtain OCSP response: "+a.statusCode));let c=[];a.on("readable",function(){let u=a.read();u&&c.push(u)}),a.on("end",function(){let u=Ojt.concat(c);s(null,u)})}Iro.request(e,i,o).on("error",s).end(r)};F2.parseResponse=function(e){let r={start:0,end:e.length},n=XCn.OCSPResponse.decode(e,"der",{track:function(p,f,h,g){g!=="content"||p!=="responseBytes/response"||(r.start=f,r.end=h)}}),i=n.responseStatus;if(i!=="successful")throw new Error("Bad OCSP response status: "+i);let s=n.responseBytes.responseType;if(s!=="id-pkix-ocsp-basic")throw new Error("Unknown OCSP response type: "+s);let o=n.responseBytes.response,a={start:r.start,end:r.end},c=[],u=XCn.BasicOCSPResponse.decode(o,"der",{track:function(p,f,h,g){g==="tagged"&&(p==="tbsResponseData"?(a.start=r.start+f,a.end=r.start+h):p==="certs/tbsCertificate"&&c.push({start:r.start+f,end:r.start+h}))}}),l=F2["id-kp-OCSPSigning"].join("."),A=(u.certs||[]).filter(function(p){return p.tbsCertificate.extensions.some(function(f){return f.extnID!=="extendedKeyUsage"?!1:f.extnValue.some(function(h){return h.join(".")===l})})});return{start:a.start,end:a.end,value:u,certs:A,certsTbs:c}};F2.digest={"1.3.14.3.2.26":"sha1","2.16.840.1.101.3.4.2.1":"sha256"};F2.digestRev={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1"};F2.sign={"1.2.840.113549.1.1.5":"sha1WithRSAEncryption","1.2.840.113549.1.1.4":"md5WithRSAEncryption","1.2.840.113549.1.1.2":"md2WithRSAEncryption","1.2.840.113549.1.1.11":"sha256WithRSAEncryption","1.2.840.113549.1.1.12":"sha384WithRSAEncryption","1.2.840.113549.1.1.13":"sha512WithRSAEncryption","1.2.840.113549.1.1.14":"sha224WithRSAEncryption","1.2.840.10040.4.3":"dsaWithSHA1","1.2.840.10045.4.1":"ecdsa-with-SHA1","1.2.840.10045.4.3.1":"SHA224","1.2.840.10045.4.3.2":"SHA256","1.2.840.10045.4.3.3":"SHA384","1.2.840.10045.4.3.4":"SHA512","2.16.840.1.101.3.4.2.1":"SHA256","2.16.840.1.101.3.4.2.2":"SHA384","2.16.840.1.101.3.4.2.3":"SHA512","2.16.840.1.101.3.4.2.4":"SHA224","2.16.840.1.101.3.4.3.1":"SHA224","2.16.840.1.101.3.4.3.2":"SHA256"};F2.signRev={sha1WithRSAEncryption:[1,2,840,113549,1,1,5],sha256WithRSAEncryption:[1,2,840,113549,1,1,11],sha384WithRSAEncryption:[1,2,840,113549,1,1,12],sha512WithRSAEncryption:[1,2,840,113549,1,1,13]};F2.toPEM=function(e,r){let n=e.toString("base64"),i=["-----BEGIN "+r+"-----"];for(let s=0;s<n.length;s+=64)i.push(n.slice(s,s+64));return i.push("-----END "+r+"-----"),i.join(`
|
|
4124
|
-
`)};F2.toDER=function(e,r){let n=e.toString().match(new RegExp("-----BEGIN "+r+"-----([^-]*)-----END "+r+"-----"));return n?n=Ojt.from(n[1].replace(/[\r\n]/g,""),"base64"):typeof e=="string"?n=Ojt.from(e):n=e,n};F2.getAuthorityInfo=function(e,r,n){let i=e.tbsCertificate.extensions;i||(i=[]);let s=i.filter(function(c){return c.extnID==="authorityInformationAccess"});if(s.length===0)return n(new Error("AuthorityInfoAccess not found in extensions"));let o=null;return s.some(function(c){return c.extnValue.some(function(l){if(l.accessMethod.join(".")!==r)return!1;let A=l.accessLocation;return A.type!=="uniformResourceIdentifier"?!1:(o=A.value+"",!0)})})?n(null,o):n(new Error(r+" not found in AuthorityInfoAccess"))};var bro=yro.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});F2.RSAPrivateKey=bro});var qw=m(Vv=>{Vv.Cache=PEn();Vv.Agent=xCn();Vv.Server=kCn();Vv.getOCSPURI=UCn().getOCSPURI;Vv.request=jCn();Vv.check=KCn();Vv.verify=JCn();Vv.utils=ZCn()});var tIn=m((eIn,Rjt)=>{(function(t,e){"use strict";function r(Q,I){if(!Q)throw new Error(I||"Assertion failed")}function n(Q,I){Q.super_=I;var N=function(){};N.prototype=I.prototype,Q.prototype=new N,Q.prototype.constructor=Q}function i(Q,I,N){if(i.isBN(Q))return Q;this.negative=0,this.words=null,this.length=0,this.red=null,Q!==null&&((I==="le"||I==="be")&&(N=I,I=10),this._init(Q||0,I||10,N||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(I){return I instanceof i?!0:I!==null&&typeof I=="object"&&I.constructor.wordSize===i.wordSize&&Array.isArray(I.words)},i.max=function(I,N){return I.cmp(N)>0?I:N},i.min=function(I,N){return I.cmp(N)<0?I:N},i.prototype._init=function(I,N,T){if(typeof I=="number")return this._initNumber(I,N,T);if(typeof I=="object")return this._initArray(I,N,T);N==="hex"&&(N=16),r(N===(N|0)&&N>=2&&N<=36),I=I.toString().replace(/\s+/g,"");var U=0;I[0]==="-"&&(U++,this.negative=1),U<I.length&&(N===16?this._parseHex(I,U,T):(this._parseBase(I,N,U),T==="le"&&this._initArray(this.toArray(),N,T)))},i.prototype._initNumber=function(I,N,T){I<0&&(this.negative=1,I=-I),I<67108864?(this.words=[I&67108863],this.length=1):I<4503599627370496?(this.words=[I&67108863,I/67108864&67108863],this.length=2):(r(I<9007199254740992),this.words=[I&67108863,I/67108864&67108863,1],this.length=3),T==="le"&&this._initArray(this.toArray(),N,T)},i.prototype._initArray=function(I,N,T){if(r(typeof I.length=="number"),I.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(I.length/3),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var q,D,v=0;if(T==="be")for(U=I.length-1,q=0;U>=0;U-=3)D=I[U]|I[U-1]<<8|I[U-2]<<16,this.words[q]|=D<<v&67108863,this.words[q+1]=D>>>26-v&67108863,v+=24,v>=26&&(v-=26,q++);else if(T==="le")for(U=0,q=0;U<I.length;U+=3)D=I[U]|I[U+1]<<8|I[U+2]<<16,this.words[q]|=D<<v&67108863,this.words[q+1]=D>>>26-v&67108863,v+=24,v>=26&&(v-=26,q++);return this._strip()};function o(Q,I){var N=Q.charCodeAt(I);if(N>=48&&N<=57)return N-48;if(N>=65&&N<=70)return N-55;if(N>=97&&N<=102)return N-87;r(!1,"Invalid character in "+Q)}function a(Q,I,N){var T=o(Q,N);return N-1>=I&&(T|=o(Q,N-1)<<4),T}i.prototype._parseHex=function(I,N,T){this.length=Math.ceil((I.length-N)/6),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var q=0,D=0,v;if(T==="be")for(U=I.length-1;U>=N;U-=2)v=a(I,N,U)<<q,this.words[D]|=v&67108863,q>=18?(q-=18,D+=1,this.words[D]|=v>>>26):q+=8;else{var k=I.length-N;for(U=k%2===0?N+1:N;U<I.length;U+=2)v=a(I,N,U)<<q,this.words[D]|=v&67108863,q>=18?(q-=18,D+=1,this.words[D]|=v>>>26):q+=8}this._strip()};function c(Q,I,N,T){for(var U=0,q=0,D=Math.min(Q.length,N),v=I;v<D;v++){var k=Q.charCodeAt(v)-48;U*=T,k>=49?q=k-49+10:k>=17?q=k-17+10:q=k,r(k>=0&&q<T,"Invalid character"),U+=q}return U}i.prototype._parseBase=function(I,N,T){this.words=[0],this.length=1;for(var U=0,q=1;q<=67108863;q*=N)U++;U--,q=q/N|0;for(var D=I.length-T,v=D%U,k=Math.min(D,D-v)+T,G=0,J=T;J<k;J+=U)G=c(I,J,J+U,N),this.imuln(q),this.words[0]+G<67108864?this.words[0]+=G:this._iaddn(G);if(v!==0){var Qe=1;for(G=c(I,J,I.length,N),J=0;J<v;J++)Qe*=N;this.imuln(Qe),this.words[0]+G<67108864?this.words[0]+=G:this._iaddn(G)}this._strip()},i.prototype.copy=function(I){I.words=new Array(this.length);for(var N=0;N<this.length;N++)I.words[N]=this.words[N];I.length=this.length,I.negative=this.negative,I.red=this.red};function u(Q,I){Q.words=I.words,Q.length=I.length,Q.negative=I.negative,Q.red=I.red}if(i.prototype._move=function(I){u(I,this)},i.prototype.clone=function(){var I=new i(null);return this.copy(I),I},i.prototype._expand=function(I){for(;this.length<I;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(I,N){I=I||10,N=N|0||1;var T;if(I===16||I==="hex"){T="";for(var U=0,q=0,D=0;D<this.length;D++){var v=this.words[D],k=((v<<U|q)&16777215).toString(16);q=v>>>24-U&16777215,U+=2,U>=26&&(U-=26,D--),q!==0||D!==this.length-1?T=A[6-k.length]+k+T:T=k+T}for(q!==0&&(T=q.toString(16)+T);T.length%N!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}if(I===(I|0)&&I>=2&&I<=36){var G=p[I],J=f[I];T="";var Qe=this.clone();for(Qe.negative=0;!Qe.isZero();){var Re=Qe.modrn(J).toString(I);Qe=Qe.idivn(J),Qe.isZero()?T=Re+T:T=A[G-Re.length]+Re+T}for(this.isZero()&&(T="0"+T);T.length%N!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(I,N){return this.toArrayLike(s,I,N)}),i.prototype.toArray=function(I,N){return this.toArrayLike(Array,I,N)};var h=function(I,N){return I.allocUnsafe?I.allocUnsafe(N):new I(N)};i.prototype.toArrayLike=function(I,N,T){this._strip();var U=this.byteLength(),q=T||Math.max(1,U);r(U<=q,"byte array longer than desired length"),r(q>0,"Requested array length <= 0");var D=h(I,q),v=N==="le"?"LE":"BE";return this["_toArrayLike"+v](D,U),D},i.prototype._toArrayLikeLE=function(I,N){for(var T=0,U=0,q=0,D=0;q<this.length;q++){var v=this.words[q]<<D|U;I[T++]=v&255,T<I.length&&(I[T++]=v>>8&255),T<I.length&&(I[T++]=v>>16&255),D===6?(T<I.length&&(I[T++]=v>>24&255),U=0,D=0):(U=v>>>24,D+=2)}if(T<I.length)for(I[T++]=U;T<I.length;)I[T++]=0},i.prototype._toArrayLikeBE=function(I,N){for(var T=I.length-1,U=0,q=0,D=0;q<this.length;q++){var v=this.words[q]<<D|U;I[T--]=v&255,T>=0&&(I[T--]=v>>8&255),T>=0&&(I[T--]=v>>16&255),D===6?(T>=0&&(I[T--]=v>>24&255),U=0,D=0):(U=v>>>24,D+=2)}if(T>=0)for(I[T--]=U;T>=0;)I[T--]=0},Math.clz32?i.prototype._countBits=function(I){return 32-Math.clz32(I)}:i.prototype._countBits=function(I){var N=I,T=0;return N>=4096&&(T+=13,N>>>=13),N>=64&&(T+=7,N>>>=7),N>=8&&(T+=4,N>>>=4),N>=2&&(T+=2,N>>>=2),T+N},i.prototype._zeroBits=function(I){if(I===0)return 26;var N=I,T=0;return(N&8191)===0&&(T+=13,N>>>=13),(N&127)===0&&(T+=7,N>>>=7),(N&15)===0&&(T+=4,N>>>=4),(N&3)===0&&(T+=2,N>>>=2),(N&1)===0&&T++,T},i.prototype.bitLength=function(){var I=this.words[this.length-1],N=this._countBits(I);return(this.length-1)*26+N};function g(Q){for(var I=new Array(Q.bitLength()),N=0;N<I.length;N++){var T=N/26|0,U=N%26;I[N]=Q.words[T]>>>U&1}return I}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,N=0;N<this.length;N++){var T=this._zeroBits(this.words[N]);if(I+=T,T!==26)break}return I},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(I){return this.negative!==0?this.abs().inotn(I).iaddn(1):this.clone()},i.prototype.fromTwos=function(I){return this.testn(I-1)?this.notn(I).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(I){for(;this.length<I.length;)this.words[this.length++]=0;for(var N=0;N<I.length;N++)this.words[N]=this.words[N]|I.words[N];return this._strip()},i.prototype.ior=function(I){return r((this.negative|I.negative)===0),this.iuor(I)},i.prototype.or=function(I){return this.length>I.length?this.clone().ior(I):I.clone().ior(this)},i.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},i.prototype.iuand=function(I){var N;this.length>I.length?N=I:N=this;for(var T=0;T<N.length;T++)this.words[T]=this.words[T]&I.words[T];return this.length=N.length,this._strip()},i.prototype.iand=function(I){return r((this.negative|I.negative)===0),this.iuand(I)},i.prototype.and=function(I){return this.length>I.length?this.clone().iand(I):I.clone().iand(this)},i.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},i.prototype.iuxor=function(I){var N,T;this.length>I.length?(N=this,T=I):(N=I,T=this);for(var U=0;U<T.length;U++)this.words[U]=N.words[U]^T.words[U];if(this!==N)for(;U<N.length;U++)this.words[U]=N.words[U];return this.length=N.length,this._strip()},i.prototype.ixor=function(I){return r((this.negative|I.negative)===0),this.iuxor(I)},i.prototype.xor=function(I){return this.length>I.length?this.clone().ixor(I):I.clone().ixor(this)},i.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},i.prototype.inotn=function(I){r(typeof I=="number"&&I>=0);var N=Math.ceil(I/26)|0,T=I%26;this._expand(N),T>0&&N--;for(var U=0;U<N;U++)this.words[U]=~this.words[U]&67108863;return T>0&&(this.words[U]=~this.words[U]&67108863>>26-T),this._strip()},i.prototype.notn=function(I){return this.clone().inotn(I)},i.prototype.setn=function(I,N){r(typeof I=="number"&&I>=0);var T=I/26|0,U=I%26;return this._expand(T+1),N?this.words[T]=this.words[T]|1<<U:this.words[T]=this.words[T]&~(1<<U),this._strip()},i.prototype.iadd=function(I){var N;if(this.negative!==0&&I.negative===0)return this.negative=0,N=this.isub(I),this.negative^=1,this._normSign();if(this.negative===0&&I.negative!==0)return I.negative=0,N=this.isub(I),I.negative=1,N._normSign();var T,U;this.length>I.length?(T=this,U=I):(T=I,U=this);for(var q=0,D=0;D<U.length;D++)N=(T.words[D]|0)+(U.words[D]|0)+q,this.words[D]=N&67108863,q=N>>>26;for(;q!==0&&D<T.length;D++)N=(T.words[D]|0)+q,this.words[D]=N&67108863,q=N>>>26;if(this.length=T.length,q!==0)this.words[this.length]=q,this.length++;else if(T!==this)for(;D<T.length;D++)this.words[D]=T.words[D];return this},i.prototype.add=function(I){var N;return I.negative!==0&&this.negative===0?(I.negative=0,N=this.sub(I),I.negative^=1,N):I.negative===0&&this.negative!==0?(this.negative=0,N=I.sub(this),this.negative=1,N):this.length>I.length?this.clone().iadd(I):I.clone().iadd(this)},i.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var N=this.iadd(I);return I.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var T=this.cmp(I);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var U,q;T>0?(U=this,q=I):(U=I,q=this);for(var D=0,v=0;v<q.length;v++)N=(U.words[v]|0)-(q.words[v]|0)+D,D=N>>26,this.words[v]=N&67108863;for(;D!==0&&v<U.length;v++)N=(U.words[v]|0)+D,D=N>>26,this.words[v]=N&67108863;if(D===0&&v<U.length&&U!==this)for(;v<U.length;v++)this.words[v]=U.words[v];return this.length=Math.max(this.length,v),U!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(I){return this.clone().isub(I)};function E(Q,I,N){N.negative=I.negative^Q.negative;var T=Q.length+I.length|0;N.length=T,T=T-1|0;var U=Q.words[0]|0,q=I.words[0]|0,D=U*q,v=D&67108863,k=D/67108864|0;N.words[0]=v;for(var G=1;G<T;G++){for(var J=k>>>26,Qe=k&67108863,Re=Math.min(G,I.length-1),$e=Math.max(0,G-Q.length+1);$e<=Re;$e++){var Bt=G-$e|0;U=Q.words[Bt]|0,q=I.words[$e]|0,D=U*q+Qe,J+=D/67108864|0,Qe=D&67108863}N.words[G]=Qe|0,k=J|0}return k!==0?N.words[G]=k|0:N.length--,N._strip()}var C=function(I,N,T){var U=I.words,q=N.words,D=T.words,v=0,k,G,J,Qe=U[0]|0,Re=Qe&8191,$e=Qe>>>13,Bt=U[1]|0,Pt=Bt&8191,ge=Bt>>>13,Ve=U[2]|0,Ke=Ve&8191,Me=Ve>>>13,ke=U[3]|0,Fe=ke&8191,rt=ke>>>13,ct=U[4]|0,at=ct&8191,gt=ct>>>13,mt=U[5]|0,Ye=mt&8191,jt=mt>>>13,Ar=U[6]|0,yr=Ar&8191,le=Ar>>>13,Se=U[7]|0,ve=Se&8191,nt=Se>>>13,de=U[8]|0,K=de&8191,ae=de>>>13,Oe=U[9]|0,ze=Oe&8191,_e=Oe>>>13,bt=q[0]|0,vt=bt&8191,kt=bt>>>13,It=q[1]|0,it=It&8191,Ft=It>>>13,De=q[2]|0,we=De&8191,ot=De>>>13,xt=q[3]|0,H=xt&8191,fe=xt>>>13,Ie=q[4]|0,Be=Ie&8191,Le=Ie>>>13,er=q[5]|0,te=er&8191,Y=er>>>13,ie=q[6]|0,xe=ie&8191,qe=ie>>>13,Je=q[7]|0,wt=Je&8191,lt=Je>>>13,Wt=q[8]|0,zt=Wt&8191,sr=Wt>>>13,tn=q[9]|0,pe=tn&8191,j=tn>>>13;T.negative=I.negative^N.negative,T.length=19,k=Math.imul(Re,vt),G=Math.imul(Re,kt),G=G+Math.imul($e,vt)|0,J=Math.imul($e,kt);var se=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(se>>>26)|0,se&=67108863,k=Math.imul(Pt,vt),G=Math.imul(Pt,kt),G=G+Math.imul(ge,vt)|0,J=Math.imul(ge,kt),k=k+Math.imul(Re,it)|0,G=G+Math.imul(Re,Ft)|0,G=G+Math.imul($e,it)|0,J=J+Math.imul($e,Ft)|0;var Ne=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,k=Math.imul(Ke,vt),G=Math.imul(Ke,kt),G=G+Math.imul(Me,vt)|0,J=Math.imul(Me,kt),k=k+Math.imul(Pt,it)|0,G=G+Math.imul(Pt,Ft)|0,G=G+Math.imul(ge,it)|0,J=J+Math.imul(ge,Ft)|0,k=k+Math.imul(Re,we)|0,G=G+Math.imul(Re,ot)|0,G=G+Math.imul($e,we)|0,J=J+Math.imul($e,ot)|0;var Pe=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,k=Math.imul(Fe,vt),G=Math.imul(Fe,kt),G=G+Math.imul(rt,vt)|0,J=Math.imul(rt,kt),k=k+Math.imul(Ke,it)|0,G=G+Math.imul(Ke,Ft)|0,G=G+Math.imul(Me,it)|0,J=J+Math.imul(Me,Ft)|0,k=k+Math.imul(Pt,we)|0,G=G+Math.imul(Pt,ot)|0,G=G+Math.imul(ge,we)|0,J=J+Math.imul(ge,ot)|0,k=k+Math.imul(Re,H)|0,G=G+Math.imul(Re,fe)|0,G=G+Math.imul($e,H)|0,J=J+Math.imul($e,fe)|0;var tt=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(tt>>>26)|0,tt&=67108863,k=Math.imul(at,vt),G=Math.imul(at,kt),G=G+Math.imul(gt,vt)|0,J=Math.imul(gt,kt),k=k+Math.imul(Fe,it)|0,G=G+Math.imul(Fe,Ft)|0,G=G+Math.imul(rt,it)|0,J=J+Math.imul(rt,Ft)|0,k=k+Math.imul(Ke,we)|0,G=G+Math.imul(Ke,ot)|0,G=G+Math.imul(Me,we)|0,J=J+Math.imul(Me,ot)|0,k=k+Math.imul(Pt,H)|0,G=G+Math.imul(Pt,fe)|0,G=G+Math.imul(ge,H)|0,J=J+Math.imul(ge,fe)|0,k=k+Math.imul(Re,Be)|0,G=G+Math.imul(Re,Le)|0,G=G+Math.imul($e,Be)|0,J=J+Math.imul($e,Le)|0;var Ht=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,k=Math.imul(Ye,vt),G=Math.imul(Ye,kt),G=G+Math.imul(jt,vt)|0,J=Math.imul(jt,kt),k=k+Math.imul(at,it)|0,G=G+Math.imul(at,Ft)|0,G=G+Math.imul(gt,it)|0,J=J+Math.imul(gt,Ft)|0,k=k+Math.imul(Fe,we)|0,G=G+Math.imul(Fe,ot)|0,G=G+Math.imul(rt,we)|0,J=J+Math.imul(rt,ot)|0,k=k+Math.imul(Ke,H)|0,G=G+Math.imul(Ke,fe)|0,G=G+Math.imul(Me,H)|0,J=J+Math.imul(Me,fe)|0,k=k+Math.imul(Pt,Be)|0,G=G+Math.imul(Pt,Le)|0,G=G+Math.imul(ge,Be)|0,J=J+Math.imul(ge,Le)|0,k=k+Math.imul(Re,te)|0,G=G+Math.imul(Re,Y)|0,G=G+Math.imul($e,te)|0,J=J+Math.imul($e,Y)|0;var Et=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(yr,vt),G=Math.imul(yr,kt),G=G+Math.imul(le,vt)|0,J=Math.imul(le,kt),k=k+Math.imul(Ye,it)|0,G=G+Math.imul(Ye,Ft)|0,G=G+Math.imul(jt,it)|0,J=J+Math.imul(jt,Ft)|0,k=k+Math.imul(at,we)|0,G=G+Math.imul(at,ot)|0,G=G+Math.imul(gt,we)|0,J=J+Math.imul(gt,ot)|0,k=k+Math.imul(Fe,H)|0,G=G+Math.imul(Fe,fe)|0,G=G+Math.imul(rt,H)|0,J=J+Math.imul(rt,fe)|0,k=k+Math.imul(Ke,Be)|0,G=G+Math.imul(Ke,Le)|0,G=G+Math.imul(Me,Be)|0,J=J+Math.imul(Me,Le)|0,k=k+Math.imul(Pt,te)|0,G=G+Math.imul(Pt,Y)|0,G=G+Math.imul(ge,te)|0,J=J+Math.imul(ge,Y)|0,k=k+Math.imul(Re,xe)|0,G=G+Math.imul(Re,qe)|0,G=G+Math.imul($e,xe)|0,J=J+Math.imul($e,qe)|0;var We=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(We>>>26)|0,We&=67108863,k=Math.imul(ve,vt),G=Math.imul(ve,kt),G=G+Math.imul(nt,vt)|0,J=Math.imul(nt,kt),k=k+Math.imul(yr,it)|0,G=G+Math.imul(yr,Ft)|0,G=G+Math.imul(le,it)|0,J=J+Math.imul(le,Ft)|0,k=k+Math.imul(Ye,we)|0,G=G+Math.imul(Ye,ot)|0,G=G+Math.imul(jt,we)|0,J=J+Math.imul(jt,ot)|0,k=k+Math.imul(at,H)|0,G=G+Math.imul(at,fe)|0,G=G+Math.imul(gt,H)|0,J=J+Math.imul(gt,fe)|0,k=k+Math.imul(Fe,Be)|0,G=G+Math.imul(Fe,Le)|0,G=G+Math.imul(rt,Be)|0,J=J+Math.imul(rt,Le)|0,k=k+Math.imul(Ke,te)|0,G=G+Math.imul(Ke,Y)|0,G=G+Math.imul(Me,te)|0,J=J+Math.imul(Me,Y)|0,k=k+Math.imul(Pt,xe)|0,G=G+Math.imul(Pt,qe)|0,G=G+Math.imul(ge,xe)|0,J=J+Math.imul(ge,qe)|0,k=k+Math.imul(Re,wt)|0,G=G+Math.imul(Re,lt)|0,G=G+Math.imul($e,wt)|0,J=J+Math.imul($e,lt)|0;var Xe=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,k=Math.imul(K,vt),G=Math.imul(K,kt),G=G+Math.imul(ae,vt)|0,J=Math.imul(ae,kt),k=k+Math.imul(ve,it)|0,G=G+Math.imul(ve,Ft)|0,G=G+Math.imul(nt,it)|0,J=J+Math.imul(nt,Ft)|0,k=k+Math.imul(yr,we)|0,G=G+Math.imul(yr,ot)|0,G=G+Math.imul(le,we)|0,J=J+Math.imul(le,ot)|0,k=k+Math.imul(Ye,H)|0,G=G+Math.imul(Ye,fe)|0,G=G+Math.imul(jt,H)|0,J=J+Math.imul(jt,fe)|0,k=k+Math.imul(at,Be)|0,G=G+Math.imul(at,Le)|0,G=G+Math.imul(gt,Be)|0,J=J+Math.imul(gt,Le)|0,k=k+Math.imul(Fe,te)|0,G=G+Math.imul(Fe,Y)|0,G=G+Math.imul(rt,te)|0,J=J+Math.imul(rt,Y)|0,k=k+Math.imul(Ke,xe)|0,G=G+Math.imul(Ke,qe)|0,G=G+Math.imul(Me,xe)|0,J=J+Math.imul(Me,qe)|0,k=k+Math.imul(Pt,wt)|0,G=G+Math.imul(Pt,lt)|0,G=G+Math.imul(ge,wt)|0,J=J+Math.imul(ge,lt)|0,k=k+Math.imul(Re,zt)|0,G=G+Math.imul(Re,sr)|0,G=G+Math.imul($e,zt)|0,J=J+Math.imul($e,sr)|0;var Ct=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,k=Math.imul(ze,vt),G=Math.imul(ze,kt),G=G+Math.imul(_e,vt)|0,J=Math.imul(_e,kt),k=k+Math.imul(K,it)|0,G=G+Math.imul(K,Ft)|0,G=G+Math.imul(ae,it)|0,J=J+Math.imul(ae,Ft)|0,k=k+Math.imul(ve,we)|0,G=G+Math.imul(ve,ot)|0,G=G+Math.imul(nt,we)|0,J=J+Math.imul(nt,ot)|0,k=k+Math.imul(yr,H)|0,G=G+Math.imul(yr,fe)|0,G=G+Math.imul(le,H)|0,J=J+Math.imul(le,fe)|0,k=k+Math.imul(Ye,Be)|0,G=G+Math.imul(Ye,Le)|0,G=G+Math.imul(jt,Be)|0,J=J+Math.imul(jt,Le)|0,k=k+Math.imul(at,te)|0,G=G+Math.imul(at,Y)|0,G=G+Math.imul(gt,te)|0,J=J+Math.imul(gt,Y)|0,k=k+Math.imul(Fe,xe)|0,G=G+Math.imul(Fe,qe)|0,G=G+Math.imul(rt,xe)|0,J=J+Math.imul(rt,qe)|0,k=k+Math.imul(Ke,wt)|0,G=G+Math.imul(Ke,lt)|0,G=G+Math.imul(Me,wt)|0,J=J+Math.imul(Me,lt)|0,k=k+Math.imul(Pt,zt)|0,G=G+Math.imul(Pt,sr)|0,G=G+Math.imul(ge,zt)|0,J=J+Math.imul(ge,sr)|0,k=k+Math.imul(Re,pe)|0,G=G+Math.imul(Re,j)|0,G=G+Math.imul($e,pe)|0,J=J+Math.imul($e,j)|0;var Gt=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,k=Math.imul(ze,it),G=Math.imul(ze,Ft),G=G+Math.imul(_e,it)|0,J=Math.imul(_e,Ft),k=k+Math.imul(K,we)|0,G=G+Math.imul(K,ot)|0,G=G+Math.imul(ae,we)|0,J=J+Math.imul(ae,ot)|0,k=k+Math.imul(ve,H)|0,G=G+Math.imul(ve,fe)|0,G=G+Math.imul(nt,H)|0,J=J+Math.imul(nt,fe)|0,k=k+Math.imul(yr,Be)|0,G=G+Math.imul(yr,Le)|0,G=G+Math.imul(le,Be)|0,J=J+Math.imul(le,Le)|0,k=k+Math.imul(Ye,te)|0,G=G+Math.imul(Ye,Y)|0,G=G+Math.imul(jt,te)|0,J=J+Math.imul(jt,Y)|0,k=k+Math.imul(at,xe)|0,G=G+Math.imul(at,qe)|0,G=G+Math.imul(gt,xe)|0,J=J+Math.imul(gt,qe)|0,k=k+Math.imul(Fe,wt)|0,G=G+Math.imul(Fe,lt)|0,G=G+Math.imul(rt,wt)|0,J=J+Math.imul(rt,lt)|0,k=k+Math.imul(Ke,zt)|0,G=G+Math.imul(Ke,sr)|0,G=G+Math.imul(Me,zt)|0,J=J+Math.imul(Me,sr)|0,k=k+Math.imul(Pt,pe)|0,G=G+Math.imul(Pt,j)|0,G=G+Math.imul(ge,pe)|0,J=J+Math.imul(ge,j)|0;var Mr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(ze,we),G=Math.imul(ze,ot),G=G+Math.imul(_e,we)|0,J=Math.imul(_e,ot),k=k+Math.imul(K,H)|0,G=G+Math.imul(K,fe)|0,G=G+Math.imul(ae,H)|0,J=J+Math.imul(ae,fe)|0,k=k+Math.imul(ve,Be)|0,G=G+Math.imul(ve,Le)|0,G=G+Math.imul(nt,Be)|0,J=J+Math.imul(nt,Le)|0,k=k+Math.imul(yr,te)|0,G=G+Math.imul(yr,Y)|0,G=G+Math.imul(le,te)|0,J=J+Math.imul(le,Y)|0,k=k+Math.imul(Ye,xe)|0,G=G+Math.imul(Ye,qe)|0,G=G+Math.imul(jt,xe)|0,J=J+Math.imul(jt,qe)|0,k=k+Math.imul(at,wt)|0,G=G+Math.imul(at,lt)|0,G=G+Math.imul(gt,wt)|0,J=J+Math.imul(gt,lt)|0,k=k+Math.imul(Fe,zt)|0,G=G+Math.imul(Fe,sr)|0,G=G+Math.imul(rt,zt)|0,J=J+Math.imul(rt,sr)|0,k=k+Math.imul(Ke,pe)|0,G=G+Math.imul(Ke,j)|0,G=G+Math.imul(Me,pe)|0,J=J+Math.imul(Me,j)|0;var ir=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(ze,H),G=Math.imul(ze,fe),G=G+Math.imul(_e,H)|0,J=Math.imul(_e,fe),k=k+Math.imul(K,Be)|0,G=G+Math.imul(K,Le)|0,G=G+Math.imul(ae,Be)|0,J=J+Math.imul(ae,Le)|0,k=k+Math.imul(ve,te)|0,G=G+Math.imul(ve,Y)|0,G=G+Math.imul(nt,te)|0,J=J+Math.imul(nt,Y)|0,k=k+Math.imul(yr,xe)|0,G=G+Math.imul(yr,qe)|0,G=G+Math.imul(le,xe)|0,J=J+Math.imul(le,qe)|0,k=k+Math.imul(Ye,wt)|0,G=G+Math.imul(Ye,lt)|0,G=G+Math.imul(jt,wt)|0,J=J+Math.imul(jt,lt)|0,k=k+Math.imul(at,zt)|0,G=G+Math.imul(at,sr)|0,G=G+Math.imul(gt,zt)|0,J=J+Math.imul(gt,sr)|0,k=k+Math.imul(Fe,pe)|0,G=G+Math.imul(Fe,j)|0,G=G+Math.imul(rt,pe)|0,J=J+Math.imul(rt,j)|0;var Cr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(ze,Be),G=Math.imul(ze,Le),G=G+Math.imul(_e,Be)|0,J=Math.imul(_e,Le),k=k+Math.imul(K,te)|0,G=G+Math.imul(K,Y)|0,G=G+Math.imul(ae,te)|0,J=J+Math.imul(ae,Y)|0,k=k+Math.imul(ve,xe)|0,G=G+Math.imul(ve,qe)|0,G=G+Math.imul(nt,xe)|0,J=J+Math.imul(nt,qe)|0,k=k+Math.imul(yr,wt)|0,G=G+Math.imul(yr,lt)|0,G=G+Math.imul(le,wt)|0,J=J+Math.imul(le,lt)|0,k=k+Math.imul(Ye,zt)|0,G=G+Math.imul(Ye,sr)|0,G=G+Math.imul(jt,zt)|0,J=J+Math.imul(jt,sr)|0,k=k+Math.imul(at,pe)|0,G=G+Math.imul(at,j)|0,G=G+Math.imul(gt,pe)|0,J=J+Math.imul(gt,j)|0;var kr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(ze,te),G=Math.imul(ze,Y),G=G+Math.imul(_e,te)|0,J=Math.imul(_e,Y),k=k+Math.imul(K,xe)|0,G=G+Math.imul(K,qe)|0,G=G+Math.imul(ae,xe)|0,J=J+Math.imul(ae,qe)|0,k=k+Math.imul(ve,wt)|0,G=G+Math.imul(ve,lt)|0,G=G+Math.imul(nt,wt)|0,J=J+Math.imul(nt,lt)|0,k=k+Math.imul(yr,zt)|0,G=G+Math.imul(yr,sr)|0,G=G+Math.imul(le,zt)|0,J=J+Math.imul(le,sr)|0,k=k+Math.imul(Ye,pe)|0,G=G+Math.imul(Ye,j)|0,G=G+Math.imul(jt,pe)|0,J=J+Math.imul(jt,j)|0;var qn=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(qn>>>26)|0,qn&=67108863,k=Math.imul(ze,xe),G=Math.imul(ze,qe),G=G+Math.imul(_e,xe)|0,J=Math.imul(_e,qe),k=k+Math.imul(K,wt)|0,G=G+Math.imul(K,lt)|0,G=G+Math.imul(ae,wt)|0,J=J+Math.imul(ae,lt)|0,k=k+Math.imul(ve,zt)|0,G=G+Math.imul(ve,sr)|0,G=G+Math.imul(nt,zt)|0,J=J+Math.imul(nt,sr)|0,k=k+Math.imul(yr,pe)|0,G=G+Math.imul(yr,j)|0,G=G+Math.imul(le,pe)|0,J=J+Math.imul(le,j)|0;var Li=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Li>>>26)|0,Li&=67108863,k=Math.imul(ze,wt),G=Math.imul(ze,lt),G=G+Math.imul(_e,wt)|0,J=Math.imul(_e,lt),k=k+Math.imul(K,zt)|0,G=G+Math.imul(K,sr)|0,G=G+Math.imul(ae,zt)|0,J=J+Math.imul(ae,sr)|0,k=k+Math.imul(ve,pe)|0,G=G+Math.imul(ve,j)|0,G=G+Math.imul(nt,pe)|0,J=J+Math.imul(nt,j)|0;var Va=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Va>>>26)|0,Va&=67108863,k=Math.imul(ze,zt),G=Math.imul(ze,sr),G=G+Math.imul(_e,zt)|0,J=Math.imul(_e,sr),k=k+Math.imul(K,pe)|0,G=G+Math.imul(K,j)|0,G=G+Math.imul(ae,pe)|0,J=J+Math.imul(ae,j)|0;var mc=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(mc>>>26)|0,mc&=67108863,k=Math.imul(ze,pe),G=Math.imul(ze,j),G=G+Math.imul(_e,pe)|0,J=Math.imul(_e,j);var F0=(v+k|0)+((G&8191)<<13)|0;return v=(J+(G>>>13)|0)+(F0>>>26)|0,F0&=67108863,D[0]=se,D[1]=Ne,D[2]=Pe,D[3]=tt,D[4]=Ht,D[5]=Et,D[6]=We,D[7]=Xe,D[8]=Ct,D[9]=Gt,D[10]=Mr,D[11]=ir,D[12]=Cr,D[13]=kr,D[14]=qn,D[15]=Li,D[16]=Va,D[17]=mc,D[18]=F0,v!==0&&(D[19]=v,T.length++),T};Math.imul||(C=E);function y(Q,I,N){N.negative=I.negative^Q.negative,N.length=Q.length+I.length;for(var T=0,U=0,q=0;q<N.length-1;q++){var D=U;U=0;for(var v=T&67108863,k=Math.min(q,I.length-1),G=Math.max(0,q-Q.length+1);G<=k;G++){var J=q-G,Qe=Q.words[J]|0,Re=I.words[G]|0,$e=Qe*Re,Bt=$e&67108863;D=D+($e/67108864|0)|0,Bt=Bt+v|0,v=Bt&67108863,D=D+(Bt>>>26)|0,U+=D>>>26,D&=67108863}N.words[q]=v,T=D,D=U}return T!==0?N.words[q]=T:N.length--,N._strip()}function b(Q,I,N){return y(Q,I,N)}i.prototype.mulTo=function(I,N){var T,U=this.length+I.length;return this.length===10&&I.length===10?T=C(this,I,N):U<63?T=E(this,I,N):U<1024?T=y(this,I,N):T=b(this,I,N),T};function O(Q,I){this.x=Q,this.y=I}O.prototype.makeRBT=function(I){for(var N=new Array(I),T=i.prototype._countBits(I)-1,U=0;U<I;U++)N[U]=this.revBin(U,T,I);return N},O.prototype.revBin=function(I,N,T){if(I===0||I===T-1)return I;for(var U=0,q=0;q<N;q++)U|=(I&1)<<N-q-1,I>>=1;return U},O.prototype.permute=function(I,N,T,U,q,D){for(var v=0;v<D;v++)U[v]=N[I[v]],q[v]=T[I[v]]},O.prototype.transform=function(I,N,T,U,q,D){this.permute(D,I,N,T,U,q);for(var v=1;v<q;v<<=1)for(var k=v<<1,G=Math.cos(2*Math.PI/k),J=Math.sin(2*Math.PI/k),Qe=0;Qe<q;Qe+=k)for(var Re=G,$e=J,Bt=0;Bt<v;Bt++){var Pt=T[Qe+Bt],ge=U[Qe+Bt],Ve=T[Qe+Bt+v],Ke=U[Qe+Bt+v],Me=Re*Ve-$e*Ke;Ke=Re*Ke+$e*Ve,Ve=Me,T[Qe+Bt]=Pt+Ve,U[Qe+Bt]=ge+Ke,T[Qe+Bt+v]=Pt-Ve,U[Qe+Bt+v]=ge-Ke,Bt!==k&&(Me=G*Re-J*$e,$e=G*$e+J*Re,Re=Me)}},O.prototype.guessLen13b=function(I,N){var T=Math.max(N,I)|1,U=T&1,q=0;for(T=T/2|0;T;T=T>>>1)q++;return 1<<q+1+U},O.prototype.conjugate=function(I,N,T){if(!(T<=1))for(var U=0;U<T/2;U++){var q=I[U];I[U]=I[T-U-1],I[T-U-1]=q,q=N[U],N[U]=-N[T-U-1],N[T-U-1]=-q}},O.prototype.normalize13b=function(I,N){for(var T=0,U=0;U<N/2;U++){var q=Math.round(I[2*U+1]/N)*8192+Math.round(I[2*U]/N)+T;I[U]=q&67108863,q<67108864?T=0:T=q/67108864|0}return I},O.prototype.convert13b=function(I,N,T,U){for(var q=0,D=0;D<N;D++)q=q+(I[D]|0),T[2*D]=q&8191,q=q>>>13,T[2*D+1]=q&8191,q=q>>>13;for(D=2*N;D<U;++D)T[D]=0;r(q===0),r((q&-8192)===0)},O.prototype.stub=function(I){for(var N=new Array(I),T=0;T<I;T++)N[T]=0;return N},O.prototype.mulp=function(I,N,T){var U=2*this.guessLen13b(I.length,N.length),q=this.makeRBT(U),D=this.stub(U),v=new Array(U),k=new Array(U),G=new Array(U),J=new Array(U),Qe=new Array(U),Re=new Array(U),$e=T.words;$e.length=U,this.convert13b(I.words,I.length,v,U),this.convert13b(N.words,N.length,J,U),this.transform(v,D,k,G,U,q),this.transform(J,D,Qe,Re,U,q);for(var Bt=0;Bt<U;Bt++){var Pt=k[Bt]*Qe[Bt]-G[Bt]*Re[Bt];G[Bt]=k[Bt]*Re[Bt]+G[Bt]*Qe[Bt],k[Bt]=Pt}return this.conjugate(k,G,U),this.transform(k,G,$e,D,U,q),this.conjugate($e,D,U),this.normalize13b($e,U),T.negative=I.negative^N.negative,T.length=I.length+N.length,T._strip()},i.prototype.mul=function(I){var N=new i(null);return N.words=new Array(this.length+I.length),this.mulTo(I,N)},i.prototype.mulf=function(I){var N=new i(null);return N.words=new Array(this.length+I.length),b(this,I,N)},i.prototype.imul=function(I){return this.clone().mulTo(I,this)},i.prototype.imuln=function(I){var N=I<0;N&&(I=-I),r(typeof I=="number"),r(I<67108864);for(var T=0,U=0;U<this.length;U++){var q=(this.words[U]|0)*I,D=(q&67108863)+(T&67108863);T>>=26,T+=q/67108864|0,T+=D>>>26,this.words[U]=D&67108863}return T!==0&&(this.words[U]=T,this.length++),this.length=I===0?1:this.length,N?this.ineg():this},i.prototype.muln=function(I){return this.clone().imuln(I)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(I){var N=g(I);if(N.length===0)return new i(1);for(var T=this,U=0;U<N.length&&N[U]===0;U++,T=T.sqr());if(++U<N.length)for(var q=T.sqr();U<N.length;U++,q=q.sqr())N[U]!==0&&(T=T.mul(q));return T},i.prototype.iushln=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26,U=67108863>>>26-N<<26-N,q;if(N!==0){var D=0;for(q=0;q<this.length;q++){var v=this.words[q]&U,k=(this.words[q]|0)-v<<N;this.words[q]=k|D,D=v>>>26-N}D&&(this.words[q]=D,this.length++)}if(T!==0){for(q=this.length-1;q>=0;q--)this.words[q+T]=this.words[q];for(q=0;q<T;q++)this.words[q]=0;this.length+=T}return this._strip()},i.prototype.ishln=function(I){return r(this.negative===0),this.iushln(I)},i.prototype.iushrn=function(I,N,T){r(typeof I=="number"&&I>=0);var U;N?U=(N-N%26)/26:U=0;var q=I%26,D=Math.min((I-q)/26,this.length),v=67108863^67108863>>>q<<q,k=T;if(U-=D,U=Math.max(0,U),k){for(var G=0;G<D;G++)k.words[G]=this.words[G];k.length=D}if(D!==0)if(this.length>D)for(this.length-=D,G=0;G<this.length;G++)this.words[G]=this.words[G+D];else this.words[0]=0,this.length=1;var J=0;for(G=this.length-1;G>=0&&(J!==0||G>=U);G--){var Qe=this.words[G]|0;this.words[G]=J<<26-q|Qe>>>q,J=Qe&v}return k&&J!==0&&(k.words[k.length++]=J),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(I,N,T){return r(this.negative===0),this.iushrn(I,N,T)},i.prototype.shln=function(I){return this.clone().ishln(I)},i.prototype.ushln=function(I){return this.clone().iushln(I)},i.prototype.shrn=function(I){return this.clone().ishrn(I)},i.prototype.ushrn=function(I){return this.clone().iushrn(I)},i.prototype.testn=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26,U=1<<N;if(this.length<=T)return!1;var q=this.words[T];return!!(q&U)},i.prototype.imaskn=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(N!==0&&T++,this.length=Math.min(T,this.length),N!==0){var U=67108863^67108863>>>N<<N;this.words[this.length-1]&=U}return this._strip()},i.prototype.maskn=function(I){return this.clone().imaskn(I)},i.prototype.iaddn=function(I){return r(typeof I=="number"),r(I<67108864),I<0?this.isubn(-I):this.negative!==0?this.length===1&&(this.words[0]|0)<=I?(this.words[0]=I-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(I),this.negative=1,this):this._iaddn(I)},i.prototype._iaddn=function(I){this.words[0]+=I;for(var N=0;N<this.length&&this.words[N]>=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},i.prototype.isubn=function(I){if(r(typeof I=="number"),r(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var N=0;N<this.length&&this.words[N]<0;N++)this.words[N]+=67108864,this.words[N+1]-=1;return this._strip()},i.prototype.addn=function(I){return this.clone().iaddn(I)},i.prototype.subn=function(I){return this.clone().isubn(I)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(I,N,T){var U=I.length+T,q;this._expand(U);var D,v=0;for(q=0;q<I.length;q++){D=(this.words[q+T]|0)+v;var k=(I.words[q]|0)*N;D-=k&67108863,v=(D>>26)-(k/67108864|0),this.words[q+T]=D&67108863}for(;q<this.length-T;q++)D=(this.words[q+T]|0)+v,v=D>>26,this.words[q+T]=D&67108863;if(v===0)return this._strip();for(r(v===-1),v=0,q=0;q<this.length;q++)D=-(this.words[q]|0)+v,v=D>>26,this.words[q]=D&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(I,N){var T=this.length-I.length,U=this.clone(),q=I,D=q.words[q.length-1]|0,v=this._countBits(D);T=26-v,T!==0&&(q=q.ushln(T),U.iushln(T),D=q.words[q.length-1]|0);var k=U.length-q.length,G;if(N!=="mod"){G=new i(null),G.length=k+1,G.words=new Array(G.length);for(var J=0;J<G.length;J++)G.words[J]=0}var Qe=U.clone()._ishlnsubmul(q,1,k);Qe.negative===0&&(U=Qe,G&&(G.words[k]=1));for(var Re=k-1;Re>=0;Re--){var $e=(U.words[q.length+Re]|0)*67108864+(U.words[q.length+Re-1]|0);for($e=Math.min($e/D|0,67108863),U._ishlnsubmul(q,$e,Re);U.negative!==0;)$e--,U.negative=0,U._ishlnsubmul(q,1,Re),U.isZero()||(U.negative^=1);G&&(G.words[Re]=$e)}return G&&G._strip(),U._strip(),N!=="div"&&T!==0&&U.iushrn(T),{div:G||null,mod:U}},i.prototype.divmod=function(I,N,T){if(r(!I.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var U,q,D;return this.negative!==0&&I.negative===0?(D=this.neg().divmod(I,N),N!=="mod"&&(U=D.div.neg()),N!=="div"&&(q=D.mod.neg(),T&&q.negative!==0&&q.iadd(I)),{div:U,mod:q}):this.negative===0&&I.negative!==0?(D=this.divmod(I.neg(),N),N!=="mod"&&(U=D.div.neg()),{div:U,mod:D.mod}):(this.negative&I.negative)!==0?(D=this.neg().divmod(I.neg(),N),N!=="div"&&(q=D.mod.neg(),T&&q.negative!==0&&q.isub(I)),{div:D.div,mod:q}):I.length>this.length||this.cmp(I)<0?{div:new i(0),mod:this}:I.length===1?N==="div"?{div:this.divn(I.words[0]),mod:null}:N==="mod"?{div:null,mod:new i(this.modrn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new i(this.modrn(I.words[0]))}:this._wordDiv(I,N)},i.prototype.div=function(I){return this.divmod(I,"div",!1).div},i.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},i.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},i.prototype.divRound=function(I){var N=this.divmod(I);if(N.mod.isZero())return N.div;var T=N.div.negative!==0?N.mod.isub(I):N.mod,U=I.ushrn(1),q=I.andln(1),D=T.cmp(U);return D<0||q===1&&D===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},i.prototype.modrn=function(I){var N=I<0;N&&(I=-I),r(I<=67108863);for(var T=(1<<26)%I,U=0,q=this.length-1;q>=0;q--)U=(T*U+(this.words[q]|0))%I;return N?-U:U},i.prototype.modn=function(I){return this.modrn(I)},i.prototype.idivn=function(I){var N=I<0;N&&(I=-I),r(I<=67108863);for(var T=0,U=this.length-1;U>=0;U--){var q=(this.words[U]|0)+T*67108864;this.words[U]=q/I|0,T=q%I}return this._strip(),N?this.ineg():this},i.prototype.divn=function(I){return this.clone().idivn(I)},i.prototype.egcd=function(I){r(I.negative===0),r(!I.isZero());var N=this,T=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var U=new i(1),q=new i(0),D=new i(0),v=new i(1),k=0;N.isEven()&&T.isEven();)N.iushrn(1),T.iushrn(1),++k;for(var G=T.clone(),J=N.clone();!N.isZero();){for(var Qe=0,Re=1;(N.words[0]&Re)===0&&Qe<26;++Qe,Re<<=1);if(Qe>0)for(N.iushrn(Qe);Qe-- >0;)(U.isOdd()||q.isOdd())&&(U.iadd(G),q.isub(J)),U.iushrn(1),q.iushrn(1);for(var $e=0,Bt=1;(T.words[0]&Bt)===0&&$e<26;++$e,Bt<<=1);if($e>0)for(T.iushrn($e);$e-- >0;)(D.isOdd()||v.isOdd())&&(D.iadd(G),v.isub(J)),D.iushrn(1),v.iushrn(1);N.cmp(T)>=0?(N.isub(T),U.isub(D),q.isub(v)):(T.isub(N),D.isub(U),v.isub(q))}return{a:D,b:v,gcd:T.iushln(k)}},i.prototype._invmp=function(I){r(I.negative===0),r(!I.isZero());var N=this,T=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var U=new i(1),q=new i(0),D=T.clone();N.cmpn(1)>0&&T.cmpn(1)>0;){for(var v=0,k=1;(N.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0)for(N.iushrn(v);v-- >0;)U.isOdd()&&U.iadd(D),U.iushrn(1);for(var G=0,J=1;(T.words[0]&J)===0&&G<26;++G,J<<=1);if(G>0)for(T.iushrn(G);G-- >0;)q.isOdd()&&q.iadd(D),q.iushrn(1);N.cmp(T)>=0?(N.isub(T),U.isub(q)):(T.isub(N),q.isub(U))}var Qe;return N.cmpn(1)===0?Qe=U:Qe=q,Qe.cmpn(0)<0&&Qe.iadd(I),Qe},i.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var N=this.clone(),T=I.clone();N.negative=0,T.negative=0;for(var U=0;N.isEven()&&T.isEven();U++)N.iushrn(1),T.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;T.isEven();)T.iushrn(1);var q=N.cmp(T);if(q<0){var D=N;N=T,T=D}else if(q===0||T.cmpn(1)===0)break;N.isub(T)}while(!0);return T.iushln(U)},i.prototype.invm=function(I){return this.egcd(I).a.umod(I)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(I){return this.words[0]&I},i.prototype.bincn=function(I){r(typeof I=="number");var N=I%26,T=(I-N)/26,U=1<<N;if(this.length<=T)return this._expand(T+1),this.words[T]|=U,this;for(var q=U,D=T;q!==0&&D<this.length;D++){var v=this.words[D]|0;v+=q,q=v>>>26,v&=67108863,this.words[D]=v}return q!==0&&(this.words[D]=q,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(I){var N=I<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this._strip();var T;if(this.length>1)T=1;else{N&&(I=-I),r(I<=67108863,"Number is too big");var U=this.words[0]|0;T=U===I?0:U<I?-1:1}return this.negative!==0?-T|0:T},i.prototype.cmp=function(I){if(this.negative!==0&&I.negative===0)return-1;if(this.negative===0&&I.negative!==0)return 1;var N=this.ucmp(I);return this.negative!==0?-N|0:N},i.prototype.ucmp=function(I){if(this.length>I.length)return 1;if(this.length<I.length)return-1;for(var N=0,T=this.length-1;T>=0;T--){var U=this.words[T]|0,q=I.words[T]|0;if(U!==q){U<q?N=-1:U>q&&(N=1);break}}return N},i.prototype.gtn=function(I){return this.cmpn(I)===1},i.prototype.gt=function(I){return this.cmp(I)===1},i.prototype.gten=function(I){return this.cmpn(I)>=0},i.prototype.gte=function(I){return this.cmp(I)>=0},i.prototype.ltn=function(I){return this.cmpn(I)===-1},i.prototype.lt=function(I){return this.cmp(I)===-1},i.prototype.lten=function(I){return this.cmpn(I)<=0},i.prototype.lte=function(I){return this.cmp(I)<=0},i.prototype.eqn=function(I){return this.cmpn(I)===0},i.prototype.eq=function(I){return this.cmp(I)===0},i.red=function(I){return new _(I)},i.prototype.toRed=function(I){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(I){return this.red=I,this},i.prototype.forceRed=function(I){return r(!this.red,"Already a number in reduction context"),this._forceRed(I)},i.prototype.redAdd=function(I){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},i.prototype.redIAdd=function(I){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},i.prototype.redSub=function(I){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},i.prototype.redISub=function(I){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},i.prototype.redShl=function(I){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},i.prototype.redMul=function(I){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},i.prototype.redIMul=function(I){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(I){return r(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var M={k256:null,p224:null,p192:null,p25519:null};function S(Q,I){this.name=Q,this.p=new i(I,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var I=new i(null);return I.words=new Array(Math.ceil(this.n/13)),I},S.prototype.ireduce=function(I){var N=I,T;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),T=N.bitLength();while(T>this.n);var U=T<this.n?-1:N.ucmp(this.p);return U===0?(N.words[0]=0,N.length=1):U>0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},S.prototype.split=function(I,N){I.iushrn(this.n,0,N)},S.prototype.imulK=function(I){return I.imul(this.k)};function P(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(P,S),P.prototype.split=function(I,N){for(var T=4194303,U=Math.min(I.length,9),q=0;q<U;q++)N.words[q]=I.words[q];if(N.length=U,I.length<=9){I.words[0]=0,I.length=1;return}var D=I.words[9];for(N.words[N.length++]=D&T,q=10;q<I.length;q++){var v=I.words[q]|0;I.words[q-10]=(v&T)<<4|D>>>22,D=v}D>>>=22,I.words[q-10]=D,D===0&&I.length>10?I.length-=10:I.length-=9},P.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var N=0,T=0;T<I.length;T++){var U=I.words[T]|0;N+=U*977,I.words[T]=N&67108863,N=U*64+(N/67108864|0)}return I.words[I.length-1]===0&&(I.length--,I.words[I.length-1]===0&&I.length--),I};function V(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,S);function Z(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,S);function X(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,S),X.prototype.imulK=function(I){for(var N=0,T=0;T<I.length;T++){var U=(I.words[T]|0)*19+N,q=U&67108863;U>>>=26,I.words[T]=q,N=U}return N!==0&&(I.words[I.length++]=N),I},i._prime=function(I){if(M[I])return M[I];var N;if(I==="k256")N=new P;else if(I==="p224")N=new V;else if(I==="p192")N=new Z;else if(I==="p25519")N=new X;else throw new Error("Unknown prime "+I);return M[I]=N,N};function _(Q){if(typeof Q=="string"){var I=i._prime(Q);this.m=I.p,this.prime=I}else r(Q.gtn(1),"modulus must be greater than 1"),this.m=Q,this.prime=null}_.prototype._verify1=function(I){r(I.negative===0,"red works only with positives"),r(I.red,"red works only with red numbers")},_.prototype._verify2=function(I,N){r((I.negative|N.negative)===0,"red works only with positives"),r(I.red&&I.red===N.red,"red works only with red numbers")},_.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):(u(I,I.umod(this.m)._forceRed(this)),I)},_.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},_.prototype.add=function(I,N){this._verify2(I,N);var T=I.add(N);return T.cmp(this.m)>=0&&T.isub(this.m),T._forceRed(this)},_.prototype.iadd=function(I,N){this._verify2(I,N);var T=I.iadd(N);return T.cmp(this.m)>=0&&T.isub(this.m),T},_.prototype.sub=function(I,N){this._verify2(I,N);var T=I.sub(N);return T.cmpn(0)<0&&T.iadd(this.m),T._forceRed(this)},_.prototype.isub=function(I,N){this._verify2(I,N);var T=I.isub(N);return T.cmpn(0)<0&&T.iadd(this.m),T},_.prototype.shl=function(I,N){return this._verify1(I),this.imod(I.ushln(N))},_.prototype.imul=function(I,N){return this._verify2(I,N),this.imod(I.imul(N))},_.prototype.mul=function(I,N){return this._verify2(I,N),this.imod(I.mul(N))},_.prototype.isqr=function(I){return this.imul(I,I.clone())},_.prototype.sqr=function(I){return this.mul(I,I)},_.prototype.sqrt=function(I){if(I.isZero())return I.clone();var N=this.m.andln(3);if(r(N%2===1),N===3){var T=this.m.add(new i(1)).iushrn(2);return this.pow(I,T)}for(var U=this.m.subn(1),q=0;!U.isZero()&&U.andln(1)===0;)q++,U.iushrn(1);r(!U.isZero());var D=new i(1).toRed(this),v=D.redNeg(),k=this.m.subn(1).iushrn(1),G=this.m.bitLength();for(G=new i(2*G*G).toRed(this);this.pow(G,k).cmp(v)!==0;)G.redIAdd(v);for(var J=this.pow(G,U),Qe=this.pow(I,U.addn(1).iushrn(1)),Re=this.pow(I,U),$e=q;Re.cmp(D)!==0;){for(var Bt=Re,Pt=0;Bt.cmp(D)!==0;Pt++)Bt=Bt.redSqr();r(Pt<$e);var ge=this.pow(J,new i(1).iushln($e-Pt-1));Qe=Qe.redMul(ge),J=ge.redSqr(),Re=Re.redMul(J),$e=Pt}return Qe},_.prototype.invm=function(I){var N=I._invmp(this.m);return N.negative!==0?(N.negative=0,this.imod(N).redNeg()):this.imod(N)},_.prototype.pow=function(I,N){if(N.isZero())return new i(1).toRed(this);if(N.cmpn(1)===0)return I.clone();var T=4,U=new Array(1<<T);U[0]=new i(1).toRed(this),U[1]=I;for(var q=2;q<U.length;q++)U[q]=this.mul(U[q-1],I);var D=U[0],v=0,k=0,G=N.bitLength()%26;for(G===0&&(G=26),q=N.length-1;q>=0;q--){for(var J=N.words[q],Qe=G-1;Qe>=0;Qe--){var Re=J>>Qe&1;if(D!==U[0]&&(D=this.sqr(D)),Re===0&&v===0){k=0;continue}v<<=1,v|=Re,k++,!(k!==T&&(q!==0||Qe!==0))&&(D=this.mul(D,U[v]),k=0,v=0)}G=26}return D},_.prototype.convertTo=function(I){var N=I.umod(this.m);return N===I?N.clone():N},_.prototype.convertFrom=function(I){var N=I.clone();return N.red=null,N},i.mont=function(I){return new L(I)};function L(Q){_.call(this,Q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(L,_),L.prototype.convertTo=function(I){return this.imod(I.ushln(this.shift))},L.prototype.convertFrom=function(I){var N=this.imod(I.mul(this.rinv));return N.red=null,N},L.prototype.imul=function(I,N){if(I.isZero()||N.isZero())return I.words[0]=0,I.length=1,I;var T=I.imul(N),U=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=T.isub(U).iushrn(this.shift),D=q;return q.cmp(this.m)>=0?D=q.isub(this.m):q.cmpn(0)<0&&(D=q.iadd(this.m)),D._forceRed(this)},L.prototype.mul=function(I,N){if(I.isZero()||N.isZero())return new i(0)._forceRed(this);var T=I.mul(N),U=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=T.isub(U).iushrn(this.shift),D=q;return q.cmp(this.m)>=0?D=q.isub(this.m):q.cmpn(0)<0&&(D=q.iadd(this.m)),D._forceRed(this)},L.prototype.invm=function(I){var N=this.imod(I._invmp(this.m).mul(this.r2));return N._forceRed(this)}})(typeof Rjt>"u"||Rjt,eIn)});var tVe=m(l7=>{"use strict";var rIn=require("process"),SEe=qw(),Sjt=V5(),u7=S_(),wjt=require("crypto"),_ro=tIn(),RM=cc(),Uw=RM.codes,xro=.01,Bro=9e5,nIn=18e6;l7.buildCertId=function(t){let e=t.issuerCertificate;t=t.raw;try{t=u7.Certificate.decode(t,"der"),e&&(e=e.raw,e=u7.Certificate.decode(e,"der"))}catch{return null}let r=t.tbsCertificate,n=e.tbsCertificate,i={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:iIn(u7.Name.encode(r.issuer,"der")),issuerKeyHash:iIn(n.subjectPublicKeyInfo.subjectPublicKey.data),serialNumber:r.serialNumber},s=Sjt.CertID.encode(i,"der");return sIn(s.toString("BASE64"))};function iIn(t){return wjt.createHash("sha1").update(t).digest()}l7.decode=function(t){let e=t.issuerCertificate;return t=t.raw,t=u7.Certificate.decode(t,"der"),e&&(e=e.raw,e=u7.Certificate.decode(e,"der")),{cert:t,issuer:e}};var sIn=function(t){let e=Buffer.from(t,"base64"),r=Sjt.CertID.decode(e,"der");return r.issuerNameHash.toString("BASE64")+"#"+r.issuerKeyHash.toString("BASE64")+"#"+r.serialNumber.toString(10)};l7.encodeKey=sIn;var Mro=function(t){let e=t.split("#"),r=Buffer.from(e[0],"base64"),n=Buffer.from(e[1],"base64"),i=new _ro(e[2],10),s={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:r,issuerKeyHash:n,serialNumber:i};return Sjt.CertID.encode(s,"der").toString("BASE64")};l7.decodeKey=Mro;var Oro=function(t,e){let r=(e-t)*xro;return r>nIn?r:nIn},oIn=function(t,e,r){let n=Oro(e,r);return e-Bro<=t&&t<=r+n};l7.isValidityRange=oIn;var eVe=function(t){return new Date(t)},Rro=function(t,e,r){let n=t.tbsCertificate.subjectPublicKeyInfo;if(n=SEe.utils.toPEM(u7.SubjectPublicKeyInfo.encode(n,"der"),"PUBLIC KEY"),e.length>0){let i=Date.now(),s=e[0],o=s.tbsCertificate.validity;if(o.notAfter.value<i||o.notBefore.value>i)return{err:RM.createOCSPError(Uw.ERR_OCSP_INVALID_CERTIFICATE_VALIDITY,"Valid from:",eVe(o.notBefore.value),", Valid to:",eVe(o.notAfter.value)),responderKey:null};let a=SEe.utils.sign[s.signatureAlgorithm.algorithm.join(".")];if(!a)return{err:RM.createOCSPError(Uw.ERR_OCSP_NO_SIGNATURE_ALGORITHM),responderKey:null};let c=wjt.createVerify(a);if(c.update(r[0]),!c.verify(n,s.signature.data))return{err:RM.createOCSPError(Uw.ERR_OCSP_INVALID_SIGNATURE),responderKey:null};let u=s.tbsCertificate.subjectPublicKeyInfo;return u=SEe.utils.toPEM(u7.SubjectPublicKeyInfo.encode(u,"der"),"PUBLIC KEY"),{err:null,responderKey:u}}return{err:null,responderKey:n}},Sro=function(t,e){function r(l){return{err:l,res:e}}let n;try{n=SEe.utils.parseResponse(e)}catch(l){return r(l)}let i=n.value;if(t){let l=n.certs,A=e.slice(n.start,n.end),p=n.certsTbs.map(function(y){return e.slice(y.start,y.end)}),f=SEe.utils.sign[i.signatureAlgorithm.algorithm.join(".")];if(!f)return r(RM.createOCSPError(Uw.ERR_OCSP_NO_SIGNATURE_ALGORITHM));let h=Rro(t,l,p);if(h.err)return r(h.err);let g=h.responderKey,E=wjt.createVerify(f),C=i.signature.data;if(E.update(A),!E.verify(g,C))return r(RM.createOCSPError(Uw.ERR_OCSP_INVALID_SIGNATURE))}let s=i.tbsResponseData;if(s.responses.length<1)return r(RM.createOCSPError(Uw.ERR_OCSP_NO_RESPONSE));let o=s.responses[0];if(o.certStatus.type==="revoked")return r(RM.createOCSPError(Uw.ERR_OCSP_REVOKED));let a=Date.now();return(rIn.env.SF_OCSP_TEST_INJECT_VALIDITY_ERROR||"").toLowerCase()==="true"||!oIn(a,o.thisUpdate,o.nextUpdate)?r(RM.createOCSPError(Uw.ERR_OCSP_INVALID_VALIDITY,"Valid from:",eVe(o.thisUpdate),", Valid to:",eVe(o.nextUpdate))):(rIn.env.SF_OCSP_TEST_INJECT_UNKNOWN_STATUS||"").toLowerCase()==="true"||o.certStatus.type==="unknown"?r(RM.createOCSPError(Uw.ERR_OCSP_UNKNOWN)):o.certStatus.type==="good"?r(null):r(RM.createOCSPError(Uw.ERR_OCSP_UNKNOWN_STATE))};l7.verifyOCSPResponse=Sro});var lIn=m((NZa,uIn)=>{"use strict";var wro=require("http"),Tro=require("url"),aIn=qw(),Dro=V5(),vro=hs(),Nro=tVe(),cIn=qf(),Tjt=cc(),Djt=Tjt.codes,bte=Rs(),Qro=function(t){return t>=500&&t<600||t===404||t===403||t===408};function zro(t,e,r){t=Tro.parse(t);let n=process.env.SF_OCSP_TEST_OCSP_RESPONDER_TIMEOUT||1e4,i=Object.assign({timeout:Number(n),method:"POST",headers:{"Content-Type":"application/ocsp-request","Content-Length":e.length}},t);function s(c,u){r&&r(c,u),r=null}function o(c){if(c.statusCode<200||c.statusCode>=400)return s(Tjt.createOCSPError(Djt.ERR_OCSP_FAILED_OBTAIN_OCSP_RESPONSE,c.statusCode),c);let u=[];c.on("readable",function(){let l=c.read();l&&u.push(l)}),c.on("end",function(){bte.getInstance().debug("Finish OCSP responder: %s",t.host);let l=Buffer.concat(u);s(null,l)})}let a=wro.request(i,o);a.on("error",function(c){r&&r(c),r=null}),a.on("timeout",function(){a.abort(),bte.getInstance().debug("Timeout OCSP responder: %s",t.host),r&&r(Tjt.createOCSPError(Djt.ERR_OCSP_RESPONDER_TIMEOUT)),r=null}),a.end(e)}uIn.exports=function(e,r,n){let i=!0,s=cIn.getOcspMode()===cIn.ocspModes.FAIL_CLOSED,o=s?2:1;function a(E,C){if(i){i=!1,process.nextTick(function(){r(E,C)});return}r(E,C)}let c;try{c=n?n.req:aIn.request.generate(e.cert,e.issuer)}catch(E){return a(E)}let u=Dro["id-pkix-ocsp"].join("."),l=1,A=1;function p(E,C){let y=!1;if(E){if(Object.prototype.hasOwnProperty.call(E,"code")&&E.code===Djt.ERR_OCSP_RESPONDER_TIMEOUT)y=!0;else if(Object.prototype.hasOwnProperty.call(E,"message")){let b=E.message.split(" ");if(b.length===0)return a(E);try{let O=parseInt(b[b.length-1],10);y=Qro(O)}catch{}}if(l<o&&y)l++,A=vro.nextSleepTime(1,10,A),setTimeout(g,A*1e3);else return bte.getInstance().debug("Failed to all retries to OCSP responder."),a(E)}else{let b=Nro.verifyOCSPResponse(c.issuer,C);a(b.err,b)}}function f(E){let C=require("url").parse(process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL),y;C.port?y=`${C.protocol}//${C.hostname}:${C.port}/retry`:y=`${C.protocol}//${C.hostname}/retry`;let b=c.data.toString("base64");C=require("url").parse(E),process.env.SF_OCSP_RESPONDER_URL=y+"/"+C.hostname+"/"+b}function h(E,C){if(E){if(E.message==="AuthorityInfoAccess not found in extensions")if(s)bte.getInstance().error("OCSP Responder URL is missing from the certificate, so cannot verify with OCSP. Aborting connection attempt due to OCSP being set to FAIL_CLOSE https://docs.snowflake.com/en/user-guide/ocsp#fail-close");else return bte.getInstance().debug("OCSP Responder URL is missing from the certificate."),a(null);return a(E)}process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL&&process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL.includes("ocsp_response_cache.json")&&f(C);let y=process.env.SF_OCSP_RESPONDER_URL;y&&(C=y),bte.getInstance().trace("Contact OCSP responder: %s, (%s/%s)",C,l,o),n||zro(C,c.data,p)}function g(){n?h(null,n.uri):aIn.utils.getAuthorityInfo(c.cert,u,h)}g(),i=!1}});var pIn=m(Qjt=>{"use strict";var Lro=require("http"),Pro=require("url"),kro=require("path"),vjt=require("fs"),AIn=Ejt(),d7=cc(),rVe=d7.codes,dIn=hs(),wEe=tVe(),nVe=qf(),Gf=Rs(),SM={NOT_START:"not_start",STARTED:"started",FINISHED:"finish"},Njt=nVe.getOcspResponseCacheSizeLimit(),_te=nVe.getOcspResponseCacheMaxAge();d7.assertInternal(dIn.number.isPositiveInteger(Njt));d7.assertInternal(dIn.number.isPositiveInteger(_te));var Fro=nVe.mkdirCacheDir(),Kv=kro.join(Fro,"ocsp_response_cache.json"),A7;function qro(){try{A7.reset(),vjt.unlinkSync(Kv)}catch(t){Gf.getInstance().debug("Failed to delete OCSP cache file: %s, err: %s",Kv,t)}}Qjt.deleteCache=qro;function Uro(){let t=SM.NOT_START,e=!1,r=!1,n=null,i=Date.now()/1e3,s=process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL;s||(s="http://ocsp.snowflakecomputing.com/ocsp_response_cache.json");try{Gf.getInstance().debug("Reading OCSP cache file. %s",Kv);let l=vjt.readFileSync(Kv,"utf-8"),A=JSON.parse(l);a(A),r=!0}catch(l){Gf.getInstance().debug("Failed to read OCSP cache file: %s, err: %s",Kv,l)}this.setAgent=function(A){n=A},this.initCache=function(A,p){A7=new AIn({maxSize:1}),this.set(A,p)},this.isInitialized=function(){return r},this.isDownloadFinished=function(){return t===SM.FINISHED},this.forceDownloadToFinish=function(){t=SM.FINISHED},this.IsCacheExpired=function(){if(!r)return!1;_te=nVe.getOcspResponseCacheMaxAge();let l=Date.now()/1e3;return l-i>_te?(Gf.getInstance().debug("OCSP local cache validity is out of range. currentTime: %s, timestamp: %s, maxAge: %s",l,i,_te),!0):!1},this.resetCacheStatus=function(){if(t=SM.NOT_START,e){Gf.getInstance().debug(Kv);let l=Date.now()/1e3,A={};A7.forEach(function(f,h){let g=wEe.decodeKey(h),E=f.toString("BASE64");A[g]=[l,E]});let p=JSON.stringify(A);Gf.getInstance().debug("Writing OCSP cache file. %s",Kv);try{vjt.writeFileSync(Kv,p,"utf-8")}catch(f){Gf.getInstance().debug("Failed to update OCSP cache file: %s, err: %s",Kv,f)}e=!1}},this.set=function(A,p){try{let f=wEe.buildCertId(A);A7.set(f,p),e=!0}catch(f){Gf.getInstance().debug("Failed to add certificate to OCSP cache file. err: %s",f)}},this.get=function(A){try{let p=wEe.buildCertId(A);return A7.get(p)}catch(p){return Gf.getInstance().debug("Failed to get certificate from OCSP cache. err: %s",p),null}},this.downloadCache=function(l){if(t===SM.STARTED)return!1;if(t===SM.FINISHED)return l(null,!1),!0;t=SM.STARTED;function A(C,y){if(t!==SM.FINISHED){if(t=SM.FINISHED,Gf.getInstance().debug("Finish OCSP Cache Server: %s",s),C)return Gf.getInstance().debug("Failed to download OCSP cache file. %s. Ignored",C),l(C,!1);try{let b=JSON.parse(y);return a(b),e=!0,l(null,!1)}catch(b){l(b,!1)}}}function p(C){if(C.statusCode<200||C.statusCode>=400)return A(new Error("Failed to obtain OCSP response: "+C.statusCode),null);let y="";C.on("data",function(b){y+=b}),C.on("end",function(){A(null,y)})}let f=Pro.parse(s),h=process.env.SF_OCSP_TEST_OCSP_RESPONSE_CACHE_SERVER_TIMEOUT||5e3,g=Object.assign({timeout:Number(h),method:"GET",agent:n},f),E=Lro.request(g,p);return E.on("error",function(C){t=SM.FINISHED,l&&l(C,!1),l=null}),E.on("timeout",function(){t=SM.FINISHED,E.abort(),Gf.getInstance().debug("Timeout OCSP responder: %s, %ss",s,g.timeout),l&&l(d7.createOCSPError(rVe.ERR_OCSP_CACHE_SERVER_TIMEOUT),!1),l=null}),E.end(),Gf.getInstance().trace("Contact OCSP Cache Server: %s",s),!0};function o(l,A){let p;A.length!==2&&(Gf.getInstance().debug("OCSP cache value doesn't consist of two elements. Ignored."),p=d7.createOCSPError(rVe.ERR_OCSP_NOT_TWO_ELEMENTS));let f=A[0],h=Date.now()/1e3;h-f>_te&&(Gf.getInstance().debug("OCSP cache validity is out of range. currentTime: %s, timestamp: %s, maxAge: %s",h,f,_te),p=d7.createOCSPError(rVe.ERR_OCSP_CACHE_EXPIRED));try{let g=wEe.encodeKey(l);if(p)return{err:p,key:g};let E=A[1],C=Buffer.from(E,"base64"),y=wEe.verifyOCSPResponse(null,C);return y.err?{err:y.err}:{err:null,key:g,value:C}}catch(g){return Gf.getInstance().debug("Failed to parse OCSP response. %s. Ignored.",g),{err:d7.createOCSPError(rVe.ERR_OCSP_FAILED_PARSE_RESPONSE)}}}function a(l){let A=Object.keys(l).length;A7=new AIn({maxSize:A<Njt?A:Njt}),c(l),r=!0}function c(l){let A=Date.now()/1e3;for(let p in l)if(Object.prototype.hasOwnProperty.call(l,p)){let f=u(l,p,A);f&&(A=f)}i=A}function u(l,A,p){let f=o(A,l[A]);if(f.err)Gf.getInstance().trace("Error when validating OCSP cache entry %s, %s",A,f.err.toString());else if(A7.set(f.key,f.value),l[A][0]<p)return l[A][0]}}Qjt.OcspResponseCache=Uro});var gIn=m(q2=>{"use strict";var Gro=q2&&q2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wro=q2&&q2.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fIn=q2&&q2.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Gro(e,t,r);return Wro(e,t),e};Object.defineProperty(q2,"__esModule",{value:!0});q2.req=q2.json=q2.toBuffer=void 0;var Hro=fIn(require("http")),jro=fIn(require("https"));async function hIn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}q2.toBuffer=hIn;async function Vro(t){let r=(await hIn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}q2.json=Vro;function Kro(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?jro:Hro).request(t,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}q2.req=Kro});var IIn=m(II=>{"use strict";var EIn=II&&II.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$ro=II&&II.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),CIn=II&&II.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&EIn(e,t,r);return $ro(e,t),e},Yro=II&&II.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EIn(e,t,r)};Object.defineProperty(II,"__esModule",{value:!0});II.Agent=void 0;var Jro=CIn(require("net")),mIn=CIn(require("http")),Xro=require("https");Yro(gIn(),II);var Gw=Symbol("AgentBaseInternalState"),zjt=class extends mIn.Agent{constructor(e){super(e),this[Gw]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
4124
|
+
`)};F2.toDER=function(e,r){let n=e.toString().match(new RegExp("-----BEGIN "+r+"-----([^-]*)-----END "+r+"-----"));return n?n=Ojt.from(n[1].replace(/[\r\n]/g,""),"base64"):typeof e=="string"?n=Ojt.from(e):n=e,n};F2.getAuthorityInfo=function(e,r,n){let i=e.tbsCertificate.extensions;i||(i=[]);let s=i.filter(function(c){return c.extnID==="authorityInformationAccess"});if(s.length===0)return n(new Error("AuthorityInfoAccess not found in extensions"));let o=null;return s.some(function(c){return c.extnValue.some(function(l){if(l.accessMethod.join(".")!==r)return!1;let A=l.accessLocation;return A.type!=="uniformResourceIdentifier"?!1:(o=A.value+"",!0)})})?n(null,o):n(new Error(r+" not found in AuthorityInfoAccess"))};var bro=yro.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});F2.RSAPrivateKey=bro});var qw=m(Vv=>{Vv.Cache=PEn();Vv.Agent=xCn();Vv.Server=kCn();Vv.getOCSPURI=UCn().getOCSPURI;Vv.request=jCn();Vv.check=KCn();Vv.verify=JCn();Vv.utils=ZCn()});var tIn=m((eIn,Rjt)=>{(function(t,e){"use strict";function r(Q,I){if(!Q)throw new Error(I||"Assertion failed")}function n(Q,I){Q.super_=I;var N=function(){};N.prototype=I.prototype,Q.prototype=new N,Q.prototype.constructor=Q}function i(Q,I,N){if(i.isBN(Q))return Q;this.negative=0,this.words=null,this.length=0,this.red=null,Q!==null&&((I==="le"||I==="be")&&(N=I,I=10),this._init(Q||0,I||10,N||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(I){return I instanceof i?!0:I!==null&&typeof I=="object"&&I.constructor.wordSize===i.wordSize&&Array.isArray(I.words)},i.max=function(I,N){return I.cmp(N)>0?I:N},i.min=function(I,N){return I.cmp(N)<0?I:N},i.prototype._init=function(I,N,T){if(typeof I=="number")return this._initNumber(I,N,T);if(typeof I=="object")return this._initArray(I,N,T);N==="hex"&&(N=16),r(N===(N|0)&&N>=2&&N<=36),I=I.toString().replace(/\s+/g,"");var U=0;I[0]==="-"&&(U++,this.negative=1),U<I.length&&(N===16?this._parseHex(I,U,T):(this._parseBase(I,N,U),T==="le"&&this._initArray(this.toArray(),N,T)))},i.prototype._initNumber=function(I,N,T){I<0&&(this.negative=1,I=-I),I<67108864?(this.words=[I&67108863],this.length=1):I<4503599627370496?(this.words=[I&67108863,I/67108864&67108863],this.length=2):(r(I<9007199254740992),this.words=[I&67108863,I/67108864&67108863,1],this.length=3),T==="le"&&this._initArray(this.toArray(),N,T)},i.prototype._initArray=function(I,N,T){if(r(typeof I.length=="number"),I.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(I.length/3),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var q,D,v=0;if(T==="be")for(U=I.length-1,q=0;U>=0;U-=3)D=I[U]|I[U-1]<<8|I[U-2]<<16,this.words[q]|=D<<v&67108863,this.words[q+1]=D>>>26-v&67108863,v+=24,v>=26&&(v-=26,q++);else if(T==="le")for(U=0,q=0;U<I.length;U+=3)D=I[U]|I[U+1]<<8|I[U+2]<<16,this.words[q]|=D<<v&67108863,this.words[q+1]=D>>>26-v&67108863,v+=24,v>=26&&(v-=26,q++);return this._strip()};function o(Q,I){var N=Q.charCodeAt(I);if(N>=48&&N<=57)return N-48;if(N>=65&&N<=70)return N-55;if(N>=97&&N<=102)return N-87;r(!1,"Invalid character in "+Q)}function a(Q,I,N){var T=o(Q,N);return N-1>=I&&(T|=o(Q,N-1)<<4),T}i.prototype._parseHex=function(I,N,T){this.length=Math.ceil((I.length-N)/6),this.words=new Array(this.length);for(var U=0;U<this.length;U++)this.words[U]=0;var q=0,D=0,v;if(T==="be")for(U=I.length-1;U>=N;U-=2)v=a(I,N,U)<<q,this.words[D]|=v&67108863,q>=18?(q-=18,D+=1,this.words[D]|=v>>>26):q+=8;else{var k=I.length-N;for(U=k%2===0?N+1:N;U<I.length;U+=2)v=a(I,N,U)<<q,this.words[D]|=v&67108863,q>=18?(q-=18,D+=1,this.words[D]|=v>>>26):q+=8}this._strip()};function c(Q,I,N,T){for(var U=0,q=0,D=Math.min(Q.length,N),v=I;v<D;v++){var k=Q.charCodeAt(v)-48;U*=T,k>=49?q=k-49+10:k>=17?q=k-17+10:q=k,r(k>=0&&q<T,"Invalid character"),U+=q}return U}i.prototype._parseBase=function(I,N,T){this.words=[0],this.length=1;for(var U=0,q=1;q<=67108863;q*=N)U++;U--,q=q/N|0;for(var D=I.length-T,v=D%U,k=Math.min(D,D-v)+T,G=0,J=T;J<k;J+=U)G=c(I,J,J+U,N),this.imuln(q),this.words[0]+G<67108864?this.words[0]+=G:this._iaddn(G);if(v!==0){var Qe=1;for(G=c(I,J,I.length,N),J=0;J<v;J++)Qe*=N;this.imuln(Qe),this.words[0]+G<67108864?this.words[0]+=G:this._iaddn(G)}this._strip()},i.prototype.copy=function(I){I.words=new Array(this.length);for(var N=0;N<this.length;N++)I.words[N]=this.words[N];I.length=this.length,I.negative=this.negative,I.red=this.red};function u(Q,I){Q.words=I.words,Q.length=I.length,Q.negative=I.negative,Q.red=I.red}if(i.prototype._move=function(I){u(I,this)},i.prototype.clone=function(){var I=new i(null);return this.copy(I),I},i.prototype._expand=function(I){for(;this.length<I;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch{i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(I,N){I=I||10,N=N|0||1;var T;if(I===16||I==="hex"){T="";for(var U=0,q=0,D=0;D<this.length;D++){var v=this.words[D],k=((v<<U|q)&16777215).toString(16);q=v>>>24-U&16777215,U+=2,U>=26&&(U-=26,D--),q!==0||D!==this.length-1?T=A[6-k.length]+k+T:T=k+T}for(q!==0&&(T=q.toString(16)+T);T.length%N!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}if(I===(I|0)&&I>=2&&I<=36){var G=p[I],J=f[I];T="";var Qe=this.clone();for(Qe.negative=0;!Qe.isZero();){var Re=Qe.modrn(J).toString(I);Qe=Qe.idivn(J),Qe.isZero()?T=Re+T:T=A[G-Re.length]+Re+T}for(this.isZero()&&(T="0"+T);T.length%N!==0;)T="0"+T;return this.negative!==0&&(T="-"+T),T}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var I=this.words[0];return this.length===2?I+=this.words[1]*67108864:this.length===3&&this.words[2]===1?I+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-I:I},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(I,N){return this.toArrayLike(s,I,N)}),i.prototype.toArray=function(I,N){return this.toArrayLike(Array,I,N)};var h=function(I,N){return I.allocUnsafe?I.allocUnsafe(N):new I(N)};i.prototype.toArrayLike=function(I,N,T){this._strip();var U=this.byteLength(),q=T||Math.max(1,U);r(U<=q,"byte array longer than desired length"),r(q>0,"Requested array length <= 0");var D=h(I,q),v=N==="le"?"LE":"BE";return this["_toArrayLike"+v](D,U),D},i.prototype._toArrayLikeLE=function(I,N){for(var T=0,U=0,q=0,D=0;q<this.length;q++){var v=this.words[q]<<D|U;I[T++]=v&255,T<I.length&&(I[T++]=v>>8&255),T<I.length&&(I[T++]=v>>16&255),D===6?(T<I.length&&(I[T++]=v>>24&255),U=0,D=0):(U=v>>>24,D+=2)}if(T<I.length)for(I[T++]=U;T<I.length;)I[T++]=0},i.prototype._toArrayLikeBE=function(I,N){for(var T=I.length-1,U=0,q=0,D=0;q<this.length;q++){var v=this.words[q]<<D|U;I[T--]=v&255,T>=0&&(I[T--]=v>>8&255),T>=0&&(I[T--]=v>>16&255),D===6?(T>=0&&(I[T--]=v>>24&255),U=0,D=0):(U=v>>>24,D+=2)}if(T>=0)for(I[T--]=U;T>=0;)I[T--]=0},Math.clz32?i.prototype._countBits=function(I){return 32-Math.clz32(I)}:i.prototype._countBits=function(I){var N=I,T=0;return N>=4096&&(T+=13,N>>>=13),N>=64&&(T+=7,N>>>=7),N>=8&&(T+=4,N>>>=4),N>=2&&(T+=2,N>>>=2),T+N},i.prototype._zeroBits=function(I){if(I===0)return 26;var N=I,T=0;return(N&8191)===0&&(T+=13,N>>>=13),(N&127)===0&&(T+=7,N>>>=7),(N&15)===0&&(T+=4,N>>>=4),(N&3)===0&&(T+=2,N>>>=2),(N&1)===0&&T++,T},i.prototype.bitLength=function(){var I=this.words[this.length-1],N=this._countBits(I);return(this.length-1)*26+N};function g(Q){for(var I=new Array(Q.bitLength()),N=0;N<I.length;N++){var T=N/26|0,U=N%26;I[N]=Q.words[T]>>>U&1}return I}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var I=0,N=0;N<this.length;N++){var T=this._zeroBits(this.words[N]);if(I+=T,T!==26)break}return I},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(I){return this.negative!==0?this.abs().inotn(I).iaddn(1):this.clone()},i.prototype.fromTwos=function(I){return this.testn(I-1)?this.notn(I).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(I){for(;this.length<I.length;)this.words[this.length++]=0;for(var N=0;N<I.length;N++)this.words[N]=this.words[N]|I.words[N];return this._strip()},i.prototype.ior=function(I){return r((this.negative|I.negative)===0),this.iuor(I)},i.prototype.or=function(I){return this.length>I.length?this.clone().ior(I):I.clone().ior(this)},i.prototype.uor=function(I){return this.length>I.length?this.clone().iuor(I):I.clone().iuor(this)},i.prototype.iuand=function(I){var N;this.length>I.length?N=I:N=this;for(var T=0;T<N.length;T++)this.words[T]=this.words[T]&I.words[T];return this.length=N.length,this._strip()},i.prototype.iand=function(I){return r((this.negative|I.negative)===0),this.iuand(I)},i.prototype.and=function(I){return this.length>I.length?this.clone().iand(I):I.clone().iand(this)},i.prototype.uand=function(I){return this.length>I.length?this.clone().iuand(I):I.clone().iuand(this)},i.prototype.iuxor=function(I){var N,T;this.length>I.length?(N=this,T=I):(N=I,T=this);for(var U=0;U<T.length;U++)this.words[U]=N.words[U]^T.words[U];if(this!==N)for(;U<N.length;U++)this.words[U]=N.words[U];return this.length=N.length,this._strip()},i.prototype.ixor=function(I){return r((this.negative|I.negative)===0),this.iuxor(I)},i.prototype.xor=function(I){return this.length>I.length?this.clone().ixor(I):I.clone().ixor(this)},i.prototype.uxor=function(I){return this.length>I.length?this.clone().iuxor(I):I.clone().iuxor(this)},i.prototype.inotn=function(I){r(typeof I=="number"&&I>=0);var N=Math.ceil(I/26)|0,T=I%26;this._expand(N),T>0&&N--;for(var U=0;U<N;U++)this.words[U]=~this.words[U]&67108863;return T>0&&(this.words[U]=~this.words[U]&67108863>>26-T),this._strip()},i.prototype.notn=function(I){return this.clone().inotn(I)},i.prototype.setn=function(I,N){r(typeof I=="number"&&I>=0);var T=I/26|0,U=I%26;return this._expand(T+1),N?this.words[T]=this.words[T]|1<<U:this.words[T]=this.words[T]&~(1<<U),this._strip()},i.prototype.iadd=function(I){var N;if(this.negative!==0&&I.negative===0)return this.negative=0,N=this.isub(I),this.negative^=1,this._normSign();if(this.negative===0&&I.negative!==0)return I.negative=0,N=this.isub(I),I.negative=1,N._normSign();var T,U;this.length>I.length?(T=this,U=I):(T=I,U=this);for(var q=0,D=0;D<U.length;D++)N=(T.words[D]|0)+(U.words[D]|0)+q,this.words[D]=N&67108863,q=N>>>26;for(;q!==0&&D<T.length;D++)N=(T.words[D]|0)+q,this.words[D]=N&67108863,q=N>>>26;if(this.length=T.length,q!==0)this.words[this.length]=q,this.length++;else if(T!==this)for(;D<T.length;D++)this.words[D]=T.words[D];return this},i.prototype.add=function(I){var N;return I.negative!==0&&this.negative===0?(I.negative=0,N=this.sub(I),I.negative^=1,N):I.negative===0&&this.negative!==0?(this.negative=0,N=I.sub(this),this.negative=1,N):this.length>I.length?this.clone().iadd(I):I.clone().iadd(this)},i.prototype.isub=function(I){if(I.negative!==0){I.negative=0;var N=this.iadd(I);return I.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(I),this.negative=1,this._normSign();var T=this.cmp(I);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var U,q;T>0?(U=this,q=I):(U=I,q=this);for(var D=0,v=0;v<q.length;v++)N=(U.words[v]|0)-(q.words[v]|0)+D,D=N>>26,this.words[v]=N&67108863;for(;D!==0&&v<U.length;v++)N=(U.words[v]|0)+D,D=N>>26,this.words[v]=N&67108863;if(D===0&&v<U.length&&U!==this)for(;v<U.length;v++)this.words[v]=U.words[v];return this.length=Math.max(this.length,v),U!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(I){return this.clone().isub(I)};function E(Q,I,N){N.negative=I.negative^Q.negative;var T=Q.length+I.length|0;N.length=T,T=T-1|0;var U=Q.words[0]|0,q=I.words[0]|0,D=U*q,v=D&67108863,k=D/67108864|0;N.words[0]=v;for(var G=1;G<T;G++){for(var J=k>>>26,Qe=k&67108863,Re=Math.min(G,I.length-1),$e=Math.max(0,G-Q.length+1);$e<=Re;$e++){var Bt=G-$e|0;U=Q.words[Bt]|0,q=I.words[$e]|0,D=U*q+Qe,J+=D/67108864|0,Qe=D&67108863}N.words[G]=Qe|0,k=J|0}return k!==0?N.words[G]=k|0:N.length--,N._strip()}var C=function(I,N,T){var U=I.words,q=N.words,D=T.words,v=0,k,G,J,Qe=U[0]|0,Re=Qe&8191,$e=Qe>>>13,Bt=U[1]|0,Pt=Bt&8191,ge=Bt>>>13,Ve=U[2]|0,Ke=Ve&8191,Me=Ve>>>13,ke=U[3]|0,Fe=ke&8191,rt=ke>>>13,ct=U[4]|0,at=ct&8191,gt=ct>>>13,mt=U[5]|0,Ye=mt&8191,jt=mt>>>13,Ar=U[6]|0,yr=Ar&8191,le=Ar>>>13,Se=U[7]|0,ve=Se&8191,nt=Se>>>13,de=U[8]|0,K=de&8191,ae=de>>>13,Oe=U[9]|0,ze=Oe&8191,_e=Oe>>>13,bt=q[0]|0,vt=bt&8191,kt=bt>>>13,It=q[1]|0,it=It&8191,Ft=It>>>13,De=q[2]|0,we=De&8191,ot=De>>>13,xt=q[3]|0,H=xt&8191,fe=xt>>>13,Ie=q[4]|0,Be=Ie&8191,Le=Ie>>>13,er=q[5]|0,te=er&8191,Y=er>>>13,ie=q[6]|0,xe=ie&8191,qe=ie>>>13,Je=q[7]|0,wt=Je&8191,lt=Je>>>13,Wt=q[8]|0,zt=Wt&8191,sr=Wt>>>13,tn=q[9]|0,pe=tn&8191,j=tn>>>13;T.negative=I.negative^N.negative,T.length=19,k=Math.imul(Re,vt),G=Math.imul(Re,kt),G=G+Math.imul($e,vt)|0,J=Math.imul($e,kt);var se=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(se>>>26)|0,se&=67108863,k=Math.imul(Pt,vt),G=Math.imul(Pt,kt),G=G+Math.imul(ge,vt)|0,J=Math.imul(ge,kt),k=k+Math.imul(Re,it)|0,G=G+Math.imul(Re,Ft)|0,G=G+Math.imul($e,it)|0,J=J+Math.imul($e,Ft)|0;var Ne=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,k=Math.imul(Ke,vt),G=Math.imul(Ke,kt),G=G+Math.imul(Me,vt)|0,J=Math.imul(Me,kt),k=k+Math.imul(Pt,it)|0,G=G+Math.imul(Pt,Ft)|0,G=G+Math.imul(ge,it)|0,J=J+Math.imul(ge,Ft)|0,k=k+Math.imul(Re,we)|0,G=G+Math.imul(Re,ot)|0,G=G+Math.imul($e,we)|0,J=J+Math.imul($e,ot)|0;var Pe=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,k=Math.imul(Fe,vt),G=Math.imul(Fe,kt),G=G+Math.imul(rt,vt)|0,J=Math.imul(rt,kt),k=k+Math.imul(Ke,it)|0,G=G+Math.imul(Ke,Ft)|0,G=G+Math.imul(Me,it)|0,J=J+Math.imul(Me,Ft)|0,k=k+Math.imul(Pt,we)|0,G=G+Math.imul(Pt,ot)|0,G=G+Math.imul(ge,we)|0,J=J+Math.imul(ge,ot)|0,k=k+Math.imul(Re,H)|0,G=G+Math.imul(Re,fe)|0,G=G+Math.imul($e,H)|0,J=J+Math.imul($e,fe)|0;var tt=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(tt>>>26)|0,tt&=67108863,k=Math.imul(at,vt),G=Math.imul(at,kt),G=G+Math.imul(gt,vt)|0,J=Math.imul(gt,kt),k=k+Math.imul(Fe,it)|0,G=G+Math.imul(Fe,Ft)|0,G=G+Math.imul(rt,it)|0,J=J+Math.imul(rt,Ft)|0,k=k+Math.imul(Ke,we)|0,G=G+Math.imul(Ke,ot)|0,G=G+Math.imul(Me,we)|0,J=J+Math.imul(Me,ot)|0,k=k+Math.imul(Pt,H)|0,G=G+Math.imul(Pt,fe)|0,G=G+Math.imul(ge,H)|0,J=J+Math.imul(ge,fe)|0,k=k+Math.imul(Re,Be)|0,G=G+Math.imul(Re,Le)|0,G=G+Math.imul($e,Be)|0,J=J+Math.imul($e,Le)|0;var Ht=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ht>>>26)|0,Ht&=67108863,k=Math.imul(Ye,vt),G=Math.imul(Ye,kt),G=G+Math.imul(jt,vt)|0,J=Math.imul(jt,kt),k=k+Math.imul(at,it)|0,G=G+Math.imul(at,Ft)|0,G=G+Math.imul(gt,it)|0,J=J+Math.imul(gt,Ft)|0,k=k+Math.imul(Fe,we)|0,G=G+Math.imul(Fe,ot)|0,G=G+Math.imul(rt,we)|0,J=J+Math.imul(rt,ot)|0,k=k+Math.imul(Ke,H)|0,G=G+Math.imul(Ke,fe)|0,G=G+Math.imul(Me,H)|0,J=J+Math.imul(Me,fe)|0,k=k+Math.imul(Pt,Be)|0,G=G+Math.imul(Pt,Le)|0,G=G+Math.imul(ge,Be)|0,J=J+Math.imul(ge,Le)|0,k=k+Math.imul(Re,te)|0,G=G+Math.imul(Re,Y)|0,G=G+Math.imul($e,te)|0,J=J+Math.imul($e,Y)|0;var Et=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(yr,vt),G=Math.imul(yr,kt),G=G+Math.imul(le,vt)|0,J=Math.imul(le,kt),k=k+Math.imul(Ye,it)|0,G=G+Math.imul(Ye,Ft)|0,G=G+Math.imul(jt,it)|0,J=J+Math.imul(jt,Ft)|0,k=k+Math.imul(at,we)|0,G=G+Math.imul(at,ot)|0,G=G+Math.imul(gt,we)|0,J=J+Math.imul(gt,ot)|0,k=k+Math.imul(Fe,H)|0,G=G+Math.imul(Fe,fe)|0,G=G+Math.imul(rt,H)|0,J=J+Math.imul(rt,fe)|0,k=k+Math.imul(Ke,Be)|0,G=G+Math.imul(Ke,Le)|0,G=G+Math.imul(Me,Be)|0,J=J+Math.imul(Me,Le)|0,k=k+Math.imul(Pt,te)|0,G=G+Math.imul(Pt,Y)|0,G=G+Math.imul(ge,te)|0,J=J+Math.imul(ge,Y)|0,k=k+Math.imul(Re,xe)|0,G=G+Math.imul(Re,qe)|0,G=G+Math.imul($e,xe)|0,J=J+Math.imul($e,qe)|0;var We=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(We>>>26)|0,We&=67108863,k=Math.imul(ve,vt),G=Math.imul(ve,kt),G=G+Math.imul(nt,vt)|0,J=Math.imul(nt,kt),k=k+Math.imul(yr,it)|0,G=G+Math.imul(yr,Ft)|0,G=G+Math.imul(le,it)|0,J=J+Math.imul(le,Ft)|0,k=k+Math.imul(Ye,we)|0,G=G+Math.imul(Ye,ot)|0,G=G+Math.imul(jt,we)|0,J=J+Math.imul(jt,ot)|0,k=k+Math.imul(at,H)|0,G=G+Math.imul(at,fe)|0,G=G+Math.imul(gt,H)|0,J=J+Math.imul(gt,fe)|0,k=k+Math.imul(Fe,Be)|0,G=G+Math.imul(Fe,Le)|0,G=G+Math.imul(rt,Be)|0,J=J+Math.imul(rt,Le)|0,k=k+Math.imul(Ke,te)|0,G=G+Math.imul(Ke,Y)|0,G=G+Math.imul(Me,te)|0,J=J+Math.imul(Me,Y)|0,k=k+Math.imul(Pt,xe)|0,G=G+Math.imul(Pt,qe)|0,G=G+Math.imul(ge,xe)|0,J=J+Math.imul(ge,qe)|0,k=k+Math.imul(Re,wt)|0,G=G+Math.imul(Re,lt)|0,G=G+Math.imul($e,wt)|0,J=J+Math.imul($e,lt)|0;var Xe=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Xe>>>26)|0,Xe&=67108863,k=Math.imul(K,vt),G=Math.imul(K,kt),G=G+Math.imul(ae,vt)|0,J=Math.imul(ae,kt),k=k+Math.imul(ve,it)|0,G=G+Math.imul(ve,Ft)|0,G=G+Math.imul(nt,it)|0,J=J+Math.imul(nt,Ft)|0,k=k+Math.imul(yr,we)|0,G=G+Math.imul(yr,ot)|0,G=G+Math.imul(le,we)|0,J=J+Math.imul(le,ot)|0,k=k+Math.imul(Ye,H)|0,G=G+Math.imul(Ye,fe)|0,G=G+Math.imul(jt,H)|0,J=J+Math.imul(jt,fe)|0,k=k+Math.imul(at,Be)|0,G=G+Math.imul(at,Le)|0,G=G+Math.imul(gt,Be)|0,J=J+Math.imul(gt,Le)|0,k=k+Math.imul(Fe,te)|0,G=G+Math.imul(Fe,Y)|0,G=G+Math.imul(rt,te)|0,J=J+Math.imul(rt,Y)|0,k=k+Math.imul(Ke,xe)|0,G=G+Math.imul(Ke,qe)|0,G=G+Math.imul(Me,xe)|0,J=J+Math.imul(Me,qe)|0,k=k+Math.imul(Pt,wt)|0,G=G+Math.imul(Pt,lt)|0,G=G+Math.imul(ge,wt)|0,J=J+Math.imul(ge,lt)|0,k=k+Math.imul(Re,zt)|0,G=G+Math.imul(Re,sr)|0,G=G+Math.imul($e,zt)|0,J=J+Math.imul($e,sr)|0;var Ct=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,k=Math.imul(ze,vt),G=Math.imul(ze,kt),G=G+Math.imul(_e,vt)|0,J=Math.imul(_e,kt),k=k+Math.imul(K,it)|0,G=G+Math.imul(K,Ft)|0,G=G+Math.imul(ae,it)|0,J=J+Math.imul(ae,Ft)|0,k=k+Math.imul(ve,we)|0,G=G+Math.imul(ve,ot)|0,G=G+Math.imul(nt,we)|0,J=J+Math.imul(nt,ot)|0,k=k+Math.imul(yr,H)|0,G=G+Math.imul(yr,fe)|0,G=G+Math.imul(le,H)|0,J=J+Math.imul(le,fe)|0,k=k+Math.imul(Ye,Be)|0,G=G+Math.imul(Ye,Le)|0,G=G+Math.imul(jt,Be)|0,J=J+Math.imul(jt,Le)|0,k=k+Math.imul(at,te)|0,G=G+Math.imul(at,Y)|0,G=G+Math.imul(gt,te)|0,J=J+Math.imul(gt,Y)|0,k=k+Math.imul(Fe,xe)|0,G=G+Math.imul(Fe,qe)|0,G=G+Math.imul(rt,xe)|0,J=J+Math.imul(rt,qe)|0,k=k+Math.imul(Ke,wt)|0,G=G+Math.imul(Ke,lt)|0,G=G+Math.imul(Me,wt)|0,J=J+Math.imul(Me,lt)|0,k=k+Math.imul(Pt,zt)|0,G=G+Math.imul(Pt,sr)|0,G=G+Math.imul(ge,zt)|0,J=J+Math.imul(ge,sr)|0,k=k+Math.imul(Re,pe)|0,G=G+Math.imul(Re,j)|0,G=G+Math.imul($e,pe)|0,J=J+Math.imul($e,j)|0;var Gt=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,k=Math.imul(ze,it),G=Math.imul(ze,Ft),G=G+Math.imul(_e,it)|0,J=Math.imul(_e,Ft),k=k+Math.imul(K,we)|0,G=G+Math.imul(K,ot)|0,G=G+Math.imul(ae,we)|0,J=J+Math.imul(ae,ot)|0,k=k+Math.imul(ve,H)|0,G=G+Math.imul(ve,fe)|0,G=G+Math.imul(nt,H)|0,J=J+Math.imul(nt,fe)|0,k=k+Math.imul(yr,Be)|0,G=G+Math.imul(yr,Le)|0,G=G+Math.imul(le,Be)|0,J=J+Math.imul(le,Le)|0,k=k+Math.imul(Ye,te)|0,G=G+Math.imul(Ye,Y)|0,G=G+Math.imul(jt,te)|0,J=J+Math.imul(jt,Y)|0,k=k+Math.imul(at,xe)|0,G=G+Math.imul(at,qe)|0,G=G+Math.imul(gt,xe)|0,J=J+Math.imul(gt,qe)|0,k=k+Math.imul(Fe,wt)|0,G=G+Math.imul(Fe,lt)|0,G=G+Math.imul(rt,wt)|0,J=J+Math.imul(rt,lt)|0,k=k+Math.imul(Ke,zt)|0,G=G+Math.imul(Ke,sr)|0,G=G+Math.imul(Me,zt)|0,J=J+Math.imul(Me,sr)|0,k=k+Math.imul(Pt,pe)|0,G=G+Math.imul(Pt,j)|0,G=G+Math.imul(ge,pe)|0,J=J+Math.imul(ge,j)|0;var Mr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(ze,we),G=Math.imul(ze,ot),G=G+Math.imul(_e,we)|0,J=Math.imul(_e,ot),k=k+Math.imul(K,H)|0,G=G+Math.imul(K,fe)|0,G=G+Math.imul(ae,H)|0,J=J+Math.imul(ae,fe)|0,k=k+Math.imul(ve,Be)|0,G=G+Math.imul(ve,Le)|0,G=G+Math.imul(nt,Be)|0,J=J+Math.imul(nt,Le)|0,k=k+Math.imul(yr,te)|0,G=G+Math.imul(yr,Y)|0,G=G+Math.imul(le,te)|0,J=J+Math.imul(le,Y)|0,k=k+Math.imul(Ye,xe)|0,G=G+Math.imul(Ye,qe)|0,G=G+Math.imul(jt,xe)|0,J=J+Math.imul(jt,qe)|0,k=k+Math.imul(at,wt)|0,G=G+Math.imul(at,lt)|0,G=G+Math.imul(gt,wt)|0,J=J+Math.imul(gt,lt)|0,k=k+Math.imul(Fe,zt)|0,G=G+Math.imul(Fe,sr)|0,G=G+Math.imul(rt,zt)|0,J=J+Math.imul(rt,sr)|0,k=k+Math.imul(Ke,pe)|0,G=G+Math.imul(Ke,j)|0,G=G+Math.imul(Me,pe)|0,J=J+Math.imul(Me,j)|0;var ir=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(ze,H),G=Math.imul(ze,fe),G=G+Math.imul(_e,H)|0,J=Math.imul(_e,fe),k=k+Math.imul(K,Be)|0,G=G+Math.imul(K,Le)|0,G=G+Math.imul(ae,Be)|0,J=J+Math.imul(ae,Le)|0,k=k+Math.imul(ve,te)|0,G=G+Math.imul(ve,Y)|0,G=G+Math.imul(nt,te)|0,J=J+Math.imul(nt,Y)|0,k=k+Math.imul(yr,xe)|0,G=G+Math.imul(yr,qe)|0,G=G+Math.imul(le,xe)|0,J=J+Math.imul(le,qe)|0,k=k+Math.imul(Ye,wt)|0,G=G+Math.imul(Ye,lt)|0,G=G+Math.imul(jt,wt)|0,J=J+Math.imul(jt,lt)|0,k=k+Math.imul(at,zt)|0,G=G+Math.imul(at,sr)|0,G=G+Math.imul(gt,zt)|0,J=J+Math.imul(gt,sr)|0,k=k+Math.imul(Fe,pe)|0,G=G+Math.imul(Fe,j)|0,G=G+Math.imul(rt,pe)|0,J=J+Math.imul(rt,j)|0;var Cr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(ze,Be),G=Math.imul(ze,Le),G=G+Math.imul(_e,Be)|0,J=Math.imul(_e,Le),k=k+Math.imul(K,te)|0,G=G+Math.imul(K,Y)|0,G=G+Math.imul(ae,te)|0,J=J+Math.imul(ae,Y)|0,k=k+Math.imul(ve,xe)|0,G=G+Math.imul(ve,qe)|0,G=G+Math.imul(nt,xe)|0,J=J+Math.imul(nt,qe)|0,k=k+Math.imul(yr,wt)|0,G=G+Math.imul(yr,lt)|0,G=G+Math.imul(le,wt)|0,J=J+Math.imul(le,lt)|0,k=k+Math.imul(Ye,zt)|0,G=G+Math.imul(Ye,sr)|0,G=G+Math.imul(jt,zt)|0,J=J+Math.imul(jt,sr)|0,k=k+Math.imul(at,pe)|0,G=G+Math.imul(at,j)|0,G=G+Math.imul(gt,pe)|0,J=J+Math.imul(gt,j)|0;var kr=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(ze,te),G=Math.imul(ze,Y),G=G+Math.imul(_e,te)|0,J=Math.imul(_e,Y),k=k+Math.imul(K,xe)|0,G=G+Math.imul(K,qe)|0,G=G+Math.imul(ae,xe)|0,J=J+Math.imul(ae,qe)|0,k=k+Math.imul(ve,wt)|0,G=G+Math.imul(ve,lt)|0,G=G+Math.imul(nt,wt)|0,J=J+Math.imul(nt,lt)|0,k=k+Math.imul(yr,zt)|0,G=G+Math.imul(yr,sr)|0,G=G+Math.imul(le,zt)|0,J=J+Math.imul(le,sr)|0,k=k+Math.imul(Ye,pe)|0,G=G+Math.imul(Ye,j)|0,G=G+Math.imul(jt,pe)|0,J=J+Math.imul(jt,j)|0;var qn=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(qn>>>26)|0,qn&=67108863,k=Math.imul(ze,xe),G=Math.imul(ze,qe),G=G+Math.imul(_e,xe)|0,J=Math.imul(_e,qe),k=k+Math.imul(K,wt)|0,G=G+Math.imul(K,lt)|0,G=G+Math.imul(ae,wt)|0,J=J+Math.imul(ae,lt)|0,k=k+Math.imul(ve,zt)|0,G=G+Math.imul(ve,sr)|0,G=G+Math.imul(nt,zt)|0,J=J+Math.imul(nt,sr)|0,k=k+Math.imul(yr,pe)|0,G=G+Math.imul(yr,j)|0,G=G+Math.imul(le,pe)|0,J=J+Math.imul(le,j)|0;var Li=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Li>>>26)|0,Li&=67108863,k=Math.imul(ze,wt),G=Math.imul(ze,lt),G=G+Math.imul(_e,wt)|0,J=Math.imul(_e,lt),k=k+Math.imul(K,zt)|0,G=G+Math.imul(K,sr)|0,G=G+Math.imul(ae,zt)|0,J=J+Math.imul(ae,sr)|0,k=k+Math.imul(ve,pe)|0,G=G+Math.imul(ve,j)|0,G=G+Math.imul(nt,pe)|0,J=J+Math.imul(nt,j)|0;var Va=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(Va>>>26)|0,Va&=67108863,k=Math.imul(ze,zt),G=Math.imul(ze,sr),G=G+Math.imul(_e,zt)|0,J=Math.imul(_e,sr),k=k+Math.imul(K,pe)|0,G=G+Math.imul(K,j)|0,G=G+Math.imul(ae,pe)|0,J=J+Math.imul(ae,j)|0;var mc=(v+k|0)+((G&8191)<<13)|0;v=(J+(G>>>13)|0)+(mc>>>26)|0,mc&=67108863,k=Math.imul(ze,pe),G=Math.imul(ze,j),G=G+Math.imul(_e,pe)|0,J=Math.imul(_e,j);var F0=(v+k|0)+((G&8191)<<13)|0;return v=(J+(G>>>13)|0)+(F0>>>26)|0,F0&=67108863,D[0]=se,D[1]=Ne,D[2]=Pe,D[3]=tt,D[4]=Ht,D[5]=Et,D[6]=We,D[7]=Xe,D[8]=Ct,D[9]=Gt,D[10]=Mr,D[11]=ir,D[12]=Cr,D[13]=kr,D[14]=qn,D[15]=Li,D[16]=Va,D[17]=mc,D[18]=F0,v!==0&&(D[19]=v,T.length++),T};Math.imul||(C=E);function y(Q,I,N){N.negative=I.negative^Q.negative,N.length=Q.length+I.length;for(var T=0,U=0,q=0;q<N.length-1;q++){var D=U;U=0;for(var v=T&67108863,k=Math.min(q,I.length-1),G=Math.max(0,q-Q.length+1);G<=k;G++){var J=q-G,Qe=Q.words[J]|0,Re=I.words[G]|0,$e=Qe*Re,Bt=$e&67108863;D=D+($e/67108864|0)|0,Bt=Bt+v|0,v=Bt&67108863,D=D+(Bt>>>26)|0,U+=D>>>26,D&=67108863}N.words[q]=v,T=D,D=U}return T!==0?N.words[q]=T:N.length--,N._strip()}function b(Q,I,N){return y(Q,I,N)}i.prototype.mulTo=function(I,N){var T,U=this.length+I.length;return this.length===10&&I.length===10?T=C(this,I,N):U<63?T=E(this,I,N):U<1024?T=y(this,I,N):T=b(this,I,N),T};function O(Q,I){this.x=Q,this.y=I}O.prototype.makeRBT=function(I){for(var N=new Array(I),T=i.prototype._countBits(I)-1,U=0;U<I;U++)N[U]=this.revBin(U,T,I);return N},O.prototype.revBin=function(I,N,T){if(I===0||I===T-1)return I;for(var U=0,q=0;q<N;q++)U|=(I&1)<<N-q-1,I>>=1;return U},O.prototype.permute=function(I,N,T,U,q,D){for(var v=0;v<D;v++)U[v]=N[I[v]],q[v]=T[I[v]]},O.prototype.transform=function(I,N,T,U,q,D){this.permute(D,I,N,T,U,q);for(var v=1;v<q;v<<=1)for(var k=v<<1,G=Math.cos(2*Math.PI/k),J=Math.sin(2*Math.PI/k),Qe=0;Qe<q;Qe+=k)for(var Re=G,$e=J,Bt=0;Bt<v;Bt++){var Pt=T[Qe+Bt],ge=U[Qe+Bt],Ve=T[Qe+Bt+v],Ke=U[Qe+Bt+v],Me=Re*Ve-$e*Ke;Ke=Re*Ke+$e*Ve,Ve=Me,T[Qe+Bt]=Pt+Ve,U[Qe+Bt]=ge+Ke,T[Qe+Bt+v]=Pt-Ve,U[Qe+Bt+v]=ge-Ke,Bt!==k&&(Me=G*Re-J*$e,$e=G*$e+J*Re,Re=Me)}},O.prototype.guessLen13b=function(I,N){var T=Math.max(N,I)|1,U=T&1,q=0;for(T=T/2|0;T;T=T>>>1)q++;return 1<<q+1+U},O.prototype.conjugate=function(I,N,T){if(!(T<=1))for(var U=0;U<T/2;U++){var q=I[U];I[U]=I[T-U-1],I[T-U-1]=q,q=N[U],N[U]=-N[T-U-1],N[T-U-1]=-q}},O.prototype.normalize13b=function(I,N){for(var T=0,U=0;U<N/2;U++){var q=Math.round(I[2*U+1]/N)*8192+Math.round(I[2*U]/N)+T;I[U]=q&67108863,q<67108864?T=0:T=q/67108864|0}return I},O.prototype.convert13b=function(I,N,T,U){for(var q=0,D=0;D<N;D++)q=q+(I[D]|0),T[2*D]=q&8191,q=q>>>13,T[2*D+1]=q&8191,q=q>>>13;for(D=2*N;D<U;++D)T[D]=0;r(q===0),r((q&-8192)===0)},O.prototype.stub=function(I){for(var N=new Array(I),T=0;T<I;T++)N[T]=0;return N},O.prototype.mulp=function(I,N,T){var U=2*this.guessLen13b(I.length,N.length),q=this.makeRBT(U),D=this.stub(U),v=new Array(U),k=new Array(U),G=new Array(U),J=new Array(U),Qe=new Array(U),Re=new Array(U),$e=T.words;$e.length=U,this.convert13b(I.words,I.length,v,U),this.convert13b(N.words,N.length,J,U),this.transform(v,D,k,G,U,q),this.transform(J,D,Qe,Re,U,q);for(var Bt=0;Bt<U;Bt++){var Pt=k[Bt]*Qe[Bt]-G[Bt]*Re[Bt];G[Bt]=k[Bt]*Re[Bt]+G[Bt]*Qe[Bt],k[Bt]=Pt}return this.conjugate(k,G,U),this.transform(k,G,$e,D,U,q),this.conjugate($e,D,U),this.normalize13b($e,U),T.negative=I.negative^N.negative,T.length=I.length+N.length,T._strip()},i.prototype.mul=function(I){var N=new i(null);return N.words=new Array(this.length+I.length),this.mulTo(I,N)},i.prototype.mulf=function(I){var N=new i(null);return N.words=new Array(this.length+I.length),b(this,I,N)},i.prototype.imul=function(I){return this.clone().mulTo(I,this)},i.prototype.imuln=function(I){var N=I<0;N&&(I=-I),r(typeof I=="number"),r(I<67108864);for(var T=0,U=0;U<this.length;U++){var q=(this.words[U]|0)*I,D=(q&67108863)+(T&67108863);T>>=26,T+=q/67108864|0,T+=D>>>26,this.words[U]=D&67108863}return T!==0&&(this.words[U]=T,this.length++),this.length=I===0?1:this.length,N?this.ineg():this},i.prototype.muln=function(I){return this.clone().imuln(I)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(I){var N=g(I);if(N.length===0)return new i(1);for(var T=this,U=0;U<N.length&&N[U]===0;U++,T=T.sqr());if(++U<N.length)for(var q=T.sqr();U<N.length;U++,q=q.sqr())N[U]!==0&&(T=T.mul(q));return T},i.prototype.iushln=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26,U=67108863>>>26-N<<26-N,q;if(N!==0){var D=0;for(q=0;q<this.length;q++){var v=this.words[q]&U,k=(this.words[q]|0)-v<<N;this.words[q]=k|D,D=v>>>26-N}D&&(this.words[q]=D,this.length++)}if(T!==0){for(q=this.length-1;q>=0;q--)this.words[q+T]=this.words[q];for(q=0;q<T;q++)this.words[q]=0;this.length+=T}return this._strip()},i.prototype.ishln=function(I){return r(this.negative===0),this.iushln(I)},i.prototype.iushrn=function(I,N,T){r(typeof I=="number"&&I>=0);var U;N?U=(N-N%26)/26:U=0;var q=I%26,D=Math.min((I-q)/26,this.length),v=67108863^67108863>>>q<<q,k=T;if(U-=D,U=Math.max(0,U),k){for(var G=0;G<D;G++)k.words[G]=this.words[G];k.length=D}if(D!==0)if(this.length>D)for(this.length-=D,G=0;G<this.length;G++)this.words[G]=this.words[G+D];else this.words[0]=0,this.length=1;var J=0;for(G=this.length-1;G>=0&&(J!==0||G>=U);G--){var Qe=this.words[G]|0;this.words[G]=J<<26-q|Qe>>>q,J=Qe&v}return k&&J!==0&&(k.words[k.length++]=J),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(I,N,T){return r(this.negative===0),this.iushrn(I,N,T)},i.prototype.shln=function(I){return this.clone().ishln(I)},i.prototype.ushln=function(I){return this.clone().iushln(I)},i.prototype.shrn=function(I){return this.clone().ishrn(I)},i.prototype.ushrn=function(I){return this.clone().iushrn(I)},i.prototype.testn=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26,U=1<<N;if(this.length<=T)return!1;var q=this.words[T];return!!(q&U)},i.prototype.imaskn=function(I){r(typeof I=="number"&&I>=0);var N=I%26,T=(I-N)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(N!==0&&T++,this.length=Math.min(T,this.length),N!==0){var U=67108863^67108863>>>N<<N;this.words[this.length-1]&=U}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.maskn=function(I){return this.clone().imaskn(I)},i.prototype.iaddn=function(I){return r(typeof I=="number"),r(I<67108864),I<0?this.isubn(-I):this.negative!==0?this.length===1&&(this.words[0]|0)<=I?(this.words[0]=I-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(I),this.negative=1,this):this._iaddn(I)},i.prototype._iaddn=function(I){this.words[0]+=I;for(var N=0;N<this.length&&this.words[N]>=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},i.prototype.isubn=function(I){if(r(typeof I=="number"),r(I<67108864),I<0)return this.iaddn(-I);if(this.negative!==0)return this.negative=0,this.iaddn(I),this.negative=1,this;if(this.words[0]-=I,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var N=0;N<this.length&&this.words[N]<0;N++)this.words[N]+=67108864,this.words[N+1]-=1;return this._strip()},i.prototype.addn=function(I){return this.clone().iaddn(I)},i.prototype.subn=function(I){return this.clone().isubn(I)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(I,N,T){var U=I.length+T,q;this._expand(U);var D,v=0;for(q=0;q<I.length;q++){D=(this.words[q+T]|0)+v;var k=(I.words[q]|0)*N;D-=k&67108863,v=(D>>26)-(k/67108864|0),this.words[q+T]=D&67108863}for(;q<this.length-T;q++)D=(this.words[q+T]|0)+v,v=D>>26,this.words[q+T]=D&67108863;if(v===0)return this._strip();for(r(v===-1),v=0,q=0;q<this.length;q++)D=-(this.words[q]|0)+v,v=D>>26,this.words[q]=D&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(I,N){var T=this.length-I.length,U=this.clone(),q=I,D=q.words[q.length-1]|0,v=this._countBits(D);T=26-v,T!==0&&(q=q.ushln(T),U.iushln(T),D=q.words[q.length-1]|0);var k=U.length-q.length,G;if(N!=="mod"){G=new i(null),G.length=k+1,G.words=new Array(G.length);for(var J=0;J<G.length;J++)G.words[J]=0}var Qe=U.clone()._ishlnsubmul(q,1,k);Qe.negative===0&&(U=Qe,G&&(G.words[k]=1));for(var Re=k-1;Re>=0;Re--){var $e=(U.words[q.length+Re]|0)*67108864+(U.words[q.length+Re-1]|0);for($e=Math.min($e/D|0,67108863),U._ishlnsubmul(q,$e,Re);U.negative!==0;)$e--,U.negative=0,U._ishlnsubmul(q,1,Re),U.isZero()||(U.negative^=1);G&&(G.words[Re]=$e)}return G&&G._strip(),U._strip(),N!=="div"&&T!==0&&U.iushrn(T),{div:G||null,mod:U}},i.prototype.divmod=function(I,N,T){if(r(!I.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var U,q,D;return this.negative!==0&&I.negative===0?(D=this.neg().divmod(I,N),N!=="mod"&&(U=D.div.neg()),N!=="div"&&(q=D.mod.neg(),T&&q.negative!==0&&q.iadd(I)),{div:U,mod:q}):this.negative===0&&I.negative!==0?(D=this.divmod(I.neg(),N),N!=="mod"&&(U=D.div.neg()),{div:U,mod:D.mod}):(this.negative&I.negative)!==0?(D=this.neg().divmod(I.neg(),N),N!=="div"&&(q=D.mod.neg(),T&&q.negative!==0&&q.isub(I)),{div:D.div,mod:q}):I.length>this.length||this.cmp(I)<0?{div:new i(0),mod:this}:I.length===1?N==="div"?{div:this.divn(I.words[0]),mod:null}:N==="mod"?{div:null,mod:new i(this.modrn(I.words[0]))}:{div:this.divn(I.words[0]),mod:new i(this.modrn(I.words[0]))}:this._wordDiv(I,N)},i.prototype.div=function(I){return this.divmod(I,"div",!1).div},i.prototype.mod=function(I){return this.divmod(I,"mod",!1).mod},i.prototype.umod=function(I){return this.divmod(I,"mod",!0).mod},i.prototype.divRound=function(I){var N=this.divmod(I);if(N.mod.isZero())return N.div;var T=N.div.negative!==0?N.mod.isub(I):N.mod,U=I.ushrn(1),q=I.andln(1),D=T.cmp(U);return D<0||q===1&&D===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},i.prototype.modrn=function(I){var N=I<0;N&&(I=-I),r(I<=67108863);for(var T=(1<<26)%I,U=0,q=this.length-1;q>=0;q--)U=(T*U+(this.words[q]|0))%I;return N?-U:U},i.prototype.modn=function(I){return this.modrn(I)},i.prototype.idivn=function(I){var N=I<0;N&&(I=-I),r(I<=67108863);for(var T=0,U=this.length-1;U>=0;U--){var q=(this.words[U]|0)+T*67108864;this.words[U]=q/I|0,T=q%I}return this._strip(),N?this.ineg():this},i.prototype.divn=function(I){return this.clone().idivn(I)},i.prototype.egcd=function(I){r(I.negative===0),r(!I.isZero());var N=this,T=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var U=new i(1),q=new i(0),D=new i(0),v=new i(1),k=0;N.isEven()&&T.isEven();)N.iushrn(1),T.iushrn(1),++k;for(var G=T.clone(),J=N.clone();!N.isZero();){for(var Qe=0,Re=1;(N.words[0]&Re)===0&&Qe<26;++Qe,Re<<=1);if(Qe>0)for(N.iushrn(Qe);Qe-- >0;)(U.isOdd()||q.isOdd())&&(U.iadd(G),q.isub(J)),U.iushrn(1),q.iushrn(1);for(var $e=0,Bt=1;(T.words[0]&Bt)===0&&$e<26;++$e,Bt<<=1);if($e>0)for(T.iushrn($e);$e-- >0;)(D.isOdd()||v.isOdd())&&(D.iadd(G),v.isub(J)),D.iushrn(1),v.iushrn(1);N.cmp(T)>=0?(N.isub(T),U.isub(D),q.isub(v)):(T.isub(N),D.isub(U),v.isub(q))}return{a:D,b:v,gcd:T.iushln(k)}},i.prototype._invmp=function(I){r(I.negative===0),r(!I.isZero());var N=this,T=I.clone();N.negative!==0?N=N.umod(I):N=N.clone();for(var U=new i(1),q=new i(0),D=T.clone();N.cmpn(1)>0&&T.cmpn(1)>0;){for(var v=0,k=1;(N.words[0]&k)===0&&v<26;++v,k<<=1);if(v>0)for(N.iushrn(v);v-- >0;)U.isOdd()&&U.iadd(D),U.iushrn(1);for(var G=0,J=1;(T.words[0]&J)===0&&G<26;++G,J<<=1);if(G>0)for(T.iushrn(G);G-- >0;)q.isOdd()&&q.iadd(D),q.iushrn(1);N.cmp(T)>=0?(N.isub(T),U.isub(q)):(T.isub(N),q.isub(U))}var Qe;return N.cmpn(1)===0?Qe=U:Qe=q,Qe.cmpn(0)<0&&Qe.iadd(I),Qe},i.prototype.gcd=function(I){if(this.isZero())return I.abs();if(I.isZero())return this.abs();var N=this.clone(),T=I.clone();N.negative=0,T.negative=0;for(var U=0;N.isEven()&&T.isEven();U++)N.iushrn(1),T.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;T.isEven();)T.iushrn(1);var q=N.cmp(T);if(q<0){var D=N;N=T,T=D}else if(q===0||T.cmpn(1)===0)break;N.isub(T)}while(!0);return T.iushln(U)},i.prototype.invm=function(I){return this.egcd(I).a.umod(I)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(I){return this.words[0]&I},i.prototype.bincn=function(I){r(typeof I=="number");var N=I%26,T=(I-N)/26,U=1<<N;if(this.length<=T)return this._expand(T+1),this.words[T]|=U,this;for(var q=U,D=T;q!==0&&D<this.length;D++){var v=this.words[D]|0;v+=q,q=v>>>26,v&=67108863,this.words[D]=v}return q!==0&&(this.words[D]=q,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(I){var N=I<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this._strip();var T;if(this.length>1)T=1;else{N&&(I=-I),r(I<=67108863,"Number is too big");var U=this.words[0]|0;T=U===I?0:U<I?-1:1}return this.negative!==0?-T|0:T},i.prototype.cmp=function(I){if(this.negative!==0&&I.negative===0)return-1;if(this.negative===0&&I.negative!==0)return 1;var N=this.ucmp(I);return this.negative!==0?-N|0:N},i.prototype.ucmp=function(I){if(this.length>I.length)return 1;if(this.length<I.length)return-1;for(var N=0,T=this.length-1;T>=0;T--){var U=this.words[T]|0,q=I.words[T]|0;if(U!==q){U<q?N=-1:U>q&&(N=1);break}}return N},i.prototype.gtn=function(I){return this.cmpn(I)===1},i.prototype.gt=function(I){return this.cmp(I)===1},i.prototype.gten=function(I){return this.cmpn(I)>=0},i.prototype.gte=function(I){return this.cmp(I)>=0},i.prototype.ltn=function(I){return this.cmpn(I)===-1},i.prototype.lt=function(I){return this.cmp(I)===-1},i.prototype.lten=function(I){return this.cmpn(I)<=0},i.prototype.lte=function(I){return this.cmp(I)<=0},i.prototype.eqn=function(I){return this.cmpn(I)===0},i.prototype.eq=function(I){return this.cmp(I)===0},i.red=function(I){return new _(I)},i.prototype.toRed=function(I){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),I.convertTo(this)._forceRed(I)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(I){return this.red=I,this},i.prototype.forceRed=function(I){return r(!this.red,"Already a number in reduction context"),this._forceRed(I)},i.prototype.redAdd=function(I){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,I)},i.prototype.redIAdd=function(I){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,I)},i.prototype.redSub=function(I){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,I)},i.prototype.redISub=function(I){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,I)},i.prototype.redShl=function(I){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,I)},i.prototype.redMul=function(I){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.mul(this,I)},i.prototype.redIMul=function(I){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,I),this.red.imul(this,I)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(I){return r(this.red&&!I.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,I)};var M={k256:null,p224:null,p192:null,p25519:null};function S(Q,I){this.name=Q,this.p=new i(I,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var I=new i(null);return I.words=new Array(Math.ceil(this.n/13)),I},S.prototype.ireduce=function(I){var N=I,T;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),T=N.bitLength();while(T>this.n);var U=T<this.n?-1:N.ucmp(this.p);return U===0?(N.words[0]=0,N.length=1):U>0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},S.prototype.split=function(I,N){I.iushrn(this.n,0,N)},S.prototype.imulK=function(I){return I.imul(this.k)};function P(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(P,S),P.prototype.split=function(I,N){for(var T=4194303,U=Math.min(I.length,9),q=0;q<U;q++)N.words[q]=I.words[q];if(N.length=U,I.length<=9){I.words[0]=0,I.length=1;return}var D=I.words[9];for(N.words[N.length++]=D&T,q=10;q<I.length;q++){var v=I.words[q]|0;I.words[q-10]=(v&T)<<4|D>>>22,D=v}D>>>=22,I.words[q-10]=D,D===0&&I.length>10?I.length-=10:I.length-=9},P.prototype.imulK=function(I){I.words[I.length]=0,I.words[I.length+1]=0,I.length+=2;for(var N=0,T=0;T<I.length;T++){var U=I.words[T]|0;N+=U*977,I.words[T]=N&67108863,N=U*64+(N/67108864|0)}return I.words[I.length-1]===0&&(I.length--,I.words[I.length-1]===0&&I.length--),I};function V(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,S);function Z(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(Z,S);function X(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(X,S),X.prototype.imulK=function(I){for(var N=0,T=0;T<I.length;T++){var U=(I.words[T]|0)*19+N,q=U&67108863;U>>>=26,I.words[T]=q,N=U}return N!==0&&(I.words[I.length++]=N),I},i._prime=function(I){if(M[I])return M[I];var N;if(I==="k256")N=new P;else if(I==="p224")N=new V;else if(I==="p192")N=new Z;else if(I==="p25519")N=new X;else throw new Error("Unknown prime "+I);return M[I]=N,N};function _(Q){if(typeof Q=="string"){var I=i._prime(Q);this.m=I.p,this.prime=I}else r(Q.gtn(1),"modulus must be greater than 1"),this.m=Q,this.prime=null}_.prototype._verify1=function(I){r(I.negative===0,"red works only with positives"),r(I.red,"red works only with red numbers")},_.prototype._verify2=function(I,N){r((I.negative|N.negative)===0,"red works only with positives"),r(I.red&&I.red===N.red,"red works only with red numbers")},_.prototype.imod=function(I){return this.prime?this.prime.ireduce(I)._forceRed(this):(u(I,I.umod(this.m)._forceRed(this)),I)},_.prototype.neg=function(I){return I.isZero()?I.clone():this.m.sub(I)._forceRed(this)},_.prototype.add=function(I,N){this._verify2(I,N);var T=I.add(N);return T.cmp(this.m)>=0&&T.isub(this.m),T._forceRed(this)},_.prototype.iadd=function(I,N){this._verify2(I,N);var T=I.iadd(N);return T.cmp(this.m)>=0&&T.isub(this.m),T},_.prototype.sub=function(I,N){this._verify2(I,N);var T=I.sub(N);return T.cmpn(0)<0&&T.iadd(this.m),T._forceRed(this)},_.prototype.isub=function(I,N){this._verify2(I,N);var T=I.isub(N);return T.cmpn(0)<0&&T.iadd(this.m),T},_.prototype.shl=function(I,N){return this._verify1(I),this.imod(I.ushln(N))},_.prototype.imul=function(I,N){return this._verify2(I,N),this.imod(I.imul(N))},_.prototype.mul=function(I,N){return this._verify2(I,N),this.imod(I.mul(N))},_.prototype.isqr=function(I){return this.imul(I,I.clone())},_.prototype.sqr=function(I){return this.mul(I,I)},_.prototype.sqrt=function(I){if(I.isZero())return I.clone();var N=this.m.andln(3);if(r(N%2===1),N===3){var T=this.m.add(new i(1)).iushrn(2);return this.pow(I,T)}for(var U=this.m.subn(1),q=0;!U.isZero()&&U.andln(1)===0;)q++,U.iushrn(1);r(!U.isZero());var D=new i(1).toRed(this),v=D.redNeg(),k=this.m.subn(1).iushrn(1),G=this.m.bitLength();for(G=new i(2*G*G).toRed(this);this.pow(G,k).cmp(v)!==0;)G.redIAdd(v);for(var J=this.pow(G,U),Qe=this.pow(I,U.addn(1).iushrn(1)),Re=this.pow(I,U),$e=q;Re.cmp(D)!==0;){for(var Bt=Re,Pt=0;Bt.cmp(D)!==0;Pt++)Bt=Bt.redSqr();r(Pt<$e);var ge=this.pow(J,new i(1).iushln($e-Pt-1));Qe=Qe.redMul(ge),J=ge.redSqr(),Re=Re.redMul(J),$e=Pt}return Qe},_.prototype.invm=function(I){var N=I._invmp(this.m);return N.negative!==0?(N.negative=0,this.imod(N).redNeg()):this.imod(N)},_.prototype.pow=function(I,N){if(N.isZero())return new i(1).toRed(this);if(N.cmpn(1)===0)return I.clone();var T=4,U=new Array(1<<T);U[0]=new i(1).toRed(this),U[1]=I;for(var q=2;q<U.length;q++)U[q]=this.mul(U[q-1],I);var D=U[0],v=0,k=0,G=N.bitLength()%26;for(G===0&&(G=26),q=N.length-1;q>=0;q--){for(var J=N.words[q],Qe=G-1;Qe>=0;Qe--){var Re=J>>Qe&1;if(D!==U[0]&&(D=this.sqr(D)),Re===0&&v===0){k=0;continue}v<<=1,v|=Re,k++,!(k!==T&&(q!==0||Qe!==0))&&(D=this.mul(D,U[v]),k=0,v=0)}G=26}return D},_.prototype.convertTo=function(I){var N=I.umod(this.m);return N===I?N.clone():N},_.prototype.convertFrom=function(I){var N=I.clone();return N.red=null,N},i.mont=function(I){return new L(I)};function L(Q){_.call(this,Q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(L,_),L.prototype.convertTo=function(I){return this.imod(I.ushln(this.shift))},L.prototype.convertFrom=function(I){var N=this.imod(I.mul(this.rinv));return N.red=null,N},L.prototype.imul=function(I,N){if(I.isZero()||N.isZero())return I.words[0]=0,I.length=1,I;var T=I.imul(N),U=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=T.isub(U).iushrn(this.shift),D=q;return q.cmp(this.m)>=0?D=q.isub(this.m):q.cmpn(0)<0&&(D=q.iadd(this.m)),D._forceRed(this)},L.prototype.mul=function(I,N){if(I.isZero()||N.isZero())return new i(0)._forceRed(this);var T=I.mul(N),U=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),q=T.isub(U).iushrn(this.shift),D=q;return q.cmp(this.m)>=0?D=q.isub(this.m):q.cmpn(0)<0&&(D=q.iadd(this.m)),D._forceRed(this)},L.prototype.invm=function(I){var N=this.imod(I._invmp(this.m).mul(this.r2));return N._forceRed(this)}})(typeof Rjt>"u"||Rjt,eIn)});var tVe=m(l7=>{"use strict";var rIn=require("process"),SEe=qw(),Sjt=V5(),u7=S_(),wjt=require("crypto"),_ro=tIn(),RM=cc(),Uw=RM.codes,xro=.01,Bro=9e5,nIn=18e6;l7.buildCertId=function(t){let e=t.issuerCertificate;t=t.raw;try{t=u7.Certificate.decode(t,"der"),e&&(e=e.raw,e=u7.Certificate.decode(e,"der"))}catch{return null}let r=t.tbsCertificate,n=e.tbsCertificate,i={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:iIn(u7.Name.encode(r.issuer,"der")),issuerKeyHash:iIn(n.subjectPublicKeyInfo.subjectPublicKey.data),serialNumber:r.serialNumber},s=Sjt.CertID.encode(i,"der");return sIn(s.toString("BASE64"))};function iIn(t){return wjt.createHash("sha1").update(t).digest()}l7.decode=function(t){let e=t.issuerCertificate;return t=t.raw,t=u7.Certificate.decode(t,"der"),e&&(e=e.raw,e=u7.Certificate.decode(e,"der")),{cert:t,issuer:e}};var sIn=function(t){let e=Buffer.from(t,"base64"),r=Sjt.CertID.decode(e,"der");return r.issuerNameHash.toString("BASE64")+"#"+r.issuerKeyHash.toString("BASE64")+"#"+r.serialNumber.toString(10)};l7.encodeKey=sIn;var Mro=function(t){let e=t.split("#"),r=Buffer.from(e[0],"base64"),n=Buffer.from(e[1],"base64"),i=new _ro(e[2],10),s={hashAlgorithm:{algorithm:[1,3,14,3,2,26]},issuerNameHash:r,issuerKeyHash:n,serialNumber:i};return Sjt.CertID.encode(s,"der").toString("BASE64")};l7.decodeKey=Mro;var Oro=function(t,e){let r=(e-t)*xro;return r>nIn?r:nIn},oIn=function(t,e,r){let n=Oro(e,r);return e-Bro<=t&&t<=r+n};l7.isValidityRange=oIn;var eVe=function(t){return new Date(t)},Rro=function(t,e,r){let n=t.tbsCertificate.subjectPublicKeyInfo;if(n=SEe.utils.toPEM(u7.SubjectPublicKeyInfo.encode(n,"der"),"PUBLIC KEY"),e.length>0){let i=Date.now(),s=e[0],o=s.tbsCertificate.validity;if(o.notAfter.value<i||o.notBefore.value>i)return{err:RM.createOCSPError(Uw.ERR_OCSP_INVALID_CERTIFICATE_VALIDITY,"Valid from:",eVe(o.notBefore.value),", Valid to:",eVe(o.notAfter.value)),responderKey:null};let a=SEe.utils.sign[s.signatureAlgorithm.algorithm.join(".")];if(!a)return{err:RM.createOCSPError(Uw.ERR_OCSP_NO_SIGNATURE_ALGORITHM),responderKey:null};let c=wjt.createVerify(a);if(c.update(r[0]),!c.verify(n,s.signature.data))return{err:RM.createOCSPError(Uw.ERR_OCSP_INVALID_SIGNATURE),responderKey:null};let u=s.tbsCertificate.subjectPublicKeyInfo;return u=SEe.utils.toPEM(u7.SubjectPublicKeyInfo.encode(u,"der"),"PUBLIC KEY"),{err:null,responderKey:u}}return{err:null,responderKey:n}},Sro=function(t,e){function r(l){return{err:l,res:e}}let n;try{n=SEe.utils.parseResponse(e)}catch(l){return r(l)}let i=n.value;if(t){let l=n.certs,A=e.slice(n.start,n.end),p=n.certsTbs.map(function(y){return e.slice(y.start,y.end)}),f=SEe.utils.sign[i.signatureAlgorithm.algorithm.join(".")];if(!f)return r(RM.createOCSPError(Uw.ERR_OCSP_NO_SIGNATURE_ALGORITHM));let h=Rro(t,l,p);if(h.err)return r(h.err);let g=h.responderKey,E=wjt.createVerify(f),C=i.signature.data;if(E.update(A),!E.verify(g,C))return r(RM.createOCSPError(Uw.ERR_OCSP_INVALID_SIGNATURE))}let s=i.tbsResponseData;if(s.responses.length<1)return r(RM.createOCSPError(Uw.ERR_OCSP_NO_RESPONSE));let o=s.responses[0];if(o.certStatus.type==="revoked")return r(RM.createOCSPError(Uw.ERR_OCSP_REVOKED));let a=Date.now();return(rIn.env.SF_OCSP_TEST_INJECT_VALIDITY_ERROR||"").toLowerCase()==="true"||!oIn(a,o.thisUpdate,o.nextUpdate)?r(RM.createOCSPError(Uw.ERR_OCSP_INVALID_VALIDITY,"Valid from:",eVe(o.thisUpdate),", Valid to:",eVe(o.nextUpdate))):(rIn.env.SF_OCSP_TEST_INJECT_UNKNOWN_STATUS||"").toLowerCase()==="true"||o.certStatus.type==="unknown"?r(RM.createOCSPError(Uw.ERR_OCSP_UNKNOWN)):o.certStatus.type==="good"?r(null):r(RM.createOCSPError(Uw.ERR_OCSP_UNKNOWN_STATE))};l7.verifyOCSPResponse=Sro});var lIn=m((NZa,uIn)=>{"use strict";var wro=require("http"),Tro=require("url"),aIn=qw(),Dro=V5(),vro=hs(),Nro=tVe(),cIn=qf(),Tjt=cc(),Djt=Tjt.codes,bte=Rs(),Qro=function(t){return t>=500&&t<600||t===404||t===403||t===408};function zro(t,e,r){t=Tro.parse(t);let n=process.env.SF_OCSP_TEST_OCSP_RESPONDER_TIMEOUT||1e4,i=Object.assign({timeout:Number(n),method:"POST",headers:{"Content-Type":"application/ocsp-request","Content-Length":e.length}},t);function s(c,u){r&&r(c,u),r=null}function o(c){if(c.statusCode<200||c.statusCode>=400)return s(Tjt.createOCSPError(Djt.ERR_OCSP_FAILED_OBTAIN_OCSP_RESPONSE,c.statusCode),c);let u=[];c.on("readable",function(){let l=c.read();l&&u.push(l)}),c.on("end",function(){bte.getInstance().debug("Finish OCSP responder: %s",t.host);let l=Buffer.concat(u);s(null,l)})}let a=wro.request(i,o);a.on("error",function(c){r&&r(c),r=null}),a.on("timeout",function(){a.abort(),bte.getInstance().debug("Timeout OCSP responder: %s",t.host),r&&r(Tjt.createOCSPError(Djt.ERR_OCSP_RESPONDER_TIMEOUT)),r=null}),a.end(e)}uIn.exports=function(e,r,n){let i=!0,s=cIn.getOcspMode()===cIn.ocspModes.FAIL_CLOSED,o=s?2:1;function a(E,C){if(i){i=!1,process.nextTick(function(){r(E,C)});return}r(E,C)}let c;try{c=n?n.req:aIn.request.generate(e.cert,e.issuer)}catch(E){return a(E)}let u=Dro["id-pkix-ocsp"].join("."),l=1,A=1;function p(E,C){let y=!1;if(E){if(Object.prototype.hasOwnProperty.call(E,"code")&&E.code===Djt.ERR_OCSP_RESPONDER_TIMEOUT)y=!0;else if(Object.prototype.hasOwnProperty.call(E,"message")){let b=E.message.split(" ");if(b.length===0)return a(E);try{let O=parseInt(b[b.length-1],10);y=Qro(O)}catch{}}if(l<o&&y)l++,A=vro.nextSleepTime(1,10,A),setTimeout(g,A*1e3);else return bte.getInstance().debug("Failed to all retries to OCSP responder."),a(E)}else{let b=Nro.verifyOCSPResponse(c.issuer,C);a(b.err,b)}}function f(E){let C=require("url").parse(process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL),y;C.port?y=`${C.protocol}//${C.hostname}:${C.port}/retry`:y=`${C.protocol}//${C.hostname}/retry`;let b=c.data.toString("base64");C=require("url").parse(E),process.env.SF_OCSP_RESPONDER_URL=y+"/"+C.hostname+"/"+b}function h(E,C){if(E){if(E.message==="AuthorityInfoAccess not found in extensions")if(s)bte.getInstance().error("OCSP Responder URL is missing from the certificate, so cannot verify with OCSP. Aborting connection attempt due to OCSP being set to FAIL_CLOSE https://docs.snowflake.com/en/user-guide/ocsp#fail-close");else return bte.getInstance().debug("OCSP Responder URL is missing from the certificate."),a(null);return a(E)}process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL&&process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL.includes("ocsp_response_cache.json")&&f(C);let y=process.env.SF_OCSP_RESPONDER_URL;y&&(C=y),bte.getInstance().trace("Contact OCSP responder: %s, (%s/%s)",C,l,o),n||zro(C,c.data,p)}function g(){n?h(null,n.uri):aIn.utils.getAuthorityInfo(c.cert,u,h)}g(),i=!1}});var pIn=m(Qjt=>{"use strict";var Lro=require("http"),Pro=require("url"),kro=require("path"),vjt=require("fs"),AIn=Ejt(),d7=cc(),rVe=d7.codes,dIn=hs(),wEe=tVe(),nVe=qf(),Gf=Rs(),SM={NOT_START:"not_start",STARTED:"started",FINISHED:"finish"},Njt=nVe.getOcspResponseCacheSizeLimit(),_te=nVe.getOcspResponseCacheMaxAge();d7.assertInternal(dIn.number.isPositiveInteger(Njt));d7.assertInternal(dIn.number.isPositiveInteger(_te));var Fro=nVe.mkdirCacheDir(),Kv=kro.join(Fro,"ocsp_response_cache.json"),A7;function qro(){try{A7.reset(),vjt.unlinkSync(Kv)}catch(t){Gf.getInstance().debug("Failed to delete OCSP cache file: %s, err: %s",Kv,t)}}Qjt.deleteCache=qro;function Uro(){let t=SM.NOT_START,e=!1,r=!1,n=null,i=Date.now()/1e3,s=process.env.SF_OCSP_RESPONSE_CACHE_SERVER_URL;s||(s="http://ocsp.snowflakecomputing.com/ocsp_response_cache.json");try{Gf.getInstance().debug("Reading OCSP cache file. %s",Kv);let l=vjt.readFileSync(Kv,"utf-8"),A=JSON.parse(l);a(A),r=!0}catch(l){Gf.getInstance().debug("Failed to read OCSP cache file: %s, err: %s",Kv,l)}this.setAgent=function(A){n=A},this.initCache=function(A,p){A7=new AIn({maxSize:1}),this.set(A,p)},this.isInitialized=function(){return r},this.isDownloadFinished=function(){return t===SM.FINISHED},this.forceDownloadToFinish=function(){t=SM.FINISHED},this.IsCacheExpired=function(){if(!r)return!1;_te=nVe.getOcspResponseCacheMaxAge();let l=Date.now()/1e3;return l-i>_te?(Gf.getInstance().debug("OCSP local cache validity is out of range. currentTime: %s, timestamp: %s, maxAge: %s",l,i,_te),!0):!1},this.resetCacheStatus=function(){if(t=SM.NOT_START,e){Gf.getInstance().debug(Kv);let l=Date.now()/1e3,A={};A7.forEach(function(f,h){let g=wEe.decodeKey(h),E=f.toString("BASE64");A[g]=[l,E]});let p=JSON.stringify(A);Gf.getInstance().debug("Writing OCSP cache file. %s",Kv);try{vjt.writeFileSync(Kv,p,"utf-8")}catch(f){Gf.getInstance().debug("Failed to update OCSP cache file: %s, err: %s",Kv,f)}e=!1}},this.set=function(A,p){try{let f=wEe.buildCertId(A);A7.set(f,p),e=!0}catch(f){Gf.getInstance().debug("Failed to add certificate to OCSP cache file. err: %s",f)}},this.get=function(A){try{let p=wEe.buildCertId(A);return A7.get(p)}catch(p){return Gf.getInstance().debug("Failed to get certificate from OCSP cache. err: %s",p),null}},this.downloadCache=function(l){if(t===SM.STARTED)return!1;if(t===SM.FINISHED)return l(null,!1),!0;t=SM.STARTED;function A(C,y){if(t!==SM.FINISHED){if(t=SM.FINISHED,Gf.getInstance().debug("Finish OCSP Cache Server: %s",s),C)return Gf.getInstance().debug("Failed to download OCSP cache file. %s. Ignored",C),l(C,!1);try{let b=JSON.parse(y);return a(b),e=!0,l(null,!1)}catch(b){l(b,!1)}}}function p(C){if(C.statusCode<200||C.statusCode>=400)return A(new Error("Failed to obtain OCSP response: "+C.statusCode),null);let y="";C.on("data",function(b){y+=b}),C.on("end",function(){A(null,y)})}let f=Pro.parse(s),h=process.env.SF_OCSP_TEST_OCSP_RESPONSE_CACHE_SERVER_TIMEOUT||5e3,g=Object.assign({timeout:Number(h),method:"GET",agent:n},f),E=Lro.request(g,p);return E.on("error",function(C){t=SM.FINISHED,l&&l(C,!1),l=null}),E.on("timeout",function(){t=SM.FINISHED,E.abort(),Gf.getInstance().debug("Timeout OCSP responder: %s, %ss",s,g.timeout),l&&l(d7.createOCSPError(rVe.ERR_OCSP_CACHE_SERVER_TIMEOUT),!1),l=null}),E.end(),Gf.getInstance().trace("Contact OCSP Cache Server: %s",s),!0};function o(l,A){let p;A.length!==2&&(Gf.getInstance().debug("OCSP cache value doesn't consist of two elements. Ignored."),p=d7.createOCSPError(rVe.ERR_OCSP_NOT_TWO_ELEMENTS));let f=A[0],h=Date.now()/1e3;h-f>_te&&(Gf.getInstance().debug("OCSP cache validity is out of range. currentTime: %s, timestamp: %s, maxAge: %s",h,f,_te),p=d7.createOCSPError(rVe.ERR_OCSP_CACHE_EXPIRED));try{let g=wEe.encodeKey(l);if(p)return{err:p,key:g};let E=A[1],C=Buffer.from(E,"base64"),y=wEe.verifyOCSPResponse(null,C);return y.err?{err:y.err}:{err:null,key:g,value:C}}catch(g){return Gf.getInstance().debug("Failed to parse OCSP response. %s. Ignored.",g),{err:d7.createOCSPError(rVe.ERR_OCSP_FAILED_PARSE_RESPONSE)}}}function a(l){let A=Object.keys(l).length;A7=new AIn({maxSize:A<Njt?A:Njt}),c(l),r=!0}function c(l){let A=Date.now()/1e3;for(let p in l)if(Object.prototype.hasOwnProperty.call(l,p)){let f=u(l,p,A);f&&(A=f)}i=A}function u(l,A,p){let f=o(A,l[A]);if(f.err)Gf.getInstance().trace("Error when validating OCSP cache entry %s, %s",A,f.err.toString());else if(A7.set(f.key,f.value),l[A][0]<p)return l[A][0]}}Qjt.OcspResponseCache=Uro});var gIn=m(q2=>{"use strict";var Gro=q2&&q2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Wro=q2&&q2.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fIn=q2&&q2.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Gro(e,t,r);return Wro(e,t),e};Object.defineProperty(q2,"__esModule",{value:!0});q2.req=q2.json=q2.toBuffer=void 0;var Hro=fIn(require("http")),jro=fIn(require("https"));async function hIn(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}q2.toBuffer=hIn;async function Vro(t){let r=(await hIn(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}q2.json=Vro;function Kro(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?jro:Hro).request(t,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}q2.req=Kro});var IIn=m(II=>{"use strict";var EIn=II&&II.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$ro=II&&II.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),CIn=II&&II.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&EIn(e,t,r);return $ro(e,t),e},Yro=II&&II.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EIn(e,t,r)};Object.defineProperty(II,"__esModule",{value:!0});II.Agent=void 0;var Jro=CIn(require("net")),mIn=CIn(require("http")),Xro=require("https");Yro(gIn(),II);var Gw=Symbol("AgentBaseInternalState"),zjt=class extends mIn.Agent{constructor(e){super(e),this[Gw]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
4125
4125
|
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new Jro.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?Xro.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof mIn.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Gw].currentSocket=a,super.createSocket(e,r,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Gw].currentSocket;if(this[Gw].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Gw].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Gw]&&(this[Gw].defaultPort=e)}get protocol(){return this[Gw].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Gw]&&(this[Gw].protocol=e)}};II.Agent=zjt});var yIn=m(xte=>{"use strict";var Zro=xte&&xte.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xte,"__esModule",{value:!0});xte.parseProxyResponse=void 0;var eno=Zro(Ja()),iVe=(0,eno.default)("https-proxy-agent:parse-proxy-response");function tno(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let l=t.read();l?u(l):t.once("readable",s)}function o(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){o(),iVe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){o(),iVe("onerror %o",l),r(l)}function u(l){i.push(l),n+=l.length;let A=Buffer.concat(i,n),p=A.indexOf(`\r
|
|
4126
4126
|
\r
|
|
4127
4127
|
`);if(p===-1){iVe("have not received end of HTTP headers yet..."),s();return}let f=A.slice(0,p).toString("ascii").split(`\r
|
|
@@ -4478,7 +4478,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4478
4478
|
`)):`##! experimental.persistence
|
|
4479
4479
|
`+t}async function fOe(t){if(t.uri&&t.source||!t.uri&&t.source===void 0)return{ok:!1,problems:[{severity:"error",code:"bad-input",message:"Exactly one of {uri, source} must be provided."}]};let e=t.source!==void 0?Txa(t.source):void 0,r=t.uri?Igi(t.uri):Sxa(t.baseUri),{urlReader:n,readSource:i}=wxa(r,e),s=new S1t.Runtime({config:Gc,urlReader:n});try{let o=await ZE(()=>s.loadModel(r).getModel());return{ok:!0,loaded:{model:o,rootUrl:r,runtime:s,readSource:i},problems:dOe(o.problems)}}catch(o){return o instanceof S1t.MalloyError?{ok:!1,problems:dOe(o.problems)}:{ok:!1,problems:[pOe(o,r.href)]}}}var a2r,Egi,Cgi,S1t,Rxa,c2r=ye(()=>{"use strict";a2r=ut(require("node:url")),Egi=ut(require("node:fs")),Cgi=ut(require("node:path")),S1t=ut(Ic());MD();IS();o2r();Rxa="memory://mcp/"});function r0e(t){if(t)return[t.range.start.line,t.range.start.character]}function w1t(t,e){return!!t&&t.url===e}function ygi(t,e){if(!t||!e)return;let r=t.split(`
|
|
4480
4480
|
`),{start:n,end:i}=e.range;if(n.line<0||n.line>=r.length||i.line<0||i.line>=r.length)return;if(n.line===i.line)return r[n.line].slice(n.character,i.character);let s=[r[n.line].slice(n.character)];for(let o=n.line+1;o<i.line;o++)s.push(r[o]);return s.push(r[i.line].slice(0,i.character)),s.join(`
|
|
4481
|
-
`)}function vxa(t){let e=t.structDef.join;return e==="one"||e==="many"||e==="cross"?e:"one"}function bgi(t){let e=t.structDef;return e.type==="array"&&e.elementTypeDef?.type!=="record_element"}function Nxa(t){let e=t.structDef;return e.type==="array"&&e.elementTypeDef?.type==="record_element"}function Qxa(t){return t.structDef.type==="record"}function zxa(t,e){return bgi(t)?e.filter(r=>r.name!=="value"):e}function Lxa(t,e){let n=e.find(i=>i.name===t.name)?.expressionType;return n&&((0,D1t.expressionIsAggregate)(n)||(0,D1t.expressionIsAnalytic)(n))?"measure":"dimension"}function Pxa(t,e){if(bgi(t)||Nxa(t)||Qxa(t))return;let r=t.structDef;if(r.sourceID){let n=r.sourceID.split("@")[0];if(n&&e.has(n))return n}if(r.name&&e.has(r.name))return r.name;if(e.has(t.name))return t.name}function _gi(t,e,r,n){let i=t.getTaglines?.()??[],s=t.location,o=w1t(s,n.rootUri),a={name:t.name,kind:"dimension"};if(i.length>0&&(a.annotations=i),o){let l=r0e(s);l&&(a.location=l)}if(t.isExploreField()){let l=t,A=Pxa(l,n.knownSources);if(a.kind="join",a.relationship=vxa(l),A&&(a.source_ref=A),(n.opts.expand==="inline"||!A)&&r<Dxa){let f=l.structDef.fields??[],h=[];for(let g of l.allFields)h.push(_gi(g,f,r+1,n));a.fields=zxa(l,h)}return a}if(t.isQueryField()){let l=t;a.kind="view";let A=l.expression||void 0;if(A&&A!==t.name&&(a.expression=A),o&&s){let p=n.readSource(s.url),f=ygi(p,s);f&&(a.body=f)}return a}let c=t;a.kind=Lxa(c,e),a.type=c.type;let u=c.expression||void 0;return u&&u!==t.name&&(a.expression=u),a}function kxa(t,e){let r=[],n=[],i=[],s=[],o=t.structDef.fields??[];for(let l of t.allFields){let A=_gi(l,o,0,e);switch(A.kind){case"dimension":r.push(A);break;case"measure":n.push(A);break;case"view":i.push(A);break;case"join":s.push(A);break}}let a=t.getTaglines?.()??[],c={name:t.name,dimensions:r,measures:n,views:i,joins:s};a.length>0&&(c.annotations=a);let u=r0e(t.location);return u&&(c.location=u),t.primaryKey&&(c.primaryKey=t.primaryKey),c}function T1t(t){if(!t)return[];let e=[];for(let r of t.blockNotes??[])e.push(r.text);for(let r of t.notes??[])e.push(r.text);return e}async function Fxa(t,e,r,n){let i=new Set([...t.explores.map(p=>p.name),...t.namedQueries.map(p=>p.as??p.name??"")]),s={rootUri:e,knownSources:i,opts:n,readSource:r},o=[];for(let p of t.explores)w1t(p.location,e)&&o.push(kxa(p,s));let a=[];for(let p of t.namedQueries){let f=p.location;if(!w1t(f,e))continue;let h={name:p.as??p.name??""},g=T1t(p.annotation);g.length>0&&(h.annotations=g);let E=r0e(f);E&&(h.location=E);let C=ygi(r(e),f);C&&(h.body=C),a.push(h)}let c=[],u=t._modelDef.queryList??[];for(let p=0;p<u.length;p++){let f=u[p],h={index:p};f.name&&(h.name=f.name);let g=T1t(f.annotation);g.length>0&&(h.annotations=g);let E=r0e(f.location);if(E&&(h.location=E),n.emitRunSql)try{let C=t.getPreparedQueryByIndex(p);h.sql=C.preparedResult.sql.trim()}catch(C){h.error=C instanceof Error?C.message:String(C)}c.push(h)}let l=t.getTaglines?.()??[],A={rootUri:e,sources:o,queries:a,runs:c};return l.length>0&&(A.annotations=l),A}async function u2r(t,e={}){let r=await fOe(t);if(!r.ok||!r.loaded)return{ok:!1,problems:r.problems};let{model:n,rootUrl:i,readSource:s}=r.loaded;try{return{ok:!0,model:await Fxa(n,i.href,s,{expand:e.expand??"ref",emitRunSql:e.emitRunSql??!1}),problems:r.problems}}catch(o){return{ok:!1,problems:[...r.problems,pOe(o,i.href)]}}}async function xgi(t){let e=await fOe(t);if(!e.ok||!e.loaded)return{ok:!1,runs:[],queries:[],problems:e.problems};let{model:r,rootUrl:n}=e.loaded,s=(r._modelDef.queryList??[]).map((a,c)=>{let u={index:c};a.name&&(u.name=a.name);let l=r0e(a.location);l&&(u.location=l);let A=T1t(a.annotation);return A.length>0&&(u.annotations=A),u}),o=r.namedQueries.filter(a=>w1t(a.location,n.href)).map(a=>{let c={name:a.as??a.name??""},u=r0e(a.location);u&&(c.location=u);let l=T1t(a.annotation);return l.length>0&&(c.annotations=l),c});return{ok:!0,rootUri:n.href,runs:s,queries:o,problems:e.problems}}var D1t,Dxa,Bgi=ye(()=>{"use strict";D1t=ut(Ic());c2r();Dxa=4});async function l2r(t,e={}){let r=await fOe(t);if(!r.ok||!r.loaded)return{ok:!1,problems:r.problems.map(a=>Mgi(a,t))};let{model:n,rootUrl:i,runtime:s}=r.loaded,o=n._modelDef.queryList??[];try{let a=s.loadModel(i),c;if(e.name){if(!n.namedQueries.find(b=>(b.as??b.name)===e.name)){let b={queries:n.namedQueries.map(O=>O.as??O.name??""),runs:o.map((O,M)=>({index:M,name:O.name??null}))};return{ok:!1,problems:[{severity:"error",code:"selector-not-found",message:`No query named '${e.name}'. Available: ${JSON.stringify(b)}`,uri:i.href}]}}c=a.loadQueryByName(e.name)}else if(typeof e.index=="number"){if(e.index<0||e.index>=o.length)return{ok:!1,problems:[{severity:"error",code:"selector-out-of-range",message:`Index ${e.index} out of range; file has ${o.length} run: statement(s).`,uri:i.href}]};c=a.loadQueryByIndex(e.index)}else{if(o.length===0)return{ok:!1,problems:[{severity:"error",code:"no-run",message:"Source has no run: statement. Specify a named query via `name`, or add a run: to the source.",uri:i.href}]};c=a.loadFinalQuery()}let u=e.rowLimit??Y8,l=Date.now(),A=(await c.getSQL()).trim(),p=Date.now(),f=await ZE(()=>c.run({rowLimit:u})),h=Date.now(),E=f.toJSON().queryResult.result,C=E.length===u;return{ok:!0,sql:A,rowCount:E.length,truncated:C,rows:E,compileTimeMS:p-l,totalTimeMS:h-l,problems:r.problems}}catch(a){return a instanceof Ogi.MalloyError?{ok:!1,problems:[...r.problems,...dOe(a.problems).map(c=>Mgi(c,t))]}:{ok:!1,problems:[...r.problems,pOe(a,i.href)]}}}function Mgi(t,e){if(t.code!=="field-not-found")return t;let r=e.uri?`Call compile_file with uri="${e.uri}" to see what fields, measures, views, and joins exist on this source.`:"Call compile on the same source (or compile_file on any imported file) to see what fields, measures, views, and joins exist.";return{...t,message:`${t.message} \u2014 ${r}`,help_topic:t.help_topic??"fields"}}var Ogi,Rgi=ye(()=>{"use strict";Ogi=ut(Ic());c2r();K$();IS()});function hOe(t){let{result:e,errors:r}=(0,Sgi.prettify)(t);return{formatted:e,errors:r}}var Sgi,A2r=ye(()=>{"use strict";Sgi=ut(NJ())});var wgi=m((R30,qxa)=>{qxa.exports={name:"@malloydata/cli",version:"0.0.54-next.2026.5.4.1a92a44",description:"Malloy CLI",bin:{"malloy-cli":"dist/index.js","malloy-packages":"scripts/malloy-packages.ts"},files:["dist/**","scripts/malloy-packages.ts"],engines:{node:">=18"},scripts:{lint:"tsc --noEmit && gts lint",test:"NODE_ENV=test jest --projects jest.config.js --runInBand","test-silent":"NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects jest.config.js --runInBand --reporters jest-silent-reporter","test-e2e":"npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test jest --projects=jest-e2e.config.js --runInBand","test-silent-e2e":"npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects=jest-e2e.config.js --runInBand --reporters jest-silent-reporter",build:"ts-node scripts/build","build-action":"esbuild --platform=node --bundle ./.github/actions/permission-check/lib/index.ts --outfile=./.github/actions/permission-check/dist/index.js","build-action-dev":"npm run build-action -- --watch",cli:"npx ts-node ./dist/cli.js",watch:"ts-node scripts/build watch",package:"ts-node scripts/package","package-npm":"ts-node scripts/package-npm","npm-publish":"ts-node scripts/npm-publish",postpack:"npm run build","malloy-update-next":"npm install --no-fund --no-audit --save-exact $(./scripts/malloy-packages.ts next) && ts-node scripts/sync-duckdb.ts && npm install --no-fund --no-audit","malloy-update":"npm install --no-fund --no-audit --save-exact $(./scripts/malloy-packages.ts latest) && ts-node scripts/sync-duckdb.ts && npm install --no-fund --no-audit","malloy-link":"npm --no-fund --no-audit link $(./scripts/malloy-packages.ts)","malloy-unlink":"npm --no-fund --no-save --no-audit unlink $(./scripts/malloy-packages.ts) && npm --no-fund --no-audit install --force"},repository:{type:"git",url:"git+https://github.com/malloydata/malloy-cli.git"},author:"Malloy",license:"MIT",bugs:{url:"https://github.com/malloydata/malloy-cli/issues"},homepage:"https://github.com/malloydata/malloy-cli#readme",builtIntoPackageDependencies:["@malloydata/db-bigquery","@malloydata/db-duckdb","@malloydata/db-mysql","@malloydata/db-postgres","@malloydata/db-snowflake","@malloydata/db-presto","@malloydata/db-trino","@malloydata/malloy","@malloydata/malloy-connections","@malloydata/malloy-sql","chalk","commander","logform","winston"],optionalDependencies:{"@duckdb/node-bindings-darwin-arm64":"1.4.4-r.1","@duckdb/node-bindings-darwin-x64":"1.4.4-r.1","@duckdb/node-bindings-linux-arm64":"1.4.4-r.1","@duckdb/node-bindings-linux-x64":"1.4.4-r.1","@duckdb/node-bindings-win32-x64":"1.4.4-r.1"},devDependencies:{"@actions/core":"^1.11.1","@actions/github":"^6.0.0","@commander-js/extra-typings":"^12.1.0","@duckdb/node-api":"1.4.4-r.1","@duckdb/node-bindings":"1.4.4-r.1","@malloydata/db-bigquery":"0.0.391","@malloydata/db-duckdb":"0.0.391","@malloydata/db-postgres":"0.0.391","@malloydata/db-snowflake":"0.0.391","@malloydata/db-trino":"0.0.391","@malloydata/malloy":"0.0.391","@malloydata/malloy-connections":"0.0.391","@malloydata/malloy-sql":"0.0.391","@types/jest":"^29.2.5","@types/node":"^14.11.2","@typescript-eslint/eslint-plugin":"^5.48.2","@typescript-eslint/parser":"^5.48.2",ajv:"^8.12.0",axios:"^1.4.0",chalk:"^4.0.0",commander:"^12.1.0","csv-stringify":"^6.4.0",esbuild:"0.25.0",eslint:"^8.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0",gts:"^3.1.1",jest:"^29.3.1","jest-silent-reporter":"^0.5.0",logform:"^2.5.1",pkg:"^5.8.1","ts-jest":"^29.1.0","ts-node":"^10.9.1",typescript:"^5.9.3",winston:"^3.9.0"},dependencies:{"@modelcontextprotocol/sdk":"^1.29.0",zod:"^4.3.6"}}});function P4(t){let e={...t};return{content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:e}}async function Ngi(){async function t(){await Gc.shutdown("idle")}let e=new B1t({name:"malloy-cli",version:Uxa.version??"development"},{instructions:Gxa});e.registerTool("compile_file",{title:"Inspect a Malloy file (compile)",description:"PREFER THIS OVER READING A .malloy FILE AS TEXT. Compile a .malloy file at the given URI and return the full structured model: sources (with dimensions, measures, views, joins), named queries, top-level run: statements with their SQL, and annotations. This is the primary way to understand what is in a .malloy file \u2014 what data sources it defines, what can be queried, what the schema looks like \u2014 whether you are about to edit it, answer a question with it, or just explore it. Reading the file as text shows you syntax; compiling it shows you semantics. Joins to named sources render by reference via `source_ref` (look up the referenced source by name in the same response); pass `expand: 'inline'` to get recursive inlined fields instead.",inputSchema:{uri:d2r,expand:Tgi,emit_run_sql:Dgi}},async({uri:i,expand:s,emit_run_sql:o})=>{let a=await u2r({uri:i},{expand:s,emitRunSql:o});return await t(),P4(a)}),e.registerTool("compile",{title:"Compile an inline Malloy source string",description:'Compile a Malloy source string (not backed by a file). Same output shape as compile_file. Use this when drafting new Malloy \u2014 the common pattern is `import "file.malloy"` + a new `run: ...`, which you iterate on against the `problems[]` feedback until clean. The compiler is ground truth; do not guess syntax. When in doubt about what fields / measures / views exist in the imported file, call compile_file on it first.',inputSchema:{source:p2r,base_uri:vgi,expand:Tgi,emit_run_sql:Dgi}},async({source:i,base_uri:s,expand:o,emit_run_sql:a})=>{let c=await u2r({source:i,baseUri:s},{expand:o,emitRunSql:a});return await t(),P4(c)}),e.registerTool("run_file",{title:"Execute a run: from a Malloy file",description:"Execute one run: or named query from a .malloy file against the user's configured connections. Selection: `name` wins if provided, else `index` (0-based into run: statements), else the final run:. Returns the generated SQL and rows (default 10000, set row_limit to override).",inputSchema:{uri:d2r,name:mC.string().optional().describe("Name of a `query:` definition to execute. Wins over `index`."),index:mC.number().int().optional().describe("0-based index into run: statements."),row_limit:mC.number().int().optional().describe("Maximum number of rows to return. Defaults to 10000.")}},async({uri:i,name:s,index:o,row_limit:a})=>{let c=await l2r({uri:i},{name:s,index:o,rowLimit:a});return await t(),P4(c)}),e.registerTool("run",{title:"Execute inline Malloy source",description:"Compile an inline Malloy source and execute its final run: statement against the user's configured connections. Returns the generated SQL and rows (default 10000, set row_limit to override). Use this after compile is clean to see the answer.",inputSchema:{source:p2r,base_uri:vgi,row_limit:mC.number().int().optional().describe("Maximum number of rows to return. Defaults to 10000.")}},async({source:i,base_uri:s,row_limit:o})=>{let a=await l2r({source:i,baseUri:s},{rowLimit:o});return await t(),P4(a)}),e.registerTool("prettify",{title:"Pretty-print Malloy source",description:"Reformat a Malloy source string. Returns the formatted source and any parse errors (lexer + parser only \u2014 semantic errors are not checked here; use `compile` for that). When `errors` is non-empty the formatted output is best-effort and may not round-trip; fix the parse errors first. Useful for cleaning up freshly-authored or machine-generated Malloy before saving.",inputSchema:{source:p2r}},async({source:i})=>P4(hOe(i))),e.registerTool("language_help",{title:"Malloy language reference (by topic)",description:"Look up a section of the Malloy language reference by topic slug or title. Call this before guessing syntax \u2014 especially for pipelines, reduction vs projection, aggregate locality, calculations/window functions, filtered aggregates, pick expressions, time ranges, tags/annotations. Also call this after any compile error whose fix is not obvious from the message \u2014 problems[] entries carry a `help_topic` field when there's a natural match. Call with no topic to list the available topics.",inputSchema:{topic:mC.string().optional().describe("Topic slug or title to look up (case-insensitive; substrings match). Omit to list all available topics.")}},async({topic:i})=>{if(!i)return P4({topics:s2r()});let s=ggi(i);return P4(s?{slug:s.slug,title:s.title,body:s.body}:{error:`No topic matches '${i}'.`,topics:s2r()})}),e.registerTool("list_runs",{title:"List runnable queries in a Malloy file",description:"Lightweight discovery: return the runnable run: statements (with optional names and indexes) and named `query:` definitions in a file, without serializing the full model. Use this when you only need to know what can be executed; if you need to understand the schema (sources, measures, views, joins), use compile_file instead.",inputSchema:{uri:d2r}},async({uri:i})=>{let s=await xgi({uri:i});return await t(),P4(s)});let r=pgi(R1t());for(let i of r)e.registerPrompt(i.name,{title:i.name,description:i.description},()=>({messages:[{role:"user",content:{type:"text",text:i.body}}]})),e.registerResource(i.name,`malloy-skill://${i.name}`,{title:i.name,description:i.description,mimeType:"text/markdown"},async s=>({contents:[{uri:s.href,mimeType:"text/markdown",text:i.body}]}));let n=new O1t;await e.connect(n)}var Uxa,Tgi,Dgi,d2r,p2r,vgi,Gxa,Qgi=ye(()=>{"use strict";ugi();dgi();ZEr();Bgi();Rgi();o2r();r2r();MD();A2r();Uxa=wgi(),Tgi=mC.enum(["ref","inline"]).optional().describe("How to render joins in the model output. 'ref' (default) references joined sources by name via `source_ref`. 'inline' recursively inlines the joined source schema (larger output, useful when the client cannot cross-reference)."),Dgi=mC.boolean().optional().describe("If true, compile each run: statement to SQL and include it as `model.runs[].sql`. Default false because run SQL is typically large and is not needed while inspecting the schema. Use run_file to execute a run: and get both SQL and rows."),d2r=mC.string().describe("File URI (file://...) or bare filesystem path. Relative paths resolve against the server's working directory."),p2r=mC.string().describe("Malloy source code."),vgi=mC.string().optional().describe("Optional URI used to resolve relative imports in the inline source. Typically the file:// URI of the file the snippet will live next to. If omitted, imports must be absolute.");Gxa=`
|
|
4481
|
+
`)}function vxa(t){let e=t.structDef.join;return e==="one"||e==="many"||e==="cross"?e:"one"}function bgi(t){let e=t.structDef;return e.type==="array"&&e.elementTypeDef?.type!=="record_element"}function Nxa(t){let e=t.structDef;return e.type==="array"&&e.elementTypeDef?.type==="record_element"}function Qxa(t){return t.structDef.type==="record"}function zxa(t,e){return bgi(t)?e.filter(r=>r.name!=="value"):e}function Lxa(t,e){let n=e.find(i=>i.name===t.name)?.expressionType;return n&&((0,D1t.expressionIsAggregate)(n)||(0,D1t.expressionIsAnalytic)(n))?"measure":"dimension"}function Pxa(t,e){if(bgi(t)||Nxa(t)||Qxa(t))return;let r=t.structDef;if(r.sourceID){let n=r.sourceID.split("@")[0];if(n&&e.has(n))return n}if(r.name&&e.has(r.name))return r.name;if(e.has(t.name))return t.name}function _gi(t,e,r,n){let i=t.getTaglines?.()??[],s=t.location,o=w1t(s,n.rootUri),a={name:t.name,kind:"dimension"};if(i.length>0&&(a.annotations=i),o){let l=r0e(s);l&&(a.location=l)}if(t.isExploreField()){let l=t,A=Pxa(l,n.knownSources);if(a.kind="join",a.relationship=vxa(l),A&&(a.source_ref=A),(n.opts.expand==="inline"||!A)&&r<Dxa){let f=l.structDef.fields??[],h=[];for(let g of l.allFields)h.push(_gi(g,f,r+1,n));a.fields=zxa(l,h)}return a}if(t.isQueryField()){let l=t;a.kind="view";let A=l.expression||void 0;if(A&&A!==t.name&&(a.expression=A),o&&s){let p=n.readSource(s.url),f=ygi(p,s);f&&(a.body=f)}return a}let c=t;a.kind=Lxa(c,e),a.type=c.type;let u=c.expression||void 0;return u&&u!==t.name&&(a.expression=u),a}function kxa(t,e){let r=[],n=[],i=[],s=[],o=t.structDef.fields??[];for(let l of t.allFields){let A=_gi(l,o,0,e);switch(A.kind){case"dimension":r.push(A);break;case"measure":n.push(A);break;case"view":i.push(A);break;case"join":s.push(A);break}}let a=t.getTaglines?.()??[],c={name:t.name,dimensions:r,measures:n,views:i,joins:s};a.length>0&&(c.annotations=a);let u=r0e(t.location);return u&&(c.location=u),t.primaryKey&&(c.primaryKey=t.primaryKey),c}function T1t(t){if(!t)return[];let e=[];for(let r of t.blockNotes??[])e.push(r.text);for(let r of t.notes??[])e.push(r.text);return e}async function Fxa(t,e,r,n){let i=new Set([...t.explores.map(p=>p.name),...t.namedQueries.map(p=>p.as??p.name??"")]),s={rootUri:e,knownSources:i,opts:n,readSource:r},o=[];for(let p of t.explores)w1t(p.location,e)&&o.push(kxa(p,s));let a=[];for(let p of t.namedQueries){let f=p.location;if(!w1t(f,e))continue;let h={name:p.as??p.name??""},g=T1t(p.annotation);g.length>0&&(h.annotations=g);let E=r0e(f);E&&(h.location=E);let C=ygi(r(e),f);C&&(h.body=C),a.push(h)}let c=[],u=t._modelDef.queryList??[];for(let p=0;p<u.length;p++){let f=u[p],h={index:p};f.name&&(h.name=f.name);let g=T1t(f.annotation);g.length>0&&(h.annotations=g);let E=r0e(f.location);if(E&&(h.location=E),n.emitRunSql)try{let C=t.getPreparedQueryByIndex(p);h.sql=C.preparedResult.sql.trim()}catch(C){h.error=C instanceof Error?C.message:String(C)}c.push(h)}let l=t.getTaglines?.()??[],A={rootUri:e,sources:o,queries:a,runs:c};return l.length>0&&(A.annotations=l),A}async function u2r(t,e={}){let r=await fOe(t);if(!r.ok||!r.loaded)return{ok:!1,problems:r.problems};let{model:n,rootUrl:i,readSource:s}=r.loaded;try{return{ok:!0,model:await Fxa(n,i.href,s,{expand:e.expand??"ref",emitRunSql:e.emitRunSql??!1}),problems:r.problems}}catch(o){return{ok:!1,problems:[...r.problems,pOe(o,i.href)]}}}async function xgi(t){let e=await fOe(t);if(!e.ok||!e.loaded)return{ok:!1,runs:[],queries:[],problems:e.problems};let{model:r,rootUrl:n}=e.loaded,s=(r._modelDef.queryList??[]).map((a,c)=>{let u={index:c};a.name&&(u.name=a.name);let l=r0e(a.location);l&&(u.location=l);let A=T1t(a.annotation);return A.length>0&&(u.annotations=A),u}),o=r.namedQueries.filter(a=>w1t(a.location,n.href)).map(a=>{let c={name:a.as??a.name??""},u=r0e(a.location);u&&(c.location=u);let l=T1t(a.annotation);return l.length>0&&(c.annotations=l),c});return{ok:!0,rootUri:n.href,runs:s,queries:o,problems:e.problems}}var D1t,Dxa,Bgi=ye(()=>{"use strict";D1t=ut(Ic());c2r();Dxa=4});async function l2r(t,e={}){let r=await fOe(t);if(!r.ok||!r.loaded)return{ok:!1,problems:r.problems.map(a=>Mgi(a,t))};let{model:n,rootUrl:i,runtime:s}=r.loaded,o=n._modelDef.queryList??[];try{let a=s.loadModel(i),c;if(e.name){if(!n.namedQueries.find(b=>(b.as??b.name)===e.name)){let b={queries:n.namedQueries.map(O=>O.as??O.name??""),runs:o.map((O,M)=>({index:M,name:O.name??null}))};return{ok:!1,problems:[{severity:"error",code:"selector-not-found",message:`No query named '${e.name}'. Available: ${JSON.stringify(b)}`,uri:i.href}]}}c=a.loadQueryByName(e.name)}else if(typeof e.index=="number"){if(e.index<0||e.index>=o.length)return{ok:!1,problems:[{severity:"error",code:"selector-out-of-range",message:`Index ${e.index} out of range; file has ${o.length} run: statement(s).`,uri:i.href}]};c=a.loadQueryByIndex(e.index)}else{if(o.length===0)return{ok:!1,problems:[{severity:"error",code:"no-run",message:"Source has no run: statement. Specify a named query via `name`, or add a run: to the source.",uri:i.href}]};c=a.loadFinalQuery()}let u=e.rowLimit??Y8,l=Date.now(),A=(await c.getSQL()).trim(),p=Date.now(),f=await ZE(()=>c.run({rowLimit:u})),h=Date.now(),E=f.toJSON().queryResult.result,C=E.length===u;return{ok:!0,sql:A,rowCount:E.length,truncated:C,rows:E,compileTimeMS:p-l,totalTimeMS:h-l,problems:r.problems}}catch(a){return a instanceof Ogi.MalloyError?{ok:!1,problems:[...r.problems,...dOe(a.problems).map(c=>Mgi(c,t))]}:{ok:!1,problems:[...r.problems,pOe(a,i.href)]}}}function Mgi(t,e){if(t.code!=="field-not-found")return t;let r=e.uri?`Call compile_file with uri="${e.uri}" to see what fields, measures, views, and joins exist on this source.`:"Call compile on the same source (or compile_file on any imported file) to see what fields, measures, views, and joins exist.";return{...t,message:`${t.message} \u2014 ${r}`,help_topic:t.help_topic??"fields"}}var Ogi,Rgi=ye(()=>{"use strict";Ogi=ut(Ic());c2r();K$();IS()});function hOe(t){let{result:e,errors:r}=(0,Sgi.prettify)(t);return{formatted:e,errors:r}}var Sgi,A2r=ye(()=>{"use strict";Sgi=ut(NJ())});var wgi=m((R30,qxa)=>{qxa.exports={name:"@malloydata/cli",version:"0.0.54-next.2026.5.4.8d18d45",description:"Malloy CLI",bin:{"malloy-cli":"dist/index.js","malloy-packages":"scripts/malloy-packages.ts"},files:["dist/**","scripts/malloy-packages.ts"],engines:{node:">=18"},scripts:{lint:"tsc --noEmit && gts lint",test:"NODE_ENV=test jest --projects jest.config.js --runInBand","test-silent":"NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects jest.config.js --runInBand --reporters jest-silent-reporter","test-e2e":"npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test jest --projects=jest-e2e.config.js --runInBand","test-silent-e2e":"npm run package-npm test > /dev/null 2>&1 && NODE_ENV=test JEST_SILENT_REPORTER_SHOW_PATHS=true jest --projects=jest-e2e.config.js --runInBand --reporters jest-silent-reporter",build:"ts-node scripts/build","build-action":"esbuild --platform=node --bundle ./.github/actions/permission-check/lib/index.ts --outfile=./.github/actions/permission-check/dist/index.js","build-action-dev":"npm run build-action -- --watch",cli:"npx ts-node ./dist/cli.js",watch:"ts-node scripts/build watch",package:"ts-node scripts/package","package-npm":"ts-node scripts/package-npm","npm-publish":"ts-node scripts/npm-publish",postpack:"npm run build","malloy-update-next":"npm install --no-fund --no-audit --save-exact $(./scripts/malloy-packages.ts next) && ts-node scripts/sync-duckdb.ts && npm install --no-fund --no-audit","malloy-update":"npm install --no-fund --no-audit --save-exact $(./scripts/malloy-packages.ts latest) && ts-node scripts/sync-duckdb.ts && npm install --no-fund --no-audit","malloy-link":"npm --no-fund --no-audit link $(./scripts/malloy-packages.ts)","malloy-unlink":"npm --no-fund --no-save --no-audit unlink $(./scripts/malloy-packages.ts) && npm --no-fund --no-audit install --force"},repository:{type:"git",url:"git+https://github.com/malloydata/malloy-cli.git"},author:"Malloy",license:"MIT",bugs:{url:"https://github.com/malloydata/malloy-cli/issues"},homepage:"https://github.com/malloydata/malloy-cli#readme",builtIntoPackageDependencies:["@malloydata/db-bigquery","@malloydata/db-duckdb","@malloydata/db-mysql","@malloydata/db-postgres","@malloydata/db-snowflake","@malloydata/db-presto","@malloydata/db-trino","@malloydata/malloy","@malloydata/malloy-connections","@malloydata/malloy-sql","chalk","commander","logform","winston"],optionalDependencies:{"@duckdb/node-bindings-darwin-arm64":"1.4.4-r.1","@duckdb/node-bindings-darwin-x64":"1.4.4-r.1","@duckdb/node-bindings-linux-arm64":"1.4.4-r.1","@duckdb/node-bindings-linux-x64":"1.4.4-r.1","@duckdb/node-bindings-win32-x64":"1.4.4-r.1"},devDependencies:{"@actions/core":"^1.11.1","@actions/github":"^6.0.0","@commander-js/extra-typings":"^12.1.0","@duckdb/node-api":"1.4.4-r.1","@duckdb/node-bindings":"1.4.4-r.1","@malloydata/db-bigquery":"0.0.391","@malloydata/db-duckdb":"0.0.391","@malloydata/db-postgres":"0.0.391","@malloydata/db-snowflake":"0.0.391","@malloydata/db-trino":"0.0.391","@malloydata/malloy":"0.0.391","@malloydata/malloy-connections":"0.0.391","@malloydata/malloy-sql":"0.0.391","@types/jest":"^29.2.5","@types/node":"^14.11.2","@typescript-eslint/eslint-plugin":"^5.48.2","@typescript-eslint/parser":"^5.48.2",ajv:"^8.12.0",axios:"^1.4.0",chalk:"^4.0.0",commander:"^12.1.0","csv-stringify":"^6.4.0",esbuild:"0.25.0",eslint:"^8.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0",gts:"^3.1.1",jest:"^29.3.1","jest-silent-reporter":"^0.5.0",logform:"^2.5.1",pkg:"^5.8.1","ts-jest":"^29.1.0","ts-node":"^10.9.1",typescript:"^5.9.3",winston:"^3.9.0"},dependencies:{"@modelcontextprotocol/sdk":"^1.29.0",zod:"^4.3.6"}}});function P4(t){let e={...t};return{content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:e}}async function Ngi(){async function t(){await Gc.shutdown("idle")}let e=new B1t({name:"malloy-cli",version:Uxa.version??"development"},{instructions:Gxa});e.registerTool("compile_file",{title:"Inspect a Malloy file (compile)",description:"PREFER THIS OVER READING A .malloy FILE AS TEXT. Compile a .malloy file at the given URI and return the full structured model: sources (with dimensions, measures, views, joins), named queries, top-level run: statements with their SQL, and annotations. This is the primary way to understand what is in a .malloy file \u2014 what data sources it defines, what can be queried, what the schema looks like \u2014 whether you are about to edit it, answer a question with it, or just explore it. Reading the file as text shows you syntax; compiling it shows you semantics. Joins to named sources render by reference via `source_ref` (look up the referenced source by name in the same response); pass `expand: 'inline'` to get recursive inlined fields instead.",inputSchema:{uri:d2r,expand:Tgi,emit_run_sql:Dgi}},async({uri:i,expand:s,emit_run_sql:o})=>{let a=await u2r({uri:i},{expand:s,emitRunSql:o});return await t(),P4(a)}),e.registerTool("compile",{title:"Compile an inline Malloy source string",description:'Compile a Malloy source string (not backed by a file). Same output shape as compile_file. Use this when drafting new Malloy \u2014 the common pattern is `import "file.malloy"` + a new `run: ...`, which you iterate on against the `problems[]` feedback until clean. The compiler is ground truth; do not guess syntax. When in doubt about what fields / measures / views exist in the imported file, call compile_file on it first.',inputSchema:{source:p2r,base_uri:vgi,expand:Tgi,emit_run_sql:Dgi}},async({source:i,base_uri:s,expand:o,emit_run_sql:a})=>{let c=await u2r({source:i,baseUri:s},{expand:o,emitRunSql:a});return await t(),P4(c)}),e.registerTool("run_file",{title:"Execute a run: from a Malloy file",description:"Execute one run: or named query from a .malloy file against the user's configured connections. Selection: `name` wins if provided, else `index` (0-based into run: statements), else the final run:. Returns the generated SQL and rows (default 10000, set row_limit to override).",inputSchema:{uri:d2r,name:mC.string().optional().describe("Name of a `query:` definition to execute. Wins over `index`."),index:mC.number().int().optional().describe("0-based index into run: statements."),row_limit:mC.number().int().optional().describe("Maximum number of rows to return. Defaults to 10000.")}},async({uri:i,name:s,index:o,row_limit:a})=>{let c=await l2r({uri:i},{name:s,index:o,rowLimit:a});return await t(),P4(c)}),e.registerTool("run",{title:"Execute inline Malloy source",description:"Compile an inline Malloy source and execute its final run: statement against the user's configured connections. Returns the generated SQL and rows (default 10000, set row_limit to override). Use this after compile is clean to see the answer.",inputSchema:{source:p2r,base_uri:vgi,row_limit:mC.number().int().optional().describe("Maximum number of rows to return. Defaults to 10000.")}},async({source:i,base_uri:s,row_limit:o})=>{let a=await l2r({source:i,baseUri:s},{rowLimit:o});return await t(),P4(a)}),e.registerTool("prettify",{title:"Pretty-print Malloy source",description:"Reformat a Malloy source string. Returns the formatted source and any parse errors (lexer + parser only \u2014 semantic errors are not checked here; use `compile` for that). When `errors` is non-empty the formatted output is best-effort and may not round-trip; fix the parse errors first. Useful for cleaning up freshly-authored or machine-generated Malloy before saving.",inputSchema:{source:p2r}},async({source:i})=>P4(hOe(i))),e.registerTool("language_help",{title:"Malloy language reference (by topic)",description:"Look up a section of the Malloy language reference by topic slug or title. Call this before guessing syntax \u2014 especially for pipelines, reduction vs projection, aggregate locality, calculations/window functions, filtered aggregates, pick expressions, time ranges, tags/annotations. Also call this after any compile error whose fix is not obvious from the message \u2014 problems[] entries carry a `help_topic` field when there's a natural match. Call with no topic to list the available topics.",inputSchema:{topic:mC.string().optional().describe("Topic slug or title to look up (case-insensitive; substrings match). Omit to list all available topics.")}},async({topic:i})=>{if(!i)return P4({topics:s2r()});let s=ggi(i);return P4(s?{slug:s.slug,title:s.title,body:s.body}:{error:`No topic matches '${i}'.`,topics:s2r()})}),e.registerTool("list_runs",{title:"List runnable queries in a Malloy file",description:"Lightweight discovery: return the runnable run: statements (with optional names and indexes) and named `query:` definitions in a file, without serializing the full model. Use this when you only need to know what can be executed; if you need to understand the schema (sources, measures, views, joins), use compile_file instead.",inputSchema:{uri:d2r}},async({uri:i})=>{let s=await xgi({uri:i});return await t(),P4(s)});let r=pgi(R1t());for(let i of r)e.registerPrompt(i.name,{title:i.name,description:i.description},()=>({messages:[{role:"user",content:{type:"text",text:i.body}}]})),e.registerResource(i.name,`malloy-skill://${i.name}`,{title:i.name,description:i.description,mimeType:"text/markdown"},async s=>({contents:[{uri:s.href,mimeType:"text/markdown",text:i.body}]}));let n=new O1t;await e.connect(n)}var Uxa,Tgi,Dgi,d2r,p2r,vgi,Gxa,Qgi=ye(()=>{"use strict";ugi();dgi();ZEr();Bgi();Rgi();o2r();r2r();MD();A2r();Uxa=wgi(),Tgi=mC.enum(["ref","inline"]).optional().describe("How to render joins in the model output. 'ref' (default) references joined sources by name via `source_ref`. 'inline' recursively inlines the joined source schema (larger output, useful when the client cannot cross-reference)."),Dgi=mC.boolean().optional().describe("If true, compile each run: statement to SQL and include it as `model.runs[].sql`. Default false because run SQL is typically large and is not needed while inspecting the schema. Use run_file to execute a run: and get both SQL and rows."),d2r=mC.string().describe("File URI (file://...) or bare filesystem path. Relative paths resolve against the server's working directory."),p2r=mC.string().describe("Malloy source code."),vgi=mC.string().optional().describe("Optional URI used to resolve relative imports in the inline source. Typically the file:// URI of the file the snippet will live next to. If omitted, imports must be absolute.");Gxa=`
|
|
4482
4482
|
This server lets an agent inspect, author, and execute Malloy semantic models.
|
|
4483
4483
|
|
|
4484
4484
|
Malloy (.malloy) files are NOT plain text you should read for comprehension.
|
package/dist/index.js
CHANGED