{"version":3,"sources":["shim.js"],"names":["__e","__g","undefined","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","IE8_DOM_DEFINE","$","$export","DESCRIPTORS","createDesc","html","cel","has","cof","invoke","fails","anObject","aFunction","isObject","toObject","toIObject","toInteger","toIndex","toLength","IObject","IE_PROTO","createArrayMethod","arrayIndexOf","ObjectProto","Object","prototype","ArrayProto","Array","arraySlice","slice","arrayJoin","join","defineProperty","setDesc","getOwnDescriptor","getDesc","defineProperties","setDescs","factories","get","a","O","P","Attributes","e","TypeError","value","propertyIsEnumerable","Properties","keys","getKeys","length","i","S","F","getOwnPropertyDescriptor","keys1","split","keys2","concat","keysLen1","createDict","iframeDocument","iframe","gt","style","display","appendChild","src","contentWindow","document","open","write","close","createGetKeys","names","object","key","result","push","Empty","getPrototypeOf","getProto","constructor","getOwnPropertyNames","getNames","create","construct","len","args","n","Function","bind","that","fn","this","partArgs","arguments","bound","begin","end","klass","start","upTo","size","cloned","charAt","separator","isArray","createArrayReduce","isRight","callbackfn","memo","index","methodize","$fn","arg1","forEach","each","map","filter","some","every","reduce","reduceRight","indexOf","lastIndexOf","el","fromIndex","Math","min","now","Date","lz","num","toISOString","NaN","isFinite","RangeError","d","y","getUTCFullYear","getUTCMilliseconds","s","abs","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","$Object","isEnum","getSymbols","getOwnPropertySymbols","global","core","hide","redefine","ctx","PROTOTYPE","type","name","source","own","out","exp","IS_FORCED","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","expProto","W","window","self","version","bitmap","enumerable","configurable","writable","exec","SRC","TO_STRING","$toString","TPL","inspectSource","it","val","safe","hasOwnProperty","String","toString","px","random","b","apply","documentElement","is","createElement","un","defined","ceil","floor","isNaN","max","asc","TYPE","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","$this","res","f","SPECIES","original","C","arg","store","uid","Symbol","SHARED","IS_INCLUDES","$fails","shared","setToStringTag","wks","keyOf","$names","enumKeys","_create","$Symbol","$JSON","JSON","_stringify","stringify","setter","HIDDEN","SymbolRegistry","AllSymbols","useNative","setSymbolDesc","D","protoDesc","wrap","tag","sym","_k","set","isSymbol","$defineProperty","$defineProperties","l","$create","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","$stringify","replacer","$replacer","$$","buggyJSON","symbolStatics","for","keyFor","useSetter","useSimple","def","TAG","stat","windowNames","getWindowNames","symbols","assign","A","K","k","T","$$len","j","x","setPrototypeOf","check","proto","test","buggy","__proto__","classof","ARG","callee","$freeze","freeze","KEY","$seal","seal","$preventExtensions","preventExtensions","$isFrozen","isFrozen","$isSealed","isSealed","$isExtensible","isExtensible","$getPrototypeOf","$keys","FProto","nameRE","NAME","match","HAS_INSTANCE","FunctionProto","toPrimitive","$trim","trim","NUMBER","$Number","Base","BROKEN_COF","TRIM","toNumber","argument","third","radix","maxCode","first","charCodeAt","code","digits","parseInt","Number","valueOf","spaces","space","non","ltrim","RegExp","rtrim","exporter","string","replace","EPSILON","pow","_isFinite","isInteger","number","isSafeInteger","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","parseFloat","log1p","sqrt","$acosh","acosh","MAX_VALUE","log","LN2","asinh","atanh","sign","cbrt","clz32","LOG2E","cosh","expm1","EPSILON32","MAX32","MIN32","roundTiesToEven","fround","$abs","$sign","Infinity","hypot","value1","value2","div","sum","larg","$imul","imul","UINT16","xn","yn","xl","yl","log10","LN10","log2","sinh","tanh","trunc","fromCharCode","$fromCodePoint","fromCodePoint","raw","callSite","tpl","$at","codePointAt","pos","context","ENDS_WITH","$endsWith","endsWith","searchString","endPosition","search","isRegExp","MATCH","re","INCLUDES","includes","repeat","count","str","STARTS_WITH","$startsWith","startsWith","iterated","_t","_i","point","done","LIBRARY","Iterators","$iterCreate","ITERATOR","BUGGY","FF_ITERATOR","KEYS","VALUES","returnThis","Constructor","next","DEFAULT","IS_SET","FORCED","methods","getMethod","kind","values","entries","DEF_VALUES","VALUES_BUG","$native","$default","IteratorPrototype","descriptor","isArrayIter","getIterFn","iter","from","arrayLike","step","iterator","mapfn","mapping","iterFn","ret","getIteratorMethod","SAFE_CLOSING","riter","skipClosing","arr","of","addToUnscopables","Arguments","UNSCOPABLES","copyWithin","to","inc","fill","endPos","$find","forced","find","findIndex","$flags","$RegExp","re1","re2","CORRECT_NEW","piRE","fiU","ignoreCase","multiline","unicode","sticky","flags","regexp","SYMBOL","REPLACE","$replace","searchValue","replaceValue","SEARCH","SPLIT","$split","limit","Wrapper","strictNew","forOf","setProto","same","speciesConstructor","asap","PROMISE","process","isNode","empty","testResolve","sub","promise","resolve","USE_NATIVE","P2","works","then","thenableThenGotten","sameConstructor","getConstructor","isThenable","PromiseCapability","reject","$$resolve","$$reject","perform","error","notify","record","isReject","chain","v","ok","run","reaction","handler","fail","h","setTimeout","console","isUnhandled","emit","onunhandledrejection","reason","_d","$reject","r","$resolve","wrapper","Promise","executor","err","onFulfilled","onRejected","catch","capability","all","iterable","abrupt","remaining","results","alreadyCalled","race","head","last","macrotask","Observer","MutationObserver","WebKitMutationObserver","flush","parent","domain","exit","enter","nextTick","toggle","node","createTextNode","observe","characterData","data","task","defer","channel","port","setTask","setImmediate","clearTask","clearImmediate","MessageChannel","counter","queue","ONREADYSTATECHANGE","listner","event","port2","port1","onmessage","postMessage","addEventListener","importScripts","removeChild","clear","strong","Map","entry","getEntry","redefineAll","$iterDefine","ID","$has","setSpecies","SIZE","fastKey","_f","ADDER","_l","delete","prev","setStrong","$iterDetect","common","IS_WEAK","fixMethod","add","BUGGY_ZERO","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","Set","weak","frozenStore","WEAK","tmp","$WeakMap","WeakMap","method","arrayFind","arrayFindIndex","FrozenStore","findFrozen","splice","WeakSet","_apply","thisArgument","argumentsList","Reflect","Target","newTarget","$args","propertyKey","attributes","deleteProperty","desc","Enumerate","enumerate","receiver","ownKeys","V","existingDescriptor","ownDesc","$includes","at","$pad","padLeft","maxLength","fillString","left","stringLength","fillStr","intMaxLength","fillLen","stringFiller","padRight","trimLeft","trimRight","$re","escape","regExp","part","getOwnPropertyDescriptors","$values","isEntries","$entries","toJSON","$task","NL","NodeList","HTC","HTMLCollection","NLProto","HTCProto","ArrayValues","partial","navigator","MSIE","userAgent","time","setInterval","path","pargs","_","holder","$ctx","$Array","statics","setStatics","define","amd"],"mappings":";;;;;;CAMC,SAASA,EAAKC,EAAKC,GACpB,cACS,SAAUC,GAKT,QAASC,qBAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUE,OAGnC,IAAIC,GAASF,EAAiBD,IAC7BE,WACAE,GAAIJ,EACJK,QAAQ,EAUT,OANAP,GAAQE,GAAUM,KAAKH,EAAOD,QAASC,EAAQA,EAAOD,QAASH,qBAG/DI,EAAOE,QAAS,EAGTF,EAAOD,QAvBf,GAAID,KAqCJ,OATAF,qBAAoBQ,EAAIT,EAGxBC,oBAAoBS,EAAIP,EAGxBF,oBAAoBU,EAAI,GAGjBV,oBAAoB,KAK/B,SAASI,EAAQD,EAASH,GAE/BA,EAAoB,GACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACpBA,EAAoB,IACp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B,KAC7B,OAAOlR,GAAOqF,EAAIL,EAAMI,MAMvB,SAASpG,EAAQD,EAASH,GAE/BI,EAAOD,QAAUH,EAAoB,IAIhC,SAASI,EAAQD,EAASH,GAG/B,GAAIY,GAAUZ,EAAoB,GAC9Ba,EAAUb,EAAoB,GAC9BmtB,EAAUntB,EAAoB,IAC9BotB,EAAUptB,EAAoB,GAAGsC,OAASA,MAC1C+qB,KACAC,EAAa,SAAS1pB,EAAME,GAC9BlD,EAAEqH,KAAK1H,KAAKqD,EAAKQ,MAAM,KAAM,SAASoB,GACjC1B,GAAUhE,GAAa0F,IAAO4nB,GAAOC,EAAQ7nB,GAAO4nB,EAAO5nB,GACtDA,SAAU6nB,EAAQ7nB,GAAO2nB,EAAK7mB,SAAS/F,QAASiF,GAAM1B,MAGlEwpB,GAAW,wCAAyC,GACpDA,EAAW,gEAAiE,GAC5EA,EAAW,6FAEXzsB,EAAQA,EAAQmD,EAAG,QAASqpB,MAKT,mBAAVjtB,SAAyBA,OAAOD,QAAQC,OAAOD,QAAUP,EAE1C,kBAAV2tB,SAAwBA,OAAOC,IAAID,OAAO,WAAW,MAAO3tB,KAEtEC,EAAIyK,KAAO1K,GACd,EAAG","file":"shim.min.js"}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {"version":3,"file":"signed-xml.js","sourceRoot":"","sources":["../src/signed-xml.ts"],"names":[],"mappings":";;;AAgBA,iDAAiD;AACjD,yCAAyC;AAEzC,+BAAiC;AACjC,+BAA+B;AAC/B,gDAAgD;AAChD,6DAA6D;AAC7D,yDAAyD;AACzD,oDAAoD;AACpD,8DAA8D;AAC9D,iCAAiC;AAEjC,MAAa,SAAS;IAo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,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;;AA7uCH,8BA8uCC;AAhpCQ,4BAAkB,GAAG;IAC1B,EAAE,EAAE,oCAAoC;CACzC,AAFwB,CAEvB;AAEK,cAAI,GAAG,GAAG,EAAE,CAAC,IAAI,AAAb,CAAc","sourcesContent":["import type {\n  CanonicalizationAlgorithmType,\n  CanonicalizationOrTransformAlgorithmType,\n  CanonicalizationOrTransformationAlgorithm,\n  CanonicalizationOrTransformationAlgorithmProcessOptions,\n  ComputeSignatureOptions,\n  ErrorFirstCallback,\n  GetKeyInfoContentArgs,\n  HashAlgorithm,\n  HashAlgorithmType,\n  Reference,\n  SignatureAlgorithm,\n  SignatureAlgorithmType,\n  SignedXmlOptions,\n} from \"./types\";\n\nimport * as isDomNode from \"@xmldom/is-dom-node\";\nimport * as xmldom from \"@xmldom/xmldom\";\nimport * as crypto from \"crypto\";\nimport { deprecate } from \"util\";\nimport * as xpath from \"xpath\";\nimport * as c14n from \"./c14n-canonicalization\";\nimport * as envelopedSignatures from \"./enveloped-signature\";\nimport * as execC14n from \"./exclusive-canonicalization\";\nimport * as hashAlgorithms from \"./hash-algorithms\";\nimport * as signatureAlgorithms from \"./signature-algorithms\";\nimport * as utils from \"./utils\";\n\nexport class SignedXml {\n  idMode?: \"wssecurity\";\n  idAttributes: string[];\n  /**\n   * A {@link Buffer} or pem encoded {@link String} containing your private key\n   */\n  privateKey?: crypto.KeyLike;\n  publicCert?: crypto.KeyLike;\n  /**\n   * One of the supported signature algorithms.\n   * @see {@link SignatureAlgorithmType}\n   */\n  signatureAlgorithm?: SignatureAlgorithmType = undefined;\n  /**\n   * Rules used to convert an XML document into its canonical form.\n   */\n  canonicalizationAlgorithm?: CanonicalizationAlgorithmType = undefined;\n  /**\n   * It specifies a list of namespace prefixes that should be considered \"inclusive\" during the canonicalization process.\n   */\n  inclusiveNamespacesPrefixList: string[] = [];\n  namespaceResolver: XPathNSResolver = {\n    lookupNamespaceURI: function (/* prefix */) {\n      throw new Error(\"Not implemented\");\n    },\n  };\n  implicitTransforms: ReadonlyArray<CanonicalizationOrTransformAlgorithmType> = [];\n  keyInfoAttributes: { [attrName: string]: string } = {};\n  getKeyInfoContent = SignedXml.getKeyInfoContent;\n  getCertFromKeyInfo = SignedXml.getCertFromKeyInfo;\n\n  // Internal state\n  private id = 0;\n  private signedXml = \"\";\n  private signatureXml = \"\";\n  private signatureNode: Node | null = null;\n  private signatureValue = \"\";\n  private originalXmlWithIds = \"\";\n  private keyInfo: Node | null = null;\n\n  /**\n   * Contains the references that were signed.\n   * @see {@link Reference}\n   */\n  private references: Reference[] = [];\n\n  /**\n   * Contains the canonicalized XML of the references that were validly signed.\n   *\n   * This populates with the canonical XML of the reference only after\n   * verifying the signature is cryptographically authentic.\n   */\n  private signedReferences: string[] = [];\n\n  /**\n   *  To add a new transformation algorithm create a new class that implements the {@link TransformationAlgorithm} interface, and register it here. More info: {@link https://github.com/node-saml/xml-crypto#customizing-algorithms|Customizing Algorithms}\n   */\n  CanonicalizationAlgorithms: Record<\n    CanonicalizationOrTransformAlgorithmType,\n    new () => CanonicalizationOrTransformationAlgorithm\n  > = {\n    \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\": c14n.C14nCanonicalization,\n    \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\":\n      c14n.C14nCanonicalizationWithComments,\n    \"http://www.w3.org/2001/10/xml-exc-c14n#\": execC14n.ExclusiveCanonicalization,\n    \"http://www.w3.org/2001/10/xml-exc-c14n#WithComments\":\n      execC14n.ExclusiveCanonicalizationWithComments,\n    \"http://www.w3.org/2000/09/xmldsig#enveloped-signature\": envelopedSignatures.EnvelopedSignature,\n  };\n\n  // TODO: In v7.x we may consider deprecating sha1\n\n  /**\n   * To add a new hash algorithm create a new class that implements the {@link HashAlgorithm} interface, and register it here. More info: {@link https://github.com/node-saml/xml-crypto#customizing-algorithms|Customizing Algorithms}\n   */\n  HashAlgorithms: Record<HashAlgorithmType, new () => HashAlgorithm> = {\n    \"http://www.w3.org/2000/09/xmldsig#sha1\": hashAlgorithms.Sha1,\n    \"http://www.w3.org/2001/04/xmlenc#sha256\": hashAlgorithms.Sha256,\n    \"http://www.w3.org/2001/04/xmlenc#sha512\": hashAlgorithms.Sha512,\n  };\n\n  // TODO: In v7.x we may consider deprecating sha1\n\n  /**\n   * To add a new signature algorithm create a new class that implements the {@link SignatureAlgorithm} interface, and register it here. More info: {@link https://github.com/node-saml/xml-crypto#customizing-algorithms|Customizing Algorithms}\n   */\n  SignatureAlgorithms: Record<SignatureAlgorithmType, new () => SignatureAlgorithm> = {\n    \"http://www.w3.org/2000/09/xmldsig#rsa-sha1\": signatureAlgorithms.RsaSha1,\n    \"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\": signatureAlgorithms.RsaSha256,\n    \"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\": signatureAlgorithms.RsaSha512,\n    // Disabled by default due to key confusion concerns.\n    // 'http://www.w3.org/2000/09/xmldsig#hmac-sha1': SignatureAlgorithms.HmacSha1\n  };\n\n  static defaultNsForPrefix = {\n    ds: \"http://www.w3.org/2000/09/xmldsig#\",\n  };\n\n  static noop = () => null;\n\n  /**\n   * The SignedXml constructor provides an abstraction for sign and verify xml documents. The object is constructed using\n   * @param options {@link SignedXmlOptions}\n   */\n  constructor(options: SignedXmlOptions = {}) {\n    const {\n      idMode,\n      idAttribute,\n      privateKey,\n      publicCert,\n      signatureAlgorithm,\n      canonicalizationAlgorithm,\n      inclusiveNamespacesPrefixList,\n      implicitTransforms,\n      keyInfoAttributes,\n      getKeyInfoContent,\n      getCertFromKeyInfo,\n    } = options;\n\n    // Options\n    this.idMode = idMode;\n    this.idAttributes = [\"Id\", \"ID\", \"id\"];\n    if (idAttribute) {\n      this.idAttributes.unshift(idAttribute);\n    }\n    this.privateKey = privateKey;\n    this.publicCert = publicCert;\n    this.signatureAlgorithm = signatureAlgorithm ?? this.signatureAlgorithm;\n    this.canonicalizationAlgorithm = canonicalizationAlgorithm;\n    if (typeof inclusiveNamespacesPrefixList === \"string\") {\n      this.inclusiveNamespacesPrefixList = inclusiveNamespacesPrefixList.split(\" \");\n    } else if (utils.isArrayHasLength(inclusiveNamespacesPrefixList)) {\n      this.inclusiveNamespacesPrefixList = inclusiveNamespacesPrefixList;\n    }\n    this.implicitTransforms = implicitTransforms ?? this.implicitTransforms;\n    this.keyInfoAttributes = keyInfoAttributes ?? this.keyInfoAttributes;\n    this.getKeyInfoContent = getKeyInfoContent ?? this.getKeyInfoContent;\n    this.getCertFromKeyInfo = getCertFromKeyInfo ?? SignedXml.noop;\n    this.CanonicalizationAlgorithms;\n    this.HashAlgorithms;\n    this.SignatureAlgorithms;\n  }\n\n  /**\n   * Due to key-confusion issues, it's risky to have both hmac\n   * and digital signature algorithms enabled at the same time.\n   * This enables HMAC and disables other signing algorithms.\n   */\n  enableHMAC(): void {\n    this.SignatureAlgorithms = {\n      \"http://www.w3.org/2000/09/xmldsig#hmac-sha1\": signatureAlgorithms.HmacSha1,\n    };\n    this.getKeyInfoContent = SignedXml.noop;\n  }\n\n  /**\n   * Builds the contents of a KeyInfo element as an XML string.\n   *\n   * For example, if the value of the prefix argument is 'foo', then\n   * the resultant XML string will be \"<foo:X509Data></foo:X509Data>\"\n   *\n   * @return an XML string representation of the contents of a KeyInfo element, or `null` if no `KeyInfo` element should be included\n   */\n  static getKeyInfoContent({ publicCert, prefix }: GetKeyInfoContentArgs): string | null {\n    if (publicCert == null) {\n      return null;\n    }\n\n    prefix = prefix ? `${prefix}:` : \"\";\n\n    let x509Certs = \"\";\n    if (Buffer.isBuffer(publicCert)) {\n      publicCert = publicCert.toString(\"latin1\");\n    }\n\n    let publicCertMatches: string[] = [];\n    if (typeof publicCert === \"string\") {\n      publicCertMatches = publicCert.match(utils.EXTRACT_X509_CERTS) || [];\n    }\n\n    if (publicCertMatches.length > 0) {\n      x509Certs = publicCertMatches\n        .map(\n          (c) =>\n            `<${prefix}X509Certificate>${utils\n              .pemToDer(c)\n              .toString(\"base64\")}</${prefix}X509Certificate>`,\n        )\n        .join(\"\");\n    }\n\n    return `<${prefix}X509Data>${x509Certs}</${prefix}X509Data>`;\n  }\n\n  /**\n   * Returns the value of the signing certificate based on the contents of the\n   * specified KeyInfo.\n   *\n   * @param keyInfo KeyInfo element (@see https://www.w3.org/TR/2008/REC-xmldsig-core-20080610/#sec-X509Data)\n   * @return the signing certificate as a string in PEM format\n   */\n  static getCertFromKeyInfo(keyInfo?: Node | null): string | null {\n    if (keyInfo != null) {\n      const cert = xpath.select1(\".//*[local-name(.)='X509Certificate']\", keyInfo);\n      if (isDomNode.isNodeLike(cert)) {\n        return utils.derToPem(cert.textContent ?? \"\", \"CERTIFICATE\");\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Validates the signature of the provided XML document synchronously using the configured key info provider.\n   *\n   * @param xml The XML document containing the signature to be validated.\n   * @returns `true` if the signature is valid\n   * @throws Error if no key info resolver is provided.\n   */\n  checkSignature(xml: string): boolean;\n  /**\n   * Validates the signature of the provided XML document synchronously using the configured key info provider.\n   *\n   * @param xml The XML document containing the signature to be validated.\n   * @param callback Callback function to handle the validation result asynchronously.\n   * @throws Error if the last parameter is provided and is not a function, or if no key info resolver is provided.\n   */\n  checkSignature(xml: string, callback: (error: Error | null, isValid?: boolean) => void): void;\n  checkSignature(\n    xml: string,\n    callback?: (error: Error | null, isValid?: boolean) => void,\n  ): unknown {\n    if (callback != null && typeof callback !== \"function\") {\n      throw new Error(\"Last parameter must be a callback function\");\n    }\n\n    this.signedXml = xml;\n\n    const doc = new xmldom.DOMParser().parseFromString(xml);\n\n    // Reset the references as only references from our re-parsed signedInfo node can be trusted\n    this.references = [];\n\n    const unverifiedSignedInfoCanon = this.getCanonSignedInfoXml(doc);\n    if (!unverifiedSignedInfoCanon) {\n      if (callback) {\n        callback(new Error(\"Canonical signed info cannot be empty\"), false);\n        return;\n      }\n\n      throw new Error(\"Canonical signed info cannot be empty\");\n    }\n\n    // unsigned, verify later to keep with consistent callback behavior\n    const parsedUnverifiedSignedInfo = new xmldom.DOMParser().parseFromString(\n      unverifiedSignedInfoCanon,\n      \"text/xml\",\n    );\n\n    const unverifiedSignedInfoDoc = parsedUnverifiedSignedInfo.documentElement;\n    if (!unverifiedSignedInfoDoc) {\n      if (callback) {\n        callback(new Error(\"Could not parse unverifiedSignedInfoCanon into a document\"), false);\n        return;\n      }\n\n      throw new Error(\"Could not parse unverifiedSignedInfoCanon into a document\");\n    }\n\n    const references = utils.findChildren(unverifiedSignedInfoDoc, \"Reference\");\n    if (!utils.isArrayHasLength(references)) {\n      if (callback) {\n        callback(new Error(\"could not find any Reference elements\"), false);\n        return;\n      }\n\n      throw new Error(\"could not find any Reference elements\");\n    }\n\n    // TODO: In a future release we'd like to load the Signature and its References at the same time,\n    // however, in the `.loadSignature()` method we don't have the entire document,\n    // which we need to to keep the inclusive namespaces\n    for (const reference of references) {\n      this.loadReference(reference);\n    }\n\n    /* eslint-disable-next-line deprecation/deprecation */\n    if (!this.getReferences().every((ref) => this.validateReference(ref, doc))) {\n      /* Trustworthiness can only be determined if SignedInfo's (which holds References' DigestValue(s)\n         which were validated at this stage) signature is valid. Execution does not proceed to validate\n         signature phase thus each References' DigestValue must be considered to be untrusted (attacker\n         might have injected any data with new new references and/or recalculated new DigestValue for\n         altered Reference(s)). Returning any content via `signedReferences` would give false sense of\n         trustworthiness if/when SignedInfo's (which holds references' DigestValues) signature is not\n         valid(ated). Put simply: if one fails, they are all not trustworthy.\n      */\n      this.signedReferences = [];\n      this.references.forEach((ref) => {\n        ref.signedReference = undefined;\n      });\n      // TODO: add this breaking change here later on for even more security: `this.references = [];`\n\n      if (callback) {\n        callback(new Error(\"Could not validate all references\"), false);\n        return;\n      }\n\n      // We return false because some references validated, but not all\n      // We should actually be throwing an error here, but that would be a breaking change\n      // See https://www.w3.org/TR/xmldsig-core/#sec-CoreValidation\n      return false;\n    }\n\n    // (Stage B authentication step, show that the `signedInfoCanon` is signed)\n\n    // First find the key & signature algorithm, these should match\n    // Stage B: Take the signature algorithm and key and verify the `SignatureValue` against the canonicalized `SignedInfo`\n    const signer = this.findSignatureAlgorithm(this.signatureAlgorithm);\n    const key = this.getCertFromKeyInfo(this.keyInfo) || this.publicCert || this.privateKey;\n    if (key == null) {\n      throw new Error(\"KeyInfo or publicCert or privateKey is required to validate signature\");\n    }\n\n    // Check the signature verification to know whether to reset signature value or not.\n    const sigRes = signer.verifySignature(unverifiedSignedInfoCanon, key, this.signatureValue);\n    if (sigRes === true) {\n      if (callback) {\n        callback(null, true);\n      } else {\n        return true;\n      }\n    } else {\n      // Ideally, we would start by verifying the `signedInfoCanon` first,\n      // but that may cause some breaking changes, so we'll handle that in v7.x.\n      // If we were validating `signedInfoCanon` first, we wouldn't have to reset this array.\n      this.signedReferences = [];\n      this.references.forEach((ref) => {\n        ref.signedReference = undefined;\n      });\n      // TODO: add this breaking change here later on for even more security: `this.references = [];`\n\n      if (callback) {\n        callback(\n          new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`),\n        );\n        return; // return early\n      } else {\n        throw new Error(\n          `invalid signature: the signature value ${this.signatureValue} is incorrect`,\n        );\n      }\n    }\n  }\n\n  private getCanonSignedInfoXml(doc: Document) {\n    if (this.signatureNode == null) {\n      throw new Error(\"No signature found.\");\n    }\n    if (typeof this.canonicalizationAlgorithm !== \"string\") {\n      throw new Error(\"Missing canonicalizationAlgorithm when trying to get signed info for XML\");\n    }\n\n    const signedInfo = utils.findChildren(this.signatureNode, \"SignedInfo\");\n    if (signedInfo.length === 0) {\n      throw new Error(\"could not find SignedInfo element in the message\");\n    }\n    if (signedInfo.length > 1) {\n      throw new Error(\n        \"could not get canonicalized signed info for a signature that contains multiple SignedInfo nodes\",\n      );\n    }\n\n    if (\n      this.canonicalizationAlgorithm === \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" ||\n      this.canonicalizationAlgorithm ===\n        \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\"\n    ) {\n      if (!doc || typeof doc !== \"object\") {\n        throw new Error(\n          \"When canonicalization method is non-exclusive, whole xml dom must be provided as an argument\",\n        );\n      }\n    }\n\n    /**\n     * Search for ancestor namespaces before canonicalization.\n     */\n    const ancestorNamespaces = utils.findAncestorNs(doc, \"//*[local-name()='SignedInfo']\");\n\n    const c14nOptions = {\n      ancestorNamespaces: ancestorNamespaces,\n    };\n\n    return this.getCanonXml([this.canonicalizationAlgorithm], signedInfo[0], c14nOptions);\n  }\n\n  private getCanonReferenceXml(doc: Document, ref: Reference, node: Node) {\n    /**\n     * Search for ancestor namespaces before canonicalization.\n     */\n    if (Array.isArray(ref.transforms)) {\n      ref.ancestorNamespaces = utils.findAncestorNs(doc, ref.xpath, this.namespaceResolver);\n    }\n\n    const c14nOptions = {\n      inclusiveNamespacesPrefixList: ref.inclusiveNamespacesPrefixList,\n      ancestorNamespaces: ref.ancestorNamespaces,\n    };\n\n    return this.getCanonXml(ref.transforms, node, c14nOptions);\n  }\n\n  private calculateSignatureValue(doc: Document, callback?: ErrorFirstCallback<string>) {\n    const signedInfoCanon = this.getCanonSignedInfoXml(doc);\n    const signer = this.findSignatureAlgorithm(this.signatureAlgorithm);\n    if (this.privateKey == null) {\n      throw new Error(\"Private key is required to compute signature\");\n    }\n    if (typeof callback === \"function\") {\n      signer.getSignature(signedInfoCanon, this.privateKey, callback);\n    } else {\n      this.signatureValue = signer.getSignature(signedInfoCanon, this.privateKey);\n    }\n  }\n\n  private findSignatureAlgorithm(name?: SignatureAlgorithmType) {\n    if (name == null) {\n      throw new Error(\"signatureAlgorithm is required\");\n    }\n    const algo = this.SignatureAlgorithms[name];\n    if (algo) {\n      return new algo();\n    } else {\n      throw new Error(`signature algorithm '${name}' is not supported`);\n    }\n  }\n\n  private findCanonicalizationAlgorithm(name: CanonicalizationOrTransformAlgorithmType) {\n    if (name != null) {\n      const algo = this.CanonicalizationAlgorithms[name];\n      if (algo) {\n        return new algo();\n      }\n    }\n\n    throw new Error(`canonicalization algorithm '${name}' is not supported`);\n  }\n\n  private findHashAlgorithm(name: HashAlgorithmType) {\n    const algo = this.HashAlgorithms[name];\n    if (algo) {\n      return new algo();\n    } else {\n      throw new Error(`hash algorithm '${name}' is not supported`);\n    }\n  }\n\n  validateElementAgainstReferences(elemOrXpath: Element | string, doc: Document): Reference {\n    let elem: Element;\n    if (typeof elemOrXpath === \"string\") {\n      const firstElem = xpath.select1(elemOrXpath, doc);\n      isDomNode.assertIsElementNode(firstElem);\n      elem = firstElem;\n    } else {\n      elem = elemOrXpath;\n    }\n\n    /* eslint-disable-next-line deprecation/deprecation */\n    for (const ref of this.getReferences()) {\n      const uri = ref.uri?.[0] === \"#\" ? ref.uri.substring(1) : ref.uri;\n\n      for (const attr of this.idAttributes) {\n        const elemId = elem.getAttribute(attr);\n        if (uri === elemId) {\n          ref.xpath = `//*[@*[local-name(.)='${attr}']='${uri}']`;\n          break; // found the correct element, no need to check further\n        }\n      }\n\n      const canonXml = this.getCanonReferenceXml(doc, ref, elem);\n      const hash = this.findHashAlgorithm(ref.digestAlgorithm);\n      const digest = hash.getHash(canonXml);\n\n      if (utils.validateDigestValue(digest, ref.digestValue)) {\n        return ref;\n      }\n    }\n\n    throw new Error(\"No references passed validation\");\n  }\n\n  private validateReference(ref: Reference, doc: Document) {\n    const uri = ref.uri?.[0] === \"#\" ? ref.uri.substring(1) : ref.uri;\n    let elem: xpath.SelectSingleReturnType = null;\n\n    if (uri === \"\") {\n      elem = xpath.select1(\"//*\", doc);\n    } else if (uri?.indexOf(\"'\") !== -1) {\n      // xpath injection\n      throw new Error(\"Cannot validate a uri with quotes inside it\");\n    } else {\n      let num_elements_for_id = 0;\n      for (const attr of this.idAttributes) {\n        const tmp_elemXpath = `//*[@*[local-name(.)='${attr}']='${uri}']`;\n        const tmp_elem = xpath.select(tmp_elemXpath, doc);\n        if (utils.isArrayHasLength(tmp_elem)) {\n          num_elements_for_id += tmp_elem.length;\n\n          if (num_elements_for_id > 1) {\n            throw new Error(\n              \"Cannot validate a document which contains multiple elements with the \" +\n                \"same value for the ID / Id / Id attributes, in order to prevent \" +\n                \"signature wrapping attack.\",\n            );\n          }\n\n          elem = tmp_elem[0];\n          ref.xpath = tmp_elemXpath;\n        }\n      }\n    }\n\n    ref.getValidatedNode = deprecate((xpathSelector?: string) => {\n      xpathSelector = xpathSelector || ref.xpath;\n      if (typeof xpathSelector !== \"string\" || ref.validationError != null) {\n        return null;\n      }\n      const selectedValue = xpath.select1(xpathSelector, doc);\n      return isDomNode.isNodeLike(selectedValue) ? selectedValue : null;\n    }, \"`ref.getValidatedNode()` is deprecated and insecure. Use `ref.signedReference` or `this.getSignedReferences()` instead.\");\n\n    if (!isDomNode.isNodeLike(elem)) {\n      const validationError = new Error(\n        `invalid signature: the signature references an element with uri ${ref.uri} but could not find such element in the xml`,\n      );\n      ref.validationError = validationError;\n      return false;\n    }\n\n    const canonXml = this.getCanonReferenceXml(doc, ref, elem);\n    const hash = this.findHashAlgorithm(ref.digestAlgorithm);\n    const digest = hash.getHash(canonXml);\n\n    if (!utils.validateDigestValue(digest, ref.digestValue)) {\n      const validationError = new Error(\n        `invalid signature: for uri ${ref.uri} calculated digest is ${digest} but the xml to validate supplies digest ${ref.digestValue}`,\n      );\n      ref.validationError = validationError;\n\n      return false;\n    }\n    // This step can only be done after we have verified the `signedInfo`.\n    // We verified that they have same hash,\n    // thus the `canonXml` and _only_ the `canonXml` can be trusted.\n    // Append this to `signedReferences`.\n    this.signedReferences.push(canonXml);\n    ref.signedReference = canonXml;\n\n    return true;\n  }\n\n  findSignatures(doc: Node): Node[] {\n    const nodes = xpath.select(\n      \"//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']\",\n      doc,\n    );\n\n    return isDomNode.isArrayOfNodes(nodes) ? nodes : [];\n  }\n\n  /**\n   * Loads the signature information from the provided XML node or string.\n   *\n   * @param signatureNode The XML node or string representing the signature.\n   */\n  loadSignature(signatureNode: Node | string): void {\n    if (typeof signatureNode === \"string\") {\n      this.signatureNode = signatureNode = new xmldom.DOMParser().parseFromString(signatureNode);\n    } else {\n      this.signatureNode = signatureNode;\n    }\n\n    this.signatureXml = signatureNode.toString();\n\n    const node = xpath.select1(\n      \".//*[local-name(.)='CanonicalizationMethod']/@Algorithm\",\n      signatureNode,\n    );\n    if (!isDomNode.isNodeLike(node)) {\n      throw new Error(\"could not find CanonicalizationMethod/@Algorithm element\");\n    }\n\n    if (isDomNode.isAttributeNode(node)) {\n      this.canonicalizationAlgorithm = node.value as CanonicalizationAlgorithmType;\n    }\n\n    const signatureAlgorithm = xpath.select1(\n      \".//*[local-name(.)='SignatureMethod']/@Algorithm\",\n      signatureNode,\n    );\n\n    if (isDomNode.isAttributeNode(signatureAlgorithm)) {\n      this.signatureAlgorithm = signatureAlgorithm.value as SignatureAlgorithmType;\n    }\n\n    const signedInfoNodes = utils.findChildren(this.signatureNode, \"SignedInfo\");\n    if (!utils.isArrayHasLength(signedInfoNodes)) {\n      throw new Error(\"no signed info node found\");\n    }\n    if (signedInfoNodes.length > 1) {\n      throw new Error(\"could not load signature that contains multiple SignedInfo nodes\");\n    }\n\n    // Try to operate on the c14n version of `signedInfo`. This forces the initial `getReferences()`\n    // API call to always return references that are loaded under the canonical `SignedInfo`\n    // in the case that the client access the `.references` **before** signature verification.\n\n    // Ensure canonicalization algorithm is exclusive, otherwise we'd need the entire document\n    let canonicalizationAlgorithmForSignedInfo = this.canonicalizationAlgorithm;\n    if (\n      !canonicalizationAlgorithmForSignedInfo ||\n      canonicalizationAlgorithmForSignedInfo ===\n        \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" ||\n      canonicalizationAlgorithmForSignedInfo ===\n        \"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\"\n    ) {\n      canonicalizationAlgorithmForSignedInfo = \"http://www.w3.org/2001/10/xml-exc-c14n#\";\n    }\n\n    const temporaryCanonSignedInfo = this.getCanonXml(\n      [canonicalizationAlgorithmForSignedInfo],\n      signedInfoNodes[0],\n    );\n    const temporaryCanonSignedInfoXml = new xmldom.DOMParser().parseFromString(\n      temporaryCanonSignedInfo,\n      \"text/xml\",\n    );\n    const signedInfoDoc = temporaryCanonSignedInfoXml.documentElement;\n\n    this.references = [];\n    const references = utils.findChildren(signedInfoDoc, \"Reference\");\n\n    if (!utils.isArrayHasLength(references)) {\n      throw new Error(\"could not find any Reference elements\");\n    }\n\n    for (const reference of references) {\n      this.loadReference(reference);\n    }\n\n    const signatureValue = xpath.select1(\n      \".//*[local-name(.)='SignatureValue']/text()\",\n      signatureNode,\n    );\n\n    if (isDomNode.isTextNode(signatureValue)) {\n      this.signatureValue = signatureValue.data.replace(/\\r?\\n/g, \"\");\n    }\n\n    const keyInfo = xpath.select1(\".//*[local-name(.)='KeyInfo']\", signatureNode);\n\n    if (isDomNode.isNodeLike(keyInfo)) {\n      this.keyInfo = keyInfo;\n    }\n  }\n\n  /**\n   * Load the reference xml node to a model\n   *\n   */\n  private loadReference(refNode: Node) {\n    let nodes = utils.findChildren(refNode, \"DigestMethod\");\n    if (nodes.length === 0) {\n      throw new Error(`could not find DigestMethod in reference ${refNode.toString()}`);\n    }\n    const digestAlgoNode = nodes[0];\n\n    const attr = utils.findAttr(digestAlgoNode, \"Algorithm\");\n    if (!attr) {\n      throw new Error(`could not find Algorithm attribute in node ${digestAlgoNode.toString()}`);\n    }\n    const digestAlgo = attr.value;\n\n    nodes = utils.findChildren(refNode, \"DigestValue\");\n    if (nodes.length === 0) {\n      throw new Error(`could not find DigestValue node in reference ${refNode.toString()}`);\n    }\n\n    if (nodes.length > 1) {\n      throw new Error(\n        `could not load reference for a node that contains multiple DigestValue nodes: ${refNode.toString()}`,\n      );\n    }\n    const digestValue = nodes[0].textContent;\n    if (!digestValue) {\n      throw new Error(`could not find the value of DigestValue in ${refNode.toString()}`);\n    }\n\n    const transforms: string[] = [];\n    let inclusiveNamespacesPrefixList: string[] = [];\n    nodes = utils.findChildren(refNode, \"Transforms\");\n    if (nodes.length !== 0) {\n      const transformsNode = nodes[0];\n      const transformsAll = utils.findChildren(transformsNode, \"Transform\");\n      for (const transform of transformsAll) {\n        const transformAttr = utils.findAttr(transform, \"Algorithm\");\n\n        if (transformAttr) {\n          transforms.push(transformAttr.value);\n        }\n      }\n\n      // This is a little strange, we are looking for children of the last child of `transformsNode`\n      const inclusiveNamespaces = utils.findChildren(\n        transformsAll[transformsAll.length - 1],\n        \"InclusiveNamespaces\",\n      );\n      if (utils.isArrayHasLength(inclusiveNamespaces)) {\n        // Should really only be one prefix list, but maybe there's some circumstances where more than one to let's handle it\n        inclusiveNamespacesPrefixList = inclusiveNamespaces\n          .flatMap((namespace) => (namespace.getAttribute(\"PrefixList\") ?? \"\").split(\" \"))\n          .filter((value) => value.length > 0);\n      }\n    }\n\n    if (utils.isArrayHasLength(this.implicitTransforms)) {\n      this.implicitTransforms.forEach(function (t) {\n        transforms.push(t);\n      });\n    }\n\n    /**\n     * DigestMethods take an octet stream rather than a node set. If the output of the last transform is a node set, we\n     * need to canonicalize the node set to an octet stream using non-exclusive canonicalization. If there are no\n     * transforms, we need to canonicalize because URI dereferencing for a same-document reference will return a node-set.\n     * @see:\n     * https://www.w3.org/TR/xmldsig-core1/#sec-DigestMethod\n     * https://www.w3.org/TR/xmldsig-core1/#sec-ReferenceProcessingModel\n     * https://www.w3.org/TR/xmldsig-core1/#sec-Same-Document\n     */\n    if (\n      transforms.length === 0 ||\n      transforms[transforms.length - 1] === \"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"\n    ) {\n      transforms.push(\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\");\n    }\n    const refUri = isDomNode.isElementNode(refNode)\n      ? refNode.getAttribute(\"URI\") || undefined\n      : undefined;\n\n    this.addReference({\n      transforms,\n      digestAlgorithm: digestAlgo,\n      uri: refUri,\n      digestValue,\n      inclusiveNamespacesPrefixList,\n      isEmptyUri: false,\n    });\n  }\n\n  /**\n   * Adds a reference to the signature.\n   *\n   * @param xpath The XPath expression to select the XML nodes to be referenced.\n   * @param transforms An array of transform algorithms to be applied to the selected nodes.\n   * @param digestAlgorithm The digest algorithm to use for computing the digest value.\n   * @param uri The URI identifier for the reference. If empty, an empty URI will be used.\n   * @param digestValue The expected digest value for the reference.\n   * @param inclusiveNamespacesPrefixList The prefix list for inclusive namespace canonicalization.\n   * @param isEmptyUri Indicates whether the URI is empty. Defaults to `false`.\n   */\n  addReference({\n    xpath,\n    transforms,\n    digestAlgorithm,\n    uri = \"\",\n    digestValue,\n    inclusiveNamespacesPrefixList = [],\n    isEmptyUri = false,\n  }: Partial<Reference> & Pick<Reference, \"xpath\">): void {\n    if (digestAlgorithm == null) {\n      throw new Error(\"digestAlgorithm is required\");\n    }\n\n    if (!utils.isArrayHasLength(transforms)) {\n      throw new Error(\"transforms must contain at least one transform algorithm\");\n    }\n\n    this.references.push({\n      xpath,\n      transforms,\n      digestAlgorithm,\n      uri,\n      digestValue,\n      inclusiveNamespacesPrefixList,\n      isEmptyUri,\n      getValidatedNode: () => {\n        throw new Error(\n          \"Reference has not been validated yet; Did you call `sig.checkSignature()`?\",\n        );\n      },\n    });\n  }\n\n  /**\n   * Returns the list of references.\n   */\n  getReferences() {\n    // TODO: Refactor once `getValidatedNode` is removed\n    /* Once we completely remove the deprecated `getValidatedNode()` method,\n    we can change this to return a clone to prevent accidental mutations,\n    e.g.:\n    return [...this.references];\n    */\n\n    return this.references;\n  }\n\n  getSignedReferences() {\n    return [...this.signedReferences];\n  }\n\n  /**\n   * Compute the signature of the given XML (using the already defined settings).\n   *\n   * @param xml The XML to compute the signature for.\n   * @param callback A callback function to handle the signature computation asynchronously.\n   * @returns void\n   * @throws TypeError If the xml can not be parsed.\n   */\n  computeSignature(xml: string): void;\n\n  /**\n   * Compute the signature of the given XML (using the already defined settings).\n   *\n   * @param xml The XML to compute the signature for.\n   * @param callback A callback function to handle the signature computation asynchronously.\n   * @returns void\n   * @throws TypeError If the xml can not be parsed.\n   */\n  computeSignature(xml: string, callback: ErrorFirstCallback<SignedXml>): void;\n\n  /**\n   * Compute the signature of the given XML (using the already defined settings).\n   *\n   * @param xml The XML to compute the signature for.\n   * @param opts An object containing options for the signature computation.\n   * @returns If no callback is provided, returns `this` (the instance of SignedXml).\n   * @throws TypeError If the xml can not be parsed, or Error if there were invalid options passed.\n   */\n  computeSignature(xml: string, options: ComputeSignatureOptions): void;\n\n  /**\n   * Compute the signature of the given XML (using the already defined settings).\n   *\n   * @param xml The XML to compute the signature for.\n   * @param opts An object containing options for the signature computation.\n   * @param callback A callback function to handle the signature computation asynchronously.\n   * @returns void\n   * @throws TypeError If the xml can not be parsed, or Error if there were invalid options passed.\n   */\n  computeSignature(\n    xml: string,\n    options: ComputeSignatureOptions,\n    callback: ErrorFirstCallback<SignedXml>,\n  ): void;\n\n  computeSignature(\n    xml: string,\n    options?: ComputeSignatureOptions | ErrorFirstCallback<SignedXml>,\n    callbackParam?: ErrorFirstCallback<SignedXml>,\n  ): void {\n    let callback: ErrorFirstCallback<SignedXml>;\n    if (typeof options === \"function\" && callbackParam == null) {\n      callback = options as ErrorFirstCallback<SignedXml>;\n      options = {} as ComputeSignatureOptions;\n    } else {\n      callback = callbackParam as ErrorFirstCallback<SignedXml>;\n      options = (options ?? {}) as ComputeSignatureOptions;\n    }\n\n    const doc = new xmldom.DOMParser().parseFromString(xml);\n    let xmlNsAttr = \"xmlns\";\n    const signatureAttrs: string[] = [];\n    let currentPrefix: string;\n\n    const validActions = [\"append\", \"prepend\", \"before\", \"after\"];\n\n    const prefix = options.prefix;\n    const attrs = options.attrs || {};\n    const location = options.location || {};\n    const existingPrefixes = options.existingPrefixes || {};\n\n    this.namespaceResolver = {\n      lookupNamespaceURI: function (prefix) {\n        return prefix ? existingPrefixes[prefix] : null;\n      },\n    };\n\n    // defaults to the root node\n    location.reference = location.reference || \"/*\";\n    // defaults to append action\n    location.action = location.action || \"append\";\n\n    if (validActions.indexOf(location.action) === -1) {\n      const err = new Error(\n        `location.action option has an invalid action: ${\n          location.action\n        }, must be any of the following values: ${validActions.join(\", \")}`,\n      );\n      if (!callback) {\n        throw err;\n      } else {\n        callback(err);\n        return;\n      }\n    }\n\n    // automatic insertion of `:`\n    if (prefix) {\n      xmlNsAttr += `:${prefix}`;\n      currentPrefix = `${prefix}:`;\n    } else {\n      currentPrefix = \"\";\n    }\n\n    Object.keys(attrs).forEach(function (name) {\n      if (name !== \"xmlns\" && name !== xmlNsAttr) {\n        signatureAttrs.push(`${name}=\"${attrs[name]}\"`);\n      }\n    });\n\n    // add the xml namespace attribute\n    signatureAttrs.push(`${xmlNsAttr}=\"http://www.w3.org/2000/09/xmldsig#\"`);\n\n    let signatureXml = `<${currentPrefix}Signature ${signatureAttrs.join(\" \")}>`;\n\n    signatureXml += this.createSignedInfo(doc, prefix);\n    signatureXml += this.getKeyInfo(prefix);\n    signatureXml += `</${currentPrefix}Signature>`;\n\n    this.originalXmlWithIds = doc.toString();\n\n    let existingPrefixesString = \"\";\n    Object.keys(existingPrefixes).forEach(function (key) {\n      existingPrefixesString += `xmlns:${key}=\"${existingPrefixes[key]}\" `;\n    });\n\n    // A trick to remove the namespaces that already exist in the xml\n    // This only works if the prefix and namespace match with those in the xml\n    const dummySignatureWrapper = `<Dummy ${existingPrefixesString}>${signatureXml}</Dummy>`;\n    const nodeXml = new xmldom.DOMParser().parseFromString(dummySignatureWrapper);\n\n    // Because we are using a dummy wrapper hack described above, we know there will be a `firstChild`\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    const signatureDoc = nodeXml.documentElement.firstChild!;\n\n    const referenceNode = xpath.select1(location.reference, doc);\n\n    if (!isDomNode.isNodeLike(referenceNode)) {\n      const err2 = new Error(\n        `the following xpath cannot be used because it was not found: ${location.reference}`,\n      );\n      if (!callback) {\n        throw err2;\n      } else {\n        callback(err2);\n        return;\n      }\n    }\n\n    if (location.action === \"append\") {\n      referenceNode.appendChild(signatureDoc);\n    } else if (location.action === \"prepend\") {\n      referenceNode.insertBefore(signatureDoc, referenceNode.firstChild);\n    } else if (location.action === \"before\") {\n      if (referenceNode.parentNode == null) {\n        throw new Error(\n          \"`location.reference` refers to the root node (by default), so we can't insert `before`\",\n        );\n      }\n      referenceNode.parentNode.insertBefore(signatureDoc, referenceNode);\n    } else if (location.action === \"after\") {\n      if (referenceNode.parentNode == null) {\n        throw new Error(\n          \"`location.reference` refers to the root node (by default), so we can't insert `after`\",\n        );\n      }\n      referenceNode.parentNode.insertBefore(signatureDoc, referenceNode.nextSibling);\n    }\n\n    this.signatureNode = signatureDoc;\n    const signedInfoNodes = utils.findChildren(this.signatureNode, \"SignedInfo\");\n    if (signedInfoNodes.length === 0) {\n      const err3 = new Error(\"could not find SignedInfo element in the message\");\n      if (!callback) {\n        throw err3;\n      } else {\n        callback(err3);\n        return;\n      }\n    }\n    const signedInfoNode = signedInfoNodes[0];\n\n    if (typeof callback === \"function\") {\n      // Asynchronous flow\n      this.calculateSignatureValue(doc, (err, signature) => {\n        if (err) {\n          callback(err);\n        } else {\n          this.signatureValue = signature || \"\";\n          signatureDoc.insertBefore(this.createSignature(prefix), signedInfoNode.nextSibling);\n          this.signatureXml = signatureDoc.toString();\n          this.signedXml = doc.toString();\n          callback(null, this);\n        }\n      });\n    } else {\n      // Synchronous flow\n      this.calculateSignatureValue(doc);\n      signatureDoc.insertBefore(this.createSignature(prefix), signedInfoNode.nextSibling);\n      this.signatureXml = signatureDoc.toString();\n      this.signedXml = doc.toString();\n    }\n  }\n\n  private getKeyInfo(prefix) {\n    const currentPrefix = prefix ? `${prefix}:` : \"\";\n\n    let keyInfoAttrs = \"\";\n    if (this.keyInfoAttributes) {\n      Object.keys(this.keyInfoAttributes).forEach((name) => {\n        keyInfoAttrs += ` ${name}=\"${this.keyInfoAttributes[name]}\"`;\n      });\n    }\n\n    const keyInfoContent = this.getKeyInfoContent({ publicCert: this.publicCert, prefix });\n    if (keyInfoAttrs || keyInfoContent) {\n      return `<${currentPrefix}KeyInfo${keyInfoAttrs}>${keyInfoContent}</${currentPrefix}KeyInfo>`;\n    }\n\n    return \"\";\n  }\n\n  /**\n   * Generate the Reference nodes (as part of the signature process)\n   *\n   */\n  private createReferences(doc, prefix) {\n    let res = \"\";\n\n    prefix = prefix || \"\";\n    prefix = prefix ? `${prefix}:` : prefix;\n\n    /* eslint-disable-next-line deprecation/deprecation */\n    for (const ref of this.getReferences()) {\n      const nodes = xpath.selectWithResolver(ref.xpath ?? \"\", doc, this.namespaceResolver);\n\n      if (!utils.isArrayHasLength(nodes)) {\n        throw new Error(\n          `the following xpath cannot be signed because it was not found: ${ref.xpath}`,\n        );\n      }\n\n      for (const node of nodes) {\n        if (ref.isEmptyUri) {\n          res += `<${prefix}Reference URI=\"\">`;\n        } else {\n          const id = this.ensureHasId(node);\n          ref.uri = id;\n          res += `<${prefix}Reference URI=\"#${id}\">`;\n        }\n        res += `<${prefix}Transforms>`;\n        for (const trans of ref.transforms || []) {\n          const transform = this.findCanonicalizationAlgorithm(trans);\n          res += `<${prefix}Transform Algorithm=\"${transform.getAlgorithmName()}\"`;\n          if (utils.isArrayHasLength(ref.inclusiveNamespacesPrefixList)) {\n            res += \">\";\n            res += `<InclusiveNamespaces PrefixList=\"${ref.inclusiveNamespacesPrefixList.join(\n              \" \",\n            )}\" xmlns=\"${transform.getAlgorithmName()}\"/>`;\n            res += `</${prefix}Transform>`;\n          } else {\n            res += \" />\";\n          }\n        }\n\n        const canonXml = this.getCanonReferenceXml(doc, ref, node);\n\n        const digestAlgorithm = this.findHashAlgorithm(ref.digestAlgorithm);\n        res +=\n          `</${prefix}Transforms>` +\n          `<${prefix}DigestMethod Algorithm=\"${digestAlgorithm.getAlgorithmName()}\" />` +\n          `<${prefix}DigestValue>${digestAlgorithm.getHash(canonXml)}</${prefix}DigestValue>` +\n          `</${prefix}Reference>`;\n      }\n    }\n\n    return res;\n  }\n\n  getCanonXml(\n    transforms: Reference[\"transforms\"],\n    node: Node,\n    options: CanonicalizationOrTransformationAlgorithmProcessOptions = {},\n  ) {\n    options.defaultNsForPrefix = options.defaultNsForPrefix ?? SignedXml.defaultNsForPrefix;\n    options.signatureNode = this.signatureNode;\n\n    const canonXml = node.cloneNode(true); // Deep clone\n    let transformedXml: Node | string = canonXml;\n\n    transforms.forEach((transformName) => {\n      if (isDomNode.isNodeLike(transformedXml)) {\n        // If, after processing, `transformedNode` is a string, we can't do anymore transforms on it\n        const transform = this.findCanonicalizationAlgorithm(transformName);\n        transformedXml = transform.process(transformedXml, options);\n      }\n      //TODO: currently transform.process may return either Node or String value (enveloped transformation returns Node, exclusive-canonicalization returns String).\n      //This either needs to be more explicit in the API, or all should return the same.\n      //exclusive-canonicalization returns String since it builds the Xml by hand. If it had used xmldom it would incorrectly minimize empty tags\n      //to <x/> instead of <x></x> and also incorrectly handle some delicate line break issues.\n      //enveloped transformation returns Node since if it would return String consider this case:\n      //<x xmlns:p='ns'><p:y/></x>\n      //if only y is the node to sign then a string would be <p:y/> without the definition of the p namespace. probably xmldom toString() should have added it.\n    });\n\n    return transformedXml.toString();\n  }\n\n  /**\n   * Ensure an element has Id attribute. If not create it with unique value.\n   * Work with both normal and wssecurity Id flavour\n   */\n  private ensureHasId(node) {\n    let attr;\n\n    if (this.idMode === \"wssecurity\") {\n      attr = utils.findAttr(\n        node,\n        \"Id\",\n        \"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\",\n      );\n    } else {\n      this.idAttributes.some((idAttribute) => {\n        attr = utils.findAttr(node, idAttribute);\n        return !!attr; // This will break the loop as soon as a truthy attr is found.\n      });\n    }\n\n    if (attr) {\n      return attr.value;\n    }\n\n    //add the attribute\n    const id = `_${this.id++}`;\n\n    if (this.idMode === \"wssecurity\") {\n      node.setAttributeNS(\n        \"http://www.w3.org/2000/xmlns/\",\n        \"xmlns:wsu\",\n        \"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\",\n      );\n      node.setAttributeNS(\n        \"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\",\n        \"wsu:Id\",\n        id,\n      );\n    } else {\n      node.setAttribute(\"Id\", id);\n    }\n\n    return id;\n  }\n\n  /**\n   * Create the SignedInfo element\n   *\n   */\n  private createSignedInfo(doc, prefix) {\n    if (typeof this.canonicalizationAlgorithm !== \"string\") {\n      throw new Error(\n        \"Missing canonicalizationAlgorithm when trying to create signed info for XML\",\n      );\n    }\n    const transform = this.findCanonicalizationAlgorithm(this.canonicalizationAlgorithm);\n    const algo = this.findSignatureAlgorithm(this.signatureAlgorithm);\n    let currentPrefix;\n\n    currentPrefix = prefix || \"\";\n    currentPrefix = currentPrefix ? `${currentPrefix}:` : currentPrefix;\n\n    let res = `<${currentPrefix}SignedInfo>`;\n    res += `<${currentPrefix}CanonicalizationMethod Algorithm=\"${transform.getAlgorithmName()}\"`;\n    if (utils.isArrayHasLength(this.inclusiveNamespacesPrefixList)) {\n      res += \">\";\n      res += `<InclusiveNamespaces PrefixList=\"${this.inclusiveNamespacesPrefixList.join(\n        \" \",\n      )}\" xmlns=\"${transform.getAlgorithmName()}\"/>`;\n      res += `</${currentPrefix}CanonicalizationMethod>`;\n    } else {\n      res += \" />\";\n    }\n    res += `<${currentPrefix}SignatureMethod Algorithm=\"${algo.getAlgorithmName()}\" />`;\n\n    res += this.createReferences(doc, prefix);\n    res += `</${currentPrefix}SignedInfo>`;\n    return res;\n  }\n\n  /**\n   * Create the Signature element\n   *\n   */\n  private createSignature(prefix?: string) {\n    let xmlNsAttr = \"xmlns\";\n\n    if (prefix) {\n      xmlNsAttr += `:${prefix}`;\n      prefix += \":\";\n    } else {\n      prefix = \"\";\n    }\n\n    const signatureValueXml = `<${prefix}SignatureValue>${this.signatureValue}</${prefix}SignatureValue>`;\n    //the canonicalization requires to get a valid xml node.\n    //we need to wrap the info in a dummy signature since it contains the default namespace.\n    const dummySignatureWrapper = `<${prefix}Signature ${xmlNsAttr}=\"http://www.w3.org/2000/09/xmldsig#\">${signatureValueXml}</${prefix}Signature>`;\n\n    const doc = new xmldom.DOMParser().parseFromString(dummySignatureWrapper);\n\n    // Because we are using a dummy wrapper hack described above, we know there will be a `firstChild`\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    return doc.documentElement.firstChild!;\n  }\n\n  /**\n   * Returns just the signature part, must be called only after {@link computeSignature}\n   *\n   * @returns The signature XML.\n   */\n  getSignatureXml(): string {\n    return this.signatureXml;\n  }\n\n  /**\n   * Returns the original xml with Id attributes added on relevant elements (required for validation), must be called only after {@link computeSignature}\n   *\n   * @returns The original XML with IDs.\n   */\n  getOriginalXmlWithIds(): string {\n    return this.originalXmlWithIds;\n  }\n\n  /**\n   * Returns the original xml document with the signature in it, must be called only after {@link computeSignature}\n   *\n   * @returns The signed XML.\n   */\n  getSignedXml(): string {\n    return this.signedXml;\n  }\n}\n"]}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   {"version":3,"file":"xapi-object-to-xo.mjs","names":["isDefaultTemplate","parseDateTime","Obfuscate","xoData","ensureArray","normalizeVmNetworks","semver","compareVersions","validate","validateVersion","createLogger","extractIpFromVmNetworks","extractProperty","forEach","isEmpty","mapFilter","parseXml","getVmDomainType","isHostRunning","isVmRunning","useUpdateSystem","debug","warn","ALLOCATION_BY_TYPE","ext","file","hba","iscsi","lvhd","lvhdofcoe","lvhdohba","lvhdoiscsi","lvm","lvmofcoe","lvmohba","lvmoiscsi","nfs","ocfs","ocfsohba","ocfsoiscsi","rawhba","rawiscsi","shm","smb","udev","xosan","zfs","defineProperties","freeze","Object","link","obj","prop","idField","dynamicValue","Array","isArray","map","_","toTimestamp","date","undefined","error","getVmGuestToolsProps","vm","$metrics","metrics","$guest_metrics","guestMetrics","build","major","micro","minor","PV_drivers_version","hasPvVersion","pvDriversDetected","PV_drivers_detected","managementAgentDetected","other","pvDriversVersion","pvDriversUpToDate","PV_drivers_up_to_date","XSA468_VULNERABLE_VERSIONS","Xen_Project","xencons","xeniface","xenbus","Amazon_Inc_","XenServer","Citrix","XCP_ng","isVmVulnerable_XSA468","_vm$platform","platform","device_id","versionDetected","key","value","entries","_XSA468_VULNERABLE_VE","includes","vendor","version","split","vendorVulnerableVersion","reason","driver","err","TRANSFORMS","pool","cpuInfo","cpu_info","auto_poweron","other_config","crashDumpSr","current_operations","default_SR","HA_enabled","Boolean","ha_enabled","haSrs","$ha_statefiles","filter","vdi","master","tags","name_description","name_label","$master","migrationCompression","migration_compression","xosanPackInstallationTime","xosan_pack_installation_time","otherConfig","cpus","cores","cpu_count","sockets","socket_count","suspendSr","zstdSupported","restrictions","restrict_zstd_export","vtpmSupported","restrict_vtpm","platform_version","software_version","host","dependents","_obj$$certificates","$id","softwareVersion","isRunning","supplementalPacks","$updates","update","formattedUpdate","name","description","author","guidance","after_apply_guidance","hosts","size","installation_size","startsWith","push","CPUs","address","bios_strings","build_number","chipset_info","iommu","enabled","controlDomain","hostname","iscsiIqn","iscsi_iqn","license_params","license_server","license_expiry","expiry","logging","memory","free","memory_free","total","memory_total","ONE_GIB","Math","ceil","usage","multipathing","patches","powerOnMode","power_on_mode","power_state","residentVms","startTime","boot_time","length","agentStartTime","agent_start_time","rebootRequired","product_brand","rpm_patch_installation_time","updates_requiring_reboot","product_version","productBrand","hvmCapable","capabilities","some","capability","certificates","$certificates","fingerprint","not_after","notAfter","PIFs","$PIFs","PCIs","$PCIs","PGPUs","$PGPUs","$PBDs","_otherConfig$pci","guest_metrics","domainType","isHvm","xenTools","resourceSet","JSON","parse","currentOperations","$xapi","operation","ref","task","getObjectByRef","creation","extract","$container","resident_on","vbd","$VBDs","_vbd$$VDI","sr","$VDI","$SR","shared","pbd","hostId","type","addresses","networks","affinityHost","attachedPcis","pci","s","blockedOperations","blocked_operations","boot","HVM_boot_params","max","VCPUs_max","number","VCPUs_number","VCPUs_at_startup","docker","monitor","docker_ps","process","docker_info","info","docker_version","containers","item","expNestedHvm","isNestedVirtEnabled","satisfies","String","$pool","vulnerabilities","is_a_template","is_a_snapshot","is_control_domain","xsa468","viridian","mainIpAddress","high_availability","ha_restart_priority","isFirmwareSupported","_parseXml","recommendations","restriction","field","firmware","firmwareRestriction","find","dynamicMin","memory_dynamic_min","dynamicMax","memory_dynamic_max","staticMin","memory_static_min","staticMax","memory_static_max","dynamic","static","gmMemory","used","memory_actual","installTime","install_time","needsVtpm","vtpm","notes","os_version","parent","hasVendorDevice","has_vendor_device","snapshots","startDelay","start_delay","start_time","secureBoot","secureboot","VIFs","VTPMs","virtualizationMode","VGPUs","$VGPUs","nicType","nic_type","xenStoreData","xenstore_data","vga","videoram","coresPerSocket","update_platform","catch","finally","snapshot_time","$snapshot_of","suspendVdi","defaultTemplate","id","uuid","template_info","arch","disks","xml","data","provision","disk","normalize","bootable","SR","install_methods","methods","install_repository","cap","mask","weight","VCPUs_params","cpuCap","cpuWeight","cpuMask","PV_args","_obj$$PBDs$","srType","content_type","physical_usage","physical_utilisation","allocationStrategy","device_config","provisioning","inMaintenanceMode","physical_size","SR_type","virtual_allocation","VDIs","sm_config","sm","SM_type","configuration","features","driver_filename","required_cluster_stack","supported_image_formats","attached","currently_attached","replace","pif","isBondMaster","bond_master_of","isBondSlave","bond_slave_of","bond","$bond_master_of","$bond_slave_of","bondMaster","bondSlaves","device","deviceName","device_name","dns","DNS","disallowUnplug","disallow_unplug","gateway","ip","IP","ipv6","IPv6","mac","MAC","management","carrier","mode","ip_configuration_mode","ipv6Mode","ipv6_configuration_mode","mtu","MTU","netmask","physical","primaryAddressType","primary_address_type","vlan","VLAN","speed","$host","$network","cbt_enabled","missing","image_format","virtual_size","VDI_type","managed","is_cd_drive","position","userdevice","read_only","VDI","VM","vif","txChecksumming","allowedIpv4Addresses","ipv4_allowed","allowedIpv6Addresses","ipv6_allowed","lockingMode","locking_mode","rateLimit","qos_algorithm_type","kbps","qos_algorithm_params","$VM","network","_obj$other_config","_obj$purpose","_obj$purpose2","automatic","bridge","defaultIsLocked","default_locking_mode","nbd","purpose","insecureNbd","message","body","time","timestamp","$object","obj_uuid","applies_to","object","getObject","allowedOperations","allowed_operations","created","finished","progress","result","status","xapiRef","$ref","host_patch","poolPatch","$pool_patch","applied","enforceHomogeneity","pool_applied","pool_patch","timestamp_applied","dataUuid","$host_patches","class_name","pci_id","pgpu","dom0Access","dom0_access","enabledVgpuTypes","gpuGroup","isSystemDisplayDevice","is_system_display_device","supportedVgpuMaxCapcities","supportedVgpuTypes","vgpus","$vgpus","vgpu","currentlyAttached","vgpuType","gpu_group","allocation","allocation_algorithm","gpuTypes","GPU_types","pgpus","vgpu_type","experimental","framebufferSize","framebuffer_size","gpuGroups","maxHeads","max_heads","maxResolutionX","max_resolution_x","maxResolutionY","max_resolution_y","modelName","model_name","vendorName","vendor_name","pusb","vendor_desc","product_desc","trim","passthroughEnabled","passthrough_enabled","usbGroup","vendorId","vendor_id","vusb","usb_group","PUSBs","VUSBs","xapiObjectToXo","xapiObj","transform","$type","toLowerCase","xoObj","$poolId","_xapiId","_xapiRef","enumerable"],"sources":["../src/xapi-object-to-xo.mjs"],"sourcesContent":["import { isDefaultTemplate, parseDateTime } from '@xen-orchestra/xapi'\nimport Obfuscate from '@vates/obfuscate'\n\nimport * as xoData from '@xen-orchestra/xapi/xoData.mjs'\nimport ensureArray from './_ensureArray.mjs'\nimport normalizeVmNetworks from './_normalizeVmNetworks.mjs'\nimport semver from 'semver'\nimport { compareVersions, validate as validateVersion } from 'compare-versions'\nimport { createLogger } from '@xen-orchestra/log'\nimport { extractIpFromVmNetworks } from './_extractIpFromVmNetworks.mjs'\nimport { extractProperty, forEach, isEmpty, mapFilter, parseXml } from './utils.mjs'\nimport { getVmDomainType, isHostRunning, isVmRunning } from './xapi/index.mjs'\nimport { useUpdateSystem } from './xapi/utils.mjs'\n\nconst { debug, warn } = createLogger('xo:server:xapi-objects-to-xo')\n\n// ===================================================================\n\nconst ALLOCATION_BY_TYPE = {\n  ext: 'thin',\n  file: 'thin',\n  hba: 'thick',\n  iscsi: 'thick',\n  lvhd: 'thick',\n  lvhdofcoe: 'thick',\n  lvhdohba: 'thick',\n  lvhdoiscsi: 'thick',\n  lvm: 'thick',\n  lvmofcoe: 'thick',\n  lvmohba: 'thick',\n  lvmoiscsi: 'thick',\n  nfs: 'thin',\n  ocfs: 'thick',\n  ocfsohba: 'thick',\n  ocfsoiscsi: 'thick',\n  rawhba: 'thick',\n  rawiscsi: 'thick',\n  shm: 'thin',\n  smb: 'thin',\n  udev: 'thick',\n  xosan: 'thin',\n  zfs: 'thin',\n}\n\n// ===================================================================\n\nconst { defineProperties, freeze } = Object\n\nfunction link(obj, prop, idField = '$id') {\n  const dynamicValue = obj[`$${prop}`]\n  if (dynamicValue == null) {\n    return dynamicValue // Properly handles null and undefined.\n  }\n\n  if (Array.isArray(dynamicValue)) {\n    return dynamicValue.map(_ => _?.[idField])\n  }\n\n  return dynamicValue[idField]\n}\n\nfunction toTimestamp(date) {\n  if (date === undefined) {\n    return null\n  }\n\n  try {\n    return parseDateTime(date)\n  } catch (error) {\n    warn('toTimestamp', { date, error })\n    return null\n  }\n}\n\n// https://github.com/xenserver/xenadmin/blob/093ab0bcd6c4b3dd69da7b1e63ef34bb807c1ddb/XenModel/XenAPI-Extensions/VM.cs#L773-L827\nconst getVmGuestToolsProps = vm => {\n  const { $metrics: metrics, $guest_metrics: guestMetrics } = vm\n  if (!isVmRunning(vm) || metrics === undefined || guestMetrics === undefined) {\n    return {}\n  }\n\n  const { build, major, micro, minor } = guestMetrics.PV_drivers_version\n  const hasPvVersion = major !== undefined && minor !== undefined\n\n  // \"PV_drivers_detected\" field doesn't exist on XS < 7\n  const pvDriversDetected = guestMetrics.PV_drivers_detected ?? hasPvVersion\n\n  return {\n    // Linux VMs don't have the flag \"feature-static-ip-setting\"\n    managementAgentDetected: hasPvVersion || guestMetrics.other['feature-static-ip-setting'] === '1',\n    pvDriversDetected,\n    pvDriversVersion: hasPvVersion ? `${major}.${minor}.${micro}-${build}` : undefined,\n    pvDriversUpToDate: pvDriversDetected ? guestMetrics.PV_drivers_up_to_date : undefined,\n  }\n}\n\n// ***** May 2025 - Xen Security Advisory XSA-468 - Windows PV drivers vulnerability *****\n\n// Vendor → (driver → version)\nconst XSA468_VULNERABLE_VERSIONS = {\n  Xen_Project: {\n    xencons: '9.1.0.2',\n    xeniface: '9.1.0.0',\n    xenbus: '9.1.0.1',\n  },\n  Amazon_Inc_: {\n    xeniface: '8.3.0',\n  },\n  XenServer: {\n    xeniface: '9.1.12.93',\n    xenbus: '9.1.11.114',\n  },\n  Citrix: {\n    xeniface: '9.1.1.11',\n    xenbus: '9.1.2.14',\n  },\n  XCP_ng: {\n    xencons: '9.0.9048.9047',\n    xeniface: '9.0.9048.9047',\n    xenbus: '9.0.9048.9047',\n  },\n}\nconst isVmVulnerable_XSA468 = vm => {\n  if (vm.platform?.device_id !== '0002') {\n    // Not a Windows VM\n    return false\n  }\n\n  const guestMetrics = vm.$guest_metrics\n  if (guestMetrics === undefined) {\n    return false\n  }\n\n  if (!guestMetrics.PV_drivers_detected) {\n    // No PV drivers installed: no vulnerability\n    return false\n  }\n\n  const pvDriversVersion = guestMetrics.PV_drivers_version\n  let versionDetected = false\n  for (const [key, value] of Object.entries(pvDriversVersion)) {\n    if (['major', 'minor', 'micro', 'build'].includes(key)) {\n      continue\n    }\n\n    const [vendor, version] = value.split(' ')\n    if (!validateVersion(version)) {\n      warn(`Invalid version number for ${vendor}: ${key} ${version}`)\n      continue\n    }\n\n    const vendorVulnerableVersion = XSA468_VULNERABLE_VERSIONS[vendor]?.[key]\n    if (vendorVulnerableVersion === undefined) {\n      continue\n    }\n\n    versionDetected = true\n\n    try {\n      if (compareVersions(version, vendorVulnerableVersion) <= 0) {\n        // PV drivers installed and vulnerable version detected\n        return { reason: 'pv-driver-version-vulnerable', driver: key, version }\n      }\n    } catch (err) {\n      warn(err)\n    }\n  }\n\n  // - PV drivers installed and could check safe versions: no vulnerability\n  // - PV drivers installed but could not check versions: potential vulnerability\n  return versionDetected ? false : { reason: 'no-pv-drivers-detected' }\n}\n\n// ***************************************************************************************\n\n// ===================================================================\n\nconst TRANSFORMS = {\n  pool(obj) {\n    const cpuInfo = obj.cpu_info\n    return {\n      auto_poweron: obj.other_config.auto_poweron === 'true',\n      crashDumpSr: link(obj, 'crash_dump_SR'),\n      current_operations: obj.current_operations,\n      default_SR: link(obj, 'default_SR'),\n      HA_enabled: Boolean(obj.ha_enabled),\n\n      // ignore undefined VDIs, which occurs if the objects were not fetched/cached yet.\n      haSrs: obj.$ha_statefiles.filter(vdi => vdi !== undefined).map(vdi => link(vdi, 'SR')),\n\n      master: link(obj, 'master'),\n      tags: obj.tags,\n      name_description: obj.name_description,\n      name_label: obj.name_label || obj.$master.name_label,\n      migrationCompression: obj.migration_compression,\n      xosanPackInstallationTime: toTimestamp(obj.other_config.xosan_pack_installation_time),\n      otherConfig: obj.other_config,\n      cpus: {\n        cores: cpuInfo && +cpuInfo.cpu_count,\n        sockets: cpuInfo && +cpuInfo.socket_count,\n      },\n      suspendSr: link(obj, 'suspend_image_SR'),\n      zstdSupported: obj.restrictions.restrict_zstd_export === 'false',\n      vtpmSupported: obj.restrictions.restrict_vtpm === 'false',\n      platform_version: obj.$master.software_version.platform_version,\n\n      // TODO\n      // - ? networks = networksByPool.items[pool.id] (network.$pool.id)\n      // - hosts = hostsByPool.items[pool.id] (host.$pool.$id)\n      // - patches = poolPatchesByPool.items[pool.id] (poolPatch.$pool.id)\n      // - SRs = srsByContainer.items[pool.id] (sr.$container.id)\n      // - templates = vmTemplatesByContainer.items[pool.id] (vmTemplate.$container.$id)\n      // - VMs = vmsByContainer.items[pool.id] (vm.$container.id)\n      // - $running_hosts = runningHostsByPool.items[pool.id] (runningHost.$pool.id)\n      // - $running_VMs = runningVmsByPool.items[pool.id] (runningHost.$pool.id)\n      // - $VMs = vmsByPool.items[pool.id] (vm.$pool.id)\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  host(obj, dependents) {\n    dependents[obj.metrics] = obj.$id\n\n    const { $metrics: metrics, other_config: otherConfig, software_version: softwareVersion } = obj\n\n    const isRunning = isHostRunning(obj)\n    let supplementalPacks\n\n    if (useUpdateSystem(obj)) {\n      supplementalPacks = []\n\n      forEach(obj.$updates, update => {\n        const formattedUpdate = {\n          name: update.name_label,\n          description: update.name_description,\n          author: update.key.split('-')[3],\n          version: update.version,\n          guidance: update.after_apply_guidance,\n          hosts: link(update, 'hosts'),\n          vdi: link(update, 'vdi'),\n          size: update.installation_size,\n        }\n\n        if (update.name_label.startsWith('XS')) {\n          // It's a patch update but for homogeneity, we're still using pool_patches\n        } else {\n          supplementalPacks.push(formattedUpdate)\n        }\n      })\n    }\n\n    const cpuInfo = obj.cpu_info\n\n    return {\n      // Deprecated\n      CPUs: cpuInfo,\n\n      address: obj.address,\n      bios_strings: obj.bios_strings,\n      build: softwareVersion.build_number,\n      chipset_info: {\n        iommu: obj.chipset_info.iommu !== undefined ? obj.chipset_info.iommu === 'true' : undefined,\n      },\n      enabled: Boolean(obj.enabled),\n      controlDomain: link(obj, 'control_domain'),\n      cpus: {\n        cores: cpuInfo && +cpuInfo.cpu_count,\n        sockets: cpuInfo && +cpuInfo.socket_count,\n      },\n      current_operations: obj.current_operations,\n      hostname: obj.hostname,\n      iscsiIqn: obj.iscsi_iqn ?? otherConfig.iscsi_iqn ?? '',\n      zstdSupported: obj.license_params.restrict_zstd_export === 'false',\n      license_params: obj.license_params,\n      license_server: obj.license_server,\n      license_expiry: toTimestamp(obj.license_params.expiry),\n      logging: obj.logging,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      memory: (function () {\n        if (metrics) {\n          const free = +metrics.memory_free\n          let total = +metrics.memory_total\n          const ONE_GIB = 1024 * 1024 * 1024\n          total = Math.ceil(total / ONE_GIB) * ONE_GIB\n\n          return {\n            usage: total - free,\n            size: total,\n          }\n        }\n\n        return {\n          usage: 0,\n          size: 0,\n\n          // Deprecated\n          total: 0,\n        }\n      })(),\n      multipathing: otherConfig.multipathing === 'true',\n      otherConfig,\n      patches: link(obj, 'patches'),\n      powerOnMode: obj.power_on_mode,\n      power_state: metrics ? (isRunning ? 'Running' : 'Halted') : 'Unknown',\n      residentVms: link(obj, 'resident_VMs'),\n      startTime: toTimestamp(otherConfig.boot_time),\n      supplementalPacks:\n        supplementalPacks ||\n        mapFilter(softwareVersion, (value, key) => {\n          let author, name\n          if (([author, name] = key.split(':')).length === 2) {\n            const [description, version] = value.split(', ')\n            return {\n              name,\n              description,\n              author,\n              version: version.split(' ')[1],\n            }\n          }\n        }),\n      agentStartTime: toTimestamp(otherConfig.agent_start_time),\n      rebootRequired:\n        softwareVersion.product_brand === 'XCP-ng'\n          ? toTimestamp(otherConfig.boot_time) < +otherConfig.rpm_patch_installation_time\n          : !isEmpty(obj.updates_requiring_reboot),\n      tags: obj.tags,\n      version: softwareVersion.product_version,\n      productBrand: softwareVersion.product_brand,\n      hvmCapable: obj.capabilities.some(capability => capability.startsWith('hvm')),\n\n      // Only exists on XCP-ng/CH >= 8.2\n      certificates: obj.$certificates?.map(({ fingerprint, not_after }) => ({\n        fingerprint,\n        notAfter: toTimestamp(not_after),\n      })),\n\n      // TODO: dedupe.\n      PIFs: link(obj, 'PIFs'),\n      $PIFs: link(obj, 'PIFs'),\n      PCIs: link(obj, 'PCIs'),\n      $PCIs: link(obj, 'PCIs'),\n      PGPUs: link(obj, 'PGPUs'),\n      $PGPUs: link(obj, 'PGPUs'),\n\n      $PBDs: link(obj, 'PBDs'),\n\n      // TODO:\n      // - controller = vmControllersByContainer.items[host.id]\n      // - SRs = srsByContainer.items[host.id]\n      // - tasks = tasksByHost.items[host.id]\n      // - templates = vmTemplatesByContainer.items[host.id]\n      // - VMs = vmsByContainer.items[host.id]\n      // - $vCPUs = sum(host.VMs, vm => host.CPUs.number)\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vm(obj, dependents) {\n    dependents[obj.guest_metrics] = obj.$id\n    dependents[obj.metrics] = obj.$id\n\n    const { $guest_metrics: guestMetrics, $metrics: metrics, other_config: otherConfig } = obj\n\n    const domainType = getVmDomainType(obj)\n    const isHvm = domainType === 'hvm'\n    const isRunning = isVmRunning(obj)\n    const xenTools = (() => {\n      if (!isRunning || !metrics) {\n        // Unknown status, returns nothing.\n        return\n      }\n\n      if (guestMetrics === undefined) {\n        return false\n      }\n\n      const { major, minor } = guestMetrics.PV_drivers_version\n\n      if (major === undefined || minor === undefined) {\n        return false\n      }\n\n      return {\n        major: +major,\n        minor: +minor,\n        version: +`${major}.${minor}`,\n      }\n    })()\n\n    let resourceSet = otherConfig['xo:resource_set']\n    if (resourceSet) {\n      try {\n        resourceSet = JSON.parse(resourceSet)\n      } catch (_) {\n        resourceSet = undefined\n      }\n    }\n\n    // Build a { taskId → operation } map instead of forwarding the\n    // { taskRef → operation } map directly\n    const currentOperations = {}\n    const { $xapi } = obj\n    forEach(obj.current_operations, (operation, ref) => {\n      const task = $xapi.getObjectByRef(ref, undefined)\n      if (task !== undefined) {\n        currentOperations[task.$id] = operation\n      }\n    })\n\n    const { creation } = xoData.extract(obj) ?? {}\n\n    let $container\n    if (obj.resident_on !== 'OpaqueRef:NULL') {\n      // resident_on is set when the VM is running (or paused or suspended on a host)\n      $container = link(obj, 'resident_on')\n    } else {\n      // if the VM is halted, the $container is the pool\n      $container = link(obj, 'pool')\n\n      // unless one of its VDI is on a non shared SR\n      //\n      // linked objects may not be there when this code run, and it will only be\n      // refreshed when the VM XAPI record change, this value is not guaranteed\n      // to be up-to-date, but it practice it appears to work fine thanks to\n      // `VBDs` and `current_operations` changing when a VDI is\n      // added/removed/migrated\n      for (const vbd of obj.$VBDs) {\n        const sr = vbd?.$VDI?.$SR\n        if (sr !== undefined && !sr.shared) {\n          const pbd = sr.$PBDs[0]\n          const hostId = pbd && link(pbd, 'host')\n          if (hostId !== undefined) {\n            $container = hostId\n            break\n          }\n        }\n      }\n    }\n\n    const vm = {\n      // type is redefined after for controllers/, templates &\n      // snapshots.\n      type: 'VM',\n\n      addresses: normalizeVmNetworks(guestMetrics?.networks ?? {}),\n      affinityHost: link(obj, 'affinity'),\n      attachedPcis: otherConfig.pci?.split(',')?.map(s => s.split('/')[1]),\n      auto_poweron: otherConfig.auto_poweron === 'true',\n      bios_strings: obj.bios_strings,\n      blockedOperations: obj.blocked_operations,\n      boot: obj.HVM_boot_params,\n      CPUs: {\n        max: +obj.VCPUs_max,\n        number: isRunning && metrics && xenTools ? +metrics.VCPUs_number : +obj.VCPUs_at_startup,\n      },\n      creation,\n      current_operations: currentOperations,\n      docker: (function () {\n        const monitor = otherConfig['xscontainer-monitor']\n        if (!monitor) {\n          return\n        }\n\n        if (monitor === 'False') {\n          return {\n            enabled: false,\n          }\n        }\n\n        const { docker_ps: process, docker_info: info, docker_version: version } = otherConfig\n\n        return {\n          enabled: true,\n          info: info && parseXml(info).docker_info,\n          containers: ensureArray(process && parseXml(process).docker_ps.item),\n          process: process && parseXml(process).docker_ps, // deprecated (only used in v4)\n          version: version && parseXml(version).docker_version,\n        }\n      })(),\n      // deprecated, use isNestedVirtEnabled instead\n      expNestedHvm: obj.platform['exp-nested-hvm'] === 'true',\n      isNestedVirtEnabled: semver.satisfies(String(obj.$pool.$master.software_version.platform_version), '>=3.4')\n        ? obj.platform['nested-virt'] === 'true'\n        : obj.platform['exp-nested-hvm'] === 'true',\n      vulnerabilities:\n        obj.is_a_template || obj.is_a_snapshot || obj.is_control_domain\n          ? undefined\n          : { xsa468: isVmVulnerable_XSA468(obj) },\n      viridian: obj.platform.viridian === 'true',\n      mainIpAddress: extractIpFromVmNetworks(guestMetrics?.networks),\n      high_availability: obj.ha_restart_priority,\n      isFirmwareSupported: (() => {\n        const restrictions = parseXml(obj.recommendations)?.restrictions?.restriction\n\n        if (restrictions === undefined) {\n          return true\n        }\n\n        const field = `supports-${obj.HVM_boot_params.firmware}`\n        const firmwareRestriction = restrictions.find(restriction => restriction.field === field)\n\n        return firmwareRestriction === undefined || firmwareRestriction.value !== 'no'\n      })(),\n      memory: (function () {\n        const dynamicMin = +obj.memory_dynamic_min\n        const dynamicMax = +obj.memory_dynamic_max\n        const staticMin = +obj.memory_static_min\n        const staticMax = +obj.memory_static_max\n\n        const memory = {\n          dynamic: [dynamicMin, dynamicMax],\n          static: [staticMin, staticMax],\n        }\n\n        const gmMemory = guestMetrics && guestMetrics.memory\n\n        if (!isRunning) {\n          memory.size = dynamicMax\n        } else if (gmMemory && gmMemory.used) {\n          memory.usage = +gmMemory.used\n          memory.size = +gmMemory.total\n        } else if (metrics) {\n          memory.size = +metrics.memory_actual\n        } else {\n          memory.size = dynamicMax\n        }\n\n        return memory\n      })(),\n      installTime: metrics && toTimestamp(metrics.install_time),\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      needsVtpm: obj.platform.vtpm === 'true',\n      notes: otherConfig['xo:notes'],\n      other: otherConfig,\n      os_version: (guestMetrics && guestMetrics.os_version) || null,\n      parent: link(obj, 'parent'),\n      power_state: obj.power_state,\n      hasVendorDevice: obj.has_vendor_device,\n      resourceSet,\n      snapshots: link(obj, 'snapshots'),\n      startDelay: +obj.start_delay,\n      startTime: metrics && toTimestamp(metrics.start_time),\n      secureBoot: obj.platform.secureboot === 'true',\n      suspendSr: link(obj, 'suspend_SR'),\n      tags: obj.tags,\n      VIFs: link(obj, 'VIFs'),\n      VTPMs: link(obj, 'VTPMs'),\n      virtualizationMode: domainType,\n\n      // deprecated, use pvDriversVersion instead\n      xenTools,\n      ...getVmGuestToolsProps(obj),\n\n      $container,\n      $VBDs: link(obj, 'VBDs'),\n\n      // TODO: dedupe\n      VGPUs: link(obj, 'VGPUs'),\n      $VGPUs: link(obj, 'VGPUs'),\n      nicType: obj.platform.nic_type,\n      xenStoreData: obj.xenstore_data,\n    }\n\n    if (isHvm) {\n      const { vga, videoram } = obj.platform\n      vm.vga = vga ?? 'cirrus'\n      vm.videoram = +(videoram ?? 4)\n    }\n\n    const coresPerSocket = obj.platform['cores-per-socket']\n    if (coresPerSocket !== undefined) {\n      vm.coresPerSocket = +coresPerSocket\n    } else {\n      // https://github.com/vatesfr/xen-orchestra/issues/9111\n      // TODO: Remove when correctly handled by XCP-ng\n      obj\n        .update_platform('cores-per-socket', String(vm.CPUs.number))\n        .catch(err => {\n          warn(`unable to set default cores per socket property for VM: ${obj.$id}`, err)\n        })\n        .finally(() => {\n          debug(`cores-per-socket was called for: ${obj.$id}`)\n        })\n    }\n\n    if (obj.is_control_domain) {\n      vm.type += '-controller'\n    } else if (obj.is_a_snapshot) {\n      vm.type += '-snapshot'\n\n      vm.snapshot_time = toTimestamp(obj.snapshot_time)\n      vm.$snapshot_of = link(obj, 'snapshot_of')\n      vm.suspendVdi = link(obj, 'suspend_VDI')\n    } else if (obj.is_a_template) {\n      const defaultTemplate = isDefaultTemplate(obj)\n      vm.type += '-template'\n      if (defaultTemplate) {\n        // scope by pool because default templates have the same UUID across pools\n        vm.id = obj.$pool.uuid + '-' + obj.uuid\n      }\n\n      vm.CPUs.number = +obj.VCPUs_at_startup\n      vm.isDefaultTemplate = defaultTemplate\n      vm.template_info = {\n        arch: otherConfig['install-arch'],\n        disks: (function () {\n          const { disks: xml } = otherConfig\n          let data\n          if (!xml || !(data = parseXml(xml)).provision) {\n            return []\n          }\n\n          const disks = ensureArray(data.provision.disk)\n          forEach(disks, function normalize(disk) {\n            disk.bootable = disk.bootable === 'true'\n            disk.size = +disk.size\n            disk.SR = extractProperty(disk, 'sr')\n          })\n\n          return disks\n        })(),\n        install_methods: (function () {\n          const methods = otherConfig['install-methods']\n\n          return methods ? methods.split(',') : []\n        })(),\n        install_repository: otherConfig['install-repository'],\n      }\n    }\n\n    const { cap, mask, weight } = obj.VCPUs_params ?? {}\n    if (cap != null) {\n      vm.cpuCap = +cap\n    }\n    if (weight != null) {\n      vm.cpuWeight = +weight\n    }\n\n    vm.cpuMask = mask?.split(',').map(_ => +_)\n\n    if (!isHvm) {\n      vm.PV_args = obj.PV_args\n    }\n\n    return vm\n  },\n\n  // -----------------------------------------------------------------\n\n  sr(obj) {\n    const srType = obj.type\n    return {\n      type: 'SR',\n\n      content_type: obj.content_type,\n\n      // TODO: Should it replace usage?\n      physical_usage: +obj.physical_utilisation,\n\n      allocationStrategy:\n        srType === 'linstor' ? (obj.$PBDs[0]?.device_config.provisioning ?? 'unknown') : ALLOCATION_BY_TYPE[srType],\n      current_operations: obj.current_operations,\n      inMaintenanceMode: obj.other_config['xo:maintenanceState'] !== undefined,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      size: +obj.physical_size,\n      shared: Boolean(obj.shared),\n      SR_type: srType,\n      tags: obj.tags,\n      usage: +obj.virtual_allocation,\n      VDIs: link(obj, 'VDIs'),\n      other_config: obj.other_config,\n      sm_config: obj.sm_config,\n\n      $container: obj.shared || !obj.$PBDs[0] ? link(obj, 'pool') : link(obj.$PBDs[0], 'host'),\n      $PBDs: link(obj, 'PBDs'),\n    }\n  },\n\n  sm(obj) {\n    return {\n      type: 'SM',\n      uuid: obj.uuid,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n\n      SM_type: obj.type,\n      configuration: obj.configuration,\n      vendor: obj.vendor,\n      features: obj.features,\n      driver_filename: obj.driver_filename,\n      required_cluster_stack: obj.required_cluster_stack,\n      supported_image_formats: obj.supported_image_formats ?? [],\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pbd(obj) {\n    return {\n      type: 'PBD',\n\n      attached: Boolean(obj.currently_attached),\n      host: link(obj, 'host'),\n      SR: link(obj, 'SR'),\n      device_config: Obfuscate.replace(obj.device_config, '* obfuscated *'),\n      otherConfig: obj.other_config,\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pif(obj) {\n    const metrics = obj.$metrics\n    const isBondMaster = !isEmpty(obj.bond_master_of)\n    const isBondSlave = obj.bond_slave_of !== 'OpaqueRef:NULL'\n\n    // Why is `bond_master_of` a list? Getting the first one in the list seems to be the right way:\n    // https://github.com/xcp-ng/xenadmin/blob/4a9d971dadd04c62f7f77f5ccf1089b4aaa59639/XenModel/XenAPI-Extensions/PIF.cs#L246-L252\n    const bond = isBondMaster ? obj.$bond_master_of[0] : isBondSlave ? obj.$bond_slave_of : undefined\n\n    return {\n      type: 'PIF',\n\n      attached: Boolean(obj.currently_attached),\n      isBondMaster,\n      isBondSlave,\n      bondMaster: isBondSlave ? link(bond, 'master') : undefined,\n      bondSlaves: isBondMaster ? link(bond, 'slaves') : undefined,\n      device: obj.device,\n      deviceName: metrics && metrics.device_name,\n      dns: obj.DNS,\n      disallowUnplug: Boolean(obj.disallow_unplug),\n      gateway: obj.gateway,\n      ip: obj.IP,\n      ipv6: obj.IPv6,\n      mac: obj.MAC,\n      management: Boolean(obj.management), // TODO: find a better name.\n      carrier: Boolean(metrics && metrics.carrier),\n      mode: obj.ip_configuration_mode,\n      ipv6Mode: obj.ipv6_configuration_mode,\n      mtu: +obj.MTU,\n      netmask: obj.netmask,\n      // A non physical PIF is a \"copy\" of an existing physical PIF (same device)\n      // A physical PIF cannot be unplugged\n      physical: Boolean(obj.physical),\n      primaryAddressType: obj.primary_address_type,\n      vlan: +obj.VLAN,\n      speed: metrics && +metrics.speed,\n      $host: link(obj, 'host'),\n      $network: link(obj, 'network'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vdi(obj) {\n    const vdi = {\n      type: 'VDI',\n\n      cbt_enabled: obj.cbt_enabled,\n      missing: obj.missing,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      parent: obj.sm_config['vhd-parent'],\n      image_format: obj.sm_config['image-format'],\n      size: +obj.virtual_size,\n      snapshots: link(obj, 'snapshots'),\n      tags: obj.tags,\n      usage: +obj.physical_utilisation,\n      VDI_type: obj.type,\n      current_operations: obj.current_operations,\n      other_config: obj.other_config,\n\n      $SR: link(obj, 'SR'),\n      $VBDs: link(obj, 'VBDs'),\n    }\n\n    if (obj.is_a_snapshot) {\n      vdi.type += '-snapshot'\n      vdi.snapshot_time = toTimestamp(obj.snapshot_time)\n      vdi.$snapshot_of = link(obj, 'snapshot_of')\n    } else if (!obj.managed) {\n      vdi.type += '-unmanaged'\n    }\n\n    return vdi\n  },\n\n  // -----------------------------------------------------------------\n\n  vbd(obj) {\n    return {\n      type: 'VBD',\n\n      attached: Boolean(obj.currently_attached),\n      bootable: Boolean(obj.bootable),\n      device: obj.device || null,\n      is_cd_drive: obj.type === 'CD',\n      position: obj.userdevice,\n      read_only: obj.mode === 'RO',\n      VDI: link(obj, 'VDI'),\n      VM: link(obj, 'VM'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vif(obj) {\n    const txChecksumming = obj.other_config['ethtool-tx']\n    return {\n      type: 'VIF',\n\n      allowedIpv4Addresses: obj.ipv4_allowed,\n      allowedIpv6Addresses: obj.ipv6_allowed,\n      attached: Boolean(obj.currently_attached),\n      device: obj.device, // TODO: should it be cast to a number?\n      lockingMode: obj.locking_mode,\n      MAC: obj.MAC,\n      MTU: +obj.MTU,\n      other_config: obj.other_config,\n\n      // See: https://xapi-project.github.io/xen-api/networking.html\n      txChecksumming: !(txChecksumming === 'false' || txChecksumming === 'off'),\n\n      // in kB/s\n      rateLimit: (() => {\n        if (obj.qos_algorithm_type === 'ratelimit') {\n          const { kbps } = obj.qos_algorithm_params\n          if (kbps !== undefined) {\n            return +kbps\n          }\n        }\n      })(),\n\n      $network: link(obj, 'network'),\n      $VM: link(obj, 'VM'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  network(obj) {\n    return {\n      automatic: obj.other_config?.automatic === 'true',\n      bridge: obj.bridge,\n      current_operations: obj.current_operations,\n      defaultIsLocked: obj.default_locking_mode === 'disabled',\n      MTU: +obj.MTU,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      other_config: obj.other_config,\n      tags: obj.tags,\n      PIFs: link(obj, 'PIFs'),\n      VIFs: link(obj, 'VIFs'),\n      nbd: obj.purpose?.includes('nbd'),\n      insecureNbd: obj.purpose?.includes('insecure_nbd'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  message(obj) {\n    return {\n      body: obj.body,\n      name: obj.name,\n      time: toTimestamp(obj.timestamp),\n\n      $object: obj.obj_uuid, // Special link as it is already an UUID.\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  task(obj) {\n    let applies_to\n    if (obj.other_config.applies_to) {\n      const object = obj.$xapi.getObject(obj.other_config.applies_to, undefined)\n      if (object === undefined) {\n        debug(`Unknown other_config.applies_to reference ${obj.other_config.applies_to} in task ${obj.$id}`)\n      } else {\n        applies_to = object.uuid\n      }\n    }\n    return {\n      allowedOperations: obj.allowed_operations,\n      created: toTimestamp(obj.created),\n      current_operations: obj.current_operations,\n      finished: toTimestamp(obj.finished),\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      progress: +obj.progress,\n      result: obj.result,\n      status: obj.status,\n      xapiRef: obj.$ref,\n      applies_to,\n      $host: link(obj, 'resident_on'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  host_patch(obj) {\n    const poolPatch = obj.$pool_patch\n    return {\n      type: 'patch',\n\n      applied: Boolean(obj.applied),\n      enforceHomogeneity: poolPatch.pool_applied,\n      description: poolPatch.name_description,\n      name: poolPatch.name_label,\n      pool_patch: poolPatch.$ref,\n      size: +poolPatch.size,\n      guidance: poolPatch.after_apply_guidance,\n      time: toTimestamp(obj.timestamp_applied),\n\n      $host: link(obj, 'host'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pool_patch(obj) {\n    return {\n      id: obj.$ref,\n\n      dataUuid: obj.uuid, // UUID of the patch file as stated in Citrix's XML file\n      description: obj.name_description,\n      guidance: obj.after_apply_guidance,\n      name: obj.name_label,\n      size: +obj.size,\n      uuid: obj.$ref,\n\n      // TODO: means that the patch must be applied on every host\n      // applied: Boolean(obj.pool_applied),\n\n      // TODO: what does it mean, should we handle it?\n      // version: obj.version,\n\n      // TODO: host.[$]pool_patches ←→ pool.[$]host_patches\n      $host_patches: link(obj, 'host_patches'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pci(obj) {\n    return {\n      type: 'PCI',\n\n      class_name: obj.class_name,\n      device_name: obj.device_name,\n      pci_id: obj.pci_id,\n\n      $host: link(obj, 'host'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pgpu(obj) {\n    return {\n      type: 'PGPU',\n\n      dom0Access: obj.dom0_access,\n      enabledVgpuTypes: link(obj, 'enabled_VGPU_types'),\n      gpuGroup: link(obj, 'GPU_group'),\n      isSystemDisplayDevice: Boolean(obj.is_system_display_device),\n      pci: link(obj, 'PCI'),\n      supportedVgpuMaxCapcities: link(obj, 'supported_VGPU_max_capacities'),\n      supportedVgpuTypes: link(obj, 'supported_VGPU_types'),\n\n      // TODO: dedupe.\n      host: link(obj, 'host'),\n      $host: link(obj, 'host'),\n      vgpus: link(obj, 'resident_VGPUs'),\n      $vgpus: link(obj, 'resident_VGPUs'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vgpu(obj) {\n    return {\n      type: 'vgpu',\n\n      currentlyAttached: Boolean(obj.currently_attached),\n      device: obj.device,\n      gpuGroup: link(obj, 'GPU_group'),\n      otherConfig: obj.other_config,\n      resident_on: link(obj, 'resident_on'),\n      vgpuType: link(obj, '$type'),\n      vm: link(obj, 'VM'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  gpu_group(obj) {\n    return {\n      type: 'gpuGroup',\n\n      allocation: obj.allocation_algorithm,\n      enabledVgpuTypes: link(obj, 'enabled_VGPU_types'),\n      gpuTypes: obj.GPU_types,\n      name_description: obj.name_description,\n      name_label: obj.name_label,\n      otherConfig: obj.other_config,\n      pgpus: link(obj, 'PGPUs'),\n      supportedVgpuTypes: link(obj, 'supported_VGPU_types'),\n      vgpus: link(obj, 'VGPUs'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vgpu_type(obj) {\n    return {\n      type: 'vgpuType',\n\n      experimental: Boolean(obj.experimental),\n      framebufferSize: obj.framebuffer_size,\n      gpuGroups: link(obj, 'enabled_on_GPU_groups'),\n      maxHeads: obj.max_heads,\n      maxResolutionX: obj.max_resolution_x,\n      maxResolutionY: obj.max_resolution_y,\n      modelName: obj.model_name,\n      pgpus: link(obj, 'enabled_on_PGPUs'),\n      vendorName: obj.vendor_name,\n      vgpus: link(obj, 'VGPUs'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vtpm(obj) {\n    return {\n      type: 'VTPM',\n\n      vm: link(obj, 'VM'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  pusb(obj) {\n    let description = obj.vendor_desc\n    if (obj.product_desc.trim() !== '') {\n      description += ` - ${obj.product_desc.trim()}`\n    }\n    return {\n      type: 'PUSB',\n\n      description,\n      host: link(obj, 'host'),\n      passthroughEnabled: obj.passthrough_enabled,\n      speed: obj.speed,\n      usbGroup: link(obj, 'USB_group'),\n      vendorId: obj.vendor_id,\n      version: obj.version,\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  vusb(obj) {\n    return {\n      type: 'VUSB',\n\n      vm: link(obj, 'VM'),\n      currentlyAttached: obj.currently_attached,\n      usbGroup: link(obj, 'USB_group'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  usb_group(obj) {\n    return {\n      type: 'USB_group',\n\n      PUSBs: link(obj, 'PUSBs'),\n      VUSBs: link(obj, 'VUSBs'),\n    }\n  },\n\n  // -----------------------------------------------------------------\n\n  bond(obj) {\n    return {\n      type: 'bond',\n      master: link(obj, 'master'),\n      mode: obj.mode,\n    }\n  },\n}\n\n// ===================================================================\n\nexport default function xapiObjectToXo(xapiObj, dependents = {}) {\n  const transform = TRANSFORMS[xapiObj.$type.toLowerCase()]\n  if (!transform) {\n    return\n  }\n\n  const xoObj = transform(xapiObj, dependents)\n  if (!xoObj) {\n    return\n  }\n\n  if (!('id' in xoObj)) {\n    xoObj.id = xapiObj.$id\n  }\n  if (!('type' in xoObj)) {\n    xoObj.type = xapiObj.$type\n  }\n  if ('uuid' in xapiObj && !('uuid' in xoObj)) {\n    xoObj.uuid = xapiObj.uuid\n  }\n  xoObj.$pool = xapiObj.$pool.$id\n  xoObj.$poolId = xoObj.$pool // TODO: deprecated, remove when no longer used in xo-web\n\n  // Internal properties.\n  defineProperties(xoObj, {\n    _xapiId: {\n      value: xapiObj.$id,\n    },\n    _xapiRef: {\n      enumerable: true,\n      value: xapiObj.$ref,\n    },\n  })\n\n  // Freezes and returns the new object.\n  return freeze(xoObj)\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,aAAa,QAAQ,qBAAqB;AACtE,OAAOC,SAAS,MAAM,kBAAkB;AAExC,OAAO,KAAKC,MAAM,MAAM,gCAAgC;AACxD,OAAOC,WAAW,MAAM,oBAAoB;AAC5C,OAAOC,mBAAmB,MAAM,4BAA4B;AAC5D,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,eAAe,EAAEC,QAAQ,IAAIC,eAAe,QAAQ,kBAAkB;AAC/E,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,uBAAuB,QAAQ,gCAAgC;AACxE,SAASC,eAAe,EAAEC,OAAO,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,aAAa;AACpF,SAASC,eAAe,EAAEC,aAAa,EAAEC,WAAW,QAAQ,kBAAkB;AAC9E,SAASC,eAAe,QAAQ,kBAAkB;AAElD,MAAM;EAAEC,KAAK;EAAEC;AAAK,CAAC,GAAGZ,YAAY,CAAC,8BAA8B,CAAC;AAIpE,MAAMa,kBAAkB,GAAG;EACzBC,GAAG,EAAE,MAAM;EACXC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,OAAO;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,OAAO;EACbC,SAAS,EAAE,OAAO;EAClBC,QAAQ,EAAE,OAAO;EACjBC,UAAU,EAAE,OAAO;EACnBC,GAAG,EAAE,OAAO;EACZC,QAAQ,EAAE,OAAO;EACjBC,OAAO,EAAE,OAAO;EAChBC,SAAS,EAAE,OAAO;EAClBC,GAAG,EAAE,MAAM;EACXC,IAAI,EAAE,OAAO;EACbC,QAAQ,EAAE,OAAO;EACjBC,UAAU,EAAE,OA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reList":[]}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    {"version":3,"file":"xosan.mjs","names":["assert","asyncMapSettled","execa","filter","find","fs","includes","map","range","remove","createLogger","defer","tap","delay","invalidParameters","Ref","ensureArray","parseXml","log","SSH_KEY_FILE","DEFAULT_NETWORK_PREFIX","VM_FIRST_NUMBER","HOST_FIRST_NUMBER","GIGABYTE","XOSAN_VM_SYSTEM_DISK_SIZE","XOSAN_DATA_DISK_USEAGE_RATIO","XOSAN_LICENSE_QUOTA","CURRENT_POOL_OPERATIONS","getXosanConfig","xosansr","xapi","getXapi","data","xo","getData","networkPrefix","undefined","setData","_getIPToVMDict","sr","dict","nodes","forEach","conf","brickName","vm","getObject","id","underlyingSr","e","_getGlusterEndpoint","hosts","node","host","addresses","ip","rateLimitedRetry","action","shouldRetry","retryCount","retryDelay","Math","random","result","debug","createVolumeInfoTypes","parseHeal","parsed","bricks","healInfo","brick","push","file","commandStatus","parseStatus","brickDictByUuid","volume","volStatus","volumes","peerid","tasks","parseInfo","volInfo","options","option","sshInfoType","command","handler","glusterEndpoint","call","cmdShouldRetry","cliOutput","opErrno","stderr","match","runCmd","glusterCmd","commandResult","profileType","parseProfile","volProfile","profileTopType","parseTop","volTop","topTypes","type","checkHosts","network","badPifs","$PIFs","pif","ip_configuration_mode","$host","$id","heal","status","statusDetail","statusMem","info","profile","profileTop","VOLUME_INFO_TYPES","getVolumeInfo","infoType","checkXosanLicense","srId","uuid","foundType","Error","description","permission","params","enum","Object","keys","resolve","profileStatus","changeStatus","optional","reconfigurePifIP","newIP","$ref","fixHostNotInNetwork","xosanSr","usedAddresses","IP","_findIPAddressOutsideList","callAsync","PBD","$PBDs","pbd","sshKey","getOrCreateSshKey","callPlugin","private_key","private","public_key","public","force","floor2048","value","floor","copyVm","originalVm","srOrSrId","address","JSON","parse","remoteSsh","cmd","ignoreError","formatSshError","messageArray","messageKeys","orderedKeys","key","idx","indexOf","splice","join","stringify","destination","exception","code","exit","err","out","stdout","slice","findErrorMessage","commandResut","cliOut","opErrstr","length","output","opRet","trim","error","createNetworkAndInsertHosts","$defer","vlan","hostIpLastNumber","xosanNetwork","createNetwork","name","pifId","_xapiId","mtu","onFailure","deleteNetwork","addressAndPif","master","pool","$master","otherAddresses","addr","name_label","readKeys","readFile","_probePoolAndWaitForPresence","peers","peer","state","hostname","stateStr","getPoolStatus","peerStatus","configureGluster","redundancy","ipAndHosts","glusterType","arbiter","configByType","replica_arbiter","creation","extra","replica","disperse","brickVms","concat","bv","volumeCreation","ipAndHost","confChunk","_setQuota","_removeQuota","createSR","template","srs","brickSize","computeBrickSize","memorySize","ipRange","OPERATION_OBJECT","operation","states","requestResource","poolId","tmpBoundObjectId","toString","license","createBoundXosanTrialLicense","boundObjectId","unbindXosanLicense","split","vmIpLastNumber","srsObjects","Promise","all","firstSr","firstVM","_importGlusterVM","VM_destroy","copiedVms","_context","vmsAndSrs","arbiterIP","arbiterVm","_prepareGlusterVm","labelSuffix","increaseDataDisk","vmAndSr","maxDiskSize","ih","backupservers","ipLastByte","config","server","xosanSrRef","SR_create","content_type","device_config","name_description","physical_size","shared","forgetSr","param","version","creationDate","Date","toISOString","rebindLicense","licenseId","oldBoundObjectId","newBoundObjectId","items","umountDisk","localEndpoint","diskMountPoint","createNewDisk","diskSize","vdiMax","createVdiSize","min","extensionSize","newDisk","_getOrWaitObject","VDI_create","SR","virtual_size","sm_config","srUuid","strictEqual","sizeDiffMb","pow","VBD_create","VDI","VM","vbd","_waitObjectState","disk","Boolean","$VBDs","device","mountNewDisk","newDeviceFiledeviceFile","brickRootCmd","newBrickRoot","mountBrickCmd","replaceBrickOnSameVM","previousBrick","newLvmSr","previousIp","Infinity","nodeIndex","findIndex","previousVM","newDeviceFile","previousBrickRoot","previousBrickDevice","previousVBD","$unplug","VDI_destroy","replaceBrick","onSameVM","newIpAddress","_findAFreeIPAddress","stayingNodes","index","previousVMEntry","newVM","addressAndHost","insertNewGlusterVm","lvmSr","ipAddress","xenstoreData","String","MTU","firstVif","$VIFs","$network","deleteVif","VIF_create","add_tags","editVm","memory","set_xenstore_data","rootDisk","$VDI","vdi","rootDiskSize","startVm","_","isNotEmpty","guest_metrics","networks","srFreeSpace","physical_utilisation","newSize","smallDiskSize","deviceFile","lvmsrId","templateStream","namespace","VM_import","_xapiRef","autoPoweron","barrier","n","reservedList","i","candidate","a","_median","arr","sort","b","vmsMemories","memory_dynamic_max","srObject","addBricks","lvmsrs","newAddresses","newNodes","newSr","arbiterNode","removeBricks","ips","brickVMs","checkSrCurrentState","POSSIBLE_CONFIGURATIONS","layout","capacity","srSizes","minSize","computeXosanPossibleOptions","lvmSrs","count","configurations","finalBrickSize","availableSpace","max","unlock","unlockXosanLicense","downloadAndInstallXosanPack","res","installSupplementalPackOnAllHosts","update_other_config","now"],"sources":["../../src/api/xosan.mjs"],"sourcesContent":["import assert from 'assert'\nimport asyncMapSettled from '@xen-orchestra/async-map/legacy.js'\nimport { execa } from 'execa'\nimport filter from 'lodash/filter.js'\nimport find from 'lodash/find.js'\nimport fs from 'fs-extra'\nimport includes from 'lodash/includes.js'\nimport map from 'lodash/map.js'\nimport range from 'lodash/range.js'\nimport remove from 'lodash/remove.js'\nimport { createLogger } from '@xen-orchestra/log'\nimport { defer } from 'golike-defer'\nimport { tap, delay } from 'promise-toolbox'\nimport { invalidParameters } from 'xo-common/api-errors.js'\nimport { Ref } from 'xen-api'\n\nimport ensureArray from '../_ensureArray.mjs'\nimport { parseXml } from '../utils.mjs'\n\nconst log = createLogger('xo:xosan')\n\nconst SSH_KEY_FILE = 'id_rsa_xosan'\nconst DEFAULT_NETWORK_PREFIX = '172.31.100.'\nconst VM_FIRST_NUMBER = 101\nconst HOST_FIRST_NUMBER = 1\nconst GIGABYTE = 1024 * 1024 * 1024\nconst XOSAN_VM_SYSTEM_DISK_SIZE = 10 * GIGABYTE\nconst XOSAN_DATA_DISK_USEAGE_RATIO = 0.99\nconst XOSAN_LICENSE_QUOTA = 200 * GIGABYTE\n\nconst CURRENT_POOL_OPERATIONS = {}\n\nfunction getXosanConfig(xosansr, xapi = this.getXapi(xosansr)) {\n  const data = xapi.xo.getData(xosansr, 'xosan_config')\n  if (data && data.networkPrefix === undefined) {\n    // some xosan might have been created before this field was added\n    data.networkPrefix = DEFAULT_NETWORK_PREFIX\n    // fire and forget\n    xapi.xo.setData(xosansr, 'xosan_config', data)\n  }\n  return data\n}\n\nfunction _getIPToVMDict(xapi, sr) {\n  const dict = {}\n  const data = getXosanConfig(sr, xapi)\n  if (data && data.nodes) {\n    data.nodes.forEach(conf => {\n      try {\n        dict[conf.brickName] = {\n          vm: xapi.getObject(conf.vm.id),\n          sr: conf.underlyingSr,\n        }\n      } catch (e) {\n        // pass\n      }\n    })\n  }\n  return dict\n}\n\nfunction _getGlusterEndpoint(sr) {\n  const xapi = this.getXapi(sr)\n  const data = getXosanConfig(sr, xapi)\n  if (!data || !data.nodes) {\n    return null\n  }\n  return {\n    xapi,\n    data,\n    hosts: map(data.nodes, node => xapi.getObject(node.host)),\n    addresses: map(data.nodes, node => node.vm.ip),\n  }\n}\n\nasync function rateLimitedRetry(action, shouldRetry, retryCount = 20) {\n  let retryDelay = 500 * (1 + Math.random() / 20)\n  let result\n  while (retryCount > 0 && (result = await action()) && shouldRetry(result)) {\n    retryDelay *= 1.1\n    log.debug(`waiting ${retryDelay} ms and retrying`)\n    await delay(retryDelay)\n    retryCount--\n  }\n  return result\n}\n\nfunction createVolumeInfoTypes() {\n  function parseHeal(parsed) {\n    const bricks = []\n    parsed.healInfo.bricks.brick.forEach(brick => {\n      bricks.push(brick)\n      if (brick.file) {\n        brick.file = ensureArray(brick.file)\n      }\n    })\n    return { commandStatus: true, result: { bricks } }\n  }\n\n  function parseStatus(parsed) {\n    const brickDictByUuid = {}\n    const volume = parsed.volStatus.volumes.volume\n    volume.node.forEach(node => {\n      brickDictByUuid[node.peerid] = brickDictByUuid[node.peerid] || []\n      brickDictByUuid[node.peerid].push(node)\n    })\n    return {\n      commandStatus: true,\n      result: { nodes: brickDictByUuid, tasks: volume.tasks },\n    }\n  }\n\n  async function parseInfo(parsed) {\n    const volume = parsed.volInfo.volumes.volume\n    volume.bricks = volume.bricks.brick\n    volume.options = volume.options.option\n    return { commandStatus: true, result: volume }\n  }\n\n  const sshInfoType = (command, handler) => {\n    return async function (sr) {\n      const glusterEndpoint = this::_getGlusterEndpoint(sr)\n      const cmdShouldRetry = result =>\n        !result.commandStatus &&\n        ((result.parsed && result.parsed.cliOutput.opErrno === '30802') ||\n          result.stderr.match(/Another transaction is in progress/))\n      const runCmd = async () => glusterCmd(glusterEndpoint, 'volume ' + command, true)\n      const commandResult = await rateLimitedRetry(runCmd, cmdShouldRetry, 30)\n      return commandResult.commandStatus ? this::handler(commandResult.parsed.cliOutput, sr) : commandResult\n    }\n  }\n\n  async function profileType(sr) {\n    async function parseProfile(parsed) {\n      const volume = parsed.volProfile\n      volume.bricks = ensureArray(volume.brick)\n      delete volume.brick\n      return { commandStatus: true, result: volume }\n    }\n\n    return this::sshInfoType('profile xosan info', parseProfile)(sr)\n  }\n\n  async function profileTopType(sr) {\n    async function parseTop(parsed) {\n      const volume = parsed.volTop\n      volume.bricks = ensureArray(volume.brick)\n      delete volume.brick\n      return { commandStatus: true, result: volume }\n    }\n\n    const topTypes = ['open', 'read', 'write', 'opendir', 'readdir']\n    return asyncMapSettled(topTypes, async type => ({\n      type,\n      result: await this::sshInfoType(`top xosan ${type}`, parseTop)(sr),\n    }))\n  }\n\n  function checkHosts(sr) {\n    const xapi = this.getXapi(sr)\n    const data = getXosanConfig(sr, xapi)\n    const network = xapi.getObject(data.network)\n    const badPifs = filter(network.$PIFs, pif => pif.ip_configuration_mode !== 'Static')\n    return badPifs.map(pif => ({ pif, host: pif.$host.$id }))\n  }\n\n  return {\n    heal: sshInfoType('heal xosan info', parseHeal),\n    status: sshInfoType('status xosan', parseStatus),\n    statusDetail: sshInfoType('status xosan detail', parseStatus),\n    statusMem: sshInfoType('status xosan mem', parseStatus),\n    info: sshInfoType('info xosan', parseInfo),\n    profile: profileType,\n    profileTop: profileTopType,\n    hosts: checkHosts,\n  }\n}\n\nconst VOLUME_INFO_TYPES = createVolumeInfoTypes()\n\nexport async function getVolumeInfo({ sr, infoType }) {\n  await this.checkXosanLicense({ srId: sr.uuid })\n\n  const glusterEndpoint = this::_getGlusterEndpoint(sr)\n\n  if (glusterEndpoint == null) {\n    return null\n  }\n  const foundType = VOLUME_INFO_TYPES[infoType]\n  if (!foundType) {\n    throw new Error('getVolumeInfo(): \"' + infoType + '\" is an invalid type')\n  }\n  return this::foundType(sr)\n}\n\ngetVolumeInfo.description = 'info on gluster volume'\ngetVolumeInfo.permission = 'admin'\n\ngetVolumeInfo.params = {\n  sr: {\n    type: 'string',\n  },\n  infoType: {\n    enum: Object.keys(VOLUME_INFO_TYPES),\n  },\n}\ngetVolumeInfo.resolve = {\n  sr: ['sr', 'SR', 'administrate'],\n}\n\nexport async function profileStatus({ sr, changeStatus = null }) {\n  await this.checkXosanLicense({ srId: sr.uuid })\n\n  const glusterEndpoint = this::_getGlusterEndpoint(sr)\n  if (changeStatus === false) {\n    await glusterCmd(glusterEndpoint, 'volume profile xosan stop')\n    return null\n  }\n  if (changeStatus === true) {\n    await glusterCmd(glusterEndpoint, 'volume profile xosan start')\n  }\n  return this::getVolumeInfo({ sr, infoType: 'profile' })\n}\n\nprofileStatus.description = 'activate, deactivate, or interrogate profile data'\nprofileStatus.permission = 'admin'\nprofileStatus.params = {\n  sr: {\n    type: 'string',\n  },\n  changeStatus: {\n    type: 'boolean',\n    optional: true,\n  },\n}\nprofileStatus.resolve = {\n  sr: ['sr', 'SR', 'administrate'],\n}\n\nfunction reconfigurePifIP(xapi, pif, newIP) {\n  xapi.call('PIF.reconfigure_ip', pif.$ref, 'Static', newIP, '255.255.255.0', '', '')\n}\n\n// this function should probably become fixSomething(thingToFix, params)\nexport async function fixHostNotInNetwork({ xosanSr, host }) {\n  await this.checkXosanLicense({ srId: xosanSr.uuid })\n\n  const xapi = this.getXapi(xosanSr)\n  const data = getXosanConfig(xosanSr, xapi)\n  const network = xapi.getObject(data.network)\n  const usedAddresses = network.$PIFs.filter(pif => pif.ip_configuration_mode === 'Static').map(pif => pif.IP)\n  const pif = network.$PIFs.find(pif => pif.ip_configuration_mode !== 'Static' && pif.$host.$id === host)\n  if (pif) {\n    const newIP = _findIPAddressOutsideList(usedAddresses, HOST_FIRST_NUMBER)\n    reconfigurePifIP(xapi, pif, newIP)\n    await xapi.callAsync('PIF.plug', pif.$ref)\n    const PBD = find(xosanSr.$PBDs, pbd => pbd.$host.$id === host)\n    if (PBD) {\n      await xapi.callAsync('PBD.plug', PBD.$ref)\n    }\n    const sshKey = await getOrCreateSshKey(xapi)\n    await callPlugin(xapi, host, 'receive_ssh_keys', {\n      private_key: sshKey.private,\n      public_key: sshKey.public,\n      force: true,\n    })\n  }\n}\n\nfixHostNotInNetwork.description = 'put host in xosan network'\nfixHostNotInNetwork.permission = 'admin'\n\nfixHostNotInNetwork.params = {\n  xosanSr: {\n    type: 'string',\n  },\n  host: {\n    type: 'string',\n  },\n}\nfixHostNotInNetwork.resolve = {\n  sr: ['sr', 'SR', 'administrate'],\n}\n\nfunction floor2048(value) {\n  return 2048 * Math.floor(value / 2048)\n}\n\nasync function copyVm(xapi, originalVm, sr) {\n  return { sr, vm: await xapi.copyVm(originalVm, { srOrSrId: sr }) }\n}\n\nasync function callPlugin(xapi, host, command, params) {\n  log.debug(`calling plugin ${host.address} ${command}`)\n  return JSON.parse(await xapi.call('host.call_plugin', host.$ref, 'xosan.py', command, params))\n}\n\nasync function remoteSsh(glusterEndpoint, cmd, ignoreError = false) {\n  let result\n  const formatSshError = result => {\n    const messageArray = []\n    const messageKeys = Object.keys(result)\n    const orderedKeys = ['stderr', 'stdout', 'exit']\n    for (const key of orderedKeys) {\n      const idx = messageKeys.indexOf(key)\n      if (idx !== -1) {\n        messageKeys.splice(idx, 1)\n      }\n      messageArray.push(`${key}: ${result[key]}`)\n    }\n    messageArray.push('command: ' + result.command.join(' '))\n    messageKeys.splice(messageKeys.indexOf('command'), 1)\n    for (const key of messageKeys) {\n      messageArray.push(`${key}: ${JSON.stringify(result[key])}`)\n    }\n    return messageArray.join('\\n')\n  }\n\n  for (const address of glusterEndpoint.addresses) {\n    for (const host of glusterEndpoint.hosts) {\n      try {\n        result = await callPlugin(glusterEndpoint.xapi, host, 'run_ssh', {\n          destination: 'root@' + address,\n          cmd,\n        })\n        break\n      } catch (exception) {\n        if (exception.code !== 'HOST_OFFLINE') {\n          throw exception\n        }\n      }\n    }\n\n    log.debug(`result of ${result.command.join(' ')}`, {\n      exit: result.exit,\n      err: result.stderr,\n      out: result.stdout.slice(0, 1000),\n    })\n    // 255 seems to be ssh's own error codes.\n    if (result.exit !== 255) {\n      if (!ignoreError && result.exit !== 0) {\n        throw new Error(formatSshError(result))\n      }\n      return result\n    }\n  }\n  throw new Error(result != null ? formatSshError(result) : 'no suitable SSH host: ' + JSON.stringify(glusterEndpoint))\n}\n\nfunction findErrorMessage(commandResut) {\n  if (commandResut.exit === 0 && commandResut.parsed) {\n    const cliOut = commandResut.parsed.cliOutput\n    if (cliOut.opErrstr && cliOut.opErrstr.length) {\n      return cliOut.opErrstr\n    }\n    // \"peer probe\" returns it's \"already in peer\" error in cliOutput/output\n    if (cliOut.output && cliOut.output.length) {\n      return cliOut.output\n    }\n  }\n  return commandResut.stderr.length ? commandResut.stderr : commandResut.stdout\n}\n\nasync function glusterCmd(glusterEndpoint, cmd, ignoreError = false) {\n  const result = await remoteSsh(glusterEndpoint, `gluster --mode=script --xml ${cmd}`, true)\n  try {\n    result.parsed = parseXml(result.stdout)\n  } catch (e) {\n    // pass, we never know if a message can be parsed or not, so we just try\n  }\n  if (result.exit === 0) {\n    const cliOut = result.parsed.cliOutput\n    // we have found cases where opErrno is !=0 and opRet was 0, albeit the operation was an error.\n    result.commandStatus = cliOut.opRet.trim() === '0' && cliOut.opErrno.trim() === '0'\n    result.error = findErrorMessage(result)\n  } else {\n    result.commandStatus = false\n    // \"gluster volume status\" timeout error message is reported on stdout instead of stderr\n    result.error = findErrorMessage(result)\n  }\n  if (!ignoreError && !result.commandStatus) {\n    const error = new Error(`error in gluster \"${result.error}\"`)\n    error.result = result\n    throw error\n  }\n  return result\n}\n\nconst createNetworkAndInsertHosts = defer(async function ($defer, xapi, pif, vlan, networkPrefix) {\n  let hostIpLastNumber = HOST_FIRST_NUMBER\n  const xosanNetwork = await xapi.createNetwork({\n    name: 'XOSAN network',\n    description: 'XOSAN network',\n    pifId: pif._xapiId,\n    mtu: pif.mtu,\n    vlan: +vlan,\n  })\n  $defer.onFailure(() => xapi.deleteNetwork(xosanNetwork))\n  const addresses = xosanNetwork.$PIFs.map(pif => ({\n    pif,\n    address: networkPrefix + hostIpLastNumber++,\n  }))\n  await asyncMapSettled(addresses, addressAndPif => reconfigurePifIP(xapi, addressAndPif.pif, addressAndPif.address))\n  const master = xapi.pool.$master\n  const otherAddresses = addresses.filter(addr => addr.pif.$host !== master)\n  await asyncMapSettled(otherAddresses, async address => {\n    const result = await callPlugin(xapi, master, 'run_ping', {\n      address: address.address,\n    })\n    if (result.exit !== 0) {\n      throw invalidParameters(\n        `Could not ping ${master.name_label}->${address.pif.$host.name_label} (${address.address}) \\n${result.stdout}`\n      )\n    }\n  })\n  return xosanNetwork\n})\n\nasync function getOrCreateSshKey(xapi) {\n  let sshKey = xapi.xo.getData(xapi.pool, 'xosan_ssh_key')\n\n  if (!sshKey) {\n    const readKeys = async () => {\n      sshKey = {\n        private: await fs.readFile(SSH_KEY_FILE, 'ascii'),\n        public: await fs.readFile(SSH_KEY_FILE + '.pub', 'ascii'),\n      }\n      xapi.xo.setData(xapi.pool, 'xosan_ssh_key', sshKey)\n    }\n\n    try {\n      await readKeys()\n    } catch (e) {\n      await execa('ssh-keygen', ['-q', '-f', SSH_KEY_FILE, '-t', 'rsa', '-b', '4096', '-N', ''])\n      await readKeys()\n    }\n  }\n\n  return sshKey\n}\n\nconst _probePoolAndWaitForPresence = defer(async function ($defer, glusterEndpoint, addresses) {\n  await asyncMapSettled(addresses, async address => {\n    await glusterCmd(glusterEndpoint, 'peer probe ' + address)\n    $defer.onFailure(() => glusterCmd(glusterEndpoint, 'peer detach ' + address, true))\n  })\n\n  function shouldRetry(peers) {\n    for (const peer of peers) {\n      if (peer.state === '4') {\n        return true\n      }\n      if (peer.state === '6') {\n        throw new Error(`${peer.hostname} is not in pool (\"${peer.stateStr}\")`)\n      }\n    }\n    return false\n  }\n\n  const getPoolStatus = async () => (await glusterCmd(glusterEndpoint, 'pool list')).parsed.cliOutput.peerStatus.peer\n  return rateLimitedRetry(getPoolStatus, shouldRetry)\n})\n\nasync function configureGluster(redundancy, ipAndHosts, glusterEndpoint, glusterType, arbiter = null) {\n  const configByType = {\n    replica_arbiter: {\n      creation: 'replica 3 arbiter 1',\n      extra: [],\n    },\n    replica: {\n      creation: 'replica ' + redundancy + ' ',\n      extra: ['volume set xosan cluster.data-self-heal on'],\n    },\n    disperse: {\n      creation: 'disperse ' + ipAndHosts.length + ' redundancy ' + redundancy + ' ',\n      extra: [],\n    },\n  }\n  const brickVms = arbiter ? ipAndHosts.concat(arbiter) : ipAndHosts\n  await _probePoolAndWaitForPresence(\n    glusterEndpoint,\n    map(brickVms.slice(1), bv => bv.address)\n  )\n  const creation = configByType[glusterType].creation\n  const volumeCreation =\n    'volume create xosan ' + creation + ' ' + brickVms.map(ipAndHost => ipAndHost.brickName).join(' ')\n  log.debug(`creating volume: ${volumeCreation}`)\n  await glusterCmd(glusterEndpoint, volumeCreation)\n  await glusterCmd(glusterEndpoint, 'volume set xosan network.remote-dio enable')\n  await glusterCmd(glusterEndpoint, 'volume set xosan cluster.eager-lock enable')\n  await glusterCmd(glusterEndpoint, 'volume set xosan cluster.locking-scheme granular')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.io-cache off')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.read-ahead off')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.quick-read off')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.strict-write-ordering off')\n  await glusterCmd(glusterEndpoint, 'volume set xosan client.event-threads 8')\n  await glusterCmd(glusterEndpoint, 'volume set xosan server.event-threads 8')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.io-thread-count 64')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.stat-prefetch on')\n  await glusterCmd(glusterEndpoint, 'volume set xosan performance.low-prio-threads 32')\n  await glusterCmd(glusterEndpoint, 'volume set xosan features.shard on')\n  await glusterCmd(glusterEndpoint, 'volume set xosan features.shard-block-size 512MB')\n  await glusterCmd(glusterEndpoint, 'volume set xosan user.cifs off')\n  for (const confChunk of configByType[glusterType].extra) {\n    await glusterCmd(glusterEndpoint, confChunk)\n  }\n  await glusterCmd(glusterEndpoint, 'volume start xosan')\n  await _setQuota(glusterEndpoint)\n}\n\nasync function _setQuota(glusterEndpoint) {\n  await glusterCmd(glusterEndpoint, 'volume quota xosan enable', true)\n  await glusterCmd(glusterEndpoint, 'volume set xosan quota-deem-statfs on', true)\n  await glusterCmd(glusterEndpoint, `volume quota xosan limit-usage / ${XOSAN_LICENSE_QUOTA}B`, true)\n}\n\nasync function _removeQuota(glusterEndpoint) {\n  await glusterCmd(glusterEndpoint, 'volume quota xosan disable', true)\n}\n\nexport const createSR = defer(async function (\n  $defer,\n  {\n    template,\n    pif,\n    vlan,\n    srs,\n    glusterType,\n    redundancy,\n    brickSize = this::computeBrickSize(srs),\n    memorySize = 4 * GIGABYTE,\n    ipRange = DEFAULT_NETWORK_PREFIX + '.0',\n  }\n) {\n  const OPERATION_OBJECT = {\n    operation: 'createSr',\n    states: [\n      'configuringNetwork',\n      'importingVm',\n      'copyingVms',\n      'configuringVms',\n      'configuringGluster',\n      'creatingSr',\n      'scanningSr',\n    ],\n  }\n  if (!this.requestResource) {\n    throw new Error('requestResource is not a function')\n  }\n\n  if (srs.length < 1) {\n    return // TODO: throw an error\n  }\n\n  const xapi = this.getXapi(srs[0])\n  const poolId = xapi.pool.$id\n  if (CURRENT_POOL_OPERATIONS[poolId]) {\n    throw new Error('createSR is already running for this pool')\n  }\n\n  CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 0 }\n\n  const tmpBoundObjectId = `tmp_${srs.join(',')}_${Math.random().toString(32).slice(2)}`\n  const license = await this.createBoundXosanTrialLicense({\n    boundObjectId: tmpBoundObjectId,\n  })\n  $defer.onFailure(() => this.unbindXosanLicense({ srId: tmpBoundObjectId }))\n\n  // '172.31.100.0' -> '172.31.100.'\n  const networkPrefix = ipRange.split('.').slice(0, 3).join('.') + '.'\n  let vmIpLastNumber = VM_FIRST_NUMBER\n\n  try {\n    const xosanNetwork = await createNetworkAndInsertHosts(xapi, pif, vlan, networkPrefix)\n    $defer.onFailure(() => xapi.deleteNetwork(xosanNetwork))\n    const sshKey = await getOrCreateSshKey(xapi)\n    const srsObjects = map(srs, srId => xapi.getObject(srId))\n    await Promise.all(\n      srsObjects.map(sr =>\n        callPlugin(xapi, sr.$PBDs[0].$host, 'receive_ssh_keys', {\n          private_key: sshKey.private,\n          public_key: sshKey.public,\n          force: 'true',\n        })\n      )\n    )\n\n    const firstSr = srsObjects[0]\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }\n    const firstVM = await this::_importGlusterVM(xapi, template, firstSr)\n    $defer.onFailure(() => xapi.VM_destroy(firstVM.$ref, true))\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 2 }\n    const copiedVms = await asyncMapSettled(srsObjects.slice(1), sr =>\n      copyVm(xapi, firstVM, sr)::tap(({ vm }) => $defer.onFailure(() => xapi.VM_destroy(vm.$ref)))\n    )\n    const vmsAndSrs = [\n      {\n        vm: firstVM,\n        sr: firstSr,\n      },\n    ].concat(copiedVms)\n    let arbiter = null\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 3 }\n    if (srs.length === 2) {\n      const sr = firstSr\n      const arbiterIP = networkPrefix + vmIpLastNumber++\n      const arbiterVm = await xapi.copyVm(firstVM, { srOrSrId: sr })\n      $defer.onFailure(() => xapi.VM_destroy(arbiterVm.$ref, true))\n      arbiter = await _prepareGlusterVm(xapi, sr, arbiterVm, xosanNetwork, arbiterIP, {\n        labelSuffix: '_arbiter',\n        increaseDataDisk: false,\n        memorySize,\n      })\n      arbiter.arbiter = true\n    }\n    const ipAndHosts = await asyncMapSettled(vmsAndSrs, vmAndSr =>\n      _prepareGlusterVm(xapi, vmAndSr.sr, vmAndSr.vm, xosanNetwork, networkPrefix + vmIpLastNumber++, {\n        maxDiskSize: brickSize,\n        memorySize,\n      })\n    )\n    const glusterEndpoint = {\n      xapi,\n      hosts: map(ipAndHosts, ih => ih.host),\n      addresses: map(ipAndHosts, ih => ih.address),\n    }\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 4 }\n    await configureGluster(redundancy, ipAndHosts, glusterEndpoint, glusterType, arbiter)\n    log.debug('xosan gluster volume started')\n    // We use 10 IPs of the gluster VM range as backup, in the hope that even if the first VM gets destroyed we find at least\n    // one VM to give mount the volfile.\n    // It is not possible to edit the device_config after the SR is created and this data is only used at mount time when rebooting\n    // the hosts.\n    const backupservers = map(\n      range(VM_FIRST_NUMBER, VM_FIRST_NUMBER + 10),\n      ipLastByte => networkPrefix + ipLastByte\n    ).join(':')\n    const config = { server: ipAndHosts[0].address + ':/xosan', backupservers }\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 5 }\n    const xosanSrRef = await xapi.SR_create({\n      content_type: '',\n      device_config: config,\n      host: firstSr.$PBDs[0].$host.$ref,\n      name_description: 'XOSAN',\n      name_label: 'XOSAN',\n      physical_size: 0,\n      shared: true,\n      type: 'xosan',\n    })\n    log.debug('sr created')\n    // we just forget because the cleanup actions are stacked in the $onFailure system\n    $defer.onFailure(() => xapi.forgetSr(xosanSrRef))\n    if (arbiter) {\n      ipAndHosts.push(arbiter)\n    }\n    const nodes = ipAndHosts.map(param => ({\n      brickName: param.brickName,\n      host: param.host.$id,\n      vm: { id: param.vm.$id, ip: param.address },\n      underlyingSr: param.underlyingSr.$id,\n      arbiter: !!param.arbiter,\n    }))\n    await xapi.xo.setData(xosanSrRef, 'xosan_config', {\n      version: 'beta2',\n      creationDate: new Date().toISOString(),\n      nodes,\n      template,\n      network: xosanNetwork.$id,\n      type: glusterType,\n      networkPrefix,\n      redundancy,\n    })\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 6 }\n    log.debug('scanning new SR')\n    await xapi.callAsync('SR.scan', xosanSrRef)\n    await this.rebindLicense({\n      licenseId: license.id,\n      oldBoundObjectId: tmpBoundObjectId,\n      newBoundObjectId: xapi.getObject(xosanSrRef).uuid,\n    })\n  } finally {\n    delete CURRENT_POOL_OPERATIONS[poolId]\n  }\n})\n\ncreateSR.description = 'create gluster VM'\ncreateSR.permission = 'admin'\ncreateSR.params = {\n  brickSize: { type: 'number', optional: true },\n  srs: {\n    type: 'array',\n    items: {\n      type: 'string',\n    },\n  },\n  template: { type: 'object' },\n  pif: {\n    type: 'string',\n  },\n  vlan: {\n    type: 'string',\n  },\n  glusterType: {\n    type: 'string',\n  },\n  redundancy: {\n    type: 'number',\n  },\n  memorySize: {\n    type: 'number',\n    optional: true,\n  },\n  ipRange: {\n    type: 'string',\n    optional: true,\n  },\n}\n\ncreateSR.resolve = {\n  srs: ['sr', 'SR', 'administrate'],\n  pif: ['pif', 'PIF', 'administrate'],\n}\n\nasync function umountDisk(localEndpoint, diskMountPoint) {\n  await remoteSsh(\n    localEndpoint,\n    `killall -v -w /usr/sbin/xfs_growfs; fuser -v ${diskMountPoint}; umount ${diskMountPoint} && sed -i '\\\\_${diskMountPoint}\\\\S_d' /etc/fstab && rm -rf ${diskMountPoint}`\n  )\n}\n\nasync function createNewDisk(xapi, sr, vm, diskSize) {\n  // https://github.com/xapi-project/sm/blob/c9e959b70b43930b33f3a5abe5afe0a36dc95f06/drivers/vhdutil.py#L31\n  const vdiMax = 2040 * 1024 * 1024 * 1024\n  const createVdiSize = Math.min(vdiMax, diskSize)\n  const extensionSize = diskSize - createVdiSize\n  const newDisk = await xapi._getOrWaitObject(\n    await xapi.VDI_create(\n      {\n        name_description: 'Created by XO',\n        name_label: 'xosan_data',\n        SR: sr.$ref,\n        virtual_size: createVdiSize,\n      },\n      { sm_config: { type: 'raw' } }\n    )\n  )\n  if (extensionSize > 0) {\n    const { type, uuid: srUuid, $PBDs } = xapi.getObject(sr)\n    const volume = `/dev/VG_XenStorage-${srUuid}/LV-${newDisk.uuid}`\n    assert.strictEqual(type, 'lvm')\n    const result = await callPlugin(xapi, $PBDs[0].$host, 'run_lvextend', {\n      sizeDiffMb: '+' + Math.floor(extensionSize / Math.pow(2, 20)),\n      volume,\n    })\n    if (result.exit !== 0) {\n      throw Error('Could not create volume ->' + result.stdout)\n    }\n    await xapi.callAsync('SR.scan', xapi.getObject(sr).$ref)\n  }\n  await xapi.VBD_create({ VDI: newDisk.$ref, VM: vm.$ref })\n  let vbd = (await xapi._waitObjectState(newDisk.$id, disk => Boolean(disk.$VBDs.length))).$VBDs[0]\n  vbd = await xapi._waitObjectState(vbd.$id, vbd => Boolean(vbd.device.length))\n  return '/dev/' + vbd.device\n}\n\nasync function mountNewDisk(localEndpoint, hostname, newDeviceFiledeviceFile) {\n  const brickRootCmd =\n    'bash -c \\'mkdir -p /bricks; for TESTVAR in {1..9}; do TESTDIR=\"/bricks/xosan$TESTVAR\" ;if mkdir $TESTDIR; then echo $TESTDIR; exit 0; fi ; done ; exit 1\\''\n  const newBrickRoot = (await remoteSsh(localEndpoint, brickRootCmd)).stdout.trim()\n  const brickName = `${hostname}:${newBrickRoot}/xosandir`\n  const mountBrickCmd = `mkfs.xfs -i size=512 ${newDeviceFiledeviceFile}; mkdir -p ${newBrickRoot}; echo \"${newDeviceFiledeviceFile} ${newBrickRoot} xfs defaults 0 0\" >> /etc/fstab; mount -a`\n  await remoteSsh(localEndpoint, mountBrickCmd)\n  return brickName\n}\n\nasync function replaceBrickOnSameVM(xosansr, previousBrick, newLvmSr, brickSize) {\n  const OPERATION_OBJECT = {\n    operation: 'replaceBrick',\n    states: ['creatingNewDisk', 'mountingDisk', 'swappingBrick', 'disconnectingOldDisk', 'scanningSr'],\n  }\n  const xapi = this.getXapi(xosansr)\n  const poolId = xapi.pool.$id\n  try {\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 0 }\n\n    // TODO: a bit of user input validation on 'previousBrick', it's going to ssh\n    const previousIp = previousBrick.split(':')[0]\n    brickSize = brickSize === undefined ? Infinity : brickSize\n    const data = this::getXosanConfig(xosansr)\n    const nodes = data.nodes\n    const nodeIndex = nodes.findIndex(node => node.vm.ip === previousIp)\n    const glusterEndpoint = this::_getGlusterEndpoint(xosansr)\n    const previousVM = _getIPToVMDict(xapi, xosansr)[previousBrick].vm\n    const newDeviceFile = await createNewDisk(xapi, newLvmSr, previousVM, brickSize)\n    const localEndpoint = {\n      xapi,\n      hosts: map(nodes, node => xapi.getObject(node.host)),\n      addresses: [previousIp],\n    }\n    const previousBrickRoot = previousBrick.split(':')[1].split('/').slice(0, 3).join('/')\n    const previousBrickDevice = (\n      await remoteSsh(localEndpoint, `grep \" ${previousBrickRoot} \" /proc/mounts | cut -d ' ' -f 1 | sed 's_/dev/__'`)\n    ).stdout.trim()\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }\n    const brickName = await mountNewDisk(localEndpoint, previousIp, newDeviceFile)\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 2 }\n    await glusterCmd(glusterEndpoint, `volume replace-brick xosan ${previousBrick} ${brickName} commit force`)\n    nodes[nodeIndex].brickName = brickName\n    nodes[nodeIndex].underlyingSr = newLvmSr\n    await xapi.xo.setData(xosansr, 'xosan_config', data)\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 3 }\n    await umountDisk(localEndpoint, previousBrickRoot)\n    const previousVBD = previousVM.$VBDs.find(vbd => vbd.device === previousBrickDevice)\n    await previousVBD.$unplug()\n    await xapi.VDI_destroy(previousVBD.VDI)\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 4 }\n    await xapi.callAsync('SR.scan', xapi.getObject(xosansr).$ref)\n  } finally {\n    delete CURRENT_POOL_OPERATIONS[poolId]\n  }\n}\n\nexport async function replaceBrick({ xosansr, previousBrick, newLvmSr, brickSize, onSameVM = true }) {\n  await this.checkXosanLicense({ srId: xosansr.uuid })\n\n  const OPERATION_OBJECT = {\n    operation: 'replaceBrick',\n    states: ['insertingNewVm', 'swapingBrick', 'deletingVm', 'scaningSr'],\n  }\n  if (onSameVM) {\n    return this::replaceBrickOnSameVM(xosansr, previousBrick, newLvmSr, brickSize)\n  }\n  const xapi = this.getXapi(xosansr)\n  const poolId = xapi.pool.$id\n  try {\n    // TODO: a bit of user input validation on 'previousBrick', it's going to ssh\n    const previousIp = previousBrick.split(':')[0]\n    brickSize = brickSize === undefined ? Infinity : brickSize\n    const data = getXosanConfig(xosansr, xapi)\n    const nodes = data.nodes\n    const newIpAddress = _findAFreeIPAddress(nodes, data.networkPrefix)\n    const nodeIndex = nodes.findIndex(node => node.vm.ip === previousIp)\n    const stayingNodes = filter(nodes, (node, index) => index !== nodeIndex)\n    const glusterEndpoint = {\n      xapi,\n      hosts: map(stayingNodes, node => xapi.getObject(node.host)),\n      addresses: map(stayingNodes, node => node.vm.ip),\n    }\n    const previousVMEntry = _getIPToVMDict(xapi, xosansr)[previousBrick]\n    const arbiter = nodes[nodeIndex].arbiter\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 0 }\n    const { newVM, addressAndHost } = await this::insertNewGlusterVm(xapi, xosansr, newLvmSr, {\n      labelSuffix: arbiter ? '_arbiter' : '',\n      glusterEndpoint,\n      newIpAddress,\n      increaseDataDisk: !arbiter,\n      brickSize,\n    })\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }\n    await glusterCmd(\n      glusterEndpoint,\n      `volume replace-brick xosan ${previousBrick} ${addressAndHost.brickName} commit force`\n    )\n    await glusterCmd(glusterEndpoint, 'peer detach ' + previousIp)\n    data.nodes.splice(nodeIndex, 1, {\n      brickName: addressAndHost.brickName,\n      host: addressAndHost.host.$id,\n      arbiter,\n      vm: { ip: addressAndHost.address, id: newVM.$id },\n      underlyingSr: newLvmSr,\n    })\n    await xapi.xo.setData(xosansr, 'xosan_config', data)\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 2 }\n    if (previousVMEntry) {\n      await xapi.VM_destroy(previousVMEntry.vm.$ref, true)\n    }\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 3 }\n    await xapi.callAsync('SR.scan', xapi.getObject(xosansr).$ref)\n  } finally {\n    delete CURRENT_POOL_OPERATIONS[poolId]\n  }\n}\n\nreplaceBrick.description = 'replaceBrick brick in gluster volume'\nreplaceBrick.permission = 'admin'\nreplaceBrick.params = {\n  xosansr: { type: 'string' },\n  previousBrick: { type: 'string' },\n  newLvmSr: { type: 'string' },\n  brickSize: { type: 'number' },\n}\n\nreplaceBrick.resolve = {\n  xosansr: ['sr', 'SR', 'administrate'],\n}\n\nasync function _prepareGlusterVm(\n  xapi,\n  lvmSr,\n  newVM,\n  xosanNetwork,\n  ipAddress,\n  { labelSuffix = '', increaseDataDisk = true, maxDiskSize = Infinity, memorySize = 2 * GIGABYTE }\n) {\n  const host = lvmSr.$PBDs[0].$host\n  const xenstoreData = {\n    'vm-data/hostname': 'XOSAN' + lvmSr.name_label + labelSuffix,\n    'vm-data/sshkey': (await getOrCreateSshKey(xapi)).public,\n    'vm-data/ip': ipAddress,\n    'vm-data/mtu': String(xosanNetwork.MTU),\n    'vm-data/vlan': String(xosanNetwork.$PIFs[0].vlan || 0),\n  }\n  const ip = ipAddress\n  const sr = xapi.getObject(lvmSr.$id)\n  // refresh the object so that sizes are correct\n  await xapi._waitObjectState(sr.$id, sr => Boolean(sr.$PBDs))\n  const firstVif = newVM.$VIFs[0]\n  if (xosanNetwork.$id !== firstVif.$network.$id) {\n    try {\n      await xapi.callAsync('VIF.move', firstVif.$ref, xosanNetwork.$ref)\n    } catch (error) {\n      if (error.code === 'MESSAGE_METHOD_UNKNOWN') {\n        // VIF.move has been introduced in xenserver 7.0\n        await xapi.deleteVif(firstVif.$id)\n        await xapi.VIF_create(\n          {\n            ...firstVif,\n            VM: newVM.$ref,\n            network: xosanNetwork.$ref,\n          },\n          firstVif\n        )\n      }\n    }\n  }\n  await newVM.add_tags('XOSAN')\n  await xapi.editVm(newVM, {\n    name_label: `XOSAN - ${lvmSr.name_label} - ${host.name_label} ${labelSuffix}`,\n    name_description: 'Xosan VM storage',\n    memory: memorySize,\n  })\n  await newVM.set_xenstore_data(xenstoreData)\n  const rootDisk = newVM.$VBDs.map(vbd => vbd && vbd.$VDI).find(vdi => vdi && vdi.name_label === 'xosan_root')\n  const rootDiskSize = rootDisk.virtual_size\n  await xapi.startVm(newVM)\n  log.debug(`waiting for boot of ${ip}`)\n  // wait until we find the assigned IP in the networks, we are just checking the boot is complete\n  // fix #3688\n  const vm = await xapi._waitObjectState(newVM.$id, _ => Ref.isNotEmpty(_.guest_metrics))\n  await xapi._waitObjectState(vm.guest_metrics, _ => includes(_.networks, ip))\n  log.debug(`booted ${ip}`)\n  const localEndpoint = { xapi, hosts: [host], addresses: [ip] }\n  const srFreeSpace = sr.physical_size - sr.physical_utilisation\n  // we use a percentage because it looks like the VDI overhead is proportional\n  const newSize = floor2048(Math.min(maxDiskSize - rootDiskSize, srFreeSpace * XOSAN_DATA_DISK_USEAGE_RATIO))\n  const smallDiskSize = 1073741824\n  const deviceFile = await createNewDisk(xapi, lvmSr, newVM, increaseDataDisk ? newSize : smallDiskSize)\n  const brickName = await mountNewDisk(localEndpoint, ip, deviceFile)\n  return { address: ip, host, vm, underlyingSr: lvmSr, brickName }\n}\n\nasync function _importGlusterVM(xapi, template, lvmsrId) {\n  const templateStream = await this.requestResource({\n    id: template.id,\n    namespace: 'xosan',\n    version: template.version,\n  })\n  const newVM = await xapi._getOrWaitObject(\n    await xapi.VM_import(templateStream, this.getObject(lvmsrId, 'SR')._xapiRef)\n  )\n  await xapi.editVm(newVM, {\n    autoPoweron: true,\n    name_label: 'XOSAN imported VM',\n    name_description: 'freshly imported',\n  })\n  return xapi.barrier(newVM.$ref)\n}\n\nfunction _findAFreeIPAddress(nodes, networkPrefix) {\n  return _findIPAddressOutsideList(\n    map(nodes, n => n.vm.ip),\n    networkPrefix\n  )\n}\n\nfunction _findIPAddressOutsideList(reservedList, networkPrefix, vmIpLastNumber = 101) {\n  for (let i = vmIpLastNumber; i < 255; i++) {\n    const candidate = networkPrefix + i\n    if (!reservedList.find(a => a === candidate)) {\n      return candidate\n    }\n  }\n  return null\n}\n\nconst _median = arr => {\n  arr.sort((a, b) => a - b)\n  return arr[Math.floor(arr.length / 2)]\n}\n\nconst insertNewGlusterVm = defer(async function (\n  $defer,\n  xapi,\n  xosansr,\n  lvmsrId,\n  { labelSuffix = '', glusterEndpoint = null, ipAddress = null, increaseDataDisk = true, brickSize = Infinity }\n) {\n  const data = getXosanConfig(xosansr, xapi)\n  if (ipAddress === null) {\n    ipAddress = _findAFreeIPAddress(data.nodes, data.networkPrefix)\n  }\n  const vmsMemories = []\n  for (const node of data.nodes) {\n    try {\n      vmsMemories.push(xapi.getObject(node.vm.id).memory_dynamic_max)\n    } catch (e) {\n      // pass\n    }\n  }\n  const xosanNetwork = xapi.getObject(data.network)\n  const srObject = xapi.getObject(lvmsrId)\n  // can't really copy an existing VM, because existing gluster VMs disks might too large to be copied.\n  const newVM = await this::_importGlusterVM(xapi, data.template, lvmsrId)\n  $defer.onFailure(() => xapi.VM_destroy(newVM.$ref, true))\n  const addressAndHost = await _prepareGlusterVm(xapi, srObject, newVM, xosanNetwork, ipAddress, {\n    labelSuffix,\n    increaseDataDisk,\n    maxDiskSize: brickSize,\n    memorySize: vmsMemories.length ? _median(vmsMemories) : 2 * GIGABYTE,\n  })\n  if (!glusterEndpoint) {\n    glusterEndpoint = this::_getGlusterEndpoint(xosansr)\n  }\n  await _probePoolAndWaitForPresence(glusterEndpoint, [addressAndHost.address])\n  return { data, newVM, addressAndHost, glusterEndpoint }\n})\n\nexport const addBricks = defer(async function ($defer, { xosansr, lvmsrs, brickSize }) {\n  await this.checkXosanLicense({ srId: xosansr.uuid })\n\n  const OPERATION_OBJECT = {\n    operation: 'addBricks',\n    states: ['insertingNewVms', 'addingBricks', 'scaningSr'],\n  }\n  const xapi = this.getXapi(xosansr)\n  const poolId = xapi.pool.$id\n  if (CURRENT_POOL_OPERATIONS[poolId]) {\n    throw new Error('createSR is already running for this pool')\n  }\n  CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 0 }\n  try {\n    const data = getXosanConfig(xosansr, xapi)\n    const usedAddresses = map(data.nodes, n => n.vm.ip)\n    const glusterEndpoint = this::_getGlusterEndpoint(xosansr)\n    const newAddresses = []\n    const newNodes = []\n    for (const newSr of lvmsrs) {\n      const ipAddress = _findIPAddressOutsideList(usedAddresses.concat(newAddresses), data.networkPrefix)\n      newAddresses.push(ipAddress)\n      const { newVM, addressAndHost } = await this::insertNewGlusterVm(xapi, xosansr, newSr, { ipAddress, brickSize })\n      $defer.onFailure(() => glusterCmd(glusterEndpoint, 'peer detach ' + ipAddress, true))\n      $defer.onFailure(() => xapi.VM_destroy(newVM.$ref, true))\n      const brickName = addressAndHost.brickName\n      newNodes.push({\n        brickName,\n        host: addressAndHost.host.$id,\n        vm: { id: newVM.$id, ip: ipAddress },\n        underlyingSr: newSr,\n      })\n    }\n    const arbiterNode = data.nodes.find(n => n.arbiter)\n    if (arbiterNode) {\n      await glusterCmd(\n        glusterEndpoint,\n        `volume remove-brick xosan replica ${data.nodes.length - 1} ${arbiterNode.brickName} force`\n      )\n      data.nodes = data.nodes.filter(n => n !== arbiterNode)\n      data.type = 'replica'\n      await xapi.xo.setData(xosansr, 'xosan_config', data)\n      await glusterCmd(glusterEndpoint, 'peer detach ' + arbiterNode.vm.ip, true)\n      await xapi.VM_destroy(await xapi.call('VM.get_by_uuid', arbiterNode.vm.id), true)\n    }\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 1 }\n    await glusterCmd(glusterEndpoint, `volume add-brick xosan ${newNodes.map(n => n.brickName).join(' ')}`)\n    data.nodes = data.nodes.concat(newNodes)\n    await xapi.xo.setData(xosansr, 'xosan_config', data)\n    CURRENT_POOL_OPERATIONS[poolId] = { ...OPERATION_OBJECT, state: 2 }\n    await xapi.callAsync('SR.scan', xapi.getObject(xosansr).$ref)\n  } finally {\n    delete CURRENT_POOL_OPERATIONS[poolId]\n  }\n})\n\naddBricks.description = 'add brick to XOSAN SR'\naddBricks.permission = 'admin'\naddBricks.params = {\n  xosansr: { type: 'string' },\n  lvmsrs: {\n    type: 'array',\n    items: {\n      type: 'string',\n    },\n  },\n  brickSize: { type: 'number' },\n}\n\naddBricks.resolve = {\n  xosansr: ['sr', 'SR', 'administrate'],\n  lvmsrs: ['sr', 'SR', 'administrate'],\n}\n\nexport const removeBricks = defer(async function ($defer, { xosansr, bricks }) {\n  await this.checkXosanLicense({ srId: xosansr.uuid })\n\n  const xapi = this.getXapi(xosansr)\n  if (CURRENT_POOL_OPERATIONS[xapi.pool.$id]) {\n    throw new Error('this there is already a XOSAN operation running on this pool')\n  }\n  CURRENT_POOL_OPERATIONS[xapi.pool.$id] = true\n  try {\n    const data = getXosanConfig(xosansr.id, xapi)\n    // IPV6\n    const ips = map(bricks, b => b.split(':')[0])\n    const glusterEndpoint = this::_getGlusterEndpoint(xosansr.id)\n    // \"peer detach\" doesn't allow removal of localhost\n    remove(glusterEndpoint.addresses, ip => ips.includes(ip))\n    const dict = _getIPToVMDict(xapi, xosansr.id)\n    const brickVMs = map(bricks, b => dict[b])\n    await glusterCmd(glusterEndpoint, `volume remove-brick xosan ${bricks.join(' ')} force`)\n    await asyncMapSettled(ips, ip => glusterCmd(glusterEndpoint, 'peer detach ' + ip, true))\n    remove(data.nodes, node => ips.includes(node.vm.ip))\n    await xapi.xo.setData(xosansr.id, 'xosan_config', data)\n    await xapi.callAsync('SR.scan', xapi.getObject(xosansr._xapiId).$ref)\n    await asyncMapSettled(brickVMs, vm => xapi.VM_destroy(vm.vm.$ref, true))\n  } finally {\n    delete CURRENT_POOL_OPERATIONS[xapi.pool.$id]\n  }\n})\n\nremoveBricks.description = 'remove brick from XOSAN SR'\nremoveBricks.permission = 'admin'\nremoveBricks.params = {\n  xosansr: { type: 'string' },\n  bricks: {\n    type: 'array',\n    items: { type: 'string' },\n  },\n}\nremoveBricks.resolve = { xosansr: ['sr', 'SR', 'administrate'] }\n\nexport function checkSrCurrentState({ poolId }) {\n  return CURRENT_POOL_OPERATIONS[poolId]\n}\n\ncheckSrCurrentState.description = 'checks if there is an operation currently running on the SR'\ncheckSrCurrentState.permission = 'admin'\ncheckSrCurrentState.params = { poolId: { type: 'string' } }\n\nconst POSSIBLE_CONFIGURATIONS = {}\nPOSSIBLE_CONFIGURATIONS[2] = [{ layout: 'replica_arbiter', redundancy: 3, capacity: 1 }]\nPOSSIBLE_CONFIGURATIONS[3] = [\n  { layout: 'replica', redundancy: 3, capacity: 1 },\n  { layout: 'disperse', redundancy: 1, capacity: 2 },\n]\nPOSSIBLE_CONFIGURATIONS[4] = [{ layout: 'replica', redundancy: 2, capacity: 2 }]\nPOSSIBLE_CONFIGURATIONS[5] = [{ layout: 'disperse', redundancy: 1, capacity: 4 }]\nPOSSIBLE_CONFIGURATIONS[6] = [\n  { layout: 'replica', redundancy: 2, capacity: 3 },\n  { layout: 'replica', redundancy: 3, capacity: 2 },\n  { layout: 'disperse', redundancy: 2, capacity: 4 },\n]\nPOSSIBLE_CONFIGURATIONS[7] = [{ layout: 'disperse', redundancy: 3, capacity: 4 }]\nPOSSIBLE_CONFIGURATIONS[8] = [{ layout: 'replica', redundancy: 2, capacity: 4 }]\nPOSSIBLE_CONFIGURATIONS[9] = [\n  { layout: 'replica', redundancy: 3, capacity: 3 },\n  { layout: 'disperse', redundancy: 1, capacity: 8 },\n]\nPOSSIBLE_CONFIGURATIONS[10] = [\n  { layout: 'replica', redundancy: 2, capacity: 5 },\n  { layout: 'disperse', redundancy: 2, capacity: 8 },\n]\nPOSSIBLE_CONFIGURATIONS[11] = [{ layout: 'disperse', redundancy: 3, capacity: 8 }]\nPOSSIBLE_CONFIGURATIONS[12] = [\n  { layout: 'replica', redundancy: 2, capacity: 6 },\n  { layout: 'disperse', redundancy: 4, capacity: 8 },\n]\nPOSSIBLE_CONFIGURATIONS[13] = [{ layout: 'disperse', redundancy: 5, capacity: 8 }]\nPOSSIBLE_CONFIGURATIONS[14] = [\n  { layout: 'replica', redundancy: 2, capacity: 7 },\n  { layout: 'disperse', redundancy: 6, capacity: 8 },\n]\nPOSSIBLE_CONFIGURATIONS[15] = [\n  { layout: 'replica', redundancy: 3, capacity: 5 },\n  { layout: 'disperse', redundancy: 7, capacity: 8 },\n]\nPOSSIBLE_CONFIGURATIONS[16] = [{ layout: 'replica', redundancy: 2, capacity: 8 }]\n\nfunction computeBrickSize(srs, brickSize = Infinity) {\n  const xapi = this.getXapi(srs[0])\n  const srsObjects = map(srs, srId => xapi.getObject(srId))\n  const srSizes = map(srsObjects, sr => sr.physical_size - sr.physical_utilisation)\n  const minSize = Math.min(brickSize, ...srSizes)\n  return Math.floor((minSize - XOSAN_VM_SYSTEM_DISK_SIZE) * XOSAN_DATA_DISK_USEAGE_RATIO)\n}\n\nexport async function computeXosanPossibleOptions({ lvmSrs, brickSize = Infinity }) {\n  const count = lvmSrs.length\n  const configurations = POSSIBLE_CONFIGURATIONS[count]\n  if (!configurations) {\n    return null\n  }\n  if (count > 0) {\n    const finalBrickSize = this::computeBrickSize(lvmSrs, brickSize)\n    return configurations.map(conf => ({\n      ...conf,\n      availableSpace: Math.max(0, finalBrickSize * conf.capacity),\n    }))\n  }\n}\n\ncomputeXosanPossibleOptions.params = {\n  lvmSrs: {\n    type: 'array',\n    items: {\n      type: 'string',\n    },\n  },\n  brickSize: {\n    type: 'number',\n    optional: true,\n  },\n}\n\n// ---------------------------------------------------------------------\n\nexport async function unlock({ licenseId, sr }) {\n  await this.unlockXosanLicense({ licenseId, srId: sr.id })\n\n  const glusterEndpoint = this::_getGlusterEndpoint(sr.id)\n  await _removeQuota(glusterEndpoint)\n  await glusterEndpoint.xapi.call('SR.scan', glusterEndpoint.xapi.getObject(sr).$ref)\n}\n\nunlock.description = 'Unlock XOSAN SR functionalities by binding it to a paid license'\n\nunlock.permission = 'admin'\n\nunlock.params = {\n  licenseId: { type: 'string' },\n  sr: { type: 'string' },\n}\n\nunlock.resolve = {\n  sr: ['sr', 'SR', 'administrate'],\n}\n\n// ---------------------------------------------------------------------\n\nexport async function downloadAndInstallXosanPack({ id, version, pool }) {\n  if (!this.requestResource) {\n    throw new Error('requestResource is not a function')\n  }\n\n  const xapi = this.getXapi(pool.id)\n  const res = await this.requestResource({\n    id,\n    namespace: 'xosan',\n    version,\n  })\n  await xapi.installSupplementalPackOnAllHosts(res)\n  await xapi.pool.update_other_config('xosan_pack_installation_time', String(Math.floor(Date.now() / 1e3)))\n}\n\ndownloadAndInstallXosanPack.description = 'Register a resource via cloud plugin'\n\ndownloadAndInstallXosanPack.params = {\n  id: { type: 'string' },\n  version: { type: 'string' },\n  pool: { type: 'string' },\n}\n\ndownloadAndInstallXosanPack.resolve = {\n  pool: ['pool', 'pool', 'administrate'],\n}\n\ndownloadAndIn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;IAAE0D,IAAI,EAAE;EAAS,CAAC;EACtBgM,OAAO,EAAE;IAAEhM,IAAI,EAAE;EAAS,CAAC;EAC3B2G,IAAI,EAAE;IAAE3G,IAAI,EAAE;EAAS;AACzB,CAAC;AAEDyU,2BAA2B,CAAC3S,OAAO,GAAG;EACpC6E,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc;AACvC,CAAC;AAED8N,2BAA2B,CAAChT,UAAU,GAAG,OAAO","ignoreList":[]}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   # Changelog

# [1.9.0](https://github.com/axios/axios/compare/v1.8.4...v1.9.0) (2025-04-24)


### Bug Fixes

* **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983))
* **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45))
* **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc))
* **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9))
* **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15))
* **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc))
* **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0))


### Features

* **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+200/-34 (#6890 #6889 #6888 #6885 #6881 #6767 #6874 #6873 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+26/-1 ()")
- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+21/-0 (#5707 )")
- <img src="https://avatars.githubusercontent.com/u/2500247?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [George Cheng](https://github.com/Gerhut "+3/-3 (#5096 )")
- <img src="https://avatars.githubusercontent.com/u/30260221?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [FatahChan](https://github.com/FatahChan "+2/-2 (#6855 )")
- <img src="https://avatars.githubusercontent.com/u/49002?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ionuț G. Stan](https://github.com/igstan "+1/-1 (#6661 )")

## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19)


### Bug Fixes

* **buildFullPath:** handle `allowAbsoluteUrls: false` without `baseURL` ([#6833](https://github.com/axios/axios/issues/6833)) ([f10c2e0](https://github.com/axios/axios/commit/f10c2e0de7fde0051f848609a29c2906d0caa1d9))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/8029107?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Marc Hassan](https://github.com/mhassan1 "+5/-1 (#6833 )")

## [1.8.3](https://github.com/axios/axios/compare/v1.8.2...v1.8.3) (2025-03-10)


### Bug Fixes

* add missing type for allowAbsoluteUrls ([#6818](https://github.com/axios/axios/issues/6818)) ([10fa70e](https://github.com/axios/axios/commit/10fa70ef14fe39558b15a179f0e82f5f5e5d11b2))
* **xhr/fetch:** pass `allowAbsoluteUrls` to `buildFullPath` in `xhr` and `fetch` adapters ([#6814](https://github.com/axios/axios/issues/6814)) ([ec159e5](https://github.com/axios/axios/commit/ec159e507bdf08c04ba1a10fe7710094e9e50ec9))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/3238291?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ashcon Partovi](https://github.com/Electroid "+6/-0 (#6811 )")
- <img src="https://avatars.githubusercontent.com/u/28559054?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [StefanBRas](https://github.com/StefanBRas "+4/-0 (#6818 )")
- <img src="https://avatars.githubusercontent.com/u/8029107?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Marc Hassan](https://github.com/mhassan1 "+2/-2 (#6814 )")

## [1.8.2](https://github.com/axios/axios/compare/v1.8.1...v1.8.2) (2025-03-07)


### Bug Fixes

* **http-adapter:** add allowAbsoluteUrls to path building ([#6810](https://github.com/axios/axios/issues/6810)) ([fb8eec2](https://github.com/axios/axios/commit/fb8eec214ce7744b5ca787f2c3b8339b2f54b00f))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/14166260?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Fasoro-Joseph Alexander](https://github.com/lexcorp16 "+1/-1 (#6810 )")

## [1.8.1](https://github.com/axios/axios/compare/v1.8.0...v1.8.1) (2025-02-26)


### Bug Fixes

* **utils:** move `generateString` to platform utils to avoid importing crypto module into client builds; ([#6789](https://github.com/axios/axios/issues/6789)) ([36a5a62](https://github.com/axios/axios/commit/36a5a620bec0b181451927f13ac85b9888b86cec))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+51/-47 (#6789 )")

# [1.8.0](https://github.com/axios/axios/compare/v1.7.9...v1.8.0) (2025-02-25)


### Bug Fixes

* **examples:** application crashed when navigating examples in browser ([#5938](https://github.com/axios/axios/issues/5938)) ([1260ded](https://github.com/axios/axios/commit/1260ded634ec101dd5ed05d3b70f8e8f899dba6c))
* missing word in SUPPORT_QUESTION.yml ([#6757](https://github.com/axios/axios/issues/6757)) ([1f890b1](https://github.com/axios/axios/commit/1f890b13f2c25a016f3c84ae78efb769f244133e))
* **utils:** replace getRandomValues with crypto module ([#6788](https://github.com/axios/axios/issues/6788)) ([23a25af](https://github.com/axios/axios/commit/23a25af0688d1db2c396deb09229d2271cc24f6c))


### Features

* Add config for ignoring absolute URLs ([#5902](https://github.com/axios/axios/issues/5902)) ([#6192](https://github.com/axios/axios/issues/6192)) ([32c7bcc](https://github.com/axios/axios/commit/32c7bcc0f233285ba27dec73a4b1e81fb7a219b3))


### Reverts

* Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) ([1317261](https://github.com/axios/axios/commit/1317261125e9c419fe9f126867f64d28f9c1efda)), closes [#6731](https://github.com/axios/axios/issues/6731) [#6732](https://github.com/axios/axios/issues/6732)


### BREAKING CHANGES

* code relying on the above will now combine the URLs instead of prefer request URL

* feat: add config option for allowing absolute URLs

* fix: add default value for allowAbsoluteUrls in buildFullPath

* fix: typo in flow control when setting allowAbsoluteUrls

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/7661715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Toscano](https://github.com/GethosTheWalrus "+42/-8 (#6192 )")
- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+26/-3 (#6788 #6777 )")
- <img src="https://avatars.githubusercontent.com/u/72578270?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Naron](https://github.com/naronchen "+27/-0 (#5901 )")
- <img src="https://avatars.githubusercontent.com/u/47430686?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [shravan || श्रvan](https://github.com/shravan20 "+7/-3 (#6116 )")
- <img src="https://avatars.githubusercontent.com/u/145078271?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Justin Dhillon](https://github.com/justindhillon "+0/-7 (#6312 )")
- <img src="https://avatars.githubusercontent.com/u/30925732?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [yionr](https://github.com/yionr "+5/-1 (#6129 )")
- <img src="https://avatars.githubusercontent.com/u/534166?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shin&#x27;ya Ueoka](https://github.com/ueokande "+3/-3 (#5935 )")
- <img src="https://avatars.githubusercontent.com/u/33569?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dan Dascalescu](https://github.com/dandv "+3/-3 (#5908 #6757 )")
- <img src="https://avatars.githubusercontent.com/u/16476523?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Nitin Ramnani](https://github.com/NitinRamnani "+2/-2 (#5938 )")
- <img src="https://avatars.githubusercontent.com/u/152275799?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shay Molcho](https://github.com/shaymolcho "+2/-2 (#6770 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+0/-3 (#6732 )")
- fancy45daddy
- <img src="https://avatars.githubusercontent.com/u/127725897?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Habip Akyol](https://github.com/habipakyol "+1/-1 (#6030 )")
- <img src="https://avatars.githubusercontent.com/u/54869395?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bailey Lissington](https://github.com/llamington "+1/-1 (#6771 )")
- <img src="https://avatars.githubusercontent.com/u/14969290?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Bernardo da Eira Duarte](https://github.com/bernardoduarte "+1/-1 (#6480 )")
- <img src="https://avatars.githubusercontent.com/u/117800149?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shivam Batham](https://github.com/Shivam-Batham "+1/-1 (#5949 )")
- <img src="https://avatars.githubusercontent.com/u/67861627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Lipin Kariappa](https://github.com/lipinnnnn "+1/-1 (#5936 )")

## [1.7.9](https://github.com/axios/axios/compare/v1.7.8...v1.7.9) (2024-12-04)


### Reverts

* Revert "fix(types): export CJS types from ESM (#6218)" (#6729) ([c44d2f2](https://github.com/axios/axios/commit/c44d2f2316ad289b38997657248ba10de11deb6c)), closes [#6218](https://github.com/axios/axios/issues/6218) [#6729](https://github.com/axios/axios/issues/6729)

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+596/-108 (#6729 )")

## [1.7.8](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) (2024-11-25)


### Bug Fixes

* allow passing a callback as paramsSerializer to buildURL ([#6680](https://github.com/axios/axios/issues/6680)) ([eac4619](https://github.com/axios/axios/commit/eac4619fe2e0926e876cd260ee21e3690381dbb5))
* **core:** fixed config merging bug ([#6668](https://github.com/axios/axios/issues/6668)) ([5d99fe4](https://github.com/axios/axios/commit/5d99fe4491202a6268c71e5dcc09192359d73cea))
* fixed width form to not shrink after 'Send Request' button is clicked ([#6644](https://github.com/axios/axios/issues/6644)) ([7ccd5fd](https://github.com/axios/axios/commit/7ccd5fd42402102d38712c32707bf055be72ab54))
* **http:** add support for File objects as payload in http adapter ([#6588](https://github.com/axios/axios/issues/6588)) ([#6605](https://github.com/axios/axios/issues/6605)) ([6841d8d](https://github.com/axios/axios/commit/6841d8d18ddc71cc1bd202ffcfddb3f95622eef3))
* **http:** fixed proxy-from-env module import ([#5222](https://github.com/axios/axios/issues/5222)) ([12b3295](https://github.com/axios/axios/commit/12b32957f1258aee94ef859809ed39f8f88f9dfa))
* **http:** use `globalThis.TextEncoder` when available ([#6634](https://github.com/axios/axios/issues/6634)) ([df956d1](https://github.com/axios/axios/commit/df956d18febc9100a563298dfdf0f102c3d15410))
* ios11 breaks when build ([#6608](https://github.com/axios/axios/issues/6608)) ([7638952](https://github.com/axios/axios/commit/763895270f7b50c7c780c3c9807ae8635de952cd))
* **types:** add missing types for mergeConfig function ([#6590](https://github.com/axios/axios/issues/6590)) ([00de614](https://github.com/axios/axios/commit/00de614cd07b7149af335e202aef0e076c254f49))
* **types:** export CJS types from ESM ([#6218](https://github.com/axios/axios/issues/6218)) ([c71811b](https://github.com/axios/axios/commit/c71811b00f2fcff558e4382ba913bdac4ad7200e))
* updated stream aborted error message to be more clear ([#6615](https://github.com/axios/axios/issues/6615)) ([cc3217a](https://github.com/axios/axios/commit/cc3217a612024d83a663722a56d7a98d8759c6d5))
* use URL API instead of DOM to fix a potential vulnerability warning; ([#6714](https://github.com/axios/axios/issues/6714)) ([0a8d6e1](https://github.com/axios/axios/commit/0a8d6e19da5b9899a2abafaaa06a75ee548597db))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/779047?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Remco Haszing](https://github.com/remcohaszing "+108/-596 (#6218 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+281/-19 (#6640 #6619 )")
- <img src="https://avatars.githubusercontent.com/u/140250471?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Aayush Yadav](https://github.com/aayushyadav020 "+124/-111 (#6617 )")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+12/-65 (#6714 )")
- <img src="https://avatars.githubusercontent.com/u/479715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ell Bradshaw](https://github.com/cincodenada "+29/-0 (#6489 )")
- <img src="https://avatars.githubusercontent.com/u/60218780?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Amit Saini](https://github.com/amitsainii "+13/-3 (#5237 )")
- <img src="https://avatars.githubusercontent.com/u/19817867?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Tommaso Paulon](https://github.com/guuido "+14/-1 (#6680 )")
- <img src="https://avatars.githubusercontent.com/u/63336443?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Akki](https://github.com/Aakash-Rana "+5/-5 (#6668 )")
- <img src="https://avatars.githubusercontent.com/u/20028934?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Sampo Silvennoinen](https://github.com/stscoundrel "+3/-3 (#6633 )")
- <img src="https://avatars.githubusercontent.com/u/1174718?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Kasper Isager Dalsgarð](https://github.com/kasperisager "+2/-2 (#6634 )")
- <img src="https://avatars.githubusercontent.com/u/3709715?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Christian Clauss](https://github.com/cclauss "+4/-0 (#6683 )")
- <img src="https://avatars.githubusercontent.com/u/1639119?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Pavan Welihinda](https://github.com/pavan168 "+2/-2 (#5222 )")
- <img src="https://avatars.githubusercontent.com/u/5742900?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Taylor Flatt](https://github.com/taylorflatt "+2/-2 (#6615 )")
- <img src="https://avatars.githubusercontent.com/u/79452224?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Kenzo Wada](https://github.com/Kenzo-Wada "+2/-2 (#6608 )")
- <img src="https://avatars.githubusercontent.com/u/50064240?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ngole Lawson](https://github.com/echelonnought "+3/-0 (#6644 )")
- <img src="https://avatars.githubusercontent.com/u/1262198?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Haven](https://github.com/Baoyx007 "+3/-0 (#6590 )")
- <img src="https://avatars.githubusercontent.com/u/149003676?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Shrivali Dutt](https://github.com/shrivalidutt "+1/-1 (#6637 )")
- <img src="https://avatars.githubusercontent.com/u/1304290?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Henco Appel](https://github.com/hencoappel "+1/-1 (#6605 )")

## [1.7.7](https://github.com/axios/axios/compare/v1.7.6...v1.7.7) (2024-08-31)


### Bug Fixes

* **fetch:** fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; ([#6584](https://github.com/axios/axios/issues/6584)) ([d198085](https://github.com/axios/axios/commit/d1980854fee1765cd02fa0787adf5d6e34dd9dcf))
* **http:** fixed support for IPv6 literal strings in url ([#5731](https://github.com/axios/axios/issues/5731)) ([364993f](https://github.com/axios/axios/commit/364993f0d8bc6e0e06f76b8a35d2d0a35cab054c))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/10539109?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Rishi556](https://github.com/Rishi556 "+39/-1 (#5731 )")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-7 (#6584 )")

## [1.7.6](https://github.com/axios/axios/compare/v1.7.5...v1.7.6) (2024-08-30)


### Bug Fixes

* **fetch:** fix content length calculation for FormData payload; ([#6524](https://github.com/axios/axios/issues/6524)) ([085f568](https://github.com/axios/axios/commit/085f56861a83e9ac02c140ad9d68dac540dfeeaa))
* **fetch:** optimize signals composing logic; ([#6582](https://github.com/axios/axios/issues/6582)) ([df9889b](https://github.com/axios/axios/commit/df9889b83c2cc37e9e6189675a73ab70c60f031f))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+98/-46 (#6582 )")
- <img src="https://avatars.githubusercontent.com/u/3534453?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jacques Germishuys](https://github.com/jacquesg "+5/-1 (#6524 )")
- <img src="https://avatars.githubusercontent.com/u/53894505?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [kuroino721](https://github.com/kuroino721 "+3/-1 (#6575 )")

## [1.7.5](https://github.com/axios/axios/compare/v1.7.4...v1.7.5) (2024-08-23)


### Bug Fixes

* **adapter:** fix undefined reference to hasBrowserEnv ([#6572](https://github.com/axios/axios/issues/6572)) ([7004707](https://github.com/axios/axios/commit/7004707c4180b416341863bd86913fe4fc2f1df1))
* **core:** add the missed implementation of AxiosError#status property; ([#6573](https://github.com/axios/axios/issues/6573)) ([6700a8a](https://github.com/axios/axios/commit/6700a8adac06942205f6a7a21421ecb36c4e0852))
* **core:** fix `ReferenceError: navigator is not defined` for custom environments; ([#6567](https://github.com/axios/axios/issues/6567)) ([fed1a4b](https://github.com/axios/axios/commit/fed1a4b2d78ed4a588c84e09d32749ed01dc2794))
* **fetch:** fix credentials handling in Cloudflare workers ([#6533](https://github.com/axios/axios/issues/6533)) ([550d885](https://github.com/axios/axios/commit/550d885eb90fd156add7b93bbdc54d30d2f9a98d))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+187/-83 (#6573 #6567 #6566 #6564 #6563 #6557 #6556 #6555 #6554 #6552 )")
- <img src="https://avatars.githubusercontent.com/u/2495809?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Antonin Bas](https://github.com/antoninbas "+6/-6 (#6572 )")
- <img src="https://avatars.githubusercontent.com/u/5406212?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Hans Otto Wirtz](https://github.com/hansottowirtz "+4/-1 (#6533 )")

## [1.7.4](https://github.com/axios/axios/compare/v1.7.3...v1.7.4) (2024-08-13)


### Bug Fixes

* **sec:** CVE-2024-39338 ([#6539](https://github.com/axios/axios/issues/6539)) ([#6543](https://github.com/axios/axios/issues/6543)) ([6b6b605](https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a))
* **sec:** disregard protocol-relative URL to remediate SSRF ([#6539](https://github.com/axios/axios/issues/6539)) ([07a661a](https://github.com/axios/axios/commit/07a661a2a6b9092c4aa640dcc7f724ec5e65bdda))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/31389480?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Lev Pachmanov](https://github.com/levpachmanov "+47/-11 (#6543 )")
- <img src="https://avatars.githubusercontent.com/u/41283691?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Đỗ Trọng Hải](https://github.com/hainenber "+49/-4 (#6539 )")

## [1.7.3](https://github.com/axios/axios/compare/v1.7.2...v1.7.3) (2024-08-01)


### Bug Fixes

* **adapter:** fix progress event emitting; ([#6518](https://github.com/axios/axios/issues/6518)) ([e3c76fc](https://github.com/axios/axios/commit/e3c76fc9bdd03aa4d98afaf211df943e2031453f))
* **fetch:** fix withCredentials request config ([#6505](https://github.com/axios/axios/issues/6505)) ([85d4d0e](https://github.com/axios/axios/commit/85d4d0ea0aae91082f04e303dec46510d1b4e787))
* **xhr:** return original config on errors from XHR adapter ([#6515](https://github.com/axios/axios/issues/6515)) ([8966ee7](https://github.com/axios/axios/commit/8966ee7ea62ecbd6cfb39a905939bcdab5cf6388))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+211/-159 (#6518 #6519 )")
- <img src="https://avatars.githubusercontent.com/u/10867286?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Valerii Sidorenko](https://github.com/ValeraS "+3/-3 (#6515 )")
- <img src="https://avatars.githubusercontent.com/u/8599535?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [prianYu](https://github.com/prianyu "+2/-2 (#6505 )")

## [1.7.2](https://github.com/axios/axios/compare/v1.7.1...v1.7.2) (2024-05-21)


### Bug Fixes

* **fetch:** enhance fetch API detection; ([#6413](https://github.com/axios/axios/issues/6413)) ([4f79aef](https://github.com/axios/axios/commit/4f79aef81b7c4644328365bfc33acf0a9ef595bc))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+3/-3 (#6413 )")

## [1.7.1](https://github.com/axios/axios/compare/v1.7.0...v1.7.1) (2024-05-20)


### Bug Fixes

* **fetch:** fixed ReferenceError issue when TextEncoder is not available in the environment; ([#6410](https://github.com/axios/axios/issues/6410)) ([733f15f](https://github.com/axios/axios/commit/733f15fe5bd2d67e1fadaee82e7913b70d45dc5e))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+14/-9 (#6410 )")

# [1.7.0](https://github.com/axios/axios/compare/v1.7.0-beta.2...v1.7.0) (2024-05-19)


### Features

* **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42))

### Bug Fixes

* **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9))  

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+1015/-127 (#6371 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+30/-14 ()")
- <img src="https://avatars.githubusercontent.com/u/16711696?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Alexandre ABRIOUX](https://github.com/alexandre-abrioux "+56/-6 (#6362 )")

# [1.7.0-beta.2](https://github.com/axios/axios/compare/v1.7.0-beta.1...v1.7.0-beta.2) (2024-05-19)


### Bug Fixes

* **fetch:** capitalize HTTP method names; ([#6395](https://github.com/axios/axios/issues/6395)) ([ad3174a](https://github.com/axios/axios/commit/ad3174a3515c3c2573f4bcb94818d582826f3914))
* **fetch:** fix & optimize progress capturing for cases when the request data has a nullish value or zero data length ([#6400](https://github.com/axios/axios/issues/6400)) ([95a3e8e](https://github.com/axios/axios/commit/95a3e8e346cfd6a5548e171f2341df3235d0e26b))
* **fetch:** fix headers getting from a stream response; ([#6401](https://github.com/axios/axios/issues/6401)) ([870e0a7](https://github.com/axios/axios/commit/870e0a76f60d0094774a6a63fa606eec52a381af))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+99/-46 (#6405 #6404 #6401 #6400 #6395 )")

# [1.7.0-beta.1](https://github.com/axios/axios/compare/v1.7.0-beta.0...v1.7.0-beta.1) (2024-05-07)


### Bug Fixes

* **core/axios:** handle un-writable error stack ([#6362](https://github.com/axios/axios/issues/6362)) ([81e0455](https://github.com/axios/axios/commit/81e0455b7b57fbaf2be16a73ebe0e6591cc6d8f9))
* **fetch:** fix cases when ReadableStream or Response.body are not available; ([#6377](https://github.com/axios/axios/issues/6377)) ([d1d359d](https://github.com/axios/axios/commit/d1d359da347704e8b28d768e61515a3e96c5b072))
* **fetch:** treat fetch-related TypeError as an AxiosError.ERR_NETWORK error; ([#6380](https://github.com/axios/axios/issues/6380)) ([bb5f9a5](https://github.com/axios/axios/commit/bb5f9a5ab768452de9e166dc28d0ffc234245ef1))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/16711696?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Alexandre ABRIOUX](https://github.com/alexandre-abrioux "+56/-6 (#6362 )")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+42/-17 (#6380 #6377 )")

# [1.7.0-beta.0](https://github.com/axios/axios/compare/v1.6.8...v1.7.0-beta.0) (2024-04-28)


### Features

* **adapter:** add fetch adapter; ([#6371](https://github.com/axios/axios/issues/6371)) ([a3ff99b](https://github.com/axios/axios/commit/a3ff99b59d8ec2ab5dd049e68c043617a4072e42))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+1015/-127 (#6371 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+30/-14 ()")

## [1.6.8](https://github.com/axios/axios/compare/v1.6.7...v1.6.8) (2024-03-15)


### Bug Fixes

* **AxiosHeaders:** fix AxiosHeaders conversion to an object during config merging ([#6243](https://github.com/axios/axios/issues/6243)) ([2656612](https://github.com/axios/axios/commit/2656612bc10fe2757e9832b708ed773ab340b5cb))
* **import:** use named export for EventEmitter; ([7320430](https://github.com/axios/axios/commit/7320430aef2e1ba2b89488a0eaf42681165498b1))
* **vulnerability:** update follow-redirects to 1.15.6 ([#6300](https://github.com/axios/axios/issues/6300)) ([8786e0f](https://github.com/axios/axios/commit/8786e0ff55a8c68d4ca989801ad26df924042e27))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+4572/-3446 (#6238 )")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-0 (#6231 )")
- <img src="https://avatars.githubusercontent.com/u/68230846?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Mitchell](https://github.com/Creaous "+9/-9 (#6300 )")
- <img src="https://avatars.githubusercontent.com/u/53797821?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Emmanuel](https://github.com/mannoeu "+2/-2 (#6196 )")
- <img src="https://avatars.githubusercontent.com/u/44109284?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Lucas Keller](https://github.com/ljkeller "+3/-0 (#6194 )")
- <img src="https://avatars.githubusercontent.com/u/72791488?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Aditya Mogili](https://github.com/ADITYA-176 "+1/-1 ()")
- <img src="https://avatars.githubusercontent.com/u/46135319?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Miroslav Petrov](https://github.com/petrovmiroslav "+1/-1 (#6243 )")

## [1.6.7](https://github.com/axios/axios/compare/v1.6.6...v1.6.7) (2024-01-25)


### Bug Fixes

* capture async stack only for rejections with native error objects; ([#6203](https://github.com/axios/axios/issues/6203)) ([1a08f90](https://github.com/axios/axios/commit/1a08f90f402336e4d00e9ee82f211c6adb1640b0))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+30/-26 (#6203 )")
- <img src="https://avatars.githubusercontent.com/u/73059627?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [zhoulixiang](https://github.com/zh-lx "+0/-3 (#6186 )")

## [1.6.6](https://github.com/axios/axios/compare/v1.6.5...v1.6.6) (2024-01-24)


### Bug Fixes

* fixed missed dispatchBeforeRedirect argument ([#5778](https://github.com/axios/axios/issues/5778)) ([a1938ff](https://github.com/axios/axios/commit/a1938ff073fcb0f89011f001dfbc1fa1dc995e39))
* wrap errors to improve async stack trace ([#5987](https://github.com/axios/axios/issues/5987)) ([123f354](https://github.com/axios/axios/commit/123f354b920f154a209ea99f76b7b2ef3d9ebbab))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/1186084?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ilya Priven](https://github.com/ikonst "+91/-8 (#5987 )")
- <img src="https://avatars.githubusercontent.com/u/1884246?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Zao Soula](https://github.com/zaosoula "+6/-6 (#5778 )")

## [1.6.5](https://github.com/axios/axios/compare/v1.6.4...v1.6.5) (2024-01-05)


### Bug Fixes

* **ci:** refactor notify action as a job of publish action; ([#6176](https://github.com/axios/axios/issues/6176)) ([0736f95](https://github.com/axios/axios/commit/0736f95ce8776366dc9ca569f49ba505feb6373c))
* **dns:** fixed lookup error handling; ([#6175](https://github.com/axios/axios/issues/6175)) ([f4f2b03](https://github.com/axios/axios/commit/f4f2b039dd38eb4829e8583caede4ed6d2dd59be))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+41/-6 (#6176 #6175 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+6/-1 ()")

## [1.6.4](https://github.com/axios/axios/compare/v1.6.3...v1.6.4) (2024-01-03)


### Bug Fixes

* **security:** fixed formToJSON prototype pollution vulnerability; ([#6167](https://github.com/axios/axios/issues/6167)) ([3c0c11c](https://github.com/axios/axios/commit/3c0c11cade045c4412c242b5727308cff9897a0e))
* **security:** fixed security vulnerability in follow-redirects ([#6163](https://github.com/axios/axios/issues/6163)) ([75af1cd](https://github.com/axios/axios/commit/75af1cdff5b3a6ca3766d3d3afbc3115bb0811b8))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+34/-6 ()")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+34/-3 (#6172 #6167 )")
- <img src="https://avatars.githubusercontent.com/u/1402060?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Guy Nesher](https://github.com/gnesher "+10/-10 (#6163 )")

## [1.6.3](https://github.com/axios/axios/compare/v1.6.2...v1.6.3) (2023-12-26)


### Bug Fixes

* Regular Expression Denial of Service (ReDoS) ([#6132](https://github.com/axios/axios/issues/6132)) ([5e7ad38](https://github.com/axios/axios/commit/5e7ad38fb0f819fceb19fb2ee5d5d38f56aa837d))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+15/-6 (#6145 )")
- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+17/-2 (#6132 )")
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+3/-0 (#6084 )")

## [1.6.2](https://github.com/axios/axios/compare/v1.6.1...v1.6.2) (2023-11-14)


### Features

* **withXSRFToken:** added withXSRFToken option as a workaround to achieve the old `withCredentials` behavior; ([#6046](https://github.com/axios/axios/issues/6046)) ([cff9967](https://github.com/axios/axios/commit/cff996779b272a5e94c2b52f5503ccf668bc42dc))

### PRs
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old &#x60;withCredentials&#x60; behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
```

📢 This PR added &#x27;withXSRFToken&#x27; option as a replacement for old withCredentials behaviour. 
You should now use withXSRFToken along with withCredential to get the old behavior.
This functionality is considered as a fix.
```

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+271/-146 (#6081 #6080 #6079 #6078 #6046 #6064 #6063 )")
- <img src="https://avatars.githubusercontent.com/u/79681367?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ng Choon Khon (CK)](https://github.com/ckng0221 "+4/-4 (#6073 )")
- <img src="https://avatars.githubusercontent.com/u/9162827?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Muhammad Noman](https://github.com/mnomanmemon "+2/-2 (#6048 )")

## [1.6.1](https://github.com/axios/axios/compare/v1.6.0...v1.6.1) (2023-11-08)


### Bug Fixes

* **formdata:** fixed content-type header normalization for non-standard browser environments; ([#6056](https://github.com/axios/axios/issues/6056)) ([dd465ab](https://github.com/axios/axios/commit/dd465ab22bbfa262c6567be6574bf46a057d5288))
* **platform:** fixed emulated browser detection in node.js environment; ([#6055](https://github.com/axios/axios/issues/6055)) ([3dc8369](https://github.com/axios/axios/commit/3dc8369e505e32a4e12c22f154c55fd63ac67fbb))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+432/-65 (#6059 #6056 #6055 )")
- <img src="https://avatars.githubusercontent.com/u/3982806?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Fabian Meyer](https://github.com/meyfa "+5/-2 (#5835 )")

### PRs
- feat(withXSRFToken): added withXSRFToken option as a workaround to achieve the old &#x60;withCredentials&#x60; behavior; ( [#6046](https://api.github.com/repos/axios/axios/pulls/6046) )
```

📢 This PR added &#x27;withXSRFToken&#x27; option as a replacement for old withCredentials behaviour. 
You should now use withXSRFToken along with withCredential to get the old behavior.
This functionality is considered as a fix.
```

# [1.6.0](https://github.com/axios/axios/compare/v1.5.1...v1.6.0) (2023-10-26)


### Bug Fixes

* **CSRF:** fixed CSRF vulnerability CVE-2023-45857 ([#6028](https://github.com/axios/axios/issues/6028)) ([96ee232](https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0))
* **dns:** fixed lookup function decorator to work properly in node v20; ([#6011](https://github.com/axios/axios/issues/6011)) ([5aaff53](https://github.com/axios/axios/commit/5aaff532a6b820bb9ab6a8cd0f77131b47e2adb8))
* **types:** fix AxiosHeaders types; ([#5931](https://github.com/axios/axios/issues/5931)) ([a1c8ad0](https://github.com/axios/axios/commit/a1c8ad008b3c13d53e135bbd0862587fb9d3fc09))

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+449/-114 (#6032 #6021 #6011 #5932 #5931 )")
- <img src="https://avatars.githubusercontent.com/u/63700910?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Valentin Panov](https://github.com/valentin-panov "+4/-4 (#6028 )")
- <img src="https://avatars.githubusercontent.com/u/76877078?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Rinku Chaudhari](https://github.com/therealrinku "+1/-1 (#5889 )")

## [1.5.1](https://github.com/axios/axios/compare/v1.5.0...v1.5.1) (2023-09-26)


### Bug Fixes

* **adapters:** improved adapters loading logic to have clear error messages; ([#5919](https://github.com/axios/axios/issues/5919)) ([e410779](https://github.com/axios/axios/commit/e4107797a7a1376f6209fbecfbbce73d3faa7859))
* **formdata:** fixed automatic addition of the `Content-Type` header for FormData in non-browser environments; ([#5917](https://github.com/axios/axios/issues/5917)) ([bc9af51](https://github.com/axios/axios/commit/bc9af51b1886d1b3529617702f2a21a6c0ed5d92))
* **headers:** allow `content-encoding` header to handle case-insensitive values ([#5890](https://github.com/axios/axios/issues/5890)) ([#5892](https://github.com/axios/axios/issues/5892)) ([4c89f25](https://github.com/axios/axios/commit/4c89f25196525e90a6e75eda9cb31ae0a2e18acd))
* **types:** removed duplicated code ([9e62056](https://github.com/axios/axios/commit/9e6205630e1c9cf863adf141c0edb9e6d8d4b149))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+89/-18 (#5919 #5917 )")
- <img src="https://avatars.githubusercontent.com/u/110460234?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [David Dallas](https://github.com/DavidJDallas "+11/-5 ()")
- <img src="https://avatars.githubusercontent.com/u/71556073?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Sean Sattler](https://github.com/fb-sean "+2/-8 ()")
- <img src="https://avatars.githubusercontent.com/u/4294069?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Mustafa Ateş Uzun](https://github.com/0o001 "+4/-4 ()")
- <img src="https://avatars.githubusercontent.com/u/132928043?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Przemyslaw Motacki](https://github.com/sfc-gh-pmotacki "+2/-1 (#5892 )")
- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+1/-1 ()")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

# [1.5.0](https://github.com/axios/axios/compare/v1.4.0...v1.5.0) (2023-08-26)


### Bug Fixes

* **adapter:** make adapter loading error more clear by using platform-specific adapters explicitly ([#5837](https://github.com/axios/axios/issues/5837)) ([9a414bb](https://github.com/axios/axios/commit/9a414bb6c81796a95c6c7fe668637825458e8b6d))
* **dns:** fixed `cacheable-lookup` integration; ([#5836](https://github.com/axios/axios/issues/5836)) ([b3e327d](https://github.com/axios/axios/commit/b3e327dcc9277bdce34c7ef57beedf644b00d628))
* **headers:** added support for setting header names that overlap with class methods; ([#5831](https://github.com/axios/axios/issues/5831)) ([d8b4ca0](https://github.com/axios/axios/commit/d8b4ca0ea5f2f05efa4edfe1e7684593f9f68273))
* **headers:** fixed common Content-Type header merging; ([#5832](https://github.com/axios/axios/issues/5832)) ([8fda276](https://github.com/axios/axios/commit/8fda2766b1e6bcb72c3fabc146223083ef13ce17))


### Features

* export getAdapter function ([#5324](https://github.com/axios/axios/issues/5324)) ([ca73eb8](https://github.com/axios/axios/commit/ca73eb878df0ae2dace81fe3a7f1fb5986231bf1))
* **export:** export adapters without `unsafe` prefix ([#5839](https://github.com/axios/axios/issues/5839)) ([1601f4a](https://github.com/axios/axios/commit/1601f4a27a81ab47fea228f1e244b2c4e3ce28bf))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+66/-29 (#5839 #5837 #5836 #5832 #5831 )")
- <img src="https://avatars.githubusercontent.com/u/102841186?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [夜葬](https://github.com/geekact "+42/-0 (#5324 )")
- <img src="https://avatars.githubusercontent.com/u/65978976?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jonathan Budiman](https://github.com/JBudiman00 "+30/-0 (#5788 )")
- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-5 (#5791 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)


### Bug Fixes

* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1))
* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))


### Features

* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))


### Performance Improvements

* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )")
- <img src="https://avatars.githubusercontent.com/u/47537704?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
- <img src="https://avatars.githubusercontent.com/u/43876655?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)


### Bug Fixes

* **types:** added transport to RawAxiosRequestConfig ([#5445](https://github.com/axios/axios/issues/5445)) ([6f360a2](https://github.com/axios/axios/commit/6f360a2531d8d70363fd9becef6a45a323f170e2))
* **utils:** make isFormData detection logic stricter to avoid unnecessary calling of the `toString` method on the target; ([#5661](https://github.com/axios/axios/issues/5661)) ([aa372f7](https://github.com/axios/axios/commit/aa372f7306295dfd1100c1c2c77ce95c95808e76))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+48/-10 (#5665 #5661 #5663 )")
- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+2/-0 (#5445 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.5](https://github.com/axios/axios/compare/v1.3.4...v1.3.5) (2023-04-05)


### Bug Fixes

* **headers:** fixed isValidHeaderName to support full list of allowed characters; ([#5584](https://github.com/axios/axios/issues/5584)) ([e7decef](https://github.com/axios/axios/commit/e7decef6a99f4627e27ed9ea5b00ce8e201c3841))
* **params:** re-added the ability to set the function as `paramsSerializer` config; ([#5633](https://github.com/axios/axios/issues/5633)) ([a56c866](https://github.com/axios/axios/commit/a56c8661209d5ce5a645a05f294a0e08a6c1f6b3))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+28/-10 (#5633 #5584 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.4](https://github.com/axios/axios/compare/v1.3.3...v1.3.4) (2023-02-22)


### Bug Fixes

* **blob:** added a check to make sure the Blob class is available in the browser's global scope; ([#5548](https://github.com/axios/axios/issues/5548)) ([3772c8f](https://github.com/axios/axios/commit/3772c8fe74112a56e3e9551f894d899bc3a9443a))
* **http:** fixed regression bug when handling synchronous errors inside the adapter; ([#5564](https://github.com/axios/axios/issues/5564)) ([a3b246c](https://github.com/axios/axios/commit/a3b246c9de5c3bc4b5a742e15add55b375479451))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+38/-26 (#5564 )")
- <img src="https://avatars.githubusercontent.com/u/19550000?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [lcysgsg](https://github.com/lcysgsg "+4/-0 (#5548 )")
- <img src="https://avatars.githubusercontent.com/u/5492927?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Michael Di Prisco](https://github.com/Cadienvan "+3/-0 (#5444 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.3](https://github.com/axios/axios/compare/v1.3.2...v1.3.3) (2023-02-13)


### Bug Fixes

* **formdata:** added a check to make sure the FormData class is available in the browser's global scope; ([#5545](https://github.com/axios/axios/issues/5545)) ([a6dfa72](https://github.com/axios/axios/commit/a6dfa72010db5ad52db8bd13c0f98e537e8fd05d))
* **formdata:** fixed setting NaN as Content-Length for form payload in some cases; ([#5535](https://github.com/axios/axios/issues/5535)) ([c19f7bf](https://github.com/axios/axios/commit/c19f7bf770f90ae8307f4ea3104f227056912da1))
* **headers:** fixed the filtering logic of the clear method; ([#5542](https://github.com/axios/axios/issues/5542)) ([ea87ebf](https://github.com/axios/axios/commit/ea87ebfe6d1699af072b9e7cd40faf8f14b0ab93))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+11/-7 (#5545 #5535 #5542 )")
- <img src="https://avatars.githubusercontent.com/u/19842213?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [陈若枫](https://github.com/ruofee "+2/-2 (#5467 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.2](https://github.com/axios/axios/compare/v1.3.1...v1.3.2) (2023-02-03)


### Bug Fixes

* **http:** treat http://localhost as base URL for relative paths to avoid `ERR_INVALID_URL` error; ([#5528](https://github.com/axios/axios/issues/5528)) ([128d56f](https://github.com/axios/axios/commit/128d56f4a0fb8f5f2ed6e0dd80bc9225fee9538c))
* **http:** use explicit import instead of TextEncoder global; ([#5530](https://github.com/axios/axios/issues/5530)) ([6b3c305](https://github.com/axios/axios/commit/6b3c305fc40c56428e0afabedc6f4d29c2830f6f))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+2/-1 (#5530 #5528 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.3.1](https://github.com/axios/axios/compare/v1.3.0...v1.3.1) (2023-02-01)


### Bug Fixes

* **formdata:** add hotfix to use the asynchronous API to compute the content-length header value; ([#5521](https://github.com/axios/axios/issues/5521)) ([96d336f](https://github.com/axios/axios/commit/96d336f527619f21da012fe1f117eeb53e5a2120))
* **serializer:** fixed serialization of array-like objects; ([#5518](https://github.com/axios/axios/issues/5518)) ([08104c0](https://github.com/axios/axios/commit/08104c028c0f9353897b1b6691d74c440fd0c32d))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+27/-8 (#5521 #5518 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

# [1.3.0](https://github.com/axios/axios/compare/v1.2.6...v1.3.0) (2023-01-31)


### Bug Fixes

* **headers:** fixed & optimized clear method; ([#5507](https://github.com/axios/axios/issues/5507)) ([9915635](https://github.com/axios/axios/commit/9915635c69d0ab70daca5738488421f67ca60959))
* **http:** add zlib headers if missing ([#5497](https://github.com/axios/axios/issues/5497)) ([65e8d1e](https://github.com/axios/axios/commit/65e8d1e28ce829f47a837e45129730e541950d3c))


### Features

* **fomdata:** added support for spec-compliant FormData & Blob types; ([#5316](https://github.com/axios/axios/issues/5316)) ([6ac574e](https://github.com/axios/axios/commit/6ac574e00a06731288347acea1e8246091196953))

### Contributors to this release

- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+352/-67 (#5514 #5512 #5510 #5509 #5508 #5316 #5507 )")
- <img src="https://avatars.githubusercontent.com/u/35015993?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [ItsNotGoodName](https://github.com/ItsNotGoodName "+43/-2 (#5497 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.6](https://github.com/axios/axios/compare/v1.2.5...v1.2.6) (2023-01-28)


### Bug Fixes

* **headers:** added missed Authorization accessor; ([#5502](https://github.com/axios/axios/issues/5502)) ([342c0ba](https://github.com/axios/axios/commit/342c0ba9a16ea50f5ed7d2366c5c1a2c877e3f26))
* **types:** fixed `CommonRequestHeadersList` & `CommonResponseHeadersList` types to be private in commonJS; ([#5503](https://github.com/axios/axios/issues/5503)) ([5a3d0a3](https://github.com/axios/axios/commit/5a3d0a3234d77361a1bc7cedee2da1e11df08e2c))

### Contributors to this release

- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+24/-9 (#5503 #5502 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.5](https://github.com/axios/axios/compare/v1.2.4...v1.2.5) (2023-01-26)


### Bug Fixes

* **types:** fixed AxiosHeaders to handle spread syntax by making all methods non-enumerable; ([#5499](https://github.com/axios/axios/issues/5499)) ([580f1e8](https://github.com/axios/axios/commit/580f1e8033a61baa38149d59fd16019de3932c22))

### Contributors to this release

- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+82/-54 (#5499 )")
- ![avatar](https://avatars.githubusercontent.com/u/20516159?v&#x3D;4&amp;s&#x3D;16) [Elliot Ford](https://github.com/EFord36 "+1/-1 (#5462 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.4](https://github.com/axios/axios/compare/v1.2.3...v1.2.4) (2023-01-22)


### Bug Fixes

* **types:** renamed `RawAxiosRequestConfig` back to `AxiosRequestConfig`; ([#5486](https://github.com/axios/axios/issues/5486)) ([2a71f49](https://github.com/axios/axios/commit/2a71f49bc6c68495fa419003a3107ed8bd703ad0))
* **types:** fix `AxiosRequestConfig` generic; ([#5478](https://github.com/axios/axios/issues/5478)) ([9bce81b](https://github.com/axios/axios/commit/186ea062da8b7d578ae78b1a5c220986b9bce81b))

### Contributors to this release

- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+242/-108 (#5486 #5482 )")
- ![avatar](https://avatars.githubusercontent.com/u/9430821?v&#x3D;4&amp;s&#x3D;16) [Daniel Hillmann](https://github.com/hilleer "+1/-1 (#5478 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.3](https://github.com/axios/axios/compare/1.2.2...1.2.3) (2023-01-10)


### Bug Fixes

* **types:** fixed AxiosRequestConfig header interface by refactoring it to RawAxiosRequestConfig; ([#5420](https://github.com/axios/axios/issues/5420)) ([0811963](https://github.com/axios/axios/commit/08119634a22f1d5b19f5c9ea0adccb6d3eebc3bc))

### Contributors to this release

- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+938/-442 (#5456 #5455 #5453 #5451 #5449 #5447 #5446 #5443 #5442 #5439 #5420 )")

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.2] - 2022-12-29

### Fixed
- fix(ci): fix release script inputs [#5392](https://github.com/axios/axios/pull/5392)
- fix(ci): prerelease scipts [#5377](https://github.com/axios/axios/pull/5377)
- fix(ci): release scripts [#5376](https://github.com/axios/axios/pull/5376)
- fix(ci): typescript tests [#5375](https://github.com/axios/axios/pull/5375)
- fix: Brotli decompression [#5353](https://github.com/axios/axios/pull/5353)
- fix: add missing HttpStatusCode [#5345](https://github.com/axios/axios/pull/5345)

### Chores
- chore(ci): set conventional-changelog header config [#5406](https://github.com/axios/axios/pull/5406)
- chore(ci): fix automatic contributors resolving [#5403](https://github.com/axios/axios/pull/5403)
- chore(ci): improved logging for the contributors list generator [#5398](https://github.com/axios/axios/pull/5398)
- chore(ci): fix release action [#5397](https://github.com/axios/axios/pull/5397)
- chore(ci): fix version bump script by adding bump argument for target version [#5393](https://github.com/axios/axios/pull/5393)
- chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 [#5342](https://github.com/axios/axios/pull/5342)
- chore(ci): GitHub Actions Release script [#5384](https://github.com/axios/axios/pull/5384)
- chore(ci): release scripts [#5364](https://github.com/axios/axios/pull/5364)

### Contributors to this release
- ![avatar](https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;16) [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- ![avatar](https://avatars.githubusercontent.com/u/1652293?v&#x3D;4&amp;s&#x3D;16) [Winnie](https://github.com/winniehell)

## [1.2.1] - 2022-12-05

### Changed
- feat(exports): export mergeConfig [#5151](https://github.com/axios/axios/pull/5151)

### Fixed
- fix(CancelledError): include config [#4922](https://github.com/axios/axios/pull/4922)
- fix(general): removing multiple/trailing/leading whitespace [#5022](https://github.com/axios/axios/pull/5022)
- fix(headers): decompression for responses without Content-Length header [#5306](https://github.com/axios/axios/pull/5306)
- fix(webWorker): exception to sending form data in web worker [#5139](https://github.com/axios/axios/pull/5139)

### Refactors
- refactor(types): AxiosProgressEvent.event type to any [#5308](https://github.com/axios/axios/pull/5308)
- refactor(types): add missing types for static AxiosError.from method [#4956](https://github.com/axios/axios/pull/4956)

### Chores
- chore(docs): remove README link to non-existent upgrade guide [#5307](https://github.com/axios/axios/pull/5307)
- chore(docs): typo in issue template name [#5159](https://github.com/axios/axios/pull/5159)

### Contributors to this release

- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [Zachary Lysobey](https://github.com/zachlysobey)
- [Kevin Ennis](https://github.com/kevincennis)
- [Philipp Loose](https://github.com/phloose)
- [secondl1ght](https://github.com/secondl1ght)
- [wenzheng](https://github.com/0x30)
- [Ivan Barsukov](https://github.com/ovarn)
- [Arthur Fiorette](https://github.com/arthurfiorette)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.2.0] - 2022-11-10

### Changed

- changed: refactored module exports [#5162](https://github.com/axios/axios/pull/5162)
- change: re-added support for loading Axios with require('axios').default [#5225](https://github.com/axios/axios/pull/5225)

### Fixed

- fix: improve AxiosHeaders class [#5224](https://github.com/axios/axios/pull/5224)
- fix: TypeScript type definitions for commonjs [#5196](https://github.com/axios/axios/pull/5196)
- fix: type definition of use method on AxiosInterceptorManager to match the the README [#5071](https://github.com/axios/axios/pull/5071)
- fix: __dirname is not defined in the sandbox [#5269](https://github.com/axios/axios/pull/5269)
- fix: AxiosError.toJSON method to avoid circular references [#5247](https://github.com/axios/axios/pull/5247)
- fix: Z_BUF_ERROR when content-encoding is set but the response body is empty [#5250](https://github.com/axios/axios/pull/5250)

### Refactors
- refactor: allowing adapters to be loaded by name [#5277](https://github.com/axios/axios/pull/5277)

### Chores

- chore: force CI restart [#5243](https://github.com/axios/axios/pull/5243)
- chore: update ECOSYSTEM.md [#5077](https://github.com/axios/axios/pull/5077)
- chore: update get/index.html [#5116](https://github.com/axios/axios/pull/5116)
- chore: update Sandbox UI/UX [#5205](https://github.com/axios/axios/pull/5205)
- chore:(actions): remove git credentials after checkout [#5235](https://github.com/axios/axios/pull/5235)
- chore(actions): bump actions/dependency-review-action from 2 to 3 [#5266](https://github.com/axios/axios/pull/5266)
- chore(packages): bump loader-utils from 1.4.1 to 1.4.2 [#5295](https://github.com/axios/axios/pull/5295)
- chore(packages): bump engine.io from 6.2.0 to 6.2.1 [#5294](https://github.com/axios/axios/pull/5294)
- chore(packages): bump socket.io-parser from 4.0.4 to 4.0.5 [#5241](https://github.com/axios/axios/pull/5241)
- chore(packages): bump loader-utils from 1.4.0 to 1.4.1 [#5245](https://github.com/axios/axios/pull/5245)
- chore(docs): update Resources links in README [#5119](https://github.com/axios/axios/pull/5119)
- chore(docs): update the link for JSON url [#5265](https://github.com/axios/axios/pull/5265)
- chore(docs): fix broken links [#5218](https://github.com/axios/axios/pull/5218)
- chore(docs): update and rename UPGRADE_GUIDE.md to MIGRATION_GUIDE.md [#5170](https://github.com/axios/axios/pull/5170)
- chore(docs): typo fix line #856 and #920 [#5194](https://github.com/axios/axios/pull/5194)
- chore(docs): typo fix #800 [#5193](https://github.com/axios/axios/pull/5193)
- chore(docs): fix typos [#5184](https://github.com/axios/axios/pull/5184)
- chore(docs): fix punctuation in README.md [#5197](https://github.com/axios/axios/pull/5197)
- chore(docs): update readme in the Handling Errors section - issue reference #5260 [#5261](https://github.com/axios/axios/pull/5261)
- chore: remove \b from filename [#5207](https://github.com/axios/axios/pull/5207)
- chore(docs): update CHANGELOG.md [#5137](https://github.com/axios/axios/pull/5137)
- chore: add sideEffects false to package.json [#5025](https://github.com/axios/axios/pull/5025)

### Contributors to this release

- [Maddy Miller](https://github.com/me4502)
- [Amit Saini](https://github.com/amitsainii)
- [ecyrbe](https://github.com/ecyrbe)
- [Ikko Ashimine](https://github.com/eltociear)
- [Geeth Gunnampalli](https://github.com/thetechie7)
- [Shreem Asati](https://github.com/shreem-123)
- [Frieder Bluemle](https://github.com/friederbluemle)
- [윤세영](https://github.com/yunseyeong)
- [Claudio Busatto](https://github.com/cjcbusatto)
- [Remco Haszing](https://github.com/remcohaszing)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [Csaba Maulis](https://github.com/om4csaba)
- [MoPaMo](https://github.com/MoPaMo)
- [Daniel Fjeldstad](https://github.com/w3bdesign)
- [Adrien Brunet](https://github.com/adrien-may)
- [Frazer Smith](https://github.com/Fdawgs)
- [HaiTao](https://github.com/836334258)
- [AZM](https://github.com/aziyatali)
- [relbns](https://github.com/relbns)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.1.3] - 2022-10-15

### Added

- Added custom params serializer support [#5113](https://github.com/axios/axios/pull/5113)

### Fixed

- Fixed top-level export to keep them in-line with static properties [#5109](https://github.com/axios/axios/pull/5109)
- Stopped including null values to query string. [#5108](https://github.com/axios/axios/pull/5108)
- Restored proxy config backwards compatibility with 0.x [#5097](https://github.com/axios/axios/pull/5097)
- Added back AxiosHeaders in AxiosHeaderValue [#5103](https://github.com/axios/axios/pull/5103)
- Pin CDN install instructions to a specific version [#5060](https://github.com/axios/axios/pull/5060)
- Handling of array values fixed for AxiosHeaders [#5085](https://github.com/axios/axios/pull/5085)

### Chores

- docs: match badge style, add link to them [#5046](https://github.com/axios/axios/pull/5046)
- chore: fixing comments typo [#5054](https://github.com/axios/axios/pull/5054)
- chore: update issue template [#5061](https://github.com/axios/axios/pull/5061)
- chore: added progress capturing section to the docs; [#5084](https://github.com/axios/axios/pull/5084)

### Contributors to this release

- [Jason Saayman](https://github.com/jasonsaayman)
- [scarf](https://github.com/scarf005)
- [Lenz Weber-Tronic](https://github.com/phryneas)
- [Arvindh](https://github.com/itsarvindh)
- [Félix Legrelle](https://github.com/FelixLgr)
- [Patrick Petrovic](https://github.com/ppati000)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [littledian](https://github.com/littledian)
- [ChronosMasterOfAllTime](https://github.com/ChronosMasterOfAllTime)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.1.2] - 2022-10-07

### Fixed

- Fixed broken exports for UMD builds.

### Contributors to this release

- [Jason Saayman](https://github.com/jasonsaayman)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.1.1] - 2022-10-07

### Fixed

- Fixed broken exports for common js. This fix breaks a prior fix, I will fix both issues ASAP but the commonJS use is more impactful.

### Contributors to this release

- [Jason Saayman](https://github.com/jasonsaayman)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.1.0] - 2022-10-06

### Fixed

- Fixed missing exports in type definition index.d.ts [#5003](https://github.com/axios/axios/pull/5003)
- Fixed query params composing [#5018](https://github.com/axios/axios/pull/5018)
- Fixed GenericAbortSignal interface by making it more generic [#5021](https://github.com/axios/axios/pull/5021)
- Fixed adding "clear" to AxiosInterceptorManager [#5010](https://github.com/axios/axios/pull/5010)
- Fixed commonjs & umd exports [#5030](https://github.com/axios/axios/pull/5030)
- Fixed inability to access response headers when using axios 1.x with Jest [#5036](https://github.com/axios/axios/pull/5036)

### Contributors to this release

- [Trim21](https://github.com/trim21)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [shingo.sasaki](https://github.com/s-sasaki-0529)
- [Ivan Pepelko](https://github.com/ivanpepelko)
- [Richard Kořínek](https://github.com/risa)

### PRs
- CVE 2023 45857 ( [#6028](https://api.github.com/repos/axios/axios/pulls/6028) )
```

⚠️ Critical vulnerability fix. See https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459
```

## [1.0.0] - 2022-10-04

### Added

- Added stack trace to AxiosError [#4624](https://github.com/axios/axios/pull/4624)
- Add AxiosError to AxiosStatic [#4654](https://github.com/axios/axios/pull/4654)
- Replaced Rollup as our build runner [#4596](https://github.com/axios/axios/pull/4596)
- Added generic TS types for the exposed toFormData helper [#4668](https://github.com/axios/axios/pull/4668)
- Added listen callback function [#4096](https://github.com/axios/axios/pull/4096)
- Added instructions for installing using PNPM [#4207](https://github.com/axios/axios/pull/4207)
- Added generic AxiosAbortSignal TS interface to avoid importing AbortController polyfill [#4229](https://github.com/axios/axios/pull/4229)
- Added axios-url-template in ECOSYSTEM.md [#4238](https://github.com/axios/axios/pull/4238)
- Added a clear() function to the request and response interceptors object so a user can ensure that all interceptors have been removed from an axios instance [#4248](https://github.com/axios/axios/pull/4248)
- Added react hook plugin [#4319](https://github.com/axios/axios/pull/4319)
- Adding HTTP status code for transformResponse [#4580](https://github.com/axios/axios/pull/4580)
- Added blob to the list of protocols supported by the browser [#4678](https://github.com/axios/axios/pull/4678)
- Resolving proxy from env on redirect [#4436](https://github.com/axios/axios/pull/4436)
- Added enhanced toFormData implementation with additional options [4704](https://github.com/axios/axios/pull/4704)
- Adding Canceler parameters config and request [#4711](https://github.com/axios/axios/pull/4711)
- Added automatic payload serialization to application/x-www-form-urlencoded [#4714](https://github.com/axios/axios/pull/4714)
- Added the ability for webpack users to overwrite built-ins [#4715](https://github.com/axios/axios/pull/4715)
- Added string[] to AxiosRequestHeaders type [#4322](https://github.com/axios/axios/pull/4322)
- Added the ability for the url-encoded-form serializer to respect the formSerializer config [#4721](https://github.com/axios/axios/pull/4721)
- Added isCancel type assert [#4293](https://github.com/axios/axios/pull/4293)
- Added data URL support for node.js [#4725](https://github.com/axios/axios/pull/4725)
- Adding types for progress event callbacks [#4675](https://github.com/axios/axios/pull/4675)
- URL params serializer [#4734](https://github.com/axios/axios/pull/4734)
- Added axios.formToJSON method [#4735](https://github.com/axios/axios/pull/4735)
- Bower platform add data protocol [#4804](https://github.com/axios/axios/pull/4804)
- Use WHATWG URL API instead of url.parse() [#4852](https://github.com/axios/axios/pull/4852)
- Add ENUM containing Http Status Codes to typings [#4903](https://github.com/axios/axios/pull/4903)
- Improve typing of timeout in index.d.ts [#4934](https://github.com/axios/axios/pull/4934)

### Changed

- Updated AxiosError.config to be optional in the type definition [#4665](https://github.com/axios/axios/pull/4665)
- Updated README emphasizing the URLSearchParam built-in interface over other solutions [#4590](https://github.com/axios/axios/pull/4590)
- Include request and config when creating a CanceledError instance [#4659](https://github.com/axios/axios/pull/4659)
- Changed func-names eslint rule to as-needed [#4492](https://github.com/axios/axios/pull/4492)
- Replacing deprecated substr() with slice() as substr() is deprecated [#4468](https://github.com/axios/axios/pull/4468)
- Updating HTTP links in README.md to use HTTPS [#4387](https://github.com/axios/axios/pull/4387)
- Updated to a better trim() polyfill [#4072](https://github.com/axios/axios/pull/4072)
- Updated types to allow specifying partial default headers on instance create [#4185](https://github.com/axios/axios/pull/4185)
- Expanded isAxiosError types [#4344](https://github.com/axios/axios/pull/4344)
- Updated type definition for axios instance methods [#4224](https://github.com/axios/axios/pull/4224)
- Updated eslint config [#4722](https://github.com/axios/axios/pull/4722)
- Updated Docs [#4742](https://github.com/axios/axios/pull/4742)
- Refactored Axios to use ES2017 [#4787](https://github.com/axios/axios/pull/4787)


### Deprecated
- There are multiple deprecations, refactors and fixes provided in this release. Please read through the full release notes to see how this may impact your project and use case.

### Removed

- Removed incorrect argument for NetworkError constructor [#4656](https://github.com/axios/axios/pull/4656)
- Removed Webpack [#4596](https://github.com/axios/axios/pull/4596)
- Removed function that transform arguments to array [#4544](https://github.com/axios/axios/pull/4544)

### Fixed

- Fixed grammar in README [#4649](https://github.com/axios/axios/pull/4649)
- Fixed code error in README [#4599](https://github.com/axios/axios/pull/4599)
- Optimized the code that checks cancellation [#4587](https://github.com/axios/axios/pull/4587)
- Fix url pointing to defaults.js in README [#4532](https://github.com/axios/axios/pull/4532)
- Use type alias instead of interface for AxiosPromise [#4505](https://github.com/axios/axios/pull/4505)
- Fix some word spelling and lint style in code comments [#4500](https://github.com/axios/axios/pull/4500)
- Edited readme with 3 updated browser icons of Chrome, FireFox and Safari [#4414](https://github.com/axios/axios/pull/4414)
- Bump follow-redirects from 1.14.9 to 1.15.0 [#4673](https://github.com/axios/axios/pull/4673)
- Fixing http tests to avoid hanging when assertions fail [#4435](https://github.com/axios/axios/pull/4435)
- Fix TS definition for AxiosRequestTransformer [#4201](https://github.com/axios/axios/pull/4201)
- Fix grammatical issues in README [#4232](https://github.com/axios/axios/pull/4232)
- Fixing instance.defaults.headers type [#4557](https://github.com/axios/axios/pull/4557)
- Fixed race condition on immediate requests cancellation [#4261](https://github.com/axios/axios/pull/4261)
- Fixing Z_BUF_ERROR when no content [#4701](https://github.com/axios/axios/pull/4701)
- Fixing proxy beforeRedirect regression [#4708](https://github.com/axios/axios/pull/4708)
- Fixed AxiosError status code type [#4717](https://github.com/axios/axios/pull/4717)
- Fixed AxiosError stack capturing [#4718](https://github.com/axios/axios/pull/4718)
- Fixing AxiosRequestHeaders typings [#4334](https://github.com/axios/axios/pull/4334)
- Fixed max body length defaults [#4731](https://github.com/axios/axios/pull/4731)
- Fixed toFormData Blob issue on node>v17 [#4728](https://github.com/axios/axios/pull/4728)
- Bump grunt from 1.5.2 to 1.5.3 [#4743](https://github.com/axios/axios/pull/4743)
- Fixing content-type header repeated [#4745](https://github.com/axios/axios/pull/4745)
- Fixed timeout error message for http [4738](https://github.com/axios/axios/pull/4738)
- Request ignores false, 0 and empty string as body values [#4785](https://github.com/axios/axios/pull/4785)
- Added back missing minified builds [#4805](https://github.com/axios/axios/pull/4805)
- Fixed a type error [#4815](https://github.com/axios/axios/pull/4815)
- Fixed a regression bug with unsubscribing from cancel token; [#4819](https://github.com/axios/axios/pull/4819)
- Remove repeated compression algorithm [#4820](https://github.com/axios/axios/pull/4820)
- The error of calling extend to pass parameters [#4857](https://github.com/axios/axios/pull/4857)
- SerializerOptions.indexes allows boolean | null | undefined [#4862](https://github.com/axios/axios/pull/4862)
- Require interceptors to return values [#4874](https://github.com/axios/axios/pull/4874)
- Removed unused imports [#4949](https://github.com/axios/axios/pull/4949)
- Allow null indexes on formSerializer and paramsSerializer [#4960](https://github.com/axios/axios/pull/4960)

### Chores
- Set permissions for GitHub actions [#4765](https://github.com/axios/axios/pull/4765)
- Included githubactions in the dependabot config [#4770](https://github.com/axios/axios/pull/4770)
- Included dependency review [#4771](https://github.com/axios/axios/pull/4771)
- Update security.md [#4784](https://github.com/axios/axios/pull/4784)
- Remove unnecessary spaces [#4854](https://github.com/axios/axios/pull/4854)
- Simplify the import path of AxiosError [#4875](https://github.com/axios/axios/pull/4875)
- Fix Gitpod dead link [#4941](https://github.com/axios/axios/pull/4941)
- Enable syntax highlighting for a code block [#4970](https://github.com/axios/axios/pull/4970)
- Using Logo Axios in Readme.md [#4993](https://github.com/axios/axios/pull/4993)
- Fix markup for note in README [#4825](https://github.com/axios/axios/pull/4825)
- Fix typo and formatting, add colons [#4853](https://github.com/axios/axios/pull/4853)
- Fix typo in readme [#4942](https://github.com/axios/axios/pull/4942)

### Security

- Update SECURITY.md [#4687](https://github.com/axios/axios/pull/4687)

### Contributors to this release

- [Bertrand Marron](https://github.com/tusbar)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
- [Dan Mooney](https://github.com/danmooney)
- [Michael Li](https://github.com/xiaoyu-tamu)
- [aong](https://github.com/yxwzaxns)
- [Des Preston](https://github.com/despreston)
- [Ted Robertson](https://github.com/tredondo)
- [zhoulixiang](https://github.com/zh-lx)
- [Arthur Fiorette](https://github.com/arthurfiorette)
- [Kumar Shanu](https://github.com/Kr-Shanu)
- [JALAL](https://github.com/JLL32)
- [Jingyi Lin](https://github.com/MageeLin)
- [Philipp Loose](https://github.com/phloose)
- [Alexander Shchukin](https://github.com/sashsvamir)
- [Dave Cardwell](https://github.com/davecardwell)
- [Cat Scarlet](https://github.com/catscarlet)
- [Luca Pizzini](https://github.com/lpizzinidev)
- [Kai](https://github.com/Schweinepriester)
- [Maxime Bargiel](https://github.com/mbargiel)
- [Brian Helba](https://github.com/brianhelba)
- [reslear](https://github.com/reslear)
- [Jamie Slome](https://github.com/JamieSlome)
- [Landro3](https://github.com/Landro3)
- [rafw87](https://github.com/rafw87)
- [Afzal Sayed](https://github.com/afzalsayed96)
- [Koki Oyatsu](https://github.com/kaishuu0123)
- [Dave](https://github.com/wangcch)
- [暴走老七](https://github.com/baozouai)
- [Spencer](https://github.com/spalger)
- [Adrian Wieprzkowicz](https://github.com/Argeento)
- [Jamie Telin](https://github.com/lejahmie)
- [毛呆](https://github.com/aweikalee)
- [Kirill Shakirov](https://github.com/turisap)
- [Rraji Abdelbari](https://github.com/estarossa0)
- [Jelle Schutter](https://github.com/jelleschutter)
- [Tom Ceuppens](https://github.com/KyorCode)
- [Johann Cooper](https://github.com/JohannCooper)
- [Dimitris Halatsis](https://github.com/mitsos1os)
- [chenjigeng](https://github.com/chenjigeng)
- [João Gabriel Quaresma](https://github.com/joaoGabriel55)
- [Victor Augusto](https://github.com/VictorAugDB)
- [neilnaveen](https://github.com/neilnaveen)
- [Pavlos](https://github.com/psmoros)
- [Kiryl Valkovich](https://github.com/visortelle)
- [Naveen](https://github.com/naveensrinivasan)
- [wenzheng](https://github.com/0x30)
- [hcwhan](https://github.com/hcwhan)
- [Bassel Rachid](https://github.com/basselworkforce)
- [Grégoire Pineau](https://github.com/lyrixx)
- [felipedamin](https://github.com/felipedamin)
- [Karl Horky](https://github.com/karlhorky)
- [Yue JIN](https://github.com/kingyue737)
- [Usman Ali Siddiqui](https://github.com/usman250994)
- [WD](https://github.com/techbirds)
- [Günther Foidl](https://github.com/gfoidl)
- [Stephen Jennings](https://github.com/jennings)
- [C.T.Lin](https://github.com/chentsulin)
- [mia-z](https://github.com/mia-z)
- [Parth Banathia](https://github.com/Parth0105)
- [parth0105pluang](https://github.com/parth0105pluang)
- [Marco Weber](https://github.com/mrcwbr)
- [Luca Pizzini](https://github.com/lpizzinidev)
- [Willian Agostini](https://github.com/WillianAgostini)
- [Huyen Nguyen](https://github.com/huyenltnguyen)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  <div align='center'>

<h1>TypeBox</h1>

<p>JSON Schema Type Builder with Static Type Resolution for TypeScript</p>
	
<img src="https://github.com/sinclairzx81/typebox/blob/master/typebox.png?raw=true" />

<br />
<br />

[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox.svg)](https://badge.fury.io/js/%40sinclair%2Ftypebox)
[![Downloads](https://img.shields.io/npm/dm/%40sinclair%2Ftypebox.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypebox)
[![GitHub CI](https://github.com/sinclairzx81/typebox/workflows/GitHub%20CI/badge.svg)](https://github.com/sinclairzx81/typebox/actions)

</div>

<a name="Install"></a>

## Install

#### Npm
```bash
$ npm install @sinclair/typebox --save
```

#### Deno
```typescript
import { Static, Type } from 'npm:@sinclair/typebox'
```

#### Esm

```typescript
import { Static, Type } from 'https://esm.sh/@sinclair/typebox'
```

## Example

```typescript
import { Static, Type } from '@sinclair/typebox'

const T = Type.Object({                              // const T = {
  x: Type.Number(),                                  //   type: 'object',
  y: Type.Number(),                                  //   required: ['x', 'y', 'z'],
  z: Type.Number()                                   //   properties: {
})                                                   //     x: { type: 'number' },
                                                     //     y: { type: 'number' },
                                                     //     z: { type: 'number' }
                                                     //   }
                                                     // }

type T = Static<typeof T>                            // type T = {
                                                     //   x: number,
                                                     //   y: number,
                                                     //   z: number
                                                     // }
```


<a name="Overview"></a>

## Overview

TypeBox is a runtime type builder that creates in-memory JSON Schema objects that can be statically inferred as TypeScript types. The schemas produced by this library are designed to match the static type assertion rules of the TypeScript compiler. TypeBox enables one to create a unified type that can be statically checked by TypeScript and runtime asserted using standard JSON Schema validation.

This library is designed to enable JSON schema to compose with the same flexibility as TypeScript's type system. It can be used as a simple tool to build up complex schemas or integrated into REST or RPC services to help validate data received over the wire. 

License MIT

## Contents
- [Install](#install)
- [Overview](#overview)
- [Usage](#usage)
- [Types](#types)
  - [Standard](#types-standard)
  - [Extended](#types-extended)
  - [Modifiers](#types-modifiers)
  - [Options](#types-options)
  - [Generics](#types-generics)
  - [References](#types-references)
  - [Recursive](#types-recursive)
  - [Conditional](#types-conditional)
  - [Template Literal](#types-template-literal)
  - [Guards](#types-guards)
  - [Unsafe](#types-unsafe)
  - [Strict](#types-strict)
- [Values](#values)
  - [Create](#values-create)
  - [Clone](#values-clone)
  - [Check](#values-check)
  - [Convert](#values-convert)
  - [Cast](#values-cast)
  - [Equal](#values-equal)
  - [Hash](#values-hash)
  - [Diff](#values-diff)
  - [Patch](#values-patch)
  - [Errors](#values-errors)
  - [Mutate](#values-mutate)
  - [Pointer](#values-pointer)
- [TypeCheck](#typecheck)
  - [Ajv](#typecheck-ajv)
  - [TypeCompiler](#typecheck-typecompiler)
- [TypeSystem](#typesystem)
  - [Types](#typesystem-types)
  - [Formats](#typesystem-formats)
  - [Policies](#typesystem-policies)
- [Benchmark](#benchmark)
  - [Compile](#benchmark-compile)
  - [Validate](#benchmark-validate)
  - [Compression](#benchmark-compression)
- [Contribute](#contribute)

<a name="usage"></a>

## Usage

The following shows general usage.

```typescript
import { Static, Type } from '@sinclair/typebox'

//--------------------------------------------------------------------------------------------
//
// Let's say you have the following type ...
//
//--------------------------------------------------------------------------------------------

type T = {
  id: string,
  name: string,
  timestamp: number
}

//--------------------------------------------------------------------------------------------
//
// ... you can express this type in the following way.
//
//--------------------------------------------------------------------------------------------

const T = Type.Object({                              // const T = {
  id: Type.String(),                                 //   type: 'object',
  name: Type.String(),                               //   properties: { 
  timestamp: Type.Integer()                          //     id: { 
})                                                   //       type: 'string' 
                                                     //     },
                                                     //     name: { 
                                                     //       type: 'string' 
                                                     //     },
                                                     //     timestamp: { 
                                                     //       type: 'integer' 
                                                     //     }
                                                     //   }, 
                                                     //   required: [
                                                     //     'id',
                                                     //     'name',
                                                     //     'timestamp'
                                                     //   ]
                                                     // } 

//--------------------------------------------------------------------------------------------
//
// ... then infer back to the original static type this way.
//
//--------------------------------------------------------------------------------------------

type T = Static<typeof T>                            // type T = {
                                                     //   id: string,
                                                     //   name: string,
                                                     //   timestamp: number
                                                     // }

//--------------------------------------------------------------------------------------------
//
// ... then use the type both as JSON schema and as a TypeScript type.
//
//--------------------------------------------------------------------------------------------

import { Value } from '@sinclair/typebox/value'

function receive(value: T) {                         // ... as a Static Type

  if(Value.Check(T, value)) {                        // ... as a JSON Schema
  
    // ok...
  }
}
```

<a name='types'></a>

## Types

TypeBox types are JSON schema fragments that can be composed into more complex types. Each fragment is structured such that a JSON schema compliant validator can runtime assert a value the same way TypeScript will statically assert a type. TypeBox provides a set of Standard types which are used create JSON schema compliant schematics as well as an Extended type set used to create schematics for constructs native to JavaScript. 

<a name='types-standard'></a>

### Standard Types

The following table lists the Standard TypeBox types. These types are fully compatible with the JSON Schema Draft 6 specification.

```typescript
┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐
│ TypeBox                        │ TypeScript                  │ JSON Schema                    │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Any()           │ type T = any                │ const T = { }                  │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Unknown()       │ type T = unknown            │ const T = { }                  │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.String()        │ type T = string             │ const T = {                    │
│                                │                             │   type: 'string'               │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Number()        │ type T = number             │ const T = {                    │
│                                │                             │   type: 'number'               │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Integer()       │ type T = number             │ const T = {                    │
│                                │                             │   type: 'integer'              │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Boolean()       │ type T = boolean            │ const T = {                    │
│                                │                             │   type: 'boolean'              │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Null()          │ type T = null               │ const T = {                    │
│                                │                             │   type: 'null'                 │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Literal(42)     │ type T = 42                 │ const T = {                    │
│                                │                             │   const: 42,                   │
│                                │                             │   type: 'number'               │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Array(          │ type T = number[]           │ const T = {                    │
│   Type.Number()                │                             │   type: 'array',               │
│ )                              │                             │   items: {                     │
│                                │                             │     type: 'number'             │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Object({        │ type T = {                  │ const T = {                    │
│   x: Type.Number(),            │   x: number,                │   type: 'object',              │
│   y: Type.Number()             │   y: number                 │   required: ['x', 'y'],        │
│ })                             │ }                           │   properties: {                │
│                                │                             │     x: {                       │
│                                │                             │       type: 'number'           │
│                                │                             │     }, {                       │
│                                │                             │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Tuple([         │ type T = [number, number]   │ const T = {                    │
│   Type.Number(),               │                             │   type: 'array',               │
│   Type.Number()                │                             │   items: [{                    │
│ ])                             │                             │      type: 'number'            │
│                                │                             │   }, {                         │
│                                │                             │     type: 'number'             │
│                                │                             │   }],                          │
│                                │                             │   additionalItems: false,      │
│                                │                             │   minItems: 2,                 │
│                                │                             │   maxItems: 2                  │
│                                │                             │ }                              │
│                                │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ enum Foo {                     │ enum Foo {                  │ const T = {                    │
│   A,                           │   A,                        │   anyOf: [{                    │
│   B                            │   B                         │     type: 'number',            │
│ }                              │ }                           │     const: 0                   │
│                                │                             │   }, {                         │
│ const T = Type.Enum(Foo)       │ type T = Foo                │     type: 'number',            │
│                                │                             │     const: 1                   │
│                                │                             │   }]                           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.KeyOf(          │ type T = keyof {            │ const T = {                    │
│   Type.Object({                │   x: number,                │   anyOf: [{                    │
│     x: Type.Number(),          │   y: number                 │     type: 'string',            │
│     y: Type.Number()           │ }                           │     const: 'x'                 │
│   })                           │                             │   }, {                         │
│ )                              │                             │     type: 'string',            │
│                                │                             │     const: 'y'                 │
│                                │                             │   }]                           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Union([         │ type T = string | number    │ const T = {                    │
│   Type.String(),               │                             │   anyOf: [{                    │
│   Type.Number()                │                             │      type: 'string'            │
│ ])                             │                             │   }, {                         │
│                                │                             │      type: 'number'            │
│                                │                             │   }]                           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Intersect([     │ type T = {                  │ const T = {                    │
│   Type.Object({                │   x: number                 │   allOf: [{                    │
│     x: Type.Number()           │ } & {                       │     type: 'object',            │
│   }),                          │   y: number                 │     required: ['x'],           │
│   Type.Object({                │ }                           │     properties: {              │
│     y: Type.Number()           │                             │       x: {                     │
│   ])                           │                             │         type: 'number'         │
│ ])                             │                             │       }                        │
│                                │                             │     }                          │
│                                │                             │   }, {                         │
│                                │                             │     type: 'object',            |
│                                │                             │     required: ['y'],           │
│                                │                             │     properties: {              │
│                                │                             │       y: {                     │
│                                │                             │         type: 'number'         │
│                                │                             │       }                        │
│                                │                             │     }                          │
│                                │                             │   }]                           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Composite([     │ type I = {                  │ const T = {                    │
│   Type.Object({                │   x: number                 │   type: 'object',              │
│     x: Type.Number()           │ } & {                       │   required: ['x', 'y'],        │
│   }),                          │   y: number                 │   properties: {                │
│   Type.Object({                │ }                           │     x: {                       │
│     y: Type.Number()           │                             │       type: 'number'           │
│   })                           │ type T = {                  │     },                         │
│ ])                             │   [K in keyof I]: I[K]      │     y: {                       │
│                                │ }                           │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Never()         │ type T = never              │ const T = {                    │
│                                │                             │   not: {}                      │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Not(            | type T = string             │ const T = {                    │
|   Type.Union([                 │                             │   allOf: [{                    │
│     Type.Literal('x'),         │                             │     not: {                     │
│     Type.Literal('y'),         │                             │       anyOf: [                 │
│     Type.Literal('z')          │                             │         { const: 'x' },        │
│   ]),                          │                             │         { const: 'y' },        │
│   Type.String()                │                             │         { const: 'z' }         │
│ )                              │                             │       ]                        │
│                                │                             │     }                          │
│                                │                             │   }, {                         │
│                                │                             │     type: 'string'             │
│                                │                             │   }]                           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Extends(        │ type T =                    │ const T = {                    │
│   Type.String(),               │  string extends number      │   const: false,                │
│   Type.Number(),               │  true : false               │   type: 'boolean'              │
│   Type.Literal(true),          │                             │ }                              │
│   Type.Literal(false)          │                             │                                │
│ )                              │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Extract(        │ type T = Extract<           │ const T = {                    │
│   Type.Union([                 │   string | number,          │   type: 'string'               │
│     Type.String(),             │   string                    │ }                              │
│     Type.Number(),             │ >                           │                                │
│   ]),                          │                             │                                │
│   Type.String()                │                             │                                │
│ )                              │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Exclude(        │ type T = Exclude<           │ const T = {                    │
│   Type.Union([                 │   string | number,          │   type: 'number'               │
│     Type.String(),             │   string                    │ }                              │
│     Type.Number(),             │ >                           │                                │
│   ]),                          │                             │                                │
│   Type.String()                │                             │                                │
│ )                              │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const U = Type.Union([         │ type U = 'open' | 'close'   │ const T = {                    │
│   Type.Literal('open'),        │                             │   type: 'string',              │
│   Type.Literal('close')        │ type T = `on${U}`           │   pattern: '^on(open|close)$'  │
│ ])                             │                             │ }                              │
│                                │                             │                                │
│ const T = Type                 │                             │                                │
│   .TemplateLiteral([           │                             │                                │
│      Type.Literal('on'),       │                             │                                │
│      U                         │                             │                                │
│   ])                           │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Record(         │ type T = Record<            │ const T = {                    │
│   Type.String(),               │   string,                   │   type: 'object',              │
│   Type.Number()                │   number                    │   patternProperties: {         │
│ )                              │ >                           │     '^.*$': {                  │
│                                │                             │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Partial(        │ type T = Partial<{          │ const T = {                    │
│   Type.Object({                │   x: number,                │   type: 'object',              │
│     x: Type.Number(),          │   y: number                 │   properties: {                │
│     y: Type.Number()           | }>                          │     x: {                       │
│   })                           │                             │       type: 'number'           │
│ )                              │                             │     },                         │
│                                │                             │     y: {                       │
│                                │                             │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Required(       │ type T = Required<{         │ const T = {                    │
│   Type.Object({                │   x?: number,               │   type: 'object',              │
│     x: Type.Optional(          │   y?: number                │   required: ['x', 'y'],        │
│       Type.Number()            | }>                          │   properties: {                │
│     ),                         │                             │     x: {                       │
│     y: Type.Optional(          │                             │       type: 'number'           │
│       Type.Number()            │                             │     },                         │
│     )                          │                             │     y: {                       │
│   })                           │                             │       type: 'number'           │
│ )                              │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Pick(           │ type T = Pick<{             │ const T = {                    │
│   Type.Object({                │   x: number,                │   type: 'object',              │
│     x: Type.Number(),          │   y: number                 │   required: ['x'],             │
│     y: Type.Number()           │ }, 'x'>                     │   properties: {                │
│   }), ['x']                    |                             │     x: {                       │
│ )                              │                             │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Omit(           │ type T = Omit<{             │ const T = {                    │
│   Type.Object({                │   x: number,                │   type: 'object',              │
│     x: Type.Number(),          │   y: number                 │   required: ['y'],             │
│     y: Type.Number()           │ }, 'x'>                     │   properties: {                │
│   }), ['x']                    |                             │     y: {                       │
│ )                              │                             │       type: 'number'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Object({        │ type T = {                  │ const R = {                    │
│    x: Type.Number(),           │   x: number,                │   $ref: 'T'                    │
│    y: Type.Number()            │   y: number                 │ }                              │
│ }, { $id: 'T' })               | }                           │                                │
│                                │                             │                                │
│ const R = Type.Ref(T)          │ type R = T                  │                                │
│                                │                             │                                │
│                                │                             │                                │
│                                │                             │                                │
│                                │                             │                                │
└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘
```

<a name='types-extended'></a>

### Extended Types

TypeBox provides several extended types that can be used to produce schematics for common JavaScript constructs. These types can not be used with standard JSON schema validators; but are useful to help frame schematics for RPC interfaces that may receive JSON validated data. Extended types are prefixed with the `[Extended]` doc comment for convenience. The following table lists the supported types.

```typescript
┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐
│ TypeBox                        │ TypeScript                  │ Extended Schema                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Constructor([   │ type T = new (              │ const T = {                    │
│   Type.String(),               │  arg0: string,              │   type: 'object',              │
│   Type.Number()                │  arg1: number               │   instanceOf: 'Constructor',   │
│ ], Type.Boolean())             │ ) => boolean                │   parameters: [{               │
│                                │                             │     type: 'string'             │
│                                │                             │   }, {                         │
│                                │                             │     type: 'number'             │
│                                │                             │   }],                          │
│                                │                             │   return: {                    │
│                                │                             │     type: 'boolean'            │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Function([      │ type T = (                  │ const T = {                    │
|   Type.String(),               │  arg0: string,              │   type : 'object',             │
│   Type.Number()                │  arg1: number               │   instanceOf: 'Function',      │
│ ], Type.Boolean())             │ ) => boolean                │   parameters: [{               │
│                                │                             │     type: 'string'             │
│                                │                             │   }, {                         │
│                                │                             │     type: 'number'             │
│                                │                             │   }],                          │
│                                │                             │   return: {                    │
│                                │                             │     type: 'boolean'            │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Promise(        │ type T = Promise<string>    │ const T = {                    │
│   Type.String()                │                             │   type: 'object',              │
│ )                              │                             │   instanceOf: 'Promise',       │
│                                │                             │   item: {                      │
│                                │                             │     type: 'string'             │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Uint8Array()    │ type T = Uint8Array         │ const T = {                    │
│                                │                             │   type: 'object',              │
│                                │                             │   instanceOf: 'Uint8Array'     │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Date()          │ type T = Date               │ const T = {                    │
│                                │                             │   type: 'object',              │
│                                │                             │   instanceOf: 'Date'           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Undefined()     │ type T = undefined          │ const T = {                    │
│                                │                             │   type: 'null',                │
│                                │                             │   typeOf: 'Undefined'          │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.RegEx(/foo/)    │ type T = string             │ const T = {                    │
│                                │                             │    type: 'string',             │
│                                │                             │    pattern: 'foo'              │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Symbol()        │ type T = symbol             │ const T = {                    │
│                                │                             │   type: 'null',                │
│                                │                             │   typeOf: 'Symbol'             │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.BigInt()        │ type T = bigint             │ const T = {                    │
│                                │                             │   type: 'null',                │
│                                │                             │   typeOf: 'BigInt'             │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Void()          │ type T = void               │ const T = {                    │
│                                │                             │   type: 'null'                 │
│                                │                             │   typeOf: 'Void'               │
│                                │                             │ }                              │
│                                │                             │                                │
└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘
```

<a name='types-modifiers'></a>

### Modifiers

TypeBox provides modifiers that allow schema properties to be statically inferred as `readonly` or `optional`. The following table shows the supported modifiers and how they map between TypeScript and JSON Schema.

```typescript
┌────────────────────────────────┬─────────────────────────────┬────────────────────────────────┐
│ TypeBox                        │ TypeScript                  │ JSON Schema                    │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Object({        │ type T = {                  │ const T = {                    │
│   name: Type.Optional(         │   name?: string             │   type: 'object',              │
│     Type.String()              │ }                           │   properties: {                │
│   )                            │                             │     name: {                    │
│ })  	                         │                             │       type: 'string'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Object({        │ type T = {                  │ const T = {                    │
│   name: Type.Readonly(         │   readonly name: string     │   type: 'object',              │
│     Type.String()              │ }                           │   properties: {                │
│   )                            │                             │     name: {                    │
│ })  	                         │                             │       type: 'string'           │
│                                │                             │     }                          │
│                                │                             │   },                           │
│                                │                             │   required: ['name']           │
│                                │                             │ }                              │
│                                │                             │                                │
├────────────────────────────────┼─────────────────────────────┼────────────────────────────────┤
│ const T = Type.Object({        │ type T = {                  │ const T = {                    │
│   name: Type.ReadonlyOptional( │   readonly name?: string    │   type: 'object',              │
│     Type.String()              │ }                           │   properties: {                │
│   )                            │                             │     name: {                    │
│ })  	                         │                             │       type: 'string'           │
│                                │                             │     }                          │
│                                │                             │   }                            │
│                                │                             │ }                              │
│                                │                             │                                │
└────────────────────────────────┴─────────────────────────────┴────────────────────────────────┘
```

<a name='types-options'></a>

### Options

You can pass JSON Schema options on the last argument of any type. Option hints specific to each type are provided for convenience.

```typescript
// String must be an email
const T = Type.String({                              // const T = { 
  format: 'email'                                    //   type: 'string',
})                                                   //   format: 'email' 
                                                     // }

// Mumber must be a multiple of 2
const T = Type.Number({                              // const T = { 
  multipleOf: 2                                      //  type: 'number', 
})                                                   //  multipleOf: 2 
                                                     // }

// Array must have at least 5 integer values
const T = Type.Array(Type.Integer(), {               // const T = { 
  minItems: 5                                        //   type: 'array',
})                                                   //   minItems: 5,        
                                                     //   items: { 
                                                     //     type: 'integer'
                                                     //   }
                                                     // }

```

<a name='types-generics'></a>

### Generic Types

Generic types can be created with generic functions constrained to type `TSchema`. The following creates a generic `Vector<T>` type.

```typescript
import { Type, Static, TSchema } from '@sinclair/typebox'

const Vector = <T extends TSchema>(t: T) => Type.Object({ x: t, y: t, z: t })

const NumberVector = Vector(Type.Number())           // const NumberVector = {
                                                     //   type: 'object',
                                                     //   required: ['x', 'y', 'z'],
                                                     //   properties: {
                                                     //     x: { type: 'number' },
                                                     //     y: { type: 'number' },
                                                     //     z: { type: 'number' }
                                                     //   }
                                                     // }

type NumberVector = Static<typeof NumberVector>      // type NumberVector = {
                                                     //   x: number,
                                                     //   y: number,
                                                     //   z: number
                                                     // }

const BooleanVector = Vector(Type.Boolean())         // const BooleanVector = {
                                                     //   type: 'object',
                                                     //   required: ['x', 'y', 'z'],
                                                     //   properties: {
                                                     //     x: { type: 'boolean' },
                                                     //     y: { type: 'boolean' },
                                                     //     z: { type: 'boolean' }
                                                     //   }
                                                     // }

type BooleanVector = Static<typeof BooleanVector>    // type BooleanVector = {
                                                     //   x: boolean,
                                                     //   y: boolean,
                                                     //   z: boolean
                                                     // }
```

The following creates a generic `Nullable<T>` type.

```typescript
const Nullable = <T extends TSchema>(schema: T) => Type.Union([schema, Type.Null()])

const T = Nullable(Type.String())                   // const T = {
                                                    //   anyOf: [
                                                    //     { type: 'string' },
                                                    //     { type: 'null' }
                                                    //   ]
                                                    // }

type T = Static<typeof T>                           // type T = string | null
```

<a name='types-references'></a>

### Reference Types

Reference types are supported with `Type.Ref`. The target type must specify a valid `$id`.

```typescript
const T = Type.String({ $id: 'T' })                  // const T = {
                                                     //    $id: 'T',
                                                     //    type: 'string'
                                                     // }
                                             
const R = Type.Ref(T)                                // const R = {
                                                     //    $ref: 'T'
                                                     // }
```

<a name='types-recursive'></a>

### Recursive Types

Recursive types are supported with `Type.Recursive`

```typescript
const Node = Type.Recursive(Node => Type.Object({    // const Node = {
  id: Type.String(),                                 //   $id: 'Node',
  nodes: Type.Array(Node)                            //   type: 'object',
}), { $id: 'Node' })                                 //   properties: {
                                                     //     id: {
                                                     //       type: 'string'
                                                     //     },
                                                     //     nodes: {
                                                     //       type: 'array',
                                                     //       items: {
                                                     //         $ref: 'Node'
                                                     //       }
                                                     //     }
                                                     //   },
                                                     //   required: [
                                                     //     'id',
                                                     //     'nodes'
                                                     //   ]
                                                     // }

type Node = Static<typeof Node>                      // type Node = {
                                                     //   id: string
                                                     //   nodes: Node[]
                                                     // }

function test(node: Node) {
  const id = node.nodes[0].nodes[0].id               // id is string
}
```

<a name='types-conditional'></a>

### Conditional Types

Conditional types are supported with `Type.Extends`, `Type.Exclude` and `Type.Extract`

```typescript
// TypeScript

type T0 = string extends number ? true : false       // type T0 = false

type T1 = Extract<string | number, number>           // type T1 = number

type T2 = Exclude<string | number, number>           // type T2 = string

// TypeBox

const T0 = Type.Extends(Type.String(), Type.Number(), Type.Literal(true), Type.Literal(false))

const T1 = Type.Extract(Type.Union([Type.String(), Type.Number()]), Type.Number())

const T2 = Type.Exclude(Type.Union([Type.String(), Type.Number()]), Type.Number())


type T0 = Static<typeof T0>                        // type T0 = false

type T1 = Static<typeof T1>                        // type T1 = number

type T2 = Static<typeof T2>                        // type T2 = string 
```

<a name='types-template-literal'></a>

### Template Literal Types

Template Literal types are supported with `Type.TemplateLiteral`

```typescript
// TypeScript

type T = `option${'A'|'B'}`                          // type T = 'optionA' | 'optionB'

type R = Record<T, string>                           // type R = {
                                                     //   optionA: string
                                                     //   optionB: string
                                                     // }

// TypeBox

const T = Type.TemplateLiteral([                     // const T = {
  Type.Literal('option'),                            //   pattern: '^option(A|B)$',
  Type.Union([                                       //   type: 'string'
    Type.Literal('A'),                               // }
    Type.Literal('B')
  ])
])

const R = Type.Record(T, Type.String())              // const R = {
                                                     //   type: 'object',
                                                     //   required: ['optionA', 'optionB'],
                                                     //   properties: {
                                                     //     optionA: {
                                                     //       type: 'string'
                                                     //     },
                                                     //     optionB: {
                                                     //       type: 'string'
                                                     //     }
                                                     //   }
                                                     // }

type T = Static<typeof T>                            // type T = 'optionA' | 'optionB'

type R = Static<typeof R>                            // type R = {
                                                     //   optionA: string
                                                     //   optionB: string
                                                     // }
```

<a name='types-unsafe'></a>

### Unsafe

Use `Type.Unsafe` to create custom schematics with user defined inference rules.

```typescript
const T = Type.Unsafe<string>({ type: 'number' })    // const T = {
                                                     //   type: 'number'
                                                     // }

type T = Static<typeof T>                            // type T = string
```

The `Type.Unsafe` type can be useful to express specific OpenAPI schema representations.

```typescript
import { Type, Static, TSchema } from '@sinclair/typebox'

// Nullable<T>

function Nullable<T extends TSchema>(schema: T) {
  return Type.Unsafe<Static<T> | null>({ ...schema, nullable: true })
}

const T = Nullable(Type.String())                    // const T = {
                                                     //   type: 'string',
                                                     //   nullable: true
                                                     // }

type T = Static<typeof T>                            // type T = string | null

// StringEnum<string[]>

function StringEnum<T extends string[]>(values: [...T]) {
  return Type.Unsafe<T[number]>({ type: 'string', enum: values })
}

const T = StringEnum(['A', 'B', 'C'])                // const T = {
                                                     //   enum: ['A', 'B', 'C']
                                                     // }

type T = Static<typeof T>                            // type T = 'A' | 'B' | 'C'
```

<a name='types-guards'></a>

### Guards

TypeBox provides a `TypeGuard` module that can be used for reflection and asserting values as types.

```typescript
import { Type, TypeGuard } from '@sinclair/typebox'

const T = Type.String()

if(TypeGuard.TString(T)) {
    
  // T is TString
}
```

<a name='types-strict'></a>

### Strict

TypeBox schemas contain the `Kind` and `Modifier` symbol properties. These properties are used for type composition and reflection. These properties are not strictly valid JSON schema; so in some cases it may be desirable to omit them. TypeBox provides a `Type.Strict` function that will omit these properties if necessary.

```typescript
const T = Type.Object({                              // const T = {
  name: Type.Optional(Type.String())                 //   [Kind]: 'Object',
})                                                   //   type: 'object',
                                                     //   properties: {
                                                     //     name: {
                                                     //       [Kind]: 'String',
                                                     //       type: 'string',
                                                     //       [Modifier]: 'Optional'
                                                     //     }
                                                     //   }
                                                     // }

const U = Type.Strict(T)                             // const U = {
                                                     //   type: 'object', 
                                                     //   properties: { 
                                                     //     name: { 
                                                     //       type: 'string' 
                                                     //     } 
                                                     //   } 
                                                     // }
```

<a name='values'></a>

## Values

TypeBox provides an optional utility module that can be used to perform common operations on JavaScript values. This module includes functionality to create, check and cast values from types as well as check equality, clone, diff and patch JavaScript values. This module is provided via optional import.

```typescript
import { Value } from '@sinclair/typebox/value'
```

<a name='values-create'></a>

### Create

Use the Create function to create a value from a type. TypeBox will use default values if specified.

```typescript
const T = Type.Object({ x: Type.Number(), y: Type.Number({ default: 42 }) })

const A = Value.Create(T)                            // const A = { x: 0, y: 42 }
```

<a name='values-clone'></a>

### Clone

Use the Clone function to deeply clone a value

```typescript
const A = Value.Clone({ x: 1, y: 2, z: 3 })          // const A = { x: 1, y: 2, z: 3 }
```

<a name='values-check'></a>

### Check

Use the Check function to type check a value

```typescript
const T = Type.Object({ x: Type.Number() })

const R = Value.Check(T, { x: 1 })                   // const R = true
```

<a name='values-convert'></a>

### Convert

Use the Convert function to convert a value into its target type if a reasonable conversion is possible.

```typescript
const T = Type.Object({ x: Type.Number() })

const R1 = Value.Convert(T, { x: '3.14' })          // const R1 = { x: 3.14 }

const R2 = Value.Convert(T, { x: 'not a number' })  // const R2 = { x: 'not a number' }
```

<a name='values-cast'></a>

### Cast

Use the Cast function to cast a value into a type. The cast function will retain as much information as possible from the original value.

```typescript
const T = Type.Object({ x: Type.Number(), y: Type.Number() }, { additionalProperties: false })

const X = Value.Cast(T, null)                        // const X = { x: 0, y: 0 }

const Y = Value.Cast(T, { x: 1 })                    // const Y = { x: 1, y: 0 }

const Z = Value.Cast(T, { x: 1, y: 2, z: 3 })        // const Z = { x: 1, y: 2 }
```

<a name='values-equal'></a>

### Equal

Use the Equal function to deeply check for value equality.

```typescript
const R = Value.Equal(                               // const R = true
  { x: 1, y: 2, z: 3 },
  { x: 1, y: 2, z: 3 }
)
```

<a name='values-hash'></a>

### Hash

Use the Hash function to create a [FNV1A-64](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) non cryptographic hash of a value.

```typescript
const A = Value.Hash({ x: 1, y: 2, z: 3 })          // const A = 2910466848807138541n

const B = Value.Hash({ x: 1, y: 4, z: 3 })          // const B = 1418369778807423581n
```

<a name='values-diff'></a>

### Diff

Use the Diff function to produce a sequence of edits to transform one value into another.

```typescript
const E = Value.Diff(                               // const E = [
  { x: 1, y: 2, z: 3 },                             //   { type: 'update', path: '/y', value: 4 },
  { y: 4, z: 5, w: 6 }                              //   { type: 'update', path: '/z', value: 5 },
)                                                   //   { type: 'insert', path: '/w', value: 6 },
                                                    //   { type: 'delete', path: '/x' }
                                                    // ]
```

<a name='values-patch'></a>

### Patch

Use the Patch function to apply edits

```typescript
const A = { x: 1, y: 2 }

const B = { x: 3 }

const E = Value.Diff(A, B)                           // const E = [
                                                     //   { type: 'update', path: '/x', value: 3 },
                                                     //   { type: 'delete', path: '/y' }
                                                     // ]

const C = Value.Patch<typeof B>(A, E)                // const C = { x: 3 }
```

<a name='values-errors'></a>

### Errors

Use the Errors function enumerate validation errors.

```typescript
const T = Type.Object({ x: Type.Number(), y: Type.Number() })

const R = [...Value.Errors(T, { x: '42' })]          // const R = [{
                                                     //   schema: { type: 'number' },
                                                     //   path: '/x',
                                                     //   value: '42',
                                                     //   message: 'Expected number'
                                                     // }, {
                                                     //   schema: { type: 'number' },
                                                     //   path: '/y',
                                                     //   value: undefined,
                                                     //   message: 'Expected number'
                                                     // }]
```

<a name='values-mutate'></a>

### Mutate

Use the Mutate function to perform a deep mutable value assignment while retaining internal references.

```typescript
const Y = { z: 1 }                                   // const Y = { z: 1 } 

const X = { y: Y }                                   // const X = { y: { z: 1 } }

const A = { x: X }                                   // const A = { x: { y: { z: 1 } } }             


Value.Mutate(A, { x: { y: { z: 2 } } })              // const A' = { x: { y: { z: 2 } } }   

const R0 = A.x.y.z === 2                             // const R0 = 2

const R1 = A.x.y === Y                               // const R1 = true

const R2 = A.x === X                                 // const R2 = true
```     

<a name='values-pointer'></a>

### Pointer

Use ValuePointer to perform mutable updates on existing values using [RFC6901](https://www.rfc-editor.org/rfc/rfc6901) JSON Pointers.

```typescript
import { ValuePointer } from '@sinclair/typebox/value'

const A = { x: 0, y: 0, z: 0 }

ValuePointer.Set(A, '/x', 1)                         // const A' = { x: 1, y: 0, z: 0 }

ValuePointer.Set(A, '/y', 1)                         // const A' = { x: 1, y: 1, z: 0 }

ValuePointer.Set(A, '/z', 1)                         // const A' = { x: 1, y: 1, z: 1 }
```

<a name='typecheck'></a>

## TypeCheck

TypeBox types target JSON Schema draft 6 so are compatible with any validator that supports this specification. TypeBox also provides a built in type checking compiler designed specifically for high performance compilation and value assertion.

The following sections detail using Ajv and TypeBox's compiler infrastructure.

<a name='typecheck-ajv'></a>

## Ajv

The following shows the recommended setup for Ajv.

```bash
$ npm install ajv ajv-formats --save
```

```typescript
import { Type }   from '@sinclair/typebox'
import addFormats from 'ajv-formats'
import Ajv        from 'ajv'

const ajv = addFormats(new Ajv({}), [
  'date-time', 
  'time', 
  'date', 
  'email',  
  'hostname', 
  'ipv4', 
  'ipv6', 
  'uri', 
  'uri-reference', 
  'uuid',
  'uri-template', 
  'json-pointer', 
  'relative-json-pointer', 
  'regex'
])

const C = ajv.compile(Type.Object({                
  x: Type.Number(),
  y: Type.Number(),
  z: Type.Number()
}))

const R = C({ x: 1, y: 2, z: 3 })                    // const R = true 
```

<a name='typecheck-typecompiler'></a>

### TypeCompiler

The TypeBox TypeCompiler is a high performance JIT compiler that transforms TypeBox types into optimized JavaScript validation routines. The compiler is tuned for fast compilation as well as fast value assertion. It is designed to serve as a validation backend that can be integrated into larger applications; but can also be used as a general purpose validator.

The TypeCompiler is provided as an optional import.

```typescript
import { TypeCompiler } from '@sinclair/typebox/compiler'
```

Use the `Compile(...)` function to compile a type.

```typescript
const C = TypeCompiler.Compile(Type.Object({         // const C: TypeCheck<TObject<{
  x: Type.Number(),                                  //     x: TNumber;
  y: Type.Number(),                                  //     y: TNumber;
  z: Type.Number()                                   //     z: TNumber;
}))                                                  // }>>

const R = C.Check({ x: 1, y: 2, z: 3 })              // const R = true
```

Use the `Errors(...)` function to produce diagnostic errors for a value. The `Errors(...)` function will return an iterator that if enumerated; will perform an exhaustive check across the entire value and yield any error found. For performance, this function should only be called after failed `Check(...)`. Applications may also choose to yield only the first value to avoid exhaustive error generation.

```typescript
const C = TypeCompiler.Compile(Type.Object({         // const C: TypeCheck<TObject<{
  x: Type.Number(),                                  //     x: TNumber;
  y: Type.Number(),                                  //     y: TNumber;
  z: Type.Number()                                   //     z: TNumber;
}))                                                  // }>>

const value = { }

const errors = [...C.Errors(value)]                  // const errors = [{
                                                     //   schema: { type: 'number' },
                                                     //   path: '/x',
                                                     //   value: undefined,
                                                     //   message: 'Expected number'
                                                     // }, {
                                                     //   schema: { type: 'number' },
                                                     //   path: '/y',
                                                     //   value: undefined,
                                                     //   message: 'Expected number'
                                                     // }, {
                                                     //   schema: { type: 'number' },
                                                     //   path: '/z',
                                                     //   value: undefined,
                                                     //   message: 'Expected number'
                                                     // }]
```

Compiled routines can be inspected with the `.Code()` function.

```typescript
const C = TypeCompiler.Compile(Type.String())        // const C: TypeCheck<TString>

console.log(C.Code())                                // return function check(value) {
                                                     //   return (
                                                     //     (typeof value === 'string')
                                                     //   )
                                                     // }
```

<a name='typesystem'></a>

## TypeSystem

The TypeBox TypeSystem module provides functionality to define types above and beyond the Standard and Extended type sets as well as control various assertion polices. Configurations made to the TypeSystem module are observed by both `TypeCompiler` and `Value` modules.

The TypeSystem module is provided as an optional import.

```typescript
import { TypeSystem } from '@sinclair/typebox/system'
```

<a name='typesystem-types'></a>

### Types

Use the `Type(...)` function to create a custom type. This function will return a type factory function that can be used to construct the type. The following creates a Point type.

```typescript
type PointOptions = { }                              // The Type Options

type PointType = { x: number, y: number }            // The Static<T> Type

const Point = TypeSystem.Type<PointType, PointOptions>('Point', (options, value) => {
  return (
    typeof value === 'object' && value !== null &&
    typeof value.x === 'number' && 
    typeof value.y === 'number'
  )
})

const T = Point()

type T = Static<typeof T>                             // type T = { x: number, y: number }

const R = Value.Check(T, { x: 1, y: 2 })              // const R = true
```

<a name='typesystem-formats'></a>

### Formats

Use the `Format(...)` function to create a custom string format. The following creates a format that checks for lowercase strings.

```typescript
TypeSystem.Format('lowercase', value => value === value.toLowerCase()) // format should be lowercase

const T = Type.String({ format: 'lowercase' })       

const A = Value.Check(T, 'Hello')                    // const A = false

const B = Value.Check(T, 'hello')                    // const B = true
```

<a name='typesystem-policies'></a>

### Policies

TypeBox validates using JSON Schema assertion policies by default. It is possible to override these policies and have TypeBox assert using TypeScript policies. The following overrides are available.

```typescript
// Allow arrays to validate as object types (default is false)
//
// const A: {} = [] - allowed in TS

TypeSystem.AllowArrayObjects = true                  

// Allow numeric values to be NaN or + or - Infinity (default is false)
//
// const A: number = NaN - allowed in TS

TypeSystem.AllowNaN = true                      
```

<a name='benchmark'></a>

## Benchmark

This project maintains a set of benchmarks that measure Ajv, Value and TypeCompiler compilation and validation performance. These benchmarks can be run locally by cloning this repository and running `npm run benchmark`. The results below show for Ajv version 8.12.0. 

For additional comparative benchmarks, please refer to [typescript-runtime-type-benchmarks](https://moltar.github.io/typescript-runtime-type-benchmarks/).

<a name='benchmark-compile'></a>

### Compile

This benchmark measures compilation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/compile.ts).

```typescript
┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┐
│          (index)           │ Iterations │     Ajv      │ TypeCompiler │ Performance  │
├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┤
│ Literal_String             │    1000    │ '    257 ms' │ '      8 ms' │ '   32.13 x' │
│ Literal_Number             │    1000    │ '    203 ms' │ '      4 ms' │ '   50.75 x' │
│ Literal_Boolean            │    1000    │ '    183 ms' │ '      4 ms' │ '   45.75 x' │
│ Primitive_Number           │    1000    │ '    174 ms' │ '      8 ms' │ '   21.75 x' │
│ Primitive_String           │    1000    │ '    158 ms' │ '      9 ms' │ '   17.56 x' │
│ Primitive_String_Pattern   │    1000    │ '    213 ms' │ '     13 ms' │ '   16.38 x' │
│ Primitive_Boolean          │    1000    │ '    136 ms' │ '      6 ms' │ '   22.67 x' │
│ Primitive_Null             │    1000    │ '    144 ms' │ '      6 ms' │ '   24.00 x' │
│ Object_Unconstrained       │    1000    │ '   1176 ms' │ '     38 ms' │ '   30.95 x' │
│ Object_Constrained         │    1000    │ '   1181 ms' │ '     31 ms' │ '   38.10 x' │
│ Object_Vector3             │    1000    │ '    387 ms' │ '      8 ms' │ '   48.38 x' │
│ Object_Box3D               │    1000    │ '   1693 ms' │ '     25 ms' │ '   67.72 x' │
│ Tuple_Primitive            │    1000    │ '    470 ms' │ '     15 ms' │ '   31.33 x' │
│ Tuple_Object               │    1000    │ '   1206 ms' │ '     17 ms' │ '   70.94 x' │
│ Composite_Intersect        │    1000    │ '    567 ms' │ '     20 ms' │ '   28.35 x' │
│ Composite_Union            │    1000    │ '    515 ms' │ '     21 ms' │ '   24.52 x' │
│ Math_Vector4               │    1000    │ '    787 ms' │ '     10 ms' │ '   78.70 x' │
│ Math_Matrix4               │    1000    │ '    386 ms' │ '      8 ms' │ '   48.25 x' │
│ Array_Primitive_Number     │    1000    │ '    349 ms' │ '      7 ms' │ '   49.86 x' │
│ Array_Primitive_String     │    1000    │ '    336 ms' │ '      4 ms' │ '   84.00 x' │
│ Array_Primitive_Boolean    │    1000    │ '    284 ms' │ '      3 ms' │ '   94.67 x' │
│ Array_Object_Unconstrained │    1000    │ '   1704 ms' │ '     19 ms' │ '   89.68 x' │
│ Array_Object_Constrained   │    1000    │ '   1456 ms' │ '     18 ms' │ '   80.89 x' │
│ Array_Tuple_Primitive      │    1000    │ '    792 ms' │ '     15 ms' │ '   52.80 x' │
│ Array_Tuple_Object         │    1000    │ '   1552 ms' │ '     17 ms' │ '   91.29 x' │
│ Array_Composite_Intersect  │    1000    │ '    744 ms' │ '     18 ms' │ '   41.33 x' │
│ Array_Composite_Union      │    1000    │ '    783 ms' │ '     15 ms' │ '   52.20 x' │
│ Array_Math_Vector4         │    1000    │ '   1093 ms' │ '     14 ms' │ '   78.07 x' │
│ Array_Math_Matrix4         │    1000    │ '    684 ms' │ '      6 ms' │ '  114.00 x' │
└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┘
```

<a name='benchmark-validate'></a>

### Validate

This benchmark measures validation performance for varying types. You can review this benchmark [here](https://github.com/sinclairzx81/typebox/blob/master/benchmark/measurement/module/check.ts).

```typescript
┌────────────────────────────┬────────────┬──────────────┬──────────────┬──────────────┬──────────────┐
│          (index)           │ Iterations │  ValueCheck  │     Ajv      │ TypeCompiler │ Performance  │
├────────────────────────────┼────────────┼──────────────┼──────────────┼──────────────┼──────────────┤
│ Literal_String             │  1000000   │ '     27 ms' │ '      6 ms' │ '      5 ms' │ '    1.20 x' │
│ Literal_Number             │  1000000   │ '     23 ms' │ '     21 ms' │ '     11 ms' │ '    1.91 x' │
│ Literal_Boolean            │  1000000   │ '     21 ms' │ '     20 ms' │ '     10 ms' │ '    2.00 x' │
│ Primitive_Number           │  1000000   │ '     26 ms' │ '     19 ms' │ '     11 ms' │ '    1.73 x' │
│ Primitive_String           │  1000000   │ '     25 ms' │ '     19 ms' │ '     10 ms' │ '    1.90 x' │
│ Primitive_String_Pattern   │  1000000   │ '    155 ms' │ '     49 ms' │ '     43 ms' │ '    1.14 x' │
│ Primitive_Boolean          │  1000000   │ '     23 ms' │ '     19 ms' │ '     10 ms' │ '    1.90 x' │
│ Primitive_Null             │  1000000   │ '     24 ms' │ '     19 ms' │ '     10 ms' │ '    1.90 x' │
│ Object_Unconstrained       │  1000000   │ '    804 ms' │ '     35 ms' │ '     28 ms' │ '    1.25 x' │
│ Object_Constrained         │  1000000   │ '   1041 ms' │ '     55 ms' │ '     41 ms' │ '    1.34 x' │
│ Object_Vector3             │  1000000   │ '    380 ms' │ '     26 ms' │ '     20 ms' │ '    1.30 x' │
│ Object_Box3D               │  1000000   │ '   1785 ms' │ '     65 ms' │ '     52 ms' │ '    1.25 x' │
│ Object_Recursive           │  1000000   │ '   4984 ms' │ '    396 ms' │ '    114 ms' │ '    3.47 x' │
│ Tuple_Primitive            │  1000000   │ '    168 ms' │ '     24 ms' │ '     16 ms' │ '    1.50 x' │
│ Tuple_Object               │  1000000   │ '    673 ms' │ '     30 ms' │ '     26 ms' │ '    1.15 x' │
│ Composite_Intersect        │  1000000   │ '    751 ms' │ '     28 ms' │ '     20 ms' │ '    1.40 x' │
│ Composite_Union            │  1000000   │ '    489 ms' │ '     24 ms' │ '     16 ms' │ '    1.50 x' │
│ Math_Vector4               │  1000000   │ '    259 ms' │ '     23 ms' │ '     13 ms' │ '    1.77 x' │
│ Math_Matrix4               │  1000000   │ '   1002 ms' │ '     40 ms' │ '     30 ms' │ '    1.33 x' │
│ Array_Primitive_Number     │  1000000   │ '    252 ms' │ '     22 ms' │ '     15 ms' │ '    1.47 x' │
│ Array_Primitive_String     │  1000000   │ '    227 ms' │ '     22 ms' │ '     18 ms' │ '    1.22 x' │
│ Array_Primitive_Boolean    │  1000000   │ '    150 ms' │ '     23 ms' │ '     22 ms' │ '    1.05 x' │
│ Array_Object_Unconstrained │  1000000   │ '   4754 ms' │ '     71 ms' │ '     64 ms' │ '    1.11 x' │
│ Array_Object_Constrained   │  1000000   │ '   4787 ms' │ '    142 ms' │ '    123 ms' │ '    1.15 x' │
│ Array_Object_Recursive     │  1000000   │ '  19088 ms' │ '   1735 ms' │ '    314 ms' │ '    5.53 x' │
│ Array_Tuple_Primitive      │  1000000   │ '    650 ms' │ '     41 ms' │ '     31 ms' │ '    1.32 x' │
│ Array_Tuple_Object         │  1000000   │ '   2770 ms' │ '     67 ms' │ '     55 ms' │ '    1.22 x' │
│ Array_Composite_Intersect  │  1000000   │ '   2693 ms' │ '     50 ms' │ '     39 ms' │ '    1.28 x' │
│ Array_Composite_Union      │  1000000   │ '   1982 ms' │ '     72 ms' │ '     33 ms' │ '    2.18 x' │
│ Array_Math_Vector4         │  1000000   │ '   1068 ms' │ '     40 ms' │ '     26 ms' │ '    1.54 x' │
│ Array_Math_Matrix4         │  1000000   │ '   4609 ms' │ '    115 ms' │ '     88 ms' │ '    1.31 x' │
└────────────────────────────┴────────────┴──────────────┴──────────────┴──────────────┴──────────────┘
```

<a name='benchmark-compression'></a>

### Compression

The following table lists esbuild compiled and minified sizes for each TypeBox module.

```typescript
┌──────────────────────┬────────────┬────────────┬─────────────┐
│       (index)        │  Compiled  │  Minified  │ Compression │
├──────────────────────┼────────────┼────────────┼─────────────┤
│ typebox/compiler     │ '124.3 kb' │ ' 55.7 kb' │  '2.23 x'   │
│ typebox/errors       │ '107.8 kb' │ ' 47.9 kb' │  '2.25 x'   │
│ typebox/system       │ ' 73.3 kb' │ ' 30.2 kb' │  '2.43 x'   │
│ typebox/value        │ '170.7 kb' │ ' 74.2 kb' │  '2.30 x'   │
│ typebox              │ ' 72.0 kb' │ ' 29.7 kb' │  '2.43 x'   │
└──────────────────────┴────────────┴────────────┴─────────────┘
```

<a name='contribute'></a>

## Contribute

TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project preferences open community discussion prior to accepting new features.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         /*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

import { c as createCommonjsModule, a as commonjsGlobal } from './openpgp.mjs';

var bn = createCommonjsModule(function (module) {
(function (module, exports) {

  // Utils
  function assert (val, msg) {
    if (!val) throw new Error(msg || 'Assertion failed');
  }

  // Could use `inherits` module, but don't want to move from single file
  // architecture yet.
  function inherits (ctor, superCtor) {
    ctor.super_ = superCtor;
    var TempCtor = function () {};
    TempCtor.prototype = superCtor.prototype;
    ctor.prototype = new TempCtor();
    ctor.prototype.constructor = ctor;
  }

  // BN

  function BN (number, base, endian) {
    if (BN.isBN(number)) {
      return number;
    }

    this.negative = 0;
    this.words = null;
    this.length = 0;

    // Reduction context
    this.red = null;

    if (number !== null) {
      if (base === 'le' || base === 'be') {
        endian = base;
        base = 10;
      }

      this._init(number || 0, base || 10, endian || 'be');
    }
  }
  if (typeof module === 'object') {
    module.exports = BN;
  } else {
    exports.BN = BN;
  }

  BN.BN = BN;
  BN.wordSize = 26;

  var Buffer;
  try {
    Buffer = void('buffer').Buffer;
  } catch (e) {
  }

  BN.isBN = function isBN (num) {
    if (num instanceof BN) {
      return true;
    }

    return num !== null && typeof num === 'object' &&
      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
  };

  BN.max = function max (left, right) {
    if (left.cmp(right) > 0) return left;
    return right;
  };

  BN.min = function min (left, right) {
    if (left.cmp(right) < 0) return left;
    return right;
  };

  BN.prototype._init = function init (number, base, endian) {
    if (typeof number === 'number') {
      return this._initNumber(number, base, endian);
    }

    if (typeof number === 'object') {
      return this._initArray(number, base, endian);
    }

    if (base === 'hex') {
      base = 16;
    }
    assert(base === (base | 0) && base >= 2 && base <= 36);

    number = number.toString().replace(/\s+/g, '');
    var start = 0;
    if (number[0] === '-') {
      start++;
    }

    if (base === 16) {
      this._parseHex(number, start);
    } else {
      this._parseBase(number, base, start);
    }

    if (number[0] === '-') {
      this.negative = 1;
    }

    this.strip();

    if (endian !== 'le') return;

    this._initArray(this.toArray(), base, endian);
  };

  BN.prototype._initNumber = function _initNumber (number, base, endian) {
    if (number < 0) {
      this.negative = 1;
      number = -number;
    }
    if (number < 0x4000000) {
      this.words = [ number & 0x3ffffff ];
      this.length = 1;
    } else if (number < 0x10000000000000) {
      this.words = [
        number & 0x3ffffff,
        (number / 0x4000000) & 0x3ffffff
      ];
      this.length = 2;
    } else {
      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)
      this.words = [
        number & 0x3ffffff,
        (number / 0x4000000) & 0x3ffffff,
        1
      ];
      this.length = 3;
    }

    if (endian !== 'le') return;

    // Reverse the bytes
    this._initArray(this.toArray(), base, endian);
  };

  BN.prototype._initArray = function _initArray (number, base, endian) {
    // Perhaps a Uint8Array
    assert(typeof number.length === 'number');
    if (number.length <= 0) {
      this.words = [ 0 ];
      this.length = 1;
      return this;
    }

    this.length = Math.ceil(number.length / 3);
    this.words = new Array(this.length);
    for (var i = 0; i < this.length; i++) {
      this.words[i] = 0;
    }

    var j, w;
    var off = 0;
    if (endian === 'be') {
      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);
        this.words[j] |= (w << off) & 0x3ffffff;
        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
        off += 24;
        if (off >= 26) {
          off -= 26;
          j++;
        }
      }
    } else if (endian === 'le') {
      for (i = 0, j = 0; i < number.length; i += 3) {
        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);
        this.words[j] |= (w << off) & 0x3ffffff;
        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;
        off += 24;
        if (off >= 26) {
          off -= 26;
          j++;
        }
      }
    }
    return this.strip();
  };

  function parseHex (str, start, end) {
    var r = 0;
    var len = Math.min(str.length, end);
    for (var i = start; i < len; i++) {
      var c = str.charCodeAt(i) - 48;

      r <<= 4;

      // 'a' - 'f'
      if (c >= 49 && c <= 54) {
        r |= c - 49 + 0xa;

      // 'A' - 'F'
      } else if (c >= 17 && c <= 22) {
        r |= c - 17 + 0xa;

      // '0' - '9'
      } else {
        r |= c & 0xf;
      }
    }
    return r;
  }

  BN.prototype._parseHex = function _parseHex (number, start) {
    // Create possibly bigger array to ensure that it fits the number
    this.length = Math.ceil((number.length - start) / 6);
    this.words = new Array(this.length);
    for (var i = 0; i < this.length; i++) {
      this.words[i] = 0;
    }

    var j, w;
    // Scan 24-bit chunks and add them to the number
    var off = 0;
    for (i = number.length - 6, j = 0; i >= start; i -= 6) {
      w = parseHex(number, i, i + 6);
      this.words[j] |= (w << off) & 0x3ffffff;
      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb
      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
      off += 24;
      if (off >= 26) {
        off -= 26;
        j++;
      }
    }
    if (i + 6 !== start) {
      w = parseHex(number, start, i + 6);
      this.words[j] |= (w << off) & 0x3ffffff;
      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;
    }
    this.strip();
  };

  function parseBase (str, start, end, mul) {
    var r = 0;
    var len = Math.min(str.length, end);
    for (var i = start; i < len; i++) {
      var c = str.charCodeAt(i) - 48;

      r *= mul;

      // 'a'
      if (c >= 49) {
        r += c - 49 + 0xa;

      // 'A'
      } else if (c >= 17) {
        r += c - 17 + 0xa;

      // '0' - '9'
      } else {
        r += c;
      }
    }
    return r;
  }

  BN.prototype._parseBase = function _parseBase (number, base, start) {
    // Initialize as zero
    this.words = [ 0 ];
    this.length = 1;

    // Find length of limb in base
    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {
      limbLen++;
    }
    limbLen--;
    limbPow = (limbPow / base) | 0;

    var total = number.length - start;
    var mod = total % limbLen;
    var end = Math.min(total, total - mod) + start;

    var word = 0;
    for (var i = start; i < end; i += limbLen) {
      word = parseBase(number, i, i + limbLen, base);

      this.imuln(limbPow);
      if (this.words[0] + word < 0x4000000) {
        this.words[0] += word;
      } else {
        this._iaddn(word);
      }
    }

    if (mod !== 0) {
      var pow = 1;
      word = parseBase(number, i, number.length, base);

      for (i = 0; i < mod; i++) {
        pow *= base;
      }

      this.imuln(pow);
      if (this.words[0] + word < 0x4000000) {
        this.words[0] += word;
      } else {
        this._iaddn(word);
      }
    }
  };

  BN.prototype.copy = function copy (dest) {
    dest.words = new Array(this.length);
    for (var i = 0; i < this.length; i++) {
      dest.words[i] = this.words[i];
    }
    dest.length = this.length;
    dest.negative = this.negative;
    dest.red = this.red;
  };

  BN.prototype.clone = function clone () {
    var r = new BN(null);
    this.copy(r);
    return r;
  };

  BN.prototype._expand = function _expand (size) {
    while (this.length < size) {
      this.words[this.length++] = 0;
    }
    return this;
  };

  // Remove leading `0` from `this`
  BN.prototype.strip = function strip () {
    while (this.length > 1 && this.words[this.length - 1] === 0) {
      this.length--;
    }
    return this._normSign();
  };

  BN.prototype._normSign = function _normSign () {
    // -0 = 0
    if (this.length === 1 && this.words[0] === 0) {
      this.negative = 0;
    }
    return this;
  };

  BN.prototype.inspect = function inspect () {
    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';
  };

  /*

  var zeros = [];
  var groupSizes = [];
  var groupBases = [];

  var s = '';
  var i = -1;
  while (++i < BN.wordSize) {
    zeros[i] = s;
    s += '0';
  }
  groupSizes[0] = 0;
  groupSizes[1] = 0;
  groupBases[0] = 0;
  groupBases[1] = 0;
  var base = 2 - 1;
  while (++base < 36 + 1) {
    var groupSize = 0;
    var groupBase = 1;
    while (groupBase < (1 << BN.wordSize) / base) {
      groupBase *= base;
      groupSize += 1;
    }
    groupSizes[base] = groupSize;
    groupBases[base] = groupBase;
  }

  */

  var zeros = [
    '',
    '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'
  ];

  var groupSizes = [
    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
  ];

  var groupBases = [
    0, 0,
    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,
    43046721, 10000000, 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
  ];

  BN.prototype.toString = function toString (base, padding) {
    base = base || 10;
    padding = padding | 0 || 1;

    var out;
    if (base === 16 || base === 'hex') {
      out = '';
      var off = 0;
      var carry = 0;
      for (var i = 0; i < this.length; i++) {
        var w = this.words[i];
        var word = (((w << off) | carry) & 0xffffff).toString(16);
        carry = (w >>> (24 - off)) & 0xffffff;
        if (carry !== 0 || i !== this.length - 1) {
          out = zeros[6 - word.length] + word + out;
        } else {
          out = word + out;
        }
        off += 2;
        if (off >= 26) {
          off -= 26;
          i--;
        }
      }
      if (carry !== 0) {
        out = carry.toString(16) + out;
      }
      while (out.length % padding !== 0) {
        out = '0' + out;
      }
      if (this.negative !== 0) {
        out = '-' + out;
      }
      return out;
    }

    if (base === (base | 0) && base >= 2 && base <= 36) {
      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));
      var groupSize = groupSizes[base];
      // var groupBase = Math.pow(base, groupSize);
      var groupBase = groupBases[base];
      out = '';
      var c = this.clone();
      c.negative = 0;
      while (!c.isZero()) {
        var r = c.modn(groupBase).toString(base);
        c = c.idivn(groupBase);

        if (!c.isZero()) {
          out = zeros[groupSize - r.length] + r + out;
        } else {
          out = r + out;
        }
      }
      if (this.isZero()) {
        out = '0' + out;
      }
      while (out.length % padding !== 0) {
        out = '0' + out;
      }
      if (this.negative !== 0) {
        out = '-' + out;
      }
      return out;
    }

    assert(false, 'Base should be between 2 and 36');
  };

  BN.prototype.toNumber = function toNumber () {
    var ret = this.words[0];
    if (this.length === 2) {
      ret += this.words[1] * 0x4000000;
    } else if (this.length === 3 && this.words[2] === 0x01) {
      // NOTE: at this stage it is known that the top bit is set
      ret += 0x10000000000000 + (this.words[1] * 0x4000000);
    } else if (this.length > 2) {
      assert(false, 'Number can only safely store up to 53 bits');
    }
    return (this.negative !== 0) ? -ret : ret;
  };

  BN.prototype.toJSON = function toJSON () {
    return this.toString(16);
  };

  BN.prototype.toBuffer = function toBuffer (endian, length) {
    assert(typeof Buffer !== 'undefined');
    return this.toArrayLike(Buffer, endian, length);
  };

  BN.prototype.toArray = function toArray (endian, length) {
    return this.toArrayLike(Array, endian, length);
  };

  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {
    var byteLength = this.byteLength();
    var reqLength = length || Math.max(1, byteLength);
    assert(byteLength <= reqLength, 'byte array longer than desired length');
    assert(reqLength > 0, 'Requested array length <= 0');

    this.strip();
    var littleEndian = endian === 'le';
    var res = new ArrayType(reqLength);

    var b, i;
    var q = this.clone();
    if (!littleEndian) {
      // Assume big-endian
      for (i = 0; i < reqLength - byteLength; i++) {
        res[i] = 0;
      }

      for (i = 0; !q.isZero(); i++) {
        b = q.andln(0xff);
        q.iushrn(8);

        res[reqLength - i - 1] = b;
      }
    } else {
      for (i = 0; !q.isZero(); i++) {
        b = q.andln(0xff);
        q.iushrn(8);

        res[i] = b;
      }

      for (; i < reqLength; i++) {
        res[i] = 0;
      }
    }

    return res;
  };

  if (Math.clz32) {
    BN.prototype._countBits = function _countBits (w) {
      return 32 - Math.clz32(w);
    };
  } else {
    BN.prototype._countBits = function _countBits (w) {
      var t = w;
      var r = 0;
      if (t >= 0x1000) {
        r += 13;
        t >>>= 13;
      }
      if (t >= 0x40) {
        r += 7;
        t >>>= 7;
      }
      if (t >= 0x8) {
        r += 4;
        t >>>= 4;
      }
      if (t >= 0x02) {
        r += 2;
        t >>>= 2;
      }
      return r + t;
    };
  }

  BN.prototype._zeroBits = function _zeroBits (w) {
    // Short-cut
    if (w === 0) return 26;

    var t = w;
    var r = 0;
    if ((t & 0x1fff) === 0) {
      r += 13;
      t >>>= 13;
    }
    if ((t & 0x7f) === 0) {
      r += 7;
      t >>>= 7;
    }
    if ((t & 0xf) === 0) {
      r += 4;
      t >>>= 4;
    }
    if ((t & 0x3) === 0) {
      r += 2;
      t >>>= 2;
    }
    if ((t & 0x1) === 0) {
      r++;
    }
    return r;
  };

  // Return number of used bits in a BN
  BN.prototype.bitLength = function bitLength () {
    var w = this.words[this.length - 1];
    var hi = this._countBits(w);
    return (this.length - 1) * 26 + hi;
  };

  function toBitArray (num) {
    var w = new Array(num.bitLength());

    for (var bit = 0; bit < w.length; bit++) {
      var off = (bit / 26) | 0;
      var wbit = bit % 26;

      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;
    }

    return w;
  }

  // Number of trailing zero bits
  BN.prototype.zeroBits = function zeroBits () {
    if (this.isZero()) return 0;

    var r = 0;
    for (var i = 0; i < this.length; i++) {
      var b = this._zeroBits(this.words[i]);
      r += b;
      if (b !== 26) break;
    }
    return r;
  };

  BN.prototype.byteLength = function byteLength () {
    return Math.ceil(this.bitLength() / 8);
  };

  BN.prototype.toTwos = function toTwos (width) {
    if (this.negative !== 0) {
      return this.abs().inotn(width).iaddn(1);
    }
    return this.clone();
  };

  BN.prototype.fromTwos = function fromTwos (width) {
    if (this.testn(width - 1)) {
      return this.notn(width).iaddn(1).ineg();
    }
    return this.clone();
  };

  BN.prototype.isNeg = function isNeg () {
    return this.negative !== 0;
  };

  // Return negative clone of `this`
  BN.prototype.neg = function neg () {
    return this.clone().ineg();
  };

  BN.prototype.ineg = function ineg () {
    if (!this.isZero()) {
      this.negative ^= 1;
    }

    return this;
  };

  // Or `num` with `this` in-place
  BN.prototype.iuor = function iuor (num) {
    while (this.length < num.length) {
      this.words[this.length++] = 0;
    }

    for (var i = 0; i < num.length; i++) {
      this.words[i] = this.words[i] | num.words[i];
    }

    return this.strip();
  };

  BN.prototype.ior = function ior (num) {
    assert((this.negative | num.negative) === 0);
    return this.iuor(num);
  };

  // Or `num` with `this`
  BN.prototype.or = function or (num) {
    if (this.length > num.length) return this.clone().ior(num);
    return num.clone().ior(this);
  };

  BN.prototype.uor = function uor (num) {
    if (this.length > num.length) return this.clone().iuor(num);
    return num.clone().iuor(this);
  };

  // And `num` with `this` in-place
  BN.prototype.iuand = function iuand (num) {
    // b = min-length(num, this)
    var b;
    if (this.length > num.length) {
      b = num;
    } else {
      b = this;
    }

    for (var i = 0; i < b.length; i++) {
      this.words[i] = this.words[i] & num.words[i];
    }

    this.length = b.length;

    return this.strip();
  };

  BN.prototype.iand = function iand (num) {
    assert((this.negative | num.negative) === 0);
    return this.iuand(num);
  };

  // And `num` with `this`
  BN.prototype.and = function and (num) {
    if (this.length > num.length) return this.clone().iand(num);
    return num.clone().iand(this);
  };

  BN.prototype.uand = function uand (num) {
    if (this.length > num.length) return this.clone().iuand(num);
    return num.clone().iuand(this);
  };

  // Xor `num` with `this` in-place
  BN.prototype.iuxor = function iuxor (num) {
    // a.length > b.length
    var a;
    var b;
    if (this.length > num.length) {
      a = this;
      b = num;
    } else {
      a = num;
      b = this;
    }

    for (var i = 0; i < b.length; i++) {
      this.words[i] = a.words[i] ^ b.words[i];
    }

    if (this !== a) {
      for (; i < a.length; i++) {
        this.words[i] = a.words[i];
      }
    }

    this.length = a.length;

    return this.strip();
  };

  BN.prototype.ixor = function ixor (num) {
    assert((this.negative | num.negative) === 0);
    return this.iuxor(num);
  };

  // Xor `num` with `this`
  BN.prototype.xor = function xor (num) {
    if (this.length > num.length) return this.clone().ixor(num);
    return num.clone().ixor(this);
  };

  BN.prototype.uxor = function uxor (num) {
    if (this.length > num.length) return this.clone().iuxor(num);
    return num.clone().iuxor(this);
  };

  // Not ``this`` with ``width`` bitwidth
  BN.prototype.inotn = function inotn (width) {
    assert(typeof width === 'number' && width >= 0);

    var bytesNeeded = Math.ceil(width / 26) | 0;
    var bitsLeft = width % 26;

    // Extend the buffer with leading zeroes
    this._expand(bytesNeeded);

    if (bitsLeft > 0) {
      bytesNeeded--;
    }

    // Handle complete words
    for (var i = 0; i < bytesNeeded; i++) {
      this.words[i] = ~this.words[i] & 0x3ffffff;
    }

    // Handle the residue
    if (bitsLeft > 0) {
      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));
    }

    // And remove leading zeroes
    return this.strip();
  };

  BN.prototype.notn = function notn (width) {
    return this.clone().inotn(width);
  };

  // Set `bit` of `this`
  BN.prototype.setn = function setn (bit, val) {
    assert(typeof bit === 'number' && bit >= 0);

    var off = (bit / 26) | 0;
    var wbit = bit % 26;

    this._expand(off + 1);

    if (val) {
      this.words[off] = this.words[off] | (1 << wbit);
    } else {
      this.words[off] = this.words[off] & ~(1 << wbit);
    }

    return this.strip();
  };

  // Add `num` to `this` in-place
  BN.prototype.iadd = function iadd (num) {
    var r;

    // negative + positive
    if (this.negative !== 0 && num.negative === 0) {
      this.negative = 0;
      r = this.isub(num);
      this.negative ^= 1;
      return this._normSign();

    // positive + negative
    } else if (this.negative === 0 && num.negative !== 0) {
      num.negative = 0;
      r = this.isub(num);
      num.negative = 1;
      return r._normSign();
    }

    // a.length > b.length
    var a, b;
    if (this.length > num.length) {
      a = this;
      b = num;
    } else {
      a = num;
      b = this;
    }

    var carry = 0;
    for (var i = 0; i < b.length; i++) {
      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
      this.words[i] = r & 0x3ffffff;
      carry = r >>> 26;
    }
    for (; carry !== 0 && i < a.length; i++) {
      r = (a.words[i] | 0) + carry;
      this.words[i] = r & 0x3ffffff;
      carry = r >>> 26;
    }

    this.length = a.length;
    if (carry !== 0) {
      this.words[this.length] = carry;
      this.length++;
    // Copy the rest of the words
    } else if (a !== this) {
      for (; i < a.length; i++) {
        this.words[i] = a.words[i];
      }
    }

    return this;
  };

  // Add `num` to `this`
  BN.prototype.add = function add (num) {
    var res;
    if (num.negative !== 0 && this.negative === 0) {
      num.negative = 0;
      res = this.sub(num);
      num.negative ^= 1;
      return res;
    } else if (num.negative === 0 && this.negative !== 0) {
      this.negative = 0;
      res = num.sub(this);
      this.negative = 1;
      return res;
    }

    if (this.length > num.length) return this.clone().iadd(num);

    return num.clone().iadd(this);
  };

  // Subtract `num` from `this` in-place
  BN.prototype.isub = function isub (num) {
    // this - (-num) = this + num
    if (num.negative !== 0) {
      num.negative = 0;
      var r = this.iadd(num);
      num.negative = 1;
      return r._normSign();

    // -this - num = -(this + num)
    } else if (this.negative !== 0) {
      this.negative = 0;
      this.iadd(num);
      this.negative = 1;
      return this._normSign();
    }

    // At this point both numbers are positive
    var cmp = this.cmp(num);

    // Optimization - zeroify
    if (cmp === 0) {
      this.negative = 0;
      this.length = 1;
      this.words[0] = 0;
      return this;
    }

    // a > b
    var a, b;
    if (cmp > 0) {
      a = this;
      b = num;
    } else {
      a = num;
      b = this;
    }

    var carry = 0;
    for (var i = 0; i < b.length; i++) {
      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
      carry = r >> 26;
      this.words[i] = r & 0x3ffffff;
    }
    for (; carry !== 0 && i < a.length; i++) {
      r = (a.words[i] | 0) + carry;
      carry = r >> 26;
      this.words[i] = r & 0x3ffffff;
    }

    // Copy rest of the words
    if (carry === 0 && i < a.length && a !== this) {
      for (; i < a.length; i++) {
        this.words[i] = a.words[i];
      }
    }

    this.length = Math.max(this.length, i);

    if (a !== this) {
      this.negative = 1;
    }

    return this.strip();
  };

  // Subtract `num` from `this`
  BN.prototype.sub = function sub (num) {
    return this.clone().isub(num);
  };

  function smallMulTo (self, num, out) {
    out.negative = num.negative ^ self.negative;
    var len = (self.length + num.length) | 0;
    out.length = len;
    len = (len - 1) | 0;

    // Peel one iteration (compiler can't do it, because of code complexity)
    var a = self.words[0] | 0;
    var b = num.words[0] | 0;
    var r = a * b;

    var lo = r & 0x3ffffff;
    var carry = (r / 0x4000000) | 0;
    out.words[0] = lo;

    for (var k = 1; k < len; k++) {
      // Sum all words with the same `i + j = k` and accumulate `ncarry`,
      // note that ncarry could be >= 0x3ffffff
      var ncarry = carry >>> 26;
      var rword = carry & 0x3ffffff;
      var maxJ = Math.min(k, num.length - 1);
      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
        var i = (k - j) | 0;
        a = self.words[i] | 0;
        b = num.words[j] | 0;
        r = a * b + rword;
        ncarry += (r / 0x4000000) | 0;
        rword = r & 0x3ffffff;
      }
      out.words[k] = rword | 0;
      carry = ncarry | 0;
    }
    if (carry !== 0) {
      out.words[k] = carry | 0;
    } else {
      out.length--;
    }

    return out.strip();
  }

  // TODO(indutny): it may be reasonable to omit it for users who don't need
  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit
  // multiplication (like elliptic secp256k1).
  var comb10MulTo = function comb10MulTo (self, num, out) {
    var a = self.words;
    var b = num.words;
    var o = out.words;
    var c = 0;
    var lo;
    var mid;
    var hi;
    var a0 = a[0] | 0;
    var al0 = a0 & 0x1fff;
    var ah0 = a0 >>> 13;
    var a1 = a[1] | 0;
    var al1 = a1 & 0x1fff;
    var ah1 = a1 >>> 13;
    var a2 = a[2] | 0;
    var al2 = a2 & 0x1fff;
    var ah2 = a2 >>> 13;
    var a3 = a[3] | 0;
    var al3 = a3 & 0x1fff;
    var ah3 = a3 >>> 13;
    var a4 = a[4] | 0;
    var al4 = a4 & 0x1fff;
    var ah4 = a4 >>> 13;
    var a5 = a[5] | 0;
    var al5 = a5 & 0x1fff;
    var ah5 = a5 >>> 13;
    var a6 = a[6] | 0;
    var al6 = a6 & 0x1fff;
    var ah6 = a6 >>> 13;
    var a7 = a[7] | 0;
    var al7 = a7 & 0x1fff;
    var ah7 = a7 >>> 13;
    var a8 = a[8] | 0;
    var al8 = a8 & 0x1fff;
    var ah8 = a8 >>> 13;
    var a9 = a[9] | 0;
    var al9 = a9 & 0x1fff;
    var ah9 = a9 >>> 13;
    var b0 = b[0] | 0;
    var bl0 = b0 & 0x1fff;
    var bh0 = b0 >>> 13;
    var b1 = b[1] | 0;
    var bl1 = b1 & 0x1fff;
    var bh1 = b1 >>> 13;
    var b2 = b[2] | 0;
    var bl2 = b2 & 0x1fff;
    var bh2 = b2 >>> 13;
    var b3 = b[3] | 0;
    var bl3 = b3 & 0x1fff;
    var bh3 = b3 >>> 13;
    var b4 = b[4] | 0;
    var bl4 = b4 & 0x1fff;
    var bh4 = b4 >>> 13;
    var b5 = b[5] | 0;
    var bl5 = b5 & 0x1fff;
    var bh5 = b5 >>> 13;
    var b6 = b[6] | 0;
    var bl6 = b6 & 0x1fff;
    var bh6 = b6 >>> 13;
    var b7 = b[7] | 0;
    var bl7 = b7 & 0x1fff;
    var bh7 = b7 >>> 13;
    var b8 = b[8] | 0;
    var bl8 = b8 & 0x1fff;
    var bh8 = b8 >>> 13;
    var b9 = b[9] | 0;
    var bl9 = b9 & 0x1fff;
    var bh9 = b9 >>> 13;

    out.negative = self.negative ^ num.negative;
    out.length = 19;
    /* k = 0 */
    lo = Math.imul(al0, bl0);
    mid = Math.imul(al0, bh0);
    mid = (mid + Math.imul(ah0, bl0)) | 0;
    hi = Math.imul(ah0, bh0);
    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;
    w0 &= 0x3ffffff;
    /* k = 1 */
    lo = Math.imul(al1, bl0);
    mid = Math.imul(al1, bh0);
    mid = (mid + Math.imul(ah1, bl0)) | 0;
    hi = Math.imul(ah1, bh0);
    lo = (lo + Math.imul(al0, bl1)) | 0;
    mid = (mid + Math.imul(al0, bh1)) | 0;
    mid = (mid + Math.imul(ah0, bl1)) | 0;
    hi = (hi + Math.imul(ah0, bh1)) | 0;
    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;
    w1 &= 0x3ffffff;
    /* k = 2 */
    lo = Math.imul(al2, bl0);
    mid = Math.imul(al2, bh0);
    mid = (mid + Math.imul(ah2, bl0)) | 0;
    hi = Math.imul(ah2, bh0);
    lo = (lo + Math.imul(al1, bl1)) | 0;
    mid = (mid + Math.imul(al1, bh1)) | 0;
    mid = (mid + Math.imul(ah1, bl1)) | 0;
    hi = (hi + Math.imul(ah1, bh1)) | 0;
    lo = (lo + Math.imul(al0, bl2)) | 0;
    mid = (mid + Math.imul(al0, bh2)) | 0;
    mid = (mid + Math.imul(ah0, bl2)) | 0;
    hi = (hi + Math.imul(ah0, bh2)) | 0;
    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;
    w2 &= 0x3ffffff;
    /* k = 3 */
    lo = Math.imul(al3, bl0);
    mid = Math.imul(al3, bh0);
    mid = (mid + Math.imul(ah3, bl0)) | 0;
    hi = Math.imul(ah3, bh0);
    lo = (lo + Math.imul(al2, bl1)) | 0;
    mid = (mid + Math.imul(al2, bh1)) | 0;
    mid = (mid + Math.imul(ah2, bl1)) | 0;
    hi = (hi + Math.imul(ah2, bh1)) | 0;
    lo = (lo + Math.imul(al1, bl2)) | 0;
    mid = (mid + Math.imul(al1, bh2)) | 0;
    mid = (mid + Math.imul(ah1, bl2)) | 0;
    hi = (hi + Math.imul(ah1, bh2)) | 0;
    lo = (lo + Math.imul(al0, bl3)) | 0;
    mid = (mid + Math.imul(al0, bh3)) | 0;
    mid = (mid + Math.imul(ah0, bl3)) | 0;
    hi = (hi + Math.imul(ah0, bh3)) | 0;
    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;
    w3 &= 0x3ffffff;
    /* k = 4 */
    lo = Math.imul(al4, bl0);
    mid = Math.imul(al4, bh0);
    mid = (mid + Math.imul(ah4, bl0)) | 0;
    hi = Math.imul(ah4, bh0);
    lo = (lo + Math.imul(al3, bl1)) | 0;
    mid = (mid + Math.imul(al3, bh1)) | 0;
    mid = (mid + Math.imul(ah3, bl1)) | 0;
    hi = (hi + Math.imul(ah3, bh1)) | 0;
    lo = (lo + Math.imul(al2, bl2)) | 0;
    mid = (mid + Math.imul(al2, bh2)) | 0;
    mid = (mid + Math.imul(ah2, bl2)) | 0;
    hi = (hi + Math.imul(ah2, bh2)) | 0;
    lo = (lo + Math.imul(al1, bl3)) | 0;
    mid = (mid + Math.imul(al1, bh3)) | 0;
    mid = (mid + Math.imul(ah1, bl3)) | 0;
    hi = (hi + Math.imul(ah1, bh3)) | 0;
    lo = (lo + Math.imul(al0, bl4)) | 0;
    mid = (mid + Math.imul(al0, bh4)) | 0;
    mid = (mid + Math.imul(ah0, bl4)) | 0;
    hi = (hi + Math.imul(ah0, bh4)) | 0;
    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;
    w4 &= 0x3ffffff;
    /* k = 5 */
    lo = Math.imul(al5, bl0);
    mid = Math.imul(al5, bh0);
    mid = (mid + Math.imul(ah5, bl0)) | 0;
    hi = Math.imul(ah5, bh0);
    lo = (lo + Math.imul(al4, bl1)) | 0;
    mid = (mid + Math.imul(al4, bh1)) | 0;
    mid = (mid + Math.imul(ah4, bl1)) | 0;
    hi = (hi + Math.imul(ah4, bh1)) | 0;
    lo = (lo + Math.imul(al3, bl2)) | 0;
    mid = (mid + Math.imul(al3, bh2)) | 0;
    mid = (mid + Math.imul(ah3, bl2)) | 0;
    hi = (hi + Math.imul(ah3, bh2)) | 0;
    lo = (lo + Math.imul(al2, bl3)) | 0;
    mid = (mid + Math.imul(al2, bh3)) | 0;
    mid = (mid + Math.imul(ah2, bl3)) | 0;
    hi = (hi + Math.imul(ah2, bh3)) | 0;
    lo = (lo + Math.imul(al1, bl4)) | 0;
    mid = (mid + Math.imul(al1, bh4)) | 0;
    mid = (mid + Math.imul(ah1, bl4)) | 0;
    hi = (hi + Math.imul(ah1, bh4)) | 0;
    lo = (lo + Math.imul(al0, bl5)) | 0;
    mid = (mid + Math.imul(al0, bh5)) | 0;
    mid = (mid + Math.imul(ah0, bl5)) | 0;
    hi = (hi + Math.imul(ah0, bh5)) | 0;
    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;
    w5 &= 0x3ffffff;
    /* k = 6 */
    lo = Math.imul(al6, bl0);
    mid = Math.imul(al6, bh0);
    mid = (mid + Math.imul(ah6, bl0)) | 0;
    hi = Math.imul(ah6, bh0);
    lo = (lo + Math.imul(al5, bl1)) | 0;
    mid = (mid + Math.imul(al5, bh1)) | 0;
    mid = (mid + Math.imul(ah5, bl1)) | 0;
    hi = (hi + Math.imul(ah5, bh1)) | 0;
    lo = (lo + Math.imul(al4, bl2)) | 0;
    mid = (mid + Math.imul(al4, bh2)) | 0;
    mid = (mid + Math.imul(ah4, bl2)) | 0;
    hi = (hi + Math.imul(ah4, bh2)) | 0;
    lo = (lo + Math.imul(al3, bl3)) | 0;
    mid = (mid + Math.imul(al3, bh3)) | 0;
    mid = (mid + Math.imul(ah3, bl3)) | 0;
    hi = (hi + Math.imul(ah3, bh3)) | 0;
    lo = (lo + Math.imul(al2, bl4)) | 0;
    mid = (mid + Math.imul(al2, bh4)) | 0;
    mid = (mid + Math.imul(ah2, bl4)) | 0;
    hi = (hi + Math.imul(ah2, bh4)) | 0;
    lo = (lo + Math.imul(al1, bl5)) | 0;
    mid = (mid + Math.imul(al1, bh5)) | 0;
    mid = (mid + Math.imul(ah1, bl5)) | 0;
    hi = (hi + Math.imul(ah1, bh5)) | 0;
    lo = (lo + Math.imul(al0, bl6)) | 0;
    mid = (mid + Math.imul(al0, bh6)) | 0;
    mid = (mid + Math.imul(ah0, bl6)) | 0;
    hi = (hi + Math.imul(ah0, bh6)) | 0;
    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;
    w6 &= 0x3ffffff;
    /* k = 7 */
    lo = Math.imul(al7, bl0);
    mid = Math.imul(al7, bh0);
    mid = (mid + Math.imul(ah7, bl0)) | 0;
    hi = Math.imul(ah7, bh0);
    lo = (lo + Math.imul(al6, bl1)) | 0;
    mid = (mid + Math.imul(al6, bh1)) | 0;
    mid = (mid + Math.imul(ah6, bl1)) | 0;
    hi = (hi + Math.imul(ah6, bh1)) | 0;
    lo = (lo + Math.imul(al5, bl2)) | 0;
    mid = (mid + Math.imul(al5, bh2)) | 0;
    mid = (mid + Math.imul(ah5, bl2)) | 0;
    hi = (hi + Math.imul(ah5, bh2)) | 0;
    lo = (lo + Math.imul(al4, bl3)) | 0;
    mid = (mid + Math.imul(al4, bh3)) | 0;
    mid = (mid + Math.imul(ah4, bl3)) | 0;
    hi = (hi + Math.imul(ah4, bh3)) | 0;
    lo = (lo + Math.imul(al3, bl4)) | 0;
    mid = (mid + Math.imul(al3, bh4)) | 0;
    mid = (mid + Math.imul(ah3, bl4)) | 0;
    hi = (hi + Math.imul(ah3, bh4)) | 0;
    lo = (lo + Math.imul(al2, bl5)) | 0;
    mid = (mid + Math.imul(al2, bh5)) | 0;
    mid = (mid + Math.imul(ah2, bl5)) | 0;
    hi = (hi + Math.imul(ah2, bh5)) | 0;
    lo = (lo + Math.imul(al1, bl6)) | 0;
    mid = (mid + Math.imul(al1, bh6)) | 0;
    mid = (mid + Math.imul(ah1, bl6)) | 0;
    hi = (hi + Math.imul(ah1, bh6)) | 0;
    lo = (lo + Math.imul(al0, bl7)) | 0;
    mid = (mid + Math.imul(al0, bh7)) | 0;
    mid = (mid + Math.imul(ah0, bl7)) | 0;
    hi = (hi + Math.imul(ah0, bh7)) | 0;
    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;
    w7 &= 0x3ffffff;
    /* k = 8 */
    lo = Math.imul(al8, bl0);
    mid = Math.imul(al8, bh0);
    mid = (mid + Math.imul(ah8, bl0)) | 0;
    hi = Math.imul(ah8, bh0);
    lo = (lo + Math.imul(al7, bl1)) | 0;
    mid = (mid + Math.imul(al7, bh1)) | 0;
    mid = (mid + Math.imul(ah7, bl1)) | 0;
    hi = (hi + Math.imul(ah7, bh1)) | 0;
    lo = (lo + Math.imul(al6, bl2)) | 0;
    mid = (mid + Math.imul(al6, bh2)) | 0;
    mid = (mid + Math.imul(ah6, bl2)) | 0;
    hi = (hi + Math.imul(ah6, bh2)) | 0;
    lo = (lo + Math.imul(al5, bl3)) | 0;
    mid = (mid + Math.imul(al5, bh3)) | 0;
    mid = (mid + Math.imul(ah5, bl3)) | 0;
    hi = (hi + Math.imul(ah5, bh3)) | 0;
    lo = (lo + Math.imul(al4, bl4)) | 0;
    mid = (mid + Math.imul(al4, bh4)) | 0;
    mid = (mid + Math.imul(ah4, bl4)) | 0;
    hi = (hi + Math.imul(ah4, bh4)) | 0;
    lo = (lo + Math.imul(al3, bl5)) | 0;
    mid = (mid + Math.imul(al3, bh5)) | 0;
    mid = (mid + Math.imul(ah3, bl5)) | 0;
    hi = (hi + Math.imul(ah3, bh5)) | 0;
    lo = (lo + Math.imul(al2, bl6)) | 0;
    mid = (mid + Math.imul(al2, bh6)) | 0;
    mid = (mid + Math.imul(ah2, bl6)) | 0;
    hi = (hi + Math.imul(ah2, bh6)) | 0;
    lo = (lo + Math.imul(al1, bl7)) | 0;
    mid = (mid + Math.imul(al1, bh7)) | 0;
    mid = (mid + Math.imul(ah1, bl7)) | 0;
    hi = (hi + Math.imul(ah1, bh7)) | 0;
    lo = (lo + Math.imul(al0, bl8)) | 0;
    mid = (mid + Math.imul(al0, bh8)) | 0;
    mid = (mid + Math.imul(ah0, bl8)) | 0;
    hi = (hi + Math.imul(ah0, bh8)) | 0;
    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;
    w8 &= 0x3ffffff;
    /* k = 9 */
    lo = Math.imul(al9, bl0);
    mid = Math.imul(al9, bh0);
    mid = (mid + Math.imul(ah9, bl0)) | 0;
    hi = Math.imul(ah9, bh0);
    lo = (lo + Math.imul(al8, bl1)) | 0;
    mid = (mid + Math.imul(al8, bh1)) | 0;
    mid = (mid + Math.imul(ah8, bl1)) | 0;
    hi = (hi + Math.imul(ah8, bh1)) | 0;
    lo = (lo + Math.imul(al7, bl2)) | 0;
    mid = (mid + Math.imul(al7, bh2)) | 0;
    mid = (mid + Math.imul(ah7, bl2)) | 0;
    hi = (hi + Math.imul(ah7, bh2)) | 0;
    lo = (lo + Math.imul(al6, bl3)) | 0;
    mid = (mid + Math.imul(al6, bh3)) | 0;
    mid = (mid + Math.imul(ah6, bl3)) | 0;
    hi = (hi + Math.imul(ah6, bh3)) | 0;
    lo = (lo + Math.imul(al5, bl4)) | 0;
    mid = (mid + Math.imul(al5, bh4)) | 0;
    mid = (mid + Math.imul(ah5, bl4)) | 0;
    hi = (hi + Math.imul(ah5, bh4)) | 0;
    lo = (lo + Math.imul(al4, bl5)) | 0;
    mid = (mid + Math.imul(al4, bh5)) | 0;
    mid = (mid + Math.imul(ah4, bl5)) | 0;
    hi = (hi + Math.imul(ah4, bh5)) | 0;
    lo = (lo + Math.imul(al3, bl6)) | 0;
    mid = (mid + Math.imul(al3, bh6)) | 0;
    mid = (mid + Math.imul(ah3, bl6)) | 0;
    hi = (hi + Math.imul(ah3, bh6)) | 0;
    lo = (lo + Math.imul(al2, bl7)) | 0;
    mid = (mid + Math.imul(al2, bh7)) | 0;
    mid = (mid + Math.imul(ah2, bl7)) | 0;
    hi = (hi + Math.imul(ah2, bh7)) | 0;
    lo = (lo + Math.imul(al1, bl8)) | 0;
    mid = (mid + Math.imul(al1, bh8)) | 0;
    mid = (mid + Math.imul(ah1, bl8)) | 0;
    hi = (hi + Math.imul(ah1, bh8)) | 0;
    lo = (lo + Math.imul(al0, bl9)) | 0;
    mid = (mid + Math.imul(al0, bh9)) | 0;
    mid = (mid + Math.imul(ah0, bl9)) | 0;
    hi = (hi + Math.imul(ah0, bh9)) | 0;
    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;
    w9 &= 0x3ffffff;
    /* k = 10 */
    lo = Math.imul(al9, bl1);
    mid = Math.imul(al9, bh1);
    mid = (mid + Math.imul(ah9, bl1)) | 0;
    hi = Math.imul(ah9, bh1);
    lo = (lo + Math.imul(al8, bl2)) | 0;
    mid = (mid + Math.imul(al8, bh2)) | 0;
    mid = (mid + Math.imul(ah8, bl2)) | 0;
    hi = (hi + Math.imul(ah8, bh2)) | 0;
    lo = (lo + Math.imul(al7, bl3)) | 0;
    mid = (mid + Math.imul(al7, bh3)) | 0;
    mid = (mid + Math.imul(ah7, bl3)) | 0;
    hi = (hi + Math.imul(ah7, bh3)) | 0;
    lo = (lo + Math.imul(al6, bl4)) | 0;
    mid = (mid + Math.imul(al6, bh4)) | 0;
    mid = (mid + Math.imul(ah6, bl4)) | 0;
    hi = (hi + Math.imul(ah6, bh4)) | 0;
    lo = (lo + Math.imul(al5, bl5)) | 0;
    mid = (mid + Math.imul(al5, bh5)) | 0;
    mid = (mid + Math.imul(ah5, bl5)) | 0;
    hi = (hi + Math.imul(ah5, bh5)) | 0;
    lo = (lo + Math.imul(al4, bl6)) | 0;
    mid = (mid + Math.imul(al4, bh6)) | 0;
    mid = (mid + Math.imul(ah4, bl6)) | 0;
    hi = (hi + Math.imul(ah4, bh6)) | 0;
    lo = (lo + Math.imul(al3, bl7)) | 0;
    mid = (mid + Math.imul(al3, bh7)) | 0;
    mid = (mid + Math.imul(ah3, bl7)) | 0;
    hi = (hi + Math.imul(ah3, bh7)) | 0;
    lo = (lo + Math.imul(al2, bl8)) | 0;
    mid = (mid + Math.imul(al2, bh8)) | 0;
    mid = (mid + Math.imul(ah2, bl8)) | 0;
    hi = (hi + Math.imul(ah2, bh8)) | 0;
    lo = (lo + Math.imul(al1, bl9)) | 0;
    mid = (mid + Math.imul(al1, bh9)) | 0;
    mid = (mid + Math.imul(ah1, bl9)) | 0;
    hi = (hi + Math.imul(ah1, bh9)) | 0;
    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;
    w10 &= 0x3ffffff;
    /* k = 11 */
    lo = Math.imul(al9, bl2);
    mid = Math.imul(al9, bh2);
    mid = (mid + Math.imul(ah9, bl2)) | 0;
    hi = Math.imul(ah9, bh2);
    lo = (lo + Math.imul(al8, bl3)) | 0;
    mid = (mid + Math.imul(al8, bh3)) | 0;
    mid = (mid + Math.imul(ah8, bl3)) | 0;
    hi = (hi + Math.imul(ah8, bh3)) | 0;
    lo = (lo + Math.imul(al7, bl4)) | 0;
    mid = (mid + Math.imul(al7, bh4)) | 0;
    mid = (mid + Math.imul(ah7, bl4)) | 0;
    hi = (hi + Math.imul(ah7, bh4)) | 0;
    lo = (lo + Math.imul(al6, bl5)) | 0;
    mid = (mid + Math.imul(al6, bh5)) | 0;
    mid = (mid + Math.imul(ah6, bl5)) | 0;
    hi = (hi + Math.imul(ah6, bh5)) | 0;
    lo = (lo + Math.imul(al5, bl6)) | 0;
    mid = (mid + Math.imul(al5, bh6)) | 0;
    mid = (mid + Math.imul(ah5, bl6)) | 0;
    hi = (hi + Math.imul(ah5, bh6)) | 0;
    lo = (lo + Math.imul(al4, bl7)) | 0;
    mid = (mid + Math.imul(al4, bh7)) | 0;
    mid = (mid + Math.imul(ah4, bl7)) | 0;
    hi = (hi + Math.imul(ah4, bh7)) | 0;
    lo = (lo + Math.imul(al3, bl8)) | 0;
    mid = (mid + Math.imul(al3, bh8)) | 0;
    mid = (mid + Math.imul(ah3, bl8)) | 0;
    hi = (hi + Math.imul(ah3, bh8)) | 0;
    lo = (lo + Math.imul(al2, bl9)) | 0;
    mid = (mid + Math.imul(al2, bh9)) | 0;
    mid = (mid + Math.imul(ah2, bl9)) | 0;
    hi = (hi + Math.imul(ah2, bh9)) | 0;
    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;
    w11 &= 0x3ffffff;
    /* k = 12 */
    lo = Math.imul(al9, bl3);
    mid = Math.imul(al9, bh3);
    mid = (mid + Math.imul(ah9, bl3)) | 0;
    hi = Math.imul(ah9, bh3);
    lo = (lo + Math.imul(al8, bl4)) | 0;
    mid = (mid + Math.imul(al8, bh4)) | 0;
    mid = (mid + Math.imul(ah8, bl4)) | 0;
    hi = (hi + Math.imul(ah8, bh4)) | 0;
    lo = (lo + Math.imul(al7, bl5)) | 0;
    mid = (mid + Math.imul(al7, bh5)) | 0;
    mid = (mid + Math.imul(ah7, bl5)) | 0;
    hi = (hi + Math.imul(ah7, bh5)) | 0;
    lo = (lo + Math.imul(al6, bl6)) | 0;
    mid = (mid + Math.imul(al6, bh6)) | 0;
    mid = (mid + Math.imul(ah6, bl6)) | 0;
    hi = (hi + Math.imul(ah6, bh6)) | 0;
    lo = (lo + Math.imul(al5, bl7)) | 0;
    mid = (mid + Math.imul(al5, bh7)) | 0;
    mid = (mid + Math.imul(ah5, bl7)) | 0;
    hi = (hi + Math.imul(ah5, bh7)) | 0;
    lo = (lo + Math.imul(al4, bl8)) | 0;
    mid = (mid + Math.imul(al4, bh8)) | 0;
    mid = (mid + Math.imul(ah4, bl8)) | 0;
    hi = (hi + Math.imul(ah4, bh8)) | 0;
    lo = (lo + Math.imul(al3, bl9)) | 0;
    mid = (mid + Math.imul(al3, bh9)) | 0;
    mid = (mid + Math.imul(ah3, bl9)) | 0;
    hi = (hi + Math.imul(ah3, bh9)) | 0;
    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;
    w12 &= 0x3ffffff;
    /* k = 13 */
    lo = Math.imul(al9, bl4);
    mid = Math.imul(al9, bh4);
    mid = (mid + Math.imul(ah9, bl4)) | 0;
    hi = Math.imul(ah9, bh4);
    lo = (lo + Math.imul(al8, bl5)) | 0;
    mid = (mid + Math.imul(al8, bh5)) | 0;
    mid = (mid + Math.imul(ah8, bl5)) | 0;
    hi = (hi + Math.imul(ah8, bh5)) | 0;
    lo = (lo + Math.imul(al7, bl6)) | 0;
    mid = (mid + Math.imul(al7, bh6)) | 0;
    mid = (mid + Math.imul(ah7, bl6)) | 0;
    hi = (hi + Math.imul(ah7, bh6)) | 0;
    lo = (lo + Math.imul(al6, bl7)) | 0;
    mid = (mid + Math.imul(al6, bh7)) | 0;
    mid = (mid + Math.imul(ah6, bl7)) | 0;
    hi = (hi + Math.imul(ah6, bh7)) | 0;
    lo = (lo + Math.imul(al5, bl8)) | 0;
    mid = (mid + Math.imul(al5, bh8)) | 0;
    mid = (mid + Math.imul(ah5, bl8)) | 0;
    hi = (hi + Math.imul(ah5, bh8)) | 0;
    lo = (lo + Math.imul(al4, bl9)) | 0;
    mid = (mid + Math.imul(al4, bh9)) | 0;
    mid = (mid + Math.imul(ah4, bl9)) | 0;
    hi = (hi + Math.imul(ah4, bh9)) | 0;
    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;
    w13 &= 0x3ffffff;
    /* k = 14 */
    lo = Math.imul(al9, bl5);
    mid = Math.imul(al9, bh5);
    mid = (mid + Math.imul(ah9, bl5)) | 0;
    hi = Math.imul(ah9, bh5);
    lo = (lo + Math.imul(al8, bl6)) | 0;
    mid = (mid + Math.imul(al8, bh6)) | 0;
    mid = (mid + Math.imul(ah8, bl6)) | 0;
    hi = (hi + Math.imul(ah8, bh6)) | 0;
    lo = (lo + Math.imul(al7, bl7)) | 0;
    mid = (mid + Math.imul(al7, bh7)) | 0;
    mid = (mid + Math.imul(ah7, bl7)) | 0;
    hi = (hi + Math.imul(ah7, bh7)) | 0;
    lo = (lo + Math.imul(al6, bl8)) | 0;
    mid = (mid + Math.imul(al6, bh8)) | 0;
    mid = (mid + Math.imul(ah6, bl8)) | 0;
    hi = (hi + Math.imul(ah6, bh8)) | 0;
    lo = (lo + Math.imul(al5, bl9)) | 0;
    mid = (mid + Math.imul(al5, bh9)) | 0;
    mid = (mid + Math.imul(ah5, bl9)) | 0;
    hi = (hi + Math.imul(ah5, bh9)) | 0;
    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;
    w14 &= 0x3ffffff;
    /* k = 15 */
    lo = Math.imul(al9, bl6);
    mid = Math.imul(al9, bh6);
    mid = (mid + Math.imul(ah9, bl6)) | 0;
    hi = Math.imul(ah9, bh6);
    lo = (lo + Math.imul(al8, bl7)) | 0;
    mid = (mid + Math.imul(al8, bh7)) | 0;
    mid = (mid + Math.imul(ah8, bl7)) | 0;
    hi = (hi + Math.imul(ah8, bh7)) | 0;
    lo = (lo + Math.imul(al7, bl8)) | 0;
    mid = (mid + Math.imul(al7, bh8)) | 0;
    mid = (mid + Math.imul(ah7, bl8)) | 0;
    hi = (hi + Math.imul(ah7, bh8)) | 0;
    lo = (lo + Math.imul(al6, bl9)) | 0;
    mid = (mid + Math.imul(al6, bh9)) | 0;
    mid = (mid + Math.imul(ah6, bl9)) | 0;
    hi = (hi + Math.imul(ah6, bh9)) | 0;
    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;
    w15 &= 0x3ffffff;
    /* k = 16 */
    lo = Math.imul(al9, bl7);
    mid = Math.imul(al9, bh7);
    mid = (mid + Math.imul(ah9, bl7)) | 0;
    hi = Math.imul(ah9, bh7);
    lo = (lo + Math.imul(al8, bl8)) | 0;
    mid = (mid + Math.imul(al8, bh8)) | 0;
    mid = (mid + Math.imul(ah8, bl8)) | 0;
    hi = (hi + Math.imul(ah8, bh8)) | 0;
    lo = (lo + Math.imul(al7, bl9)) | 0;
    mid = (mid + Math.imul(al7, bh9)) | 0;
    mid = (mid + Math.imul(ah7, bl9)) | 0;
    hi = (hi + Math.imul(ah7, bh9)) | 0;
    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;
    w16 &= 0x3ffffff;
    /* k = 17 */
    lo = Math.imul(al9, bl8);
    mid = Math.imul(al9, bh8);
    mid = (mid + Math.imul(ah9, bl8)) | 0;
    hi = Math.imul(ah9, bh8);
    lo = (lo + Math.imul(al8, bl9)) | 0;
    mid = (mid + Math.imul(al8, bh9)) | 0;
    mid = (mid + Math.imul(ah8, bl9)) | 0;
    hi = (hi + Math.imul(ah8, bh9)) | 0;
    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;
    w17 &= 0x3ffffff;
    /* k = 18 */
    lo = Math.imul(al9, bl9);
    mid = Math.imul(al9, bh9);
    mid = (mid + Math.imul(ah9, bl9)) | 0;
    hi = Math.imul(ah9, bh9);
    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;
    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;
    w18 &= 0x3ffffff;
    o[0] = w0;
    o[1] = w1;
    o[2] = w2;
    o[3] = w3;
    o[4] = w4;
    o[5] = w5;
    o[6] = w6;
    o[7] = w7;
    o[8] = w8;
    o[9] = w9;
    o[10] = w10;
    o[11] = w11;
    o[12] = w12;
    o[13] = w13;
    o[14] = w14;
    o[15] = w15;
    o[16] = w16;
    o[17] = w17;
    o[18] = w18;
    if (c !== 0) {
      o[19] = c;
      out.length++;
    }
    return out;
  };

  // Polyfill comb
  if (!Math.imul) {
    comb10MulTo = smallMulTo;
  }

  function bigMulTo (self, num, out) {
    out.negative = num.negative ^ self.negative;
    out.length = self.length + num.length;

    var carry = 0;
    var hncarry = 0;
    for (var k = 0; k < out.length - 1; k++) {
      // Sum all words with the same `i + j = k` and accumulate `ncarry`,
      // note that ncarry could be >= 0x3ffffff
      var ncarry = hncarry;
      hncarry = 0;
      var rword = carry & 0x3ffffff;
      var maxJ = Math.min(k, num.length - 1);
      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
        var i = k - j;
        var a = self.words[i] | 0;
        var b = num.words[j] | 0;
        var r = a * b;

        var lo = r & 0x3ffffff;
        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;
        lo = (lo + rword) | 0;
        rword = lo & 0x3ffffff;
        ncarry = (ncarry + (lo >>> 26)) | 0;

        hncarry += ncarry >>> 26;
        ncarry &= 0x3ffffff;
      }
      out.words[k] = rword;
      carry = ncarry;
      ncarry = hncarry;
    }
    if (carry !== 0) {
      out.words[k] = carry;
    } else {
      out.length--;
    }

    return out.strip();
  }

  function jumboMulTo (self, num, out) {
    var fftm = new FFTM();
    return fftm.mulp(self, num, out);
  }

  BN.prototype.mulTo = function mulTo (num, out) {
    var res;
    var len = this.length + num.length;
    if (this.length === 10 && num.length === 10) {
      res = comb10MulTo(this, num, out);
    } else if (len < 63) {
      res = smallMulTo(this, num, out);
    } else if (len < 1024) {
      res = bigMulTo(this, num, out);
    } else {
      res = jumboMulTo(this, num, out);
    }

    return res;
  };

  // Cooley-Tukey algorithm for FFT
  // slightly revisited to rely on looping instead of recursion

  function FFTM (x, y) {
    this.x = x;
    this.y = y;
  }

  FFTM.prototype.makeRBT = function makeRBT (N) {
    var t = new Array(N);
    var l = BN.prototype._countBits(N) - 1;
    for (var i = 0; i < N; i++) {
      t[i] = this.revBin(i, l, N);
    }

    return t;
  };

  // Returns binary-reversed representation of `x`
  FFTM.prototype.revBin = function revBin (x, l, N) {
    if (x === 0 || x === N - 1) return x;

    var rb = 0;
    for (var i = 0; i < l; i++) {
      rb |= (x & 1) << (l - i - 1);
      x >>= 1;
    }

    return rb;
  };

  // Performs "tweedling" phase, therefore 'emulating'
  // behaviour of the recursive algorithm
  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {
    for (var i = 0; i < N; i++) {
      rtws[i] = rws[rbt[i]];
      itws[i] = iws[rbt[i]];
    }
  };

  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {
    this.permute(rbt, rws, iws, rtws, itws, N);

    for (var s = 1; s < N; s <<= 1) {
      var l = s << 1;

      var rtwdf = Math.cos(2 * Math.PI / l);
      var itwdf = Math.sin(2 * Math.PI / l);

      for (var p = 0; p < N; p += l) {
        var rtwdf_ = rtwdf;
        var itwdf_ = itwdf;

        for (var j = 0; j < s; j++) {
          var re = rtws[p + j];
          var ie = itws[p + j];

          var ro = rtws[p + j + s];
          var io = itws[p + j + s];

          var rx = rtwdf_ * ro - itwdf_ * io;

          io = rtwdf_ * io + itwdf_ * ro;
          ro = rx;

          rtws[p + j] = re + ro;
          itws[p + j] = ie + io;

          rtws[p + j + s] = re - ro;
          itws[p + j + s] = ie - io;

          /* jshint maxdepth : false */
          if (j !== l) {
            rx = rtwdf * rtwdf_ - itwdf * itwdf_;

            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
            rtwdf_ = rx;
          }
        }
      }
    }
  };

  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {
    var N = Math.max(m, n) | 1;
    var odd = N & 1;
    var i = 0;
    for (N = N / 2 | 0; N; N = N >>> 1) {
      i++;
    }

    return 1 << i + 1 + odd;
  };

  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {
    if (N <= 1) return;

    for (var i = 0; i < N / 2; i++) {
      var t = rws[i];

      rws[i] = rws[N - i - 1];
      rws[N - i - 1] = t;

      t = iws[i];

      iws[i] = -iws[N - i - 1];
      iws[N - i - 1] = -t;
    }
  };

  FFTM.prototype.normalize13b = function normalize13b (ws, N) {
    var carry = 0;
    for (var i = 0; i < N / 2; i++) {
      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +
        Math.round(ws[2 * i] / N) +
        carry;

      ws[i] = w & 0x3ffffff;

      if (w < 0x4000000) {
        carry = 0;
      } else {
        carry = w / 0x4000000 | 0;
      }
    }

    return ws;
  };

  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {
    var carry = 0;
    for (var i = 0; i < len; i++) {
      carry = carry + (ws[i] | 0);

      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;
      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;
    }

    // Pad with zeroes
    for (i = 2 * len; i < N; ++i) {
      rws[i] = 0;
    }

    assert(carry === 0);
    assert((carry & ~0x1fff) === 0);
  };

  FFTM.prototype.stub = function stub (N) {
    var ph = new Array(N);
    for (var i = 0; i < N; i++) {
      ph[i] = 0;
    }

    return ph;
  };

  FFTM.prototype.mulp = function mulp (x, y, out) {
    var N = 2 * this.guessLen13b(x.length, y.length);

    var rbt = this.makeRBT(N);

    var _ = this.stub(N);

    var rws = new Array(N);
    var rwst = new Array(N);
    var iwst = new Array(N);

    var nrws = new Array(N);
    var nrwst = new Array(N);
    var niwst = new Array(N);

    var rmws = out.words;
    rmws.length = N;

    this.convert13b(x.words, x.length, rws, N);
    this.convert13b(y.words, y.length, nrws, N);

    this.transform(rws, _, rwst, iwst, N, rbt);
    this.transform(nrws, _, nrwst, niwst, N, rbt);

    for (var i = 0; i < N; i++) {
      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
      rwst[i] = rx;
    }

    this.conjugate(rwst, iwst, N);
    this.transform(rwst, iwst, rmws, _, N, rbt);
    this.conjugate(rmws, _, N);
    this.normalize13b(rmws, N);

    out.negative = x.negative ^ y.negative;
    out.length = x.length + y.length;
    return out.strip();
  };

  // Multiply `this` by `num`
  BN.prototype.mul = function mul (num) {
    var out = new BN(null);
    out.words = new Array(this.length + num.length);
    return this.mulTo(num, out);
  };

  // Multiply employing FFT
  BN.prototype.mulf = function mulf (num) {
    var out = new BN(null);
    out.words = new Array(this.length + num.length);
    return jumboMulTo(this, num, out);
  };

  // In-place Multiplication
  BN.prototype.imul = function imul (num) {
    return this.clone().mulTo(num, this);
  };

  BN.prototype.imuln = function imuln (num) {
    assert(typeof num === 'number');
    assert(num < 0x4000000);

    // Carry
    var carry = 0;
    for (var i = 0; i < this.length; i++) {
      var w = (this.words[i] | 0) * num;
      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);
      carry >>= 26;
      carry += (w / 0x4000000) | 0;
      // NOTE: lo is 27bit maximum
      carry += lo >>> 26;
      this.words[i] = lo & 0x3ffffff;
    }

    if (carry !== 0) {
      this.words[i] = carry;
      this.length++;
    }

    return this;
  };

  BN.prototype.muln = function muln (num) {
    return this.clone().imuln(num);
  };

  // `this` * `this`
  BN.prototype.sqr = function sqr () {
    return this.mul(this);
  };

  // `this` * `this` in-place
  BN.prototype.isqr = function isqr () {
    return this.imul(this.clone());
  };

  // Math.pow(`this`, `num`)
  BN.prototype.pow = function pow (num) {
    var w = toBitArray(num);
    if (w.length === 0) return new BN(1);

    // Skip leading zeroes
    var res = this;
    for (var i = 0; i < w.length; i++, res = res.sqr()) {
      if (w[i] !== 0) break;
    }

    if (++i < w.length) {
      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
        if (w[i] === 0) continue;

        res = res.mul(q);
      }
    }

    return res;
  };

  // Shift-left in-place
  BN.prototype.iushln = function iushln (bits) {
    assert(typeof bits === 'number' && bits >= 0);
    var r = bits % 26;
    var s = (bits - r) / 26;
    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);
    var i;

    if (r !== 0) {
      var carry = 0;

      for (i = 0; i < this.length; i++) {
        var newCarry = this.words[i] & carryMask;
        var c = ((this.words[i] | 0) - newCarry) << r;
        this.words[i] = c | carry;
        carry = newCarry >>> (26 - r);
      }

      if (carry) {
        this.words[i] = carry;
        this.length++;
      }
    }

    if (s !== 0) {
      for (i = this.length - 1; i >= 0; i--) {
        this.words[i + s] = this.words[i];
      }

      for (i = 0; i < s; i++) {
        this.words[i] = 0;
      }

      this.length += s;
    }

    return this.strip();
  };

  BN.prototype.ishln = function ishln (bits) {
    // TODO(indutny): implement me
    assert(this.negative === 0);
    return this.iushln(bits);
  };

  // Shift-right in-place
  // NOTE: `hint` is a lowest bit before trailing zeroes
  // NOTE: if `extended` is present - it will be filled with destroyed bits
  BN.prototype.iushrn = function iushrn (bits, hint, extended) {
    assert(typeof bits === 'number' && bits >= 0);
    var h;
    if (hint) {
      h = (hint - (hint % 26)) / 26;
    } else {
      h = 0;
    }

    var r = bits % 26;
    var s = Math.min((bits - r) / 26, this.length);
    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
    var maskedWords = extended;

    h -= s;
    h = Math.max(0, h);

    // Extended mode, copy masked part
    if (maskedWords) {
      for (var i = 0; i < s; i++) {
        maskedWords.words[i] = this.words[i];
      }
      maskedWords.length = s;
    }

    if (s === 0) ; else if (this.length > s) {
      this.length -= s;
      for (i = 0; i < this.length; i++) {
        this.words[i] = this.words[i + s];
      }
    } else {
      this.words[0] = 0;
      this.length = 1;
    }

    var carry = 0;
    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
      var word = this.words[i] | 0;
      this.words[i] = (carry << (26 - r)) | (word >>> r);
      carry = word & mask;
    }

    // Push carried bits as a mask
    if (maskedWords && carry !== 0) {
      maskedWords.words[maskedWords.length++] = carry;
    }

    if (this.length === 0) {
      this.words[0] = 0;
      this.length = 1;
    }

    return this.strip();
  };

  BN.prototype.ishrn = function ishrn (bits, hint, extended) {
    // TODO(indutny): implement me
    assert(this.negative === 0);
    return this.iushrn(bits, hint, extended);
  };

  // Shift-left
  BN.prototype.shln = function shln (bits) {
    return this.clone().ishln(bits);
  };

  BN.prototype.ushln = function ushln (bits) {
    return this.clone().iushln(bits);
  };

  // Shift-right
  BN.prototype.shrn = function shrn (bits) {
    return this.clone().ishrn(bits);
  };

  BN.prototype.ushrn = function ushrn (bits) {
    return this.clone().iushrn(bits);
  };

  // Test if n bit is set
  BN.prototype.testn = function testn (bit) {
    assert(typeof bit === 'number' && bit >= 0);
    var r = bit % 26;
    var s = (bit - r) / 26;
    var q = 1 << r;

    // Fast case: bit is much higher than all existing words
    if (this.length <= s) return false;

    // Check bit and return
    var w = this.words[s];

    return !!(w & q);
  };

  // Return only lowers bits of number (in-place)
  BN.prototype.imaskn = function imaskn (bits) {
    assert(typeof bits === 'number' && bits >= 0);
    var r = bits % 26;
    var s = (bits - r) / 26;

    assert(this.negative === 0, 'imaskn works only with positive numbers');

    if (this.length <= s) {
      return this;
    }

    if (r !== 0) {
      s++;
    }
    this.length = Math.min(s, this.length);

    if (r !== 0) {
      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);
      this.words[this.length - 1] &= mask;
    }

    return this.strip();
  };

  // Return only lowers bits of number
  BN.prototype.maskn = function maskn (bits) {
    return this.clone().imaskn(bits);
  };

  // Add plain number `num` to `this`
  BN.prototype.iaddn = function iaddn (num) {
    assert(typeof num === 'number');
    assert(num < 0x4000000);
    if (num < 0) return this.isubn(-num);

    // Possible sign change
    if (this.negative !== 0) {
      if (this.length === 1 && (this.words[0] | 0) < num) {
        this.words[0] = num - (this.words[0] | 0);
        this.negative = 0;
        return this;
      }

      this.negative = 0;
      this.isubn(num);
      this.negative = 1;
      return this;
    }

    // Add without checks
    return this._iaddn(num);
  };

  BN.prototype._iaddn = function _iaddn (num) {
    this.words[0] += num;

    // Carry
    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {
      this.words[i] -= 0x4000000;
      if (i === this.length - 1) {
        this.words[i + 1] = 1;
      } else {
        this.words[i + 1]++;
      }
    }
    this.length = Math.max(this.length, i + 1);

    return this;
  };

  // Subtract plain number `num` from `this`
  BN.prototype.isubn = function isubn (num) {
    assert(typeof num === 'number');
    assert(num < 0x4000000);
    if (num < 0) return this.iaddn(-num);

    if (this.negative !== 0) {
      this.negative = 0;
      this.iaddn(num);
      this.negative = 1;
      return this;
    }

    this.words[0] -= num;

    if (this.length === 1 && this.words[0] < 0) {
      this.words[0] = -this.words[0];
      this.negative = 1;
    } else {
      // Carry
      for (var i = 0; i < this.length && this.words[i] < 0; i++) {
        this.words[i] += 0x4000000;
        this.words[i + 1] -= 1;
      }
    }

    return this.strip();
  };

  BN.prototype.addn = function addn (num) {
    return this.clone().iaddn(num);
  };

  BN.prototype.subn = function subn (num) {
    return this.clone().isubn(num);
  };

  BN.prototype.iabs = function iabs () {
    this.negative = 0;

    return this;
  };

  BN.prototype.abs = function abs () {
    return this.clone().iabs();
  };

  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {
    var len = num.length + shift;
    var i;

    this._expand(len);

    var w;
    var carry = 0;
    for (i = 0; i < num.length; i++) {
      w = (this.words[i + shift] | 0) + carry;
      var right = (num.words[i] | 0) * mul;
      w -= right & 0x3ffffff;
      carry = (w >> 26) - ((right / 0x4000000) | 0);
      this.words[i + shift] = w & 0x3ffffff;
    }
    for (; i < this.length - shift; i++) {
      w = (this.words[i + shift] | 0) + carry;
      carry = w >> 26;
      this.words[i + shift] = w & 0x3ffffff;
    }

    if (carry === 0) return this.strip();

    // Subtraction overflow
    assert(carry === -1);
    carry = 0;
    for (i = 0; i < this.length; i++) {
      w = -(this.words[i] | 0) + carry;
      carry = w >> 26;
      this.words[i] = w & 0x3ffffff;
    }
    this.negative = 1;

    return this.strip();
  };

  BN.prototype._wordDiv = function _wordDiv (num, mode) {
    var shift = this.length - num.length;

    var a = this.clone();
    var b = num;

    // Normalize
    var bhi = b.words[b.length - 1] | 0;
    var bhiBits = this._countBits(bhi);
    shift = 26 - bhiBits;
    if (shift !== 0) {
      b = b.ushln(shift);
      a.iushln(shift);
      bhi = b.words[b.length - 1] | 0;
    }

    // Initialize quotient
    var m = a.length - b.length;
    var q;

    if (mode !== 'mod') {
      q = new BN(null);
      q.length = m + 1;
      q.words = new Array(q.length);
      for (var i = 0; i < q.length; i++) {
        q.words[i] = 0;
      }
    }

    var diff = a.clone()._ishlnsubmul(b, 1, m);
    if (diff.negative === 0) {
      a = diff;
      if (q) {
        q.words[m] = 1;
      }
    }

    for (var j = m - 1; j >= 0; j--) {
      var qj = (a.words[b.length + j] | 0) * 0x4000000 +
        (a.words[b.length + j - 1] | 0);

      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max
      // (0x7ffffff)
      qj = Math.min((qj / bhi) | 0, 0x3ffffff);

      a._ishlnsubmul(b, qj, j);
      while (a.negative !== 0) {
        qj--;
        a.negative = 0;
        a._ishlnsubmul(b, 1, j);
        if (!a.isZero()) {
          a.negative ^= 1;
        }
      }
      if (q) {
        q.words[j] = qj;
      }
    }
    if (q) {
      q.strip();
    }
    a.strip();

    // Denormalize
    if (mode !== 'div' && shift !== 0) {
      a.iushrn(shift);
    }

    return {
      div: q || null,
      mod: a
    };
  };

  // NOTE: 1) `mode` can be set to `mod` to request mod only,
  //       to `div` to request div only, or be absent to
  //       request both div & mod
  //       2) `positive` is true if unsigned mod is requested
  BN.prototype.divmod = function divmod (num, mode, positive) {
    assert(!num.isZero());

    if (this.isZero()) {
      return {
        div: new BN(0),
        mod: new BN(0)
      };
    }

    var div, mod, res;
    if (this.negative !== 0 && num.negative === 0) {
      res = this.neg().divmod(num, mode);

      if (mode !== 'mod') {
        div = res.div.neg();
      }

      if (mode !== 'div') {
        mod = res.mod.neg();
        if (positive && mod.negative !== 0) {
          mod.iadd(num);
        }
      }

      return {
        div: div,
        mod: mod
      };
    }

    if (this.negative === 0 && num.negative !== 0) {
      res = this.divmod(num.neg(), mode);

      if (mode !== 'mod') {
        div = res.div.neg();
      }

      return {
        div: div,
        mod: res.mod
      };
    }

    if ((this.negative & num.negative) !== 0) {
      res = this.neg().divmod(num.neg(), mode);

      if (mode !== 'div') {
        mod = res.mod.neg();
        if (positive && mod.negative !== 0) {
          mod.isub(num);
        }
      }

      return {
        div: res.div,
        mod: mod
      };
    }

    // Both numbers are positive at this point

    // Strip both numbers to approximate shift value
    if (num.length > this.length || this.cmp(num) < 0) {
      return {
        div: new BN(0),
        mod: this
      };
    }

    // Very short reduction
    if (num.length === 1) {
      if (mode === 'div') {
        return {
          div: this.divn(num.words[0]),
          mod: null
        };
      }

      if (mode === 'mod') {
        return {
          div: null,
          mod: new BN(this.modn(num.words[0]))
        };
      }

      return {
        div: this.divn(num.words[0]),
        mod: new BN(this.modn(num.words[0]))
      };
    }

    return this._wordDiv(num, mode);
  };

  // Find `this` / `num`
  BN.prototype.div = function div (num) {
    return this.divmod(num, 'div', false).div;
  };

  // Find `this` % `num`
  BN.prototype.mod = function mod (num) {
    return this.divmod(num, 'mod', false).mod;
  };

  BN.prototype.umod = function umod (num) {
    return this.divmod(num, 'mod', true).mod;
  };

  // Find Round(`this` / `num`)
  BN.prototype.divRound = function divRound (num) {
    var dm = this.divmod(num);

    // Fast case - exact division
    if (dm.mod.isZero()) return dm.div;

    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;

    var half = num.ushrn(1);
    var r2 = num.andln(1);
    var cmp = mod.cmp(half);

    // Round down
    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;

    // Round up
    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
  };

  BN.prototype.modn = function modn (num) {
    assert(num <= 0x3ffffff);
    var p = (1 << 26) % num;

    var acc = 0;
    for (var i = this.length - 1; i >= 0; i--) {
      acc = (p * acc + (this.words[i] | 0)) % num;
    }

    return acc;
  };

  // In-place division by number
  BN.prototype.idivn = function idivn (num) {
    assert(num <= 0x3ffffff);

    var carry = 0;
    for (var i = this.length - 1; i >= 0; i--) {
      var w = (this.words[i] | 0) + carry * 0x4000000;
      this.words[i] = (w / num) | 0;
      carry = w % num;
    }

    return this.strip();
  };

  BN.prototype.divn = function divn (num) {
    return this.clone().idivn(num);
  };

  BN.prototype.egcd = function egcd (p) {
    assert(p.negative === 0);
    assert(!p.isZero());

    var x = this;
    var y = p.clone();

    if (x.negative !== 0) {
      x = x.umod(p);
    } else {
      x = x.clone();
    }

    // A * x + B * y = x
    var A = new BN(1);
    var B = new BN(0);

    // C * x + D * y = y
    var C = new BN(0);
    var D = new BN(1);

    var g = 0;

    while (x.isEven() && y.isEven()) {
      x.iushrn(1);
      y.iushrn(1);
      ++g;
    }

    var yp = y.clone();
    var xp = x.clone();

    while (!x.isZero()) {
      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
      if (i > 0) {
        x.iushrn(i);
        while (i-- > 0) {
          if (A.isOdd() || B.isOdd()) {
            A.iadd(yp);
            B.isub(xp);
          }

          A.iushrn(1);
          B.iushrn(1);
        }
      }

      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
      if (j > 0) {
        y.iushrn(j);
        while (j-- > 0) {
          if (C.isOdd() || D.isOdd()) {
            C.iadd(yp);
            D.isub(xp);
          }

          C.iushrn(1);
          D.iushrn(1);
        }
      }

      if (x.cmp(y) >= 0) {
        x.isub(y);
        A.isub(C);
        B.isub(D);
      } else {
        y.isub(x);
        C.isub(A);
        D.isub(B);
      }
    }

    return {
      a: C,
      b: D,
      gcd: y.iushln(g)
    };
  };

  // This is reduced incarnation of the binary EEA
  // above, designated to invert members of the
  // _prime_ fields F(p) at a maximal speed
  BN.prototype._invmp = function _invmp (p) {
    assert(p.negative === 0);
    assert(!p.isZero());

    var a = this;
    var b = p.clone();

    if (a.negative !== 0) {
      a = a.umod(p);
    } else {
      a = a.clone();
    }

    var x1 = new BN(1);
    var x2 = new BN(0);

    var delta = b.clone();

    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
      if (i > 0) {
        a.iushrn(i);
        while (i-- > 0) {
          if (x1.isOdd()) {
            x1.iadd(delta);
          }

          x1.iushrn(1);
        }
      }

      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
      if (j > 0) {
        b.iushrn(j);
        while (j-- > 0) {
          if (x2.isOdd()) {
            x2.iadd(delta);
          }

          x2.iushrn(1);
        }
      }

      if (a.cmp(b) >= 0) {
        a.isub(b);
        x1.isub(x2);
      } else {
        b.isub(a);
        x2.isub(x1);
      }
    }

    var res;
    if (a.cmpn(1) === 0) {
      res = x1;
    } else {
      res = x2;
    }

    if (res.cmpn(0) < 0) {
      res.iadd(p);
    }

    return res;
  };

  BN.prototype.gcd = function gcd (num) {
    if (this.isZero()) return num.abs();
    if (num.isZero()) return this.abs();

    var a = this.clone();
    var b = num.clone();
    a.negative = 0;
    b.negative = 0;

    // Remove common factor of two
    for (var shift = 0; a.isEven() && b.isEven(); shift++) {
      a.iushrn(1);
      b.iushrn(1);
    }

    do {
      while (a.isEven()) {
        a.iushrn(1);
      }
      while (b.isEven()) {
        b.iushrn(1);
      }

      var r = a.cmp(b);
      if (r < 0) {
        // Swap `a` and `b` to make `a` always bigger than `b`
        var t = a;
        a = b;
        b = t;
      } else if (r === 0 || b.cmpn(1) === 0) {
        break;
      }

      a.isub(b);
    } while (true);

    return b.iushln(shift);
  };

  // Invert number in the field F(num)
  BN.prototype.invm = function invm (num) {
    return this.egcd(num).a.umod(num);
  };

  BN.prototype.isEven = function isEven () {
    return (this.words[0] & 1) === 0;
  };

  BN.prototype.isOdd = function isOdd () {
    return (this.words[0] & 1) === 1;
  };

  // And first word and num
  BN.prototype.andln = function andln (num) {
    return this.words[0] & num;
  };

  // Increment at the bit position in-line
  BN.prototype.bincn = function bincn (bit) {
    assert(typeof bit === 'number');
    var r = bit % 26;
    var s = (bit - r) / 26;
    var q = 1 << r;

    // Fast case: bit is much higher than all existing words
    if (this.length <= s) {
      this._expand(s + 1);
      this.words[s] |= q;
      return this;
    }

    // Add bit and propagate, if needed
    var carry = q;
    for (var i = s; carry !== 0 && i < this.length; i++) {
      var w = this.words[i] | 0;
      w += carry;
      carry = w >>> 26;
      w &= 0x3ffffff;
      this.words[i] = w;
    }
    if (carry !== 0) {
      this.words[i] = carry;
      this.length++;
    }
    return this;
  };

  BN.prototype.isZero = function isZero () {
    return this.length === 1 && this.words[0] === 0;
  };

  BN.prototype.cmpn = function cmpn (num) {
    var negative = num < 0;

    if (this.negative !== 0 && !negative) return -1;
    if (this.negative === 0 && negative) return 1;

    this.strip();

    var res;
    if (this.length > 1) {
      res = 1;
    } else {
      if (negative) {
        num = -num;
      }

      assert(num <= 0x3ffffff, 'Number is too big');

      var w = this.words[0] | 0;
      res = w === num ? 0 : w < num ? -1 : 1;
    }
    if (this.negative !== 0) return -res | 0;
    return res;
  };

  // Compare two numbers and return:
  // 1 - if `this` > `num`
  // 0 - if `this` == `num`
  // -1 - if `this` < `num`
  BN.prototype.cmp = function cmp (num) {
    if (this.negative !== 0 && num.negative === 0) return -1;
    if (this.negative === 0 && num.negative !== 0) return 1;

    var res = this.ucmp(num);
    if (this.negative !== 0) return -res | 0;
    return res;
  };

  // Unsigned comparison
  BN.prototype.ucmp = function ucmp (num) {
    // At this point both numbers have the same sign
    if (this.length > num.length) return 1;
    if (this.length < num.length) return -1;

    var res = 0;
    for (var i = this.length - 1; i >= 0; i--) {
      var a = this.words[i] | 0;
      var b = num.words[i] | 0;

      if (a === b) continue;
      if (a < b) {
        res = -1;
      } else if (a > b) {
        res = 1;
      }
      break;
    }
    return res;
  };

  BN.prototype.gtn = function gtn (num) {
    return this.cmpn(num) === 1;
  };

  BN.prototype.gt = function gt (num) {
    return this.cmp(num) === 1;
  };

  BN.prototype.gten = function gten (num) {
    return this.cmpn(num) >= 0;
  };

  BN.prototype.gte = function gte (num) {
    return this.cmp(num) >= 0;
  };

  BN.prototype.ltn = function ltn (num) {
    return this.cmpn(num) === -1;
  };

  BN.prototype.lt = function lt (num) {
    return this.cmp(num) === -1;
  };

  BN.prototype.lten = function lten (num) {
    return this.cmpn(num) <= 0;
  };

  BN.prototype.lte = function lte (num) {
    return this.cmp(num) <= 0;
  };

  BN.prototype.eqn = function eqn (num) {
    return this.cmpn(num) === 0;
  };

  BN.prototype.eq = function eq (num) {
    return this.cmp(num) === 0;
  };

  //
  // A reduce context, could be using montgomery or something better, depending
  // on the `m` itself.
  //
  BN.red = function red (num) {
    return new Red(num);
  };

  BN.prototype.toRed = function toRed (ctx) {
    assert(!this.red, 'Already a number in reduction context');
    assert(this.negative === 0, 'red works only with positives');
    return ctx.convertTo(this)._forceRed(ctx);
  };

  BN.prototype.fromRed = function fromRed () {
    assert(this.red, 'fromRed works only with numbers in reduction context');
    return this.red.convertFrom(this);
  };

  BN.prototype._forceRed = function _forceRed (ctx) {
    this.red = ctx;
    return this;
  };

  BN.prototype.forceRed = function forceRed (ctx) {
    assert(!this.red, 'Already a number in reduction context');
    return this._forceRed(ctx);
  };

  BN.prototype.redAdd = function redAdd (num) {
    assert(this.red, 'redAdd works only with red numbers');
    return this.red.add(this, num);
  };

  BN.prototype.redIAdd = function redIAdd (num) {
    assert(this.red, 'redIAdd works only with red numbers');
    return this.red.iadd(this, num);
  };

  BN.prototype.redSub = function redSub (num) {
    assert(this.red, 'redSub works only with red numbers');
    return this.red.sub(this, num);
  };

  BN.prototype.redISub = function redISub (num) {
    assert(this.red, 'redISub works only with red numbers');
    return this.red.isub(this, num);
  };

  BN.prototype.redShl = function redShl (num) {
    assert(this.red, 'redShl works only with red numbers');
    return this.red.shl(this, num);
  };

  BN.prototype.redMul = function redMul (num) {
    assert(this.red, 'redMul works only with red numbers');
    this.red._verify2(this, num);
    return this.red.mul(this, num);
  };

  BN.prototype.redIMul = function redIMul (num) {
    assert(this.red, 'redMul works only with red numbers');
    this.red._verify2(this, num);
    return this.red.imul(this, num);
  };

  BN.prototype.redSqr = function redSqr () {
    assert(this.red, 'redSqr works only with red numbers');
    this.red._verify1(this);
    return this.red.sqr(this);
  };

  BN.prototype.redISqr = function redISqr () {
    assert(this.red, 'redISqr works only with red numbers');
    this.red._verify1(this);
    return this.red.isqr(this);
  };

  // Square root over p
  BN.prototype.redSqrt = function redSqrt () {
    assert(this.red, 'redSqrt works only with red numbers');
    this.red._verify1(this);
    return this.red.sqrt(this);
  };

  BN.prototype.redInvm = function redInvm () {
    assert(this.red, 'redInvm works only with red numbers');
    this.red._verify1(this);
    return this.red.invm(this);
  };

  // Return negative clone of `this` % `red modulo`
  BN.prototype.redNeg = function redNeg () {
    assert(this.red, 'redNeg works only with red numbers');
    this.red._verify1(this);
    return this.red.neg(this);
  };

  BN.prototype.redPow = function redPow (num) {
    assert(this.red && !num.red, 'redPow(normalNum)');
    this.red._verify1(this);
    return this.red.pow(this, num);
  };

  // Prime numbers with efficient reduction
  var primes = {
    k256: null,
    p224: null,
    p192: null,
    p25519: null
  };

  // Pseudo-Mersenne prime
  function MPrime (name, p) {
    // P = 2 ^ N - K
    this.name = name;
    this.p = new BN(p, 16);
    this.n = this.p.bitLength();
    this.k = new BN(1).iushln(this.n).isub(this.p);

    this.tmp = this._tmp();
  }

  MPrime.prototype._tmp = function _tmp () {
    var tmp = new BN(null);
    tmp.words = new Array(Math.ceil(this.n / 13));
    return tmp;
  };

  MPrime.prototype.ireduce = function ireduce (num) {
    // Assumes that `num` is less than `P^2`
    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)
    var r = num;
    var rlen;

    do {
      this.split(r, this.tmp);
      r = this.imulK(r);
      r = r.iadd(this.tmp);
      rlen = r.bitLength();
    } while (rlen > this.n);

    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
    if (cmp === 0) {
      r.words[0] = 0;
      r.length = 1;
    } else if (cmp > 0) {
      r.isub(this.p);
    } else {
      r.strip();
    }

    return r;
  };

  MPrime.prototype.split = function split (input, out) {
    input.iushrn(this.n, 0, out);
  };

  MPrime.prototype.imulK = function imulK (num) {
    return num.imul(this.k);
  };

  function K256 () {
    MPrime.call(
      this,
      'k256',
      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');
  }
  inherits(K256, MPrime);

  K256.prototype.split = function split (input, output) {
    // 256 = 9 * 26 + 22
    var mask = 0x3fffff;

    var outLen = Math.min(input.length, 9);
    for (var i = 0; i < outLen; i++) {
      output.words[i] = input.words[i];
    }
    output.length = outLen;

    if (input.length <= 9) {
      input.words[0] = 0;
      input.length = 1;
      return;
    }

    // Shift by 9 limbs
    var prev = input.words[9];
    output.words[output.length++] = prev & mask;

    for (i = 10; i < input.length; i++) {
      var next = input.words[i] | 0;
      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);
      prev = next;
    }
    prev >>>= 22;
    input.words[i - 10] = prev;
    if (prev === 0 && input.length > 10) {
      input.length -= 10;
    } else {
      input.length -= 9;
    }
  };

  K256.prototype.imulK = function imulK (num) {
    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]
    num.words[num.length] = 0;
    num.words[num.length + 1] = 0;
    num.length += 2;

    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390
    var lo = 0;
    for (var i = 0; i < num.length; i++) {
      var w = num.words[i] | 0;
      lo += w * 0x3d1;
      num.words[i] = lo & 0x3ffffff;
      lo = w * 0x40 + ((lo / 0x4000000) | 0);
    }

    // Fast length reduction
    if (num.words[num.length - 1] === 0) {
      num.length--;
      if (num.words[num.length - 1] === 0) {
        num.length--;
      }
    }
    return num;
  };

  function P224 () {
    MPrime.call(
      this,
      'p224',
      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');
  }
  inherits(P224, MPrime);

  function P192 () {
    MPrime.call(
      this,
      'p192',
      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');
  }
  inherits(P192, MPrime);

  function P25519 () {
    // 2 ^ 255 - 19
    MPrime.call(
      this,
      '25519',
      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');
  }
  inherits(P25519, MPrime);

  P25519.prototype.imulK = function imulK (num) {
    // K = 0x13
    var carry = 0;
    for (var i = 0; i < num.length; i++) {
      var hi = (num.words[i] | 0) * 0x13 + carry;
      var lo = hi & 0x3ffffff;
      hi >>>= 26;

      num.words[i] = lo;
      carry = hi;
    }
    if (carry !== 0) {
      num.words[num.length++] = carry;
    }
    return num;
  };

  // Exported mostly for testing purposes, use plain name instead
  BN._prime = function prime (name) {
    // Cached version of prime
    if (primes[name]) return primes[name];

    var prime;
    if (name === 'k256') {
      prime = new K256();
    } else if (name === 'p224') {
      prime = new P224();
    } else if (name === 'p192') {
      prime = new P192();
    } else if (name === 'p25519') {
      prime = new P25519();
    } else {
      throw new Error('Unknown prime ' + name);
    }
    primes[name] = prime;

    return prime;
  };

  //
  // Base reduction engine
  //
  function Red (m) {
    if (typeof m === 'string') {
      var prime = BN._prime(m);
      this.m = prime.p;
      this.prime = prime;
    } else {
      assert(m.gtn(1), 'modulus must be greater than 1');
      this.m = m;
      this.prime = null;
    }
  }

  Red.prototype._verify1 = function _verify1 (a) {
    assert(a.negative === 0, 'red works only with positives');
    assert(a.red, 'red works only with red numbers');
  };

  Red.prototype._verify2 = function _verify2 (a, b) {
    assert((a.negative | b.negative) === 0, 'red works only with positives');
    assert(a.red && a.red === b.red,
      'red works only with red numbers');
  };

  Red.prototype.imod = function imod (a) {
    if (this.prime) return this.prime.ireduce(a)._forceRed(this);
    return a.umod(this.m)._forceRed(this);
  };

  Red.prototype.neg = function neg (a) {
    if (a.isZero()) {
      return a.clone();
    }

    return this.m.sub(a)._forceRed(this);
  };

  Red.prototype.add = function add (a, b) {
    this._verify2(a, b);

    var res = a.add(b);
    if (res.cmp(this.m) >= 0) {
      res.isub(this.m);
    }
    return res._forceRed(this);
  };

  Red.prototype.iadd = function iadd (a, b) {
    this._verify2(a, b);

    var res = a.iadd(b);
    if (res.cmp(this.m) >= 0) {
      res.isub(this.m);
    }
    return res;
  };

  Red.prototype.sub = function sub (a, b) {
    this._verify2(a, b);

    var res = a.sub(b);
    if (res.cmpn(0) < 0) {
      res.iadd(this.m);
    }
    return res._forceRed(this);
  };

  Red.prototype.isub = function isub (a, b) {
    this._verify2(a, b);

    var res = a.isub(b);
    if (res.cmpn(0) < 0) {
      res.iadd(this.m);
    }
    return res;
  };

  Red.prototype.shl = function shl (a, num) {
    this._verify1(a);
    return this.imod(a.ushln(num));
  };

  Red.prototype.imul = function imul (a, b) {
    this._verify2(a, b);
    return this.imod(a.imul(b));
  };

  Red.prototype.mul = function mul (a, b) {
    this._verify2(a, b);
    return this.imod(a.mul(b));
  };

  Red.prototype.isqr = function isqr (a) {
    return this.imul(a, a.clone());
  };

  Red.prototype.sqr = function sqr (a) {
    return this.mul(a, a);
  };

  Red.prototype.sqrt = function sqrt (a) {
    if (a.isZero()) return a.clone();

    var mod3 = this.m.andln(3);
    assert(mod3 % 2 === 1);

    // Fast case
    if (mod3 === 3) {
      var pow = this.m.add(new BN(1)).iushrn(2);
      return this.pow(a, pow);
    }

    // Tonelli-Shanks algorithm (Totally unoptimized and slow)
    //
    // Find Q and S, that Q * 2 ^ S = (P - 1)
    var q = this.m.subn(1);
    var s = 0;
    while (!q.isZero() && q.andln(1) === 0) {
      s++;
      q.iushrn(1);
    }
    assert(!q.isZero());

    var one = new BN(1).toRed(this);
    var nOne = one.redNeg();

    // Find quadratic non-residue
    // NOTE: Max is such because of generalized Riemann hypothesis.
    var lpow = this.m.subn(1).iushrn(1);
    var z = this.m.bitLength();
    z = new BN(2 * z * z).toRed(this);

    while (this.pow(z, lpow).cmp(nOne) !== 0) {
      z.redIAdd(nOne);
    }

    var c = this.pow(z, q);
    var r = this.pow(a, q.addn(1).iushrn(1));
    var t = this.pow(a, q);
    var m = s;
    while (t.cmp(one) !== 0) {
      var tmp = t;
      for (var i = 0; tmp.cmp(one) !== 0; i++) {
        tmp = tmp.redSqr();
      }
      assert(i < m);
      var b = this.pow(c, new BN(1).iushln(m - i - 1));

      r = r.redMul(b);
      c = b.redSqr();
      t = t.redMul(c);
      m = i;
    }

    return r;
  };

  Red.prototype.invm = function invm (a) {
    var inv = a._invmp(this.m);
    if (inv.negative !== 0) {
      inv.negative = 0;
      return this.imod(inv).redNeg();
    } else {
      return this.imod(inv);
    }
  };

  Red.prototype.pow = function pow (a, num) {
    if (num.isZero()) return new BN(1).toRed(this);
    if (num.cmpn(1) === 0) return a.clone();

    var windowSize = 4;
    var wnd = new Array(1 << windowSize);
    wnd[0] = new BN(1).toRed(this);
    wnd[1] = a;
    for (var i = 2; i < wnd.length; i++) {
      wnd[i] = this.mul(wnd[i - 1], a);
    }

    var res = wnd[0];
    var current = 0;
    var currentLen = 0;
    var start = num.bitLength() % 26;
    if (start === 0) {
      start = 26;
    }

    for (i = num.length - 1; i >= 0; i--) {
      var word = num.words[i];
      for (var j = start - 1; j >= 0; j--) {
        var bit = (word >> j) & 1;
        if (res !== wnd[0]) {
          res = this.sqr(res);
        }

        if (bit === 0 && current === 0) {
          currentLen = 0;
          continue;
        }

        current <<= 1;
        current |= bit;
        currentLen++;
        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;

        res = this.mul(res, wnd[current]);
        currentLen = 0;
        current = 0;
      }
      start = 26;
    }

    return res;
  };

  Red.prototype.convertTo = function convertTo (num) {
    var r = num.umod(this.m);

    return r === num ? r.clone() : r;
  };

  Red.prototype.convertFrom = function convertFrom (num) {
    var res = num.clone();
    res.red = null;
    return res;
  };

  //
  // Montgomery method engine
  //

  BN.mont = function mont (num) {
    return new Mont(num);
  };

  function Mont (m) {
    Red.call(this, m);

    this.shift = this.m.bitLength();
    if (this.shift % 26 !== 0) {
      this.shift += 26 - (this.shift % 26);
    }

    this.r = new BN(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);
  }
  inherits(Mont, Red);

  Mont.prototype.convertTo = function convertTo (num) {
    return this.imod(num.ushln(this.shift));
  };

  Mont.prototype.convertFrom = function convertFrom (num) {
    var r = this.imod(num.mul(this.rinv));
    r.red = null;
    return r;
  };

  Mont.prototype.imul = function imul (a, b) {
    if (a.isZero() || b.isZero()) {
      a.words[0] = 0;
      a.length = 1;
      return a;
    }

    var t = a.imul(b);
    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
    var u = t.isub(c).iushrn(this.shift);
    var res = u;

    if (u.cmp(this.m) >= 0) {
      res = u.isub(this.m);
    } else if (u.cmpn(0) < 0) {
      res = u.iadd(this.m);
    }

    return res._forceRed(this);
  };

  Mont.prototype.mul = function mul (a, b) {
    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);

    var t = a.mul(b);
    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
    var u = t.isub(c).iushrn(this.shift);
    var res = u;
    if (u.cmp(this.m) >= 0) {
      res = u.isub(this.m);
    } else if (u.cmpn(0) < 0) {
      res = u.iadd(this.m);
    }

    return res._forceRed(this);
  };

  Mont.prototype.invm = function invm (a) {
    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R
    var res = this.imod(a._invmp(this.m).mul(this.r2));
    return res._forceRed(this);
  };
})(module, commonjsGlobal);
});

export default bn;
export { bn as __moduleExports };
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   /*! OpenPGP.js v5.11.2 - 2024-06-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;import{c as e,m as f,i as d,u as t,b as a,d as c,_ as r,e as b,f as i,g as n,r as s}from"./openpgp.min.mjs";import o from"./bn.min.mjs";var h,u=e((function(e,f){var d=f;function t(e){return 1===e.length?"0"+e:e}function a(e){for(var f="",d=0;d<e.length;d++)f+=t(e[d].toString(16));return f}d.toArray=function(e,f){if(Array.isArray(e))return e.slice();if(!e)return[];var d=[];if("string"!=typeof e){for(var t=0;t<e.length;t++)d[t]=0|e[t];return d}if("hex"===f){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(t=0;t<e.length;t+=2)d.push(parseInt(e[t]+e[t+1],16))}else for(t=0;t<e.length;t++){var a=e.charCodeAt(t),c=a>>8,r=255&a;c?d.push(c,r):d.push(r)}return d},d.zero2=t,d.toHex=a,d.encode=function(e,f){return"hex"===f?a(e):e}})),p=e((function(e,d){var t=d;t.assert=f,t.toArray=u.toArray,t.zero2=u.zero2,t.toHex=u.toHex,t.encode=u.encode,t.getNAF=function(e,f){for(var d=[],t=1<<f+1,a=e.clone();a.cmpn(1)>=0;){var c;if(a.isOdd()){var r=a.andln(t-1);c=r>(t>>1)-1?(t>>1)-r:r,a.isubn(c)}else c=0;d.push(c);for(var b=0!==a.cmpn(0)&&0===a.andln(t-1)?f+1:1,i=1;i<b;i++)d.push(0);a.iushrn(b)}return d},t.getJSF=function(e,f){var d=[[],[]];e=e.clone(),f=f.clone();for(var t=0,a=0;e.cmpn(-t)>0||f.cmpn(-a)>0;){var c,r,b,i=e.andln(3)+t&3,n=f.andln(3)+a&3;if(3===i&&(i=-1),3===n&&(n=-1),0==(1&i))c=0;else c=3!==(b=e.andln(7)+t&7)&&5!==b||2!==n?i:-i;if(d[0].push(c),0==(1&n))r=0;else r=3!==(b=f.andln(7)+a&7)&&5!==b||2!==i?n:-n;d[1].push(r),2*t===c+1&&(t=1-t),2*a===r+1&&(a=1-a),e.iushrn(1),f.iushrn(1)}return d},t.cachedProperty=function(e,f,d){var t="_"+f;e.prototype[f]=function(){return void 0!==this[t]?this[t]:this[t]=d.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new o(e,"hex","le")}})),l=function(e){return h||(h=new y(null)),h.generate(e)};function y(e){this.rand=e}var v=y;if(y.prototype.generate=function(e){return this._rand(e)},y.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var f=new Uint8Array(e),d=0;d<f.length;d++)f[d]=this.rand.getByte();return f},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?y.prototype._rand=function(e){var f=new Uint8Array(e);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?y.prototype._rand=function(e){var f=new Uint8Array(e);return self.msCrypto.getRandomValues(f),f}:"object"==typeof window&&(y.prototype._rand=function(){throw Error("Not implemented yet")});else try{var m=void 0;if("function"!=typeof m.randomBytes)throw Error("Not supported");y.prototype._rand=function(e){return m.randomBytes(e)}}catch(e){}l.Rand=v;var A=p.getNAF,g=p.getJSF,S=p.assert;function w(e,f){this.type=e,this.p=new o(f.p,16),this.red=f.prime?o.red(f.prime):o.mont(this.p),this.zero=new o(0).toRed(this.red),this.one=new o(1).toRed(this.red),this.two=new o(2).toRed(this.red),this.n=f.n&&new o(f.n,16),this.g=f.g&&this.pointFromJSON(f.g,f.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,];var d=this.n&&this.p.div(this.n);!d||d.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var I=w;function E(e,f){this.curve=e,this.type=f,this.precomputed=null}w.prototype.point=function(){throw Error("Not implemented")},w.prototype.validate=function(){throw Error("Not implemented")},w.prototype._fixedNafMul=function(e,f){S(e.precomputed);var d=e._getDoubles(),t=A(f,1),a=(1<<d.step+1)-(d.step%2==0?2:1);a/=3;for(var c=[],r=0;r<t.length;r+=d.step){var b=0;for(f=r+d.step-1;f>=r;f--)b=(b<<1)+t[f];c.push(b)}for(var i=this.jpoint(null,null,null),n=this.jpoint(null,null,null),s=a;s>0;s--){for(r=0;r<c.length;r++){(b=c[r])===s?n=n.mixedAdd(d.points[r]):b===-s&&(n=n.mixedAdd(d.points[r].neg()))}i=i.add(n)}return i.toP()},w.prototype._wnafMul=function(e,f){var d=4,t=e._getNAFPoints(d);d=t.wnd;for(var a=t.points,c=A(f,d),r=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(f=0;b>=0&&0===c[b];b--)f++;if(b>=0&&f++,r=r.dblp(f),b<0)break;var i=c[b];S(0!==i),r="affine"===e.type?i>0?r.mixedAdd(a[i-1>>1]):r.mixedAdd(a[-i-1>>1].neg()):i>0?r.add(a[i-1>>1]):r.add(a[-i-1>>1].neg())}return"affine"===e.type?r.toP():r},w.prototype._wnafMulAdd=function(e,f,d,t,a){for(var c=this._wnafT1,r=this._wnafT2,b=this._wnafT3,i=0,n=0;n<t;n++){var s=(x=f[n])._getNAFPoints(e);c[n]=s.wnd,r[n]=s.points}for(n=t-1;n>=1;n-=2){var o=n-1,h=n;if(1===c[o]&&1===c[h]){var u=[f[o],null,null,f[h]];0===f[o].y.cmp(f[h].y)?(u[1]=f[o].add(f[h]),u[2]=f[o].toJ().mixedAdd(f[h].neg())):0===f[o].y.cmp(f[h].y.redNeg())?(u[1]=f[o].toJ().mixedAdd(f[h]),u[2]=f[o].add(f[h].neg())):(u[1]=f[o].toJ().mixedAdd(f[h]),u[2]=f[o].toJ().mixedAdd(f[h].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],l=g(d[o],d[h]);i=Math.max(l[0].length,i),b[o]=Array(i),b[h]=Array(i);for(var y=0;y<i;y++){var v=0|l[0][y],m=0|l[1][y];b[o][y]=p[3*(v+1)+(m+1)],b[h][y]=0,r[o]=u}}else b[o]=A(d[o],c[o]),b[h]=A(d[h],c[h]),i=Math.max(b[o].length,i),i=Math.max(b[h].length,i)}var S=this.jpoint(null,null,null),w=this._wnafT4;for(n=i;n>=0;n--){for(var I=0;n>=0;){var E=!0;for(y=0;y<t;y++)w[y]=0|b[y][n],0!==w[y]&&(E=!1);if(!E)break;I++,n--}if(n>=0&&I++,S=S.dblp(I),n<0)break;for(y=0;y<t;y++){var x,M=w[y];0!==M&&(M>0?x=r[y][M-1>>1]:M<0&&(x=r[y][-M-1>>1].neg()),S="affine"===x.type?S.mixedAdd(x):S.add(x))}}for(n=0;n<t;n++)r[n]=null;return a?S:S.toP()},w.BasePoint=E,E.prototype.eq=function(){throw Error("Not implemented")},E.prototype.validate=function(){return this.curve.validate(this)},w.prototype.decodePoint=function(e,f){e=p.toArray(e,f);var d=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*d)return 6===e[0]?S(e[e.length-1]%2==0):7===e[0]&&S(e[e.length-1]%2==1),this.point(e.slice(1,1+d),e.slice(1+d,1+2*d));if((2===e[0]||3===e[0])&&e.length-1===d)return this.pointFromX(e.slice(1,1+d),3===e[0]);throw Error("Unknown point format")},E.prototype.encodeCompressed=function(e){return this.encode(e,!0)},E.prototype._encode=function(e){var f=this.curve.p.byteLength(),d=this.getX().toArray("be",f);return e?[this.getY().isEven()?2:3].concat(d):[4].concat(d,this.getY().toArray("be",f))},E.prototype.encode=function(e,f){return p.encode(this._encode(f),e)},E.prototype.precompute=function(e){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,e),f.beta=this._getBeta(),this.precomputed=f,this},E.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return!!f&&f.points.length>=Math.ceil((e.bitLength()+1)/f.step)},E.prototype._getDoubles=function(e,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var d=[this],t=this,a=0;a<f;a+=e){for(var c=0;c<e;c++)t=t.dbl();d.push(t)}return{step:e,points:d}},E.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],d=(1<<e)-1,t=1===d?null:this.dbl(),a=1;a<d;a++)f[a]=f[a-1].add(t);return{wnd:e,points:f}},E.prototype._getBeta=function(){return null},E.prototype.dblp=function(e){for(var f=this,d=0;d<e;d++)f=f.dbl();return f};var x=p.assert;function M(e){I.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}d(M,I);var B=M;function C(e,f,d,t){I.BasePoint.call(this,e,"affine"),null===f&&null===d?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(f,16),this.y=new o(d,16),t&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function _(e,f,d,t){I.BasePoint.call(this,e,"jacobian"),null===f&&null===d&&null===t?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(f,16),this.y=new o(d,16),this.z=new o(t,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function D(e){I.call(this,"mont",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.i4=new o(4).toRed(this.red).redInvm(),this.two=new o(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}M.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var f,d;if(e.beta)f=new o(e.beta,16).toRed(this.red);else{var t=this._getEndoRoots(this.p);f=(f=t[0].cmp(t[1])<0?t[0]:t[1]).toRed(this.red)}if(e.lambda)d=new o(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(f))?d=a[0]:(d=a[1],x(0===this.g.mul(d).x.cmp(this.g.x.redMul(f))))}return{beta:f,lambda:d,basis:e.basis?e.basis.map((function(e){return{a:new o(e.a,16),b:new o(e.b,16)}})):this._getEndoBasis(d)}}},M.prototype._getEndoRoots=function(e){var f=e===this.p?this.red:o.mont(e),d=new o(2).toRed(f).redInvm(),t=d.redNeg(),a=new o(3).toRed(f).redNeg().redSqrt().redMul(d);return[t.redAdd(a).fromRed(),t.redSub(a).fromRed()]},M.prototype._getEndoBasis=function(e){for(var f,d,t,a,c,r,b,i,n,s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,u=this.n.clone(),p=new o(1),l=new o(0),y=new o(0),v=new o(1),m=0;0!==h.cmpn(0);){var A=u.div(h);i=u.sub(A.mul(h)),n=y.sub(A.mul(p));var g=v.sub(A.mul(l));if(!t&&i.cmp(s)<0)f=b.neg(),d=p,t=i.neg(),a=n;else if(t&&2==++m)break;b=i,u=h,h=i,y=p,p=n,v=l,l=g}c=i.neg(),r=n;var S=t.sqr().add(a.sqr());return c.sqr().add(r.sqr()).cmp(S)>=0&&(c=f,r=d),t.negative&&(t=t.neg(),a=a.neg()),c.negative&&(c=c.neg(),r=r.neg()),[{a:t,b:a},{a:c,b:r}]},M.prototype._endoSplit=function(e){var f=this.endo.basis,d=f[0],t=f[1],a=t.b.mul(e).divRound(this.n),c=d.b.neg().mul(e).divRound(this.n),r=a.mul(d.a),b=c.mul(t.a),i=a.mul(d.b),n=c.mul(t.b);return{k1:e.sub(r).sub(b),k2:i.add(n).neg()}},M.prototype.pointFromX=function(e,f){(e=new o(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),t=d.redSqrt();if(0!==t.redSqr().redSub(d).cmp(this.zero))throw Error("invalid point");var a=t.fromRed().isOdd();return(f&&!a||!f&&a)&&(t=t.redNeg()),this.point(e,t)},M.prototype.validate=function(e){if(e.inf)return!0;var f=e.x,d=e.y,t=this.a.redMul(f),a=f.redSqr().redMul(f).redIAdd(t).redIAdd(this.b);return 0===d.redSqr().redISub(a).cmpn(0)},M.prototype._endoWnafMulAdd=function(e,f,d){for(var t=this._endoWnafT1,a=this._endoWnafT2,c=0;c<e.length;c++){var r=this._endoSplit(f[c]),b=e[c],i=b._getBeta();r.k1.negative&&(r.k1.ineg(),b=b.neg(!0)),r.k2.negative&&(r.k2.ineg(),i=i.neg(!0)),t[2*c]=b,t[2*c+1]=i,a[2*c]=r.k1,a[2*c+1]=r.k2}for(var n=this._wnafMulAdd(1,t,a,2*c,d),s=0;s<2*c;s++)t[s]=null,a[s]=null;return n},d(C,I.BasePoint),M.prototype.point=function(e,f,d){return new C(this,e,f,d)},M.prototype.pointFromJSON=function(e,f){return C.fromJSON(this,e,f)},C.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var f=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var d=this.curve,t=function(e){return d.point(e.x.redMul(d.endo.beta),e.y)};e.beta=f,f.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(t)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(t)}}}return f}},C.prototype.toJSON=function(){return this.precomputed?[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)}}]:[this.x,this.y]},C.fromJSON=function(e,f,d){"string"==typeof f&&(f=JSON.parse(f));var t=e.point(f[0],f[1],d);if(!f[2])return t;function a(f){return e.point(f[0],f[1],d)}var c=f[2];return t.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[t].concat(c.doubles.points.map(a))},naf:c.naf&&{wnd:c.naf.wnd,points:[t].concat(c.naf.points.map(a))}},t},C.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},C.prototype.isInfinity=function(){return this.inf},C.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var f=this.y.redSub(e.y);0!==f.cmpn(0)&&(f=f.redMul(this.x.redSub(e.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(e.x),t=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,t)},C.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),t=e.redInvm(),a=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(t),c=a.redSqr().redISub(this.x.redAdd(this.x)),r=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,r)},C.prototype.getX=function(){return this.x.fromRed()},C.prototype.getY=function(){return this.y.fromRed()},C.prototype.mul=function(e){return e=new o(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},C.prototype.mulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a):this.curve._wnafMulAdd(1,t,a,2)},C.prototype.jmulAdd=function(e,f,d){var t=[this,f],a=[e,d];return this.curve.endo?this.curve._endoWnafMulAdd(t,a,!0):this.curve._wnafMulAdd(1,t,a,2,!0)},C.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},C.prototype.neg=function(e){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var d=this.precomputed,t=function(e){return e.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(t)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(t)}}}return f},C.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},d(_,I.BasePoint),M.prototype.jpoint=function(e,f,d){return new _(this,e,f,d)},_.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),f=e.redSqr(),d=this.x.redMul(f),t=this.y.redMul(f).redMul(e);return this.curve.point(d,t)},_.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var f=e.z.redSqr(),d=this.z.redSqr(),t=this.x.redMul(f),a=e.x.redMul(d),c=this.y.redMul(f.redMul(e.z)),r=e.y.redMul(d.redMul(this.z)),b=t.redSub(a),i=c.redSub(r);if(0===b.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var n=b.redSqr(),s=n.redMul(b),o=t.redMul(n),h=i.redSqr().redIAdd(s).redISub(o).redISub(o),u=i.redMul(o.redISub(h)).redISub(c.redMul(s)),p=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(h,u,p)},_.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var f=this.z.redSqr(),d=this.x,t=e.x.redMul(f),a=this.y,c=e.y.redMul(f).redMul(this.z),r=d.redSub(t),b=a.redSub(c);if(0===r.cmpn(0))return 0!==b.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=r.redSqr(),n=i.redMul(r),s=d.redMul(i),o=b.redSqr().redIAdd(n).redISub(s).redISub(s),h=b.redMul(s.redISub(o)).redISub(a.redMul(n)),u=this.z.redMul(r);return this.curve.jpoint(o,h,u)},_.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var f=this,d=0;d<e;d++)f=f.dbl();return f}var t=this.curve.a,a=this.curve.tinv,c=this.x,r=this.y,b=this.z,i=b.redSqr().redSqr(),n=r.redAdd(r);for(d=0;d<e;d++){var s=c.redSqr(),o=n.redSqr(),h=o.redSqr(),u=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),p=c.redMul(o),l=u.redSqr().redISub(p.redAdd(p)),y=p.redISub(l),v=u.redMul(y);v=v.redIAdd(v).redISub(h);var m=n.redMul(b);d+1<e&&(i=i.redMul(h)),c=l,b=m,n=v}return this.curve.jpoint(c,n.redMul(a),b)},_.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},_.prototype._zeroDbl=function(){var e,f,d;if(this.zOne){var t=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),r=this.x.redAdd(a).redSqr().redISub(t).redISub(c);r=r.redIAdd(r);var b=t.redAdd(t).redIAdd(t),i=b.redSqr().redISub(r).redISub(r),n=c.redIAdd(c);n=(n=n.redIAdd(n)).redIAdd(n),e=i,f=b.redMul(r.redISub(i)).redISub(n),d=this.y.redAdd(this.y)}else{var s=this.x.redSqr(),o=this.y.redSqr(),h=o.redSqr(),u=this.x.redAdd(o).redSqr().redISub(s).redISub(h);u=u.redIAdd(u);var p=s.redAdd(s).redIAdd(s),l=p.redSqr(),y=h.redIAdd(h);y=(y=y.redIAdd(y)).redIAdd(y),e=l.redISub(u).redISub(u),f=p.redMul(u.redISub(e)).redISub(y),d=(d=this.y.redMul(this.z)).redIAdd(d)}return this.curve.jpoint(e,f,d)},_.prototype._threeDbl=function(){var e,f,d;if(this.zOne){var t=this.x.redSqr(),a=this.y.redSqr(),c=a.redSqr(),r=this.x.redAdd(a).redSqr().redISub(t).redISub(c);r=r.redIAdd(r);var b=t.redAdd(t).redIAdd(t).redIAdd(this.curve.a),i=b.redSqr().redISub(r).redISub(r);e=i;var n=c.redIAdd(c);n=(n=n.redIAdd(n)).redIAdd(n),f=b.redMul(r.redISub(i)).redISub(n),d=this.y.redAdd(this.y)}else{var s=this.z.redSqr(),o=this.y.redSqr(),h=this.x.redMul(o),u=this.x.redSub(s).redMul(this.x.redAdd(s));u=u.redAdd(u).redIAdd(u);var p=h.redIAdd(h),l=(p=p.redIAdd(p)).redAdd(p);e=u.redSqr().redISub(l),d=this.y.redAdd(this.z).redSqr().redISub(o).redISub(s);var y=o.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),f=u.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,f,d)},_.prototype._dbl=function(){var e=this.curve.a,f=this.x,d=this.y,t=this.z,a=t.redSqr().redSqr(),c=f.redSqr(),r=d.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(e.redMul(a)),i=f.redAdd(f),n=(i=i.redIAdd(i)).redMul(r),s=b.redSqr().redISub(n.redAdd(n)),o=n.redISub(s),h=r.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var u=b.redMul(o).redISub(h),p=d.redAdd(d).redMul(t);return this.curve.jpoint(s,u,p)},_.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr(),t=f.redSqr(),a=e.redAdd(e).redIAdd(e),c=a.redSqr(),r=this.x.redAdd(f).redSqr().redISub(e).redISub(t),b=(r=(r=(r=r.redIAdd(r)).redAdd(r).redIAdd(r)).redISub(c)).redSqr(),i=t.redIAdd(t);i=(i=(i=i.redIAdd(i)).redIAdd(i)).redIAdd(i);var n=a.redIAdd(r).redSqr().redISub(c).redISub(b).redISub(i),s=f.redMul(n);s=(s=s.redIAdd(s)).redIAdd(s);var o=this.x.redMul(b).redISub(s);o=(o=o.redIAdd(o)).redIAdd(o);var h=this.y.redMul(n.redMul(i.redISub(n)).redISub(r.redMul(b)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var u=this.z.redAdd(r).redSqr().redISub(d).redISub(b);return this.curve.jpoint(o,h,u)},_.prototype.mul=function(e,f){return e=new o(e,f),this.curve._wnafMul(this,e)},_.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var f=this.z.redSqr(),d=e.z.redSqr();if(0!==this.x.redMul(d).redISub(e.x.redMul(f)).cmpn(0))return!1;var t=f.redMul(this.z),a=d.redMul(e.z);return 0===this.y.redMul(a).redISub(e.y.redMul(t)).cmpn(0)},_.prototype.eqXToP=function(e){var f=this.z.redSqr(),d=e.toRed(this.curve.red).redMul(f);if(0===this.x.cmp(d))return!0;for(var t=e.clone(),a=this.curve.redN.redMul(f);;){if(t.iadd(this.curve.n),t.cmp(this.curve.p)>=0)return!1;if(d.redIAdd(a),0===this.x.cmp(d))return!0}},_.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},_.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},d(D,I);var F=D;function z(e,f,d){I.BasePoint.call(this,e,"projective"),null===f&&null===d?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new o(f,16),this.z=new o(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}D.prototype.validate=function(e){var f=e.normalize().x,d=f.redSqr(),t=d.redMul(f).redAdd(d.redMul(this.a)).redAdd(f);return 0===t.redSqrt().redSqr().cmp(t)},d(z,I.BasePoint),D.prototype.decodePoint=function(e,f){if(33===(e=p.toArray(e,f)).length&&64===e[0]&&(e=e.slice(1,33).reverse()),32!==e.length)throw Error("Unknown point compression format");return this.point(e,1)},D.prototype.point=function(e,f){return new z(this,e,f)},D.prototype.pointFromJSON=function(e){return z.fromJSON(this,e)},z.prototype.precompute=function(){},z.prototype._encode=function(e){var f=this.curve.p.byteLength();return e?[64].concat(this.getX().toArray("le",f)):this.getX().toArray("be",f)},z.fromJSON=function(e,f){return new z(e,f[0],f[1]||e.one)},z.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},z.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),f=this.x.redSub(this.z).redSqr(),d=e.redSub(f),t=e.redMul(f),a=d.redMul(f.redAdd(this.curve.a24.redMul(d)));return this.curve.point(t,a)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(e,f){var d=this.x.redAdd(this.z),t=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z).redMul(d),r=a.redMul(t),b=f.z.redMul(c.redAdd(r).redSqr()),i=f.x.redMul(c.redISub(r).redSqr());return this.curve.point(b,i)},z.prototype.mul=function(e){for(var f=(e=new o(e,16)).clone(),d=this,t=this.curve.point(null,null),a=[];0!==f.cmpn(0);f.iushrn(1))a.push(f.andln(1));for(var c=a.length-1;c>=0;c--)0===a[c]?(d=d.diffAdd(t,this),t=t.dbl()):(t=d.diffAdd(t,this),d=d.dbl());return t},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var q=p.assert;function R(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,I.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),q(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}d(R,I);var P=R;function N(e,f,d,t,a){I.BasePoint.call(this,e,"projective"),null===f&&null===d&&null===t?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(f,16),this.y=new o(d,16),this.z=t?new o(t,16):this.curve.one,this.t=a&&new o(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}R.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},R.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},R.prototype.jpoint=function(e,f,d,t){return this.point(e,f,d,t)},R.prototype.pointFromX=function(e,f){(e=new o(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=this.c2.redSub(this.a.redMul(d)),a=this.one.redSub(this.c2.redMul(this.d).redMul(d)),c=t.redMul(a.redInvm()),r=c.redSqrt();if(0!==r.redSqr().redSub(c).cmp(this.zero))throw Error("invalid point");var b=r.fromRed().isOdd();return(f&&!b||!f&&b)&&(r=r.redNeg()),this.point(e,r)},R.prototype.pointFromY=function(e,f){(e=new o(e,16)).red||(e=e.toRed(this.red));var d=e.redSqr(),t=d.redSub(this.c2),a=d.redMul(this.d).redMul(this.c2).redSub(this.a),c=t.redMul(a.redInvm());if(0===c.cmp(this.zero)){if(f)throw Error("invalid point");return this.point(this.zero,e)}var r=c.redSqrt();if(0!==r.redSqr().redSub(c).cmp(this.zero))throw Error("invalid point");return r.fromRed().isOdd()!==f&&(r=r.redNeg()),this.point(r,e)},R.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var f=e.x.redSqr(),d=e.y.redSqr(),t=f.redMul(this.a).redAdd(d),a=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(d)));return 0===t.cmp(a)},d(N,I.BasePoint),R.prototype.pointFromJSON=function(e){return N.fromJSON(this,e)},R.prototype.point=function(e,f,d,t){return new N(this,e,f,d,t)},N.fromJSON=function(e,f){return new N(e,f[0],f[1],f[2])},N.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},N.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},N.prototype._extDbl=function(){var e=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr();d=d.redIAdd(d);var t=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(f),c=t.redAdd(f),r=c.redSub(d),b=t.redSub(f),i=a.redMul(r),n=c.redMul(b),s=a.redMul(b),o=r.redMul(c);return this.curve.point(i,n,o,s)},N.prototype._projDbl=function(){var e,f,d,t=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var r=(n=this.curve._mulA(a)).redAdd(c);if(this.zOne)e=t.redSub(a).redSub(c).redMul(r.redSub(this.curve.two)),f=r.redMul(n.redSub(c)),d=r.redSqr().redSub(r).redSub(r);else{var b=this.z.redSqr(),i=r.redSub(b).redISub(b);e=t.redSub(a).redISub(c).redMul(i),f=r.redMul(n.redSub(c)),d=r.redMul(i)}}else{var n=a.redAdd(c);b=this.curve._mulC(this.z).redSqr(),i=n.redSub(b).redSub(b);e=this.curve._mulC(t.redISub(n)).redMul(i),f=this.curve._mulC(n).redMul(a.redISub(c)),d=n.redMul(i)}return this.curve.point(e,f,d)},N.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},N.prototype._extAdd=function(e){var f=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),d=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),t=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=d.redSub(f),r=a.redSub(t),b=a.redAdd(t),i=d.redAdd(f),n=c.redMul(r),s=b.redMul(i),o=c.redMul(i),h=r.redMul(b);return this.curve.point(n,s,h,o)},N.prototype._projAdd=function(e){var f,d,t=this.z.redMul(e.z),a=t.redSqr(),c=this.x.redMul(e.x),r=this.y.redMul(e.y),b=this.curve.d.redMul(c).redMul(r),i=a.redSub(b),n=a.redAdd(b),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(c).redISub(r),o=t.redMul(i).redMul(s);return this.curve.twisted?(f=t.redMul(n).redMul(r.redSub(this.curve._mulA(c))),d=i.redMul(n)):(f=t.redMul(n).redMul(r.redSub(c)),d=this.curve._mulC(i).redMul(n)),this.curve.point(o,f,d)},N.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},N.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},N.prototype.mulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!1)},N.prototype.jmulAdd=function(e,f,d){return this.curve._wnafMulAdd(1,[this,f],[e,d],2,!0)},N.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},N.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},N.prototype.getX=function(){return this.normalize(),this.x.fromRed()},N.prototype.getY=function(){return this.normalize(),this.y.fromRed()},N.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},N.prototype.eqXToP=function(e){var f=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(f))return!0;for(var d=e.clone(),t=this.curve.redN.redMul(this.z);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(t),0===this.x.cmp(f))return!0}},N.prototype.toP=N.prototype.normalize,N.prototype.mixedAdd=N.prototype.add;var k=e((function(e,f){var d=f;d.base=I,d.short=B,d.mont=F,d.edwards=P})),j=t.rotl32,O=t.sum32,L=t.sum32_5,T=a.ft_1,J=c.BlockHash,X=[1518500249,1859775393,2400959708,3395469782];function V(){if(!(this instanceof V))return new V;J.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}t.inherits(V,J);var K=V;V.blockSize=512,V.outSize=160,V.hmacStrength=80,V.padLength=64,V.prototype._update=function(e,f){for(var d=this.W,t=0;t<16;t++)d[t]=e[f+t];for(;t<d.length;t++)d[t]=j(d[t-3]^d[t-8]^d[t-14]^d[t-16],1);var a=this.h[0],c=this.h[1],r=this.h[2],b=this.h[3],i=this.h[4];for(t=0;t<d.length;t++){var n=~~(t/20),s=L(j(a,5),T(n,c,r,b),i,d[t],X[n]);i=b,b=r,r=j(c,30),c=a,a=s}this.h[0]=O(this.h[0],a),this.h[1]=O(this.h[1],c),this.h[2]=O(this.h[2],r),this.h[3]=O(this.h[3],b),this.h[4]=O(this.h[4],i)},V.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"big"):t.split32(this.h,"big")};var U={sha1:K,sha224:r,sha256:b,sha384:i,sha512:n};function H(e,f,d){if(!(this instanceof H))return new H(e,f,d);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(t.toArray(f,d))}var W=H;H.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),f(e.length<=this.blockSize);for(var d=e.length;d<this.blockSize;d++)e.push(0);for(d=0;d<e.length;d++)e[d]^=54;for(this.inner=(new this.Hash).update(e),d=0;d<e.length;d++)e[d]^=106;this.outer=(new this.Hash).update(e)},H.prototype.update=function(e,f){return this.inner.update(e,f),this},H.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var Y=e((function(e,f){var d=f;d.utils=t,d.common=c,d.sha=U,d.ripemd=s,d.hmac=W,d.sha1=d.sha.sha1,d.sha256=d.sha.sha256,d.sha224=d.sha.sha224,d.sha384=d.sha.sha384,d.sha512=d.sha.sha512,d.ripemd160=d.ripemd.ripemd160})),G={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"]]}},Q=e((function(e,f){var d,t=f,a=p.assert;function c(e){if("short"===e.type)this.curve=new k.short(e);else if("edwards"===e.type)this.curve=new k.edwards(e);else{if("mont"!==e.type)throw Error("Unknown curve type.");this.curve=new k.mont(e)}this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, n*G != O")}function r(e,f){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var d=new c(f);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:d}),d}})}t.PresetCurve=c,r("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:Y.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),r("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:Y.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),r("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:Y.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),r("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:Y.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"]}),r("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:Y.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"]}),r("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:Y.sha256,gRed:!1,g:["9"]}),r("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",cofactor:"8",hash:Y.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]}),r("brainpoolP256r1",{type:"short",prime:null,p:"A9FB57DB A1EEA9BC 3E660A90 9D838D72 6E3BF623 D5262028 2013481D 1F6E5377",a:"7D5A0975 FC2C3057 EEF67530 417AFFE7 FB8055C1 26DC5C6C E94A4B44 F330B5D9",b:"26DC5C6C E94A4B44 F330B5D9 BBD77CBF 95841629 5CF7E1CE 6BCCDC18 FF8C07B6",n:"A9FB57DB A1EEA9BC 3E660A90 9D838D71 8C397AA3 B561A6F7 901E0E82 974856A7",hash:Y.sha256,gRed:!1,g:["8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262","547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997"]}),r("brainpoolP384r1",{type:"short",prime:null,p:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B4 12B1DA19 7FB71123ACD3A729 901D1A71 87470013 3107EC53",a:"7BC382C6 3D8C150C 3C72080A CE05AFA0 C2BEA28E 4FB22787 139165EF BA91F90F8AA5814A 503AD4EB 04A8C7DD 22CE2826",b:"04A8C7DD 22CE2826 8B39B554 16F0447C 2FB77DE1 07DCD2A6 2E880EA5 3EEB62D57CB43902 95DBC994 3AB78696 FA504C11",n:"8CB91E82 A3386D28 0F5D6F7E 50E641DF 152F7109 ED5456B3 1F166E6C AC0425A7CF3AB6AF 6B7FC310 3B883202 E9046565",hash:Y.sha384,gRed:!1,g:["1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E","8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315"]}),r("brainpoolP512r1",{type:"short",prime:null,p:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 703308717D4D9B00 9BC66842 AECDA12A E6A380E6 2881FF2F 2D82C685 28AA6056 583A48F3",a:"7830A331 8B603B89 E2327145 AC234CC5 94CBDD8D 3DF91610 A83441CA EA9863BC2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A7 2BF2C7B9 E7C1AC4D 77FC94CA",b:"3DF91610 A83441CA EA9863BC 2DED5D5A A8253AA1 0A2EF1C9 8B9AC8B5 7F1117A72BF2C7B9 E7C1AC4D 77FC94CA DC083E67 984050B7 5EBAE5DD 2809BD63 8016F723",n:"AADD9DB8 DBE9C48B 3FD4E6AE 33C9FC07 CB308DB3 B3C9D20E D6639CCA 70330870553E5C41 4CA92619 41866119 7FAC1047 1DB1D381 085DDADD B5879682 9CA90069",hash:Y.sha512,gRed:!1,g:["81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822","7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892"]});try{d=G}catch(e){d=void 0}r("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:Y.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",d]})}));function Z(e){if(!(this instanceof Z))return new Z(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var d=u.toArray(e.entropy,e.entropyEnc||"hex"),t=u.toArray(e.nonce,e.nonceEnc||"hex"),a=u.toArray(e.pers,e.persEnc||"hex");f(d.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(d,t,a)}var $=Z;Z.prototype._init=function(e,f,d){var t=e.concat(f).concat(d);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(t),this._reseed=1,this.reseedInterval=281474976710656},Z.prototype._hmac=function(){return new Y.hmac(this.hash,this.K)},Z.prototype._update=function(e){var f=this._hmac().update(this.V).update([0]);e&&(f=f.update(e)),this.K=f.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Z.prototype.reseed=function(e,d,t,a){"string"!=typeof d&&(a=t,t=d,d=null),e=u.toArray(e,d),t=u.toArray(t,a),f(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},Z.prototype.generate=function(e,f,d,t){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof f&&(t=d,d=f,f=null),d&&(d=u.toArray(d,t||"hex"),this._update(d));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var c=a.slice(0,e);return this._update(d),this._reseed++,u.encode(c,f)};var ee=p.assert;function fe(e,f){this.ec=e,this.priv=null,this.pub=null,f.priv&&this._importPrivate(f.priv,f.privEnc),f.pub&&this._importPublic(f.pub,f.pubEnc)}var de=fe;fe.fromPublic=function(e,f,d){return f instanceof fe?f:new fe(e,{pub:f,pubEnc:d})},fe.fromPrivate=function(e,f,d){return f instanceof fe?f:new fe(e,{priv:f,privEnc:d})},fe.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},fe.prototype.getPublic=function(e,f){return this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,f):this.pub},fe.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},fe.prototype._importPrivate=function(e,f){if(this.priv=new o(e,f||16),"mont"===this.ec.curve.type){var d=this.ec.curve.one,t=d.ushln(252).sub(d).ushln(3);this.priv=this.priv.or(d.ushln(254)),this.priv=this.priv.and(t)}else this.priv=this.priv.umod(this.ec.curve.n)},fe.prototype._importPublic=function(e,f){if(e.x||e.y)return"mont"===this.ec.curve.type?ee(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||ee(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,f)},fe.prototype.derive=function(e){return e.mul(this.priv).getX()},fe.prototype.sign=function(e,f,d){return this.ec.sign(e,this,f,d)},fe.prototype.verify=function(e,f){return this.ec.verify(e,f,this)},fe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var te=p.assert;function ae(e,f){if(e instanceof ae)return e;this._importDER(e,f)||(te(e.r&&e.s,"Signature without r or s"),this.r=new o(e.r,16),this.s=new o(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ce=ae;function re(){this.place=0}function be(e,f){var d=e[f.place++];if(!(128&d))return d;for(var t=15&d,a=0,c=0,r=f.place;c<t;c++,r++)a<<=8,a|=e[r];return f.place=r,a}function ie(e){for(var f=0,d=e.length-1;!e[f]&&!(128&e[f+1])&&f<d;)f++;return 0===f?e:e.slice(f)}function ne(e,f){if(f<128)e.push(f);else{var d=1+(Math.log(f)/Math.LN2>>>3);for(e.push(128|d);--d;)e.push(f>>>(d<<3)&255);e.push(f)}}ae.prototype._importDER=function(e,f){e=p.toArray(e,f);var d=new re;if(48!==e[d.place++])return!1;if(be(e,d)+d.place!==e.length)return!1;if(2!==e[d.place++])return!1;var t=be(e,d),a=e.slice(d.place,t+d.place);if(d.place+=t,2!==e[d.place++])return!1;var c=be(e,d);if(e.length!==c+d.place)return!1;var r=e.slice(d.place,c+d.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===r[0]&&128&r[1]&&(r=r.slice(1)),this.r=new o(a),this.s=new o(r),this.recoveryParam=null,!0},ae.prototype.toDER=function(e){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=ie(f),d=ie(d);!(d[0]||128&d[1]);)d=d.slice(1);var t=[2];ne(t,f.length),(t=t.concat(f)).push(2),ne(t,d.length);var a=t.concat(d),c=[48];return ne(c,a.length),c=c.concat(a),p.encode(c,e)};var se=p.assert;function oe(e){if(!(this instanceof oe))return new oe(e);"string"==typeof e&&(se(Q.hasOwnProperty(e),"Unknown curve "+e),e=Q[e]),e instanceof Q.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var he=oe;oe.prototype.keyPair=function(e){return new de(this,e)},oe.prototype.keyFromPrivate=function(e,f){return de.fromPrivate(this,e,f)},oe.prototype.keyFromPublic=function(e,f){return de.fromPublic(this,e,f)},oe.prototype.genKeyPair=function(e){e||(e={});var f=new $({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||l(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});if("mont"===this.curve.type){var d=new o(f.generate(32));return this.keyFromPrivate(d)}for(var t=this.n.byteLength(),a=this.n.sub(new o(2));;){if(!((d=new o(f.generate(t))).cmp(a)>0))return d.iaddn(1),this.keyFromPrivate(d)}},oe.prototype._truncateToN=function(e,f,d){var t=(d=d||8*e.byteLength())-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!f&&e.cmp(this.n)>=0?e.sub(this.n):e},oe.prototype.truncateMsg=function(e){var f;return e instanceof Uint8Array?(f=8*e.byteLength,e=this._truncateToN(new o(e,16),!1,f)):"string"==typeof e?(f=4*e.length,e=this._truncateToN(new o(e,16),!1,f)):e=this._truncateToN(new o(e,16)),e},oe.prototype.sign=function(e,f,d,t){"object"==typeof d&&(t=d,d=null),t||(t={}),f=this.keyFromPrivate(f,d),e=this.truncateMsg(e);for(var a=this.n.byteLength(),c=f.getPrivate().toArray("be",a),r=e.toArray("be",a),b=new $({hash:this.hash,entropy:c,nonce:r,pers:t.pers,persEnc:t.persEnc||"utf8"}),i=this.n.sub(new o(1)),n=0;;n++){var s=t.k?t.k(n):new o(b.generate(this.n.byteLength()));if(!((s=this._truncateToN(s,!0)).cmpn(1)<=0||s.cmp(i)>=0)){var h=this.g.mul(s);if(!h.isInfinity()){var u=h.getX(),p=u.umod(this.n);if(0!==p.cmpn(0)){var l=s.invm(this.n).mul(p.mul(f.getPrivate()).iadd(e));if(0!==(l=l.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==u.cmp(p)?2:0);return t.canonical&&l.cmp(this.nh)>0&&(l=this.n.sub(l),y^=1),new ce({r:p,s:l,recoveryParam:y})}}}}}},oe.prototype.verify=function(e,f,d,t){return d=this.keyFromPublic(d,t),f=new ce(f,"hex"),this._verify(this.truncateMsg(e),f,d)||this._verify(this._truncateToN(new o(e,16)),f,d)},oe.prototype._verify=function(e,f,d){var t=f.r,a=f.s;if(t.cmpn(1)<0||t.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c,r=a.invm(this.n),b=r.mul(e).umod(this.n),i=r.mul(t).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(b,d.getPublic(),i)).isInfinity()&&c.eqXToP(t):!(c=this.g.mulAdd(b,d.getPublic(),i)).isInfinity()&&0===c.getX().umod(this.n).cmp(t)},oe.prototype.recoverPubKey=function(e,f,d,t){se((3&d)===d,"The recovery param is more than two bits"),f=new ce(f,t);var a=this.n,c=new o(e),r=f.r,b=f.s,i=1&d,n=d>>1;if(r.cmp(this.curve.p.umod(this.curve.n))>=0&&n)throw Error("Unable to find sencond key candinate");r=n?this.curve.pointFromX(r.add(this.curve.n),i):this.curve.pointFromX(r,i);var s=f.r.invm(a),h=a.sub(c).mul(s).umod(a),u=b.mul(s).umod(a);return this.g.mulAdd(h,r,u)},oe.prototype.getKeyRecoveryParam=function(e,f,d,t){if(null!==(f=new ce(f,t)).recoveryParam)return f.recoveryParam;for(var a=0;a<4;a++){var c;try{c=this.recoverPubKey(e,f,a)}catch(e){continue}if(c.eq(d))return a}throw Error("Unable to find valid recovery factor")};var ue=p.assert,pe=p.parseBytes,le=p.cachedProperty;function ye(e,f){if(this.eddsa=e,f.hasOwnProperty("secret")&&(this._secret=pe(f.secret)),e.isPoint(f.pub))this._pub=f.pub;else if(this._pubBytes=pe(f.pub),this._pubBytes&&33===this._pubBytes.length&&64===this._pubBytes[0]&&(this._pubBytes=this._pubBytes.slice(1,33)),this._pubBytes&&32!==this._pubBytes.length)throw Error("Unknown point compression format")}ye.fromPublic=function(e,f){return f instanceof ye?f:new ye(e,{pub:f})},ye.fromSecret=function(e,f){return f instanceof ye?f:new ye(e,{secret:f})},ye.prototype.secret=function(){return this._secret},le(ye,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),le(ye,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),le(ye,"privBytes",(function(){var e=this.eddsa,f=this.hash(),d=e.encodingLength-1,t=f.slice(0,e.encodingLength);return t[0]&=248,t[d]&=127,t[d]|=64,t})),le(ye,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),le(ye,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),le(ye,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),ye.prototype.sign=function(e){return ue(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},ye.prototype.verify=function(e,f){return this.eddsa.verify(e,f,this)},ye.prototype.getSecret=function(e){return ue(this._secret,"KeyPair is public only"),p.encode(this.secret(),e)},ye.prototype.getPublic=function(e,f){return p.encode((f?[64]:[]).concat(this.pubBytes()),e)};var ve=ye,me=p.assert,Ae=p.cachedProperty,ge=p.parseBytes;function Se(e,f){this.eddsa=e,"object"!=typeof f&&(f=ge(f)),Array.isArray(f)&&(f={R:f.slice(0,e.encodingLength),S:f.slice(e.encodingLength)}),me(f.R&&f.S,"Signature without R or S"),e.isPoint(f.R)&&(this._R=f.R),f.S instanceof o&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}Ae(Se,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Ae(Se,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Ae(Se,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Ae(Se,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Se.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Se.prototype.toHex=function(){return p.encode(this.toBytes(),"hex").toUpperCase()};var we=Se,Ie=p.assert,Ee=p.parseBytes;function xe(e){if(Ie("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof xe))return new xe(e);e=Q[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Y.sha512}var Me=xe;xe.prototype.sign=function(e,f){e=Ee(e);var d=this.keyFromSecret(f),t=this.hashInt(d.messagePrefix(),e),a=this.g.mul(t),c=this.encodePoint(a),r=this.hashInt(c,d.pubBytes(),e).mul(d.priv()),b=t.add(r).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:c})},xe.prototype.verify=function(e,f,d){e=Ee(e),f=this.makeSignature(f);var t=this.keyFromPublic(d),a=this.hashInt(f.Rencoded(),t.pubBytes(),e),c=this.g.mul(f.S());return f.R().add(t.pub().mul(a)).eq(c)},xe.prototype.hashInt=function(){for(var e=this.hash(),f=0;f<arguments.length;f++)e.update(arguments[f]);return p.intFromLE(e.digest()).umod(this.curve.n)},xe.prototype.keyPair=function(e){return new ve(this,e)},xe.prototype.keyFromPublic=function(e){return ve.fromPublic(this,e)},xe.prototype.keyFromSecret=function(e){return ve.fromSecret(this,e)},xe.prototype.genKeyPair=function(e){e||(e={});var f=new $({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||l(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.curve.n.toArray()});return this.keyFromSecret(f.generate(32))},xe.prototype.makeSignature=function(e){return e instanceof we?e:new we(this,e)},xe.prototype.encodePoint=function(e){var f=e.getY().toArray("le",this.encodingLength);return f[this.encodingLength-1]|=e.getX().isOdd()?128:0,f},xe.prototype.decodePoint=function(e){var f=(e=p.parseBytes(e)).length-1,d=e.slice(0,f).concat(-129&e[f]),t=0!=(128&e[f]),a=p.intFromLE(d);return this.curve.pointFromY(a,t)},xe.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},xe.prototype.decodeInt=function(e){return p.intFromLE(e)},xe.prototype.isPoint=function(e){return e instanceof this.pointClass};var Be=e((function(e,f){var d=f;d.utils=p,d.rand=l,d.curve=k,d.curves=Q,d.ec=he,d.eddsa=Me}));export default Be;export{Be as __moduleExports};
//# sourceMappingURL=elliptic.min.mjs.map
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       X            __TEXT                                                     __text          __TEXT                ؅                                 __stubs         __TEXT          ̣      T      ̣                         __stub_helper   __TEXT                 l                                  __gcc_except_tab__TEXT                T                                   __const         __TEXT                                                   __cstring       __TEXT                4                                   __unwind_info   __TEXT                                                   __eh_frame      __TEXT          ȿ      8       ȿ               h                  __DATA_CONST            @              @                  __got           __DATA_CONST           X                        G           __const         __DATA_CONST    X            X                                   __DATA                  @              @                   __la_symbol_ptr __DATA                 8                       R           __data          __DATA          8            8                               H   __LINKEDIT       @      @       @     ,                    "  0    @ (   (@ h  A   `C   8K         Q    \ p     P             :   ;   P                           Z                          \>Ĉ2ua2                       *                 0          @   /usr/lib/libc++.1.dylib    8           8   /usr/lib/libSystem.B.dylib      &       Q    )      Q           `i X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               R_WO{   !4  ҃  R 9-Rhr+  9 A O  h! 9h 6@s! @9@ q"
"   59 7{FOEWD_@`! {FOEWD_ Ra!     A  !@  B c!     [!    96@	      9h 6@9!  q TA!   B!  {FOEWD_ 9! 
! J   O{   @  ! !   5h
@  t@=  ! @ 5@Q!   5{BOA _ R!  @  A  !@  B ! @    A  ! A 
   R!  `@~  A  !@  B !    
                    {    CWO{ @ `@c Q!  5`@@S s!   5@ q@ TO 9t@@A  !  O H! O@9 4t@@A  !  # ,! ` 5`@@{DOCWBC_`@@{DOCWBC_`@{DOCWBC_ R   `@     R   `@     R   `@  A  !@  B          ]  CWO{  #     5@@@_    5_@9H 4c    4@   xA  !p  H   	!  #    5 q( R!R	
@z  T@c  ң    5@  {DOCWBC_@c    @4@   xA  !s  @   xA  !n  @   xA  !i  @   xA  !\d  O{C  H  !A   9(7
  a
@a {AO¨_`@     a
@hb@9h  5`@l  
 {AO¨_ O{C    @a@5    5{AO¨_@    A  ! 1     
 O{      # 9   5@{BOA _ R   X   R   QA  !@  B       {   %  C_WO{  a  ` 9H  !A    B " R @ 4   5H     o  H R; # \# " R  5\" R  5{HOGWF_EC_@   A  !8  @   A  !  @   A  !        9h 6 @a V   @ O{C  @  hB@9h  5`@  {AO¨_nO{C  H  !A   9 76 a
@   `@: / a
@  hb@9h  5`@ {AO¨. PCO{ 9 7@t    h@t h @ A  !8   c #   h9h 6@ <=@
 h9 7{DOCC_֔@{DOCC_ 
 CWO{   @ # !  ` 5a@ `@c k  5u@@  u@c \   5@@c l ` 5c@9( 4a@ `@c U @	 5s@  @c 9  5@@@  5{DOCWBC_ s@ R  @@A  !@  B   R   4
  @   XA  ! '   R  `@'A  !@  B     R  @A  !@  B  
   R  `@
A  !@  B           
    
    U      #   M O{C    @a@   5{AO¨_@   XA  !    xWO{    @@#     5~ 
 @ / @ R( @h^9i@j
@J@J  q"RC Ҹ @ 5{COBWA_ R2  @A  !@  B 4  R&  @A  !@  B (     !       h^9h 6`@  C_WO{  R  T C  c@#  : @ 5@C  c@     5@{DOCWB_AC_  R   [A  !@  B     o
g_WO{@ aB T@@@ "R  B  B!+ `A 57@C B  B!  A 5#@ B  B"c  A 5@ B  B$"
  B 5Yc  B  B8" `B 5Y B 5Y B 5YB  Bd" C 5Y C 5Y  D 5YB  Bl" D 5Y D 5Y  E 5YB  Bt" E 5Y  F 5Y @F 5YB  B|" F 5Yy  G 5Y `G 5YB  B"  H 5Yg @H 5Y H 5Yl H 5Y9B  B" H  h t6 ab^ @H 5  ?? 4c 飀?) q  TH  a	yi[)W@6}G T[@^  Tv9 "  T  @  Av"
`N  "  T	 ?  T  T       z	  @B
¬ ?"
kaT  T
} T}	 
@
 
@ ! T
  T  @	 l@8, 8J T 9u{) q  TI  )a	(yh    C@7} = TG@^  Tw9 "  T  @  Aw`Z  "  T	 ?  T  T       z	 j @B
¬ ?"
kaT  T
} T}	 
@k
n 
@ ! T
  T  k@	 l@8, 8J T 9w"S) q  TI  )a	(yh   /@;}3 T3@_  T{~9 #  T  h@ J A{"
`f  #  T	 ?  T  T       lz	  @B
¬ ?"
kaT  T} Tm}	 
j@
 
@ ! T
  T  j@	 l@8, 8J T 9`+) q  TI  )a	(yh   @;}(* T@_  T{9 CB) #  T  h@  A{`r  CB)#  T	 ?  T  T       lz	 J @B
¬ ?"
kaT  T} Tm}	 
j@K
N 
@ ! T
  T  Kj@	 l@8, 8J T 9xR)@hpq
@h`@N   5`6@a>@{ROQWP_OgNoM_@   l!A  !! R   (A  !@B     R   A  !@B     R   A  !@B     R   A  !@B     Rx      Rq      Rj   A  !@B l    R]      RV      RO   A  !@B Q    RB      R;      R4   A  !@B 6 p   R'      R       R   A  !@B  U   R      R      R   zA  !@B   :   R   m   R   f   R   _   R   XA  !@B     R  `6@KA  !@B    }   z   w   u     R  `@3A  !@B       B                    
      
  	                    5   h~97h97h97h^9h7  @u h96   h96@m h9H6   h96@ @d h^9 7   h^9 6 @\        	                   K .  {C  #    {A _a  < _WO{	C @4 @ RO  $a # %5   o  5@@		 T	}}    3    ҆   57@	@7 @  ?3@@   {IOHWG_ R  @   R   @|A  !@B         	   3@       q T   {IOHWG_   WO{         <  5  `@#   2 @h  5{COBWA_( Rh {COBWA_ R  `@   R  `@A  !@B      h O{C  H  !A   @  `@ 
 h~9(7a@a a@ {AO¨_`&@j a@hA9h  5`@  a@Ah@9h  5`@  {AO¨_zyxO{C  97h~97h9(7h9h7h^97{AO¨`r@A h~9h6`f@= h9(6`Z@9 h96`N@5 h^96`B@1 {AO¨O{C  97h~97h9H7h97h^97{AO¨ `r@ h~9H6`f@ h96`Z@ h96`N@ h^96`B@ {AO¨ _WO{C  @@ ?{EODWC_B_ ? q T  @	@ ?  | B T X   T 9# 	  @   A#  j58`"#  9h 6@  {EODWC_B_#      9 6@       O{  _, q T`@  ! A  5 @ ` 5hA9  4{BOA _h@@ ?{BOA _ R  @A  !@B       !  !      e   ` C_	W
O{  @	\9 7)@?  Th^9'  iF@?B T	 R h^9(7@ # i9)7hb)@ 3 i9	7h)@ C i"h~97@ q' S ih96(  iB@hF ?i(8h^9(6i"H # i9)6hI 3 i9I6h&K C i"h~9h6hj@h )@' S ih9h7@ q  	 ' S ih96hv@h  )@  	 / c `O Ch @
h R h
Aw aAc   4j   |  T X   T_ 9 	  @   A    j58`"  _9 7{LOKWJ_IC_@ {LOKWJ_IC_   _9h 6@  WO{C @\97b@    5@ @`F[   5{EODWC_bH   4 R   3A  !@B   R  `6@'A  !@B       u O{C  `F#   5{AO¨_ R  `6@A  !@B    W    @@  _} 	 _C_WO{ H  !A     9   9 |9#   ` 5@@B @C  c @D  @  5{DOCWB_AC_ RA  @   R:  @A  !@B <       4    ~9h 6 @        ) @"	@@  I @#
@` O{C  @  hB@9h  5`@h  {AO¨_O{C  @  hB@9h  5`@X  {AO¨_CWO{@H  @  `@# ]   5@   u a@h@	!@#  ?# a  @`    {DOCWBC_ R  `@GA  !@B       @`      CWO{H  %@@ @  @  `@  ` 5@   s C ) R     @I  )%@)@?  T{DOCWBC_֜  R  `@A  !@B    R CWO{   @ # !   5a@ `@c  @	 5v@@   v@"@Cc    5@@c  ` 5c@9( 4a@ `@c  @	 5s@  @c   5@@@p  5{DOCWBC_ s@ R0  @A  !@B 2  R$   
      X!  ! V'   R  `@A  !@B     R
  @A  !@B  
   R  `@yA  !@B           
    
          # o CWO{   @ # ! Z  5a@ `@c B  	 5v@@   v@@c    5@@c A ` 5c@9( 4a@ `@c * @	 5s@  @c   5@@@  5{DOCWBC_ s@ R  @A  !@B   R   	
      X!  ! '   R  `@A  !@B     Rs  @A  !@B u 
   Rf  `@A  !@B h          
   ] 
   Y *     e # " {     "  O{C   R;    A  !B  B@>  8 	 { 	 H  @A   {_{     "O{C |9h7@h a"`@# ?  h@@#  ?(  !A  9(7#  @a   {EOD_h*@h@@ ?@ #  @@95@M  #     q T    {EOD_    O{  (\@9	 *,@? qAb#   5@     5@{BOA _ R   1   R   *!  !@B      z g_WO{ a h^97@RJ_ T	*K,˟#
 TH 6v@(K_JK
@_] RJ5_7r   ?#  T T? T   y@*@Z )xJ_CT86+  +zȂ 	  
¬ ?"
JaT?  T?} T,})@kˠ@ k! T?  T  )@K@8 8) T_[ `  T* x Ah
 v@U (i^9i 7h^ 9  h j(8{DOCWB_AgŨ_og_WO{CC0ѡ:    7`$@ q T	 q
@zBzC T R* qySh@k T    R
  R
 ~@@`@  / @ ng <h&@*? q  4yS6 Rh@k"
 T  B    Rh      Rc  U R6 Rh@k
 Ti@*} }H		) Q q)Z(t
 	   ) RL    i@	k Ti@*I	* Q? qXV 4 r TB    R5      R0  N:  h@)!@)i@
	H	Z8/t)I	*? qz_  *h@j@J

)
A)	)i
@?A qTZ )i4# R    i@	kcTC0{EODWC_BgAoƨ_#mg_WO{C  G
 F
  A
   4 ?
  *1BK}@-9@O
}ӯ=+AFq˓+~@-D}-
+4m
}j}ӭa͓}@}
N ʰ}@ÁΓn|@d   |ӯ ʎa̓}@>@|ӌ=  C|@"A B|ӃQ"G"AϓBT|@o@Ó5
EW ~Ӵ^ |@`~@1~  `}@| ʱ.
K@b}@u~
gBT$|@4 |ӤP-
ʅ ʥœ|@ Un|Qn aΓF .|@4 |Q͓ʄ@ē|@Փ c|ӣTa Ɠ!~@~T Г|@U|ӂ 
P bГ|~@|@ }bǓ|@x c|Ӧc`e ʥ`œ|@ ʵ }ӌVT|&1 &|@'   |ӄ@ē  ϓA̓}@1~!ʆ|@!`'|@5   |ӂ T }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NA?Nb?N} gCfdfc|Z NTAO!|{!NB?Nd?N~ g|Cfdf|NN0NƄNz gNZNƄN#n>Nz`ocT`OcNz NTAOHNr!NN?N@>NN} @fAf | g3nN( LdNN"nGhoBThO11nBNG NTAO<NZAos!Nq>N} fGVAO`f1~ 2gN3AoN L0VAOFNՄN#nfpocTpOe%nvN NTAOl<NN!N<N}n fN f}gNAoĆN LTAON LN{ L"nCAoBTAOQN LQ L T % $  {EODWC_BgA#l_(  #)  )#?  q()  )m#*  J#+  k-#I*  JM#?  qJ  q q) q _O{C f
   4{EOD_֟
 q  T {EOD_hJ)
qSlI)
kjk^@3)uSJ	 K}+)JuS#)S)?kI  T+ #   5# 	 5#    R{EOD_og	_
WO{
C`h   R  `h   M  @`h  W H   b  T7 D    `  #E)   	#  3  C ' g
)_){ #)# 	  4 x     @   7 @ # j
   4c `   [  R {MOLWK_JgIoH_ { 'A* j+#  ґ{B _ { @) i' {B _ { 'Aj+#  y{B _ { @i' n{B _ { 'AJ j+#  a{B _ { @I i' U{B _Cg_	W
O{H`h   (      `h     3  B   >   y @  # # P   4  @+ @) ' {LOKWJ_IgHC_@@    #   4 @ 4@! q  T R
 J   q  T R
 '  
i{kB ,A   o
 ob"n#n@NaNk   T N@ n <<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T} T

q}  /`Nk
,

a@@A!. ! aT<<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T
)
j
L@8-@8J* aTh  Qh @7U RO{C  o  4{AO¨_ֈ
@
 4@! q  T R
 R  q  T R
 /  
ez+ l   o
 o o o¬pErM¬$n%%nF&ng'nNNNNaT N@N`N@ n <<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T	} T

q}  /`Nk
,

a@@A!. ! aT<<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T
)
j
L@8-@8J* aTh  Q @7@{AO¨_  R{AO¨_# R RC R R! RA RO{C   R  4{AO¨_ֈ
@
 4@! q  T R
 R  q  T R
 /  
ez+ l   o
 o o o¬pErM¬$n%%nF&ng'nNNNNaT N@N`N@ n <<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T	} T

q}  /`Nk
,

a@@A!. ! aT<<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T
)
j
L@8-@8J* aTh  Q @7@{AO¨_  R{AO¨_O{C  ! Rs  4{AO¨_ֈ
@
 4@! q  T R
 R  q  T R
 /  
ez+ l   o
 o o o¬pErM¬$n%%nF&ng'nNNNNaT N@N`N@ n <<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T	} T

q}  /`Nk
,

a@@A!. ! aT<<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T
)
j
L@8-@8J* aTh  Q @7@{AO¨_  R{AO¨_O{C  A R  4{AO¨_ֈ
@
 4@! q  T R
 R  q  T R
 /  
ez+ l   o
 o o o¬pErM¬$n%%nF&ng'nNNNNaT N@N`N@ n <<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T	} T

q}  /`Nk
,

a@@A!. ! aT<<
<*k
*<
<	k*k
*<
<
k*k
*<k*_@ T
)
j
L@8-@8J* aTh  Q @7@{AO¨_  R{AO¨_  q  T(  A  @_    2__WO{  (   e9
  H  E  B  0  -  `R9   A {COBWA_Ĩ_       R  o         =)  ) @"
A
  ) @
-@I		 )@i		 )@
-AI			 )@i		
 )@
-BI		 )@i		 )@
-CI		 )@i		 ) @9	 _O{C   ( TR hC9h  4 h.  h*   {AO¨_  R( R(   o` )  )"@b="
Ai@(```````a h a {AO¨_O	{
(  %@@  ( TR hC9h  4 h.  h*   ^)  )%@)@? T{JOI_ւh)T  o`h\Sx) R`	````` `=)  )!	A$
@a
d i@(h a   R  R   R   R^)  )%@)@?@T _WO{         *@   {COBWA_Ĩ_  R{COBWA_Ĩ_@ TR˗ &D
("$   s˨ T&D
("  sѵT@   RB8    R@ {COBWA_Ĩ_O	{
 )  )%@)@ B C @  A@ B)  "= "n)  "=""n)  %=)  $=)  ) A.	@)1A)G
C
B)1C)T
E
1D)O
K
1E)F)Q

M
9G)&NgNPys@MQyf@MNƄN &nB'nP@ n @n`o T`O N`oV`ONNN@n@n!!n#nphocThOcN0ho!ThO!N&NgNPyd@MQybq@MNƄN@n@@ n n0nPpoBTpOBNpo TpO N@nQ@ n%NN@n@n!!n#npAocTAOcN0Ao!TAO!N@n@nƄNNPyp0@MQya@MNƄN"n n`o T`O NP`oBT`OBNDNN#n!n0ho!ThO!NphocThOcNgN&NPynp@MQyl@MфNN  n""nFpoBTpOBNpo TpO NNDN!n#nfAocTAOcN&Ao!TAO!N&BnBnT>N	(@	ʉ<N	)f)
ʪ f)
$ (>N	(A	ʩ<N		f)
ʊ f)
$h f	(B	I fk<N	i
J<N)
$( f	(C		 f	)<N)

<N)
$^)  )%@)@?  T{JOI_֡
 WO{ (  %@@  3  h@) T  ])  )%@)@?` T:  h*@   ])  )%@)@?! T{GOFWE_h@i*D)J5i*iC9i  4	 i. 	 i* u	R!Km
 `@ `Ab@ n
  R R R   R])  )%@)@? TN
 _WO{ (  %@@b U   R \)  )%@)@? T{SORWQ_P_ hT  @  T7   6 o(   @  A=( h	!ҩW)A	   1 7 Z 	 g_WO{(  %@@O (`h  CR [)  )%@)@?a T{DOCWB_AgŨ_ CO ? ( T  o(   @  A
=( 	)ҩW)A)	 C3 R@7C7C	 )ҸW8A  o(  :=A @   RC3 R7C7CCR@7D` Qq TRDE  o =@Az CR7CR R t7D` QqTDE*CCR   7CT	  R\CR  F9h  4 .  * QR  M4	 RG	 R?	  ) ?  AH T @"A@A n!n"n#n   B"CBC n!n"n#n  D"EDE n!n"n#n  F"GFG n!n"n#n  H"IHI n!n"n#n 	 J"KJK n!n"n#n 
 L"MLM n!n"n#n 
 N"ONO n!n"n#n  P"QPQ n!n"n#n  R"SRS n!n"n#n  T"UTU n!n"n#n  V"WVW n!n"n#n  X"YXY n!n"n#n  Z"[Z[ n!n"n#n  \"]\] n!n"n#n  ^"_^_ n!n"n#n _ )hh
hhI		h(! AT_h|  7O{C a|0@   ?`@  z `   {AO¨_WO{  t|  H  AB  4  6@  {BOAWè@ {BOAWèT   H  ABH  4  _ {C   (  !@@@ R ?{A __WO{ C (  %@@   @@*  R/ @	 qc T	 R QzS Q. R  ** @A@A n!n"n#n  BCBC n!n"n#n DEDE n!n"n#n FGFG n!n"n#n HIHI n!n"n#n	 JKJK n!n"n#n
 LMLM n!n"n#n
 NONO n!n"n#n PQPQ n!n"n#n RSRS n!n"n#n TUTU n!n"n#n VWVW n!n"n#n XYXY n!n"n#n Z[Z[ n!n"n#n \]\] n!n"n#n ^_^_ n!n"n#n ) ` T2	~v"2KbT ** jpjp   ʠj0" AT #jh*i(! T`@a
@#RYV  BBh 4 RBB 4#R @@v  BB  4h6@  ?֨\)  )%@)@? TC {COBWA_Ĩ_֕@@vh6@, \)  )%@)@?T ( @ 4	B) 4*@)*
  ( @9( 4	@(})@? q

K( Q  qH
  *@_ q	K
K* @9_
 q)%

 QK|k`*h})
(H	@
	ɚ@	_	 (@ Qog_WO{  @u 4h"@ q	 Ti@i 4 * R7 
   i@ 	 T4 4  Ҕ^x h@T4  ҕ@9 h@?T4  Ҕ| h@TH4  ҡ^x@n h@TR   R    h@ 4 R: R[ R( R  ֲ 4 h"@  TKZh:  5s )# 9  = <'  5 h@c " #Ti"@	Kk Tzw"  5 h@CT 4 h"@  TKZh  5s )# 9  = <  
 5 h@c " #Ti"@	Kk Tzw  5 h@CT	 4 h"@  TKZh   5s )# 9  = <  5 h@c " #Ti"@	Kk Tzw   5 h@CT 4 h"@  TKZh   5s )h R# 9  = <  5 h@c " Ti"@	Kk Tzw   5 h@CT9 i@?	kT R   R    
    4`@  T  {FOEWD_CgBoA_   @ @ q  T  _ _  _@ 	@(@) ! q T _@4 _I  q@_@  @ 	P@?! q  T_8@4`_T@?
k  T_H@(4_	L@  4  4}S  4 _`__X@  4}S  4_`_	 F    _h  _  R_o_WO{C(  %@@(@ 4  R 7 R8 RE  @A  
BC 
DE 
FG 
HI 
	JK 

LM 

NO 
PQ 
RS 
TU 
VW 
XY 
Z[ 
\] 
^_ 
 h@kb
 TV) R	R"i@h@
}()
 ( T ))
jh*i(! TA  @A  
BC 
DE 
FG 
HI 
	JK 

LM 

NO 
PQ 
RS 
TU 
VW 
XY 
Z[ 
\] 
^_ 
B  R	Ri@h@
a()
 hT ))
jh*i(! T(  AB  4 Rj[	  )%@)@? TC{DOCWB_AoŨ_֠ WO{  %@@   # R>V@ #   R
@ #   RR@ #   RN@ #   R^@ #   R #   R@ #   R
@A @# A9  6
@@ *@ #   R@  *@# :@ #   R|@A :@# wA9 6@:@: J@ #   Rk"@  J@# f# R]	  )%@)@?  T{ROQWP_$ WO{   %@@   t h@vӈ2@  ?`@ b&@  i4  BB  4R BB  4 	R  R]	  )%@)@?! T{GOFWE_ ` ]	  )%@)@? T { @@   {_g_WO{C (@@ R@ @9 q T  Y  W   q` 4   {EODWC_BgA_Rh^   !@3b RB ` 4  !P3t Rb R;   q5
@9I Q?) 1#T	 +3/ R
?(T)		)?T	io8 Q . 1hT  R@Lz@T*`
 iR   !`3b R 5 # b   @	`ө hN   !p3b R 5 # T  @@	`h
) @9 qaT  `@# h  @	`Ih*  @9 qT  `@# [   @	`ө h
  : " J ~r v5@9 q
=@8I Q?) 1T	 +3 R
?T)		)?bT	jo8 Q . 1hT  R@Lz T*` i^ j @9	 Q?) 1b  T  _	 - R*3?
T Q)		)?bT
	hm8 Q - 1hTj  qA  T
 
  )  _ 	 R
 R  `C  aC" /  c!CKR  Є%C % 
  Ц)CR	  . @" TJ	 Q.%h(8 N 9QpK!PJ"o


8/1.18/Ppq"$.焥8/g  &*K
J }S!p
 *q TO 	N  qHT9QcK!CJc q
q 
8/1.18/Ppq"$.焥8/g1  &q *K
J ~S"c
 *q TO 		J1 _ q  T. @CT1  9QqK!QJ1"p
0

8/1.18/Ppq"$.焥8/g  &0*K
J }S!q
 *q TB 	. @CT	  _ q  T j!?*j`  T  _(  __ q(T_WO{   %@@  R o  5
 # TR y   I
 T   3  C TRr$  h^@   c3+  RR +   	
 T   +   	 T  hR@   c3+  RR +   ) T   +   # T"  hN@   c3+  RR + y  ) T   +   # T"  hV@   c3+  RR + a  ) T   +  
  T@	  )%@)@? T{FOEWD_C_ִR x b@c*@     T	?	 cTR x! b@c
@      iUi|ɛ)A ~)	i 	?   T?	 a  T  @   " T;m3m+m#mWO	!  R	 R
  @==
  @==jURJUr  `==R  Ѐ==RMR OoR  =0RROg
N%O
NO
NNOoO  h2  B c   T	A @9\32 Qiqb  T  }b h|xS
K N=N=N=N=N>
N@nGn_nGn_nGn_nGn$N$N*$N$N`NINN퇧N8o8o"8o 8o釥NNONnN.NO/N,,N)NㇶNNdN`N@NbNaNmmNaNCNc8o!8oeN!%NENc%NEN8oB%NceNeN8o%N!eNEN8oEeNNoN8oOoNNNnONE5nj5n+ OJNN8oJ8ojNeNcN%O!N6NOwNN!8oN!"NNB8o "N!bNNB8oBbNBNAN5nBNB8obN!N8NN 8oᇰN !NᇱN!8o!N aNᇵN!8oAaN!N N5n!N!8oaN NN ObNO <NN{NZNB aT T Q&%  |S 
 ~S'
 
 
"U
4
hR !u
 &"f
 * * * * 8 qhTA  _n 4R)K) ) R*
J}S+K
R,}S-*
J
MR-
.!M
,
-iR nR!m
.R)R!i
)*)*)
*)
*	 9  9OIWH#Gm+Fm3Em;Dm_ iURIUr	|)a ~)		K q  T	 qa  T  @  _( q T   RRr  
}Jcq
hT_  R_  a       _   {           0  @ 0  @ 0  
@ 0  @ 0  @ 0  @ 0  @ 0  @ 0  "@ 0  &@ 0  *@ 0  .@ 0  2@ 0  6@ 0  :@ 0  >@ 0  B@ 0  F@ 0  J@ 0  N@ 0  R@ 0  V@ 0  Z@ 0  ^@ 0  b@ 0  f@ 0  j@ 0  n@ 0  r@ 0  v@ 0  z@ 0  ~@ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  @ 0  A 0  A 0  
A 0  A 0  A 0  A 0  A 1  1G  *@ P      P     P  6   P     P     P  '  P  v  P    P      P      P      P      P    P    P    P    P    P  (  P  =  P  S  P  l  P  z  P    P    P    P    P    P    P    P  	  P  3  P  S  P  q  P    P    P    P    P    P    P  <  P  ^  P  ~~  P  {  P  x  P  u  P  r  P  o  P  l-  P  iW  P  fp  P  c  P  `  P  ]  P  Z  P  W
  P  T0  P  QN  P  Nh  P  K  P  H  P  E  P  B  P  ?
  P  <+  P  9K  P  6^  P  3r  P  0  P  -  P  *  P  '  Q<XP  d   $      }         L  A8 8  8 PT$  x       D        &          4    
l     
,H       `  ` l  | 0   'P p (    8   
$<      
`t      D`X         }t @  @, x   <   $               X        
,H      * H  HH (   (    D        ,   D  D, p, , , @ @ @ @ @ x   	                                                                                                  UBL\8    L   $      }        4         0   ,x      =/$@(l   (   ,             1( 4  4 @DL     0            d      (   8    D  Dd L,  &`@ 0       D    
$<      
$<       `  ` p4   L      ,  }u D  D<    <   $               X       }u D  D4    <   $               X          < $,  E1,<4         }        l         0   N4Napi5ErrorE N4Napi15ObjectReferenceE N4Napi9ReferenceINS_6ObjectEEE St9exception St12length_error St11logic_error                                                                                  kAكy!~[тRQl>+h;ʄg+rn<6_:Oɼg	jɼg	j;ʄg+rn<6_:OтRQl>+hkAكy!~[                            	   
         
            
         	      
                                                     
   
                  	         	         
                     
                	                   
                           
            
                   
                  	                  
      
                	            
                     	                         
            	                      
            
      
                              	            
                                   	   
         
            
         	      
                                   z   9         ?  ?  ?   >                 $(,048<4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal Error::New napi_get_last_error_info napi_is_exception_pending napi_get_and_clear_last_exception Error in native callback napi_create_string_utf8 napi_create_error Error::Error napi_create_object napi_define_properties napi_create_reference message EscapableHandleScope::~EscapableHandleScope napi_close_escapable_handle_scope HandleScope::~HandleScope napi_close_handle_scope hash Hash expected 1 argument password salt secret data hashLength m t p version type argon2:HashWorker basic_string Argon2d argon2d Argon2i argon2i Argon2id argon2id OK Output pointer is NULL Output is too short Output is too long Password is too short Password is too long Salt is too short Salt is too long Associated data is too short Associated data is too long Secret is too short Secret is too long Time cost is too small Time cost is too large Memory cost is too small Memory cost is too large Too few lanes Too many lanes Password pointer is NULL, but password length is not 0 Salt pointer is NULL, but salt length is not 0 Secret pointer is NULL, but secret length is not 0 Associated data pointer is NULL, but ad length is not 0 Memory allocation error The free memory callback is NULL The allocate memory callback is NULL Argon2_Context context is NULL There is no such version of Argon2 Output pointer mismatch Not enough threads Too many threads Missing arguments Encoding failed Decoding failed Threading failure Some of encoded parameters are too long or too short The password does not match the supplied hash Unknown error code $v= $m= ,t= ,p= %lu       
   D      H        T     T         T      @    t  l   ̣      t                         $  #  P  H$  `  $  p  d%    &    '  ȫ  '  ث  L(    *  t  *    4,     -  Ȭ  P;    =    0>    0@  4  `A  t  TB    D    E  ܯ  F    H    XH  (  H  8  I  T  J  h  L    \O  h  O  x  Q        S X         
 h   T    X p   	  	  X
    @ , $ L \  <     <" l#  `$ & (  ( ( ) $*  d*  * + , . T1 h1  1 1  3  3  6 	8 E E F 	\H I  L  N 0N S S T xU W X <\ ] ^ a d (e e e e Pj k 	o p 
@t 8w `w |z } h    Ѕ     T               zR x        `        D                                                                                                                X             &                        h                                         #      '      '                      >      ?      0@      `A      TB      D      E      tF      F                      ģ      ȣ      0@      `A              H      I      tF      F             D                  3                 Z      H      8      (                        ڻ                  s      R      :            Ϻ            i      Z      L      3                        ٹ      Ź                  {      i      T      >      +                         Ӹ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8      D      P      \      h      t                                                  ȧ      ԧ                                          (      4      @      L      X      d      p      |                                    Ĩ      Ш      ܨ                                     $      0      <      H      T      `      l      x                                          ̩      ة                                           ,      8      D      P      \      h      t                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ! TAREpRApSBYBTATARA`)" XD`;      @__ZNSt12length_errorD1Ev Qq @__ZTVN10__cxxabiv117__class_type_infoE 0`@__ZTVN10__cxxabiv120__si_class_type_infoE @__ZTVN10__cxxabiv121__vmi_class_type_infoE @__ZTVSt12length_error ` @___cxa_pure_virtual @___gxx_personality_v0 @___stack_chk_guard @_memset @dyld_stub_binder       @__ZN4Napi11AsyncWorker18OnAsyncWorkExecuteEP10napi_env__Pv Qq @__ZN4Napi11AsyncWorker19OnAsyncWorkCompleteEP10napi_env__11napi_statusPv @__ZN4Napi7details12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ @__ZN4Napi7details20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_ @__ZdaPv r@@__ZdlPv @__Znam @__Znwm    r @__Unwind_Resume  r@__ZNSt11logic_errorC2EPKc  r@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc  r@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm  r @__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_  r(@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_  r0@__ZNSt9exceptionD2Ev  r8@__ZSt9terminatev  r`@___cxa_allocate_exception  rh@___cxa_begin_catch  rp@___cxa_end_catch  rx@___cxa_free_exception  r@___cxa_throw  r@___memcpy_chk  r@___sprintf_chk  r@___stack_chk_fail  r@_bzero  r@_calloc  r@_free  r@_malloc  r@_memcpy  r@_memmove  r@_memset  r>@_napi_add_finalizer  r>@_napi_call_function  r>@_napi_close_escapable_handle_scope  r>@_napi_close_handle_scope  r>@_napi_coerce_to_number  r>@_napi_create_async_work  r>@_napi_create_buffer_copy  r>@_napi_create_error  r>@_napi_create_function  r>@_napi_create_object  r>@_napi_create_promise  r>@_napi_create_reference  r>@_napi_create_string_latin1  r>@_napi_create_string_utf8  r>@_napi_create_type_error  r>@_napi_define_properties  r>@_napi_delete_async_work  r>@_napi_delete_reference  r>@_napi_escape_handle  r>@_napi_fatal_error  r>@_napi_get_and_clear_last_exception  r>@_napi_get_cb_info  r>@_napi_get_last_error_info  r>@_napi_get_named_property  r>@_napi_get_property  r>@_napi_get_reference_value  r>@_napi_get_typedarray_info  r>@_napi_get_value_string_utf8  r>@_napi_get_value_uint32  r>@_napi_has_property  r>@_napi_is_exception_pending  r>@_napi_open_escapable_handle_scope  r>@_napi_open_handle_scope  r>@_napi_queue_async_work  r>@_napi_reject_deferred  r>@_napi_resolve_deferred  r>@_napi_set_named_property  r>@_napi_throw  r>@_napi_typeof  r@_pthread_create  r@_pthread_exit  r@_pthread_join  r@_strlen  r@_strncmp         _ 
        8OnAsyncWorkExecuteEP10napi_env__Pv 9OnAsyncWorkCompleteEP10napi_env__11napi_statusPv v v  12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ u20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_ z 11AsyncWorker1 7details          ncodedlen rror_message          create exit join    hread_ ype2string    _ctx  ctx e hash t verify        encoded raw    _ctx  ctx hash_ verify        encoded raw    _ctx  ctx hash_ verify        encoded raw    _ctx  ctx hash_ verify  _ d_  _ d_ i  llocate_memory rgon2          key param  _      final init long update  _  64len lake2b      lear_internal_memory opy_block  Ԫ    ܝ      first_blocks memory_blocks segment  ܇  ll_ nalize    i ree_memory  Đ        _hash 	ize 	 _block_value 	ial 	 dex_alpha 	it 	 ;  ;    api_register_module_v1 	ode_api_module_get_api_version_v1 	umlen 	       
FLAG_clear_internal_memory 	_ZN4Napi a b c decode_string encode_string f 	in 	n 	secure_wipe_memory 
validate_inputs 
xor_block 
   ;L@xL(x@@P$`400,40,ll<	(	<<        ^  <   BEa         @          G      [    G          ;         @;                    c          q          q           d      
          #          7          K    c      _    tg      n    j          l          f          f          k          $l          l          Pf          f          k          n      3    l      A    g      X    Dg      k    l      |    o                    |{          0z          ls          $t          r          |          xu                          &    T      5          D    ܎      W           k    S      y    ܃                    D                    4          $                              P                "          3          >            N            h                                                `                                                                         K            a            i            q            x                                                                                                
                        '            9            L            S            [            a            i            q            z                                                                                    	            .	            A	            W	            k	            	            	            	            	            	            	            
            *
            >
            P
            s
            
            
            
            
            
            
                        2            E            `                                                                                                                         .            <            D            M            ;   <   >   ?   @   A   B   C   H   I   J   K   L   M   N   O   Q   S   T   U   W   X   Y   Z   [   \   ]   ^   _   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~                                                =         G   R   V      ;   <   >   ?   @   A   B   C   H   I   J   K   L   M   N   O   Q   S   T   U   W   X   Y   Z   [   \   ]   ^   _   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~                                            _FLAG_clear_internal_memory __ZN4Napi11AsyncWorker18OnAsyncWorkExecuteEP10napi_env__Pv __ZN4Napi11AsyncWorker19OnAsyncWorkCompleteEP10napi_env__11napi_statusPv __ZN4Napi7details12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ __ZN4Napi7details20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_ _allocate_memory _argon2_ctx _argon2_encodedlen _argon2_error_message _argon2_hash _argon2_thread_create _argon2_thread_exit _argon2_thread_join _argon2_type2string _argon2_verify _argon2_verify_ctx _argon2d_ctx _argon2d_hash_encoded _argon2d_hash_raw _argon2d_verify _argon2d_verify_ctx _argon2i_ctx _argon2i_hash_encoded _argon2i_hash_raw _argon2i_verify _argon2i_verify_ctx _argon2id_ctx _argon2id_hash_encoded _argon2id_hash_raw _argon2id_verify _argon2id_verify_ctx _b64len _blake2b _blake2b_final _blake2b_init _blake2b_init_key _blake2b_init_param _blake2b_long _blake2b_update _clear_internal_memory _copy_block _decode_string _encode_string _fill_first_blocks _fill_memory_blocks _fill_segment _finalize _free_memory _index_alpha _init_block_value _initial_hash _initialize _napi_register_module_v1 _node_api_module_get_api_version_v1 _numlen _secure_wipe_memory _validate_inputs _xor_block __Unwind_Resume __ZNSt11logic_errorC2EPKc __ZNSt12length_errorD1Ev __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_ __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_ __ZNSt9exceptionD2Ev __ZSt9terminatev __ZTVN10__cxxabiv117__class_type_infoE __ZTVN10__cxxabiv120__si_class_type_infoE __ZTVN10__cxxabiv121__vmi_class_type_infoE __ZTVSt12length_error __ZdaPv __ZdlPv __Znam __Znwm ___cxa_allocate_exception ___cxa_begin_catch ___cxa_end_catch ___cxa_free_exception ___cxa_pure_virtual ___cxa_throw ___gxx_personality_v0 ___memcpy_chk ___sprintf_chk ___stack_chk_fail ___stack_chk_guard _bzero _calloc _free _malloc _memcpy _memmove _memset _napi_add_finalizer _napi_call_function _napi_close_escapable_handle_scope _napi_close_handle_scope _napi_coerce_to_number _napi_create_async_work _napi_create_buffer_copy _napi_create_error _napi_create_function _napi_create_object _napi_create_promise _napi_create_reference _napi_create_string_latin1 _napi_create_string_utf8 _napi_create_type_error _napi_define_properties _napi_delete_async_work _napi_delete_reference _napi_escape_handle _napi_fatal_error _napi_get_and_clear_last_exception _napi_get_cb_info _napi_get_last_error_info _napi_get_named_property _napi_get_property _napi_get_reference_value _napi_get_typedarray_info _napi_get_value_string_utf8 _napi_get_value_uint32 _napi_has_property _napi_is_exception_pending _napi_open_escapable_handle_scope _napi_open_handle_scope _napi_queue_async_work _napi_reject_deferred _napi_resolve_deferred _napi_set_named_property _napi_throw _napi_typeof _pthread_create _pthread_exit _pthread_join _strlen _strncmp dyld_stub_binder radr://5614542              X            D       d   X        i`                                                 argon2.node Gl?VH
vG'~Bf6YdF )	gT'b4gADiHĻ=sI[Vӯ	!
YM0]ZfA>bp[G~L9{V'Hg`< '%nġRh|i7սֱ| In8OS&A~z'"*Y&$Q%yJԻ !2'bq^	yϞFc#	O%(RiWRׂCT5(1	g	(iOCO?cfynPxlUS.#k˂w4S.%U+Xh i_n2AX'XofkOX||zڽH,XofkOX||zڽH,XofkOX||zڽH,වƾz?ٺ#:'J vbR7XofkOX||zڽH,XofkOX||zڽH,XofkOX||zڽH,1#=u_
	PE\dWVf~؜B>&.m6B]M2Z
5)u]rbIG,}2z^                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   0            __TEXT                                                     __text          __TEXT          /            /                           __stubs         __TEXT                                               __stub_helper   __TEXT          ,            ,                           __gcc_except_tab__TEXT                                                   __cstring       __TEXT                "                                   __const         __TEXT                `                                   __unwind_info   __TEXT          @      x      @                             __eh_frame      __TEXT                H                                        __DATA                  @              @                   __nl_symbol_ptr __DATA                                         G           __got           __DATA                `                       H           __la_symbol_ptr __DATA          h      8      h                T           __const         __DATA                                                 __data          __DATA          (            (                               H   __LINKEDIT       @     h-       @     h-                    "  0    @      @ x  A    D @  L         pT    _ x
     P             B   C   N                           ]                          >'=_~$       
  
    0          $   /usr/lib/libc++.1.dylib    8           '   /usr/lib/libSystem.B.dylib      &      S    )      pT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     UHAVSH0IG uHI^ HuX
IF(I^ HuII~ tBI~H5  H  HEHUH}Hus
  t	I~0  HEHCEuHI^0HH0[A^]H譣  讣  H$   @ UHHHH:  fD  Pt  E  D  UHAVSHH  HHHwHtH{  HC    CHt	H{X  Hs8Ht{@ u	H{0迣  HC8    Hs Ht{( u	H{蟣  HC     [A^]HbHZIH{H茢  H{0   HHI   L1UHSPHwHtH uH;8  HC    H[]Hf     UHSPHwHtH uH;  HC    H[]Hf     UH	   ]D  UHAWAVATSH@IHH5  11  IEEhashE H]LuH]HuH艡  Et	H}螡  LeHuEtH]HLHL趢  uEt	H}e  LH@[A\A^A_]ÿ8   c  IHL  H5  H  LW  HILA   HIEt#H}HIHIEt	H}  u%L  H    E1_I  Lx  HPUHSPHH(  HHG t	H{0膠  Hl  HsHt{ u	H{2  HC    H[]H UHSPHH  HHG t	H{0&  H  HsHt{ u	H{Ҡ  HH[]  H@ UHAWAVAUATSHHHP H[A\A]A^A_]Iƃ   L͟  HHQIH  Hs}IHsC6ELeMu(4MIILs  IHEILmLuLLL蠟  C4 HHHuH  Et	H}"  A  FH}0  IEtH}  I  L譞  HD  UHAVSH Ht3H{H}Huޟ  u6H]H}{0  H}Hu  uG{` u	HHP8H [A^]ÿ8   茞  HHuH9  H5  H  H  H=  H5ϫ  fIHY  L  Iƃu'L5  H  .  ^II  H}Huc  tH=T  H5g  XHnHfH^f.     @ UHAWAVATSH H8 t^HHw HtH{HUy  uNLuE1L{0HHS0LeLHP@LLL0  H}Ht	H}8  H [A\A^A_]ÿ8   9  IHsH  H5  H`  L,  HL  HH}HuH蟜  H}Ҝ  H莜  f.     @ UHAWAVSH(HD  H HEH8 tXIHHw HtH{HUz  uXL}E1H0Ly  HUHEHEHE   HUHLv2  H  H H;EuH([A^A_]d  8   0  IHsH  H5v  HW  L#  HL  H褛  @ UHHtH]`]f.     @ UHHWHG    ]f     UHAWAVSHIHH?H}Hu虜     HsHtH;HUX  )  L;HuL;1HMLL'     LuH}Hu8  u(} t"HsHt_H;HU  3  L3 H}HuHML谛     LuH]H}Hu3  uzLHH[A^A_]L31׿8   賚  IHuH`  H5  H  L覚  8   脚  IHL2  H5  H  Lx    H=b  H5     8   9  IH3H   H5  Ha  L-     8     IHuH   H5L  H-  L     8   ҙ  IH3H   H5  H  Lƙ  ]&HL諙  HL螙   
H
HH}Huș  uH  H=i  H5  HUHAWAVAUATSHIIHE    HuL     HEL(D`HuL     } t#HuL覙  tjH=Ť  H5  5MH  IEH  HMLHH=     AwB   Ds7HUHML1  u7HULL   LH[A\A]A^A_]HUHML1跘  tH=$  H5  H=  H5  H=  H5  nH=  H5]  [f.     UHAWAVATSHPHwHG    G H2  HHWG HG0    H   IIHLwHHֺ   L  tjHuL  ugHD  HEWEELeE   HE    HuHM   L՗  u:HuL   L襗  u7HP[A\A^A_]H=  H5  ](H={  H5  HH=f  H5  3 IHC  t	H{0蔖  Hz  HsHt{ u	H{@  I    L)  HUHAWAVSPIHH>HvLE11@  umWHC    HuHH  HuH1ؕ  I>HHHHSHESIv   HEE1  u<HH[A^A_]ÿ8   Օ  HI6HH5  H  Hɕ  8   觕  II6HUH5  H  L蛕  IL舕  IH{  L
  It	H{8  L  @ UHAWAVSHHHH}Hu1  u>H{ tLsH  LH-  u`H}HuP  u:H[A^A_]ÿ8   ה  HHuHH5  H  Hʔ  H=  H5  |8   蓔  IHsH@H5  H  L膔  KILq  IHd  IH}Hu蠔  uL  H=  H5  HHf.     UHAWAVSH(HHwH   H{HU辔     H{HuHU     }tdE LsL}H5  L   HMLL腔  } t4LsL}H5T  L   HMLL;  u[HCHUHCHUHC1H([A^A_]ÿ8   *  IHsH48     IHsH8     IHsHH5:  H  L   HLҒ  Hd  @ UHAWAVSPIHt3HH  HMLHH!  u,HULH[A^A_]ÿ8   e  IHL8   K  IHLH5  Hs  L?   HL,  H辑  f.     @ UHAWAVAUATSPIIII   ԑ  HL(LxH
  LMLLHI4  u6HuH
  LHE1E1  uHULH[A\A]A^A_]H\  8   j  HHLH5  H  H^  IHM  Lߐ  f.     D  UHAWAVAUATSH   H C  H_HG(L0    IH  HHL謑    HHHr  H_  H@HLu    H@HH;  H-  HhHL>    HhH@H  H  HMHL
    HUHhH  Hѝ  HMHLِ    HuHUHO  1  HuHUHǐ  L  DeH  HMHL臐  ]  HuHUH  x  HuHUHu    DmH:  HMHL5    HuHUH諏    HuHUH#    EȉEH  HMHL    HuHUHW    HuHUHϏ    EȉEH  HMHL荏  .  HuHUH  I  HuHUH{  d  EȉEHJ  HMHL9  s  HuHUH诎    HuHUH'    DuHuH蝎    HEH]HEHݛ  HMLH  H  II_hIwpIWxH[    DuWA   IǇ       Hc H
w
H
  L4E1DmDeI   HELI  LIsC6HMHAM   Is1IMfIL%  I   IM   M   IrK.H9
  J0I9   HMLMHLHt'1f.     fHH9uHI)HIr`1f.     D  TTTTTTTTTTTTTTHI9uB0 Hc(H
w
H
  L4E1I   HEL0I5  L8IsC6HMHAM   Is1IMfIL΋  I   IM   M   IrK.H9  J0I9  HMLMHLHt 1D  HH9uHI)HIr`1f.     D  TTTTTTTTTTTTTTHI9uB0 HcPH
w
H
P  L4E1I   HELXI  L`IsC6HMHAM   Is1IMfIL~  I   IM   M   IrK.H9  J0I9s  HMLMHLHt 1D  HH9uHI)HIr`1f.     D  TTTTTTTTTTTTTTHI9uB0 HcxH
w
H
   L4E1DmM   LuI  LeIsC6A IM   Is4LI^HH7  II   HI   M   IrK4I9C  K0I96  LLLLOHHt&1f.     HH9uHH)HIr`1f.     D  LLLLLLLLLLLLLLHH9uC0 E   EA   EA   EA  EA  EA  IIw.  Q
  IGhIWxH   [A\A]A^A_]I s21  I sQ1  I sp1{  I    1v  LHHyHHHH`   1   LHHyHHHH`[  1  LHHyHHHH`/  1  LHHpHHHуH`  1t  HH1 AD= AL=8L8AD= AL=0D8 L80AD=@AL=PD8@L8PAD=`AL=pD8`L8pHHuHt5J4/HHHH1D  DDH H9uI9AA  LHH4EAJ<+f.     fIT
 HHH9uI9*HH1    AD= AL=8L8AD= AL=0D8 L80AD=@AL=PD8@L8PAD=`AL=pD8`L8pHHuHt5J4/HHHH1D  DDH H9uI9[AV  LHH4EAJ<+f.     fIT
 HHH9uI9HH1    AD= AL=8L8AD= AL=0D8 L80AD=@AL=PD8@L8PAD=`AL=pD8`L8pHHuHt5J4/HHHH1D  DDH H9uI9Ak  LHH4EAJ<+f.     fIT
 HHH9uI9_HH1    A4AL4A0AL0AD4 AL40AD0 AL00AD4@AL4PAD0@AL0PAD4`AL4pAD0`AL0pHHuHt>I4HLHH1f.     @ D::D>>H H9uI9AttLHIDI4II HH9uI9IEAHHIEAHHPIEAHHIDLHH=I  H5G  8   襂  IHHSH5  Hͮ  L虂    8   r  IHH H5  H  Lf    8   ?  IHHH5  Hg  L3  S  8     IHHH5S  H4  L      8   ف  IHHH5   H  Ĺ    8   要  IHHTH5  Hέ  L蚁    8   s  IHH!H5  H  Lg    8   @  IHHH5  Hh  L4  T  8   
  IHHH5T  H5  L  !  8   ڀ  IHHH5!  H  L΀    8   觀  IHHUH5  HϬ  L蛀    8   t  IHH"H5  H  Lh    8   A  IHHH5  Hi  L5  U  8     IHHH5U  H6  L  "  8     IHHH5"  H  L    8     IHHVH5  HЫ  L    8   u  IHH#H5  H  Li    8   B  IHHH5  Hj  L6  V  8     IHHH5V  H7  L  #  8   ~  IHHH5#  H  L~     8   ~  IHHWH5  HѪ  L~     8   v~  IHH$H5  H  Lj~     8   C~  IHHH5  Hk  L7~  Z8   ~  IIwhHH5Y  H:  L~  )H}  H}t  H}i  L_  8   }  IIwHdH5  Hީ  L}  HL}  H+}  HL}     *(&$" 
 HLJ}     HHE u#HE u=HE uWLH ut   I   |  HE tHHE tI   |  HE tHHE tI   |  LH u HLH tI   q|  HL
 HLE|  H|  UHHH}HuH}Hu3   H]f.      UHHt	H]{  ]f.     fUHAVSHpHHH}H   HEHHHMH}HH}Ht{  HHp[A^]HIH}Ht
{  HIƃu!L{  HC{  1I{  L{  HfUHAWAVATSIIHH   HwHWLGHG    HO0LOhLg WG0G@GPG`HG    HO(HHL{  uMHC H;v;   HHHAz  HC`HC(LLLHE1E1{  u$[A\A^A_]ÿ8   z  IHsHN8   z  IHsH3H5̦  H  Lyz   HLfz  Hy       UHAWAVSHHH7HWG    HG    H   LsL{H$    HHLLE1E1z  upHC     HE    H;HsH$    LELLE1z  HMHK t(8   y  IH3HQ1C   WCH[A^A_]ÿ8   py  IH3HH5  H  Ldy   HLQy  Hx   UHSPH   u>   uJ   uV   ub   tH   x  HH[]H   x     tH   x     tH   x     tH   x     uf.     UHSPH   uF   uR   u^   uj   tH   *x  HHH[]x  H   x     tH   w     tH   w     tH   w     ufUHAWAVAUATSH   IL         u>DIHL)   A   h  LL)H9rC+  Mf)  M   I9shL)6  IIIIHLL)H9sJ+HL)HL)H9a  uEIFFAD  AA    I    I   A    I   HEH]HHI9w K H9HBHAHH   HCLEH}sv  IMH}  LMHIT  J/I9sK,LMHH95  I s1   LHHpHHHуH`s1iHH17L7A4AL4D7 L70AD4 AL40D7@L7PAD4@AL4PD7`L7pAD4`AL4pHHuHt4H7HLHH1@ DDH H9uI9   AtAMILLEAJ4f.     @ HIHI9uM9u   H4EALHMALHt 1D  HH9uHI)HIr`1f.     D  TTTTTTTTTTTTTTHI9uH}tQt  M   HUHI   H]M   K<,H-t  IAuCD- AC, AuIH"M   C, AtI   M   L(0A   uI   HHI   I   H8@A   uI   HHI   I   HHPA   uDI   H1<HCHXH艅`A   tPI   HtI   I   HtI   
1Hh81HX`A   uI   H1<HCHhH艅pA   xA   tA  |EWEE   A  EA  H(h     $  IHs  H   IHsCD- ELeMu(4LHHH
r  IHEHH]LmLLL:r  C, IHHuLq  Et	H}q  Hĸ   [A\A]A^A_]H}e  LM  HEt	H}q  HCq   UHAWAVSH8HLw   @uH   HHH   H   LEL1q  u0HUH}LHUH{hHspBr  u9H8[A^A_]ÿ8   	q  HHLH5P  H1  Hp  8   p  IHshHH5!  H  Lp  ILIHp  LGp      UHAVSHH~H{hHspq  u[A^]ÿ8   bp  IHshHH5  H  LUp  HLDp  Ho  fD  UHAWAVSHIHHv  HHHwWGG( G0G@ GHGQHMHHHdp  u9H{IvHUHCH$H
  L  Ip  u<H[A^A_]ÿ8   o  IHsH4H5͛  H  Lzo  /8   Vo  IHsHH5  H}  LIo   IL4o  IHCH t	H{Xn  Hs8Ht{@ uHC0H8o  HC8    Hs Ht{( uHCH8o  HC     Lin  HAH9f     UHHHHIHH]f     UHHЉHHHIH]    UH
n      UHm      UHAVSH@HCHuiHHtjHSHHsLuL   HHLP0Hs  HHEEt	H}m  H}m  HuHt#} uH}{n  HCPHuHHP(1H@[A^]H,HH
  HHEEt	H}gm  H}Lm  HuHt} u	H}n  Hm  Hf.     UHAVSHHIt
HBHRHHHMHHHm  u1HUHMH1km  u5HULHLH[A^]ÿ8   l  IHHx8   l  IHH^H5  Hؘ  Ll   HLl  H#l   UHAWAVATSH HIIH?H}HuTm     IwHtI?HUm  9  M'HUM'1LHKL)HLMLLPl     H]H}Hul  u(} t"IwHtaI?HUl  5  M7 H}HuHMH]l     LuH]H}Huk  u|LHH [A\A^A_]M71տ8   ^k  IHuHH5  H  LQk  8   /k  IHLH5v  HW  L#k    H=
x  H52x  _   8   j  II7HH5+  H  Lj     8   j  IHuH^H5  Hؖ  Lj     8   }j  II7H+H5Ė  H  Lqj  ]&HLVj  HLIj   
HHH}Husj  uHi  H=w  H59w  fH|f.     fUHAWAVATSH HIIH?H}Huj     IwHtI?HUj  2  M'HUM'1LHKLMLLi     H]H}Hu\j  u(} t"IwHtaI?HUj  5  M7 H}HuHMHi     LuH]H}HuWi  u|LHH [A\A^A_]M71տ8   h  IHuHH5  H  Lh  8   h  IHLTH5  HΔ  Lh    H=u  H5u     8   [h  II7H	H5  H  LOh     8   (h  IHuHH5n  HO  Lh     8   g  II7HH5;  H  Lg  ]&HLg  HLg   
H,HH}Hug  uH0g  H=t  H5t  HUHAWAVAUATSHX  H͓  H HEHHHG  IHH AE$HHHt         HE11-  HHHHHHAEHAEHAE$H      L   LVf  H   HBf  HHLLL1q  HLL1a  HHA   % DEǅ    AuADEeAC7H1ۉ1HF	IE HH
HHH   e  LE9Ly   A  HDH   fD  HňHH 1Au ILD LED1I9LH5  IE AMIH
HH
HDH
HA}  H  AE;u  HF<0D<   LLVd     HEd  HLHLL1t  HLL1`  HDHLHHD  LHF$1D1F|1DELH
HHH 1AuEDMILDELEH1I9LHv4  IANIMLH
HH
HI
IA}  HLd   AE;us*AA}Iu DDDD Ha  H H;EuHX  [A\A]A^A_]b  f     UHH  H&  H HE1t1offoffHH=   u<W))oDfDfDf H H=   u1fDot  f.     fofodfoD fo\0fofffffofffffod`ffolpffpfDpͱfol@fofffffotPfAoffAfffffA8 fA8 fDofDffEfDfofffffAfDDp9Ap9Ep9Ap9fDofDffEfDfofffffAffofs?fsffofs?fsffof:f:fD:fD:fofAfDffAfofffffpʱfEpܱfDfpͱfEpɱfDfAoffAfffAofAfEffAfofA8 fA8 ffofA8 fA8 ffofffff<fofffffLfAfAp9Dp9p9p9fAoffAfffofffffffofs?fsffofs?fsffof:f:f\ fD0ft@flPf:fA:fL`fTpHH=   Hffo   fo   fo  fo   fofffffofffffo  ffo   ffDpԱfDpͱfo  fAoffAfffo   fAoffAfffffA8 fA8 fofffffofffffDfDEp9Ap9Ep9Ep9fDofDffEfDfAoffAfffAffofs?fsffofs?fsffof:f:fD:fE:fofffffofffffpڱfEpұfDfpݱfEpɱfDfAoffAfffAofAfEffAfofA8 fA8 ffofA8 fA8 ffofffff   fofffff   fAfAp9Dp9p9p9fAoffAfffofffffffofs?fsffofs?fsffof:f:f  f   f  f   f:fA:f  f   H1f.      (W)fo fDfDDH H=   uH  H H;Eu	H  ][  UHtt0uBH
Bi  H3i  HD]ÅH
Mi  H=i  HD]ÅH
&i  Hi  HD]1]     UHAVSH@AH
3     AwCPKT    9B4    1S\UHE    SLUĉuȉEEЉMԋCXEDu9vMH}HW?  uH}:,  uHuH(  1H@[A^]f.     D  UHAWAVAUATSH   LH z  HEH g  IHM HH N  H?  MMAUH	Z  H   M@U8HXHu `LhADpLxHUUHE    E    HE    E    D}]]ԉ]]WEE    MIHXD9tLHu '  L}{Le LLu(H}HtHLBY  MtBL}0Mt9HXLLDF  t HL&  LL&  H߻HL&  H1X  HĈ   [A\A]A^A_]f.     fUHH@LUEHE(HD$ D$L$D$0   D$(   HD$     H@]f.     UHH@(EHE WL$HD$$D$0   D$(   H@]@ UHH@LUEHE(HD$ D$L$D$0   D$(    HD$    pH@]f.     UHH@(EHE WL$HD$$D$0   D$(    *H@]@ UHH@LUEHE(HD$ D$L$D$0   D$(   HD$    H@]f.     UHH@(EHE WL$HD$$D$0   D$(   H@]@ UHAWAVAUATSH   HH A   IAH   HILMW  IH    DxDXLV  HEHpLV  HPE1AH} t.Ht)L`hHPLU<  t;E1AHp9V  HP-V  L%V  DHĈ   [A\A]A^A_]LPXV  HPHtHPuuDXMH  HPAs	11  DʃHrIIIH   LHHf1ffɋ9D9A3?A3D?fnfnf`faff`fafD9\9A3D?fnA3\?fnf`faff`fafHHu
f1fAt49A3?t9fnA3t?fnff`faff`fafffpffpUff~L9tA2	HI9uA   BE1:D  UHAWAVSPII)Y  ENMJ  IAs	11  DʃHrIIIH'  LHHf1fff.     f9\9A3?A3\?fnfnf`faff`fafD9\9A3D?fnA3\?fnf`faff`fafHHuAt49A3?t9fnA3t?fnff`faff`fafffpffpUff~L9t!f.     A2	HI9u   t1H[A^A_]f1fA[    UH   ]UH1]@ UH   ]UH1]d@ UH   ]QUH   ]AUHAWAVSPII1)Y  ENMJ  IAs	11  DʃHrIIIH'  LHHf1fff.     f9\9A3?A3\?fnfnf`faff`fafD9\9A3D?fnA3\?fnf`faff`fafHHuAt49A3?t9fnA3t?fnff`faff`fafffpffpUff~L9t!f.     A2	HI9u   t1H[A^A_]f1fA[    UHAWAVSPII   V  ENMG  IAs	11  DʃHrIIIH$  LHHf1fff     9\9A3?A3\?fnfnf`faff`fafD9\9A3D?fnA3\?fnf`faff`fafHHuAt49A3?t9fnA3t?fnff`faff`fafffpffpUff~L9t!f.     A2	HI9u   t1H[A^A_]f1fA[    UHAWAVSPII   V  ENMG  IAs	11  DʃHrIIIH$  LHHf1fff     9\9A3?A3\?fnfnf`faff`fafD9\9A3D?fnA3\?fnf`faff`fafHHuAt49A3?t9fnA3t?fnff`faff`fafffpffpUff~L9t!f.     A2	HI9u   t1H[A^A_]f1fA[    ##wUHHcH
b}  H]H$_  f.     fUHAWAVAUATSPEAAAIcH
B~  H<ON  HEЉK  HDK  IDK  IDK  IDK  Iǿ   K  H]LLLLHHH[A\A]A^A_]ÐH   H   UHW                     GpG`GPG@G0G G(_  G0( _  G (^  G(^  HH1HFH1GHFH1GHFH1GHF H1G HF(H1G(HF0H1G0HF8H1G8   1]f.     fUHAVSAH   HHFH@r+   HP      tHCXHCP   W                     CpC`CPC@C0C C(]  (]  C(]  C (]  C0HH
  H1   E1D[A^]    UHAVSH   HH
 w  H	HMAHt3HHNH@rI   HL      tHCXHCPHv  H H;E,  DHĐ   [A^]HtHtHAsW                     CpC`CPC@C0C C(
\  (
\  K(
\  K (
\  K0H	H  H1   )E)E)E)E)E)E)p)`L`   LHHiI     HL7      L
  E1Hu  H H;E<I  f.     @ UHAWAVAUATSP1H   IH   IH   I~P    IA   HH         H)I<H`Mn`LHH  IF@HIF@I^HLL   Aǆ       I)L1I   rFf.      IF@HIF@I^HLHT   IǀHI   wA   LI<H`HL8H  E   1H[A\A]A^A_]f.     UHAWAVAUATSHX  H=t  H HEFp)EF`)EFP)EF@)ENV ^0)])p)`)POW _0) )))HтRQH3G@HHl>+hH3GHHIkAكL3OPHy!~[HH3WXLHLHHL HH6_:OHH+rn<HH;ʄgHHɼg	jH<   HLfD  LLLMH=QY  E\8HNPE\8ILJPHB|HPHFTHL1H LIIHH1H HM1LILL1I(H(I1MI NPHLX  FDHLHH1HH(JPHHB|MM1HPI0LI1I1I0LLHB|I0HPH1LLHMH IHHLH1H(I1LMHHMB|L3HPIL1H1IH0HхHH1IHхMHB|LPL1HH HB|HPILM1HI(LHB|HPMHB|I1LPLHB|I HPHFdMLI1I L1MLML1H(H(I1HI JPHH5oV  t7L%dV  LL3HI(HPLHB<'HPHL1H0I1I0LILMI1LHL1LI0LMLLM1IHLM1MI1HI0ILHI1LIIH@HH<  HL37L3L7H3OH3HOH3GH3HGH3_H3H_L3o L3Lo H3w(H3Hw(L3W0M1LW0L38I1L8Htn  H H;EuHX  [A\A]A^A_]A  f.     fUHAWAVATSHPH2n  H HEظH   IH   H   H9   H{P       HC@HSH     tHCXHCPH<H`L{`   )*A  HLQ)EC)EC )EC0)E   LeLL3A  @   L     L  @   H  1H
Em  H	H;Mu
HP[A\A^A_]@  fUHAWAVAUATSH   IHIIHm  H HEAHu	M&  M  M  I@
  MM   I@   Mt"HLLLZ      W)E)E)E)E)E)p)`)P)@)0) (R  )(R  )(R  ) (R  )LH
  Hɼg	jH1HDmHHLQxHLL{AH   
  Hk  H H;EuDH   [A\A]A^A_]+?  f.      UHAWAVAUATSHx  H]k  H HEǅl    HH AW  IIHIlH@wCHCH@  H   Z   tHǅHHǅ@  HHɽg	jW)0)@)P)`)p))))))(P  )(P  ) (P  )(P  ) Hǅ@   HHl   A3  HLL{  HH@     ((AOADcI AAV  L Hf.     f(((())))pWA   A   A   AFpAF`AFPAF@AF0AF AFA(_O  )(O  )(cO  ) (EO  )HHɽg	jHE@   @   HHp2  @   HHVHAž   	  E  ((AOAAI A@(((())))pEA	  EW)E)E)E)E)E)p)`)P)@)0) (N  )(N  )(N  ) (N  )LH
  HHɽg	jH H1HDeHHp@   E  LHLLþ   L  ?  HLL:  E1%  W)))))))p)`)P)@)0(L  )(L  ) (L  )(L  ) HH
  HHɽg	jH H1HHHl   xWHLLxAHLHA*H   S  H   @  AH   )  He  H H;EuDHx  [A\A]A^A_]M9  UH   N9  ]UH   89  ]UHH   H9vDH   H9v81fHH1HLH1LHLH1LHLH1LHH=   u]NWGWO _0GF WN0WG O0F@NPW@WGPWW@GPF`NpW`WGpWW`Gp         W   W               W   W               W   W               W   W              W  W        0     W0  W   0  @  P  @  WP  W@  P  `  p  `  Wp  W`  p        W  W          W  W          W  W          W  W            W  W        0     W0  W   0  @  P  @  WP  W@  P  `  p  `  Wp  W`  p        W  W          W  W          W  W          W  W            W  W        0     W0  W   0  @  P  @  WP  W@  P  `  p  `  Wp  W`  p        W  W          W  W          W  W          W  W    ]D  HH¹HtAu=UHSPHHO`Ht
HHHH2  H1HEH[]f     UHAWAVSPHIIHك=c   tMtLHP   IGhLHtHH[A^A_]H[A^A_]`2  fD  UH=mc   tHt]   ]fD  UHHH}HuH9c  H}HU1H]    UHAWAVAUATSH(  H=^  H HEHS  HHG  HL+DcLH
J4(H H   1  HDCI@  G$AM   IE0HMU   1Df     HDL9   AI
DDH
IHH9sILHH9s:M1D  IDH1ݸIH1HH   u     LE1fD  CDCLBWBWBBBBCDWCWBBII   u1Ÿ))HH=   uLI>AvH   =a      H   =`   tnH   HXH
=`   L tMtLHcIFhLHtDHH[  H H;EuDH(  [A\A]A^A_]HL XH
IFhLHuH/  H[  H H;Et'/  f     UH> t#DODGt6DADFFu1IDFEt.DGFt,AA*~EFtDDFAA E1A@LȉHH DHH H)ЋOHH t
1HH]1]f.     UHAWAVAUATSH(H  DM   H}  HG     I       1D  1HH9  tEH}  A E1I1f.     D  LH	LLH}HAGMH9rE1  E1E1H]fD  A ILH	HLH}ICH       II9rI          E1E1f.     D  A ILH	HLtH}ID{H       IM9rI       EtSE1E1A ILH	HL$H}ID{H       IM9rI       	H]E1CDHH9}10     L\,  H  Iľ   L>,  H  IHEx   1HE   Lu    z  LME1Lm    AE I9rD)I<+    HEED}E E    LmL+EȉCẺCEЈCEfCEӈCEԉCLH5"  H*  	  IAMIHI9iA+E 9Lus#I<*    HHEHH9r߸      LME1LmAE I9rD)I<7*    HEED}EE    LmL+EȉCẺCEЈCEfCEӈCEԉCLH5@  H)  '  IAMIHI9iA+E 9Lus#I<)  2  HHEHH9r߸      LME1LmAE I9rD)I<U)    HEED}EE    LmL+EȉCẺCEЈCEfCEӈCEԉCLH5^  H(  E  IAMIHI9iA+E 9Lus#I<(  P  HHEHH9r߸       LME1LmAE I9rD)I<s(     HEED}EE    LmL+EȉCẺCEЈCEfCEӈCEԉCLH5|  H'  ugIAEIHI9mA+M 9LusI<'  uvHHE@H9rHUHMHU;Qa1)L/Et1fI<'  HI9uLuLG(  L?(  H([A\A]A^A_]ûf.      UHHtH? ts]ø]ø]H    H  O(   rH0    H@    WPrOT4    9rL        yOX    ]H` HOhtnHuw]ø 7MɹD]ø8 KH B]ø]ø]øH1]     UHAWAVAUATSH  HR  H HEЃ~   II1LmL  f.     f((L(( D L0(( D@LP(0(@D`Lp(P(`      (p(      ((      ((      ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(    ((    ((    ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(    ((    ((    ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(M    (E(M    (E(M    A;\$  AF@    A^D   H   LLI$AT$HH
H4I9vmH4H   I9s]H
HH1HHTHHTHHTHHHH   u  f.     ((L(( D L0(( D@LP(0(@D`Lp(P(`      (p(      ((      ((      ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(    ((    ((    ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(    ((    ((    ((     ((    0  (( @  P  (0(@`  p  (P(`    (p(M    (E(M    (E(M    AF@      H   LLKI$AT$ӃHH
H4I9H4H   I9H
HH1    HHTHHTHHTHHHH   u=N   tH   HJ  H H;EuH  [A\A]A^A_]  f.     UHAWAVAUATSH  HI  H HEH  IH  AHL@   LoCTL   LLC   LLCP   LLCL   LLC\   LLD   LLtC   LL[HsHt(SHCCptH{s1C    C(HH   	Hs HtS(HC8HH   Hs0Ht(S8HCptH{0s8C8    CHHH   ~Hs@HtSHHfH@   LHG  H H;EuH  [A\A]A^A_]Y  f.     UHAWAVSHXHG  H HEAH   IH   HLw0wH
IF`Ht[HHHt^S$H}LW=L   tH}о   H}HE1=K   t&H}H   zH  HHuAHF  H H;EuDHX[A^A_]m  f.     D  UHHHwHWH蹲  1]UHAWAVAUATSH(IIDgDw(1舾He  HLuAU 1$A$I  LeIH  ILHH  MMD  AG\   H5w+     L    H5_+     L  1Ʌ  HIIA$HЀ	  I1ɉ1L9  HH4HH  ATHr@
r<0H[  HH N  I<AOPH5*       1Ʌ&  LIK<DA@<	A  1D1L9  @DHHHH  HHtVI
rA0@H@  LUHH   HHAGLH5*     G  1Ʌp  HIHEIEA@<	S  1D1L9>  @HH<HH%  I4Ht3~@
rA0@H@   HH    IAOTAOX<$   IJ HHEHEI HuX  H   HMHH    AO(8$   HHMHMI?HuH  HtmHHEHH u]AGIG0    AG8    IG@    AGH    WAG`AGp    LAƅuE1; AAAADH([A\A]A^A_]EEA@<	wIH   1MDfD  H9wHHHHrAD$IXH
rA0HxHH kAO\nfD  UHAWAVSHE1fDo+  fo+  fDo
+  fo+  fvfo-+  E11+f.     fLEL;  DBIDE  AAҺz   D)A   D!!DA  fAnfpPfofAfnflfrfoffrfffAfffrffpUff~D	f~	fpUfA~A	DA  AAA!EE	A   	  LXAEDQAEE  AAֺz   D)A   D!!A  fAnfpPfofAfnflfrfoffrfffAfffrffpUff~	f~	fpUf~	ӉA  AAA!EA	A     LXAEvLDL;
	  fD  EE  AAֺz   D)A   D!!A  fAnfpPfofAfnflfrfoffrfffAfffrffpUff~	f~	fpUfA~A	DA  AAA!AD	   t@HAAL;LEDуwAt	1[A^A_]LL؃wD  UHAWAVAUATSH   IIIH>  H HEЉ1輶HL1Hw  t  Ie  fA$ IH2  I)J  IIHPLH  I*  MA$v= IED$\H
#  H]   H11  H  I)  HIHPHuL  I  IA$m= IED$PH
J#  H]   H11S  Hq  I)  HIHPHuLI  Ih  IA,t= IED$LH
"  H]   H11  H  I)(  HIHPHuL  I  IA,p= IED$TH
"  H]   H11  H  I)  HIHPHuL  I  IfA$ IAt$(HH!H    @H)ȃt	uHHHxI)S  IH  MT$ 1E1MH6LHIIHu)  AI{LIH  AAHEA	ōq   CAD1AAZsI[  LI"ADσ?4I)I;fnfp fof{%  fof%%  fof-%  f
%  fAnfp f`E1fff]fMfoUfo5_%  ffoffofo]fpfo`foffpTfDofDfppfoffDlpTfoffmpfofDpTfDofDfppfoffDlpTfoffmpfofDpTfDofDfppfoffDlpTfoffmpfofDpTfoffppfofflpTfoffm(#$  TDTDTDTE(fo$  fDA(ffoA(f(ffrfrfDofrfofAr(fo#  fA(fA(fA(ffAf0ffof fAffAoff foE(fo#  fDE(fDD(fDfArfArfAr(fo
d#  ffAff@A(ffAffPA(ffAfA(ffrA(fffDA(fo
#  ffrA(fo-#  ffA(ffrE(fDfDA(ffrA(ff(ffr(ffffEfDfD(D(="  AWfvffrfo
"  ffAE(EWfDfArfDfEA(AWffrffAA(AWffrfffo]fEfArfo
;"  fDfD0fEfDfEfArfDfD fDfDfEfArfDfDfDPfofEfAfrff f@ffoMfo!  ffDfAgfDfDfEgfAgC$foIfo!  ffffL9'L9?IщIۉD?  DGAA!Ӎ  WG!!Ѝ     !!	։5?  Ѓ+?  ׃/D			A;Iwtw(HE?  D@AA!э  pG!!ҍ     !!	?  у+?  Ѓ/D			HAIA Hxu	_  A IQ  LxfA$ IEL$IH!H    HEID)уt
u
HMHEL9}  IM  M$1A   E1<AELHIA   IIu!  DyIvII  AEE	܍qACDyލ1Zb  HH"ރ6D,IDD)AI6fAnfp fof*  fof%.  fof-2  f
:  fAnfp f`E1fff]fMfoUfo5  ffoffofo]fpfo`foffpTfDofDfppfoffDlpTfoffmpfofDpTfDofDfppfoffDlpTfoffmpfofDpTfDofDfppfoffDlpTfoffmpfofDpTfoffppfofflpTfoffm(  TDTDTDTE(fo  fDA(ffoA(f(ffrfrfDofrfofAr(fo  fA(fA(fA(ffAf0ffof fAffAoff foE(fo7  fDE(fDD(fDfArfArfAr(fo
  ffAff@A(ffAffPA(ffAfA(ffrA(fffDA(fo
  ffrA(fo-  ffA(ffrE(fDfDA(ffrA(ff(ffr(ffffEfDfD(D(=T  AWfvffrfo
K  ffAE(EWfDfArfDfEA(AWffrffAA(AWffrfffo]fEfArfo
  fDfD0fEfDfEfArfDfD fDfDfEfArfDfDfDPfofEfAfrff f@ffoMfoa  ffDfAgfDfDfEgfAgC$foIfo5  ffffL9'H9DAIA   DD?  DFAA!Ѝ  VG!!׍     !!	Ӊ5?  Ѓ+?  փ/D			A6Iw   D(AA?A  ACA!A  A{G!!A  A   !!	Dف?  у+A?  AAA/A	A	A	HEIA 1H}uH

.  H	H;Mu(H   [A\A]A^A_]A 1H
-  H	H;Mt}  f.     D  UHHH!H    I)σt	uHH]f.     fUH   
r'        HHH#cw]ÐUHHtHHHt1]  ]f.      UH1]  @ UH1  UHf.     UHf.     %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  %,  % -  %-  %-  %-  %-  %
-  %-  %-  %-  %-  %-  %-  %-  %-  %-  %-  % -  %"-  %$-  %&-  %(-  %*-  %,-  %.-  %0-  %2-  %4-  %6-  %8-  %:-  %<-  %>-  %@-  %B-  %D-  %F-  %H-  %J-  %L-  %N-  %P-  %R-  %T-  %V-  %X-  %Z-  %\-  %^-  %`-  %b-  %d-  %f-  %h-  %j-  %l-  %n-    hA  ~  h\  t  hw  j  h  `  h  V  h  L  h  B  h  8  h8  .  hU  $  hp    h    h    h     h     h     h*     hI     hg     h     h     h     h     h     h     h9     hZ  z   h{  p   h  f   h  \   h  R   h  H   h!  >   h@  4   h^  *   h{      h     h     h       LE)  AS%)  h   h]   h   h   hP  h  h  h  h0  hQ  hk  h  xh  nh    dh   Zh  Ph  Fh  <h  2h  (h  h#  h2  
h   h  h  h!  h0  <!]@         %Tt       
/      
/      M;Cv0  N         }      '  
AU      
AT      =.)c  } *     	          X'  Q> ,  ,	=B-  o w  %      }        &   T  T b0   H      )   7  7. u	 	  -   #                ;         5-R i )           * >  >E "   &    ;    QH 0  0 OT   t |      )          &          -     R  R ]  l w+        )   7  77) n7) 7) 1) F) F) F) F) F) ) ) ) 
( 
( ' 
  ' )   ' )   ' )   ' )   ' )   ' )   ' )   ' )     '  )     '  )    !' !) !  !' !) !  !' !) "  "' ") "  "' ") "  "' #) #  #' #) #  #' #) $  $' $) $  $' $) $  $' %) %  %' %) %  %' %) &  &' &) &	) &	( &	( &' &  &' &  1 b)L/F  u }      }      "         +       +   +       L      '   1    9  9W A)  E=@D          <          % 5  5	 x}d          }  }    +      <  << 	 	  /   #                ;             <  <5 	 	  /   #                ;            message Error::New napi_get_last_error_info napi_is_exception_pending napi_get_and_clear_last_exception Error in native callback napi_create_string_utf8 napi_create_error Error::Error napi_create_object napi_define_properties napi_create_reference 4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal EscapableHandleScope::~EscapableHandleScope napi_close_escapable_handle_scope HandleScope::~HandleScope napi_close_handle_scope Hash expected 1 argument password salt secret data hashLength m t p version type argon2:HashWorker Argon2d argon2d Argon2i argon2i Argon2id argon2id OK Output pointer is NULL Output is too short Output is too long Password is too short Password is too long Salt is too short Salt is too long Associated data is too short Associated data is too long Secret is too short Secret is too long Time cost is too small Time cost is too large Memory cost is too small Memory cost is too large Too few lanes Too many lanes Password pointer is NULL, but password length is not 0 Salt pointer is NULL, but salt length is not 0 Secret pointer is NULL, but secret length is not 0 Associated data pointer is NULL, but ad length is not 0 Memory allocation error The free memory callback is NULL The allocate memory callback is NULL Argon2_Context context is NULL There is no such version of Argon2 Output pointer mismatch Not enough threads Too many threads Missing arguments Encoding failed Decoding failed Threading failure Some of encoded parameters are too long or too short The password does not match the supplied hash Unknown error code $v= $m= ,t= ,p= %lu   N4Napi5ErrorE N4Napi15ObjectReferenceE N4Napi9ReferenceINS_6ObjectEEE St9exception                                                                                    
	
ɼg	j;ʄg+rn<6_:OтRQl>+hkAكy!~[                            	   
         
            
         	      
                                                     
   
                  	         	         
                     
                	                   
                           
            
                   
                  	                  
      
                	            
                     	                         
            	                      
            
      
                              	            
                                   	   
         
            
         	      
                                          Z   9                         ?  ?          ?   >               ?   ?   ?   ?           A   A   A   A           G   G   G   G                       ?  ?  ?  ?  +   +   +   +   /   /   /   /                     
   D      H         XaQ! QQa QXQ ! P  /  P  `         P  /    p0    01    p1  $  1  4  3    p3    3    4    6  8   7  T   8  h  ;     `=  8  >  h  ?     A    A    B    W  <  pX  p  Y     \    @b    @c    c    e  <  f  d  `g    i         E                  0   @ P  p P     ` 
   @  @   '  @( (  * + p, 2 3  4 5   6  7 7 `: < A  @I 	 J K  pM  P Q   R V  W W  X 	@[ b 
c 0k  `q q  r  pr Pu  v `|  }     0 p              zR x  $      hB        AC
          D   `B        A    $   d   @        AC
       $      (        AC
       $      @C        AC
       $      HI        AC
       $     @I        AC
       ,   ,  KU       AC
M    $   \  hh#        AC
       $     ph        AC
       $     8k        AC
B    $     k        AC
B    $     xu        AC
       $   $  pu        AC
       $   L  hu	        AC
       $   t  Pu	        AC
              zPLR x    ,   $   ?       SAC
G  ,   T   ?       ?AC
C  ,      X@7       +AC
B    ,      h@7       AC
B    4      @P      AC
K      ,     A]       AC
B    ,   L  A\       AC
B    4   |   B      AC
M    ,     B"      AC
G  4     C       AC
K      ,     D       AC
I,   L  Eo      AC
I4   |   Io      AC
K      ,     XJ,      AC
F,     XK5      AC
I,     hLL      CAC
I,   D  M       ?AC
F4   t  N       +AC
J    4     N      AC
P    ,     c       AC
G  4     d      AC
G      ,   L  d
      AC
I4   |  0g=      AC
P    ,     8m       AC
I,     nj       AC
C  ,     Hnw      {AC
I,   D  o       AC
G  ,   t  p       AC
G  4     hq      {AC
K      4     s}      AC
K             zR x  ,      u       AC
P    $   L   pzI       AC
              zR x  $      X        AC
       $   D           AC
G  ,   l   P       AC
P    $      F        AC
       $      <        AC
       $       F        AC
       $     H<        AC
       $   <  `F        AC
       $   d  <        AC
       ,            AC
P    $             AC
F$     x        AC
       $     `        AC
       $   4  H        AC
       $   \  0        AC
       $             AC
       $              AC
       $            AC
F$     `       AC
F$   $  ؊       AC
F$   L  P$        IC
       ,   t  X        AC
J           zR x  $              XC
       $   D   x        AC
C  $   l   @       AC
J  ,      ȏ&       AC
J    ,      Ȑ       AC
P    ,             AC
K      ,   $         AC
P    ,   T         AC
P           zR x  $              AC
       $   D           AC
       $   l          AC
       $      hW        XC
B    $      Z        AC
F$      ؤ        AC
       $     Ф)        AC
       ,   4  ؤ       AC
P    $   d          AC
       ,      C       AC
M    $     @H       AC
       ,     h&	       AC
P    ,     h5       AC
P    $   D  x        AC
I$   l  @         AC
              zR x  ,       :       AC
M    $   L   0{       AC
E,   t          AC
P    $      h4        AC
       $      7        AC
              zR x  $      #        AC
       $   D           AC
       $   l   p        AC
               0e      Pe      3      W      W      X     H                                       F                                                 
                                      P                  (      2      <      Z      d      n      x                              ,      6      @      J      T      ^      h      r      |                                                                                                      &      0      :      D      N      X      b      l      v                                                                                  `      p      3      4              6       7      7       8                      3      p3      /                                             &                          0           H                            Z      P[      3      4       \      @b      @c      7       8            T      B      2      "                                          m      L      4                        c      T      F      -                                                u      c      N      8      %                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         !YCYD`:BTATBSApRAp`0     @__ZTVN10__cxxabiv117__class_type_infoE Qq`@__ZTVN10__cxxabiv120__si_class_type_infoE @__ZTVN10__cxxabiv121__vmi_class_type_infoE  @__ZdaPv ` @__ZdlPv @__Znam @__Znwm @___cxa_pure_virtual @___gxx_personality_v0 @___stack_chk_guard @_memset 	@dyld_stub_binder      @__ZN4Napi11AsyncWorker18OnAsyncWorkExecuteEP10napi_env__Pv Qq@__ZN4Napi11AsyncWorker19OnAsyncWorkCompleteEP10napi_env__11napi_statusPv @__ZN4Napi7details12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ @__ZN4Napi7details20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_ @__ZTIN4Napi15ObjectReferenceE @__ZTIN4Napi5ErrorE @__ZTIN4Napi9ReferenceINS_6ObjectEEE @__ZTISt9exception @__ZTSN4Napi15ObjectReferenceE @__ZTSN4Napi5ErrorE  @__ZTSN4Napi9ReferenceINS_6ObjectEEE @__ZTSSt9exception  @__ZdaPv @__ZdlPv @__Znam @__Znwm      qh@__Unwind_Resume  qp@__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv  qx@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc  q@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm  q@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_  q@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev  q@__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_  q@__ZNSt9exceptionD2Ev  q@__ZSt9terminatev  q@___bzero  q@___cxa_allocate_exception  q@___cxa_begin_catch  q@___cxa_end_catch  q@___cxa_free_exception  q@___cxa_throw  q@___memcpy_chk  q@___sprintf_chk  q@___stack_chk_fail  q@_calloc  q@_free  q@_malloc  q@_memcpy  q@_memset  q>@_napi_add_finalizer  q>@_napi_call_function  q>@_napi_close_escapable_handle_scope  q>@_napi_close_handle_scope  q>@_napi_coerce_to_number  q>@_napi_create_async_work  q>@_napi_create_buffer_copy  q>@_napi_create_error  q>@_napi_create_function  q>@_napi_create_object  q>@_napi_create_promise  q>@_napi_create_reference  q>@_napi_create_string_latin1  q>@_napi_create_string_utf8  q>@_napi_create_type_error  q>@_napi_define_properties  q>@_napi_delete_async_work  q>@_napi_delete_reference  q>@_napi_escape_handle  q>@_napi_fatal_error  q>@_napi_get_and_clear_last_exception  q>@_napi_get_cb_info  q>@_napi_get_last_error_info  q>@_napi_get_named_property  q>@_napi_get_property  q>@_napi_get_reference_value  q>@_napi_get_typedarray_info  q>@_napi_get_value_string_utf8  q>@_napi_get_value_uint32  q>@_napi_has_property  q>@_napi_is_exception_pending  q>@_napi_open_escapable_handle_scope  q>@_napi_open_handle_scope  q>@_napi_queue_async_work  q>@_napi_reject_deferred  q>@_napi_resolve_deferred  q>@_napi_set_named_property  q>@_napi_throw  q>@_napi_typeof  q@_pthread_create  q@_pthread_exit  q@_pthread_join  q@_strlen  q@_strncmp   _    
FLAG_clear_internal_memory _Z a b 	c 
decode_string encode_string f in n secure_wipe_memory 
validate_inputs 
xor_block 
  8OnAsyncWorkExecuteEP10napi_env__Pv 9OnAsyncWorkCompleteEP10napi_env__11napi_statusPv   11AsyncWorker1 7details   12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ 20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_   N4Napi T   15ObjectReferenceE 5ErrorE 9ReferenceINS_6ObjectEEE ؆   N4Napi St9exception Ȇ  I S   15ObjectReferenceE 5ErrorE 9ReferenceINS_6ObjectEEE    N4Napi St9exception     llocate_memory rgon2    ctx e hash t verify    ncodedlen rror_message        create exit join  Ц    hread_ ype2string    _ctx    _ d_ i 	   ctx hash_ verify    encoded raw    _ctx      ctx hash_ verify 	   encoded raw 	   _ctx 	   _ d_ 	   ctx 	hash_ 	verify 	   encoded 	raw 	   Ђ_ctx 	 Љ    64len 	lake2b 
 _ 
   final 
init 
long 
update 
 _ 
   key 
param 
     Е    lear_internal_memory 
opy_block  е        first_blocks memory_blocks segment      ll_ nalize    i ree_memory      dex_alpha it    _block_value ial    _hash ize    c  api_register_module_v1 ode_api_module_get_api_version_v1 
umlen 
 c  Х       _ @@``  )0 p  	`P@P@P@0`` 0 "@@0 b
  <   BEa       
  (          0e      [    Pe          W         W         0        X                 H     !         ?         R         v   &                    x                    p          y                    P          @          px      -     }      <          O    `      \    {      r    0|          @                    p          P{          {          0          0                    p|      &    |      9    P      J    Є      _          g    0      p              0                     @                    Њ                    К                              @      %          9    pl      G           Q    P      ^          k          }    p                    1          1                    С                                                  ]                                    <                                                                        A            l           t           |                                                                                                          	            	            ,	            ;	            M	            `	            h	            n	            v	            ~	            	            	            	            	            	            
            
            2
            E
            [
            o
            
            
            
            
            
            
                        .            B            T            w                                                                                                6            I            d                                                                                    
            
            $
            2
            @
            H
            Q
            C   D   E   F   G   H   I   J   K   O   P   Q   R   S   T   U   V   W   Y   [   \   ]   _   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~                                                         @                  	         Z   ^      C   D   E   F   G   H   I   J   K   O   P   Q   R   S   T   U   V   W   Y   [   \   ]   _   `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~                                                              _FLAG_clear_internal_memory __ZN4Napi11AsyncWorker18OnAsyncWorkExecuteEP10napi_env__Pv __ZN4Napi11AsyncWorker19OnAsyncWorkCompleteEP10napi_env__11napi_statusPv __ZN4Napi7details12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES2_E7WrapperEP10napi_env__P20napi_callback_info__ __ZN4Napi7details20PostFinalizerWrapperIXadL_ZNS0_17default_finalizerINS0_12CallbackDataIPFNS_5ValueERKNS_12CallbackInfoEES4_EEEEvP10napi_env__PvSD_EEEEvSC_SD_SD_ __ZTIN4Napi15ObjectReferenceE __ZTIN4Napi5ErrorE __ZTIN4Napi9ReferenceINS_6ObjectEEE __ZTISt9exception __ZTSN4Napi15ObjectReferenceE __ZTSN4Napi5ErrorE __ZTSN4Napi9ReferenceINS_6ObjectEEE __ZTSSt9exception _allocate_memory _argon2_ctx _argon2_encodedlen _argon2_error_message _argon2_hash _argon2_thread_create _argon2_thread_exit _argon2_thread_join _argon2_type2string _argon2_verify _argon2_verify_ctx _argon2d_ctx _argon2d_hash_encoded _argon2d_hash_raw _argon2d_verify _argon2d_verify_ctx _argon2i_ctx _argon2i_hash_encoded _argon2i_hash_raw _argon2i_verify _argon2i_verify_ctx _argon2id_ctx _argon2id_hash_encoded _argon2id_hash_raw _argon2id_verify _argon2id_verify_ctx _b64len _blake2b _blake2b_final _blake2b_init _blake2b_init_key _blake2b_init_param _blake2b_long _blake2b_update _clear_internal_memory _copy_block _decode_string _encode_string _fill_first_blocks _fill_memory_blocks _fill_segment _finalize _free_memory _index_alpha _init_block_value _initial_hash _initialize _napi_register_module_v1 _node_api_module_get_api_version_v1 _numlen _secure_wipe_memory _validate_inputs _xor_block __Unwind_Resume __ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_ __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_ __ZNSt9exceptionD2Ev __ZSt9terminatev __ZTVN10__cxxabiv117__class_type_infoE __ZTVN10__cxxabiv120__si_class_type_infoE __ZTVN10__cxxabiv121__vmi_class_type_infoE __ZdaPv __ZdlPv __Znam __Znwm ___bzero ___cxa_allocate_exception ___cxa_begin_catch ___cxa_end_catch ___cxa_free_exception ___cxa_pure_virtual ___cxa_throw ___gxx_personality_v0 ___memcpy_chk ___sprintf_chk ___stack_chk_fail ___stack_chk_guard _calloc _free _malloc _memcpy _memset _napi_add_finalizer _napi_call_function _napi_close_escapable_handle_scope _napi_close_handle_scope _napi_coerce_to_number _napi_create_async_work _napi_create_buffer_copy _napi_create_error _napi_create_function _napi_create_object _napi_create_promise _napi_create_reference _napi_create_string_latin1 _napi_create_string_utf8 _napi_create_type_error _napi_define_properties _napi_delete_async_work _napi_delete_reference _napi_escape_handle _napi_fatal_error _napi_get_and_clear_last_exception _napi_get_cb_info _napi_get_last_error_info _napi_get_named_property _napi_get_property _napi_get_reference_value _napi_get_typedarray_info _napi_get_value_string_utf8 _napi_get_value_uint32 _napi_has_property _napi_is_exception_pending _napi_open_escapable_handle_scope _napi_open_handle_scope _napi_queue_async_work _napi_reject_deferred _napi_resolve_deferred _napi_set_named_property _napi_throw _napi_typeof _pthread_create _pthread_exit _pthread_join _strlen _strncmp dyld_stub_binder radr://5614542                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                // If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types.
// Otherwise, use the types from node.
type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob;
type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File;

/**
 * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
 * Node.js APIs support `Buffer`s.
 *
 * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
 * extends it with methods that cover additional use cases. Node.js APIs accept
 * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
 *
 * While the `Buffer` class is available within the global scope, it is still
 * recommended to explicitly reference it via an import or require statement.
 *
 * ```js
 * import { Buffer } from 'node:buffer';
 *
 * // Creates a zero-filled Buffer of length 10.
 * const buf1 = Buffer.alloc(10);
 *
 * // Creates a Buffer of length 10,
 * // filled with bytes which all have the value `1`.
 * const buf2 = Buffer.alloc(10, 1);
 *
 * // Creates an uninitialized buffer of length 10.
 * // This is faster than calling Buffer.alloc() but the returned
 * // Buffer instance might contain old data that needs to be
 * // overwritten using fill(), write(), or other functions that fill the Buffer's
 * // contents.
 * const buf3 = Buffer.allocUnsafe(10);
 *
 * // Creates a Buffer containing the bytes [1, 2, 3].
 * const buf4 = Buffer.from([1, 2, 3]);
 *
 * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
 * // are all truncated using `(value &#x26; 255)` to fit into the range 0–255.
 * const buf5 = Buffer.from([257, 257.5, -255, '1']);
 *
 * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
 * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
 * // [116, 195, 169, 115, 116] (in decimal notation)
 * const buf6 = Buffer.from('tést');
 *
 * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
 * const buf7 = Buffer.from('tést', 'latin1');
 * ```
 * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/buffer.js)
 */
declare module "buffer" {
    import { BinaryLike } from "node:crypto";
    import { ReadableStream as WebReadableStream } from "node:stream/web";
    /**
     * This function returns `true` if `input` contains only valid UTF-8-encoded data,
     * including the case in which `input` is empty.
     *
     * Throws if the `input` is a detached array buffer.
     * @since v19.4.0, v18.14.0
     * @param input The input to validate.
     */
    export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
    /**
     * This function returns `true` if `input` contains only valid ASCII-encoded data,
     * including the case in which `input` is empty.
     *
     * Throws if the `input` is a detached array buffer.
     * @since v19.6.0, v18.15.0
     * @param input The input to validate.
     */
    export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
    export const INSPECT_MAX_BYTES: number;
    export const kMaxLength: number;
    export const kStringMaxLength: number;
    export const constants: {
        MAX_LENGTH: number;
        MAX_STRING_LENGTH: number;
    };
    export type TranscodeEncoding =
        | "ascii"
        | "utf8"
        | "utf-8"
        | "utf16le"
        | "utf-16le"
        | "ucs2"
        | "ucs-2"
        | "latin1"
        | "binary";
    /**
     * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
     * encoding to another. Returns a new `Buffer` instance.
     *
     * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
     * conversion from `fromEnc` to `toEnc` is not permitted.
     *
     * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
     *
     * The transcoding process will use substitution characters if a given byte
     * sequence cannot be adequately represented in the target encoding. For instance:
     *
     * ```js
     * import { Buffer, transcode } from 'node:buffer';
     *
     * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
     * console.log(newBuf.toString('ascii'));
     * // Prints: '?'
     * ```
     *
     * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
     * with `?` in the transcoded `Buffer`.
     * @since v7.1.0
     * @param source A `Buffer` or `Uint8Array` instance.
     * @param fromEnc The current encoding.
     * @param toEnc To target encoding.
     */
    export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
    export const SlowBuffer: {
        /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
        new(size: number): Buffer;
        prototype: Buffer;
    };
    /**
     * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
     * a prior call to `URL.createObjectURL()`.
     * @since v16.7.0
     * @experimental
     * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
     */
    export function resolveObjectURL(id: string): Blob | undefined;
    export { Buffer };
    /**
     * @experimental
     */
    export interface BlobOptions {
        /**
         * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
         * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
         */
        endings?: "transparent" | "native";
        /**
         * The Blob content-type. The intent is for `type` to convey
         * the MIME media type of the data, however no validation of the type format
         * is performed.
         */
        type?: string | undefined;
    }
    /**
     * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
     * multiple worker threads.
     * @since v15.7.0, v14.18.0
     */
    export class Blob {
        /**
         * The total size of the `Blob` in bytes.
         * @since v15.7.0, v14.18.0
         */
        readonly size: number;
        /**
         * The content-type of the `Blob`.
         * @since v15.7.0, v14.18.0
         */
        readonly type: string;
        /**
         * Creates a new `Blob` object containing a concatenation of the given sources.
         *
         * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
         * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
         *
         * String sources are also copied into the `Blob`.
         */
        constructor(sources: Array<ArrayBuffer | BinaryLike | Blob>, options?: BlobOptions);
        /**
         * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
         * the `Blob` data.
         * @since v15.7.0, v14.18.0
         */
        arrayBuffer(): Promise<ArrayBuffer>;
        /**
         * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
         *
         * ```js
         * const blob = new Blob(['hello']);
         * blob.bytes().then((bytes) => {
         *   console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
         * });
         * ```
         */
        bytes(): Promise<Uint8Array>;
        /**
         * Creates and returns a new `Blob` containing a subset of this `Blob` objects
         * data. The original `Blob` is not altered.
         * @since v15.7.0, v14.18.0
         * @param start The starting index.
         * @param end The ending index.
         * @param type The content-type for the new `Blob`
         */
        slice(start?: number, end?: number, type?: string): Blob;
        /**
         * Returns a promise that fulfills with the contents of the `Blob` decoded as a
         * UTF-8 string.
         * @since v15.7.0, v14.18.0
         */
        text(): Promise<string>;
        /**
         * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
         * @since v16.7.0
         */
        stream(): WebReadableStream;
    }
    export interface FileOptions {
        /**
         * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
         * converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
         */
        endings?: "native" | "transparent";
        /** The File content-type. */
        type?: string;
        /** The last modified date of the file. `Default`: Date.now(). */
        lastModified?: number;
    }
    /**
     * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
     * @since v19.2.0, v18.13.0
     */
    export class File extends Blob {
        constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
        /**
         * The name of the `File`.
         * @since v19.2.0, v18.13.0
         */
        readonly name: string;
        /**
         * The last modified date of the `File`.
         * @since v19.2.0, v18.13.0
         */
        readonly lastModified: number;
    }
    export import atob = globalThis.atob;
    export import btoa = globalThis.btoa;

    global {
        namespace NodeJS {
            export { BufferEncoding };
        }
        // Buffer class
        type BufferEncoding =
            | "ascii"
            | "utf8"
            | "utf-8"
            | "utf16le"
            | "utf-16le"
            | "ucs2"
            | "ucs-2"
            | "base64"
            | "base64url"
            | "latin1"
            | "binary"
            | "hex";
        type WithImplicitCoercion<T> =
            | T
            | {
                valueOf(): T;
            };
        /**
         * Raw data is stored in instances of the Buffer class.
         * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap.  A Buffer cannot be resized.
         * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
         */
        interface BufferConstructor {
            // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
            // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier

            /**
             * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * Buffer.isBuffer(Buffer.alloc(10)); // true
             * Buffer.isBuffer(Buffer.from('foo')); // true
             * Buffer.isBuffer('a string'); // false
             * Buffer.isBuffer([]); // false
             * Buffer.isBuffer(new Uint8Array(1024)); // false
             * ```
             * @since v0.1.101
             */
            isBuffer(obj: any): obj is Buffer;
            /**
             * Returns `true` if `encoding` is the name of a supported character encoding,
             * or `false` otherwise.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * console.log(Buffer.isEncoding('utf8'));
             * // Prints: true
             *
             * console.log(Buffer.isEncoding('hex'));
             * // Prints: true
             *
             * console.log(Buffer.isEncoding('utf/8'));
             * // Prints: false
             *
             * console.log(Buffer.isEncoding(''));
             * // Prints: false
             * ```
             * @since v0.9.1
             * @param encoding A character encoding name to check.
             */
            isEncoding(encoding: string): encoding is BufferEncoding;
            /**
             * Returns the byte length of a string when encoded using `encoding`.
             * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
             * for the encoding that is used to convert the string into bytes.
             *
             * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
             * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
             * return value might be greater than the length of a `Buffer` created from the
             * string.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const str = '\u00bd + \u00bc = \u00be';
             *
             * console.log(`${str}: ${str.length} characters, ` +
             *             `${Buffer.byteLength(str, 'utf8')} bytes`);
             * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
             * ```
             *
             * When `string` is a
             * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
             * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
             * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
             * @since v0.1.90
             * @param string A value to calculate the length of.
             * @param [encoding='utf8'] If `string` is a string, this is its encoding.
             * @return The number of bytes contained within `string`.
             */
            byteLength(
                string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
                encoding?: BufferEncoding,
            ): number;
            /**
             * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from('1234');
             * const buf2 = Buffer.from('0123');
             * const arr = [buf1, buf2];
             *
             * console.log(arr.sort(Buffer.compare));
             * // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
             * // (This result is equal to: [buf2, buf1].)
             * ```
             * @since v0.11.13
             * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
             */
            compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
            /**
             * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
             * for pooling. This value may be modified.
             * @since v0.11.3
             */
            poolSize: number;
        }
        interface Buffer {
            // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
            // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier

            /**
             * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
             * not contain enough space to fit the entire string, only part of `string` will be
             * written. However, partially encoded characters will not be written.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.alloc(256);
             *
             * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
             *
             * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
             * // Prints: 12 bytes: ½ + ¼ = ¾
             *
             * const buffer = Buffer.alloc(10);
             *
             * const length = buffer.write('abcd', 8);
             *
             * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
             * // Prints: 2 bytes : ab
             * ```
             * @since v0.1.90
             * @param string String to write to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write `string`.
             * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
             * @param [encoding='utf8'] The character encoding of `string`.
             * @return Number of bytes written.
             */
            write(string: string, encoding?: BufferEncoding): number;
            write(string: string, offset: number, encoding?: BufferEncoding): number;
            write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
            /**
             * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
             *
             * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
             * then each invalid byte is replaced with the replacement character `U+FFFD`.
             *
             * The maximum length of a string instance (in UTF-16 code units) is available
             * as {@link constants.MAX_STRING_LENGTH}.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.allocUnsafe(26);
             *
             * for (let i = 0; i < 26; i++) {
             *   // 97 is the decimal ASCII value for 'a'.
             *   buf1[i] = i + 97;
             * }
             *
             * console.log(buf1.toString('utf8'));
             * // Prints: abcdefghijklmnopqrstuvwxyz
             * console.log(buf1.toString('utf8', 0, 5));
             * // Prints: abcde
             *
             * const buf2 = Buffer.from('tést');
             *
             * console.log(buf2.toString('hex'));
             * // Prints: 74c3a97374
             * console.log(buf2.toString('utf8', 0, 3));
             * // Prints: té
             * console.log(buf2.toString(undefined, 0, 3));
             * // Prints: té
             * ```
             * @since v0.1.90
             * @param [encoding='utf8'] The character encoding to use.
             * @param [start=0] The byte offset to start decoding at.
             * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
             */
            toString(encoding?: BufferEncoding, start?: number, end?: number): string;
            /**
             * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
             * this function when stringifying a `Buffer` instance.
             *
             * `Buffer.from()` accepts objects in the format returned from this method.
             * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
             * const json = JSON.stringify(buf);
             *
             * console.log(json);
             * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
             *
             * const copy = JSON.parse(json, (key, value) => {
             *   return value &#x26;&#x26; value.type === 'Buffer' ?
             *     Buffer.from(value) :
             *     value;
             * });
             *
             * console.log(copy);
             * // Prints: <Buffer 01 02 03 04 05>
             * ```
             * @since v0.9.2
             */
            toJSON(): {
                type: "Buffer";
                data: number[];
            };
            /**
             * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from('ABC');
             * const buf2 = Buffer.from('414243', 'hex');
             * const buf3 = Buffer.from('ABCD');
             *
             * console.log(buf1.equals(buf2));
             * // Prints: true
             * console.log(buf1.equals(buf3));
             * // Prints: false
             * ```
             * @since v0.11.13
             * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
             */
            equals(otherBuffer: Uint8Array): boolean;
            /**
             * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
             * Comparison is based on the actual sequence of bytes in each `Buffer`.
             *
             * * `0` is returned if `target` is the same as `buf`
             * * `1` is returned if `target` should come _before_`buf` when sorted.
             * * `-1` is returned if `target` should come _after_`buf` when sorted.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from('ABC');
             * const buf2 = Buffer.from('BCD');
             * const buf3 = Buffer.from('ABCD');
             *
             * console.log(buf1.compare(buf1));
             * // Prints: 0
             * console.log(buf1.compare(buf2));
             * // Prints: -1
             * console.log(buf1.compare(buf3));
             * // Prints: -1
             * console.log(buf2.compare(buf1));
             * // Prints: 1
             * console.log(buf2.compare(buf3));
             * // Prints: 1
             * console.log([buf1, buf2, buf3].sort(Buffer.compare));
             * // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
             * // (This result is equal to: [buf1, buf3, buf2].)
             * ```
             *
             * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
             * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
             *
             * console.log(buf1.compare(buf2, 5, 9, 0, 4));
             * // Prints: 0
             * console.log(buf1.compare(buf2, 0, 6, 4));
             * // Prints: -1
             * console.log(buf1.compare(buf2, 5, 6, 5));
             * // Prints: 1
             * ```
             *
             * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
             * @since v0.11.13
             * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
             * @param [targetStart=0] The offset within `target` at which to begin comparison.
             * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
             * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
             * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
             */
            compare(
                target: Uint8Array,
                targetStart?: number,
                targetEnd?: number,
                sourceStart?: number,
                sourceEnd?: number,
            ): -1 | 0 | 1;
            /**
             * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
             *
             * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
             * for all TypedArrays, including Node.js `Buffer`s, although it takes
             * different function arguments.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * // Create two `Buffer` instances.
             * const buf1 = Buffer.allocUnsafe(26);
             * const buf2 = Buffer.allocUnsafe(26).fill('!');
             *
             * for (let i = 0; i < 26; i++) {
             *   // 97 is the decimal ASCII value for 'a'.
             *   buf1[i] = i + 97;
             * }
             *
             * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
             * buf1.copy(buf2, 8, 16, 20);
             * // This is equivalent to:
             * // buf2.set(buf1.subarray(16, 20), 8);
             *
             * console.log(buf2.toString('ascii', 0, 25));
             * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
             * ```
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * // Create a `Buffer` and copy data from one region to an overlapping region
             * // within the same `Buffer`.
             *
             * const buf = Buffer.allocUnsafe(26);
             *
             * for (let i = 0; i < 26; i++) {
             *   // 97 is the decimal ASCII value for 'a'.
             *   buf[i] = i + 97;
             * }
             *
             * buf.copy(buf, 0, 4, 10);
             *
             * console.log(buf.toString());
             * // Prints: efghijghijklmnopqrstuvwxyz
             * ```
             * @since v0.1.90
             * @param target A `Buffer` or {@link Uint8Array} to copy into.
             * @param [targetStart=0] The offset within `target` at which to begin writing.
             * @param [sourceStart=0] The offset within `buf` from which to begin copying.
             * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
             * @return The number of bytes copied.
             */
            copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian.
             *
             * `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeBigInt64BE(0x0102030405060708n, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 01 02 03 04 05 06 07 08>
             * ```
             * @since v12.0.0, v10.20.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeBigInt64BE(value: bigint, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian.
             *
             * `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeBigInt64LE(0x0102030405060708n, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 08 07 06 05 04 03 02 01>
             * ```
             * @since v12.0.0, v10.20.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeBigInt64LE(value: bigint, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian.
             *
             * This function is also available under the `writeBigUint64BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer de ca fa fe ca ce fa de>
             * ```
             * @since v12.0.0, v10.20.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeBigUInt64BE(value: bigint, offset?: number): number;
            /**
             * @alias Buffer.writeBigUInt64BE
             * @since v14.10.0, v12.19.0
             */
            writeBigUint64BE(value: bigint, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer de fa ce ca fe fa ca de>
             * ```
             *
             * This function is also available under the `writeBigUint64LE` alias.
             * @since v12.0.0, v10.20.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeBigUInt64LE(value: bigint, offset?: number): number;
            /**
             * @alias Buffer.writeBigUInt64LE
             * @since v14.10.0, v12.19.0
             */
            writeBigUint64LE(value: bigint, offset?: number): number;
            /**
             * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
             * when `value` is anything other than an unsigned integer.
             *
             * This function is also available under the `writeUintLE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(6);
             *
             * buf.writeUIntLE(0x1234567890ab, 0, 6);
             *
             * console.log(buf);
             * // Prints: <Buffer ab 90 78 56 34 12>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
             * @return `offset` plus the number of bytes written.
             */
            writeUIntLE(value: number, offset: number, byteLength: number): number;
            /**
             * @alias Buffer.writeUIntLE
             * @since v14.9.0, v12.19.0
             */
            writeUintLE(value: number, offset: number, byteLength: number): number;
            /**
             * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
             * when `value` is anything other than an unsigned integer.
             *
             * This function is also available under the `writeUintBE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(6);
             *
             * buf.writeUIntBE(0x1234567890ab, 0, 6);
             *
             * console.log(buf);
             * // Prints: <Buffer 12 34 56 78 90 ab>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
             * @return `offset` plus the number of bytes written.
             */
            writeUIntBE(value: number, offset: number, byteLength: number): number;
            /**
             * @alias Buffer.writeUIntBE
             * @since v14.9.0, v12.19.0
             */
            writeUintBE(value: number, offset: number, byteLength: number): number;
            /**
             * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
             * when `value` is anything other than a signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(6);
             *
             * buf.writeIntLE(0x1234567890ab, 0, 6);
             *
             * console.log(buf);
             * // Prints: <Buffer ab 90 78 56 34 12>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
             * @return `offset` plus the number of bytes written.
             */
            writeIntLE(value: number, offset: number, byteLength: number): number;
            /**
             * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
             * signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(6);
             *
             * buf.writeIntBE(0x1234567890ab, 0, 6);
             *
             * console.log(buf);
             * // Prints: <Buffer 12 34 56 78 90 ab>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
             * @return `offset` plus the number of bytes written.
             */
            writeIntBE(value: number, offset: number, byteLength: number): number;
            /**
             * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
             *
             * This function is also available under the `readBigUint64BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
             *
             * console.log(buf.readBigUInt64BE(0));
             * // Prints: 4294967295n
             * ```
             * @since v12.0.0, v10.20.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
             */
            readBigUInt64BE(offset?: number): bigint;
            /**
             * @alias Buffer.readBigUInt64BE
             * @since v14.10.0, v12.19.0
             */
            readBigUint64BE(offset?: number): bigint;
            /**
             * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
             *
             * This function is also available under the `readBigUint64LE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
             *
             * console.log(buf.readBigUInt64LE(0));
             * // Prints: 18446744069414584320n
             * ```
             * @since v12.0.0, v10.20.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
             */
            readBigUInt64LE(offset?: number): bigint;
            /**
             * @alias Buffer.readBigUInt64LE
             * @since v14.10.0, v12.19.0
             */
            readBigUint64LE(offset?: number): bigint;
            /**
             * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed
             * values.
             * @since v12.0.0, v10.20.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
             */
            readBigInt64BE(offset?: number): bigint;
            /**
             * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed
             * values.
             * @since v12.0.0, v10.20.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
             */
            readBigInt64LE(offset?: number): bigint;
            /**
             * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting
             * up to 48 bits of accuracy.
             *
             * This function is also available under the `readUintLE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
             *
             * console.log(buf.readUIntLE(0, 6).toString(16));
             * // Prints: ab9078563412
             * ```
             * @since v0.11.15
             * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
             */
            readUIntLE(offset: number, byteLength: number): number;
            /**
             * @alias Buffer.readUIntLE
             * @since v14.9.0, v12.19.0
             */
            readUintLE(offset: number, byteLength: number): number;
            /**
             * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting
             * up to 48 bits of accuracy.
             *
             * This function is also available under the `readUintBE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
             *
             * console.log(buf.readUIntBE(0, 6).toString(16));
             * // Prints: 1234567890ab
             * console.log(buf.readUIntBE(1, 6).toString(16));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.11.15
             * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
             */
            readUIntBE(offset: number, byteLength: number): number;
            /**
             * @alias Buffer.readUIntBE
             * @since v14.9.0, v12.19.0
             */
            readUintBE(offset: number, byteLength: number): number;
            /**
             * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value
             * supporting up to 48 bits of accuracy.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
             *
             * console.log(buf.readIntLE(0, 6).toString(16));
             * // Prints: -546f87a9cbee
             * ```
             * @since v0.11.15
             * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
             */
            readIntLE(offset: number, byteLength: number): number;
            /**
             * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value
             * supporting up to 48 bits of accuracy.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
             *
             * console.log(buf.readIntBE(0, 6).toString(16));
             * // Prints: 1234567890ab
             * console.log(buf.readIntBE(1, 6).toString(16));
             * // Throws ERR_OUT_OF_RANGE.
             * console.log(buf.readIntBE(1, 0).toString(16));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.11.15
             * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
             * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
             */
            readIntBE(offset: number, byteLength: number): number;
            /**
             * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
             *
             * This function is also available under the `readUint8` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([1, -2]);
             *
             * console.log(buf.readUInt8(0));
             * // Prints: 1
             * console.log(buf.readUInt8(1));
             * // Prints: 254
             * console.log(buf.readUInt8(2));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
             */
            readUInt8(offset?: number): number;
            /**
             * @alias Buffer.readUInt8
             * @since v14.9.0, v12.19.0
             */
            readUint8(offset?: number): number;
            /**
             * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`.
             *
             * This function is also available under the `readUint16LE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56]);
             *
             * console.log(buf.readUInt16LE(0).toString(16));
             * // Prints: 3412
             * console.log(buf.readUInt16LE(1).toString(16));
             * // Prints: 5634
             * console.log(buf.readUInt16LE(2).toString(16));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
             */
            readUInt16LE(offset?: number): number;
            /**
             * @alias Buffer.readUInt16LE
             * @since v14.9.0, v12.19.0
             */
            readUint16LE(offset?: number): number;
            /**
             * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
             *
             * This function is also available under the `readUint16BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56]);
             *
             * console.log(buf.readUInt16BE(0).toString(16));
             * // Prints: 1234
             * console.log(buf.readUInt16BE(1).toString(16));
             * // Prints: 3456
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
             */
            readUInt16BE(offset?: number): number;
            /**
             * @alias Buffer.readUInt16BE
             * @since v14.9.0, v12.19.0
             */
            readUint16BE(offset?: number): number;
            /**
             * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
             *
             * This function is also available under the `readUint32LE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
             *
             * console.log(buf.readUInt32LE(0).toString(16));
             * // Prints: 78563412
             * console.log(buf.readUInt32LE(1).toString(16));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readUInt32LE(offset?: number): number;
            /**
             * @alias Buffer.readUInt32LE
             * @since v14.9.0, v12.19.0
             */
            readUint32LE(offset?: number): number;
            /**
             * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
             *
             * This function is also available under the `readUint32BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
             *
             * console.log(buf.readUInt32BE(0).toString(16));
             * // Prints: 12345678
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readUInt32BE(offset?: number): number;
            /**
             * @alias Buffer.readUInt32BE
             * @since v14.9.0, v12.19.0
             */
            readUint32BE(offset?: number): number;
            /**
             * Reads a signed 8-bit integer from `buf` at the specified `offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed values.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([-1, 5]);
             *
             * console.log(buf.readInt8(0));
             * // Prints: -1
             * console.log(buf.readInt8(1));
             * // Prints: 5
             * console.log(buf.readInt8(2));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.0
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
             */
            readInt8(offset?: number): number;
            /**
             * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed values.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0, 5]);
             *
             * console.log(buf.readInt16LE(0));
             * // Prints: 1280
             * console.log(buf.readInt16LE(1));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
             */
            readInt16LE(offset?: number): number;
            /**
             * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed values.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0, 5]);
             *
             * console.log(buf.readInt16BE(0));
             * // Prints: 5
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
             */
            readInt16BE(offset?: number): number;
            /**
             * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed values.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0, 0, 0, 5]);
             *
             * console.log(buf.readInt32LE(0));
             * // Prints: 83886080
             * console.log(buf.readInt32LE(1));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readInt32LE(offset?: number): number;
            /**
             * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
             *
             * Integers read from a `Buffer` are interpreted as two's complement signed values.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([0, 0, 0, 5]);
             *
             * console.log(buf.readInt32BE(0));
             * // Prints: 5
             * ```
             * @since v0.5.5
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readInt32BE(offset?: number): number;
            /**
             * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([1, 2, 3, 4]);
             *
             * console.log(buf.readFloatLE(0));
             * // Prints: 1.539989614439558e-36
             * console.log(buf.readFloatLE(1));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.11.15
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readFloatLE(offset?: number): number;
            /**
             * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([1, 2, 3, 4]);
             *
             * console.log(buf.readFloatBE(0));
             * // Prints: 2.387939260590663e-38
             * ```
             * @since v0.11.15
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
             */
            readFloatBE(offset?: number): number;
            /**
             * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
             *
             * console.log(buf.readDoubleLE(0));
             * // Prints: 5.447603722011605e-270
             * console.log(buf.readDoubleLE(1));
             * // Throws ERR_OUT_OF_RANGE.
             * ```
             * @since v0.11.15
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
             */
            readDoubleLE(offset?: number): number;
            /**
             * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
             *
             * console.log(buf.readDoubleBE(0));
             * // Prints: 8.20788039913184e-304
             * ```
             * @since v0.11.15
             * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
             */
            readDoubleBE(offset?: number): number;
            reverse(): this;
            /**
             * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
             * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
             *
             * console.log(buf1);
             * // Prints: <Buffer 01 02 03 04 05 06 07 08>
             *
             * buf1.swap16();
             *
             * console.log(buf1);
             * // Prints: <Buffer 02 01 04 03 06 05 08 07>
             *
             * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
             *
             * buf2.swap16();
             * // Throws ERR_INVALID_BUFFER_SIZE.
             * ```
             *
             * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
             * between UTF-16 little-endian and UTF-16 big-endian:
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
             * buf.swap16(); // Convert to big-endian UTF-16 text.
             * ```
             * @since v5.10.0
             * @return A reference to `buf`.
             */
            swap16(): this;
            /**
             * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
             * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
             *
             * console.log(buf1);
             * // Prints: <Buffer 01 02 03 04 05 06 07 08>
             *
             * buf1.swap32();
             *
             * console.log(buf1);
             * // Prints: <Buffer 04 03 02 01 08 07 06 05>
             *
             * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
             *
             * buf2.swap32();
             * // Throws ERR_INVALID_BUFFER_SIZE.
             * ```
             * @since v5.10.0
             * @return A reference to `buf`.
             */
            swap32(): this;
            /**
             * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
             * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
             *
             * console.log(buf1);
             * // Prints: <Buffer 01 02 03 04 05 06 07 08>
             *
             * buf1.swap64();
             *
             * console.log(buf1);
             * // Prints: <Buffer 08 07 06 05 04 03 02 01>
             *
             * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
             *
             * buf2.swap64();
             * // Throws ERR_INVALID_BUFFER_SIZE.
             * ```
             * @since v6.3.0
             * @return A reference to `buf`.
             */
            swap64(): this;
            /**
             * Writes `value` to `buf` at the specified `offset`. `value` must be a
             * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
             * other than an unsigned 8-bit integer.
             *
             * This function is also available under the `writeUint8` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeUInt8(0x3, 0);
             * buf.writeUInt8(0x4, 1);
             * buf.writeUInt8(0x23, 2);
             * buf.writeUInt8(0x42, 3);
             *
             * console.log(buf);
             * // Prints: <Buffer 03 04 23 42>
             * ```
             * @since v0.5.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
             * @return `offset` plus the number of bytes written.
             */
            writeUInt8(value: number, offset?: number): number;
            /**
             * @alias Buffer.writeUInt8
             * @since v14.9.0, v12.19.0
             */
            writeUint8(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
             * anything other than an unsigned 16-bit integer.
             *
             * This function is also available under the `writeUint16LE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeUInt16LE(0xdead, 0);
             * buf.writeUInt16LE(0xbeef, 2);
             *
             * console.log(buf);
             * // Prints: <Buffer ad de ef be>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
             * @return `offset` plus the number of bytes written.
             */
            writeUInt16LE(value: number, offset?: number): number;
            /**
             * @alias Buffer.writeUInt16LE
             * @since v14.9.0, v12.19.0
             */
            writeUint16LE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
             * unsigned 16-bit integer.
             *
             * This function is also available under the `writeUint16BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeUInt16BE(0xdead, 0);
             * buf.writeUInt16BE(0xbeef, 2);
             *
             * console.log(buf);
             * // Prints: <Buffer de ad be ef>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
             * @return `offset` plus the number of bytes written.
             */
            writeUInt16BE(value: number, offset?: number): number;
            /**
             * @alias Buffer.writeUInt16BE
             * @since v14.9.0, v12.19.0
             */
            writeUint16BE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
             * anything other than an unsigned 32-bit integer.
             *
             * This function is also available under the `writeUint32LE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeUInt32LE(0xfeedface, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer ce fa ed fe>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeUInt32LE(value: number, offset?: number): number;
            /**
             * @alias Buffer.writeUInt32LE
             * @since v14.9.0, v12.19.0
             */
            writeUint32LE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
             * unsigned 32-bit integer.
             *
             * This function is also available under the `writeUint32BE` alias.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeUInt32BE(0xfeedface, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer fe ed fa ce>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeUInt32BE(value: number, offset?: number): number;
            /**
             * @alias Buffer.writeUInt32BE
             * @since v14.9.0, v12.19.0
             */
            writeUint32BE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
             * signed 8-bit integer. Behavior is undefined when `value` is anything other than
             * a signed 8-bit integer.
             *
             * `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(2);
             *
             * buf.writeInt8(2, 0);
             * buf.writeInt8(-2, 1);
             *
             * console.log(buf);
             * // Prints: <Buffer 02 fe>
             * ```
             * @since v0.5.0
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
             * @return `offset` plus the number of bytes written.
             */
            writeInt8(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian.  The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is
             * anything other than a signed 16-bit integer.
             *
             * The `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(2);
             *
             * buf.writeInt16LE(0x0304, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 04 03>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
             * @return `offset` plus the number of bytes written.
             */
            writeInt16LE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian.  The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is
             * anything other than a signed 16-bit integer.
             *
             * The `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(2);
             *
             * buf.writeInt16BE(0x0102, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 01 02>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
             * @return `offset` plus the number of bytes written.
             */
            writeInt16BE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is
             * anything other than a signed 32-bit integer.
             *
             * The `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeInt32LE(0x05060708, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 08 07 06 05>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeInt32LE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is
             * anything other than a signed 32-bit integer.
             *
             * The `value` is interpreted and written as a two's complement signed integer.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeInt32BE(0x01020304, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 01 02 03 04>
             * ```
             * @since v0.5.5
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeInt32BE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
             * undefined when `value` is anything other than a JavaScript number.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeFloatLE(0xcafebabe, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer bb fe 4a 4f>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeFloatLE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
             * undefined when `value` is anything other than a JavaScript number.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(4);
             *
             * buf.writeFloatBE(0xcafebabe, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 4f 4a fe bb>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
             * @return `offset` plus the number of bytes written.
             */
            writeFloatBE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything
             * other than a JavaScript number.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeDoubleLE(123.456, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeDoubleLE(value: number, offset?: number): number;
            /**
             * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything
             * other than a JavaScript number.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(8);
             *
             * buf.writeDoubleBE(123.456, 0);
             *
             * console.log(buf);
             * // Prints: <Buffer 40 5e dd 2f 1a 9f be 77>
             * ```
             * @since v0.11.15
             * @param value Number to be written to `buf`.
             * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
             * @return `offset` plus the number of bytes written.
             */
            writeDoubleBE(value: number, offset?: number): number;
            /**
             * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
             * the entire `buf` will be filled:
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * // Fill a `Buffer` with the ASCII character 'h'.
             *
             * const b = Buffer.allocUnsafe(50).fill('h');
             *
             * console.log(b.toString());
             * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
             *
             * // Fill a buffer with empty string
             * const c = Buffer.allocUnsafe(5).fill('');
             *
             * console.log(c.fill(''));
             * // Prints: <Buffer 00 00 00 00 00>
             * ```
             *
             * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
             * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
             * filled with `value &#x26; 255`.
             *
             * If the final write of a `fill()` operation falls on a multi-byte character,
             * then only the bytes of that character that fit into `buf` are written:
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
             *
             * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
             * // Prints: <Buffer c8 a2 c8 a2 c8>
             * ```
             *
             * If `value` contains invalid characters, it is truncated; if no valid
             * fill data remains, an exception is thrown:
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.allocUnsafe(5);
             *
             * console.log(buf.fill('a'));
             * // Prints: <Buffer 61 61 61 61 61>
             * console.log(buf.fill('aazz', 'hex'));
             * // Prints: <Buffer aa aa aa aa aa>
             * console.log(buf.fill('zz', 'hex'));
             * // Throws an exception.
             * ```
             * @since v0.5.0
             * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.
             * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
             * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
             * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
             * @return A reference to `buf`.
             */
            fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
            /**
             * If `value` is:
             *
             * * a string, `value` is interpreted according to the character encoding in `encoding`.
             * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
             * To compare a partial `Buffer`, use `buf.subarray`.
             * * a number, `value` will be interpreted as an unsigned 8-bit integer
             * value between `0` and `255`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from('this is a buffer');
             *
             * console.log(buf.indexOf('this'));
             * // Prints: 0
             * console.log(buf.indexOf('is'));
             * // Prints: 2
             * console.log(buf.indexOf(Buffer.from('a buffer')));
             * // Prints: 8
             * console.log(buf.indexOf(97));
             * // Prints: 8 (97 is the decimal ASCII value for 'a')
             * console.log(buf.indexOf(Buffer.from('a buffer example')));
             * // Prints: -1
             * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
             * // Prints: 8
             *
             * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
             *
             * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
             * // Prints: 4
             * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
             * // Prints: 6
             * ```
             *
             * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value,
             * an integer between 0 and 255.
             *
             * If `byteOffset` is not a number, it will be coerced to a number. If the result
             * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
             * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const b = Buffer.from('abcdef');
             *
             * // Passing a value that's a number, but not a valid byte.
             * // Prints: 2, equivalent to searching for 99 or 'c'.
             * console.log(b.indexOf(99.9));
             * console.log(b.indexOf(256 + 99));
             *
             * // Passing a byteOffset that coerces to NaN or 0.
             * // Prints: 1, searching the whole buffer.
             * console.log(b.indexOf('b', undefined));
             * console.log(b.indexOf('b', {}));
             * console.log(b.indexOf('b', null));
             * console.log(b.indexOf('b', []));
             * ```
             *
             * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
             * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
             * @since v1.5.0
             * @param value What to search for.
             * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
             * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
             * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
             */
            indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
            /**
             * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
             * rather than the first occurrence.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from('this buffer is a buffer');
             *
             * console.log(buf.lastIndexOf('this'));
             * // Prints: 0
             * console.log(buf.lastIndexOf('buffer'));
             * // Prints: 17
             * console.log(buf.lastIndexOf(Buffer.from('buffer')));
             * // Prints: 17
             * console.log(buf.lastIndexOf(97));
             * // Prints: 15 (97 is the decimal ASCII value for 'a')
             * console.log(buf.lastIndexOf(Buffer.from('yolo')));
             * // Prints: -1
             * console.log(buf.lastIndexOf('buffer', 5));
             * // Prints: 5
             * console.log(buf.lastIndexOf('buffer', 4));
             * // Prints: -1
             *
             * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
             *
             * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
             * // Prints: 6
             * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
             * // Prints: 4
             * ```
             *
             * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value,
             * an integer between 0 and 255.
             *
             * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
             * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
             * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const b = Buffer.from('abcdef');
             *
             * // Passing a value that's a number, but not a valid byte.
             * // Prints: 2, equivalent to searching for 99 or 'c'.
             * console.log(b.lastIndexOf(99.9));
             * console.log(b.lastIndexOf(256 + 99));
             *
             * // Passing a byteOffset that coerces to NaN.
             * // Prints: 1, searching the whole buffer.
             * console.log(b.lastIndexOf('b', undefined));
             * console.log(b.lastIndexOf('b', {}));
             *
             * // Passing a byteOffset that coerces to 0.
             * // Prints: -1, equivalent to passing 0.
             * console.log(b.lastIndexOf('b', null));
             * console.log(b.lastIndexOf('b', []));
             * ```
             *
             * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
             * @since v6.0.0
             * @param value What to search for.
             * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
             * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
             * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
             */
            lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
            /**
             * Equivalent to `buf.indexOf() !== -1`.
             *
             * ```js
             * import { Buffer } from 'node:buffer';
             *
             * const buf = Buffer.from('this is a buffer');
             *
             * console.log(buf.includes('this'));
             * // Prints: true
             * console.log(buf.includes('is'));
             * // Prints: true
             * console.log(buf.includes(Buffer.from('a buffer')));
             * // Prints: true
             * console.log(buf.includes(97));
             * // Prints: true (97 is the decimal ASCII value for 'a')
             * console.log(buf.includes(Buffer.from('a buffer example')));
             * // Prints: false
             * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
             * // Prints: true
             * console.log(buf.includes('this', 4));
             * // Prints: false
             * ```
             * @since v5.3.0
             * @param value What to search for.
             * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
             * @param [encoding='utf8'] If `value` is a string, this is its encoding.
             * @return `true` if `value` was found in `buf`, `false` otherwise.
             */
            includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
        }
        var Buffer: BufferConstructor;
        /**
         * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
         * into a string using Latin-1 (ISO-8859-1).
         *
         * The `data` may be any JavaScript-value that can be coerced into a string.
         *
         * **This function is only provided for compatibility with legacy web platform APIs**
         * **and should never be used in new code, because they use strings to represent**
         * **binary data and predate the introduction of typed arrays in JavaScript.**
         * **For code running using Node.js APIs, converting between base64-encoded strings**
         * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
         * @since v15.13.0, v14.17.0
         * @legacy Use `Buffer.from(data, 'base64')` instead.
         * @param data The Base64-encoded input string.
         */
        function atob(data: string): string;
        /**
         * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
         * into a string using Base64.
         *
         * The `data` may be any JavaScript-value that can be coerced into a string.
         *
         * **This function is only provided for compatibility with legacy web platform APIs**
         * **and should never be used in new code, because they use strings to represent**
         * **binary data and predate the introduction of typed arrays in JavaScript.**
         * **For code running using Node.js APIs, converting between base64-encoded strings**
         * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
         * @since v15.13.0, v14.17.0
         * @legacy Use `buf.toString('base64')` instead.
         * @param data An ASCII (Latin1) string.
         */
        function btoa(data: string): string;
        interface Blob extends _Blob {}
        /**
         * `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
         * https://nodejs.org/api/buffer.html#class-blob
         * @since v18.0.0
         */
        var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
            : typeof import("buffer").Blob;
        interface File extends _File {}
        /**
         * `File` class is a global reference for `import { File } from 'node:buffer'`
         * https://nodejs.org/api/buffer.html#class-file
         * @since v20.0.0
         */
        var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
            : typeof import("buffer").File;
    }
}
declare module "node:buffer" {
    export * from "buffer";
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               





Network Working Group                                         C. Lonvick
Request for Comments: 3164                                 Cisco Systems
Category: Informational                                      August 2001


                        The BSD syslog Protocol

Status of this Memo

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

Copyright Notice

   Copyright (C) The Internet Society (2001).  All Rights Reserved.

Abstract

   This document describes the observed behavior of the syslog protocol.
   This protocol has been used for the transmission of event
   notification messages across networks for many years.  While this
   protocol was originally developed on the University of California
   Berkeley Software Distribution (BSD) TCP/IP system implementations,
   its value to operations and management has led it to be ported to
   many other operating systems as well as being embedded into many
   other networked devices.

Table of Contents

   1. Introduction....................................................2
   1.1 Events and Generated Messages..................................3
   1.2 Operations of the Message Receivers............................5
   2. Transport Layer Protocol........................................5
   3. Definitions and Architecture....................................5
   4. Packet Format and Contents......................................7
   4.1 syslog Message Parts...........................................8
   4.1.1 PRI Part.....................................................8
   4.1.2 HEADER Part of a syslog Packet..............................10
   4.1.3 MSG Part of a syslog Packet.................................11
   4.2 Original syslog Packets Generated by a Device.................12
   4.3 Relayed syslog Packets........................................12
   4.3.1 Valid PRI and TIMESTAMP.....................................13
   4.3.2 Valid PRI but no TIMESTAMP or invalid TIMESTAMP.............13
   4.3.3 No PRI or Unidentifiable PRI................................14
   5. Conventions....................................................14
   5.1 Dates and Times...............................................15
   5.2 Domain Name and Address.......................................15



Lonvick                      Informational                      [Page 1]

RFC 3164                The BSD syslog Protocol              August 2001


   5.3 Originating Process Information...............................15
   5.4 Examples......................................................16
   6. Security Considerations........................................18
   6.1 Packet Parameters.............................................19
   6.2 Message Authenticity..........................................19
   6.2.1 Authentication Problems.....................................19
   6.2.2 Message Forgery.............................................20
   6.3 Sequenced Delivery............................................20
   6.3.1 Single Source to a Destination..............................20
   6.3.2 Multiple Sources to a Destination...........................21
   6.3.3 Multiple Sources to Multiple Destinations...................21
   6.3.4 Replaying...................................................22
   6.4 Reliable Delivery.............................................22
   6.5 Message Integrity.............................................22
   6.6 Message Observation...........................................22
   6.7 Message Prioritization and Differentiation....................23
   6.8 Misconfiguration..............................................24
   6.9 Forwarding Loop...............................................24
   6.10 Load Considerations..........................................25
   7. IANA Considerations............................................25
   8. Conclusion and Other Efforts...................................25
   Acknowledgements..................................................26
   References........................................................27
   Author's Address..................................................28
   Full Copyright Statement..........................................29

1. Introduction

   Since the beginning, life has relied upon the transmission of
   messages.  For the self-aware organic unit, these messages can relay
   many different things.  The messages may signal danger, the presence
   of food or the other necessities of life, and many other things.  In
   many cases, these messages are informative to other units and require
   no acknowledgement.  As people interacted and created processes, this
   same principle was applied to societal communications.  As an
   example, severe weather warnings may be delivered through any number
   of channels - a siren blowing, warnings delivered over television and
   radio stations, and even through the use of flags on ships.  The
   expectation is that people hearing or seeing these warnings would
   realize their significance and take appropriate action.  In most
   cases, no responding acknowledgement of receipt of the warning is
   required or even desired.  Along these same lines, operating systems,
   processes and applications were written to send messages of their own
   status, or messages to indicate that certain events had occurred.
   These event messages generally had local significance to the machine
   operators.  As the operating systems, processes and applications grew
   ever more complex, systems were devised to categorize and log these
   diverse messages and allow the operations staff to more quickly



Lonvick                      Informational                      [Page 2]

RFC 3164                The BSD syslog Protocol              August 2001


   differentiate the notifications of problems from simple status
   messages.  The syslog process was one such system that has been
   widely accepted in many operating systems.  Flexibility was designed
   into this process so the operations staff have the ability to
   configure the destination of messages sent from the processes running
   on the device.  In one dimension, the events that were received by
   the syslog process could be logged to different files and also
   displayed on the console of the device.  In another dimension, the
   syslog process could be configured to forward the messages across a
   network to the syslog process on another machine. The syslog process
   had to be built network-aware for some modicum of scalability since
   it was known that the operators of multiple systems would not have
   the time to access each system to review the messages logged there.
   The syslog process running on the remote devices could therefore be
   configured to either add the message to a file, or to subsequently
   forward it to another machine.

   In its most simplistic terms, the syslog protocol provides a
   transport to allow a machine to send event notification messages
   across IP networks to event message collectors - also known as syslog
   servers.  Since each process, application and operating system was
   written somewhat independently, there is little uniformity to the
   content of syslog messages.  For this reason, no assumption is made
   upon the formatting or contents of the messages.  The protocol is
   simply designed to transport these event messages.  In all cases,
   there is one device that originates the message.  The syslog process
   on that machine may send the message to a collector.  No
   acknowledgement of the receipt is made.

   One of the fundamental tenets of the syslog protocol and process is
   its simplicity.  No stringent coordination is required between the
   transmitters and the receivers.  Indeed, the transmission of syslog
   messages may be started on a device without a receiver being
   configured, or even actually physically present.  Conversely, many
   devices will most likely be able to receive messages without explicit
   configuration or definitions.  This simplicity has greatly aided the
   acceptance and deployment of syslog.

1.1 Events and Generated Messages

   The writers of the operating systems, processes and applications have
   had total control over the circumstances that would generate any
   message.  In some cases, messages are generated to give status. These
   can be either at a certain period of time, or at some other interval
   such as the invocation or exit of a program.  In other cases, the
   messages may be generated due to a set of conditions being met.  In
   those cases, either a status message or a message containing an alarm
   of some type may be generated.  It was considered that the writers of



Lonvick                      Informational                      [Page 3]

RFC 3164                The BSD syslog Protocol              August 2001


   the operating systems, processes and applications would quantify
   their messages into one of several broad categories.  These broad
   categories generally consist of the facility that generated them,
   along with an indication of the severity of the message.  This was so
   that the operations staff could selectively filter the messages and
   be presented with the more important and time sensitive notifications
   quickly, while also having the ability to place status or informative
   messages in a file for later perusal.   Other options for displaying
   or storing messages have been seen to exist as well.

   Devices MUST be configured with rules for displaying and/or
   forwarding the event messages.  The rules that have been seen are
   generally very flexible.  An administrator may want to have all
   messages stored locally as well as to have all messages of a high
   severity forwarded to another device.  They may find it appropriate
   to also have messages from a particular facility sent to some or all
   of the users of the device and displayed on the system console.
   However the administrator decides to configure the disposition of the
   event messages, the process of having them sent to a syslog collector
   generally consists of deciding which facility messages and which
   severity levels will be forwarded, and then defining the remote
   receiver.  For example, an administrator may want all messages that
   are generated by the mail facility to be forwarded to one particular
   event message collector.  Then the administrator may want to have all
   kernel generated messages sent to a different syslog receiver while,
   at the same time, having the critically severe messages from the
   kernel also sent to a third receiver.  It may also be appropriate to
   have those messages displayed on the system console as well as being
   mailed to some appropriate people, while at the same time, being sent
   to a file on the local disk of the device.  Conversely, it may be
   appropriate to have messages from a locally defined process only
   displayed on the console but not saved or forwarded from the device.
   In any event, the rules for this will have to be generated on the
   device.  Since the administrators will then know which types of
   messages will be received on the collectors, they should then make
   appropriate rules on those syslog servers as well.

   The contents of a message have also been at the discretion of its
   creator.  It has been considered to be good form to write the
   messages so that they are informative to the person who may be
   reading them.  It has also been considered good practice to include a
   timestamp and some indication of the sending device and the process
   that originated it in the messages.  However, none of those are
   stringently required.

   It should be assumed that any process on any device might generate an
   event message.  This may include processes on machines that do not
   have any local storage - e.g., printers, routers, hubs, switches, and



Lonvick                      Informational                      [Page 4]

RFC 3164                The BSD syslog Protocol              August 2001


   diskless workstations.  In that case, it may be imperative that event
   messages are transported to a collector so that they may be recorded
   and hopefully viewed by an operator.

1.2 Operations of the Message Receivers

   It is beyond the scope of this document to specify how event messages
   should be processed when they are received.  Like the operations
   described in Section 1.1, they generally may be displayed to the
   appropriate people, saved onto disk, further forwarded, or any
   combination of these.  The rules for determining the disposition of
   received messages have been seen to be identical to the rules for
   determining the disposition of locally generated messages.

   As a very general rule, there are usually many devices sending
   messages to relatively fewer collectors.  This fan-in process allows
   an administrator to aggregate messages into relatively few
   repositories.

2. Transport Layer Protocol

   syslog uses the user datagram protocol (UDP) [1] as its underlying
   transport layer mechanism.  The UDP port that has been assigned to
   syslog is 514.  It is RECOMMENDED that the source port also be 514 to
   indicate that the message is from the syslog process of the sender,
   but there have been cases seen where valid syslog messages have come
   from a sender with a source port other than 514.  If the sender uses
   a source port other than 514 then it is RECOMMENDED and has been
   considered to be good form that subsequent messages are from a single
   consistent port.

3. Definitions and Architecture

   The following definitions will be used in this document.

         A machine that can generate a message will be called a
         "device".

         A machine that can receive the message and forward it to
         another machine will be called a "relay".

         A machine that receives the message and does not relay it to
         any other machines will be called a "collector".  This has been
         commonly known as a "syslog server".

         Any device or relay will be known as the "sender" when it sends
         a message.




Lonvick                      Informational                      [Page 5]

RFC 3164                The BSD syslog Protocol              August 2001


         Any relay or collector will be known as the "receiver" when it
         receives the message.

   The architecture of the devices may be summarized as follows:

         Senders send messages to relays or collectors with no knowledge
         of whether it is a collector or relay.

         Senders may be configured to send the same message to multiple
         receivers.

         Relays may send all or some of the messages that they receive
         to a subsequent relay or collector.  In the case where they do
         not forward all of their messages, they are acting as both a
         collector and a relay.  In the following diagram, these devices
         will be designated as relays.

         Relays may also generate their own messages and send them on to
         subsequent relays or collectors.  In that case it is acting as
         a device.  These devices will also be designated as a relay in
         the following diagram.

   The following architectures shown in Diagram 1 are valid while the
   first one has been known to be the most prevalent.  Other
   arrangements of these examples are also acceptable.  As noted above,
   in the following diagram relays may pass along all or some of the
   messages that they receive along with passing along messages that
   they internally generate.























Lonvick                      Informational                      [Page 6]

RFC 3164                The BSD syslog Protocol              August 2001


         +------+         +---------+
         |Device|---->----|Collector|
         +------+         +---------+

         +------+         +-----+         +---------+
         |Device|---->----|Relay|---->----|Collector|
         +------+         +-----+         +---------+

         +------+     +-----+            +-----+     +---------+
         |Device|-->--|Relay|-->--..-->--|Relay|-->--|Collector|
         +------+     +-----+            +-----+     +---------+

         +------+         +-----+         +---------+
         |Device|---->----|Relay|---->----|Collector|
         |      |-\       +-----+         +---------+
         +------+  \
                    \      +-----+         +---------+
                     \-->--|Relay|---->----|Collector|
                           +-----+         +---------+

         +------+         +---------+
         |Device|---->----|Collector|
         |      |-\       +---------+
         +------+  \
                    \      +-----+         +---------+
                     \-->--|Relay|---->----|Collector|
                           +-----+         +---------+

         +------+         +-----+            +---------+
         |Device|---->----|Relay|---->-------|Collector|
         |      |-\       +-----+         /--|         |
         +------+  \                     /   +---------+
                    \      +-----+      /
                     \-->--|Relay|-->--/
                           +-----+

           Diagram 1.  Some Possible syslog Architectures

4. Packet Format and Contents

   The payload of any IP packet that has a UDP destination port of 514
   MUST be treated as a syslog message.  There MAY be differences
   between the format of an originally transmitted syslog message and
   the format of a relayed message.  In essence, it is RECOMMENDED to
   transmit a syslog message in the format specified in this document,
   but it is not required.  If a relay is able to recognize the message
   as adhering to that format then it MUST retransmit the message
   without making any changes to it.  However, if a relay receives a



Lonvick                      Informational                      [Page 7]

RFC 3164                The BSD syslog Protocol              August 2001


   message but cannot discern the proper implementation of the format,
   it is REQUIRED to modify the message so that it conforms to that
   format before it retransmits it.  Section 4.1 will describe the
   RECOMMENDED format for syslog messages.  Section 4.2 will describe
   the requirements for originally transmitted messages and Section 4.3
   will describe the requirements for relayed messages.

4.1 syslog Message Parts

   The full format of a syslog message seen on the wire has three
   discernable parts.  The first part is called the PRI, the second part
   is the HEADER, and the third part is the MSG.  The total length of
   the packet MUST be 1024 bytes or less.  There is no minimum length of
   the syslog message although sending a syslog packet with no contents
   is worthless and SHOULD NOT be transmitted.

4.1.1 PRI Part

   The PRI part MUST have three, four, or five characters and will be
   bound with angle brackets as the first and last characters.  The PRI
   part starts with a leading "<" ('less-than' character), followed by a
   number, which is followed by a ">" ('greater-than' character). The
   code set used in this part MUST be seven-bit ASCII in an eight-bit
   field as described in RFC 2234 [2].  These are the ASCII codes as
   defined in "USA Standard Code for Information Interchange" [3].  In
   this, the "<" character is defined as the Augmented Backus-Naur Form
   (ABNF) %d60, and the ">" character has ABNF value %d62.  The number
   contained within these angle brackets is known as the Priority value
   and represents both the Facility and Severity as described below.
   The Priority value consists of one, two, or three decimal integers
   (ABNF DIGITS) using values of %d48 (for "0") through %d57 (for "9").

   The Facilities and Severities of the messages are numerically coded
   with decimal values.  Some of the operating system daemons and
   processes have been assigned Facility values.  Processes and daemons
   that have not been explicitly assigned a Facility may use any of the
   "local use" facilities or they may use the "user-level" Facility.
   Those Facilities that have been designated are shown in the following
   table along with their numerical code values.

       Numerical             Facility
          Code

           0             kernel messages
           1             user-level messages
           2             mail system
           3             system daemons
           4             security/authorization messages (note 1)



Lonvick                      Informational                      [Page 8]

RFC 3164                The BSD syslog Protocol              August 2001


           5             messages generated internally by syslogd
           6             line printer subsystem
           7             network news subsystem
           8             UUCP subsystem
           9             clock daemon (note 2)
          10             security/authorization messages (note 1)
          11             FTP daemon
          12             NTP subsystem
          13             log audit (note 1)
          14             log alert (note 1)
          15             clock daemon (note 2)
          16             local use 0  (local0)
          17             local use 1  (local1)
          18             local use 2  (local2)
          19             local use 3  (local3)
          20             local use 4  (local4)
          21             local use 5  (local5)
          22             local use 6  (local6)
          23             local use 7  (local7)

           Table 1.  syslog Message Facilities

        Note 1 - Various operating systems have been found to utilize
           Facilities 4, 10, 13 and 14 for security/authorization,
           audit, and alert messages which seem to be similar.
        Note 2 - Various operating systems have been found to utilize
           both Facilities 9 and 15 for clock (cron/at) messages.

   Each message Priority also has a decimal Severity level indicator.
   These are described in the following table along with their numerical
   values.

        Numerical         Severity
          Code

           0       Emergency: system is unusable
           1       Alert: action must be taken immediately
           2       Critical: critical conditions
           3       Error: error conditions
           4       Warning: warning conditions
           5       Notice: normal but significant condition
           6       Informational: informational messages
           7       Debug: debug-level messages

           Table 2. syslog Message Severities






Lonvick                      Informational                      [Page 9]

RFC 3164                The BSD syslog Protocol              August 2001


   The Priority value is calculated by first multiplying the Facility
   number by 8 and then adding the numerical value of the Severity. For
   example, a kernel message (Facility=0) with a Severity of Emergency
   (Severity=0) would have a Priority value of 0.  Also, a "local use 4"
   message (Facility=20) with a Severity of Notice (Severity=5) would
   have a Priority value of 165.  In the PRI part of a syslog message,
   these values would be placed between the angle brackets as <0> and
   <165> respectively.  The only time a value of "0" will follow the "<"
   is for the Priority value of "0". Otherwise, leading "0"s MUST NOT be
   used.

4.1.2 HEADER Part of a syslog Packet

   The HEADER part contains a timestamp and an indication of the
   hostname or IP address of the device.  The HEADER part of the syslog
   packet MUST contain visible (printing) characters.  The code set used
   MUST also be seven-bit ASCII in an eight-bit field like that used in
   the PRI part.  In this code set, the only allowable characters are
   the ABNF VCHAR values (%d33-126) and spaces (SP value %d32).

   The HEADER contains two fields called the TIMESTAMP and the HOSTNAME.
   The TIMESTAMP will immediately follow the trailing ">" from the PRI
   part and single space characters MUST follow each of the TIMESTAMP
   and HOSTNAME fields.  HOSTNAME will contain the hostname, as it knows
   itself.  If it does not have a hostname, then it will contain its own
   IP address.  If a device has multiple IP addresses, it has usually
   been seen to use the IP address from which the message is
   transmitted.  An alternative to this behavior has also been seen.  In
   that case, a device may be configured to send all messages using a
   single source IP address regardless of the interface from which the
   message is sent.  This will provide a single consistent HOSTNAME for
   all messages sent from a device.

   The TIMESTAMP field is the local time and is in the format of "Mmm dd
   hh:mm:ss" (without the quote marks) where:

         Mmm is the English language abbreviation for the month of the
         year with the first character in uppercase and the other two
         characters in lowercase.  The following are the only acceptable
         values:

         Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

         dd is the day of the month.  If the day of the month is less
         than 10, then it MUST be represented as a space and then the
         number.  For example, the 7th day of August would be
         represented as "Aug  7", with two spaces between the "g" and
         the "7".



Lonvick                      Informational                     [Page 10]

RFC 3164                The BSD syslog Protocol              August 2001


         hh:mm:ss is the local time.  The hour (hh) is represented in a
         24-hour format.  Valid entries are between 00 and 23,
         inclusive.  The minute (mm) and second (ss) entries are between
         00 and 59 inclusive.

   A single space character MUST follow the TIMESTAMP field.

   The HOSTNAME field will contain only the hostname, the IPv4 address,
   or the IPv6 address of the originator of the message.  The preferred
   value is the hostname.  If the hostname is used, the HOSTNAME field
   MUST contain the hostname of the device as specified in STD 13 [4].
   It should be noted that this MUST NOT contain any embedded spaces.
   The Domain Name MUST NOT be included in the HOSTNAME field.  If the
   IPv4 address is used, it MUST be shown as the dotted decimal notation
   as used in STD 13 [5].  If an IPv6 address is used, any valid
   representation used in RFC 2373 [6] MAY be used.  A single space
   character MUST also follow the HOSTNAME field.

4.1.3 MSG Part of a syslog Packet

   The MSG part will fill the remainder of the syslog packet.  This will
   usually contain some additional information of the process that
   generated the message, and then the text of the message.  There is no
   ending delimiter to this part.  The MSG part of the syslog packet
   MUST contain visible (printing) characters.  The code set
   traditionally and most often used has also been seven-bit ASCII in an
   eight-bit field like that used in the PRI and HEADER parts.  In this
   code set, the only allowable characters are the ABNF VCHAR values
   (%d33-126) and spaces (SP value %d32).  However, no indication of the
   code set used within the MSG is required, nor is it expected.  Other
   code sets MAY be used as long as the characters used in the MSG are
   exclusively visible characters and spaces similar to those described
   above.  The selection of a code set used in the MSG part SHOULD be
   made with thoughts of the intended receiver.  A message containing
   characters in a code set that cannot be viewed or understood by a
   recipient will yield no information of value to an operator or
   administrator looking at it.

   The MSG part has two fields known as the TAG field and the CONTENT
   field.  The value in the TAG field will be the name of the program or
   process that generated the message.  The CONTENT contains the details
   of the message.  This has traditionally been a freeform message that
   gives some detailed information of the event.  The TAG is a string of
   ABNF alphanumeric characters that MUST NOT exceed 32 characters.  Any
   non-alphanumeric character will terminate the TAG field and will be
   assumed to be the starting character of the CONTENT field.  Most
   commonly, the first character of the CONTENT field that signifies the




Lonvick                      Informational                     [Page 11]

RFC 3164                The BSD syslog Protocol              August 2001


   conclusion of the TAG field has been seen to be the left square
   bracket character ("["), a colon character (":"), or a space
   character.  This is explained in more detail in Section 5.3.

4.2 Original syslog Packets Generated by a Device

   There are no set requirements on the contents of the syslog packet as
   it is originally sent from a device.  It should be reiterated here
   that the payload of any IP packet destined to UDP port 514 MUST be
   considered to be a valid syslog message.  It is, however, RECOMMENDED
   that the syslog packet have all of the parts described in Section 4.1
   - PRI, HEADER and MSG - as this enhances readability by the recipient
   and eliminates the need for a relay to modify the message.

   For implementers that do choose to construct syslog messages with the
   RECOMMENDED format, the following guidance is offered.

         If the originally formed message has a TIMESTAMP in the HEADER
         part, then it SHOULD be the local time of the device within its
         timezone.

         If the originally formed message has a HOSTNAME field, then it
         will contain the hostname as it knows itself.  If it does not
         have a hostname, then it will contain its own IP address.

         If the originally formed message has a TAG value, then that
         will be the name of the program or process that generated the
         message.

4.3 Relayed syslog Packets

   When a relay receives a packet, it will check for a valid PRI.  If
   the first character is not a less-than sign, the relay MUST assume
   that the packet does not contain a valid PRI.  If the 3rd, 4th, or
   5th character is not a right angle bracket character, the relay again
   MUST assume that the PRI was not included in the original message.
   If the relay does find a valid PRI part then it must check for a
   valid TIMESTAMP in the HEADER part.  From these rules, there will be
   three general cases of received messages.  Table 3 gives the general
   characteristics of these cases and lists the subsequent section of
   this document that describes the handling of that case.

              Case                                         Section
         Valid PRI and TIMESTAMP                            4.3.1
         Valid PRI but no TIMESTAMP or invalid TIMESTAMP    4.3.2
         No PRI or unidentifiable PRI                       4.3.3

              Table 3. Cases of Received syslog Messages



Lonvick                      Informational                     [Page 12]

RFC 3164                The BSD syslog Protocol              August 2001


4.3.1 Valid PRI and TIMESTAMP

   If the relay does find a valid PRI and a valid TIMESTAMP, then it
   will check its internal configuration.  Relays MUST be configured to
   forward syslog packets on the basis of their Priority value.  If the
   relay finds that it is configured to forward the received packet,
   then it MUST do so without making any changes to the packet.  To
   emphasize the point one more time, it is for this reason that it is
   RECOMMENDED that the syslog message originally transmitted adhere to
   the format described in Section 4.1.

   It should be noted here that the message receiver does not need to
   validate the time in the TIMESTAMP field.  The assumption may be made
   that a device whose date has not been correctly set will still have
   the ability to send valid syslog messages.  Additionally, the relay
   does not need to validate that the value in the HOSTNAME field
   matches the hostname or IP address of the device sending the message.
   A reason for this behavior may be found in Section 4.1.2.

4.3.2 Valid PRI but no TIMESTAMP or invalid TIMESTAMP

   If a relay does not find a valid TIMESTAMP in a received syslog
   packet, then it MUST add a TIMESTAMP and a space character
   immediately after the closing angle bracket of the PRI part.  It
   SHOULD additionally add a HOSTNAME and a space character after the
   TIMESTAMP.  These fields are described here and detailed in Section
   4.1.2.  The remainder of the received packet MUST be treated as the
   CONTENT field of the MSG and appended.  Since the relay would have no
   way to determine the originating process from the device that
   originated the message, the TAG value cannot be determined and will
   not be included.

   The TIMESTAMP will be the current local time of the relay.

   The HOSTNAME will be the name of the device, as it is known by the
   relay.  If the name cannot be determined, the IP address of the
   device will be used.

   If the relay adds a TIMESTAMP, or a TIMESTAMP and HOSTNAME, after the
   PRI part, then it MUST check that the total length of the packet is
   still 1024 bytes or less.  If the packet has been expanded beyond
   1024 bytes, then the relay MUST truncate the packet to be 1024 bytes.
   This may cause the loss of vital information from the end of the
   original packet.  It is for this reason that it is RECOMMENDED that
   the PRI and HEADER parts of originally generated syslog packets
   contain the values and fields documented in Section 4.1.





Lonvick                      Informational                     [Page 13]

RFC 3164                The BSD syslog Protocol              August 2001


4.3.3 No PRI or Unidentifiable PRI

   If the relay receives a syslog message without a PRI, or with an
   unidentifiable PRI, then it MUST insert a PRI with a Priority value
   of 13 as well as a TIMESTAMP as described in Section 4.3.2.  The
   relay SHOULD also insert a HOSTNAME as described in Section 4.3.2.
   The entire contents of the received packet will be treated as the
   CONTENT of the relayed MSG and appended.

   An example of an unidentifiable PRI would be "<00>", without the
   double quotes.  It may be that these are the first 4 characters of
   the message.  To continue this example, if a relay does receive a
   syslog message with the first four characters of "<00>", then it will
   consult its configuration.  If it is configured to forward syslog
   messages with a Priority value of 13 to another relay or collector,
   then it MUST modify the packet as described above.  The specifics of
   doing this, including the RECOMMENDED insertion of the HOSTNAME, are
   given below.

   Originally received message
     <00>...
   Relayed message
     <13>TIMESTAMP HOSTNAME <00>...

   If the relay adds a TIMESTAMP, or a TIMESTAMP and HOSTNAME, after the
   PRI part, then it MUST check that the total length of the packet is
   still 1024 bytes or less.  If the packet has been expanded beyond
   1024 bytes, then the relay MUST truncate the packet to be 1024 bytes.
   This may cause the loss of vital information from the end of the
   original packet.  It is for this reason that it is RECOMMENDED that
   the PRI and HEADER parts of originally generated syslog packets
   contain the values and fields documented in Section 4.1.

5. Conventions

   Although Section 4 of this document specifies all requirements for
   the syslog protocol format and contents, certain conventions have
   come about over time for the inclusion of additional information
   within the syslog message.  It must be plainly stated that these
   items are not mandated but may be considered by implementers for
   completeness and to give the recipient some additional clues of their
   origin and nature.









Lonvick                      Informational                     [Page 14]

RFC 3164                The BSD syslog Protocol              August 2001


5.1 Dates and Times

   It has been found that some network administrators like to archive
   their syslog messages over long periods of time.  It has been seen
   that some original syslog messages contain a more explicit time stamp
   in which a 2 character or 4 character year field immediately follows
   the space terminating the TIMESTAMP.  This is not consistent with the
   original intent of the order and format of the fields.  If
   implementers wish to contain a more specific date and time stamp
   within the transmitted message, it should be within the CONTENT
   field.  Implementers may wish to utilize the ISO 8601 [7] date and
   time formats if they want to include more explicit date and time
   information.

   Additional methods to address this desire for long-term archiving
   have been proposed and some have been successfully implemented.  One
   such method is that the network administrators may choose to modify
   the messages stored on their collectors.  They may run a simple
   script to add the year, and any other information, to each stored
   record.  Alternatively, the script may replace the stored time with a
   format more appropriate for the needs of the network administrators.
   Another alternative has been to insert a record into the file that
   contains the current year.  By association then, all other records
   near that informative record should have been received in that same
   year.  Neither of these however, addresses the issue of associating a
   correct timezone with each record.

5.2 Domain Name and Address

   To readily identify the device that originated the message, it may be
   a good practice to include its fully qualified domain name (FQDN) and
   its IP address within the CONTENT field.  Traditionally, however,
   only the hostname has been included in the HOSTNAME field.

5.3 Originating Process Information

   It has also been considered to be a good practice to include some
   information about the process on the device that generated the
   message - if that concept exists.  This is usually the process name
   and process id (often known as the "pid") for robust operating
   systems.  The process name is commonly displayed in the TAG field.
   Quite often, additional information is included at the beginning of
   the CONTENT field.  The format of "TAG[pid]:" - without the quote
   marks - is common.  The left square bracket is used to terminate the
   TAG field in this case and is then the first character in the CONTENT
   field.  If the process id is immaterial, it may be left off.





Lonvick                      Informational                     [Page 15]

RFC 3164                The BSD syslog Protocol              August 2001


   In that case, a colon and a space character usually follow the TAG.
   This would be displayed as "TAG: " without the quotes.  In that case,
   the colon is the first character in the CONTENT field.

5.4 Examples

   As examples, these are valid messages as they may be observed on the
   wire between two devices.  In the following examples, each message
   has been indented, with line breaks inserted in this document for
   readability.

        Example 1

        <34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick
        on /dev/pts/8

   This example shows an authentication error in an attempt to acquire
   additional privileges.  It also shows the command attempted and the
   user attempting it.  This was recorded as an original message from
   the device called mymachine.  A relay receiving this would not make
   any changes before sending it along as it contains a properly
   formatted PRI part and TIMESTAMP field in the HEADER part.  The TAG
   value in this example is the process "su".  The colon has terminated
   the TAG field and is the first character of the CONTENT field.  In
   this case, the process id (pid) would be considered transient and
   anyone looking at this syslog message would gain no useful
   information from knowing the pid.  It has not been included so the
   first two characters of the CONTENT field are the colon and a space
   character.

        Example 2

        Use the BFG!

   While this is a valid message, it has extraordinarily little useful
   information.  This message does not have any discernable PRI part. It
   does not contain a timestamp or any indication of the source of the
   message.  If this message is stored on paper or disk, subsequent
   review of the message will not yield anything of value.

   This example is obviously an original message from a device.  A relay
   MUST make changes to the message as described in Section 4.3 before
   forwarding it.  The resulting relayed message is shown below.

        <13>Feb  5 17:32:18 10.0.0.99 Use the BFG!






Lonvick                      Informational                     [Page 16]

RFC 3164                The BSD syslog Protocol              August 2001


   In this relayed message, the entire message has been treated as the
   CONTENT portion of the MSG part.  First, a valid PRI part has been
   added using the default priority value of 13.  Next, a TIMESTAMP has
   been added along with a HOSTNAME in the HEADER part.  Subsequent
   relays will not make any further changes to this message.  It should
   be noted in this example that the day of the month is less than 10.
   Since single digits in the date (5 in this case) are preceded by a
   space in the TIMESTAMP format, there are two spaces following the
   month in the TIMESTAMP before the day of the month.  Also, the relay
   appears to have no knowledge of the host name of the device sending
   the message so it has inserted the IPv4 address of the device into
   the HOSTNAME field.

        Example 3

         <165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]: %% It's
         time to make the do-nuts.  %%  Ingredients: Mix=OK, Jelly=OK #
         Devices: Mixer=OK, Jelly_Injector=OK, Frier=OK # Transport:
         Conveyer1=OK, Conveyer2=OK # %%

   This message does have a valid PRI part with a Priority value
   indicating that it came from a locally defined facility (local4) with
   a severity of Notice.  The HEADER part has a proper TIMESTAMP field
   in the message.  A relay will not modify this message before sending
   it.  However, the HOSTNAME and TAG fields are not consistent with the
   definitions in Section 4.  The HOSTNAME field would be construed to
   be "CST" and the beginning of the MSG part would be "1987".

   It should be noted that the information contained in the CONTENT of
   this example is not telemetry data, nor is it supervisory control or
   data acquisition information.  Due to the security concerns listed in
   Section 6 of this document, information of that nature should
   probably not be conveyed across this protocol.

        Example 4

         <0>1990 Oct 22 10:52:01 TZ-6 scapegoat.dmz.example.org 10.1.2.3
         sched[0]: That's All Folks!

   This example has a lot of extraneous information throughout.  A human
   or sufficiently adaptable automated parser would be able to determine
   the date and time information as well as a fully qualified domain
   name (FQDN) [4] and IP address.  The information about the nature of
   the event is, however, limited.  Due to the indicated severity of the
   event, the process may not have been able to gather or send anything
   more informative.  It may have been fortunate to have generated and
   sent this message at all.




Lonvick                      Informational                     [Page 17]

RFC 3164                The BSD syslog Protocol              August 2001


   This example is obviously an original message from a device.  Since
   the first field in the HEADER part is not a TIMESTAMP in the format
   defined in Section 4.1.2, it MUST be modified by a relay.  A relay
   will add a TIMESTAMP and SHOULD add a HOSTNAME as follows and will
   treat the entire received packet after the PRI part from the original
   packet as the CONTENT field of the new packet.  The value used in the
   HOSTNAME field is only the hostname without the domain name as it is
   known by the relay.  A TAG value will not be added to the relayed
   packet.  While the inclusion of the domain name and IPv4 address in
   the original message is a noble endeavor, it is not consistent with
   the use of the field as described in Section 4.1.2.

         <0>Oct 22 10:52:12 scapegoat 1990 Oct 22 10:52:01 TZ-6
         scapegoat.dmz.example.org 10.1.2.3 sched[0]: That's All Folks!

6. Security Considerations

   An odor may be considered to be a message that does not require any
   acknowledgement.  People tend to avoid bad odors but are drawn to
   odors that they associate with good food.  The acknowledgement of the
   receipt of the odor or scent is not required and indeed it may be the
   height of discretion to totally ignore some odors.  On the other
   hand, it is usually considered good civility to acknowledge the
   prowess of the cook merely from the ambiance wafting from the
   kitchen.  Similarly, various species have been found to utilize odors
   to attract mates.  One species of moth uses this scent to find each
   other.  However, it has been found that bolas spiders can mimic the
   odor of the female moths of this species.  This scent will then
   attract male moths, which will follow it with the expectation of
   finding a mate.  Instead, when they arrive at the source of the
   scent, they will be eaten [8].  This is a case of a false message
   being sent out with inimical intent.

   In its local use, the syslog process places event notification
   messages into files on that system.  This relies upon the integrity
   of the system for the protection of the messages.  The subsequent
   configuration of the syslog process to use the syslog protocol to
   transport the messages to a remote collector was an extension of the
   delivery of event notification messages and it exhibits the same
   trust of the network.  There are several security consequences of the
   fundamental simplicity of syslog and there are some concerns about
   the applicability of this protocol in situations that require robust
   delivery.  Along the lines of the analogy, computer event messages
   may be sent accidentally, erroneously and even maliciously. At the
   time of this writing, however, there have not been any reports of any
   networked device consuming any other device.





Lonvick                      Informational                     [Page 18]

RFC 3164                The BSD syslog Protocol              August 2001


6.1 Packet Parameters

   As was described above, the message length MUST NOT exceed 1024
   bytes.  Attacks have seen where syslog messages are sent to a
   receiver that have message lengths greater than 1024 bytes.  In some
   older versions of syslog, the receipt of syslog packets that had a
   message greater than 1024 bytes caused problems.  syslog message
   receivers must not malfunction upon the receipt of packets where the
   message length is greater than 1024 bytes.  Various behaviors have
   been seen on receivers that do receive messages greater than 1024
   bytes.  Some have been seen to log the entire contents of the
   message, while others have been seen to log only portions of the
   message.  Still others have been known to discard the message
   altogether.  Devices MUST NOT retransmit messages whose received
   length exceeds 1024 bytes.

   Similarly, the receiver must rigidly enforce the correctness of the
   message body.  syslog collectors must not malfunction if received
   messages do not have the less-than and greater-than characters around
   a valid Priority value.  They MUST treat these messages as the
   unformatted CONTENT as was described in Section 4.3.3 if they relay
   it.

   Also, received messages must contain printable text in the message as
   was described throughout Section 4.  Devices must not malfunction if
   they receive a message containing characters other than the
   characters described above.

6.2 Message Authenticity

   The syslog delivery mechanism does not strongly associate the message
   with the message sender.  The receiver of that packet will not be
   able to ascertain that the message was indeed sent from the reported
   sender, or if the packet was sent from another device.  It should be
   noted here that the message receiver does not need to verify that the
   HOSTNAME in the HEADER part match the name of the IP address
   contained in the Source Address field of the IP packet.

6.2.1 Authentication Problems

   One possible consequence of this behavior is that a misconfigured
   machine may send syslog messages to a collector representing itself
   as another machine.  The administrative staff may become confused
   that the status of the supposed sender of the messages may not be
   accurately reflected in the received messages.  The administrators
   may not be able to readily discern that there are two or more
   machines representing themselves as the same machine.




Lonvick                      Informational                     [Page 19]

RFC 3164                The BSD syslog Protocol              August 2001


   It should also be noted that some cases of filling the HOSTNAME field
   in the HEADER part might only have local significance and that may
   only be ephemeral.  If the device had obtained an IP address from a
   DHCP pool, then any association between an identifier and an actual
   source would not always hold true.  The inclusion of a fully
   qualified domain name in the CONTENT may give the administrators the
   best chance of identifying the source of each message if it can
   always be associated with an IP address or if it can always be
   associated with a unique machine.

6.2.2 Message Forgery

   Malicious exploits of this behavior have also been noted.  An
   attacker may transmit syslog messages (either from the machine from
   which the messages are purportedly sent or from any other machine) to
   a collector.  In one case, an attacker may hide the true nature of an
   attack amidst many other messages.  As an example, an attacker may
   start generating forged messages indicating a problem on some
   machine.  This may get the attention of the system administrators who
   will spend their time investigating the alleged problem.  During this
   time, the attacker may be able to compromise a different machine, or
   a different process on the same machine.  Additionally, an attacker
   may generate false syslog messages to give untrue indications of
   status or of events.  As an example, an attacker may stop a critical
   process on a machine, which may generate a notification of exit.  The
   attacker may subsequently generate a forged notification that the
   process had been restarted.  The system administrators may accept
   that misinformation and not verify that the process had indeed been
   restarted.

6.3 Sequenced Delivery

   As a general rule, the forensics of a network anomaly rely upon
   reconstructing the sequence of events.  In a perfect world, the
   messages would be received on the syslog collector in the order of
   their generation from the other devices and anyone looking at these
   records would have an accurate picture of the sequence of events.
   Unfortunately, the syslog process and protocol do not ensure ordered
   delivery.  This section details some of the problems that may be
   encountered from this.

6.3.1 Single Source to a Destination

   The syslog records are usually presented (placed in a file, displayed
   on the console, etc.) in the order in which they are received.  This
   is not always in accordance with the sequence in which they were
   generated.  As they are transported across an IP network, some out of
   order receipt should be expected.  This may lead to some confusion as



Lonvick                      Informational                     [Page 20]

RFC 3164                The BSD syslog Protocol              August 2001


   messages may be received that would indicate that a process has
   stopped before it was started.  This may be somewhat rectified if the
   originating process had timestamped or numbered each of the messages
   before transmission.  In this, the sending device should utilize an
   authoritative time source.  It should be remembered, however, that
   not all devices are capable of receiving time updates, and not all
   devices can timestamp their messages.

6.3.2 Multiple Sources to a Destination

   In syslog, there is no concept of unified event numbering.  Single
   devices are free to include a sequence number within the CONTENT but
   that can hardly be coordinated between multiple devices.  In such
   cases, multiple devices may report that each one is sending message
   number one.  Again, this may be rectified somewhat if the sending
   devices utilize a timestamp from an authoritative source in their
   messages.  As has been noted, however, even messages from a single
   device to a single collector may be received out of order.  This
   situation is compounded when there are several devices configured to
   send their syslog messages to a single collector.  Messages from one
   device may be delayed so the collector receives messages from another
   device first even though the messages from the first device were
   generated before the messages from the second.  If there is no
   timestamp or coordinated sequence number, then the messages may be
   presented in the order in which they were received which may give an
   inaccurate view of the sequence of actual events.

6.3.3 Multiple Sources to Multiple Destinations

   The plethora of configuration options available to the network
   administrators may further skew the perception of the order of
   events.  It is possible to configure a group of devices to send the
   status messages -or other informative messages- to one collector,
   while sending messages of relatively higher importance to another
   collector.  Additionally, the messages may be sent to different files
   on the same collector.  If the messages do not contain timestamps
   from the source, it may be difficult to order the messages if they
   are kept in different places.  An administrator may not be able to
   determine if a record in one file occurred before or after a record
   in a different file.  This may be somewhat alleviated by placing
   marking messages with a timestamp into all destination files.  If
   these have coordinated timestamps, then there will be some indication
   of the time of receipt of the individual messages.








Lonvick                      Informational                     [Page 21]

RFC 3164                The BSD syslog Protocol              August 2001


6.3.4 Replaying

   Without any sequence indication or timestamp, messages may be
   recorded and replayed at a later time.  An attacker may record a set
   of messages that indicate normal activity of a machine.  At a later
   time, that attacker may remove that machine from the network and
   replay the syslog messages to the collector.  Even with a TIMESTAMP
   field in the HEADER part, an attacker may record the packets and
   could simply modify them to reflect the current time before
   retransmitting them.  The administrators may find nothing unusual in
   the received messages and their receipt would falsely indicate normal
   activity of the machine.

6.4 Reliable Delivery

   As there is no mechanism within either the syslog process or the
   protocol to ensure delivery, and since the underlying transport is
   UDP, some messages may be lost.  They may either be dropped through
   network congestion, or they may be maliciously intercepted and
   discarded.  The consequences of the drop of one or more syslog
   messages cannot be determined.  If the messages are simple status
   updates, then their non-receipt may either not be noticed, or it may
   cause an annoyance for the system operators.  On the other hand, if
   the messages are more critical, then the administrators may not
   become aware of a developing and potentially serious problem.
   Messages may also be intercepted and discarded by an attacker as a
   way to hide unauthorized activities.

6.5 Message Integrity

   Besides being discarded, syslog messages may be damaged in transit,
   or an attacker may maliciously modify them.  In the case of a packet
   containing a syslog message being damaged, there are various
   mechanisms built into the link layer as well as into the IP [9] and
   UDP protocols which may detect the damage.  An intermediary router
   may discard a damaged IP packet [10].  Damage to a UDP packet may be
   detected by the receiving UDP module, which may silently discard it.
   In any case, the original contents of the message will not be
   delivered to the collector.  Additionally, if an attacker is
   positioned between the sender and collector of syslog messages, they
   may be able to intercept and modify those messages while in-transit
   to hide unauthorized activities.

6.6 Message Observation

   While there are no strict guidelines pertaining to the event message
   format, most syslog messages are generated in human readable form
   with the assumption that capable administrators should be able to



Lonvick                      Informational                     [Page 22]

RFC 3164                The BSD syslog Protocol              August 2001


   read them and understand their meaning.  Neither the syslog protocol
   nor the syslog application have mechanisms to provide confidentiality
   of the messages in transit.  In most cases passing clear-text
   messages is a benefit to the operations staff if they are sniffing
   the packets off of the wire.  The operations staff may be able to
   read the messages and associate them with other events seen from
   other packets crossing the wire to track down and correct problems.
   Unfortunately, an attacker may also be able to observe the human-
   readable contents of syslog messages.  The attacker may then use the
   knowledge gained from those messages to compromise a machine or do
   other damage.

6.7 Message Prioritization and Differentiation

   While the processes that create the messages may signify the
   importance of the events through the use of the message Priority
   value, there is no distinct association between this value and the
   importance of delivery of the packet.  As an example of this,
   consider an application that generates two event messages.  The first
   is a normal status message but the second could be an important
   message denoting a problem with the process.  This second message
   would have an appropriately higher Severity value associated with the
   importance of that event.  If the operators had configured that both
   of these messages be transported to a syslog collector then they
   would, in turn, be given to UDP for transmission.  Under normal
   conditions, no distinction would be made between them and they would
   be transmitted in their order.

   Again, under normal circumstances, the receiver would accept syslog
   messages as they are received.  If many devices are transmitting
   normal status messages, but one is transmitting an important event
   message, there is no inherent mechanism within the syslog protocol to
   prioritize the important message over the other messages.

   On a case-by-case basis, device operators may find some way to
   associate the different levels with the quality of service
   identifiers.  As an example, the operators may elect to define some
   linkage between syslog messages that have a specific Priority value
   with a specific value to be used in the IPv4 Precedence field [9],
   the IPv6 Traffic Class octet [11], or the Differentiated Services
   field [12].  In the above example, the operators may have the ability
   to associate the status message with normal delivery while
   associating the message indicating a problem with a high reliability,
   low latency queue as it goes through the network.  This would have
   the affect of prioritizing the essential messages before the normal
   status messages.  Even with this hop-by-hop prioritization, this
   queuing mechanism could still lead to head of line blocking on the
   transmitting device as well as buffer starvation on the receiving



Lonvick                      Informational                     [Page 23]

RFC 3164                The BSD syslog Protocol              August 2001


   device if there are many near-simultaneous messages being sent or
   received.  This behavior is not unique to syslog but is endemic to
   all operations that transmit messages serially.

   There are security concerns for this behavior.  Head of line blocking
   of the transmission of important event messages may relegate the
   conveyance of important messages behind less important messages.  If
   the queue is cleared appropriately, this may only add seconds to the
   transmission of the important message.  On the other hand, if the
   queue is not cleared, then important messages may not be transmitted.
   Also at the receiving side, if the syslog receiver is suffering from
   buffer starvation due to large numbers of messages being received
   near-simultaneously, important messages may be dropped
   indiscriminately along with other messages.  While these are problems
   with the devices and their capacities, the protocol security concern
   is that there is no prioritization of the relatively more important
   messages over the less important messages.

6.8 Misconfiguration

   Since there is no control information distributed about any messages
   or configurations, it is wholly the responsibility of the network
   administrator to ensure that the messages are actually going to the
   intended recipient.  Cases have been noted where devices were
   inadvertently configured to send syslog messages to the wrong
   receiver.  In many cases, the inadvertent receiver may not be
   configured to receive syslog messages and it will probably discard
   them.  In certain other cases, the receipt of syslog messages has
   been known to cause problems for the unintended recipient [13].  If
   messages are not going to the intended recipient, then they cannot be
   reviewed or processed.

6.9 Forwarding Loop

   As it is shown in Figure 1, machines may be configured to relay
   syslog messages to subsequent relays before reaching a collector. In
   one particular case, an administrator found that he had mistakenly
   configured two relays to forward messages with certain Priority
   values to each other.  When either of these machines either received
   or generated that type of message, it would forward it to the other
   relay.  That relay would, in turn, forward it back.  This cycle did
   cause degradation to the intervening network as well as to the
   processing availability on the two devices.  Network administrators
   must take care to not cause such a death spiral.







Lonvick                      Informational                     [Page 24]

RFC 3164                The BSD syslog Protocol              August 2001


6.10 Load Considerations

   Network administrators must take the time to estimate the appropriate
   size of the syslog receivers.  An attacker may perform a Denial of
   Service attack by filling the disk of the collector with false
   messages.  Placing the records in a circular file may alleviate this
   but that has the consequence of not ensuring that an administrator
   will be able to review the records in the future. Along this line, a
   receiver or collector must have a network interface capable of
   receiving all messages sent to it.

   Administrators and network planners must also critically review the
   network paths between the devices, the relays, and the collectors.
   Generated syslog messages should not overwhelm any of the network
   links.

7. IANA Considerations

   The syslog protocol has been assigned UDP port 514.  This port
   assignment will be maintained by IANA exclusively for this protocol.

   The syslog protocol provides for the definition of named attributes
   to indicate the Severity of each message and the Facility that
   generated the message as described in Section 4.  The name space
   identifiers for these attributes are defined as numbers.  The
   protocol does not define the specific assignment of the name space
   for these numbers; the application developer or system vendor is
   allowed to define the attribute, its semantics, and the associated
   numbers.  This name space will not be controlled to prevent
   collisions as systems are expected to use the same attributes,
   semantics and associated numbers to describe events that are deemed
   similar even between heterogeneous devices.

8. Conclusion and Other Efforts

   The syslog protocol may be effectively used to transport event
   notification messages across a network.  In all cases, it is
   important that the syslog message receiver embody the principle of
   "be liberal in what you accept".  It is highly recommended that the
   network operators who choose to use this understand the
   characteristics of the protocol and its security implications.

   There have been attempts in the past to standardize the format of the
   syslog message.  The most notable attempt culminated in a BOF at the
   Fortieth Internet Engineering Task Force meeting in 1997.  This was
   the Universal Logging Protocol (ulp) BOF and the minutes of their
   meeting are on-line at the IETF Proceedings web site [14].




Lonvick                      Informational                     [Page 25]

RFC 3164                The BSD syslog Protocol              August 2001


   Many good thoughts came from that effort and interested implementers
   may want to find some of the notes or papers produced from that
   effort.

   At the time of this writing, efforts are underway to allow the usage
   of international character sets in applications that have been
   traditionally thought of as being text-only.  The HOSTNAME and
   TIMESTAMP fields described above are representative of this.  Also,
   the entire CONTENT field has traditionally been printing characters
   and spaces in the code set known as US-ASCII.  It is hoped that the
   proponents of these internationalization efforts will find a suitable
   way to allow the use of international character sets within syslog
   messages without being disruptive.  It should also be hoped that
   implementers will allow for the future acceptance of additional code
   sets and that they may make appropriate plans.  Again, it must be
   cautioned that the simplicity of the existing system has been a
   tremendous value to its acceptance.  Anything that lessens that
   simplicity may diminish that value.

Acknowledgements

   The following people provided content feedback during the writing of
   this document:

         Jon Knight <J.P.Knight@lboro.ac.uk>
         Magosanyi Arpad <mag@bunuel.tii.matav.hu>
         Balazs Scheidler <bazsi@balabit.hu>
         Jon Callas <jon@counterpane.com>
         Eliot Lear <lear@cisco.com>
         Petter Reinholdtsen <pere@hungry.com>
         Darren Reed <darrenr@reed.wattle.id.au>
         Alfonso De Gregorio <dira@speedcom.it>
         Eric Allman <eric@sendmail.com>
         Andrew Ross <andrew@kiwi-enterprises.com>
         George Maslyar <george.maslyar@primark.com>
         Albert Mietus <albert@ons-huis.net>
         Russ Allbery <rra@stanford.edu>
         Titus D. Winters <titus@cs.hmc.edu>
         Edwin P. Boon <Edwin.Boon@consul.com>
         Jeroen M. Mostert <Jeroen.Mostert@consul.com>

   Eric Allman is the original inventor and author of the syslog daemon
   and protocol.  The author of this memo and the community at large
   would like to express their appreciation for this work and for the
   usefulness that it has provided over the years.






Lonvick                      Informational                     [Page 26]

RFC 3164                The BSD syslog Protocol              August 2001


   A large amount of additional information about this de-facto standard
   operating system feature may usually be found in the syslog.conf file
   as well as in the man pages for syslog.conf, syslog, syslogd, and
   logger, of many Unix and Unix-like devices.

References

   1  Postel, J., "User Datagram Protocol", STD 6, RFC 768, August 1980.

   2  Crocker, D. and P. Overell, "Augmented BNF for Syntax
      Specifications: ABNF", RFC 2234, November 1997.

   3  USA Standard Code for Information Interchange, USASI X3.4-1968

   4  Mockapetris, P., "Domain Names - Concepts and Facilities", STD 13,
      RFC 1034, November 1987.

   5  Mockapetris, P., "Domain names - Implementation and
      Specification", STD 13, RFC 1035, November 1987.

   6  Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture",
      RFC 2373, July 1998.

   7  Data elements and interchange formats - Information exchange -
      Representation of dates and times, International Organization for
      Standardization, Reference number ISO 8601 : 1988 (E), 1988

   8  Stowe, M., et al, "Chemical Mimicry: Bolas Spiders Emit Components
      of Moth Prey Species Sex Pheromones", Science, 1987

   9  Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.

   10 Baker, F., "Requirements for IP Version 4 Routers", RFC 1812, June
      1995.

   11 Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6)
      Specification", RFC 2460, December 1998.

   12 Nichols, K., Blake, S., Baker, F. and D. Black, "Definition of the
      Differentiated Services Field (DS Field) in the IPv4 and IPv6
      Headers", RFC 2474, December 1998.

   13 Cisco Systems Product Security Incident Response Team (PSIRT),
      "Field Notice: Cisco IOS(r) Syslog Crash", January 11, 1999
      http://www.cisco.com/warp/public/707/advisory.html






Lonvick                      Informational                     [Page 27]

RFC 3164                The BSD syslog Protocol              August 2001


   14 Walker, D., IETF Secretariat, "Proceedings of the Fortieth
      Internet Engineering Task Force, Washington, DC, USA, December 8-
      12, 1997
      http://www.ietf.org/proceedings/97dec/index.html

Author's Address

   Chris Lonvick
   Cisco Systems
   12515 Research Blvd.
   Austin, TX, USA

   Phone:  +1.512.378.1182
   EMail:  clonvick@cisco.com





































Lonvick                      Informational                     [Page 28]

RFC 3164                The BSD syslog Protocol              August 2001


Full Copyright Statement

   Copyright (C) The Internet Society (2001).  All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement

   Funding for the RFC Editor function is currently provided by the
   Internet Society.



















Lonvick                      Informational                     [Page 29]

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         import { AsyncAction } from './AsyncAction';
import { AsyncScheduler } from './AsyncScheduler';

export class AnimationFrameScheduler extends AsyncScheduler {
  public flush(action?: AsyncAction<any>): void {
    this._active = true;
    // The async id that effects a call to flush is stored in _scheduled.
    // Before executing an action, it's necessary to check the action's async
    // id to determine whether it's supposed to be executed in the current
    // flush.
    // Previous implementations of this method used a count to determine this,
    // but that was unsound, as actions that are unsubscribed - i.e. cancelled -
    // are removed from the actions array and that can shift actions that are
    // scheduled to be executed in a subsequent flush into positions at which
    // they are executed within the current flush.
    const flushId = this._scheduled;
    this._scheduled = undefined;

    const { actions } = this;
    let error: any;
    action = action || actions.shift()!;

    do {
      if ((error = action.execute(action.state, action.delay))) {
        break;
      }
    } while ((action = actions[0]) && action.id === flushId && actions.shift());

    this._active = false;

    if (error) {
      while ((action = actions[0]) && action.id === flushId && actions.shift()) {
        action.unsubscribe();
      }
      throw error;
    }
  }
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            