@anthropic-ai/claude-agent-sdk
Version:
SDK for building AI agents with Claude Code's capabilities. Programmatically interact with Claude to build autonomous agents that can understand codebases, edit files, and execute workflows.
113 lines • 1.18 MB
JavaScript
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
// Version: 0.3.185
var F8=Object.create;var{getPrototypeOf:B8,defineProperty:fa,getOwnPropertyNames:__,getOwnPropertyDescriptor:H8}=Object,w_=Object.prototype.hasOwnProperty;function S_(e){return this[e]}var Z8,K8,x_=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?Z8??=new WeakMap:K8??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?F8(B8(e)):{};let s=t||!e||!e.__esModule?fa(r,"default",{value:e,enumerable:!0}):r;for(let h of __(e))if(!w_.call(s,h))fa(s,h,{get:S_.bind(e,h),enumerable:!0});if(i)n.set(e,s);return s},xt=(e)=>{var t=(b_??=new WeakMap).get(e),r;if(t)return t;if(t=fa({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of __(e))if(!w_.call(t,i))fa(t,i,{get:S_.bind(e,i),enumerable:!(r=H8(e,i))||r.enumerable})}return b_.set(e,t),t},b_,Je=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var V8=(e)=>e;function W8(e,t){this[e]=V8.bind(null,t)}var vn=(e,t)=>{for(var r in t)fa(e,r,{get:t[r],enumerable:!0,configurable:!0,set:W8.bind(t,r)})};var ha=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ii=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),G8=Symbol.dispose||Symbol.for("Symbol.dispose"),J8=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Bt=(e,t,r)=>{if(t!=null){if(typeof t!=="object"&&typeof t!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var i;if(r)i=t[J8];if(i===void 0)i=t[G8];if(typeof i!=="function")throw TypeError("Object not disposable");e.push([r,i,t])}else if(r)e.push([r]);return t},Ht=(e,t,r)=>{var i=typeof SuppressedError==="function"?SuppressedError:function(s,h,b,v){return v=Error(b),v.name="SuppressedError",v.error=s,v.suppressed=h,v},n=(s)=>t=r?new i(s,t,"An error was suppressed during disposal"):(r=!0,s),o=(s)=>{while(s=e.pop())try{var h=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(h).then(o,(b)=>(n(b),o()))}catch(b){n(b)}if(r)throw t};return o()};var Er={};vn(Er,{transcode:()=>KI,resolveObjectURL:()=>BI,kStringMaxLength:()=>d1,kMaxLength:()=>ga,isUtf8:()=>HI,isAscii:()=>ZI,default:()=>VI,constants:()=>yI,btoa:()=>hI,atob:()=>pI,INSPECT_MAX_BYTES:()=>c1,File:()=>mI,Buffer:()=>fe,Blob:()=>gI});function uI(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");if(r===-1)r=t;var i=r===t?0:4-r%4;return[r,i]}function lI(e,t){return(e+t)*3/4-t}function cI(e){var t,r=uI(e),i=r[0],n=r[1],o=new Uint8Array(lI(i,n)),s=0,h=n>0?i-4:i,b;for(b=0;b<h;b+=4)t=_n[e.charCodeAt(b)]<<18|_n[e.charCodeAt(b+1)]<<12|_n[e.charCodeAt(b+2)]<<6|_n[e.charCodeAt(b+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;if(n===2)t=_n[e.charCodeAt(b)]<<2|_n[e.charCodeAt(b+1)]>>4,o[s++]=t&255;if(n===1)t=_n[e.charCodeAt(b)]<<10|_n[e.charCodeAt(b+1)]<<4|_n[e.charCodeAt(b+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255;return o}function dI(e){return Vn[e>>18&63]+Vn[e>>12&63]+Vn[e>>6&63]+Vn[e&63]}function fI(e,t,r){var i,n=[];for(var o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(dI(i));return n.join("")}function i1(e){var t,r=e.length,i=r%3,n=[],o=16383;for(var s=0,h=r-i;s<h;s+=o)n.push(fI(e,s,s+o>h?h:s+o));if(i===1)t=e[r-1],n.push(Vn[t>>2]+Vn[t<<4&63]+"==");else if(i===2)t=(e[r-2]<<8)+e[r-1],n.push(Vn[t>>10]+Vn[t>>4&63]+Vn[t<<2&63]+"=");return n.join("")}function Mc(e,t,r,i,n){var o,s,h=n*8-i-1,b=(1<<h)-1,v=b>>1,_=-7,g=r?n-1:0,S=r?-1:1,x=e[t+g];g+=S,o=x&(1<<-_)-1,x>>=-_,_+=h;for(;_>0;o=o*256+e[t+g],g+=S,_-=8);s=o&(1<<-_)-1,o>>=-_,_+=i;for(;_>0;s=s*256+e[t+g],g+=S,_-=8);if(o===0)o=1-v;else if(o===b)return s?NaN:(x?-1:1)*(1/0);else s=s+Math.pow(2,i),o=o-v;return(x?-1:1)*s*Math.pow(2,o-i)}function l1(e,t,r,i,n,o){var s,h,b,v=o*8-n-1,_=(1<<v)-1,g=_>>1,S=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,M=i?1:-1,I=t<0||t===0&&1/t<0?1:0;if(t=Math.abs(t),isNaN(t)||t===1/0)h=isNaN(t)?1:0,s=_;else{if(s=Math.floor(Math.log(t)/Math.LN2),t*(b=Math.pow(2,-s))<1)s--,b*=2;if(s+g>=1)t+=S/b;else t+=S*Math.pow(2,1-g);if(t*b>=2)s++,b/=2;if(s+g>=_)h=0,s=_;else if(s+g>=1)h=(t*b-1)*Math.pow(2,n),s=s+g;else h=t*Math.pow(2,g-1)*Math.pow(2,n),s=0}for(;n>=8;e[r+x]=h&255,x+=M,h/=256,n-=8);s=s<<n|h,v+=n;for(;v>0;e[r+x]=s&255,x+=M,s/=256,v-=8);e[r+x-M]|=I*128}function ni(e){if(e>ga)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,fe.prototype),t}function nm(e,t,r){return class extends r{constructor(){super();Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function fe(e,t,r){if(typeof e==="number"){if(typeof t==="string")throw TypeError('The "string" argument must be of type string. Received type number');return im(e)}return f1(e,t,r)}function f1(e,t,r){if(typeof e==="string")return wI(e,t);if(ArrayBuffer.isView(e))return SI(e);if(e==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Wn(e,ArrayBuffer)||e&&Wn(e.buffer,ArrayBuffer))return tm(e,t,r);if(typeof SharedArrayBuffer<"u"&&(Wn(e,SharedArrayBuffer)||e&&Wn(e.buffer,SharedArrayBuffer)))return tm(e,t,r);if(typeof e==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return fe.from(i,t,r);let n=xI(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==="function")return fe.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h1(e){if(typeof e!=="number")throw TypeError('"size" argument must be of type number');else if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function _I(e,t,r){if(h1(e),e<=0)return ni(e);if(t!==void 0)return typeof r==="string"?ni(e).fill(t,r):ni(e).fill(t);return ni(e)}function im(e){return h1(e),ni(e<0?0:om(e)|0)}function wI(e,t){if(typeof t!=="string"||t==="")t="utf8";if(!fe.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=p1(e,t)|0,i=ni(r),n=i.write(e,t);if(n!==r)i=i.slice(0,n);return i}function em(e){let t=e.length<0?0:om(e.length)|0,r=ni(t);for(let i=0;i<t;i+=1)r[i]=e[i]&255;return r}function SI(e){if(Wn(e,Uint8Array)){let t=new Uint8Array(e);return tm(t.buffer,t.byteOffset,t.byteLength)}return em(e)}function tm(e,t,r){if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');let i;if(t===void 0&&r===void 0)i=new Uint8Array(e);else if(r===void 0)i=new Uint8Array(e,t);else i=new Uint8Array(e,t,r);return Object.setPrototypeOf(i,fe.prototype),i}function xI(e){if(fe.isBuffer(e)){let t=om(e.length)|0,r=ni(t);if(r.length===0)return r;return e.copy(r,0,0,t),r}if(e.length!==void 0){if(typeof e.length!=="number"||Number.isNaN(e.length))return ni(0);return em(e)}if(e.type==="Buffer"&&Array.isArray(e.data))return em(e.data)}function om(e){if(e>=ga)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ga.toString(16)+" bytes");return e|0}function p1(e,t){if(fe.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Wn(e,ArrayBuffer))return e.byteLength;if(typeof e!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return rm(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return x1(e).length;default:if(n)return i?-1:rm(e).length;t=(""+t).toLowerCase(),n=!0}}function kI(e,t,r){let i=!1;if(t===void 0||t<0)t=0;if(t>this.length)return"";if(r===void 0||r>this.length)r=this.length;if(r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";if(!e)e="utf8";while(!0)switch(e){case"hex":return OI(this,t,r);case"utf8":case"utf-8":return g1(this,t,r);case"ascii":return RI(this,t,r);case"latin1":case"binary":return CI(this,t,r);case"base64":return PI(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return NI(this,t,r);default:if(i)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function lo(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function m1(e,t,r,i,n){if(e.length===0)return-1;if(typeof r==="string")i=r,r=0;else if(r>2147483647)r=2147483647;else if(r<-2147483648)r=-2147483648;if(r=+r,Number.isNaN(r))r=n?0:e.length-1;if(r<0)r=e.length+r;if(r>=e.length)if(n)return-1;else r=e.length-1;else if(r<0)if(n)r=0;else return-1;if(typeof t==="string")t=fe.from(t,i);if(fe.isBuffer(t)){if(t.length===0)return-1;return s1(e,t,r,i,n)}else if(typeof t==="number"){if(t=t&255,typeof Uint8Array.prototype.indexOf==="function")if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return s1(e,[t],r,i,n)}throw TypeError("val must be string, number or Buffer")}function s1(e,t,r,i,n){let o=1,s=e.length,h=t.length;if(i!==void 0){if(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le"){if(e.length<2||t.length<2)return-1;o=2,s/=2,h/=2,r/=2}}function b(_,g){if(o===1)return _[g];else return _.readUInt16BE(g*o)}let v;if(n){let _=-1;for(v=r;v<s;v++)if(b(e,v)===b(t,_===-1?0:v-_)){if(_===-1)_=v;if(v-_+1===h)return _*o}else{if(_!==-1)v-=v-_;_=-1}}else{if(r+h>s)r=s-h;for(v=r;v>=0;v--){let _=!0;for(let g=0;g<h;g++)if(b(e,v+g)!==b(t,g)){_=!1;break}if(_)return v}}return-1}function MI(e,t,r,i){r=Number(r)||0;let n=e.length-r;if(!i)i=n;else if(i=Number(i),i>n)i=n;let o=t.length;if(i>o/2)i=o/2;let s;for(s=0;s<i;++s){let h=parseInt(t.substr(s*2,2),16);if(Number.isNaN(h))return s;e[r+s]=h}return s}function EI(e,t,r,i){return Ec(rm(t,e.length-r),e,r,i)}function II(e,t,r,i){return Ec(UI(t),e,r,i)}function TI(e,t,r,i){return Ec(x1(t),e,r,i)}function $I(e,t,r,i){return Ec(LI(t,e.length-r),e,r,i)}function PI(e,t,r){if(t===0&&r===e.length)return i1(e);else return i1(e.slice(t,r))}function g1(e,t,r){r=Math.min(e.length,r);let i=[],n=t;while(n<r){let o=e[n],s=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h<=r){let b,v,_,g;switch(h){case 1:if(o<128)s=o;break;case 2:if(b=e[n+1],(b&192)===128){if(g=(o&31)<<6|b&63,g>127)s=g}break;case 3:if(b=e[n+1],v=e[n+2],(b&192)===128&&(v&192)===128){if(g=(o&15)<<12|(b&63)<<6|v&63,g>2047&&(g<55296||g>57343))s=g}break;case 4:if(b=e[n+1],v=e[n+2],_=e[n+3],(b&192)===128&&(v&192)===128&&(_&192)===128){if(g=(o&15)<<18|(b&63)<<12|(v&63)<<6|_&63,g>65535&&g<1114112)s=g}}}if(s===null)s=65533,h=1;else if(s>65535)s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023;i.push(s),n+=h}return AI(i)}function AI(e){let t=e.length;if(t<=a1)return String.fromCharCode.apply(String,e);let r="",i=0;while(i<t)r+=String.fromCharCode.apply(String,e.slice(i,i+=a1));return r}function RI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]&127);return i}function CI(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function OI(e,t,r){let i=e.length;if(!t||t<0)t=0;if(!r||r<0||r>i)r=i;let n="";for(let o=t;o<r;++o)n+=qI[e[o]];return n}function NI(e,t,r){let i=e.slice(t,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}function Mr(e,t,r){if(e%1!==0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function Jr(e,t,r,i,n,o){if(!fe.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw RangeError('"value" argument is out of bounds');if(r+i>e.length)throw RangeError("Index out of range")}function y1(e,t,r,i,n){S1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function v1(e,t,r,i,n){S1(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}function b1(e,t,r,i,n,o){if(r+i>e.length)throw RangeError("Index out of range");if(r<0)throw RangeError("Index out of range")}function _1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)b1(e,t,r,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return l1(e,t,r,i,23,4),r+4}function w1(e,t,r,i,n){if(t=+t,r=r>>>0,!n)b1(e,t,r,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return l1(e,t,r,i,52,8),r+8}function u1(e){let t="",r=e.length,i=e[0]==="-"?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function DI(e,t,r){if(ts(t,"offset"),e[t]===void 0||e[t+r]===void 0)ya(t,e.length-(r+1))}function S1(e,t,r,i,n,o){if(e>r||e<t){let s=typeof t==="bigint"?"n":"",h;if(o>3)if(t===0||t===BigInt(0))h=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`;else h=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`;else h=`>= ${t}${s} and <= ${r}${s}`;throw new Qp("value",h,e)}DI(i,n,o)}function ts(e,t){if(typeof e!=="number")throw new bI(t,"number",e)}function ya(e,t,r){if(Math.floor(e)!==e)throw ts(e,r),new Qp(r||"offset","an integer",e);if(t<0)throw new vI;throw new Qp(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}function jI(e){if(e=e.split("=")[0],e=e.trim().replace(zI,""),e.length<2)return"";while(e.length%4!==0)e=e+"=";return e}function rm(e,t){t=t||1/0;let r,i=e.length,n=null,o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)o.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);n=r;continue}r=(n-55296<<10|r-56320)+65536}else if(n){if((t-=3)>-1)o.push(239,191,189)}if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw Error("Invalid code point")}return o}function UI(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function LI(e,t){let r,i,n,o=[];for(let s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i)}return o}function x1(e){return cI(jI(e))}function Ec(e,t,r,i){let n;for(n=0;n<i;++n){if(n+r>=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function Wn(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Pi(e){return typeof BigInt>"u"?FI:e}function FI(){throw Error("BigInt not supported")}function sm(e){return()=>{throw Error(e+" is not implemented for node:buffer browser polyfill")}}var Vn,_n,Yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uo,n1,o1,c1=50,ga=2147483647,d1=536870888,hI,pI,mI,gI,yI,vI,bI,Qp,a1=4096,zI,qI,BI,HI,ZI=(e)=>{for(let t of e)if(t.charCodeAt(0)>127)return!1;return!0},KI,VI;var Ir=ha(()=>{Vn=[],_n=[];for(uo=0,n1=Yp.length;uo<n1;++uo)Vn[uo]=Yp[uo],_n[Yp.charCodeAt(uo)]=uo;_n[45]=62;_n[95]=63;o1=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,hI=globalThis.btoa,pI=globalThis.atob,mI=globalThis.File,gI=globalThis.Blob,yI={MAX_LENGTH:ga,MAX_STRING_LENGTH:d1};vI=nm("ERR_BUFFER_OUT_OF_BOUNDS",function(e){if(e)return`${e} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),bI=nm("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),Qp=nm("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;if(Number.isInteger(r)&&Math.abs(r)>4294967296)n=u1(String(r));else if(typeof r==="bigint"){if(n=String(r),r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))n=u1(n);n+="n"}return i+=` It must be ${t}. Received ${n}`,i},RangeError);Object.defineProperty(fe.prototype,"parent",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.buffer}});Object.defineProperty(fe.prototype,"offset",{enumerable:!0,get:function(){if(!fe.isBuffer(this))return;return this.byteOffset}});fe.poolSize=8192;fe.from=function(e,t,r){return f1(e,t,r)};Object.setPrototypeOf(fe.prototype,Uint8Array.prototype);Object.setPrototypeOf(fe,Uint8Array);fe.alloc=function(e,t,r){return _I(e,t,r)};fe.allocUnsafe=function(e){return im(e)};fe.allocUnsafeSlow=function(e){return im(e)};fe.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==fe.prototype};fe.compare=function(e,t){if(Wn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(Wn(t,Uint8Array))t=fe.from(t,t.offset,t.byteLength);if(!fe.isBuffer(e)||!fe.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}if(r<i)return-1;if(i<r)return 1;return 0};fe.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};fe.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return fe.alloc(0);let r;if(t===void 0){t=0;for(r=0;r<e.length;++r)t+=e[r].length}let i=fe.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){let o=e[r];if(Wn(o,Uint8Array))if(n+o.length>i.length){if(!fe.isBuffer(o))o=fe.from(o);o.copy(i,n)}else Uint8Array.prototype.set.call(i,o,n);else if(!fe.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');else o.copy(i,n);n+=o.length}return i};fe.byteLength=p1;fe.prototype._isBuffer=!0;fe.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)lo(this,t,t+1);return this};fe.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)lo(this,t,t+3),lo(this,t+1,t+2);return this};fe.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)lo(this,t,t+7),lo(this,t+1,t+6),lo(this,t+2,t+5),lo(this,t+3,t+4);return this};fe.prototype.toString=function(){let e=this.length;if(e===0)return"";if(arguments.length===0)return g1(this,0,e);return kI.apply(this,arguments)};fe.prototype.toLocaleString=fe.prototype.toString;fe.prototype.equals=function(e){if(!fe.isBuffer(e))throw TypeError("Argument must be a Buffer");if(this===e)return!0;return fe.compare(this,e)===0};fe.prototype.inspect=function(){let e="",t=c1;if(e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t)e+=" ... ";return"<Buffer "+e+">"};if(o1)fe.prototype[o1]=fe.prototype.inspect;fe.prototype.compare=function(e,t,r,i,n){if(Wn(e,Uint8Array))e=fe.from(e,e.offset,e.byteLength);if(!fe.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0)t=0;if(r===void 0)r=e?e.length:0;if(i===void 0)i=0;if(n===void 0)n=this.length;if(t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let o=n-i,s=r-t,h=Math.min(o,s),b=this.slice(i,n),v=e.slice(t,r);for(let _=0;_<h;++_)if(b[_]!==v[_]){o=b[_],s=v[_];break}if(o<s)return-1;if(s<o)return 1;return 0};fe.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};fe.prototype.indexOf=function(e,t,r){return m1(this,e,t,r,!0)};fe.prototype.lastIndexOf=function(e,t,r){return m1(this,e,t,r,!1)};fe.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t==="string")i=t,r=this.length,t=0;else if(isFinite(t))if(t=t>>>0,isFinite(r)){if(r=r>>>0,i===void 0)i="utf8"}else i=r,r=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let n=this.length-t;if(r===void 0||r>n)r=n;if(e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!i)i="utf8";let o=!1;for(;;)switch(i){case"hex":return MI(this,e,t,r);case"utf8":case"utf-8":return EI(this,e,t,r);case"ascii":case"latin1":case"binary":return II(this,e,t,r);case"base64":return TI(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $I(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};fe.prototype.slice=function(e,t){let r=this.length;if(e=~~e,t=t===void 0?r:~~t,e<0){if(e+=r,e<0)e=0}else if(e>r)e=r;if(t<0){if(t+=r,t<0)t=0}else if(t>r)t=r;if(t<e)t=e;let i=this.subarray(e,t);return Object.setPrototypeOf(i,fe.prototype),i};fe.prototype.readUintLE=fe.prototype.readUIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Mr(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;return i};fe.prototype.readUintBE=fe.prototype.readUIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Mr(e,t,this.length);let i=this[e+--t],n=1;while(t>0&&(n*=256))i+=this[e+--t]*n;return i};fe.prototype.readUint8=fe.prototype.readUInt8=function(e,t){if(e=e>>>0,!t)Mr(e,1,this.length);return this[e]};fe.prototype.readUint16LE=fe.prototype.readUInt16LE=function(e,t){if(e=e>>>0,!t)Mr(e,2,this.length);return this[e]|this[e+1]<<8};fe.prototype.readUint16BE=fe.prototype.readUInt16BE=function(e,t){if(e=e>>>0,!t)Mr(e,2,this.length);return this[e]<<8|this[e+1]};fe.prototype.readUint32LE=fe.prototype.readUInt32LE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};fe.prototype.readUint32BE=fe.prototype.readUInt32BE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};fe.prototype.readBigUInt64LE=Pi(function(e){e=e>>>0,ts(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)ya(e,this.length-8);let i=t+this[++e]*256+this[++e]*65536+this[++e]*16777216,n=this[++e]+this[++e]*256+this[++e]*65536+r*16777216;return BigInt(i)+(BigInt(n)<<BigInt(32))});fe.prototype.readBigUInt64BE=Pi(function(e){e=e>>>0,ts(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)ya(e,this.length-8);let i=t*16777216+this[++e]*65536+this[++e]*256+this[++e],n=this[++e]*16777216+this[++e]*65536+this[++e]*256+r;return(BigInt(i)<<BigInt(32))+BigInt(n)});fe.prototype.readIntLE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Mr(e,t,this.length);let i=this[e],n=1,o=0;while(++o<t&&(n*=256))i+=this[e+o]*n;if(n*=128,i>=n)i-=Math.pow(2,8*t);return i};fe.prototype.readIntBE=function(e,t,r){if(e=e>>>0,t=t>>>0,!r)Mr(e,t,this.length);let i=t,n=1,o=this[e+--i];while(i>0&&(n*=256))o+=this[e+--i]*n;if(n*=128,o>=n)o-=Math.pow(2,8*t);return o};fe.prototype.readInt8=function(e,t){if(e=e>>>0,!t)Mr(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};fe.prototype.readInt16LE=function(e,t){if(e=e>>>0,!t)Mr(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt16BE=function(e,t){if(e=e>>>0,!t)Mr(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};fe.prototype.readInt32LE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};fe.prototype.readInt32BE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};fe.prototype.readBigInt64LE=Pi(function(e){e=e>>>0,ts(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)ya(e,this.length-8);let i=this[e+4]+this[e+5]*256+this[e+6]*65536+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++e]*256+this[++e]*65536+this[++e]*16777216)});fe.prototype.readBigInt64BE=Pi(function(e){e=e>>>0,ts(e,"offset");let t=this[e],r=this[e+7];if(t===void 0||r===void 0)ya(e,this.length-8);let i=(t<<24)+this[++e]*65536+this[++e]*256+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*16777216+this[++e]*65536+this[++e]*256+r)});fe.prototype.readFloatLE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return Mc(this,e,!0,23,4)};fe.prototype.readFloatBE=function(e,t){if(e=e>>>0,!t)Mr(e,4,this.length);return Mc(this,e,!1,23,4)};fe.prototype.readDoubleLE=function(e,t){if(e=e>>>0,!t)Mr(e,8,this.length);return Mc(this,e,!0,52,8)};fe.prototype.readDoubleBE=function(e,t){if(e=e>>>0,!t)Mr(e,8,this.length);return Mc(this,e,!1,52,8)};fe.prototype.writeUintLE=fe.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Jr(this,e,t,r,s,0)}let n=1,o=0;this[t]=e&255;while(++o<r&&(n*=256))this[t+o]=e/n&255;return t+r};fe.prototype.writeUintBE=fe.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,r=r>>>0,!i){let s=Math.pow(2,8*r)-1;Jr(this,e,t,r,s,0)}let n=r-1,o=1;this[t+n]=e&255;while(--n>=0&&(o*=256))this[t+n]=e/o&255;return t+r};fe.prototype.writeUint8=fe.prototype.writeUInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,1,255,0);return this[t]=e&255,t+1};fe.prototype.writeUint16LE=fe.prototype.writeUInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,2,65535,0);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeUint16BE=fe.prototype.writeUInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,2,65535,0);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeUint32LE=fe.prototype.writeUInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,4,4294967295,0);return this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};fe.prototype.writeUint32BE=fe.prototype.writeUInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,4,4294967295,0);return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigUInt64LE=Pi(function(e,t=0){return y1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeBigUInt64BE=Pi(function(e,t=0){return v1(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});fe.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Jr(this,e,t,r,h-1,-h)}let n=0,o=1,s=0;this[t]=e&255;while(++n<r&&(o*=256)){if(e<0&&s===0&&this[t+n-1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t>>>0,!i){let h=Math.pow(2,8*r-1);Jr(this,e,t,r,h-1,-h)}let n=r-1,o=1,s=0;this[t+n]=e&255;while(--n>=0&&(o*=256)){if(e<0&&s===0&&this[t+n+1]!==0)s=1;this[t+n]=(e/o>>0)-s&255}return t+r};fe.prototype.writeInt8=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,1,127,-128);if(e<0)e=255+e+1;return this[t]=e&255,t+1};fe.prototype.writeInt16LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,2,32767,-32768);return this[t]=e&255,this[t+1]=e>>>8,t+2};fe.prototype.writeInt16BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,2,32767,-32768);return this[t]=e>>>8,this[t+1]=e&255,t+2};fe.prototype.writeInt32LE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,4,2147483647,-2147483648);return this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};fe.prototype.writeInt32BE=function(e,t,r){if(e=+e,t=t>>>0,!r)Jr(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;return this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};fe.prototype.writeBigInt64LE=Pi(function(e,t=0){return y1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeBigInt64BE=Pi(function(e,t=0){return v1(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});fe.prototype.writeFloatLE=function(e,t,r){return _1(this,e,t,!0,r)};fe.prototype.writeFloatBE=function(e,t,r){return _1(this,e,t,!1,r)};fe.prototype.writeDoubleLE=function(e,t,r){return w1(this,e,t,!0,r)};fe.prototype.writeDoubleBE=function(e,t,r){return w1(this,e,t,!1,r)};fe.prototype.copy=function(e,t,r,i){if(!fe.isBuffer(e))throw TypeError("argument should be a Buffer");if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i<r)i=r;if(i===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t<i-r)i=e.length-t+r;let n=i-r;if(this===e&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(t,r,i);else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n};fe.prototype.fill=function(e,t,r,i){if(typeof e==="string"){if(typeof t==="string")i=t,t=0,r=this.length;else if(typeof r==="string")i=r,r=this.length;if(i!==void 0&&typeof i!=="string")throw TypeError("encoding must be a string");if(typeof i==="string"&&!fe.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(e.length===1){let o=e.charCodeAt(0);if(i==="utf8"&&o<128||i==="latin1")e=o}}else if(typeof e==="number")e=e&255;else if(typeof e==="boolean")e=Number(e);if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t=t>>>0,r=r===void 0?this.length:r>>>0,!e)e=0;let n;if(typeof e==="number")for(n=t;n<r;++n)this[n]=e;else{let o=fe.isBuffer(e)?e:fe.from(e,i),s=o.length;if(s===0)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};zI=/[^+/0-9A-Za-z-_]/g;qI=function(){let e=Array(256);for(let t=0;t<16;++t){let r=t*16;for(let i=0;i<16;++i)e[r+i]="0123456789abcdef"[t]+"0123456789abcdef"[i]}return e}();BI=sm("resolveObjectURL"),HI=sm("isUtf8"),KI=sm("transcode"),VI=fe});var C1={};vn(C1,{types:()=>nT,promisify:()=>$1,log:()=>E1,isUndefined:()=>rs,isSymbol:()=>oT,isString:()=>Rc,isRegExp:()=>Ic,isPrimitive:()=>sT,isObject:()=>ns,isNumber:()=>M1,isNullOrUndefined:()=>iT,isNull:()=>Ac,isFunction:()=>$c,isError:()=>Tc,isDate:()=>cm,isBuffer:()=>aT,isBoolean:()=>fm,isArray:()=>k1,inspect:()=>co,inherits:()=>I1,format:()=>dm,deprecate:()=>GI,default:()=>cT,debuglog:()=>JI,callbackifyOnRejected:()=>mm,callbackify:()=>P1,_extend:()=>pm,TextEncoder:()=>A1,TextDecoder:()=>R1});function dm(e,...t){if(!Rc(e)){var r=[e];for(var i=0;i<t.length;i++)r.push(co(t[i]));return r.join(" ")}var i=0,n=t.length,o=String(e).replace(WI,function(h){if(h==="%%")return"%";if(i>=n)return h;switch(h){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(b){return"[Circular]"}default:return h}});for(var s=t[i];i<n;s=t[++i])if(Ac(s)||!ns(s))o+=" "+s;else o+=" "+co(s);return o}function GI(e,t){if(typeof process>"u"||process?.noDeprecation===!0)return e;var r=!1;function i(...n){if(!r){if(process.throwDeprecation)throw Error(t);else if(process.traceDeprecation)console.trace(t);else console.error(t);r=!0}return e.apply(this,...n)}return i}function XI(e,t){var r=co.styles[t];if(r)return"\x1B["+co.colors[r][0]+"m"+e+"\x1B["+co.colors[r][1]+"m";else return e}function YI(e,t){return e}function QI(e){var t={};return e.forEach(function(r,i){t[r]=!0}),t}function Pc(e,t,r){if(e.customInspect&&t&&$c(t.inspect)&&t.inspect!==co&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(r,e);if(!Rc(i))i=Pc(e,i,r);return i}var n=eT(e,t);if(n)return n;var o=Object.keys(t),s=QI(o);if(e.showHidden)o=Object.getOwnPropertyNames(t);if(Tc(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return am(t);if(o.length===0){if($c(t)){var h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(Ic(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(cm(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Tc(t))return am(t)}var b="",v=!1,_=["{","}"];if(k1(t))v=!0,_=["[","]"];if($c(t)){var g=t.name?": "+t.name:"";b=" [Function"+g+"]"}if(Ic(t))b=" "+RegExp.prototype.toString.call(t);if(cm(t))b=" "+Date.prototype.toUTCString.call(t);if(Tc(t))b=" "+am(t);if(o.length===0&&(!v||t.length==0))return _[0]+b+_[1];if(r<0)if(Ic(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");else return e.stylize("[Object]","special");e.seen.push(t);var S;if(v)S=tT(e,t,r,s,o);else S=o.map(function(x){return lm(e,t,r,s,x,v)});return e.seen.pop(),rT(S,b,_)}function eT(e,t){if(rs(t))return e.stylize("undefined","undefined");if(Rc(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(M1(t))return e.stylize(""+t,"number");if(fm(t))return e.stylize(""+t,"boolean");if(Ac(t))return e.stylize("null","null")}function am(e){return"["+Error.prototype.toString.call(e)+"]"}function tT(e,t,r,i,n){var o=[];for(var s=0,h=t.length;s<h;++s)if(T1(t,String(s)))o.push(lm(e,t,r,i,String(s),!0));else o.push("");return n.forEach(function(b){if(!b.match(/^\d+$/))o.push(lm(e,t,r,i,b,!0))}),o}function lm(e,t,r,i,n,o){var s,h,b;if(b=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]},b.get)if(b.set)h=e.stylize("[Getter/Setter]","special");else h=e.stylize("[Getter]","special");else if(b.set)h=e.stylize("[Setter]","special");if(!T1(i,n))s="["+n+"]";if(!h)if(e.seen.indexOf(b.value)<0){if(Ac(r))h=Pc(e,b.value,null);else h=Pc(e,b.value,r-1);if(h.indexOf(`
`)>-1)if(o)h=h.split(`
`).map(function(v){return" "+v}).join(`
`).slice(2);else h=`
`+h.split(`
`).map(function(v){return" "+v}).join(`
`)}else h=e.stylize("[Circular]","special");if(rs(s)){if(o&&n.match(/^\d+$/))return h;if(s=JSON.stringify(""+n),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))s=s.slice(1,-1),s=e.stylize(s,"name");else s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string")}return s+": "+h}function rT(e,t,r){var i=0,n=e.reduce(function(o,s){if(i++,s.indexOf(`
`)>=0)i++;return o+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(t===""?"":t+`
`)+" "+e.join(`,
`)+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}function k1(e){return Array.isArray(e)}function fm(e){return typeof e==="boolean"}function Ac(e){return e===null}function iT(e){return e==null}function M1(e){return typeof e==="number"}function Rc(e){return typeof e==="string"}function oT(e){return typeof e==="symbol"}function rs(e){return e===void 0}function Ic(e){return ns(e)&&hm(e)==="[object RegExp]"}function ns(e){return typeof e==="object"&&e!==null}function cm(e){return ns(e)&&hm(e)==="[object Date]"}function Tc(e){return ns(e)&&(hm(e)==="[object Error]"||e instanceof Error)}function $c(e){return typeof e==="function"}function sT(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e>"u"}function aT(e){return e instanceof Buffer}function hm(e){return Object.prototype.toString.call(e)}function um(e){return e<10?"0"+e.toString(10):e.toString(10)}function lT(){var e=new Date,t=[um(e.getHours()),um(e.getMinutes()),um(e.getSeconds())].join(":");return[e.getDate(),uT[e.getMonth()],t].join(" ")}function E1(...e){console.log("%s - %s",lT(),dm.apply(null,e))}function I1(e,t){if(t)e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function pm(e,t){if(!t||!ns(t))return e;var r=Object.keys(t),i=r.length;while(i--)e[r[i]]=t[r[i]];return e}function T1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function mm(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function P1(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');function t(...r){var i=r.pop();if(typeof i!=="function")throw TypeError("The last argument must be of type Function");var n=this,o=function(...s){return i.apply(n,...s)};e.apply(this,r).then(function(s){process.nextTick(o.bind(null,null,s))},function(s){process.nextTick(mm.bind(null,s,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),t}var WI,JI,co,nT=()=>{},uT,$1,A1,R1,cT;var O1=ha(()=>{WI=/%[sdj%]/g;JI=((e={},t={},r)=>((r=typeof process<"u"&&!1)&&(r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),t=new RegExp("^"+r+"$","i"),(i)=>{if(i=i.toUpperCase(),!e[i])if(t.test(i))e[i]=function(...n){console.error("%s: %s",i,pid,dm.apply(null,...n))};else e[i]=function(){};return e[i]}))(),co=((e)=>(e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.custom=Symbol.for("nodejs.util.inspect.custom"),e))(function(e,t,...r){var i={seen:[],stylize:YI};if(r.length>=1)i.depth=r[0];if(r.length>=2)i.colors=r[1];if(fm(t))i.showHidden=t;else if(t)pm(i,t);if(rs(i.showHidden))i.showHidden=!1;if(rs(i.depth))i.depth=2;if(rs(i.colors))i.colors=!1;if(i.colors)i.stylize=XI;return Pc(i,e,i.depth)});uT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];$1=((e)=>(e.custom=Symbol.for("nodejs.util.promisify.custom"),e))(function(e){if(typeof e!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var t=e[kCustomPromisifiedSymbol];if(typeof t!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(...r){var i,n,o=new Promise(function(s,h){i=s,n=h});r.push(function(s,h){if(s)n(s);else i(h)});try{e.apply(this,r)}catch(s){n(s)}return o}if(Object.setPrototypeOf(t,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol)Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))});({TextEncoder:A1,TextDecoder:R1}=globalThis),cT={TextEncoder:A1,TextDecoder:R1,promisify:$1,log:E1,inherits:I1,_extend:pm,callbackifyOnRejected:mm,callbackify:P1}});var ba={};vn(ba,{setMaxListeners:()=>Z1,once:()=>B1,listenerCount:()=>K1,init:()=>Ai,getMaxListeners:()=>W1,getEventListeners:()=>H1,default:()=>bT,captureRejectionSymbol:()=>U1,addAbortListener:()=>G1,EventEmitter:()=>Ai});function L1(e,t){var{_events:r}=e;if(t[0]??=Error("Unhandled error."),!r)throw t[0];var i=r[j1];if(i)for(var n of D1.call(i))n.apply(e,t);var o=r.error;if(!o)throw t[0];for(var n of D1.call(o))n.apply(e,t);return!0}function hT(e,t,r,i){t.then(void 0,function(n){queueMicrotask(()=>pT(e,n,r,i))})}function pT(e,t,r,i){if(typeof e[N1]==="function")e[N1](t,r,...i);else try{e[fo]=!1,e.emit("error",t)}finally{e[fo]=!0}}function q1(e,t,r){r.warned=!0;let i=Error(`Possible EventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=r.length,console.warn(i)}function F1(e,t,...r){this.removeListener(e,t),t.apply(this,r)}function B1(e,t,r){var i=r?.signal;if(V1(i,"options.signal"),i?.aborted)throw new gm(void 0,{cause:i?.reason});let{resolve:n,reject:o,promise:s}=$newPromiseCapability(Promise),h=(_)=>{if(e.removeListener(t,b),i!=null)Cc(i,"abort",v);o(_)},b=(..._)=>{if(typeof e.removeListener==="function")e.removeListener("error",h);if(i!=null)Cc(i,"abort",v);n(_)};if(z1(e,t,b,{once:!0}),t!=="error"&&typeof e.once==="function")e.once("error",h);function v(){Cc(e,t,b),Cc(e,"error",h),o(new gm(void 0,{cause:i?.reason}))}if(i!=null)z1(i,"abort",v,{once:!0});return s}function H1(e,t){return e.listeners(t)}function Z1(e,...t){vm(e,"setMaxListeners",0);var r;if(t&&(r=t.length))for(let i=0;i<r;i++)t[i].setMaxListeners(e);else ho=e}function K1(e,t){return e.listenerCount(t)}function Cc(e,t,r,i){if(typeof e.removeListener==="function")e.removeListener(t,r);else e.removeEventListener(t,r,i)}function z1(e,t,r,i){if(typeof e.on==="function")if(i.once)e.once(t,r);else e.on(t,r);else e.addEventListener(t,r,i)}function is(e,t,r){let i=TypeError(`The "${e}" argument must be of type ${t}. Received ${r}`);return i.code="ERR_INVALID_ARG_TYPE",i}function yT(e,t,r){let i=RangeError(`The "${e}" argument is out of range. It must be ${t}. Received ${r}`);return i.code="ERR_OUT_OF_RANGE",i}function V1(e,t){if(e!==void 0&&(e===null||typeof e!=="object"||!("aborted"in e)))throw is(t,"AbortSignal",e)}function vm(e,t,r,i){if(typeof e!=="number")throw is(t,"number",e);if(r!=null&&e<r||i!=null&&e>i||(r!=null||i!=null)&&Number.isNaN(e))throw yT(t,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,e)}function va(e){if(typeof e!=="function")throw TypeError("The listener must be a function")}function vT(e,t){if(typeof e!=="boolean")throw is(t,"boolean",e)}function W1(e){return e?._maxListeners??ho}function G1(e,t){if(e===void 0)throw is("signal","AbortSignal",e);if(V1(e,"signal"),typeof t!=="function")throw is("listener","function",t);let r;if(e.aborted)queueMicrotask(()=>t());else e.addEventListener("abort",t,{__proto__:null,once:!0}),r=()=>{e.removeEventListener("abort",t)};return{__proto__:null,[Symbol.dispose](){r?.()}}}var ym,fo,j1,dT,fT,N1,U1,D1,ho=10,Ai=function(e){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[fo]=e?.captureRejections?Boolean(e?.captureRejections):Lt[fo])this.emit=gT},Lt,mT=function(e,...t){if(e==="error")return L1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o];switch(t.length){case 0:h.call(this);break;case 1:h.call(this,t[0]);break;case 2:h.call(this,t[0],t[1]);break;case 3:h.call(this,t[0],t[1],t[2]);break;default:h.apply(this,t);break}}return!0},gT=function(e,...t){if(e==="error")return L1(this,t);var{_events:r}=this;if(r===void 0)return!1;var i=r[e];if(i===void 0)return!1;let n=i.length>1?i.slice():i;for(let o=0,{length:s}=n;o<s;o++){let h=n[o],b;switch(t.length){case 0:b=h.call(this);break;case 1:b=h.call(this,t[0]);break;case 2:b=h.call(this,t[0],t[1]);break;case 3:b=h.call(this,t[0],t[1],t[2]);break;default:b=h.apply(this,t);break}if(b!==void 0&&typeof b?.then==="function"&&b.then===Promise.prototype.then)hT(this,b,e,t)}return!0},gm,bT;var _a=ha(()=>{ym=Symbol.for,fo=Symbol("kCapture"),j1=ym("events.errorMonitor"),dT=Symbol("events.maxEventTargetListeners"),fT=Symbol("events.maxEventTargetListenersWarned"),N1=ym("nodejs.rejection"),U1=ym("nodejs.rejection"),D1=Array.prototype.slice,Lt=Ai.prototype={};Lt._events=void 0;Lt._eventsCount=0;Lt._maxListeners=void 0;Lt.setMaxListeners=function(e){return vm(e,"setMaxListeners",0),this._maxListeners=e,this};Lt.constructor=Ai;Lt.getMaxListeners=function(){return this?._maxListeners??ho};Lt.emit=mT;Lt.addListener=function(e,t){va(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.push(t);var n=this._maxListeners??ho;if(n>0&&i.length>n&&!i.warned)q1(this,e,i)}return this};Lt.on=Lt.addListener;Lt.prependListener=function(e,t){va(t);var r=this._events;if(!r)r=this._events={__proto__:null},this._eventsCount=0;else if(r.newListener)this.emit("newListener",e,t.listener??t);var i=r[e];if(!i)r[e]=[t],this._eventsCount++;else{i.unshift(t);var n=this._maxListeners??ho;if(n>0&&i.length>n&&!i.warned)q1(this,e,i)}return this};Lt.once=function(e,t){va(t);let r=F1.bind(this,e,t);return r.listener=t,this.addListener(e,r),this};Lt.prependOnceListener=function(e,t){va(t);let r=F1.bind(this,e,t);return r.listener=t,this.prependListener(e,r),this};Lt.removeListener=function(e,t){va(t);var{_events:r}=this;if(!r)return this;var i=r[e];if(!i)return this;var n=i.length;let o=-1;for(let s=n-1;s>=0;s--)if(i[s]===t||i[s].listener===t){o=s;break}if(o<0)return this;if(o===0)i.shift();else i.splice(o,1);if(i.length===0)delete r[e],this._eventsCount--;return this};Lt.off=Lt.removeListener;Lt.removeAllListeners=function(e){var{_events:t}=this;if(e&&t){if(t[e])delete t[e],this._eventsCount--}else this._events={__proto__:null};return this};Lt.listeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.map((i)=>i.listener??i)};Lt.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];if(!r)return[];return r.slice()};Lt.listenerCount=function(e){var{_events:t}=this;if(!t)return 0;return t[e]?.length??0};Lt.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};Lt[fo]=!1;gm=class gm extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!=="object")throw is("options","Object",t);super(e,t);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(Ai,{captureRejections:{get(){return Lt[fo]},set(e){vT(e,"EventEmitter.captureRejections"),Lt[fo]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>ho,set:(e)=>{vm(e,"defaultMaxListeners",0),ho=e}},kMaxEventTargetListeners:{value:dT,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:fT,enumerable:!1,configurable:!1,writable:!1}});Object.assign(Ai,{once:B1,getEventListeners:H1,getMaxListeners:W1,setMaxListeners:Z1,EventEmitter:Ai,usingDomains:!1,captureRejectionSymbol:U1,errorMonitor:j1,addAbortListener:G1,init:Ai,listenerCount:K1});bT=Ai});var Sm=Je((WZ,nw)=>{var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vt=Tt((e,t)=>{class r extends Error{constructor(i){if(!Array.isArray(i))throw TypeError(`Expected input to be an Array, got ${typeof i}`);let n="";for(let o=0;o<i.length;o++)n+=` ${i[o].stack}
`;super(n);this.name="AggregateError",this.errors=i}}t.exports={AggregateError:r,ArrayIsArray(i){return Array.isArray(i)},ArrayPrototypeIncludes(i,n){return i.includes(n)},ArrayPrototypeIndexOf(i,n){return i.indexOf(n)},ArrayPrototypeJoin(i,n){return i.join(n)},ArrayPrototypeMap(i,n){return i.map(n)},ArrayPrototypePop(i,n){return i.pop(n)},ArrayPrototypePush(i,n){return i.push(n)},ArrayPrototypeSlice(i,n,o){return i.slice(n,o)},Error,FunctionPrototypeCall(i,n,...o){return i.call(n,...o)},FunctionPrototypeSymbolHasInstance(i,n){return Function.prototype[Symbol.hasInstance].call(i,n)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(i,n){return Object.defineProperties(i,n)},ObjectDefineProperty(i,n,o){return Object.defineProperty(i,n,o)},ObjectGetOwnPropertyDescriptor(i,n){return Object.getOwnPropertyDescriptor(i,n)},ObjectKeys(i){return Object.keys(i)},ObjectSetPrototypeOf(i,n){return Object.setPrototypeOf(i,n)},Promise,PromisePrototypeCatch(i,n){return i.catch(n)},PromisePrototypeThen(i,n,o){return i.then(n,o)},PromiseReject(i){return Promise.reject(i)},PromiseResolve(i){return Promise.resolve(i)},ReflectApply:Reflect.apply,RegExpPrototypeTest(i,n){return i.test(n)},SafeSet:Set,String,StringPrototypeSlice(i,n,o){return i.slice(n,o)},StringPrototypeToLowerCase(i){return i.toLowerCase()},StringPrototypeToUpperCase(i){return i.toUpperCase()},StringPrototypeTrim(i){return i.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(i,n,o){return i.set(n,o)},Boolean,Uint8Array}}),J1=Tt((e,t)=>{t.exports={format(r,...i){return r.replace(/%([sdifj])/g,function(...[n,o]){let s=i.shift();if(o==="f")return s.toFixed(6);else if(o==="j")return JSON.stringify(s);else if(o==="s"&&typeof s==="object")return`${s.constructor!==Object?s.constructor.name:""} {}`.trim();else return s.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'")){if(!r.includes('"'))return`"${r}"`;else if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}return`'${r}'`;case"number":if(isNaN(r))return"NaN";else if(Object.is(r,-0))return String(r);return r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}}),Fr=Tt((e,t)=>{var{format:r,inspect:i}=J1(),{AggregateError:n}=Vt(),o=globalThis.AggregateError||n,s=Symbol("kIsNodeError"),h=["string","function","number","object","Function","Object","boolean","bigint","symbol"],b=/^([A-Z][a-z0-9]*)+$/,v={};function _($,P){if(!$)throw new v.ERR_INTERNAL_ASSERTION(P)}function g($){let P="",R=$.length,C=$[0]==="-"?1:0;for(;R>=C+4;R-=3)P=`_${$.slice(R-3,R)}${P}`;return`${$.slice(0,R)}${P}`}function S($,P,R){if(typeof P==="function")return _(P.length<=R.length,`Code: ${$}; The provided arguments length (${R.length}) does not match the required ones (${P.length}).`),P(...R);let C=(P.match(/%[dfijoOs]/g)||[]).length;if(_(C===R.length,`Code: ${$}; The provided arguments length (${R.length}) does not match the required ones (${C}).`),R.length===0)return P;return r(P,...R)}function x($,P,R){if(!R)R=Error;class C extends R{constructor(...D){super(S($,P,D))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(C.prototype,{name:{value:R.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),C.prototype.code=$,C.prototype[s]=!0,v[$]=C}function M($){let P="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:P}),$}function I($,P){if($&&P&&$!==P){if(Array.isArray(P.errors))return P.errors.push($),P;let R=new o([P,$],P.message);return R.code=P.code,R}return $||P}class T extends Error{constructor($="The operation was aborted",P=void 0){if(P!==void 0&&typeof P!=="object")throw new v.ERR_INVALID_ARG_TYPE("options","Object",P);super($,P);this.code="ABORT_ERR",this.name="AbortError"}}x("ERR_ASSERTION","%s",Error),x("ERR_INVALID_ARG_TYPE",($,P,R)=>{if(_(typeof $==="string","'name' must be a string"),!Array.isArray(P))P=[P];let C="The ";if($.endsWith(" argument"))C+=`${$} `;else C+=`"${$}" ${$.includes(".")?"property":"argument"} `;C+="must be ";let D=[],B=[],ie=[];for(let ue of P)if(_(typeof ue==="string","All expected entries have to be of type string"),h.includes(ue))D.push(ue.toLowerCase());else if(b.test(ue))B.push(ue);else _(ue!=="object",'The value "object" should be written as "Object"'),ie.push(ue);if(B.length>0){let ue=D.indexOf("object");if(ue!==-1)D.splice(D,ue,1),B.push("Object")}if(D.length>0){switch(D.length){case 1:C+=`of type ${D[0]}`;break;case 2:C+=`one of type ${D[0]} or ${D[1]}`;break;default:{let ue=D.pop();C+=`one of type ${D.join(", ")}, or ${ue}`}}if(B.length>0||ie.length>0)C+=" or "}if(B.length>0){switch(B.length){case 1:C+=`an instance of ${B[0]}`;break;case 2:C+=`an instance of ${B[0]} or ${B[1]}`;break;default:{let ue=B.pop();C+=`an instance of ${B.join(", ")}, or ${ue}`}}if(ie.length>0)C+=" or "}switch(ie.length){case 0:break;case 1:if(ie[0].toLowerCase()!==ie[0])C+="an ";C+=`${ie[0]}`;break;case 2:C+=`one of ${ie[0]} or ${ie[1]}`;break;default:{let ue=ie.pop();C+=`one of ${ie.join(", ")}, or ${ue}`}}if(R==null)C+=`. Received ${R}`;else if(typeof R==="function"&&R.name)C+=`. Received function ${R.name}`;else if(typeof R==="object"){var le;if((le=R.constructor)!==null&&le!==void 0&&le.name)C+=`. Received an instance of ${R.constructor.name}`;else{let ue=i(R,{depth:-1});C+=`. Received ${ue}`}}else{let ue=i(R,{colors:!1});if(ue.length>25)ue=`${ue.slice(0,25)}...`;C+=`. Received type ${typeof R} (${ue})`}return C},TypeError),x("ERR_INVALID_ARG_VALUE",($,P,R="is invalid")=>{let C=i(P);if(C.length>128)C=C.slice(0,128)+"...";return`The ${$.includes(".")?"property":"argument"} '${$}' ${R}. Received ${C}`},TypeError),x("ERR_INVALID_RETURN_VALUE",($,P,R)=>{var C;let D=R!==null&&R!==void 0&&(C=R.constructor)!==null&&C!==void 0&&C.name?`instance of ${R.constructor.name}`:`type ${typeof R}`;return`Expected ${$} to be returned from the "${P}" function but got ${D}.`},TypeError),x("ERR_MISSING_ARGS",(...$)=>{_($.length>0,"At least one arg needs to be specified");let P,R=$.length;switch($=(Array.isArray($)?$:[$]).map((C)=>`"${C}"`).join(" or "),R){case 1:P+=`The ${$[0]} argument`;break;case 2:P+=`The ${$[0]} and ${$[1]} arguments`;break;default:{let C=$.pop();P+=`The ${$.join(", ")}, and ${C} arguments`}break}return`${P} must be specified`},TypeError),x("ERR_OUT_OF_RANGE",($,P,R)=>{_(P,'Missing "range" argument');let C;if(Number.isInteger(R)&&Math.abs(R)>4294967296)C=g(String(R));else if(typeof R==="bigint"){C=String(R);let D=BigInt(2)**BigInt(32);if(R>D||R<-D)C=g(C);C+="n"}else C=i(R);return`The value of "${$}" is out of range. It must be ${P}. Received ${C}`},RangeError),x("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),x("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),x("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),x("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),x("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),x("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),x("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),x("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),x("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),x("ERR_STREAM_WRITE_AFTER_END","write after end",Error),x("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:T,aggregateTwoErrors:M(I),hideStackFrames:M,codes:v}}),_T=Tt((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=new WeakMap,i=new WeakMap;function n(q){let ee=r.get(q);return console.assert(ee!=null,"'this' is expected an Event object, but got",q),ee}function o(q){if(q.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",q.passiveListener);return}if(!q.event.cancelable)return;if(q.canceled=!0,typeof q.event.preventDefault==="function")q.event.preventDefault()}function s(q,ee){r.set(this,{eventTarget:q,event:ee,eventPhase:2,currentTarget:q,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:ee.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let a=Object.keys(ee);for(let c=0;c<a.length;++c){let f=a[c];if(!(f in this))Object.defineProperty(this,f,h(f))}}if(s.prototype={get type(){return n(this).event.type},get target(){return n(this).eventTarget},get currentTarget(){return n(this).currentTarget},composedPath(){let q=n(this).currentTarget;if(q==null)return[];return[q]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return n(this).eventPhase},stopPropagation(){let q=n(this);if(q.stopped=!0,typeof q.event.stopPropagation==="function")q.event.stopPropagation()},stopImmediatePropagation(){let q=n(this);if(q.stopped=!0,q.immediateStopped=!0,typeof q.event.stopImmediatePropagation==="function")q.event.stopImmediatePropagation()},get bubbles(){return Boolean(n(this).event.bubbles)},get cancelable(){return Boolean(n(this).event.cancelable)},preventDefault(){o(n(this))},get defaultPrevented(){return n(this).canceled},get composed(){return Boolean(n(this).event.composed)},get timeStamp(){return n(this).timeStamp},get srcElement(){return n(this).eventTarget},get cancelBubble(){return n(this).stopped},set cancelBubble(q){if(!q)return;let ee=n(this);if(ee.stopped=!0,typeof ee.event.cancelBubble==="boolean")ee.event.cancelBubble=!0},get returnValue(){return!n(this).canceled},set returnValue(q){if(!q)o(n(this))},initEvent(){}},Object.defineProperty(s.prototype,"constructor",{value:s,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(s.prototype,window.Event.prototype),i.set(window.Event.prototype,s);function h(q){return{get(){return n(this).event[q]},set(ee){n(this).event[q]=ee},configurable:!0,enumerable:!0}}function b(q){return{value(){let ee=n(this).event;return ee[q].apply(ee,arguments)},configurable:!0,enumerable:!0}}function v(q,ee){let a=Object.keys(ee);if(a.length===0)return q;function c(f,l){q.call(this,f,l)}c.prototype=Object.create(q.prototype,{constructor:{value:c,configurable:!0,writable:!0}});for(let f=0;f<a.length;++f){let l=a[f];if(!(l in q.prototype)){let d=typeof Object.getOwnPropertyDescriptor(ee,l).value==="function";Object.defineProperty(c.prototype,l,d?b(l):h(l))}}return c}function _(q){if(q==null||q===Object.prototype)return s;let ee=i.get(q);if(ee==null)ee=v(_(Object.getPrototypeOf(q)),q),i.set(q,ee);return ee}function g(q,ee){return new(_(Object.getPrototypeOf(ee)))(q,ee)}function S(q){return n(q).immediateStopped}function x(q,ee){n(q).eventPhase=ee}function M(q,ee){n(q).currentTarget=ee}function I(q,ee){n(q).passiveListener=ee}var T=new WeakMap,$=1,P=2,R=3;function C(q){return q!==null&&typeof q==="object"}function D(q){let ee=T.get(q);if(ee==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return ee}function B(q){return{get(){let ee=D(this).get(q);while(ee!=null){if(ee.listenerType===R)return ee.listener;ee=ee.next}return null},set(ee){if(typeof ee!=="function"&&!C(ee))ee=null;let a=D(this),c=null,f=a.get(q);while(f!=null){if(f.listenerType===R)if(c!==null)c.next=f.next;else if(f.next!==null)a.set(q,f.next);else a.delete(q);else c=f;f=f.next}if(ee!==null){let l={listener:ee,listenerType:R,passive:!1,once:!1,next:null};if(c===null)a.set(q,l);else c.next=l}},configurable:!0,enumerable:!0}}function ie(q,ee){Object.defineProperty(q,`on${ee}`,B(ee))}function le(q){function ee(){ue.call(this)}ee.prototype=Object.create(ue.prototype,{constructor:{value:ee,configurable:!0,writable:!0}});for(let a=0;a<q.length;++a)ie(ee.prototype,q[a]);return ee}function ue(){if(this instanceof ue){T.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return le(arguments[0]);if(arguments.length>0){let q=Array(arguments.length);for(let ee=0;ee<arguments.length;++ee)q[ee]=arguments[ee];return le(q)}throw TypeError("Cannot call a class as a function")}if(ue.prototype={addEventListener(q,ee,a){if(ee==null)return;if(typeof ee!=="function"&&!C(ee))throw TypeError("'listener' should be a function or an object.");let c=D(this),f=C(a),l=(f?Boolean(a.capture):Boolean(a))?$:P,d={listener:ee,listenerType:l,passive:f&&Boolean(a.passive),once:f&&Boolean(a.once),next:null},y=c.get(q);if(y===void 0){c.set(q,d);return}let w=null;while(y!=null){if(y.listener===ee&&y.listenerType===l)return;w=y,y=y.next}w.next=d},removeEventListener(q,ee,a){if(ee==null)return;let c=D(this),f=(C(a)?Boolean(a.capture):Boolean(a))?$:P,l=null,d=c.get(q);while(d!=null){if(d.listener===ee&&d.listenerType===f){if(l!==null)l.next=d.next;else if(d.next!==null)c.set(q,d.next);else c.delete(q);return}l=d,d=d.next}},dispatchEvent(q){if(q==null||typeof q.type!=="string")throw TypeError('"event.type" should be a string.');let ee=D(this),a=q.type,c=ee.get(a);if(c==null)return!0;let f=g(this,q),l=null;while(c!=null){if(c.once)if(l!==null)l.next=c.next;else if(c.next!==null)ee.set(a,c.next);else ee.delete(a);else l=c;if(I(f,c.passive?c.listener:null),typeof c.listener==="function")try{c.listener.call(this,f)}catch(d){if(typeof console<"u"&&typeof console.error==="function")console.error(d)}else if(c.listenerType!==R&&typeof c.listener.handleEvent==="function")c.listener.handleEvent(f);if(S(f))break;c=c.next}return I(f,null),x(f,0),M(f,null),!f.defaultPrevented}},Object.defineProperty(ue.prototype,"constructor",{value:ue,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(ue.prototype,window.EventTarget.prototype);e.defineEventAttribute=ie,e.EventTarget=ue,e.default=ue,t.exports=ue,t.exports.EventTarget=t.exports.default=ue,t.exports.defineEventAttribute=ie}),wa=Tt((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=_T();class i extends r.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let _=s.get(this);if(typeof _!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return _}}r.defineEventAttribute(i.prototype,"abort");function n(){let _=Object.create(i.prototype);return r.EventTarget.call(_),s.set(_,!1),_}function o(_){if(s.get(_)!==!1)return;s.set(_,!0),_.dispatchEvent({type:"abort"})}var s=new WeakMap;if(Object.defineProperties(i.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(i.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class h{constructor(){b.set(this,n())}get signal(){return v(this)}abort(){o(v(this))}}var b=new WeakMap;function v(_){let g=b.get(_);if(g==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${_===null?"null":typeof _}`);return g}if(Object.defineProperties(h.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(h.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});e.AbortController=h,e.AbortSignal=i,e.default=h,t.exports=h,t.exports.AbortController=t.exports.default=h,t.exports.AbortSignal=i}),Xr=Tt((e,t)=>{var r=(Ir(),xt(Er)),{format:i,inspect:n}=J1(),{codes:{ERR_INVALID_ARG_TYPE:o}}=Fr(),{kResistStopPropagation:s,AggregateError:h,SymbolDispose:b}=Vt(),v=globalThis.AbortSignal||wa().AbortSignal,_=globalThis.AbortController||wa().AbortController,g=Object.getPrototypeOf(async function(){}).constructor,S=globalThis.Blob||r.Blob,x=typeof S<"u"?function(T){return T instanceof S}:function(T){return!1},M=(T,$)=>{if(T!==void 0&&(T===null||typeof T!=="object"||!("aborted"in T)))throw new o($,"AbortSignal",T)},I=(T,$)=>{if(typeof T!=="function")throw new o($,"Function",T)};t.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(T){let $=!1;return function(...P){if($)return;$=!0,T.apply(this,P)}},createDeferredPromise:function(){let T,$;return{promise:new Promise((P,R)=>{T=P,$=R}),resolve:T,reject:$}},promisify(T){return new Promise(($,P)=>{T((R,...C)=>{if(R)return P(R);return $(...C)})})},debuglog(){return function(){}},format:i,inspect:n,types:{isAsyncFunction(T){return T instanceof g},isArrayBufferView(T){return ArrayBuffer.isView(T)}},isBlob:x,deprecate(T,$){return T},addAbortListener:(_a(),xt(ba)).addAbortListener||function(T,$){if(T===void 0)throw new o("signal","AbortSignal",T);M(T,"signal"),I($,"listener");let P;if(T.aborted)queueMicrotask(()=>$());else T.addEventListener("abort",$,{__proto__:null,once:!0,[s]:!0}),P=()=>{T.removeEventListener("abort",$)};return{__proto__:null,[b](){var R;(R=P)===null||R===void 0||R()}}},AbortSignalAny:v.any||function(T){if(T.length===1)return T[0];let $=new _,P=()=>$.abort();return T.forEach((R)=>{M(R,"signals"),R.addEventListener("abort",P,{once:!0})}),$.signal.addEventListener("abort",()=>{T.forEach((R)=>R.removeEventListener("abort",P))},{once:!0}),$.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),Sa=Tt((e,t)=>{var{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:n,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:h,NumberMAX_SAFE_INTEGER:b,NumberMIN_SAFE_INTEGER:v,NumberParseInt:_,ObjectPrototypeHasOwnProperty:g,RegExpPrototypeExec:S,String:x,StringPrototypeToUpperCase:M,StringPrototypeTrim:I}=Vt(),{hideStackFrames:T,codes:{ERR_SOCKET_BAD_PORT:$,ERR_INVALID_ARG_TYPE:P,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:C,ERR_UNKNOWN_SIGNAL:D}}=Fr(),{normalizeEncoding:B}=Xr(),{isAsyncFunction:ie,isArrayBufferView:le}=Xr().types,ue={};function q(j){return j===(j|0)}function ee(j){return j===j>>>0}var a=/^[0-7]+$/,c="must be a 32-bit unsigned integer or an octal string";function f(j,Z,je){if(typeof j>"u")j=je;if(typeof j==="string"){if(S(a,j)===null)throw new R(Z,j,c);j=_(j,8)}return y(j,Z),j}var l=T((j,Z,je=v,W=b)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);if(j<je||j>W)throw new C(Z,`>= ${je} && <= ${W}`,j)}),d=T((j,Z,je=-2147483648,W=2147483647)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);if(j<je||j>W)throw new C(Z,`>= ${je} && <= ${W}`,j)}),y=T((j,Z,je=!1)=>{if(typeof j!=="number")throw new P(Z,"number",j);if(!s(j))throw new C(Z,"an integer",j);let W=je?1:0,re=4294967295;if(j<W||j>re)throw new C(Z,`>= ${W} && <= ${re}`,j)});function w(j,Z){if(typeof j!=="string")throw new P(Z,"string",j)}function p(j,Z,je=void 0,W){if(typeof j!=="number")throw new P(Z,"number",j);if(je!=null&&j<je||W!=null&&j>W||(je!=null||W!=null)&&h(j))throw new C(Z,`${je!=null?`>= ${je}`:""}${je!=null&&W!=null?" && ":""}${W!=null?`<= ${W}`:""}`,j)}var u=T((j,Z,je)=>{if(!i(je,j)){let W="must be one of: "+n(o(je,(re)=>typeof re==="string"?`'${re}'`:x(re)),", ");throw new R(Z,j,W)}});function m(j,Z){if(typeof j!=="boolean")throw new P(Z,"boolean",j)}function E(j,Z,je){return j==null||!g(j,Z)?je:j[Z]}var k=T((j,Z,je=null)=>{let W=E(je,"allowArray",!1),re=E(je,"allowFunction",!1);if(!E(je,"nullable",!1)&&j===null||!W&&r(j)||typeof j!=="object"&&(!re||typeof j!=="function"))throw new P(Z,"Object",j)}),A=T((j,Z)=>{if(j!=null&&typeof j!=="object"&&typeof j!=="function")throw new P(Z,"a dictionary",j)}),N=T((j,Z,je=0)=>{if(!r(j))throw new P(Z,"Array",j);if(j.length<je){let W=`must be longer than ${je}`;throw new R(Z,j,W)}});function U(j,Z){N(j,Z);for(let je=0;je<j.length;je++)w(j[je],`${Z}[${je}]`)}function K(j,Z){N(j,Z);for(let je=0;je<j.length;je++)m(j[je],`${Z}[${je}]`)}function he(j,Z){N(j,Z);for(let je=0;je<j.length;je++){let W=j[je],re=`${Z}[${je}]`;if(W==null)throw new P(re,"AbortSignal",W);Q(W,re)}}function J(j,Z="signal"){if(w(j,Z),ue[j]===void 0){if(ue[M(j)]!==void 0)throw new D(j+" (signals must use all capital letters)");throw new D(j)}}var H=T((j,Z="buffer")=>{if(!le(j))throw new P(Z,["Buffer","TypedArray","DataView"],j)});function se(j,Z){let je=B(Z),W=j.length;if(je==="hex"&&W%2!==0)throw new R("encoding",Z,`is invalid for data of length ${W}`)}function V(j,Z="Port",je=!0){if(typeof j!=="number"&&typeof j!=="string"||typeof j==="string"&&I(j).length===0||+j!==+j>>>0||j>65535||j===0&&!je)throw new $(Z,j,je);return j|0}var Q=T((j,Z)=>{if(j!==void 0&&(j===null||typeof j!=="object"||!("aborted"in j)))throw new P(Z,"AbortSignal",j)}),Be=T((j,Z)=>{if(typeof j!=="function")throw new P(Z,"Function",j)}),z=T((j,Z)=>{if(typeof j!=="function"||ie(j))throw new P(Z,"Function",j)}),L=T((j,Z)=>{if(j!==void 0)throw new P(Z,"undefined",j)});function ae(j,Z,je){if(!i(je,j))throw new P(Z,`('${n(je,"|")}')`,j)}var G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Y(j,Z){if(typeof j>"u"||!S(G,j))throw new R(Z,j,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Me(j){if(typeof j==="string")return Y(j,"hints"),j;else if(r(j)){let Z=j.length,je="";if(Z===0)return je;for(let W=0;W<Z;W++){let re=j[W];if(Y(re,"hints"),je+=re,W!==Z-1)je+=", "}return je}throw new R("hints",j,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:q,isUint32:ee,parseFileMode:f,validateArray:N,validateStringArray:U,validateBooleanArray:K,validateAbortSignalArray:he,validateBoolean:m,validateBuffer:H,validateDictionary:A,validateEncoding:se,validateFunction:Be,validateInt32:d,validateInteger:l,validateNumber:p,validateObject:k,validateOneOf:u,validatePlainFunction:z,validatePort:V,validateSignalName:J,validateString:w,validateUint32:y,validateUndefined:L,validateUnion:ae,validateAbortSignal:Q,validateLinkHeaderValue:Me}}),po=Tt((e,t)=>{t.exports=globalThis.process}),oi=Tt((e,t)=>{var{SymbolAsyncIterator:r,SymbolIterator:i,SymbolFor:n}=Vt(),o=n("nodejs.stream.destroyed"),s=n("nodejs.stream.errored"),h=n("nodejs.stream.readable"),b=n("nodejs.stream.writable"),v=n("nodejs.stream.disturbed"),_=n("nodejs.webstream.isClosedPromise"),g=n("nodejs.webstream.controllerErrorFunction");function S(E,k=!1){var A;return!!(E&&typeof E.pipe==="function"&&typeof E.on==="function"&&(!k||typeof E.pause==="function"&&typeof E.resume==="function")&&(!E._writableState||((A=E._readableState)===null||A===void 0?void 0:A.readable)!==!1)&&(!E._writableState||E._readableState))}function x(E){var k;return!!(E&&typeof E.write==="function"&&typeof E.on==="function"&&(!E._readableState||((k=E._writableState)===null||k===void 0?void 0:k.writable)!==!1))}function M(E){return!!(E&&typeof E.pipe==="function"&&E._readableState&&typeof E.on==="function"&&typeof E.write==="function")}function I(E){return E&&(E._readableState||E._writableState||typeof E.write==="function"&&typeof E.on==="function"||typeof E.pipe==="function"&&typeof E.on==="function")}function T(E){return!!(E&&!I(E)&&typeof E.pipeThrough==="function"&&typeof E.getReader==="function"&&typeof E.cancel==="function")}function $(E){return!!(E&&!I(E)&&typeof E.getWriter==="function"&&typeof E.abort==="function")}function P(E){return!!(E&&!I(E)&&typeof E.readable==="object"&&typeof E.writable==="object")}function R(E){return T(E)||$(E)||P(E)}function C(E,k){if(E==null)return!1;if(k===!0)return typeof E[r]==="function";if(k===!1)return typeof E[i]==="function";return typeof E[r]==="function"||typeof E[i]==="function"}function D(E){if(!I(E))return null;let{_writableState:k,_readableState:A}=E,N=k||A;return!!(E.destroyed||E[o]||N!==null&&N!==void 0&&N.destroyed)}function B(E){if(!x(E))return null;if(E.writableEnded===!0)return!0;let k=E._writableState;if(k!==null&&k!==void 0&&k.errored)return!1;if(typeof(k===null||k===void 0?void 0:k.ended)!=="boolean")return null;return k.ended}function ie(E,k){if(!x(E))return null;if(E.writableFinished===!0)return!0;let A=E._writableState;if(A!==null&&A!==void 0&&A.errored)return!1;if(typeof(A===null||A===void 0?void 0:A.finished)!=="boolean")return null;return!!(A.finished||k===!1&&A.ended===!0&&A.length===0)}function le(E){if(!S(E))return null;if(E.readableEnded===!0)return!0;let k=E._readableState;if(!k||k.errored)return!1;if(typeof(k===null||k===void 0?void 0:k.ended)!=="boolean")return null;return k.ended}function ue(E,k){if(!S(E))return null;let A=E._readableState;if(A!==null&&A!==void 0&&A.errored)return!1;if(typeof(A===null||A===void 0?void 0:A.endEmitted)!=="boolean")return null;return!!(A.endEmitted||k===!1&&A.ended===!0&&A.length===0)}function q(E){if(E&&E[h]!=null)return E[h];if(typeof(E===null||E===void 0?void 0:E.readable)!=="boolean")return null;if(D(E))return!1;return S(E)&&E.readable&&!ue(E)}function ee(E){if(E&&E[b]!=null)return E[b];if(typeof(E===null||E===void 0?void 0:E.writable)!=="boolean")return null;if(D(E))return!1;return x(E)&&E.writable&&!B(E)}function a(E,k){if(!I(E))return null;if(D(E))return!0;if((k===null||k===void 0?void 0:k.readable)!==!1&&q(E))return!1;if((k===null||k===void 0?void 0:k.writable)!==!1&&ee(E))return!1;return!0}function c(E){var k,A;if(!I(E))return null;if(E.writableErrored)return E.writableErrored;return(k=(A=E._writableState)===null||A===void 0?void 0:A.errored)!==null&&k!==void 0?k:null}function f(E){var k,A;if(!I(E))return null;if(E.readableErrored)return E.readableErrored;return(k=(A=E._readableState)===null||A===void 0?void 0:A.errored)!==null&&k!==void 0?k:null}function l(E){if(!I(E))return null;if(typeof E.closed==="boolean")return E.closed;let{_writableState:k,_readableState:A}=E;if(typeof(k===null||k===void 0?void 0:k.closed)==="boolean"||typeof(A===null||A===void 0?void 0:A.closed)==="boolean")return(k===null||k===void 0?void 0:k.closed)||(A===null||A===void 0?void 0:A.closed);if(typeof E._closed==="boolean"&&d(E))return E._closed;return null}function d(E){return typeof E._closed==="boolean"&&typeof E._defaultKeepAlive==="boolean"&&typeof E._removedConnection==="boolean"&&typeof E._removedContLen==="boolean"}function y(E){return typeof E._sent100==="boolean"&&d(E)}function w(E){var k;return typeof E._consuming==="boolean"&&typeof E._dumped==="boolean"&&((k=E.req)===null||k===void 0?void 0:k.upgradeOrConnect)===void 0}function p(E){if(!I(E))return null;let{_writableState:k,_readableState:A}=E,N=k||A;return!N&&y(E)||!!(N&&N.autoDestroy&&N.emitClose&&N.closed===!1)}function u(E){var k;return!!(E&&((k=E[v])!==null&&k!==void 0?k:E.readableDidRead||E.readableAborted))}function m(E){var k,A,N,U,K,he,J,H,se,V;return!!(E&&((k=(A=(N=(U=(K=(he=E[s])!==null&&he!==void 0?he:E.readableErrored)!==null&&K!==void 0?K:E.writableErrored)!==null&&U!==void 0?U:(J=E._readableState)===null||J===void 0?void 0:J.errorEmitted)!==null&&N!==void 0?N:(H=E._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&A!==void 0?A:(se=E._readableState)===null||se===void 0?void 0:se.errored)!==null&&k!==void 0?k:(V=E._writableState)===null||V===void 0?void 0:V.errored))}t.exports={isDestroyed:D,kIsDestroyed:o,isDisturbed:u,kIsDisturbed:v,isErrored:m,kIsErrored:s,isReadable:q,kIsReadable:h,kIsClosedPromise:_,kControllerErrorFunction:g,kIsWritable:b,isClosed:l,isDuplexNodeStream:M,isFinished:a,isIterable:C,isReadableNodeStream:S,isReadableStream:T,isReadableEnded:le,isReadableFinished:ue,isReadableErrored:f,isNodeStream:I,isWebStream:R,isWritable:ee,isWritableNodeStream:x,isWritableStream:$,isWritableEnded:B,isWritableFinished:ie,isWritableErrored:c,isServerRequest:w,isServerResponse:y,willEmitClose:p,isTransformStream:P}}),Ri=Tt((e,t)=>{var r=po(),{AbortError:i,codes:n}=Fr(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=n,{kEmptyObject:h,once:b}=Xr(),{validateAbortSignal:v,validateFunction:_,validateObject:g,validateBoolean:S}=Sa(),{Promise:x,PromisePrototypeThen:M,SymbolDispose:I}=Vt(),{isClosed:T,isReadable:$,isReadableNodeStream:P,isReadableStream:R,isReadableFinished:C,isReadableErrored:D,isWritable:B,isWritableNodeStream:ie,isWritableStream:le,isWritableFinished:ue,isWritableErrored:q,isNodeStream:ee,willEmitClose:a,kIsClosedPromise:c}=oi(),f;function l(u){return u.setHeader&&typeof u.abort==="function"}var d=()=>{};function y(u,m,E){var k,A;if(arguments.length===2)E=m,m=h;else if(m==null)m=h;else g(m,"options");if(_(E,"callback"),v(m.signal,"options.signal"),E=b(E),R(u)||le(u))return w(u,m,E);if(!ee(u))throw new o("stream",["ReadableStream","WritableStream","Stream"],u);let N=(k=m.readable)!==null&&k!==void 0?k:P(u),U=(A=m.writable)!==null&&A!==void 0?A:ie(u),K=u._writableState,he=u._readableState,J=()=>{if(!u.writable)V()},H=a(u)&&P(u)===N&&ie(u)===U,se=ue(u,!1),V=()=>{if(se=!0,u.destroyed)H=!1;if(H&&(!u.readable||N))return;if(!N||Q)E.call(u)},Q=C(u,!1),Be=()=>{if(Q=!0,u.destroyed)H=!1;if(H&&(!u.writable||U))return;if(!U||se)E.call(u)},z=(j)=>{E.call(u,j)},L=T(u),ae=()=>{L=!0;let j=q(u)||D(u);if(j&&typeof j!=="boolean")return E.call(u,j);if(N&&!Q&&P(u,!0)){if(!C(u,!1))return E.call(u,new s)}if(U&&!se){if(!ue(u,!1))return E.call(u,new s)}E.call(u)},G=()=>{L=!0;let j=q(u)||D(u);if(j&&typeof j!=="boolean")return E.call(u,j);E.call(u)},Y=()=>{u.req.on("finish",V)};if(l(u)){if(u.on("complete",V),!H)u.on("abort",ae);if(u.req)Y();else u.on("request",Y)}else if(U&&!K)u.on("end",J),u.on("close",J);if(!H&&typeof u.aborted==="boolean")u.on("aborted",ae);if(u.on("end",Be),u.on("finish",V),m.error!==!1)u.on("error",z);if(u.on("close",ae),L)r.nextTick(ae);else if(K!==null&&K!==void 0&&K.errorEmitted||he!==null&&he!==void 0&&he.errorEmitted){if(!H)r.nextTick(G)}else if(!N&&(!H||$(u))&&(se||B(u)===!1))r.nextTick(G);else if(!U&&(!H||B(u))&&(Q||$(u)===!1))r.nextTick(G);else if(he&&u.req&&u.aborted)r.nextTick(G);let Me=()=>{if(E=d,u.removeListener("aborted",ae),u.removeListener("complete",V),u.removeListener("abort",ae),u.removeListener("request",Y),u.req)u.req.removeListener("finish",V);u.removeListener("end",J),u.removeListener("close",J),u.removeListener("finish",V),u.removeListener("end",Be),u.removeListener("error",z),u.removeListener("close",ae)};if(m.signal&&!L){let j=()=>{let Z=E;Me(),Z.call(u,new i(void 0,{cause:m.signal.reason}))};if(m.signal.aborted)r.nextTick(j);else{f=f||Xr().addAbortListener;let Z=f(m.signal,j),je=E;E=b((...W)=>{Z[I](),je.apply(u,W)})}}return Me}function w(u,m,E){let k=!1,A=d;if(m.signal)if(A=()=>{k=!0,E.call(u,new i(void 0,{cause:m.signal.reason}))},m.signal.aborted)r.nextTick(A);else{f=f||Xr().addAbortListener;let U=f(m.signal,A),K=E;E=b((...he)=>{U[I](),K.apply(u,he)})}let N=(...U)=>{if(!k)r.nextTick(()=>E.apply(u,U))};return M(u[c].promise,N,N),d}function p(u,m){var E;let k=!1;if(m===null)m=h;if((E=m)!==null&&E!==void 0&&E.cleanup)S(m.cleanup,"cleanup"),k=m.cleanup;return new x((A,N)=>{let U=y(u,m,(K)=>{if(k)U();if(K)N(K);else A()})})}t.exports=y,t.exports.finished=p}),os=Tt((e,t)=>{var r=po(),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:n},AbortError:o}=Fr(),{Symbol:s}=Vt(),{kIsDestroyed:h,isDestroyed:b,isFinished:v,isServerRequest:_}=oi(),g=s("kDestroy"),S=s("kConstruct");function x(a,c,f){if(a){if(a.stack,c&&!c.errored)c.errored=a;if(f&&!f.errored)f.errored=a}}function M(a,c){let f=this._readableState,l=this._writableState,d=l||f;if(l!==null&&l!==void 0&&l.destroyed||f!==null&&f!==void 0&&f.destroyed){if(typeof c==="function")c();return this}if(x(a,l,f),l)l.destroyed=!0;if(f)f.destroyed=!0;if(!d.constructed)this.once(g,function(y){I(this,i(y,a),c)});else I(this,a,c);return this}function I(a,c,f){let l=!1;function d(y){if(l)return;l=!0;let{_readableState:w,_writableState:p}=a;if(x(y,p,w),p)p.closed=!0;if(w)w.closed=!0;if(typeof f==="function")f(y);if(y)r.nextTick(T,a,y);else r.nextTick($,a)}try{a._destroy(c||null,d)}catch(y){d(y)}}function T(a,c){P(a,c),$(a)}function $(a){let{_readableState:c,_writableState:f}=a;if(f)f.closeEmitted=!0;if(c)c.closeEmitted=!0;if(f!==null&&f!==void 0&&f.emitClose||c!==null&&c!==void 0&&c.emitClose)a.emit("close")}function P(a,c){let{_readableState:f,_writableState:l}=a;if(l!==null&&l!==void 0&&l.errorEmitted||f!==null&&f!==void 0&&f.errorEmitted)return;if(l)l.errorEmitted=!0;if(f)f.errorEmitted=!0;a.emit("error",c)}function R(){let a=this._readableState,c=this._writableState;if(a)a.constructed=!0,a.closed=!1,a.closeEmitted=!1,a.destroyed=!1,a.errored=null,a.errorEmitted=!1,a.reading=!1,a.ended=a.readable===!1,a.endEmitted=a.readable===!1;if(c)c.constructed=!0,c.destroyed=!1,c.closed=!1,c.closeEmitted=!1,c.errored=null,c.errorEmitted=!1,c.finalCalled=!1,c.prefinished=!1,c.ended=c.writable===!1,c.ending=c.writable===!1,c.finished=c.writable===!1}function C(a,c,f){let{_readableState:l,_writableState:d}=a;if(d!==null&&d!==void 0&&d.destroyed||l!==null&&l!==void 0&&l.destroyed)return this;if(l!==null&&l!==void 0&&l.autoDestroy||d!==null&&d!==void 0&&d.autoDestroy)a.destroy(c);else if(c){if(c.stack,d&&!d.errored)d.errored=c;if(l&&!l.errored)l.errored=c;if(f)r.nextTick(P,a,c);else P(a,c)}}function D(a,c){if(typeof a._construct!=="function")return;let{_readableState:f,_writableState:l}=a;if(f)f.constructed=!1;if(l)l.constructed=!1;if(a.once(S,c),a.listenerCount(S)>1)return;r.nextTick(B,a)}function B(a){let c=!1;function f(l){if(c){C(a,l!==null&&l!==void 0?l:new n);return}c=!0;let{_readableState:d,_writableState:y}=a,w=y||d;if(d)d.constructed=!0;if(y)y.constructed=!0;if(w.destroyed)a.emit(g,l);else if(l)C(a,l,!0);else r.nextTick(ie,a)}try{a._construct((l)=>{r.nextTick(f,l)})}catch(l){r.nextTick(f,l)}}function ie(a){a.emit(S)}function le(a){return(a===null||a===void 0?void 0:a.setHeader)&&typeof a.abort==="function"}function ue(a){a.emit("close")}function q(a,c){a.emit("error",c),r.nextTick(ue,a)}function ee(a,c){if(!a||b(a))return;if(!c&&!v(a))c=new o;if(_(a))a.socket=null,a.destroy(c);else if(le(a))a.abort();else if(le(a.req))a.req.abort();else if(typeof a.destroy==="function")a.destroy(c);else if(typeof a.close==="function")a.close();else if(c)r.nextTick(q,a,c);else r.nextTick(ue,a);if(!a.destroyed)a[h]=!0}t.exports={construct:D,destroyer:ee,destroy:M,undestroy:R,errorOrDestroy:C}}),bm=Tt((e,t)=>{var{ArrayIsArray:r,ObjectSetPrototypeOf:i}=Vt(),{EventEmitter:n}=(_a(),xt(ba));function o(h){n.call(this,h)}i(o.prototype,n.prototype),i(o,n),o.prototype.pipe=function(h,b){let v=this;function _($){if(h.writable&&h.write($)===!1&&v.pause)v.pause()}v.on("data",_);function g(){if(v.readable&&v.resume)v.resume()}if(h.on("drain",g),!h._isStdio&&(!b||b.end!==!1))v.on("end",x),v.on("close",M);let S=!1;function x(){if(S)return;S=!0,h.end()}function M(){if(S)return;if(S=!0,typeof h.destroy==="function")h.destroy()}function I($){if(T(),n.listenerCount(this,"error")===0)this.emit("error",$)}s(v,"error",I),s(h,"error",I);function T(){v.removeListener("data",_),h.removeListener("drain",g),v.removeListener("end",x),v.removeListener("close",M),v.removeListener("error",I),h.removeListener("error",I),v.removeListener("end",T),v.removeListener("close",T),h.removeListener("close",T)}return v.on("end",T),v.on("close",T),h.on("close",T),h.emit("pipe",v),h};function s(h,b,v){if(typeof h.prependListener==="function")return h.prependListener(b,v);if(!h._events||!h._events[b])h.on(b,v);else if(r(h._events[b]))h._events[b].unshift(v);else h._events[b]=[v,h._events[b]]}t.exports={Stream:o,prependListener:s}}),Oc=Tt((e,t)=>{var{SymbolDispose:r}=Vt(),{AbortError:i,codes:n}=Fr(),{isNodeStream:o,isWebStream:s,kControllerErrorFunction:h}=oi(),b=Ri(),{ERR_INVALID_ARG_TYPE:v}=n,_,g=(S,x)=>{if(typeof S!=="object"||!("aborted"in S))throw new v(x,"AbortSignal",S)};t.exports.addAbortSignal=function(S,x){if(g(S,"signal"),!o(x)&&!s(x))throw new v("stream",["ReadableStream","WritableStream","Stream"],x);return t.exports.addAbortSignalNoValidate(S,x)},t.exports.addAbortSignalNoValidate=function(S,x){if(typeof S!=="object"||!("aborted"in S))return x;let M=o(x)?()=>{x.destroy(new i(void 0,{cause:S.reason}))}:()=>{x[h](new i(void 0,{cause:S.reason}))};if(S.aborted)M();else{_=_||Xr().addAbortListener;let I=_(S,M);b(x,I[r])}return x}}),wT=Tt((e,t)=>{var{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:n,Uint8Array:o}=Vt(),{Buffer:s}=(Ir(),xt(Er)),{inspect:h}=Xr();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(b){let v={data:b,next:null};if(this.length>0)this.tail.next=v;else this.head=v;this.tail=v,++this.length}unshift(b){let v={data:b,next:this.head};if(this.length===0)this.tail=v;this.head=v,++this.length}shift(){if(this.length===0)return;let b=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,b}clear(){this.head=this.tail=null,this.length=0}join(b){if(this.length===0)return"";let v=this.head,_=""+v.data;while((v=v.next)!==null)_+=b+v.data;return _}concat(b){if(this.length===0)return s.alloc(0);let v=s.allocUnsafe(b>>>0),_=this.head,g=0;while(_)n(v,_.data,g),g+=_.data.length,_=_.next;return v}consume(b,v){let _=this.head.data;if(b<_.length){let g=_.slice(0,b);return this.head.data=_.slice(b),g}if(b===_.length)return this.shift();return v?this._getString(b):this._getBuffer(b)}first(){return this.head.data}*[i](){for(let b=this.head;b;b=b.next)yield b.data}_getString(b){let v="",_=this.head,g=0;do{let S=_.data;if(b>S.length)v+=S,b-=S.length;else{if(b===S.length)if(v+=S,++g,_.next)this.head=_.next;else this.head=this.tail=null;else v+=r(S,0,b),this.head=_,_.data=r(S,b);break}++g}while((_=_.next)!==null);return this.length-=g,v}_getBuffer(b){let v=s.allocUnsafe(b),_=b,g=this.head,S=0;do{let x=g.data;if(b>x.length)n(v,x,_-b),b-=x.length;else{if(b===x.length)if(n(v,x,_-b),++S,g.next)this.head=g.next;else this.head=this.tail=null;else n(v,new o(x.buffer,x.byteOffset,b),_-b),this.head=g,g.data=x.slice(b);break}++S}while((g=g.next)!==null);return this.length-=S,v}[Symbol.for("nodejs.util.inspect.custom")](b,v){return h(this,{...v,depth:0,customInspect:!1})}}}),Nc=Tt((e,t)=>{var{MathFloor:r,NumberIsInteger:i}=Vt(),{validateInteger:n}=Sa(),{ERR_INVALID_ARG_VALUE:o}=Fr().codes,s=16384,h=16;function b(S,x,M){return S.highWaterMark!=null?S.highWaterMark:x?S[M]:null}function v(S){return S?h:s}function _(S,x){if(n(x,"value",0),S)h=x;else s=x}function g(S,x,M,I){let T=b(x,I,M);if(T!=null){if(!i(T)||T<0){let $=I?`options.${M}`:"options.highWaterMark";throw new o($,T)}return r(T)}return v(S.objectMode)}t.exports={getHighWaterMark:g,getDefaultHighWaterMark:v,setDefaultHighWaterMark:_}}),ST=Tt((e,t)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var r=(Ir(),xt(Er)),i=r.Buffer;function n(s,h){for(var b in s)h[b]=s[b]}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow)t.exports=r;else n(r,e),e.Buffer=o;function o(s,h,b){return i(s,h,b)}o.prototype=Object.create(i.prototype),n(i,o),o.from=function(s,h,b){if(typeof s==="number")throw TypeError("Argument must not be a number");return i(s,h,b)},o.alloc=function(s,h,b){if(typeof s!=="number")throw TypeError("Argument must be a number");var v=i(s);if(h!==void 0)if(typeof b==="string")v.fill(h,b);else v.fill(h);else v.fill(0);return v},o.allocUnsafe=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return i(s)},o.allocUnsafeSlow=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return r.SlowBuffer(s)}}),xT=Tt((e)=>{var t=ST().Buffer,r=t.isEncoding||function(P){switch(P=""+P,P&&P.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(P){if(!P)return"utf8";var R;while(!0)switch(P){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return P;default:if(R)return;P=(""+P).toLowerCase(),R=!0}}function n(P){var R=i(P);if(typeof R!=="string"&&(t.isEncoding===r||!r(P)))throw Error("Unknown encoding: "+P);return R||P}e.StringDecoder=o;function o(P){this.encoding=n(P);var R;switch(this.encoding){case"utf16le":this.text=S,this.end=x,R=4;break;case"utf8":this.fillLast=v,R=4;break;case"base64":this.text=M,this.end=I,R=3;break;default:this.write=T,this.end=$;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(R)}o.prototype.write=function(P){if(P.length===0)return"";var R,C;if(this.lastNeed){if(R=this.fillLast(P),R===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;if(C<P.length)return R?R+this.text(P,C):this.text(P,C);return R||""},o.prototype.end=g,o.prototype.text=_,o.prototype.fillLast=function(P){if(this.lastNeed<=P.length)return P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,this.lastTotal-this.lastNeed,0,P.length),this.lastNeed-=P.length};function s(P){if(P<=127)return 0;else if(P>>5===6)return 2;else if(P>>4===14)return 3;else if(P>>3===30)return 4;return P>>6===2?-1:-2}function h(P,R,C){var D=R.length-1;if(D<C)return 0;var B=s(R[D]);if(B>=0){if(B>0)P.lastNeed=B-1;return B}if(--D<C||B===-2)return 0;if(B=s(R[D]),B>=0){if(B>0)P.lastNeed=B-2;return B}if(--D<C||B===-2)return 0;if(B=s(R[D]),B>=0){if(B>0)if(B===2)B=0;else P.lastNeed=B-3;return B}return 0}function b(P,R,C){if((R[0]&192)!==128)return P.lastNeed=0,"�";if(P.lastNeed>1&&R.length>1){if((R[1]&192)!==128)return P.lastNeed=1,"�";if(P.lastNeed>2&&R.length>2){if((R[2]&192)!==128)return P.lastNeed=2,"�"}}}function v(P){var R=this.lastTotal-this.lastNeed,C=b(this,P,R);if(C!==void 0)return C;if(this.lastNeed<=P.length)return P.copy(this.lastChar,R,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);P.copy(this.lastChar,R,0,P.length),this.lastNeed-=P.length}function _(P,R){var C=h(this,P,R);if(!this.lastNeed)return P.toString("utf8",R);this.lastTotal=C;var D=P.length-(C-this.lastNeed);return P.copy(this.lastChar,0,D),P.toString("utf8",R,D)}function g(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed)return R+"�";return R}function S(P,R){if((P.length-R)%2===0){var C=P.toString("utf16le",R);if(C){var D=C.charCodeAt(C.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=P[P.length-1],P.toString("utf16le",R,P.length-1)}function x(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return R+this.lastChar.toString("utf16le",0,C)}return R}function M(P,R){var C=(P.length-R)%3;if(C===0)return P.toString("base64",R);if(this.lastNeed=3-C,this.lastTotal=3,C===1)this.lastChar[0]=P[P.length-1];else this.lastChar[0]=P[P.length-2],this.lastChar[1]=P[P.length-1];return P.toString("base64",R,P.length-C)}function I(P){var R=P&&P.length?this.write(P):"";if(this.lastNeed)return R+this.lastChar.toString("base64",0,3-this.lastNeed);return R}function T(P){return P.toString(this.encoding)}function $(P){return P&&P.length?this.write(P):""}}),X1=Tt((e,t)=>{var r=po(),{PromisePrototypeThen:i,SymbolAsyncIterator:n,SymbolIterator:o}=Vt(),{Buffer:s}=(Ir(),xt(Er)),{ERR_INVALID_ARG_TYPE:h,ERR_STREAM_NULL_VALUES:b}=Fr().codes;function v(_,g,S){let x;if(typeof g==="string"||g instanceof s)return new _({objectMode:!0,...S,read(){this.push(g),this.push(null)}});let M;if(g&&g[n])M=!0,x=g[n]();else if(g&&g[o])M=!1,x=g[o]();else throw new h("iterable",["Iterable"],g);let I=new _({objectMode:!0,highWaterMark:1,...S}),T=!1;I._read=function(){if(!T)T=!0,P()},I._destroy=function(R,C){i($(R),()=>r.nextTick(C,R),(D)=>r.nextTick(C,D||R))};async function $(R){let C=R!==void 0&&R!==null,D=typeof x.throw==="function";if(C&&D){let{value:B,done:ie}=await x.throw(R);if(await B,ie)return}if(typeof x.return==="function"){let{value:B}=await x.return();await B}}async function P(){for(;;){try{let{value:R,done:C}=M?await x.next():x.next();if(C)I.push(null);else{let D=R&&typeof R.then==="function"?await R:R;if(D===null)throw T=!1,new b;else if(I.push(D))continue;else T=!1}}catch(R){I.destroy(R)}break}}return I}t.exports=v}),Dc=Tt((e,t)=>{var r=po(),{ArrayPrototypeIndexOf:i,NumberIsInteger:n,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:h,ObjectKeys:b,ObjectSetPrototypeOf:v,Promise:_,SafeSet:g,SymbolAsyncDispose:S,SymbolAsyncIterator:x,Symbol:M}=Vt();t.exports=W,W.ReadableState=je;var{EventEmitter:I}=(_a(),xt(ba)),{Stream:T,prependListener:$}=bm(),{Buffer:P}=(Ir(),xt(Er)),{addAbortSignal:R}=Oc(),C=Ri(),D=Xr().debuglog("stream",(O)=>{D=O}),B=wT(),ie=os(),{getHighWaterMark:le,getDefaultHighWaterMark:ue}=Nc(),{aggregateTwoErrors:q,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:a,ERR_OUT_OF_RANGE:c,ERR_STREAM_PUSH_AFTER_EOF:f,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:l},AbortError:d}=Fr(),{validateObject:y}=Sa(),w=M("kPaused"),{StringDecoder:p}=xT(),u=X1();v(W.prototype,T.prototype),v(W,T);var m=()=>{},{errorOrDestroy:E}=ie,k=1,A=2,N=4,U=8,K=16,he=32,J=64,H=128,se=256,V=512,Q=1024,Be=2048,z=4096,L=8192,ae=16384,G=32768,Y=65536,Me=131072,j=262144;function Z(O){return{enumerable:!1,get(){return(this.state&O)!==0},set(F){if(F)this.state|=O;else this.state&=~O}}}h(je.prototype,{objectMode:Z(k),ended:Z(A),endEmitted:Z(N),reading:Z(U),constructed:Z(K),sync:Z(he),needReadable:Z(J),emittedReadable:Z(H),readableListening:Z(se),resumeScheduled:Z(V),errorEmitted:Z(Q),emitClose:Z(Be),autoDestroy:Z(z),destroyed:Z(L),closed:Z(ae),closeEmitted:Z(G),multiAwaitDrain:Z(Y),readingMore:Z(Me),dataEmitted:Z(j)});function je(O,F,X){if(typeof X!=="boolean")X=F instanceof ii();if(this.state=Be|z|K|he,O&&O.objectMode)this.state|=k;if(X&&O&&O.readableObjectMode)this.state|=k;if(this.highWaterMark=O?le(this,O,"readableHighWaterMark",X):ue(!1),this.buffer=new B,this.length=0,this.pipes=[],this.flowing=null,this[w]=null,O&&O.emitClose===!1)this.state&=~Be;if(O&&O.autoDestroy===!1)this.state&=~z;if(this.errored=null,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,O&&O.encoding)this.decoder=new p(O.encoding),this.encoding=O.encoding}function W(O){if(!(this instanceof W))return new W(O);let F=this instanceof ii();if(this._readableState=new je(O,this,F),O){if(typeof O.read==="function")this._read=O.read;if(typeof O.destroy==="function")this._destroy=O.destroy;if(typeof O.construct==="function")this._construct=O.construct;if(O.signal&&!F)R(O.signal,this)}T.call(this,O),ie.construct(this,()=>{if(this._readableState.needReadable)xe(this,this._readableState)})}W.prototype.destroy=ie.destroy,W.prototype._undestroy=ie.undestroy,W.prototype._destroy=function(O,F){F(O)},W.prototype[I.captureRejectionSymbol]=function(O){this.destroy(O)},W.prototype[S]=function(){let O;if(!this.destroyed)O=this.readableEnded?null:new d,this.destroy(O);return new _((F,X)=>C(this,(te)=>te&&te!==O?X(te):F(null)))},W.prototype.push=function(O,F){return re(this,O,F,!1)},W.prototype.unshift=function(O,F){return re(this,O,F,!0)};function re(O,F,X,te){D("readableAddChunk",F);let We=O._readableState,me;if((We.state&k)===0){if(typeof F==="string"){if(X=X||We.defaultEncoding,We.encoding!==X)if(te&&We.encoding)F=P.from(F,X).toString(We.encoding);else F=P.from(F,X),X=""}else if(F instanceof P)X="";else if(T._isUint8Array(F))F=T._uint8ArrayToBuffer(F),X="";else if(F!=null)me=new ee("chunk",["string","Buffer","Uint8Array"],F)}if(me)E(O,me);else if(F===null)We.state&=~U,pe(O,We);else if((We.state&k)!==0||F&&F.length>0)if(te)if((We.state&N)!==0)E(O,new l);else if(We.destroyed||We.errored)return!1;else st(O,We,F,!0);else if(We.ended)E(O,new f);else if(We.destroyed||We.errored)return!1;else if(We.state&=~U,We.decoder&&!X)if(F=We.decoder.write(F),We.objectMode||F.length!==0)st(O,We,F,!1);else xe(O,We);else st(O,We,F,!1);else if(!te)We.state&=~U,xe(O,We);return!We.ended&&(We.length<We.highWaterMark||We.length===0)}function st(O,F,X,te){if(F.flowing&&F.length===0&&!F.sync&&O.listenerCount("data")>0){if((F.state&Y)!==0)F.awaitDrainWriters.clear();else F.awaitDrainWriters=null;F.dataEmitted=!0,O.emit("data",X)}else{if(F.length+=F.objectMode?1:X.length,te)F.buffer.unshift(X);else F.buffer.push(X);if((F.state&J)!==0)ve(O)}xe(O,F)}W.prototype.isPaused=function(){let O=this._readableState;return O[w]===!0||O.flowing===!1},W.prototype.setEncoding=function(O){let F=new p(O);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;let X=this._readableState.buffer,te="";for(let We of X)te+=F.write(We);if(X.clear(),te!=="")X.push(te);return this._readableState.length=te.length,this};var ge=1073741824;function ye(O){if(O>ge)throw new c("size","<= 1GiB",O);else O--,O|=O>>>1,O|=O>>>2,O|=O>>>4,O|=O>>>8,O|=O>>>16,O++;return O}function Gt(O,F){if(O<=0||F.length===0&&F.ended)return 0;if((F.state&k)!==0)return 1;if(o(O)){if(F.flowing&&F.length)return F.buffer.first().length;return F.length}if(O<=F.length)return O;return F.ended?F.length:0}W.prototype.read=function(O){if(D("read",O),O===void 0)O=NaN;else if(!n(O))O=s(O,10);let F=this._readableState,X=O;if(O>F.highWaterMark)F.highWaterMark=ye(O);if(O!==0)F.state&=~H;if(O===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended)){if(D("read: emitReadable",F.length,F.ended),F.length===0&&F.ended)xr(this);else ve(this);return null}if(O=Gt(O,F),O===0&&F.ended){if(F.length===0)xr(this);return null}let te=(F.state&J)!==0;if(D("need readable",te),F.length===0||F.length-O<F.highWaterMark)te=!0,D("length less than watermark",te);if(F.ended||F.reading||F.destroyed||F.errored||!F.constructed)te=!1,D("reading, ended or constructing",te);else if(te){if(D("do read"),F.state|=U|he,F.length===0)F.state|=J;try{this._read(F.highWaterMark)}catch(me){E(this,me)}if(F.state&=~he,!F.reading)O=Gt(X,F)}let We;if(O>0)We=Te(O,F);else We=null;if(We===null)F.needReadable=F.length<=F.highWaterMark,O=0;else if(F.length-=O,F.multiAwaitDrain)F.awaitDrainWriters.clear();else F.awaitDrainWriters=null;if(F.length===0){if(!F.ended)F.needReadable=!0;if(X!==O&&F.ended)xr(this)}if(We!==null&&!F.errorEmitted&&!F.closeEmitted)F.dataEmitted=!0,this.emit("data",We);return We};function pe(O,F){if(D("onEofChunk"),F.ended)return;if(F.decoder){let X=F.decoder.end();if(X&&X.length)F.buffer.push(X),F.length+=F.objectMode?1:X.length}if(F.ended=!0,F.sync)ve(O);else F.needReadable=!1,F.emittedReadable=!0,er(O)}function ve(O){let F=O._readableState;if(D("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,!F.emittedReadable)D("emitReadable",F.flowing),F.emittedReadable=!0,r.nextTick(er,O)}function er(O){let F=O._readableState;if(D("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&!F.errored&&(F.length||F.ended))O.emit("readable"),F.emittedReadable=!1;F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,Ie(O)}function xe(O,F){if(!F.readingMore&&F.constructed)F.readingMore=!0,r.nextTick(Se,O,F)}function Se(O,F){while(!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0)){let X=F.length;if(D("maybeReadMore read 0"),O.read(0),X===F.length)break}F.readingMore=!1}W.prototype._read=function(O){throw new a("_read()")},W.prototype.pipe=function(O,F){let X=this,te=this._readableState;if(te.pipes.length===1){if(!te.multiAwaitDrain)te.multiAwaitDrain=!0,te.awaitDrainWriters=new g(te.awaitDrainWriters?[te.awaitDrainWriters]:[])}te.pipes.push(O),D("pipe count=%d opts=%j",te.pipes.length,F);let We=(!F||F.end!==!1)&&O!==r.stdout&&O!==r.stderr?we:dt;if(te.endEmitted)r.nextTick(We);else X.once("end",We);O.on("unpipe",me);function me(Dt,Pt){if(D("onunpipe"),Dt===X){if(Pt&&Pt.hasUnpiped===!1)Pt.hasUnpiped=!0,ze()}}function we(){D("onend"),O.end()}let Jt,Pe=!1;function ze(){if(D("cleanup"),O.removeListener("close",Xt),O.removeListener("finish",pt),Jt)O.removeListener("drain",Jt);if(O.removeListener("error",ke),O.removeListener("unpipe",me),X.removeListener("end",we),X.removeListener("end",dt),X.removeListener("data",Ae),Pe=!0,Jt&&te.awaitDrainWriters&&(!O._writableState||O._writableState.needDrain))Jt()}function $r(){if(!Pe){if(te.pipes.length===1&&te.pipes[0]===O)D("false write response, pause",0),te.awaitDrainWriters=O,te.multiAwaitDrain=!1;else if(te.pipes.length>1&&te.pipes.includes(O))D("false write response, pause",te.awaitDrainWriters.size),te.awaitDrainWriters.add(O);X.pause()}if(!Jt)Jt=Or(X,O),O.on("drain",Jt)}X.on("data",Ae);function Ae(Dt){D("ondata");let Pt=O.write(Dt);if(D("dest.write",Pt),Pt===!1)$r()}function ke(Dt){if(D("onerror",Dt),dt(),O.removeListener("error",ke),O.listenerCount("error")===0){let Pt=O._writableState||O._readableState;if(Pt&&!Pt.errorEmitted)E(O,Dt);else O.emit("error",Dt)}}$(O,"error",ke);function Xt(){O.removeListener("finish",pt),dt()}O.once("close",Xt);function pt(){D("onfinish"),O.removeListener("close",Xt),dt()}O.once("finish",pt);function dt(){D("unpipe"),X.unpipe(O)}if(O.emit("pipe",X),O.writableNeedDrain===!0)$r();else if(!te.flowing)D("pipe resume"),X.resume();return O};function Or(O,F){return function(){let X=O._readableState;if(X.awaitDrainWriters===F)D("pipeOnDrain",1),X.awaitDrainWriters=null;else if(X.multiAwaitDrain)D("pipeOnDrain",X.awaitDrainWriters.size),X.awaitDrainWriters.delete(F);if((!X.awaitDrainWriters||X.awaitDrainWriters.size===0)&&O.listenerCount("data"))O.resume()}}W.prototype.unpipe=function(O){let F=this._readableState,X={hasUnpiped:!1};if(F.pipes.length===0)return this;if(!O){let We=F.pipes;F.pipes=[],this.pause();for(let me=0;me<We.length;me++)We[me].emit("unpipe",this,{hasUnpiped:!1});return this}let te=i(F.pipes,O);if(te===-1)return this;if(F.pipes.splice(te,1),F.pipes.length===0)this.pause();return O.emit("unpipe",this,X),this},W.prototype.on=function(O,F){let X=T.prototype.on.call(this,O,F),te=this._readableState;if(O==="data"){if(te.readableListening=this.listenerCount("readable")>0,te.flowing!==!1)this.resume()}else if(O==="readable"){if(!te.endEmitted&&!te.readableListening){if(te.readableListening=te.needReadable=!0,te.flowing=!1,te.emittedReadable=!1,D("on readable",te.length,te.reading),te.length)ve(this);else if(!te.reading)r.nextTick(Re,this)}}return X},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(O,F){let X=T.prototype.removeListener.call(this,O,F);if(O==="readable")r.nextTick(Ee,this);return X},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(O){let F=T.prototype.removeAllListeners.apply(this,arguments);if(O==="readable"||O===void 0)r.nextTick(Ee,this);return F};function Ee(O){let F=O._readableState;if(F.readableListening=O.listenerCount("readable")>0,F.resumeScheduled&&F[w]===!1)F.flowing=!0;else if(O.listenerCount("data")>0)O.resume();else if(!F.readableListening)F.flowing=null}function Re(O){D("readable nexttick read 0"),O.read(0)}W.prototype.resume=function(){let O=this._readableState;if(!O.flowing)D("resume"),O.flowing=!O.readableListening,Nr(this,O);return O[w]=!1,this};function Nr(O,F){if(!F.resumeScheduled)F.resumeScheduled=!0,r.nextTick(Ce,O,F)}function Ce(O,F){if(D("resume",F.reading),!F.reading)O.read(0);if(F.resumeScheduled=!1,O.emit("resume"),Ie(O),F.flowing&&!F.reading)O.read(0)}W.prototype.pause=function(){if(D("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)D("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[w]=!0,this};function Ie(O){let F=O._readableState;D("flow",F.flowing);while(F.flowing&&O.read()!==null);}W.prototype.wrap=function(O){let F=!1;O.on("data",(te)=>{if(!this.push(te)&&O.pause)F=!0,O.pause()}),O.on("end",()=>{this.push(null)}),O.on("error",(te)=>{E(this,te)}),O.on("close",()=>{this.destroy()}),O.on("destroy",()=>{this.destroy()}),this._read=()=>{if(F&&O.resume)F=!1,O.resume()};let X=b(O);for(let te=1;te<X.length;te++){let We=X[te];if(this[We]===void 0&&typeof O[We]==="function")this[We]=O[We].bind(O)}return this},W.prototype[x]=function(){return Tr(this)},W.prototype.iterator=function(O){if(O!==void 0)y(O,"options");return Tr(this,O)};function Tr(O,F){if(typeof O.read!=="function")O=W.wrap(O,{objectMode:!0});let X=Oe(O,F);return X.stream=O,X}async function*Oe(O,F){let X=m;function te(we){if(this===O)X(),X=m;else X=we}O.on("readable",te);let We,me=C(O,{writable:!1},(we)=>{We=we?q(We,we):null,X(),X=m});try{while(!0){let we=O.destroyed?null:O.read();if(we!==null)yield we;else if(We)throw We;else if(We===null)return;else await new _(te)}}catch(we){throw We=q(We,we),We}finally{if((We||(F===null||F===void 0?void 0:F.destroyOnReturn)!==!1)&&(We===void 0||O._readableState.autoDestroy))ie.destroyer(O,null);else O.off("readable",te),me()}}h(W.prototype,{readable:{__proto__:null,get(){let O=this._readableState;return!!O&&O.readable!==!1&&!O.destroyed&&!O.errorEmitted&&!O.endEmitted},set(O){if(this._readableState)this._readableState.readable=!!O}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(O){if(this._readableState)this._readableState.flowing=O}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(O){if(!this._readableState)return;this._readableState.destroyed=O}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),h(je.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[w]!==!1},set(O){this[w]=!!O}}}),W._fromList=Te;function Te(O,F){if(F.length===0)return null;let X;if(F.objectMode)X=F.buffer.shift();else if(!O||O>=F.length){if(F.decoder)X=F.buffer.join("");else if(F.buffer.length===1)X=F.buffer.first();else X=F.buffer.concat(F.length);F.buffer.clear()}else X=F.buffer.consume(O,F.decoder);return X}function xr(O){let F=O._readableState;if(D("endReadable",F.endEmitted),!F.endEmitted)F.ended=!0,r.nextTick(Ne,F,O)}function Ne(O,F){if(D("endReadableNT",O.endEmitted,O.length),!O.errored&&!O.closeEmitted&&!O.endEmitted&&O.length===0){if(O.endEmitted=!0,F.emit("end"),F.writable&&F.allowHalfOpen===!1)r.nextTick(De,F);else if(O.autoDestroy){let X=F._writableState;if(!X||X.autoDestroy&&(X.finished||X.writable===!1))F.destroy()}}}function De(O){if(O.writable&&!O.writableEnded&&!O.destroyed)O.end()}W.from=function(O,F){return u(W,O,F)};var kr;function $e(){if(kr===void 0)kr={};return kr}W.fromWeb=function(O,F){return $e().newStreamReadableFromReadableStream(O,F)},W.toWeb=function(O,F){return $e().newReadableStreamFromStreamReadable(O,F)},W.wrap=function(O,F){var X,te;return new W({objectMode:(X=(te=O.readableObjectMode)!==null&&te!==void 0?te:O.objectMode)!==null&&X!==void 0?X:!0,...F,destroy(We,me){ie.destroyer(O,We),me(We)}}).wrap(O)}}),_m=Tt((e,t)=>{var r=po(),{ArrayPrototypeSlice:i,Error:n,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:h,ObjectSetPrototypeOf:b,StringPrototypeToLowerCase:v,Symbol:_,SymbolHasInstance:g}=Vt();t.exports=y,y.WritableState=l;var{EventEmitter:S}=(_a(),xt(ba)),x=bm().Stream,{Buffer:M}=(Ir(),xt(Er)),I=os(),{addAbortSignal:T}=Oc(),{getHighWaterMark:$,getDefaultHighWaterMark:P}=Nc(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_MULTIPLE_CALLBACK:D,ERR_STREAM_CANNOT_PIPE:B,ERR_STREAM_DESTROYED:ie,ERR_STREAM_ALREADY_FINISHED:le,ERR_STREAM_NULL_VALUES:ue,ERR_STREAM_WRITE_AFTER_END:q,ERR_UNKNOWN_ENCODING:ee}=Fr().codes,{errorOrDestroy:a}=I;b(y.prototype,x.prototype),b(y,x);function c(){}var f=_("kOnFinished");function l(z,L,ae){if(typeof ae!=="boolean")ae=L instanceof ii();if(this.objectMode=!!(z&&z.objectMode),ae)this.objectMode=this.objectMode||!!(z&&z.writableObjectMode);this.highWaterMark=z?$(this,z,"writableHighWaterMark",ae):P(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let G=!!(z&&z.decodeStrings===!1);this.decodeStrings=!G,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=E.bind(void 0,L),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,d(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!z||z.emitClose!==!1,this.autoDestroy=!z||z.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[f]=[]}function d(z){z.buffered=[],z.bufferedIndex=0,z.allBuffers=!0,z.allNoop=!0}l.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},s(l.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function y(z){let L=this instanceof ii();if(!L&&!o(y,this))return new y(z);if(this._writableState=new l(z,this,L),z){if(typeof z.write==="function")this._write=z.write;if(typeof z.writev==="function")this._writev=z.writev;if(typeof z.destroy==="function")this._destroy=z.destroy;if(typeof z.final==="function")this._final=z.final;if(typeof z.construct==="function")this._construct=z.construct;if(z.signal)T(z.signal,this)}x.call(this,z),I.construct(this,()=>{let ae=this._writableState;if(!ae.writing)U(this,ae);H(this,ae)})}s(y,g,{__proto__:null,value:function(z){if(o(this,z))return!0;if(this!==y)return!1;return z&&z._writableState instanceof l}}),y.prototype.pipe=function(){a(this,new B)};function w(z,L,ae,G){let Y=z._writableState;if(typeof ae==="function")G=ae,ae=Y.defaultEncoding;else{if(!ae)ae=Y.defaultEncoding;else if(ae!=="buffer"&&!M.isEncoding(ae))throw new ee(ae);if(typeof G!=="function")G=c}if(L===null)throw new ue;else if(!Y.objectMode)if(typeof L==="string"){if(Y.decodeStrings!==!1)L=M.from(L,ae),ae="buffer"}else if(L instanceof M)ae="buffer";else if(x._isUint8Array(L))L=x._uint8ArrayToBuffer(L),ae="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],L);let Me;if(Y.ending)Me=new q;else if(Y.destroyed)Me=new ie("write");if(Me)return r.nextTick(G,Me),a(z,Me,!0),Me;return Y.pendingcb++,p(z,Y,L,ae,G)}y.prototype.write=function(z,L,ae){return w(this,z,L,ae)===!0},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){let z=this._writableState;if(z.corked){if(z.corked--,!z.writing)U(this,z)}},y.prototype.setDefaultEncoding=function(z){if(typeof z==="string")z=v(z);if(!M.isEncoding(z))throw new ee(z);return this._writableState.defaultEncoding=z,this};function p(z,L,ae,G,Y){let Me=L.objectMode?1:ae.length;L.length+=Me;let j=L.length<L.highWaterMark;if(!j)L.needDrain=!0;if(L.writing||L.corked||L.errored||!L.constructed){if(L.buffered.push({chunk:ae,encoding:G,callback:Y}),L.allBuffers&&G!=="buffer")L.allBuffers=!1;if(L.allNoop&&Y!==c)L.allNoop=!1}else L.writelen=Me,L.writecb=Y,L.writing=!0,L.sync=!0,z._write(ae,G,L.onwrite),L.sync=!1;return j&&!L.errored&&!L.destroyed}function u(z,L,ae,G,Y,Me,j){if(L.writelen=G,L.writecb=j,L.writing=!0,L.sync=!0,L.destroyed)L.onwrite(new ie("write"));else if(ae)z._writev(Y,L.onwrite);else z._write(Y,Me,L.onwrite);L.sync=!1}function m(z,L,ae,G){--L.pendingcb,G(ae),N(L),a(z,ae)}function E(z,L){let ae=z._writableState,G=ae.sync,Y=ae.writecb;if(typeof Y!=="function"){a(z,new D);return}if(ae.writing=!1,ae.writecb=null,ae.length-=ae.writelen,ae.writelen=0,L){if(L.stack,!ae.errored)ae.errored=L;if(z._readableState&&!z._readableState.errored)z._readableState.errored=L;if(G)r.nextTick(m,z,ae,L,Y);else m(z,ae,L,Y)}else{if(ae.buffered.length>ae.bufferedIndex)U(z,ae);if(G)if(ae.afterWriteTickInfo!==null&&ae.afterWriteTickInfo.cb===Y)ae.afterWriteTickInfo.count++;else ae.afterWriteTickInfo={count:1,cb:Y,stream:z,state:ae},r.nextTick(k,ae.afterWriteTickInfo);else A(z,ae,1,Y)}}function k({stream:z,state:L,count:ae,cb:G}){return L.afterWriteTickInfo=null,A(z,L,ae,G)}function A(z,L,ae,G){if(!L.ending&&!z.destroyed&&L.length===0&&L.needDrain)L.needDrain=!1,z.emit("drain");while(ae-- >0)L.pendingcb--,G();if(L.destroyed)N(L);H(z,L)}function N(z){if(z.writing)return;for(let Y=z.bufferedIndex;Y<z.buffered.length;++Y){var L;let{chunk:Me,callback:j}=z.buffered[Y],Z=z.objectMode?1:Me.length;z.length-=Z,j((L=z.errored)!==null&&L!==void 0?L:new ie("write"))}let ae=z[f].splice(0);for(let Y=0;Y<ae.length;Y++){var G;ae[Y]((G=z.errored)!==null&&G!==void 0?G:new ie("end"))}d(z)}function U(z,L){if(L.corked||L.bufferProcessing||L.destroyed||!L.constructed)return;let{buffered:ae,bufferedIndex:G,objectMode:Y}=L,Me=ae.length-G;if(!Me)return;let j=G;if(L.bufferProcessing=!0,Me>1&&z._writev){L.pendingcb-=Me-1;let Z=L.allNoop?c:(W)=>{for(let re=j;re<ae.length;++re)ae[re].callback(W)},je=L.allNoop&&j===0?ae:i(ae,j);je.allBuffers=L.allBuffers,u(z,L,!0,L.length,je,"",Z),d(L)}else{do{let{chunk:Z,encoding:je,callback:W}=ae[j];ae[j++]=null;let re=Y?1:Z.length;u(z,L,!1,re,Z,je,W)}while(j<ae.length&&!L.writing);if(j===ae.length)d(L);else if(j>256)ae.splice(0,j),L.bufferedIndex=0;else L.bufferedIndex=j}L.bufferProcessing=!1}y.prototype._write=function(z,L,ae){if(this._writev)this._writev([{chunk:z,encoding:L}],ae);else throw new C("_write()")},y.prototype._writev=null,y.prototype.end=function(z,L,ae){let G=this._writableState;if(typeof z==="function")ae=z,z=null,L=null;else if(typeof L==="function")ae=L,L=null;let Y;if(z!==null&&z!==void 0){let Me=w(this,z,L);if(Me instanceof n)Y=Me}if(G.corked)G.corked=1,this.uncork();if(Y);else if(!G.errored&&!G.ending)G.ending=!0,H(this,G,!0),G.ended=!0;else if(G.finished)Y=new le("end");else if(G.destroyed)Y=new ie("end");if(typeof ae==="function")if(Y||G.finished)r.nextTick(ae,Y);else G[f].push(ae);return this};function K(z){return z.ending&&!z.destroyed&&z.constructed&&z.length===0&&!z.errored&&z.buffered.length===0&&!z.finished&&!z.writing&&!z.errorEmitted&&!z.closeEmitted}function he(z,L){let ae=!1;function G(Y){if(ae){a(z,Y!==null&&Y!==void 0?Y:D());return}if(ae=!0,L.pendingcb--,Y){let Me=L[f].splice(0);for(let j=0;j<Me.length;j++)Me[j](Y);a(z,Y,L.sync)}else if(K(L))L.prefinished=!0,z.emit("prefinish"),L.pendingcb++,r.nextTick(se,z,L)}L.sync=!0,L.pendingcb++;try{z._final(G)}catch(Y){G(Y)}L.sync=!1}function J(z,L){if(!L.prefinished&&!L.finalCalled)if(typeof z._final==="function"&&!L.destroyed)L.finalCalled=!0,he(z,L);else L.prefinished=!0,z.emit("prefinish")}function H(z,L,ae){if(K(L)){if(J(z,L),L.pendingcb===0){if(ae)L.pendingcb++,r.nextTick((G,Y)=>{if(K(Y))se(G,Y);else Y.pendingcb--},z,L);else if(K(L))L.pendingcb++,se(z,L)}}}function se(z,L){L.pendingcb--,L.finished=!0;let ae=L[f].splice(0);for(let G=0;G<ae.length;G++)ae[G]();if(z.emit("finish"),L.autoDestroy){let G=z._readableState;if(!G||G.autoDestroy&&(G.endEmitted||G.readable===!1))z.destroy()}}h(y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(z){if(this._writableState)this._writableState.destroyed=z}},writable:{__proto__:null,get(){let z=this._writableState;return!!z&&z.writable!==!1&&!z.destroyed&&!z.errored&&!z.ending&&!z.ended},set(z){if(this._writableState)this._writableState.writable=!!z}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let z=this._writableState;if(!z)return!1;return!z.destroyed&&!z.ending&&z.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var V=I.destroy;y.prototype.destroy=function(z,L){let ae=this._writableState;if(!ae.destroyed&&(ae.bufferedIndex<ae.buffered.length||ae[f].length))r.nextTick(N,ae);return V.call(this,z,L),this},y.prototype._undestroy=I.undestroy,y.prototype._destroy=function(z,L){L(z)},y.prototype[S.captureRejectionSymbol]=function(z){this.destroy(z)};var Q;function Be(){if(Q===void 0)Q={};return Q}y.fromWeb=function(z,L){return Be().newStreamWritableFromWritableStream(z,L)},y.toWeb=function(z){return Be().newWritableStreamFromStreamWritable(z)}}),kT=Tt((e,t)=>{var r=po(),i=(Ir(),xt(Er)),{isReadable:n,isWritable:o,isIterable:s,isNodeStream:h,isReadableNodeStream:b,isWritableNodeStream:v,isDuplexNodeStream:_,isReadableStream:g,isWritableStream:S}=oi(),x=Ri(),{AbortError:M,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:T}}=Fr(),{destroyer:$}=os(),P=ii(),R=Dc(),C=_m(),{createDeferredPromise:D}=Xr(),B=X1(),ie=globalThis.Blob||i.Blob,le=typeof ie<"u"?function(f){return f instanceof ie}:function(f){return!1},ue=globalThis.AbortController||wa().AbortController,{FunctionPrototypeCall:q}=Vt();class ee extends P{constructor(f){super(f);if((f===null||f===void 0?void 0:f.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((f===null||f===void 0?void 0:f.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}t.exports=function f(l,d){if(_(l))return l;if(b(l))return c({readable:l});if(v(l))return c({writable:l});if(h(l))return c({writable:!1,readable:!1});if(g(l))return c({readable:R.fromWeb(l)});if(S(l))return c({writable:C.fromWeb(l)});if(typeof l==="function"){let{value:w,write:p,final:u,destroy:m}=a(l);if(s(w))return B(ee,w,{objectMode:!0,write:p,final:u,destroy:m});let E=w===null||w===void 0?void 0:w.then;if(typeof E==="function"){let k,A=q(E,w,(N)=>{if(N!=null)throw new T("nully","body",N)},(N)=>{$(k,N)});return k=new ee({objectMode:!0,readable:!1,write:p,final(N){u(async()=>{try{await A,r.nextTick(N,null)}catch(U){r.nextTick(N,U)}})},destroy:m})}throw new T("Iterable, AsyncIterable or AsyncFunction",d,w)}if(le(l))return f(l.arrayBuffer());if(s(l))return B(ee,l,{objectMode:!0,writable:!1});if(g(l===null||l===void 0?void 0:l.readable)&&S(l===null||l===void 0?void 0:l.writable))return ee.fromWeb(l);if(typeof(l===null||l===void 0?void 0:l.writable)==="object"||typeof(l===null||l===void 0?void 0:l.readable)==="object"){let w=l!==null&&l!==void 0&&l.readable?b(l===null||l===void 0?void 0:l.readable)?l===null||l===void 0?void 0:l.readable:f(l.readable):void 0,p=l!==null&&l!==void 0&&l.writable?v(l===null||l===void 0?void 0:l.writable)?l===null||l===void 0?void 0:l.writable:f(l.writable):void 0;return c({readable:w,writable:p})}let y=l===null||l===void 0?void 0:l.then;if(typeof y==="function"){let w;return q(y,l,(p)=>{if(p!=null)w.push(p);w.push(null)},(p)=>{$(w,p)}),w=new ee({objectMode:!0,writable:!1,read(){}})}throw new I(d,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],l)};function a(f){let{promise:l,resolve:d}=D(),y=new ue,w=y.signal;return{value:f(async function*(){while(!0){let p=l;l=null;let{chunk:u,done:m,cb:E}=await p;if(r.nextTick(E),m)return;if(w.aborted)throw new M(void 0,{cause:w.reason});({promise:l,resolve:d}=D()),yield u}}(),{signal:w}),write(p,u,m){let E=d;d=null,E({chunk:p,done:!1,cb:m})},final(p){let u=d;d=null,u({done:!0,cb:p})},destroy(p,u){y.abort(),u(p)}}}function c(f){let l=f.readable&&typeof f.readable.read!=="function"?R.wrap(f.readable):f.readable,d=f.writable,y=!!n(l),w=!!o(d),p,u,m,E,k;function A(N){let U=E;if(E=null,U)U(N);else if(N)k.destroy(N)}if(k=new ee({readableObjectMode:!!(l!==null&&l!==void 0&&l.readableObjectMode),writableObjectMode:!!(d!==null&&d!==void 0&&d.writableObjectMode),readable:y,writable:w}),w)x(d,(N)=>{if(w=!1,N)$(l,N);A(N)}),k._write=function(N,U,K){if(d.write(N,U))K();else p=K},k._final=function(N){d.end(),u=N},d.on("drain",function(){if(p){let N=p;p=null,N()}}),d.on("finish",function(){if(u){let N=u;u=null,N()}});if(y)x(l,(N)=>{if(y=!1,N)$(l,N);A(N)}),l.on("readable",function(){if(m){let N=m;m=null,N()}}),l.on("end",function(){k.push(null)}),k._read=function(){while(!0){let N=l.read();if(N===null){m=k._read;return}if(!k.push(N))return}};return k._destroy=function(N,U){if(!N&&E!==null)N=new M;if(m=null,p=null,u=null,E===null)U(N);else E=U,$(d,N),$(l,N)},k}}),ii=Tt((e,t)=>{var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:n,ObjectSetPrototypeOf:o}=Vt();t.exports=b;var s=Dc(),h=_m();o(b.prototype,s.prototype),o(b,s);{let S=n(h.prototype);for(let x=0;x<S.length;x++){let M=S[x];if(!b.prototype[M])b.prototype[M]=h.prototype[M]}}function b(S){if(!(this instanceof b))return new b(S);if(s.call(this,S),h.call(this,S),S){if(this.allowHalfOpen=S.allowHalfOpen!==!1,S.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(S.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}r(b.prototype,{writable:{__proto__:null,...i(h.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(h.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(h.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(h.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(h.prototype,"writableLength")},writableFinished:{__proto__:null,...i(h.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(h.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(h.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(h.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(S){if(this._readableState&&this._writableState)this._readableState.destroyed=S,this._writableState.destroyed=S}}});var v;function _(){if(v===void 0)v={};return v}b.fromWeb=function(S,x){return _().newStreamDuplexFromReadableWritablePair(S,x)},b.toWeb=function(S){return _().newReadableWritablePairFromDuplex(S)};var g;b.from=function(S){if(!g)g=kT();return g(S,"body")}}),Y1=Tt((e,t)=>{var{ObjectSetPrototypeOf:r,Symbol:i}=Vt();t.exports=b;var{ERR_METHOD_NOT_IMPLEMENTED:n}=Fr().codes,o=ii(),{getHighWaterMark:s}=Nc();r(b.prototype,o.prototype),r(b,o);var h=i("kCallback");function b(g){if(!(this instanceof b))return new b(g);let S=g?s(this,g,"readableHighWaterMark",!0):null;if(S===0)g={...g,highWaterMark:null,readableHighWaterMark:S,writableHighWaterMark:g.writableHighWaterMark||0};if(o.call(this,g),this._readableState.sync=!1,this[h]=null,g){if(typeof g.transform==="function")this._transform=g.transform;if(typeof g.flush==="function")this._flush=g.flush}this.on("prefinish",_)}function v(g){if(typeof this._flush==="function"&&!this.destroyed)this._flush((S,x)=>{if(S){if(g)g(S);else this.destroy(S);return}if(x!=null)this.push(x);if(this.push(null),g)g()});else if(this.push(null),g)g()}function _(){if(this._final!==v)v.call(this)}b.prototype._final=v,b.prototype._transform=function(g,S,x){throw new n("_transform()")},b.prototype._write=function(g,S,x){let M=this._readableState,I=this._writableState,T=M.length;this._transform(g,S,($,P)=>{if($){x($);return}if(P!=null)this.push(P);if(I.ended||T===M.length||M.length<M.highWaterMark)x();else this[h]=x})},b.prototype._read=function(){if(this[h]){let g=this[h];this[h]=null,g()}}}),Q1=Tt((e,t)=>{var{ObjectSetPrototypeOf:r}=Vt();t.exports=n;var i=Y1();r(n.prototype,i.prototype),r(n,i);function n(o){if(!(this instanceof n))return new n(o);i.call(this,o)}n.prototype._transform=function(o,s,h){h(null,o)}}),wm=Tt((e,t)=>{var r=po(),{ArrayIsArray:i,Promise:n,SymbolAsyncIterator:o,SymbolDispose:s}=Vt(),h=Ri(),{once:b}=Xr(),v=os(),_=ii(),{aggregateTwoErrors:g,codes:{ERR_INVALID_ARG_TYPE:S,ERR_INVALID_RETURN_VALUE:x,ERR_MISSING_ARGS:M,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:T},AbortError:$}=Fr(),{validateFunction:P,validateAbortSignal:R}=Sa(),{isIterable:C,isReadable:D,isReadableNodeStream:B,isNodeStream:ie,isTransformStream:le,isWebStream:ue,isReadableStream:q,isReadableFinished:ee}=oi(),a=globalThis.AbortController||wa().AbortController,c,f,l;function d(N,U,K){let he=!1;N.on("close",()=>{he=!0});let J=h(N,{readable:U,writable:K},(H)=>{he=!H});return{destroy:(H)=>{if(he)return;he=!0,v.destroyer(N,H||new I("pipe"))},cleanup:J}}function y(N){return P(N[N.length-1],"streams[stream.length - 1]"),N.pop()}function w(N){if(C(N))return N;else if(B(N))return p(N);throw new S("val",["Readable","Iterable","AsyncIterable"],N)}async function*p(N){if(!f)f=Dc();yield*f.prototype[o].call(N)}async function u(N,U,K,{end:he}){let J,H=null,se=(Be)=>{if(Be)J=Be;if(H){let z=H;H=null,z()}},V=()=>new n((Be,z)=>{if(J)z(J);else H=()=>{if(J)z(J);else Be()}});U.on("drain",se);let Q=h(U,{readable:!1},se);try{if(U.writableNeedDrain)await V();for await(let Be of N)if(!U.write(Be))await V();if(he)U.end(),await V();K()}catch(Be){K(J!==Be?g(J,Be):Be)}finally{Q(),U.off("drain",se)}}async function m(N,U,K,{end:he}){if(le(U))U=U.writable;let J=U.getWriter();try{for await(let H of N)await J.ready,J.write(H).catch(()=>{});if(await J.ready,he)await J.close();K()}catch(H){try{await J.abort(H),K(H)}catch(se){K(se)}}}function E(...N){return k(N,b(y(N)))}function k(N,U,K){if(N.length===1&&i(N[0]))N=N[0];if(N.length<2)throw new M("streams");let he=new a,J=he.signal,H=K===null||K===void 0?void 0:K.signal,se=[];R(H,"options.signal");function V(){Y(new $)}l=l||Xr().addAbortListener;let Q;if(H)Q=l(H,V);let Be,z,L=[],ae=0;function G(W){Y(W,--ae===0)}function Y(W,re){var st;if(W&&(!Be||Be.code==="ERR_STREAM_PREMATURE_CLOSE"))Be=W;if(!Be&&!re)return;while(L.length)L.shift()(Be);if((st=Q)===null||st===void 0||st[s](),he.abort(),re){if(!Be)se.forEach((ge)=>ge());r.nextTick(U,Be,z)}}let Me;for(let W=0;W<N.length;W++){let re=N[W],st=W<N.length-1,ge=W>0,ye=st||(K===null||K===void 0?void 0:K.end)!==!1,Gt=W===N.length-1;if(ie(re)){let pe=function(ve){if(ve&&ve.name!=="AbortError"&&ve.code!=="ERR_STREAM_PREMATURE_CLOSE")G(ve)};var j=pe;if(ye){let{destroy:ve,cleanup:er}=d(re,st,ge);if(L.push(ve),D(re)&&Gt)se.push(er)}if(re.on("error",pe),D(re)&&Gt)se.push(()=>{re.removeListener("error",pe)})}if(W===0)if(typeof re==="function"){if(Me=re({signal:J}),!C(Me))throw new x("Iterable, AsyncIterable or Stream","source",Me)}else if(C(re)||B(re)||le(re))Me=re;else Me=_.from(re);else if(typeof re==="function"){if(le(Me)){var Z;Me=w((Z=Me)===null||Z===void 0?void 0:Z.readable)}else Me=w(Me);if(Me=re(Me,{signal:J}),st){if(!C(Me,!0))throw new x("AsyncIterable",`transform[${W-1}]`,Me)}else{var je;if(!c)c=Q1();let pe=new c({objectMode:!0}),ve=(je=Me)===null||je===void 0?void 0:je.then;if(typeof ve==="function")ae++,ve.call(Me,(Se)=>{if(z=Se,Se!=null)pe.write(Se);if(ye)pe.end();r.nextTick(G)},(Se)=>{pe.destroy(Se),r.nextTick(G,Se)});else if(C(Me,!0))ae++,u(Me,pe,G,{end:ye});else if(q(Me)||le(Me)){let Se=Me.readable||Me;ae++,u(Se,pe,G,{end:ye})}else throw new x("AsyncIterable or Promise","destination",Me);Me=pe;let{destroy:er,cleanup:xe}=d(Me,!1,!0);if(L.push(er),Gt)se.push(xe)}}else if(ie(re)){if(B(Me)){ae+=2;let pe=A(Me,re,G,{end:ye});if(D(re)&&Gt)se.push(pe)}else if(le(Me)||q(Me)){let pe=Me.readable||Me;ae++,u(pe,re,G,{end:ye})}else if(C(Me))ae++,u(Me,re,G,{end:ye});else throw new S("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Me);Me=re}else if(ue(re)){if(B(Me))ae++,m(w(Me),re,G,{end:ye});else if(q(Me)||C(Me))ae++,m(Me,re,G,{end:ye});else if(le(Me))ae++,m(Me.readable,re,G,{end:ye});else throw new S("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Me);Me=re}else Me=_.from(re)}if(J!==null&&J!==void 0&&J.aborted||H!==null&&H!==void 0&&H.aborted)r.nextTick(V);return Me}function A(N,U,K,{end:he}){let J=!1;if(U.on("close",()=>{if(!J)K(new T)}),N.pipe(U,{end:!1}),he){let se=function(){J=!0,U.end()};var H=se;if(ee(N))r.nextTick(se);else N.once("end",se)}else K();return h(N,{readable:!0,writable:!1},(se)=>{let V=N._readableState;if(se&&se.code==="ERR_STREAM_PREMATURE_CLOSE"&&V&&V.ended&&!V.errored&&!V.errorEmitted)N.once("end",K).once("error",K);else K(se)}),h(U,{readable:!1,writable:!0},K)}t.exports={pipelineImpl:k,pipeline:E}}),ew=Tt((e,t)=>{var{pipeline:r}=wm(),i=ii(),{destroyer:n}=os(),{isNodeStream:o,isReadable:s,isWritable:h,isWebStream:b,isTransformStream:v,isWritableStream:_,isReadableStream:g}=oi(),{AbortError:S,codes:{ERR_INVALID_ARG_VALUE:x,ERR_MISSING_ARGS:M}}=Fr(),I=Ri();t.exports=function(...T){if(T.length===0)throw new M("streams");if(T.length===1)return i.from(T[0]);let $=[...T];if(typeof T[0]==="function")T[0]=i.from(T[0]);if(typeof T[T.length-1]==="function"){let a=T.length-1;T[a]=i.from(T[a])}for(let a=0;a<T.length;++a){if(!o(T[a])&&!b(T[a]))continue;if(a<T.length-1&&!(s(T[a])||g(T[a])||v(T[a])))throw new x(`streams[${a}]`,$[a],"must be readable");if(a>0&&!(h(T[a])||_(T[a])||v(T[a])))throw new x(`streams[${a}]`,$[a],"must be writable")}let P,R,C,D,B;function ie(a){let c=D;if(D=null,c)c(a);else if(a)B.destroy(a);else if(!ee&&!q)B.destroy()}let le=T[0],ue=r(T,ie),q=!!(h(le)||_(le)||v(le)),ee=!!(s(ue)||g(ue)||v(ue));if(B=new i({writableObjectMode:!!(le!==null&&le!==void 0&&le.writableObjectMode),readableObjectMode:!!(ue!==null&&ue!==void 0&&ue.readableObjectMode),writable:q,readable:ee}),q){if(o(le))B._write=function(c,f,l){if(le.write(c,f))l();else P=l},B._final=function(c){le.end(),R=c},le.on("drain",function(){if(P){let c=P;P=null,c()}});else if(b(le)){let c=(v(le)?le.writable:le).getWriter();B._write=async function(f,l,d){try{await c.ready,c.write(f).catch(()=>{}),d()}catch(y){d(y)}},B._final=async function(f){try{await c.ready,c.close().catch(()=>{}),R=f}catch(l){f(l)}}}let a=v(ue)?ue.readable:ue;I(a,()=>{if(R){let c=R;R=null,c()}})}if(ee){if(o(ue))ue.on("readable",function(){if(C){let a=C;C=null,a()}}),ue.on("end",function(){B.push(null)}),B._read=function(){while(!0){let a=ue.read();if(a===null){C=B._read;return}if(!B.push(a))return}};else if(b(ue)){let a=(v(ue)?ue.readable:ue).getReader();B._read=async function(){while(!0)try{let{value:c,done:f}=await a.read();if(!B.push(c))return;if(f){B.push(null);return}}catch{return}}}}return B._destroy=function(a,c){if(!a&&D!==null)a=new S;if(C=null,P=null,R=null,D===null)c(a);else if(D=c,o(ue))n(ue,a)},B}}),MT=Tt((e,t)=>{var r=globalThis.AbortController||wa().AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:n,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:h}=Fr(),{validateAbortSignal:b,validateInteger:v,validateObject:_}=Sa(),g=Vt().Symbol("kWeak"),S=Vt().Symbol("kResistStopPropagation"),{finished:x}=Ri(),M=ew(),{addAbortSignalNoValidate:I}=Oc(),{isWritable:T,isNodeStream:$}=oi(),{deprecate:P}=Xr(),{ArrayPrototypePush:R,Boolean:C,MathFloor:D,Number:B,NumberIsNaN:ie,Promise:le,PromiseReject:ue,PromiseResolve:q,PromisePrototypeThen:ee,Symbol:a}=Vt(),c=a("kEmpty"),f=a("kEof");function l(H,se){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)b(se.signal,"options.signal");if($(H)&&!T(H))throw new i("stream",H,"must be writable");let V=M(this,H);if(se!==null&&se!==void 0&&se.signal)I(se.signal,V);return V}function d(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)b(se.signal,"options.signal");let V=1;if((se===null||se===void 0?void 0:se.concurrency)!=null)V=D(se.concurrency);let Q=V-1;if((se===null||se===void 0?void 0:se.highWaterMark)!=null)Q=D(se.highWaterMark);return v(V,"options.concurrency",1),v(Q,"options.highWaterMark",0),Q+=V,async function*(){let Be=Xr().AbortSignalAny([se===null||se===void 0?void 0:se.signal].filter(C)),z=this,L=[],ae={signal:Be},G,Y,Me=!1,j=0;function Z(){Me=!0,je()}function je(){j-=1,W()}function W(){if(Y&&!Me&&j<V&&L.length<Q)Y(),Y=null}async function re(){try{for await(let st of z){if(Me)return;if(Be.aborted)throw new h;try{if(st=H(st,ae),st===c)continue;st=q(st)}catch(ge){st=ue(ge)}if(j+=1,ee(st,je,Z),L.push(st),G)G(),G=null;if(!Me&&(L.length>=Q||j>=V))await new le((ge)=>{Y=ge})}L.push(f)}catch(st){let ge=ue(st);ee(ge,je,Z),L.push(ge)}finally{if(Me=!0,G)G(),G=null}}re();try{while(!0){while(L.length>0){let st=await L[0];if(st===f)return;if(Be.aborted)throw new h;if(st!==c)yield st;L.shift(),W()}await new le((st)=>{G=st})}}finally{if(Me=!0,Y)Y(),Y=null}}.call(this)}function y(H=void 0){if(H!=null)_(H,"options");if((H===null||H===void 0?void 0:H.signal)!=null)b(H.signal,"options.signal");return async function*(){let se=0;for await(let Q of this){var V;if(H!==null&&H!==void 0&&(V=H.signal)!==null&&V!==void 0&&V.aborted)throw new h({cause:H.signal.reason});yield[se++,Q]}}.call(this)}async function w(H,se=void 0){for await(let V of E.call(this,H,se))return!0;return!1}async function p(H,se=void 0){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);return!await w.call(this,async(...V)=>!await H(...V),se)}async function u(H,se){for await(let V of E.call(this,H,se))return V;return}async function m(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);async function V(Q,Be){return await H(Q,Be),c}for await(let Q of d.call(this,V,se));}function E(H,se){if(typeof H!=="function")throw new n("fn",["Function","AsyncFunction"],H);async function V(Q,Be){if(await H(Q,Be))return Q;return c}return d.call(this,V,se)}class k extends o{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function A(H,se,V){var Q;if(typeof H!=="function")throw new n("reducer",["Function","AsyncFunction"],H);if(V!=null)_(V,"options");if((V===null||V===void 0?void 0:V.signal)!=null)b(V.signal,"options.signal");let Be=arguments.length>1;if(V!==null&&V!==void 0&&(Q=V.signal)!==null&&Q!==void 0&&Q.aborted){let Y=new h(void 0,{cause:V.signal.reason});throw this.once("error",()=>{}),await x(this.destroy(Y)),Y}let z=new r,L=z.signal;if(V!==null&&V!==void 0&&V.signal){let Y={once:!0,[g]:this,[S]:!0};V.signal.addEventListener("abort",()=>z.abort(),Y)}let ae=!1;try{for await(let Y of this){var G;if(ae=!0,V!==null&&V!==void 0&&(G=V.signal)!==null&&G!==void 0&&G.aborted)throw new h;if(!Be)se=Y,Be=!0;else se=await H(se,Y,{signal:L})}if(!ae&&!Be)throw new k}finally{z.abort()}return se}async function N(H){if(H!=null)_(H,"options");if((H===null||H===void 0?void 0:H.signal)!=null)b(H.signal,"options.signal");let se=[];for await(let Q of this){var V;if(H!==null&&H!==void 0&&(V=H.signal)!==null&&V!==void 0&&V.aborted)throw new h(void 0,{cause:H.signal.reason});R(se,Q)}return se}function U(H,se){let V=d.call(this,H,se);return async function*(){for await(let Q of V)yield*Q}.call(this)}function K(H){if(H=B(H),ie(H))return 0;if(H<0)throw new s("number",">= 0",H);return H}function he(H,se=void 0){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)b(se.signal,"options.signal");return H=K(H),async function*(){var V;if(se!==null&&se!==void 0&&(V=se.signal)!==null&&V!==void 0&&V.aborted)throw new h;for await(let Be of this){var Q;if(se!==null&&se!==void 0&&(Q=se.signal)!==null&&Q!==void 0&&Q.aborted)throw new h;if(H--<=0)yield Be}}.call(this)}function J(H,se=void 0){if(se!=null)_(se,"options");if((se===null||se===void 0?void 0:se.signal)!=null)b(se.signal,"options.signal");return H=K(H),async function*(){var V;if(se!==null&&se!==void 0&&(V=se.signal)!==null&&V!==void 0&&V.aborted)throw new h;for await(let Be of this){var Q;if(se!==null&&se!==void 0&&(Q=se.signal)!==null&&Q!==void 0&&Q.aborted)throw new h;if(H-- >0)yield Be;if(H<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:P(y,"readable.asIndexedPairs will be removed in a future version."),drop:he,filter:E,flatMap:U,map:d,take:J,compose:l},t.exports.promiseReturningOperators={every:p,forEach:m,reduce:A,toArray:N,some:w,find:u}}),tw=Tt((e,t)=>{var{ArrayPrototypePop:r,Promise:i}=Vt(),{isIterable:n,isNodeStream:o,isWebStream:s}=oi(),{pipelineImpl:h}=wm(),{finished:b}=Ri();rw();function v(..._){return new i((g,S)=>{let x,M,I=_[_.length-1];if(I&&typeof I==="object"&&!o(I)&&!n(I)&&!s(I)){let T=r(_);x=T.signal,M=T.end}h(_,(T,$)=>{if(T)S(T);else g($)},{signal:x,end:M})})}t.exports={finished:b,pipeline:v}}),rw=Tt((e,t)=>{var{Buffer:r}=(Ir(),xt(Er)),{ObjectDefineProperty:i,ObjectKeys:n,ReflectApply:o}=Vt(),{promisify:{custom:s}}=Xr(),{streamReturningOperators:h,promiseReturningOperators:b}=MT(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:v}}=Fr(),_=ew(),{setDefaultHighWaterMark:g,getDefaultHighWaterMark:S}=Nc(),{pipeline:x}=wm(),{destroyer:M}=os(),I=Ri(),T=tw(),$=oi(),P=t.exports=bm().Stream;P.isDestroyed=$.isDestroyed,P.isDisturbed=$.isDisturbed,P.isErrored=$.isErrored,P.isReadable=$.isReadable,P.isWritable=$.isWritable,P.Readable=Dc();for(let C of n(h)){let D=function(...ie){if(new.target)throw v();return P.Readable.from(o(B,this,ie))},B=h[C];i(D,"name",{__proto__:null,value:B.name}),i(D,"length",{__proto__:null,value:B.length}),i(P.Readable.prototype,C,{__proto__:null,value:D,enumerable:!1,configurable:!0,writable:!0})}for(let C of n(b)){let D=function(...ie){if(new.target)throw v();return o(B,this,ie)},B=b[C];i(D,"name",{__proto__:null,value:B.name}),i(D,"length",{__proto__:null,value:B.length}),i(P.Readable.prototype,C,{__proto__:null,value:D,enumerable:!1,configurable:!0,writable:!0})}P.Writable=_m(),P.Duplex=ii(),P.Transform=Y1(),P.PassThrough=Q1(),P.pipeline=x;var{addAbortSignal:R}=Oc();P.addAbortSignal=R,P.finished=I,P.destroy=M,P.compose=_,P.setDefaultHighWaterMark=g,P.getDefaultHighWaterMark=S,i(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return T}}),i(x,s,{__proto__:null,enumerable:!0,get(){return T.pipeline}}),i(I,s,{__proto__:null,enumerable:!0,get(){return T.finished}}),P.Stream=P,P._isUint8Array=function(C){return C instanceof Uint8Array},P._uint8ArrayToBuffer=function(C){return r.from(C.buffer,C.byteOffset,C.byteLength)}}),ET=Tt((e,t)=>{var r=Sm();{let i=rw(),n=tw(),o=i.Readable.destroy;t.exports=i.Readable,t.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,t.exports._isUint8Array=i._isUint8Array,t.exports.isDisturbed=i.isDisturbed,t.exports.isErrored=i.isErrored,t.exports.isReadable=i.isReadable,t.exports.Readable=i.Readable,t.exports.Writable=i.Writable,t.exports.Duplex=i.Duplex,t.exports.Transform=i.Transform,t.exports.PassThrough=i.PassThrough,t.exports.addAbortSignal=i.addAbortSignal,t.exports.finished=i.finished,t.exports.destroy=i.destroy,t.exports.destroy=o,t.exports.pipeline=i.pipeline,t.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get(){return n}}),t.exports.Stream=i.Stream}t.exports.default=t.exports});nw.exports=ET()});var ln={};vn(ln,{webcrypto:()=>QP,rng:()=>pP,randomUUID:()=>Ow,randomFillSync:()=>KP,randomFill:()=>ZP,randomBytes:()=>Cw,publicEncrypt:()=>qP,publicDecrypt:()=>BP,pseudoRandomBytes:()=>hP,prng:()=>fP,privateEncrypt:()=>FP,privateDecrypt:()=>HP,pbkdf2Sync:()=>_P,pbkdf2:()=>bP,listCiphers:()=>PP,getRandomValues:()=>JP,getHashes:()=>vP,getDiffieHellman:()=>CP,getCurves:()=>YP,getCiphers:()=>$P,default:()=>eA,createVerify:()=>jP,createSign:()=>DP,createHmac:()=>yP,createHash:()=>Cm,createECDH:()=>LP,createDiffieHellmanGroup:()=>RP,createDiffieHellman:()=>OP,createDecipheriv:()=>TP,createDecipher:()=>EP,createCredentials:()=>VP,createCipheriv:()=>kP,createCipher:()=>SP,constants:()=>WP,Verify:()=>UP,Sign:()=>zP,Hmac:()=>gP,Hash:()=>mP,DiffieHellmanGroup:()=>AP,DiffieHellman:()=>NP,Decipheriv:()=>IP,Decipher:()=>MP,DEFAULT_ENCODING:()=>GP,Cipheriv:()=>xP,Cipher:()=>wP});function AT(e){return this[e]}function YP(){return XP}var IT,TT,iw,$T,PT,RT,CT,OT=(e,t,r)=>{var i=e!=null&&typeof e==="object";if(i){var n=t?RT??=new WeakMap:CT??=new WeakMap,o=n.get(e);if(o)return o}r=e!=null?IT(TT(e)):{};let s=t||!e||!e.__esModule?iw(r,"default",{value:e,enumerable:!0}):r;for(let h of $T(e))if(!PT.call(s,h))iw(s,h,{get:AT.bind(e,h),enumerable:!0});if(i)n.set(e,s);return s},ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zc,jc,sw,NT,km,Mm,Br,DT,ka,aw,zT,jT,UT,LT,uw,qT,FT,BT,HT,ZT,KT,VT,WT,GT,JT,Ma,Uc,lw,XT,cw,dw,YT,Ea,Em,Im,QT,fw,Tm,e$,hw,t$,pw,mw,r$,n$,i$,o$,s$,a$,u$,l$,c$,d$,f$,h$,p$,m$,$m,gw,g$,yw,y$,v$,b$,_$,si,Ci,vw,wn,bw,Lc,w$,un,S$,x$,k$,_w,Gn,Ia,ww,M$,Sw,E$,xw,I$,T$,$$,P$,Pm,A$,Am,R$,C$,O$,N$,D$,z$,j$,U$,L$,q$,F$,B$,H$,Z$,ow,K$,xa,V$,kw,Mw,W$,G$,Ew,J$,X$,Ta,Y$,Q$,eP,tP,rP,nP,Iw,iP,Tw,$w,Pw,Rm,Aw,oP,Rw,sP,aP,xm,uP,lP,cP,dP,gt,fP,hP,pP,Cw,mP,Cm,gP,yP,vP,bP,_P,wP,SP,xP,kP,MP,EP,IP,TP,$P,PP,AP,RP,CP,OP,NP,DP,zP,jP,UP,LP,qP,FP,BP,HP,ZP,KP,VP,WP,GP="buffer",JP=(e)=>crypto.getRandomValues(e),Ow=()=>crypto.randomUUID(),XP,QP,eA;var Hr=ha(()=>{IT=Object.create,{getPrototypeOf:TT,defineProperty:iw,getOwnPropertyNames:$T}=Object,PT=Object.prototype.hasOwnProperty;zc=ce((e,t)=>{t.exports=(Hr(),xt(ln)).randomBytes}),jc=ce((e,t)=>{t.exports=(Hr(),xt(ln)).createHash}),sw=ce((e,t)=>{t.exports=(Hr(),xt(ln)).createHmac}),NT=ce((e,t)=>{t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),km=ce((e,t)=>{var r=isFinite,i=Math.pow(2,30)-1;t.exports=function(n,o){if(typeof n!=="number")throw TypeError("Iterations not a number");if(n<0||!r(n))throw TypeError("Bad iterations");if(typeof o!=="number")throw TypeError("Key length not a number");if(o<0||o>i||o!==o)throw TypeError("Bad key length")}}),Mm=ce((e,t)=>{var r;if(globalThis.process&&globalThis.process.browser)r="utf-8";else if(globalThis.process&&globalThis.process.version)i=parseInt(process.version.split(".")[0].slice(1),10),r=i>=6?"utf-8":"binary";else r="utf-8";var i;t.exports=r}),Br=ce((e,t)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var r=(Ir(),xt(Er)),i=r.Buffer;function n(s,h){for(var b in s)h[b]=s[b]}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow)t.exports=r;else n(r,e),e.Buffer=o;function o(s,h,b){return i(s,h,b)}o.prototype=Object.create(i.prototype),n(i,o),o.from=function(s,h,b){if(typeof s==="number")throw TypeError("Argument must not be a number");return i(s,h,b)},o.alloc=function(s,h,b){if(typeof s!=="number")throw TypeError("Argument must be a number");var v=i(s);if(h!==void 0)if(typeof b==="string")v.fill(h,b);else v.fill(h);else v.fill(0);return v},o.allocUnsafe=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return i(s)},o.allocUnsafeSlow=function(s){if(typeof s!=="number")throw TypeError("Argument must be a number");return r.SlowBuffer(s)}}),DT=ce((e,t)=>{var r={}.toString;t.exports=Array.isArray||function(i){return r.call(i)=="[object Array]"}}),ka=ce((e,t)=>{t.exports=TypeError}),aw=ce((e,t)=>{t.exports=Object}),zT=ce((e,t)=>{t.exports=Error}),jT=ce((e,t)=>{t.exports=EvalError}),UT=ce((e,t)=>{t.exports=RangeError}),LT=ce((e,t)=>{t.exports=ReferenceError}),uw=ce((e,t)=>{t.exports=SyntaxError}),qT=ce((e,t)=>{t.exports=URIError}),FT=ce((e,t)=>{t.exports=Math.abs}),BT=ce((e,t)=>{t.exports=Math.floor}),HT=ce((e,t)=>{t.exports=Math.max}),ZT=ce((e,t)=>{t.exports=Math.min}),KT=ce((e,t)=>{t.exports=Math.pow}),VT=ce((e,t)=>{t.exports=Math.round}),WT=ce((e,t)=>{t.exports=Number.isNaN||function(r){return r!==r}}),GT=ce((e,t)=>{var r=WT();t.exports=function(i){if(r(i)||i===0)return i;return i<0?-1:1}}),JT=ce((e,t)=>{t.exports=Object.getOwnPropertyDescriptor}),Ma=ce((e,t)=>{var r=JT();if(r)try{r([],"length")}catch(i){r=null}t.exports=r}),Uc=ce((e,t)=>{var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch(i){r=!1}t.exports=r}),lw=ce((e,t)=>{t.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var r={},i=Symbol("test"),n=Object(i);if(typeof i==="string")return!1;if(Object.prototype.toString.call(i)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[i]=o;for(var s in r)return!1;if(typeof Object.keys==="function"&&Object.keys(r).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var h=Object.getOwnPropertySymbols(r);if(h.length!==1||h[0]!==i)return!1;if(!Object.prototype.propertyIsEnumerable.call(r,i))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var b=Object.getOwnPropertyDescriptor(r,i);if(b.value!==o||b.enumerable!==!0)return!1}return!0}}),XT=ce((e,t)=>{var r=typeof Symbol<"u"&&Symbol,i=lw();t.exports=function(){if(typeof r!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof r("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return i()}}),cw=ce((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),dw=ce((e,t)=>{var r=aw();t.exports=r.getPrototypeOf||null}),YT=ce((e,t)=>{var r="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,n=Math.max,o="[object Function]",s=function(v,_){var g=[];for(var S=0;S<v.length;S+=1)g[S]=v[S];for(var x=0;x<_.length;x+=1)g[x+v.length]=_[x];return g},h=function(v,_){var g=[];for(var S=_||0,x=0;S<v.length;S+=1,x+=1)g[x]=v[S];return g},b=function(v,_){var g="";for(var S=0;S<v.length;S+=1)if(g+=v[S],S+1<v.length)g+=_;return g};t.exports=function(v){var _=this;if(typeof _!=="function"||i.apply(_)!==o)throw TypeError(r+_);var g=h(arguments,1),S,x=function(){if(this instanceof S){var P=_.apply(this,s(g,arguments));if(Object(P)===P)return P;return this}return _.apply(v,s(g,arguments))},M=n(0,_.length-g.length),I=[];for(var T=0;T<M;T++)I[T]="$"+T;if(S=Function("binder","return function ("+b(I,",")+"){ return binder.apply(this,arguments); }")(x),_.prototype){var $=function(){};$.prototype=_.prototype,S.prototype=new $,$.prototype=null}return S}}),Ea=ce((e,t)=>{var r=YT();t.exports=Function.prototype.bind||r}),Em=ce((e,t)=>{t.exports=Function.prototype.call}),Im=ce((e,t)=>{t.exports=Function.prototype.apply}),QT=ce((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),fw=ce((e,t)=>{var r=Ea(),i=Im(),n=Em(),o=QT();t.exports=o||r.call(n,i)}),Tm=ce((e,t)=>{var r=Ea(),i=ka(),n=Em(),o=fw();t.exports=function(s){if(s.length<1||typeof s[0]!=="function")throw new i("a function is required");return o(r,n,s)}}),e$=ce((e,t)=>{var r=Tm(),i=Ma(),n;try{n=[].__proto__===Array.prototype}catch(b){if(!b||typeof b!=="object"||!("code"in b)||b.code!=="ERR_PROTO_ACCESS")throw b}var o=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,h=s.getPrototypeOf;t.exports=o&&typeof o.get==="function"?r([o.get]):typeof h==="function"?function(b){return h(b==null?b:s(b))}:!1}),hw=ce((e,t)=>{var r=cw(),i=dw(),n=e$();t.exports=r?function(o){return r(o)}:i?function(o){if(!o||typeof o!=="object"&&typeof o!=="function")throw TypeError("getProto: not an object");return i(o)}:n?function(o){return n(o)}:null}),t$=ce((e,t)=>{var r=Function.prototype.call,i=Object.prototype.hasOwnProperty,n=Ea();t.exports=n.call(r,i)}),pw=ce((e,t)=>{var r,i=aw(),n=zT(),o=jT(),s=UT(),h=LT(),b=uw(),v=ka(),_=qT(),g=FT(),S=BT(),x=HT(),M=ZT(),I=KT(),T=VT(),$=GT(),P=Function,R=function(se){try{return P('"use strict"; return ('+se+").constructor;")()}catch(V){}},C=Ma(),D=Uc(),B=function(){throw new v},ie=C?function(){try{return arguments.callee,B}catch(se){try{return C(arguments,"callee").get}catch(V){return B}}}():B,le=XT()(),ue=hw(),q=dw(),ee=cw(),a=Im(),c=Em(),f={},l=typeof Uint8Array>"u"||!ue?r:ue(Uint8Array),d={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":le&&ue?ue([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":f,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":le&&ue?ue(ue([][Symbol.iterator]())):r,"%JSON%":typeof JSON==="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!le||!ue?r:ue(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":s,"%ReferenceError%":h,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!le||!ue?r:ue(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":le&&ue?ue(""[Symbol.iterator]()):r,"%Symbol%":le?Symbol:r,"%SyntaxError%":b,"%ThrowTypeError%":ie,"%TypedArray%":l,"%TypeError%":v,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":_,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":c,"%Function.prototype.apply%":a,"%Object.defineProperty%":D,"%Object.getPrototypeOf%":q,"%Math.abs%":g,"%Math.floor%":S,"%Math.max%":x,"%Math.min%":M,"%Math.pow%":I,"%Math.round%":T,"%Math.sign%":$,"%Reflect.getPrototypeOf%":ee};if(ue)try{null.error}catch(se){y=ue(ue(se)),d["%Error.prototype%"]=y}var y,w=function se(V){var Q;if(V==="%AsyncFunction%")Q=R("async function () {}");else if(V==="%GeneratorFunction%")Q=R("function* () {}");else if(V==="%AsyncGeneratorFunction%")Q=R("async function* () {}");else if(V==="%AsyncGenerator%"){var Be=se("%AsyncGeneratorFunction%");if(Be)Q=Be.prototype}else if(V==="%AsyncIteratorPrototype%"){var z=se("%AsyncGenerator%");if(z&&ue)Q=ue(z.prototype)}return d[V]=Q,Q},p={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},u=Ea(),m=t$(),E=u.call(c,Array.prototype.concat),k=u.call(a,Array.prototype.splice),A=u.call(c,String.prototype.replace),N=u.call(c,String.prototype.slice),U=u.call(c,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,he=/\\(\\)?/g,J=function(se){var V=N(se,0,1),Q=N(se,-1);if(V==="%"&&Q!=="%")throw new b("invalid intrinsic syntax, expected closing `%`");else if(Q==="%"&&V!=="%")throw new b("invalid intrinsic syntax, expected opening `%`");var Be=[];return A(se,K,function(z,L,ae,G){Be[Be.length]=ae?A(G,he,"$1"):L||z}),Be},H=function(se,V){var Q=se,Be;if(m(p,Q))Be=p[Q],Q="%"+Be[0]+"%";if(m(d,Q)){var z=d[Q];if(z===f)z=w(Q);if(typeof z>"u"&&!V)throw new v("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:Be,name:Q,value:z}}throw new b("intrinsic "+se+" does not exist!")};t.exports=function(se,V){if(typeof se!=="string"||se.length===0)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof V!=="boolean")throw new v('"allowMissing" argument must be a boolean');if(U(/^%?[^%]*%?$/,se)===null)throw new b("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=J(se),Be=Q.length>0?Q[0]:"",z=H("%"+Be+"%",V),L=z.name,ae=z.value,G=!1,Y=z.alias;if(Y)Be=Y[0],k(Q,E([0,1],Y));for(var Me=1,j=!0;Me<Q.length;Me+=1){var Z=Q[Me],je=N(Z,0,1),W=N(Z,-1);if((je==='"'||je==="'"||je==="`"||(W==='"'||W==="'"||W==="`"))&&je!==W)throw new b("property names with quotes must have matching quotes");if(Z==="constructor"||!j)G=!0;if(Be+="."+Z,L="%"+Be+"%",m(d,L))ae=d[L];else if(ae!=null){if(!(Z in ae)){if(!V)throw new v("base intrinsic for "+se+" exists, but the property is not available.");return}if(C&&Me+1>=Q.length){var re=C(ae,Z);if(j=!!re,j&&"get"in re&&!("originalValue"in re.get))ae=re.get;else ae=ae[Z]}else j=m(ae,Z),ae=ae[Z];if(j&&!G)d[L]=ae}}return ae}}),mw=ce((e,t)=>{var r=pw(),i=Tm(),n=i([r("%String.prototype.indexOf%")]);t.exports=function(o,s){var h=r(o,!!s);if(typeof h==="function"&&n(o,".prototype.")>-1)return i([h]);return h}}),r$=ce((e,t)=>{var r=Function.prototype.toString,i=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,n,o;if(typeof i==="function"&&typeof Object.defineProperty==="function")try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i(function(){throw 42},null,n)}catch(C){if(C!==o)i=null}else i=null;var s=/^\s*class\b/,h=function(C){try{var D=r.call(C);return s.test(D)}catch(B){return!1}},b=function(C){try{if(h(C))return!1;return r.call(C),!0}catch(D){return!1}},v=Object.prototype.toString,_="[object Object]",g="[object Function]",S="[object GeneratorFunction]",x="[object HTMLAllCollection]",M="[object HTML document.all class]",I="[object HTMLCollection]",T=typeof Symbol==="function"&&!!Symbol.toStringTag,$=!(0 in[,]),P=function(){return!1};if(typeof document==="object"){if(R=document.all,v.call(R)===v.call(document.all))P=function(C){if(($||!C)&&(typeof C>"u"||typeof C==="object"))try{var D=v.call(C);return(D===x||D===M||D===I||D===_)&&C("")==null}catch(B){}return!1}}var R;t.exports=i?function(C){if(P(C))return!0;if(!C)return!1;if(typeof C!=="function"&&typeof C!=="object")return!1;try{i(C,null,n)}catch(D){if(D!==o)return!1}return!h(C)&&b(C)}:function(C){if(P(C))return!0;if(!C)return!1;if(typeof C!=="function"&&typeof C!=="object")return!1;if(T)return b(C);if(h(C))return!1;var D=v.call(C);if(D!==g&&D!==S&&!/^\[object HTML/.test(D))return!1;return b(C)}}),n$=ce((e,t)=>{var r=r$(),i=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=function(v,_,g){for(var S=0,x=v.length;S<x;S++)if(n.call(v,S))if(g==null)_(v[S],S,v);else _.call(g,v[S],S,v)},s=function(v,_,g){for(var S=0,x=v.length;S<x;S++)if(g==null)_(v.charAt(S),S,v);else _.call(g,v.charAt(S),S,v)},h=function(v,_,g){for(var S in v)if(n.call(v,S))if(g==null)_(v[S],S,v);else _.call(g,v[S],S,v)};function b(v){return i.call(v)==="[object Array]"}t.exports=function(v,_,g){if(!r(_))throw TypeError("iterator must be a function");var S;if(arguments.length>=3)S=g;if(b(v))o(v,_,S);else if(typeof v==="string")s(v,_,S);else h(v,_,S)}}),i$=ce((e,t)=>{t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),o$=ce((e,t)=>{var r=i$(),i=typeof globalThis>"u"?globalThis:globalThis;t.exports=function(){var n=[];for(var o=0;o<r.length;o++)if(typeof i[r[o]]==="function")n[n.length]=r[o];return n}}),s$=ce((e,t)=>{var r=Uc(),i=uw(),n=ka(),o=Ma();t.exports=function(s,h,b){if(!s||typeof s!=="object"&&typeof s!=="function")throw new n("`obj` must be an object or a function`");if(typeof h!=="string"&&typeof h!=="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new n("`loose`, if provided, must be a boolean");var v=arguments.length>3?arguments[3]:null,_=arguments.length>4?arguments[4]:null,g=arguments.length>5?arguments[5]:null,S=arguments.length>6?arguments[6]:!1,x=!!o&&o(s,h);if(r)r(s,h,{configurable:g===null&&x?x.configurable:!g,enumerable:v===null&&x?x.enumerable:!v,value:b,writable:_===null&&x?x.writable:!_});else if(S||!v&&!_&&!g)s[h]=b;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),a$=ce((e,t)=>{var r=Uc(),i=function(){return!!r};i.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch(n){return!0}},t.exports=i}),u$=ce((e,t)=>{var r=pw(),i=s$(),n=a$()(),o=Ma(),s=ka(),h=r("%Math.floor%");t.exports=function(b,v){if(typeof b!=="function")throw new s("`fn` is not a function");if(typeof v!=="number"||v<0||v>4294967295||h(v)!==v)throw new s("`length` must be a positive 32-bit integer");var _=arguments.length>2&&!!arguments[2],g=!0,S=!0;if("length"in b&&o){var x=o(b,"length");if(x&&!x.configurable)g=!1;if(x&&!x.writable)S=!1}if(g||S||!_)if(n)i(b,"length",v,!0,!0);else i(b,"length",v);return b}}),l$=ce((e,t)=>{var r=Ea(),i=Im(),n=fw();t.exports=function(){return n(r,i,arguments)}}),c$=ce((e,t)=>{var r=u$(),i=Uc(),n=Tm(),o=l$();if(t.exports=function(s){var h=n(arguments),b=s.length-(arguments.length-1);return r(h,1+(b>0?b:0),!0)},i)i(t.exports,"apply",{value:o});else t.exports.apply=o}),d$=ce((e,t)=>{var r=lw();t.exports=function(){return r()&&!!Symbol.toStringTag}}),f$=ce((e,t)=>{var r=n$(),i=o$(),n=c$(),o=mw(),s=Ma(),h=hw(),b=o("Object.prototype.toString"),v=d$()(),_=typeof globalThis>"u"?globalThis:globalThis,g=i(),S=o("String.prototype.slice"),x=o("Array.prototype.indexOf",!0)||function($,P){for(var R=0;R<$.length;R+=1)if($[R]===P)return R;return-1},M={__proto__:null};if(v&&s&&h)r(g,function($){var P=new _[$];if(Symbol.toStringTag in P&&h){var R=h(P),C=s(R,Symbol.toStringTag);if(!C&&R){var D=h(R);C=s(D,Symbol.toStringTag)}M["$"+$]=n(C.get)}});else r(g,function($){var P=new _[$],R=P.slice||P.set;if(R)M["$"+$]=n(R)});var I=function($){var P=!1;return r(M,function(R,C){if(!P)try{if("$"+R($)===C)P=S(C,1)}catch(D){}}),P},T=function($){var P=!1;return r(M,function(R,C){if(!P)try{R($),P=S(C,1)}catch(D){}}),P};t.exports=function($){if(!$||typeof $!=="object")return!1;if(!v){var P=S(b($),8,-1);if(x(g,P)>-1)return P;if(P!=="Object")return!1;return T($)}if(!s)return null;return I($)}}),h$=ce((e,t)=>{var r=f$();t.exports=function(i){return!!r(i)}}),p$=ce((e,t)=>{var r=ka(),i=mw(),n=i("TypedArray.prototype.buffer",!0),o=h$();t.exports=n||function(s){if(!o(s))throw new r("Not a Typed Array");return s.buffer}}),m$=ce((e,t)=>{var r=Br().Buffer,i=DT(),n=p$(),o=ArrayBuffer.isView||function(v){try{return n(v),!0}catch(_){return!1}},s=typeof Uint8Array<"u",h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",b=h&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);t.exports=function(v,_){if(r.isBuffer(v)){if(v.constructor&&!("isBuffer"in v))return r.from(v);return v}if(typeof v==="string")return r.from(v,_);if(h&&o(v)){if(v.byteLength===0)return r.alloc(0);if(b){var g=r.from(v.buffer,v.byteOffset,v.byteLength);if(g.byteLength===v.byteLength)return g}var S=v instanceof Uint8Array?v:new Uint8Array(v.buffer,v.byteOffset,v.byteLength),x=r.from(S);if(x.length===v.byteLength)return x}if(s&&v instanceof Uint8Array)return r.from(v);var M=i(v);if(M)for(var I=0;I<v.length;I+=1){var T=v[I];if(typeof T!=="number"||T<0||T>255||~~T!==T)throw RangeError("Array items must be numbers in the range 0-255.")}if(M||r.isBuffer(v)&&v.constructor&&typeof v.constructor.isBuffer==="function"&&v.constructor.isBuffer(v))return r.from(v);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),$m=ce((e,t)=>{var r=Br().Buffer,i=m$(),n=typeof Uint8Array<"u",o=n&&typeof ArrayBuffer<"u",s=o&&ArrayBuffer.isView;t.exports=function(h,b,v){if(typeof h==="string"||r.isBuffer(h)||n&&h instanceof Uint8Array||s&&s(h))return i(h,b);throw TypeError(v+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),gw=ce((e,t)=>{var r={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},i={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},n=sw(),o=Br().Buffer,s=km(),h=Mm(),b=$m();function v(_,g,S,x,M){s(S,x),_=b(_,h,"Password"),g=b(g,h,"Salt");var I=(M||"sha1").toLowerCase(),T=i[I]||I,$=r[T];if(typeof $!=="number"||!$)throw TypeError("Digest algorithm not supported: "+M);var P=o.allocUnsafe(x),R=o.allocUnsafe(g.length+4);g.copy(R,0,0,g.length);var C=0,D=$,B=Math.ceil(x/D);for(var ie=1;ie<=B;ie++){R.writeUInt32BE(ie,g.length);var le=n(T,_).update(R).digest(),ue=le;for(var q=1;q<S;q++){ue=n(T,_).update(ue).digest();for(var ee=0;ee<D;ee++)le[ee]^=ue[ee]}le.copy(P,C),C+=D}return P}t.exports=v}),g$=ce((e,t)=>{var r=Br().Buffer,i=km(),n=Mm(),o=gw(),s=$m(),h,b=globalThis.crypto&&globalThis.crypto.subtle,v={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},_=[],g;function S(){if(g)return g;if(globalThis.process&&globalThis.process.nextTick)g=globalThis.process.nextTick;else if(globalThis.queueMicrotask)g=globalThis.queueMicrotask;else if(globalThis.setImmediate)g=globalThis.setImmediate;else g=globalThis.setTimeout;return g}function x(T,$,P,R,C){return b.importKey("raw",T,{name:"PBKDF2"},!1,["deriveBits"]).then(function(D){return b.deriveBits({name:"PBKDF2",salt:$,iterations:P,hash:{name:C}},D,R<<3)}).then(function(D){return r.from(D)})}function M(T){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!b||!b.importKey||!b.deriveBits)return Promise.resolve(!1);if(_[T]!==void 0)return _[T];h=h||r.alloc(8);var $=x(h,h,10,128,T).then(function(){return!0},function(){return!1});return _[T]=$,$}function I(T,$){T.then(function(P){S()(function(){$(null,P)})},function(P){S()(function(){$(P)})})}t.exports=function(T,$,P,R,C,D){if(typeof C==="function")D=C,C=void 0;if(i(P,R),T=s(T,n,"Password"),$=s($,n,"Salt"),typeof D!=="function")throw Error("No callback provided to pbkdf2");C=C||"sha1";var B=v[C.toLowerCase()];if(!B||typeof globalThis.Promise!=="function"){S()(function(){var ie;try{ie=o(T,$,P,R,C)}catch(le){D(le);return}D(null,ie)});return}I(M(B).then(function(ie){if(ie)return x(T,$,P,R,B);return o(T,$,P,R,C)}),D)}}),yw=ce((e)=>{var t=(Hr(),xt(ln)),r=km(),i=Mm(),n=$m();function o(h,b,v,_,g,S){if(r(v,_),h=n(h,i,"Password"),b=n(b,i,"Salt"),typeof g==="function")S=g,g="sha1";if(typeof S!=="function")throw Error("No callback provided to pbkdf2");return t.pbkdf2(h,b,v,_,g,S)}function s(h,b,v,_,g){return r(v,_),h=n(h,i,"Password"),b=n(b,i,"Salt"),g=g||"sha1",t.pbkdf2Sync(h,b,v,_,g)}if(!t.pbkdf2Sync||t.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)e.pbkdf2Sync=gw(),e.pbkdf2=g$();else e.pbkdf2Sync=s,e.pbkdf2=o}),y$=ce((e)=>{var t=(Hr(),xt(ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),v$=ce((e)=>{var t=(Hr(),xt(ln));e.DiffieHellmanGroup=t.DiffieHellmanGroup,e.createDiffieHellmanGroup=t.createDiffieHellmanGroup,e.getDiffieHellman=t.getDiffieHellman,e.createDiffieHellman=t.createDiffieHellman,e.DiffieHellman=t.DiffieHellman}),b$=ce((e)=>{var t=(Hr(),xt(ln));e.createSign=t.createSign,e.Sign=t.Sign,e.createVerify=t.createVerify,e.Verify=t.Verify}),_$=ce((e,t)=>{t.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),si=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Ir(),xt(Er)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function b(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function v(a,c,f){var l=b(a,f);if(f-1>=c)l|=b(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var g=["","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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var N=Math.max(0,m-a.length+1);N<=A;N++){var U=m-N|0;d=a.words[U]|0,y=c.words[N]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var T=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,N=l[1]|0,U=N&8191,K=N>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,Be=l[4]|0,z=Be&8191,L=Be>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,st=l[8]|0,ge=st&8191,ye=st>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,er=d[0]|0,xe=er&8191,Se=er>>>13,Or=d[1]|0,Ee=Or&8191,Re=Or>>>13,Nr=d[2]|0,Ce=Nr&8191,Ie=Nr>>>13,Tr=d[3]|0,Oe=Tr&8191,Te=Tr>>>13,xr=d[4]|0,Ne=xr&8191,De=xr>>>13,kr=d[5]|0,$e=kr&8191,O=kr>>>13,F=d[6]|0,X=F&8191,te=F>>>13,We=d[7]|0,me=We&8191,we=We>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,$r=d[9]|0,Ae=$r&8191,ke=$r>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,Te)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,Te)|0;var Dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,Te)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,Te)|0,p=p+Math.imul(k,Ne)|0,u=u+Math.imul(k,De)|0,u=u+Math.imul(A,Ne)|0,m=m+Math.imul(A,De)|0;var Pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,Te)|0,p=p+Math.imul(U,Ne)|0,u=u+Math.imul(U,De)|0,u=u+Math.imul(K,Ne)|0,m=m+Math.imul(K,De)|0,p=p+Math.imul(k,$e)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,$e)|0,m=m+Math.imul(A,O)|0;var or=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(or>>>26)|0,or&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,Te)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,Te)|0,p=p+Math.imul(J,Ne)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(H,Ne)|0,m=m+Math.imul(H,De)|0,p=p+Math.imul(U,$e)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,$e)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,Te)|0,p=p+Math.imul(V,Ne)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(Q,Ne)|0,m=m+Math.imul(Q,De)|0,p=p+Math.imul(J,$e)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,$e)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,Te)|0,p=p+Math.imul(z,Ne)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(L,Ne)|0,m=m+Math.imul(L,De)|0,p=p+Math.imul(V,$e)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,$e)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,Te)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,Te)|0,p=p+Math.imul(G,Ne)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(Y,Ne)|0,m=m+Math.imul(Y,De)|0,p=p+Math.imul(z,$e)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,$e)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,Te)|0,p=p+Math.imul(j,Ne)|0,u=u+Math.imul(j,De)|0,u=u+Math.imul(Z,Ne)|0,m=m+Math.imul(Z,De)|0,p=p+Math.imul(G,$e)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,$e)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,Te)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,Te)|0,p=p+Math.imul(W,Ne)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(re,Ne)|0,m=m+Math.imul(re,De)|0,p=p+Math.imul(j,$e)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,$e)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,Te),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,Te),p=p+Math.imul(ge,Ne)|0,u=u+Math.imul(ge,De)|0,u=u+Math.imul(ye,Ne)|0,m=m+Math.imul(ye,De)|0,p=p+Math.imul(W,$e)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,$e)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Ne),u=Math.imul(pe,De),u=u+Math.imul(ve,Ne)|0,m=Math.imul(ve,De),p=p+Math.imul(ge,$e)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,$e)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,$e),u=Math.imul(pe,O),u=u+Math.imul(ve,$e)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var vr=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,y[0]=Xt,y[1]=pt,y[2]=dt,y[3]=Dt,y[4]=Pt,y[5]=or,y[6]=sr,y[7]=ar,y[8]=ur,y[9]=lr,y[10]=cr,y[11]=dr,y[12]=fr,y[13]=hr,y[14]=pr,y[15]=mr,y[16]=gr,y[17]=yr,y[18]=vr,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)T=I;function $(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,N=k*A,U=N&67108863;w=w+(N/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=T(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=$(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var N=0;N<w;N++){var U=f[E+N],K=l[E+N],he=f[E+N+w],J=l[E+N+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+N]=U+he,l[E+N]=K+J,f[E+N+w]=U-he,l[E+N+w]=K-J,N!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var N=0;N<l;N++){var U=p[N]*E[N]-u[N]*k[N];u[N]=p[N]*k[N]+u[N]*E[N],p[N]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,N=1;(f.words[0]&N)===0&&A<26;++A,N<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function D(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},D.prototype.split=function(a,c){a.iushrn(this.n,0,c)},D.prototype.imulK=function(a){return a.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,D),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,D);function le(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,D);function ue(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,D),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function q(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},q.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},q.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},q.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},q.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},q.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},q.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},q.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var N=k;for(var U=0;N.cmp(y)!==0;U++)N=N.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},q.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},q.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},q.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},q.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(q.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new s(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)}o(ee,q),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),Ci=ce((e,t)=>{t.exports=r;function r(i,n){if(!i)throw Error(n||"Assertion failed")}r.equal=function(i,n,o){if(i!=n)throw Error(o||"Assertion failed: "+i+" != "+n)}}),vw=ce((e)=>{var t=e;function r(o,s){if(Array.isArray(o))return o.slice();if(!o)return[];var h=[];if(typeof o!=="string"){for(var b=0;b<o.length;b++)h[b]=o[b]|0;return h}if(s==="hex"){if(o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0)o="0"+o;for(var b=0;b<o.length;b+=2)h.push(parseInt(o[b]+o[b+1],16))}else for(var b=0;b<o.length;b++){var v=o.charCodeAt(b),_=v>>8,g=v&255;if(_)h.push(_,g);else h.push(g)}return h}t.toArray=r;function i(o){if(o.length===1)return"0"+o;else return o}t.zero2=i;function n(o){var s="";for(var h=0;h<o.length;h++)s+=i(o[h].toString(16));return s}t.toHex=n,t.encode=function(o,s){if(s==="hex")return n(o);else return o}}),wn=ce((e)=>{var t=e,r=si(),i=Ci(),n=vw();t.assert=i,t.toArray=n.toArray,t.zero2=n.zero2,t.toHex=n.toHex,t.encode=n.encode;function o(_,g,S){var x=Array(Math.max(_.bitLength(),S)+1),M;for(M=0;M<x.length;M+=1)x[M]=0;var I=1<<g+1,T=_.clone();for(M=0;M<x.length;M++){var $,P=T.andln(I-1);if(T.isOdd()){if(P>(I>>1)-1)$=(I>>1)-P;else $=P;T.isubn($)}else $=0;x[M]=$,T.iushrn(1)}return x}t.getNAF=o;function s(_,g){var S=[[],[]];_=_.clone(),g=g.clone();var x=0,M=0,I;while(_.cmpn(-x)>0||g.cmpn(-M)>0){var T=_.andln(3)+x&3,$=g.andln(3)+M&3;if(T===3)T=-1;if($===3)$=-1;var P;if((T&1)===0)P=0;else if(I=_.andln(7)+x&7,(I===3||I===5)&&$===2)P=-T;else P=T;S[0].push(P);var R;if(($&1)===0)R=0;else if(I=g.andln(7)+M&7,(I===3||I===5)&&T===2)R=-$;else R=$;if(S[1].push(R),2*x===P+1)x=1-x;if(2*M===R+1)M=1-M;_.iushrn(1),g.iushrn(1)}return S}t.getJSF=s;function h(_,g,S){var x="_"+g;_.prototype[g]=function(){return this[x]!==void 0?this[x]:this[x]=S.call(this)}}t.cachedProperty=h;function b(_){return typeof _==="string"?t.toArray(_,"hex"):_}t.parseBytes=b;function v(_){return new r(_,"hex","le")}t.intFromLE=v}),bw=ce((e,t)=>{var r;t.exports=function(o){if(!r)r=new i(null);return r.generate(o)};function i(o){this.rand=o}if(t.exports.Rand=i,i.prototype.generate=function(o){return this._rand(o)},i.prototype._rand=function(o){if(this.rand.getBytes)return this.rand.getBytes(o);var s=new Uint8Array(o);for(var h=0;h<s.length;h++)s[h]=this.rand.getByte();return s},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)i.prototype._rand=function(o){var s=new Uint8Array(o);return self.crypto.getRandomValues(s),s};else if(self.msCrypto&&self.msCrypto.getRandomValues)i.prototype._rand=function(o){var s=new Uint8Array(o);return self.msCrypto.getRandomValues(s),s};else if(typeof window==="object")i.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(n=(Hr(),xt(ln)),typeof n.randomBytes!=="function")throw Error("Not supported");i.prototype._rand=function(o){return n.randomBytes(o)}}catch(o){}var n}),Lc=ce((e,t)=>{var r=si(),i=wn(),n=i.getNAF,o=i.getJSF,s=i.assert;function h(v,_){this.type=v,this.p=new r(_.p,16),this.red=_.prime?r.red(_.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=_.n&&new r(_.n,16),this.g=_.g&&this.pointFromJSON(_.g,_.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var g=this.n&&this.p.div(this.n);if(!g||g.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}t.exports=h,h.prototype.point=function(){throw Error("Not implemented")},h.prototype.validate=function(){throw Error("Not implemented")},h.prototype._fixedNafMul=function(v,_){s(v.precomputed);var g=v._getDoubles(),S=n(_,1,this._bitLength),x=(1<<g.step+1)-(g.step%2===0?2:1);x/=3;var M=[],I,T;for(I=0;I<S.length;I+=g.step){T=0;for(var $=I+g.step-1;$>=I;$--)T=(T<<1)+S[$];M.push(T)}var P=this.jpoint(null,null,null),R=this.jpoint(null,null,null);for(var C=x;C>0;C--){for(I=0;I<M.length;I++)if(T=M[I],T===C)R=R.mixedAdd(g.points[I]);else if(T===-C)R=R.mixedAdd(g.points[I].neg());P=P.add(R)}return P.toP()},h.prototype._wnafMul=function(v,_){var g=4,S=v._getNAFPoints(g);g=S.wnd;var x=S.points,M=n(_,g,this._bitLength),I=this.jpoint(null,null,null);for(var T=M.length-1;T>=0;T--){for(var $=0;T>=0&&M[T]===0;T--)$++;if(T>=0)$++;if(I=I.dblp($),T<0)break;var P=M[T];if(s(P!==0),v.type==="affine")if(P>0)I=I.mixedAdd(x[P-1>>1]);else I=I.mixedAdd(x[-P-1>>1].neg());else if(P>0)I=I.add(x[P-1>>1]);else I=I.add(x[-P-1>>1].neg())}return v.type==="affine"?I.toP():I},h.prototype._wnafMulAdd=function(v,_,g,S,x){var M=this._wnafT1,I=this._wnafT2,T=this._wnafT3,$=0,P,R,C;for(P=0;P<S;P++){C=_[P];var D=C._getNAFPoints(v);M[P]=D.wnd,I[P]=D.points}for(P=S-1;P>=1;P-=2){var B=P-1,ie=P;if(M[B]!==1||M[ie]!==1){T[B]=n(g[B],M[B],this._bitLength),T[ie]=n(g[ie],M[ie],this._bitLength),$=Math.max(T[B].length,$),$=Math.max(T[ie].length,$);continue}var le=[_[B],null,null,_[ie]];if(_[B].y.cmp(_[ie].y)===0)le[1]=_[B].add(_[ie]),le[2]=_[B].toJ().mixedAdd(_[ie].neg());else if(_[B].y.cmp(_[ie].y.redNeg())===0)le[1]=_[B].toJ().mixedAdd(_[ie]),le[2]=_[B].add(_[ie].neg());else le[1]=_[B].toJ().mixedAdd(_[ie]),le[2]=_[B].toJ().mixedAdd(_[ie].neg());var ue=[-3,-1,-5,-7,0,7,5,1,3],q=o(g[B],g[ie]);$=Math.max(q[0].length,$),T[B]=Array($),T[ie]=Array($);for(R=0;R<$;R++){var ee=q[0][R]|0,a=q[1][R]|0;T[B][R]=ue[(ee+1)*3+(a+1)],T[ie][R]=0,I[B]=le}}var c=this.jpoint(null,null,null),f=this._wnafT4;for(P=$;P>=0;P--){var l=0;while(P>=0){var d=!0;for(R=0;R<S;R++)if(f[R]=T[R][P]|0,f[R]!==0)d=!1;if(!d)break;l++,P--}if(P>=0)l++;if(c=c.dblp(l),P<0)break;for(R=0;R<S;R++){var y=f[R];if(y===0)continue;else if(y>0)C=I[R][y-1>>1];else if(y<0)C=I[R][-y-1>>1].neg();if(C.type==="affine")c=c.mixedAdd(C);else c=c.add(C)}}for(P=0;P<S;P++)I[P]=null;if(x)return c;else return c.toP()};function b(v,_){this.curve=v,this.type=_,this.precomputed=null}h.BasePoint=b,b.prototype.eq=function(){throw Error("Not implemented")},b.prototype.validate=function(){return this.curve.validate(this)},h.prototype.decodePoint=function(v,_){v=i.toArray(v,_);var g=this.p.byteLength();if((v[0]===4||v[0]===6||v[0]===7)&&v.length-1===2*g){if(v[0]===6)s(v[v.length-1]%2===0);else if(v[0]===7)s(v[v.length-1]%2===1);var S=this.point(v.slice(1,1+g),v.slice(1+g,1+2*g));return S}else if((v[0]===2||v[0]===3)&&v.length-1===g)return this.pointFromX(v.slice(1,1+g),v[0]===3);throw Error("Unknown point format")},b.prototype.encodeCompressed=function(v){return this.encode(v,!0)},b.prototype._encode=function(v){var _=this.curve.p.byteLength(),g=this.getX().toArray("be",_);if(v)return[this.getY().isEven()?2:3].concat(g);return[4].concat(g,this.getY().toArray("be",_))},b.prototype.encode=function(v,_){return i.encode(this._encode(_),v)},b.prototype.precompute=function(v){if(this.precomputed)return this;var _={doubles:null,naf:null,beta:null};return _.naf=this._getNAFPoints(8),_.doubles=this._getDoubles(4,v),_.beta=this._getBeta(),this.precomputed=_,this},b.prototype._hasDoubles=function(v){if(!this.precomputed)return!1;var _=this.precomputed.doubles;if(!_)return!1;return _.points.length>=Math.ceil((v.bitLength()+1)/_.step)},b.prototype._getDoubles=function(v,_){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var g=[this],S=this;for(var x=0;x<_;x+=v){for(var M=0;M<v;M++)S=S.dbl();g.push(S)}return{step:v,points:g}},b.prototype._getNAFPoints=function(v){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var _=[this],g=(1<<v)-1,S=g===1?null:this.dbl();for(var x=1;x<g;x++)_[x]=_[x-1].add(S);return{wnd:v,points:_}},b.prototype._getBeta=function(){return null},b.prototype.dblp=function(v){var _=this;for(var g=0;g<v;g++)_=_.dbl();return _}}),w$=ce((e,t)=>{if(typeof Object.create==="function")t.exports=function(r,i){if(i)r.super_=i,r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})};else t.exports=function(r,i){if(i){r.super_=i;var n=function(){};n.prototype=i.prototype,r.prototype=new n,r.prototype.constructor=r}}}),un=ce((e,t)=>{try{if(r=(O1(),xt(C1)),typeof r.inherits!=="function")throw"";t.exports=r.inherits}catch(i){t.exports=w$()}var r}),S$=ce((e,t)=>{var r=wn(),i=si(),n=un(),o=Lc(),s=r.assert;function h(_){o.call(this,"short",_),this.a=new i(_.a,16).toRed(this.red),this.b=new i(_.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(_),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}n(h,o),t.exports=h,h.prototype._getEndomorphism=function(_){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var g,S;if(_.beta)g=new i(_.beta,16).toRed(this.red);else{var x=this._getEndoRoots(this.p);g=x[0].cmp(x[1])<0?x[0]:x[1],g=g.toRed(this.red)}if(_.lambda)S=new i(_.lambda,16);else{var M=this._getEndoRoots(this.n);if(this.g.mul(M[0]).x.cmp(this.g.x.redMul(g))===0)S=M[0];else S=M[1],s(this.g.mul(S).x.cmp(this.g.x.redMul(g))===0)}var I;if(_.basis)I=_.basis.map(function(T){return{a:new i(T.a,16),b:new i(T.b,16)}});else I=this._getEndoBasis(S);return{beta:g,lambda:S,basis:I}},h.prototype._getEndoRoots=function(_){var g=_===this.p?this.red:i.mont(_),S=new i(2).toRed(g).redInvm(),x=S.redNeg(),M=new i(3).toRed(g).redNeg().redSqrt().redMul(S),I=x.redAdd(M).fromRed(),T=x.redSub(M).fromRed();return[I,T]},h.prototype._getEndoBasis=function(_){var g=this.n.ushrn(Math.floor(this.n.bitLength()/2)),S=_,x=this.n.clone(),M=new i(1),I=new i(0),T=new i(0),$=new i(1),P,R,C,D,B,ie,le,ue=0,q,ee;while(S.cmpn(0)!==0){var a=x.div(S);q=x.sub(a.mul(S)),ee=T.sub(a.mul(M));var c=$.sub(a.mul(I));if(!C&&q.cmp(g)<0)P=le.neg(),R=M,C=q.neg(),D=ee;else if(C&&++ue===2)break;le=q,x=S,S=q,T=M,M=ee,$=I,I=c}B=q.neg(),ie=ee;var f=C.sqr().add(D.sqr()),l=B.sqr().add(ie.sqr());if(l.cmp(f)>=0)B=P,ie=R;if(C.negative)C=C.neg(),D=D.neg();if(B.negative)B=B.neg(),ie=ie.neg();return[{a:C,b:D},{a:B,b:ie}]},h.prototype._endoSplit=function(_){var g=this.endo.basis,S=g[0],x=g[1],M=x.b.mul(_).divRound(this.n),I=S.b.neg().mul(_).divRound(this.n),T=M.mul(S.a),$=I.mul(x.a),P=M.mul(S.b),R=I.mul(x.b),C=_.sub(T).sub($),D=P.add(R).neg();return{k1:C,k2:D}},h.prototype.pointFromX=function(_,g){if(_=new i(_,16),!_.red)_=_.toRed(this.red);var S=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),x=S.redSqrt();if(x.redSqr().redSub(S).cmp(this.zero)!==0)throw Error("invalid point");var M=x.fromRed().isOdd();if(g&&!M||!g&&M)x=x.redNeg();return this.point(_,x)},h.prototype.validate=function(_){if(_.inf)return!0;var{x:g,y:S}=_,x=this.a.redMul(g),M=g.redSqr().redMul(g).redIAdd(x).redIAdd(this.b);return S.redSqr().redISub(M).cmpn(0)===0},h.prototype._endoWnafMulAdd=function(_,g,S){var x=this._endoWnafT1,M=this._endoWnafT2;for(var I=0;I<_.length;I++){var T=this._endoSplit(g[I]),$=_[I],P=$._getBeta();if(T.k1.negative)T.k1.ineg(),$=$.neg(!0);if(T.k2.negative)T.k2.ineg(),P=P.neg(!0);x[I*2]=$,x[I*2+1]=P,M[I*2]=T.k1,M[I*2+1]=T.k2}var R=this._wnafMulAdd(1,x,M,I*2,S);for(var C=0;C<I*2;C++)x[C]=null,M[C]=null;return R};function b(_,g,S,x){if(o.BasePoint.call(this,_,"affine"),g===null&&S===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new i(g,16),this.y=new i(S,16),x)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}n(b,o.BasePoint),h.prototype.point=function(_,g,S){return new b(this,_,g,S)},h.prototype.pointFromJSON=function(_,g){return b.fromJSON(this,_,g)},b.prototype._getBeta=function(){if(!this.curve.endo)return;var _=this.precomputed;if(_&&_.beta)return _.beta;var g=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(_){var S=this.curve,x=function(M){return S.point(M.x.redMul(S.endo.beta),M.y)};_.beta=g,g.precomputed={beta:null,naf:_.naf&&{wnd:_.naf.wnd,points:_.naf.points.map(x)},doubles:_.doubles&&{step:_.doubles.step,points:_.doubles.points.map(x)}}}return g},b.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},b.fromJSON=function(_,g,S){if(typeof g==="string")g=JSON.parse(g);var x=_.point(g[0],g[1],S);if(!g[2])return x;function M(T){return _.point(T[0],T[1],S)}var I=g[2];return x.precomputed={beta:null,doubles:I.doubles&&{step:I.doubles.step,points:[x].concat(I.doubles.points.map(M))},naf:I.naf&&{wnd:I.naf.wnd,points:[x].concat(I.naf.points.map(M))}},x},b.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},b.prototype.isInfinity=function(){return this.inf},b.prototype.add=function(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var g=this.y.redSub(_.y);if(g.cmpn(0)!==0)g=g.redMul(this.x.redSub(_.x).redInvm());var S=g.redSqr().redISub(this.x).redISub(_.x),x=g.redMul(this.x.redSub(S)).redISub(this.y);return this.curve.point(S,x)},b.prototype.dbl=function(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var g=this.curve.a,S=this.x.redSqr(),x=_.redInvm(),M=S.redAdd(S).redIAdd(S).redIAdd(g).redMul(x),I=M.redSqr().redISub(this.x.redAdd(this.x)),T=M.redMul(this.x.redSub(I)).redISub(this.y);return this.curve.point(I,T)},b.prototype.getX=function(){return this.x.fromRed()},b.prototype.getY=function(){return this.y.fromRed()},b.prototype.mul=function(_){if(_=new i(_,16),this.isInfinity())return this;else if(this._hasDoubles(_))return this.curve._fixedNafMul(this,_);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[_]);else return this.curve._wnafMul(this,_)},b.prototype.mulAdd=function(_,g,S){var x=[this,g],M=[_,S];if(this.curve.endo)return this.curve._endoWnafMulAdd(x,M);else return this.curve._wnafMulAdd(1,x,M,2)},b.prototype.jmulAdd=function(_,g,S){var x=[this,g],M=[_,S];if(this.curve.endo)return this.curve._endoWnafMulAdd(x,M,!0);else return this.curve._wnafMulAdd(1,x,M,2,!0)},b.prototype.eq=function(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)},b.prototype.neg=function(_){if(this.inf)return this;var g=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var S=this.precomputed,x=function(M){return M.neg()};g.precomputed={naf:S.naf&&{wnd:S.naf.wnd,points:S.naf.points.map(x)},doubles:S.doubles&&{step:S.doubles.step,points:S.doubles.points.map(x)}}}return g},b.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function v(_,g,S,x){if(o.BasePoint.call(this,_,"jacobian"),g===null&&S===null&&x===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0);else this.x=new i(g,16),this.y=new i(S,16),this.z=new i(x,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}n(v,o.BasePoint),h.prototype.jpoint=function(_,g,S){return new v(this,_,g,S)},v.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),g=_.redSqr(),S=this.x.redMul(g),x=this.y.redMul(g).redMul(_);return this.curve.point(S,x)},v.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},v.prototype.add=function(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var g=_.z.redSqr(),S=this.z.redSqr(),x=this.x.redMul(g),M=_.x.redMul(S),I=this.y.redMul(g.redMul(_.z)),T=_.y.redMul(S.redMul(this.z)),$=x.redSub(M),P=I.redSub(T);if($.cmpn(0)===0)if(P.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var R=$.redSqr(),C=R.redMul($),D=x.redMul(R),B=P.redSqr().redIAdd(C).redISub(D).redISub(D),ie=P.redMul(D.redISub(B)).redISub(I.redMul(C)),le=this.z.redMul(_.z).redMul($);return this.curve.jpoint(B,ie,le)},v.prototype.mixedAdd=function(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var g=this.z.redSqr(),S=this.x,x=_.x.redMul(g),M=this.y,I=_.y.redMul(g).redMul(this.z),T=S.redSub(x),$=M.redSub(I);if(T.cmpn(0)===0)if($.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var P=T.redSqr(),R=P.redMul(T),C=S.redMul(P),D=$.redSqr().redIAdd(R).redISub(C).redISub(C),B=$.redMul(C.redISub(D)).redISub(M.redMul(R)),ie=this.z.redMul(T);return this.curve.jpoint(D,B,ie)},v.prototype.dblp=function(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var g;if(this.curve.zeroA||this.curve.threeA){var S=this;for(g=0;g<_;g++)S=S.dbl();return S}var x=this.curve.a,M=this.curve.tinv,I=this.x,T=this.y,$=this.z,P=$.redSqr().redSqr(),R=T.redAdd(T);for(g=0;g<_;g++){var C=I.redSqr(),D=R.redSqr(),B=D.redSqr(),ie=C.redAdd(C).redIAdd(C).redIAdd(x.redMul(P)),le=I.redMul(D),ue=ie.redSqr().redISub(le.redAdd(le)),q=le.redISub(ue),ee=ie.redMul(q);ee=ee.redIAdd(ee).redISub(B);var a=R.redMul($);if(g+1<_)P=P.redMul(B);I=ue,$=a,R=ee}return this.curve.jpoint(I,R.redMul(M),$)},v.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},v.prototype._zeroDbl=function(){var _,g,S;if(this.zOne){var x=this.x.redSqr(),M=this.y.redSqr(),I=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var $=x.redAdd(x).redIAdd(x),P=$.redSqr().redISub(T).redISub(T),R=I.redIAdd(I);R=R.redIAdd(R),R=R.redIAdd(R),_=P,g=$.redMul(T.redISub(P)).redISub(R),S=this.y.redAdd(this.y)}else{var C=this.x.redSqr(),D=this.y.redSqr(),B=D.redSqr(),ie=this.x.redAdd(D).redSqr().redISub(C).redISub(B);ie=ie.redIAdd(ie);var le=C.redAdd(C).redIAdd(C),ue=le.redSqr(),q=B.redIAdd(B);q=q.redIAdd(q),q=q.redIAdd(q),_=ue.redISub(ie).redISub(ie),g=le.redMul(ie.redISub(_)).redISub(q),S=this.y.redMul(this.z),S=S.redIAdd(S)}return this.curve.jpoint(_,g,S)},v.prototype._threeDbl=function(){var _,g,S;if(this.zOne){var x=this.x.redSqr(),M=this.y.redSqr(),I=M.redSqr(),T=this.x.redAdd(M).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var $=x.redAdd(x).redIAdd(x).redIAdd(this.curve.a),P=$.redSqr().redISub(T).redISub(T);_=P;var R=I.redIAdd(I);R=R.redIAdd(R),R=R.redIAdd(R),g=$.redMul(T.redISub(P)).redISub(R),S=this.y.redAdd(this.y)}else{var C=this.z.redSqr(),D=this.y.redSqr(),B=this.x.redMul(D),ie=this.x.redSub(C).redMul(this.x.redAdd(C));ie=ie.redAdd(ie).redIAdd(ie);var le=B.redIAdd(B);le=le.redIAdd(le);var ue=le.redAdd(le);_=ie.redSqr().redISub(ue),S=this.y.redAdd(this.z).redSqr().redISub(D).redISub(C);var q=D.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),g=ie.redMul(le.redISub(_)).redISub(q)}return this.curve.jpoint(_,g,S)},v.prototype._dbl=function(){var _=this.curve.a,g=this.x,S=this.y,x=this.z,M=x.redSqr().redSqr(),I=g.redSqr(),T=S.redSqr(),$=I.redAdd(I).redIAdd(I).redIAdd(_.redMul(M)),P=g.redAdd(g);P=P.redIAdd(P);var R=P.redMul(T),C=$.redSqr().redISub(R.redAdd(R)),D=R.redISub(C),B=T.redSqr();B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var ie=$.redMul(D).redISub(B),le=S.redAdd(S).redMul(x);return this.curve.jpoint(C,ie,le)},v.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),g=this.y.redSqr(),S=this.z.redSqr(),x=g.redSqr(),M=_.redAdd(_).redIAdd(_),I=M.redSqr(),T=this.x.redAdd(g).redSqr().redISub(_).redISub(x);T=T.redIAdd(T),T=T.redAdd(T).redIAdd(T),T=T.redISub(I);var $=T.redSqr(),P=x.redIAdd(x);P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P);var R=M.redIAdd(T).redSqr().redISub(I).redISub($).redISub(P),C=g.redMul(R);C=C.redIAdd(C),C=C.redIAdd(C);var D=this.x.redMul($).redISub(C);D=D.redIAdd(D),D=D.redIAdd(D);var B=this.y.redMul(R.redMul(P.redISub(R)).redISub(T.redMul($)));B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var ie=this.z.redAdd(T).redSqr().redISub(S).redISub($);return this.curve.jpoint(D,B,ie)},v.prototype.mul=function(_,g){return _=new i(_,g),this.curve._wnafMul(this,_)},v.prototype.eq=function(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var g=this.z.redSqr(),S=_.z.redSqr();if(this.x.redMul(S).redISub(_.x.redMul(g)).cmpn(0)!==0)return!1;var x=g.redMul(this.z),M=S.redMul(_.z);return this.y.redMul(M).redISub(_.y.redMul(x)).cmpn(0)===0},v.prototype.eqXToP=function(_){var g=this.z.redSqr(),S=_.toRed(this.curve.red).redMul(g);if(this.x.cmp(S)===0)return!0;var x=_.clone(),M=this.curve.redN.redMul(g);for(;;){if(x.iadd(this.curve.n),x.cmp(this.curve.p)>=0)return!1;if(S.redIAdd(M),this.x.cmp(S)===0)return!0}},v.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},v.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),x$=ce((e,t)=>{var r=si(),i=un(),n=Lc(),o=wn();function s(b){n.call(this,"mont",b),this.a=new r(b.a,16).toRed(this.red),this.b=new r(b.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}i(s,n),t.exports=s,s.prototype.validate=function(b){var v=b.normalize().x,_=v.redSqr(),g=_.redMul(v).redAdd(_.redMul(this.a)).redAdd(v),S=g.redSqrt();return S.redSqr().cmp(g)===0};function h(b,v,_){if(n.BasePoint.call(this,b,"projective"),v===null&&_===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new r(v,16),this.z=new r(_,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}i(h,n.BasePoint),s.prototype.decodePoint=function(b,v){return this.point(o.toArray(b,v),1)},s.prototype.point=function(b,v){return new h(this,b,v)},s.prototype.pointFromJSON=function(b){return h.fromJSON(this,b)},h.prototype.precompute=function(){},h.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h.fromJSON=function(b,v){return new h(b,v[0],v[1]||b.one)},h.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.z.cmpn(0)===0},h.prototype.dbl=function(){var b=this.x.redAdd(this.z),v=b.redSqr(),_=this.x.redSub(this.z),g=_.redSqr(),S=v.redSub(g),x=v.redMul(g),M=S.redMul(g.redAdd(this.curve.a24.redMul(S)));return this.curve.point(x,M)},h.prototype.add=function(){throw Error("Not supported on Montgomery curve")},h.prototype.diffAdd=function(b,v){var _=this.x.redAdd(this.z),g=this.x.redSub(this.z),S=b.x.redAdd(b.z),x=b.x.redSub(b.z),M=x.redMul(_),I=S.redMul(g),T=v.z.redMul(M.redAdd(I).redSqr()),$=v.x.redMul(M.redISub(I).redSqr());return this.curve.point(T,$)},h.prototype.mul=function(b){var v=b.clone(),_=this,g=this.curve.point(null,null),S=this;for(var x=[];v.cmpn(0)!==0;v.iushrn(1))x.push(v.andln(1));for(var M=x.length-1;M>=0;M--)if(x[M]===0)_=_.diffAdd(g,S),g=g.dbl();else g=_.diffAdd(g,S),_=_.dbl();return g},h.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},h.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},h.prototype.eq=function(b){return this.getX().cmp(b.getX())===0},h.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),k$=ce((e,t)=>{var r=wn(),i=si(),n=un(),o=Lc(),s=r.assert;function h(v){this.twisted=(v.a|0)!==1,this.mOneA=this.twisted&&(v.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",v),this.a=new i(v.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(v.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(v.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(v.c|0)===1}n(h,o),t.exports=h,h.prototype._mulA=function(v){if(this.mOneA)return v.redNeg();else return this.a.redMul(v)},h.prototype._mulC=function(v){if(this.oneC)return v;else return this.c.redMul(v)},h.prototype.jpoint=function(v,_,g,S){return this.point(v,_,g,S)},h.prototype.pointFromX=function(v,_){if(v=new i(v,16),!v.red)v=v.toRed(this.red);var g=v.redSqr(),S=this.c2.redSub(this.a.redMul(g)),x=this.one.redSub(this.c2.redMul(this.d).redMul(g)),M=S.redMul(x.redInvm()),I=M.redSqrt();if(I.redSqr().redSub(M).cmp(this.zero)!==0)throw Error("invalid point");var T=I.fromRed().isOdd();if(_&&!T||!_&&T)I=I.redNeg();return this.point(v,I)},h.prototype.pointFromY=function(v,_){if(v=new i(v,16),!v.red)v=v.toRed(this.red);var g=v.redSqr(),S=g.redSub(this.c2),x=g.redMul(this.d).redMul(this.c2).redSub(this.a),M=S.redMul(x.redInvm());if(M.cmp(this.zero)===0)if(_)throw Error("invalid point");else return this.point(this.zero,v);var I=M.redSqrt();if(I.redSqr().redSub(M).cmp(this.zero)!==0)throw Error("invalid point");if(I.fromRed().isOdd()!==_)I=I.redNeg();return this.point(I,v)},h.prototype.validate=function(v){if(v.isInfinity())return!0;v.normalize();var _=v.x.redSqr(),g=v.y.redSqr(),S=_.redMul(this.a).redAdd(g),x=this.c2.redMul(this.one.redAdd(this.d.redMul(_).redMul(g)));return S.cmp(x)===0};function b(v,_,g,S,x){if(o.BasePoint.call(this,v,"projective"),_===null&&g===null&&S===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new i(_,16),this.y=new i(g,16),this.z=S?new i(S,16):this.curve.one,this.t=x&&new i(x,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}n(b,o.BasePoint),h.prototype.pointFromJSON=function(v){return b.fromJSON(this,v)},h.prototype.point=function(v,_,g,S){return new b(this,v,_,g,S)},b.fromJSON=function(v,_){return new b(v,_[0],_[1],_[2])},b.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},b.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},b.prototype._extDbl=function(){var v=this.x.redSqr(),_=this.y.redSqr(),g=this.z.redSqr();g=g.redIAdd(g);var S=this.curve._mulA(v),x=this.x.redAdd(this.y).redSqr().redISub(v).redISub(_),M=S.redAdd(_),I=M.redSub(g),T=S.redSub(_),$=x.redMul(I),P=M.redMul(T),R=x.redMul(T),C=I.redMul(M);return this.curve.point($,P,C,R)},b.prototype._projDbl=function(){var v=this.x.redAdd(this.y).redSqr(),_=this.x.redSqr(),g=this.y.redSqr(),S,x,M,I,T,$;if(this.curve.twisted){I=this.curve._mulA(_);var P=I.redAdd(g);if(this.zOne)S=v.redSub(_).redSub(g).redMul(P.redSub(this.curve.two)),x=P.redMul(I.redSub(g)),M=P.redSqr().redSub(P).redSub(P);else T=this.z.redSqr(),$=P.redSub(T).redISub(T),S=v.redSub(_).redISub(g).redMul($),x=P.redMul(I.redSub(g)),M=P.redMul($)}else I=_.redAdd(g),T=this.curve._mulC(this.z).redSqr(),$=I.redSub(T).redSub(T),S=this.curve._mulC(v.redISub(I)).redMul($),x=this.curve._mulC(I).redMul(_.redISub(g)),M=I.redMul($);return this.curve.point(S,x,M)},b.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},b.prototype._extAdd=function(v){var _=this.y.redSub(this.x).redMul(v.y.redSub(v.x)),g=this.y.redAdd(this.x).redMul(v.y.redAdd(v.x)),S=this.t.redMul(this.curve.dd).redMul(v.t),x=this.z.redMul(v.z.redAdd(v.z)),M=g.redSub(_),I=x.redSub(S),T=x.redAdd(S),$=g.redAdd(_),P=M.redMul(I),R=T.redMul($),C=M.redMul($),D=I.redMul(T);return this.curve.point(P,R,D,C)},b.prototype._projAdd=function(v){var _=this.z.redMul(v.z),g=_.redSqr(),S=this.x.redMul(v.x),x=this.y.redMul(v.y),M=this.curve.d.redMul(S).redMul(x),I=g.redSub(M),T=g.redAdd(M),$=this.x.redAdd(this.y).redMul(v.x.redAdd(v.y)).redISub(S).redISub(x),P=_.redMul(I).redMul($),R,C;if(this.curve.twisted)R=_.redMul(T).redMul(x.redSub(this.curve._mulA(S))),C=I.redMul(T);else R=_.redMul(T).redMul(x.redSub(S)),C=this.curve._mulC(I).redMul(T);return this.curve.point(P,R,C)},b.prototype.add=function(v){if(this.isInfinity())return v;if(v.isInfinity())return this;if(this.curve.extended)return this._extAdd(v);else return this._projAdd(v)},b.prototype.mul=function(v){if(this._hasDoubles(v))return this.curve._fixedNafMul(this,v);else return this.curve._wnafMul(this,v)},b.prototype.mulAdd=function(v,_,g){return this.curve._wnafMulAdd(1,[this,_],[v,g],2,!1)},b.prototype.jmulAdd=function(v,_,g){return this.curve._wnafMulAdd(1,[this,_],[v,g],2,!0)},b.prototype.normalize=function(){if(this.zOne)return this;var v=this.z.redInvm();if(this.x=this.x.redMul(v),this.y=this.y.redMul(v),this.t)this.t=this.t.redMul(v);return this.z=this.curve.one,this.zOne=!0,this},b.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},b.prototype.getX=function(){return this.normalize(),this.x.fromRed()},b.prototype.getY=function(){return this.normalize(),this.y.fromRed()},b.prototype.eq=function(v){return this===v||this.getX().cmp(v.getX())===0&&this.getY().cmp(v.getY())===0},b.prototype.eqXToP=function(v){var _=v.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(_)===0)return!0;var g=v.clone(),S=this.curve.redN.redMul(this.z);for(;;){if(g.iadd(this.curve.n),g.cmp(this.curve.p)>=0)return!1;if(_.redIAdd(S),this.x.cmp(_)===0)return!0}},b.prototype.toP=b.prototype.normalize,b.prototype.mixedAdd=b.prototype.add}),_w=ce((e)=>{var t=e;t.base=Lc(),t.short=S$(),t.mont=x$(),t.edwards=k$()}),Gn=ce((e)=>{var t=Ci(),r=un();e.inherits=r;function i(c,f){if((c.charCodeAt(f)&64512)!==55296)return!1;if(f<0||f+1>=c.length)return!1;return(c.charCodeAt(f+1)&64512)===56320}function n(c,f){if(Array.isArray(c))return c.slice();if(!c)return[];var l=[];if(typeof c==="string"){if(!f){var d=0;for(var y=0;y<c.length;y++){var w=c.charCodeAt(y);if(w<128)l[d++]=w;else if(w<2048)l[d++]=w>>6|192,l[d++]=w&63|128;else if(i(c,y))w=65536+((w&1023)<<10)+(c.charCodeAt(++y)&1023),l[d++]=w>>18|240,l[d++]=w>>12&63|128,l[d++]=w>>6&63|128,l[d++]=w&63|128;else l[d++]=w>>12|224,l[d++]=w>>6&63|128,l[d++]=w&63|128}}else if(f==="hex"){if(c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0)c="0"+c;for(y=0;y<c.length;y+=2)l.push(parseInt(c[y]+c[y+1],16))}}else for(y=0;y<c.length;y++)l[y]=c[y]|0;return l}e.toArray=n;function o(c){var f="";for(var l=0;l<c.length;l++)f+=b(c[l].toString(16));return f}e.toHex=o;function s(c){var f=c>>>24|c>>>8&65280|c<<8&16711680|(c&255)<<24;return f>>>0}e.htonl=s;function h(c,f){var l="";for(var d=0;d<c.length;d++){var y=c[d];if(f==="little")y=s(y);l+=v(y.toString(16))}return l}e.toHex32=h;function b(c){if(c.length===1)return"0"+c;else return c}e.zero2=b;function v(c){if(c.length===7)return"0"+c;else if(c.length===6)return"00"+c;else if(c.length===5)return"000"+c;else if(c.length===4)return"0000"+c;else if(c.length===3)return"00000"+c;else if(c.length===2)return"000000"+c;else if(c.length===1)return"0000000"+c;else return c}e.zero8=v;function _(c,f,l,d){var y=l-f;t(y%4===0);var w=Array(y/4);for(var p=0,u=f;p<w.length;p++,u+=4){var m;if(d==="big")m=c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3];else m=c[u+3]<<24|c[u+2]<<16|c[u+1]<<8|c[u];w[p]=m>>>0}return w}e.join32=_;function g(c,f){var l=Array(c.length*4);for(var d=0,y=0;d<c.length;d++,y+=4){var w=c[d];if(f==="big")l[y]=w>>>24,l[y+1]=w>>>16&255,l[y+2]=w>>>8&255,l[y+3]=w&255;else l[y+3]=w>>>24,l[y+2]=w>>>16&255,l[y+1]=w>>>8&255,l[y]=w&255}return l}e.split32=g;function S(c,f){return c>>>f|c<<32-f}e.rotr32=S;function x(c,f){return c<<f|c>>>32-f}e.rotl32=x;function M(c,f){return c+f>>>0}e.sum32=M;function I(c,f,l){return c+f+l>>>0}e.sum32_3=I;function T(c,f,l,d){return c+f+l+d>>>0}e.sum32_4=T;function $(c,f,l,d,y){return c+f+l+d+y>>>0}e.sum32_5=$;function P(c,f,l,d){var y=c[f],w=c[f+1],p=d+w>>>0,u=(p<d?1:0)+l+y;c[f]=u>>>0,c[f+1]=p}e.sum64=P;function R(c,f,l,d){var y=f+d>>>0,w=(y<f?1:0)+c+l;return w>>>0}e.sum64_hi=R;function C(c,f,l,d){var y=f+d;return y>>>0}e.sum64_lo=C;function D(c,f,l,d,y,w,p,u){var m=0,E=f;E=E+d>>>0,m+=E<f?1:0,E=E+w>>>0,m+=E<w?1:0,E=E+u>>>0,m+=E<u?1:0;var k=c+l+y+p+m;return k>>>0}e.sum64_4_hi=D;function B(c,f,l,d,y,w,p,u){var m=f+d+w+u;return m>>>0}e.sum64_4_lo=B;function ie(c,f,l,d,y,w,p,u,m,E){var k=0,A=f;A=A+d>>>0,k+=A<f?1:0,A=A+w>>>0,k+=A<w?1:0,A=A+u>>>0,k+=A<u?1:0,A=A+E>>>0,k+=A<E?1:0;var N=c+l+y+p+m+k;return N>>>0}e.sum64_5_hi=ie;function le(c,f,l,d,y,w,p,u,m,E){var k=f+d+w+u+E;return k>>>0}e.sum64_5_lo=le;function ue(c,f,l){var d=f<<32-l|c>>>l;return d>>>0}e.rotr64_hi=ue;function q(c,f,l){var d=c<<32-l|f>>>l;return d>>>0}e.rotr64_lo=q;function ee(c,f,l){return c>>>l}e.shr64_hi=ee;function a(c,f,l){var d=c<<32-l|f>>>l;return d>>>0}e.shr64_lo=a}),Ia=ce((e)=>{var t=Gn(),r=Ci();function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=i,i.prototype.update=function(n,o){if(n=t.toArray(n,o),!this.pending)this.pending=n;else this.pending=this.pending.concat(n);if(this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var s=n.length%this._delta8;if(this.pending=n.slice(n.length-s,n.length),this.pending.length===0)this.pending=null;n=t.join32(n,0,n.length-s,this.endian);for(var h=0;h<n.length;h+=this._delta32)this._update(n,h,h+this._delta32)}return this},i.prototype.digest=function(n){return this.update(this._pad()),r(this.pending===null),this._digest(n)},i.prototype._pad=function(){var n=this.pendingTotal,o=this._delta8,s=o-(n+this.padLength)%o,h=Array(s+this.padLength);h[0]=128;for(var b=1;b<s;b++)h[b]=0;if(n<<=3,this.endian==="big"){for(var v=8;v<this.padLength;v++)h[b++]=0;h[b++]=0,h[b++]=0,h[b++]=0,h[b++]=0,h[b++]=n>>>24&255,h[b++]=n>>>16&255,h[b++]=n>>>8&255,h[b++]=n&255}else{h[b++]=n&255,h[b++]=n>>>8&255,h[b++]=n>>>16&255,h[b++]=n>>>24&255,h[b++]=0,h[b++]=0,h[b++]=0,h[b++]=0;for(v=8;v<this.padLength;v++)h[b++]=0}return h}}),ww=ce((e)=>{var t=Gn(),r=t.rotr32;function i(g,S,x,M){if(g===0)return n(S,x,M);if(g===1||g===3)return s(S,x,M);if(g===2)return o(S,x,M)}e.ft_1=i;function n(g,S,x){return g&S^~g&x}e.ch32=n;function o(g,S,x){return g&S^g&x^S&x}e.maj32=o;function s(g,S,x){return g^S^x}e.p32=s;function h(g){return r(g,2)^r(g,13)^r(g,22)}e.s0_256=h;function b(g){return r(g,6)^r(g,11)^r(g,25)}e.s1_256=b;function v(g){return r(g,7)^r(g,18)^g>>>3}e.g0_256=v;function _(g){return r(g,17)^r(g,19)^g>>>10}e.g1_256=_}),M$=ce((e,t)=>{var r=Gn(),i=Ia(),n=ww(),o=r.rotl32,s=r.sum32,h=r.sum32_5,b=n.ft_1,v=i.BlockHash,_=[1518500249,1859775393,2400959708,3395469782];function g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}r.inherits(g,v),t.exports=g,g.blockSize=512,g.outSize=160,g.hmacStrength=80,g.padLength=64,g.prototype._update=function(S,x){var M=this.W;for(var I=0;I<16;I++)M[I]=S[x+I];for(;I<M.length;I++)M[I]=o(M[I-3]^M[I-8]^M[I-14]^M[I-16],1);var T=this.h[0],$=this.h[1],P=this.h[2],R=this.h[3],C=this.h[4];for(I=0;I<M.length;I++){var D=~~(I/20),B=h(o(T,5),b(D,$,P,R),C,M[I],_[D]);C=R,R=P,P=o($,30),$=T,T=B}this.h[0]=s(this.h[0],T),this.h[1]=s(this.h[1],$),this.h[2]=s(this.h[2],P),this.h[3]=s(this.h[3],R),this.h[4]=s(this.h[4],C)},g.prototype._digest=function(S){if(S==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")}}),Sw=ce((e,t)=>{var r=Gn(),i=Ia(),n=ww(),o=Ci(),s=r.sum32,h=r.sum32_4,b=r.sum32_5,v=n.ch32,_=n.maj32,g=n.s0_256,S=n.s1_256,x=n.g0_256,M=n.g1_256,I=i.BlockHash,T=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function $(){if(!(this instanceof $))return new $;I.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=T,this.W=Array(64)}r.inherits($,I),t.exports=$,$.blockSize=512,$.outSize=256,$.hmacStrength=192,$.padLength=64,$.prototype._update=function(P,R){var C=this.W;for(var D=0;D<16;D++)C[D]=P[R+D];for(;D<C.length;D++)C[D]=h(M(C[D-2]),C[D-7],x(C[D-15]),C[D-16]);var B=this.h[0],ie=this.h[1],le=this.h[2],ue=this.h[3],q=this.h[4],ee=this.h[5],a=this.h[6],c=this.h[7];o(this.k.length===C.length);for(D=0;D<C.length;D++){var f=b(c,S(q),v(q,ee,a),this.k[D],C[D]),l=s(g(B),_(B,ie,le));c=a,a=ee,ee=q,q=s(ue,f),ue=le,le=ie,ie=B,B=s(f,l)}this.h[0]=s(this.h[0],B),this.h[1]=s(this.h[1],ie),this.h[2]=s(this.h[2],le),this.h[3]=s(this.h[3],ue),this.h[4]=s(this.h[4],q),this.h[5]=s(this.h[5],ee),this.h[6]=s(this.h[6],a),this.h[7]=s(this.h[7],c)},$.prototype._digest=function(P){if(P==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")}}),E$=ce((e,t)=>{var r=Gn(),i=Sw();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(n,i),t.exports=n,n.blockSize=512,n.outSize=224,n.hmacStrength=192,n.padLength=64,n.prototype._digest=function(o){if(o==="hex")return r.toHex32(this.h.slice(0,7),"big");else return r.split32(this.h.slice(0,7),"big")}}),xw=ce((e,t)=>{var r=Gn(),i=Ia(),n=Ci(),o=r.rotr64_hi,s=r.rotr64_lo,h=r.shr64_hi,b=r.shr64_lo,v=r.sum64,_=r.sum64_hi,g=r.sum64_lo,S=r.sum64_4_hi,x=r.sum64_4_lo,M=r.sum64_5_hi,I=r.sum64_5_lo,T=i.BlockHash,$=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function P(){if(!(this instanceof P))return new P;T.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=$,this.W=Array(160)}r.inherits(P,T),t.exports=P,P.blockSize=1024,P.outSize=512,P.hmacStrength=192,P.padLength=128,P.prototype._prepareBlock=function(l,d){var y=this.W;for(var w=0;w<32;w++)y[w]=l[d+w];for(;w<y.length;w+=2){var p=c(y[w-4],y[w-3]),u=f(y[w-4],y[w-3]),m=y[w-14],E=y[w-13],k=ee(y[w-30],y[w-29]),A=a(y[w-30],y[w-29]),N=y[w-32],U=y[w-31];y[w]=S(p,u,m,E,k,A,N,U),y[w+1]=x(p,u,m,E,k,A,N,U)}},P.prototype._update=function(l,d){this._prepareBlock(l,d);var y=this.W,w=this.h[0],p=this.h[1],u=this.h[2],m=this.h[3],E=this.h[4],k=this.h[5],A=this.h[6],N=this.h[7],U=this.h[8],K=this.h[9],he=this.h[10],J=this.h[11],H=this.h[12],se=this.h[13],V=this.h[14],Q=this.h[15];n(this.k.length===y.length);for(var Be=0;Be<y.length;Be+=2){var z=V,L=Q,ae=ue(U,K),G=q(U,K),Y=R(U,K,he,J,H,se),Me=C(U,K,he,J,H,se),j=this.k[Be],Z=this.k[Be+1],je=y[Be],W=y[Be+1],re=M(z,L,ae,G,Y,Me,j,Z,je,W),st=I(z,L,ae,G,Y,Me,j,Z,je,W);z=ie(w,p),L=le(w,p),ae=D(w,p,u,m,E,k),G=B(w,p,u,m,E,k);var ge=_(z,L,ae,G),ye=g(z,L,ae,G);V=H,Q=se,H=he,se=J,he=U,J=K,U=_(A,N,re,st),K=g(N,N,re,st),A=E,N=k,E=u,k=m,u=w,m=p,w=_(re,st,ge,ye),p=g(re,st,ge,ye)}v(this.h,0,w,p),v(this.h,2,u,m),v(this.h,4,E,k),v(this.h,6,A,N),v(this.h,8,U,K),v(this.h,10,he,J),v(this.h,12,H,se),v(this.h,14,V,Q)},P.prototype._digest=function(l){if(l==="hex")return r.toHex32(this.h,"big");else return r.split32(this.h,"big")};function R(l,d,y,w,p){var u=l&y^~l&p;if(u<0)u+=4294967296;return u}function C(l,d,y,w,p,u){var m=d&w^~d&u;if(m<0)m+=4294967296;return m}function D(l,d,y,w,p){var u=l&y^l&p^y&p;if(u<0)u+=4294967296;return u}function B(l,d,y,w,p,u){var m=d&w^d&u^w&u;if(m<0)m+=4294967296;return m}function ie(l,d){var y=o(l,d,28),w=o(d,l,2),p=o(d,l,7),u=y^w^p;if(u<0)u+=4294967296;return u}function le(l,d){var y=s(l,d,28),w=s(d,l,2),p=s(d,l,7),u=y^w^p;if(u<0)u+=4294967296;return u}function ue(l,d){var y=o(l,d,14),w=o(l,d,18),p=o(d,l,9),u=y^w^p;if(u<0)u+=4294967296;return u}function q(l,d){var y=s(l,d,14),w=s(l,d,18),p=s(d,l,9),u=y^w^p;if(u<0)u+=4294967296;return u}function ee(l,d){var y=o(l,d,1),w=o(l,d,8),p=h(l,d,7),u=y^w^p;if(u<0)u+=4294967296;return u}function a(l,d){var y=s(l,d,1),w=s(l,d,8),p=b(l,d,7),u=y^w^p;if(u<0)u+=4294967296;return u}function c(l,d){var y=o(l,d,19),w=o(d,l,29),p=h(l,d,6),u=y^w^p;if(u<0)u+=4294967296;return u}function f(l,d){var y=s(l,d,19),w=s(d,l,29),p=b(l,d,6),u=y^w^p;if(u<0)u+=4294967296;return u}}),I$=ce((e,t)=>{var r=Gn(),i=xw();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(n,i),t.exports=n,n.blockSize=1024,n.outSize=384,n.hmacStrength=192,n.padLength=128,n.prototype._digest=function(o){if(o==="hex")return r.toHex32(this.h.slice(0,12),"big");else return r.split32(this.h.slice(0,12),"big")}}),T$=ce((e)=>{e.sha1=M$(),e.sha224=E$(),e.sha256=Sw(),e.sha384=I$(),e.sha512=xw()}),$$=ce((e)=>{var t=Gn(),r=Ia(),i=t.rotl32,n=t.sum32,o=t.sum32_3,s=t.sum32_4,h=r.BlockHash;function b(){if(!(this instanceof b))return new b;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}t.inherits(b,h),e.ripemd160=b,b.blockSize=512,b.outSize=160,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(T,$){var P=this.h[0],R=this.h[1],C=this.h[2],D=this.h[3],B=this.h[4],ie=P,le=R,ue=C,q=D,ee=B;for(var a=0;a<80;a++){var c=n(i(s(P,v(a,R,C,D),T[S[a]+$],_(a)),M[a]),B);P=B,B=D,D=i(C,10),C=R,R=c,c=n(i(s(ie,v(79-a,le,ue,q),T[x[a]+$],g(a)),I[a]),ee),ie=ee,ee=q,q=i(ue,10),ue=le,le=c}c=o(this.h[1],C,q),this.h[1]=o(this.h[2],D,ee),this.h[2]=o(this.h[3],B,ie),this.h[3]=o(this.h[4],P,le),this.h[4]=o(this.h[0],R,ue),this.h[0]=c},b.prototype._digest=function(T){if(T==="hex")return t.toHex32(this.h,"little");else return t.split32(this.h,"little")};function v(T,$,P,R){if(T<=15)return $^P^R;else if(T<=31)return $&P|~$&R;else if(T<=47)return($|~P)^R;else if(T<=63)return $&R|P&~R;else return $^(P|~R)}function _(T){if(T<=15)return 0;else if(T<=31)return 1518500249;else if(T<=47)return 1859775393;else if(T<=63)return 2400959708;else return 2840853838}function g(T){if(T<=15)return 1352829926;else if(T<=31)return 1548603684;else if(T<=47)return 1836072691;else if(T<=63)return 2053994217;else return 0}var S=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],x=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],M=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],I=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),P$=ce((e,t)=>{var r=Gn(),i=Ci();function n(o,s,h){if(!(this instanceof n))return new n(o,s,h);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(s,h))}t.exports=n,n.prototype._init=function(o){if(o.length>this.blockSize)o=new this.Hash().update(o).digest();i(o.length<=this.blockSize);for(var s=o.length;s<this.blockSize;s++)o.push(0);for(s=0;s<o.length;s++)o[s]^=54;this.inner=new this.Hash().update(o);for(s=0;s<o.length;s++)o[s]^=106;this.outer=new this.Hash().update(o)},n.prototype.update=function(o,s){return this.inner.update(o,s),this},n.prototype.digest=function(o){return this.outer.update(this.inner.digest()),this.outer.digest(o)}}),Pm=ce((e)=>{var t=e;t.utils=Gn(),t.common=Ia(),t.sha=T$(),t.ripemd=$$(),t.hmac=P$(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}),A$=ce((e,t)=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),Am=ce((e)=>{var t=e,r=Pm(),i=_w(),n=wn(),o=n.assert;function s(v){if(v.type==="short")this.curve=new i.short(v);else if(v.type==="edwards")this.curve=new i.edwards(v);else this.curve=new i.mont(v);this.g=this.curve.g,this.n=this.curve.n,this.hash=v.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=s;function h(v,_){Object.defineProperty(t,v,{configurable:!0,enumerable:!0,get:function(){var g=new s(_);return Object.defineProperty(t,v,{configurable:!0,enumerable:!0,value:g}),g}})}h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var b;try{b=A$()}catch(v){b=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",b]})}),R$=ce((e,t)=>{var r=Pm(),i=vw(),n=Ci();function o(s){if(!(this instanceof o))return new o(s);this.hash=s.hash,this.predResist=!!s.predResist,this.outLen=this.hash.outSize,this.minEntropy=s.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var h=i.toArray(s.entropy,s.entropyEnc||"hex"),b=i.toArray(s.nonce,s.nonceEnc||"hex"),v=i.toArray(s.pers,s.persEnc||"hex");n(h.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(h,b,v)}t.exports=o,o.prototype._init=function(s,h,b){var v=s.concat(h).concat(b);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var _=0;_<this.V.length;_++)this.K[_]=0,this.V[_]=1;this._update(v),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},o.prototype._update=function(s){var h=this._hmac().update(this.V).update([0]);if(s)h=h.update(s);if(this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),!s)return;this.K=this._hmac().update(this.V).update([1]).update(s).digest(),this.V=this._hmac().update(this.V).digest()},o.prototype.reseed=function(s,h,b,v){if(typeof h!=="string")v=b,b=h,h=null;s=i.toArray(s,h),b=i.toArray(b,v),n(s.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(s.concat(b||[])),this._reseed=1},o.prototype.generate=function(s,h,b,v){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof h!=="string")v=b,b=h,h=null;if(b)b=i.toArray(b,v||"hex"),this._update(b);var _=[];while(_.length<s)this.V=this._hmac().update(this.V).digest(),_=_.concat(this.V);var g=_.slice(0,s);return this._update(b),this._reseed++,i.encode(g,h)}}),C$=ce((e,t)=>{var r=si(),i=wn(),n=i.assert;function o(s,h){if(this.ec=s,this.priv=null,this.pub=null,h.priv)this._importPrivate(h.priv,h.privEnc);if(h.pub)this._importPublic(h.pub,h.pubEnc)}t.exports=o,o.fromPublic=function(s,h,b){if(h instanceof o)return h;return new o(s,{pub:h,pubEnc:b})},o.fromPrivate=function(s,h,b){if(h instanceof o)return h;return new o(s,{priv:h,privEnc:b})},o.prototype.validate=function(){var s=this.getPublic();if(s.isInfinity())return{result:!1,reason:"Invalid public key"};if(!s.validate())return{result:!1,reason:"Public key is not a point"};if(!s.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},o.prototype.getPublic=function(s,h){if(typeof s==="string")h=s,s=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!h)return this.pub;return this.pub.encode(h,s)},o.prototype.getPrivate=function(s){if(s==="hex")return this.priv.toString(16,2);else return this.priv},o.prototype._importPrivate=function(s,h){this.priv=new r(s,h||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(s,h){if(s.x||s.y){if(this.ec.curve.type==="mont")n(s.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")n(s.x&&s.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(s.x,s.y);return}this.pub=this.ec.curve.decodePoint(s,h)},o.prototype.derive=function(s){if(!s.validate())n(s.validate(),"public point not validated");return s.mul(this.priv).getX()},o.prototype.sign=function(s,h,b){return this.ec.sign(s,this,h,b)},o.prototype.verify=function(s,h,b){return this.ec.verify(s,h,this,void 0,b)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),O$=ce((e,t)=>{var r=si(),i=wn(),n=i.assert;function o(_,g){if(_ instanceof o)return _;if(this._importDER(_,g))return;if(n(_.r&&_.s,"Signature without r or s"),this.r=new r(_.r,16),this.s=new r(_.s,16),_.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=_.recoveryParam}t.exports=o;function s(){this.place=0}function h(_,g){var S=_[g.place++];if(!(S&128))return S;var x=S&15;if(x===0||x>4)return!1;if(_[g.place]===0)return!1;var M=0;for(var I=0,T=g.place;I<x;I++,T++)M<<=8,M|=_[T],M>>>=0;if(M<=127)return!1;return g.place=T,M}function b(_){var g=0,S=_.length-1;while(!_[g]&&!(_[g+1]&128)&&g<S)g++;if(g===0)return _;return _.slice(g)}o.prototype._importDER=function(_,g){_=i.toArray(_,g);var S=new s;if(_[S.place++]!==48)return!1;var x=h(_,S);if(x===!1)return!1;if(x+S.place!==_.length)return!1;if(_[S.place++]!==2)return!1;var M=h(_,S);if(M===!1)return!1;if((_[S.place]&128)!==0)return!1;var I=_.slice(S.place,M+S.place);if(S.place+=M,_[S.place++]!==2)return!1;var T=h(_,S);if(T===!1)return!1;if(_.length!==T+S.place)return!1;if((_[S.place]&128)!==0)return!1;var $=_.slice(S.place,T+S.place);if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;if($[0]===0)if($[1]&128)$=$.slice(1);else return!1;return this.r=new r(I),this.s=new r($),this.recoveryParam=null,!0};function v(_,g){if(g<128){_.push(g);return}var S=1+(Math.log(g)/Math.LN2>>>3);_.push(S|128);while(--S)_.push(g>>>(S<<3)&255);_.push(g)}o.prototype.toDER=function(_){var g=this.r.toArray(),S=this.s.toArray();if(g[0]&128)g=[0].concat(g);if(S[0]&128)S=[0].concat(S);g=b(g),S=b(S);while(!S[0]&&!(S[1]&128))S=S.slice(1);var x=[2];v(x,g.length),x=x.concat(g),x.push(2),v(x,S.length);var M=x.concat(S),I=[48];return v(I,M.length),I=I.concat(M),i.encode(I,_)}}),N$=ce((e,t)=>{var r=si(),i=R$(),n=wn(),o=Am(),s=bw(),h=n.assert,b=C$(),v=O$();function _(g){if(!(this instanceof _))return new _(g);if(typeof g==="string")h(Object.prototype.hasOwnProperty.call(o,g),"Unknown curve "+g),g=o[g];if(g instanceof o.PresetCurve)g={curve:g};this.curve=g.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=g.curve.g,this.g.precompute(g.curve.n.bitLength()+1),this.hash=g.hash||g.curve.hash}t.exports=_,_.prototype.keyPair=function(g){return new b(this,g)},_.prototype.keyFromPrivate=function(g,S){return b.fromPrivate(this,g,S)},_.prototype.keyFromPublic=function(g,S){return b.fromPublic(this,g,S)},_.prototype.genKeyPair=function(g){if(!g)g={};var S=new i({hash:this.hash,pers:g.pers,persEnc:g.persEnc||"utf8",entropy:g.entropy||s(this.hash.hmacStrength),entropyEnc:g.entropy&&g.entropyEnc||"utf8",nonce:this.n.toArray()}),x=this.n.byteLength(),M=this.n.sub(new r(2));for(;;){var I=new r(S.generate(x));if(I.cmp(M)>0)continue;return I.iaddn(1),this.keyFromPrivate(I)}},_.prototype._truncateToN=function(g,S,x){var M;if(r.isBN(g)||typeof g==="number")g=new r(g,16),M=g.byteLength();else if(typeof g==="object")M=g.length,g=new r(g,16);else{var I=g.toString();M=I.length+1>>>1,g=new r(I,16)}if(typeof x!=="number")x=M*8;var T=x-this.n.bitLength();if(T>0)g=g.ushrn(T);if(!S&&g.cmp(this.n)>=0)return g.sub(this.n);else return g},_.prototype.sign=function(g,S,x,M){if(typeof x==="object")M=x,x=null;if(!M)M={};if(typeof g!=="string"&&typeof g!=="number"&&!r.isBN(g)){h(typeof g==="object"&&g&&typeof g.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),h(g.length>>>0===g.length);for(var I=0;I<g.length;I++)h((g[I]&255)===g[I])}S=this.keyFromPrivate(S,x),g=this._truncateToN(g,!1,M.msgBitLength),h(!g.isNeg(),"Can not sign a negative message");var T=this.n.byteLength(),$=S.getPrivate().toArray("be",T),P=g.toArray("be",T);h(new r(P).eq(g),"Can not sign message");var R=new i({hash:this.hash,entropy:$,nonce:P,pers:M.pers,persEnc:M.persEnc||"utf8"}),C=this.n.sub(new r(1));for(var D=0;;D++){var B=M.k?M.k(D):new r(R.generate(this.n.byteLength()));if(B=this._truncateToN(B,!0),B.cmpn(1)<=0||B.cmp(C)>=0)continue;var ie=this.g.mul(B);if(ie.isInfinity())continue;var le=ie.getX(),ue=le.umod(this.n);if(ue.cmpn(0)===0)continue;var q=B.invm(this.n).mul(ue.mul(S.getPrivate()).iadd(g));if(q=q.umod(this.n),q.cmpn(0)===0)continue;var ee=(ie.getY().isOdd()?1:0)|(le.cmp(ue)!==0?2:0);if(M.canonical&&q.cmp(this.nh)>0)q=this.n.sub(q),ee^=1;return new v({r:ue,s:q,recoveryParam:ee})}},_.prototype.verify=function(g,S,x,M,I){if(!I)I={};g=this._truncateToN(g,!1,I.msgBitLength),x=this.keyFromPublic(x,M),S=new v(S,"hex");var{r:T,s:$}=S;if(T.cmpn(1)<0||T.cmp(this.n)>=0)return!1;if($.cmpn(1)<0||$.cmp(this.n)>=0)return!1;var P=$.invm(this.n),R=P.mul(g).umod(this.n),C=P.mul(T).umod(this.n),D;if(!this.curve._maxwellTrick){if(D=this.g.mulAdd(R,x.getPublic(),C),D.isInfinity())return!1;return D.getX().umod(this.n).cmp(T)===0}if(D=this.g.jmulAdd(R,x.getPublic(),C),D.isInfinity())return!1;return D.eqXToP(T)},_.prototype.recoverPubKey=function(g,S,x,M){h((3&x)===x,"The recovery param is more than two bits"),S=new v(S,M);var I=this.n,T=new r(g),$=S.r,P=S.s,R=x&1,C=x>>1;if($.cmp(this.curve.p.umod(this.curve.n))>=0&&C)throw Error("Unable to find sencond key candinate");if(C)$=this.curve.pointFromX($.add(this.curve.n),R);else $=this.curve.pointFromX($,R);var D=S.r.invm(I),B=I.sub(T).mul(D).umod(I),ie=P.mul(D).umod(I);return this.g.mulAdd(B,$,ie)},_.prototype.getKeyRecoveryParam=function(g,S,x,M){if(S=new v(S,M),S.recoveryParam!==null)return S.recoveryParam;for(var I=0;I<4;I++){var T;try{T=this.recoverPubKey(g,S,I)}catch($){continue}if(T.eq(x))return I}throw Error("Unable to find valid recovery factor")}}),D$=ce((e,t)=>{var r=wn(),i=r.assert,n=r.parseBytes,o=r.cachedProperty;function s(h,b){if(this.eddsa=h,this._secret=n(b.secret),h.isPoint(b.pub))this._pub=b.pub;else this._pubBytes=n(b.pub)}s.fromPublic=function(h,b){if(b instanceof s)return b;return new s(h,{pub:b})},s.fromSecret=function(h,b){if(b instanceof s)return b;return new s(h,{secret:b})},s.prototype.secret=function(){return this._secret},o(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(s,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),o(s,"privBytes",function(){var h=this.eddsa,b=this.hash(),v=h.encodingLength-1,_=b.slice(0,h.encodingLength);return _[0]&=248,_[v]&=127,_[v]|=64,_}),o(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(h){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},s.prototype.verify=function(h,b){return this.eddsa.verify(h,b,this)},s.prototype.getSecret=function(h){return i(this._secret,"KeyPair is public only"),r.encode(this.secret(),h)},s.prototype.getPublic=function(h){return r.encode(this.pubBytes(),h)},t.exports=s}),z$=ce((e,t)=>{var r=si(),i=wn(),n=i.assert,o=i.cachedProperty,s=i.parseBytes;function h(b,v){if(this.eddsa=b,typeof v!=="object")v=s(v);if(Array.isArray(v))n(v.length===b.encodingLength*2,"Signature has invalid size"),v={R:v.slice(0,b.encodingLength),S:v.slice(b.encodingLength)};if(n(v.R&&v.S,"Signature without R or S"),b.isPoint(v.R))this._R=v.R;if(v.S instanceof r)this._S=v.S;this._Rencoded=Array.isArray(v.R)?v.R:v.Rencoded,this._Sencoded=Array.isArray(v.S)?v.S:v.Sencoded}o(h,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(h,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(h,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(h,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),h.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},h.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=h}),j$=ce((e,t)=>{var r=Pm(),i=Am(),n=wn(),o=n.assert,s=n.parseBytes,h=D$(),b=z$();function v(_){if(o(_==="ed25519","only tested with ed25519 so far"),!(this instanceof v))return new v(_);_=i[_].curve,this.curve=_,this.g=_.g,this.g.precompute(_.n.bitLength()+1),this.pointClass=_.point().constructor,this.encodingLength=Math.ceil(_.n.bitLength()/8),this.hash=r.sha512}t.exports=v,v.prototype.sign=function(_,g){_=s(_);var S=this.keyFromSecret(g),x=this.hashInt(S.messagePrefix(),_),M=this.g.mul(x),I=this.encodePoint(M),T=this.hashInt(I,S.pubBytes(),_).mul(S.priv()),$=x.add(T).umod(this.curve.n);return this.makeSignature({R:M,S:$,Rencoded:I})},v.prototype.verify=function(_,g,S){if(_=s(_),g=this.makeSignature(g),g.S().gte(g.eddsa.curve.n)||g.S().isNeg())return!1;var x=this.keyFromPublic(S),M=this.hashInt(g.Rencoded(),x.pubBytes(),_),I=this.g.mul(g.S()),T=g.R().add(x.pub().mul(M));return T.eq(I)},v.prototype.hashInt=function(){var _=this.hash();for(var g=0;g<arguments.length;g++)_.update(arguments[g]);return n.intFromLE(_.digest()).umod(this.curve.n)},v.prototype.keyFromPublic=function(_){return h.fromPublic(this,_)},v.prototype.keyFromSecret=function(_){return h.fromSecret(this,_)},v.prototype.makeSignature=function(_){if(_ instanceof b)return _;return new b(this,_)},v.prototype.encodePoint=function(_){var g=_.getY().toArray("le",this.encodingLength);return g[this.encodingLength-1]|=_.getX().isOdd()?128:0,g},v.prototype.decodePoint=function(_){_=n.parseBytes(_);var g=_.length-1,S=_.slice(0,g).concat(_[g]&-129),x=(_[g]&128)!==0,M=n.intFromLE(S);return this.curve.pointFromY(M,x)},v.prototype.encodeInt=function(_){return _.toArray("le",this.encodingLength)},v.prototype.decodeInt=function(_){return n.intFromLE(_)},v.prototype.isPoint=function(_){return _ instanceof this.pointClass}}),U$=ce((e)=>{var t=e;t.version=_$().version,t.utils=wn(),t.rand=bw(),t.curve=_w(),t.curves=Am(),t.ec=N$(),t.eddsa=j$()}),L$=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Ir(),xt(Er)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function b(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function v(a,c,f){var l=b(a,f);if(f-1>=c)l|=b(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var g=["","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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var N=Math.max(0,m-a.length+1);N<=A;N++){var U=m-N|0;d=a.words[U]|0,y=c.words[N]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var T=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,N=l[1]|0,U=N&8191,K=N>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,Be=l[4]|0,z=Be&8191,L=Be>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,st=l[8]|0,ge=st&8191,ye=st>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,er=d[0]|0,xe=er&8191,Se=er>>>13,Or=d[1]|0,Ee=Or&8191,Re=Or>>>13,Nr=d[2]|0,Ce=Nr&8191,Ie=Nr>>>13,Tr=d[3]|0,Oe=Tr&8191,Te=Tr>>>13,xr=d[4]|0,Ne=xr&8191,De=xr>>>13,kr=d[5]|0,$e=kr&8191,O=kr>>>13,F=d[6]|0,X=F&8191,te=F>>>13,We=d[7]|0,me=We&8191,we=We>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,$r=d[9]|0,Ae=$r&8191,ke=$r>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,Te)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,Te)|0;var Dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,Te)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,Te)|0,p=p+Math.imul(k,Ne)|0,u=u+Math.imul(k,De)|0,u=u+Math.imul(A,Ne)|0,m=m+Math.imul(A,De)|0;var Pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,Te)|0,p=p+Math.imul(U,Ne)|0,u=u+Math.imul(U,De)|0,u=u+Math.imul(K,Ne)|0,m=m+Math.imul(K,De)|0,p=p+Math.imul(k,$e)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,$e)|0,m=m+Math.imul(A,O)|0;var or=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(or>>>26)|0,or&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,Te)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,Te)|0,p=p+Math.imul(J,Ne)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(H,Ne)|0,m=m+Math.imul(H,De)|0,p=p+Math.imul(U,$e)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,$e)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,Te)|0,p=p+Math.imul(V,Ne)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(Q,Ne)|0,m=m+Math.imul(Q,De)|0,p=p+Math.imul(J,$e)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,$e)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,Te)|0,p=p+Math.imul(z,Ne)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(L,Ne)|0,m=m+Math.imul(L,De)|0,p=p+Math.imul(V,$e)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,$e)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,Te)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,Te)|0,p=p+Math.imul(G,Ne)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(Y,Ne)|0,m=m+Math.imul(Y,De)|0,p=p+Math.imul(z,$e)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,$e)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,Te)|0,p=p+Math.imul(j,Ne)|0,u=u+Math.imul(j,De)|0,u=u+Math.imul(Z,Ne)|0,m=m+Math.imul(Z,De)|0,p=p+Math.imul(G,$e)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,$e)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,Te)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,Te)|0,p=p+Math.imul(W,Ne)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(re,Ne)|0,m=m+Math.imul(re,De)|0,p=p+Math.imul(j,$e)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,$e)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,Te),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,Te),p=p+Math.imul(ge,Ne)|0,u=u+Math.imul(ge,De)|0,u=u+Math.imul(ye,Ne)|0,m=m+Math.imul(ye,De)|0,p=p+Math.imul(W,$e)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,$e)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Ne),u=Math.imul(pe,De),u=u+Math.imul(ve,Ne)|0,m=Math.imul(ve,De),p=p+Math.imul(ge,$e)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,$e)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,$e),u=Math.imul(pe,O),u=u+Math.imul(ve,$e)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var vr=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,y[0]=Xt,y[1]=pt,y[2]=dt,y[3]=Dt,y[4]=Pt,y[5]=or,y[6]=sr,y[7]=ar,y[8]=ur,y[9]=lr,y[10]=cr,y[11]=dr,y[12]=fr,y[13]=hr,y[14]=pr,y[15]=mr,y[16]=gr,y[17]=yr,y[18]=vr,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)T=I;function $(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,N=k*A,U=N&67108863;w=w+(N/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=T(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=$(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var N=0;N<w;N++){var U=f[E+N],K=l[E+N],he=f[E+N+w],J=l[E+N+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+N]=U+he,l[E+N]=K+J,f[E+N+w]=U-he,l[E+N+w]=K-J,N!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var N=0;N<l;N++){var U=p[N]*E[N]-u[N]*k[N];u[N]=p[N]*k[N]+u[N]*E[N],p[N]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,N=1;(f.words[0]&N)===0&&A<26;++A,N<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function D(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},D.prototype.split=function(a,c){a.iushrn(this.n,0,c)},D.prototype.imulK=function(a){return a.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,D),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,D);function le(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,D);function ue(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,D),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function q(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},q.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},q.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},q.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},q.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},q.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},q.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},q.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var N=k;for(var U=0;N.cmp(y)!==0;U++)N=N.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},q.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},q.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},q.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},q.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(q.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new s(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)}o(ee,q),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),q$=ce((e,t)=>{var r=U$(),i=L$();t.exports=function(h){return new o(h)};var n={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};n.p224=n.secp224r1,n.p256=n.secp256r1=n.prime256v1,n.p192=n.secp192r1=n.prime192v1,n.p384=n.secp384r1,n.p521=n.secp521r1;function o(h){if(this.curveType=n[h],!this.curveType)this.curveType={name:h};this.curve=new r.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(h,b){return this.keys=this.curve.genKeyPair(),this.getPublicKey(h,b)},o.prototype.computeSecret=function(h,b,v){if(b=b||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,b);var _=this.curve.keyFromPublic(h).getPublic(),g=_.mul(this.keys.getPrivate()).getX();return s(g,v,this.curveType.byteLength)},o.prototype.getPublicKey=function(h,b){var v=this.keys.getPublic(b==="compressed",!0);if(b==="hybrid")if(v[v.length-1]%2)v[0]=7;else v[0]=6;return s(v,h)},o.prototype.getPrivateKey=function(h){return s(this.keys.getPrivate(),h)},o.prototype.setPublicKey=function(h,b){if(b=b||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,b);return this.keys._importPublic(h),this},o.prototype.setPrivateKey=function(h,b){if(b=b||"utf8",!Buffer.isBuffer(h))h=new Buffer(h,b);var v=new i(h);return v=v.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(v),this};function s(h,b,v){if(!Array.isArray(h))h=h.toArray();var _=new Buffer(h);if(v&&_.length<v){var g=new Buffer(v-_.length);g.fill(0),_=Buffer.concat([g,_])}if(!b)return _;else return _.toString(b)}}),F$=ce((e,t)=>{var r=(Hr(),xt(ln)).createECDH;t.exports=r||q$()}),B$=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Ir(),xt(Er)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function b(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function v(a,c,f){var l=b(a,f);if(f-1>=c)l|=b(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var g=["","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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var N=Math.max(0,m-a.length+1);N<=A;N++){var U=m-N|0;d=a.words[U]|0,y=c.words[N]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var T=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,N=l[1]|0,U=N&8191,K=N>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,Be=l[4]|0,z=Be&8191,L=Be>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,st=l[8]|0,ge=st&8191,ye=st>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,er=d[0]|0,xe=er&8191,Se=er>>>13,Or=d[1]|0,Ee=Or&8191,Re=Or>>>13,Nr=d[2]|0,Ce=Nr&8191,Ie=Nr>>>13,Tr=d[3]|0,Oe=Tr&8191,Te=Tr>>>13,xr=d[4]|0,Ne=xr&8191,De=xr>>>13,kr=d[5]|0,$e=kr&8191,O=kr>>>13,F=d[6]|0,X=F&8191,te=F>>>13,We=d[7]|0,me=We&8191,we=We>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,$r=d[9]|0,Ae=$r&8191,ke=$r>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,Te)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,Te)|0;var Dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,Te)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,Te)|0,p=p+Math.imul(k,Ne)|0,u=u+Math.imul(k,De)|0,u=u+Math.imul(A,Ne)|0,m=m+Math.imul(A,De)|0;var Pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,Te)|0,p=p+Math.imul(U,Ne)|0,u=u+Math.imul(U,De)|0,u=u+Math.imul(K,Ne)|0,m=m+Math.imul(K,De)|0,p=p+Math.imul(k,$e)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,$e)|0,m=m+Math.imul(A,O)|0;var or=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(or>>>26)|0,or&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,Te)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,Te)|0,p=p+Math.imul(J,Ne)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(H,Ne)|0,m=m+Math.imul(H,De)|0,p=p+Math.imul(U,$e)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,$e)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,Te)|0,p=p+Math.imul(V,Ne)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(Q,Ne)|0,m=m+Math.imul(Q,De)|0,p=p+Math.imul(J,$e)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,$e)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,Te)|0,p=p+Math.imul(z,Ne)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(L,Ne)|0,m=m+Math.imul(L,De)|0,p=p+Math.imul(V,$e)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,$e)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,Te)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,Te)|0,p=p+Math.imul(G,Ne)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(Y,Ne)|0,m=m+Math.imul(Y,De)|0,p=p+Math.imul(z,$e)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,$e)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,Te)|0,p=p+Math.imul(j,Ne)|0,u=u+Math.imul(j,De)|0,u=u+Math.imul(Z,Ne)|0,m=m+Math.imul(Z,De)|0,p=p+Math.imul(G,$e)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,$e)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,Te)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,Te)|0,p=p+Math.imul(W,Ne)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(re,Ne)|0,m=m+Math.imul(re,De)|0,p=p+Math.imul(j,$e)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,$e)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,Te),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,Te),p=p+Math.imul(ge,Ne)|0,u=u+Math.imul(ge,De)|0,u=u+Math.imul(ye,Ne)|0,m=m+Math.imul(ye,De)|0,p=p+Math.imul(W,$e)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,$e)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Ne),u=Math.imul(pe,De),u=u+Math.imul(ve,Ne)|0,m=Math.imul(ve,De),p=p+Math.imul(ge,$e)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,$e)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,$e),u=Math.imul(pe,O),u=u+Math.imul(ve,$e)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var vr=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,y[0]=Xt,y[1]=pt,y[2]=dt,y[3]=Dt,y[4]=Pt,y[5]=or,y[6]=sr,y[7]=ar,y[8]=ur,y[9]=lr,y[10]=cr,y[11]=dr,y[12]=fr,y[13]=hr,y[14]=pr,y[15]=mr,y[16]=gr,y[17]=yr,y[18]=vr,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)T=I;function $(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,N=k*A,U=N&67108863;w=w+(N/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=T(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=$(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var N=0;N<w;N++){var U=f[E+N],K=l[E+N],he=f[E+N+w],J=l[E+N+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+N]=U+he,l[E+N]=K+J,f[E+N+w]=U-he,l[E+N+w]=K-J,N!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var N=0;N<l;N++){var U=p[N]*E[N]-u[N]*k[N];u[N]=p[N]*k[N]+u[N]*E[N],p[N]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,N=1;(f.words[0]&N)===0&&A<26;++A,N<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function D(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},D.prototype.split=function(a,c){a.iushrn(this.n,0,c)},D.prototype.imulK=function(a){return a.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,D),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,D);function le(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,D);function ue(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,D),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function q(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},q.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},q.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},q.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},q.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},q.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},q.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},q.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var N=k;for(var U=0;N.cmp(y)!==0;U++)N=N.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},q.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},q.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},q.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},q.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(q.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new s(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)}o(ee,q),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),H$=ce((e)=>{var t=Ta(),r=un(),i=e;i.define=function(o,s){return new n(o,s)};function n(o,s){this.name=o,this.body=s,this.decoders={},this.encoders={}}n.prototype._createNamed=function(o){var s;try{s=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
this._initNamed(entity);
})`)}catch(h){s=function(b){this._initNamed(b)}}return r(s,o),s.prototype._initNamed=function(h){o.call(this,h)},new s(this)},n.prototype._getDecoder=function(o){if(o=o||"der",!this.decoders.hasOwnProperty(o))this.decoders[o]=this._createNamed(t.decoders[o]);return this.decoders[o]},n.prototype.decode=function(o,s,h){return this._getDecoder(s).decode(o,h)},n.prototype._getEncoder=function(o){if(o=o||"der",!this.encoders.hasOwnProperty(o))this.encoders[o]=this._createNamed(t.encoders[o]);return this.encoders[o]},n.prototype.encode=function(o,s,h){return this._getEncoder(s).encode(o,h)}}),Z$=ce((e)=>{var t=un();function r(n){this._reporterState={obj:null,path:[],options:n||{},errors:[]}}e.Reporter=r,r.prototype.isError=function(n){return n instanceof i},r.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}},r.prototype.restore=function(n){var o=this._reporterState;o.obj=n.obj,o.path=o.path.slice(0,n.pathLen)},r.prototype.enterKey=function(n){return this._reporterState.path.push(n)},r.prototype.exitKey=function(n){var o=this._reporterState;o.path=o.path.slice(0,n-1)},r.prototype.leaveKey=function(n,o,s){var h=this._reporterState;if(this.exitKey(n),h.obj!==null)h.obj[o]=s},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var n=this._reporterState,o=n.obj;return n.obj={},o},r.prototype.leaveObject=function(n){var o=this._reporterState,s=o.obj;return o.obj=n,s},r.prototype.error=function(n){var o,s=this._reporterState,h=n instanceof i;if(h)o=n;else o=new i(s.path.map(function(b){return"["+JSON.stringify(b)+"]"}).join(""),n.message||n,n.stack);if(!s.options.partial)throw o;if(!h)s.errors.push(o);return o},r.prototype.wrapResult=function(n){var o=this._reporterState;if(!o.options.partial)return n;return{result:this.isError(n)?null:n,errors:o.errors}};function i(n,o){this.path=n,this.rethrow(o)}t(i,Error),i.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,i);if(!this.stack)try{throw Error(this.message)}catch(o){this.stack=o.stack}return this}}),ow=ce((e)=>{var t=un(),r=xa().Reporter,i=(Ir(),xt(Er)).Buffer;function n(s,h){if(r.call(this,h),!i.isBuffer(s)){this.error("Input not Buffer");return}this.base=s,this.offset=0,this.length=s.length}t(n,r),e.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},n.prototype.restore=function(s){var h=new n(this.base);return h.offset=s.offset,h.length=this.offset,this.offset=s.offset,r.prototype.restore.call(this,s.reporter),h},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(s){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(s||"DecoderBuffer overrun")},n.prototype.skip=function(s,h){if(!(this.offset+s<=this.length))return this.error(h||"DecoderBuffer overrun");var b=new n(this.base);return b._reporterState=this._reporterState,b.offset=this.offset,b.length=this.offset+s,this.offset+=s,b},n.prototype.raw=function(s){return this.base.slice(s?s.offset:this.offset,this.length)};function o(s,h){if(Array.isArray(s))this.length=0,this.value=s.map(function(b){if(!(b instanceof o))b=new o(b,h);return this.length+=b.length,b},this);else if(typeof s==="number"){if(!(0<=s&&s<=255))return h.error("non-byte EncoderBuffer value");this.value=s,this.length=1}else if(typeof s==="string")this.value=s,this.length=i.byteLength(s);else if(i.isBuffer(s))this.value=s,this.length=s.length;else return h.error("Unsupported type: "+typeof s)}e.EncoderBuffer=o,o.prototype.join=function(s,h){if(!s)s=new i(this.length);if(!h)h=0;if(this.length===0)return s;if(Array.isArray(this.value))this.value.forEach(function(b){b.join(s,h),h+=b.length});else{if(typeof this.value==="number")s[h]=this.value;else if(typeof this.value==="string")s.write(this.value,h);else if(i.isBuffer(this.value))this.value.copy(s,h);h+=this.length}return s}}),K$=ce((e,t)=>{var r=xa().Reporter,i=xa().EncoderBuffer,n=xa().DecoderBuffer,o=Ci(),s=["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"],h=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s),b=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function v(g,S){var x={};if(this._baseState=x,x.enc=g,x.parent=S||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,!x.parent)x.children=[],this._wrap()}t.exports=v;var _=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];v.prototype.clone=function(){var g=this._baseState,S={};_.forEach(function(M){S[M]=g[M]});var x=new this.constructor(S.parent);return x._baseState=S,x},v.prototype._wrap=function(){var g=this._baseState;h.forEach(function(S){this[S]=function(){var x=new this.constructor(this);return g.children.push(x),x[S].apply(x,arguments)}},this)},v.prototype._init=function(g){var S=this._baseState;o(S.parent===null),g.call(this),S.children=S.children.filter(function(x){return x._baseState.parent===this},this),o.equal(S.children.length,1,"Root node can have only one child")},v.prototype._useArgs=function(g){var S=this._baseState,x=g.filter(function(M){return M instanceof this.constructor},this);if(g=g.filter(function(M){return!(M instanceof this.constructor)},this),x.length!==0)o(S.children===null),S.children=x,x.forEach(function(M){M._baseState.parent=this},this);if(g.length!==0)o(S.args===null),S.args=g,S.reverseArgs=g.map(function(M){if(typeof M!=="object"||M.constructor!==Object)return M;var I={};return Object.keys(M).forEach(function(T){if(T==(T|0))T|=0;var $=M[T];I[$]=T}),I})},b.forEach(function(g){v.prototype[g]=function(){var S=this._baseState;throw Error(g+" not implemented for encoding: "+S.enc)}}),s.forEach(function(g){v.prototype[g]=function(){var S=this._baseState,x=Array.prototype.slice.call(arguments);return o(S.tag===null),S.tag=g,this._useArgs(x),this}}),v.prototype.use=function(g){o(g);var S=this._baseState;return o(S.use===null),S.use=g,this},v.prototype.optional=function(){var g=this._baseState;return g.optional=!0,this},v.prototype.def=function(g){var S=this._baseState;return o(S.default===null),S.default=g,S.optional=!0,this},v.prototype.explicit=function(g){var S=this._baseState;return o(S.explicit===null&&S.implicit===null),S.explicit=g,this},v.prototype.implicit=function(g){var S=this._baseState;return o(S.explicit===null&&S.implicit===null),S.implicit=g,this},v.prototype.obj=function(){var g=this._baseState,S=Array.prototype.slice.call(arguments);if(g.obj=!0,S.length!==0)this._useArgs(S);return this},v.prototype.key=function(g){var S=this._baseState;return o(S.key===null),S.key=g,this},v.prototype.any=function(){var g=this._baseState;return g.any=!0,this},v.prototype.choice=function(g){var S=this._baseState;return o(S.choice===null),S.choice=g,this._useArgs(Object.keys(g).map(function(x){return g[x]})),this},v.prototype.contains=function(g){var S=this._baseState;return o(S.use===null),S.contains=g,this},v.prototype._decode=function(g,S){var x=this._baseState;if(x.parent===null)return g.wrapResult(x.children[0]._decode(g,S));var M=x.default,I=!0,T=null;if(x.key!==null)T=g.enterKey(x.key);if(x.optional){var $=null;if(x.explicit!==null)$=x.explicit;else if(x.implicit!==null)$=x.implicit;else if(x.tag!==null)$=x.tag;if($===null&&!x.any){var P=g.save();try{if(x.choice===null)this._decodeGeneric(x.tag,g,S);else this._decodeChoice(g,S);I=!0}catch(le){I=!1}g.restore(P)}else if(I=this._peekTag(g,$,x.any),g.isError(I))return I}var R;if(x.obj&&I)R=g.enterObject();if(I){if(x.explicit!==null){var C=this._decodeTag(g,x.explicit);if(g.isError(C))return C;g=C}var D=g.offset;if(x.use===null&&x.choice===null){if(x.any)var P=g.save();var B=this._decodeTag(g,x.implicit!==null?x.implicit:x.tag,x.any);if(g.isError(B))return B;if(x.any)M=g.raw(P);else g=B}if(S&&S.track&&x.tag!==null)S.track(g.path(),D,g.length,"tagged");if(S&&S.track&&x.tag!==null)S.track(g.path(),g.offset,g.length,"content");if(x.any)M=M;else if(x.choice===null)M=this._decodeGeneric(x.tag,g,S);else M=this._decodeChoice(g,S);if(g.isError(M))return M;if(!x.any&&x.choice===null&&x.children!==null)x.children.forEach(function(le){le._decode(g,S)});if(x.contains&&(x.tag==="octstr"||x.tag==="bitstr")){var ie=new n(M);M=this._getUse(x.contains,g._reporterState.obj)._decode(ie,S)}}if(x.obj&&I)M=g.leaveObject(R);if(x.key!==null&&(M!==null||I===!0))g.leaveKey(T,x.key,M);else if(T!==null)g.exitKey(T);return M},v.prototype._decodeGeneric=function(g,S,x){var M=this._baseState;if(g==="seq"||g==="set")return null;if(g==="seqof"||g==="setof")return this._decodeList(S,g,M.args[0],x);else if(/str$/.test(g))return this._decodeStr(S,g,x);else if(g==="objid"&&M.args)return this._decodeObjid(S,M.args[0],M.args[1],x);else if(g==="objid")return this._decodeObjid(S,null,null,x);else if(g==="gentime"||g==="utctime")return this._decodeTime(S,g,x);else if(g==="null_")return this._decodeNull(S,x);else if(g==="bool")return this._decodeBool(S,x);else if(g==="objDesc")return this._decodeStr(S,g,x);else if(g==="int"||g==="enum")return this._decodeInt(S,M.args&&M.args[0],x);if(M.use!==null)return this._getUse(M.use,S._reporterState.obj)._decode(S,x);else return S.error("unknown tag: "+g)},v.prototype._getUse=function(g,S){var x=this._baseState;if(x.useDecoder=this._use(g,S),o(x.useDecoder._baseState.parent===null),x.useDecoder=x.useDecoder._baseState.children[0],x.implicit!==x.useDecoder._baseState.implicit)x.useDecoder=x.useDecoder.clone(),x.useDecoder._baseState.implicit=x.implicit;return x.useDecoder},v.prototype._decodeChoice=function(g,S){var x=this._baseState,M=null,I=!1;if(Object.keys(x.choice).some(function(T){var $=g.save(),P=x.choice[T];try{var R=P._decode(g,S);if(g.isError(R))return!1;M={type:T,value:R},I=!0}catch(C){return g.restore($),!1}return!0},this),!I)return g.error("Choice not matched");return M},v.prototype._createEncoderBuffer=function(g){return new i(g,this.reporter)},v.prototype._encode=function(g,S,x){var M=this._baseState;if(M.default!==null&&M.default===g)return;var I=this._encodeValue(g,S,x);if(I===void 0)return;if(this._skipDefault(I,S,x))return;return I},v.prototype._encodeValue=function(g,S,x){var M=this._baseState;if(M.parent===null)return M.children[0]._encode(g,S||new r);var P=null;if(this.reporter=S,M.optional&&g===void 0)if(M.default!==null)g=M.default;else return;var I=null,T=!1;if(M.any)P=this._createEncoderBuffer(g);else if(M.choice)P=this._encodeChoice(g,S);else if(M.contains)I=this._getUse(M.contains,x)._encode(g,S),T=!0;else if(M.children)I=M.children.map(function(D){if(D._baseState.tag==="null_")return D._encode(null,S,g);if(D._baseState.key===null)return S.error("Child should have a key");var B=S.enterKey(D._baseState.key);if(typeof g!=="object")return S.error("Child expected, but input is not object");var ie=D._encode(g[D._baseState.key],S,g);return S.leaveKey(B),ie},this).filter(function(D){return D}),I=this._createEncoderBuffer(I);else if(M.tag==="seqof"||M.tag==="setof"){if(!(M.args&&M.args.length===1))return S.error("Too many args for : "+M.tag);if(!Array.isArray(g))return S.error("seqof/setof, but data is not Array");var $=this.clone();$._baseState.implicit=null,I=this._createEncoderBuffer(g.map(function(D){var B=this._baseState;return this._getUse(B.args[0],g)._encode(D,S)},$))}else if(M.use!==null)P=this._getUse(M.use,x)._encode(g,S);else I=this._encodePrimitive(M.tag,g),T=!0;var P;if(!M.any&&M.choice===null){var R=M.implicit!==null?M.implicit:M.tag,C=M.implicit===null?"universal":"context";if(R===null){if(M.use===null)S.error("Tag could be omitted only for .use()")}else if(M.use===null)P=this._encodeComposite(R,T,C,I)}if(M.explicit!==null)P=this._encodeComposite(M.explicit,!1,"context",P);return P},v.prototype._encodeChoice=function(g,S){var x=this._baseState,M=x.choice[g.type];if(!M)o(!1,g.type+" not found in "+JSON.stringify(Object.keys(x.choice)));return M._encode(g.value,S)},v.prototype._encodePrimitive=function(g,S){var x=this._baseState;if(/str$/.test(g))return this._encodeStr(S,g);else if(g==="objid"&&x.args)return this._encodeObjid(S,x.reverseArgs[0],x.args[1]);else if(g==="objid")return this._encodeObjid(S,null,null);else if(g==="gentime"||g==="utctime")return this._encodeTime(S,g);else if(g==="null_")return this._encodeNull();else if(g==="int"||g==="enum")return this._encodeInt(S,x.args&&x.reverseArgs[0]);else if(g==="bool")return this._encodeBool(S);else if(g==="objDesc")return this._encodeStr(S,g);else throw Error("Unsupported tag: "+g)},v.prototype._isNumstr=function(g){return/^[0-9 ]*$/.test(g)},v.prototype._isPrintstr=function(g){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(g)}}),xa=ce((e)=>{var t=e;t.Reporter=Z$().Reporter,t.DecoderBuffer=ow().DecoderBuffer,t.EncoderBuffer=ow().EncoderBuffer,t.Node=K$()}),V$=ce((e)=>{var t=kw();e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.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"},e.tagByName=t._reverse(e.tag)}),kw=ce((e)=>{var t=e;t._reverse=function(r){var i={};return Object.keys(r).forEach(function(n){if((n|0)==n)n=n|0;var o=r[n];i[o]=n}),i},t.der=V$()}),Mw=ce((e,t)=>{var r=un(),i=Ta(),n=i.base,o=i.bignum,s=i.constants.der;function h(g){this.enc="der",this.name=g.name,this.entity=g,this.tree=new b,this.tree._init(g.body)}t.exports=h,h.prototype.decode=function(g,S){if(!(g instanceof n.DecoderBuffer))g=new n.DecoderBuffer(g,S);return this.tree._decode(g,S)};function b(g){n.Node.call(this,"der",g)}r(b,n.Node),b.prototype._peekTag=function(g,S,x){if(g.isEmpty())return!1;var M=g.save(),I=v(g,'Failed to peek tag: "'+S+'"');if(g.isError(I))return I;return g.restore(M),I.tag===S||I.tagStr===S||I.tagStr+"of"===S||x},b.prototype._decodeTag=function(g,S,x){var M=v(g,'Failed to decode tag of "'+S+'"');if(g.isError(M))return M;var I=_(g,M.primitive,'Failed to get length of "'+S+'"');if(g.isError(I))return I;if(!x&&M.tag!==S&&M.tagStr!==S&&M.tagStr+"of"!==S)return g.error('Failed to match tag: "'+S+'"');if(M.primitive||I!==null)return g.skip(I,'Failed to match body of: "'+S+'"');var T=g.save(),$=this._skipUntilEnd(g,'Failed to skip indefinite length body: "'+this.tag+'"');if(g.isError($))return $;return I=g.offset-T.offset,g.restore(T),g.skip(I,'Failed to match body of: "'+S+'"')},b.prototype._skipUntilEnd=function(g,S){while(!0){var x=v(g,S);if(g.isError(x))return x;var M=_(g,x.primitive,S);if(g.isError(M))return M;var I;if(x.primitive||M!==null)I=g.skip(M);else I=this._skipUntilEnd(g,S);if(g.isError(I))return I;if(x.tagStr==="end")break}},b.prototype._decodeList=function(g,S,x,M){var I=[];while(!g.isEmpty()){var T=this._peekTag(g,"end");if(g.isError(T))return T;var $=x.decode(g,"der",M);if(g.isError($)&&T)break;I.push($)}return I},b.prototype._decodeStr=function(g,S){if(S==="bitstr"){var x=g.readUInt8();if(g.isError(x))return x;return{unused:x,data:g.raw()}}else if(S==="bmpstr"){var M=g.raw();if(M.length%2===1)return g.error("Decoding of string type: bmpstr length mismatch");var I="";for(var T=0;T<M.length/2;T++)I+=String.fromCharCode(M.readUInt16BE(T*2));return I}else if(S==="numstr"){var $=g.raw().toString("ascii");if(!this._isNumstr($))return g.error("Decoding of string type: numstr unsupported characters");return $}else if(S==="octstr")return g.raw();else if(S==="objDesc")return g.raw();else if(S==="printstr"){var P=g.raw().toString("ascii");if(!this._isPrintstr(P))return g.error("Decoding of string type: printstr unsupported characters");return P}else if(/str$/.test(S))return g.raw().toString();else return g.error("Decoding of string type: "+S+" unsupported")},b.prototype._decodeObjid=function(g,S,x){var M,I=[],T=0;while(!g.isEmpty()){var $=g.readUInt8();if(T<<=7,T|=$&127,($&128)===0)I.push(T),T=0}if($&128)I.push(T);var P=I[0]/40|0,R=I[0]%40;if(x)M=I;else M=[P,R].concat(I.slice(1));if(S){var C=S[M.join(" ")];if(C===void 0)C=S[M.join(".")];if(C!==void 0)M=C}return M},b.prototype._decodeTime=function(g,S){var x=g.raw().toString();if(S==="gentime")var M=x.slice(0,4)|0,I=x.slice(4,6)|0,T=x.slice(6,8)|0,$=x.slice(8,10)|0,P=x.slice(10,12)|0,R=x.slice(12,14)|0;else if(S==="utctime"){var M=x.slice(0,2)|0,I=x.slice(2,4)|0,T=x.slice(4,6)|0,$=x.slice(6,8)|0,P=x.slice(8,10)|0,R=x.slice(10,12)|0;if(M<70)M=2000+M;else M=1900+M}else return g.error("Decoding "+S+" time is not supported yet");return Date.UTC(M,I-1,T,$,P,R,0)},b.prototype._decodeNull=function(g){return null},b.prototype._decodeBool=function(g){var S=g.readUInt8();if(g.isError(S))return S;else return S!==0},b.prototype._decodeInt=function(g,S){var x=g.raw(),M=new o(x);if(S)M=S[M.toString(10)]||M;return M},b.prototype._use=function(g,S){if(typeof g==="function")g=g(S);return g._getDecoder("der").tree};function v(g,S){var x=g.readUInt8(S);if(g.isError(x))return x;var M=s.tagClass[x>>6],I=(x&32)===0;if((x&31)===31){var T=x;x=0;while((T&128)===128){if(T=g.readUInt8(S),g.isError(T))return T;x<<=7,x|=T&127}}else x&=31;var $=s.tag[x];return{cls:M,primitive:I,tag:x,tagStr:$}}function _(g,S,x){var M=g.readUInt8(x);if(g.isError(M))return M;if(!S&&M===128)return null;if((M&128)===0)return M;var I=M&127;if(I>4)return g.error("length octect is too long");M=0;for(var T=0;T<I;T++){M<<=8;var $=g.readUInt8(x);if(g.isError($))return $;M|=$}return M}}),W$=ce((e,t)=>{var r=un(),i=(Ir(),xt(Er)).Buffer,n=Mw();function o(s){n.call(this,s),this.enc="pem"}r(o,n),t.exports=o,o.prototype.decode=function(s,h){var b=s.toString().split(/[\r\n]+/g),v=h.label.toUpperCase(),_=/^-----(BEGIN|END) ([^-]+)-----$/,g=-1,S=-1;for(var x=0;x<b.length;x++){var M=b[x].match(_);if(M===null)continue;if(M[2]!==v)continue;if(g===-1){if(M[1]!=="BEGIN")break;g=x}else{if(M[1]!=="END")break;S=x;break}}if(g===-1||S===-1)throw Error("PEM section not found for: "+v);var I=b.slice(g+1,S).join("");I.replace(/[^a-z0-9\+\/=]+/gi,"");var T=new i(I,"base64");return n.prototype.decode.call(this,T,h)}}),G$=ce((e)=>{var t=e;t.der=Mw(),t.pem=W$()}),Ew=ce((e,t)=>{var r=un(),i=(Ir(),xt(Er)).Buffer,n=Ta(),o=n.base,s=n.constants.der;function h(g){this.enc="der",this.name=g.name,this.entity=g,this.tree=new b,this.tree._init(g.body)}t.exports=h,h.prototype.encode=function(g,S){return this.tree._encode(g,S).join()};function b(g){o.Node.call(this,"der",g)}r(b,o.Node),b.prototype._encodeComposite=function(g,S,x,M){var I=_(g,S,x,this.reporter);if(M.length<128){var P=new i(2);return P[0]=I,P[1]=M.length,this._createEncoderBuffer([P,M])}var T=1;for(var $=M.length;$>=256;$>>=8)T++;var P=new i(2+T);P[0]=I,P[1]=128|T;for(var $=1+T,R=M.length;R>0;$--,R>>=8)P[$]=R&255;return this._createEncoderBuffer([P,M])},b.prototype._encodeStr=function(g,S){if(S==="bitstr")return this._createEncoderBuffer([g.unused|0,g.data]);else if(S==="bmpstr"){var x=new i(g.length*2);for(var M=0;M<g.length;M++)x.writeUInt16BE(g.charCodeAt(M),M*2);return this._createEncoderBuffer(x)}else if(S==="numstr"){if(!this._isNumstr(g))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(g)}else if(S==="printstr"){if(!this._isPrintstr(g))return 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");return this._createEncoderBuffer(g)}else if(/str$/.test(S))return this._createEncoderBuffer(g);else if(S==="objDesc")return this._createEncoderBuffer(g);else return this.reporter.error("Encoding of string type: "+S+" unsupported")},b.prototype._encodeObjid=function(g,S,x){if(typeof g==="string"){if(!S)return this.reporter.error("string objid given, but no values map found");if(!S.hasOwnProperty(g))return this.reporter.error("objid not found in values map");g=S[g].split(/[\s\.]+/g);for(var M=0;M<g.length;M++)g[M]|=0}else if(Array.isArray(g)){g=g.slice();for(var M=0;M<g.length;M++)g[M]|=0}if(!Array.isArray(g))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(g));if(!x){if(g[1]>=40)return this.reporter.error("Second objid identifier OOB");g.splice(0,2,g[0]*40+g[1])}var I=0;for(var M=0;M<g.length;M++){var T=g[M];for(I++;T>=128;T>>=7)I++}var $=new i(I),P=$.length-1;for(var M=g.length-1;M>=0;M--){var T=g[M];$[P--]=T&127;while((T>>=7)>0)$[P--]=128|T&127}return this._createEncoderBuffer($)};function v(g){if(g<10)return"0"+g;else return g}b.prototype._encodeTime=function(g,S){var x,M=new Date(g);if(S==="gentime")x=[v(M.getFullYear()),v(M.getUTCMonth()+1),v(M.getUTCDate()),v(M.getUTCHours()),v(M.getUTCMinutes()),v(M.getUTCSeconds()),"Z"].join("");else if(S==="utctime")x=[v(M.getFullYear()%100),v(M.getUTCMonth()+1),v(M.getUTCDate()),v(M.getUTCHours()),v(M.getUTCMinutes()),v(M.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+S+" time is not supported yet");return this._encodeStr(x,"octstr")},b.prototype._encodeNull=function(){return this._createEncoderBuffer("")},b.prototype._encodeInt=function(g,S){if(typeof g==="string"){if(!S)return this.reporter.error("String int or enum given, but no values map");if(!S.hasOwnProperty(g))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(g));g=S[g]}if(typeof g!=="number"&&!i.isBuffer(g)){var x=g.toArray();if(!g.sign&&x[0]&128)x.unshift(0);g=new i(x)}if(i.isBuffer(g)){var M=g.length;if(g.length===0)M++;var T=new i(M);if(g.copy(T),g.length===0)T[0]=0;return this._createEncoderBuffer(T)}if(g<128)return this._createEncoderBuffer(g);if(g<256)return this._createEncoderBuffer([0,g]);var M=1;for(var I=g;I>=256;I>>=8)M++;var T=Array(M);for(var I=T.length-1;I>=0;I--)T[I]=g&255,g>>=8;if(T[0]&128)T.unshift(0);return this._createEncoderBuffer(new i(T))},b.prototype._encodeBool=function(g){return this._createEncoderBuffer(g?255:0)},b.prototype._use=function(g,S){if(typeof g==="function")g=g(S);return g._getEncoder("der").tree},b.prototype._skipDefault=function(g,S,x){var M=this._baseState,I;if(M.default===null)return!1;var T=g.join();if(M.defaultBuffer===void 0)M.defaultBuffer=this._encodeValue(M.default,S,x).join();if(T.length!==M.defaultBuffer.length)return!1;for(I=0;I<T.length;I++)if(T[I]!==M.defaultBuffer[I])return!1;return!0};function _(g,S,x,M){var I;if(g==="seqof")g="seq";else if(g==="setof")g="set";if(s.tagByName.hasOwnProperty(g))I=s.tagByName[g];else if(typeof g==="number"&&(g|0)===g)I=g;else return M.error("Unknown tag: "+g);if(I>=31)return M.error("Multi-octet tag encoding unsupported");if(!S)I|=32;return I|=s.tagClassByName[x||"universal"]<<6,I}}),J$=ce((e,t)=>{var r=un(),i=Ew();function n(o){i.call(this,o),this.enc="pem"}r(n,i),t.exports=n,n.prototype.encode=function(o,s){var h=i.prototype.encode.call(this,o),b=h.toString("base64"),v=["-----BEGIN "+s.label+"-----"];for(var _=0;_<b.length;_+=64)v.push(b.slice(_,_+64));return v.push("-----END "+s.label+"-----"),v.join(`
`)}}),X$=ce((e)=>{var t=e;t.der=Ew(),t.pem=J$()}),Ta=ce((e)=>{var t=e;t.bignum=B$(),t.define=H$().define,t.base=xa(),t.constants=kw(),t.decoders=G$(),t.encoders=X$()}),Y$=ce((e,t)=>{var r=Ta(),i=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),h=r.define("RelativeDistinguishedName",function(){this.setof(n)}),b=r.define("RDNSequence",function(){this.seqof(h)}),v=r.define("Name",function(){this.choice({rdnSequence:this.use(b)})}),_=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),g=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),S=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(v),this.key("validity").use(_),this.key("subject").use(v),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(g).optional())}),x=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(S),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=x}),Q$=ce((e)=>{var t=Ta();e.certificate=Y$();var r=t.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())});e.RSAPrivateKey=r;var i=t.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});e.RSAPublicKey=i;var n=t.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),o=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(n),this.key("subjectPublicKey").bitstr())});e.PublicKey=o;var s=t.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(n),this.key("subjectPrivateKey").octstr())});e.PrivateKey=s;var h=t.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});e.EncryptedPrivateKey=h;var b=t.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});e.DSAPrivateKey=b,e.DSAparam=t.define("DSAparam",function(){this.int()});var v=t.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),_=t.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(v),this.key("publicKey").optional().explicit(1).bitstr())});e.ECPrivateKey=_,e.signature=t.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),eP=ce((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),tP=ce((e,t)=>{var r=Br().Buffer,i=Sm().Transform,n=un();function o(v){i.call(this),this._block=r.allocUnsafe(v),this._blockSize=v,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(o,i),o.prototype._transform=function(v,_,g){var S=null;try{this.update(v,_)}catch(x){S=x}g(S)},o.prototype._flush=function(v){var _=null;try{this.push(this.digest())}catch(g){_=g}v(_)};var s=typeof Uint8Array<"u",h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function b(v,_){if(v instanceof r)return v;if(typeof v==="string")return r.from(v,_);if(h&&ArrayBuffer.isView(v)){if(v.byteLength===0)return r.alloc(0);var g=r.from(v.buffer,v.byteOffset,v.byteLength);if(g.byteLength===v.byteLength)return g}if(s&&v instanceof Uint8Array)return r.from(v);if(r.isBuffer(v)&&v.constructor&&typeof v.constructor.isBuffer==="function"&&v.constructor.isBuffer(v))return r.from(v);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}o.prototype.update=function(v,_){if(this._finalized)throw Error("Digest already called");v=b(v,_);var g=this._block,S=0;while(this._blockOffset+v.length-S>=this._blockSize){for(var x=this._blockOffset;x<this._blockSize;)g[x++]=v[S++];this._update(),this._blockOffset=0}while(S<v.length)g[this._blockOffset++]=v[S++];for(var M=0,I=v.length*8;I>0;++M)if(this._length[M]+=I,I=this._length[M]/4294967296|0,I>0)this._length[M]-=4294967296*I;return this},o.prototype._update=function(){throw Error("_update is not implemented")},o.prototype.digest=function(v){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var _=this._digest();if(v!==void 0)_=_.toString(v);this._block.fill(0),this._blockOffset=0;for(var g=0;g<4;++g)this._length[g]=0;return _},o.prototype._digest=function(){throw Error("_digest is not implemented")},t.exports=o}),rP=ce((e,t)=>{var r=un(),i=tP(),n=Br().Buffer,o=Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}r(s,i),s.prototype._update=function(){var S=o;for(var x=0;x<16;++x)S[x]=this._block.readInt32LE(x*4);var M=this._a,I=this._b,T=this._c,$=this._d;M=b(M,I,T,$,S[0],3614090360,7),$=b($,M,I,T,S[1],3905402710,12),T=b(T,$,M,I,S[2],606105819,17),I=b(I,T,$,M,S[3],3250441966,22),M=b(M,I,T,$,S[4],4118548399,7),$=b($,M,I,T,S[5],1200080426,12),T=b(T,$,M,I,S[6],2821735955,17),I=b(I,T,$,M,S[7],4249261313,22),M=b(M,I,T,$,S[8],1770035416,7),$=b($,M,I,T,S[9],2336552879,12),T=b(T,$,M,I,S[10],4294925233,17),I=b(I,T,$,M,S[11],2304563134,22),M=b(M,I,T,$,S[12],1804603682,7),$=b($,M,I,T,S[13],4254626195,12),T=b(T,$,M,I,S[14],2792965006,17),I=b(I,T,$,M,S[15],1236535329,22),M=v(M,I,T,$,S[1],4129170786,5),$=v($,M,I,T,S[6],3225465664,9),T=v(T,$,M,I,S[11],643717713,14),I=v(I,T,$,M,S[0],3921069994,20),M=v(M,I,T,$,S[5],3593408605,5),$=v($,M,I,T,S[10],38016083,9),T=v(T,$,M,I,S[15],3634488961,14),I=v(I,T,$,M,S[4],3889429448,20),M=v(M,I,T,$,S[9],568446438,5),$=v($,M,I,T,S[14],3275163606,9),T=v(T,$,M,I,S[3],4107603335,14),I=v(I,T,$,M,S[8],1163531501,20),M=v(M,I,T,$,S[13],2850285829,5),$=v($,M,I,T,S[2],4243563512,9),T=v(T,$,M,I,S[7],1735328473,14),I=v(I,T,$,M,S[12],2368359562,20),M=_(M,I,T,$,S[5],4294588738,4),$=_($,M,I,T,S[8],2272392833,11),T=_(T,$,M,I,S[11],1839030562,16),I=_(I,T,$,M,S[14],4259657740,23),M=_(M,I,T,$,S[1],2763975236,4),$=_($,M,I,T,S[4],1272893353,11),T=_(T,$,M,I,S[7],4139469664,16),I=_(I,T,$,M,S[10],3200236656,23),M=_(M,I,T,$,S[13],681279174,4),$=_($,M,I,T,S[0],3936430074,11),T=_(T,$,M,I,S[3],3572445317,16),I=_(I,T,$,M,S[6],76029189,23),M=_(M,I,T,$,S[9],3654602809,4),$=_($,M,I,T,S[12],3873151461,11),T=_(T,$,M,I,S[15],530742520,16),I=_(I,T,$,M,S[2],3299628645,23),M=g(M,I,T,$,S[0],4096336452,6),$=g($,M,I,T,S[7],1126891415,10),T=g(T,$,M,I,S[14],2878612391,15),I=g(I,T,$,M,S[5],4237533241,21),M=g(M,I,T,$,S[12],1700485571,6),$=g($,M,I,T,S[3],2399980690,10),T=g(T,$,M,I,S[10],4293915773,15),I=g(I,T,$,M,S[1],2240044497,21),M=g(M,I,T,$,S[8],1873313359,6),$=g($,M,I,T,S[15],4264355552,10),T=g(T,$,M,I,S[6],2734768916,15),I=g(I,T,$,M,S[13],1309151649,21),M=g(M,I,T,$,S[4],4149444226,6),$=g($,M,I,T,S[11],3174756917,10),T=g(T,$,M,I,S[2],718787259,15),I=g(I,T,$,M,S[9],3951481745,21),this._a=this._a+M|0,this._b=this._b+I|0,this._c=this._c+T|0,this._d=this._d+$|0},s.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var S=n.allocUnsafe(16);return S.writeInt32LE(this._a,0),S.writeInt32LE(this._b,4),S.writeInt32LE(this._c,8),S.writeInt32LE(this._d,12),S};function h(S,x){return S<<x|S>>>32-x}function b(S,x,M,I,T,$,P){return h(S+(x&M|~x&I)+T+$|0,P)+x|0}function v(S,x,M,I,T,$,P){return h(S+(x&I|M&~I)+T+$|0,P)+x|0}function _(S,x,M,I,T,$,P){return h(S+(x^M^I)+T+$|0,P)+x|0}function g(S,x,M,I,T,$,P){return h(S+(M^(x|~I))+T+$|0,P)+x|0}t.exports=s}),nP=ce((e,t)=>{var r=Br().Buffer,i=rP();function n(o,s,h,b){if(!r.isBuffer(o))o=r.from(o,"binary");if(s){if(!r.isBuffer(s))s=r.from(s,"binary");if(s.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var v=h/8,_=r.alloc(v),g=r.alloc(b||0),S=r.alloc(0);while(v>0||b>0){var x=new i;if(x.update(S),x.update(o),s)x.update(s);S=x.digest();var M=0;if(v>0){var I=_.length-v;M=Math.min(v,S.length),S.copy(_,I,0,M),v-=M}if(M<S.length&&b>0){var T=g.length-b,$=Math.min(b,S.length-M);S.copy(g,T,M,M+$),b-=$}}return S.fill(0),{key:_,iv:g}}t.exports=n}),Iw=ce((e)=>{var t=(Hr(),xt(ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),iP=ce((e,t)=>{var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=nP(),s=Iw(),h=Br().Buffer;t.exports=function(b,v){var _=b.toString(),g=_.match(r),S;if(!g){var x=_.match(n);S=h.from(x[2].replace(/[\r\n]/g,""),"base64")}else{var M="aes"+g[1],I=h.from(g[2],"hex"),T=h.from(g[3].replace(/[\r\n]/g,""),"base64"),$=o(v,I.slice(0,8),parseInt(g[1],10)).key,P=[],R=s.createDecipheriv(M,$,I);P.push(R.update(T)),P.push(R.final()),S=h.concat(P)}var C=_.match(i)[1];return{tag:C,data:S}}}),Tw=ce((e,t)=>{var r=Q$(),i=eP(),n=iP(),o=Iw(),s=yw().pbkdf2Sync,h=Br().Buffer;function b(_,g){var S=_.algorithm.decrypt.kde.kdeparams.salt,x=parseInt(_.algorithm.decrypt.kde.kdeparams.iters.toString(),10),M=i[_.algorithm.decrypt.cipher.algo.join(".")],I=_.algorithm.decrypt.cipher.iv,T=_.subjectPrivateKey,$=parseInt(M.split("-")[1],10)/8,P=s(g,S,x,$,"sha1"),R=o.createDecipheriv(M,P,I),C=[];return C.push(R.update(T)),C.push(R.final()),h.concat(C)}function v(_){var g;if(typeof _==="object"&&!h.isBuffer(_))g=_.passphrase,_=_.key;if(typeof _==="string")_=h.from(_);var S=n(_,g),x=S.tag,M=S.data,I,T;switch(x){case"CERTIFICATE":T=r.certificate.decode(M,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!T)T=r.PublicKey.decode(M,"der");switch(I=T.algorithm.algorithm.join("."),I){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(T.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return T.subjectPrivateKey=T.subjectPublicKey,{type:"ec",data:T};case"1.2.840.10040.4.1":return T.algorithm.params.pub_key=r.DSAparam.decode(T.subjectPublicKey.data,"der"),{type:"dsa",data:T.algorithm.params};default:throw Error("unknown key id "+I)}case"ENCRYPTED PRIVATE KEY":M=r.EncryptedPrivateKey.decode(M,"der"),M=b(M,g);case"PRIVATE KEY":switch(T=r.PrivateKey.decode(M,"der"),I=T.algorithm.algorithm.join("."),I){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(T.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:T.algorithm.curve,privateKey:r.ECPrivateKey.decode(T.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return T.algorithm.params.priv_key=r.DSAparam.decode(T.subjectPrivateKey,"der"),{type:"dsa",params:T.algorithm.params};default:throw Error("unknown key id "+I)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(M,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(M,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(M,"der")};case"EC PRIVATE KEY":return M=r.ECPrivateKey.decode(M,"der"),{curve:M.parameters.value,privateKey:M.privateKey};default:throw Error("unknown key type "+x)}}v.signature=r.signature,t.exports=v}),$w=ce((e,t)=>{var r=jc(),i=Br().Buffer;t.exports=function(o,s){var h=i.alloc(0),b=0,v;while(h.length<s)v=n(b++),h=i.concat([h,r("sha1").update(o).update(v).digest()]);return h.slice(0,s)};function n(o){var s=i.allocUnsafe(4);return s.writeUInt32BE(o,0),s}}),Pw=ce((e,t)=>{t.exports=function(r,i){var n=r.length,o=-1;while(++o<n)r[o]^=i[o];return r}}),Rm=ce((e,t)=>{(function(r,i){function n(a,c){if(!a)throw Error(c||"Assertion failed")}function o(a,c){a.super_=c;var f=function(){};f.prototype=c.prototype,a.prototype=new f,a.prototype.constructor=a}function s(a,c,f){if(s.isBN(a))return a;if(this.negative=0,this.words=null,this.length=0,this.red=null,a!==null){if(c==="le"||c==="be")f=c,c=10;this._init(a||0,c||10,f||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Ir(),xt(Er)).Buffer}catch(a){}s.isBN=function(a){if(a instanceof s)return!0;return a!==null&&typeof a==="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,c){if(a.cmp(c)>0)return a;return c},s.min=function(a,c){if(a.cmp(c)<0)return a;return c},s.prototype._init=function(a,c,f){if(typeof a==="number")return this._initNumber(a,c,f);if(typeof a==="object")return this._initArray(a,c,f);if(c==="hex")c=16;n(c===(c|0)&&c>=2&&c<=36),a=a.toString().replace(/\s+/g,"");var l=0;if(a[0]==="-")l++,this.negative=1;if(l<a.length){if(c===16)this._parseHex(a,l,f);else if(this._parseBase(a,c,l),f==="le")this._initArray(this.toArray(),c,f)}},s.prototype._initNumber=function(a,c,f){if(a<0)this.negative=1,a=-a;if(a<67108864)this.words=[a&67108863],this.length=1;else if(a<4503599627370496)this.words=[a&67108863,a/67108864&67108863],this.length=2;else n(a<9007199254740992),this.words=[a&67108863,a/67108864&67108863,1],this.length=3;if(f!=="le")return;this._initArray(this.toArray(),c,f)},s.prototype._initArray=function(a,c,f){if(n(typeof a.length==="number"),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d,y,w=0;if(f==="be"){for(l=a.length-1,d=0;l>=0;l-=3)if(y=a[l]|a[l-1]<<8|a[l-2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}else if(f==="le"){for(l=0,d=0;l<a.length;l+=3)if(y=a[l]|a[l+1]<<8|a[l+2]<<16,this.words[d]|=y<<w&67108863,this.words[d+1]=y>>>26-w&67108863,w+=24,w>=26)w-=26,d++}return this.strip()};function b(a,c){var f=a.charCodeAt(c);if(f>=65&&f<=70)return f-55;else if(f>=97&&f<=102)return f-87;else return f-48&15}function v(a,c,f){var l=b(a,f);if(f-1>=c)l|=b(a,f-1)<<4;return l}s.prototype._parseHex=function(a,c,f){this.length=Math.ceil((a.length-c)/6),this.words=Array(this.length);for(var l=0;l<this.length;l++)this.words[l]=0;var d=0,y=0,w;if(f==="be")for(l=a.length-1;l>=c;l-=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8;else{var p=a.length-c;for(l=p%2===0?c+1:c;l<a.length;l+=2)if(w=v(a,c,l)<<d,this.words[y]|=w&67108863,d>=18)d-=18,y+=1,this.words[y]|=w>>>26;else d+=8}this.strip()};function _(a,c,f,l){var d=0,y=Math.min(a.length,f);for(var w=c;w<y;w++){var p=a.charCodeAt(w)-48;if(d*=l,p>=49)d+=p-49+10;else if(p>=17)d+=p-17+10;else d+=p}return d}s.prototype._parseBase=function(a,c,f){this.words=[0],this.length=1;for(var l=0,d=1;d<=67108863;d*=c)l++;l--,d=d/c|0;var y=a.length-f,w=y%l,p=Math.min(y,y-w)+f,u=0;for(var m=f;m<p;m+=l)if(u=_(a,m,m+l,c),this.imuln(d),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u);if(w!==0){var E=1;u=_(a,m,a.length,c);for(m=0;m<w;m++)E*=c;if(this.imuln(E),this.words[0]+u<67108864)this.words[0]+=u;else this._iaddn(u)}this.strip()},s.prototype.copy=function(a){a.words=Array(this.length);for(var c=0;c<this.length;c++)a.words[c]=this.words[c];a.length=this.length,a.negative=this.negative,a.red=this.red},s.prototype.clone=function(){var a=new s(null);return this.copy(a),a},s.prototype._expand=function(a){while(this.length<a)this.words[this.length++]=0;return this},s.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var g=["","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"],S=[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],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(a,c){a=a||10,c=c|0||1;var f;if(a===16||a==="hex"){f="";var l=0,d=0;for(var y=0;y<this.length;y++){var w=this.words[y],p=((w<<l|d)&16777215).toString(16);if(d=w>>>24-l&16777215,l+=2,l>=26)l-=26,y--;if(d!==0||y!==this.length-1)f=g[6-p.length]+p+f;else f=p+f}if(d!==0)f=d.toString(16)+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}if(a===(a|0)&&a>=2&&a<=36){var u=S[a],m=x[a];f="";var E=this.clone();E.negative=0;while(!E.isZero()){var k=E.modn(m).toString(a);if(E=E.idivn(m),!E.isZero())f=g[u-k.length]+k+f;else f=k+f}if(this.isZero())f="0"+f;while(f.length%c!==0)f="0"+f;if(this.negative!==0)f="-"+f;return f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];if(this.length===2)a+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)a+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(a,c){return n(typeof h<"u"),this.toArrayLike(h,a,c)},s.prototype.toArray=function(a,c){return this.toArrayLike(Array,a,c)},s.prototype.toArrayLike=function(a,c,f){var l=this.byteLength(),d=f||Math.max(1,l);n(l<=d,"byte array longer than desired length"),n(d>0,"Requested array length <= 0"),this.strip();var y=c==="le",w=new a(d),p,u,m=this.clone();if(!y){for(u=0;u<d-l;u++)w[u]=0;for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[d-u-1]=p}else{for(u=0;!m.isZero();u++)p=m.andln(255),m.iushrn(8),w[u]=p;for(;u<d;u++)w[u]=0}return w},Math.clz32)s.prototype._countBits=function(a){return 32-Math.clz32(a)};else s.prototype._countBits=function(a){var c=a,f=0;if(c>=4096)f+=13,c>>>=13;if(c>=64)f+=7,c>>>=7;if(c>=8)f+=4,c>>>=4;if(c>=2)f+=2,c>>>=2;return f+c};s.prototype._zeroBits=function(a){if(a===0)return 26;var c=a,f=0;if((c&8191)===0)f+=13,c>>>=13;if((c&127)===0)f+=7,c>>>=7;if((c&15)===0)f+=4,c>>>=4;if((c&3)===0)f+=2,c>>>=2;if((c&1)===0)f++;return f},s.prototype.bitLength=function(){var a=this.words[this.length-1],c=this._countBits(a);return(this.length-1)*26+c};function M(a){var c=Array(a.bitLength());for(var f=0;f<c.length;f++){var l=f/26|0,d=f%26;c[f]=(a.words[l]&1<<d)>>>d}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;var a=0;for(var c=0;c<this.length;c++){var f=this._zeroBits(this.words[c]);if(a+=f,f!==26)break}return a},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(a){if(this.negative!==0)return this.abs().inotn(a).iaddn(1);return this.clone()},s.prototype.fromTwos=function(a){if(this.testn(a-1))return this.notn(a).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(a){while(this.length<a.length)this.words[this.length++]=0;for(var c=0;c<a.length;c++)this.words[c]=this.words[c]|a.words[c];return this.strip()},s.prototype.ior=function(a){return n((this.negative|a.negative)===0),this.iuor(a)},s.prototype.or=function(a){if(this.length>a.length)return this.clone().ior(a);return a.clone().ior(this)},s.prototype.uor=function(a){if(this.length>a.length)return this.clone().iuor(a);return a.clone().iuor(this)},s.prototype.iuand=function(a){var c;if(this.length>a.length)c=a;else c=this;for(var f=0;f<c.length;f++)this.words[f]=this.words[f]&a.words[f];return this.length=c.length,this.strip()},s.prototype.iand=function(a){return n((this.negative|a.negative)===0),this.iuand(a)},s.prototype.and=function(a){if(this.length>a.length)return this.clone().iand(a);return a.clone().iand(this)},s.prototype.uand=function(a){if(this.length>a.length)return this.clone().iuand(a);return a.clone().iuand(this)},s.prototype.iuxor=function(a){var c,f;if(this.length>a.length)c=this,f=a;else c=a,f=this;for(var l=0;l<f.length;l++)this.words[l]=c.words[l]^f.words[l];if(this!==c)for(;l<c.length;l++)this.words[l]=c.words[l];return this.length=c.length,this.strip()},s.prototype.ixor=function(a){return n((this.negative|a.negative)===0),this.iuxor(a)},s.prototype.xor=function(a){if(this.length>a.length)return this.clone().ixor(a);return a.clone().ixor(this)},s.prototype.uxor=function(a){if(this.length>a.length)return this.clone().iuxor(a);return a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a==="number"&&a>=0);var c=Math.ceil(a/26)|0,f=a%26;if(this._expand(c),f>0)c--;for(var l=0;l<c;l++)this.words[l]=~this.words[l]&67108863;if(f>0)this.words[l]=~this.words[l]&67108863>>26-f;return this.strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,c){n(typeof a==="number"&&a>=0);var f=a/26|0,l=a%26;if(this._expand(f+1),c)this.words[f]=this.words[f]|1<<l;else this.words[f]=this.words[f]&~(1<<l);return this.strip()},s.prototype.iadd=function(a){var c;if(this.negative!==0&&a.negative===0)return this.negative=0,c=this.isub(a),this.negative^=1,this._normSign();else if(this.negative===0&&a.negative!==0)return a.negative=0,c=this.isub(a),a.negative=1,c._normSign();var f,l;if(this.length>a.length)f=this,l=a;else f=a,l=this;var d=0;for(var y=0;y<l.length;y++)c=(f.words[y]|0)+(l.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;for(;d!==0&&y<f.length;y++)c=(f.words[y]|0)+d,this.words[y]=c&67108863,d=c>>>26;if(this.length=f.length,d!==0)this.words[this.length]=d,this.length++;else if(f!==this)for(;y<f.length;y++)this.words[y]=f.words[y];return this},s.prototype.add=function(a){var c;if(a.negative!==0&&this.negative===0)return a.negative=0,c=this.sub(a),a.negative^=1,c;else if(a.negative===0&&this.negative!==0)return this.negative=0,c=a.sub(this),this.negative=1,c;if(this.length>a.length)return this.clone().iadd(a);return a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var c=this.iadd(a);return a.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var f=this.cmp(a);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var l,d;if(f>0)l=this,d=a;else l=a,d=this;var y=0;for(var w=0;w<d.length;w++)c=(l.words[w]|0)-(d.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;for(;y!==0&&w<l.length;w++)c=(l.words[w]|0)+y,y=c>>26,this.words[w]=c&67108863;if(y===0&&w<l.length&&l!==this)for(;w<l.length;w++)this.words[w]=l.words[w];if(this.length=Math.max(this.length,w),l!==this)this.negative=1;return this.strip()},s.prototype.sub=function(a){return this.clone().isub(a)};function I(a,c,f){f.negative=c.negative^a.negative;var l=a.length+c.length|0;f.length=l,l=l-1|0;var d=a.words[0]|0,y=c.words[0]|0,w=d*y,p=w&67108863,u=w/67108864|0;f.words[0]=p;for(var m=1;m<l;m++){var E=u>>>26,k=u&67108863,A=Math.min(m,c.length-1);for(var N=Math.max(0,m-a.length+1);N<=A;N++){var U=m-N|0;d=a.words[U]|0,y=c.words[N]|0,w=d*y+k,E+=w/67108864|0,k=w&67108863}f.words[m]=k|0,u=E|0}if(u!==0)f.words[m]=u|0;else f.length--;return f.strip()}var T=function(a,c,f){var l=a.words,d=c.words,y=f.words,w=0,p,u,m,E=l[0]|0,k=E&8191,A=E>>>13,N=l[1]|0,U=N&8191,K=N>>>13,he=l[2]|0,J=he&8191,H=he>>>13,se=l[3]|0,V=se&8191,Q=se>>>13,Be=l[4]|0,z=Be&8191,L=Be>>>13,ae=l[5]|0,G=ae&8191,Y=ae>>>13,Me=l[6]|0,j=Me&8191,Z=Me>>>13,je=l[7]|0,W=je&8191,re=je>>>13,st=l[8]|0,ge=st&8191,ye=st>>>13,Gt=l[9]|0,pe=Gt&8191,ve=Gt>>>13,er=d[0]|0,xe=er&8191,Se=er>>>13,Or=d[1]|0,Ee=Or&8191,Re=Or>>>13,Nr=d[2]|0,Ce=Nr&8191,Ie=Nr>>>13,Tr=d[3]|0,Oe=Tr&8191,Te=Tr>>>13,xr=d[4]|0,Ne=xr&8191,De=xr>>>13,kr=d[5]|0,$e=kr&8191,O=kr>>>13,F=d[6]|0,X=F&8191,te=F>>>13,We=d[7]|0,me=We&8191,we=We>>>13,Jt=d[8]|0,Pe=Jt&8191,ze=Jt>>>13,$r=d[9]|0,Ae=$r&8191,ke=$r>>>13;f.negative=a.negative^c.negative,f.length=19,p=Math.imul(k,xe),u=Math.imul(k,Se),u=u+Math.imul(A,xe)|0,m=Math.imul(A,Se);var Xt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,p=Math.imul(U,xe),u=Math.imul(U,Se),u=u+Math.imul(K,xe)|0,m=Math.imul(K,Se),p=p+Math.imul(k,Ee)|0,u=u+Math.imul(k,Re)|0,u=u+Math.imul(A,Ee)|0,m=m+Math.imul(A,Re)|0;var pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pt>>>26)|0,pt&=67108863,p=Math.imul(J,xe),u=Math.imul(J,Se),u=u+Math.imul(H,xe)|0,m=Math.imul(H,Se),p=p+Math.imul(U,Ee)|0,u=u+Math.imul(U,Re)|0,u=u+Math.imul(K,Ee)|0,m=m+Math.imul(K,Re)|0,p=p+Math.imul(k,Ce)|0,u=u+Math.imul(k,Ie)|0,u=u+Math.imul(A,Ce)|0,m=m+Math.imul(A,Ie)|0;var dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dt>>>26)|0,dt&=67108863,p=Math.imul(V,xe),u=Math.imul(V,Se),u=u+Math.imul(Q,xe)|0,m=Math.imul(Q,Se),p=p+Math.imul(J,Ee)|0,u=u+Math.imul(J,Re)|0,u=u+Math.imul(H,Ee)|0,m=m+Math.imul(H,Re)|0,p=p+Math.imul(U,Ce)|0,u=u+Math.imul(U,Ie)|0,u=u+Math.imul(K,Ce)|0,m=m+Math.imul(K,Ie)|0,p=p+Math.imul(k,Oe)|0,u=u+Math.imul(k,Te)|0,u=u+Math.imul(A,Oe)|0,m=m+Math.imul(A,Te)|0;var Dt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,p=Math.imul(z,xe),u=Math.imul(z,Se),u=u+Math.imul(L,xe)|0,m=Math.imul(L,Se),p=p+Math.imul(V,Ee)|0,u=u+Math.imul(V,Re)|0,u=u+Math.imul(Q,Ee)|0,m=m+Math.imul(Q,Re)|0,p=p+Math.imul(J,Ce)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(H,Ce)|0,m=m+Math.imul(H,Ie)|0,p=p+Math.imul(U,Oe)|0,u=u+Math.imul(U,Te)|0,u=u+Math.imul(K,Oe)|0,m=m+Math.imul(K,Te)|0,p=p+Math.imul(k,Ne)|0,u=u+Math.imul(k,De)|0,u=u+Math.imul(A,Ne)|0,m=m+Math.imul(A,De)|0;var Pt=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,p=Math.imul(G,xe),u=Math.imul(G,Se),u=u+Math.imul(Y,xe)|0,m=Math.imul(Y,Se),p=p+Math.imul(z,Ee)|0,u=u+Math.imul(z,Re)|0,u=u+Math.imul(L,Ee)|0,m=m+Math.imul(L,Re)|0,p=p+Math.imul(V,Ce)|0,u=u+Math.imul(V,Ie)|0,u=u+Math.imul(Q,Ce)|0,m=m+Math.imul(Q,Ie)|0,p=p+Math.imul(J,Oe)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(H,Oe)|0,m=m+Math.imul(H,Te)|0,p=p+Math.imul(U,Ne)|0,u=u+Math.imul(U,De)|0,u=u+Math.imul(K,Ne)|0,m=m+Math.imul(K,De)|0,p=p+Math.imul(k,$e)|0,u=u+Math.imul(k,O)|0,u=u+Math.imul(A,$e)|0,m=m+Math.imul(A,O)|0;var or=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(or>>>26)|0,or&=67108863,p=Math.imul(j,xe),u=Math.imul(j,Se),u=u+Math.imul(Z,xe)|0,m=Math.imul(Z,Se),p=p+Math.imul(G,Ee)|0,u=u+Math.imul(G,Re)|0,u=u+Math.imul(Y,Ee)|0,m=m+Math.imul(Y,Re)|0,p=p+Math.imul(z,Ce)|0,u=u+Math.imul(z,Ie)|0,u=u+Math.imul(L,Ce)|0,m=m+Math.imul(L,Ie)|0,p=p+Math.imul(V,Oe)|0,u=u+Math.imul(V,Te)|0,u=u+Math.imul(Q,Oe)|0,m=m+Math.imul(Q,Te)|0,p=p+Math.imul(J,Ne)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(H,Ne)|0,m=m+Math.imul(H,De)|0,p=p+Math.imul(U,$e)|0,u=u+Math.imul(U,O)|0,u=u+Math.imul(K,$e)|0,m=m+Math.imul(K,O)|0,p=p+Math.imul(k,X)|0,u=u+Math.imul(k,te)|0,u=u+Math.imul(A,X)|0,m=m+Math.imul(A,te)|0;var sr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,p=Math.imul(W,xe),u=Math.imul(W,Se),u=u+Math.imul(re,xe)|0,m=Math.imul(re,Se),p=p+Math.imul(j,Ee)|0,u=u+Math.imul(j,Re)|0,u=u+Math.imul(Z,Ee)|0,m=m+Math.imul(Z,Re)|0,p=p+Math.imul(G,Ce)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(Y,Ce)|0,m=m+Math.imul(Y,Ie)|0,p=p+Math.imul(z,Oe)|0,u=u+Math.imul(z,Te)|0,u=u+Math.imul(L,Oe)|0,m=m+Math.imul(L,Te)|0,p=p+Math.imul(V,Ne)|0,u=u+Math.imul(V,De)|0,u=u+Math.imul(Q,Ne)|0,m=m+Math.imul(Q,De)|0,p=p+Math.imul(J,$e)|0,u=u+Math.imul(J,O)|0,u=u+Math.imul(H,$e)|0,m=m+Math.imul(H,O)|0,p=p+Math.imul(U,X)|0,u=u+Math.imul(U,te)|0,u=u+Math.imul(K,X)|0,m=m+Math.imul(K,te)|0,p=p+Math.imul(k,me)|0,u=u+Math.imul(k,we)|0,u=u+Math.imul(A,me)|0,m=m+Math.imul(A,we)|0;var ar=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,p=Math.imul(ge,xe),u=Math.imul(ge,Se),u=u+Math.imul(ye,xe)|0,m=Math.imul(ye,Se),p=p+Math.imul(W,Ee)|0,u=u+Math.imul(W,Re)|0,u=u+Math.imul(re,Ee)|0,m=m+Math.imul(re,Re)|0,p=p+Math.imul(j,Ce)|0,u=u+Math.imul(j,Ie)|0,u=u+Math.imul(Z,Ce)|0,m=m+Math.imul(Z,Ie)|0,p=p+Math.imul(G,Oe)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(Y,Oe)|0,m=m+Math.imul(Y,Te)|0,p=p+Math.imul(z,Ne)|0,u=u+Math.imul(z,De)|0,u=u+Math.imul(L,Ne)|0,m=m+Math.imul(L,De)|0,p=p+Math.imul(V,$e)|0,u=u+Math.imul(V,O)|0,u=u+Math.imul(Q,$e)|0,m=m+Math.imul(Q,O)|0,p=p+Math.imul(J,X)|0,u=u+Math.imul(J,te)|0,u=u+Math.imul(H,X)|0,m=m+Math.imul(H,te)|0,p=p+Math.imul(U,me)|0,u=u+Math.imul(U,we)|0,u=u+Math.imul(K,me)|0,m=m+Math.imul(K,we)|0,p=p+Math.imul(k,Pe)|0,u=u+Math.imul(k,ze)|0,u=u+Math.imul(A,Pe)|0,m=m+Math.imul(A,ze)|0;var ur=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(ur>>>26)|0,ur&=67108863,p=Math.imul(pe,xe),u=Math.imul(pe,Se),u=u+Math.imul(ve,xe)|0,m=Math.imul(ve,Se),p=p+Math.imul(ge,Ee)|0,u=u+Math.imul(ge,Re)|0,u=u+Math.imul(ye,Ee)|0,m=m+Math.imul(ye,Re)|0,p=p+Math.imul(W,Ce)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(re,Ce)|0,m=m+Math.imul(re,Ie)|0,p=p+Math.imul(j,Oe)|0,u=u+Math.imul(j,Te)|0,u=u+Math.imul(Z,Oe)|0,m=m+Math.imul(Z,Te)|0,p=p+Math.imul(G,Ne)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(Y,Ne)|0,m=m+Math.imul(Y,De)|0,p=p+Math.imul(z,$e)|0,u=u+Math.imul(z,O)|0,u=u+Math.imul(L,$e)|0,m=m+Math.imul(L,O)|0,p=p+Math.imul(V,X)|0,u=u+Math.imul(V,te)|0,u=u+Math.imul(Q,X)|0,m=m+Math.imul(Q,te)|0,p=p+Math.imul(J,me)|0,u=u+Math.imul(J,we)|0,u=u+Math.imul(H,me)|0,m=m+Math.imul(H,we)|0,p=p+Math.imul(U,Pe)|0,u=u+Math.imul(U,ze)|0,u=u+Math.imul(K,Pe)|0,m=m+Math.imul(K,ze)|0,p=p+Math.imul(k,Ae)|0,u=u+Math.imul(k,ke)|0,u=u+Math.imul(A,Ae)|0,m=m+Math.imul(A,ke)|0;var lr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(pe,Ee),u=Math.imul(pe,Re),u=u+Math.imul(ve,Ee)|0,m=Math.imul(ve,Re),p=p+Math.imul(ge,Ce)|0,u=u+Math.imul(ge,Ie)|0,u=u+Math.imul(ye,Ce)|0,m=m+Math.imul(ye,Ie)|0,p=p+Math.imul(W,Oe)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(re,Oe)|0,m=m+Math.imul(re,Te)|0,p=p+Math.imul(j,Ne)|0,u=u+Math.imul(j,De)|0,u=u+Math.imul(Z,Ne)|0,m=m+Math.imul(Z,De)|0,p=p+Math.imul(G,$e)|0,u=u+Math.imul(G,O)|0,u=u+Math.imul(Y,$e)|0,m=m+Math.imul(Y,O)|0,p=p+Math.imul(z,X)|0,u=u+Math.imul(z,te)|0,u=u+Math.imul(L,X)|0,m=m+Math.imul(L,te)|0,p=p+Math.imul(V,me)|0,u=u+Math.imul(V,we)|0,u=u+Math.imul(Q,me)|0,m=m+Math.imul(Q,we)|0,p=p+Math.imul(J,Pe)|0,u=u+Math.imul(J,ze)|0,u=u+Math.imul(H,Pe)|0,m=m+Math.imul(H,ze)|0,p=p+Math.imul(U,Ae)|0,u=u+Math.imul(U,ke)|0,u=u+Math.imul(K,Ae)|0,m=m+Math.imul(K,ke)|0;var cr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(cr>>>26)|0,cr&=67108863,p=Math.imul(pe,Ce),u=Math.imul(pe,Ie),u=u+Math.imul(ve,Ce)|0,m=Math.imul(ve,Ie),p=p+Math.imul(ge,Oe)|0,u=u+Math.imul(ge,Te)|0,u=u+Math.imul(ye,Oe)|0,m=m+Math.imul(ye,Te)|0,p=p+Math.imul(W,Ne)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(re,Ne)|0,m=m+Math.imul(re,De)|0,p=p+Math.imul(j,$e)|0,u=u+Math.imul(j,O)|0,u=u+Math.imul(Z,$e)|0,m=m+Math.imul(Z,O)|0,p=p+Math.imul(G,X)|0,u=u+Math.imul(G,te)|0,u=u+Math.imul(Y,X)|0,m=m+Math.imul(Y,te)|0,p=p+Math.imul(z,me)|0,u=u+Math.imul(z,we)|0,u=u+Math.imul(L,me)|0,m=m+Math.imul(L,we)|0,p=p+Math.imul(V,Pe)|0,u=u+Math.imul(V,ze)|0,u=u+Math.imul(Q,Pe)|0,m=m+Math.imul(Q,ze)|0,p=p+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(H,Ae)|0,m=m+Math.imul(H,ke)|0;var dr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(dr>>>26)|0,dr&=67108863,p=Math.imul(pe,Oe),u=Math.imul(pe,Te),u=u+Math.imul(ve,Oe)|0,m=Math.imul(ve,Te),p=p+Math.imul(ge,Ne)|0,u=u+Math.imul(ge,De)|0,u=u+Math.imul(ye,Ne)|0,m=m+Math.imul(ye,De)|0,p=p+Math.imul(W,$e)|0,u=u+Math.imul(W,O)|0,u=u+Math.imul(re,$e)|0,m=m+Math.imul(re,O)|0,p=p+Math.imul(j,X)|0,u=u+Math.imul(j,te)|0,u=u+Math.imul(Z,X)|0,m=m+Math.imul(Z,te)|0,p=p+Math.imul(G,me)|0,u=u+Math.imul(G,we)|0,u=u+Math.imul(Y,me)|0,m=m+Math.imul(Y,we)|0,p=p+Math.imul(z,Pe)|0,u=u+Math.imul(z,ze)|0,u=u+Math.imul(L,Pe)|0,m=m+Math.imul(L,ze)|0,p=p+Math.imul(V,Ae)|0,u=u+Math.imul(V,ke)|0,u=u+Math.imul(Q,Ae)|0,m=m+Math.imul(Q,ke)|0;var fr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(fr>>>26)|0,fr&=67108863,p=Math.imul(pe,Ne),u=Math.imul(pe,De),u=u+Math.imul(ve,Ne)|0,m=Math.imul(ve,De),p=p+Math.imul(ge,$e)|0,u=u+Math.imul(ge,O)|0,u=u+Math.imul(ye,$e)|0,m=m+Math.imul(ye,O)|0,p=p+Math.imul(W,X)|0,u=u+Math.imul(W,te)|0,u=u+Math.imul(re,X)|0,m=m+Math.imul(re,te)|0,p=p+Math.imul(j,me)|0,u=u+Math.imul(j,we)|0,u=u+Math.imul(Z,me)|0,m=m+Math.imul(Z,we)|0,p=p+Math.imul(G,Pe)|0,u=u+Math.imul(G,ze)|0,u=u+Math.imul(Y,Pe)|0,m=m+Math.imul(Y,ze)|0,p=p+Math.imul(z,Ae)|0,u=u+Math.imul(z,ke)|0,u=u+Math.imul(L,Ae)|0,m=m+Math.imul(L,ke)|0;var hr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(hr>>>26)|0,hr&=67108863,p=Math.imul(pe,$e),u=Math.imul(pe,O),u=u+Math.imul(ve,$e)|0,m=Math.imul(ve,O),p=p+Math.imul(ge,X)|0,u=u+Math.imul(ge,te)|0,u=u+Math.imul(ye,X)|0,m=m+Math.imul(ye,te)|0,p=p+Math.imul(W,me)|0,u=u+Math.imul(W,we)|0,u=u+Math.imul(re,me)|0,m=m+Math.imul(re,we)|0,p=p+Math.imul(j,Pe)|0,u=u+Math.imul(j,ze)|0,u=u+Math.imul(Z,Pe)|0,m=m+Math.imul(Z,ze)|0,p=p+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(Y,Ae)|0,m=m+Math.imul(Y,ke)|0;var pr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(pr>>>26)|0,pr&=67108863,p=Math.imul(pe,X),u=Math.imul(pe,te),u=u+Math.imul(ve,X)|0,m=Math.imul(ve,te),p=p+Math.imul(ge,me)|0,u=u+Math.imul(ge,we)|0,u=u+Math.imul(ye,me)|0,m=m+Math.imul(ye,we)|0,p=p+Math.imul(W,Pe)|0,u=u+Math.imul(W,ze)|0,u=u+Math.imul(re,Pe)|0,m=m+Math.imul(re,ze)|0,p=p+Math.imul(j,Ae)|0,u=u+Math.imul(j,ke)|0,u=u+Math.imul(Z,Ae)|0,m=m+Math.imul(Z,ke)|0;var mr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(mr>>>26)|0,mr&=67108863,p=Math.imul(pe,me),u=Math.imul(pe,we),u=u+Math.imul(ve,me)|0,m=Math.imul(ve,we),p=p+Math.imul(ge,Pe)|0,u=u+Math.imul(ge,ze)|0,u=u+Math.imul(ye,Pe)|0,m=m+Math.imul(ye,ze)|0,p=p+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(re,Ae)|0,m=m+Math.imul(re,ke)|0;var gr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(gr>>>26)|0,gr&=67108863,p=Math.imul(pe,Pe),u=Math.imul(pe,ze),u=u+Math.imul(ve,Pe)|0,m=Math.imul(ve,ze),p=p+Math.imul(ge,Ae)|0,u=u+Math.imul(ge,ke)|0,u=u+Math.imul(ye,Ae)|0,m=m+Math.imul(ye,ke)|0;var yr=(w+p|0)+((u&8191)<<13)|0;w=(m+(u>>>13)|0)+(yr>>>26)|0,yr&=67108863,p=Math.imul(pe,Ae),u=Math.imul(pe,ke),u=u+Math.imul(ve,Ae)|0,m=Math.imul(ve,ke);var vr=(w+p|0)+((u&8191)<<13)|0;if(w=(m+(u>>>13)|0)+(vr>>>26)|0,vr&=67108863,y[0]=Xt,y[1]=pt,y[2]=dt,y[3]=Dt,y[4]=Pt,y[5]=or,y[6]=sr,y[7]=ar,y[8]=ur,y[9]=lr,y[10]=cr,y[11]=dr,y[12]=fr,y[13]=hr,y[14]=pr,y[15]=mr,y[16]=gr,y[17]=yr,y[18]=vr,w!==0)y[19]=w,f.length++;return f};if(!Math.imul)T=I;function $(a,c,f){f.negative=c.negative^a.negative,f.length=a.length+c.length;var l=0,d=0;for(var y=0;y<f.length-1;y++){var w=d;d=0;var p=l&67108863,u=Math.min(y,c.length-1);for(var m=Math.max(0,y-a.length+1);m<=u;m++){var E=y-m,k=a.words[E]|0,A=c.words[m]|0,N=k*A,U=N&67108863;w=w+(N/67108864|0)|0,U=U+p|0,p=U&67108863,w=w+(U>>>26)|0,d+=w>>>26,w&=67108863}f.words[y]=p,l=w,w=d}if(l!==0)f.words[y]=l;else f.length--;return f.strip()}function P(a,c,f){var l=new R;return l.mulp(a,c,f)}s.prototype.mulTo=function(a,c){var f,l=this.length+a.length;if(this.length===10&&a.length===10)f=T(this,a,c);else if(l<63)f=I(this,a,c);else if(l<1024)f=$(this,a,c);else f=P(this,a,c);return f};function R(a,c){this.x=a,this.y=c}R.prototype.makeRBT=function(a){var c=Array(a),f=s.prototype._countBits(a)-1;for(var l=0;l<a;l++)c[l]=this.revBin(l,f,a);return c},R.prototype.revBin=function(a,c,f){if(a===0||a===f-1)return a;var l=0;for(var d=0;d<c;d++)l|=(a&1)<<c-d-1,a>>=1;return l},R.prototype.permute=function(a,c,f,l,d,y){for(var w=0;w<y;w++)l[w]=c[a[w]],d[w]=f[a[w]]},R.prototype.transform=function(a,c,f,l,d,y){this.permute(y,a,c,f,l,d);for(var w=1;w<d;w<<=1){var p=w<<1,u=Math.cos(2*Math.PI/p),m=Math.sin(2*Math.PI/p);for(var E=0;E<d;E+=p){var k=u,A=m;for(var N=0;N<w;N++){var U=f[E+N],K=l[E+N],he=f[E+N+w],J=l[E+N+w],H=k*he-A*J;if(J=k*J+A*he,he=H,f[E+N]=U+he,l[E+N]=K+J,f[E+N+w]=U-he,l[E+N+w]=K-J,N!==p)H=u*k-m*A,A=u*A+m*k,k=H}}}},R.prototype.guessLen13b=function(a,c){var f=Math.max(c,a)|1,l=f&1,d=0;for(f=f/2|0;f;f=f>>>1)d++;return 1<<d+1+l},R.prototype.conjugate=function(a,c,f){if(f<=1)return;for(var l=0;l<f/2;l++){var d=a[l];a[l]=a[f-l-1],a[f-l-1]=d,d=c[l],c[l]=-c[f-l-1],c[f-l-1]=-d}},R.prototype.normalize13b=function(a,c){var f=0;for(var l=0;l<c/2;l++){var d=Math.round(a[2*l+1]/c)*8192+Math.round(a[2*l]/c)+f;if(a[l]=d&67108863,d<67108864)f=0;else f=d/67108864|0}return a},R.prototype.convert13b=function(a,c,f,l){var d=0;for(var y=0;y<c;y++)d=d+(a[y]|0),f[2*y]=d&8191,d=d>>>13,f[2*y+1]=d&8191,d=d>>>13;for(y=2*c;y<l;++y)f[y]=0;n(d===0),n((d&-8192)===0)},R.prototype.stub=function(a){var c=Array(a);for(var f=0;f<a;f++)c[f]=0;return c},R.prototype.mulp=function(a,c,f){var l=2*this.guessLen13b(a.length,c.length),d=this.makeRBT(l),y=this.stub(l),w=Array(l),p=Array(l),u=Array(l),m=Array(l),E=Array(l),k=Array(l),A=f.words;A.length=l,this.convert13b(a.words,a.length,w,l),this.convert13b(c.words,c.length,m,l),this.transform(w,y,p,u,l,d),this.transform(m,y,E,k,l,d);for(var N=0;N<l;N++){var U=p[N]*E[N]-u[N]*k[N];u[N]=p[N]*k[N]+u[N]*E[N],p[N]=U}return this.conjugate(p,u,l),this.transform(p,u,A,y,l,d),this.conjugate(A,y,l),this.normalize13b(A,l),f.negative=a.negative^c.negative,f.length=a.length+c.length,f.strip()},s.prototype.mul=function(a){var c=new s(null);return c.words=Array(this.length+a.length),this.mulTo(a,c)},s.prototype.mulf=function(a){var c=new s(null);return c.words=Array(this.length+a.length),P(this,a,c)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){n(typeof a==="number"),n(a<67108864);var c=0;for(var f=0;f<this.length;f++){var l=(this.words[f]|0)*a,d=(l&67108863)+(c&67108863);c>>=26,c+=l/67108864|0,c+=d>>>26,this.words[f]=d&67108863}if(c!==0)this.words[f]=c,this.length++;return this.length=a===0?1:this.length,this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var c=M(a);if(c.length===0)return new s(1);var f=this;for(var l=0;l<c.length;l++,f=f.sqr())if(c[l]!==0)break;if(++l<c.length)for(var d=f.sqr();l<c.length;l++,d=d.sqr()){if(c[l]===0)continue;f=f.mul(d)}return f},s.prototype.iushln=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=67108863>>>26-c<<26-c,d;if(c!==0){var y=0;for(d=0;d<this.length;d++){var w=this.words[d]&l,p=(this.words[d]|0)-w<<c;this.words[d]=p|y,y=w>>>26-c}if(y)this.words[d]=y,this.length++}if(f!==0){for(d=this.length-1;d>=0;d--)this.words[d+f]=this.words[d];for(d=0;d<f;d++)this.words[d]=0;this.length+=f}return this.strip()},s.prototype.ishln=function(a){return n(this.negative===0),this.iushln(a)},s.prototype.iushrn=function(a,c,f){n(typeof a==="number"&&a>=0);var l;if(c)l=(c-c%26)/26;else l=0;var d=a%26,y=Math.min((a-d)/26,this.length),w=67108863^67108863>>>d<<d,p=f;if(l-=y,l=Math.max(0,l),p){for(var u=0;u<y;u++)p.words[u]=this.words[u];p.length=y}if(y===0);else if(this.length>y){this.length-=y;for(u=0;u<this.length;u++)this.words[u]=this.words[u+y]}else this.words[0]=0,this.length=1;var m=0;for(u=this.length-1;u>=0&&(m!==0||u>=l);u--){var E=this.words[u]|0;this.words[u]=m<<26-d|E>>>d,m=E&w}if(p&&m!==0)p.words[p.length++]=m;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},s.prototype.ishrn=function(a,c,f){return n(this.negative===0),this.iushrn(a,c,f)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return!1;var d=this.words[f];return!!(d&l)},s.prototype.imaskn=function(a){n(typeof a==="number"&&a>=0);var c=a%26,f=(a-c)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(c!==0)f++;if(this.length=Math.min(f,this.length),c!==0){var l=67108863^67108863>>>c<<c;this.words[this.length-1]&=l}return this.strip()},s.prototype.maskn=function(a){return this.clone().imaskn(a)},s.prototype.iaddn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.isubn(-a);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<a)return this.words[0]=a-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(a),this.negative=1,this}return this._iaddn(a)},s.prototype._iaddn=function(a){this.words[0]+=a;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)if(this.words[c]-=67108864,c===this.length-1)this.words[c+1]=1;else this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},s.prototype.isubn=function(a){if(n(typeof a==="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},s.prototype.addn=function(a){return this.clone().iaddn(a)},s.prototype.subn=function(a){return this.clone().isubn(a)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(a,c,f){var l=a.length+f,d;this._expand(l);var y,w=0;for(d=0;d<a.length;d++){y=(this.words[d+f]|0)+w;var p=(a.words[d]|0)*c;y-=p&67108863,w=(y>>26)-(p/67108864|0),this.words[d+f]=y&67108863}for(;d<this.length-f;d++)y=(this.words[d+f]|0)+w,w=y>>26,this.words[d+f]=y&67108863;if(w===0)return this.strip();n(w===-1),w=0;for(d=0;d<this.length;d++)y=-(this.words[d]|0)+w,w=y>>26,this.words[d]=y&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(a,c){var f=this.length-a.length,l=this.clone(),d=a,y=d.words[d.length-1]|0,w=this._countBits(y);if(f=26-w,f!==0)d=d.ushln(f),l.iushln(f),y=d.words[d.length-1]|0;var p=l.length-d.length,u;if(c!=="mod"){u=new s(null),u.length=p+1,u.words=Array(u.length);for(var m=0;m<u.length;m++)u.words[m]=0}var E=l.clone()._ishlnsubmul(d,1,p);if(E.negative===0){if(l=E,u)u.words[p]=1}for(var k=p-1;k>=0;k--){var A=(l.words[d.length+k]|0)*67108864+(l.words[d.length+k-1]|0);A=Math.min(A/y|0,67108863),l._ishlnsubmul(d,A,k);while(l.negative!==0)if(A--,l.negative=0,l._ishlnsubmul(d,1,k),!l.isZero())l.negative^=1;if(u)u.words[k]=A}if(u)u.strip();if(l.strip(),c!=="div"&&f!==0)l.iushrn(f);return{div:u||null,mod:l}},s.prototype.divmod=function(a,c,f){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var l,d,y;if(this.negative!==0&&a.negative===0){if(y=this.neg().divmod(a,c),c!=="mod")l=y.div.neg();if(c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.iadd(a)}return{div:l,mod:d}}if(this.negative===0&&a.negative!==0){if(y=this.divmod(a.neg(),c),c!=="mod")l=y.div.neg();return{div:l,mod:y.mod}}if((this.negative&a.negative)!==0){if(y=this.neg().divmod(a.neg(),c),c!=="div"){if(d=y.mod.neg(),f&&d.negative!==0)d.isub(a)}return{div:y.div,mod:d}}if(a.length>this.length||this.cmp(a)<0)return{div:new s(0),mod:this};if(a.length===1){if(c==="div")return{div:this.divn(a.words[0]),mod:null};if(c==="mod")return{div:null,mod:new s(this.modn(a.words[0]))};return{div:this.divn(a.words[0]),mod:new s(this.modn(a.words[0]))}}return this._wordDiv(a,c)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var c=this.divmod(a);if(c.mod.isZero())return c.div;var f=c.div.negative!==0?c.mod.isub(a):c.mod,l=a.ushrn(1),d=a.andln(1),y=f.cmp(l);if(y<0||d===1&&y===0)return c.div;return c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},s.prototype.modn=function(a){n(a<=67108863);var c=67108864%a,f=0;for(var l=this.length-1;l>=0;l--)f=(c*f+(this.words[l]|0))%a;return f},s.prototype.idivn=function(a){n(a<=67108863);var c=0;for(var f=this.length-1;f>=0;f--){var l=(this.words[f]|0)+c*67108864;this.words[f]=l/a|0,c=l%a}return this.strip()},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=new s(0),w=new s(1),p=0;while(c.isEven()&&f.isEven())c.iushrn(1),f.iushrn(1),++p;var u=f.clone(),m=c.clone();while(!c.isZero()){for(var E=0,k=1;(c.words[0]&k)===0&&E<26;++E,k<<=1);if(E>0){c.iushrn(E);while(E-- >0){if(l.isOdd()||d.isOdd())l.iadd(u),d.isub(m);l.iushrn(1),d.iushrn(1)}}for(var A=0,N=1;(f.words[0]&N)===0&&A<26;++A,N<<=1);if(A>0){f.iushrn(A);while(A-- >0){if(y.isOdd()||w.isOdd())y.iadd(u),w.isub(m);y.iushrn(1),w.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(y),d.isub(w);else f.isub(c),y.isub(l),w.isub(d)}return{a:y,b:w,gcd:f.iushln(p)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var c=this,f=a.clone();if(c.negative!==0)c=c.umod(a);else c=c.clone();var l=new s(1),d=new s(0),y=f.clone();while(c.cmpn(1)>0&&f.cmpn(1)>0){for(var w=0,p=1;(c.words[0]&p)===0&&w<26;++w,p<<=1);if(w>0){c.iushrn(w);while(w-- >0){if(l.isOdd())l.iadd(y);l.iushrn(1)}}for(var u=0,m=1;(f.words[0]&m)===0&&u<26;++u,m<<=1);if(u>0){f.iushrn(u);while(u-- >0){if(d.isOdd())d.iadd(y);d.iushrn(1)}}if(c.cmp(f)>=0)c.isub(f),l.isub(d);else f.isub(c),d.isub(l)}var E;if(c.cmpn(1)===0)E=l;else E=d;if(E.cmpn(0)<0)E.iadd(a);return E},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var c=this.clone(),f=a.clone();c.negative=0,f.negative=0;for(var l=0;c.isEven()&&f.isEven();l++)c.iushrn(1),f.iushrn(1);do{while(c.isEven())c.iushrn(1);while(f.isEven())f.iushrn(1);var d=c.cmp(f);if(d<0){var y=c;c=f,f=y}else if(d===0||f.cmpn(1)===0)break;c.isub(f)}while(!0);return f.iushln(l)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a==="number");var c=a%26,f=(a-c)/26,l=1<<c;if(this.length<=f)return this._expand(f+1),this.words[f]|=l,this;var d=l;for(var y=f;d!==0&&y<this.length;y++){var w=this.words[y]|0;w+=d,d=w>>>26,w&=67108863,this.words[y]=w}if(d!==0)this.words[y]=d,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var c=a<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var f;if(this.length>1)f=1;else{if(c)a=-a;n(a<=67108863,"Number is too big");var l=this.words[0]|0;f=l===a?0:l<a?-1:1}if(this.negative!==0)return-f|0;return f},s.prototype.cmp=function(a){if(this.negative!==0&&a.negative===0)return-1;if(this.negative===0&&a.negative!==0)return 1;var c=this.ucmp(a);if(this.negative!==0)return-c|0;return c},s.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;var c=0;for(var f=this.length-1;f>=0;f--){var l=this.words[f]|0,d=a.words[f]|0;if(l===d)continue;if(l<d)c=-1;else if(l>d)c=1;break}return c},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var C={k256:null,p224:null,p192:null,p25519:null};function D(a,c){this.name=a,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var c=a,f;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),f=c.bitLength();while(f>this.n);var l=f<this.n?-1:c.ucmp(this.p);if(l===0)c.words[0]=0,c.length=1;else if(l>0)c.isub(this.p);else if(c.strip!==void 0)c.strip();else c._strip();return c},D.prototype.split=function(a,c){a.iushrn(this.n,0,c)},D.prototype.imulK=function(a){return a.imul(this.k)};function B(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(B,D),B.prototype.split=function(a,c){var f=4194303,l=Math.min(a.length,9);for(var d=0;d<l;d++)c.words[d]=a.words[d];if(c.length=l,a.length<=9){a.words[0]=0,a.length=1;return}var y=a.words[9];c.words[c.length++]=y&f;for(d=10;d<a.length;d++){var w=a.words[d]|0;a.words[d-10]=(w&f)<<4|y>>>22,y=w}if(y>>>=22,a.words[d-10]=y,y===0&&a.length>10)a.length-=10;else a.length-=9},B.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;var c=0;for(var f=0;f<a.length;f++){var l=a.words[f]|0;c+=l*977,a.words[f]=c&67108863,c=l*64+(c/67108864|0)}if(a.words[a.length-1]===0){if(a.length--,a.words[a.length-1]===0)a.length--}return a};function ie(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(ie,D);function le(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(le,D);function ue(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(ue,D),ue.prototype.imulK=function(a){var c=0;for(var f=0;f<a.length;f++){var l=(a.words[f]|0)*19+c,d=l&67108863;l>>>=26,a.words[f]=d,c=l}if(c!==0)a.words[a.length++]=c;return a},s._prime=function(a){if(C[a])return C[a];var c;if(a==="k256")c=new B;else if(a==="p224")c=new ie;else if(a==="p192")c=new le;else if(a==="p25519")c=new ue;else throw Error("Unknown prime "+a);return C[a]=c,c};function q(a){if(typeof a==="string"){var c=s._prime(a);this.m=c.p,this.prime=c}else n(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},q.prototype._verify2=function(a,c){n((a.negative|c.negative)===0,"red works only with positives"),n(a.red&&a.red===c.red,"red works only with red numbers")},q.prototype.imod=function(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.umod(this.m)._forceRed(this)},q.prototype.neg=function(a){if(a.isZero())return a.clone();return this.m.sub(a)._forceRed(this)},q.prototype.add=function(a,c){this._verify2(a,c);var f=a.add(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f._forceRed(this)},q.prototype.iadd=function(a,c){this._verify2(a,c);var f=a.iadd(c);if(f.cmp(this.m)>=0)f.isub(this.m);return f},q.prototype.sub=function(a,c){this._verify2(a,c);var f=a.sub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f._forceRed(this)},q.prototype.isub=function(a,c){this._verify2(a,c);var f=a.isub(c);if(f.cmpn(0)<0)f.iadd(this.m);return f},q.prototype.shl=function(a,c){return this._verify1(a),this.imod(a.ushln(c))},q.prototype.imul=function(a,c){return this._verify2(a,c),this.imod(a.imul(c))},q.prototype.mul=function(a,c){return this._verify2(a,c),this.imod(a.mul(c))},q.prototype.isqr=function(a){return this.imul(a,a.clone())},q.prototype.sqr=function(a){return this.mul(a,a)},q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var c=this.m.andln(3);if(n(c%2===1),c===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(a,f)}var l=this.m.subn(1),d=0;while(!l.isZero()&&l.andln(1)===0)d++,l.iushrn(1);n(!l.isZero());var y=new s(1).toRed(this),w=y.redNeg(),p=this.m.subn(1).iushrn(1),u=this.m.bitLength();u=new s(2*u*u).toRed(this);while(this.pow(u,p).cmp(w)!==0)u.redIAdd(w);var m=this.pow(u,l),E=this.pow(a,l.addn(1).iushrn(1)),k=this.pow(a,l),A=d;while(k.cmp(y)!==0){var N=k;for(var U=0;N.cmp(y)!==0;U++)N=N.redSqr();n(U<A);var K=this.pow(m,new s(1).iushln(A-U-1));E=E.redMul(K),m=K.redSqr(),k=k.redMul(m),A=U}return E},q.prototype.invm=function(a){var c=a._invmp(this.m);if(c.negative!==0)return c.negative=0,this.imod(c).redNeg();else return this.imod(c)},q.prototype.pow=function(a,c){if(c.isZero())return new s(1).toRed(this);if(c.cmpn(1)===0)return a.clone();var f=4,l=Array(1<<f);l[0]=new s(1).toRed(this),l[1]=a;for(var d=2;d<l.length;d++)l[d]=this.mul(l[d-1],a);var y=l[0],w=0,p=0,u=c.bitLength()%26;if(u===0)u=26;for(d=c.length-1;d>=0;d--){var m=c.words[d];for(var E=u-1;E>=0;E--){var k=m>>E&1;if(y!==l[0])y=this.sqr(y);if(k===0&&w===0){p=0;continue}if(w<<=1,w|=k,p++,p!==f&&(d!==0||E!==0))continue;y=this.mul(y,l[w]),p=0,w=0}u=26}return y},q.prototype.convertTo=function(a){var c=a.umod(this.m);return c===a?c.clone():c},q.prototype.convertFrom=function(a){var c=a.clone();return c.red=null,c},s.mont=function(a){return new ee(a)};function ee(a){if(q.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new s(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)}o(ee,q),ee.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ee.prototype.convertFrom=function(a){var c=this.imod(a.mul(this.rinv));return c.red=null,c},ee.prototype.imul=function(a,c){if(a.isZero()||c.isZero())return a.words[0]=0,a.length=1,a;var f=a.imul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.mul=function(a,c){if(a.isZero()||c.isZero())return new s(0)._forceRed(this);var f=a.mul(c),l=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=f.isub(l).iushrn(this.shift),y=d;if(d.cmp(this.m)>=0)y=d.isub(this.m);else if(d.cmpn(0)<0)y=d.iadd(this.m);return y._forceRed(this)},ee.prototype.invm=function(a){var c=this.imod(a._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(typeof t>"u"||t,e)}),Aw=ce((e,t)=>{var r=Rm(),i=Br().Buffer;function n(o,s){return i.from(o.toRed(r.mont(s.modulus)).redPow(new r(s.publicExponent)).fromRed().toArray())}t.exports=n}),oP=ce((e,t)=>{(function(r,i){function n(l,d){if(!l)throw Error(d||"Assertion failed")}function o(l,d){l.super_=d;var y=function(){};y.prototype=d.prototype,l.prototype=new y,l.prototype.constructor=l}function s(l,d,y){if(s.isBN(l))return l;if(this.negative=0,this.words=null,this.length=0,this.red=null,l!==null){if(d==="le"||d==="be")y=d,d=10;this._init(l||0,d||10,y||"be")}}if(typeof r==="object")r.exports=s;else i.BN=s;s.BN=s,s.wordSize=26;var h;try{if(typeof window<"u"&&typeof window.Buffer<"u")h=window.Buffer;else h=(Ir(),xt(Er)).Buffer}catch(l){}s.isBN=function(l){if(l instanceof s)return!0;return l!==null&&typeof l==="object"&&l.constructor.wordSize===s.wordSize&&Array.isArray(l.words)},s.max=function(l,d){if(l.cmp(d)>0)return l;return d},s.min=function(l,d){if(l.cmp(d)<0)return l;return d},s.prototype._init=function(l,d,y){if(typeof l==="number")return this._initNumber(l,d,y);if(typeof l==="object")return this._initArray(l,d,y);if(d==="hex")d=16;n(d===(d|0)&&d>=2&&d<=36),l=l.toString().replace(/\s+/g,"");var w=0;if(l[0]==="-")w++,this.negative=1;if(w<l.length){if(d===16)this._parseHex(l,w,y);else if(this._parseBase(l,d,w),y==="le")this._initArray(this.toArray(),d,y)}},s.prototype._initNumber=function(l,d,y){if(l<0)this.negative=1,l=-l;if(l<67108864)this.words=[l&67108863],this.length=1;else if(l<4503599627370496)this.words=[l&67108863,l/67108864&67108863],this.length=2;else n(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3;if(y!=="le")return;this._initArray(this.toArray(),d,y)},s.prototype._initArray=function(l,d,y){if(n(typeof l.length==="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var p,u,m=0;if(y==="be"){for(w=l.length-1,p=0;w>=0;w-=3)if(u=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[p]|=u<<m&67108863,this.words[p+1]=u>>>26-m&67108863,m+=24,m>=26)m-=26,p++}else if(y==="le"){for(w=0,p=0;w<l.length;w+=3)if(u=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[p]|=u<<m&67108863,this.words[p+1]=u>>>26-m&67108863,m+=24,m>=26)m-=26,p++}return this._strip()};function b(l,d){var y=l.charCodeAt(d);if(y>=48&&y<=57)return y-48;else if(y>=65&&y<=70)return y-55;else if(y>=97&&y<=102)return y-87;else n(!1,"Invalid character in "+l)}function v(l,d,y){var w=b(l,y);if(y-1>=d)w|=b(l,y-1)<<4;return w}s.prototype._parseHex=function(l,d,y){this.length=Math.ceil((l.length-d)/6),this.words=Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var p=0,u=0,m;if(y==="be")for(w=l.length-1;w>=d;w-=2)if(m=v(l,d,w)<<p,this.words[u]|=m&67108863,p>=18)p-=18,u+=1,this.words[u]|=m>>>26;else p+=8;else{var E=l.length-d;for(w=E%2===0?d+1:d;w<l.length;w+=2)if(m=v(l,d,w)<<p,this.words[u]|=m&67108863,p>=18)p-=18,u+=1,this.words[u]|=m>>>26;else p+=8}this._strip()};function _(l,d,y,w){var p=0,u=0,m=Math.min(l.length,y);for(var E=d;E<m;E++){var k=l.charCodeAt(E)-48;if(p*=w,k>=49)u=k-49+10;else if(k>=17)u=k-17+10;else u=k;n(k>=0&&u<w,"Invalid character"),p+=u}return p}s.prototype._parseBase=function(l,d,y){this.words=[0],this.length=1;for(var w=0,p=1;p<=67108863;p*=d)w++;w--,p=p/d|0;var u=l.length-y,m=u%w,E=Math.min(u,u-m)+y,k=0;for(var A=y;A<E;A+=w)if(k=_(l,A,A+w,d),this.imuln(p),this.words[0]+k<67108864)this.words[0]+=k;else this._iaddn(k);if(m!==0){var N=1;k=_(l,A,l.length,d);for(A=0;A<m;A++)N*=d;if(this.imuln(N),this.words[0]+k<67108864)this.words[0]+=k;else this._iaddn(k)}this._strip()},s.prototype.copy=function(l){l.words=Array(this.length);for(var d=0;d<this.length;d++)l.words[d]=this.words[d];l.length=this.length,l.negative=this.negative,l.red=this.red};function g(l,d){l.words=d.words,l.length=d.length,l.negative=d.negative,l.red=d.red}if(s.prototype._move=function(l){g(l,this)},s.prototype.clone=function(){var l=new s(null);return this.copy(l),l},s.prototype._expand=function(l){while(this.length<l)this.words[this.length++]=0;return this},s.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},s.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch(l){s.prototype.inspect=S}else s.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var x=["","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"],M=[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],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(s.prototype.toString=function(l,d){l=l||10,d=d|0||1;var y;if(l===16||l==="hex"){y="";var w=0,p=0;for(var u=0;u<this.length;u++){var m=this.words[u],E=((m<<w|p)&16777215).toString(16);if(p=m>>>24-w&16777215,w+=2,w>=26)w-=26,u--;if(p!==0||u!==this.length-1)y=x[6-E.length]+E+y;else y=E+y}if(p!==0)y=p.toString(16)+y;while(y.length%d!==0)y="0"+y;if(this.negative!==0)y="-"+y;return y}if(l===(l|0)&&l>=2&&l<=36){var k=M[l],A=I[l];y="";var N=this.clone();N.negative=0;while(!N.isZero()){var U=N.modrn(A).toString(l);if(N=N.idivn(A),!N.isZero())y=x[k-U.length]+U+y;else y=U+y}if(this.isZero())y="0"+y;while(y.length%d!==0)y="0"+y;if(this.negative!==0)y="-"+y;return y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var l=this.words[0];if(this.length===2)l+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)l+=4503599627370496+this.words[1]*67108864;else if(this.length>2)n(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-l:l},s.prototype.toJSON=function(){return this.toString(16,2)},h)s.prototype.toBuffer=function(l,d){return this.toArrayLike(h,l,d)};s.prototype.toArray=function(l,d){return this.toArrayLike(Array,l,d)};var T=function(l,d){if(l.allocUnsafe)return l.allocUnsafe(d);return new l(d)};if(s.prototype.toArrayLike=function(l,d,y){this._strip();var w=this.byteLength(),p=y||Math.max(1,w);n(w<=p,"byte array longer than desired length"),n(p>0,"Requested array length <= 0");var u=T(l,p),m=d==="le"?"LE":"BE";return this["_toArrayLike"+m](u,w),u},s.prototype._toArrayLikeLE=function(l,d){var y=0,w=0;for(var p=0,u=0;p<this.length;p++){var m=this.words[p]<<u|w;if(l[y++]=m&255,y<l.length)l[y++]=m>>8&255;if(y<l.length)l[y++]=m>>16&255;if(u===6){if(y<l.length)l[y++]=m>>24&255;w=0,u=0}else w=m>>>24,u+=2}if(y<l.length){l[y++]=w;while(y<l.length)l[y++]=0}},s.prototype._toArrayLikeBE=function(l,d){var y=l.length-1,w=0;for(var p=0,u=0;p<this.length;p++){var m=this.words[p]<<u|w;if(l[y--]=m&255,y>=0)l[y--]=m>>8&255;if(y>=0)l[y--]=m>>16&255;if(u===6){if(y>=0)l[y--]=m>>24&255;w=0,u=0}else w=m>>>24,u+=2}if(y>=0){l[y--]=w;while(y>=0)l[y--]=0}},Math.clz32)s.prototype._countBits=function(l){return 32-Math.clz32(l)};else s.prototype._countBits=function(l){var d=l,y=0;if(d>=4096)y+=13,d>>>=13;if(d>=64)y+=7,d>>>=7;if(d>=8)y+=4,d>>>=4;if(d>=2)y+=2,d>>>=2;return y+d};s.prototype._zeroBits=function(l){if(l===0)return 26;var d=l,y=0;if((d&8191)===0)y+=13,d>>>=13;if((d&127)===0)y+=7,d>>>=7;if((d&15)===0)y+=4,d>>>=4;if((d&3)===0)y+=2,d>>>=2;if((d&1)===0)y++;return y},s.prototype.bitLength=function(){var l=this.words[this.length-1],d=this._countBits(l);return(this.length-1)*26+d};function $(l){var d=Array(l.bitLength());for(var y=0;y<d.length;y++){var w=y/26|0,p=y%26;d[y]=l.words[w]>>>p&1}return d}s.prototype.zeroBits=function(){if(this.isZero())return 0;var l=0;for(var d=0;d<this.length;d++){var y=this._zeroBits(this.words[d]);if(l+=y,y!==26)break}return l},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(l){if(this.negative!==0)return this.abs().inotn(l).iaddn(1);return this.clone()},s.prototype.fromTwos=function(l){if(this.testn(l-1))return this.notn(l).iaddn(1).ineg();return this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},s.prototype.iuor=function(l){while(this.length<l.length)this.words[this.length++]=0;for(var d=0;d<l.length;d++)this.words[d]=this.words[d]|l.words[d];return this._strip()},s.prototype.ior=function(l){return n((this.negative|l.negative)===0),this.iuor(l)},s.prototype.or=function(l){if(this.length>l.length)return this.clone().ior(l);return l.clone().ior(this)},s.prototype.uor=function(l){if(this.length>l.length)return this.clone().iuor(l);return l.clone().iuor(this)},s.prototype.iuand=function(l){var d;if(this.length>l.length)d=l;else d=this;for(var y=0;y<d.length;y++)this.words[y]=this.words[y]&l.words[y];return this.length=d.length,this._strip()},s.prototype.iand=function(l){return n((this.negative|l.negative)===0),this.iuand(l)},s.prototype.and=function(l){if(this.length>l.length)return this.clone().iand(l);return l.clone().iand(this)},s.prototype.uand=function(l){if(this.length>l.length)return this.clone().iuand(l);return l.clone().iuand(this)},s.prototype.iuxor=function(l){var d,y;if(this.length>l.length)d=this,y=l;else d=l,y=this;for(var w=0;w<y.length;w++)this.words[w]=d.words[w]^y.words[w];if(this!==d)for(;w<d.length;w++)this.words[w]=d.words[w];return this.length=d.length,this._strip()},s.prototype.ixor=function(l){return n((this.negative|l.negative)===0),this.iuxor(l)},s.prototype.xor=function(l){if(this.length>l.length)return this.clone().ixor(l);return l.clone().ixor(this)},s.prototype.uxor=function(l){if(this.length>l.length)return this.clone().iuxor(l);return l.clone().iuxor(this)},s.prototype.inotn=function(l){n(typeof l==="number"&&l>=0);var d=Math.ceil(l/26)|0,y=l%26;if(this._expand(d),y>0)d--;for(var w=0;w<d;w++)this.words[w]=~this.words[w]&67108863;if(y>0)this.words[w]=~this.words[w]&67108863>>26-y;return this._strip()},s.prototype.notn=function(l){return this.clone().inotn(l)},s.prototype.setn=function(l,d){n(typeof l==="number"&&l>=0);var y=l/26|0,w=l%26;if(this._expand(y+1),d)this.words[y]=this.words[y]|1<<w;else this.words[y]=this.words[y]&~(1<<w);return this._strip()},s.prototype.iadd=function(l){var d;if(this.negative!==0&&l.negative===0)return this.negative=0,d=this.isub(l),this.negative^=1,this._normSign();else if(this.negative===0&&l.negative!==0)return l.negative=0,d=this.isub(l),l.negative=1,d._normSign();var y,w;if(this.length>l.length)y=this,w=l;else y=l,w=this;var p=0;for(var u=0;u<w.length;u++)d=(y.words[u]|0)+(w.words[u]|0)+p,this.words[u]=d&67108863,p=d>>>26;for(;p!==0&&u<y.length;u++)d=(y.words[u]|0)+p,this.words[u]=d&67108863,p=d>>>26;if(this.length=y.length,p!==0)this.words[this.length]=p,this.length++;else if(y!==this)for(;u<y.length;u++)this.words[u]=y.words[u];return this},s.prototype.add=function(l){var d;if(l.negative!==0&&this.negative===0)return l.negative=0,d=this.sub(l),l.negative^=1,d;else if(l.negative===0&&this.negative!==0)return this.negative=0,d=l.sub(this),this.negative=1,d;if(this.length>l.length)return this.clone().iadd(l);return l.clone().iadd(this)},s.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var d=this.iadd(l);return l.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var y=this.cmp(l);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,p;if(y>0)w=this,p=l;else w=l,p=this;var u=0;for(var m=0;m<p.length;m++)d=(w.words[m]|0)-(p.words[m]|0)+u,u=d>>26,this.words[m]=d&67108863;for(;u!==0&&m<w.length;m++)d=(w.words[m]|0)+u,u=d>>26,this.words[m]=d&67108863;if(u===0&&m<w.length&&w!==this)for(;m<w.length;m++)this.words[m]=w.words[m];if(this.length=Math.max(this.length,m),w!==this)this.negative=1;return this._strip()},s.prototype.sub=function(l){return this.clone().isub(l)};function P(l,d,y){y.negative=d.negative^l.negative;var w=l.length+d.length|0;y.length=w,w=w-1|0;var p=l.words[0]|0,u=d.words[0]|0,m=p*u,E=m&67108863,k=m/67108864|0;y.words[0]=E;for(var A=1;A<w;A++){var N=k>>>26,U=k&67108863,K=Math.min(A,d.length-1);for(var he=Math.max(0,A-l.length+1);he<=K;he++){var J=A-he|0;p=l.words[J]|0,u=d.words[he]|0,m=p*u+U,N+=m/67108864|0,U=m&67108863}y.words[A]=U|0,k=N|0}if(k!==0)y.words[A]=k|0;else y.length--;return y._strip()}var R=function(l,d,y){var w=l.words,p=d.words,u=y.words,m=0,E,k,A,N=w[0]|0,U=N&8191,K=N>>>13,he=w[1]|0,J=he&8191,H=he>>>13,se=w[2]|0,V=se&8191,Q=se>>>13,Be=w[3]|0,z=Be&8191,L=Be>>>13,ae=w[4]|0,G=ae&8191,Y=ae>>>13,Me=w[5]|0,j=Me&8191,Z=Me>>>13,je=w[6]|0,W=je&8191,re=je>>>13,st=w[7]|0,ge=st&8191,ye=st>>>13,Gt=w[8]|0,pe=Gt&8191,ve=Gt>>>13,er=w[9]|0,xe=er&8191,Se=er>>>13,Or=p[0]|0,Ee=Or&8191,Re=Or>>>13,Nr=p[1]|0,Ce=Nr&8191,Ie=Nr>>>13,Tr=p[2]|0,Oe=Tr&8191,Te=Tr>>>13,xr=p[3]|0,Ne=xr&8191,De=xr>>>13,kr=p[4]|0,$e=kr&8191,O=kr>>>13,F=p[5]|0,X=F&8191,te=F>>>13,We=p[6]|0,me=We&8191,we=We>>>13,Jt=p[7]|0,Pe=Jt&8191,ze=Jt>>>13,$r=p[8]|0,Ae=$r&8191,ke=$r>>>13,Xt=p[9]|0,pt=Xt&8191,dt=Xt>>>13;y.negative=l.negative^d.negative,y.length=19,E=Math.imul(U,Ee),k=Math.imul(U,Re),k=k+Math.imul(K,Ee)|0,A=Math.imul(K,Re);var Dt=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,E=Math.imul(J,Ee),k=Math.imul(J,Re),k=k+Math.imul(H,Ee)|0,A=Math.imul(H,Re),E=E+Math.imul(U,Ce)|0,k=k+Math.imul(U,Ie)|0,k=k+Math.imul(K,Ce)|0,A=A+Math.imul(K,Ie)|0;var Pt=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,E=Math.imul(V,Ee),k=Math.imul(V,Re),k=k+Math.imul(Q,Ee)|0,A=Math.imul(Q,Re),E=E+Math.imul(J,Ce)|0,k=k+Math.imul(J,Ie)|0,k=k+Math.imul(H,Ce)|0,A=A+Math.imul(H,Ie)|0,E=E+Math.imul(U,Oe)|0,k=k+Math.imul(U,Te)|0,k=k+Math.imul(K,Oe)|0,A=A+Math.imul(K,Te)|0;var or=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(or>>>26)|0,or&=67108863,E=Math.imul(z,Ee),k=Math.imul(z,Re),k=k+Math.imul(L,Ee)|0,A=Math.imul(L,Re),E=E+Math.imul(V,Ce)|0,k=k+Math.imul(V,Ie)|0,k=k+Math.imul(Q,Ce)|0,A=A+Math.imul(Q,Ie)|0,E=E+Math.imul(J,Oe)|0,k=k+Math.imul(J,Te)|0,k=k+Math.imul(H,Oe)|0,A=A+Math.imul(H,Te)|0,E=E+Math.imul(U,Ne)|0,k=k+Math.imul(U,De)|0,k=k+Math.imul(K,Ne)|0,A=A+Math.imul(K,De)|0;var sr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(sr>>>26)|0,sr&=67108863,E=Math.imul(G,Ee),k=Math.imul(G,Re),k=k+Math.imul(Y,Ee)|0,A=Math.imul(Y,Re),E=E+Math.imul(z,Ce)|0,k=k+Math.imul(z,Ie)|0,k=k+Math.imul(L,Ce)|0,A=A+Math.imul(L,Ie)|0,E=E+Math.imul(V,Oe)|0,k=k+Math.imul(V,Te)|0,k=k+Math.imul(Q,Oe)|0,A=A+Math.imul(Q,Te)|0,E=E+Math.imul(J,Ne)|0,k=k+Math.imul(J,De)|0,k=k+Math.imul(H,Ne)|0,A=A+Math.imul(H,De)|0,E=E+Math.imul(U,$e)|0,k=k+Math.imul(U,O)|0,k=k+Math.imul(K,$e)|0,A=A+Math.imul(K,O)|0;var ar=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(ar>>>26)|0,ar&=67108863,E=Math.imul(j,Ee),k=Math.imul(j,Re),k=k+Math.imul(Z,Ee)|0,A=Math.imul(Z,Re),E=E+Math.imul(G,Ce)|0,k=k+Math.imul(G,Ie)|0,k=k+Math.imul(Y,Ce)|0,A=A+Math.imul(Y,Ie)|0,E=E+Math.imul(z,Oe)|0,k=k+Math.imul(z,Te)|0,k=k+Math.imul(L,Oe)|0,A=A+Math.imul(L,Te)|0,E=E+Math.imul(V,Ne)|0,k=k+Math.imul(V,De)|0,k=k+Math.imul(Q,Ne)|0,A=A+Math.imul(Q,De)|0,E=E+Math.imul(J,$e)|0,k=k+Math.imul(J,O)|0,k=k+Math.imul(H,$e)|0,A=A+Math.imul(H,O)|0,E=E+Math.imul(U,X)|0,k=k+Math.imul(U,te)|0,k=k+Math.imul(K,X)|0,A=A+Math.imul(K,te)|0;var ur=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(ur>>>26)|0,ur&=67108863,E=Math.imul(W,Ee),k=Math.imul(W,Re),k=k+Math.imul(re,Ee)|0,A=Math.imul(re,Re),E=E+Math.imul(j,Ce)|0,k=k+Math.imul(j,Ie)|0,k=k+Math.imul(Z,Ce)|0,A=A+Math.imul(Z,Ie)|0,E=E+Math.imul(G,Oe)|0,k=k+Math.imul(G,Te)|0,k=k+Math.imul(Y,Oe)|0,A=A+Math.imul(Y,Te)|0,E=E+Math.imul(z,Ne)|0,k=k+Math.imul(z,De)|0,k=k+Math.imul(L,Ne)|0,A=A+Math.imul(L,De)|0,E=E+Math.imul(V,$e)|0,k=k+Math.imul(V,O)|0,k=k+Math.imul(Q,$e)|0,A=A+Math.imul(Q,O)|0,E=E+Math.imul(J,X)|0,k=k+Math.imul(J,te)|0,k=k+Math.imul(H,X)|0,A=A+Math.imul(H,te)|0,E=E+Math.imul(U,me)|0,k=k+Math.imul(U,we)|0,k=k+Math.imul(K,me)|0,A=A+Math.imul(K,we)|0;var lr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(lr>>>26)|0,lr&=67108863,E=Math.imul(ge,Ee),k=Math.imul(ge,Re),k=k+Math.imul(ye,Ee)|0,A=Math.imul(ye,Re),E=E+Math.imul(W,Ce)|0,k=k+Math.imul(W,Ie)|0,k=k+Math.imul(re,Ce)|0,A=A+Math.imul(re,Ie)|0,E=E+Math.imul(j,Oe)|0,k=k+Math.imul(j,Te)|0,k=k+Math.imul(Z,Oe)|0,A=A+Math.imul(Z,Te)|0,E=E+Math.imul(G,Ne)|0,k=k+Math.imul(G,De)|0,k=k+Math.imul(Y,Ne)|0,A=A+Math.imul(Y,De)|0,E=E+Math.imul(z,$e)|0,k=k+Math.imul(z,O)|0,k=k+Math.imul(L,$e)|0,A=A+Math.imul(L,O)|0,E=E+Math.imul(V,X)|0,k=k+Math.imul(V,te)|0,k=k+Math.imul(Q,X)|0,A=A+Math.imul(Q,te)|0,E=E+Math.imul(J,me)|0,k=k+Math.imul(J,we)|0,k=k+Math.imul(H,me)|0,A=A+Math.imul(H,we)|0,E=E+Math.imul(U,Pe)|0,k=k+Math.imul(U,ze)|0,k=k+Math.imul(K,Pe)|0,A=A+Math.imul(K,ze)|0;var cr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(cr>>>26)|0,cr&=67108863,E=Math.imul(pe,Ee),k=Math.imul(pe,Re),k=k+Math.imul(ve,Ee)|0,A=Math.imul(ve,Re),E=E+Math.imul(ge,Ce)|0,k=k+Math.imul(ge,Ie)|0,k=k+Math.imul(ye,Ce)|0,A=A+Math.imul(ye,Ie)|0,E=E+Math.imul(W,Oe)|0,k=k+Math.imul(W,Te)|0,k=k+Math.imul(re,Oe)|0,A=A+Math.imul(re,Te)|0,E=E+Math.imul(j,Ne)|0,k=k+Math.imul(j,De)|0,k=k+Math.imul(Z,Ne)|0,A=A+Math.imul(Z,De)|0,E=E+Math.imul(G,$e)|0,k=k+Math.imul(G,O)|0,k=k+Math.imul(Y,$e)|0,A=A+Math.imul(Y,O)|0,E=E+Math.imul(z,X)|0,k=k+Math.imul(z,te)|0,k=k+Math.imul(L,X)|0,A=A+Math.imul(L,te)|0,E=E+Math.imul(V,me)|0,k=k+Math.imul(V,we)|0,k=k+Math.imul(Q,me)|0,A=A+Math.imul(Q,we)|0,E=E+Math.imul(J,Pe)|0,k=k+Math.imul(J,ze)|0,k=k+Math.imul(H,Pe)|0,A=A+Math.imul(H,ze)|0,E=E+Math.imul(U,Ae)|0,k=k+Math.imul(U,ke)|0,k=k+Math.imul(K,Ae)|0,A=A+Math.imul(K,ke)|0;var dr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(dr>>>26)|0,dr&=67108863,E=Math.imul(xe,Ee),k=Math.imul(xe,Re),k=k+Math.imul(Se,Ee)|0,A=Math.imul(Se,Re),E=E+Math.imul(pe,Ce)|0,k=k+Math.imul(pe,Ie)|0,k=k+Math.imul(ve,Ce)|0,A=A+Math.imul(ve,Ie)|0,E=E+Math.imul(ge,Oe)|0,k=k+Math.imul(ge,Te)|0,k=k+Math.imul(ye,Oe)|0,A=A+Math.imul(ye,Te)|0,E=E+Math.imul(W,Ne)|0,k=k+Math.imul(W,De)|0,k=k+Math.imul(re,Ne)|0,A=A+Math.imul(re,De)|0,E=E+Math.imul(j,$e)|0,k=k+Math.imul(j,O)|0,k=k+Math.imul(Z,$e)|0,A=A+Math.imul(Z,O)|0,E=E+Math.imul(G,X)|0,k=k+Math.imul(G,te)|0,k=k+Math.imul(Y,X)|0,A=A+Math.imul(Y,te)|0,E=E+Math.imul(z,me)|0,k=k+Math.imul(z,we)|0,k=k+Math.imul(L,me)|0,A=A+Math.imul(L,we)|0,E=E+Math.imul(V,Pe)|0,k=k+Math.imul(V,ze)|0,k=k+Math.imul(Q,Pe)|0,A=A+Math.imul(Q,ze)|0,E=E+Math.imul(J,Ae)|0,k=k+Math.imul(J,ke)|0,k=k+Math.imul(H,Ae)|0,A=A+Math.imul(H,ke)|0,E=E+Math.imul(U,pt)|0,k=k+Math.imul(U,dt)|0,k=k+Math.imul(K,pt)|0,A=A+Math.imul(K,dt)|0;var fr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(fr>>>26)|0,fr&=67108863,E=Math.imul(xe,Ce),k=Math.imul(xe,Ie),k=k+Math.imul(Se,Ce)|0,A=Math.imul(Se,Ie),E=E+Math.imul(pe,Oe)|0,k=k+Math.imul(pe,Te)|0,k=k+Math.imul(ve,Oe)|0,A=A+Math.imul(ve,Te)|0,E=E+Math.imul(ge,Ne)|0,k=k+Math.imul(ge,De)|0,k=k+Math.imul(ye,Ne)|0,A=A+Math.imul(ye,De)|0,E=E+Math.imul(W,$e)|0,k=k+Math.imul(W,O)|0,k=k+Math.imul(re,$e)|0,A=A+Math.imul(re,O)|0,E=E+Math.imul(j,X)|0,k=k+Math.imul(j,te)|0,k=k+Math.imul(Z,X)|0,A=A+Math.imul(Z,te)|0,E=E+Math.imul(G,me)|0,k=k+Math.imul(G,we)|0,k=k+Math.imul(Y,me)|0,A=A+Math.imul(Y,we)|0,E=E+Math.imul(z,Pe)|0,k=k+Math.imul(z,ze)|0,k=k+Math.imul(L,Pe)|0,A=A+Math.imul(L,ze)|0,E=E+Math.imul(V,Ae)|0,k=k+Math.imul(V,ke)|0,k=k+Math.imul(Q,Ae)|0,A=A+Math.imul(Q,ke)|0,E=E+Math.imul(J,pt)|0,k=k+Math.imul(J,dt)|0,k=k+Math.imul(H,pt)|0,A=A+Math.imul(H,dt)|0;var hr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(hr>>>26)|0,hr&=67108863,E=Math.imul(xe,Oe),k=Math.imul(xe,Te),k=k+Math.imul(Se,Oe)|0,A=Math.imul(Se,Te),E=E+Math.imul(pe,Ne)|0,k=k+Math.imul(pe,De)|0,k=k+Math.imul(ve,Ne)|0,A=A+Math.imul(ve,De)|0,E=E+Math.imul(ge,$e)|0,k=k+Math.imul(ge,O)|0,k=k+Math.imul(ye,$e)|0,A=A+Math.imul(ye,O)|0,E=E+Math.imul(W,X)|0,k=k+Math.imul(W,te)|0,k=k+Math.imul(re,X)|0,A=A+Math.imul(re,te)|0,E=E+Math.imul(j,me)|0,k=k+Math.imul(j,we)|0,k=k+Math.imul(Z,me)|0,A=A+Math.imul(Z,we)|0,E=E+Math.imul(G,Pe)|0,k=k+Math.imul(G,ze)|0,k=k+Math.imul(Y,Pe)|0,A=A+Math.imul(Y,ze)|0,E=E+Math.imul(z,Ae)|0,k=k+Math.imul(z,ke)|0,k=k+Math.imul(L,Ae)|0,A=A+Math.imul(L,ke)|0,E=E+Math.imul(V,pt)|0,k=k+Math.imul(V,dt)|0,k=k+Math.imul(Q,pt)|0,A=A+Math.imul(Q,dt)|0;var pr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(pr>>>26)|0,pr&=67108863,E=Math.imul(xe,Ne),k=Math.imul(xe,De),k=k+Math.imul(Se,Ne)|0,A=Math.imul(Se,De),E=E+Math.imul(pe,$e)|0,k=k+Math.imul(pe,O)|0,k=k+Math.imul(ve,$e)|0,A=A+Math.imul(ve,O)|0,E=E+Math.imul(ge,X)|0,k=k+Math.imul(ge,te)|0,k=k+Math.imul(ye,X)|0,A=A+Math.imul(ye,te)|0,E=E+Math.imul(W,me)|0,k=k+Math.imul(W,we)|0,k=k+Math.imul(re,me)|0,A=A+Math.imul(re,we)|0,E=E+Math.imul(j,Pe)|0,k=k+Math.imul(j,ze)|0,k=k+Math.imul(Z,Pe)|0,A=A+Math.imul(Z,ze)|0,E=E+Math.imul(G,Ae)|0,k=k+Math.imul(G,ke)|0,k=k+Math.imul(Y,Ae)|0,A=A+Math.imul(Y,ke)|0,E=E+Math.imul(z,pt)|0,k=k+Math.imul(z,dt)|0,k=k+Math.imul(L,pt)|0,A=A+Math.imul(L,dt)|0;var mr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(mr>>>26)|0,mr&=67108863,E=Math.imul(xe,$e),k=Math.imul(xe,O),k=k+Math.imul(Se,$e)|0,A=Math.imul(Se,O),E=E+Math.imul(pe,X)|0,k=k+Math.imul(pe,te)|0,k=k+Math.imul(ve,X)|0,A=A+Math.imul(ve,te)|0,E=E+Math.imul(ge,me)|0,k=k+Math.imul(ge,we)|0,k=k+Math.imul(ye,me)|0,A=A+Math.imul(ye,we)|0,E=E+Math.imul(W,Pe)|0,k=k+Math.imul(W,ze)|0,k=k+Math.imul(re,Pe)|0,A=A+Math.imul(re,ze)|0,E=E+Math.imul(j,Ae)|0,k=k+Math.imul(j,ke)|0,k=k+Math.imul(Z,Ae)|0,A=A+Math.imul(Z,ke)|0,E=E+Math.imul(G,pt)|0,k=k+Math.imul(G,dt)|0,k=k+Math.imul(Y,pt)|0,A=A+Math.imul(Y,dt)|0;var gr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(gr>>>26)|0,gr&=67108863,E=Math.imul(xe,X),k=Math.imul(xe,te),k=k+Math.imul(Se,X)|0,A=Math.imul(Se,te),E=E+Math.imul(pe,me)|0,k=k+Math.imul(pe,we)|0,k=k+Math.imul(ve,me)|0,A=A+Math.imul(ve,we)|0,E=E+Math.imul(ge,Pe)|0,k=k+Math.imul(ge,ze)|0,k=k+Math.imul(ye,Pe)|0,A=A+Math.imul(ye,ze)|0,E=E+Math.imul(W,Ae)|0,k=k+Math.imul(W,ke)|0,k=k+Math.imul(re,Ae)|0,A=A+Math.imul(re,ke)|0,E=E+Math.imul(j,pt)|0,k=k+Math.imul(j,dt)|0,k=k+Math.imul(Z,pt)|0,A=A+Math.imul(Z,dt)|0;var yr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(yr>>>26)|0,yr&=67108863,E=Math.imul(xe,me),k=Math.imul(xe,we),k=k+Math.imul(Se,me)|0,A=Math.imul(Se,we),E=E+Math.imul(pe,Pe)|0,k=k+Math.imul(pe,ze)|0,k=k+Math.imul(ve,Pe)|0,A=A+Math.imul(ve,ze)|0,E=E+Math.imul(ge,Ae)|0,k=k+Math.imul(ge,ke)|0,k=k+Math.imul(ye,Ae)|0,A=A+Math.imul(ye,ke)|0,E=E+Math.imul(W,pt)|0,k=k+Math.imul(W,dt)|0,k=k+Math.imul(re,pt)|0,A=A+Math.imul(re,dt)|0;var vr=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(vr>>>26)|0,vr&=67108863,E=Math.imul(xe,Pe),k=Math.imul(xe,ze),k=k+Math.imul(Se,Pe)|0,A=Math.imul(Se,ze),E=E+Math.imul(pe,Ae)|0,k=k+Math.imul(pe,ke)|0,k=k+Math.imul(ve,Ae)|0,A=A+Math.imul(ve,ke)|0,E=E+Math.imul(ge,pt)|0,k=k+Math.imul(ge,dt)|0,k=k+Math.imul(ye,pt)|0,A=A+Math.imul(ye,dt)|0;var Kp=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(Kp>>>26)|0,Kp&=67108863,E=Math.imul(xe,Ae),k=Math.imul(xe,ke),k=k+Math.imul(Se,Ae)|0,A=Math.imul(Se,ke),E=E+Math.imul(pe,pt)|0,k=k+Math.imul(pe,dt)|0,k=k+Math.imul(ve,pt)|0,A=A+Math.imul(ve,dt)|0;var Vp=(m+E|0)+((k&8191)<<13)|0;m=(A+(k>>>13)|0)+(Vp>>>26)|0,Vp&=67108863,E=Math.imul(xe,pt),k=Math.imul(xe,dt),k=k+Math.imul(Se,pt)|0,A=Math.imul(Se,dt);var Wp=(m+E|0)+((k&8191)<<13)|0;if(m=(A+(k>>>13)|0)+(Wp>>>26)|0,Wp&=67108863,u[0]=Dt,u[1]=Pt,u[2]=or,u[3]=sr,u[4]=ar,u[5]=ur,u[6]=lr,u[7]=cr,u[8]=dr,u[9]=fr,u[10]=hr,u[11]=pr,u[12]=mr,u[13]=gr,u[14]=yr,u[15]=vr,u[16]=Kp,u[17]=Vp,u[18]=Wp,m!==0)u[19]=m,y.length++;return y};if(!Math.imul)R=P;function C(l,d,y){y.negative=d.negative^l.negative,y.length=l.length+d.length;var w=0,p=0;for(var u=0;u<y.length-1;u++){var m=p;p=0;var E=w&67108863,k=Math.min(u,d.length-1);for(var A=Math.max(0,u-l.length+1);A<=k;A++){var N=u-A,U=l.words[N]|0,K=d.words[A]|0,he=U*K,J=he&67108863;m=m+(he/67108864|0)|0,J=J+E|0,E=J&67108863,m=m+(J>>>26)|0,p+=m>>>26,m&=67108863}y.words[u]=E,w=m,m=p}if(w!==0)y.words[u]=w;else y.length--;return y._strip()}function D(l,d,y){return C(l,d,y)}s.prototype.mulTo=function(l,d){var y,w=this.length+l.length;if(this.length===10&&l.length===10)y=R(this,l,d);else if(w<63)y=P(this,l,d);else if(w<1024)y=C(this,l,d);else y=D(this,l,d);return y};function B(l,d){this.x=l,this.y=d}B.prototype.makeRBT=function(l){var d=Array(l),y=s.prototype._countBits(l)-1;for(var w=0;w<l;w++)d[w]=this.revBin(w,y,l);return d},B.prototype.revBin=function(l,d,y){if(l===0||l===y-1)return l;var w=0;for(var p=0;p<d;p++)w|=(l&1)<<d-p-1,l>>=1;return w},B.prototype.permute=function(l,d,y,w,p,u){for(var m=0;m<u;m++)w[m]=d[l[m]],p[m]=y[l[m]]},B.prototype.transform=function(l,d,y,w,p,u){this.permute(u,l,d,y,w,p);for(var m=1;m<p;m<<=1){var E=m<<1,k=Math.cos(2*Math.PI/E),A=Math.sin(2*Math.PI/E);for(var N=0;N<p;N+=E){var U=k,K=A;for(var he=0;he<m;he++){var J=y[N+he],H=w[N+he],se=y[N+he+m],V=w[N+he+m],Q=U*se-K*V;if(V=U*V+K*se,se=Q,y[N+he]=J+se,w[N+he]=H+V,y[N+he+m]=J-se,w[N+he+m]=H-V,he!==E)Q=k*U-A*K,K=k*K+A*U,U=Q}}}},B.prototype.guessLen13b=function(l,d){var y=Math.max(d,l)|1,w=y&1,p=0;for(y=y/2|0;y;y=y>>>1)p++;return 1<<p+1+w},B.prototype.conjugate=function(l,d,y){if(y<=1)return;for(var w=0;w<y/2;w++){var p=l[w];l[w]=l[y-w-1],l[y-w-1]=p,p=d[w],d[w]=-d[y-w-1],d[y-w-1]=-p}},B.prototype.normalize13b=function(l,d){var y=0;for(var w=0;w<d/2;w++){var p=Math.round(l[2*w+1]/d)*8192+Math.round(l[2*w]/d)+y;if(l[w]=p&67108863,p<67108864)y=0;else y=p/67108864|0}return l},B.prototype.convert13b=function(l,d,y,w){var p=0;for(var u=0;u<d;u++)p=p+(l[u]|0),y[2*u]=p&8191,p=p>>>13,y[2*u+1]=p&8191,p=p>>>13;for(u=2*d;u<w;++u)y[u]=0;n(p===0),n((p&-8192)===0)},B.prototype.stub=function(l){var d=Array(l);for(var y=0;y<l;y++)d[y]=0;return d},B.prototype.mulp=function(l,d,y){var w=2*this.guessLen13b(l.length,d.length),p=this.makeRBT(w),u=this.stub(w),m=Array(w),E=Array(w),k=Array(w),A=Array(w),N=Array(w),U=Array(w),K=y.words;K.length=w,this.convert13b(l.words,l.length,m,w),this.convert13b(d.words,d.length,A,w),this.transform(m,u,E,k,w,p),this.transform(A,u,N,U,w,p);for(var he=0;he<w;he++){var J=E[he]*N[he]-k[he]*U[he];k[he]=E[he]*U[he]+k[he]*N[he],E[he]=J}return this.conjugate(E,k,w),this.transform(E,k,K,u,w,p),this.conjugate(K,u,w),this.normalize13b(K,w),y.negative=l.negative^d.negative,y.length=l.length+d.length,y._strip()},s.prototype.mul=function(l){var d=new s(null);return d.words=Array(this.length+l.length),this.mulTo(l,d)},s.prototype.mulf=function(l){var d=new s(null);return d.words=Array(this.length+l.length),D(this,l,d)},s.prototype.imul=function(l){return this.clone().mulTo(l,this)},s.prototype.imuln=function(l){var d=l<0;if(d)l=-l;n(typeof l==="number"),n(l<67108864);var y=0;for(var w=0;w<this.length;w++){var p=(this.words[w]|0)*l,u=(p&67108863)+(y&67108863);y>>=26,y+=p/67108864|0,y+=u>>>26,this.words[w]=u&67108863}if(y!==0)this.words[w]=y,this.length++;return this.length=l===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(l){return this.clone().imuln(l)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(l){var d=$(l);if(d.length===0)return new s(1);var y=this;for(var w=0;w<d.length;w++,y=y.sqr())if(d[w]!==0)break;if(++w<d.length)for(var p=y.sqr();w<d.length;w++,p=p.sqr()){if(d[w]===0)continue;y=y.mul(p)}return y},s.prototype.iushln=function(l){n(typeof l==="number"&&l>=0);var d=l%26,y=(l-d)/26,w=67108863>>>26-d<<26-d,p;if(d!==0){var u=0;for(p=0;p<this.length;p++){var m=this.words[p]&w,E=(this.words[p]|0)-m<<d;this.words[p]=E|u,u=m>>>26-d}if(u)this.words[p]=u,this.length++}if(y!==0){for(p=this.length-1;p>=0;p--)this.words[p+y]=this.words[p];for(p=0;p<y;p++)this.words[p]=0;this.length+=y}return this._strip()},s.prototype.ishln=function(l){return n(this.negative===0),this.iushln(l)},s.prototype.iushrn=function(l,d,y){n(typeof l==="number"&&l>=0);var w;if(d)w=(d-d%26)/26;else w=0;var p=l%26,u=Math.min((l-p)/26,this.length),m=67108863^67108863>>>p<<p,E=y;if(w-=u,w=Math.max(0,w),E){for(var k=0;k<u;k++)E.words[k]=this.words[k];E.length=u}if(u===0);else if(this.length>u){this.length-=u;for(k=0;k<this.length;k++)this.words[k]=this.words[k+u]}else this.words[0]=0,this.length=1;var A=0;for(k=this.length-1;k>=0&&(A!==0||k>=w);k--){var N=this.words[k]|0;this.words[k]=A<<26-p|N>>>p,A=N&m}if(E&&A!==0)E.words[E.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},s.prototype.ishrn=function(l,d,y){return n(this.negative===0),this.iushrn(l,d,y)},s.prototype.shln=function(l){return this.clone().ishln(l)},s.prototype.ushln=function(l){return this.clone().iushln(l)},s.prototype.shrn=function(l){return this.clone().ishrn(l)},s.prototype.ushrn=function(l){return this.clone().iushrn(l)},s.prototype.testn=function(l){n(typeof l==="number"&&l>=0);var d=l%26,y=(l-d)/26,w=1<<d;if(this.length<=y)return!1;var p=this.words[y];return!!(p&w)},s.prototype.imaskn=function(l){n(typeof l==="number"&&l>=0);var d=l%26,y=(l-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(d!==0)y++;if(this.length=Math.min(y,this.length),d!==0){var w=67108863^67108863>>>d<<d;this.words[this.length-1]&=w}return this._strip()},s.prototype.maskn=function(l){return this.clone().imaskn(l)},s.prototype.iaddn=function(l){if(n(typeof l==="number"),n(l<67108864),l<0)return this.isubn(-l);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=l)return this.words[0]=l-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(l),this.negative=1,this}return this._iaddn(l)},s.prototype._iaddn=function(l){this.words[0]+=l;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)if(this.words[d]-=67108864,d===this.length-1)this.words[d+1]=1;else this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(l){if(n(typeof l==="number"),n(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(l){return this.clone().iaddn(l)},s.prototype.subn=function(l){return this.clone().isubn(l)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(l,d,y){var w=l.length+y,p;this._expand(w);var u,m=0;for(p=0;p<l.length;p++){u=(this.words[p+y]|0)+m;var E=(l.words[p]|0)*d;u-=E&67108863,m=(u>>26)-(E/67108864|0),this.words[p+y]=u&67108863}for(;p<this.length-y;p++)u=(this.words[p+y]|0)+m,m=u>>26,this.words[p+y]=u&67108863;if(m===0)return this._strip();n(m===-1),m=0;for(p=0;p<this.length;p++)u=-(this.words[p]|0)+m,m=u>>26,this.words[p]=u&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(l,d){var y=this.length-l.length,w=this.clone(),p=l,u=p.words[p.length-1]|0,m=this._countBits(u);if(y=26-m,y!==0)p=p.ushln(y),w.iushln(y),u=p.words[p.length-1]|0;var E=w.length-p.length,k;if(d!=="mod"){k=new s(null),k.length=E+1,k.words=Array(k.length);for(var A=0;A<k.length;A++)k.words[A]=0}var N=w.clone()._ishlnsubmul(p,1,E);if(N.negative===0){if(w=N,k)k.words[E]=1}for(var U=E-1;U>=0;U--){var K=(w.words[p.length+U]|0)*67108864+(w.words[p.length+U-1]|0);K=Math.min(K/u|0,67108863),w._ishlnsubmul(p,K,U);while(w.negative!==0)if(K--,w.negative=0,w._ishlnsubmul(p,1,U),!w.isZero())w.negative^=1;if(k)k.words[U]=K}if(k)k._strip();if(w._strip(),d!=="div"&&y!==0)w.iushrn(y);return{div:k||null,mod:w}},s.prototype.divmod=function(l,d,y){if(n(!l.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var w,p,u;if(this.negative!==0&&l.negative===0){if(u=this.neg().divmod(l,d),d!=="mod")w=u.div.neg();if(d!=="div"){if(p=u.mod.neg(),y&&p.negative!==0)p.iadd(l)}return{div:w,mod:p}}if(this.negative===0&&l.negative!==0){if(u=this.divmod(l.neg(),d),d!=="mod")w=u.div.neg();return{div:w,mod:u.mod}}if((this.negative&l.negative)!==0){if(u=this.neg().divmod(l.neg(),d),d!=="div"){if(p=u.mod.neg(),y&&p.negative!==0)p.isub(l)}return{div:u.div,mod:p}}if(l.length>this.length||this.cmp(l)<0)return{div:new s(0),mod:this};if(l.length===1){if(d==="div")return{div:this.divn(l.words[0]),mod:null};if(d==="mod")return{div:null,mod:new s(this.modrn(l.words[0]))};return{div:this.divn(l.words[0]),mod:new s(this.modrn(l.words[0]))}}return this._wordDiv(l,d)},s.prototype.div=function(l){return this.divmod(l,"div",!1).div},s.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},s.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},s.prototype.divRound=function(l){var d=this.divmod(l);if(d.mod.isZero())return d.div;var y=d.div.negative!==0?d.mod.isub(l):d.mod,w=l.ushrn(1),p=l.andln(1),u=y.cmp(w);if(u<0||p===1&&u===0)return d.div;return d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(l){var d=l<0;if(d)l=-l;n(l<=67108863);var y=67108864%l,w=0;for(var p=this.length-1;p>=0;p--)w=(y*w+(this.words[p]|0))%l;return d?-w:w},s.prototype.modn=function(l){return this.modrn(l)},s.prototype.idivn=function(l){var d=l<0;if(d)l=-l;n(l<=67108863);var y=0;for(var w=this.length-1;w>=0;w--){var p=(this.words[w]|0)+y*67108864;this.words[w]=p/l|0,y=p%l}return this._strip(),d?this.ineg():this},s.prototype.divn=function(l){return this.clone().idivn(l)},s.prototype.egcd=function(l){n(l.negative===0),n(!l.isZero());var d=this,y=l.clone();if(d.negative!==0)d=d.umod(l);else d=d.clone();var w=new s(1),p=new s(0),u=new s(0),m=new s(1),E=0;while(d.isEven()&&y.isEven())d.iushrn(1),y.iushrn(1),++E;var k=y.clone(),A=d.clone();while(!d.isZero()){for(var N=0,U=1;(d.words[0]&U)===0&&N<26;++N,U<<=1);if(N>0){d.iushrn(N);while(N-- >0){if(w.isOdd()||p.isOdd())w.iadd(k),p.isub(A);w.iushrn(1),p.iushrn(1)}}for(var K=0,he=1;(y.words[0]&he)===0&&K<26;++K,he<<=1);if(K>0){y.iushrn(K);while(K-- >0){if(u.isOdd()||m.isOdd())u.iadd(k),m.isub(A);u.iushrn(1),m.iushrn(1)}}if(d.cmp(y)>=0)d.isub(y),w.isub(u),p.isub(m);else y.isub(d),u.isub(w),m.isub(p)}return{a:u,b:m,gcd:y.iushln(E)}},s.prototype._invmp=function(l){n(l.negative===0),n(!l.isZero());var d=this,y=l.clone();if(d.negative!==0)d=d.umod(l);else d=d.clone();var w=new s(1),p=new s(0),u=y.clone();while(d.cmpn(1)>0&&y.cmpn(1)>0){for(var m=0,E=1;(d.words[0]&E)===0&&m<26;++m,E<<=1);if(m>0){d.iushrn(m);while(m-- >0){if(w.isOdd())w.iadd(u);w.iushrn(1)}}for(var k=0,A=1;(y.words[0]&A)===0&&k<26;++k,A<<=1);if(k>0){y.iushrn(k);while(k-- >0){if(p.isOdd())p.iadd(u);p.iushrn(1)}}if(d.cmp(y)>=0)d.isub(y),w.isub(p);else y.isub(d),p.isub(w)}var N;if(d.cmpn(1)===0)N=w;else N=p;if(N.cmpn(0)<0)N.iadd(l);return N},s.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var d=this.clone(),y=l.clone();d.negative=0,y.negative=0;for(var w=0;d.isEven()&&y.isEven();w++)d.iushrn(1),y.iushrn(1);do{while(d.isEven())d.iushrn(1);while(y.isEven())y.iushrn(1);var p=d.cmp(y);if(p<0){var u=d;d=y,y=u}else if(p===0||y.cmpn(1)===0)break;d.isub(y)}while(!0);return y.iushln(w)},s.prototype.invm=function(l){return this.egcd(l).a.umod(l)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(l){return this.words[0]&l},s.prototype.bincn=function(l){n(typeof l==="number");var d=l%26,y=(l-d)/26,w=1<<d;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;var p=w;for(var u=y;p!==0&&u<this.length;u++){var m=this.words[u]|0;m+=p,p=m>>>26,m&=67108863,this.words[u]=m}if(p!==0)this.words[u]=p,this.length++;return this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(l){var d=l<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var y;if(this.length>1)y=1;else{if(d)l=-l;n(l<=67108863,"Number is too big");var w=this.words[0]|0;y=w===l?0:w<l?-1:1}if(this.negative!==0)return-y|0;return y},s.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var d=this.ucmp(l);if(this.negative!==0)return-d|0;return d},s.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;var d=0;for(var y=this.length-1;y>=0;y--){var w=this.words[y]|0,p=l.words[y]|0;if(w===p)continue;if(w<p)d=-1;else if(w>p)d=1;break}return d},s.prototype.gtn=function(l){return this.cmpn(l)===1},s.prototype.gt=function(l){return this.cmp(l)===1},s.prototype.gten=function(l){return this.cmpn(l)>=0},s.prototype.gte=function(l){return this.cmp(l)>=0},s.prototype.ltn=function(l){return this.cmpn(l)===-1},s.prototype.lt=function(l){return this.cmp(l)===-1},s.prototype.lten=function(l){return this.cmpn(l)<=0},s.prototype.lte=function(l){return this.cmp(l)<=0},s.prototype.eqn=function(l){return this.cmpn(l)===0},s.prototype.eq=function(l){return this.cmp(l)===0},s.red=function(l){return new c(l)},s.prototype.toRed=function(l){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(l){return this.red=l,this},s.prototype.forceRed=function(l){return n(!this.red,"Already a number in reduction context"),this._forceRed(l)},s.prototype.redAdd=function(l){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},s.prototype.redIAdd=function(l){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},s.prototype.redSub=function(l){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},s.prototype.redISub=function(l){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},s.prototype.redShl=function(l){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},s.prototype.redMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},s.prototype.redIMul=function(l){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(l){return n(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var ie={k256:null,p224:null,p192:null,p25519:null};function le(l,d){this.name=l,this.p=new s(d,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}le.prototype._tmp=function(){var l=new s(null);return l.words=Array(Math.ceil(this.n/13)),l},le.prototype.ireduce=function(l){var d=l,y;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),y=d.bitLength();while(y>this.n);var w=y<this.n?-1:d.ucmp(this.p);if(w===0)d.words[0]=0,d.length=1;else if(w>0)d.isub(this.p);else if(d.strip!==void 0)d.strip();else d._strip();return d},le.prototype.split=function(l,d){l.iushrn(this.n,0,d)},le.prototype.imulK=function(l){return l.imul(this.k)};function ue(){le.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(ue,le),ue.prototype.split=function(l,d){var y=4194303,w=Math.min(l.length,9);for(var p=0;p<w;p++)d.words[p]=l.words[p];if(d.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var u=l.words[9];d.words[d.length++]=u&y;for(p=10;p<l.length;p++){var m=l.words[p]|0;l.words[p-10]=(m&y)<<4|u>>>22,u=m}if(u>>>=22,l.words[p-10]=u,u===0&&l.length>10)l.length-=10;else l.length-=9},ue.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;var d=0;for(var y=0;y<l.length;y++){var w=l.words[y]|0;d+=w*977,l.words[y]=d&67108863,d=w*64+(d/67108864|0)}if(l.words[l.length-1]===0){if(l.length--,l.words[l.length-1]===0)l.length--}return l};function q(){le.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(q,le);function ee(){le.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(ee,le);function a(){le.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(a,le),a.prototype.imulK=function(l){var d=0;for(var y=0;y<l.length;y++){var w=(l.words[y]|0)*19+d,p=w&67108863;w>>>=26,l.words[y]=p,d=w}if(d!==0)l.words[l.length++]=d;return l},s._prime=function(l){if(ie[l])return ie[l];var d;if(l==="k256")d=new ue;else if(l==="p224")d=new q;else if(l==="p192")d=new ee;else if(l==="p25519")d=new a;else throw Error("Unknown prime "+l);return ie[l]=d,d};function c(l){if(typeof l==="string"){var d=s._prime(l);this.m=d.p,this.prime=d}else n(l.gtn(1),"modulus must be greater than 1"),this.m=l,this.prime=null}c.prototype._verify1=function(l){n(l.negative===0,"red works only with positives"),n(l.red,"red works only with red numbers")},c.prototype._verify2=function(l,d){n((l.negative|d.negative)===0,"red works only with positives"),n(l.red&&l.red===d.red,"red works only with red numbers")},c.prototype.imod=function(l){if(this.prime)return this.prime.ireduce(l)._forceRed(this);return g(l,l.umod(this.m)._forceRed(this)),l},c.prototype.neg=function(l){if(l.isZero())return l.clone();return this.m.sub(l)._forceRed(this)},c.prototype.add=function(l,d){this._verify2(l,d);var y=l.add(d);if(y.cmp(this.m)>=0)y.isub(this.m);return y._forceRed(this)},c.prototype.iadd=function(l,d){this._verify2(l,d);var y=l.iadd(d);if(y.cmp(this.m)>=0)y.isub(this.m);return y},c.prototype.sub=function(l,d){this._verify2(l,d);var y=l.sub(d);if(y.cmpn(0)<0)y.iadd(this.m);return y._forceRed(this)},c.prototype.isub=function(l,d){this._verify2(l,d);var y=l.isub(d);if(y.cmpn(0)<0)y.iadd(this.m);return y},c.prototype.shl=function(l,d){return this._verify1(l),this.imod(l.ushln(d))},c.prototype.imul=function(l,d){return this._verify2(l,d),this.imod(l.imul(d))},c.prototype.mul=function(l,d){return this._verify2(l,d),this.imod(l.mul(d))},c.prototype.isqr=function(l){return this.imul(l,l.clone())},c.prototype.sqr=function(l){return this.mul(l,l)},c.prototype.sqrt=function(l){if(l.isZero())return l.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(l,y)}var w=this.m.subn(1),p=0;while(!w.isZero()&&w.andln(1)===0)p++,w.iushrn(1);n(!w.isZero());var u=new s(1).toRed(this),m=u.redNeg(),E=this.m.subn(1).iushrn(1),k=this.m.bitLength();k=new s(2*k*k).toRed(this);while(this.pow(k,E).cmp(m)!==0)k.redIAdd(m);var A=this.pow(k,w),N=this.pow(l,w.addn(1).iushrn(1)),U=this.pow(l,w),K=p;while(U.cmp(u)!==0){var he=U;for(var J=0;he.cmp(u)!==0;J++)he=he.redSqr();n(J<K);var H=this.pow(A,new s(1).iushln(K-J-1));N=N.redMul(H),A=H.redSqr(),U=U.redMul(A),K=J}return N},c.prototype.invm=function(l){var d=l._invmp(this.m);if(d.negative!==0)return d.negative=0,this.imod(d).redNeg();else return this.imod(d)},c.prototype.pow=function(l,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return l.clone();var y=4,w=Array(1<<y);w[0]=new s(1).toRed(this),w[1]=l;for(var p=2;p<w.length;p++)w[p]=this.mul(w[p-1],l);var u=w[0],m=0,E=0,k=d.bitLength()%26;if(k===0)k=26;for(p=d.length-1;p>=0;p--){var A=d.words[p];for(var N=k-1;N>=0;N--){var U=A>>N&1;if(u!==w[0])u=this.sqr(u);if(U===0&&m===0){E=0;continue}if(m<<=1,m|=U,E++,E!==y&&(p!==0||N!==0))continue;u=this.mul(u,w[m]),E=0,m=0}k=26}return u},c.prototype.convertTo=function(l){var d=l.umod(this.m);return d===l?d.clone():d},c.prototype.convertFrom=function(l){var d=l.clone();return d.red=null,d},s.mont=function(l){return new f(l)};function f(l){if(c.call(this,l),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new s(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)}o(f,c),f.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},f.prototype.convertFrom=function(l){var d=this.imod(l.mul(this.rinv));return d.red=null,d},f.prototype.imul=function(l,d){if(l.isZero()||d.isZero())return l.words[0]=0,l.length=1,l;var y=l.imul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=y.isub(w).iushrn(this.shift),u=p;if(p.cmp(this.m)>=0)u=p.isub(this.m);else if(p.cmpn(0)<0)u=p.iadd(this.m);return u._forceRed(this)},f.prototype.mul=function(l,d){if(l.isZero()||d.isZero())return new s(0)._forceRed(this);var y=l.mul(d),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),p=y.isub(w).iushrn(this.shift),u=p;if(p.cmp(this.m)>=0)u=p.isub(this.m);else if(p.cmpn(0)<0)u=p.iadd(this.m);return u._forceRed(this)},f.prototype.invm=function(l){var d=this.imod(l._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(typeof t>"u"||t,e)}),Rw=ce((e,t)=>{var r=oP(),i=zc(),n=Br().Buffer;function o(b){var v=b.modulus.byteLength(),_;do _=new r(i(v));while(_.cmp(b.modulus)>=0||!_.umod(b.prime1)||!_.umod(b.prime2));return _}function s(b){var v=o(b),_=v.toRed(r.mont(b.modulus)).redPow(new r(b.publicExponent)).fromRed();return{blinder:_,unblinder:v.invm(b.modulus)}}function h(b,v){var _=s(v),g=v.modulus.byteLength(),S=new r(b).mul(_.blinder).umod(v.modulus),x=S.toRed(r.mont(v.prime1)),M=S.toRed(r.mont(v.prime2)),I=v.coefficient,T=v.prime1,$=v.prime2,P=x.redPow(v.exponent1).fromRed(),R=M.redPow(v.exponent2).fromRed(),C=P.isub(R).imul(I).umod(T).imul($);return R.iadd(C).imul(_.unblinder).umod(v.modulus).toArrayLike(n,"be",g)}h.getr=o,t.exports=h}),sP=ce((e,t)=>{var r=Tw(),i=zc(),n=jc(),o=$w(),s=Pw(),h=Rm(),b=Aw(),v=Rw(),_=Br().Buffer;t.exports=function(M,I,T){var $;if(M.padding)$=M.padding;else if(T)$=1;else $=4;var P=r(M),R;if($===4)R=g(P,I);else if($===1)R=S(P,I,T);else if($===3){if(R=new h(I),R.cmp(P.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(T)return v(R,P);else return b(R,P)};function g(M,I){var T=M.modulus.byteLength(),$=I.length,P=n("sha1").update(_.alloc(0)).digest(),R=P.length,C=2*R;if($>T-C-2)throw Error("message too long");var D=_.alloc(T-$-C-2),B=T-R-1,ie=i(R),le=s(_.concat([P,D,_.alloc(1,1),I],B),o(ie,B)),ue=s(ie,o(le,R));return new h(_.concat([_.alloc(1),ue,le],T))}function S(M,I,T){var $=I.length,P=M.modulus.byteLength();if($>P-11)throw Error("message too long");var R;if(T)R=_.alloc(P-$-3,255);else R=x(P-$-3);return new h(_.concat([_.from([0,T?1:2]),R,_.alloc(1),I],P))}function x(M){var I=_.allocUnsafe(M),T=0,$=i(M*2),P=0,R;while(T<M){if(P===$.length)$=i(M*2),P=0;if(R=$[P++],R)I[T++]=R}return I}}),aP=ce((e,t)=>{var r=Tw(),i=$w(),n=Pw(),o=Rm(),s=Rw(),h=jc(),b=Aw(),v=Br().Buffer;t.exports=function(x,M,I){var T;if(x.padding)T=x.padding;else if(I)T=1;else T=4;var $=r(x),P=$.modulus.byteLength();if(M.length>P||new o(M).cmp($.modulus)>=0)throw Error("decryption error");var R;if(I)R=b(new o(M),$);else R=s(M,$);var C=v.alloc(P-R.length);if(R=v.concat([C,R],P),T===4)return _($,R);else if(T===1)return g($,R,I);else if(T===3)return R;else throw Error("unknown padding")};function _(x,M){var I=x.modulus.byteLength(),T=h("sha1").update(v.alloc(0)).digest(),$=T.length;if(M[0]!==0)throw Error("decryption error");var P=M.slice(1,$+1),R=M.slice($+1),C=n(P,i(R,$)),D=n(R,i(C,I-$-1));if(S(T,D.slice(0,$)))throw Error("decryption error");var B=$;while(D[B]===0)B++;if(D[B++]!==1)throw Error("decryption error");return D.slice(B)}function g(x,M,I){var T=M.slice(0,2),$=2,P=0;while(M[$++]!==0)if($>=M.length){P++;break}var R=M.slice(2,$-1);if(T.toString("hex")!=="0002"&&!I||T.toString("hex")!=="0001"&&I)P++;if(R.length<8)P++;if(P)throw Error("decryption error");return M.slice($)}function S(x,M){x=v.from(x),M=v.from(M);var I=0,T=x.length;if(x.length!==M.length)I++,T=Math.min(x.length,M.length);var $=-1;while(++$<T)I+=x[$]^M[$];return I}}),xm=ce((e)=>{e.publicEncrypt=sP(),e.privateDecrypt=aP(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}}),uP=ce((e)=>{var t=(Hr(),xt(ln));if(typeof t.publicEncrypt!=="function")t=xm();if(e.publicEncrypt=t.publicEncrypt,e.privateDecrypt=t.privateDecrypt,typeof t.privateEncrypt!=="function")e.privateEncrypt=xm().privateEncrypt;else e.privateEncrypt=t.privateEncrypt;if(typeof t.publicDecrypt!=="function")e.publicDecrypt=xm().publicDecrypt;else e.publicDecrypt=t.publicDecrypt}),lP=ce((e)=>{var t=Br(),r=zc(),i=t.Buffer,n=t.kMaxLength,o=globalThis.crypto||globalThis.msCrypto,s=Math.pow(2,32)-1;function h(S,x){if(typeof S!=="number"||S!==S)throw TypeError("offset must be a number");if(S>s||S<0)throw TypeError("offset must be a uint32");if(S>n||S>x)throw RangeError("offset out of range")}function b(S,x,M){if(typeof S!=="number"||S!==S)throw TypeError("size must be a number");if(S>s||S<0)throw TypeError("size must be a uint32");if(S+x>M||S>n)throw RangeError("buffer too small")}o&&o.getRandomValues,e.randomFill=v,e.randomFillSync=g;function v(S,x,M,I){if(!i.isBuffer(S)&&!(S instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof x==="function")I=x,x=0,M=S.length;else if(typeof M==="function")I=M,M=S.length-x;else if(typeof I!=="function")throw TypeError('"cb" argument must be a function');return h(x,S.length),b(M,x,S.length),_(S,x,M,I)}function _(S,x,M,I){if(!1)var T,$;if(I){r(M,function(R,C){if(R)return I(R);C.copy(S,x),I(null,S)});return}var P=r(M);return P.copy(S,x),S}function g(S,x,M){if(typeof x>"u")x=0;if(!i.isBuffer(S)&&!(S instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(h(x,S.length),M===void 0)M=S.length-x;return b(M,x,S.length),_(S,x,M)}}),cP=ce((e,t)=>{var r=(Hr(),xt(ln));if(typeof r.randomFill==="function"&&typeof r.randomFillSync==="function")e.randomFill=r.randomFill,e.randomFillSync=r.randomFillSync;else t.exports=lP()}),dP=ce((e)=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=zc(),e.createHash=e.Hash=jc(),e.createHmac=e.Hmac=sw();var t=NT(),r=Object.keys(t),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);e.getHashes=function(){return i};var n=yw();e.pbkdf2=n.pbkdf2,e.pbkdf2Sync=n.pbkdf2Sync;var o=y$();e.Cipher=o.Cipher,e.createCipher=o.createCipher,e.Cipheriv=o.Cipheriv,e.createCipheriv=o.createCipheriv,e.Decipher=o.Decipher,e.createDecipher=o.createDecipher,e.Decipheriv=o.Decipheriv,e.createDecipheriv=o.createDecipheriv,e.getCiphers=o.getCiphers,e.listCiphers=o.listCiphers;var s=v$();e.DiffieHellmanGroup=s.DiffieHellmanGroup,e.createDiffieHellmanGroup=s.createDiffieHellmanGroup,e.getDiffieHellman=s.getDiffieHellman,e.createDiffieHellman=s.createDiffieHellman,e.DiffieHellman=s.DiffieHellman;var h=b$();e.createSign=h.createSign,e.Sign=h.Sign,e.createVerify=h.createVerify,e.Verify=h.Verify,e.createECDH=F$();var b=uP();e.publicEncrypt=b.publicEncrypt,e.privateEncrypt=b.privateEncrypt,e.publicDecrypt=b.publicDecrypt,e.privateDecrypt=b.privateDecrypt;var v=cP();e.randomFill=v.randomFill,e.randomFillSync=v.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
we accept pull requests
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),gt=OT(dP(),1),fP=gt.prng,hP=gt.pseudoRandomBytes,pP=gt.rng,Cw=gt.randomBytes,mP=gt.Hash,Cm=gt.createHash,gP=gt.Hmac,yP=gt.createHmac,vP=gt.getHashes,bP=gt.pbkdf2,_P=gt.pbkdf2Sync,wP=gt.Cipher,SP=gt.createCipher,xP=gt.Cipheriv,kP=gt.createCipheriv,MP=gt.Decipher,EP=gt.createDecipher,IP=gt.Decipheriv,TP=gt.createDecipheriv,$P=gt.getCiphers,PP=gt.listCiphers,AP=gt.DiffieHellmanGroup,RP=gt.createDiffieHellmanGroup,CP=gt.getDiffieHellman,OP=gt.createDiffieHellman,NP=gt.DiffieHellman,DP=gt.createSign,zP=gt.Sign,jP=gt.createVerify,UP=gt.Verify,LP=gt.createECDH,qP=gt.publicEncrypt,FP=gt.privateEncrypt,BP=gt.publicDecrypt,HP=gt.privateDecrypt,ZP=gt.randomFill,KP=gt.randomFillSync,VP=gt.createCredentials,WP=gt.constants,XP=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];QP=crypto,eA=crypto});var yo={};vn(yo,{sep:()=>qc,resolve:()=>Ni,relative:()=>Fw,posix:()=>Vw,parse:()=>jm,normalize:()=>Nm,join:()=>Xn,isAbsolute:()=>Dm,format:()=>Zw,extname:()=>Hw,dirname:()=>go,delimiter:()=>Kw,default:()=>pA,basename:()=>zm,_makeLong:()=>Bw});function Jn(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function qw(e,t){var r="",i=0,n=-1,o=0,s;for(var h=0;h<=e.length;++h){if(h<e.length)s=e.charCodeAt(h);else if(s===47)break;else s=47;if(s===47){if(n===h-1||o===1);else if(n!==h-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var b=r.lastIndexOf("/");if(b!==r.length-1){if(b===-1)r="",i=0;else r=r.slice(0,b),i=r.length-1-r.lastIndexOf("/");n=h,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=h,o=0;continue}}if(t){if(r.length>0)r+="/..";else r="..";i=2}}else{if(r.length>0)r+="/"+e.slice(n+1,h);else r=e.slice(n+1,h);i=h-n-1}n=h,o=0}else if(s===46&&o!==-1)++o;else o=-1}return r}function hA(e,t){var r=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");if(!r)return i;if(r===t.root)return r+i;return r+e+i}function Ni(){var e="",t=!1,r;for(var i=arguments.length-1;i>=-1&&!t;i--){var n;if(i>=0)n=arguments[i];else{if(r===void 0)r=process.cwd();n=r}if(Jn(n),n.length===0)continue;e=n+"/"+e,t=n.charCodeAt(0)===47}if(e=qw(e,!t),t)if(e.length>0)return"/"+e;else return"/";else if(e.length>0)return e;else return"."}function Nm(e){if(Jn(e),e.length===0)return".";var t=e.charCodeAt(0)===47,r=e.charCodeAt(e.length-1)===47;if(e=qw(e,!t),e.length===0&&!t)e=".";if(e.length>0&&r)e+="/";if(t)return"/"+e;return e}function Dm(e){return Jn(e),e.length>0&&e.charCodeAt(0)===47}function Xn(){if(arguments.length===0)return".";var e;for(var t=0;t<arguments.length;++t){var r=arguments[t];if(Jn(r),r.length>0)if(e===void 0)e=r;else e+="/"+r}if(e===void 0)return".";return Nm(e)}function Fw(e,t){if(Jn(e),Jn(t),e===t)return"";if(e=Ni(e),t=Ni(t),e===t)return"";var r=1;for(;r<e.length;++r)if(e.charCodeAt(r)!==47)break;var i=e.length,n=i-r,o=1;for(;o<t.length;++o)if(t.charCodeAt(o)!==47)break;var s=t.length,h=s-o,b=n<h?n:h,v=-1,_=0;for(;_<=b;++_){if(_===b){if(h>b){if(t.charCodeAt(o+_)===47)return t.slice(o+_+1);else if(_===0)return t.slice(o+_)}else if(n>b){if(e.charCodeAt(r+_)===47)v=_;else if(_===0)v=0}break}var g=e.charCodeAt(r+_),S=t.charCodeAt(o+_);if(g!==S)break;else if(g===47)v=_}var x="";for(_=r+v+1;_<=i;++_)if(_===i||e.charCodeAt(_)===47)if(x.length===0)x+="..";else x+="/..";if(x.length>0)return x+t.slice(o+v);else{if(o+=v,t.charCodeAt(o)===47)++o;return t.slice(o)}}function Bw(e){return e}function go(e){if(Jn(e),e.length===0)return".";var t=e.charCodeAt(0),r=t===47,i=-1,n=!0;for(var o=e.length-1;o>=1;--o)if(t=e.charCodeAt(o),t===47){if(!n){i=o;break}}else n=!1;if(i===-1)return r?"/":".";if(r&&i===1)return"//";return e.slice(0,i)}function zm(e,t){if(t!==void 0&&typeof t!=="string")throw TypeError('"ext" argument must be a string');Jn(e);var r=0,i=-1,n=!0,o;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,h=-1;for(o=e.length-1;o>=0;--o){var b=e.charCodeAt(o);if(b===47){if(!n){r=o+1;break}}else{if(h===-1)n=!1,h=o+1;if(s>=0)if(b===t.charCodeAt(s)){if(--s===-1)i=o}else s=-1,i=h}}if(r===i)i=h;else if(i===-1)i=e.length;return e.slice(r,i)}else{for(o=e.length-1;o>=0;--o)if(e.charCodeAt(o)===47){if(!n){r=o+1;break}}else if(i===-1)n=!1,i=o+1;if(i===-1)return"";return e.slice(r,i)}}function Hw(e){Jn(e);var t=-1,r=0,i=-1,n=!0,o=0;for(var s=e.length-1;s>=0;--s){var h=e.charCodeAt(s);if(h===47){if(!n){r=s+1;break}continue}if(i===-1)n=!1,i=s+1;if(h===46){if(t===-1)t=s;else if(o!==1)o=1}else if(t!==-1)o=-1}if(t===-1||i===-1||o===0||o===1&&t===i-1&&t===r+1)return"";return e.slice(t,i)}function Zw(e){if(e===null||typeof e!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return hA("/",e)}function jm(e){Jn(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return t;var r=e.charCodeAt(0),i=r===47,n;if(i)t.root="/",n=1;else n=0;var o=-1,s=0,h=-1,b=!0,v=e.length-1,_=0;for(;v>=n;--v){if(r=e.charCodeAt(v),r===47){if(!b){s=v+1;break}continue}if(h===-1)b=!1,h=v+1;if(r===46){if(o===-1)o=v;else if(_!==1)_=1}else if(o!==-1)_=-1}if(o===-1||h===-1||_===0||_===1&&o===h-1&&o===s+1){if(h!==-1)if(s===0&&i)t.base=t.name=e.slice(1,h);else t.base=t.name=e.slice(s,h)}else{if(s===0&&i)t.name=e.slice(1,o),t.base=e.slice(1,h);else t.name=e.slice(s,o),t.base=e.slice(s,h);t.ext=e.slice(o,h)}if(s>0)t.dir=e.slice(0,s-1);else if(i)t.dir="/";return t}var qc="/",Kw=":",Vw,pA;var Rn=ha(()=>{Vw=((e)=>(e.posix=e,e))({resolve:Ni,normalize:Nm,isAbsolute:Dm,join:Xn,relative:Fw,_makeLong:Bw,dirname:go,basename:zm,extname:Hw,format:Zw,parse:jm,sep:qc,delimiter:Kw,win32:null,posix:null}),pA=Vw});var Ql=Je((Yx)=>{Object.defineProperty(Yx,"__esModule",{value:!0});Yx.regexpCode=Yx.getEsmExportName=Yx.getProperty=Yx.safeStringify=Yx.stringify=Yx.strConcat=Yx.addCodeArg=Yx.str=Yx._=Yx.nil=Yx._Code=Yx.Name=Yx.IDENTIFIER=Yx._CodeOrName=void 0;class cp{}Yx._CodeOrName=cp;Yx.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Qs extends cp{constructor(e){super();if(!Yx.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Yx.Name=Qs;class Ln extends cp{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Qs)t[r.str]=(t[r.str]||0)+1;return t},{})}}Yx._Code=Ln;Yx.nil=new Ln("");function Jx(e,...t){let r=[e[0]],i=0;while(i<t.length)ub(r,t[i]),r.push(e[++i]);return new Ln(r)}Yx._=Jx;var ab=new Ln("+");function Xx(e,...t){let r=[Yl(e[0])],i=0;while(i<t.length)r.push(ab),ub(r,t[i]),r.push(ab,Yl(e[++i]));return pN(r),new Ln(r)}Yx.str=Xx;function ub(e,t){if(t instanceof Ln)e.push(...t._items);else if(t instanceof Qs)e.push(t);else e.push(yN(t))}Yx.addCodeArg=ub;function pN(e){let t=1;while(t<e.length-1){if(e[t]===ab){let r=mN(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function mN(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Qs||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Qs))return`"${e}${t.slice(1)}`;return}function gN(e,t){return t.emptyStr()?e:e.emptyStr()?t:Xx`${e}${t}`}Yx.strConcat=gN;function yN(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Yl(Array.isArray(e)?e.join(","):e)}function vN(e){return new Ln(Yl(e))}Yx.stringify=vN;function Yl(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Yx.safeStringify=Yl;function bN(e){return typeof e=="string"&&Yx.IDENTIFIER.test(e)?new Ln(`.${e}`):Jx`[${e}]`}Yx.getProperty=bN;function _N(e){if(typeof e=="string"&&Yx.IDENTIFIER.test(e))return new Ln(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Yx.getEsmExportName=_N;function wN(e){return new Ln(e.toString())}Yx.regexpCode=wN});var fb=Je((rk)=>{Object.defineProperty(rk,"__esModule",{value:!0});rk.ValueScope=rk.ValueScopeName=rk.Scope=rk.varKinds=rk.UsedValueState=void 0;var nn=Ql();class ek extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var fp;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(fp||(rk.UsedValueState=fp={}));rk.varKinds={const:new nn.Name("const"),let:new nn.Name("let"),var:new nn.Name("var")};class cb{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof nn.Name?e:this.name(e)}name(e){return new nn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}rk.Scope=cb;class db extends nn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=nn._`.${new nn.Name(t)}[${r}]`}}rk.ValueScopeName=db;var ON=nn._`\n`;class tk extends cb{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ON:nn.nil}}get(){return this._scope}name(e){return new db(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:n}=i,o=(r=t.key)!==null&&r!==void 0?r:t.ref,s=this._values[n];if(s){let v=s.get(o);if(v)return v}else s=this._values[n]=new Map;s.set(o,i);let h=this._scope[n]||(this._scope[n]=[]),b=h.length;return h[b]=t.ref,i.setValue(t,{property:n,itemIndex:b}),i}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return nn._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(i)=>{if(i.value===void 0)throw Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,r)}_reduceValues(e,t,r={},i){let n=nn.nil;for(let o in e){let s=e[o];if(!s)continue;let h=r[o]=r[o]||new Map;s.forEach((b)=>{if(h.has(b))return;h.set(b,fp.Started);let v=t(b);if(v){let _=this.opts.es5?rk.varKinds.var:rk.varKinds.const;n=nn._`${n}${_} ${b} = ${v};${this.opts._n}`}else if(v=i===null||i===void 0?void 0:i(b))n=nn._`${n}${v}${this.opts._n}`;else throw new ek(b);h.set(b,fp.Completed)})}return n}}rk.ValueScope=tk});var mt=Je((on)=>{Object.defineProperty(on,"__esModule",{value:!0});on.or=on.and=on.not=on.CodeGen=on.operators=on.varKinds=on.ValueScopeName=on.ValueScope=on.Scope=on.Name=on.regexpCode=on.stringify=on.getProperty=on.nil=on.strConcat=on.str=on._=void 0;var St=Ql(),qn=fb(),eo=Ql();Object.defineProperty(on,"_",{enumerable:!0,get:function(){return eo._}});Object.defineProperty(on,"str",{enumerable:!0,get:function(){return eo.str}});Object.defineProperty(on,"strConcat",{enumerable:!0,get:function(){return eo.strConcat}});Object.defineProperty(on,"nil",{enumerable:!0,get:function(){return eo.nil}});Object.defineProperty(on,"getProperty",{enumerable:!0,get:function(){return eo.getProperty}});Object.defineProperty(on,"stringify",{enumerable:!0,get:function(){return eo.stringify}});Object.defineProperty(on,"regexpCode",{enumerable:!0,get:function(){return eo.regexpCode}});Object.defineProperty(on,"Name",{enumerable:!0,get:function(){return eo.Name}});var vp=fb();Object.defineProperty(on,"Scope",{enumerable:!0,get:function(){return vp.Scope}});Object.defineProperty(on,"ValueScope",{enumerable:!0,get:function(){return vp.ValueScope}});Object.defineProperty(on,"ValueScopeName",{enumerable:!0,get:function(){return vp.ValueScopeName}});Object.defineProperty(on,"varKinds",{enumerable:!0,get:function(){return vp.varKinds}});on.operators={GT:new St._Code(">"),GTE:new St._Code(">="),LT:new St._Code("<"),LTE:new St._Code("<="),EQ:new St._Code("==="),NEQ:new St._Code("!=="),NOT:new St._Code("!"),OR:new St._Code("||"),AND:new St._Code("&&"),ADD:new St._Code("+")};class to{optimizeNodes(){return this}optimizeNames(e,t){return this}}class ik extends to{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?qn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=ta(this.rhs,e,t);return this}get names(){return this.rhs instanceof St._CodeOrName?this.rhs.names:{}}}class mb extends to{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof St.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=ta(this.rhs,e,t),this}get names(){let e=this.lhs instanceof St.Name?{}:{...this.lhs.names};return yp(e,this.rhs)}}class ok extends mb{constructor(e,t,r,i){super(e,r,i);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class sk extends to{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class ak extends to{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class uk extends to{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class lk extends to{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=ta(this.code,e,t),this}get names(){return this.code instanceof St._CodeOrName?this.code.names:{}}}class bp extends to{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,i=r.length;while(i--){let n=r[i];if(n.optimizeNames(e,t))continue;jN(e,n.names),r.splice(i,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Bo(e,t.names),{})}}class ro extends bp{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class ck extends bp{}class ec extends ro{}ec.kind="else";class xi extends ro{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new ec(r):r}if(t){if(e===!1)return t instanceof xi?t:t.nodes;if(this.nodes.length)return this;return new xi(mk(e),t instanceof xi?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=ta(this.condition,e,t),this}get names(){let e=super.names;if(yp(e,this.condition),this.else)Bo(e,this.else.names);return e}}xi.kind="if";class ea extends ro{}ea.kind="for";class dk extends ea{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=ta(this.iteration,e,t),this}get names(){return Bo(super.names,this.iteration.names)}}class fk extends ea{constructor(e,t,r,i){super();this.varKind=e,this.name=t,this.from=r,this.to=i}render(e){let t=e.es5?qn.varKinds.var:this.varKind,{name:r,from:i,to:n}=this;return`for(${t} ${r}=${i}; ${r}<${n}; ${r}++)`+super.render(e)}get names(){let e=yp(super.names,this.from);return yp(e,this.to)}}class hb extends ea{constructor(e,t,r,i){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=ta(this.iterable,e,t),this}get names(){return Bo(super.names,this.iterable.names)}}class hp extends ro{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}hp.kind="func";class pp extends bp{render(e){return"return "+super.render(e)}}pp.kind="return";class hk extends ro{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,i;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Bo(e,this.catch.names);if(this.finally)Bo(e,this.finally.names);return e}}class mp extends ro{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}mp.kind="catch";class gp extends ro{render(e){return"finally"+super.render(e)}}gp.kind="finally";class pk{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
`:""},this._extScope=e,this._scope=new qn.Scope({parent:e}),this._nodes=[new ck]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,i){let n=this._scope.toName(t);if(r!==void 0&&i)this._constants[n.str]=r;return this._leafNode(new ik(e,n,r)),n}const(e,t,r){return this._def(qn.varKinds.const,e,t,r)}let(e,t,r){return this._def(qn.varKinds.let,e,t,r)}var(e,t,r){return this._def(qn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new mb(e,t,r))}add(e,t){return this._leafNode(new ok(e,on.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==St.nil)this._leafNode(new lk(e));return this}object(...e){let t=["{"];for(let[r,i]of e){if(t.length>1)t.push(",");if(t.push(r),r!==i||this.opts.es5)t.push(":"),(0,St.addCodeArg)(t,i)}return t.push("}"),new St._Code(t)}if(e,t,r){if(this._blockNode(new xi(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new xi(e))}else(){return this._elseNode(new ec)}endIf(){return this._endBlockNode(xi,ec)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new dk(e),t)}forRange(e,t,r,i,n=this.opts.es5?qn.varKinds.var:qn.varKinds.let){let o=this._scope.toName(e);return this._for(new fk(n,o,t,r),()=>i(o))}forOf(e,t,r,i=qn.varKinds.const){let n=this._scope.toName(e);if(this.opts.es5){let o=t instanceof St.Name?t:this.var("_arr",t);return this.forRange("_i",0,St._`${o}.length`,(s)=>{this.var(n,St._`${o}[${s}]`),r(n)})}return this._for(new hb("of",i,n,t),()=>r(n))}forIn(e,t,r,i=this.opts.es5?qn.varKinds.var:qn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,St._`Object.keys(${t})`,r);let n=this._scope.toName(e);return this._for(new hb("in",i,n,t),()=>r(n))}endFor(){return this._endBlockNode(ea)}label(e){return this._leafNode(new sk(e))}break(e){return this._leafNode(new ak(e))}return(e){let t=new pp;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(pp)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let i=new hk;if(this._blockNode(i),this.code(e),t){let n=this.name("e");this._currNode=i.catch=new mp(n),t(n)}if(r)this._currNode=i.finally=new gp,this.code(r);return this._endBlockNode(mp,gp)}throw(e){return this._leafNode(new uk(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=St.nil,r,i){if(this._blockNode(new hp(e,t,r)),i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(hp)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof xi))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}on.CodeGen=pk;function Bo(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function yp(e,t){return t instanceof St._CodeOrName?Bo(e,t.names):e}function ta(e,t,r){if(e instanceof St.Name)return i(e);if(!n(e))return e;return new St._Code(e._items.reduce((o,s)=>{if(s instanceof St.Name)s=i(s);if(s instanceof St._Code)o.push(...s._items);else o.push(s);return o},[]));function i(o){let s=r[o.str];if(s===void 0||t[o.str]!==1)return o;return delete t[o.str],s}function n(o){return o instanceof St._Code&&o._items.some((s)=>s instanceof St.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function jN(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function mk(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:St._`!${pb(e)}`}on.not=mk;var UN=gk(on.operators.AND);function LN(...e){return e.reduce(UN)}on.and=LN;var qN=gk(on.operators.OR);function FN(...e){return e.reduce(qN)}on.or=FN;function gk(e){return(t,r)=>t===St.nil?r:r===St.nil?t:St._`${pb(t)} ${e} ${pb(r)}`}function pb(e){return e instanceof St.Name?e:St._`(${e})`}});var kt=Je((Mk)=>{Object.defineProperty(Mk,"__esModule",{value:!0});Mk.checkStrictMode=Mk.getErrorPath=Mk.Type=Mk.useFunc=Mk.setEvaluated=Mk.evaluatedPropsToName=Mk.mergeEvaluated=Mk.eachItem=Mk.unescapeJsonPointer=Mk.escapeJsonPointer=Mk.escapeFragment=Mk.unescapeFragment=Mk.schemaRefOrVal=Mk.schemaHasRulesButRef=Mk.schemaHasRules=Mk.checkUnknownRules=Mk.alwaysValidSchema=Mk.toHash=void 0;var zt=mt(),KN=Ql();function VN(e){let t={};for(let r of e)t[r]=!0;return t}Mk.toHash=VN;function WN(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return _k(e,t),!wk(t,e.self.RULES.all)}Mk.alwaysValidSchema=WN;function _k(e,t=e.schema){let{opts:r,self:i}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let n=i.RULES.keywords;for(let o in t)if(!n[o])kk(e,`unknown keyword: "${o}"`)}Mk.checkUnknownRules=_k;function wk(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Mk.schemaHasRules=wk;function GN(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Mk.schemaHasRulesButRef=GN;function JN({topSchemaRef:e,schemaPath:t},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return zt._`${r}`}return zt._`${e}${t}${(0,zt.getProperty)(i)}`}Mk.schemaRefOrVal=JN;function XN(e){return Sk(decodeURIComponent(e))}Mk.unescapeFragment=XN;function YN(e){return encodeURIComponent(yb(e))}Mk.escapeFragment=YN;function yb(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Mk.escapeJsonPointer=yb;function Sk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Mk.unescapeJsonPointer=Sk;function QN(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Mk.eachItem=QN;function vk({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(n,o,s,h)=>{let b=s===void 0?o:s instanceof zt.Name?(o instanceof zt.Name?e(n,o,s):t(n,o,s),s):o instanceof zt.Name?(t(n,s,o),o):r(o,s);return h===zt.Name&&!(b instanceof zt.Name)?i(n,b):b}}Mk.mergeEvaluated={props:vk({mergeNames:(e,t,r)=>e.if(zt._`${r} !== true && ${t} !== undefined`,()=>{e.if(zt._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,zt._`${r} || {}`).code(zt._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(zt._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,zt._`${r} || {}`),vb(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:xk}),items:vk({mergeNames:(e,t,r)=>e.if(zt._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,zt._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(zt._`${r} !== true`,()=>e.assign(r,t===!0?!0:zt._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function xk(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",zt._`{}`);if(t!==void 0)vb(e,r,t);return r}Mk.evaluatedPropsToName=xk;function vb(e,t,r){Object.keys(r).forEach((i)=>e.assign(zt._`${t}${(0,zt.getProperty)(i)}`,!0))}Mk.setEvaluated=vb;var bk={};function eD(e,t){return e.scopeValue("func",{ref:t,code:bk[t.code]||(bk[t.code]=new KN._Code(t.code))})}Mk.useFunc=eD;var gb;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(gb||(Mk.Type=gb={}));function tD(e,t,r){if(e instanceof zt.Name){let i=t===gb.Num;return r?i?zt._`"[" + ${e} + "]"`:zt._`"['" + ${e} + "']"`:i?zt._`"/" + ${e}`:zt._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,zt.getProperty)(e).toString():"/"+yb(e)}Mk.getErrorPath=tD;function kk(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Mk.checkStrictMode=kk});var ki=Je((Ik)=>{Object.defineProperty(Ik,"__esModule",{value:!0});var qr=mt(),bD={data:new qr.Name("data"),valCxt:new qr.Name("valCxt"),instancePath:new qr.Name("instancePath"),parentData:new qr.Name("parentData"),parentDataProperty:new qr.Name("parentDataProperty"),rootData:new qr.Name("rootData"),dynamicAnchors:new qr.Name("dynamicAnchors"),vErrors:new qr.Name("vErrors"),errors:new qr.Name("errors"),this:new qr.Name("this"),self:new qr.Name("self"),scope:new qr.Name("scope"),json:new qr.Name("json"),jsonPos:new qr.Name("jsonPos"),jsonLen:new qr.Name("jsonLen"),jsonPart:new qr.Name("jsonPart")};Ik.default=bD});var tc=Je((Ak)=>{Object.defineProperty(Ak,"__esModule",{value:!0});Ak.extendErrors=Ak.resetErrorsCount=Ak.reportExtraError=Ak.reportError=Ak.keyword$DataError=Ak.keywordError=void 0;var Mt=mt(),wp=kt(),Wr=ki();Ak.keywordError={message:({keyword:e})=>Mt.str`must pass "${e}" keyword validation`};Ak.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Mt.str`"${e}" keyword must be ${t} ($data)`:Mt.str`"${e}" keyword is invalid ($data)`};function wD(e,t=Ak.keywordError,r,i){let{it:n}=e,{gen:o,compositeRule:s,allErrors:h}=n,b=Pk(e,t,r);if(i!==null&&i!==void 0?i:s||h)Tk(o,b);else $k(n,Mt._`[${b}]`)}Ak.reportError=wD;function SD(e,t=Ak.keywordError,r){let{it:i}=e,{gen:n,compositeRule:o,allErrors:s}=i,h=Pk(e,t,r);if(Tk(n,h),!(o||s))$k(i,Wr.default.vErrors)}Ak.reportExtraError=SD;function xD(e,t){e.assign(Wr.default.errors,t),e.if(Mt._`${Wr.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Mt._`${Wr.default.vErrors}.length`,t),()=>e.assign(Wr.default.vErrors,null)))}Ak.resetErrorsCount=xD;function kD({gen:e,keyword:t,schemaValue:r,data:i,errsCount:n,it:o}){if(n===void 0)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",n,Wr.default.errors,(h)=>{if(e.const(s,Mt._`${Wr.default.vErrors}[${h}]`),e.if(Mt._`${s}.instancePath === undefined`,()=>e.assign(Mt._`${s}.instancePath`,(0,Mt.strConcat)(Wr.default.instancePath,o.errorPath))),e.assign(Mt._`${s}.schemaPath`,Mt.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(Mt._`${s}.schema`,r),e.assign(Mt._`${s}.data`,i)})}Ak.extendErrors=kD;function Tk(e,t){let r=e.const("err",t);e.if(Mt._`${Wr.default.vErrors} === null`,()=>e.assign(Wr.default.vErrors,Mt._`[${r}]`),Mt._`${Wr.default.vErrors}.push(${r})`),e.code(Mt._`${Wr.default.errors}++`)}function $k(e,t){let{gen:r,validateName:i,schemaEnv:n}=e;if(n.$async)r.throw(Mt._`new ${e.ValidationError}(${t})`);else r.assign(Mt._`${i}.errors`,t),r.return(!1)}var Ho={keyword:new Mt.Name("keyword"),schemaPath:new Mt.Name("schemaPath"),params:new Mt.Name("params"),propertyName:new Mt.Name("propertyName"),message:new Mt.Name("message"),schema:new Mt.Name("schema"),parentSchema:new Mt.Name("parentSchema")};function Pk(e,t,r){let{createErrors:i}=e.it;if(i===!1)return Mt._`{}`;return MD(e,t,r)}function MD(e,t,r={}){let{gen:i,it:n}=e,o=[ED(n,r),ID(e,r)];return TD(e,t,o),i.object(...o)}function ED({errorPath:e},{instancePath:t}){let r=t?Mt.str`${e}${(0,wp.getErrorPath)(t,wp.Type.Str)}`:e;return[Wr.default.instancePath,(0,Mt.strConcat)(Wr.default.instancePath,r)]}function ID({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let n=i?t:Mt.str`${t}/${e}`;if(r)n=Mt.str`${n}${(0,wp.getErrorPath)(r,wp.Type.Str)}`;return[Ho.schemaPath,n]}function TD(e,{params:t,message:r},i){let{keyword:n,data:o,schemaValue:s,it:h}=e,{opts:b,propertyName:v,topSchemaRef:_,schemaPath:g}=h;if(i.push([Ho.keyword,n],[Ho.params,typeof t=="function"?t(e):t||Mt._`{}`]),b.messages)i.push([Ho.message,typeof r=="function"?r(e):r]);if(b.verbose)i.push([Ho.schema,s],[Ho.parentSchema,Mt._`${_}${g}`],[Wr.default.data,o]);if(v)i.push([Ho.propertyName,v])}});var Dk=Je((Ok)=>{Object.defineProperty(Ok,"__esModule",{value:!0});Ok.boolOrEmptySchema=Ok.topBoolOrEmptySchema=void 0;var CD=tc(),OD=mt(),ND=ki(),DD={message:"boolean schema is false"};function zD(e){let{gen:t,schema:r,validateName:i}=e;if(r===!1)Ck(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(ND.default.data);else t.assign(OD._`${i}.errors`,null),t.return(!0)}Ok.topBoolOrEmptySchema=zD;function jD(e,t){let{gen:r,schema:i}=e;if(i===!1)r.var(t,!1),Ck(e);else r.var(t,!0)}Ok.boolOrEmptySchema=jD;function Ck(e,t){let{gen:r,data:i}=e,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,CD.reportError)(n,DD,void 0,t)}});var _b=Je((zk)=>{Object.defineProperty(zk,"__esModule",{value:!0});zk.getRules=zk.isJSONType=void 0;var LD=["string","number","integer","boolean","null","object","array"],qD=new Set(LD);function FD(e){return typeof e=="string"&&qD.has(e)}zk.isJSONType=FD;function BD(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}zk.getRules=BD});var wb=Je((qk)=>{Object.defineProperty(qk,"__esModule",{value:!0});qk.shouldUseRule=qk.shouldUseGroup=qk.schemaHasRulesForType=void 0;function ZD({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&Uk(e,i)}qk.schemaHasRulesForType=ZD;function Uk(e,t){return t.rules.some((r)=>Lk(e,r))}qk.shouldUseGroup=Uk;function Lk(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((i)=>e[i]!==void 0))}qk.shouldUseRule=Lk});var rc=Je((Kk)=>{Object.defineProperty(Kk,"__esModule",{value:!0});Kk.reportTypeError=Kk.checkDataTypes=Kk.checkDataType=Kk.coerceAndCheckDataType=Kk.getJSONTypes=Kk.getSchemaTypes=Kk.DataType=void 0;var WD=_b(),GD=wb(),JD=tc(),ht=mt(),Bk=kt(),ra;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ra||(Kk.DataType=ra={}));function XD(e){let t=Hk(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}Kk.getSchemaTypes=XD;function Hk(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(WD.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Kk.getJSONTypes=Hk;function YD(e,t){let{gen:r,data:i,opts:n}=e,o=QD(t,n.coerceTypes),s=t.length>0&&!(o.length===0&&t.length===1&&(0,GD.schemaHasRulesForType)(e,t[0]));if(s){let h=xb(t,i,n.strictNumbers,ra.Wrong);r.if(h,()=>{if(o.length)ez(e,t,o);else kb(e)})}return s}Kk.coerceAndCheckDataType=YD;var Zk=new Set(["string","number","integer","boolean","null"]);function QD(e,t){return t?e.filter((r)=>Zk.has(r)||t==="array"&&r==="array"):[]}function ez(e,t,r){let{gen:i,data:n,opts:o}=e,s=i.let("dataType",ht._`typeof ${n}`),h=i.let("coerced",ht._`undefined`);if(o.coerceTypes==="array")i.if(ht._`${s} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,ht._`${n}[0]`).assign(s,ht._`typeof ${n}`).if(xb(t,n,o.strictNumbers),()=>i.assign(h,n)));i.if(ht._`${h} !== undefined`);for(let v of r)if(Zk.has(v)||v==="array"&&o.coerceTypes==="array")b(v);i.else(),kb(e),i.endIf(),i.if(ht._`${h} !== undefined`,()=>{i.assign(n,h),tz(e,h)});function b(v){switch(v){case"string":i.elseIf(ht._`${s} == "number" || ${s} == "boolean"`).assign(h,ht._`"" + ${n}`).elseIf(ht._`${n} === null`).assign(h,ht._`""`);return;case"number":i.elseIf(ht._`${s} == "boolean" || ${n} === null
|| (${s} == "string" && ${n} && ${n} == +${n})`).assign(h,ht._`+${n}`);return;case"integer":i.elseIf(ht._`${s} === "boolean" || ${n} === null
|| (${s} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(h,ht._`+${n}`);return;case"boolean":i.elseIf(ht._`${n} === "false" || ${n} === 0 || ${n} === null`).assign(h,!1).elseIf(ht._`${n} === "true" || ${n} === 1`).assign(h,!0);return;case"null":i.elseIf(ht._`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(h,null);return;case"array":i.elseIf(ht._`${s} === "string" || ${s} === "number"
|| ${s} === "boolean" || ${n} === null`).assign(h,ht._`[${n}]`)}}}function tz({gen:e,parentData:t,parentDataProperty:r},i){e.if(ht._`${t} !== undefined`,()=>e.assign(ht._`${t}[${r}]`,i))}function Sb(e,t,r,i=ra.Correct){let n=i===ra.Correct?ht.operators.EQ:ht.operators.NEQ,o;switch(e){case"null":return ht._`${t} ${n} null`;case"array":o=ht._`Array.isArray(${t})`;break;case"object":o=ht._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(ht._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return ht._`typeof ${t} ${n} ${e}`}return i===ra.Correct?o:(0,ht.not)(o);function s(h=ht.nil){return(0,ht.and)(ht._`typeof ${t} == "number"`,h,r?ht._`isFinite(${t})`:ht.nil)}}Kk.checkDataType=Sb;function xb(e,t,r,i){if(e.length===1)return Sb(e[0],t,r,i);let n,o=(0,Bk.toHash)(e);if(o.array&&o.object){let s=ht._`typeof ${t} != "object"`;n=o.null?s:ht._`!${t} || ${s}`,delete o.null,delete o.array,delete o.object}else n=ht.nil;if(o.number)delete o.integer;for(let s in o)n=(0,ht.and)(n,Sb(s,t,r,i));return n}Kk.checkDataTypes=xb;var rz={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ht._`{type: ${e}}`:ht._`{type: ${t}}`};function kb(e){let t=nz(e);(0,JD.reportError)(t,rz)}Kk.reportTypeError=kb;function nz(e){let{gen:t,data:r,schema:i}=e,n=(0,Bk.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:e}}});var Xk=Je((Gk)=>{Object.defineProperty(Gk,"__esModule",{value:!0});Gk.assignDefaults=void 0;var na=mt(),cz=kt();function dz(e,t){let{properties:r,items:i}=e.schema;if(t==="object"&&r)for(let n in r)Wk(e,n,r[n].default);else if(t==="array"&&Array.isArray(i))i.forEach((n,o)=>Wk(e,o,n.default))}Gk.assignDefaults=dz;function Wk(e,t,r){let{gen:i,compositeRule:n,data:o,opts:s}=e;if(r===void 0)return;let h=na._`${o}${(0,na.getProperty)(t)}`;if(n){(0,cz.checkStrictMode)(e,`default is ignored for: ${h}`);return}let b=na._`${h} === undefined`;if(s.useDefaults==="empty")b=na._`${b} || ${h} === null || ${h} === ""`;i.if(b,na._`${h} = ${(0,na.stringify)(r)}`)}});var Pn=Je((eM)=>{Object.defineProperty(eM,"__esModule",{value:!0});eM.validateUnion=eM.validateArray=eM.usePattern=eM.callValidateCode=eM.schemaProperties=eM.allSchemaProperties=eM.noPropertyInData=eM.propertyInData=eM.isOwnProperty=eM.hasPropFunc=eM.reportMissingProp=eM.checkMissingProp=eM.checkReportMissingProp=void 0;var Ft=mt(),Mb=kt(),no=ki(),fz=kt();function hz(e,t){let{gen:r,data:i,it:n}=e;r.if(Ib(r,i,t,n.opts.ownProperties),()=>{e.setParams({missingProperty:Ft._`${t}`},!0),e.error()})}eM.checkReportMissingProp=hz;function pz({gen:e,data:t,it:{opts:r}},i,n){return(0,Ft.or)(...i.map((o)=>(0,Ft.and)(Ib(e,t,o,r.ownProperties),Ft._`${n} = ${o}`)))}eM.checkMissingProp=pz;function mz(e,t){e.setParams({missingProperty:t},!0),e.error()}eM.reportMissingProp=mz;function Yk(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Ft._`Object.prototype.hasOwnProperty`})}eM.hasPropFunc=Yk;function Eb(e,t,r){return Ft._`${Yk(e)}.call(${t}, ${r})`}eM.isOwnProperty=Eb;function gz(e,t,r,i){let n=Ft._`${t}${(0,Ft.getProperty)(r)} !== undefined`;return i?Ft._`${n} && ${Eb(e,t,r)}`:n}eM.propertyInData=gz;function Ib(e,t,r,i){let n=Ft._`${t}${(0,Ft.getProperty)(r)} === undefined`;return i?(0,Ft.or)(n,(0,Ft.not)(Eb(e,t,r))):n}eM.noPropertyInData=Ib;function Qk(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}eM.allSchemaProperties=Qk;function yz(e,t){return Qk(t).filter((r)=>!(0,Mb.alwaysValidSchema)(e,t[r]))}eM.schemaProperties=yz;function vz({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:o},it:s},h,b,v){let _=v?Ft._`${e}, ${t}, ${i}${n}`:t,g=[[no.default.instancePath,(0,Ft.strConcat)(no.default.instancePath,o)],[no.default.parentData,s.parentData],[no.default.parentDataProperty,s.parentDataProperty],[no.default.rootData,no.default.rootData]];if(s.opts.dynamicRef)g.push([no.default.dynamicAnchors,no.default.dynamicAnchors]);let S=Ft._`${_}, ${r.object(...g)}`;return b!==Ft.nil?Ft._`${h}.call(${b}, ${S})`:Ft._`${h}(${S})`}eM.callValidateCode=vz;var bz=Ft._`new RegExp`;function _z({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:n}=t.code,o=n(r,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:Ft._`${n.code==="new RegExp"?bz:(0,fz.useFunc)(e,n)}(${r}, ${i})`})}eM.usePattern=_z;function wz(e){let{gen:t,data:r,keyword:i,it:n}=e,o=t.name("valid");if(n.allErrors){let h=t.let("valid",!0);return s(()=>t.assign(h,!1)),h}return t.var(o,!0),s(()=>t.break()),o;function s(h){let b=t.const("len",Ft._`${r}.length`);t.forRange("i",0,b,(v)=>{e.subschema({keyword:i,dataProp:v,dataPropType:Mb.Type.Num},o),t.if((0,Ft.not)(o),h)})}}eM.validateArray=wz;function Sz(e){let{gen:t,schema:r,keyword:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((b)=>(0,Mb.alwaysValidSchema)(n,b))&&!n.opts.unevaluated)return;let s=t.let("valid",!1),h=t.name("_valid");t.block(()=>r.forEach((b,v)=>{let _=e.subschema({keyword:i,schemaProp:v,compositeRule:!0},h);if(t.assign(s,Ft._`${s} || ${h}`),!e.mergeValidEvaluated(_,h))t.if((0,Ft.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}eM.validateUnion=Sz});var sM=Je((iM)=>{Object.defineProperty(iM,"__esModule",{value:!0});iM.validateKeywordUsage=iM.validSchemaType=iM.funcKeywordCode=iM.macroKeywordCode=void 0;var Gr=mt(),Zo=ki(),Nz=Pn(),Dz=tc();function zz(e,t){let{gen:r,keyword:i,schema:n,parentSchema:o,it:s}=e,h=t.macro.call(s.self,n,o,s),b=nM(r,i,h);if(s.opts.validateSchema!==!1)s.self.validateSchema(h,!0);let v=r.name("valid");e.subschema({schema:h,schemaPath:Gr.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:b,compositeRule:!0},v),e.pass(v,()=>e.error(!0))}iM.macroKeywordCode=zz;function jz(e,t){var r;let{gen:i,keyword:n,schema:o,parentSchema:s,$data:h,it:b}=e;Lz(b,t);let v=!h&&t.compile?t.compile.call(b.self,o,s,b):t.validate,_=nM(i,n,v),g=i.let("valid");e.block$data(g,S),e.ok((r=t.valid)!==null&&r!==void 0?r:g);function S(){if(t.errors===!1){if(I(),t.modifying)rM(e);T(()=>e.error())}else{let $=t.async?x():M();if(t.modifying)rM(e);T(()=>Uz(e,$))}}function x(){let $=i.let("ruleErrs",null);return i.try(()=>I(Gr._`await `),(P)=>i.assign(g,!1).if(Gr._`${P} instanceof ${b.ValidationError}`,()=>i.assign($,Gr._`${P}.errors`),()=>i.throw(P))),$}function M(){let $=Gr._`${_}.errors`;return i.assign($,null),I(Gr.nil),$}function I($=t.async?Gr._`await `:Gr.nil){let P=b.opts.passContext?Zo.default.this:Zo.default.self,R=!(("compile"in t)&&!h||t.schema===!1);i.assign(g,Gr._`${$}${(0,Nz.callValidateCode)(e,_,P,R)}`,t.modifying)}function T($){var P;i.if((0,Gr.not)((P=t.valid)!==null&&P!==void 0?P:g),$)}}iM.funcKeywordCode=jz;function rM(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,Gr._`${i.parentData}[${i.parentDataProperty}]`))}function Uz(e,t){let{gen:r}=e;r.if(Gr._`Array.isArray(${t})`,()=>{r.assign(Zo.default.vErrors,Gr._`${Zo.default.vErrors} === null ? ${t} : ${Zo.default.vErrors}.concat(${t})`).assign(Zo.default.errors,Gr._`${Zo.default.vErrors}.length`),(0,Dz.extendErrors)(e)},()=>e.error())}function Lz({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function nM(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Gr.stringify)(r)})}function qz(e,t,r=!1){return!t.length||t.some((i)=>i==="array"?Array.isArray(e):i==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==i||r&&typeof e>"u")}iM.validSchemaType=qz;function Fz({schema:e,opts:t,self:r,errSchemaPath:i},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw Error("ajv implementation error");let s=n.dependencies;if(s===null||s===void 0?void 0:s.some((h)=>!Object.prototype.hasOwnProperty.call(e,h)))throw Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){let b=`keyword "${o}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(b);else throw Error(b)}}}iM.validateKeywordUsage=Fz});var cM=Je((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});uM.extendSubschemaMode=uM.extendSubschemaData=uM.getSubschema=void 0;var ei=mt(),aM=kt();function Kz(e,{keyword:t,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:o,topSchemaRef:s}){if(t!==void 0&&i!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let h=e.schema[t];return r===void 0?{schema:h,schemaPath:ei._`${e.schemaPath}${(0,ei.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:h[r],schemaPath:ei._`${e.schemaPath}${(0,ei.getProperty)(t)}${(0,ei.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,aM.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||o===void 0||s===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:s,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}uM.getSubschema=Kz;function Vz(e,t,{dataProp:r,dataPropType:i,data:n,dataTypes:o,propertyName:s}){if(n!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=t;if(r!==void 0){let{errorPath:v,dataPathArr:_,opts:g}=t,S=h.let("data",ei._`${t.data}${(0,ei.getProperty)(r)}`,!0);b(S),e.errorPath=ei.str`${v}${(0,aM.getErrorPath)(r,i,g.jsPropertySyntax)}`,e.parentDataProperty=ei._`${r}`,e.dataPathArr=[..._,e.parentDataProperty]}if(n!==void 0){let v=n instanceof ei.Name?n:h.let("data",n,!0);if(b(v),s!==void 0)e.propertyName=s}if(o)e.dataTypes=o;function b(v){e.data=v,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,v]}}uM.extendSubschemaData=Vz;function Wz(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:o}){if(i!==void 0)e.compositeRule=i;if(n!==void 0)e.createErrors=n;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}uM.extendSubschemaMode=Wz});var Tb=Je((hae,dM)=>{dM.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var s=o[n];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var hM=Je((pae,fM)=>{var io=fM.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Sp(t,i,n,e,"",e)};io.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};io.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};io.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};io.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Sp(e,t,r,i,n,o,s,h,b,v){if(i&&typeof i=="object"&&!Array.isArray(i)){t(i,n,o,s,h,b,v);for(var _ in i){var g=i[_];if(Array.isArray(g)){if(_ in io.arrayKeywords)for(var S=0;S<g.length;S++)Sp(e,t,r,g[S],n+"/"+_+"/"+S,o,n,_,i,S)}else if(_ in io.propsKeywords){if(g&&typeof g=="object")for(var x in g)Sp(e,t,r,g[x],n+"/"+_+"/"+Xz(x),o,n,_,i,x)}else if(_ in io.keywords||e.allKeys&&!(_ in io.skipKeywords))Sp(e,t,r,g,n+"/"+_,o,n,_,i)}r(i,n,o,s,h,b,v)}}function Xz(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var nc=Je((yM)=>{Object.defineProperty(yM,"__esModule",{value:!0});yM.getSchemaRefs=yM.resolveUrl=yM.normalizeId=yM._getFullPath=yM.getFullPath=yM.inlineRef=void 0;var Yz=kt(),Qz=Tb(),ej=hM(),tj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function rj(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!$b(e);if(!t)return!1;return pM(e)<=t}yM.inlineRef=rj;var nj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function $b(e){for(let t in e){if(nj.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some($b))return!0;if(typeof r=="object"&&$b(r))return!0}return!1}function pM(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,tj.has(r))continue;if(typeof e[r]=="object")(0,Yz.eachItem)(e[r],(i)=>t+=pM(i));if(t===1/0)return 1/0}return t}function mM(e,t="",r){if(r!==!1)t=ia(t);let i=e.parse(t);return gM(e,i)}yM.getFullPath=mM;function gM(e,t){return e.serialize(t).split("#")[0]+"#"}yM._getFullPath=gM;var ij=/#\/?$/;function ia(e){return e?e.replace(ij,""):""}yM.normalizeId=ia;function oj(e,t,r){return r=ia(r),e.resolve(t,r)}yM.resolveUrl=oj;var sj=/^[a-z_][-a-z0-9._]*$/i;function aj(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=ia(e[r]||t),o={"":n},s=mM(i,n,!1),h={},b=new Set;return ej(e,{allKeys:!0},(g,S,x,M)=>{if(M===void 0)return;let I=s+S,T=o[M];if(typeof g[r]=="string")T=$.call(this,g[r]);P.call(this,g.$anchor),P.call(this,g.$dynamicAnchor),o[S]=T;function $(R){let C=this.opts.uriResolver.resolve;if(R=ia(T?C(T,R):R),b.has(R))throw _(R);b.add(R);let D=this.refs[R];if(typeof D=="string")D=this.refs[D];if(typeof D=="object")v(g,D.schema,R);else if(R!==ia(I))if(R[0]==="#")v(g,h[R],R),h[R]=g;else this.refs[R]=I;return R}function P(R){if(typeof R=="string"){if(!sj.test(R))throw Error(`invalid anchor "${R}"`);$.call(this,`#${R}`)}}}),h;function v(g,S,x){if(S!==void 0&&!Qz(g,S))throw _(x)}function _(g){return Error(`reference "${g}" resolves to more than one schema`)}}yM.getSchemaRefs=aj});var sc=Je((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});CM.getData=CM.KeywordCxt=CM.validateFunctionCode=void 0;var xM=Dk(),bM=rc(),Ab=wb(),xp=rc(),hj=Xk(),oc=sM(),Pb=cM(),rt=mt(),lt=ki(),pj=nc(),Mi=kt(),ic=tc();function mj(e){if(EM(e)){if(IM(e),MM(e)){vj(e);return}}kM(e,()=>(0,xM.topBoolOrEmptySchema)(e))}CM.validateFunctionCode=mj;function kM({gen:e,validateName:t,schema:r,schemaEnv:i,opts:n},o){if(n.code.es5)e.func(t,rt._`${lt.default.data}, ${lt.default.valCxt}`,i.$async,()=>{e.code(rt._`"use strict"; ${_M(r,n)}`),yj(e,n),e.code(o)});else e.func(t,rt._`${lt.default.data}, ${gj(n)}`,i.$async,()=>e.code(_M(r,n)).code(o))}function gj(e){return rt._`{${lt.default.instancePath}="", ${lt.default.parentData}, ${lt.default.parentDataProperty}, ${lt.default.rootData}=${lt.default.data}${e.dynamicRef?rt._`, ${lt.default.dynamicAnchors}={}`:rt.nil}}={}`}function yj(e,t){e.if(lt.default.valCxt,()=>{if(e.var(lt.default.instancePath,rt._`${lt.default.valCxt}.${lt.default.instancePath}`),e.var(lt.default.parentData,rt._`${lt.default.valCxt}.${lt.default.parentData}`),e.var(lt.default.parentDataProperty,rt._`${lt.default.valCxt}.${lt.default.parentDataProperty}`),e.var(lt.default.rootData,rt._`${lt.default.valCxt}.${lt.default.rootData}`),t.dynamicRef)e.var(lt.default.dynamicAnchors,rt._`${lt.default.valCxt}.${lt.default.dynamicAnchors}`)},()=>{if(e.var(lt.default.instancePath,rt._`""`),e.var(lt.default.parentData,rt._`undefined`),e.var(lt.default.parentDataProperty,rt._`undefined`),e.var(lt.default.rootData,lt.default.data),t.dynamicRef)e.var(lt.default.dynamicAnchors,rt._`{}`)})}function vj(e){let{schema:t,opts:r,gen:i}=e;kM(e,()=>{if(r.$comment&&t.$comment)$M(e);if(xj(e),i.let(lt.default.vErrors,null),i.let(lt.default.errors,0),r.unevaluated)bj(e);TM(e),Ej(e)});return}function bj(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",rt._`${r}.evaluated`),t.if(rt._`${e.evaluated}.dynamicProps`,()=>t.assign(rt._`${e.evaluated}.props`,rt._`undefined`)),t.if(rt._`${e.evaluated}.dynamicItems`,()=>t.assign(rt._`${e.evaluated}.items`,rt._`undefined`))}function _M(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?rt._`/*# sourceURL=${r} */`:rt.nil}function _j(e,t){if(EM(e)){if(IM(e),MM(e)){wj(e,t);return}}(0,xM.boolOrEmptySchema)(e,t)}function MM({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function EM(e){return typeof e.schema!="boolean"}function wj(e,t){let{schema:r,gen:i,opts:n}=e;if(n.$comment&&r.$comment)$M(e);kj(e),Mj(e);let o=i.const("_errs",lt.default.errors);TM(e,o),i.var(t,rt._`${o} === ${lt.default.errors}`)}function IM(e){(0,Mi.checkUnknownRules)(e),Sj(e)}function TM(e,t){if(e.opts.jtd)return wM(e,[],!1,t);let r=(0,bM.getSchemaTypes)(e.schema),i=(0,bM.coerceAndCheckDataType)(e,r);wM(e,r,!i,t)}function Sj(e){let{schema:t,errSchemaPath:r,opts:i,self:n}=e;if(t.$ref&&i.ignoreKeywordsWithRef&&(0,Mi.schemaHasRulesButRef)(t,n.RULES))n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function xj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)(0,Mi.checkStrictMode)(e,"default is ignored in the schema root")}function kj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,pj.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function Mj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function $M({gen:e,schemaEnv:t,schema:r,errSchemaPath:i,opts:n}){let o=r.$comment;if(n.$comment===!0)e.code(rt._`${lt.default.self}.logger.log(${o})`);else if(typeof n.$comment=="function"){let s=rt.str`${i}/$comment`,h=e.scopeValue("root",{ref:t.root});e.code(rt._`${lt.default.self}.opts.$comment(${o}, ${s}, ${h}.schema)`)}}function Ej(e){let{gen:t,schemaEnv:r,validateName:i,ValidationError:n,opts:o}=e;if(r.$async)t.if(rt._`${lt.default.errors} === 0`,()=>t.return(lt.default.data),()=>t.throw(rt._`new ${n}(${lt.default.vErrors})`));else{if(t.assign(rt._`${i}.errors`,lt.default.vErrors),o.unevaluated)Ij(e);t.return(rt._`${lt.default.errors} === 0`)}}function Ij({gen:e,evaluated:t,props:r,items:i}){if(r instanceof rt.Name)e.assign(rt._`${t}.props`,r);if(i instanceof rt.Name)e.assign(rt._`${t}.items`,i)}function wM(e,t,r,i){let{gen:n,schema:o,data:s,allErrors:h,opts:b,self:v}=e,{RULES:_}=v;if(o.$ref&&(b.ignoreKeywordsWithRef||!(0,Mi.schemaHasRulesButRef)(o,_))){n.block(()=>AM(e,"$ref",_.all.$ref.definition));return}if(!b.jtd)Tj(e,t);n.block(()=>{for(let S of _.rules)g(S);g(_.post)});function g(S){if(!(0,Ab.shouldUseGroup)(o,S))return;if(S.type){if(n.if((0,xp.checkDataType)(S.type,s,b.strictNumbers)),SM(e,S),t.length===1&&t[0]===S.type&&r)n.else(),(0,xp.reportTypeError)(e);n.endIf()}else SM(e,S);if(!h)n.if(rt._`${lt.default.errors} === ${i||0}`)}}function SM(e,t){let{gen:r,schema:i,opts:{useDefaults:n}}=e;if(n)(0,hj.assignDefaults)(e,t.type);r.block(()=>{for(let o of t.rules)if((0,Ab.shouldUseRule)(i,o))AM(e,o.keyword,o.definition,t.type)})}function Tj(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if($j(e,t),!e.opts.allowUnionTypes)Pj(e,t);Aj(e,e.dataTypes)}function $j(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!PM(e.dataTypes,r))Rb(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Cj(e,t)}function Pj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Rb(e,"use allowUnionTypes to allow union type keyword")}function Aj(e,t){let r=e.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Ab.shouldUseRule)(e.schema,n)){let{type:o}=n.definition;if(o.length&&!o.some((s)=>Rj(t,s)))Rb(e,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function Rj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function PM(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Cj(e,t){let r=[];for(let i of e.dataTypes)if(PM(t,i))r.push(i);else if(t.includes("integer")&&i==="number")r.push("integer");e.dataTypes=r}function Rb(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Mi.checkStrictMode)(e,t,e.opts.strictTypes)}class Cb{constructor(e,t,r){if((0,oc.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Mi.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",RM(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,oc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",lt.default.errors)}result(e,t,r){this.failResult((0,rt.not)(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,rt.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(rt._`${t} !== undefined && (${(0,rt.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?ic.reportExtraError:ic.reportError)(this,this.def.error,t)}$dataError(){(0,ic.reportError)(this,this.def.$dataError||ic.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,ic.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=rt.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=rt.nil,t=rt.nil){if(!this.$data)return;let{gen:r,schemaCode:i,schemaType:n,def:o}=this;if(r.if((0,rt.or)(rt._`${i} === undefined`,t)),e!==rt.nil)r.assign(e,!0);if(n.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==rt.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:i,it:n}=this;return(0,rt.or)(o(),s());function o(){if(r.length){if(!(t instanceof rt.Name))throw Error("ajv implementation error");let h=Array.isArray(r)?r:[r];return rt._`${(0,xp.checkDataTypes)(h,t,n.opts.strictNumbers,xp.DataType.Wrong)}`}return rt.nil}function s(){if(i.validateSchema){let h=e.scopeValue("validate$data",{ref:i.validateSchema});return rt._`!${h}(${t})`}return rt.nil}}subschema(e,t){let r=(0,Pb.getSubschema)(this.it,e);(0,Pb.extendSubschemaData)(r,this.it,e),(0,Pb.extendSubschemaMode)(r,e);let i={...this.it,...r,items:void 0,props:void 0};return _j(i,t),i}mergeEvaluated(e,t){let{it:r,gen:i}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Mi.mergeEvaluated.props(i,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Mi.mergeEvaluated.items(i,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:i}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,rt.Name)),!0}}CM.KeywordCxt=Cb;function AM(e,t,r,i){let n=new Cb(e,r,t);if("code"in r)r.code(n,i);else if(n.$data&&r.validate)(0,oc.funcKeywordCode)(n,r);else if("macro"in r)(0,oc.macroKeywordCode)(n,r);else if(r.compile||r.validate)(0,oc.funcKeywordCode)(n,r)}var Oj=/^\/(?:[^~]|~0|~1)*$/,Nj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function RM(e,{dataLevel:t,dataNames:r,dataPathArr:i}){let n,o;if(e==="")return lt.default.rootData;if(e[0]==="/"){if(!Oj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);n=e,o=lt.default.rootData}else{let v=Nj.exec(e);if(!v)throw Error(`Invalid JSON-pointer: ${e}`);let _=+v[1];if(n=v[2],n==="#"){if(_>=t)throw Error(b("property/index",_));return i[t-_]}if(_>t)throw Error(b("data",_));if(o=r[t-_],!n)return o}let s=o,h=n.split("/");for(let v of h)if(v)o=rt._`${o}${(0,rt.getProperty)((0,Mi.unescapeJsonPointer)(v))}`,s=rt._`${s} && ${o}`;return s;function b(v,_){return`Cannot access ${v} ${_} levels up, current level is ${t}`}}CM.getData=RM});var kp=Je((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});class NM extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}DM.default=NM});var ac=Je((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var Ob=nc();class zM extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,Ob.resolveUrl)(e,t,r),this.missingSchema=(0,Ob.normalizeId)((0,Ob.getFullPath)(e,this.missingRef))}}jM.default=zM});var Ep=Je((qM)=>{Object.defineProperty(qM,"__esModule",{value:!0});qM.resolveSchema=qM.getCompilingSchema=qM.resolveRef=qM.compileSchema=qM.SchemaEnv=void 0;var Fn=mt(),Lj=kp(),Ko=ki(),Bn=nc(),UM=kt(),qj=sc();class uc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,Bn.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}qM.SchemaEnv=uc;function Db(e){let t=LM.call(this,e);if(t)return t;let r=(0,Bn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:o}=this.opts,s=new Fn.CodeGen(this.scope,{es5:i,lines:n,ownProperties:o}),h;if(e.$async)h=s.scopeValue("Error",{ref:Lj.default,code:Fn._`require("ajv/dist/runtime/validation_error").default`});let b=s.scopeName("validate");e.validateName=b;let v={gen:s,allErrors:this.opts.allErrors,data:Ko.default.data,parentData:Ko.default.parentData,parentDataProperty:Ko.default.parentDataProperty,dataNames:[Ko.default.data],dataPathArr:[Fn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Fn.stringify)(e.schema)}:{ref:e.schema}),validateName:b,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Fn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Fn._`""`,opts:this.opts,self:this},_;try{this._compilations.add(e),(0,qj.validateFunctionCode)(v),s.optimize(this.opts.code.optimize);let g=s.toString();if(_=`${s.scopeRefs(Ko.default.scope)}return ${g}`,this.opts.code.process)_=this.opts.code.process(_,e);let x=Function(`${Ko.default.self}`,`${Ko.default.scope}`,_)(this,this.scope.get());if(this.scope.value(b,{ref:x}),x.errors=null,x.schema=e.schema,x.schemaEnv=e,e.$async)x.$async=!0;if(this.opts.code.source===!0)x.source={validateName:b,validateCode:g,scopeValues:s._values};if(this.opts.unevaluated){let{props:M,items:I}=v;if(x.evaluated={props:M instanceof Fn.Name?void 0:M,items:I instanceof Fn.Name?void 0:I,dynamicProps:M instanceof Fn.Name,dynamicItems:I instanceof Fn.Name},x.source)x.source.evaluated=(0,Fn.stringify)(x.evaluated)}return e.validate=x,e}catch(g){if(delete e.validate,delete e.validateName,_)this.logger.error("Error compiling schema, function code:",_);throw g}finally{this._compilations.delete(e)}}qM.compileSchema=Db;function Fj(e,t,r){var i;r=(0,Bn.resolveUrl)(this.opts.uriResolver,t,r);let n=e.refs[r];if(n)return n;let o=Zj.call(this,e,r);if(o===void 0){let s=(i=e.localRefs)===null||i===void 0?void 0:i[r],{schemaId:h}=this.opts;if(s)o=new uc({schema:s,schemaId:h,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=Bj.call(this,o)}qM.resolveRef=Fj;function Bj(e){if((0,Bn.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Db.call(this,e)}function LM(e){for(let t of this._compilations)if(Hj(t,e))return t}qM.getCompilingSchema=LM;function Hj(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Zj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Mp.call(this,e,t)}function Mp(e,t){let r=this.opts.uriResolver.parse(t),i=(0,Bn._getFullPath)(this.opts.uriResolver,r),n=(0,Bn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===n)return Nb.call(this,r,e);let o=(0,Bn.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let h=Mp.call(this,e,s);if(typeof(h===null||h===void 0?void 0:h.schema)!=="object")return;return Nb.call(this,r,h)}if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;if(!s.validate)Db.call(this,s);if(o===(0,Bn.normalizeId)(t)){let{schema:h}=s,{schemaId:b}=this.opts,v=h[b];if(v)n=(0,Bn.resolveUrl)(this.opts.uriResolver,n,v);return new uc({schema:h,schemaId:b,root:e,baseId:n})}return Nb.call(this,r,s)}qM.resolveSchema=Mp;var Kj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Nb(e,{baseId:t,schema:r,root:i}){var n;if(((n=e.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let h of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let b=r[(0,UM.unescapeFragment)(h)];if(b===void 0)return;r=b;let v=typeof r==="object"&&r[this.opts.schemaId];if(!Kj.has(h)&&v)t=(0,Bn.resolveUrl)(this.opts.uriResolver,t,v)}let o;if(typeof r!="boolean"&&r.$ref&&!(0,UM.schemaHasRulesButRef)(r,this.RULES)){let h=(0,Bn.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Mp.call(this,i,h)}let{schemaId:s}=this.opts;if(o=o||new uc({schema:r,schemaId:s,root:i,baseId:t}),o.schema!==o.root.schema)return o;return}});var BM=Je((_ae,Xj)=>{Xj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ub=Je((wae,GM)=>{var Yj=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ZM=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),zb=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),KM=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Qj=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function jb(e){let t="",r=0,i=0;for(i=0;i<e.length;i++){if(r=e[i].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i];break}for(i+=1;i<e.length;i++){if(r=e[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[i]}return t}var eU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function HM(e){return e.length=0,!0}function tU(e,t,r){if(e.length){let i=jb(e);if(i!=="")t.push(i);else return r.error=!0,!1;e.length=0}return!0}function rU(e){let t=0,r={error:!1,address:"",zone:""},i=[],n=[],o=!1,s=!1,h=tU;for(let b=0;b<e.length;b++){let v=e[b];if(v==="["||v==="]")continue;if(v===":"){if(o===!0)s=!0;if(!h(n,i,r))break;if(++t>7){r.error=!0;break}if(b>0&&e[b-1]===":")o=!0;i.push(":");continue}else if(v==="%"){if(!h(n,i,r))break;h=HM}else{n.push(v);continue}}if(n.length)if(h===HM)r.zone=n.join("");else if(s)i.push(n.join(""));else i.push(jb(n));return r.address=i.join(""),r}function VM(e){if(nU(e,":")<2)return{host:e,isIPV6:!1};let t=rU(e);if(!t.error){let{address:r,address:i}=t;if(t.zone)r+="%"+t.zone,i+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:i}}else return{host:e,isIPV6:!1}}function nU(e,t){let r=0;for(let i=0;i<e.length;i++)if(e[i]===t)r++;return r}function iU(e){let t=e,r=[],i=-1,n=0;while(n=t.length){if(n===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(n===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(n===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((i=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,i)),t=t.slice(i)}return r.join("")}var oU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},sU=/[@/?#:]/g,aU=/[@/?#]/g;function WM(e,t){let r=t?aU:sU;return r.lastIndex=0,e.replace(r,(i)=>oU[i])}function uU(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let i=0;i<e.length;i++){if(e[i]==="%"&&i+2<e.length){let n=e.slice(i+1,i+3);if(zb(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));if(t&&KM(s))r+=s;else r+="%"+o;i+=2;continue}}r+=e[i]}return r}function lU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(zb(i)){let n=i.toUpperCase(),o=String.fromCharCode(parseInt(n,16));if(o!=="."&&KM(o))t+=o;else t+="%"+n;r+=2;continue}}if(Qj(e[r]))t+=e[r];else t+=escape(e[r])}return t}function cU(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(zb(i)){t+="%"+i.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function dU(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!ZM(r)){let i=VM(r);if(i.isIPV6===!0)r=`[${i.escapedHost}]`;else r=WM(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}GM.exports={nonSimpleDomain:eU,recomposeAuthority:dU,reescapeHostDelimiters:WM,normalizePercentEncoding:uU,normalizePathEncoding:lU,escapePreservingEscapes:cU,removeDotSegments:iU,isIPv4:ZM,isUUID:Yj,normalizeIPv6:VM,stringArrayToHexStripped:jb}});var e4=Je((Sae,QM)=>{var{isUUID:fU}=Ub(),hU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,pU=["http","https","ws","wss","urn","urn:uuid"];function mU(e){return pU.indexOf(e)!==-1}function Lb(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function JM(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function XM(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function gU(e){return e.secure=Lb(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function yU(e){if(e.port===(Lb(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function vU(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(hU);if(r){let i=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let n=`${i}:${t.nid||e.nid}`,o=qb(n);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function bU(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",i=e.nid.toLowerCase(),n=`${r}:${t.nid||i}`,o=qb(n);if(o)e=o.serialize(e,t);let s=e,h=e.nss;return s.path=`${i||t.nid}:${h}`,t.skipEscape=!0,s}function _U(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!fU(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function wU(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var YM={scheme:"http",domainHost:!0,parse:JM,serialize:XM},SU={scheme:"https",domainHost:YM.domainHost,parse:JM,serialize:XM},Ip={scheme:"ws",domainHost:!0,parse:gU,serialize:yU},xU={scheme:"wss",domainHost:Ip.domainHost,parse:Ip.parse,serialize:Ip.serialize},kU={scheme:"urn",parse:vU,serialize:bU,skipNormalize:!0},MU={scheme:"urn:uuid",parse:_U,serialize:wU,skipNormalize:!0},Tp={http:YM,https:SU,ws:Ip,wss:xU,urn:kU,"urn:uuid":MU};Object.setPrototypeOf(Tp,null);function qb(e){return e&&(Tp[e]||Tp[e.toLowerCase()])||void 0}QM.exports={wsIsSecure:Lb,SCHEMES:Tp,isValidSchemeName:mU,getSchemeHandler:qb}});var s4=Je((xae,$p)=>{var{normalizeIPv6:EU,removeDotSegments:lc,recomposeAuthority:IU,normalizePercentEncoding:TU,normalizePathEncoding:$U,escapePreservingEscapes:PU,reescapeHostDelimiters:AU,isIPv4:RU,nonSimpleDomain:CU}=Ub(),{SCHEMES:OU,getSchemeHandler:r4}=e4();function NU(e,t){if(typeof e==="string")e=LU(e,t);else if(typeof e==="object")e=oa(Vo(e,t),t);return e}function DU(e,t,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=n4(oa(e,i),oa(t,i),i,!0);return i.skipEscape=!0,Vo(n,i)}function n4(e,t,r,i){let n={};if(!i)e=oa(Vo(e,r),r),t=oa(Vo(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=lc(t.path||""),n.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=lc(t.path||""),n.query=t.query;else{if(!t.path)if(n.path=e.path,t.query!==void 0)n.query=t.query;else n.query=e.query;else{if(t.path[0]==="/")n.path=lc(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)n.path="/"+t.path;else if(!e.path)n.path=t.path;else n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;n.path=lc(n.path)}n.query=t.query}n.userinfo=e.userinfo,n.host=e.host,n.port=e.port}n.scheme=e.scheme}return n.fragment=t.fragment,n}function zU(e,t,r){let i=t4(e,r),n=t4(t,r);return i!==void 0&&n!==void 0&&i.toLowerCase()===n.toLowerCase()}function Vo(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},i=Object.assign({},t),n=[],o=r4(i.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,i);if(r.path!==void 0)if(!i.skipEscape){if(r.path=PU(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=TU(r.path);if(i.reference!=="suffix"&&r.scheme)n.push(r.scheme,":");let s=IU(r);if(s!==void 0){if(i.reference!=="suffix")n.push("//");if(n.push(s),r.path&&r.path[0]!=="/")n.push("/")}if(r.path!==void 0){let h=r.path;if(!i.absolutePath&&(!o||!o.absolutePath))h=lc(h);if(s===void 0&&h[0]==="/"&&h[1]==="/")h="/%2F"+h.slice(2);n.push(h)}if(r.query!==void 0)n.push("?",r.query);if(r.fragment!==void 0)n.push("#",r.fragment);return n.join("")}var jU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function UU(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function i4(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,o=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let s=e.match(jU);if(s){if(i.scheme=s[1],i.userinfo=s[3],i.host=s[4],i.port=parseInt(s[5],10),i.path=s[6]||"",i.query=s[7],i.fragment=s[8],isNaN(i.port))i.port=s[5];let h=UU(i,s);if(h!==void 0)i.error=i.error||h,n=!0;if(i.host)if(RU(i.host)===!1){let _=EU(i.host);i.host=_.host.toLowerCase(),o=_.isIPV6}else o=!0;if(i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path)i.reference="same-document";else if(i.scheme===void 0)i.reference="relative";else if(i.fragment===void 0)i.reference="absolute";else i.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==i.reference)i.error=i.error||"URI is not a "+r.reference+" reference.";let b=r4(r.scheme||i.scheme);if(!r.unicodeSupport&&(!b||!b.unicodeSupport)){if(i.host&&(r.domainHost||b&&b.domainHost)&&o===!1&&CU(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(v){i.error=i.error||"Host's domain name can not be converted to ASCII: "+v}}if(!b||b&&!b.skipNormalize){if(e.indexOf("%")!==-1){if(i.scheme!==void 0)i.scheme=unescape(i.scheme);if(i.host!==void 0)i.host=AU(unescape(i.host),o)}if(i.path)i.path=$U(i.path);if(i.fragment)try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}}if(b&&b.parse)b.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n}}function oa(e,t){return i4(e,t).parsed}function LU(e,t){return o4(e,t).normalized}function o4(e,t){let{parsed:r,malformedAuthorityOrPort:i}=i4(e,t);return{normalized:i?e:Vo(r,t),malformedAuthorityOrPort:i}}function t4(e,t){if(typeof e==="string"){let{normalized:r,malformedAuthorityOrPort:i}=o4(e,t);return i?void 0:r}if(typeof e==="object")return Vo(e,t)}var Fb={SCHEMES:OU,normalize:NU,resolve:DU,resolveComponent:n4,equal:zU,serialize:Vo,parse:oa};$p.exports=Fb;$p.exports.default=Fb;$p.exports.fastUri=Fb});var l4=Je((u4)=>{Object.defineProperty(u4,"__esModule",{value:!0});var a4=s4();a4.code='require("ajv/dist/runtime/uri").default';u4.default=a4});var y4=Je((Ei)=>{Object.defineProperty(Ei,"__esModule",{value:!0});Ei.CodeGen=Ei.Name=Ei.nil=Ei.stringify=Ei.str=Ei._=Ei.KeywordCxt=void 0;var FU=sc();Object.defineProperty(Ei,"KeywordCxt",{enumerable:!0,get:function(){return FU.KeywordCxt}});var sa=mt();Object.defineProperty(Ei,"_",{enumerable:!0,get:function(){return sa._}});Object.defineProperty(Ei,"str",{enumerable:!0,get:function(){return sa.str}});Object.defineProperty(Ei,"stringify",{enumerable:!0,get:function(){return sa.stringify}});Object.defineProperty(Ei,"nil",{enumerable:!0,get:function(){return sa.nil}});Object.defineProperty(Ei,"Name",{enumerable:!0,get:function(){return sa.Name}});Object.defineProperty(Ei,"CodeGen",{enumerable:!0,get:function(){return sa.CodeGen}});var BU=kp(),p4=ac(),HU=_b(),cc=Ep(),ZU=mt(),dc=nc(),Pp=rc(),Hb=kt(),c4=BM(),KU=l4(),m4=(e,t)=>new RegExp(e,t);m4.code="new RegExp";var VU=["removeAdditional","useDefaults","coerceTypes"],WU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),GU={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},JU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},d4=200;function XU(e){var t,r,i,n,o,s,h,b,v,_,g,S,x,M,I,T,$,P,R,C,D,B,ie,le,ue;let q=e.strict,ee=(t=e.code)===null||t===void 0?void 0:t.optimize,a=ee===!0||ee===void 0?1:ee||0,c=(i=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:m4,f=(n=e.uriResolver)!==null&&n!==void 0?n:KU.default;return{strictSchema:(s=(o=e.strictSchema)!==null&&o!==void 0?o:q)!==null&&s!==void 0?s:!0,strictNumbers:(b=(h=e.strictNumbers)!==null&&h!==void 0?h:q)!==null&&b!==void 0?b:!0,strictTypes:(_=(v=e.strictTypes)!==null&&v!==void 0?v:q)!==null&&_!==void 0?_:"log",strictTuples:(S=(g=e.strictTuples)!==null&&g!==void 0?g:q)!==null&&S!==void 0?S:"log",strictRequired:(M=(x=e.strictRequired)!==null&&x!==void 0?x:q)!==null&&M!==void 0?M:!1,code:e.code?{...e.code,optimize:a,regExp:c}:{optimize:a,regExp:c},loopRequired:(I=e.loopRequired)!==null&&I!==void 0?I:d4,loopEnum:(T=e.loopEnum)!==null&&T!==void 0?T:d4,meta:($=e.meta)!==null&&$!==void 0?$:!0,messages:(P=e.messages)!==null&&P!==void 0?P:!0,inlineRefs:(R=e.inlineRefs)!==null&&R!==void 0?R:!0,schemaId:(C=e.schemaId)!==null&&C!==void 0?C:"$id",addUsedSchema:(D=e.addUsedSchema)!==null&&D!==void 0?D:!0,validateSchema:(B=e.validateSchema)!==null&&B!==void 0?B:!0,validateFormats:(ie=e.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(le=e.unicodeRegExp)!==null&&le!==void 0?le:!0,int32range:(ue=e.int32range)!==null&&ue!==void 0?ue:!0,uriResolver:f}}class Ap{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...XU(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new ZU.ValueScope({scope:{},prefixes:WU,es5:t,lines:r}),this.logger=nL(e.logger);let i=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,HU.getRules)(),f4.call(this,GU,e,"NOT SUPPORTED"),f4.call(this,JU,e,"DEPRECATED","warn"),this._metaOpts=tL.call(this),e.formats)QU.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)eL.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);YU.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,i=c4;if(r==="id")i={...c4},i.id=i.$id,delete i.$id;if(t&&e)this.addMetaSchema(i,i[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let i=r(t);if(!("$async"in r))this.errors=r.errors;return i}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return i.call(this,e,t);async function i(v,_){await n.call(this,v.$schema);let g=this._addSchema(v,_);return g.validate||o.call(this,g)}async function n(v){if(v&&!this.getSchema(v))await i.call(this,{$ref:v},!0)}async function o(v){try{return this._compileSchemaEnv(v)}catch(_){if(!(_ instanceof p4.default))throw _;return s.call(this,_),await h.call(this,_.missingSchema),o.call(this,v)}}function s({missingSchema:v,missingRef:_}){if(this.refs[v])throw Error(`AnySchema ${v} is loaded but ${_} cannot be resolved`)}async function h(v){let _=await b.call(this,v);if(!this.refs[v])await n.call(this,_.$schema);if(!this.refs[v])this.addSchema(_,v,t)}async function b(v){let _=this._loading[v];if(_)return _;try{return await(this._loading[v]=r(v))}finally{delete this._loading[v]}}}addSchema(e,t,r,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,i);return this}let n;if(typeof e==="object"){let{schemaId:o}=this.opts;if(n=e[o],n!==void 0&&typeof n!="string")throw Error(`schema ${o} must be string`)}return t=(0,dc.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,i,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(r,e);if(!i&&t){let n="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(n);else throw Error(n)}return i}getSchema(e){let t;while(typeof(t=h4.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,i=new cc.SchemaEnv({schema:{},schemaId:r});if(t=cc.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=h4.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=(0,dc.normalizeId)(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(oL.call(this,r,t),!t)return(0,Hb.eachItem)(r,(n)=>Bb.call(this,n)),this;aL.call(this,t);let i={...t,type:(0,Pp.getJSONTypes)(t.type),schemaType:(0,Pp.getJSONTypes)(t.schemaType)};return(0,Hb.eachItem)(r,i.type.length===0?(n)=>Bb.call(this,n,i):(n)=>i.type.forEach((o)=>Bb.call(this,n,i,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let i=r.rules.findIndex((n)=>n.keyword===e);if(i>=0)r.rules.splice(i,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((i)=>`${r}${i.instancePath} ${i.message}`).reduce((i,n)=>i+t+n)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){let n=i.split("/").slice(1),o=e;for(let s of n)o=o[s];for(let s in r){let h=r[s];if(typeof h!="object")continue;let{$data:b}=h.definition,v=o[s];if(b&&v)o[s]=g4(v)}}return e}_removeAllSchemas(e,t){for(let r in e){let i=e[r];if(!t||t.test(r)){if(typeof i=="string")delete e[r];else if(i&&!i.meta)this._cache.delete(i.schema),delete e[r]}}}_addSchema(e,t,r,i=this.opts.validateSchema,n=this.opts.addUsedSchema){let o,{schemaId:s}=this.opts;if(typeof e=="object")o=e[s];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let h=this._cache.get(e);if(h!==void 0)return h;r=(0,dc.normalizeId)(o||r);let b=dc.getSchemaRefs.call(this,e,r);if(h=new cc.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:b}),this._cache.set(h.schema,h),n&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=h}if(i)this.validateSchema(e,!0);return h}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else cc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{cc.compileSchema.call(this,e)}finally{this.opts=t}}}Ap.ValidationError=BU.default;Ap.MissingRefError=p4.default;Ei.default=Ap;function f4(e,t,r,i="error"){for(let n in e){let o=n;if(o in t)this.logger[i](`${r}: option ${n}. ${e[o]}`)}}function h4(e){return e=(0,dc.normalizeId)(e),this.schemas[e]||this.refs[e]}function YU(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function QU(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function eL(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function tL(){let e={...this.opts};for(let t of VU)delete e[t];return e}var rL={log(){},warn(){},error(){}};function nL(e){if(e===!1)return rL;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var iL=/^[a-z_$][a-z0-9_$:-]*$/i;function oL(e,t){let{RULES:r}=this;if((0,Hb.eachItem)(e,(i)=>{if(r.keywords[i])throw Error(`Keyword ${i} is already defined`);if(!iL.test(i))throw Error(`Keyword ${i} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Bb(e,t,r){var i;let n=t===null||t===void 0?void 0:t.post;if(r&&n)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=n?o.post:o.rules.find(({type:b})=>b===r);if(!s)s={type:r,rules:[]},o.rules.push(s);if(o.keywords[e]=!0,!t)return;let h={keyword:e,definition:{...t,type:(0,Pp.getJSONTypes)(t.type),schemaType:(0,Pp.getJSONTypes)(t.schemaType)}};if(t.before)sL.call(this,s,h,t.before);else s.rules.push(h);o.all[e]=h,(i=t.implements)===null||i===void 0||i.forEach((b)=>this.addKeyword(b))}function sL(e,t,r){let i=e.rules.findIndex((n)=>n.keyword===r);if(i>=0)e.rules.splice(i,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function aL(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=g4(t);e.validateSchema=this.compile(t,!0)}var uL={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function g4(e){return{anyOf:[e,uL]}}});var b4=Je((v4)=>{Object.defineProperty(v4,"__esModule",{value:!0});var dL={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};v4.default=dL});var M4=Je((x4)=>{Object.defineProperty(x4,"__esModule",{value:!0});x4.callRef=x4.getValidate=void 0;var hL=ac(),_4=Pn(),sn=mt(),aa=ki(),w4=Ep(),Rp=kt(),pL={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:n,schemaEnv:o,validateName:s,opts:h,self:b}=i,{root:v}=o;if((r==="#"||r==="#/")&&n===v.baseId)return g();let _=w4.resolveRef.call(b,v,n,r);if(_===void 0)throw new hL.default(i.opts.uriResolver,n,r);if(_ instanceof w4.SchemaEnv)return S(_);return x(_);function g(){if(o===v)return Cp(e,s,o,o.$async);let M=t.scopeValue("root",{ref:v});return Cp(e,sn._`${M}.validate`,v,v.$async)}function S(M){let I=S4(e,M);Cp(e,I,M,M.$async)}function x(M){let I=t.scopeValue("schema",h.code.source===!0?{ref:M,code:(0,sn.stringify)(M)}:{ref:M}),T=t.name("valid"),$=e.subschema({schema:M,dataTypes:[],schemaPath:sn.nil,topSchemaRef:I,errSchemaPath:r},T);e.mergeEvaluated($),e.ok(T)}}};function S4(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):sn._`${r.scopeValue("wrapper",{ref:t})}.validate`}x4.getValidate=S4;function Cp(e,t,r,i){let{gen:n,it:o}=e,{allErrors:s,schemaEnv:h,opts:b}=o,v=b.passContext?aa.default.this:sn.nil;if(i)_();else g();function _(){if(!h.$async)throw Error("async schema referenced by sync schema");let M=n.let("valid");n.try(()=>{if(n.code(sn._`await ${(0,_4.callValidateCode)(e,t,v)}`),x(t),!s)n.assign(M,!0)},(I)=>{if(n.if(sn._`!(${I} instanceof ${o.ValidationError})`,()=>n.throw(I)),S(I),!s)n.assign(M,!1)}),e.ok(M)}function g(){e.result((0,_4.callValidateCode)(e,t,v),()=>x(t),()=>S(t))}function S(M){let I=sn._`${M}.errors`;n.assign(aa.default.vErrors,sn._`${aa.default.vErrors} === null ? ${I} : ${aa.default.vErrors}.concat(${I})`),n.assign(aa.default.errors,sn._`${aa.default.vErrors}.length`)}function x(M){var I;if(!o.opts.unevaluated)return;let T=(I=r===null||r===void 0?void 0:r.validate)===null||I===void 0?void 0:I.evaluated;if(o.props!==!0)if(T&&!T.dynamicProps){if(T.props!==void 0)o.props=Rp.mergeEvaluated.props(n,T.props,o.props)}else{let $=n.var("props",sn._`${M}.evaluated.props`);o.props=Rp.mergeEvaluated.props(n,$,o.props,sn.Name)}if(o.items!==!0)if(T&&!T.dynamicItems){if(T.items!==void 0)o.items=Rp.mergeEvaluated.items(n,T.items,o.items)}else{let $=n.var("items",sn._`${M}.evaluated.items`);o.items=Rp.mergeEvaluated.items(n,$,o.items,sn.Name)}}}x4.callRef=Cp;x4.default=pL});var I4=Je((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});var yL=b4(),vL=M4(),bL=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yL.default,vL.default];E4.default=bL});var $4=Je((T4)=>{Object.defineProperty(T4,"__esModule",{value:!0});var Op=mt(),oo=Op.operators,Np={maximum:{okStr:"<=",ok:oo.LTE,fail:oo.GT},minimum:{okStr:">=",ok:oo.GTE,fail:oo.LT},exclusiveMaximum:{okStr:"<",ok:oo.LT,fail:oo.GTE},exclusiveMinimum:{okStr:">",ok:oo.GT,fail:oo.LTE}},wL={message:({keyword:e,schemaCode:t})=>Op.str`must be ${Np[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Op._`{comparison: ${Np[e].okStr}, limit: ${t}}`},SL={keyword:Object.keys(Np),type:"number",schemaType:"number",$data:!0,error:wL,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data(Op._`${r} ${Np[t].fail} ${i} || isNaN(${r})`)}};T4.default=SL});var A4=Je((P4)=>{Object.defineProperty(P4,"__esModule",{value:!0});var fc=mt(),kL={message:({schemaCode:e})=>fc.str`must be multiple of ${e}`,params:({schemaCode:e})=>fc._`{multipleOf: ${e}}`},ML={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kL,code(e){let{gen:t,data:r,schemaCode:i,it:n}=e,o=n.opts.multipleOfPrecision,s=t.let("res"),h=o?fc._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:fc._`${s} !== parseInt(${s})`;e.fail$data(fc._`(${i} === 0 || (${s} = ${r}/${i}, ${h}))`)}};P4.default=ML});var O4=Je((C4)=>{Object.defineProperty(C4,"__esModule",{value:!0});function R4(e){let t=e.length,r=0,i=0,n;while(i<t)if(r++,n=e.charCodeAt(i++),n>=55296&&n<=56319&&i<t){if(n=e.charCodeAt(i),(n&64512)===56320)i++}return r}C4.default=R4;R4.code='require("ajv/dist/runtime/ucs2length").default'});var D4=Je((N4)=>{Object.defineProperty(N4,"__esModule",{value:!0});var Wo=mt(),TL=kt(),$L=O4(),PL={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return Wo.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>Wo._`{limit: ${e}}`},AL={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:PL,code(e){let{keyword:t,data:r,schemaCode:i,it:n}=e,o=t==="maxLength"?Wo.operators.GT:Wo.operators.LT,s=n.opts.unicode===!1?Wo._`${r}.length`:Wo._`${(0,TL.useFunc)(e.gen,$L.default)}(${r})`;e.fail$data(Wo._`${s} ${o} ${i}`)}};N4.default=AL});var j4=Je((z4)=>{Object.defineProperty(z4,"__esModule",{value:!0});var CL=Pn(),OL=kt(),ua=mt(),NL={message:({schemaCode:e})=>ua.str`must match pattern "${e}"`,params:({schemaCode:e})=>ua._`{pattern: ${e}}`},DL={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:NL,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e,h=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:b}=s.opts.code,v=b.code==="new RegExp"?ua._`new RegExp`:(0,OL.useFunc)(t,b),_=t.let("valid");t.try(()=>t.assign(_,ua._`${v}(${o}, ${h}).test(${r})`),()=>t.assign(_,!1)),e.fail$data(ua._`!${_}`)}else{let b=(0,CL.usePattern)(e,n);e.fail$data(ua._`!${b}.test(${r})`)}}};z4.default=DL});var L4=Je((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});var hc=mt(),jL={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return hc.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>hc._`{limit: ${e}}`},UL={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jL,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxProperties"?hc.operators.GT:hc.operators.LT;e.fail$data(hc._`Object.keys(${r}).length ${n} ${i}`)}};U4.default=UL});var F4=Je((q4)=>{Object.defineProperty(q4,"__esModule",{value:!0});var pc=Pn(),mc=mt(),qL=kt(),FL={message:({params:{missingProperty:e}})=>mc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>mc._`{missingProperty: ${e}}`},BL={keyword:"required",type:"object",schemaType:"array",$data:!0,error:FL,code(e){let{gen:t,schema:r,schemaCode:i,data:n,$data:o,it:s}=e,{opts:h}=s;if(!o&&r.length===0)return;let b=r.length>=h.loopRequired;if(s.allErrors)v();else _();if(h.strictRequired){let x=e.parentSchema.properties,{definedProperties:M}=e.it;for(let I of r)if((x===null||x===void 0?void 0:x[I])===void 0&&!M.has(I)){let T=s.schemaEnv.baseId+s.errSchemaPath,$=`required property "${I}" is not defined at "${T}" (strictRequired)`;(0,qL.checkStrictMode)(s,$,s.opts.strictRequired)}}function v(){if(b||o)e.block$data(mc.nil,g);else for(let x of r)(0,pc.checkReportMissingProp)(e,x)}function _(){let x=t.let("missing");if(b||o){let M=t.let("valid",!0);e.block$data(M,()=>S(x,M)),e.ok(M)}else t.if((0,pc.checkMissingProp)(e,r,x)),(0,pc.reportMissingProp)(e,x),t.else()}function g(){t.forOf("prop",i,(x)=>{e.setParams({missingProperty:x}),t.if((0,pc.noPropertyInData)(t,n,x,h.ownProperties),()=>e.error())})}function S(x,M){e.setParams({missingProperty:x}),t.forOf(x,i,()=>{t.assign(M,(0,pc.propertyInData)(t,n,x,h.ownProperties)),t.if((0,mc.not)(M),()=>{e.error(),t.break()})},mc.nil)}}};q4.default=BL});var H4=Je((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});var gc=mt(),ZL={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return gc.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>gc._`{limit: ${e}}`},KL={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ZL,code(e){let{keyword:t,data:r,schemaCode:i}=e,n=t==="maxItems"?gc.operators.GT:gc.operators.LT;e.fail$data(gc._`${r}.length ${n} ${i}`)}};B4.default=KL});var Dp=Je((K4)=>{Object.defineProperty(K4,"__esModule",{value:!0});var Z4=Tb();Z4.code='require("ajv/dist/runtime/equal").default';K4.default=Z4});var W4=Je((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});var Zb=rc(),Cr=mt(),GL=kt(),JL=Dp(),XL={message:({params:{i:e,j:t}})=>Cr.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Cr._`{i: ${e}, j: ${t}}`},YL={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:XL,code(e){let{gen:t,data:r,$data:i,schema:n,parentSchema:o,schemaCode:s,it:h}=e;if(!i&&!n)return;let b=t.let("valid"),v=o.items?(0,Zb.getSchemaTypes)(o.items):[];e.block$data(b,_,Cr._`${s} === false`),e.ok(b);function _(){let M=t.let("i",Cr._`${r}.length`),I=t.let("j");e.setParams({i:M,j:I}),t.assign(b,!0),t.if(Cr._`${M} > 1`,()=>(g()?S:x)(M,I))}function g(){return v.length>0&&!v.some((M)=>M==="object"||M==="array")}function S(M,I){let T=t.name("item"),$=(0,Zb.checkDataTypes)(v,T,h.opts.strictNumbers,Zb.DataType.Wrong),P=t.const("indices",Cr._`{}`);t.for(Cr._`;${M}--;`,()=>{if(t.let(T,Cr._`${r}[${M}]`),t.if($,Cr._`continue`),v.length>1)t.if(Cr._`typeof ${T} == "string"`,Cr._`${T} += "_"`);t.if(Cr._`typeof ${P}[${T}] == "number"`,()=>{t.assign(I,Cr._`${P}[${T}]`),e.error(),t.assign(b,!1).break()}).code(Cr._`${P}[${T}] = ${M}`)})}function x(M,I){let T=(0,GL.useFunc)(t,JL.default),$=t.name("outer");t.label($).for(Cr._`;${M}--;`,()=>t.for(Cr._`${I} = ${M}; ${I}--;`,()=>t.if(Cr._`${T}(${r}[${M}], ${r}[${I}])`,()=>{e.error(),t.assign(b,!1).break($)})))}}};V4.default=YL});var J4=Je((G4)=>{Object.defineProperty(G4,"__esModule",{value:!0});var Kb=mt(),eq=kt(),tq=Dp(),rq={message:"must be equal to constant",params:({schemaCode:e})=>Kb._`{allowedValue: ${e}}`},nq={keyword:"const",$data:!0,error:rq,code(e){let{gen:t,data:r,$data:i,schemaCode:n,schema:o}=e;if(i||o&&typeof o=="object")e.fail$data(Kb._`!${(0,eq.useFunc)(t,tq.default)}(${r}, ${n})`);else e.fail(Kb._`${o} !== ${r}`)}};G4.default=nq});var Y4=Je((X4)=>{Object.defineProperty(X4,"__esModule",{value:!0});var yc=mt(),oq=kt(),sq=Dp(),aq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>yc._`{allowedValues: ${e}}`},uq={keyword:"enum",schemaType:"array",$data:!0,error:aq,code(e){let{gen:t,data:r,$data:i,schema:n,schemaCode:o,it:s}=e;if(!i&&n.length===0)throw Error("enum must have non-empty array");let h=n.length>=s.opts.loopEnum,b,v=()=>b!==null&&b!==void 0?b:b=(0,oq.useFunc)(t,sq.default),_;if(h||i)_=t.let("valid"),e.block$data(_,g);else{if(!Array.isArray(n))throw Error("ajv implementation error");let x=t.const("vSchema",o);_=(0,yc.or)(...n.map((M,I)=>S(x,I)))}e.pass(_);function g(){t.assign(_,!1),t.forOf("v",o,(x)=>t.if(yc._`${v()}(${r}, ${x})`,()=>t.assign(_,!0).break()))}function S(x,M){let I=n[M];return typeof I==="object"&&I!==null?yc._`${v()}(${r}, ${x}[${M}])`:yc._`${r} === ${I}`}}};X4.default=uq});var e3=Je((Q4)=>{Object.defineProperty(Q4,"__esModule",{value:!0});var cq=$4(),dq=A4(),fq=D4(),hq=j4(),pq=L4(),mq=F4(),gq=H4(),yq=W4(),vq=J4(),bq=Y4(),_q=[cq.default,dq.default,fq.default,hq.default,pq.default,mq.default,gq.default,yq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},vq.default,bq.default];Q4.default=_q});var Wb=Je((r3)=>{Object.defineProperty(r3,"__esModule",{value:!0});r3.validateAdditionalItems=void 0;var Go=mt(),Vb=kt(),Sq={message:({params:{len:e}})=>Go.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Go._`{limit: ${e}}`},xq={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Sq,code(e){let{parentSchema:t,it:r}=e,{items:i}=t;if(!Array.isArray(i)){(0,Vb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}t3(e,i)}};function t3(e,t){let{gen:r,schema:i,data:n,keyword:o,it:s}=e;s.items=!0;let h=r.const("len",Go._`${n}.length`);if(i===!1)e.setParams({len:t.length}),e.pass(Go._`${h} <= ${t.length}`);else if(typeof i=="object"&&!(0,Vb.alwaysValidSchema)(s,i)){let v=r.var("valid",Go._`${h} <= ${t.length}`);r.if((0,Go.not)(v),()=>b(v)),e.ok(v)}function b(v){r.forRange("i",t.length,h,(_)=>{if(e.subschema({keyword:o,dataProp:_,dataPropType:Vb.Type.Num},v),!s.allErrors)r.if((0,Go.not)(v),()=>r.break())})}}r3.validateAdditionalItems=t3;r3.default=xq});var Gb=Je((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});s3.validateTuple=void 0;var i3=mt(),zp=kt(),Mq=Pn(),Eq={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return o3(e,"additionalItems",t);if(r.items=!0,(0,zp.alwaysValidSchema)(r,t))return;e.ok((0,Mq.validateArray)(e))}};function o3(e,t,r=e.schema){let{gen:i,parentSchema:n,data:o,keyword:s,it:h}=e;if(_(n),h.opts.unevaluated&&r.length&&h.items!==!0)h.items=zp.mergeEvaluated.items(i,r.length,h.items);let b=i.name("valid"),v=i.const("len",i3._`${o}.length`);r.forEach((g,S)=>{if((0,zp.alwaysValidSchema)(h,g))return;i.if(i3._`${v} > ${S}`,()=>e.subschema({keyword:s,schemaProp:S,dataProp:S},b)),e.ok(b)});function _(g){let{opts:S,errSchemaPath:x}=h,M=r.length,I=M===g.minItems&&(M===g.maxItems||g[t]===!1);if(S.strictTuples&&!I){let T=`"${s}" is ${M}-tuple, but minItems or maxItems/${t} are not specified or different at path "${x}"`;(0,zp.checkStrictMode)(h,T,S.strictTuples)}}}s3.validateTuple=o3;s3.default=Eq});var l3=Je((u3)=>{Object.defineProperty(u3,"__esModule",{value:!0});var Tq=Gb(),$q={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,Tq.validateTuple)(e,"items")};u3.default=$q});var f3=Je((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});var c3=mt(),Aq=kt(),Rq=Pn(),Cq=Wb(),Oq={message:({params:{len:e}})=>c3.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>c3._`{limit: ${e}}`},Nq={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Oq,code(e){let{schema:t,parentSchema:r,it:i}=e,{prefixItems:n}=r;if(i.items=!0,(0,Aq.alwaysValidSchema)(i,t))return;if(n)(0,Cq.validateAdditionalItems)(e,n);else e.ok((0,Rq.validateArray)(e))}};d3.default=Nq});var p3=Je((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});var An=mt(),jp=kt(),zq={message:({params:{min:e,max:t}})=>t===void 0?An.str`must contain at least ${e} valid item(s)`:An.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?An._`{minContains: ${e}}`:An._`{minContains: ${e}, maxContains: ${t}}`},jq={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:zq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e,s,h,{minContains:b,maxContains:v}=i;if(o.opts.next)s=b===void 0?1:b,h=v;else s=1;let _=t.const("len",An._`${n}.length`);if(e.setParams({min:s,max:h}),h===void 0&&s===0){(0,jp.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&s>h){(0,jp.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,jp.alwaysValidSchema)(o,r)){let I=An._`${_} >= ${s}`;if(h!==void 0)I=An._`${I} && ${_} <= ${h}`;e.pass(I);return}o.items=!0;let g=t.name("valid");if(h===void 0&&s===1)x(g,()=>t.if(g,()=>t.break()));else if(s===0){if(t.let(g,!0),h!==void 0)t.if(An._`${n}.length > 0`,S)}else t.let(g,!1),S();e.result(g,()=>e.reset());function S(){let I=t.name("_valid"),T=t.let("count",0);x(I,()=>t.if(I,()=>M(T)))}function x(I,T){t.forRange("i",0,_,($)=>{e.subschema({keyword:"contains",dataProp:$,dataPropType:jp.Type.Num,compositeRule:!0},I),T()})}function M(I){if(t.code(An._`${I}++`),h===void 0)t.if(An._`${I} >= ${s}`,()=>t.assign(g,!0).break());else if(t.if(An._`${I} > ${h}`,()=>t.assign(g,!1).break()),s===1)t.assign(g,!0);else t.if(An._`${I} >= ${s}`,()=>t.assign(g,!0))}}};h3.default=jq});var _3=Je((y3)=>{Object.defineProperty(y3,"__esModule",{value:!0});y3.validateSchemaDeps=y3.validatePropertyDeps=y3.error=void 0;var Jb=mt(),Lq=kt(),vc=Pn();y3.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=t===1?"property":"properties";return Jb.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>Jb._`{property: ${e},
missingProperty: ${i},
depsCount: ${t},
deps: ${r}}`};var qq={keyword:"dependencies",type:"object",schemaType:"object",error:y3.error,code(e){let[t,r]=Fq(e);m3(e,t),g3(e,r)}};function Fq({schema:e}){let t={},r={};for(let i in e){if(i==="__proto__")continue;let n=Array.isArray(e[i])?t:r;n[i]=e[i]}return[t,r]}function m3(e,t=e.schema){let{gen:r,data:i,it:n}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let s in t){let h=t[s];if(h.length===0)continue;let b=(0,vc.propertyInData)(r,i,s,n.opts.ownProperties);if(e.setParams({property:s,depsCount:h.length,deps:h.join(", ")}),n.allErrors)r.if(b,()=>{for(let v of h)(0,vc.checkReportMissingProp)(e,v)});else r.if(Jb._`${b} && (${(0,vc.checkMissingProp)(e,h,o)})`),(0,vc.reportMissingProp)(e,o),r.else()}}y3.validatePropertyDeps=m3;function g3(e,t=e.schema){let{gen:r,data:i,keyword:n,it:o}=e,s=r.name("valid");for(let h in t){if((0,Lq.alwaysValidSchema)(o,t[h]))continue;r.if((0,vc.propertyInData)(r,i,h,o.opts.ownProperties),()=>{let b=e.subschema({keyword:n,schemaProp:h},s);e.mergeValidEvaluated(b,s)},()=>r.var(s,!0)),e.ok(s)}}y3.validateSchemaDeps=g3;y3.default=qq});var x3=Je((S3)=>{Object.defineProperty(S3,"__esModule",{value:!0});var w3=mt(),Zq=kt(),Kq={message:"property name must be valid",params:({params:e})=>w3._`{propertyName: ${e.propertyName}}`},Vq={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Kq,code(e){let{gen:t,schema:r,data:i,it:n}=e;if((0,Zq.alwaysValidSchema)(n,r))return;let o=t.name("valid");t.forIn("key",i,(s)=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),t.if((0,w3.not)(o),()=>{if(e.error(!0),!n.allErrors)t.break()})}),e.ok(o)}};S3.default=Vq});var Xb=Je((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});var Up=Pn(),Hn=mt(),Gq=ki(),Lp=kt(),Jq={message:"must NOT have additional properties",params:({params:e})=>Hn._`{additionalProperty: ${e.additionalProperty}}`},Xq={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Jq,code(e){let{gen:t,schema:r,parentSchema:i,data:n,errsCount:o,it:s}=e;if(!o)throw Error("ajv implementation error");let{allErrors:h,opts:b}=s;if(s.props=!0,b.removeAdditional!=="all"&&(0,Lp.alwaysValidSchema)(s,r))return;let v=(0,Up.allSchemaProperties)(i.properties),_=(0,Up.allSchemaProperties)(i.patternProperties);g(),e.ok(Hn._`${o} === ${Gq.default.errors}`);function g(){t.forIn("key",n,(T)=>{if(!v.length&&!_.length)M(T);else t.if(S(T),()=>M(T))})}function S(T){let $;if(v.length>8){let P=(0,Lp.schemaRefOrVal)(s,i.properties,"properties");$=(0,Up.isOwnProperty)(t,P,T)}else if(v.length)$=(0,Hn.or)(...v.map((P)=>Hn._`${T} === ${P}`));else $=Hn.nil;if(_.length)$=(0,Hn.or)($,..._.map((P)=>Hn._`${(0,Up.usePattern)(e,P)}.test(${T})`));return(0,Hn.not)($)}function x(T){t.code(Hn._`delete ${n}[${T}]`)}function M(T){if(b.removeAdditional==="all"||b.removeAdditional&&r===!1){x(T);return}if(r===!1){if(e.setParams({additionalProperty:T}),e.error(),!h)t.break();return}if(typeof r=="object"&&!(0,Lp.alwaysValidSchema)(s,r)){let $=t.name("valid");if(b.removeAdditional==="failing")I(T,$,!1),t.if((0,Hn.not)($),()=>{e.reset(),x(T)});else if(I(T,$),!h)t.if((0,Hn.not)($),()=>t.break())}}function I(T,$,P){let R={keyword:"additionalProperties",dataProp:T,dataPropType:Lp.Type.Str};if(P===!1)Object.assign(R,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(R,$)}}};k3.default=Xq});var T3=Je((I3)=>{Object.defineProperty(I3,"__esModule",{value:!0});var Qq=sc(),M3=Pn(),Yb=kt(),E3=Xb(),eF={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:i,data:n,it:o}=e;if(o.opts.removeAdditional==="all"&&i.additionalProperties===void 0)E3.default.code(new Qq.KeywordCxt(o,E3.default,"additionalProperties"));let s=(0,M3.allSchemaProperties)(r);for(let g of s)o.definedProperties.add(g);if(o.opts.unevaluated&&s.length&&o.props!==!0)o.props=Yb.mergeEvaluated.props(t,(0,Yb.toHash)(s),o.props);let h=s.filter((g)=>!(0,Yb.alwaysValidSchema)(o,r[g]));if(h.length===0)return;let b=t.name("valid");for(let g of h){if(v(g))_(g);else{if(t.if((0,M3.propertyInData)(t,n,g,o.opts.ownProperties)),_(g),!o.allErrors)t.else().var(b,!0);t.endIf()}e.it.definedProperties.add(g),e.ok(b)}function v(g){return o.opts.useDefaults&&!o.compositeRule&&r[g].default!==void 0}function _(g){e.subschema({keyword:"properties",schemaProp:g,dataProp:g},b)}}};I3.default=eF});var C3=Je((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});var $3=Pn(),qp=mt(),P3=kt(),A3=kt(),rF={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:i,parentSchema:n,it:o}=e,{opts:s}=o,h=(0,$3.allSchemaProperties)(r),b=h.filter((I)=>(0,P3.alwaysValidSchema)(o,r[I]));if(h.length===0||b.length===h.length&&(!o.opts.unevaluated||o.props===!0))return;let v=s.strictSchema&&!s.allowMatchingProperties&&n.properties,_=t.name("valid");if(o.props!==!0&&!(o.props instanceof qp.Name))o.props=(0,A3.evaluatedPropsToName)(t,o.props);let{props:g}=o;S();function S(){for(let I of h){if(v)x(I);if(o.allErrors)M(I);else t.var(_,!0),M(I),t.if(_)}}function x(I){for(let T in v)if(new RegExp(I).test(T))(0,P3.checkStrictMode)(o,`property ${T} matches pattern ${I} (use allowMatchingProperties)`)}function M(I){t.forIn("key",i,(T)=>{t.if(qp._`${(0,$3.usePattern)(e,I)}.test(${T})`,()=>{let $=b.includes(I);if(!$)e.subschema({keyword:"patternProperties",schemaProp:I,dataProp:T,dataPropType:A3.Type.Str},_);if(o.opts.unevaluated&&g!==!0)t.assign(qp._`${g}[${T}]`,!0);else if(!$&&!o.allErrors)t.if((0,qp.not)(_),()=>t.break())})})}}};R3.default=rF});var N3=Je((O3)=>{Object.defineProperty(O3,"__esModule",{value:!0});var iF=kt(),oF={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,iF.alwaysValidSchema)(i,r)){e.fail();return}let n=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),e.failResult(n,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};O3.default=oF});var z3=Je((D3)=>{Object.defineProperty(D3,"__esModule",{value:!0});var aF=Pn(),uF={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:aF.validateUnion,error:{message:"must match a schema in anyOf"}};D3.default=uF});var U3=Je((j3)=>{Object.defineProperty(j3,"__esModule",{value:!0});var Fp=mt(),cF=kt(),dF={message:"must match exactly one schema in oneOf",params:({params:e})=>Fp._`{passingSchemas: ${e.passing}}`},fF={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dF,code(e){let{gen:t,schema:r,parentSchema:i,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let o=r,s=t.let("valid",!1),h=t.let("passing",null),b=t.name("_valid");e.setParams({passing:h}),t.block(v),e.result(s,()=>e.reset(),()=>e.error(!0));function v(){o.forEach((_,g)=>{let S;if((0,cF.alwaysValidSchema)(n,_))t.var(b,!0);else S=e.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},b);if(g>0)t.if(Fp._`${b} && ${s}`).assign(s,!1).assign(h,Fp._`[${h}, ${g}]`).else();t.if(b,()=>{if(t.assign(s,!0),t.assign(h,g),S)e.mergeEvaluated(S,Fp.Name)})})}}};j3.default=fF});var q3=Je((L3)=>{Object.defineProperty(L3,"__esModule",{value:!0});var pF=kt(),mF={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let n=t.name("valid");r.forEach((o,s)=>{if((0,pF.alwaysValidSchema)(i,o))return;let h=e.subschema({keyword:"allOf",schemaProp:s},n);e.ok(n),e.mergeEvaluated(h)})}};L3.default=mF});var Z3=Je((H3)=>{Object.defineProperty(H3,"__esModule",{value:!0});var Bp=mt(),B3=kt(),yF={message:({params:e})=>Bp.str`must match "${e.ifClause}" schema`,params:({params:e})=>Bp._`{failingKeyword: ${e.ifClause}}`},vF={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yF,code(e){let{gen:t,parentSchema:r,it:i}=e;if(r.then===void 0&&r.else===void 0)(0,B3.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=F3(i,"then"),o=F3(i,"else");if(!n&&!o)return;let s=t.let("valid",!0),h=t.name("_valid");if(b(),e.reset(),n&&o){let _=t.let("ifClause");e.setParams({ifClause:_}),t.if(h,v("then",_),v("else",_))}else if(n)t.if(h,v("then"));else t.if((0,Bp.not)(h),v("else"));e.pass(s,()=>e.error(!0));function b(){let _=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(_)}function v(_,g){return()=>{let S=e.subschema({keyword:_},h);if(t.assign(s,h),e.mergeValidEvaluated(S,s),g)t.assign(g,Bp._`${_}`);else e.setParams({ifClause:_})}}}};function F3(e,t){let r=e.schema[t];return r!==void 0&&!(0,B3.alwaysValidSchema)(e,r)}H3.default=vF});var V3=Je((K3)=>{Object.defineProperty(K3,"__esModule",{value:!0});var _F=kt(),wF={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)(0,_F.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};K3.default=wF});var G3=Je((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});var xF=Wb(),kF=l3(),MF=Gb(),EF=f3(),IF=p3(),TF=_3(),$F=x3(),PF=Xb(),AF=T3(),RF=C3(),CF=N3(),OF=z3(),NF=U3(),DF=q3(),zF=Z3(),jF=V3();function UF(e=!1){let t=[CF.default,OF.default,NF.default,DF.default,zF.default,jF.default,$F.default,PF.default,TF.default,AF.default,RF.default];if(e)t.push(kF.default,EF.default);else t.push(xF.default,MF.default);return t.push(IF.default),t}W3.default=UF});var X3=Je((J3)=>{Object.defineProperty(J3,"__esModule",{value:!0});var nr=mt(),qF={message:({schemaCode:e})=>nr.str`must match format "${e}"`,params:({schemaCode:e})=>nr._`{format: ${e}}`},FF={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:qF,code(e,t){let{gen:r,data:i,$data:n,schema:o,schemaCode:s,it:h}=e,{opts:b,errSchemaPath:v,schemaEnv:_,self:g}=h;if(!b.validateFormats)return;if(n)S();else x();function S(){let M=r.scopeValue("formats",{ref:g.formats,code:b.code.formats}),I=r.const("fDef",nr._`${M}[${s}]`),T=r.let("fType"),$=r.let("format");r.if(nr._`typeof ${I} == "object" && !(${I} instanceof RegExp)`,()=>r.assign(T,nr._`${I}.type || "string"`).assign($,nr._`${I}.validate`),()=>r.assign(T,nr._`"string"`).assign($,I)),e.fail$data((0,nr.or)(P(),R()));function P(){if(b.strictSchema===!1)return nr.nil;return nr._`${s} && !${$}`}function R(){let C=_.$async?nr._`(${I}.async ? await ${$}(${i}) : ${$}(${i}))`:nr._`${$}(${i})`,D=nr._`(typeof ${$} == "function" ? ${C} : ${$}.test(${i}))`;return nr._`${$} && ${$} !== true && ${T} === ${t} && !${D}`}}function x(){let M=g.formats[o];if(!M){P();return}if(M===!0)return;let[I,T,$]=R(M);if(I===t)e.pass(C());function P(){if(b.strictSchema===!1){g.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${o}" ignored in schema at path "${v}"`}}function R(D){let B=D instanceof RegExp?(0,nr.regexpCode)(D):b.code.formats?nr._`${b.code.formats}${(0,nr.getProperty)(o)}`:void 0,ie=r.scopeValue("formats",{key:o,ref:D,code:B});if(typeof D=="object"&&!(D instanceof RegExp))return[D.type||"string",D.validate,nr._`${ie}.validate`];return["string",D,ie]}function C(){if(typeof M=="object"&&!(M instanceof RegExp)&&M.async){if(!_.$async)throw Error("async format in sync schema");return nr._`await ${$}(${i})`}return typeof T=="function"?nr._`${$}(${i})`:nr._`${$}.test(${i})`}}}};J3.default=FF});var Q3=Je((Y3)=>{Object.defineProperty(Y3,"__esModule",{value:!0});var HF=X3(),ZF=[HF.default];Y3.default=ZF});var r8=Je((e8)=>{Object.defineProperty(e8,"__esModule",{value:!0});e8.contentVocabulary=e8.metadataVocabulary=void 0;e8.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];e8.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var o8=Je((i8)=>{Object.defineProperty(i8,"__esModule",{value:!0});var WF=I4(),GF=e3(),JF=G3(),XF=Q3(),n8=r8(),YF=[WF.default,GF.default,(0,JF.default)(),XF.default,n8.metadataVocabulary,n8.contentVocabulary];i8.default=YF});var l8=Je((a8)=>{Object.defineProperty(a8,"__esModule",{value:!0});a8.DiscrError=void 0;var s8;(function(e){e.Tag="tag",e.Mapping="mapping"})(s8||(a8.DiscrError=s8={}))});var f8=Je((d8)=>{Object.defineProperty(d8,"__esModule",{value:!0});var la=mt(),Qb=l8(),c8=Ep(),eB=ac(),tB=kt(),rB={message:({params:{discrError:e,tagName:t}})=>e===Qb.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>la._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},nB={keyword:"discriminator",type:"object",schemaType:"object",error:rB,code(e){let{gen:t,data:r,schema:i,parentSchema:n,it:o}=e,{oneOf:s}=n;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let h=i.propertyName;if(typeof h!="string")throw Error("discriminator: requires propertyName");if(i.mapping)throw Error("discriminator: mapping is not supported");if(!s)throw Error("discriminator: requires oneOf keyword");let b=t.let("valid",!1),v=t.const("tag",la._`${r}${(0,la.getProperty)(h)}`);t.if(la._`typeof ${v} == "string"`,()=>_(),()=>e.error(!1,{discrError:Qb.DiscrError.Tag,tag:v,tagName:h})),e.ok(b);function _(){let x=S();t.if(!1);for(let M in x)t.elseIf(la._`${v} === ${M}`),t.assign(b,g(x[M]));t.else(),e.error(!1,{discrError:Qb.DiscrError.Mapping,tag:v,tagName:h}),t.endIf()}function g(x){let M=t.name("valid"),I=e.subschema({keyword:"oneOf",schemaProp:x},M);return e.mergeEvaluated(I,la.Name),M}function S(){var x;let M={},I=$(n),T=!0;for(let C=0;C<s.length;C++){let D=s[C];if((D===null||D===void 0?void 0:D.$ref)&&!(0,tB.schemaHasRulesButRef)(D,o.self.RULES)){let ie=D.$ref;if(D=c8.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ie),D instanceof c8.SchemaEnv)D=D.schema;if(D===void 0)throw new eB.default(o.opts.uriResolver,o.baseId,ie)}let B=(x=D===null||D===void 0?void 0:D.properties)===null||x===void 0?void 0:x[h];if(typeof B!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);T=T&&(I||$(D)),P(B,C)}if(!T)throw Error(`discriminator: "${h}" must be required`);return M;function $({required:C}){return Array.isArray(C)&&C.includes(h)}function P(C,D){if(C.const)R(C.const,D);else if(C.enum)for(let B of C.enum)R(B,D);else throw Error(`discriminator: "properties/${h}" must have "const" or "enum"`)}function R(C,D){if(typeof C!="string"||C in M)throw Error(`discriminator: "${h}" values must be unique strings`);M[C]=D}}}};d8.default=nB});var h8=Je((yue,oB)=>{oB.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var t_=Je((an,e_)=>{Object.defineProperty(an,"__esModule",{value:!0});an.MissingRefError=an.ValidationError=an.CodeGen=an.Name=an.nil=an.stringify=an.str=an._=an.KeywordCxt=an.Ajv=void 0;var sB=y4(),aB=o8(),uB=f8(),p8=h8(),lB=["/properties"],Hp="http://json-schema.org/draft-07/schema";class bc extends sB.default{_addVocabularies(){if(super._addVocabularies(),aB.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(uB.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(p8,lB):p8;this.addMetaSchema(e,Hp,!1),this.refs["http://json-schema.org/schema"]=Hp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Hp)?Hp:void 0)}}an.Ajv=bc;e_.exports=an=bc;e_.exports.Ajv=bc;Object.defineProperty(an,"__esModule",{value:!0});an.default=bc;var cB=sc();Object.defineProperty(an,"KeywordCxt",{enumerable:!0,get:function(){return cB.KeywordCxt}});var ca=mt();Object.defineProperty(an,"_",{enumerable:!0,get:function(){return ca._}});Object.defineProperty(an,"str",{enumerable:!0,get:function(){return ca.str}});Object.defineProperty(an,"stringify",{enumerable:!0,get:function(){return ca.stringify}});Object.defineProperty(an,"nil",{enumerable:!0,get:function(){return ca.nil}});Object.defineProperty(an,"Name",{enumerable:!0,get:function(){return ca.Name}});Object.defineProperty(an,"CodeGen",{enumerable:!0,get:function(){return ca.CodeGen}});var dB=kp();Object.defineProperty(an,"ValidationError",{enumerable:!0,get:function(){return dB.default}});var fB=ac();Object.defineProperty(an,"MissingRefError",{enumerable:!0,get:function(){return fB.default}})});var k8=Je((S8)=>{Object.defineProperty(S8,"__esModule",{value:!0});S8.formatNames=S8.fastFormats=S8.fullFormats=void 0;function ti(e,t){return{validate:e,compare:t}}S8.fullFormats={date:ti(v8,o_),time:ti(n_(!0),s_),"date-time":ti(m8(!0),_8),"iso-time":ti(n_(),b8),"iso-date-time":ti(m8(),w8),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_B,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:IB,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:wB,int32:{type:"number",validate:kB},int64:{type:"number",validate:MB},float:{type:"number",validate:y8},double:{type:"number",validate:y8},password:!0,binary:!0};S8.fastFormats={...S8.fullFormats,date:ti(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o_),time:ti(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,s_),"date-time":ti(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_8),"iso-time":ti(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b8),"iso-date-time":ti(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w8),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};S8.formatNames=Object.keys(S8.fullFormats);function mB(e){return e%4===0&&(e%100!==0||e%400===0)}var gB=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,yB=[0,31,28,31,30,31,30,31,31,30,31,30,31];function v8(e){let t=gB.exec(e);if(!t)return!1;let r=+t[1],i=+t[2],n=+t[3];return i>=1&&i<=12&&n>=1&&n<=(i===2&&mB(r)?29:yB[i])}function o_(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var r_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function n_(e){return function(r){let i=r_.exec(r);if(!i)return!1;let n=+i[1],o=+i[2],s=+i[3],h=i[4],b=i[5]==="-"?-1:1,v=+(i[6]||0),_=+(i[7]||0);if(v>23||_>59||e&&!h)return!1;if(n<=23&&o<=59&&s<60)return!0;let g=o-_*b,S=n-v*b-(g<0?1:0);return(S===23||S===-1)&&(g===59||g===-1)&&s<61}}function s_(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),i=new Date("2020-01-01T"+t).valueOf();if(!(r&&i))return;return r-i}function b8(e,t){if(!(e&&t))return;let r=r_.exec(e),i=r_.exec(t);if(!(r&&i))return;if(e=r[1]+r[2]+r[3],t=i[1]+i[2]+i[3],e>t)return 1;if(e<t)return-1;return 0}var i_=/t|\s/i;function m8(e){let t=n_(e);return function(i){let n=i.split(i_);return n.length===2&&v8(n[0])&&t(n[1])}}function _8(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),i=new Date(t).valueOf();if(!(r&&i))return;return r-i}function w8(e,t){if(!(e&&t))return;let[r,i]=e.split(i_),[n,o]=t.split(i_),s=o_(r,n);if(s===void 0)return;return s||s_(i,o)}var vB=/\/|:/,bB=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _B(e){return vB.test(e)&&bB.test(e)}var g8=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function wB(e){return g8.lastIndex=0,g8.test(e)}var SB=-2147483648,xB=2147483647;function kB(e){return Number.isInteger(e)&&e<=xB&&e>=SB}function MB(e){return Number.isInteger(e)}function y8(){return!0}var EB=/[^\\]\\Z/;function IB(e){if(EB.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var E8=Je((M8)=>{Object.defineProperty(M8,"__esModule",{value:!0});M8.formatLimitDefinition=void 0;var $B=t_(),Zn=mt(),so=Zn.operators,Zp={formatMaximum:{okStr:"<=",ok:so.LTE,fail:so.GT},formatMinimum:{okStr:">=",ok:so.GTE,fail:so.LT},formatExclusiveMaximum:{okStr:"<",ok:so.LT,fail:so.GTE},formatExclusiveMinimum:{okStr:">",ok:so.GT,fail:so.LTE}},PB={message:({keyword:e,schemaCode:t})=>Zn.str`should be ${Zp[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Zn._`{comparison: ${Zp[e].okStr}, limit: ${t}}`};M8.formatLimitDefinition={keyword:Object.keys(Zp),type:"string",schemaType:"string",$data:!0,error:PB,code(e){let{gen:t,data:r,schemaCode:i,keyword:n,it:o}=e,{opts:s,self:h}=o;if(!s.validateFormats)return;let b=new $B.KeywordCxt(o,h.RULES.all.format.definition,"format");if(b.$data)v();else _();function v(){let S=t.scopeValue("formats",{ref:h.formats,code:s.code.formats}),x=t.const("fmt",Zn._`${S}[${b.schemaCode}]`);e.fail$data((0,Zn.or)(Zn._`typeof ${x} != "object"`,Zn._`${x} instanceof RegExp`,Zn._`typeof ${x}.compare != "function"`,g(x)))}function _(){let S=b.schema,x=h.formats[S];if(!x||x===!0)return;if(typeof x!="object"||x instanceof RegExp||typeof x.compare!="function")throw Error(`"${n}": format "${S}" does not define "compare" function`);let M=t.scopeValue("formats",{key:S,ref:x,code:s.code.formats?Zn._`${s.code.formats}${(0,Zn.getProperty)(S)}`:void 0});e.fail$data(g(M))}function g(S){return Zn._`${S}.compare(${r}, ${i}) ${Zp[n].fail} 0`}},dependencies:["format"]};var AB=(e)=>(e.addKeyword(M8.formatLimitDefinition),e);M8.default=AB});var P8=Je((_c,$8)=>{Object.defineProperty(_c,"__esModule",{value:!0});var da=k8(),CB=E8(),l_=mt(),I8=new l_.Name("fullFormats"),OB=new l_.Name("fastFormats"),c_=(e,t={keywords:!0})=>{if(Array.isArray(t))return T8(e,t,da.fullFormats,I8),e;let[r,i]=t.mode==="fast"?[da.fastFormats,OB]:[da.fullFormats,I8],n=t.formats||da.formatNames;if(T8(e,n,r,i),t.keywords)(0,CB.default)(e);return e};c_.get=(e,t="full")=>{let i=(t==="fast"?da.fastFormats:da.fullFormats)[e];if(!i)throw Error(`Unknown format "${e}"`);return i};function T8(e,t,r,i){var n,o;(n=(o=e.opts.code).formats)!==null&&n!==void 0||(o.formats=l_._`require("ajv-formats/dist/formats").${i}`);for(let s of t)e.addFormat(s,r[s])}$8.exports=_c=c_;Object.defineProperty(_c,"__esModule",{value:!0});_c.default=c_});class Kn extends Error{}function k_(e,t,r){return new Promise((i,n)=>{if(t?.aborted){if(r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i();return}let o=setTimeout((h,b,v)=>{h?.removeEventListener("abort",b),v()},e,t,s,i);function s(){if(clearTimeout(o),r?.throwOnAbort||r?.abortError)n(r.abortError?.()??Error("aborted"));else i()}if(t?.addEventListener("abort",s,{once:!0}),r?.unref)o.unref()})}var{closeSync:fQ,writeFileSync:hQ,fsyncSync:pQ,openSync:mQ}=(()=>({}));function Y8(){this.__data__=[],this.size=0}var M_=Y8;function Q8(e,t){return e===t||e!==e&&t!==t}var E_=Q8;function eE(e,t){var r=e.length;while(r--)if(E_(e[r][0],t))return r;return-1}var Ti=eE;var tE=Array.prototype,rE=tE.splice;function nE(e){var t=this.__data__,r=Ti(t,e);if(r<0)return!1;var i=t.length-1;if(r==i)t.pop();else rE.call(t,r,1);return--this.size,!0}var I_=nE;function iE(e){var t=this.__data__,r=Ti(t,e);return r<0?void 0:t[r][1]}var T_=iE;function oE(e){return Ti(this.__data__,e)>-1}var $_=oE;function sE(e,t){var r=this.__data__,i=Ti(r,e);if(i<0)++this.size,r.push([e,t]);else r[i][1]=t;return this}var P_=sE;function Jo(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}Jo.prototype.clear=M_;Jo.prototype.delete=I_;Jo.prototype.get=T_;Jo.prototype.has=$_;Jo.prototype.set=P_;var A_=Jo;var aE=typeof global=="object"&&global&&global.Object===Object&&global,R_=aE;var uE=typeof self=="object"&&self&&self.Object===Object&&self,lE=R_||uE||Function("return this")(),Xo=lE;var cE=Xo.Symbol,Yo=cE;var C_=Object.prototype,dE=C_.hasOwnProperty,fE=C_.toString,pa=Yo?Yo.toStringTag:void 0;function hE(e){var t=dE.call(e,pa),r=e[pa];try{e[pa]=void 0;var i=!0}catch(o){}var n=fE.call(e);if(i)if(t)e[pa]=r;else delete e[pa];return n}var O_=hE;var pE=Object.prototype,mE=pE.toString;function gE(e){return mE.call(e)}var N_=gE;var yE="[object Null]",vE="[object Undefined]",D_=Yo?Yo.toStringTag:void 0;function bE(e){if(e==null)return e===void 0?vE:yE;return D_&&D_ in Object(e)?O_(e):N_(e)}var z_=bE;function _E(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Sc=_E;var wE="[object AsyncFunction]",SE="[object Function]",xE="[object GeneratorFunction]",kE="[object Proxy]";function ME(e){if(!Sc(e))return!1;var t=z_(e);return t==SE||t==xE||t==wE||t==kE}var j_=ME;var EE=Xo["__core-js_shared__"],xc=EE;var U_=function(){var e=/[^.]+$/.exec(xc&&xc.keys&&xc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function IE(e){return!!U_&&U_ in e}var L_=IE;var TE=Function.prototype,$E=TE.toString;function PE(e){if(e!=null){try{return $E.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var q_=PE;var AE=/[\\^$.*+?()[\]{}|]/g,RE=/^\[object .+?Constructor\]$/,CE=Function.prototype,OE=Object.prototype,NE=CE.toString,DE=OE.hasOwnProperty,zE=RegExp("^"+NE.call(DE).replace(AE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jE(e){if(!Sc(e)||L_(e))return!1;var t=j_(e)?zE:RE;return t.test(q_(e))}var F_=jE;function UE(e,t){return e==null?void 0:e[t]}var B_=UE;function LE(e,t){var r=B_(e,t);return F_(r)?r:void 0}var kc=LE;var qE=kc(Xo,"Map"),H_=qE;var FE=kc(Object,"create"),ri=FE;function BE(){this.__data__=ri?ri(null):{},this.size=0}var Z_=BE;function HE(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var K_=HE;var ZE="__lodash_hash_undefined__",KE=Object.prototype,VE=KE.hasOwnProperty;function WE(e){var t=this.__data__;if(ri){var r=t[e];return r===ZE?void 0:r}return VE.call(t,e)?t[e]:void 0}var V_=WE;var GE=Object.prototype,JE=GE.hasOwnProperty;function XE(e){var t=this.__data__;return ri?t[e]!==void 0:JE.call(t,e)}var W_=XE;var YE="__lodash_hash_undefined__";function QE(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ri&&t===void 0?YE:t,this}var G_=QE;function Qo(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}Qo.prototype.clear=Z_;Qo.prototype.delete=K_;Qo.prototype.get=V_;Qo.prototype.has=W_;Qo.prototype.set=G_;var Gp=Qo;function eI(){this.size=0,this.__data__={hash:new Gp,map:new(H_||A_),string:new Gp}}var J_=eI;function tI(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var X_=tI;function rI(e,t){var r=e.__data__;return X_(t)?r[typeof t=="string"?"string":"hash"]:r.map}var $i=rI;function nI(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t}var Y_=nI;function iI(e){return $i(this,e).get(e)}var Q_=iI;function oI(e){return $i(this,e).has(e)}var e1=oI;function sI(e,t){var r=$i(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}var t1=sI;function es(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var i=e[t];this.set(i[0],i[1])}}es.prototype.clear=J_;es.prototype.delete=Y_;es.prototype.get=Q_;es.prototype.has=e1;es.prototype.set=t1;var Jp=es;var{realpathSync:Uw}=(()=>({}));var aI="Expected a function";function Xp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(aI);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,i);return r.cache=o.set(n,s)||o,s};return r.cache=new(Xp.Cache||Jp),r}Xp.Cache=Jp;var bn=Xp;var r1=function(){return"/"};var ma=()=>globalThis.crypto.randomUUID();Hr();Hr();var Nw="[\\w-]{1,63}",tA=new RegExp(`^${Nw}$`),JZ=new RegExp(`^a(?:${Nw}-)?[0-9a-f]{16}$`);function Dw(e,t){let r=Buffer.from(t.replace(/-/g,""),"hex"),i=Cm("sha1").update(r).update(Buffer.from(e,"utf8")).digest();i[6]=i[6]&15|80,i[8]=i[8]&63|128;let n=i.subarray(0,16).toString("hex");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20,32)}`}var rA="3ab19d7e-9f35-45c2-926e-75e271cc60b3";function zw(){let e=process.env.CLAUDE_CODE_REMOTE_SESSION_ID?.trim();return e?Dw(e,rA):null}function mo(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function Oi(){let e=new Set;return{subscribe(t){return e.add(t),()=>{e.delete(t)}},emit(...t){let r;for(let i of e)try{i(...t)}catch(n){(r??=[]).push(n)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}function jw(){return{sent:new Set,rejected:new Set}}var iA={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};function oA(){let e="";if(typeof process<"u"&&typeof process.cwd==="function"&&typeof Uw==="function"){let r=r1();try{e=Lw(Uw(r))}catch{e=Lw(r)}}return{originalCwd:e,projectRoot:e,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:e,modelUsage:{},mainLoopModelOverride:void 0,refusalFallbackModelLatch:void 0,sdkDialogHostActive:!1,sdkSupportedDialogKinds:void 0,sdkSupportedDialogKindsSource:void 0,replConfigArgv:[],initialMainLoopModel:void 0,modelStrings:null,isInteractive:!1,attacherCaps:null,hasStreamingInput:!1,modelOverrideOptOutForSession:!1,rendererMode:void 0,strictToolResultPairing:!1,memoryToggledOff:!1,teamMemoryServerStatus:void 0,sdkAgentProgressSummariesEnabled:!1,userMsgOptIn:!1,searchToolsOptIn:!1,clientType:"cli",sessionSource:void 0,sessionStartType:"fresh",questionPreviewFormat:void 0,sessionIngressToken:void 0,oauthTokenFromFd:void 0,oauthScopesFromFd:void 0,apiKeyFromFd:void 0,gatewayAuth:null,gatewayRefreshInFlight:null,flagSettingsPath:void 0,flagSettingsExpectedContent:void 0,flagSettingsInline:null,parentManagedSettings:null,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,statsStore:null,sessionId:zw()??ma(),mainAgentId:null,parentSessionId:void 0,loggerProvider:null,eventLogger:null,pendingOTelEvents:[],meterProvider:null,tracerProvider:null,cachedTelemetryResource:null,cachedOtlpHttpAgentFactory:{direct:null,proxied:null},foundryDeploymentCapabilities:new Map,agentColorMap:new Map,agentColorIndex:0,lastAPIRequest:null,lastCancelledAPIMessageId:null,lastAPIRequestMessages:null,lastClassifierRequests:null,cachedClaudeMdContent:null,inMemoryErrorLog:[],inlinePlugins:[],inlinePluginsNoMcp:[],inlinePluginUrls:[],syncedPluginDirs:[],chromeFlagOverride:void 0,onboardingShownThisSession:!1,useCoworkPlugins:!1,disableSlashCommands:!1,sessionBypassPermissionsMode:!1,scheduledTasksEnabled:!1,sessionPrResolved:!1,sessionCronTasks:[],loopChainStartedAt:Object.create(null),loopTickInFlightPrompt:null,loopConsecutiveKeepalives:0,sessionCreatedTeams:new Set,inheritedTeamName:void 0,sessionTrustAccepted:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,needsAutoModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0,longContext1mCreditsBlocked:!1,fableCreditsRequired:!1,fableConsentSessionFallback:!1,fableBridgeDialogTimedOut:!1,fableConsentDialogInteracted:!1,sdkOAuthTokenRefreshCallback:null,hostAuthTokenRefreshCallback:null,mainThreadAgentType:void 0,mainThreadAgentHooks:void 0,sessionSkillAllowlist:void 0,caps:iA,replBridgeActive:!1,directConnectServerUrl:void 0,mcpConnectNonBlocking:!1,strictMcpConfig:!1,activeRoutine:void 0,systemPromptSectionCache:new Map,lastEmittedDate:null,additionalDirectoriesForClaudeMd:[],allowedChannels:[],hasDevChannels:!1,sessionProjectDir:null,promptCache1hAllowlist:null,stickyBetas:jw(),thinkingTypeOverrides:new Map,inferenceProfileBackingModels:new Map,promptId:null,promptIndex:0,lastMainRequestId:void 0,lastMainThreadCacheTtlMs:null,lastApiCompletionTimestamp:null,pendingPostCompaction:!1}}var sA=oA(),aA=()=>{return};function Om(){return aA()?.sessionId??sA.sessionId}var uA=Oi(),PK=uA.subscribe;function Lw(e){return process.platform==="darwin"?e.normalize("NFC"):e}var lA=Oi(),AK=lA.subscribe;var cA=Oi(),RK=cA.subscribe;var dA=Oi();var CK=dA.subscribe;var fA=Oi();var OK=fA.subscribe;var{appendFile:b2,mkdir:q9,rename:_2,stat:F9,symlink:B9,unlink:M0}=(()=>({}));Rn();function Ww({writeFn:e,flushIntervalMs:t=1000,maxBufferSize:r=100,maxBufferBytes:i=1/0,immediateMode:n=!1}){let o=[],s=0,h=null,b=null;function v(){if(h)clearTimeout(h),h=null}function _(M){try{e(M)}catch{}}function g(){if(b)_(b.join("")),b=null;if(o.length===0)return;_(o.join("")),o=[],s=0,v()}function S(){if(!h)h=setTimeout(g,t)}function x(){if(b){b.push(...o),o=[],s=0,v();return}let M=o;o=[],s=0,v(),b=M,setImmediate(()=>{let I=b;if(b=null,I)_(I.join(""))})}return{write(M){if(n){_(M);return}if(o.push(M),s+=M.length,S(),o.length>=r||s>=i)x()},flush:g,dispose(){g()}}}Rn();var{realpathSync:jK}=(()=>({}));function Jw(e){return process.platform==="darwin"?e.normalize("NFC"):e}function Xw(e){return/^[\\/]{2}/.test(e)}function Yw(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function mA(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function Qw(e){if(/^\\\\\?\\volume\{/i.test(e))return Gw(e);let t=mA(e);if(t!==e&&Gw(t))return!0;return Xw(t)&&!Yw(t)}function Gw(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)||e.includes("/")}function gA(e){if(typeof e==="function")return e;if(Symbol.asyncDispose in e)return()=>e[Symbol.asyncDispose]();return()=>e[Symbol.dispose]()}class eS{#e=new Set;register(e){let t=gA(e);this.#e.add(t);let r=()=>{this.#e.delete(t)};return Object.assign(r,{[Symbol.dispose]:r})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async(t)=>t()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}}var yA=new eS;function tS(e){return yA.register(e)}var rS=bn((e)=>{if(!e||e.trim()==="")return null;let t=e.split(",").map((o)=>o.trim()).filter(Boolean);if(t.length===0)return null;let r=t.some((o)=>o.startsWith("!")),i=t.some((o)=>!o.startsWith("!"));if(r&&i)return null;let n=t.map((o)=>o.replace(/^!/,"").toLowerCase());return{include:r?[]:n,exclude:r?n:[],isExclusive:r}});function vA(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let o=e.match(/^([^:[]+):/);if(o&&o[1])t.push(o[1].trim().toLowerCase())}let i=e.match(/^\[([^\]]+)]/);if(i&&i[1])t.push(i[1].trim().toLowerCase());if(e.toLowerCase().includes("1p event:"))t.push("1p");let n=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(n&&n[1]){let o=n[1].trim().toLowerCase();if(o.length<30&&!o.includes(" "))t.push(o)}return Array.from(new Set(t))}function bA(e,t){if(!t)return!0;if(e.length===0)return!1;if(t.isExclusive)return!e.some((r)=>t.exclude.includes(r));else return e.some((r)=>t.include.includes(r))}function nS(e,t){if(!t)return!0;let r=vA(e);return bA(r,t)}var Um=function(){return"/"};Rn();var iS=bn(()=>(process.env.CLAUDE_CONFIG_DIR??Xn(Um(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR);var GK=bn(()=>mo(process.env.CLAUDE_CODE_SUPERVISED));function Ve(e,t,r,i,n){if(i==="m")throw TypeError("Private method is not writable");if(i==="a"&&!n)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r}function oe(e,t,r,i){if(r==="a"&&!i)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)}var Lm=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Lm=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(i)=>(+i^r()&15>>+i/4).toString(16))};function ai(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var $a=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class Xe extends Error{}class br extends Xe{constructor(e,t,r,i,n){super(`${br.makeMessage(e,t,r)}`);this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=t,this.type=n??null}static makeMessage(e,t,r){let i=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;if(e&&i)return`${e} ${i}`;if(e)return`${e} status code (no body)`;if(i)return i;return"(no status code or body)"}static generate(e,t,r,i){if(!e||!i)return new vo({message:r,cause:$a(t)});let n=t,o=n?.error?.type;if(e===400)return new Aa(e,n,r,i,o);if(e===401)return new Ra(e,n,r,i,o);if(e===403)return new Ca(e,n,r,i,o);if(e===404)return new Oa(e,n,r,i,o);if(e===409)return new Na(e,n,r,i,o);if(e===422)return new Da(e,n,r,i,o);if(e===429)return new za(e,n,r,i,o);if(e>=500)return new ja(e,n,r,i,o);return new br(e,n,r,i,o)}}class Pr extends br{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class vo extends br{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}}class Pa extends vo{constructor({message:e}={}){super({message:e??"Request timed out."})}}class Aa extends br{}class Ra extends br{}class Ca extends br{}class Oa extends br{}class Na extends br{}class Da extends br{}class za extends br{}class ja extends br{}var wA=/^[a-z][a-z0-9+.-]*:/i,oS=(e)=>wA.test(e),qm=(e)=>(qm=Array.isArray,qm(e)),Fm=qm;function Fc(e){if(typeof e!=="object")return{};return e??{}}function Bm(e){if(!e)return!0;for(let t in e)return!1;return!0}function sS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var aS=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new Xe(`${e} must be an integer`);if(t<0)throw new Xe(`${e} must be a positive integer`);return t};var Bc=(e)=>{try{return JSON.parse(e)}catch(t){return}};var uS=(e)=>new Promise((t)=>setTimeout(t,e));var Sn="0.94.0";var fS=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function SA(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var xA=()=>{let e=SA();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Sn,"X-Stainless-OS":cS(Deno.build.os),"X-Stainless-Arch":lS(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Sn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Sn,"X-Stainless-OS":cS(globalThis.process.platform??"unknown"),"X-Stainless-Arch":lS(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=kA();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Sn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Sn,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function kA(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let i=r.exec(navigator.userAgent);if(i){let n=i[1]||0,o=i[2]||0,s=i[3]||0;return{browser:t,version:`${n}.${o}.${s}`}}}return null}var lS=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},cS=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},dS,Ua=()=>dS??(dS=xA());function hS(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Hm(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Hc(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Hm({start(){},async pull(r){let{done:i,value:n}=await t.next();if(i)r.close();else r.enqueue(n)},async cancel(){await t.return?.()}})}function La(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();if(r?.done)t.releaseLock();return r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function pS(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var mS=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function gS(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new Xe(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var vS="urn:ietf:params:oauth:grant-type:jwt-bearer",bS="refresh_token",Zc="/v1/oauth/token",bo="oauth-2025-04-20",_S="oidc-federation-2026-04-01",wS=120,ss=30,SS=5,yS=1048576;function Kc(e){if(!e)return;let t;try{t=new URL(e)}catch(i){throw new At(`Invalid token endpoint base URL "${e}": ${i}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1"))return;throw new At(`Refusing to send credential over non-https token endpoint "${e}"`)}async function Vc(e,t){let r=await TA(e),i;try{i=JSON.parse(r)}catch{throw new At(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,Yr(r),t)}if(!i.access_token)throw new At(`Token endpoint response missing access_token: ${JSON.stringify(Yr(i))}`,e.status,Yr(i),t);if(i.token_type&&i.token_type.toLowerCase()!=="bearer")throw new At(`Token endpoint response: unsupported token_type "${i.token_type}" (want Bearer)`,e.status,Yr(i),t);return i}var Zm=2000,IA=new Set(["error","error_description","error_uri"]);function Yr(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=Zm)return e;return e.slice(0,Zm)+`... <${e.length-Zm} more chars>`}return JSON.stringify(Yr(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[r,i]of Object.entries(e))if(IA.has(r))t[r]=i;return t}return null}async function Wc(e,t=(r)=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),i=e,n;try{i=await r.promises.realpath(e),n=await r.promises.stat(i)}catch{return}let o=n.mode&511;if(o&18)throw new At(`Credentials file at ${i} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${i}\`.`);if(o&36)throw new At(`Credentials file at ${i} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${i}\` before retrying.`);if(typeof process.getuid==="function"&&n.uid!==process.getuid())t(`credentials file at ${i} is owned by uid ${n.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Gc(e,t){let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Rn(),yo))).dirname(e);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,e)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function TA(e){if(!e.body)return"";let t=e.body.getReader(),r=[],i=0;for(;;){let{done:o,value:s}=await t.read();if(o)break;if(i+s.length>yS){let h=yS-i;if(h>0)r.push(s.subarray(0,h));await t.cancel();break}r.push(s),i+=s.length}let n;if(r.length===1)n=r[0];else{n=new Uint8Array(r.reduce((s,h)=>s+h.length,0));let o=0;for(let s of r)n.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(n)}class At extends Xe{constructor(e,t=null,r=null,i=null){super(e);this.statusCode=t,this.body=r,this.requestId=i}}function Cn(){return Math.floor(Date.now()/1000)}class Km{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let r=t.expiresAt-Cn();if(r>wS)return t.token;if(r>ss)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(Cn()-this.lastAdvisoryError<SS)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=Cn(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var $t=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function MS(e){let t=0;for(let n of e)t+=n.length;let r=new Uint8Array(t),i=0;for(let n of e)r.set(n,i),i+=n.length;return r}var xS;function as(e){let t;return(xS??(t=new globalThis.TextEncoder,xS=t.encode.bind(t)))(e)}var kS;function Vm(e){let t;return(kS??(t=new globalThis.TextDecoder,kS=t.decode.bind(t)))(e)}var Xc={off:0,error:200,warn:300,info:400,debug:500},Wm=(e,t,r)=>{if(!e)return;if(sS(Xc,e))return e;tr(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Xc))}`);return};function qa(){}function Jc(e,t,r){if(!t||Xc[e]>Xc[r])return qa;else return t[e].bind(t)}var $A={error:qa,warn:qa,info:qa,debug:qa},ES=new WeakMap;function tr(e){let t=e.logger,r=e.logLevel??"off";if(!t)return $A;let i=ES.get(t);if(i&&i[0]===r)return i[1];let n={error:Jc("error",t,r),warn:Jc("warn",t,r),info:Jc("info",t,r),debug:Jc("debug",t,r)};return ES.set(t,[r,n]),n}var ui=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var Yc="1.0",PA=/^[A-Za-z0-9_.-]+$/;function IS(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!PA.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var TS=async(e)=>{var t,r;let i=await Gm();if(i===null)return null;let n=e??await PS();if(n===null)return null;IS(n);let o=await import("node:fs"),h=(await Promise.resolve().then(() => (Rn(),yo))).join(i,"configs",`${n}.json`),b;try{b=await o.promises.readFile(h,"utf-8")}catch(g){if(g?.code!=="ENOENT")throw Error(`failed to read config file ${h}: ${g}`);b=null}if(b===null){let g=$t("ANTHROPIC_ORGANIZATION_ID"),S=$t("ANTHROPIC_IDENTITY_TOKEN_FILE"),x=$t("ANTHROPIC_FEDERATION_RULE_ID");if(x&&g)return{fromFile:!1,config:{organization_id:g,workspace_id:$t("ANTHROPIC_WORKSPACE_ID"),base_url:$t("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:x,service_account_id:$t("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:S?{source:"file",path:S}:void 0,scope:$t("ANTHROPIC_SCOPE")}}};return null}let v;try{v=JSON.parse(b)}catch(g){throw Error(`failed to parse config file ${h}: ${g}`)}if(!v.authentication)throw Error(`config file ${h} is missing "authentication"`);let _=v.authentication.type;if(_!=="oidc_federation"&&_!=="user_oauth")throw Error(`authentication.type "${_}" is not a known authentication type`);if(v.organization_id??(v.organization_id=$t("ANTHROPIC_ORGANIZATION_ID")),v.workspace_id??(v.workspace_id=$t("ANTHROPIC_WORKSPACE_ID")),v.base_url??(v.base_url=$t("ANTHROPIC_BASE_URL")),(t=v.authentication).scope??(t.scope=$t("ANTHROPIC_SCOPE")),v.authentication.type==="oidc_federation"){if(!v.authentication.identity_token){let g=$t("ANTHROPIC_IDENTITY_TOKEN_FILE");if(g)v.authentication.identity_token={source:"file",path:g}}if(!v.authentication.federation_rule_id)v.authentication.federation_rule_id=$t("ANTHROPIC_FEDERATION_RULE_ID")??"";(r=v.authentication).service_account_id??(r.service_account_id=$t("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:v,fromFile:!0}};var $S=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await Gm();if(!r)return null;let i=t??await PS();if(!i)return null;return IS(i),(await Promise.resolve().then(() => (Rn(),yo))).join(r,"credentials",`${i}.json`)},Gm=async()=>{if(!AA())return null;let e=await Promise.resolve().then(() => (Rn(),yo)),t=$t("ANTHROPIC_CONFIG_DIR");if(t)return t;if(Ua()["X-Stainless-OS"]==="Windows"){let o=$t("APPDATA");if(o)return e.join(o,"Anthropic");let s=$t("USERPROFILE");if(s)return e.join(s,"AppData","Roaming","Anthropic");return null}let i=$t("XDG_CONFIG_HOME");if(i)return e.join(i,"anthropic");let n=$t("HOME");if(n)return e.join(n,".config","anthropic");return null},AA=()=>{let e=Ua()["X-Stainless-Runtime"];return e==="node"||e==="deno"},PS=async()=>{let e=await Gm();if(!e)return null;let t=$t("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),n=(await Promise.resolve().then(() => (Rn(),yo))).join(e,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}};function Jm(e){if(!e)throw new Xe("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(n){throw new Xe(`Failed to read identity token file at ${e}: ${n}`)}let i=r.trim();if(!i)throw new Xe(`Identity token file at ${e} is empty`);return i}}function AS(e){if(!e)throw new Xe("Identity token value is empty");return()=>e}function RS(e){return async()=>{Kc(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new At(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:vS,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)r.service_account_id=e.serviceAccountId;if(e.workspaceId)r.workspace_id=e.workspaceId;let i=`${e.baseURL}${Zc}`,n;try{n=await e.fetch(i,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${bo},${_S}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Sn} oidcFederationProvider`},body:JSON.stringify(r)})}catch(b){throw new At(`Failed to reach token endpoint ${i}: ${b}`)}let o=n.headers.get("Request-Id");if(!n.ok){let b=await n.text().catch(()=>""),v=Yr(b),_="";if(n.status===401)_=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new At(`Token exchange failed with status ${n.status}${o?` (request-id ${o})`:""}: ${v}${_}`,n.status,v,o)}let s=await Vc(n,o),h=Number(s.expires_in);if(!Number.isFinite(h))throw new At(`Token endpoint response missing required fields: ${JSON.stringify(Yr(s))}`,n.status,Yr(s),o);return{token:s.access_token,expiresAt:Cn()+h}}}function CS(e){return async(t)=>{let r=await import("node:fs");await Wc(e.credentialsPath,e.onSafetyWarning);let i;try{i=await r.promises.readFile(e.credentialsPath,"utf-8")}catch(T){throw new At(`Credentials file not found at ${e.credentialsPath}: ${T}`)}let n;try{n=JSON.parse(i)}catch(T){throw new At(`Credentials file at ${e.credentialsPath} is not valid JSON: ${T}`)}let o=n.access_token;if(!o)throw new At(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=n.expires_at;if(!t?.forceRefresh&&(s==null||Cn()<s-ss))return{token:o,expiresAt:s??null};let h=n.refresh_token;if(!e.clientId||!h)throw new At(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${h?"set":"empty"})`);Kc(e.baseURL);let b={grant_type:bS,refresh_token:h,client_id:e.clientId},v=`${e.baseURL}${Zc}`,_;try{_=await e.fetch(v,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":bo,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${Sn} userOAuthProvider`},body:JSON.stringify(b)})}catch(T){throw new At(`User OAuth refresh failed to reach token endpoint: ${T}`)}let g=_.headers.get("Request-Id");if(!_.ok){let T=await _.text().catch(()=>"");throw new At(`User OAuth refresh failed (HTTP ${_.status}): ${Yr(T)}`,_.status,Yr(T),g)}let S=await Vc(_,g),x=Number(S.expires_in);if(!Number.isFinite(x))throw new At(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(Yr(S))}`,_.status,Yr(S),g);let M=Cn()+x,I=S.refresh_token||h;return await Gc(e.credentialsPath,{...n,version:Yc,type:"oauth_token",access_token:S.access_token,expires_at:M,refresh_token:I}),{token:S.access_token,expiresAt:M}}}function Xm(e,t){let r=e.authentication.credentials_path??null,i=(e.base_url||t.baseURL).replace(/\/+$/,""),n=RA(e,r,i,t),o={};if(e.workspace_id&&e.authentication.type==="user_oauth")o["anthropic-workspace-id"]=e.workspace_id;return{provider:n,extraHeaders:o,baseURL:e.base_url||void 0}}async function OS(e,t){let r=await TS(t);if(!r)return null;let{config:i,fromFile:n}=r,o=i.authentication.credentials_path||!n?i:{...i,authentication:{...i.authentication,credentials_path:await $S(i,t)??void 0}};return Xm(o,e)}function RA(e,t,r,i){switch(e.authentication.type){case"oidc_federation":{let n=e.authentication,o=CA(n);if(!o)throw new At("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!n.federation_rule_id)throw new At("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new At("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=RS({identityTokenProvider:o,federationRuleId:n.federation_rule_id,organizationId:e.organization_id,serviceAccountId:n.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent});if(t)return OA(s,t,i.onCacheWriteError,i.onSafetyWarning);return s}case"user_oauth":{if(!t)throw new At("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return CS({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:i.fetch,userAgent:i.userAgent,onSafetyWarning:i.onSafetyWarning})}default:{let n=e.authentication.type;throw new At(`authentication.type "${n}" is not a known authentication type`)}}}function CA(e){if(e.identity_token){let i=e.identity_token.source;if(i!=="file")throw new At(`identity_token.source "${i}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new At('identity_token.source "file" requires a non-empty path');return Jm(e.identity_token.path)}let t=$t("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return Jm(t);let r=$t("ANTHROPIC_IDENTITY_TOKEN");if(r)return AS(r);return null}function OA(e,t,r,i){return async(n)=>{let o=await import("node:fs");await Wc(t,i);let s;try{let b=await o.promises.readFile(t,"utf-8");s=JSON.parse(b);let v=s?.access_token;if(v&&!n?.forceRefresh){let _=s?.expires_at;if(_==null||Cn()<_-ss)return{token:v,expiresAt:_??null}}}catch(b){if(b?.code!=="ENOENT"&&!(b instanceof SyntaxError))r?.(b)}let h=await e(n);try{await Gc(t,{...s??{},version:Yc,type:"oauth_token",access_token:h.token,expires_at:h.expiresAt})}catch(b){r?.(b)}return h}}var cn,dn;class Di{constructor(){cn.set(this,void 0),dn.set(this,void 0),Ve(this,cn,new Uint8Array,"f"),Ve(this,dn,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?as(e):e;Ve(this,cn,MS([oe(this,cn,"f"),t]),"f");let r=[],i;while((i=NA(oe(this,cn,"f"),oe(this,dn,"f")))!=null){if(i.carriage&&oe(this,dn,"f")==null){Ve(this,dn,i.index,"f");continue}if(oe(this,dn,"f")!=null&&(i.index!==oe(this,dn,"f")+1||i.carriage)){r.push(Vm(oe(this,cn,"f").subarray(0,oe(this,dn,"f")-1))),Ve(this,cn,oe(this,cn,"f").subarray(oe(this,dn,"f")),"f"),Ve(this,dn,null,"f");continue}let n=oe(this,dn,"f")!==null?i.preceding-1:i.preceding,o=Vm(oe(this,cn,"f").subarray(0,n));r.push(o),Ve(this,cn,oe(this,cn,"f").subarray(i.index),"f"),Ve(this,dn,null,"f")}return r}flush(){if(!oe(this,cn,"f").length)return[];return this.decode(`
`)}}cn=new WeakMap,dn=new WeakMap;Di.NEWLINE_CHARS=new Set([`
`,"\r"]);Di.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function NA(e,t){for(let n=t??0;n<e.length;n++){if(e[n]===10)return{preceding:n,index:n+1,carriage:!1};if(e[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function NS(e){for(let i=0;i<e.length-1;i++){if(e[i]===10&&e[i+1]===10)return i+2;if(e[i]===13&&e[i+1]===13)return i+2;if(e[i]===13&&e[i+1]===10&&i+3<e.length&&e[i+2]===13&&e[i+3]===10)return i+4}return-1}var Fa;class fn{constructor(e,t,r){this.iterator=e,Fa.set(this,void 0),this.controller=t,Ve(this,Fa,r,"f")}static fromSSEResponse(e,t,r){let i=!1,n=r?tr(r):console;async function*o(){if(i)throw new Xe("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(let h of DA(e,t)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(b){throw n.error("Could not parse message into JSON:",h.data),n.error("From chunk:",h.raw),b}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop"||h.event==="message"||h.event==="user.message"||h.event==="user.interrupt"||h.event==="user.tool_confirmation"||h.event==="user.custom_tool_result"||h.event==="agent.message"||h.event==="agent.thinking"||h.event==="agent.tool_use"||h.event==="agent.tool_result"||h.event==="agent.mcp_tool_use"||h.event==="agent.mcp_tool_result"||h.event==="agent.custom_tool_use"||h.event==="agent.thread_context_compacted"||h.event==="session.status_running"||h.event==="session.status_idle"||h.event==="session.status_rescheduled"||h.event==="session.status_terminated"||h.event==="session.error"||h.event==="session.deleted"||h.event==="span.model_request_start"||h.event==="span.model_request_end")try{yield JSON.parse(h.data)}catch(b){throw n.error("Could not parse message into JSON:",h.data),n.error("From chunk:",h.raw),b}if(h.event==="ping")continue;if(h.event==="error"){let b=Bc(h.data)??h.data,v=b?.error?.type;throw new br(void 0,b,void 0,e.headers,v)}}s=!0}catch(h){if(ai(h))return;throw h}finally{if(!s)t.abort()}}return new fn(o,t,r)}static fromReadableStream(e,t,r){let i=!1;async function*n(){let s=new Di,h=La(e);for await(let b of h)for(let v of s.decode(b))yield v;for(let b of s.flush())yield b}async function*o(){if(i)throw new Xe("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(let h of n()){if(s)continue;if(h)yield JSON.parse(h)}s=!0}catch(h){if(ai(h))return;throw h}finally{if(!s)t.abort()}}return new fn(o,t,r)}[(Fa=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),i=(n)=>({next:()=>{if(n.length===0){let o=r.next();e.push(o),t.push(o)}return n.shift()}});return[new fn(()=>i(e),this.controller,oe(this,Fa,"f")),new fn(()=>i(t),this.controller,oe(this,Fa,"f"))]}toReadableStream(){let e=this,t;return Hm({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{let{value:i,done:n}=await t.next();if(n)return r.close();let o=as(JSON.stringify(i)+`
`);r.enqueue(o)}catch(i){r.error(i)}},async cancel(){await t.return?.()}})}}async function*DA(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new Xe("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new Xe("Attempted to iterate over a response with no body")}let r=new DS,i=new Di,n=La(e.body);for await(let o of zA(n))for(let s of i.decode(o)){let h=r.decode(s);if(h)yield h}for(let o of i.flush()){let s=r.decode(o);if(s)yield s}}async function*zA(e){let t=new Uint8Array;for await(let r of e){if(r==null)continue;let i=r instanceof ArrayBuffer?new Uint8Array(r):typeof r==="string"?as(r):r,n=new Uint8Array(t.length+i.length);n.set(t),n.set(i,t.length),t=n;let o;while((o=NS(t))!==-1)yield t.slice(0,o),t=t.slice(o)}if(t.length>0)yield t}class DS{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r"))e=e.substring(0,e.length-1);if(!e){if(!this.event&&!this.data.length)return null;let n={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],n}if(this.chunks.push(e),e.startsWith(":"))return null;let[t,r,i]=jA(e,":");if(i.startsWith(" "))i=i.substring(1);if(t==="event")this.event=i;else if(t==="data")this.data.push(i);return null}}function jA(e,t){let r=e.indexOf(t);if(r!==-1)return[e.substring(0,r),t,e.substring(r+t.length)];return[e,"",""]}async function Qc(e,t){let{response:r,requestLogID:i,retryOfRequestLogID:n,startTime:o}=t,s=await(async()=>{if(t.options.stream){if(tr(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass)return t.options.__streamClass.fromSSEResponse(r,t.controller);return fn.fromSSEResponse(r,t.controller)}if(r.status===204)return null;if(t.options.__binaryResponse)return r;let b=r.headers.get("content-type")?.split(";")[0]?.trim();if(b?.includes("application/json")||b?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let S=await r.json();return Ym(S,r)}return await r.text()})();return tr(e).debug(`[${i}] response parsed`,ui({retryOfRequestLogID:n,url:r.url,status:r.status,body:s,durationMs:Date.now()-o})),s}function Ym(e,t){if(!e||typeof e!=="object"||Array.isArray(e))return e;return Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var Ba;class _o extends Promise{constructor(e,t,r=Qc){super((i)=>{i(null)});this.responsePromise=t,this.parseResponse=r,Ba.set(this,void 0),Ve(this,Ba,e,"f")}_thenUnwrap(e){return new _o(oe(this,Ba,"f"),this.responsePromise,async(t,r)=>Ym(e(await this.parseResponse(t,r),r),r.response))}asResponse(){return this.responsePromise.then((e)=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then((e)=>this.parseResponse(oe(this,Ba,"f"),e));return this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}Ba=new WeakMap;var ed;class Qm{constructor(e,t,r,i){ed.set(this,void 0),Ve(this,ed,e,"f"),this.options=i,this.response=t,this.body=r}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Xe("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await oe(this,ed,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;yield e;while(e.hasNextPage())e=await e.getNextPage(),yield e}async*[(ed=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}}class td extends _o{constructor(e,t,r){super(e,t,async(i,n)=>new r(i,n.response,await Qc(i,n),n.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}}class On extends Qm{constructor(e,t,r,i){super(e,t,r,i);this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let t=this.first_id;if(!t)return null;return{...this.options,query:{...Fc(this.options.query),before_id:t}}}let e=this.last_id;if(!e)return null;return{...this.options,query:{...Fc(this.options.query),after_id:e}}}}class Rt extends Qm{constructor(e,t,r,i){super(e,t,r,i);this.data=r.data||[],this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;if(!e)return null;return{...this.options,query:{...Fc(this.options.query),page:e}}}}var t0=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node==="string"&&parseInt(e.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function wo(e,t,r){return t0(),new File(e,t??"unknown_file",r)}function Ha(e,t){let r=typeof e==="object"&&e!==null&&(("name"in e)&&e.name&&String(e.name)||("url"in e)&&e.url&&String(e.url)||("filename"in e)&&e.filename&&String(e.filename)||("path"in e)&&e.path&&String(e.path))||"";return t?r.split(/[\\/]/).pop()||void 0:r}var r0=(e)=>e!=null&&typeof e==="object"&&typeof e[Symbol.asyncIterator]==="function";var us=async(e,t,r=!0)=>({...e,body:await qA(e.body,t,r)}),zS=new WeakMap;function LA(e){let t=typeof e==="function"?e:e.fetch,r=zS.get(t);if(r)return r;let i=(async()=>{try{let n="Response"in t?t.Response:(await t("data:,")).constructor,o=new FormData;if(o.toString()===await new n(o).text())return!1;return!0}catch{return!0}})();return zS.set(t,i),i}var qA=async(e,t,r=!0)=>{if(!await LA(t))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let i=new FormData;return await Promise.all(Object.entries(e||{}).map(([n,o])=>e0(i,n,o,r))),i},FA=(e)=>e instanceof Blob&&("name"in e);var e0=async(e,t,r,i)=>{if(r===void 0)return;if(r==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")e.append(t,String(r));else if(r instanceof Response){let n={},o=r.headers.get("Content-Type");if(o)n={type:o};e.append(t,wo([await r.blob()],Ha(r,i),n))}else if(r0(r))e.append(t,wo([await new Response(Hc(r)).blob()],Ha(r,i)));else if(FA(r))e.append(t,wo([r],Ha(r,i),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map((n)=>e0(e,t+"[]",n,i)));else if(typeof r==="object")await Promise.all(Object.entries(r).map(([n,o])=>e0(e,`${t}[${n}]`,o,i)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)};var jS=(e)=>e!=null&&typeof e==="object"&&typeof e.size==="number"&&typeof e.type==="string"&&typeof e.text==="function"&&typeof e.slice==="function"&&typeof e.arrayBuffer==="function",BA=(e)=>e!=null&&typeof e==="object"&&typeof e.name==="string"&&typeof e.lastModified==="number"&&jS(e),HA=(e)=>e!=null&&typeof e==="object"&&typeof e.url==="string"&&typeof e.blob==="function";async function rd(e,t,r){if(t0(),e=await e,t||(t=Ha(e,!0)),BA(e)){if(e instanceof File&&t==null&&r==null)return e;return wo([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...r})}if(HA(e)){let n=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),wo(await n0(n),t,r)}let i=await n0(e);if(!r?.type){let n=i.find((o)=>typeof o==="object"&&("type"in o)&&o.type);if(typeof n==="string")r={...r,type:n}}return wo(i,t,r)}async function n0(e){let t=[];if(typeof e==="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(jS(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(r0(e))for await(let r of e)t.push(...await n0(r));else{let r=e?.constructor?.name;throw Error(`Unexpected data type: ${typeof e}${r?`; constructor: ${r}`:""}${ZA(e)}`)}return t}function ZA(e){if(typeof e!=="object"||e===null)return"";return`; props: [${Object.getOwnPropertyNames(e).map((r)=>`"${r}"`).join(", ")}]`}class ut{constructor(e){this._client=e}}var US=Symbol.for("brand.privateNullableHeaders");function*VA(e){if(!e)return;if(US in e){let{values:i,nulls:n}=e;yield*i.entries();for(let o of n)yield[o,null];return}let t=!1,r;if(e instanceof Headers)r=e.entries();else if(Fm(e))r=e;else t=!0,r=Object.entries(e??{});for(let i of r){let n=i[0];if(typeof n!=="string")throw TypeError("expected header name to be a string");let o=Fm(i[1])?i[1]:[i[1]],s=!1;for(let h of o){if(h===void 0)continue;if(t&&!s)s=!0,yield[n,null];yield[n,h]}}}var be=(e)=>{let t=new Headers,r=new Set;for(let i of e){let n=new Set;for(let[o,s]of VA(i)){let h=o.toLowerCase();if(!n.has(h))t.delete(o),n.add(h);if(s===null)t.delete(o),r.add(h);else t.append(o,s),r.delete(h)}}return{[US]:!0,values:t,nulls:r}};function qS(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var LS=Object.freeze(Object.create(null)),WA=(e=qS)=>function(r,...i){if(r.length===1)return r[0];let n=!1,o=[],s=r.reduce((_,g,S)=>{if(/[?#]/.test(g))n=!0;let x=i[S],M=(n?encodeURIComponent:e)(""+x);if(S!==i.length&&(x==null||typeof x==="object"&&x.toString===Object.getPrototypeOf(Object.getPrototypeOf(x.hasOwnProperty??LS)??LS)?.toString))M=x+"",o.push({start:_.length+g.length,length:M.length,error:`Value of type ${Object.prototype.toString.call(x).slice(8,-1)} is not a valid path parameter`});return _+g+(S===i.length?"":M)},""),h=s.split(/[?#]/,1)[0],b=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,v;while((v=b.exec(h))!==null)o.push({start:v.index,length:v[0].length,error:`Value "${v[0]}" can't be safely passed as a path parameter`});if(o.sort((_,g)=>_.start-g.start),o.length>0){let _=0,g=o.reduce((S,x)=>{let M=" ".repeat(x.start-_),I="^".repeat(x.length);return _=x.start+x.length,S+M+I},"");throw new Xe(`Path parameters result in path with invalid segments:
${o.map((S)=>S.error).join(`
`)}
${s}
${g}`)}return s},Ze=WA(qS);class Za extends ut{create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/environments?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/environments/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/environments/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/environments/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/environments/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}var Ka=Symbol("anthropic.sdk.stainlessHelper");function nd(e){return typeof e==="object"&&e!==null&&Ka in e}function i0(e,t){let r=new Set;if(e){for(let i of e)if(nd(i))r.add(i[Ka])}if(t)for(let i of t){if(nd(i))r.add(i[Ka]);if(Array.isArray(i.content)){for(let n of i.content)if(nd(n))r.add(n[Ka])}}return Array.from(r)}function id(e,t){let r=i0(e,t);if(r.length===0)return{};return{"x-stainless-helper":r.join(", ")}}function FS(e){if(nd(e))return{"x-stainless-helper":e[Ka]};return{}}class Va extends ut{list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/files?beta=true",On,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/files/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},r?.headers])})}download(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/files/${e}/content?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}retrieveMetadata(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/files/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},r?.headers])})}upload(e,t){let{betas:r,...i}=e;return this._client.post("/v1/files?beta=true",us({body:i,...t,headers:be([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},FS(i.file),t?.headers])},this._client))}}class Wa extends ut{retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/models/${e}?beta=true`,{...r,headers:be([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/models?beta=true",On,{query:i,...t,headers:be([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers])})}}class Ga extends ut{create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/user_profiles/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/user_profiles/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"user-profiles-2026-03-24"].toString()},t?.headers])})}createEnrollmentURL(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}}class Ja extends ut{list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/agents/${e}/versions?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}class ls extends ut{constructor(){super(...arguments);this.versions=new Ja(this._client)}create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/agents?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i,...n}=t??{};return this._client.get(Ze`/v1/agents/${e}?beta=true`,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/agents/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}archive(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/agents/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}ls.Versions=Ja;class Xa extends ut{create(e,t,r){let{view:i,betas:n,...o}=t;return this._client.post(Ze`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:o,...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,t,r){let{memory_store_id:i,betas:n,...o}=t;return this._client.get(Ze`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:o,...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{memory_store_id:i,view:n,betas:o,...s}=t;return this._client.post(Ze`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:n},body:s,...r,headers:be([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/memory_stores/${e}/memories?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,t,r){let{memory_store_id:i,expected_content_sha256:n,betas:o}=t;return this._client.delete(Ze`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:n},...r,headers:be([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}class Ya extends ut{retrieve(e,t,r){let{memory_store_id:i,betas:n,...o}=t;return this._client.get(Ze`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:o,...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/memory_stores/${e}/memory_versions?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}redact(e,t,r){let{memory_store_id:i,betas:n}=t;return this._client.post(Ze`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}class So extends ut{constructor(){super(...arguments);this.memories=new Xa(this._client),this.memoryVersions=new Ya(this._client)}create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/memory_stores?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/memory_stores/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/memory_stores/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/memory_stores/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/memory_stores/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}So.Memories=Xa;So.MemoryVersions=Ya;class cs{constructor(e,t){this.iterator=e,this.controller=t}async*decoder(){let e=new Di;for await(let t of this.iterator)for(let r of e.decode(t))yield JSON.parse(r);for(let t of e.flush())yield JSON.parse(t)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new Xe("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new Xe("Attempted to iterate over a response with no body")}return new cs(La(e.body),t)}}class Qa extends ut{create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/messages/batches/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",On,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/messages/batches/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},r?.headers])})}cancel(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/messages/batches/${e}/cancel?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},r?.headers])})}async results(e,t={},r){let i=await this.retrieve(e);if(!i.results_url)throw new Xe(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:n}=t??{};return this._client.get(i.results_url,{...r,headers:be([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>cs.fromResponse(s.response,s.controller))}}var od={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function BS(e){return e?.output_format??e?.output_config?.format}function o0(e,t,r){let i=BS(t);if(!t||!("parse"in(i??{})))return{...e,content:e.content.map((n)=>{if(n.type==="text"){let o=Object.defineProperty({...n},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return n}),parsed_output:null};return s0(e,t,r)}function s0(e,t,r){let i=null,n=e.content.map((o)=>{if(o.type==="text"){let s=o9(t,o.text);if(i===null)i=s;let h=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(h,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...e,content:n,parsed_output:i}}function o9(e,t){let r=BS(e);if(r?.type!=="json_schema")return null;try{if("parse"in r)return r.parse(t);return JSON.parse(t)}catch(i){throw new Xe(`Failed to parse structured output: ${i}`)}}var s9=(e)=>{let t=0,r=[];while(t<e.length){let i=e[t];if(i==="\\"){t++;continue}if(i==="{"){r.push({type:"brace",value:"{"}),t++;continue}if(i==="}"){r.push({type:"brace",value:"}"}),t++;continue}if(i==="["){r.push({type:"paren",value:"["}),t++;continue}if(i==="]"){r.push({type:"paren",value:"]"}),t++;continue}if(i===":"){r.push({type:"separator",value:":"}),t++;continue}if(i===","){r.push({type:"delimiter",value:","}),t++;continue}if(i==='"'){let h="",b=!1;i=e[++t];while(i!=='"'){if(t===e.length){b=!0;break}if(i==="\\"){if(t++,t===e.length){b=!0;break}h+=i+e[t],i=e[++t]}else h+=i,i=e[++t]}if(i=e[++t],!b)r.push({type:"string",value:h});continue}if(i&&/\s/.test(i)){t++;continue}let o=/[0-9]/;if(i&&o.test(i)||i==="-"||i==="."){let h="";if(i==="-")h+=i,i=e[++t];while(i&&o.test(i)||i===".")h+=i,i=e[++t];r.push({type:"number",value:h});continue}let s=/[a-z]/i;if(i&&s.test(i)){let h="";while(i&&s.test(i)){if(t===e.length)break;h+=i,i=e[++t]}if(h=="true"||h=="false"||h==="null")r.push({type:"name",value:h});else{t++;continue}continue}t++}return r},ds=(e)=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),ds(e);break;case"number":let r=t.value[t.value.length-1];if(r==="."||r==="-")return e=e.slice(0,e.length-1),ds(e);case"string":let i=e[e.length-2];if(i?.type==="delimiter")return e=e.slice(0,e.length-1),ds(e);else if(i?.type==="brace"&&i.value==="{")return e=e.slice(0,e.length-1),ds(e);break;case"delimiter":return e=e.slice(0,e.length-1),ds(e);break}return e},a9=(e)=>{let t=[];if(e.map((r)=>{if(r.type==="brace")if(r.value==="{")t.push("}");else t.splice(t.lastIndexOf("}"),1);if(r.type==="paren")if(r.value==="[")t.push("]");else t.splice(t.lastIndexOf("]"),1)}),t.length>0)t.reverse().map((r)=>{if(r==="}")e.push({type:"brace",value:"}"});else if(r==="]")e.push({type:"paren",value:"]"})});return e},u9=(e)=>{let t="";return e.map((r)=>{switch(r.type){case"string":t+='"'+r.value+'"';break;default:t+=r.value;break}}),t},sd=(e)=>JSON.parse(u9(a9(ds(s9(e)))));var xn,zi,fs,eu,ad,tu,ru,ud,nu,li,iu,ld,cd,xo,dd,fd,ou,a0,HS,hd,u0,l0,c0,ZS,KS="__json_buf";function VS(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class su{constructor(e,t){xn.add(this),this.messages=[],this.receivedMessages=[],zi.set(this,void 0),fs.set(this,null),this.controller=new AbortController,eu.set(this,void 0),ad.set(this,()=>{}),tu.set(this,()=>{}),ru.set(this,void 0),ud.set(this,()=>{}),nu.set(this,()=>{}),li.set(this,{}),iu.set(this,!1),ld.set(this,!1),cd.set(this,!1),xo.set(this,!1),dd.set(this,void 0),fd.set(this,void 0),ou.set(this,void 0),hd.set(this,(r)=>{if(Ve(this,ld,!0,"f"),ai(r))r=new Pr;if(r instanceof Pr)return Ve(this,cd,!0,"f"),this._emit("abort",r);if(r instanceof Xe)return this._emit("error",r);if(r instanceof Error){let i=new Xe(r.message);return i.cause=r,this._emit("error",i)}return this._emit("error",new Xe(String(r)))}),Ve(this,eu,new Promise((r,i)=>{Ve(this,ad,r,"f"),Ve(this,tu,i,"f")}),"f"),Ve(this,ru,new Promise((r,i)=>{Ve(this,ud,r,"f"),Ve(this,nu,i,"f")}),"f"),oe(this,eu,"f").catch(()=>{}),oe(this,ru,"f").catch(()=>{}),Ve(this,fs,e,"f"),Ve(this,ou,t?.logger??console,"f")}get response(){return oe(this,dd,"f")}get request_id(){return oe(this,fd,"f")}async withResponse(){Ve(this,xo,!0,"f");let e=await oe(this,eu,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new su(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,r,{logger:i}={}){let n=new su(t,{logger:i});for(let o of t.messages)n._addMessageParam(o);return Ve(n,fs,{...t,stream:!0},"f"),n._run(()=>n._createMessage(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),n}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},oe(this,hd,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,r){let i=r?.signal,n;if(i){if(i.aborted)this.controller.abort();n=this.controller.abort.bind(this.controller),i.addEventListener("abort",n)}try{oe(this,xn,"m",u0).call(this);let{response:o,data:s}=await e.create({...t,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let h of s)oe(this,xn,"m",l0).call(this,h);if(s.controller.signal?.aborted)throw new Pr;oe(this,xn,"m",c0).call(this)}finally{if(i&&n)i.removeEventListener("abort",n)}}_connected(e){if(this.ended)return;Ve(this,dd,e,"f"),Ve(this,fd,e?.headers.get("request-id"),"f"),oe(this,ad,"f").call(this,e),this._emit("connect")}get ended(){return oe(this,iu,"f")}get errored(){return oe(this,ld,"f")}get aborted(){return oe(this,cd,"f")}abort(){this.controller.abort()}on(e,t){return(oe(this,li,"f")[e]||(oe(this,li,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=oe(this,li,"f")[e];if(!r)return this;let i=r.findIndex((n)=>n.listener===t);if(i>=0)r.splice(i,1);return this}once(e,t){return(oe(this,li,"f")[e]||(oe(this,li,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{if(Ve(this,xo,!0,"f"),e!=="error")this.once("error",r);this.once(e,t)})}async done(){Ve(this,xo,!0,"f"),await oe(this,ru,"f")}get currentMessage(){return oe(this,zi,"f")}async finalMessage(){return await this.done(),oe(this,xn,"m",a0).call(this)}async finalText(){return await this.done(),oe(this,xn,"m",HS).call(this)}_emit(e,...t){if(oe(this,iu,"f"))return;if(e==="end")Ve(this,iu,!0,"f"),oe(this,ud,"f").call(this);let r=oe(this,li,"f")[e];if(r)oe(this,li,"f")[e]=r.filter((i)=>!i.once),r.forEach(({listener:i})=>i(...t));if(e==="abort"){let i=t[0];if(!oe(this,xo,"f")&&!r?.length)Promise.reject(i);oe(this,tu,"f").call(this,i),oe(this,nu,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=t[0];if(!oe(this,xo,"f")&&!r?.length)Promise.reject(i);oe(this,tu,"f").call(this,i),oe(this,nu,"f").call(this,i),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",oe(this,xn,"m",a0).call(this))}async _fromReadableStream(e,t){let r=t?.signal,i;if(r){if(r.aborted)this.controller.abort();i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i)}try{oe(this,xn,"m",u0).call(this),this._connected(null);let n=fn.fromReadableStream(e,this.controller);for await(let o of n)oe(this,xn,"m",l0).call(this,o);if(n.controller.signal?.aborted)throw new Pr;oe(this,xn,"m",c0).call(this)}finally{if(r&&i)r.removeEventListener("abort",i)}}[(zi=new WeakMap,fs=new WeakMap,eu=new WeakMap,ad=new WeakMap,tu=new WeakMap,ru=new WeakMap,ud=new WeakMap,nu=new WeakMap,li=new WeakMap,iu=new WeakMap,ld=new WeakMap,cd=new WeakMap,xo=new WeakMap,dd=new WeakMap,fd=new WeakMap,ou=new WeakMap,hd=new WeakMap,xn=new WeakSet,a0=function(){if(this.receivedMessages.length===0)throw new Xe("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},HS=function(){if(this.receivedMessages.length===0)throw new Xe("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((r)=>r.type==="text").map((r)=>r.text);if(t.length===0)throw new Xe("stream ended without producing a content block with type=text");return t.join(" ")},u0=function(){if(this.ended)return;Ve(this,zi,void 0,"f")},l0=function(t){if(this.ended)return;let r=oe(this,xn,"m",ZS).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let i=r.content.at(-1);switch(t.delta.type){case"text_delta":{if(i.type==="text")this._emit("text",t.delta.text,i.text||"");break}case"citations_delta":{if(i.type==="text")this._emit("citation",t.delta.citation,i.citations??[]);break}case"input_json_delta":{if(VS(i)&&i.input)this._emit("inputJson",t.delta.partial_json,i.input);break}case"thinking_delta":{if(i.type==="thinking")this._emit("thinking",t.delta.thinking,i.thinking);break}case"signature_delta":{if(i.type==="thinking")this._emit("signature",i.signature);break}case"compaction_delta":{if(i.type==="compaction"&&i.content)this._emit("compaction",i.content);break}default:WS(t.delta)}break}case"message_stop":{this._addMessageParam(r),this._addMessage(o0(r,oe(this,fs,"f"),{logger:oe(this,ou,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Ve(this,zi,r,"f");break}case"content_block_start":case"message_delta":break}},c0=function(){if(this.ended)throw new Xe("stream has ended, this shouldn't happen");let t=oe(this,zi,"f");if(!t)throw new Xe("request ended without sending any chunks");return Ve(this,zi,void 0,"f"),o0(t,oe(this,fs,"f"),{logger:oe(this,ou,"f")})},ZS=function(t){let r=oe(this,zi,"f");if(t.type==="message_start"){if(r)throw new Xe(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new Xe(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":if(r.container=t.delta.container,r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,r.context_management=t.context_management,t.usage.input_tokens!=null)r.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)r.usage.server_tool_use=t.usage.server_tool_use;if(t.usage.iterations!=null)r.usage.iterations=t.usage.iterations;return r;case"content_block_start":return r.content.push(t.content_block),r;case"content_block_delta":{let i=r.content.at(t.index);switch(t.delta.type){case"text_delta":{if(i?.type==="text")r.content[t.index]={...i,text:(i.text||"")+t.delta.text};break}case"citations_delta":{if(i?.type==="text")r.content[t.index]={...i,citations:[...i.citations??[],t.delta.citation]};break}case"input_json_delta":{if(i&&VS(i)){let n=i[KS]||"";n+=t.delta.partial_json;let o={...i};if(Object.defineProperty(o,KS,{value:n,enumerable:!1,writable:!0}),n)try{o.input=sd(n)}catch(s){let h=new Xe(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${s}. JSON: ${n}`);oe(this,hd,"f").call(this,h)}r.content[t.index]=o}break}case"thinking_delta":{if(i?.type==="thinking")r.content[t.index]={...i,thinking:i.thinking+t.delta.thinking};break}case"signature_delta":{if(i?.type==="thinking")r.content[t.index]={...i,signature:t.delta.signature};break}case"compaction_delta":{if(i?.type==="compaction")r.content[t.index]={...i,content:(i.content||"")+t.delta.content};break}default:WS(t.delta)}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("streamEvent",(i)=>{let n=t.shift();if(n)n.resolve(i);else e.push(i)}),this.on("end",()=>{r=!0;for(let i of t)i.resolve(void 0);t.length=0}),this.on("abort",(i)=>{r=!0;for(let n of t)n.reject(i);t.length=0}),this.on("error",(i)=>{r=!0;for(let n of t)n.reject(i);t.length=0}),{next:async()=>{if(!e.length){if(r)return{value:void 0,done:!0};return new Promise((n,o)=>t.push({resolve:n,reject:o})).then((n)=>n?{value:n,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new fn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function WS(e){}class hs extends Error{constructor(e){let t=typeof e==="string"?e:e.map((r)=>{if(r.type==="text")return r.text;return`[${r.type}]`}).join(" ");super(t);this.name="ToolError",this.content=e}}var GS=1e5,JS=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
1. Task Overview
The user's core request and success criteria
Any clarifications or constraints they specified
2. Current State
What has been completed so far
Files created, modified, or analyzed (with paths if relevant)
Key outputs or artifacts produced
3. Important Discoveries
Technical constraints or requirements uncovered
Decisions made and their rationale
Errors encountered and how they were resolved
What approaches were tried that didn't work (and why)
4. Next Steps
Specific actions needed to complete the task
Any blockers or open questions to resolve
Priority order if multiple steps remain
5. Context to Preserve
User preferences or style requirements
Domain-specific details that aren't obvious
Any promises made to the user
Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
Wrap your summary in <summary></summary> tags.`;var au,ps,ko,_r,Qr,hn,ci,ji,uu,XS,d0;function YS(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}class lu{constructor(e,t,r){au.add(this),this.client=e,ps.set(this,!1),ko.set(this,!1),_r.set(this,void 0),Qr.set(this,void 0),hn.set(this,void 0),ci.set(this,void 0),ji.set(this,void 0),uu.set(this,0),Ve(this,_r,{params:{...t,messages:structuredClone(t.messages)}},"f");let n=["BetaToolRunner",...i0(t.tools,t.messages)].join(", ");if(Ve(this,Qr,{...r,headers:be([{"x-stainless-helper":n},r?.headers])},"f"),Ve(this,ji,YS(),"f"),t.compactionControl?.enabled)console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(ps=new WeakMap,ko=new WeakMap,_r=new WeakMap,Qr=new WeakMap,hn=new WeakMap,ci=new WeakMap,ji=new WeakMap,uu=new WeakMap,au=new WeakSet,XS=async function(){let t=oe(this,_r,"f").params.compactionControl;if(!t||!t.enabled)return!1;let r=0;if(oe(this,hn,"f")!==void 0)try{let b=await oe(this,hn,"f");r=b.usage.input_tokens+(b.usage.cache_creation_input_tokens??0)+(b.usage.cache_read_input_tokens??0)+b.usage.output_tokens}catch{return!1}let i=t.contextTokenThreshold??GS;if(r<i)return!1;let n=t.model??oe(this,_r,"f").params.model,o=t.summaryPrompt??JS,s=oe(this,_r,"f").params.messages;if(s[s.length-1].role==="assistant"){let b=s[s.length-1];if(Array.isArray(b.content)){let v=b.content.filter((_)=>_.type!=="tool_use");if(v.length===0)s.pop();else b.content=v}}let h=await this.client.beta.messages.create({model:n,messages:[...s,{role:"user",content:[{type:"text",text:o}]}],max_tokens:oe(this,_r,"f").params.max_tokens},{signal:oe(this,Qr,"f").signal,headers:be([oe(this,Qr,"f").headers,{"x-stainless-helper":"compaction"}])});if(h.content[0]?.type!=="text")throw new Xe("Expected text response for compaction");return oe(this,_r,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var e;if(oe(this,ps,"f"))throw new Xe("Cannot iterate over a consumed stream");Ve(this,ps,!0,"f"),Ve(this,ko,!0,"f"),Ve(this,ci,void 0,"f");try{while(!0){let t;try{if(oe(this,_r,"f").params.max_iterations&&oe(this,uu,"f")>=oe(this,_r,"f").params.max_iterations)break;Ve(this,ko,!1,"f"),Ve(this,ci,void 0,"f"),Ve(this,uu,(e=oe(this,uu,"f"),e++,e),"f"),Ve(this,hn,void 0,"f");let{max_iterations:r,compactionControl:i,...n}=oe(this,_r,"f").params;if(n.stream)t=this.client.beta.messages.stream({...n},oe(this,Qr,"f")),Ve(this,hn,t.finalMessage(),"f"),oe(this,hn,"f").catch(()=>{}),yield t;else Ve(this,hn,this.client.beta.messages.create({...n,stream:!1},oe(this,Qr,"f")),"f"),yield oe(this,hn,"f");if(!await oe(this,au,"m",XS).call(this)){if(!oe(this,ko,"f")){let{role:h,content:b}=await oe(this,hn,"f");oe(this,_r,"f").params.messages.push({role:h,content:b})}let s=await oe(this,au,"m",d0).call(this,oe(this,_r,"f").params.messages.at(-1));if(s)oe(this,_r,"f").params.messages.push(s);else if(!oe(this,ko,"f"))break}}finally{if(t)t.abort()}}if(!oe(this,hn,"f"))throw new Xe("ToolRunner concluded without a message from the server");oe(this,ji,"f").resolve(await oe(this,hn,"f"))}catch(t){throw Ve(this,ps,!1,"f"),oe(this,ji,"f").promise.catch(()=>{}),oe(this,ji,"f").reject(t),Ve(this,ji,YS(),"f"),t}}setMessagesParams(e){if(typeof e==="function")oe(this,_r,"f").params=e(oe(this,_r,"f").params);else oe(this,_r,"f").params=e;Ve(this,ko,!0,"f"),Ve(this,ci,void 0,"f")}setRequestOptions(e){if(typeof e==="function")Ve(this,Qr,e(oe(this,Qr,"f")),"f");else Ve(this,Qr,{...oe(this,Qr,"f"),...e},"f")}async generateToolResponse(e=oe(this,Qr,"f").signal){let t=await oe(this,hn,"f")??this.params.messages.at(-1);if(!t)return null;return oe(this,au,"m",d0).call(this,t,e)}done(){return oe(this,ji,"f").promise}async runUntilDone(){if(!oe(this,ps,"f"))for await(let e of this);return this.done()}get params(){return oe(this,_r,"f").params}pushMessages(...e){this.setMessagesParams((t)=>({...t,messages:[...t.messages,...e]}))}then(e,t){return this.runUntilDone().then(e,t)}}d0=async function(t,r=oe(this,Qr,"f").signal){if(oe(this,ci,"f")!==void 0)return oe(this,ci,"f");return Ve(this,ci,l9(oe(this,_r,"f").params,t,{...oe(this,Qr,"f"),signal:r}),"f"),oe(this,ci,"f")};async function l9(e,t=e.messages.at(-1),r){if(!t||t.role!=="assistant"||!t.content||typeof t.content==="string")return null;let i=t.content.filter((o)=>o.type==="tool_use");if(i.length===0)return null;return{role:"user",content:await Promise.all(i.map(async(o)=>{let s=e.tools.find((h)=>("name"in h?h.name:h.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let h=o.input;if("parse"in s&&s.parse)h=s.parse(h);let b=await s.run(h,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:b}}catch(h){return{type:"tool_result",tool_use_id:o.id,content:h instanceof hs?h.content:`Error: ${h instanceof Error?h.message:String(h)}`,is_error:!0}}}))}}var QS={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},c9=["claude-mythos-preview","claude-opus-4-6"];class Ui extends ut{constructor(){super(...arguments);this.batches=new Qa(this._client)}create(e,t){let r=e2(e),{betas:i,...n}=r;if(n.model in QS)console.warn(`The model '${n.model}' is deprecated and will reach end-of-life on ${QS[n.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(c9.includes(n.model)&&n.thinking&&n.thinking.type==="enabled")console.warn(`Using Claude with ${n.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let o=this._client._options.timeout;if(!n.stream&&o==null){let h=od[n.model]??void 0;o=this._client.calculateNonstreamingTimeout(n.max_tokens,h)}let s=id(n.tools,n.messages);return this._client.post("/v1/messages?beta=true",{body:n,timeout:o??600000,...t,headers:be([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},s,t?.headers]),stream:r.stream??!1})}parse(e,t){return t={...t,headers:be([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},t?.headers])},this.create(e,t).then((r)=>s0(r,e,{logger:this._client.logger??console}))}stream(e,t){return su.createMessage(this,e,t)}countTokens(e,t){let r=e2(e),{betas:i,...n}=r;return this._client.post("/v1/messages/count_tokens?beta=true",{body:n,...t,headers:be([{"anthropic-beta":[...i??[],"token-counting-2024-11-01"].toString()},t?.headers])})}toolRunner(e,t){return new lu(this._client,e,t)}}function e2(e){if(!e.output_format)return e;if(e.output_config?.format)throw new Xe("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:t,...r}=e;return{...r,output_config:{...e.output_config,format:t}}}Ui.Batches=Qa;Ui.BetaToolRunner=lu;Ui.ToolError=hs;class cu extends ut{list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/sessions/${e}/events?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}send(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/sessions/${e}/events?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}stream(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/sessions/${e}/events/stream?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers]),stream:!0})}}class du extends ut{retrieve(e,t,r){let{session_id:i,betas:n}=t;return this._client.get(Ze`/v1/sessions/${i}/resources/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{session_id:i,betas:n,...o}=t;return this._client.post(Ze`/v1/sessions/${i}/resources/${e}?beta=true`,{body:o,...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/sessions/${e}/resources?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,t,r){let{session_id:i,betas:n}=t;return this._client.delete(Ze`/v1/sessions/${i}/resources/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}add(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/sessions/${e}/resources?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}class Mo extends ut{constructor(){super(...arguments);this.events=new cu(this._client),this.resources=new du(this._client)}create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/sessions?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/sessions/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/sessions/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/sessions/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/sessions/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}Mo.Events=cu;Mo.Resources=du;class fu extends ut{create(e,t={},r){let{betas:i,...n}=t??{};return this._client.post(Ze`/v1/skills/${e}/versions?beta=true`,us({body:n,...r,headers:be([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])},this._client))}retrieve(e,t,r){let{skill_id:i,betas:n}=t;return this._client.get(Ze`/v1/skills/${i}/versions/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/skills/${e}/versions?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,t,r){let{skill_id:i,betas:n}=t;return this._client.delete(Ze`/v1/skills/${i}/versions/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}}class ms extends ut{constructor(){super(...arguments);this.versions=new fu(this._client)}create(e={},t){let{betas:r,...i}=e??{};return this._client.post("/v1/skills?beta=true",us({body:i,...t,headers:be([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},t?.headers])},this._client,!1))}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/skills/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/skills/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"skills-2025-10-02"].toString()},r?.headers])})}}ms.Versions=fu;class hu extends ut{create(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/vaults/${e}/credentials?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,t,r){let{vault_id:i,betas:n}=t;return this._client.get(Ze`/v1/vaults/${i}/credentials/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{vault_id:i,betas:n,...o}=t;return this._client.post(Ze`/v1/vaults/${i}/credentials/${e}?beta=true`,{body:o,...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e,t={},r){let{betas:i,...n}=t??{};return this._client.getAPIList(Ze`/v1/vaults/${e}/credentials?beta=true`,Rt,{query:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,t,r){let{vault_id:i,betas:n}=t;return this._client.delete(Ze`/v1/vaults/${i}/credentials/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,t,r){let{vault_id:i,betas:n}=t;return this._client.post(Ze`/v1/vaults/${i}/credentials/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}class gs extends ut{constructor(){super(...arguments);this.credentials=new hu(this._client)}create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/vaults?beta=true",{body:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/vaults/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}update(e,t,r){let{betas:i,...n}=t;return this._client.post(Ze`/v1/vaults/${e}?beta=true`,{body:n,...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Rt,{query:i,...t,headers:be([{"anthropic-beta":[...r??[],"managed-agents-2026-04-01"].toString()},t?.headers])})}delete(e,t={},r){let{betas:i}=t??{};return this._client.delete(Ze`/v1/vaults/${e}?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,t={},r){let{betas:i}=t??{};return this._client.post(Ze`/v1/vaults/${e}/archive?beta=true`,{...r,headers:be([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}}gs.Credentials=hu;class Dr extends ut{constructor(){super(...arguments);this.models=new Wa(this._client),this.messages=new Ui(this._client),this.agents=new ls(this._client),this.environments=new Za(this._client),this.sessions=new Mo(this._client),this.vaults=new gs(this._client),this.memoryStores=new So(this._client),this.files=new Va(this._client),this.skills=new ms(this._client),this.userProfiles=new Ga(this._client)}}Dr.Models=Wa;Dr.Messages=Ui;Dr.Agents=ls;Dr.Environments=Za;Dr.Sessions=Mo;Dr.Vaults=gs;Dr.MemoryStores=So;Dr.Files=Va;Dr.Skills=ms;Dr.UserProfiles=Ga;class ys extends ut{create(e,t){let{betas:r,...i}=e;return this._client.post("/v1/complete",{body:i,timeout:this._client._options.timeout??600000,...t,headers:be([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers]),stream:e.stream??!1})}}function t2(e){return e?.output_config?.format}function f0(e,t,r){let i=t2(t);if(!t||!("parse"in(i??{})))return{...e,content:e.content.map((n)=>{if(n.type==="text")return Object.defineProperty({...n},"parsed_output",{value:null,enumerable:!1});return n}),parsed_output:null};return h0(e,t,r)}function h0(e,t,r){let i=null,n=e.content.map((o)=>{if(o.type==="text"){let s=b9(t,o.text);if(i===null)i=s;return Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1})}return o});return{...e,content:n,parsed_output:i}}function b9(e,t){let r=t2(e);if(r?.type!=="json_schema")return null;try{if("parse"in r)return r.parse(t);return JSON.parse(t)}catch(i){throw new Xe(`Failed to parse structured output: ${i}`)}}var kn,Li,vs,pu,pd,mu,gu,md,yu,di,vu,gd,yd,Eo,vd,bd,bu,p0,r2,m0,g0,y0,v0,n2,i2="__json_buf";function o2(e){return e.type==="tool_use"||e.type==="server_tool_use"}class _u{constructor(e,t){kn.add(this),this.messages=[],this.receivedMessages=[],Li.set(this,void 0),vs.set(this,null),this.controller=new AbortController,pu.set(this,void 0),pd.set(this,()=>{}),mu.set(this,()=>{}),gu.set(this,void 0),md.set(this,()=>{}),yu.set(this,()=>{}),di.set(this,{}),vu.set(this,!1),gd.set(this,!1),yd.set(this,!1),Eo.set(this,!1),vd.set(this,void 0),bd.set(this,void 0),bu.set(this,void 0),m0.set(this,(r)=>{if(Ve(this,gd,!0,"f"),ai(r))r=new Pr;if(r instanceof Pr)return Ve(this,yd,!0,"f"),this._emit("abort",r);if(r instanceof Xe)return this._emit("error",r);if(r instanceof Error){let i=new Xe(r.message);return i.cause=r,this._emit("error",i)}return this._emit("error",new Xe(String(r)))}),Ve(this,pu,new Promise((r,i)=>{Ve(this,pd,r,"f"),Ve(this,mu,i,"f")}),"f"),Ve(this,gu,new Promise((r,i)=>{Ve(this,md,r,"f"),Ve(this,yu,i,"f")}),"f"),oe(this,pu,"f").catch(()=>{}),oe(this,gu,"f").catch(()=>{}),Ve(this,vs,e,"f"),Ve(this,bu,t?.logger??console,"f")}get response(){return oe(this,vd,"f")}get request_id(){return oe(this,bd,"f")}async withResponse(){Ve(this,Eo,!0,"f");let e=await oe(this,pu,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let t=new _u(null);return t._run(()=>t._fromReadableStream(e)),t}static createMessage(e,t,r,{logger:i}={}){let n=new _u(t,{logger:i});for(let o of t.messages)n._addMessageParam(o);return Ve(n,vs,{...t,stream:!0},"f"),n._run(()=>n._createMessage(e,{...t,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),n}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},oe(this,m0,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,t=!0){if(this.receivedMessages.push(e),t)this._emit("message",e)}async _createMessage(e,t,r){let i=r?.signal,n;if(i){if(i.aborted)this.controller.abort();n=this.controller.abort.bind(this.controller),i.addEventListener("abort",n)}try{oe(this,kn,"m",g0).call(this);let{response:o,data:s}=await e.create({...t,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(o);for await(let h of s)oe(this,kn,"m",y0).call(this,h);if(s.controller.signal?.aborted)throw new Pr;oe(this,kn,"m",v0).call(this)}finally{if(i&&n)i.removeEventListener("abort",n)}}_connected(e){if(this.ended)return;Ve(this,vd,e,"f"),Ve(this,bd,e?.headers.get("request-id"),"f"),oe(this,pd,"f").call(this,e),this._emit("connect")}get ended(){return oe(this,vu,"f")}get errored(){return oe(this,gd,"f")}get aborted(){return oe(this,yd,"f")}abort(){this.controller.abort()}on(e,t){return(oe(this,di,"f")[e]||(oe(this,di,"f")[e]=[])).push({listener:t}),this}off(e,t){let r=oe(this,di,"f")[e];if(!r)return this;let i=r.findIndex((n)=>n.listener===t);if(i>=0)r.splice(i,1);return this}once(e,t){return(oe(this,di,"f")[e]||(oe(this,di,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,r)=>{if(Ve(this,Eo,!0,"f"),e!=="error")this.once("error",r);this.once(e,t)})}async done(){Ve(this,Eo,!0,"f"),await oe(this,gu,"f")}get currentMessage(){return oe(this,Li,"f")}async finalMessage(){return await this.done(),oe(this,kn,"m",p0).call(this)}async finalText(){return await this.done(),oe(this,kn,"m",r2).call(this)}_emit(e,...t){if(oe(this,vu,"f"))return;if(e==="end")Ve(this,vu,!0,"f"),oe(this,md,"f").call(this);let r=oe(this,di,"f")[e];if(r)oe(this,di,"f")[e]=r.filter((i)=>!i.once),r.forEach(({listener:i})=>i(...t));if(e==="abort"){let i=t[0];if(!oe(this,Eo,"f")&&!r?.length)Promise.reject(i);oe(this,mu,"f").call(this,i),oe(this,yu,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=t[0];if(!oe(this,Eo,"f")&&!r?.length)Promise.reject(i);oe(this,mu,"f").call(this,i),oe(this,yu,"f").call(this,i),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",oe(this,kn,"m",p0).call(this))}async _fromReadableStream(e,t){let r=t?.signal,i;if(r){if(r.aborted)this.controller.abort();i=this.controller.abort.bind(this.controller),r.addEventListener("abort",i)}try{oe(this,kn,"m",g0).call(this),this._connected(null);let n=fn.fromReadableStream(e,this.controller);for await(let o of n)oe(this,kn,"m",y0).call(this,o);if(n.controller.signal?.aborted)throw new Pr;oe(this,kn,"m",v0).call(this)}finally{if(r&&i)r.removeEventListener("abort",i)}}[(Li=new WeakMap,vs=new WeakMap,pu=new WeakMap,pd=new WeakMap,mu=new WeakMap,gu=new WeakMap,md=new WeakMap,yu=new WeakMap,di=new WeakMap,vu=new WeakMap,gd=new WeakMap,yd=new WeakMap,Eo=new WeakMap,vd=new WeakMap,bd=new WeakMap,bu=new WeakMap,m0=new WeakMap,kn=new WeakSet,p0=function(){if(this.receivedMessages.length===0)throw new Xe("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},r2=function(){if(this.receivedMessages.length===0)throw new Xe("stream ended without producing a Message with role=assistant");let t=this.receivedMessages.at(-1).content.filter((r)=>r.type==="text").map((r)=>r.text);if(t.length===0)throw new Xe("stream ended without producing a content block with type=text");return t.join(" ")},g0=function(){if(this.ended)return;Ve(this,Li,void 0,"f")},y0=function(t){if(this.ended)return;let r=oe(this,kn,"m",n2).call(this,t);switch(this._emit("streamEvent",t,r),t.type){case"content_block_delta":{let i=r.content.at(-1);switch(t.delta.type){case"text_delta":{if(i.type==="text")this._emit("text",t.delta.text,i.text||"");break}case"citations_delta":{if(i.type==="text")this._emit("citation",t.delta.citation,i.citations??[]);break}case"input_json_delta":{if(o2(i)&&i.input)this._emit("inputJson",t.delta.partial_json,i.input);break}case"thinking_delta":{if(i.type==="thinking")this._emit("thinking",t.delta.thinking,i.thinking);break}case"signature_delta":{if(i.type==="thinking")this._emit("signature",i.signature);break}default:s2(t.delta)}break}case"message_stop":{this._addMessageParam(r),this._addMessage(f0(r,oe(this,vs,"f"),{logger:oe(this,bu,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{Ve(this,Li,r,"f");break}case"content_block_start":case"message_delta":break}},v0=function(){if(this.ended)throw new Xe("stream has ended, this shouldn't happen");let t=oe(this,Li,"f");if(!t)throw new Xe("request ended without sending any chunks");return Ve(this,Li,void 0,"f"),f0(t,oe(this,vs,"f"),{logger:oe(this,bu,"f")})},n2=function(t){let r=oe(this,Li,"f");if(t.type==="message_start"){if(r)throw new Xe(`Unexpected event order, got ${t.type} before receiving "message_stop"`);return t.message}if(!r)throw new Xe(`Unexpected event order, got ${t.type} before "message_start"`);switch(t.type){case"message_stop":return r;case"message_delta":if(r.stop_reason=t.delta.stop_reason,r.stop_sequence=t.delta.stop_sequence,r.usage.output_tokens=t.usage.output_tokens,t.usage.input_tokens!=null)r.usage.input_tokens=t.usage.input_tokens;if(t.usage.cache_creation_input_tokens!=null)r.usage.cache_creation_input_tokens=t.usage.cache_creation_input_tokens;if(t.usage.cache_read_input_tokens!=null)r.usage.cache_read_input_tokens=t.usage.cache_read_input_tokens;if(t.usage.server_tool_use!=null)r.usage.server_tool_use=t.usage.server_tool_use;return r;case"content_block_start":return r.content.push({...t.content_block}),r;case"content_block_delta":{let i=r.content.at(t.index);switch(t.delta.type){case"text_delta":{if(i?.type==="text")r.content[t.index]={...i,text:(i.text||"")+t.delta.text};break}case"citations_delta":{if(i?.type==="text")r.content[t.index]={...i,citations:[...i.citations??[],t.delta.citation]};break}case"input_json_delta":{if(i&&o2(i)){let n=i[i2]||"";n+=t.delta.partial_json;let o={...i};if(Object.defineProperty(o,i2,{value:n,enumerable:!1,writable:!0}),n)o.input=sd(n);r.content[t.index]=o}break}case"thinking_delta":{if(i?.type==="thinking")r.content[t.index]={...i,thinking:i.thinking+t.delta.thinking};break}case"signature_delta":{if(i?.type==="thinking")r.content[t.index]={...i,signature:t.delta.signature};break}default:s2(t.delta)}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){let e=[],t=[],r=!1;return this.on("streamEvent",(i)=>{let n=t.shift();if(n)n.resolve(i);else e.push(i)}),this.on("end",()=>{r=!0;for(let i of t)i.resolve(void 0);t.length=0}),this.on("abort",(i)=>{r=!0;for(let n of t)n.reject(i);t.length=0}),this.on("error",(i)=>{r=!0;for(let n of t)n.reject(i);t.length=0}),{next:async()=>{if(!e.length){if(r)return{value:void 0,done:!0};return new Promise((n,o)=>t.push({resolve:n,reject:o})).then((n)=>n?{value:n,done:!1}:{value:void 0,done:!0})}return{value:e.shift(),done:!1}},return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new fn(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function s2(e){}class wu extends ut{create(e,t){return this._client.post("/v1/messages/batches",{body:e,...t})}retrieve(e,t){return this._client.get(Ze`/v1/messages/batches/${e}`,t)}list(e={},t){return this._client.getAPIList("/v1/messages/batches",On,{query:e,...t})}delete(e,t){return this._client.delete(Ze`/v1/messages/batches/${e}`,t)}cancel(e,t){return this._client.post(Ze`/v1/messages/batches/${e}/cancel`,t)}async results(e,t){let r=await this.retrieve(e);if(!r.results_url)throw new Xe(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);return this._client.get(r.results_url,{...t,headers:be([{Accept:"application/binary"},t?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((i,n)=>cs.fromResponse(n.response,n.controller))}}class Io extends ut{constructor(){super(...arguments);this.batches=new wu(this._client)}create(e,t){if(e.model in a2)console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${a2[e.model]}
Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(w9.includes(e.model)&&e.thinking&&e.thinking.type==="enabled")console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let r=this._client._options.timeout;if(!e.stream&&r==null){let n=od[e.model]??void 0;r=this._client.calculateNonstreamingTimeout(e.max_tokens,n)}let i=id(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:r??600000,...t,headers:be([i,t?.headers]),stream:e.stream??!1})}parse(e,t){return this.create(e,t).then((r)=>h0(r,e,{logger:this._client.logger??console}))}stream(e,t){return _u.createMessage(this,e,t,{logger:this._client.logger??console})}countTokens(e,t){return this._client.post("/v1/messages/count_tokens",{body:e,...t})}}var a2={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},w9=["claude-mythos-preview","claude-opus-4-6"];Io.Batches=wu;class bs extends ut{retrieve(e,t={},r){let{betas:i}=t??{};return this._client.get(Ze`/v1/models/${e}`,{...r,headers:be([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},r?.headers])})}list(e={},t){let{betas:r,...i}=e??{};return this._client.getAPIList("/v1/models",On,{query:i,...t,headers:be([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},t?.headers])})}}var b0,_0,_d,u2,l2="\\n\\nHuman:",c2="\\n\\nAssistant:";class Yt{get credentials(){return this._authState.provider}constructor({baseURL:e=$t("ANTHROPIC_BASE_URL"),apiKey:t,authToken:r,...i}={}){if(b0.add(this),this._requestAuthFlags=new WeakMap,_d.set(this,void 0),t===void 0)t=i.profile!=null?null:$t("ANTHROPIC_API_KEY")??null;if(r===void 0)r=i.profile!=null?null:$t("ANTHROPIC_AUTH_TOKEN")??null;if(i.profile!=null&&(i.credentials!=null||i.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let n={apiKey:t,authToken:r,...i,baseURL:e||"https://api.anthropic.com"};if(!n.dangerouslyAllowBrowser&&fS())throw new Xe(`It looks like you're running in a browser-like environment.
This is disabled by default, as it risks exposing your secret API credentials to attackers.
If you understand the risks and have appropriate mitigations in place,
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
`);this.baseURL=n.baseURL,this._baseURLIsExplicit=i.__baseURLIsExplicit??!!e,this.timeout=n.timeout??_0.DEFAULT_TIMEOUT,this.logger=n.logger??console;let o="warn";this.logLevel=o,this.logLevel=Wm(n.logLevel,"ClientOptions.logLevel",this)??Wm($t("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??o,this.fetchOptions=n.fetchOptions,this.maxRetries=n.maxRetries??2,this.fetch=n.fetch??hS(),Ve(this,_d,mS,"f");let s=$t("ANTHROPIC_CUSTOM_HEADERS");if(s){let b={};for(let v of s.split(`
`)){let _=v.indexOf(":");if(_>=0)b[v.substring(0,_).trim()]=v.substring(_+1).trim()}n.defaultHeaders={...b,...n.defaultHeaders}}let h=i.__auth;if(delete n.__auth,delete n.__baseURLIsExplicit,this._options=n,this.apiKey=typeof t==="string"?t:null,this.authToken=r,h){if(this._authState=h,!this._baseURLIsExplicit&&h.baseURL)this.baseURL=h.baseURL}else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let b=n.credentials??null;if(b)this._authState.provider=b,this._authState.tokenCache=this._makeTokenCache(b);else if(n.config!=null){let v=Xm(n.config,this._credentialResolverOptions());this._authState.provider=v.provider,this._authState.tokenCache=this._makeTokenCache(v.provider),this._authState.extraHeaders=v.extraHeaders,this._applyCredentialBaseURL(v.baseURL)}else if(n.profile!=null)this._authState.resolution=this._resolveDefaultCredentials(n.profile);else this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let t=e.replace(/\/+$/,"");if(this._authState.baseURL=t,!this._baseURLIsExplicit)this.baseURL=t}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:(e)=>{tr(this).debug("credential cache write failed (best-effort)",e)},onSafetyWarning:(e)=>{tr(this).warn(e)}}}_makeTokenCache(e){return new Km(e,(t)=>{tr(this).debug("advisory token refresh failed; serving cached token",t)})}withOptions(e){let t="credentials"in e||"config"in e||"profile"in e,r="apiKey"in e||"authToken"in e||t,i={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...t?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:r?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(i)}async _resolveDefaultCredentials(e){try{let t=await OS(this._credentialResolverOptions(),e);if(t)this._authState.provider=t.provider,this._authState.tokenCache=this._makeTokenCache(t.provider),this._authState.extraHeaders=t.extraHeaders,this._applyCredentialBaseURL(t.baseURL);else if(e!=null)throw new Xe(`Profile "${e}" could not be resolved (no <config_dir>/configs/${e}.json found).`)}catch(t){this._authState.error=t}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t}){if(e.get("x-api-key")||e.get("authorization"))return;if(this._authState.error)throw this._authState.error;if(this._authState.tokenCache||this._authState.resolution)return;if(this.apiKey&&e.get("x-api-key"))return;if(t.has("x-api-key"))return;if(this.authToken&&e.get("authorization"))return;if(t.has("authorization"))return;throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}_authFlags(e){let t=this._requestAuthFlags.get(e);if(!t)t={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,t);return t}async authHeaders(e){if(this._authState.resolution)await this._authState.resolution;if(this._authState.error)return;if(this._authState.tokenCache&&this.apiKey==null){let t=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,be([{Authorization:`Bearer ${t}`}])}return be([await this.apiKeyAuth(e),await this.bearerAuth(e)])}async apiKeyAuth(e){if(this.apiKey==null)return;return be([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken==null)return;return be([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return gS(e)}getUserAgent(){return`${this.constructor.name}/JS ${Sn}`}defaultIdempotencyKey(){return`stainless-node-retry-${Lm()}`}makeStatusError(e,t,r,i){return br.generate(e,t,r,i)}buildURL(e,t,r){let i=!oe(this,b0,"m",u2).call(this)&&r||this.baseURL,n=oS(e)?new URL(e):new URL(i+(i.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),o=this.defaultQuery(),s=Object.fromEntries(n.searchParams);if(!Bm(o)||!Bm(s))t={...s,...o,...t};if(typeof t==="object"&&t&&!Array.isArray(t))n.search=this.stringifyQuery(t);return n.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128000>600)throw new Xe("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(e){}async prepareRequest(e,{url:t,options:r}){if(this._authState.tokenCache&&this.apiKey==null){let i=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[o,s]of Object.entries(this._authState.extraHeaders))if(!i.has(o))i.set(o,s);if(!i.get("anthropic-beta")?.split(",").map((o)=>o.trim())?.includes(bo))i.append("anthropic-beta",bo);e.headers=i}}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,r){return this.request(Promise.resolve(r).then((i)=>({method:e,path:t,...i})))}request(e,t=null){return new _o(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,r){let i=await e,n=i.maxRetries??this.maxRetries;if(t==null)t=n,this._requestAuthFlags.delete(i);await this.prepareOptions(i);let{req:o,url:s,timeout:h}=await this.buildRequest(i,{retryCount:n-t});await this.prepareRequest(o,{url:s,options:i});let b="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),v=r===void 0?"":`, retryOf: ${r}`,_=Date.now();if(tr(this).debug(`[${b}] sending request`,ui({retryOfRequestLogID:r,method:i.method,url:s,options:i,headers:o.headers})),i.signal?.aborted)throw new Pr;let g=new AbortController,S=await this.fetchWithTimeout(s,o,h,g).catch($a),x=Date.now();if(S instanceof globalThis.Error){let T=`retrying, ${t} attempts remaining`;if(i.signal?.aborted)throw new Pr;let $=ai(S)||/timed? ?out/i.test(String(S)+("cause"in S?String(S.cause):""));if(t)return tr(this).info(`[${b}] connection ${$?"timed out":"failed"} - ${T}`),tr(this).debug(`[${b}] connection ${$?"timed out":"failed"} (${T})`,ui({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),this.retryRequest(i,t,r??b);if(tr(this).info(`[${b}] connection ${$?"timed out":"failed"} - error; no more retries left`),tr(this).debug(`[${b}] connection ${$?"timed out":"failed"} (error; no more retries left)`,ui({retryOfRequestLogID:r,url:s,durationMs:x-_,message:S.message})),$)throw new Pa;throw new vo({cause:S})}let M=[...S.headers.entries()].filter(([T])=>T==="request-id").map(([T,$])=>", "+T+": "+JSON.stringify($)).join(""),I=`[${b}${v}${M}] ${o.method} ${s} ${S.ok?"succeeded":"failed"} with status ${S.status} in ${x-_}ms`;if(!S.ok){let T=await this.shouldRetry(S,i);if(t&&T){let B=`retrying, ${t} attempts remaining`;return await pS(S.body),tr(this).info(`${I} - ${B}`),tr(this).debug(`[${b}] response error (${B})`,ui({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),this.retryRequest(i,t,r??b,S.headers)}let $=T?"error; no more retries left":"error; not retryable";tr(this).info(`${I} - ${$}`);let P=await S.text().catch((B)=>$a(B).message),R=Bc(P),C=R?void 0:P;throw tr(this).debug(`[${b}] response error (${$})`,ui({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,message:C,durationMs:Date.now()-_})),this.makeStatusError(S.status,R,C,S.headers)}return tr(this).info(I),tr(this).debug(`[${b}] response start`,ui({retryOfRequestLogID:r,url:S.url,status:S.status,headers:S.headers,durationMs:x-_})),{response:S,options:i,controller:g,requestLogID:b,retryOfRequestLogID:r,startTime:_}}getAPIList(e,t,r){return this.requestAPIList(t,r&&"then"in r?r.then((i)=>({method:"get",path:e,...i})):{method:"get",path:e,...r})}requestAPIList(e,t){let r=this.makeRequest(t,null,void 0);return new td(this,r,e)}async fetchWithTimeout(e,t,r,i){let{signal:n,method:o,...s}=t||{},h=this._makeAbort(i);if(n)n.addEventListener("abort",h,{once:!0});let b=setTimeout(h,r),v=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body==="object"&&s.body!==null&&Symbol.asyncIterator in s.body,_={signal:i.signal,...v?{duplex:"half"}:{},method:"GET",...s};if(o)_.method=o.toUpperCase();try{return await this.fetch.call(void 0,e,_)}finally{clearTimeout(b)}}async shouldRetry(e,t){let r=this._authFlags(t);if(e.status===401&&this._authState.tokenCache&&r.usedTokenCache&&!r.didRefreshFor401)return r.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let i=e.headers.get("x-should-retry");if(i==="true")return!0;if(i==="false")return!1;if(e.status===408)return!0;if(e.status===409)return!0;if(e.status===429)return!0;if(e.status>=500)return!0;return!1}async retryRequest(e,t,r,i){let n,o=i?.get("retry-after-ms");if(o){let h=parseFloat(o);if(!Number.isNaN(h))n=h}let s=i?.get("retry-after");if(s&&!n){let h=parseFloat(s);if(!Number.isNaN(h))n=h*1000;else n=Date.parse(s)-Date.now()}if(n===void 0){let h=e.maxRetries??this.maxRetries;n=this.calculateDefaultRetryTimeoutMillis(t,h)}return await uS(n),this.makeRequest(e,t-1,r)}calculateDefaultRetryTimeoutMillis(e,t){let n=t-e,o=Math.min(0.5*Math.pow(2,n),8),s=1-Math.random()*0.25;return o*s*1000}calculateNonstreamingTimeout(e,t){if(3600000*e/128000>600000||t!=null&&e>t)throw new Xe("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(e,{retryCount:t=0}={}){let r={...e},{method:i,path:n,query:o,defaultBaseURL:s}=r;if(this._authState.resolution)await this._authState.resolution;if(!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL)this.baseURL=this._authState.baseURL;let h=this.buildURL(n,o,s);if("timeout"in r)aS("timeout",r.timeout);r.timeout=r.timeout??this.timeout;let{bodyHeaders:b,body:v}=this.buildBody({options:r}),_=await this.buildHeaders({options:e,method:i,bodyHeaders:b,retryCount:t});return{req:{method:i,headers:_,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&v instanceof globalThis.ReadableStream&&{duplex:"half"},...v&&{body:v},...this.fetchOptions??{},...r.fetchOptions??{}},url:h,timeout:r.timeout}}async buildHeaders({options:e,method:t,bodyHeaders:r,retryCount:i}){let n={};if(this.idempotencyHeader&&t!=="get"){if(!e.idempotencyKey)e.idempotencyKey=this.defaultIdempotencyKey();n[this.idempotencyHeader]=e.idempotencyKey}let o=be([n,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1000))}:{},...Ua(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,r,e.headers]);return this.validateHeaders(o),o.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:t}}){if(!e)return{bodyHeaders:void 0,body:void 0};let r=be([t]);if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e==="string"&&r.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:e};else if(typeof e==="object"&&((Symbol.asyncIterator in e)||(Symbol.iterator in e)&&("next"in e)&&typeof e.next==="function"))return{bodyHeaders:void 0,body:Hc(e)};else if(typeof e==="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)};else return oe(this,_d,"f").call(this,{body:e,headers:r})}}_0=Yt,_d=new WeakMap,b0=new WeakSet,u2=function(){return this.baseURL!=="https://api.anthropic.com"};Yt.Anthropic=_0;Yt.HUMAN_PROMPT=l2;Yt.AI_PROMPT=c2;Yt.DEFAULT_TIMEOUT=600000;Yt.AnthropicError=Xe;Yt.APIError=br;Yt.APIConnectionError=vo;Yt.APIConnectionTimeoutError=Pa;Yt.APIUserAbortError=Pr;Yt.NotFoundError=Oa;Yt.ConflictError=Na;Yt.RateLimitError=za;Yt.BadRequestError=Aa;Yt.AuthenticationError=Ra;Yt.InternalServerError=ja;Yt.PermissionDeniedError=Ca;Yt.UnprocessableEntityError=Da;Yt.toFile=rd;class To extends Yt{constructor(){super(...arguments);this.completions=new ys(this),this.messages=new Io(this),this.models=new bs(this),this.beta=new Dr(this)}}To.Completions=ys;To.Messages=Io;To.Models=bs;To.Beta=Dr;function x9(e){return e}function Su(e){return x9(e)}function w0(e){return e instanceof Error?e:Error(String(e))}function wd(e){return e instanceof Error?e.message:String(e)}function _s(e){if(e&&typeof e==="object"&&"code"in e&&typeof e.code==="string")return e.code;return}function d2(e){return _s(e)==="ENOENT"}function S0(e){return _s(e)==="EISDIR"}var ct=(()=>({}));var{lstat:k9,mkdir:M9,open:E9,readdir:I9,readFile:f2,rename:T9,rmdir:$9,rm:P9,stat:A9,unlink:R9}=(()=>({}));Rn();var C9={cwd(){return process.cwd()},existsSync(e){let r=[];try{const t=Bt(r,Wt`fs.existsSync(${e})`,0);return ct.existsSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},async stat(e){return A9(e)},async lstat(e){return k9(e)},async readdir(e){return I9(e,{withFileTypes:!0})},async unlink(e){return R9(e)},async rmdir(e){return $9(e)},async rm(e,t){return P9(e,t)},async mkdir(e,t){try{await M9(e,{recursive:!0,...t})}catch(r){if(_s(r)!=="EEXIST")throw r}},async readFile(e,t){return f2(e,{encoding:t.encoding})},async rename(e,t){return T9(e,t)},statSync(e){let r=[];try{const t=Bt(r,Wt`fs.statSync(${e})`,0);return ct.statSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},lstatSync(e){let r=[];try{const t=Bt(r,Wt`fs.lstatSync(${e})`,0);return ct.lstatSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},readFileSync(e,t){let i=[];try{const r=Bt(i,Wt`fs.readFileSync(${e})`,0);return ct.readFileSync(e,{encoding:t.encoding})}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},readFileBytesSync(e){let r=[];try{const t=Bt(r,Wt`fs.readFileBytesSync(${e})`,0);return ct.readFileSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},readSync(e,t){let n=[];try{const r=Bt(n,Wt`fs.readSync(${e}, ${t.length} bytes)`,0);let i=void 0;try{i=ct.openSync(e,"r");let b=Buffer.alloc(t.length),v=ct.readSync(i,b,0,t.length,0);return{buffer:b,bytesRead:v}}finally{if(i)ct.closeSync(i)}}catch(o){var s=o,h=1}finally{Ht(n,s,h)}},appendFileSync(e,t,r){let n=[];try{const i=Bt(n,Wt`fs.appendFileSync(${e}, ${t.length} chars)`,0);if(r?.mode!==void 0)try{let b=ct.openSync(e,"ax",r.mode);try{ct.appendFileSync(b,t)}finally{ct.closeSync(b)}return}catch(b){if(_s(b)!=="EEXIST")throw b}ct.appendFileSync(e,t)}catch(o){var s=o,h=1}finally{Ht(n,s,h)}},copyFileSync(e,t){let i=[];try{const r=Bt(i,Wt`fs.copyFileSync(${e} → ${t})`,0);ct.copyFileSync(e,t)}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},unlinkSync(e){let r=[];try{const t=Bt(r,Wt`fs.unlinkSync(${e})`,0);ct.unlinkSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},renameSync(e,t){let i=[];try{const r=Bt(i,Wt`fs.renameSync(${e} → ${t})`,0);ct.renameSync(e,t)}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},linkSync(e,t){let i=[];try{const r=Bt(i,Wt`fs.linkSync(${e} → ${t})`,0);ct.linkSync(e,t)}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},symlinkSync(e,t,r){let n=[];try{const i=Bt(n,Wt`fs.symlinkSync(${e} → ${t})`,0);ct.symlinkSync(e,t,r)}catch(o){var s=o,h=1}finally{Ht(n,s,h)}},readlinkSync(e){let r=[];try{const t=Bt(r,Wt`fs.readlinkSync(${e})`,0);return ct.readlinkSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},realpathSync(e){let r=[];try{const t=Bt(r,Wt`fs.realpathSync(${e})`,0);return Jw(ct.realpathSync(e))}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},mkdirSync(e,t){let n=[];try{const r=Bt(n,Wt`fs.mkdirSync(${e})`,0);let i={recursive:!0};if(t?.mode!==void 0)i.mode=t.mode;try{ct.mkdirSync(e,i)}catch(b){if(_s(b)!=="EEXIST")throw b}}catch(o){var s=o,h=1}finally{Ht(n,s,h)}},readdirSync(e){let r=[];try{const t=Bt(r,Wt`fs.readdirSync(${e})`,0);return ct.readdirSync(e,{withFileTypes:!0})}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},readdirStringSync(e){let r=[];try{const t=Bt(r,Wt`fs.readdirStringSync(${e})`,0);return ct.readdirSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},isDirEmptySync(e){let i=[];try{const t=Bt(i,Wt`fs.isDirEmptySync(${e})`,0);let r=this.readdirSync(e);return r.length===0}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},rmdirSync(e){let r=[];try{const t=Bt(r,Wt`fs.rmdirSync(${e})`,0);ct.rmdirSync(e)}catch(i){var n=i,o=1}finally{Ht(r,n,o)}},rmSync(e,t){let i=[];try{const r=Bt(i,Wt`fs.rmSync(${e})`,0);ct.rmSync(e,t)}catch(n){var o=n,s=1}finally{Ht(i,o,s)}},createWriteStream(e){return ct.createWriteStream(e)},async readFileBytes(e,t){if(t===void 0)return f2(e);let r=await E9(e,"r");try{let{size:i}=await r.stat(),n=Math.min(i,t),o=Buffer.allocUnsafe(n),s=0;while(s<n){let{bytesRead:h}=await r.read(o,s,n-s,s);if(h===0)break;s+=h}return s<n?o.subarray(0,s):o}finally{await r.close()}}},O9=C9;function Sd(){return O9}Rn();var{lstatSync:AY,readFileSync:RY,rmSync:CY,unlinkSync:OY,writeFileSync:NY}=(()=>({}));function N9(e,t){if(e.destroyed)return;e.write(t)}function h2(e){N9(process.stderr,e)}var qY=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,FY=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;var D9=/api[_-]?key|secret|token|password|passwd|credential|bearer|authorization|auth[_-]?header|cookie|session[_-]?(?:id|key)|connection[_-]?string|(?:private|ssh|encryption|signing|access|deploy|master|license)[_-]?key|client[_-]?secret/i,p2="[^\\s,;&}\\])]+",y2="-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",z9=`[^\\s-]{0,4}${y2}['"\`]?`,m2=`\\[REDACTED\\]|"[^"]*"|'[^']*'|(?:Bearer|Basic)\\s+(?:\\[REDACTED\\]|${p2})|${z9}|${p2}`,j9=["sk","ant","api"].join("-"),U9=[{id:"url-userinfo",source:":\\/\\/([^/@\\s]+)@",confidence:"low"},{id:"gcp-service-account",source:"\\b([a-z0-9-]+@[a-z0-9-]+\\.iam\\.gserviceaccount\\.com)\\b",flags:"i",confidence:"low"},{id:"loose-anthropic-key",source:"\\b(sk-ant-?[\\w-]{10,})",confidence:"low"},{id:"http-auth-scheme",source:"\\b(?:Bearer|Basic)\\s+([A-Za-z0-9+/=._~-]{20,})",flags:"i",confidence:"low"},{id:"loose-jwt",source:"\\b(eyJ[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,}\\.[A-Za-z0-9_-]{10,})",confidence:"low"},{id:"sensitive-assign",source:`(?:${D9.source})[\\w.-]*["']?\\s*[=:]\\s*(${m2})`,flags:"i",confidence:"low"},{id:"cloud-env-var",source:`\\b(?:AWS|GOOGLE|GCP|GCLOUD|AZURE)_\\w+\\s*[=:]\\s*(${m2})`,flags:"i",confidence:"low"},{id:"aws-access-token",source:"\\b((?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})\\b",confidence:"high"},{id:"gcp-api-key",source:`\\b(AIza[\\w-]{35})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"azure-ad-client-secret",source:`(?:^|[\\\\'"\\x60\\s>=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${j9}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:y2,flags:"i",confidence:"high"}];var g2=null;function L9(e){return U9.map((t)=>({id:t.id,confidence:t.confidence,re:new RegExp(t.source,e?(t.flags??"").replace("g","")+"g":t.flags??"")}))}function v2(e){g2??=L9(!0);for(let t of g2)e=e.replace(t.re,(r,i)=>{if(typeof i!=="string")return"[REDACTED]";let n=i.length>=2&&(i[0]==='"'||i[0]==="'")&&i.at(-1)===i[0]?i[0]:"",o=r.lastIndexOf(i);return`${r.slice(0,o)}${n}[REDACTED]${n}${r.slice(o+i.length)}`});return e}var E0={verbose:0,debug:1,info:2,warn:3,error:4},H9=bn(()=>{let e=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();if(e&&Object.hasOwn(E0,e))return e;return"debug"}),Z9=!1;function kd(){if(typeof process>"u"||!Array.isArray(process.argv))return[];let e=process.argv.indexOf("--");return e===-1?process.argv:process.argv.slice(0,e)}var I0=bn(()=>{let e=kd();return Z9||mo(process.env.DEBUG)||mo(process.env.DEBUG_SDK)||e.includes("--debug")||e.includes("-d")||S2()||e.some((t)=>t.startsWith("--debug="))||x2()!==null});var K9=bn(()=>{let e=kd().find((r)=>r.startsWith("--debug="));if(!e)return null;let t=e.substring(8);return rS(t)}),S2=bn(()=>{let e=kd();return e.includes("--debug-to-stderr")||e.includes("-d2e")}),x2=bn(()=>{let e=kd();for(let t=0;t<e.length;t++){let r=e[t];if(r.startsWith("--debug-file="))return w2(r.substring(13));if(r==="--debug-file"&&t+1<e.length)return w2(e[t+1])}return null});function w2(e){return Qw(e)?null:Ni(e)}function V9(e){if(!I0())return!1;if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let t=K9();return nS(e,t)}var W9=!1;var G9=10485760,xd=null,x0=Promise.resolve(),xu=-1,k0=!1,T0=null;async function k2(e,t,r=G9){if(xu<0)xu=await F9(e).then((i)=>i.size).catch(()=>0);else xu+=t;if(xu<=r||k0)return;k0=!0;try{let i=e.endsWith(".txt")?`${e.slice(0,-4)}.1.txt`:`${e}.1`;try{await _2(e,i)}catch(n){if(!d2(n))await M0(i).catch(()=>{}),await _2(e,i).catch(()=>M0(e).catch(()=>{}))}xu=0}finally{k0=!1}}function M2(e){return T0=Xn(e,`${Om()}.txt`),T0}async function J9(e,t,r,i){if(e)await q9(t,{recursive:!0}).catch(()=>{});let n=r;try{await b2(r,i)}catch(o){if(!S0(o))throw o;n=M2(r),await b2(n,i)}await k2(n,Buffer.byteLength(i)).catch($0),I2()}function $0(){}function X9(){if(!xd){let e=null;xd=Ww({writeFn:(t)=>{let r=E2(),i=go(r),n=e!==i;if(e=i,I0()){if(n)try{Sd().mkdirSync(i)}catch{}let o=r;try{Sd().appendFileSync(r,t)}catch(s){if(!S0(s))throw s;o=M2(r),Sd().appendFileSync(o,t)}k2(o,Buffer.byteLength(t)).catch($0),I2();return}x0=x0.then(J9.bind(null,n,i,r,t)).catch($0)},flushIntervalMs:1000,maxBufferSize:100,immediateMode:I0()}),tS(async()=>{xd?.dispose(),await x0})}return xd}function zr(e,{level:t}={level:"debug"}){if(E0[t]<E0[H9()])return;if(!V9(e))return;if(W9&&e.includes(`
`))e=pn(e);let i=`${new Date().toISOString()} [${t.toUpperCase()}] ${v2(e.trim())}
`;if(S2()){h2(i);return}X9().write(i)}function E2(){return x2()??T0??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??Xn(iS(),"debug",`${Om()}.txt`)}var I2=bn(async()=>{try{let e=E2(),t=go(e),r=Xn(t,"latest");await M0(r).catch(()=>{}),await B9(e,r)}catch{}});var vQ=(()=>{let e=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(e!==void 0){let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t}return 1/0})();var Y9={[Symbol.dispose](){}};function Q9(){return Y9}var Wt=Q9;function pn(e,t,r){let n=[];try{const i=Bt(n,Wt`JSON.stringify(${e})`,0);return JSON.stringify(e,t,r)}catch(o){var s=o,h=1}finally{Ht(n,s,h)}}var ws=(e,t)=>{let i=[];try{const r=Bt(i,Wt`JSON.parse(${e})`,0);return typeof t>"u"?JSON.parse(e):JSON.parse(e,t)}catch(n){var o=n,s=1}finally{Ht(i,o,s)}};class $o{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((e,t)=>{this.readResolve=e,this.readReject=t})}enqueue(e){if(this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let t=this.readReject;this.readResolve=void 0,this.readReject=void 0,t(e)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}function eR(){return{eventQueue:[],sink:null}}var tR=eR();function ku(e,t){let r=tR;if(r.sink===null){r.eventQueue.push({eventName:e,metadata:t,async:!1});return}r.sink.logEvent(e,t)}function rR(e,t){ku("tengu_feature_ok",{feature_name:Su(e),...t})}function nR(e,t,r){ku("tengu_feature_bad",{...r,feature_name:Su(e),error_code:t})}async function Nn(e,t,r){try{let i=await t();return rR(e),i}catch(i){throw nR(e,r?.(i)??"error"),i}}class P0{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}var T2=Symbol("suppressControlResponse");class A0{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;onUserDialog;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new $o;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,t){let r={type:"system",subtype:"mirror_error",error:t,key:e,uuid:ma(),session_id:e.sessionId};this.inputStream.enqueue(r)}addCleanupCallback(e){if(this.cleanupPerformed)e();else this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.onUserDialog!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,t,r,i,n,o=new Map,s,h,b,v,_,g){this.transport=e;this.isSingleUserTurn=t;this.canUseTool=r;this.hooks=i;this.abortController=n;this.jsonSchema=s;this.initConfig=h;this.onElicitation=b;this.getOAuthToken=v;this.getHostAuthToken=_;this.onUserDialog=g;for(let[S,x]of o)this.connectSdkMcpServer(S,x);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){if(this.cleanupPromise)return this.cleanupPromise;return this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise}async performCleanup(e){for(let t of this.cleanupCallbacks)try{t()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let r of this.cancelControllers.values())r.abort();this.cancelControllers.clear(),this.transport.close();let t=e??Error("Query closed before response received");for(let{reject:r}of this.pendingControlResponses.values())r(t);this.pendingControlResponses.clear();for(let{reject:r}of this.pendingMcpResponses.values())r(t);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let r of this.sdkMcpTransports.values())r.close().catch(()=>{});if(this.sdkMcpTransports.clear(),e)this.inputStream.error(e);else this.inputStream.done()}catch(t){}if(this.transport.waitForExit){let t=new AbortController;try{await Promise.race([this.transport.waitForExit(),k_(2000,t.signal)])}catch{}finally{t.abort()}}}next(...[e]){return this.sdkMessages.next(...[e])}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let t=this.pendingControlResponses.get(e.response.request_id);if(t)t.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else if(e.type==="keep_alive")continue;else if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}if(e.type==="result"){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)zr("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}else if(!(e.type==="system"&&e.subtype==="session_state_changed"))this.lastErrorResultText=void 0;this.inputStream.enqueue(e)}if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher)await this.transcriptMirrorBatcher.flush();if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.lastErrorResultText!==void 0&&!(e instanceof Kn)){let t=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);zr(`[Query.readMessages] Replacing exit error with result text. Original: ${wd(e)}`),this.inputStream.error(t),this.cleanup(t);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){if(this.cancelControllers.has(e.request_id)){zr(`[Query.handleControlRequest] Duplicate delivery of in-flight request ${e.request_id} (${e.request.subtype}) — skipping`);return}let t=new AbortController;this.cancelControllers.set(e.request_id,t);try{let r=await this.processControlRequest(e,t.signal);if(this.cleanupPerformed)return;if(r===T2)return;let i={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:r}};await Promise.resolve(this.transport.write(pn(i)+`
`))}catch(r){if(this.cleanupPerformed)return;let i={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:wd(r)}};try{await Promise.resolve(this.transport.write(pn(i)+`
`))}catch(n){zr(`[Query.handleControlRequest] Error-response write failed: ${wd(n)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let t=this.cancelControllers.get(e.request_id);if(t)t.abort(),this.cancelControllers.delete(e.request_id)}async processControlRequest(e,t){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:t,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,t);else if(e.request.subtype==="mcp_message"){let r=e.request,i=this.sdkMcpTransports.get(r.server_name);if(!i)throw Error(`SDK MCP server not found: ${r.server_name}`);if("method"in r.message&&"id"in r.message&&r.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(r.server_name,r,i)};else{if(i.onmessage)i.onmessage(r.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}else if(e.request.subtype==="elicitation"){let r=e.request;if(this.onElicitation)return await this.onElicitation({serverName:r.mcp_server_name,message:r.message,mode:r.mode,url:r.url,elicitationId:r.elicitation_id,requestedSchema:r.requested_schema,title:r.title,displayName:r.display_name,description:r.description},{signal:t});return{action:"decline"}}else if(e.request.subtype==="request_user_dialog"){if(this.onUserDialog)return await this.onUserDialog({dialogKind:e.request.dialog_kind,payload:e.request.payload,toolUseID:e.request.tool_use_id},{signal:t});return zr(`[Query] No onUserDialog handler for request_user_dialog (kind=${e.request.dialog_kind}) — staying silent so a capable client (or the worker's park deadline) settles it`),ku("tengu_request_user_dialog_response_ignored",{shape:Su("auto_cancel")}),T2}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:t})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:t})??null}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[n,o]of Object.entries(this.hooks))if(o.length>0)e[n]=o.map((s)=>{let h=[];for(let b of s.hooks){let v=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(v,b),h.push(v)}return{matcher:s.matcher,hookCallbackIds:h,timeout:s.timeout}})}let t=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,r={subtype:"initialize",hooks:e,sdkMcpServers:t,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt==="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText,supportedDialogKinds:this.initConfig?.supportedDialogKinds};return(await this.request(r)).response}async interrupt(){return Nn("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e,t){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e,thinking_display:t})}async applyFlagSettings(e){return Nn("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,t){return Nn("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:t?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,t){await this.request({subtype:"seed_read_state",path:e,mtime:t})}async enableRemoteControl(e,t){return(await this.request({subtype:"remote_control",enabled:e,...t!==void 0&&{name:t}})).response}async submitFeedback(e,t){return(await this.request({subtype:"submit_feedback",description:e,surface:t?.surface})).response}async generateSessionTitle(e,t){return Nn("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:t?.persist})).response.title)}async askSideQuestion(e){return Nn("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,t){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:t?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let t of e)if(t.request.subtype==="can_use_tool")this.handleControlRequest(t).catch(()=>{})}processPendingUserDialogRequests(e){for(let t of e)if(t.request.subtype==="request_user_dialog")this.handleControlRequest(t).catch(()=>{})}request(e){let t=Math.random().toString(36).substring(2,15),r={request_id:t,type:"control_request",request:e},i=e.subtype==="initialize";return new Promise((n,o)=>{this.pendingControlResponses.set(t,{handler:(s)=>{if(this.pendingControlResponses.delete(t),s.subtype==="success")n(s);else o(Error(s.error));if(!i&&(s.pending_permission_requests||s.pending_user_dialog_requests))zr(`[Query] Ignoring prompt-redelivery fields on non-initialize response (subtype=${e.subtype})`);else{if(s.pending_permission_requests)this.processPendingPermissionRequests(s.pending_permission_requests);if(s.pending_user_dialog_requests)this.processPendingUserDialogRequests(s.pending_user_dialog_requests)}},reject:o}),Promise.resolve(this.transport.write(pn(r)+`
`)).catch((s)=>{this.pendingControlResponses.delete(t),o(s)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,t){return Nn("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:t})})}async enableChannel(e){return Nn("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,t){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:t})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,t){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:t})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,t){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:t})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET(){return(await this.request({subtype:"get_usage"})).response}async readFile(e,t){try{return(await this.request({subtype:"read_file",path:e,max_bytes:t?.maxBytes,encoding:t?.encoding})).response}catch{return null}}async reloadPlugins(){return Nn("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async reloadSkills(){return Nn("sdk_reload_skills",async()=>(await this.request({subtype:"reload_skills"})).response)}async setMcpServers(e){return Nn("sdk_mcp_set_servers",async()=>{let t={},r={};for(let[h,b]of Object.entries(e))if(b.type==="sdk"&&"instance"in b)t[h]=b.instance;else r[h]=b;let i=new Set(this.sdkMcpServerInstances.keys()),n=new Set(Object.keys(t));for(let h of i)if(!n.has(h))await this.disconnectSdkMcpServer(h);for(let[h,b]of Object.entries(t))if(!i.has(h))this.connectSdkMcpServer(h,b);let o={};for(let h of Object.keys(t))o[h]={type:"sdk",name:h};return(await this.request({subtype:"mcp_set_servers",servers:{...r,...o}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){zr("[Query.streamInput] Starting to process input stream");try{let t=0;for await(let r of e){if(t++,zr(`[Query.streamInput] Processing message ${t}: ${r.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(pn(r)+`
`))}if(zr(`[Query.streamInput] Finished processing ${t} messages from input stream`),t>0&&this.hasBidirectionalNeeds())zr("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();zr("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(t){if(!(t instanceof Kn))throw t}}waitForFirstResult(){if(this.firstResultReceived)return zr("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((e)=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,t,r,i){let n=this.hookCallbacks.get(e);if(!n)throw Error(`No hook callback found for ID: ${e}`);return n(t,r,{signal:i})}connectSdkMcpServer(e,t){let r=new P0((i)=>this.sendMcpServerMessageToCli(e,i));this.sdkMcpTransports.set(e,r),this.sdkMcpServerInstances.set(e,t),t.connect(r).catch((i)=>{if(this.sdkMcpTransports.get(e)===r)this.sdkMcpTransports.delete(e);if(this.sdkMcpServerInstances.get(e)===t)this.sdkMcpServerInstances.delete(e);zr(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${i}`,{level:"error"})})}async disconnectSdkMcpServer(e){let t=this.sdkMcpTransports.get(e);if(t)await t.close(),this.sdkMcpTransports.delete(e);this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,t){if("id"in t&&t.id!==null&&t.id!==void 0){let i=`${e}:${t.id}`,n=this.pendingMcpResponses.get(i);if(n){n.resolve(t),this.pendingMcpResponses.delete(i);return}}let r={type:"control_request",request_id:ma(),request:{subtype:"mcp_message",server_name:e,message:t}};Promise.resolve(this.transport.write(pn(r)+`
`)).catch((i)=>{zr(`[Query.sendMcpServerMessageToCli] Transport write failed: ${i}`,{level:"error"})})}handleMcpControlRequest(e,t,r){let i="id"in t.message?t.message.id:null,n=`${e}:${i}`;return new Promise((o,s)=>{let h=()=>{this.pendingMcpResponses.delete(n)},b=(_)=>{h(),o(_)},v=(_)=>{h(),s(_)};if(this.pendingMcpResponses.set(n,{resolve:b,reject:v}),r.onmessage)r.onmessage(t.message);else{h(),s(Error("No message handler registered"));return}})}}class Md extends Error{retryAfterMs;constructor(e,t){super(e);this.retryAfterMs=t}}class R0{pending=[];pendingAtClose=0;draining=!1;closed=!1;backpressureResolvers=[];sleepResolve=null;flushResolvers=[];droppedBatches=0;config;constructor(e){this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length===0)return;while(this.pending.length+t.length>this.config.maxQueueSize&&!this.closed)await new Promise((r)=>{this.backpressureResolvers.push(r)});if(this.closed)return;this.pending.push(...t),this.drain()}flush(){if(this.pending.length===0&&!this.draining)return Promise.resolve();return this.drain(),new Promise((e)=>{this.flushResolvers.push(e)})}close(){if(this.closed)return;this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{while(this.pending.length>0&&!this.closed){let t=this.takeBatch();if(t.length===0)continue;try{await this.config.send(t),e=0}catch(r){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let i=r instanceof Md?r.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,i));continue}this.releaseBackpressure()}}finally{if(this.draining=!1,this.pending.length===0){for(let t of this.flushResolvers)t();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let r=0,i=0;while(i<this.pending.length&&i<e){let n;try{n=Buffer.byteLength(pn(this.pending[i]))}catch{this.pending.splice(i,1);continue}if(i>0&&r+n>t)break;r+=n,i++}return this.pending.splice(0,i)}retryDelay(e,t){let r=Math.random()*this.config.jitterMs;if(t!==void 0)return Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+r;return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+r}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise((t)=>{this.sleepResolve=t,setTimeout((r,i)=>{r.sleepResolve=null,i()},e,this,t)})}}function $2(e){let t=[],r=0,i;while((i=e.indexOf(`
`,r))!==-1){let n=e.slice(r,i);if(r=i+2,!n.trim())continue;let o={},s=!1;for(let h of n.split(`
`)){if(h.startsWith(":")){s=!0;continue}let b=h.indexOf(":");if(b===-1)continue;let v=h.slice(0,b),_=h[b+1]===" "?h.slice(b+2):h.slice(b+1);switch(v){case"event":o.event=_;break;case"id":o.id=_;break;case"data":o.data=o.data?o.data+`
`+_:_;break}}if(o.data||s)t.push(o)}return{frames:t,remaining:e.slice(r)}}var iR=15000,P2=1000,A2=30000,R2=5,oR=45000,sR=30000,aR=3,uR=1000,C2=new Set([401,403,404]),lR={stream:!0};class C0{options;ready=!1;closed=!1;abortController;streamAbort=null;messages=new $o;exitError;readyPromise;readyResolve;readyReject;abortHandler;livenessTimer;reconnectAttempts=0;lastEventId="";uploader;constructor(e){this.options=e;if(this.abortController=e.abortController||new AbortController,this.readyPromise=new Promise((t,r)=>{this.readyResolve=t,this.readyReject=r}),this.readyPromise.catch(()=>{}),this.uploader=new R0({maxBatchSize:1,maxQueueSize:uR,baseDelayMs:P2,maxDelayMs:A2,jitterMs:250,maxConsecutiveFailures:aR,send:(t)=>this.postOnce(t[0])}),this.abortHandler=()=>{this.exitError=new Kn("SSE connection aborted by user"),this.close()},this.abortController.signal.aborted)this.abortHandler();else this.abortController.signal.addEventListener("abort",this.abortHandler);this.connect()}buildHeaders(e){return{...this.options.headers??{},...e}}async connect(){if(this.closed)return;this.streamAbort=new AbortController;let e=this.streamAbort.signal,t=this.buildHeaders({Accept:"text/event-stream"});if(this.lastEventId)t["Last-Event-ID"]=this.lastEventId;let r=setTimeout(()=>{this.streamAbort?.abort(),this.handleStreamEnd(Error("SSE connect timeout"))},this.options.connectTimeoutMs??iR),i;try{i=await fetch(this.options.streamUrl,{method:"GET",headers:t,signal:e})}catch(n){if(clearTimeout(r),this.closed||e.aborted)return;return this.handleStreamEnd(w0(n))}if(clearTimeout(r),!i.ok||!i.body){if(i.body?.cancel(),C2.has(i.status))return this.fail(Error(`SSE connect failed: HTTP ${i.status}`));return this.handleStreamEnd(Error(`SSE connect failed: HTTP ${i.status}`))}this.ready=!0,this.reconnectAttempts=0,this.resetLivenessTimer(),this.readyResolve?.(),this.readStream(i.body,e)}async readStream(e,t){let r=e.getReader(),i=new TextDecoder,n="";try{while(!t.aborted){let{done:o,value:s}=await r.read();if(o)break;this.resetLivenessTimer(),n+=i.decode(s,lR);let{frames:h,remaining:b}=$2(n);n=b;for(let v of h){if(v.id)this.lastEventId=v.id;if(!v.data)continue;if(v.event!=="client_event"&&v.event!=="ephemeral_event")continue;try{let _=ws(v.data),g=_.payload;if(!g||typeof g.type!=="string")continue;if(v.event==="ephemeral_event"){if(g.type==="stream_event"){this.messages.enqueue(g);continue}if(g.type==="system"&&g.subtype==="thinking_tokens"){let S=g;this.messages.enqueue({type:"system",subtype:"thinking_tokens",estimated_tokens:S.estimated_tokens,estimated_tokens_delta:S.estimated_tokens_delta,uuid:S.uuid,session_id:S.session_id});continue}console.debug(`[BrowserSSETransport] Dropping ${g.type} on ephemeral_event (only stream_event and system:thinking_tokens ride ephemeral)`);continue}if(_.source!=="worker"&&(g.type==="control_request"||g.type==="control_cancel_request"))continue;if(g.type==="control_response"&&_.source!=="worker"&&g.response&&typeof g.response==="object"&&(("pending_user_dialog_requests"in g.response)||("pending_permission_requests"in g.response))){let{pending_user_dialog_requests:S,pending_permission_requests:x,...M}=g.response;this.messages.enqueue({...g,response:M});continue}this.messages.enqueue(g)}catch{}}}}catch(o){if(!this.closed&&!t.aborted)return this.handleStreamEnd(w0(o));return}finally{r.releaseLock()}if(!this.closed&&!t.aborted)this.handleStreamEnd()}handleStreamEnd(e){if(this.ready=!1,this.clearLivenessTimer(),this.closed)return;if(this.reconnectAttempts>=R2)return this.fail(e??Error(`SSE reconnect budget exhausted (${R2} attempts)`));this.reconnectAttempts++;let t=Math.min(P2*2**(this.reconnectAttempts-1),A2);setTimeout(()=>void this.connect(),t)}fail(e){if(this.exitError=this.exitError??e,!this.ready)this.readyReject?.(e);this.close()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(()=>{this.streamAbort?.abort(),this.handleStreamEnd(Error("SSE liveness timeout"))},oR)}clearLivenessTimer(){if(this.livenessTimer)clearTimeout(this.livenessTimer),this.livenessTimer=void 0}async write(e){if(this.abortController.signal.aborted)throw new Kn("Operation aborted");if(!this.ready)await this.readyPromise;if(this.closed)throw this.exitError??Error("SSETransport is closed");let t=ws(e),r=!t||typeof t!=="object"||Array.isArray(t)||typeof t.uuid==="string"&&t.uuid?e:JSON.stringify({...t,uuid:crypto.randomUUID()});await this.uploader.enqueue(r)}async postOnce(e){let t=this.buildHeaders({"Content-Type":"application/json"}),r=JSON.stringify({session_id:this.options.sessionId,events:[{payload:ws(e)}]}),i=await fetch(this.options.sendUrl,{method:"POST",headers:t,body:r,signal:cR([this.abortController.signal,AbortSignal.timeout(sR)])});if(i.body?.cancel(),i.ok)return;if(C2.has(i.status))throw this.fail(Error(`POST ${this.options.sendUrl}: HTTP ${i.status}`)),Error(`permanent HTTP ${i.status}`);let n=i.headers.get("Retry-After");throw new Md(`POST ${this.options.sendUrl}: HTTP ${i.status}`,n?Number(n)*1000:void 0)}close(){if(this.closed)return;if(this.closed=!0,this.ready=!1,this.clearLivenessTimer(),this.streamAbort?.abort(),this.uploader.close(),this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;this.messages.done()}[Symbol.dispose](){this.close()}isReady(){return this.ready&&!this.closed}endInput(){}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function cR(e){let t=AbortSignal;if(typeof t.any==="function")return t.any(e);let r=new AbortController;for(let i of e){if(i.aborted){r.abort(i.reason);break}i.addEventListener("abort",()=>r.abort(i.reason),{once:!0})}return r.signal}var O2=15000,dR=50000;class O0{options;ws;ready=!1;abortController;messages=new $o;exitError;readyPromise;readyResolve;readyReject;abortHandler;keepAliveTimer;partialLine="";constructor(e){this.options=e;this.abortController=e.abortController||new AbortController,this.readyPromise=new Promise((t,r)=>{this.readyResolve=t,this.readyReject=r}),this.readyPromise.catch(()=>{}),this.initialize()}initialize(){try{let{url:e}=this.options,t=new URL(e);if(!t.protocol.startsWith("ws"))throw Error("WebSocket URL must use ws:// or wss:// protocol");this.ws=new globalThis.WebSocket(t.toString());let r=setTimeout(()=>{if(!this.ready){this.ws?.close();let i=Error(`WebSocket connection timeout after ${O2}ms`);if(this.exitError=i,this.readyReject)this.readyReject(i)}},O2);if(this.ws.onopen=()=>{if(clearTimeout(r),this.ready=!0,this.readyResolve)this.readyResolve();if(this.options.authMessage&&this.ws)try{this.ws.send(pn(this.options.authMessage)+`
`)}catch{}this.keepAliveTimer=setInterval(()=>{if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)try{this.ws.send(pn({type:"keep_alive"})+`
`)}catch{}},dR)},this.ws.onerror=(i)=>{clearTimeout(r),this.ready=!1;let n=Error("WebSocket connection error");if(this.exitError=n,this.readyReject)this.readyReject(n);this.messages.done()},this.ws.onclose=(i)=>{if(this.ready=!1,this.keepAliveTimer)clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0;if(i.code!==1000&&i.code!==1001)this.exitError=Error(`WebSocket closed abnormally with code ${i.code}: ${i.reason}`);this.messages.done()},this.ws.onmessage=(i)=>{if(typeof i.data!=="string")return;let o=(this.partialLine+i.data).split(`
`);this.partialLine=o.pop()??"";for(let s of o){if(!s)continue;try{this.messages.enqueue(ws(s))}catch(h){}}},this.abortController)if(this.abortHandler=()=>{this.close(),this.exitError=new Kn("WebSocket connection aborted by user")},this.abortController.signal.aborted)this.abortHandler();else this.abortController.signal.addEventListener("abort",this.abortHandler)}catch(e){if(this.ready=!1,this.exitError=e,this.readyReject)this.readyReject(e);throw e}}async write(e){if(this.abortController.signal.aborted)throw new Kn("Operation aborted");if(!this.ready)await this.readyPromise;if(!this.ready||!this.ws||this.ws.readyState!==globalThis.WebSocket.OPEN)throw Error("WebSocketTransport is not ready for writing");this.ws.send(e)}close(){if(this.abortHandler&&this.abortController)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;if(this.keepAliveTimer)clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0;if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)this.ws.close(1000,"Normal closure");this.ready=!1,this.messages.done()}[Symbol.dispose](){this.close()}isReady(){return this.ready&&this.ws?.readyState===globalThis.WebSocket.OPEN}endInput(){}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}}function N2(e){return new AbortController}var Tv={};vn(Tv,{xid:()=>d7,void:()=>R7,uuidv7:()=>i7,uuidv6:()=>n7,uuidv4:()=>r7,uuid:()=>t7,url:()=>o7,uppercase:()=>dl,unknown:()=>qt,union:()=>Ot,undefined:()=>P7,ulid:()=>c7,uint64:()=>T7,uint32:()=>M7,tuple:()=>D7,trim:()=>yl,treeifyError:()=>$d,transform:()=>Sv,toUpperCase:()=>bl,toLowerCase:()=>vl,toJSONSchema:()=>zs,templateLiteral:()=>Z7,symbol:()=>$7,superRefine:()=>B6,success:()=>B7,stringbool:()=>W7,stringFormat:()=>w7,string:()=>de,strictObject:()=>N7,startsWith:()=>hl,size:()=>ul,setErrorMap:()=>X7,set:()=>U7,safeParseAsync:()=>Yy,safeParse:()=>Xy,registry:()=>Lu,regexes:()=>Hi,regex:()=>ll,refine:()=>F6,record:()=>Nt,readonly:()=>D6,property:()=>Fy,promise:()=>K7,prettifyError:()=>Pd,preprocess:()=>Eh,prefault:()=>$6,positive:()=>jy,pipe:()=>bh,partialRecord:()=>z7,parseAsync:()=>Jy,parse:()=>Gy,overwrite:()=>gi,optional:()=>Ut,object:()=>Ye,number:()=>Et,nullish:()=>F7,nullable:()=>vh,null:()=>_h,normalize:()=>gl,nonpositive:()=>Ly,nonoptional:()=>P6,nonnegative:()=>qy,never:()=>wh,negative:()=>Uy,nativeEnum:()=>L7,nanoid:()=>a7,nan:()=>H7,multipleOf:()=>zo,minSize:()=>jo,minLength:()=>Vi,mime:()=>ml,maxSize:()=>Os,maxLength:()=>Ns,map:()=>j7,lte:()=>Mn,lt:()=>pi,lowercase:()=>cl,looseObject:()=>Ur,locales:()=>Rs,literal:()=>et,length:()=>Ds,lazy:()=>U6,ksuid:()=>f7,keyof:()=>O7,jwt:()=>_7,json:()=>G7,iso:()=>js,ipv6:()=>p7,ipv4:()=>h7,intersection:()=>El,int64:()=>I7,int32:()=>k7,int:()=>Qy,instanceof:()=>V7,includes:()=>fl,guid:()=>e7,gte:()=>rn,gt:()=>mi,globalRegistry:()=>tn,getErrorMap:()=>Y7,function:()=>dh,formatError:()=>Es,float64:()=>x7,float32:()=>S7,flattenError:()=>Ms,file:()=>q7,enum:()=>Zr,endsWith:()=>pl,emoji:()=>s7,email:()=>Q5,e164:()=>b7,discriminatedUnion:()=>kh,date:()=>C7,custom:()=>Ev,cuid2:()=>l7,cuid:()=>u7,core:()=>Dn,config:()=>rr,coerce:()=>Iv,clone:()=>jr,cidrv6:()=>g7,cidrv4:()=>m7,check:()=>q6,catch:()=>C6,boolean:()=>ir,bigint:()=>E7,base64url:()=>v7,base64:()=>y7,array:()=>bt,any:()=>A7,_default:()=>I6,_ZodString:()=>ev,ZodXID:()=>uv,ZodVoid:()=>g6,ZodUnknown:()=>p6,ZodUnion:()=>bv,ZodUndefined:()=>d6,ZodUUID:()=>yi,ZodURL:()=>rv,ZodULID:()=>av,ZodType:()=>yt,ZodTuple:()=>_6,ZodTransform:()=>wv,ZodTemplateLiteral:()=>z6,ZodSymbol:()=>c6,ZodSuccess:()=>A6,ZodStringFormat:()=>jt,ZodString:()=>Sl,ZodSet:()=>S6,ZodRecord:()=>_v,ZodRealError:()=>Us,ZodReadonly:()=>N6,ZodPromise:()=>L6,ZodPrefault:()=>T6,ZodPipe:()=>Mv,ZodOptional:()=>xv,ZodObject:()=>xh,ZodNumberFormat:()=>Ls,ZodNumber:()=>xl,ZodNullable:()=>M6,ZodNull:()=>f6,ZodNonOptional:()=>kv,ZodNever:()=>m6,ZodNanoID:()=>iv,ZodNaN:()=>O6,ZodMap:()=>w6,ZodLiteral:()=>x6,ZodLazy:()=>j6,ZodKSUID:()=>lv,ZodJWT:()=>yv,ZodIssueCode:()=>J7,ZodIntersection:()=>b6,ZodISOTime:()=>mh,ZodISODuration:()=>gh,ZodISODateTime:()=>hh,ZodISODate:()=>ph,ZodIPv6:()=>dv,ZodIPv4:()=>cv,ZodGUID:()=>yh,ZodFile:()=>k6,ZodError:()=>X5,ZodEnum:()=>wl,ZodEmoji:()=>nv,ZodEmail:()=>tv,ZodE164:()=>gv,ZodDiscriminatedUnion:()=>v6,ZodDefault:()=>E6,ZodDate:()=>Sh,ZodCustomStringFormat:()=>l6,ZodCustom:()=>Mh,ZodCatch:()=>R6,ZodCUID2:()=>sv,ZodCUID:()=>ov,ZodCIDRv6:()=>hv,ZodCIDRv4:()=>fv,ZodBoolean:()=>kl,ZodBigIntFormat:()=>vv,ZodBigInt:()=>Ml,ZodBase64URL:()=>mv,ZodBase64:()=>pv,ZodArray:()=>y6,ZodAny:()=>h6,TimePrecision:()=>qf,NEVER:()=>Ed,$output:()=>jf,$input:()=>Uf,$brand:()=>Id});var Dn={};vn(Dn,{version:()=>jg,util:()=>Fe,treeifyError:()=>$d,toJSONSchema:()=>zs,toDotPath:()=>j2,safeParseAsync:()=>Bi,safeParse:()=>Fi,registry:()=>Lu,regexes:()=>Hi,prettifyError:()=>Pd,parseAsync:()=>Co,parse:()=>Ro,locales:()=>Rs,isValidJWT:()=>r6,isValidBase64URL:()=>t6,isValidBase64:()=>Hg,globalRegistry:()=>tn,globalConfig:()=>Mu,function:()=>dh,formatError:()=>Es,flattenError:()=>Ms,config:()=>rr,clone:()=>jr,_xid:()=>Yu,_void:()=>nh,_uuidv7:()=>Zu,_uuidv6:()=>Hu,_uuidv4:()=>Bu,_uuid:()=>Fu,_url:()=>Ku,_uppercase:()=>dl,_unknown:()=>Do,_union:()=>$5,_undefined:()=>Qf,_ulid:()=>Xu,_uint64:()=>Xf,_uint32:()=>Vf,_tuple:()=>By,_trim:()=>yl,_transform:()=>j5,_toUpperCase:()=>bl,_toLowerCase:()=>vl,_templateLiteral:()=>V5,_symbol:()=>Yf,_success:()=>B5,_stringbool:()=>lh,_stringFormat:()=>ch,_string:()=>Lf,_startsWith:()=>hl,_size:()=>ul,_set:()=>O5,_safeParseAsync:()=>Od,_safeParse:()=>Cd,_regex:()=>ll,_refine:()=>uh,_record:()=>R5,_readonly:()=>K5,_property:()=>Fy,_promise:()=>G5,_positive:()=>jy,_pipe:()=>Z5,_parseAsync:()=>Rd,_parse:()=>Ad,_overwrite:()=>gi,_optional:()=>U5,_number:()=>Ff,_nullable:()=>L5,_null:()=>eh,_normalize:()=>gl,_nonpositive:()=>Ly,_nonoptional:()=>F5,_nonnegative:()=>qy,_never:()=>rh,_negative:()=>Uy,_nativeEnum:()=>D5,_nanoid:()=>Wu,_nan:()=>oh,_multipleOf:()=>zo,_minSize:()=>jo,_minLength:()=>Vi,_min:()=>rn,_mime:()=>ml,_maxSize:()=>Os,_maxLength:()=>Ns,_max:()=>Mn,_map:()=>C5,_lte:()=>Mn,_lt:()=>pi,_lowercase:()=>cl,_literal:()=>z5,_length:()=>Ds,_lazy:()=>W5,_ksuid:()=>Qu,_jwt:()=>al,_isoTime:()=>Ry,_isoDuration:()=>Cy,_isoDateTime:()=>Py,_isoDate:()=>Ay,_ipv6:()=>tl,_ipv4:()=>el,_intersection:()=>A5,_int64:()=>Jf,_int32:()=>Kf,_int:()=>Bf,_includes:()=>fl,_guid:()=>Cs,_gte:()=>rn,_gt:()=>mi,_float64:()=>Zf,_float32:()=>Hf,_file:()=>sh,_enum:()=>N5,_endsWith:()=>pl,_emoji:()=>Vu,_email:()=>qu,_e164:()=>sl,_discriminatedUnion:()=>P5,_default:()=>q5,_date:()=>ih,_custom:()=>ah,_cuid2:()=>Ju,_cuid:()=>Gu,_coercedString:()=>$y,_coercedNumber:()=>Oy,_coercedDate:()=>zy,_coercedBoolean:()=>Ny,_coercedBigint:()=>Dy,_cidrv6:()=>nl,_cidrv4:()=>rl,_catch:()=>H5,_boolean:()=>Wf,_bigint:()=>Gf,_base64url:()=>ol,_base64:()=>il,_array:()=>_l,_any:()=>th,TimePrecision:()=>qf,NEVER:()=>Ed,JSONSchemaGenerator:()=>fh,JSONSchema:()=>s6,Doc:()=>jd,$output:()=>jf,$input:()=>Uf,$constructor:()=>ne,$brand:()=>Id,$ZodXID:()=>Jd,$ZodVoid:()=>mf,$ZodUnknown:()=>No,$ZodUnion:()=>zu,$ZodUndefined:()=>df,$ZodUUID:()=>Fd,$ZodURL:()=>Hd,$ZodULID:()=>Gd,$ZodType:()=>at,$ZodTuple:()=>Ki,$ZodTransform:()=>Ps,$ZodTemplateLiteral:()=>Of,$ZodSymbol:()=>cf,$ZodSuccess:()=>Pf,$ZodStringFormat:()=>Ct,$ZodString:()=>Zi,$ZodSet:()=>wf,$ZodRegistry:()=>Uu,$ZodRecord:()=>bf,$ZodRealError:()=>ks,$ZodReadonly:()=>Cf,$ZodPromise:()=>Nf,$ZodPrefault:()=>Tf,$ZodPipe:()=>As,$ZodOptional:()=>Mf,$ZodObject:()=>Du,$ZodNumberFormat:()=>uf,$ZodNumber:()=>Ou,$ZodNullable:()=>Ef,$ZodNull:()=>ff,$ZodNonOptional:()=>$f,$ZodNever:()=>pf,$ZodNanoID:()=>Kd,$ZodNaN:()=>Rf,$ZodMap:()=>_f,$ZodLiteral:()=>xf,$ZodLazy:()=>Df,$ZodKSUID:()=>Xd,$ZodJWT:()=>sf,$ZodIntersection:()=>vf,$ZodISOTime:()=>Fg,$ZodISODuration:()=>Bg,$ZodISODateTime:()=>Lg,$ZodISODate:()=>qg,$ZodIPv6:()=>Qd,$ZodIPv4:()=>Yd,$ZodGUID:()=>qd,$ZodFunction:()=>Hy,$ZodFile:()=>kf,$ZodError:()=>Cu,$ZodEnum:()=>Sf,$ZodEmoji:()=>Zd,$ZodEmail:()=>Bd,$ZodE164:()=>of,$ZodDiscriminatedUnion:()=>yf,$ZodDefault:()=>If,$ZodDate:()=>gf,$ZodCustomStringFormat:()=>af,$ZodCustom:()=>zf,$ZodCheckUpperCase:()=>Ag,$ZodCheckStringFormat:()=>Is,$ZodCheckStartsWith:()=>Cg,$ZodCheckSizeEquals:()=>Mg,$ZodCheckRegex:()=>$g,$ZodCheckProperty:()=>Ng,$ZodCheckOverwrite:()=>zg,$ZodCheckNumberFormat:()=>wg,$ZodCheckMultipleOf:()=>_g,$ZodCheckMinSize:()=>kg,$ZodCheckMinLength:()=>Ig,$ZodCheckMimeType:()=>Dg,$ZodCheckMaxSize:()=>xg,$ZodCheckMaxLength:()=>Eg,$ZodCheckLowerCase:()=>Pg,$ZodCheckLessThan:()=>Dd,$ZodCheckLengthEquals:()=>Tg,$ZodCheckIncludes:()=>Rg,$ZodCheckGreaterThan:()=>zd,$ZodCheckEndsWith:()=>Og,$ZodCheckBigIntFormat:()=>Sg,$ZodCheck:()=>Zt,$ZodCatch:()=>Af,$ZodCUID2:()=>Wd,$ZodCUID:()=>Vd,$ZodCIDRv6:()=>tf,$ZodCIDRv4:()=>ef,$ZodBoolean:()=>Ts,$ZodBigIntFormat:()=>lf,$ZodBigInt:()=>Nu,$ZodBase64URL:()=>nf,$ZodBase64:()=>rf,$ZodAsyncError:()=>fi,$ZodArray:()=>$s,$ZodAny:()=>hf});var Ed=Object.freeze({status:"aborted"});function ne(e,t,r){function i(h,b){var v;Object.defineProperty(h,"_zod",{value:h._zod??{},enumerable:!1}),(v=h._zod).traits??(v.traits=new Set),h._zod.traits.add(e),t(h,b);for(let _ in s.prototype)if(!(_ in h))Object.defineProperty(h,_,{value:s.prototype[_].bind(h)});h._zod.constr=s,h._zod.def=b}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(h){var b;let v=r?.Parent?new o:this;i(v,h),(b=v._zod).deferred??(b.deferred=[]);for(let _ of v._zod.deferred)_();return v}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:(h)=>{if(r?.Parent&&h instanceof r.Parent)return!0;return h?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var Id=Symbol("zod_brand");class fi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var Mu={};function rr(e){if(e)Object.assign(Mu,e);return Mu}var Fe={};vn(Fe,{unwrapMessage:()=>Eu,stringifyPrimitive:()=>Ke,required:()=>TR,randomString:()=>bR,propertyKeyTypes:()=>Pu,promiseAllObject:()=>vR,primitiveTypes:()=>L0,prefixIssues:()=>en,pick:()=>xR,partial:()=>IR,optionalKeys:()=>q0,omit:()=>kR,numKeys:()=>_R,nullish:()=>qi,normalizeParams:()=>qe,merge:()=>ER,jsonStringifyReplacer:()=>D0,joinValues:()=>_e,issue:()=>H0,isPlainObject:()=>xs,isObject:()=>Ss,getSizableOrigin:()=>Au,getParsedType:()=>wR,getLengthableOrigin:()=>Ru,getEnumValues:()=>Iu,getElementAtPath:()=>yR,floatSafeRemainder:()=>z0,finalizeIssue:()=>mn,extend:()=>MR,escapeRegex:()=>hi,esc:()=>Po,defineLazy:()=>It,createTransparentProxy:()=>SR,clone:()=>jr,cleanRegex:()=>$u,cleanEnum:()=>$R,captureStackTrace:()=>Td,cached:()=>Tu,assignProp:()=>j0,assertNotEqual:()=>hR,assertNever:()=>mR,assertIs:()=>pR,assertEqual:()=>fR,assert:()=>gR,allowsEval:()=>U0,aborted:()=>Ao,NUMBER_FORMAT_RANGES:()=>F0,Class:()=>D2,BIGINT_FORMAT_RANGES:()=>B0});function fR(e){return e}function hR(e){return e}function pR(e){}function mR(e){throw Error()}function gR(e){}function Iu(e){let t=Object.values(e).filter((i)=>typeof i==="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function _e(e,t="|"){return e.map((r)=>Ke(r)).join(t)}function D0(e,t){if(typeof t==="bigint")return t.toString();return t}function Tu(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function qi(e){return e===null||e===void 0}function $u(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function z0(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}function It(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function j0(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function yR(e,t){if(!t)return e;return t.reduce((r,i)=>r?.[i],e)}function vR(e){let t=Object.keys(e),r=t.map((i)=>e[i]);return Promise.all(r).then((i)=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=i[o];return n})}function bR(e=10){let r="";for(let i=0;i<e;i++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function Po(e){return JSON.stringify(e)}var Td=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ss(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var U0=Tu(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function xs(e){if(Ss(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;if(Ss(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function _R(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var wR=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Pu=new Set(["string","number","symbol"]),L0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function hi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jr(e,t,r){let i=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)i._zod.parent=e;return i}function qe(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function SR(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,o){return t??(t=e()),Reflect.set(t,i,n,o)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function Ke(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function q0(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var F0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},B0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function xR(e,t){let r={},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;r[n]=i.shape[n]}return jr(e,{...e._zod.def,shape:r,checks:[]})}function kR(e,t){let r={...e._zod.def.shape},i=e._zod.def;for(let n in t){if(!(n in i.shape))throw Error(`Unrecognized key: "${n}"`);if(!t[n])continue;delete r[n]}return jr(e,{...e._zod.def,shape:r,checks:[]})}function MR(e,t){if(!xs(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return j0(this,"shape",i),i},checks:[]};return jr(e,r)}function ER(e,t){return jr(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return j0(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function IR(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in i))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=e?new e({type:"optional",innerType:i[o]}):i[o]}else for(let o in i)n[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return jr(t,{...t._zod.def,shape:n,checks:[]})}function TR(e,t,r){let i=t._zod.def.shape,n={...i};if(r)for(let o in r){if(!(o in n))throw Error(`Unrecognized key: "${o}"`);if(!r[o])continue;n[o]=new e({type:"nonoptional",innerType:i[o]})}else for(let o in i)n[o]=new e({type:"nonoptional",innerType:i[o]});return jr(t,{...t._zod.def,shape:n,checks:[]})}function Ao(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function en(e,t){return t.map((r)=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Eu(e){return typeof e==="string"?e:e?.message}function mn(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let n=Eu(e.inst?._zod.def?.error?.(e))??Eu(t?.error?.(e))??Eu(r.customError?.(e))??Eu(r.localeError?.(e))??"Invalid input";i.message=n}if(delete i.inst,delete i.continue,!t?.reportInput)delete i.input;return i}function Au(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Ru(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function H0(...e){let[t,r,i]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:i};return{...t}}function $R(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}class D2{constructor(...e){}}var z2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,D0,2)},enumerable:!0})},Cu=ne("$ZodError",z2),ks=ne("$ZodError",z2,{Parent:Error});function Ms(e,t=(r)=>r.message){let r={},i=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else i.push(t(n));return{formErrors:i,fieldErrors:r}}function Es(e,t){let r=t||function(o){return o.message},i={_errors:[]},n=(o)=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((h)=>n({issues:h}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(r(s));else{let h=i,b=0;while(b<s.path.length){let v=s.path[b];if(b!==s.path.length-1)h[v]=h[v]||{_errors:[]};else h[v]=h[v]||{_errors:[]},h[v]._errors.push(r(s));h=h[v],b++}}};return n(e),i}function $d(e,t){let r=t||function(o){return o.message},i={errors:[]},n=(o,s=[])=>{var h,b;for(let v of o.issues)if(v.code==="invalid_union"&&v.errors.length)v.errors.map((_)=>n({issues:_},v.path));else if(v.code==="invalid_key")n({issues:v.issues},v.path);else if(v.code==="invalid_element")n({issues:v.issues},v.path);else{let _=[...s,...v.path];if(_.length===0){i.errors.push(r(v));continue}let g=i,S=0;while(S<_.length){let x=_[S],M=S===_.length-1;if(typeof x==="string")g.properties??(g.properties={}),(h=g.properties)[x]??(h[x]={errors:[]}),g=g.properties[x];else g.items??(g.items=[]),(b=g.items)[x]??(b[x]={errors:[]}),g=g.items[x];if(M)g.errors.push(r(v));S++}}};return n(e),i}function j2(e){let t=[];for(let r of e)if(typeof r==="number")t.push(`[${r}]`);else if(typeof r==="symbol")t.push(`[${JSON.stringify(String(r))}]`);else if(/[^\w$]/.test(r))t.push(`[${JSON.stringify(r)}]`);else{if(t.length)t.push(".");t.push(r)}return t.join("")}function Pd(e){let t=[],r=[...e.issues].sort((i,n)=>i.path.length-n.path.length);for(let i of r)if(t.push(`✖ ${i.message}`),i.path?.length)t.push(` → at ${j2(i.path)}`);return t.join(`
`)}var Ad=(e)=>(t,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new fi;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((b)=>mn(b,o,rr())));throw Td(h,n?.callee),h}return s.value},Ro=Ad(ks),Rd=(e)=>async(t,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;if(s.issues.length){let h=new(n?.Err??e)(s.issues.map((b)=>mn(b,o,rr())));throw Td(h,n?.callee),h}return s.value},Co=Rd(ks),Cd=(e)=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new fi;return o.issues.length?{success:!1,error:new(e??Cu)(o.issues.map((s)=>mn(s,n,rr())))}:{success:!0,data:o.value}},Fi=Cd(ks),Od=(e)=>async(t,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length?{success:!1,error:new e(o.issues.map((s)=>mn(s,n,rr())))}:{success:!0,data:o.value}},Bi=Od(ks);var Hi={};vn(Hi,{xid:()=>W0,uuid7:()=>OR,uuid6:()=>CR,uuid4:()=>RR,uuid:()=>Oo,uppercase:()=>bg,unicodeEmail:()=>zR,undefined:()=>yg,ulid:()=>V0,time:()=>lg,string:()=>dg,rfc5322Email:()=>DR,number:()=>pg,null:()=>gg,nanoid:()=>J0,lowercase:()=>vg,ksuid:()=>G0,ipv6:()=>rg,ipv4:()=>tg,integer:()=>hg,html5Email:()=>NR,hostname:()=>sg,guid:()=>Y0,extendedDuration:()=>AR,emoji:()=>eg,email:()=>Q0,e164:()=>ag,duration:()=>X0,domain:()=>LR,datetime:()=>cg,date:()=>ug,cuid2:()=>K0,cuid:()=>Z0,cidrv6:()=>ig,cidrv4:()=>ng,browserEmail:()=>jR,boolean:()=>mg,bigint:()=>fg,base64url:()=>Nd,base64:()=>og,_emoji:()=>UR});var Z0=/^[cC][^\s-]{8,}$/,K0=/^[0-9a-z]+$/,V0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,W0=/^[0-9a-vA-V]{20}$/,G0=/^[A-Za-z0-9]{27}$/,J0=/^[a-zA-Z0-9_-]{21}$/,X0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,AR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Y0=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Oo=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},RR=Oo(4),CR=Oo(6),OR=Oo(7),Q0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,NR=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,DR=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,zR=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,jR=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,UR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eg(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var tg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rg=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,ng=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ig=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,og=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nd=/^[A-Za-z0-9_-]*$/,sg=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,LR=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ag=/^\+(?:[0-9]){6,14}[0-9]$/,U2="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ug=new RegExp(`^${U2}$`);function L2(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function lg(e){return new RegExp(`^${L2(e)}$`)}function cg(e){let t=L2({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-]\\d{2}:\\d{2})");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${U2}T(?:${i})$`)}var dg=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fg=/^\d+n?$/,hg=/^\d+$/,pg=/^-?\d+(?:\.\d+)?/i,mg=/true|false/i,gg=/null/i;var yg=/undefined/i;var vg=/^[^A-Z]*$/,bg=/^[^a-z]*$/;var Zt=ne("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),F2={number:"number",bigint:"bigint",object:"date"},Dd=ne("$ZodCheckLessThan",(e,t)=>{Zt.init(e,t);let r=F2[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<o)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value<=t.value:i.value<t.value)return;i.issues.push({origin:r,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zd=ne("$ZodCheckGreaterThan",(e,t)=>{Zt.init(e,t);let r=F2[typeof t.value];e._zod.onattach.push((i)=>{let n=i._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>o)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(i)=>{if(t.inclusive?i.value>=t.value:i.value>t.value)return;i.issues.push({origin:r,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_g=ne("$ZodCheckMultipleOf",(e,t)=>{Zt.init(e,t),e._zod.onattach.push((r)=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):z0(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),wg=ne("$ZodCheckNumberFormat",(e,t)=>{Zt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,o]=F0[t.format];e._zod.onattach.push((s)=>{let h=s._zod.bag;if(h.format=t.format,h.minimum=n,h.maximum=o,r)h.pattern=hg}),e._zod.check=(s)=>{let h=s.value;if(r){if(!Number.isInteger(h)){s.issues.push({expected:i,format:t.format,code:"invalid_type",input:h,inst:e});return}if(!Number.isSafeInteger(h)){if(h>0)s.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});else s.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort});return}}if(h<n)s.issues.push({origin:"number",input:h,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(h>o)s.issues.push({origin:"number",input:h,code:"too_big",maximum:o,inst:e})}}),Sg=ne("$ZodCheckBigIntFormat",(e,t)=>{Zt.init(e,t);let[r,i]=B0[t.format];e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i}),e._zod.check=(n)=>{let o=n.value;if(o<r)n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(o>i)n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:e})}}),xg=ne("$ZodCheckMaxSize",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.size<=t.maximum)return;r.issues.push({origin:Au(i),code:"too_big",maximum:t.maximum,input:i,inst:e,continue:!t.abort})}}),kg=ne("$ZodCheckMinSize",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.size>=t.minimum)return;r.issues.push({origin:Au(i),code:"too_small",minimum:t.minimum,input:i,inst:e,continue:!t.abort})}}),Mg=ne("$ZodCheckSizeEquals",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.size!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=(r)=>{let i=r.value,n=i.size;if(n===t.size)return;let o=n>t.size;r.issues.push({origin:Au(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Eg=ne("$ZodCheckMaxLength",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.length<=t.maximum)return;let o=Ru(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ig=ne("$ZodCheckMinLength",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.length>=t.minimum)return;let o=Ru(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Tg=ne("$ZodCheckLengthEquals",(e,t)=>{Zt.init(e,t),e._zod.when=(r)=>{let i=r.value;return!qi(i)&&i.length!==void 0},e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=(r)=>{let i=r.value,n=i.length;if(n===t.length)return;let o=Ru(i),s=n>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Is=ne("$ZodCheckStringFormat",(e,t)=>{var r,i;if(Zt.init(e,t),e._zod.onattach.push((n)=>{let o=n._zod.bag;if(o.format=t.format,t.pattern)o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(i=e._zod).check??(i.check=()=>{})}),$g=ne("$ZodCheckRegex",(e,t)=>{Is.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pg=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vg),Is.init(e,t)}),Ag=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bg),Is.init(e,t)}),Rg=ne("$ZodCheckIncludes",(e,t)=>{Zt.init(e,t);let r=hi(t.includes),i=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Cg=ne("$ZodCheckStartsWith",(e,t)=>{Zt.init(e,t);let r=new RegExp(`^${hi(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.startsWith(t.prefix))return;i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Og=ne("$ZodCheckEndsWith",(e,t)=>{Zt.init(e,t);let r=new RegExp(`.*${hi(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((i)=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.endsWith(t.suffix))return;i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function q2(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues))}var Ng=ne("$ZodCheckProperty",(e,t)=>{Zt.init(e,t),e._zod.check=(r)=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then((n)=>q2(n,r,t.property));q2(i,r,t.property);return}}),Dg=ne("$ZodCheckMimeType",(e,t)=>{Zt.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((i)=>{i._zod.bag.mime=t.mime}),e._zod.check=(i)=>{if(r.has(i.value.type))return;i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e})}}),zg=ne("$ZodCheckOverwrite",(e,t)=>{Zt.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class jd{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
`).filter((o)=>o),i=Math.min(...r.map((o)=>o.length-o.trimStart().length)),n=r.map((o)=>o.slice(i)).map((o)=>" ".repeat(this.indent*2)+o);for(let o of n)this.content.push(o)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,i.join(`
`))}}var jg={major:4,minor:0,patch:0};var at=ne("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jg;let i=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))i.unshift(e);for(let n of i)for(let o of n._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(o,s,h)=>{let b=Ao(o),v;for(let _ of s){if(_._zod.when){if(!_._zod.when(o))continue}else if(b)continue;let g=o.issues.length,S=_._zod.check(o);if(S instanceof Promise&&h?.async===!1)throw new fi;if(v||S instanceof Promise)v=(v??Promise.resolve()).then(async()=>{if(await S,o.issues.length===g)return;if(!b)b=Ao(o,g)});else{if(o.issues.length===g)continue;if(!b)b=Ao(o,g)}}if(v)return v.then(()=>o);return o};e._zod.run=(o,s)=>{let h=e._zod.parse(o,s);if(h instanceof Promise){if(s.async===!1)throw new fi;return h.then((b)=>n(b,i,s))}return n(h,i,s)}}e["~standard"]={validate:(n)=>{try{let o=Fi(e,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch(o){return Bi(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Zi=ne("$ZodString",(e,t)=>{at.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dg(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ct=ne("$ZodStringFormat",(e,t)=>{Is.init(e,t),Zi.init(e,t)}),qd=ne("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Y0),Ct.init(e,t)}),Fd=ne("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Oo(i))}else t.pattern??(t.pattern=Oo());Ct.init(e,t)}),Bd=ne("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Q0),Ct.init(e,t)}),Hd=ne("$ZodURL",(e,t)=>{Ct.init(e,t),e._zod.check=(r)=>{try{let i=r.value,n=new URL(i),o=n.href;if(t.hostname){if(t.hostname.lastIndex=0,!t.hostname.test(n.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:sg.source,input:r.value,inst:e,continue:!t.abort})}if(t.protocol){if(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})}if(!i.endsWith("/")&&o.endsWith("/"))r.value=o.slice(0,-1);else r.value=o;return}catch(i){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Zd=ne("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=eg()),Ct.init(e,t)}),Kd=ne("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=J0),Ct.init(e,t)}),Vd=ne("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Z0),Ct.init(e,t)}),Wd=ne("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=K0),Ct.init(e,t)}),Gd=ne("$ZodULID",(e,t)=>{t.pattern??(t.pattern=V0),Ct.init(e,t)}),Jd=ne("$ZodXID",(e,t)=>{t.pattern??(t.pattern=W0),Ct.init(e,t)}),Xd=ne("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=G0),Ct.init(e,t)}),Lg=ne("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cg(t)),Ct.init(e,t)}),qg=ne("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ug),Ct.init(e,t)}),Fg=ne("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=lg(t)),Ct.init(e,t)}),Bg=ne("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=X0),Ct.init(e,t)}),Yd=ne("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tg),Ct.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format="ipv4"})}),Qd=ne("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rg),Ct.init(e,t),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.format="ipv6"}),e._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ef=ne("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ng),Ct.init(e,t)}),tf=ne("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ig),Ct.init(e,t),e._zod.check=(r)=>{let[i,n]=r.value.split("/");try{if(!n)throw Error();let o=Number(n);if(`${o}`!==n)throw Error();if(o<0||o>128)throw Error();new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Hg(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var rf=ne("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=og),Ct.init(e,t),e._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=(r)=>{if(Hg(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function t6(e){if(!Nd.test(e))return!1;let t=e.replace(/[-_]/g,(i)=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Hg(r)}var nf=ne("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Nd),Ct.init(e,t),e._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=(r)=>{if(t6(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),of=ne("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ag),Ct.init(e,t)});function r6(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var sf=ne("$ZodJWT",(e,t)=>{Ct.init(e,t),e._zod.check=(r)=>{if(r6(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),af=ne("$ZodCustomStringFormat",(e,t)=>{Ct.init(e,t),e._zod.check=(r)=>{if(t.fn(r.value))return;r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Ou=ne("$ZodNumber",(e,t)=>{at.init(e,t),e._zod.pattern=e._zod.bag.pattern??pg,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),r}}),uf=ne("$ZodNumber",(e,t)=>{wg.init(e,t),Ou.init(e,t)}),Ts=ne("$ZodBoolean",(e,t)=>{at.init(e,t),e._zod.pattern=mg,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(o){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Nu=ne("$ZodBigInt",(e,t)=>{at.init(e,t),e._zod.pattern=fg,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(n){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),lf=ne("$ZodBigInt",(e,t)=>{Sg.init(e,t),Nu.init(e,t)}),cf=ne("$ZodSymbol",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n==="symbol")return r;return r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),df=ne("$ZodUndefined",(e,t)=>{at.init(e,t),e._zod.pattern=yg,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),ff=ne("$ZodNull",(e,t)=>{at.init(e,t),e._zod.pattern=gg,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),hf=ne("$ZodAny",(e,t)=>{at.init(e,t),e._zod.parse=(r)=>r}),No=ne("$ZodUnknown",(e,t)=>{at.init(e,t),e._zod.parse=(r)=>r}),pf=ne("$ZodNever",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),mf=ne("$ZodVoid",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),gf=ne("$ZodDate",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(h){}let n=r.value,o=n instanceof Date;if(o&&!Number.isNaN(n.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),r}});function H2(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}var $s=ne("$ZodArray",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let h=n[s],b=t.element._zod.run({value:h,issues:[]},i);if(b instanceof Promise)o.push(b.then((v)=>H2(v,r,s)));else H2(b,r,s)}if(o.length)return Promise.all(o).then(()=>r);return r}});function Ud(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}function Z2(e,t,r,i){if(e.issues.length)if(i[r]===void 0)if(r in i)t.value[r]=void 0;else t.value[r]=e.value;else t.issues.push(...en(r,e.issues));else if(e.value===void 0){if(r in i)t.value[r]=void 0}else t.value[r]=e.value}var Du=ne("$ZodObject",(e,t)=>{at.init(e,t);let r=Tu(()=>{let g=Object.keys(t.shape);for(let x of g)if(!(t.shape[x]instanceof at))throw Error(`Invalid element at key "${x}": expected a Zod schema`);let S=q0(t.shape);return{shape:t.shape,keys:g,keySet:new Set(g),numKeys:g.length,optionalKeys:new Set(S)}});It(e._zod,"propValues",()=>{let g=t.shape,S={};for(let x in g){let M=g[x]._zod;if(M.values){S[x]??(S[x]=new Set);for(let I of M.values)S[x].add(I)}}return S});let i=(g)=>{let S=new jd(["shape","payload","ctx"]),x=r.value,M=(P)=>{let R=Po(P);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};S.write("const input = payload.value;");let I=Object.create(null),T=0;for(let P of x.keys)I[P]=`key_${T++}`;S.write("const newResult = {}");for(let P of x.keys)if(x.optionalKeys.has(P)){let R=I[P];S.write(`const ${R} = ${M(P)};`);let C=Po(P);S.write(`
if (${R}.issues.length) {
if (input[${C}] === undefined) {
if (${C} in input) {
newResult[${C}] = undefined;
}
} else {
payload.issues = payload.issues.concat(
${R}.issues.map((iss) => ({
...iss,
path: iss.path ? [${C}, ...iss.path] : [${C}],
}))
);
}
} else if (${R}.value === undefined) {
if (${C} in input) newResult[${C}] = undefined;
} else {
newResult[${C}] = ${R}.value;
}
`)}else{let R=I[P];S.write(`const ${R} = ${M(P)};`),S.write(`
if (${R}.issues.length) payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
...iss,
path: iss.path ? [${Po(P)}, ...iss.path] : [${Po(P)}]
})));`),S.write(`newResult[${Po(P)}] = ${R}.value`)}S.write("payload.value = newResult;"),S.write("return payload;");let $=S.compile();return(P,R)=>$(g,P,R)},n,o=Ss,s=!Mu.jitless,b=s&&U0.value,v=t.catchall,_;e._zod.parse=(g,S)=>{_??(_=r.value);let x=g.value;if(!o(x))return g.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),g;let M=[];if(s&&b&&S?.async===!1&&S.jitless!==!0){if(!n)n=i(t.shape);g=n(g,S)}else{g.value={};let R=_.shape;for(let C of _.keys){let D=R[C],B=D._zod.run({value:x[C],issues:[]},S),ie=D._zod.optin==="optional"&&D._zod.optout==="optional";if(B instanceof Promise)M.push(B.then((le)=>ie?Z2(le,g,C,x):Ud(le,g,C)));else if(ie)Z2(B,g,C,x);else Ud(B,g,C)}}if(!v)return M.length?Promise.all(M).then(()=>g):g;let I=[],T=_.keySet,$=v._zod,P=$.def.type;for(let R of Object.keys(x)){if(T.has(R))continue;if(P==="never"){I.push(R);continue}let C=$.run({value:x[R],issues:[]},S);if(C instanceof Promise)M.push(C.then((D)=>Ud(D,g,R)));else Ud(C,g,R)}if(I.length)g.issues.push({code:"unrecognized_keys",keys:I,input:x,inst:e});if(!M.length)return g;return Promise.all(M).then(()=>g)}});function K2(e,t,r,i){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((n)=>n.issues.map((o)=>mn(o,i,rr())))}),t}var zu=ne("$ZodUnion",(e,t)=>{at.init(e,t),It(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),It(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((i)=>i._zod.pattern);return new RegExp(`^(${r.map((i)=>$u(i.source)).join("|")})$`)}return}),e._zod.parse=(r,i)=>{let n=!1,o=[];for(let s of t.options){let h=s._zod.run({value:r.value,issues:[]},i);if(h instanceof Promise)o.push(h),n=!0;else{if(h.issues.length===0)return h;o.push(h)}}if(!n)return K2(o,r,e,i);return Promise.all(o).then((s)=>K2(s,r,e,i))}}),yf=ne("$ZodDiscriminatedUnion",(e,t)=>{zu.init(e,t);let r=e._zod.parse;It(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[h,b]of Object.entries(s)){if(!n[h])n[h]=new Set;for(let v of b)n[h].add(v)}}return n});let i=Tu(()=>{let n=t.options,o=new Map;for(let s of n){let h=s._zod.propValues[t.discriminator];if(!h||h.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let b of h){if(o.has(b))throw Error(`Duplicate discriminator value "${String(b)}"`);o.set(b,s)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!Ss(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let h=i.value.get(s?.[t.discriminator]);if(h)return h._zod.run(n,o);if(t.unionFallback)return r(n,o);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),n}}),vf=ne("$ZodIntersection",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value,o=t.left._zod.run({value:n,issues:[]},i),s=t.right._zod.run({value:n,issues:[]},i);if(o instanceof Promise||s instanceof Promise)return Promise.all([o,s]).then(([b,v])=>V2(r,b,v));return V2(r,o,s)}});function Ug(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(xs(e)&&xs(t)){let r=Object.keys(t),i=Object.keys(e).filter((o)=>r.indexOf(o)!==-1),n={...e,...t};for(let o of i){let s=Ug(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let n=e[i],o=t[i],s=Ug(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function V2(e,t,r){if(t.issues.length)e.issues.push(...t.issues);if(r.issues.length)e.issues.push(...r.issues);if(Ao(e))return e;let i=Ug(t.value,r.value);if(!i.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var Ki=ne("$ZodTuple",(e,t)=>{at.init(e,t);let r=t.items,i=r.length-[...r].reverse().findIndex((n)=>n._zod.optin!=="optional");e._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let h=[];if(!t.rest){let v=s.length>r.length,_=s.length<i-1;if(v||_)return n.issues.push({input:s,inst:e,origin:"array",...v?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),n}let b=-1;for(let v of r){if(b++,b>=s.length){if(b>=i)continue}let _=v._zod.run({value:s[b],issues:[]},o);if(_ instanceof Promise)h.push(_.then((g)=>Ld(g,n,b)));else Ld(_,n,b)}if(t.rest){let v=s.slice(r.length);for(let _ of v){b++;let g=t.rest._zod.run({value:_,issues:[]},o);if(g instanceof Promise)h.push(g.then((S)=>Ld(S,n,b)));else Ld(g,n,b)}}if(h.length)return Promise.all(h).then(()=>n);return n}});function Ld(e,t,r){if(e.issues.length)t.issues.push(...en(r,e.issues));t.value[r]=e.value}var bf=ne("$ZodRecord",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!xs(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let o=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let b of s)if(typeof b==="string"||typeof b==="number"||typeof b==="symbol"){let v=t.valueType._zod.run({value:n[b],issues:[]},i);if(v instanceof Promise)o.push(v.then((_)=>{if(_.issues.length)r.issues.push(...en(b,_.issues));r.value[b]=_.value}));else{if(v.issues.length)r.issues.push(...en(b,v.issues));r.value[b]=v.value}}let h;for(let b in n)if(!s.has(b))h=h??[],h.push(b);if(h&&h.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:h})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let h=t.keyType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(h.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:h.issues.map((v)=>mn(v,i,rr())),input:s,path:[s],inst:e}),r.value[h.value]=h.value;continue}let b=t.valueType._zod.run({value:n[s],issues:[]},i);if(b instanceof Promise)o.push(b.then((v)=>{if(v.issues.length)r.issues.push(...en(s,v.issues));r.value[h.value]=v.value}));else{if(b.issues.length)r.issues.push(...en(s,b.issues));r.value[h.value]=b.value}}}if(o.length)return Promise.all(o).then(()=>r);return r}}),_f=ne("$ZodMap",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let o=[];r.value=new Map;for(let[s,h]of n){let b=t.keyType._zod.run({value:s,issues:[]},i),v=t.valueType._zod.run({value:h,issues:[]},i);if(b instanceof Promise||v instanceof Promise)o.push(Promise.all([b,v]).then(([_,g])=>{W2(_,g,r,s,n,e,i)}));else W2(b,v,r,s,n,e,i)}if(o.length)return Promise.all(o).then(()=>r);return r}});function W2(e,t,r,i,n,o,s){if(e.issues.length)if(Pu.has(typeof i))r.issues.push(...en(i,e.issues));else r.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:e.issues.map((h)=>mn(h,s,rr()))});if(t.issues.length)if(Pu.has(typeof i))r.issues.push(...en(i,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:t.issues.map((h)=>mn(h,s,rr()))});r.value.set(e.value,t.value)}var wf=ne("$ZodSet",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let h=t.valueType._zod.run({value:s,issues:[]},i);if(h instanceof Promise)o.push(h.then((b)=>G2(b,r)));else G2(h,r)}if(o.length)return Promise.all(o).then(()=>r);return r}});function G2(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var Sf=ne("$ZodEnum",(e,t)=>{at.init(e,t);let r=Iu(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter((i)=>Pu.has(typeof i)).map((i)=>typeof i==="string"?hi(i):i.toString()).join("|")})$`),e._zod.parse=(i,n)=>{let o=i.value;if(e._zod.values.has(o))return i;return i.issues.push({code:"invalid_value",values:r,input:o,inst:e}),i}}),xf=ne("$ZodLiteral",(e,t)=>{at.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?hi(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,i)=>{let n=r.value;if(e._zod.values.has(n))return r;return r.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),r}}),kf=ne("$ZodFile",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(n instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Ps=ne("$ZodTransform",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=t.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r));if(n instanceof Promise)throw new fi;return r.value=n,r}}),Mf=ne("$ZodOptional",(e,t)=>{at.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$u(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional")return t.innerType._zod.run(r,i);if(r.value===void 0)return r;return t.innerType._zod.run(r,i)}}),Ef=ne("$ZodNullable",(e,t)=>{at.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$u(r.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>{if(r.value===null)return r;return t.innerType._zod.run(r,i)}}),If=ne("$ZodDefault",(e,t)=>{at.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>J2(o,t));return J2(n,t)}});function J2(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Tf=ne("$ZodPrefault",(e,t)=>{at.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,i)}}),$f=ne("$ZodNonOptional",(e,t)=>{at.init(e,t),It(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((i)=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>X2(o,e));return X2(n,e)}});function X2(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Pf=ne("$ZodSuccess",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>(r.value=o.issues.length===0,r));return r.value=n.issues.length===0,r}}),Af=ne("$ZodCatch",(e,t)=>{at.init(e,t),e._zod.optin="optional",It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>{if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((s)=>mn(s,i,rr()))},input:r.value}),r.issues=[];return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((o)=>mn(o,i,rr()))},input:r.value}),r.issues=[];return r}}),Rf=ne("$ZodNaN",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),As=ne("$ZodPipe",(e,t)=>{at.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,i)=>{let n=t.in._zod.run(r,i);if(n instanceof Promise)return n.then((o)=>Y2(o,t,i));return Y2(n,t,i)}});function Y2(e,t,r){if(Ao(e))return e;return t.out._zod.run({value:e.value,issues:e.issues},r)}var Cf=ne("$ZodReadonly",(e,t)=>{at.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,i)=>{let n=t.innerType._zod.run(r,i);if(n instanceof Promise)return n.then(Q2);return Q2(n)}});function Q2(e){return e.value=Object.freeze(e.value),e}var Of=ne("$ZodTemplateLiteral",(e,t)=>{at.init(e,t);let r=[];for(let i of t.parts)if(i instanceof at){if(!i._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||L0.has(typeof i))r.push(hi(`${i}`));else throw Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,n)=>{if(typeof i.value!=="string")return i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(i.value))return i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i;return i}}),Nf=ne("$ZodPromise",(e,t)=>{at.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},i))}),Df=ne("$ZodLazy",(e,t)=>{at.init(e,t),It(e._zod,"innerType",()=>t.getter()),It(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),It(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),It(e._zod,"optin",()=>e._zod.innerType._zod.optin),It(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),zf=ne("$ZodCustom",(e,t)=>{Zt.init(e,t),at.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=(r)=>{let i=r.value,n=t.fn(i);if(n instanceof Promise)return n.then((o)=>e6(o,r,i,e));e6(n,r,i,e);return}});function e6(e,t,r,i){if(!e){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};if(i._zod.def.params)n.params=i._zod.def.params;t.issues.push(H0(n))}}var Rs={};vn(Rs,{zhTW:()=>Ty,zhCN:()=>Iy,vi:()=>Ey,ur:()=>My,ua:()=>ky,tr:()=>xy,th:()=>Sy,ta:()=>wy,sv:()=>_y,sl:()=>by,ru:()=>vy,pt:()=>yy,ps:()=>my,pl:()=>gy,ota:()=>py,no:()=>hy,nl:()=>fy,ms:()=>dy,mk:()=>cy,ko:()=>ly,kh:()=>uy,ja:()=>ay,it:()=>sy,id:()=>oy,hu:()=>iy,he:()=>ny,frCA:()=>ry,fr:()=>ty,fi:()=>ey,fa:()=>Qg,es:()=>Yg,eo:()=>Xg,en:()=>ju,de:()=>Jg,cs:()=>Gg,ca:()=>Wg,be:()=>Vg,az:()=>Kg,ar:()=>Zg});var qR=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(n)=>{switch(n.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${n.expected}، ولكن تم إدخال ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Ke(n.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`;if(o.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`;if(o.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`;if(o.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`;return`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${_e(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function Zg(){return{localeError:qR()}}var FR=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Yanlış dəyər: gözlənilən ${Ke(n.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`;if(o.format==="ends_with")return`Yanlış mətn: "${o.suffix}" ilə bitməlidir`;if(o.format==="includes")return`Yanlış mətn: "${o.includes}" daxil olmalıdır`;if(o.format==="regex")return`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Kg(){return{localeError:FR()}}function i6(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var BR=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"лік";case"object":{if(Array.isArray(n))return"масіў";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(n)=>{switch(n.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${n.expected}, атрымана ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Няправільны ўвод: чакалася ${Ke(n.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),b=i6(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${b}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),b=i6(h,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${b}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${o.prefix}"`;if(o.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${o.suffix}"`;if(o.format==="includes")return`Няправільны радок: павінен змяшчаць "${o.includes}"`;if(o.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`;return`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function Vg(){return{localeError:BR()}}var HR=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipus invàlid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Valor invàlid: s'esperava ${Ke(n.values[0])}`;return`Opció invàlida: s'esperava una de ${_e(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",s=t(n.origin);if(s)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",s=t(n.origin);if(s)return`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Format invàlid: ha de començar amb "${o.prefix}"`;if(o.format==="ends_with")return`Format invàlid: ha d'acabar amb "${o.suffix}"`;if(o.format==="includes")return`Format invàlid: ha d'incloure "${o.includes}"`;if(o.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${o.pattern}`;return`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function Wg(){return{localeError:HR()}}var ZR=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(n)=>{switch(n.code){case"invalid_type":return`Neplatný vstup: očekáváno ${n.expected}, obdrženo ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neplatný vstup: očekáváno ${Ke(n.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neplatný řetězec: musí začínat na "${o.prefix}"`;if(o.format==="ends_with")return`Neplatný řetězec: musí končit na "${o.suffix}"`;if(o.format==="includes")return`Neplatný řetězec: musí obsahovat "${o.includes}"`;if(o.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`;return`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${_e(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function Gg(){return{localeError:ZR()}}var KR=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(n)=>{switch(n.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ungültige Eingabe: erwartet ${Ke(n.values[0])}`;return`Ungültige Option: erwartet eine von ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ungültiger String: muss mit "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ungültiger String: muss mit "${o.suffix}" enden`;if(o.format==="includes")return`Ungültiger String: muss "${o.includes}" enthalten`;if(o.format==="regex")return`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`;return`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function Jg(){return{localeError:KR()}}var VR=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},WR=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(i)=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${VR(i.input)}`;case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${Ke(i.values[0])}`;return`Invalid option: expected one of ${_e(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`;return`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Invalid string: must start with "${n.prefix}"`;if(n.format==="ends_with")return`Invalid string: must end with "${n.suffix}"`;if(n.format==="includes")return`Invalid string: must include "${n.includes}"`;if(n.format==="regex")return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${_e(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function ju(){return{localeError:WR()}}var GR=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},JR=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(i)=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${i.expected}, riceviĝis ${GR(i.input)}`;case"invalid_value":if(i.values.length===1)return`Nevalida enigo: atendiĝis ${Ke(i.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${_e(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Tro malgranda: atendiĝis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`;return`Tro malgranda: atendiĝis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${n.prefix}"`;if(n.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${n.suffix}"`;if(n.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${n.includes}"`;if(n.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`;return`Nevalida ${r[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${_e(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function Xg(){return{localeError:JR()}}var XR=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Entrada inválida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: se esperaba ${Ke(n.values[0])}`;return`Opción inválida: se esperaba una de ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Demasiado pequeño: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${s.unit}`;return`Demasiado pequeño: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Cadena inválida: debe comenzar con "${o.prefix}"`;if(o.format==="ends_with")return`Cadena inválida: debe terminar en "${o.suffix}"`;if(o.format==="includes")return`Cadena inválida: debe incluir "${o.includes}"`;if(o.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${o.pattern}`;return`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${n.origin}`;default:return"Entrada inválida"}}};function Yg(){return{localeError:XR()}}var YR=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"آرایه";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(n)=>{switch(n.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${n.expected} میبود، ${r(n.input)} دریافت شد`;case"invalid_value":if(n.values.length===1)return`ورودی نامعتبر: میبایست ${Ke(n.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${_e(n.values,"|")} میبود`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`رشته نامعتبر: باید با "${o.prefix}" شروع شود`;if(o.format==="ends_with")return`رشته نامعتبر: باید با "${o.suffix}" تمام شود`;if(o.format==="includes")return`رشته نامعتبر: باید شامل "${o.includes}" باشد`;if(o.format==="regex")return`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`;return`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${_e(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function Qg(){return{localeError:YR()}}var QR=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(n)=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Virheellinen syöte: täytyy olla ${Ke(n.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${o.prefix}"`;if(o.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${o.suffix}"`;if(o.format==="includes")return`Virheellinen syöte: täytyy sisältää "${o.includes}"`;if(o.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`;return`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_e(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function ey(){return{localeError:QR()}}var e5=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : ${n.expected} attendu, ${r(n.input)} reçu`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : ${Ke(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${_e(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_e(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function ty(){return{localeError:e5()}}var t5=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(n)=>{switch(n.code){case"invalid_type":return`Entrée invalide : attendu ${n.expected}, reçu ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrée invalide : attendu ${Ke(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",s=t(n.origin);if(s)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",s=t(n.origin);if(s)return`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chaîne invalide : doit commencer par "${o.prefix}"`;if(o.format==="ends_with")return`Chaîne invalide : doit se terminer par "${o.suffix}"`;if(o.format==="includes")return`Chaîne invalide : doit inclure "${o.includes}"`;if(o.format==="regex")return`Chaîne invalide : doit correspondre au motif ${o.pattern}`;return`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${_e(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function ry(){return{localeError:t5()}}var r5=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(n)=>{switch(n.code){case"invalid_type":return`קלט לא תקין: צריך ${n.expected}, התקבל ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`קלט לא תקין: צריך ${Ke(n.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${n.origin??"value"} צריך להיות ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()} ${s.unit}`;return`קטן מדי: ${n.origin} צריך להיות ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`;if(o.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`;if(o.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`;if(o.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`;return`${i[o.format]??n.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${n.divisor}`;case"unrecognized_keys":return`מפתח${n.keys.length>1?"ות":""} לא מזוה${n.keys.length>1?"ים":"ה"}: ${_e(n.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${n.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n.origin}`;default:return"קלט לא תקין"}}};function ny(){return{localeError:r5()}}var n5=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"szám";case"object":{if(Array.isArray(n))return"tömb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(n)=>{switch(n.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${n.expected}, a kapott érték ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Érvénytelen bemenet: a várt érték ${Ke(n.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`;if(o.format==="ends_with")return`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`;if(o.format==="includes")return`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`;if(o.format==="regex")return`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`;return`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function iy(){return{localeError:n5()}}var i5=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${Ke(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak valid: harus dimulai dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak valid: harus berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak valid: harus menyertakan "${o.includes}"`;if(o.format==="regex")return`String tidak valid: harus sesuai pola ${o.pattern}`;return`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function oy(){return{localeError:i5()}}var o5=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${Ke(n.values[0])}`;return`Opzione non valida: atteso uno tra ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Stringa non valida: deve iniziare con "${o.prefix}"`;if(o.format==="ends_with")return`Stringa non valida: deve terminare con "${o.suffix}"`;if(o.format==="includes")return`Stringa non valida: deve includere "${o.includes}"`;if(o.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function sy(){return{localeError:o5()}}var s5=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"数値";case"object":{if(Array.isArray(n))return"配列";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(n)=>{switch(n.code){case"invalid_type":return`無効な入力: ${n.expected}が期待されましたが、${r(n.input)}が入力されました`;case"invalid_value":if(n.values.length===1)return`無効な入力: ${Ke(n.values[0])}が期待されました`;return`無効な選択: ${_e(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",s=t(n.origin);if(s)return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`;return`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",s=t(n.origin);if(s)return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`;return`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無効な文字列: "${o.prefix}"で始まる必要があります`;if(o.format==="ends_with")return`無効な文字列: "${o.suffix}"で終わる必要があります`;if(o.format==="includes")return`無効な文字列: "${o.includes}"を含む必要があります`;if(o.format==="regex")return`無効な文字列: パターン${o.pattern}に一致する必要があります`;return`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${_e(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function ay(){return{localeError:s5()}}var a5=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(n))return"អារេ (Array)";if(n===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(n)=>{switch(n.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${n.expected} ប៉ុន្តែទទួលបាន ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Ke(n.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`;if(o.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`;if(o.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`;if(o.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`;return`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${_e(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function uy(){return{localeError:a5()}}var u5=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(n)=>{switch(n.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${n.expected}, 받은 타입은 ${r(n.input)}입니다`;case"invalid_value":if(n.values.length===1)return`잘못된 입력: 값은 ${Ke(n.values[0])} 이어야 합니다`;return`잘못된 옵션: ${_e(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",h=t(n.origin),b=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${b} ${o}${s}`;return`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",h=t(n.origin),b=h?.unit??"요소";if(h)return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${b} ${o}${s}`;return`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`;if(o.format==="ends_with")return`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`;if(o.format==="includes")return`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`;if(o.format==="regex")return`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${_e(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function ly(){return{localeError:u5()}}var l5=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"број";case"object":{if(Array.isArray(n))return"низа";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(n)=>{switch(n.code){case"invalid_type":return`Грешен внес: се очекува ${n.expected}, примено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${Ke(n.values[0])}`;return`Грешана опција: се очекува една ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неважечка низа: мора да започнува со "${o.prefix}"`;if(o.format==="ends_with")return`Неважечка низа: мора да завршува со "${o.suffix}"`;if(o.format==="includes")return`Неважечка низа: мора да вклучува "${o.includes}"`;if(o.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${o.pattern}`;return`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function cy(){return{localeError:l5()}}var c5=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${Ke(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`String tidak sah: mesti bermula dengan "${o.prefix}"`;if(o.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${o.suffix}"`;if(o.format==="includes")return`String tidak sah: mesti mengandungi "${o.includes}"`;if(o.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${o.pattern}`;return`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_e(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function dy(){return{localeError:c5()}}var d5=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(n)=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${Ke(n.values[0])}`;return`Ongeldige optie: verwacht één van ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ongeldige tekst: moet met "${o.prefix}" beginnen`;if(o.format==="ends_with")return`Ongeldige tekst: moet op "${o.suffix}" eindigen`;if(o.format==="includes")return`Ongeldige tekst: moet "${o.includes}" bevatten`;if(o.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`;return`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function fy(){return{localeError:d5()}}var f5=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${Ke(n.values[0])}`;return`Ugyldig valg: forventet en av ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ugyldig streng: må starte med "${o.prefix}"`;if(o.format==="ends_with")return`Ugyldig streng: må ende med "${o.suffix}"`;if(o.format==="includes")return`Ugyldig streng: må inneholde "${o.includes}"`;if(o.format==="regex")return`Ugyldig streng: må matche mønsteret ${o.pattern}`;return`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function hy(){return{localeError:f5()}}var h5=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(n)=>{switch(n.code){case"invalid_type":return`Fâsit giren: umulan ${n.expected}, alınan ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Fâsit giren: umulan ${Ke(n.values[0])}`;return`Fâsit tercih: mûteberler ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Fâsit metin: "${o.prefix}" ile başlamalı.`;if(o.format==="ends_with")return`Fâsit metin: "${o.suffix}" ile bitmeli.`;if(o.format==="includes")return`Fâsit metin: "${o.includes}" ihtivâ etmeli.`;if(o.format==="regex")return`Fâsit metin: ${o.pattern} nakşına uymalı.`;return`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function py(){return{localeError:h5()}}var p5=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"عدد";case"object":{if(Array.isArray(n))return"ارې";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(n)=>{switch(n.code){case"invalid_type":return`ناسم ورودي: باید ${n.expected} وای, مګر ${r(n.input)} ترلاسه شو`;case"invalid_value":if(n.values.length===1)return`ناسم ورودي: باید ${Ke(n.values[0])} وای`;return`ناسم انتخاب: باید یو له ${_e(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`ناسم متن: باید د "${o.prefix}" سره پیل شي`;if(o.format==="ends_with")return`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`;if(o.format==="includes")return`ناسم متن: باید "${o.includes}" ولري`;if(o.format==="regex")return`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`;return`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${_e(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function my(){return{localeError:p5()}}var m5=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(n)=>{switch(n.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Ke(n.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`;if(o.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`;if(o.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`;if(o.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`;return`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function gy(){return{localeError:m5()}}var g5=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"número";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(n)=>{switch(n.code){case"invalid_type":return`Tipo inválido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Entrada inválida: esperado ${Ke(n.values[0])}`;return`Opção inválida: esperada uma das ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Texto inválido: deve começar com "${o.prefix}"`;if(o.format==="ends_with")return`Texto inválido: deve terminar com "${o.suffix}"`;if(o.format==="includes")return`Texto inválido: deve incluir "${o.includes}"`;if(o.format==="regex")return`Texto inválido: deve corresponder ao padrão ${o.pattern}`;return`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function yy(){return{localeError:g5()}}function o6(e,t,r,i){let n=Math.abs(e),o=n%10,s=n%100;if(s>=11&&s<=19)return i;if(o===1)return t;if(o>=2&&o<=4)return r;return i}var y5=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"массив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(n)=>{switch(n.code){case"invalid_type":return`Неверный ввод: ожидалось ${n.expected}, получено ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неверный ввод: ожидалось ${Ke(n.values[0])}`;return`Неверный вариант: ожидалось одно из ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let h=Number(n.maximum),b=o6(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${b}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let h=Number(n.minimum),b=o6(h,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${b}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неверная строка: должна начинаться с "${o.prefix}"`;if(o.format==="ends_with")return`Неверная строка: должна заканчиваться на "${o.suffix}"`;if(o.format==="includes")return`Неверная строка: должна содержать "${o.includes}"`;if(o.format==="regex")return`Неверная строка: должна соответствовать шаблону ${o.pattern}`;return`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function vy(){return{localeError:y5()}}var v5=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"število";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(n)=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pričakovano ${Ke(n.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Neveljaven niz: mora se začeti z "${o.prefix}"`;if(o.format==="ends_with")return`Neveljaven niz: mora se končati z "${o.suffix}"`;if(o.format==="includes")return`Neveljaven niz: mora vsebovati "${o.includes}"`;if(o.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`;return`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function by(){return{localeError:v5()}}var b5=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(n)=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: förväntat ${Ke(n.values[0])}`;return`Ogiltigt val: förväntade en av ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Ogiltig sträng: måste börja med "${o.prefix}"`;if(o.format==="ends_with")return`Ogiltig sträng: måste sluta med "${o.suffix}"`;if(o.format==="includes")return`Ogiltig sträng: måste innehålla "${o.includes}"`;if(o.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`;return`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${_e(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function _y(){return{localeError:b5()}}var _5=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(n))return"அணி";if(n===null)return"வெறுமை";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${n.expected}, பெறப்பட்டது ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Ke(n.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${_e(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`;if(o.format==="ends_with")return`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`;if(o.format==="includes")return`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`;if(o.format==="regex")return`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function wy(){return{localeError:_5()}}var w5=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(n))return"อาร์เรย์ (Array)";if(n===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(n)=>{switch(n.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${n.expected} แต่ได้รับ ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Ke(n.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(n.origin);if(s)return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",s=t(n.origin);if(s)return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`;if(o.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`;if(o.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`;if(o.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`;return`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${_e(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Sy(){return{localeError:w5()}}var S5=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},x5=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(i){return e[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(i)=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${S5(i.input)}`;case"invalid_value":if(i.values.length===1)return`Geçersiz değer: beklenen ${Ke(i.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${_e(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=t(i.origin);if(o)return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()} ${o.unit??"öğe"}`;return`Çok büyük: beklenen ${i.origin??"değer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=t(i.origin);if(o)return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`;return`Çok küçük: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.format==="starts_with")return`Geçersiz metin: "${n.prefix}" ile başlamalı`;if(n.format==="ends_with")return`Geçersiz metin: "${n.suffix}" ile bitmeli`;if(n.format==="includes")return`Geçersiz metin: "${n.includes}" içermeli`;if(n.format==="regex")return`Geçersiz metin: ${n.pattern} desenine uymalı`;return`Geçersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${_e(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function xy(){return{localeError:x5()}}var k5=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"число";case"object":{if(Array.isArray(n))return"масив";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(n)=>{switch(n.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${n.expected}, отримано ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Неправильні вхідні дані: очікується ${Ke(n.values[0])}`;return`Неправильна опція: очікується одне з ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Неправильний рядок: повинен починатися з "${o.prefix}"`;if(o.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`;if(o.format==="includes")return`Неправильний рядок: повинен містити "${o.includes}"`;if(o.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`;return`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${_e(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function ky(){return{localeError:k5()}}var M5=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"نمبر";case"object":{if(Array.isArray(n))return"آرے";if(n===null)return"نل";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(n)=>{switch(n.code){case"invalid_type":return`غلط ان پٹ: ${n.expected} متوقع تھا، ${r(n.input)} موصول ہوا`;case"invalid_value":if(n.values.length===1)return`غلط ان پٹ: ${Ke(n.values[0])} متوقع تھا`;return`غلط آپشن: ${_e(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`;if(o.format==="ends_with")return`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`;if(o.format==="includes")return`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`;if(o.format==="regex")return`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`;return`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${_e(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function My(){return{localeError:M5()}}var E5=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"số";case"object":{if(Array.isArray(n))return"mảng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(n)=>{switch(n.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${n.expected}, nhận được ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Ke(n.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`;if(o.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`;if(o.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`;if(o.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`;return`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${_e(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Ey(){return{localeError:E5()}}var I5=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(n))return"数组";if(n===null)return"空值(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(n)=>{switch(n.code){case"invalid_type":return`无效输入:期望 ${n.expected},实际接收 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`无效输入:期望 ${Ke(n.values[0])}`;return`无效选项:期望以下之一 ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`无效字符串:必须以 "${o.prefix}" 开头`;if(o.format==="ends_with")return`无效字符串:必须以 "${o.suffix}" 结尾`;if(o.format==="includes")return`无效字符串:必须包含 "${o.includes}"`;if(o.format==="regex")return`无效字符串:必须满足正则表达式 ${o.pattern}`;return`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${_e(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Iy(){return{localeError:I5()}}var T5=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}let r=(n)=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(n)=>{switch(n.code){case"invalid_type":return`無效的輸入值:預期為 ${n.expected},但收到 ${r(n.input)}`;case"invalid_value":if(n.values.length===1)return`無效的輸入值:預期為 ${Ke(n.values[0])}`;return`無效的選項:預期為以下其中之一 ${_e(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s)return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`無效的字串:必須以 "${o.prefix}" 開頭`;if(o.format==="ends_with")return`無效的字串:必須以 "${o.suffix}" 結尾`;if(o.format==="includes")return`無效的字串:必須包含 "${o.includes}"`;if(o.format==="regex")return`無效的字串:必須符合格式 ${o.pattern}`;return`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${_e(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Ty(){return{localeError:T5()}}var jf=Symbol("ZodOutput"),Uf=Symbol("ZodInput");class Uu{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function Lu(){return new Uu}var tn=Lu();function Lf(e,t){return new e({type:"string",...qe(t)})}function $y(e,t){return new e({type:"string",coerce:!0,...qe(t)})}function qu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function Cs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function Fu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function Bu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function Hu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function Zu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function Ku(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function Vu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function Wu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function Gu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function Ju(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function Xu(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function Yu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function Qu(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function el(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function tl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function rl(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function nl(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function il(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function ol(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function sl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function al(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}var qf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Py(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function Ay(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function Ry(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function Cy(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function Ff(e,t){return new e({type:"number",checks:[],...qe(t)})}function Oy(e,t){return new e({type:"number",coerce:!0,checks:[],...qe(t)})}function Bf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function Hf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...qe(t)})}function Zf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...qe(t)})}function Kf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...qe(t)})}function Vf(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...qe(t)})}function Wf(e,t){return new e({type:"boolean",...qe(t)})}function Ny(e,t){return new e({type:"boolean",coerce:!0,...qe(t)})}function Gf(e,t){return new e({type:"bigint",...qe(t)})}function Dy(e,t){return new e({type:"bigint",coerce:!0,...qe(t)})}function Jf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...qe(t)})}function Xf(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...qe(t)})}function Yf(e,t){return new e({type:"symbol",...qe(t)})}function Qf(e,t){return new e({type:"undefined",...qe(t)})}function eh(e,t){return new e({type:"null",...qe(t)})}function th(e){return new e({type:"any"})}function Do(e){return new e({type:"unknown"})}function rh(e,t){return new e({type:"never",...qe(t)})}function nh(e,t){return new e({type:"void",...qe(t)})}function ih(e,t){return new e({type:"date",...qe(t)})}function zy(e,t){return new e({type:"date",coerce:!0,...qe(t)})}function oh(e,t){return new e({type:"nan",...qe(t)})}function pi(e,t){return new Dd({check:"less_than",...qe(t),value:e,inclusive:!1})}function Mn(e,t){return new Dd({check:"less_than",...qe(t),value:e,inclusive:!0})}function mi(e,t){return new zd({check:"greater_than",...qe(t),value:e,inclusive:!1})}function rn(e,t){return new zd({check:"greater_than",...qe(t),value:e,inclusive:!0})}function jy(e){return mi(0,e)}function Uy(e){return pi(0,e)}function Ly(e){return Mn(0,e)}function qy(e){return rn(0,e)}function zo(e,t){return new _g({check:"multiple_of",...qe(t),value:e})}function Os(e,t){return new xg({check:"max_size",...qe(t),maximum:e})}function jo(e,t){return new kg({check:"min_size",...qe(t),minimum:e})}function ul(e,t){return new Mg({check:"size_equals",...qe(t),size:e})}function Ns(e,t){return new Eg({check:"max_length",...qe(t),maximum:e})}function Vi(e,t){return new Ig({check:"min_length",...qe(t),minimum:e})}function Ds(e,t){return new Tg({check:"length_equals",...qe(t),length:e})}function ll(e,t){return new $g({check:"string_format",format:"regex",...qe(t),pattern:e})}function cl(e){return new Pg({check:"string_format",format:"lowercase",...qe(e)})}function dl(e){return new Ag({check:"string_format",format:"uppercase",...qe(e)})}function fl(e,t){return new Rg({check:"string_format",format:"includes",...qe(t),includes:e})}function hl(e,t){return new Cg({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function pl(e,t){return new Og({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function Fy(e,t,r){return new Ng({check:"property",property:e,schema:t,...qe(r)})}function ml(e,t){return new Dg({check:"mime_type",mime:e,...qe(t)})}function gi(e){return new zg({check:"overwrite",tx:e})}function gl(e){return gi((t)=>t.normalize(e))}function yl(){return gi((e)=>e.trim())}function vl(){return gi((e)=>e.toLowerCase())}function bl(){return gi((e)=>e.toUpperCase())}function _l(e,t,r){return new e({type:"array",element:t,...qe(r)})}function $5(e,t,r){return new e({type:"union",options:t,...qe(r)})}function P5(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...qe(i)})}function A5(e,t,r){return new e({type:"intersection",left:t,right:r})}function By(e,t,r,i){let n=r instanceof at;return new e({type:"tuple",items:t,rest:n?r:null,...qe(n?i:r)})}function R5(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...qe(i)})}function C5(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...qe(i)})}function O5(e,t,r){return new e({type:"set",valueType:t,...qe(r)})}function N5(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new e({type:"enum",entries:i,...qe(r)})}function D5(e,t,r){return new e({type:"enum",entries:t,...qe(r)})}function z5(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...qe(r)})}function sh(e,t){return new e({type:"file",...qe(t)})}function j5(e,t){return new e({type:"transform",transform:t})}function U5(e,t){return new e({type:"optional",innerType:t})}function L5(e,t){return new e({type:"nullable",innerType:t})}function q5(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():r}})}function F5(e,t,r){return new e({type:"nonoptional",innerType:t,...qe(r)})}function B5(e,t){return new e({type:"success",innerType:t})}function H5(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function Z5(e,t,r){return new e({type:"pipe",in:t,out:r})}function K5(e,t){return new e({type:"readonly",innerType:t})}function V5(e,t,r){return new e({type:"template_literal",parts:t,...qe(r)})}function W5(e,t){return new e({type:"lazy",getter:t})}function G5(e,t){return new e({type:"promise",innerType:t})}function ah(e,t,r){let i=qe(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function uh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...qe(r)})}function lh(e,t){let r=qe(t),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")i=i.map((M)=>typeof M==="string"?M.toLowerCase():M),n=n.map((M)=>typeof M==="string"?M.toLowerCase():M);let o=new Set(i),s=new Set(n),h=e.Pipe??As,b=e.Boolean??Ts,v=e.String??Zi,g=new(e.Transform??Ps)({type:"transform",transform:(M,I)=>{let T=M;if(r.case!=="sensitive")T=T.toLowerCase();if(o.has(T))return!0;else if(s.has(T))return!1;else return I.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:I.value,inst:g}),{}},error:r.error}),S=new h({type:"pipe",in:new v({type:"string",error:r.error}),out:g,error:r.error});return new h({type:"pipe",in:S,out:new b({type:"boolean",error:r.error}),error:r.error})}function ch(e,t,r,i={}){let n=qe(i),o={...qe(i),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(h)=>r.test(h),...n};if(r instanceof RegExp)o.pattern=r;return new e(o)}class Hy{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=(...r)=>{let i=this._def.input?Ro(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=e(...i);return this._def.output?Ro(this._def.output,n,void 0,{callee:t}):n};return t}implementAsync(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=async(...r)=>{let i=this._def.input?await Co(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(i))throw Error("Invalid arguments schema: not an array or tuple schema.");let n=await e(...i);return this._def.output?Co(this._def.output,n,void 0,{callee:t}):n};return t}input(...e){let t=this.constructor;if(Array.isArray(e[0]))return new t({type:"function",input:new Ki({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output});return new t({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function dh(e){return new Hy({type:"function",input:Array.isArray(e?.input)?By(Ki,e?.input):e?.input??_l($s,Do(No)),output:e?.output??Do(No)})}class fh{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??tn,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let i=e._zod.def,n={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(e);if(o){if(o.count++,t.schemaPath.includes(e))o.cycle=t.path;return o.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let h=e._zod.toJSONSchema?.();if(h)s.schema=h;else{let _={...t,schemaPath:[...t.schemaPath,e],path:t.path},g=e._zod.parent;if(g)s.ref=g,this.process(g,_),this.seen.get(g).isParent=!0;else{let S=s.schema;switch(i.type){case"string":{let x=S;x.type="string";let{minimum:M,maximum:I,format:T,patterns:$,contentEncoding:P}=e._zod.bag;if(typeof M==="number")x.minLength=M;if(typeof I==="number")x.maxLength=I;if(T){if(x.format=n[T]??T,x.format==="")delete x.format}if(P)x.contentEncoding=P;if($&&$.size>0){let R=[...$];if(R.length===1)x.pattern=R[0].source;else if(R.length>1)s.schema.allOf=[...R.map((C)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:C.source}))]}break}case"number":{let x=S,{minimum:M,maximum:I,format:T,multipleOf:$,exclusiveMaximum:P,exclusiveMinimum:R}=e._zod.bag;if(typeof T==="string"&&T.includes("int"))x.type="integer";else x.type="number";if(typeof R==="number")x.exclusiveMinimum=R;if(typeof M==="number"){if(x.minimum=M,typeof R==="number")if(R>=M)delete x.minimum;else delete x.exclusiveMinimum}if(typeof P==="number")x.exclusiveMaximum=P;if(typeof I==="number"){if(x.maximum=I,typeof P==="number")if(P<=I)delete x.maximum;else delete x.exclusiveMaximum}if(typeof $==="number")x.multipleOf=$;break}case"boolean":{let x=S;x.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{S.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{S.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let x=S,{minimum:M,maximum:I}=e._zod.bag;if(typeof M==="number")x.minItems=M;if(typeof I==="number")x.maxItems=I;x.type="array",x.items=this.process(i.element,{..._,path:[..._.path,"items"]});break}case"object":{let x=S;x.type="object",x.properties={};let M=i.shape;for(let $ in M)x.properties[$]=this.process(M[$],{..._,path:[..._.path,"properties",$]});let I=new Set(Object.keys(M)),T=new Set([...I].filter(($)=>{let P=i.shape[$]._zod;if(this.io==="input")return P.optin===void 0;else return P.optout===void 0}));if(T.size>0)x.required=Array.from(T);if(i.catchall?._zod.def.type==="never")x.additionalProperties=!1;else if(!i.catchall){if(this.io==="output")x.additionalProperties=!1}else if(i.catchall)x.additionalProperties=this.process(i.catchall,{..._,path:[..._.path,"additionalProperties"]});break}case"union":{let x=S;x.anyOf=i.options.map((M,I)=>this.process(M,{..._,path:[..._.path,"anyOf",I]}));break}case"intersection":{let x=S,M=this.process(i.left,{..._,path:[..._.path,"allOf",0]}),I=this.process(i.right,{..._,path:[..._.path,"allOf",1]}),T=(P)=>("allOf"in P)&&Object.keys(P).length===1,$=[...T(M)?M.allOf:[M],...T(I)?I.allOf:[I]];x.allOf=$;break}case"tuple":{let x=S;x.type="array";let M=i.items.map(($,P)=>this.process($,{..._,path:[..._.path,"prefixItems",P]}));if(this.target==="draft-2020-12")x.prefixItems=M;else x.items=M;if(i.rest){let $=this.process(i.rest,{..._,path:[..._.path,"items"]});if(this.target==="draft-2020-12")x.items=$;else x.additionalItems=$}if(i.rest)x.items=this.process(i.rest,{..._,path:[..._.path,"items"]});let{minimum:I,maximum:T}=e._zod.bag;if(typeof I==="number")x.minItems=I;if(typeof T==="number")x.maxItems=T;break}case"record":{let x=S;x.type="object",x.propertyNames=this.process(i.keyType,{..._,path:[..._.path,"propertyNames"]}),x.additionalProperties=this.process(i.valueType,{..._,path:[..._.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let x=S,M=Iu(i.entries);if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";x.enum=M;break}case"literal":{let x=S,M=[];for(let I of i.values)if(I===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof I==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else M.push(Number(I));else M.push(I);if(M.length===0);else if(M.length===1){let I=M[0];x.type=I===null?"null":typeof I,x.const=I}else{if(M.every((I)=>typeof I==="number"))x.type="number";if(M.every((I)=>typeof I==="string"))x.type="string";if(M.every((I)=>typeof I==="boolean"))x.type="string";if(M.every((I)=>I===null))x.type="null";x.enum=M}break}case"file":{let x=S,M={type:"string",format:"binary",contentEncoding:"binary"},{minimum:I,maximum:T,mime:$}=e._zod.bag;if(I!==void 0)M.minLength=I;if(T!==void 0)M.maxLength=T;if($)if($.length===1)M.contentMediaType=$[0],Object.assign(x,M);else x.anyOf=$.map((P)=>({...M,contentMediaType:P}));else Object.assign(x,M);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let x=this.process(i.innerType,_);S.anyOf=[x,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"success":{let x=S;x.type="boolean";break}case"default":{this.process(i.innerType,_),s.ref=i.innerType,S.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{if(this.process(i.innerType,_),s.ref=i.innerType,this.io==="input")S._prefault=JSON.parse(JSON.stringify(i.defaultValue));break}case"catch":{this.process(i.innerType,_),s.ref=i.innerType;let x;try{x=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}S.default=x;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let x=S,M=e._zod.pattern;if(!M)throw Error("Pattern not found in template literal");x.type="string",x.pattern=M.source;break}case"pipe":{let x=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(x,_),s.ref=x;break}case"readonly":{this.process(i.innerType,_),s.ref=i.innerType,S.readOnly=!0;break}case"promise":{this.process(i.innerType,_),s.ref=i.innerType;break}case"optional":{this.process(i.innerType,_),s.ref=i.innerType;break}case"lazy":{let x=e._zod.innerType;this.process(x,_),s.ref=x;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let b=this.metadataRegistry.get(e);if(b)Object.assign(s.schema,b);if(this.io==="input"&&wr(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(r=s.schema).default??(r.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},i=this.seen.get(e);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(v)=>{let _=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let M=r.external.registry.get(v[0])?.id;if(M)return{ref:r.external.uri(M)};let I=v[1].defId??v[1].schema.id??`schema${this.counter++}`;return v[1].defId=I,{defId:I,ref:`${r.external.uri("__shared")}#/${_}/${I}`}}if(v[1]===i)return{ref:"#"};let S=`${"#"}/${_}/`,x=v[1].schema.id??`__schema${this.counter++}`;return{defId:x,ref:S+x}},o=(v)=>{if(v[1].schema.$ref)return;let _=v[1],{ref:g,defId:S}=n(v);if(_.def={..._.schema},S)_.defId=S;let x=_.schema;for(let M in x)delete x[M];x.$ref=g};for(let v of this.seen.entries()){let _=v[1];if(e===v[0]){o(v);continue}if(r.external){let S=r.external.registry.get(v[0])?.id;if(e!==v[0]&&S){o(v);continue}}if(this.metadataRegistry.get(v[0])?.id){o(v);continue}if(_.cycle){if(r.cycles==="throw")throw Error(`Cycle detected: #/${_.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(r.cycles==="ref")o(v);continue}if(_.count>1){if(r.reused==="ref"){o(v);continue}}}let s=(v,_)=>{let g=this.seen.get(v),S=g.def??g.schema,x={...S};if(g.ref===null)return;let M=g.ref;if(g.ref=null,M){s(M,_);let I=this.seen.get(M).schema;if(I.$ref&&_.target==="draft-7")S.allOf=S.allOf??[],S.allOf.push(I);else Object.assign(S,I),Object.assign(S,x)}if(!g.isParent)this.override({zodSchema:v,jsonSchema:S,path:g.path??[]})};for(let v of[...this.seen.entries()].reverse())s(v[0],{target:this.target});let h={};if(this.target==="draft-2020-12")h.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")h.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(h,i.def);let b=r.external?.defs??{};for(let v of this.seen.entries()){let _=v[1];if(_.def&&_.defId)b[_.defId]=_.def}if(!r.external&&Object.keys(b).length>0)if(this.target==="draft-2020-12")h.$defs=b;else h.definitions=b;try{return JSON.parse(JSON.stringify(h))}catch(v){throw Error("Error converting schema to JSON.")}}}function zs(e,t){if(e instanceof Uu){let i=new fh(t),n={};for(let h of e._idmap.entries()){let[b,v]=h;i.process(v)}let o={},s={registry:e,uri:t?.uri||((h)=>h),defs:n};for(let h of e._idmap.entries()){let[b,v]=h;o[b]=i.emit(v,{...t,external:s})}if(Object.keys(n).length>0){let h=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[h]:n}}return{schemas:o}}let r=new fh(t);return r.process(e),r.emit(e,t)}function wr(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return wr(n.element,r);case"object":{for(let o in n.shape)if(wr(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(wr(o,r))return!0;return!1}case"intersection":return wr(n.left,r)||wr(n.right,r);case"tuple":{for(let o of n.items)if(wr(o,r))return!0;if(n.rest&&wr(n.rest,r))return!0;return!1}case"record":return wr(n.keyType,r)||wr(n.valueType,r);case"map":return wr(n.keyType,r)||wr(n.valueType,r);case"set":return wr(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return wr(n.innerType,r);case"lazy":return wr(n.getter(),r);case"default":return wr(n.innerType,r);case"prefault":return wr(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return wr(n.in,r)||wr(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}var s6={};var js={};vn(js,{time:()=>Vy,duration:()=>Wy,datetime:()=>Zy,date:()=>Ky,ZodISOTime:()=>mh,ZodISODuration:()=>gh,ZodISODateTime:()=>hh,ZodISODate:()=>ph});var hh=ne("ZodISODateTime",(e,t)=>{Lg.init(e,t),jt.init(e,t)});function Zy(e){return Py(hh,e)}var ph=ne("ZodISODate",(e,t)=>{qg.init(e,t),jt.init(e,t)});function Ky(e){return Ay(ph,e)}var mh=ne("ZodISOTime",(e,t)=>{Fg.init(e,t),jt.init(e,t)});function Vy(e){return Ry(mh,e)}var gh=ne("ZodISODuration",(e,t)=>{Bg.init(e,t),jt.init(e,t)});function Wy(e){return Cy(gh,e)}var u6=(e,t)=>{Cu.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>Es(e,r)},flatten:{value:(r)=>Ms(e,r)},addIssue:{value:(r)=>e.issues.push(r)},addIssues:{value:(r)=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},X5=ne("ZodError",u6),Us=ne("ZodError",u6,{Parent:Error});var Gy=Ad(Us),Jy=Rd(Us),Xy=Cd(Us),Yy=Od(Us);var yt=ne("ZodType",(e,t)=>(at.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>jr(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>Gy(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Xy(e,r,i),e.parseAsync=async(r,i)=>Jy(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Yy(e,r,i),e.spa=e.safeParseAsync,e.refine=(r,i)=>e.check(F6(r,i)),e.superRefine=(r)=>e.check(B6(r)),e.overwrite=(r)=>e.check(gi(r)),e.optional=()=>Ut(e),e.nullable=()=>vh(e),e.nullish=()=>Ut(vh(e)),e.nonoptional=(r)=>P6(e,r),e.array=()=>bt(e),e.or=(r)=>Ot([e,r]),e.and=(r)=>El(e,r),e.transform=(r)=>bh(e,Sv(r)),e.default=(r)=>I6(e,r),e.prefault=(r)=>$6(e,r),e.catch=(r)=>C6(e,r),e.pipe=(r)=>bh(e,r),e.readonly=()=>D6(e),e.describe=(r)=>{let i=e.clone();return tn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return tn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return tn.get(e);let i=e.clone();return tn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),ev=ne("_ZodString",(e,t)=>{Zi.init(e,t),yt.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(ll(...i)),e.includes=(...i)=>e.check(fl(...i)),e.startsWith=(...i)=>e.check(hl(...i)),e.endsWith=(...i)=>e.check(pl(...i)),e.min=(...i)=>e.check(Vi(...i)),e.max=(...i)=>e.check(Ns(...i)),e.length=(...i)=>e.check(Ds(...i)),e.nonempty=(...i)=>e.check(Vi(1,...i)),e.lowercase=(i)=>e.check(cl(i)),e.uppercase=(i)=>e.check(dl(i)),e.trim=()=>e.check(yl()),e.normalize=(...i)=>e.check(gl(...i)),e.toLowerCase=()=>e.check(vl()),e.toUpperCase=()=>e.check(bl())}),Sl=ne("ZodString",(e,t)=>{Zi.init(e,t),ev.init(e,t),e.email=(r)=>e.check(qu(tv,r)),e.url=(r)=>e.check(Ku(rv,r)),e.jwt=(r)=>e.check(al(yv,r)),e.emoji=(r)=>e.check(Vu(nv,r)),e.guid=(r)=>e.check(Cs(yh,r)),e.uuid=(r)=>e.check(Fu(yi,r)),e.uuidv4=(r)=>e.check(Bu(yi,r)),e.uuidv6=(r)=>e.check(Hu(yi,r)),e.uuidv7=(r)=>e.check(Zu(yi,r)),e.nanoid=(r)=>e.check(Wu(iv,r)),e.guid=(r)=>e.check(Cs(yh,r)),e.cuid=(r)=>e.check(Gu(ov,r)),e.cuid2=(r)=>e.check(Ju(sv,r)),e.ulid=(r)=>e.check(Xu(av,r)),e.base64=(r)=>e.check(il(pv,r)),e.base64url=(r)=>e.check(ol(mv,r)),e.xid=(r)=>e.check(Yu(uv,r)),e.ksuid=(r)=>e.check(Qu(lv,r)),e.ipv4=(r)=>e.check(el(cv,r)),e.ipv6=(r)=>e.check(tl(dv,r)),e.cidrv4=(r)=>e.check(rl(fv,r)),e.cidrv6=(r)=>e.check(nl(hv,r)),e.e164=(r)=>e.check(sl(gv,r)),e.datetime=(r)=>e.check(Zy(r)),e.date=(r)=>e.check(Ky(r)),e.time=(r)=>e.check(Vy(r)),e.duration=(r)=>e.check(Wy(r))});function de(e){return Lf(Sl,e)}var jt=ne("ZodStringFormat",(e,t)=>{Ct.init(e,t),ev.init(e,t)}),tv=ne("ZodEmail",(e,t)=>{Bd.init(e,t),jt.init(e,t)});function Q5(e){return qu(tv,e)}var yh=ne("ZodGUID",(e,t)=>{qd.init(e,t),jt.init(e,t)});function e7(e){return Cs(yh,e)}var yi=ne("ZodUUID",(e,t)=>{Fd.init(e,t),jt.init(e,t)});function t7(e){return Fu(yi,e)}function r7(e){return Bu(yi,e)}function n7(e){return Hu(yi,e)}function i7(e){return Zu(yi,e)}var rv=ne("ZodURL",(e,t)=>{Hd.init(e,t),jt.init(e,t)});function o7(e){return Ku(rv,e)}var nv=ne("ZodEmoji",(e,t)=>{Zd.init(e,t),jt.init(e,t)});function s7(e){return Vu(nv,e)}var iv=ne("ZodNanoID",(e,t)=>{Kd.init(e,t),jt.init(e,t)});function a7(e){return Wu(iv,e)}var ov=ne("ZodCUID",(e,t)=>{Vd.init(e,t),jt.init(e,t)});function u7(e){return Gu(ov,e)}var sv=ne("ZodCUID2",(e,t)=>{Wd.init(e,t),jt.init(e,t)});function l7(e){return Ju(sv,e)}var av=ne("ZodULID",(e,t)=>{Gd.init(e,t),jt.init(e,t)});function c7(e){return Xu(av,e)}var uv=ne("ZodXID",(e,t)=>{Jd.init(e,t),jt.init(e,t)});function d7(e){return Yu(uv,e)}var lv=ne("ZodKSUID",(e,t)=>{Xd.init(e,t),jt.init(e,t)});function f7(e){return Qu(lv,e)}var cv=ne("ZodIPv4",(e,t)=>{Yd.init(e,t),jt.init(e,t)});function h7(e){return el(cv,e)}var dv=ne("ZodIPv6",(e,t)=>{Qd.init(e,t),jt.init(e,t)});function p7(e){return tl(dv,e)}var fv=ne("ZodCIDRv4",(e,t)=>{ef.init(e,t),jt.init(e,t)});function m7(e){return rl(fv,e)}var hv=ne("ZodCIDRv6",(e,t)=>{tf.init(e,t),jt.init(e,t)});function g7(e){return nl(hv,e)}var pv=ne("ZodBase64",(e,t)=>{rf.init(e,t),jt.init(e,t)});function y7(e){return il(pv,e)}var mv=ne("ZodBase64URL",(e,t)=>{nf.init(e,t),jt.init(e,t)});function v7(e){return ol(mv,e)}var gv=ne("ZodE164",(e,t)=>{of.init(e,t),jt.init(e,t)});function b7(e){return sl(gv,e)}var yv=ne("ZodJWT",(e,t)=>{sf.init(e,t),jt.init(e,t)});function _7(e){return al(yv,e)}var l6=ne("ZodCustomStringFormat",(e,t)=>{af.init(e,t),jt.init(e,t)});function w7(e,t,r={}){return ch(l6,e,t,r)}var xl=ne("ZodNumber",(e,t)=>{Ou.init(e,t),yt.init(e,t),e.gt=(i,n)=>e.check(mi(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(pi(i,n)),e.lte=(i,n)=>e.check(Mn(i,n)),e.max=(i,n)=>e.check(Mn(i,n)),e.int=(i)=>e.check(Qy(i)),e.safe=(i)=>e.check(Qy(i)),e.positive=(i)=>e.check(mi(0,i)),e.nonnegative=(i)=>e.check(rn(0,i)),e.negative=(i)=>e.check(pi(0,i)),e.nonpositive=(i)=>e.check(Mn(0,i)),e.multipleOf=(i,n)=>e.check(zo(i,n)),e.step=(i,n)=>e.check(zo(i,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function Et(e){return Ff(xl,e)}var Ls=ne("ZodNumberFormat",(e,t)=>{uf.init(e,t),xl.init(e,t)});function Qy(e){return Bf(Ls,e)}function S7(e){return Hf(Ls,e)}function x7(e){return Zf(Ls,e)}function k7(e){return Kf(Ls,e)}function M7(e){return Vf(Ls,e)}var kl=ne("ZodBoolean",(e,t)=>{Ts.init(e,t),yt.init(e,t)});function ir(e){return Wf(kl,e)}var Ml=ne("ZodBigInt",(e,t)=>{Nu.init(e,t),yt.init(e,t),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.gt=(i,n)=>e.check(mi(i,n)),e.gte=(i,n)=>e.check(rn(i,n)),e.min=(i,n)=>e.check(rn(i,n)),e.lt=(i,n)=>e.check(pi(i,n)),e.lte=(i,n)=>e.check(Mn(i,n)),e.max=(i,n)=>e.check(Mn(i,n)),e.positive=(i)=>e.check(mi(BigInt(0),i)),e.negative=(i)=>e.check(pi(BigInt(0),i)),e.nonpositive=(i)=>e.check(Mn(BigInt(0),i)),e.nonnegative=(i)=>e.check(rn(BigInt(0),i)),e.multipleOf=(i,n)=>e.check(zo(i,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function E7(e){return Gf(Ml,e)}var vv=ne("ZodBigIntFormat",(e,t)=>{lf.init(e,t),Ml.init(e,t)});function I7(e){return Jf(vv,e)}function T7(e){return Xf(vv,e)}var c6=ne("ZodSymbol",(e,t)=>{cf.init(e,t),yt.init(e,t)});function $7(e){return Yf(c6,e)}var d6=ne("ZodUndefined",(e,t)=>{df.init(e,t),yt.init(e,t)});function P7(e){return Qf(d6,e)}var f6=ne("ZodNull",(e,t)=>{ff.init(e,t),yt.init(e,t)});function _h(e){return eh(f6,e)}var h6=ne("ZodAny",(e,t)=>{hf.init(e,t),yt.init(e,t)});function A7(){return th(h6)}var p6=ne("ZodUnknown",(e,t)=>{No.init(e,t),yt.init(e,t)});function qt(){return Do(p6)}var m6=ne("ZodNever",(e,t)=>{pf.init(e,t),yt.init(e,t)});function wh(e){return rh(m6,e)}var g6=ne("ZodVoid",(e,t)=>{mf.init(e,t),yt.init(e,t)});function R7(e){return nh(g6,e)}var Sh=ne("ZodDate",(e,t)=>{gf.init(e,t),yt.init(e,t),e.min=(i,n)=>e.check(rn(i,n)),e.max=(i,n)=>e.check(Mn(i,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function C7(e){return ih(Sh,e)}var y6=ne("ZodArray",(e,t)=>{$s.init(e,t),yt.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Vi(r,i)),e.nonempty=(r)=>e.check(Vi(1,r)),e.max=(r,i)=>e.check(Ns(r,i)),e.length=(r,i)=>e.check(Ds(r,i)),e.unwrap=()=>e.element});function bt(e,t){return _l(y6,e,t)}function O7(e){let t=e._zod.def.shape;return et(Object.keys(t))}var xh=ne("ZodObject",(e,t)=>{Du.init(e,t),yt.init(e,t),Fe.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Zr(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qt()}),e.loose=()=>e.clone({...e._zod.def,catchall:qt()}),e.strict=()=>e.clone({...e._zod.def,catchall:wh()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>Fe.extend(e,r),e.merge=(r)=>Fe.merge(e,r),e.pick=(r)=>Fe.pick(e,r),e.omit=(r)=>Fe.omit(e,r),e.partial=(...r)=>Fe.partial(xv,e,r[0]),e.required=(...r)=>Fe.required(kv,e,r[0])});function Ye(e,t){let r={type:"object",get shape(){return Fe.assignProp(this,"shape",{...e}),this.shape},...Fe.normalizeParams(t)};return new xh(r)}function N7(e,t){return new xh({type:"object",get shape(){return Fe.assignProp(this,"shape",{...e}),this.shape},catchall:wh(),...Fe.normalizeParams(t)})}function Ur(e,t){return new xh({type:"object",get shape(){return Fe.assignProp(this,"shape",{...e}),this.shape},catchall:qt(),...Fe.normalizeParams(t)})}var bv=ne("ZodUnion",(e,t)=>{zu.init(e,t),yt.init(e,t),e.options=t.options});function Ot(e,t){return new bv({type:"union",options:e,...Fe.normalizeParams(t)})}var v6=ne("ZodDiscriminatedUnion",(e,t)=>{bv.init(e,t),yf.init(e,t)});function kh(e,t,r){return new v6({type:"union",options:t,discriminator:e,...Fe.normalizeParams(r)})}var b6=ne("ZodIntersection",(e,t)=>{vf.init(e,t),yt.init(e,t)});function El(e,t){return new b6({type:"intersection",left:e,right:t})}var _6=ne("ZodTuple",(e,t)=>{Ki.init(e,t),yt.init(e,t),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function D7(e,t,r){let i=t instanceof at,n=i?r:t;return new _6({type:"tuple",items:e,rest:i?t:null,...Fe.normalizeParams(n)})}var _v=ne("ZodRecord",(e,t)=>{bf.init(e,t),yt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Nt(e,t,r){return new _v({type:"record",keyType:e,valueType:t,...Fe.normalizeParams(r)})}function z7(e,t,r){return new _v({type:"record",keyType:Ot([e,wh()]),valueType:t,...Fe.normalizeParams(r)})}var w6=ne("ZodMap",(e,t)=>{_f.init(e,t),yt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function j7(e,t,r){return new w6({type:"map",keyType:e,valueType:t,...Fe.normalizeParams(r)})}var S6=ne("ZodSet",(e,t)=>{wf.init(e,t),yt.init(e,t),e.min=(...r)=>e.check(jo(...r)),e.nonempty=(r)=>e.check(jo(1,r)),e.max=(...r)=>e.check(Os(...r)),e.size=(...r)=>e.check(ul(...r))});function U7(e,t){return new S6({type:"set",valueType:e,...Fe.normalizeParams(t)})}var wl=ne("ZodEnum",(e,t)=>{Sf.init(e,t),yt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new wl({...t,checks:[],...Fe.normalizeParams(n),entries:o})},e.exclude=(i,n)=>{let o={...t.entries};for(let s of i)if(r.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new wl({...t,checks:[],...Fe.normalizeParams(n),entries:o})}});function Zr(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((i)=>[i,i])):e;return new wl({type:"enum",entries:r,...Fe.normalizeParams(t)})}function L7(e,t){return new wl({type:"enum",entries:e,...Fe.normalizeParams(t)})}var x6=ne("ZodLiteral",(e,t)=>{xf.init(e,t),yt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function et(e,t){return new x6({type:"literal",values:Array.isArray(e)?e:[e],...Fe.normalizeParams(t)})}var k6=ne("ZodFile",(e,t)=>{kf.init(e,t),yt.init(e,t),e.min=(r,i)=>e.check(jo(r,i)),e.max=(r,i)=>e.check(Os(r,i)),e.mime=(r,i)=>e.check(ml(Array.isArray(r)?r:[r],i))});function q7(e){return sh(k6,e)}var wv=ne("ZodTransform",(e,t)=>{Ps.init(e,t),yt.init(e,t),e._zod.parse=(r,i)=>{r.addIssue=(o)=>{if(typeof o==="string")r.issues.push(Fe.issue(o,r.value,t));else{let s=o;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(Fe.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((o)=>(r.value=o,r));return r.value=n,r}});function Sv(e){return new wv({type:"transform",transform:e})}var xv=ne("ZodOptional",(e,t)=>{Mf.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ut(e){return new xv({type:"optional",innerType:e})}var M6=ne("ZodNullable",(e,t)=>{Ef.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vh(e){return new M6({type:"nullable",innerType:e})}function F7(e){return Ut(vh(e))}var E6=ne("ZodDefault",(e,t)=>{If.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function I6(e,t){return new E6({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var T6=ne("ZodPrefault",(e,t)=>{Tf.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function $6(e,t){return new T6({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var kv=ne("ZodNonOptional",(e,t)=>{$f.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function P6(e,t){return new kv({type:"nonoptional",innerType:e,...Fe.normalizeParams(t)})}var A6=ne("ZodSuccess",(e,t)=>{Pf.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function B7(e){return new A6({type:"success",innerType:e})}var R6=ne("ZodCatch",(e,t)=>{Af.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function C6(e,t){return new R6({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var O6=ne("ZodNaN",(e,t)=>{Rf.init(e,t),yt.init(e,t)});function H7(e){return oh(O6,e)}var Mv=ne("ZodPipe",(e,t)=>{As.init(e,t),yt.init(e,t),e.in=t.in,e.out=t.out});function bh(e,t){return new Mv({type:"pipe",in:e,out:t})}var N6=ne("ZodReadonly",(e,t)=>{Cf.init(e,t),yt.init(e,t)});function D6(e){return new N6({type:"readonly",innerType:e})}var z6=ne("ZodTemplateLiteral",(e,t)=>{Of.init(e,t),yt.init(e,t)});function Z7(e,t){return new z6({type:"template_literal",parts:e,...Fe.normalizeParams(t)})}var j6=ne("ZodLazy",(e,t)=>{Df.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.getter()});function U6(e){return new j6({type:"lazy",getter:e})}var L6=ne("ZodPromise",(e,t)=>{Nf.init(e,t),yt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function K7(e){return new L6({type:"promise",innerType:e})}var Mh=ne("ZodCustom",(e,t)=>{zf.init(e,t),yt.init(e,t)});function q6(e,t){let r=new Zt({check:"custom",...Fe.normalizeParams(t)});return r._zod.check=e,r}function Ev(e,t){return ah(Mh,e??(()=>!0),t)}function F6(e,t={}){return uh(Mh,e,t)}function B6(e,t){let r=q6((i)=>(i.addIssue=(n)=>{if(typeof n==="string")i.issues.push(Fe.issue(n,i.value,r._zod.def));else{let o=n;if(o.fatal)o.continue=!1;o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Fe.issue(o))}},e(i.value,i)),t);return r}function V7(e,t={error:`Input not instance of ${e.name}`}){let r=new Mh({type:"custom",check:"custom",fn:(i)=>i instanceof e,abort:!0,...Fe.normalizeParams(t)});return r._zod.bag.Class=e,r}var W7=(...e)=>lh({Pipe:Mv,Boolean:kl,String:Sl,Transform:wv},...e);function G7(e){let t=U6(()=>Ot([de(e),Et(),ir(),_h(),bt(t),Nt(de(),t)]));return t}function Eh(e,t){return bh(Sv(e),t)}var J7={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function X7(e){rr({customError:e})}function Y7(){return rr().customError}var Iv={};vn(Iv,{string:()=>Q7,number:()=>eC,date:()=>nC,boolean:()=>tC,bigint:()=>rC});function Q7(e){return $y(Sl,e)}function eC(e){return Oy(xl,e)}function tC(e){return Ny(kl,e)}function rC(e){return Dy(Ml,e)}function nC(e){return zy(Sh,e)}rr(ju());var _t;(function(e){e.assertEqual=(n)=>{};function t(n){}e.assertIs=t;function r(n){throw Error()}e.assertNever=r,e.arrayToEnum=(n)=>{let o={};for(let s of n)o[s]=s;return o},e.getValidEnumValues=(n)=>{let o=e.objectKeys(n).filter((h)=>typeof n[n[h]]!=="number"),s={};for(let h of o)s[h]=n[h];return e.objectValues(s)},e.objectValues=(n)=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys==="function"?(n)=>Object.keys(n):(n)=>{let o=[];for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s))o.push(s);return o},e.find=(n,o)=>{for(let s of n)if(o(s))return s;return},e.isInteger=typeof Number.isInteger==="function"?(n)=>Number.isInteger(n):(n)=>typeof n==="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,o=" | "){return n.map((s)=>typeof s==="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(n,o)=>{if(typeof o==="bigint")return o.toString();return o}})(_t||(_t={}));var H6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(H6||(H6={}));var He=_t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vi=(e)=>{switch(typeof e){case"undefined":return He.undefined;case"string":return He.string;case"number":return Number.isNaN(e)?He.nan:He.number;case"boolean":return He.boolean;case"function":return He.function;case"bigint":return He.bigint;case"symbol":return He.symbol;case"object":if(Array.isArray(e))return He.array;if(e===null)return He.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return He.promise;if(typeof Map<"u"&&e instanceof Map)return He.map;if(typeof Set<"u"&&e instanceof Set)return He.set;if(typeof Date<"u"&&e instanceof Date)return He.date;return He.object;default:return He.unknown}};var Ue=_t.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class gn extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},r={_errors:[]},i=(n)=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let s=r,h=0;while(h<o.path.length){let b=o.path[h];if(h!==o.path.length-1)s[b]=s[b]||{_errors:[]};else s[b]=s[b]||{_errors:[]},s[b]._errors.push(t(o));s=s[b],h++}}};return i(this),r}static assert(e){if(!(e instanceof gn))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_t.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}gn.create=(e)=>new gn(e);var iC=(e,t)=>{let r;switch(e.code){case Ue.invalid_type:if(e.received===He.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case Ue.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,_t.jsonStringifyReplacer)}`;break;case Ue.unrecognized_keys:r=`Unrecognized key(s) in object: ${_t.joinValues(e.keys,", ")}`;break;case Ue.invalid_union:r="Invalid input";break;case Ue.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_t.joinValues(e.options)}`;break;case Ue.invalid_enum_value:r=`Invalid enum value. Expected ${_t.joinValues(e.options)}, received '${e.received}'`;break;case Ue.invalid_arguments:r="Invalid function arguments";break;case Ue.invalid_return_type:r="Invalid function return type";break;case Ue.invalid_date:r="Invalid date";break;case Ue.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else _t.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case Ue.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case Ue.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case Ue.custom:r="Invalid input";break;case Ue.invalid_intersection_types:r="Intersection results could not be merged";break;case Ue.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ue.not_finite:r="Number must be finite";break;default:r=t.defaultError,_t.assertNever(e)}return{message:r}},Wi=iC;var oC=Wi;function Il(){return oC}var Ih=(e)=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,o=[...r,...n.path||[]],s={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let h="",b=i.filter((v)=>!!v).slice().reverse();for(let v of b)h=v(s,{data:t,defaultError:h}).message;return{...n,path:o,message:h}};function Ge(e,t){let r=Il(),i=Ih({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Wi?void 0:Wi].filter((n)=>!!n)});e.common.issues.push(i)}class Lr{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let i of t){if(i.status==="aborted")return it;if(i.status==="dirty")e.dirty();r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let i of t){let n=await i.key,o=await i.value;r.push({key:n,value:o})}return Lr.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let i of t){let{key:n,value:o}=i;if(n.status==="aborted")return it;if(o.status==="aborted")return it;if(n.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet))r[n.value]=o.value}return{status:e.value,value:r}}}var it=Object.freeze({status:"aborted"}),qs=(e)=>({status:"dirty",value:e}),Kr=(e)=>({status:"valid",value:e}),$v=(e)=>e.status==="aborted",Pv=(e)=>e.status==="dirty",Uo=(e)=>e.status==="valid",Tl=(e)=>typeof Promise<"u"&&e instanceof Promise;var Qe;(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Qe||(Qe={}));class zn{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var Z6=(e,t)=>{if(Uo(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new gn(e.common.issues);return this._error=r,this._error}}}};function ft(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:n};return{errorMap:(s,h)=>{let{message:b}=e;if(s.code==="invalid_enum_value")return{message:b??h.defaultError};if(typeof h.data>"u")return{message:b??i??h.defaultError};if(s.code!=="invalid_type")return{message:h.defaultError};return{message:b??r??h.defaultError}},description:n}}class vt{get description(){return this._def.description}_getType(e){return vi(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Lr,ctx:{common:e.parent.common,data:e.data,parsedType:vi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Tl(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Z6(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return Uo(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>Uo(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:vi(e)},i=this._parse({data:e,path:r.path,parent:r}),n=await(Tl(i)?i:Promise.resolve(i));return Z6(r,n)}refine(e,t){let r=(i)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(i);else return t};return this._refinement((i,n)=>{let o=e(i),s=()=>n.addIssue({code:Ue.custom,...r(i)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((h)=>{if(!h)return s(),!1;else return!0});if(!o)return s(),!1;else return!0})}refinement(e,t){return this._refinement((r,i)=>{if(!e(r))return i.addIssue(typeof t==="function"?t(r,i):t),!1;else return!0})}_refinement(e){return new Qn({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return En.create(this,this._def)}nullable(){return Gi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yn.create(this)}promise(){return Ks.create(this,this._def)}or(e){return Cl.create([this,e],this._def)}and(e){return Ol.create(this,e,this._def)}transform(e){return new Qn({...ft(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new jl({...ft(this._def),innerType:this,defaultValue:t,typeName:Le.ZodDefault})}brand(){return new Ov({typeName:Le.ZodBranded,type:this,...ft(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Ul({...ft(this._def),innerType:this,catchValue:t,typeName:Le.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Nh.create(this,e)}readonly(){return Ll.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var sC=/^c[^\s-]{8,}$/i,aC=/^[0-9a-z]+$/,uC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cC=/^[a-z0-9_-]{21}$/i,dC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Av,mC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_C=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,K6="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wC=new RegExp(`^${K6}$`);function V6(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function SC(e){return new RegExp(`^${V6(e)}$`)}function xC(e){let t=`${K6}T${V6(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function kC(e,t){if((t==="v4"||!t)&&mC.test(e))return!0;if((t==="v6"||!t)&&yC.test(e))return!0;return!1}function MC(e,t){if(!dC.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));if(typeof n!=="object"||n===null)return!1;if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&n.alg!==t)return!1;return!0}catch{return!1}}function EC(e,t){if((t==="v4"||!t)&&gC.test(e))return!0;if((t==="v6"||!t)&&vC.test(e))return!0;return!1}class _i extends vt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==He.string){let n=this._getOrReturnCtx(e);return Ge(n,{code:Ue.invalid_type,expected:He.string,received:n.parsedType}),it}let r=new Lr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.length<n.value)i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="max"){if(e.data.length>n.value)i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="length"){let o=e.data.length>n.value,s=e.data.length<n.value;if(o||s){if(i=this._getOrReturnCtx(e,i),o)Ge(i,{code:Ue.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});else if(s)Ge(i,{code:Ue.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});r.dirty()}}else if(n.kind==="email"){if(!hC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"email",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="emoji"){if(!Av)Av=new RegExp(pC,"u");if(!Av.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"emoji",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="uuid"){if(!lC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"uuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="nanoid"){if(!cC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"nanoid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid"){if(!sC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"cuid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid2"){if(!aC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"cuid2",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ulid"){if(!uC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"ulid",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ge(i,{validation:"url",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="regex"){if(n.regex.lastIndex=0,!n.regex.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"regex",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="trim")e.data=e.data.trim();else if(n.kind==="includes"){if(!e.data.includes(n.value,n.position))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()}else if(n.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(n.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(n.kind==="startsWith"){if(!e.data.startsWith(n.value))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="endsWith"){if(!e.data.endsWith(n.value))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="datetime"){if(!xC(n).test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:"datetime",message:n.message}),r.dirty()}else if(n.kind==="date"){if(!wC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:"date",message:n.message}),r.dirty()}else if(n.kind==="time"){if(!SC(n).test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.invalid_string,validation:"time",message:n.message}),r.dirty()}else if(n.kind==="duration"){if(!fC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"duration",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ip"){if(!kC(e.data,n.version))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"ip",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="jwt"){if(!MC(e.data,n.alg))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"jwt",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cidr"){if(!EC(e.data,n.version))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"cidr",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64"){if(!bC.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"base64",code:Ue.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64url"){if(!_C.test(e.data))i=this._getOrReturnCtx(e,i),Ge(i,{validation:"base64url",code:Ue.invalid_string,message:n.message}),r.dirty()}else _t.assertNever(n);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((i)=>e.test(i),{validation:t,code:Ue.invalid_string,...Qe.errToObj(r)})}_addCheck(e){return new _i({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Qe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Qe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Qe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Qe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Qe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Qe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Qe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Qe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Qe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Qe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Qe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Qe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Qe.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Qe.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Qe.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Qe.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Qe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Qe.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Qe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Qe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Qe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Qe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Qe.errToObj(t)})}nonempty(e){return this.min(1,Qe.errToObj(e))}trim(){return new _i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}_i.create=(e)=>new _i({checks:[],typeName:Le.ZodString,coerce:e?.coerce??!1,...ft(e)});function IC(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i,o=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return o%s/10**n}class Bs extends vt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==He.number){let n=this._getOrReturnCtx(e);return Ge(n,{code:Ue.invalid_type,expected:He.number,received:n.parsedType}),it}let r=void 0,i=new Lr;for(let n of this._def.checks)if(n.kind==="int"){if(!_t.isInteger(e.data))r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()}else if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(IC(e.data,n.value)!==0)r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else if(n.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.not_finite,message:n.message}),i.dirty()}else _t.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Qe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Qe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Qe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Qe.toString(t))}setLimit(e,t,r,i){return new Bs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Qe.toString(i)}]})}_addCheck(e){return new Bs({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Qe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Qe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Qe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qe.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&_t.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}}Bs.create=(e)=>new Bs({checks:[],typeName:Le.ZodNumber,coerce:e?.coerce||!1,...ft(e)});class Hs extends vt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==He.bigint)return this._getInvalidInput(e);let r=void 0,i=new Lr;for(let n of this._def.checks)if(n.kind==="min"){if(n.inclusive?e.data<n.value:e.data<=n.value)r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?e.data>n.value:e.data>=n.value)r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(e.data%n.value!==BigInt(0))r=this._getOrReturnCtx(e,r),Ge(r,{code:Ue.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else _t.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Ge(t,{code:Ue.invalid_type,expected:He.bigint,received:t.parsedType}),it}gte(e,t){return this.setLimit("min",e,!0,Qe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Qe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Qe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Qe.toString(t))}setLimit(e,t,r,i){return new Hs({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Qe.toString(i)}]})}_addCheck(e){return new Hs({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Qe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Qe.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}}Hs.create=(e)=>new Hs({checks:[],typeName:Le.ZodBigInt,coerce:e?.coerce??!1,...ft(e)});class Th extends vt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==He.boolean){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.boolean,received:r.parsedType}),it}return Kr(e.data)}}Th.create=(e)=>new Th({typeName:Le.ZodBoolean,coerce:e?.coerce||!1,...ft(e)});class Pl extends vt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==He.date){let n=this._getOrReturnCtx(e);return Ge(n,{code:Ue.invalid_type,expected:He.date,received:n.parsedType}),it}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return Ge(n,{code:Ue.invalid_date}),it}let r=new Lr,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(e.data.getTime()<n.value)i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()}else if(n.kind==="max"){if(e.data.getTime()>n.value)i=this._getOrReturnCtx(e,i),Ge(i,{code:Ue.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()}else _t.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Pl({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Qe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Qe.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}}Pl.create=(e)=>new Pl({checks:[],coerce:e?.coerce||!1,typeName:Le.ZodDate,...ft(e)});class $h extends vt{_parse(e){if(this._getType(e)!==He.symbol){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.symbol,received:r.parsedType}),it}return Kr(e.data)}}$h.create=(e)=>new $h({typeName:Le.ZodSymbol,...ft(e)});class Al extends vt{_parse(e){if(this._getType(e)!==He.undefined){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.undefined,received:r.parsedType}),it}return Kr(e.data)}}Al.create=(e)=>new Al({typeName:Le.ZodUndefined,...ft(e)});class Rl extends vt{_parse(e){if(this._getType(e)!==He.null){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.null,received:r.parsedType}),it}return Kr(e.data)}}Rl.create=(e)=>new Rl({typeName:Le.ZodNull,...ft(e)});class Ph extends vt{constructor(){super(...arguments);this._any=!0}_parse(e){return Kr(e.data)}}Ph.create=(e)=>new Ph({typeName:Le.ZodAny,...ft(e)});class Lo extends vt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Kr(e.data)}}Lo.create=(e)=>new Lo({typeName:Le.ZodUnknown,...ft(e)});class wi extends vt{_parse(e){let t=this._getOrReturnCtx(e);return Ge(t,{code:Ue.invalid_type,expected:He.never,received:t.parsedType}),it}}wi.create=(e)=>new wi({typeName:Le.ZodNever,...ft(e)});class Ah extends vt{_parse(e){if(this._getType(e)!==He.undefined){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.void,received:r.parsedType}),it}return Kr(e.data)}}Ah.create=(e)=>new Ah({typeName:Le.ZodVoid,...ft(e)});class Yn extends vt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==He.array)return Ge(t,{code:Ue.invalid_type,expected:He.array,received:t.parsedType}),it;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,s=t.data.length<i.exactLength.value;if(o||s)Ge(t,{code:o?Ue.too_big:Ue.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty()}if(i.minLength!==null){if(t.data.length<i.minLength.value)Ge(t,{code:Ue.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()}if(i.maxLength!==null){if(t.data.length>i.maxLength.value)Ge(t,{code:Ue.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new zn(t,o,t.path,s)))).then((o)=>Lr.mergeArray(r,o));let n=[...t.data].map((o,s)=>i.type._parseSync(new zn(t,o,t.path,s)));return Lr.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new Yn({...this._def,minLength:{value:e,message:Qe.toString(t)}})}max(e,t){return new Yn({...this._def,maxLength:{value:e,message:Qe.toString(t)}})}length(e,t){return new Yn({...this._def,exactLength:{value:e,message:Qe.toString(t)}})}nonempty(e){return this.min(1,e)}}Yn.create=(e,t)=>new Yn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...ft(t)});function Fs(e){if(e instanceof Qt){let t={};for(let r in e.shape){let i=e.shape[r];t[r]=En.create(Fs(i))}return new Qt({...e._def,shape:()=>t})}else if(e instanceof Yn)return new Yn({...e._def,type:Fs(e.element)});else if(e instanceof En)return En.create(Fs(e.unwrap()));else if(e instanceof Gi)return Gi.create(Fs(e.unwrap()));else if(e instanceof Si)return Si.create(e.items.map((t)=>Fs(t)));else return e}class Qt extends vt{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_t.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==He.object){let b=this._getOrReturnCtx(e);return Ge(b,{code:Ue.invalid_type,expected:He.object,received:b.parsedType}),it}let{status:r,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof wi&&this._def.unknownKeys==="strip")){for(let b in i.data)if(!o.includes(b))s.push(b)}let h=[];for(let b of o){let v=n[b],_=i.data[b];h.push({key:{status:"valid",value:b},value:v._parse(new zn(i,_,i.path,b)),alwaysSet:b in i.data})}if(this._def.catchall instanceof wi){let b=this._def.unknownKeys;if(b==="passthrough")for(let v of s)h.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(b==="strict"){if(s.length>0)Ge(i,{code:Ue.unrecognized_keys,keys:s}),r.dirty()}else if(b==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let b=this._def.catchall;for(let v of s){let _=i.data[v];h.push({key:{status:"valid",value:v},value:b._parse(new zn(i,_,i.path,v)),alwaysSet:v in i.data})}}if(i.common.async)return Promise.resolve().then(async()=>{let b=[];for(let v of h){let _=await v.key,g=await v.value;b.push({key:_,value:g,alwaysSet:v.alwaysSet})}return b}).then((b)=>Lr.mergeObjectSync(r,b));else return Lr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return Qe.errToObj,new Qt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let i=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:Qe.errToObj(e).message??i};return{message:i}}}:{}})}strip(){return new Qt({...this._def,unknownKeys:"strip"})}passthrough(){return new Qt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Le.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qt({...this._def,catchall:e})}pick(e){let t={};for(let r of _t.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Qt({...this._def,shape:()=>t})}omit(e){let t={};for(let r of _t.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Qt({...this._def,shape:()=>t})}deepPartial(){return Fs(this)}partial(e){let t={};for(let r of _t.objectKeys(this.shape)){let i=this.shape[r];if(e&&!e[r])t[r]=i;else t[r]=i.optional()}return new Qt({...this._def,shape:()=>t})}required(e){let t={};for(let r of _t.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];while(n instanceof En)n=n._def.innerType;t[r]=n}return new Qt({...this._def,shape:()=>t})}keyof(){return W6(_t.objectKeys(this.shape))}}Qt.create=(e,t)=>new Qt({shape:()=>e,unknownKeys:"strip",catchall:wi.create(),typeName:Le.ZodObject,...ft(t)});Qt.strictCreate=(e,t)=>new Qt({shape:()=>e,unknownKeys:"strict",catchall:wi.create(),typeName:Le.ZodObject,...ft(t)});Qt.lazycreate=(e,t)=>new Qt({shape:e,unknownKeys:"strip",catchall:wi.create(),typeName:Le.ZodObject,...ft(t)});class Cl extends vt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function i(n){for(let s of n)if(s.result.status==="valid")return s.result;for(let s of n)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=n.map((s)=>new gn(s.ctx.common.issues));return Ge(t,{code:Ue.invalid_union,unionErrors:o}),it}if(t.common.async)return Promise.all(r.map(async(n)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);else{let n=void 0,o=[];for(let h of r){let b={...t,common:{...t.common,issues:[]},parent:null},v=h._parseSync({data:t.data,path:t.path,parent:b});if(v.status==="valid")return v;else if(v.status==="dirty"&&!n)n={result:v,ctx:b};if(b.common.issues.length)o.push(b.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let s=o.map((h)=>new gn(h));return Ge(t,{code:Ue.invalid_union,unionErrors:s}),it}}get options(){return this._def.options}}Cl.create=(e,t)=>new Cl({options:e,typeName:Le.ZodUnion,...ft(t)});var bi=(e)=>{if(e instanceof Nl)return bi(e.schema);else if(e instanceof Qn)return bi(e.innerType());else if(e instanceof Dl)return[e.value];else if(e instanceof qo)return e.options;else if(e instanceof zl)return _t.objectValues(e.enum);else if(e instanceof jl)return bi(e._def.innerType);else if(e instanceof Al)return[void 0];else if(e instanceof Rl)return[null];else if(e instanceof En)return[void 0,...bi(e.unwrap())];else if(e instanceof Gi)return[null,...bi(e.unwrap())];else if(e instanceof Ov)return bi(e.unwrap());else if(e instanceof Ll)return bi(e.unwrap());else if(e instanceof Ul)return bi(e._def.innerType);else return[]};class Cv extends vt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.object)return Ge(t,{code:Ue.invalid_type,expected:He.object,received:t.parsedType}),it;let r=this.discriminator,i=t.data[r],n=this.optionsMap.get(i);if(!n)return Ge(t,{code:Ue.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it;if(t.common.async)return n._parseAsync({data:t.data,path:t.path,parent:t});else return n._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let n of t){let o=bi(n.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,n)}}return new Cv({typeName:Le.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...ft(r)})}}function Rv(e,t){let r=vi(e),i=vi(t);if(e===t)return{valid:!0,data:e};else if(r===He.object&&i===He.object){let n=_t.objectKeys(t),o=_t.objectKeys(e).filter((h)=>n.indexOf(h)!==-1),s={...e,...t};for(let h of o){let b=Rv(e[h],t[h]);if(!b.valid)return{valid:!1};s[h]=b.data}return{valid:!0,data:s}}else if(r===He.array&&i===He.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let o=0;o<e.length;o++){let s=e[o],h=t[o],b=Rv(s,h);if(!b.valid)return{valid:!1};n.push(b.data)}return{valid:!0,data:n}}else if(r===He.date&&i===He.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}class Ol extends vt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=(n,o)=>{if($v(n)||$v(o))return it;let s=Rv(n.value,o.value);if(!s.valid)return Ge(r,{code:Ue.invalid_intersection_types}),it;if(Pv(n)||Pv(o))t.dirty();return{status:t.value,value:s.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,o])=>i(n,o));else return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ol.create=(e,t,r)=>new Ol({left:e,right:t,typeName:Le.ZodIntersection,...ft(r)});class Si extends vt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.array)return Ge(r,{code:Ue.invalid_type,expected:He.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Ge(r,{code:Ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;if(!this._def.rest&&r.data.length>this._def.items.length)Ge(r,{code:Ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let n=[...r.data].map((o,s)=>{let h=this._def.items[s]||this._def.rest;if(!h)return null;return h._parse(new zn(r,o,r.path,s))}).filter((o)=>!!o);if(r.common.async)return Promise.all(n).then((o)=>Lr.mergeArray(t,o));else return Lr.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Si({...this._def,rest:e})}}Si.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Si({items:e,typeName:Le.ZodTuple,rest:null,...ft(t)})};class Rh extends vt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.object)return Ge(r,{code:Ue.invalid_type,expected:He.object,received:r.parsedType}),it;let i=[],n=this._def.keyType,o=this._def.valueType;for(let s in r.data)i.push({key:n._parse(new zn(r,s,r.path,s)),value:o._parse(new zn(r,r.data[s],r.path,s)),alwaysSet:s in r.data});if(r.common.async)return Lr.mergeObjectAsync(t,i);else return Lr.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof vt)return new Rh({keyType:e,valueType:t,typeName:Le.ZodRecord,...ft(r)});return new Rh({keyType:_i.create(),valueType:e,typeName:Le.ZodRecord,...ft(t)})}}class Ch extends vt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.map)return Ge(r,{code:Ue.invalid_type,expected:He.map,received:r.parsedType}),it;let i=this._def.keyType,n=this._def.valueType,o=[...r.data.entries()].map(([s,h],b)=>({key:i._parse(new zn(r,s,r.path,[b,"key"])),value:n._parse(new zn(r,h,r.path,[b,"value"]))}));if(r.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let h of o){let b=await h.key,v=await h.value;if(b.status==="aborted"||v.status==="aborted")return it;if(b.status==="dirty"||v.status==="dirty")t.dirty();s.set(b.value,v.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let h of o){let{key:b,value:v}=h;if(b.status==="aborted"||v.status==="aborted")return it;if(b.status==="dirty"||v.status==="dirty")t.dirty();s.set(b.value,v.value)}return{status:t.value,value:s}}}}Ch.create=(e,t,r)=>new Ch({valueType:t,keyType:e,typeName:Le.ZodMap,...ft(r)});class Zs extends vt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==He.set)return Ge(r,{code:Ue.invalid_type,expected:He.set,received:r.parsedType}),it;let i=this._def;if(i.minSize!==null){if(r.data.size<i.minSize.value)Ge(r,{code:Ue.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()}if(i.maxSize!==null){if(r.data.size>i.maxSize.value)Ge(r,{code:Ue.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty()}let n=this._def.valueType;function o(h){let b=new Set;for(let v of h){if(v.status==="aborted")return it;if(v.status==="dirty")t.dirty();b.add(v.value)}return{status:t.value,value:b}}let s=[...r.data.values()].map((h,b)=>n._parse(new zn(r,h,r.path,b)));if(r.common.async)return Promise.all(s).then((h)=>o(h));else return o(s)}min(e,t){return new Zs({...this._def,minSize:{value:e,message:Qe.toString(t)}})}max(e,t){return new Zs({...this._def,maxSize:{value:e,message:Qe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...ft(t)});class $l extends vt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.function)return Ge(t,{code:Ue.invalid_type,expected:He.function,received:t.parsedType}),it;function r(s,h){return Ih({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Il(),Wi].filter((b)=>!!b),issueData:{code:Ue.invalid_arguments,argumentsError:h}})}function i(s,h){return Ih({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Il(),Wi].filter((b)=>!!b),issueData:{code:Ue.invalid_return_type,returnTypeError:h}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Ks){let s=this;return Kr(async function(...h){let b=new gn([]),v=await s._def.args.parseAsync(h,n).catch((S)=>{throw b.addIssue(r(h,S)),b}),_=await Reflect.apply(o,this,v);return await s._def.returns._def.type.parseAsync(_,n).catch((S)=>{throw b.addIssue(i(_,S)),b})})}else{let s=this;return Kr(function(...h){let b=s._def.args.safeParse(h,n);if(!b.success)throw new gn([r(h,b.error)]);let v=Reflect.apply(o,this,b.data),_=s._def.returns.safeParse(v,n);if(!_.success)throw new gn([i(v,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $l({...this._def,args:Si.create(e).rest(Lo.create())})}returns(e){return new $l({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new $l({args:e?e:Si.create([]).rest(Lo.create()),returns:t||Lo.create(),typeName:Le.ZodFunction,...ft(r)})}}class Nl extends vt{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Nl.create=(e,t)=>new Nl({getter:e,typeName:Le.ZodLazy,...ft(t)});class Dl extends vt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Ge(t,{received:t.data,code:Ue.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:e.data}}get value(){return this._def.value}}Dl.create=(e,t)=>new Dl({value:e,typeName:Le.ZodLiteral,...ft(t)});function W6(e,t){return new qo({values:e,typeName:Le.ZodEnum,...ft(t)})}class qo extends vt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return Ge(t,{expected:_t.joinValues(r),received:t.parsedType,code:Ue.invalid_type}),it}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return Ge(t,{received:t.data,code:Ue.invalid_enum_value,options:r}),it}return Kr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return qo.create(e,{...this._def,...t})}exclude(e,t=this._def){return qo.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}}qo.create=W6;class zl extends vt{_parse(e){let t=_t.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==He.string&&r.parsedType!==He.number){let i=_t.objectValues(t);return Ge(r,{expected:_t.joinValues(i),received:r.parsedType,code:Ue.invalid_type}),it}if(!this._cache)this._cache=new Set(_t.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let i=_t.objectValues(t);return Ge(r,{received:r.data,code:Ue.invalid_enum_value,options:i}),it}return Kr(e.data)}get enum(){return this._def.values}}zl.create=(e,t)=>new zl({values:e,typeName:Le.ZodNativeEnum,...ft(t)});class Ks extends vt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==He.promise&&t.common.async===!1)return Ge(t,{code:Ue.invalid_type,expected:He.promise,received:t.parsedType}),it;let r=t.parsedType===He.promise?t.data:Promise.resolve(t.data);return Kr(r.then((i)=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ks.create=(e,t)=>new Ks({type:e,typeName:Le.ZodPromise,...ft(t)});class Qn extends vt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:(o)=>{if(Ge(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(r.data,n);if(r.common.async)return Promise.resolve(o).then(async(s)=>{if(t.value==="aborted")return it;let h=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});if(h.status==="aborted")return it;if(h.status==="dirty")return qs(h.value);if(t.value==="dirty")return qs(h.value);return h});else{if(t.value==="aborted")return it;let s=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(s.status==="aborted")return it;if(s.status==="dirty")return qs(s.value);if(t.value==="dirty")return qs(s.value);return s}}if(i.type==="refinement"){let o=(s)=>{let h=i.refinement(s,n);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return it;if(s.status==="dirty")t.dirty();return o(s.value),{status:t.value,value:s.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((s)=>{if(s.status==="aborted")return it;if(s.status==="dirty")t.dirty();return o(s.value).then(()=>({status:t.value,value:s.value}))})}if(i.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Uo(o))return it;let s=i.transform(o.value,n);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!Uo(o))return it;return Promise.resolve(i.transform(o.value,n)).then((s)=>({status:t.value,value:s}))});_t.assertNever(i)}}Qn.create=(e,t,r)=>new Qn({schema:e,typeName:Le.ZodEffects,effect:t,...ft(r)});Qn.createWithPreprocess=(e,t,r)=>new Qn({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...ft(r)});class En extends vt{_parse(e){if(this._getType(e)===He.undefined)return Kr(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}En.create=(e,t)=>new En({innerType:e,typeName:Le.ZodOptional,...ft(t)});class Gi extends vt{_parse(e){if(this._getType(e)===He.null)return Kr(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Gi.create=(e,t)=>new Gi({innerType:e,typeName:Le.ZodNullable,...ft(t)});class jl extends vt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===He.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}jl.create=(e,t)=>new jl({innerType:e,typeName:Le.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ft(t)});class Ul extends vt{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Tl(i))return i.then((n)=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new gn(r.common.issues)},input:r.data})}));else return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new gn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ul.create=(e,t)=>new Ul({innerType:e,typeName:Le.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ft(t)});class Oh extends vt{_parse(e){if(this._getType(e)!==He.nan){let r=this._getOrReturnCtx(e);return Ge(r,{code:Ue.invalid_type,expected:He.nan,received:r.parsedType}),it}return{status:"valid",value:e.data}}}Oh.create=(e)=>new Oh({typeName:Le.ZodNaN,...ft(e)});var Cre=Symbol("zod_brand");class Ov extends vt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Nh extends vt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return it;if(n.status==="dirty")return t.dirty(),qs(n.value);else return this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();else{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return it;if(i.status==="dirty")return t.dirty(),{status:"dirty",value:i.value};else return this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,t){return new Nh({in:e,out:t,typeName:Le.ZodPipeline})}}class Ll extends vt{_parse(e){let t=this._def.innerType._parse(e),r=(i)=>{if(Uo(i))i.value=Object.freeze(i.value);return i};return Tl(t)?t.then((i)=>r(i)):r(t)}unwrap(){return this._def.innerType}}Ll.create=(e,t)=>new Ll({innerType:e,typeName:Le.ZodReadonly,...ft(t)});var Ore={object:Qt.lazycreate},Le;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Le||(Le={}));var Nre=_i.create,Dre=Bs.create,zre=Oh.create,jre=Hs.create,Ure=Th.create,Lre=Pl.create,qre=$h.create,Fre=Al.create,Bre=Rl.create,Hre=Ph.create,Zre=Lo.create,Kre=wi.create,Vre=Ah.create,Wre=Yn.create,G6=Qt.create,Gre=Qt.strictCreate,Jre=Cl.create,Xre=Cv.create,Yre=Ol.create,Qre=Si.create,ene=Rh.create,tne=Ch.create,rne=Zs.create,nne=$l.create,ine=Nl.create,one=Dl.create,sne=qo.create,ane=zl.create,une=Ks.create,lne=Qn.create,cne=En.create,dne=Gi.create,fne=Qn.createWithPreprocess,hne=Nh.create;var $C=ne("ZodMiniType",(e,t)=>{if(!e._zod)throw Error("Uninitialized schema in ZodMiniType.");at.init(e,t),e.def=t,e.parse=(r,i)=>Ro(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Fi(e,r,i),e.parseAsync=async(r,i)=>Co(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Bi(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((i)=>typeof i==="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>jr(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e)});var PC=ne("ZodMiniObject",(e,t)=>{Du.init(e,t),$C.init(e,t),Fe.defineLazy(e,"shape",()=>t.shape)});function Nv(e,t){let r={type:"object",get shape(){return Fe.assignProp(this,"shape",{...e}),this.shape},...Fe.normalizeParams(t)};return new PC(r)}function In(e){return!!e._zod}function Fo(e){let t=Object.values(e);if(t.length===0)return Nv({});let r=t.every(In),i=t.every((n)=>!In(n));if(r)return Nv(e);if(i)return G6(e);throw Error("Mixed Zod versions detected in object shape.")}function Ji(e,t){if(In(e))return Fi(e,t);return e.safeParse(t)}async function Dh(e,t){if(In(e))return await Bi(e,t);return await e.safeParseAsync(t)}function Xi(e){if(!e)return;let t;if(In(e))t=e._zod?.def?.shape;else t=e.shape;if(!t)return;if(typeof t==="function")try{return t()}catch{return}return t}function Vs(e){if(!e)return;if(typeof e==="object"){let t=e,r=e;if(!t._def&&!r._zod){let i=Object.values(e);if(i.length>0&&i.every((n)=>typeof n==="object"&&n!==null&&(n._def!==void 0||n._zod!==void 0||typeof n.parse==="function")))return Fo(e)}}if(In(e)){let r=e._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return e}else if(e.shape!==void 0)return e;return}function zh(e){if(e&&typeof e==="object"){if("message"in e&&typeof e.message==="string")return e.message;if("issues"in e&&Array.isArray(e.issues)&&e.issues.length>0){let t=e.issues[0];if(t&&typeof t==="object"&&"message"in t)return String(t.message)}try{return JSON.stringify(e)}catch{return String(e)}}return String(e)}function J6(e){return e.description}function X6(e){if(In(e))return e._zod?.def?.type==="optional";let t=e;if(typeof e.isOptional==="function")return e.isOptional();return t._def?.typeName==="ZodOptional"}function jh(e){if(In(e)){let o=e._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let i=e.value;if(i!==void 0)return i;return}var Dv="2025-11-25";var Y6=[Dv,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Yi="io.modelcontextprotocol/related-task",Lh="2.0",Sr=Ev((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),Q6=Ot([de(),Et().int()]),ex=de(),Tne=Ur({ttl:Et().optional(),pollInterval:Et().optional()}),RC=Ye({ttl:Et().optional()}),CC=Ye({taskId:de()}),zv=Ur({progressToken:Q6.optional(),[Yi]:CC.optional()}),yn=Ye({_meta:zv.optional()}),ql=yn.extend({task:RC.optional()}),tx=(e)=>ql.safeParse(e).success,Ar=Ye({method:de(),params:yn.loose().optional()}),Tn=Ye({_meta:zv.optional()}),$n=Ye({method:de(),params:Tn.loose().optional()}),Rr=Ur({_meta:zv.optional()}),qh=Ot([de(),Et().int()]),rx=Ye({jsonrpc:et(Lh),id:qh,...Ar.shape}).strict(),jv=(e)=>rx.safeParse(e).success,nx=Ye({jsonrpc:et(Lh),...$n.shape}).strict(),ix=(e)=>nx.safeParse(e).success,Uv=Ye({jsonrpc:et(Lh),id:qh,result:Rr}).strict(),Fl=(e)=>Uv.safeParse(e).success;var nt;(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(nt||(nt={}));var Lv=Ye({jsonrpc:et(Lh),id:qh.optional(),error:Ye({code:Et().int(),message:de(),data:qt().optional()})}).strict();var ox=(e)=>Lv.safeParse(e).success;var $ne=Ot([rx,nx,Uv,Lv]),Pne=Ot([Uv,Lv]),Fh=Rr.strict(),OC=Tn.extend({requestId:qh.optional(),reason:de().optional()}),Bh=$n.extend({method:et("notifications/cancelled"),params:OC}),NC=Ye({src:de(),mimeType:de().optional(),sizes:bt(de()).optional(),theme:Zr(["light","dark"]).optional()}),Bl=Ye({icons:bt(NC).optional()}),Ws=Ye({name:de(),title:de().optional()}),sx=Ws.extend({...Ws.shape,...Bl.shape,version:de(),websiteUrl:de().optional(),description:de().optional()}),DC=El(Ye({applyDefaults:ir().optional()}),Nt(de(),qt())),zC=Eh((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},El(Ye({form:DC.optional(),url:Sr.optional()}),Nt(de(),qt()).optional())),jC=Ur({list:Sr.optional(),cancel:Sr.optional(),requests:Ur({sampling:Ur({createMessage:Sr.optional()}).optional(),elicitation:Ur({create:Sr.optional()}).optional()}).optional()}),UC=Ur({list:Sr.optional(),cancel:Sr.optional(),requests:Ur({tools:Ur({call:Sr.optional()}).optional()}).optional()}),LC=Ye({experimental:Nt(de(),Sr).optional(),sampling:Ye({context:Sr.optional(),tools:Sr.optional()}).optional(),elicitation:zC.optional(),roots:Ye({listChanged:ir().optional()}).optional(),tasks:jC.optional(),extensions:Nt(de(),Sr).optional()}),qC=yn.extend({protocolVersion:de(),capabilities:LC,clientInfo:sx}),qv=Ar.extend({method:et("initialize"),params:qC});var FC=Ye({experimental:Nt(de(),Sr).optional(),logging:Sr.optional(),completions:Sr.optional(),prompts:Ye({listChanged:ir().optional()}).optional(),resources:Ye({subscribe:ir().optional(),listChanged:ir().optional()}).optional(),tools:Ye({listChanged:ir().optional()}).optional(),tasks:UC.optional(),extensions:Nt(de(),Sr).optional()}),BC=Rr.extend({protocolVersion:de(),capabilities:FC,serverInfo:sx,instructions:de().optional()}),Fv=$n.extend({method:et("notifications/initialized"),params:Tn.optional()});var Hh=Ar.extend({method:et("ping"),params:yn.optional()}),HC=Ye({progress:Et(),total:Ut(Et()),message:Ut(de())}),ZC=Ye({...Tn.shape,...HC.shape,progressToken:Q6}),Zh=$n.extend({method:et("notifications/progress"),params:ZC}),KC=yn.extend({cursor:ex.optional()}),Hl=Ar.extend({params:KC.optional()}),Zl=Rr.extend({nextCursor:ex.optional()}),VC=Zr(["working","input_required","completed","failed","cancelled"]),Kl=Ye({taskId:de(),status:VC,ttl:Ot([Et(),_h()]),createdAt:de(),lastUpdatedAt:de(),pollInterval:Ut(Et()),statusMessage:Ut(de())}),Gs=Rr.extend({task:Kl}),WC=Tn.merge(Kl),Vl=$n.extend({method:et("notifications/tasks/status"),params:WC}),Kh=Ar.extend({method:et("tasks/get"),params:yn.extend({taskId:de()})}),Vh=Rr.merge(Kl),Wh=Ar.extend({method:et("tasks/result"),params:yn.extend({taskId:de()})}),Ane=Rr.loose(),Gh=Hl.extend({method:et("tasks/list")}),Jh=Zl.extend({tasks:bt(Kl)}),Xh=Ar.extend({method:et("tasks/cancel"),params:yn.extend({taskId:de()})}),ax=Rr.merge(Kl),ux=Ye({uri:de(),mimeType:Ut(de()),_meta:Nt(de(),qt()).optional()}),lx=ux.extend({text:de()}),Bv=de().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),cx=ux.extend({blob:Bv}),Wl=Zr(["user","assistant"]),Js=Ye({audience:bt(Wl).optional(),priority:Et().min(0).max(1).optional(),lastModified:js.datetime({offset:!0}).optional()}),dx=Ye({...Ws.shape,...Bl.shape,uri:de(),description:Ut(de()),mimeType:Ut(de()),size:Ut(Et()),annotations:Js.optional(),_meta:Ut(Ur({}))}),GC=Ye({...Ws.shape,...Bl.shape,uriTemplate:de(),description:Ut(de()),mimeType:Ut(de()),annotations:Js.optional(),_meta:Ut(Ur({}))}),Yh=Hl.extend({method:et("resources/list")}),JC=Zl.extend({resources:bt(dx)}),Qh=Hl.extend({method:et("resources/templates/list")}),XC=Zl.extend({resourceTemplates:bt(GC)}),Hv=yn.extend({uri:de()}),YC=Hv,ep=Ar.extend({method:et("resources/read"),params:YC}),QC=Rr.extend({contents:bt(Ot([lx,cx]))}),eO=$n.extend({method:et("notifications/resources/list_changed"),params:Tn.optional()}),tO=Hv,rO=Ar.extend({method:et("resources/subscribe"),params:tO}),nO=Hv,iO=Ar.extend({method:et("resources/unsubscribe"),params:nO}),oO=Tn.extend({uri:de()}),sO=$n.extend({method:et("notifications/resources/updated"),params:oO}),aO=Ye({name:de(),description:Ut(de()),required:Ut(ir())}),uO=Ye({...Ws.shape,...Bl.shape,description:Ut(de()),arguments:Ut(bt(aO)),_meta:Ut(Ur({}))}),tp=Hl.extend({method:et("prompts/list")}),lO=Zl.extend({prompts:bt(uO)}),cO=yn.extend({name:de(),arguments:Nt(de(),de()).optional()}),rp=Ar.extend({method:et("prompts/get"),params:cO}),Zv=Ye({type:et("text"),text:de(),annotations:Js.optional(),_meta:Nt(de(),qt()).optional()}),Kv=Ye({type:et("image"),data:Bv,mimeType:de(),annotations:Js.optional(),_meta:Nt(de(),qt()).optional()}),Vv=Ye({type:et("audio"),data:Bv,mimeType:de(),annotations:Js.optional(),_meta:Nt(de(),qt()).optional()}),dO=Ye({type:et("tool_use"),name:de(),id:de(),input:Nt(de(),qt()),_meta:Nt(de(),qt()).optional()}),fO=Ye({type:et("resource"),resource:Ot([lx,cx]),annotations:Js.optional(),_meta:Nt(de(),qt()).optional()}),hO=dx.extend({type:et("resource_link")}),Wv=Ot([Zv,Kv,Vv,hO,fO]),pO=Ye({role:Wl,content:Wv}),mO=Rr.extend({description:de().optional(),messages:bt(pO)}),gO=$n.extend({method:et("notifications/prompts/list_changed"),params:Tn.optional()}),yO=Ye({title:de().optional(),readOnlyHint:ir().optional(),destructiveHint:ir().optional(),idempotentHint:ir().optional(),openWorldHint:ir().optional()}),vO=Ye({taskSupport:Zr(["required","optional","forbidden"]).optional()}),fx=Ye({...Ws.shape,...Bl.shape,description:de().optional(),inputSchema:Ye({type:et("object"),properties:Nt(de(),Sr).optional(),required:bt(de()).optional()}).catchall(qt()),outputSchema:Ye({type:et("object"),properties:Nt(de(),Sr).optional(),required:bt(de()).optional()}).catchall(qt()).optional(),annotations:yO.optional(),execution:vO.optional(),_meta:Nt(de(),qt()).optional()}),np=Hl.extend({method:et("tools/list")}),bO=Zl.extend({tools:bt(fx)}),ip=Rr.extend({content:bt(Wv).default([]),structuredContent:Nt(de(),qt()).optional(),isError:ir().optional()}),Rne=ip.or(Rr.extend({toolResult:qt()})),_O=ql.extend({name:de(),arguments:Nt(de(),qt()).optional()}),Xs=Ar.extend({method:et("tools/call"),params:_O}),wO=$n.extend({method:et("notifications/tools/list_changed"),params:Tn.optional()}),Cne=Ye({autoRefresh:ir().default(!0),debounceMs:Et().int().nonnegative().default(300)}),Gl=Zr(["debug","info","notice","warning","error","critical","alert","emergency"]),SO=yn.extend({level:Gl}),Gv=Ar.extend({method:et("logging/setLevel"),params:SO}),xO=Tn.extend({level:Gl,logger:de().optional(),data:qt()}),kO=$n.extend({method:et("notifications/message"),params:xO}),MO=Ye({name:de().optional()}),EO=Ye({hints:bt(MO).optional(),costPriority:Et().min(0).max(1).optional(),speedPriority:Et().min(0).max(1).optional(),intelligencePriority:Et().min(0).max(1).optional()}),IO=Ye({mode:Zr(["auto","required","none"]).optional()}),TO=Ye({type:et("tool_result"),toolUseId:de().describe("The unique identifier for the corresponding tool call."),content:bt(Wv).default([]),structuredContent:Ye({}).loose().optional(),isError:ir().optional(),_meta:Nt(de(),qt()).optional()}),$O=kh("type",[Zv,Kv,Vv]),Uh=kh("type",[Zv,Kv,Vv,dO,TO]),PO=Ye({role:Wl,content:Ot([Uh,bt(Uh)]),_meta:Nt(de(),qt()).optional()}),AO=ql.extend({messages:bt(PO),modelPreferences:EO.optional(),systemPrompt:de().optional(),includeContext:Zr(["none","thisServer","allServers"]).optional(),temperature:Et().optional(),maxTokens:Et().int(),stopSequences:bt(de()).optional(),metadata:Sr.optional(),tools:bt(fx).optional(),toolChoice:IO.optional()}),RO=Ar.extend({method:et("sampling/createMessage"),params:AO}),Jl=Rr.extend({model:de(),stopReason:Ut(Zr(["endTurn","stopSequence","maxTokens"]).or(de())),role:Wl,content:$O}),Jv=Rr.extend({model:de(),stopReason:Ut(Zr(["endTurn","stopSequence","maxTokens","toolUse"]).or(de())),role:Wl,content:Ot([Uh,bt(Uh)])}),CO=Ye({type:et("boolean"),title:de().optional(),description:de().optional(),default:ir().optional()}),OO=Ye({type:et("string"),title:de().optional(),description:de().optional(),minLength:Et().optional(),maxLength:Et().optional(),format:Zr(["email","uri","date","date-time"]).optional(),default:de().optional()}),NO=Ye({type:Zr(["number","integer"]),title:de().optional(),description:de().optional(),minimum:Et().optional(),maximum:Et().optional(),default:Et().optional()}),DO=Ye({type:et("string"),title:de().optional(),description:de().optional(),enum:bt(de()),default:de().optional()}),zO=Ye({type:et("string"),title:de().optional(),description:de().optional(),oneOf:bt(Ye({const:de(),title:de()})),default:de().optional()}),jO=Ye({type:et("string"),title:de().optional(),description:de().optional(),enum:bt(de()),enumNames:bt(de()).optional(),default:de().optional()}),UO=Ot([DO,zO]),LO=Ye({type:et("array"),title:de().optional(),description:de().optional(),minItems:Et().optional(),maxItems:Et().optional(),items:Ye({type:et("string"),enum:bt(de())}),default:bt(de()).optional()}),qO=Ye({type:et("array"),title:de().optional(),description:de().optional(),minItems:Et().optional(),maxItems:Et().optional(),items:Ye({anyOf:bt(Ye({const:de(),title:de()}))}),default:bt(de()).optional()}),FO=Ot([LO,qO]),BO=Ot([jO,UO,FO]),HO=Ot([BO,CO,OO,NO]),ZO=ql.extend({mode:et("form").optional(),message:de(),requestedSchema:Ye({type:et("object"),properties:Nt(de(),HO),required:bt(de()).optional()})}),KO=ql.extend({mode:et("url"),message:de(),elicitationId:de(),url:de().url()}),VO=Ot([ZO,KO]),WO=Ar.extend({method:et("elicitation/create"),params:VO}),GO=Tn.extend({elicitationId:de()}),JO=$n.extend({method:et("notifications/elicitation/complete"),params:GO}),Ys=Rr.extend({action:Zr(["accept","decline","cancel"]),content:Eh((e)=>e===null?void 0:e,Nt(de(),Ot([de(),Et(),ir(),bt(de())])).optional())}),XO=Ye({type:et("ref/resource"),uri:de()});var YO=Ye({type:et("ref/prompt"),name:de()}),QO=yn.extend({ref:Ot([YO,XO]),argument:Ye({name:de(),value:de()}),context:Ye({arguments:Nt(de(),de()).optional()}).optional()}),op=Ar.extend({method:et("completion/complete"),params:QO});function hx(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function px(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var eN=Rr.extend({completion:Ur({values:bt(de()).max(100),total:Ut(Et().int()),hasMore:Ut(ir())})}),tN=Ye({uri:de().startsWith("file://"),name:de().optional(),_meta:Nt(de(),qt()).optional()}),rN=Ar.extend({method:et("roots/list"),params:yn.optional()}),Xv=Rr.extend({roots:bt(tN)}),nN=$n.extend({method:et("notifications/roots/list_changed"),params:Tn.optional()}),One=Ot([Hh,qv,op,Gv,rp,tp,Yh,Qh,ep,rO,iO,Xs,np,Kh,Wh,Gh,Xh]),Nne=Ot([Bh,Zh,Fv,nN,Vl]),Dne=Ot([Fh,Jl,Jv,Ys,Xv,Vh,Jh,Gs]),zne=Ot([Hh,RO,WO,rN,Kh,Wh,Gh,Xh]),jne=Ot([Bh,Zh,kO,sO,eO,wO,gO,Vl,JO]),Une=Ot([Fh,BC,eN,mO,lO,JC,XC,QC,ip,bO,Vh,Jh,Gs]);class tt extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`);this.code=e,this.data=r,this.name="McpError"}static fromError(e,t,r){if(e===nt.UrlElicitationRequired&&r){let i=r;if(i.elicitations)return new mx(i.elicitations,t)}return new tt(e,t,r)}}class mx extends tt{constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(nt.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}function Qi(e){return e==="completed"||e==="failed"||e==="cancelled"}var yx=Symbol("Let zodToJsonSchema decide on which parser to use");var gx={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},vx=(e)=>typeof e==="string"?{...gx,name:e}:{...gx,...e};var bx=(e)=>{let t=vx(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([i,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,i],jsonSchema:void 0}]))}};function Yv(e,t,r,i){if(!i?.errorMessages)return;if(r)e.errorMessage={...e.errorMessage,[t]:r}}function wt(e,t,r,i,n){e[t]=r,Yv(e,t,i,n)}var sp=(e,t)=>{let r=0;for(;r<e.length&&r<t.length;r++)if(e[r]!==t[r])break;return[(e.length-r).toString(),...t.slice(r)].join("/")};function Kt(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?sp(t,e.currentPath):t.join("/")}}function _x(e,t){let r={type:"array"};if(e.type?._def&&e.type?._def?.typeName!==Le.ZodAny)r.items=ot(e.type._def,{...t,currentPath:[...t.currentPath,"items"]});if(e.minLength)wt(r,"minItems",e.minLength.value,e.minLength.message,t);if(e.maxLength)wt(r,"maxItems",e.maxLength.value,e.maxLength.message,t);if(e.exactLength)wt(r,"minItems",e.exactLength.value,e.exactLength.message,t),wt(r,"maxItems",e.exactLength.value,e.exactLength.message,t);return r}function wx(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"min":if(t.target==="jsonSchema7")if(i.inclusive)wt(r,"minimum",i.value,i.message,t);else wt(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;wt(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)wt(r,"maximum",i.value,i.message,t);else wt(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;wt(r,"maximum",i.value,i.message,t)}break;case"multipleOf":wt(r,"multipleOf",i.value,i.message,t);break}return r}function Sx(){return{type:"boolean"}}function ap(e,t){return ot(e.type._def,t)}var xx=(e,t)=>ot(e.innerType._def,t);function Qv(e,t,r){let i=r??t.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,o)=>Qv(e,t,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return iN(e,t)}}var iN=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let i of e.checks)switch(i.kind){case"min":wt(r,"minimum",i.value,i.message,t);break;case"max":wt(r,"maximum",i.value,i.message,t);break}return r};function kx(e,t){return{...ot(e.innerType._def,t),default:e.defaultValue()}}function Mx(e,t){return t.effectStrategy==="input"?ot(e.schema._def,t):Kt(t)}function Ex(e){return{type:"string",enum:Array.from(e.values)}}var oN=(e)=>{if("type"in e&&e.type==="string")return!1;return"allOf"in e};function Ix(e,t){let r=[ot(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ot(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter((o)=>!!o),i=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach((o)=>{if(oN(o)){if(n.push(...o.allOf),o.unevaluatedProperties===void 0)i=void 0}else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:h,...b}=o;s=b}else i=void 0;n.push(s)}}),n.length?{allOf:n,...i}:void 0}function Tx(e,t){let r=typeof e.value;if(r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string")return{type:Array.isArray(e.value)?"array":"object"};if(t.target==="openApi3")return{type:r==="bigint"?"integer":r,enum:[e.value]};return{type:r==="bigint"?"integer":r,const:e.value}}var eb=void 0,jn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(eb===void 0)eb=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return eb},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function up(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":wt(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":wt(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Un(r,"email",i.message,t);break;case"format:idn-email":Un(r,"idn-email",i.message,t);break;case"pattern:zod":Vr(r,jn.email,i.message,t);break}break;case"url":Un(r,"uri",i.message,t);break;case"uuid":Un(r,"uuid",i.message,t);break;case"regex":Vr(r,i.regex,i.message,t);break;case"cuid":Vr(r,jn.cuid,i.message,t);break;case"cuid2":Vr(r,jn.cuid2,i.message,t);break;case"startsWith":Vr(r,RegExp(`^${tb(i.value,t)}`),i.message,t);break;case"endsWith":Vr(r,RegExp(`${tb(i.value,t)}$`),i.message,t);break;case"datetime":Un(r,"date-time",i.message,t);break;case"date":Un(r,"date",i.message,t);break;case"time":Un(r,"time",i.message,t);break;case"duration":Un(r,"duration",i.message,t);break;case"length":wt(r,"minLength",typeof r.minLength==="number"?Math.max(r.minLength,i.value):i.value,i.message,t),wt(r,"maxLength",typeof r.maxLength==="number"?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":{Vr(r,RegExp(tb(i.value,t)),i.message,t);break}case"ip":{if(i.version!=="v6")Un(r,"ipv4",i.message,t);if(i.version!=="v4")Un(r,"ipv6",i.message,t);break}case"base64url":Vr(r,jn.base64url,i.message,t);break;case"jwt":Vr(r,jn.jwt,i.message,t);break;case"cidr":{if(i.version!=="v6")Vr(r,jn.ipv4Cidr,i.message,t);if(i.version!=="v4")Vr(r,jn.ipv6Cidr,i.message,t);break}case"emoji":Vr(r,jn.emoji(),i.message,t);break;case"ulid":{Vr(r,jn.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Un(r,"binary",i.message,t);break}case"contentEncoding:base64":{wt(r,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Vr(r,jn.base64,i.message,t);break}}break}case"nanoid":Vr(r,jn.nanoid,i.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:((n)=>{})(i)}return r}function tb(e,t){return t.patternStrategy==="escape"?aN(e):e}var sN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function aN(e){let t="";for(let r=0;r<e.length;r++){if(!sN.has(e[r]))t+="\\";t+=e[r]}return t}function Un(e,t,r,i){if(e.format||e.anyOf?.some((n)=>n.format)){if(!e.anyOf)e.anyOf=[];if(e.format){if(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage){if(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})}else wt(e,"format",t,r,i)}function Vr(e,t,r,i){if(e.pattern||e.allOf?.some((n)=>n.pattern)){if(!e.allOf)e.allOf=[];if(e.pattern){if(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage){if(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0)delete e.errorMessage}}e.allOf.push({pattern:$x(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})}else wt(e,"pattern",$x(t,i),r,i)}function $x(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",o=!1,s=!1,h=!1;for(let b=0;b<i.length;b++){if(o){n+=i[b],o=!1;continue}if(r.i){if(s){if(i[b].match(/[a-z]/)){if(h)n+=i[b],n+=`${i[b-2]}-${i[b]}`.toUpperCase(),h=!1;else if(i[b+1]==="-"&&i[b+2]?.match(/[a-z]/))n+=i[b],h=!0;else n+=`${i[b]}${i[b].toUpperCase()}`;continue}}else if(i[b].match(/[a-z]/)){n+=`[${i[b]}${i[b].toUpperCase()}]`;continue}}if(r.m){if(i[b]==="^"){n+=`(^|(?<=[\r
]))`;continue}else if(i[b]==="$"){n+=`($|(?=[\r
]))`;continue}}if(r.s&&i[b]==="."){n+=s?`${i[b]}\r
`:`[${i[b]}\r
]`;continue}if(n+=i[b],i[b]==="\\")o=!0;else if(s&&i[b]==="]")s=!1;else if(!s&&i[b]==="[")s=!0}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return n}function lp(e,t){if(t.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(t.target==="openApi3"&&e.keyType?._def.typeName===Le.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((i,n)=>({...i,[n]:ot(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??Kt(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:ot(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Le.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=up(e.keyType._def,t);return{...r,propertyNames:n}}else if(e.keyType?._def.typeName===Le.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===Le.ZodBranded&&e.keyType._def.type._def.typeName===Le.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=ap(e.keyType._def,t);return{...r,propertyNames:n}}return r}function Px(e,t){if(t.mapStrategy==="record")return lp(e,t);let r=ot(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Kt(t),i=ot(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Kt(t);return{type:"array",maxItems:125,items:{type:"array",items:[r,i],minItems:2,maxItems:2}}}function Ax(e){let t=e.values,i=Object.keys(e.values).filter((o)=>typeof t[t[o]]!=="number").map((o)=>t[o]),n=Array.from(new Set(i.map((o)=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:i}}function Rx(e){return e.target==="openAi"?void 0:{not:Kt({...e,currentPath:[...e.currentPath,"not"]})}}function Cx(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Xl={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Nx(e,t){if(t.target==="openApi3")return Ox(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every((i)=>(i._def.typeName in Xl)&&(!i._def.checks||!i._def.checks.length))){let i=r.reduce((n,o)=>{let s=Xl[o._def.typeName];return s&&!n.includes(s)?[...n,s]:n},[]);return{type:i.length>1?i:i[0]}}else if(r.every((i)=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=r.reduce((n,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...n,s];case"bigint":return[...n,"integer"];case"object":if(o._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(i.length===r.length){let n=i.filter((o,s,h)=>h.indexOf(o)===s);return{type:n.length>1?n:n[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every((i)=>i._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((i,n)=>[...i,...n._def.values.filter((o)=>!i.includes(o))],[])};return Ox(e,t)}var Ox=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((i,n)=>ot(i._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter((i)=>!!i&&(!t.strictUnions||typeof i==="object"&&Object.keys(i).length>0));return r.length?{anyOf:r}:void 0};function Dx(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length)){if(t.target==="openApi3")return{type:Xl[e.innerType._def.typeName],nullable:!0};return{type:[Xl[e.innerType._def.typeName],"null"]}}if(t.target==="openApi3"){let i=ot(e.innerType._def,{...t,currentPath:[...t.currentPath]});if(i&&"$ref"in i)return{allOf:[i],nullable:!0};return i&&{...i,nullable:!0}}let r=ot(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function zx(e,t){let r={type:"number"};if(!e.checks)return r;for(let i of e.checks)switch(i.kind){case"int":r.type="integer",Yv(r,"type",i.message,t);break;case"min":if(t.target==="jsonSchema7")if(i.inclusive)wt(r,"minimum",i.value,i.message,t);else wt(r,"exclusiveMinimum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMinimum=!0;wt(r,"minimum",i.value,i.message,t)}break;case"max":if(t.target==="jsonSchema7")if(i.inclusive)wt(r,"maximum",i.value,i.message,t);else wt(r,"exclusiveMaximum",i.value,i.message,t);else{if(!i.inclusive)r.exclusiveMaximum=!0;wt(r,"maximum",i.value,i.message,t)}break;case"multipleOf":wt(r,"multipleOf",i.value,i.message,t);break}return r}function jx(e,t){let r=t.target==="openAi",i={type:"object",properties:{}},n=[],o=e.shape();for(let h in o){let b=o[h];if(b===void 0||b._def===void 0)continue;let v=lN(b);if(v&&r){if(b._def.typeName==="ZodOptional")b=b._def.innerType;if(!b.isNullable())b=b.nullable();v=!1}let _=ot(b._def,{...t,currentPath:[...t.currentPath,"properties",h],propertyPath:[...t.currentPath,"properties",h]});if(_===void 0)continue;if(i.properties[h]=_,!v)n.push(h)}if(n.length)i.required=n;let s=uN(e,t);if(s!==void 0)i.additionalProperties=s;return i}function uN(e,t){if(e.catchall._def.typeName!=="ZodNever")return ot(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function lN(e){try{return e.isOptional()}catch{return!0}}var Ux=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return ot(e.innerType._def,t);let r=ot(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Kt(t)},r]}:Kt(t)};var Lx=(e,t)=>{if(t.pipeStrategy==="input")return ot(e.in._def,t);else if(t.pipeStrategy==="output")return ot(e.out._def,t);let r=ot(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),i=ot(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,i].filter((n)=>n!==void 0)}};function qx(e,t){return ot(e.type._def,t)}function Fx(e,t){let i={type:"array",uniqueItems:!0,items:ot(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};if(e.minSize)wt(i,"minItems",e.minSize.value,e.minSize.message,t);if(e.maxSize)wt(i,"maxItems",e.maxSize.value,e.maxSize.message,t);return i}function Bx(e,t){if(e.rest)return{type:"array",minItems:e.items.length,items:e.items.map((r,i)=>ot(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[]),additionalItems:ot(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})};else return{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,i)=>ot(r._def,{...t,currentPath:[...t.currentPath,"items",`${i}`]})).reduce((r,i)=>i===void 0?r:[...r,i],[])}}function Hx(e){return{not:Kt(e)}}function Zx(e){return Kt(e)}var Kx=(e,t)=>ot(e.innerType._def,t);var Vx=(e,t,r)=>{switch(t){case Le.ZodString:return up(e,r);case Le.ZodNumber:return zx(e,r);case Le.ZodObject:return jx(e,r);case Le.ZodBigInt:return wx(e,r);case Le.ZodBoolean:return Sx();case Le.ZodDate:return Qv(e,r);case Le.ZodUndefined:return Hx(r);case Le.ZodNull:return Cx(r);case Le.ZodArray:return _x(e,r);case Le.ZodUnion:case Le.ZodDiscriminatedUnion:return Nx(e,r);case Le.ZodIntersection:return Ix(e,r);case Le.ZodTuple:return Bx(e,r);case Le.ZodRecord:return lp(e,r);case Le.ZodLiteral:return Tx(e,r);case Le.ZodEnum:return Ex(e);case Le.ZodNativeEnum:return Ax(e);case Le.ZodNullable:return Dx(e,r);case Le.ZodOptional:return Ux(e,r);case Le.ZodMap:return Px(e,r);case Le.ZodSet:return Fx(e,r);case Le.ZodLazy:return()=>e.getter()._def;case Le.ZodPromise:return qx(e,r);case Le.ZodNaN:case Le.ZodNever:return Rx(r);case Le.ZodEffects:return Mx(e,r);case Le.ZodAny:return Kt(r);case Le.ZodUnknown:return Zx(r);case Le.ZodDefault:return kx(e,r);case Le.ZodBranded:return ap(e,r);case Le.ZodReadonly:return Kx(e,r);case Le.ZodCatch:return xx(e,r);case Le.ZodPipeline:return Lx(e,r);case Le.ZodFunction:case Le.ZodVoid:case Le.ZodSymbol:return;default:return((i)=>{return})(t)}};function ot(e,t,r=!1){let i=t.seen.get(e);if(t.override){let h=t.override?.(e,t,i,r);if(h!==yx)return h}if(i&&!r){let h=cN(i,t);if(h!==void 0)return h}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let o=Vx(e,e.typeName,t),s=typeof o==="function"?ot(o(),t):o;if(s)dN(e,t,s);if(t.postProcess){let h=t.postProcess(s,e,t);return n.jsonSchema=s,h}return n.jsonSchema=s,s}var cN=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:sp(t.currentPath,e.path)};case"none":case"seen":{if(e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Kt(t);return t.$refStrategy==="seen"?Kt(t):void 0}}},dN=(e,t,r)=>{if(e.description){if(r.description=e.description,t.markdownDescription)r.markdownDescription=e.description}return r};var rb=(e,t)=>{let r=bx(t),i=typeof t==="object"&&t.definitions?Object.entries(t.definitions).reduce((b,[v,_])=>({...b,[v]:ot(_._def,{...r,currentPath:[...r.basePath,r.definitionPath,v]},!0)??Kt(r)}),{}):void 0,n=typeof t==="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=ot(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??Kt(r),s=typeof t==="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;if(s!==void 0)o.title=s;if(r.flags.hasReferencedOpenAiAnyType){if(!i)i={};if(!i[r.openAiAnyTypeName])i[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}}let h=n===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:o}};if(r.target==="jsonSchema7")h.$schema="http://json-schema.org/draft-07/schema#";else if(r.target==="jsonSchema2019-09"||r.target==="openAi")h.$schema="https://json-schema.org/draft/2019-09/schema#";if(r.target==="openAi"&&(("anyOf"in h)||("oneOf"in h)||("allOf"in h)||("type"in h)&&Array.isArray(h.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return h};function fN(e){if(!e)return"draft-7";if(e==="jsonSchema7"||e==="draft-7")return"draft-7";if(e==="jsonSchema2019-09"||e==="draft-2020-12")return"draft-2020-12";return"draft-7"}function nb(e,t){if(In(e))return zs(e,{target:fN(t?.target),io:t?.pipeStrategy??"input"});return rb(e,{strictUnions:t?.strictUnions??!0,pipeStrategy:t?.pipeStrategy??"input"})}function ib(e){let r=Xi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=jh(r);if(typeof i!=="string")throw Error("Schema method literal must be a string");return i}function ob(e,t){let r=Ji(e,t);if(!r.success)throw r.error;return r.data}var hN=60000;class sb{constructor(e){if(this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Bh,(t)=>{this._oncancel(t)}),this.setNotificationHandler(Zh,(t)=>{this._onprogress(t)}),this.setRequestHandler(Hh,(t)=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore)this.setRequestHandler(Kh,async(t,r)=>{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new tt(nt.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(Wh,async(t,r)=>{let i=async()=>{let n=t.params.taskId;if(this._taskMessageQueue){let s;while(s=await this._taskMessageQueue.dequeue(n,r.sessionId)){if(s.type==="response"||s.type==="error"){let h=s.message,b=h.id,v=this._requestResolvers.get(b);if(v)if(this._requestResolvers.delete(b),s.type==="response")v(h);else{let _=h,g=new tt(_.error.code,_.error.message,_.error.data);v(g)}else{let _=s.type==="response"?"Response":"Error";this._onerror(Error(`${_} handler missing for request ${b}`))}continue}await this._transport?.send(s.message,{relatedRequestId:r.requestId})}}let o=await this._taskStore.getTask(n,r.sessionId);if(!o)throw new tt(nt.InvalidParams,`Task not found: ${n}`);if(!Qi(o.status))return await this._waitForTaskUpdate(n,r.signal),await i();if(Qi(o.status)){let s=await this._taskStore.getTaskResult(n,r.sessionId);return this._clearTaskQueue(n),{...s,_meta:{...s._meta,[Yi]:{taskId:n}}}}return await i()};return await i()}),this.setRequestHandler(Gh,async(t,r)=>{try{let{tasks:i,nextCursor:n}=await this._taskStore.listTasks(t.params?.cursor,r.sessionId);return{tasks:i,nextCursor:n,_meta:{}}}catch(i){throw new tt(nt.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(Xh,async(t,r)=>{try{let i=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!i)throw new tt(nt.InvalidParams,`Task not found: ${t.params.taskId}`);if(Qi(i.status))throw new tt(nt.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(t.params.taskId);let n=await this._taskStore.getTask(t.params.taskId,r.sessionId);if(!n)throw new tt(nt.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...n}}catch(i){if(i instanceof tt)throw i;throw new tt(nt.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}})}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,i,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),tt.fromError(nt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let i=this._transport?.onmessage;this._transport.onmessage=(n,o)=>{if(i?.(n,o),Fl(n)||ox(n))this._onresponse(n);else if(jv(n))this._onrequest(n,o);else if(ix(n))this._onnotification(n);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let r of this._timeoutInfo.values())clearTimeout(r.timeoutId);this._timeoutInfo.clear();for(let r of this._requestHandlerAbortControllers.values())r.abort();this._requestHandlerAbortControllers.clear();let t=tt.fromError(nt.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let r of e.values())r(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;if(t===void 0)return;Promise.resolve().then(()=>t(e)).catch((r)=>this._onerror(Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){let r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,n=e.params?._meta?.[Yi]?.taskId;if(r===void 0){let v={jsonrpc:"2.0",id:e.id,error:{code:nt.MethodNotFound,message:"Method not found"}};if(n&&this._taskMessageQueue)this._enqueueTaskMessage(n,{type:"error",message:v,timestamp:Date.now()},i?.sessionId).catch((_)=>this._onerror(Error(`Failed to enqueue error response: ${_}`)));else i?.send(v).catch((_)=>this._onerror(Error(`Failed to send an error response: ${_}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=tx(e.params)?e.params.task:void 0,h=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,b={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async(v)=>{if(o.signal.aborted)return;let _={relatedRequestId:e.id};if(n)_.relatedTask={taskId:n};await this.notification(v,_)},sendRequest:async(v,_,g)=>{if(o.signal.aborted)throw new tt(nt.ConnectionClosed,"Request was cancelled");let S={...g,relatedRequestId:e.id};if(n&&!S.relatedTask)S.relatedTask={taskId:n};let x=S.relatedTask?.taskId??n;if(x&&h)await h.updateTaskStatus(x,"input_required");return await this.request(v,_,S)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:n,taskStore:h,taskRequestedTtl:s?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(s)this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,b)).then(async(v)=>{if(o.signal.aborted)return;let _={result:v,jsonrpc:"2.0",id:e.id};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"response",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)},async(v)=>{if(o.signal.aborted)return;let _={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(v.code)?v.code:nt.InternalError,message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};if(n&&this._taskMessageQueue)await this._enqueueTaskMessage(n,{type:"error",message:_,timestamp:Date.now()},i?.sessionId);else await i?.send(_)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(e.id)===o)this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),n=this._progressHandlers.get(i);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(h){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(h);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._requestResolvers.get(t);if(r){if(this._requestResolvers.delete(t),Fl(e))r(e);else{let o=new tt(e.error.code,e.error.message,e.error.data);r(o)}return}let i=this._responseHandlers.get(t);if(i===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let n=!1;if(Fl(e)&&e.result&&typeof e.result==="object"){let o=e.result;if(o.task&&typeof o.task==="object"){let s=o.task;if(typeof s.taskId==="string")n=!0,this._taskProgressTokens.set(s.taskId,t)}}if(!n)this._progressHandlers.delete(t);if(Fl(e))i(e);else{let o=tt.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,r){let{task:i}=r??{};if(!i){try{yield{type:"result",result:await this.request(e,t,r)}}catch(o){yield{type:"error",error:o instanceof tt?o:new tt(nt.InternalError,String(o))}}return}let n;try{let o=await this.request(e,Gs,r);if(o.task)n=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new tt(nt.InternalError,"Task creation did not return a task");while(!0){let s=await this.getTask({taskId:n},r);if(yield{type:"taskStatus",task:s},Qi(s.status)){if(s.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};else if(s.status==="failed")yield{type:"error",error:new tt(nt.InternalError,`Task ${n} failed`)};else if(s.status==="cancelled")yield{type:"error",error:new tt(nt.InternalError,`Task ${n} was cancelled`)};return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:n},t,r)};return}let h=s.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((b)=>setTimeout(b,h)),r?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof tt?o:new tt(nt.InternalError,String(o))}}}request(e,t,r){let{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o,task:s,relatedTask:h}=r??{};return new Promise((b,v)=>{let _=($)=>{v($)};if(!this._transport){_(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod(e.method),s)this.assertTaskCapability(e.method)}catch($){_($);return}r?.signal?.throwIfAborted();let g=this._requestMessageId++,S={...e,jsonrpc:"2.0",id:g};if(r?.onprogress)this._progressHandlers.set(g,r.onprogress),S.params={...e.params,_meta:{...e.params?._meta||{},progressToken:g}};if(s)S.params={...S.params,task:s};if(h)S.params={...S.params,_meta:{...S.params?._meta||{},[Yi]:h}};let x=($)=>{this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String($)}},{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch((R)=>this._onerror(Error(`Failed to send cancellation: ${R}`)));let P=$ instanceof tt?$:new tt(nt.RequestTimeout,String($));v(P)};this._responseHandlers.set(g,($)=>{if(r?.signal?.aborted)return;if($ instanceof Error)return v($);try{let P=Ji(t,$.result);if(!P.success)v(P.error);else b(P.data)}catch(P){v(P)}}),r?.signal?.addEventListener("abort",()=>{x(r?.signal?.reason)});let M=r?.timeout??hN,I=()=>x(tt.fromError(nt.RequestTimeout,"Request timed out",{timeout:M}));this._setupTimeout(g,M,r?.maxTotalTimeout,I,r?.resetTimeoutOnProgress??!1);let T=h?.taskId;if(T){let $=(P)=>{let R=this._responseHandlers.get(g);if(R)R(P);else this._onerror(Error(`Response handler missing for side-channeled request ${g}`))};this._requestResolvers.set(g,$),this._enqueueTaskMessage(T,{type:"request",message:S,timestamp:Date.now()}).catch((P)=>{this._cleanupTimeout(g),v(P)})}else this._transport.send(S,{relatedRequestId:i,resumptionToken:n,onresumptiontoken:o}).catch(($)=>{this._cleanupTimeout(g),v($)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Vh,t)}async getTaskResult(e,t,r){return this.request({method:"tasks/result",params:e},t,r)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Jh,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ax,t)}async notification(e,t){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let r=t?.relatedTask?.taskId;if(r){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Yi]:t.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};if(t?.relatedTask)s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Yi]:t.relatedTask}}};this._transport?.send(s,t).catch((h)=>this._onerror(h))});return}let o={...e,jsonrpc:"2.0"};if(t?.relatedTask)o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Yi]:t.relatedTask}}};await this._transport.send(o,t)}setRequestHandler(e,t){let r=ib(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(i,n)=>{let o=ob(e,i);return Promise.resolve(t(o,n))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let r=ib(e);this._notificationHandlers.set(r,(i)=>{let n=ob(e,i);return Promise.resolve(t(n))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);if(t!==void 0)this._progressHandlers.delete(t),this._taskProgressTokens.delete(e)}async _enqueueTaskMessage(e,t,r){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,r,i)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let r=await this._taskMessageQueue.dequeueAll(e,t);for(let i of r)if(i.type==="request"&&jv(i.message)){let n=i.message.id,o=this._requestResolvers.get(n);if(o)o(new tt(nt.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(n);else this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let r=this._options?.defaultTaskPollInterval??1000;try{let i=await this._taskStore?.getTask(e);if(i?.pollInterval)r=i.pollInterval}catch{}return new Promise((i,n)=>{if(t.aborted){n(new tt(nt.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,r);t.addEventListener("abort",()=>{clearTimeout(o),n(new tt(nt.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){let r=this._taskStore;if(!r)throw Error("No task store configured");return{createTask:async(i)=>{if(!e)throw Error("No request provided");return await r.createTask(i,e.id,{method:e.method,params:e.params},t)},getTask:async(i)=>{let n=await r.getTask(i,t);if(!n)throw new tt(nt.InvalidParams,"Failed to retrieve task: Task not found");return n},storeTaskResult:async(i,n,o)=>{await r.storeTaskResult(i,n,o,t);let s=await r.getTask(i,t);if(s){let h=Vl.parse({method:"notifications/tasks/status",params:s});if(await this.notification(h),Qi(s.status))this._cleanupTaskProgressHandler(i)}},getTaskResult:(i)=>r.getTaskResult(i,t),updateTaskStatus:async(i,n,o)=>{let s=await r.getTask(i,t);if(!s)throw new tt(nt.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Qi(s.status))throw new tt(nt.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${n}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(i,n,o,t);let h=await r.getTask(i,t);if(h){let b=Vl.parse({method:"notifications/tasks/status",params:h});if(await this.notification(b),Qi(h.status))this._cleanupTaskProgressHandler(i)}},listTasks:(i)=>r.listTasks(i,t)}}}function Wx(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Gx(e,t){let r={...e};for(let i in t){let n=i,o=t[n];if(o===void 0)continue;let s=r[n];if(Wx(s)&&Wx(o))r[n]={...s,...o};else r[n]=o}return r}var A8=x_(t_(),1),R8=x_(P8(),1);function NB(){let e=new A8.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return R8.default(e),e}class d_{constructor(e){this._ajv=e??NB()}getValidator(e){let t="$id"in e&&typeof e.$id==="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return(r)=>{if(t(r))return{valid:!0,data:r,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}}class f_{constructor(e){this._server=e}requestStream(e,t,r){return this._server.requestStream(e,t,r)}createMessageStream(e,t){let r=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!r?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],n=Array.isArray(i.content)?i.content:[i.content],o=n.some((v)=>v.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,h=s?Array.isArray(s.content)?s.content:[s.content]:[],b=h.some((v)=>v.type==="tool_use");if(o){if(n.some((v)=>v.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!b)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(b){let v=new Set(h.filter((g)=>g.type==="tool_use").map((g)=>g.id)),_=new Set(n.filter((g)=>g.type==="tool_result").map((g)=>g.toolUseId));if(v.size!==_.size||![...v].every((g)=>_.has(g)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Jl,t)}elicitInputStream(e,t){let r=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!r?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!r?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let n=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:n},Ys,t)}async getTask(e,t){return this._server.getTask({taskId:e},t)}async getTaskResult(e,t,r){return this._server.getTaskResult({taskId:e},t,r)}async listTasks(e,t){return this._server.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._server.cancelTask({taskId:e},t)}}function C8(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function O8(e,t,r){if(!e)throw Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}class h_ extends sb{constructor(e,t){super(t);if(this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Gl.options.map((r,i)=>[r,i])),this.isMessageIgnored=(r,i)=>{let n=this._loggingLevels.get(i);return n?this.LOG_LEVEL_SEVERITY.get(r)<this.LOG_LEVEL_SEVERITY.get(n):!1},this._capabilities=t?.capabilities??{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new d_,this.setRequestHandler(qv,(r)=>this._oninitialize(r)),this.setNotificationHandler(Fv,()=>this.oninitialized?.()),this._capabilities.logging)this.setRequestHandler(Gv,async(r,i)=>{let n=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=r.params,s=Gl.safeParse(o);if(s.success)this._loggingLevels.set(n,s.data);return{}})}get experimental(){if(!this._experimental)this._experimental={tasks:new f_(this)};return this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=Gx(this._capabilities,e)}setRequestHandler(e,t){let i=Xi(e)?.method;if(!i)throw Error("Schema is missing a method literal");let n;if(In(i)){let s=i;n=s._zod?.def?.value??s.value}else{let s=i;n=s._def?.value??s.value}if(typeof n!=="string")throw Error("Schema method literal must be a string");if(n==="tools/call"){let s=async(h,b)=>{let v=Ji(Xs,h);if(!v.success){let x=v.error instanceof Error?v.error.message:String(v.error);throw new tt(nt.InvalidParams,`Invalid tools/call request: ${x}`)}let{params:_}=v.data,g=await Promise.resolve(t(h,b));if(_.task){let x=Ji(Gs,g);if(!x.success){let M=x.error instanceof Error?x.error.message:String(x.error);throw new tt(nt.InvalidParams,`Invalid task creation result: ${M}`)}return x.data}let S=Ji(ip,g);if(!S.success){let x=S.error instanceof Error?S.error.message:String(S.error);throw new tt(nt.InvalidParams,`Invalid tools/call result: ${x}`)}return S.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,t)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(!this._capabilities)return;switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){O8(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){if(!this._capabilities)return;C8(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:Y6.includes(t)?t:Dv,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Fh)}async createMessage(e,t){if(e.tools||e.toolChoice){if(!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.")}if(e.messages.length>0){let r=e.messages[e.messages.length-1],i=Array.isArray(r.content)?r.content:[r.content],n=i.some((b)=>b.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],h=s.some((b)=>b.type==="tool_use");if(n){if(i.some((b)=>b.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!h)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(h){let b=new Set(s.filter((_)=>_.type==="tool_use").map((_)=>_.id)),v=new Set(i.filter((_)=>_.type==="tool_result").map((_)=>_.toolUseId));if(b.size!==v.size||![...b].every((_)=>v.has(_)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}if(e.tools)return this.request({method:"sampling/createMessage",params:e},Jv,t);return this.request({method:"sampling/createMessage",params:e},Jl,t)}async elicitInput(e,t){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Ys,t)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},n=await this.request({method:"elicitation/create",params:i},Ys,t);if(n.action==="accept"&&n.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(n.content);if(!s.valid)throw new tt(nt.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){if(o instanceof tt)throw o;throw new tt(nt.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return n}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this.request({method:"roots/list",params:e},Xv,t)}async sendLoggingMessage(e,t){if(this._capabilities.logging){if(!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var D8=Symbol.for("mcp.completable");function p_(e){return!!e&&typeof e==="object"&&D8 in e}function z8(e){return e[D8]?.complete}var N8;(function(e){e.Completable="McpCompletable"})(N8||(N8={}));var DB=/^[A-Za-z0-9._-]{1,128}$/;function zB(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!DB.test(e)){let r=e.split("").filter((i)=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,o)=>o.indexOf(i)===n);return t.push(`Tool name contains invalid characters: ${r.map((i)=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function jB(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function m_(e){let t=zB(e);return jB(e,t.warnings),t.isValid}class g_{constructor(e){this._mcpServer=e}registerToolTask(e,t,r){let i={taskSupport:"required",...t.execution};if(i.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,t.title,t.description,t.inputSchema,t.outputSchema,t.annotations,i,t._meta,r)}}class v_{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new h_(e,t)}get experimental(){if(!this._experimental)this._experimental={tasks:new g_(this)};return this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(ao(np)),this.server.assertCanSetRequestHandler(ao(Xs)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(np,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:(()=>{let i=Vs(t.inputSchema);return i?nb(i,{strictUnions:!0,pipeStrategy:"input"}):UB})(),annotations:t.annotations,execution:t.execution,_meta:t._meta};if(t.outputSchema){let i=Vs(t.outputSchema);if(i)r.outputSchema=nb(i,{strictUnions:!0,pipeStrategy:"output"})}return r})})),this.server.setRequestHandler(Xs,async(e,t)=>{try{let r=this._registeredTools[e.params.name];if(!r)throw new tt(nt.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new tt(nt.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,n=r.execution?.taskSupport,o="createTask"in r.handler;if((n==="required"||n==="optional")&&!o)throw new tt(nt.InternalError,`Tool ${e.params.name} has taskSupport '${n}' but was not registered with registerToolTask`);if(n==="required"&&!i)throw new tt(nt.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(n==="optional"&&!i&&o)return await this.handleAutomaticTaskPolling(r,e,t);let s=await this.validateToolInput(r,e.params.arguments,e.params.name),h=await this.executeToolHandler(r,s,t);if(i)return h;return await this.validateToolOutput(r,h,e.params.name),h}catch(r){if(r instanceof tt){if(r.code===nt.UrlElicitationRequired)throw r}return this.createToolError(r instanceof Error?r.message:String(r))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let n=Vs(e.inputSchema)??e.inputSchema,o=await Dh(n,t);if(!o.success){let s="error"in o?o.error:"Unknown error",h=zh(s);throw new tt(nt.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${h}`)}return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(!("content"in t))return;if(t.isError)return;if(!t.structuredContent)throw new tt(nt.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let i=Vs(e.outputSchema),n=await Dh(i,t.structuredContent);if(!n.success){let o="error"in n?n.error:"Unknown error",s=zh(o);throw new tt(nt.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${s}`)}}async executeToolHandler(e,t,r){let i=e.handler;if("createTask"in i){if(!r.taskStore)throw Error("No task store provided.");let o={...r,taskStore:r.taskStore};if(e.inputSchema)return await Promise.resolve(i.createTask(t,o));else return await Promise.resolve(i.createTask(o))}if(e.inputSchema)return await Promise.resolve(i(t,r));else return await Promise.resolve(i(r))}async handleAutomaticTaskPolling(e,t,r){if(!r.taskStore)throw Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,t.params.arguments,t.params.name),n=e.handler,o={...r,taskStore:r.taskStore},s=i?await Promise.resolve(n.createTask(i,o)):await Promise.resolve(n.createTask(o)),h=s.task.taskId,b=s.task,v=b.pollInterval??5000;while(b.status!=="completed"&&b.status!=="failed"&&b.status!=="cancelled"){await new Promise((g)=>setTimeout(g,v));let _=await r.taskStore.getTask(h);if(!_)throw new tt(nt.InternalError,`Task ${h} not found during polling`);b=_}return await r.taskStore.getTaskResult(h)}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(ao(op)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(op,async(e)=>{switch(e.params.ref.type){case"ref/prompt":return hx(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return px(e),this.handleResourceCompletion(e,e.params.ref);default:throw new tt(nt.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new tt(nt.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new tt(nt.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return wc;let n=Xi(r.argsSchema)?.[e.params.argument.name];if(!p_(n))return wc;let o=z8(n);if(!o)return wc;let s=await o(e.params.argument.value,e.params.context);return U8(s)}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((o)=>o.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return wc;throw new tt(nt.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return wc;let n=await i(e.params.argument.value,e.params.context);return U8(n)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(ao(Yh)),this.server.assertCanSetRequestHandler(ao(Qh)),this.server.assertCanSetRequestHandler(ao(ep)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Yh,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,o])=>o.enabled).map(([n,o])=>({uri:n,name:o.name,...o.metadata})),i=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let o=await n.resourceTemplate.listCallback(t);for(let s of o.resources)i.push({...n.metadata,...s})}return{resources:[...r,...i]}}),this.server.setRequestHandler(Qh,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,r])=>({name:t,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(ep,async(e,t)=>{let r=new URL(e.params.uri),i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new tt(nt.InvalidParams,`Resource ${r} disabled`);return i.readCallback(r,t)}for(let n of Object.values(this._registeredResourceTemplates)){let o=n.resourceTemplate.uriTemplate.match(r.toString());if(o)return n.readCallback(r,o,t)}throw new tt(nt.InvalidParams,`Resource ${r} not found`)}),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(ao(tp)),this.server.assertCanSetRequestHandler(ao(rp)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(tp,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?LB(t.argsSchema):void 0}))})),this.server.setRequestHandler(rp,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new tt(nt.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new tt(nt.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let i=Vs(r.argsSchema),n=await Dh(i,e.params.arguments);if(!n.success){let h="error"in n?n.error:"Unknown error",b=zh(h);throw new tt(nt.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${b}`)}let o=n.data,s=r.callback;return await Promise.resolve(s(o,t))}else{let i=r.callback;return await Promise.resolve(i(t))}}),this._promptHandlersInitialized=!0}resource(e,t,...r){let i;if(typeof r[0]==="object")i=r.shift();let n=r[0];if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let o=this._createRegisteredResource(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}registerResource(e,t,r,i){if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,r,i,n){let o={name:e,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({uri:null}),update:(s)=>{if(typeof s.uri<"u"&&s.uri!==r){if(delete this._registeredResources[r],s.uri)this._registeredResources[s.uri]=o}if(typeof s.name<"u")o.name=s.name;if(typeof s.title<"u")o.title=s.title;if(typeof s.metadata<"u")o.metadata=s.metadata;if(typeof s.callback<"u")o.readCallback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=o,o}_createRegisteredResourceTemplate(e,t,r,i,n){let o={resourceTemplate:r,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(b)=>{if(typeof b.name<"u"&&b.name!==e){if(delete this._registeredResourceTemplates[e],b.name)this._registeredResourceTemplates[b.name]=o}if(typeof b.title<"u")o.title=b.title;if(typeof b.template<"u")o.resourceTemplate=b.template;if(typeof b.metadata<"u")o.metadata=b.metadata;if(typeof b.callback<"u")o.readCallback=b.callback;if(typeof b.enabled<"u")o.enabled=b.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=o;let s=r.uriTemplate.variableNames;if(Array.isArray(s)&&s.some((b)=>!!r.completeCallback(b)))this.setCompletionRequestHandler();return o}_createRegisteredPrompt(e,t,r,i,n){let o={title:t,description:r,argsSchema:i===void 0?void 0:Fo(i),callback:n,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:(s)=>{if(typeof s.name<"u"&&s.name!==e){if(delete this._registeredPrompts[e],s.name)this._registeredPrompts[s.name]=o}if(typeof s.title<"u")o.title=s.title;if(typeof s.description<"u")o.description=s.description;if(typeof s.argsSchema<"u")o.argsSchema=Fo(s.argsSchema);if(typeof s.callback<"u")o.callback=s.callback;if(typeof s.enabled<"u")o.enabled=s.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=o,i){if(Object.values(i).some((h)=>{let b=h instanceof En?h._def?.innerType:h;return p_(b)}))this.setCompletionRequestHandler()}return o}_createRegisteredTool(e,t,r,i,n,o,s,h,b){m_(e);let v={title:t,description:r,inputSchema:j8(i),outputSchema:j8(n),annotations:o,execution:s,_meta:h,handler:b,enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:(_)=>{if(typeof _.name<"u"&&_.name!==e){if(typeof _.name==="string")m_(_.name);if(delete this._registeredTools[e],_.name)this._registeredTools[_.name]=v}if(typeof _.title<"u")v.title=_.title;if(typeof _.description<"u")v.description=_.description;if(typeof _.paramsSchema<"u")v.inputSchema=Fo(_.paramsSchema);if(typeof _.outputSchema<"u")v.outputSchema=Fo(_.outputSchema);if(typeof _.callback<"u")v.handler=_.callback;if(typeof _.annotations<"u")v.annotations=_.annotations;if(typeof _._meta<"u")v._meta=_._meta;if(typeof _.enabled<"u")v.enabled=_.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=v,this.setToolRequestHandlers(),this.sendToolListChanged(),v}tool(e,...t){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r,i,n,o;if(typeof t[0]==="string")r=t.shift();if(t.length>1){let h=t[0];if(y_(h)){if(i=t.shift(),t.length>1&&typeof t[0]==="object"&&t[0]!==null&&!y_(t[0]))o=t.shift()}else if(typeof h==="object"&&h!==null){if(Object.values(h).some((b)=>typeof b==="object"&&b!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);o=t.shift()}}let s=t[0];return this._createRegisteredTool(e,void 0,r,i,n,o,{taskSupport:"forbidden"},void 0,s)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:i,description:n,inputSchema:o,outputSchema:s,annotations:h,_meta:b}=t;return this._createRegisteredTool(e,i,n,o,s,h,{taskSupport:"forbidden"},b,r)}prompt(e,...t){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let r;if(typeof t[0]==="string")r=t.shift();let i;if(t.length>1)i=t.shift();let n=t[0],o=this._createRegisteredPrompt(e,void 0,r,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),o}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:i,description:n,argsSchema:o}=t,s=this._createRegisteredPrompt(e,i,n,o,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}var UB={type:"object",properties:{}};function L8(e){return e!==null&&typeof e==="object"&&"parse"in e&&typeof e.parse==="function"&&"safeParse"in e&&typeof e.safeParse==="function"}function q8(e){return"_def"in e||"_zod"in e||L8(e)}function y_(e){if(typeof e!=="object"||e===null)return!1;if(q8(e))return!1;if(Object.keys(e).length===0)return!0;return Object.values(e).some(L8)}function j8(e){if(!e)return;if(y_(e))return Fo(e);if(!q8(e))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return e}function LB(e){let t=Xi(e);if(!t)return[];return Object.entries(t).map(([r,i])=>{let n=J6(i),o=X6(i);return{name:r,description:n,required:!o}})}function ao(e){let r=Xi(e)?.method;if(!r)throw Error("Schema is missing a method literal");let i=jh(r);if(typeof i==="string")return i;throw Error("Schema method literal must be a string")}function U8(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var wc={completion:{values:[],hasMore:!1}};function qB(e,t,r,i,n){let o={};if(n?.searchHint)o["anthropic/searchHint"]=n.searchHint;if(n?.alwaysLoad)o["anthropic/alwaysLoad"]=!0;return{name:e,description:t,inputSchema:r,handler:i,annotations:n?.annotations,_meta:Object.keys(o).length>0?o:void 0}}function FB(e){let t=new v_({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0},instructions:e.instructions});if(e.tools)e.tools.forEach((r)=>{for(let i of Object.values(r.inputSchema)){if(!BB(i))continue;let n=i.description;if(n&&!tn.has(i))tn.add(i,{description:n})}t.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:e.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)});return{type:"sdk",name:e.name,instance:t}}function BB(e){return typeof e==="object"&&e!==null&&"_zod"in e}function ale(e){let t=e.abortController||N2(),r=new Map;if(e.mcpServers)for(let[o,s]of Object.entries(e.mcpServers))if(s.type==="sdk"&&s.instance)r.set(o,s.instance);else throw Error("Browser SDK only supports SDK MCP servers for now");let i;if(e.sse)i=new C0({streamUrl:e.sse.streamUrl,sendUrl:e.sse.sendUrl,sessionId:e.sse.sessionId,headers:e.sse.headers,abortController:t});else i=new O0({url:e.websocket.url,headers:e.websocket.headers,authMessage:e.websocket.authMessage,abortController:t});let n=new A0(i,!1,e.canUseTool,e.hooks,t,r,e.jsonSchema,void 0,e.onElicitation,void 0,void 0,e.onUserDialog);return n.streamInput(e.prompt).catch((o)=>t.abort(o)),n}export{Tv as z,qB as tool,ale as query,FB as createSdkMcpServer};